Home » Source Code » H264 Verilog » rec_DF_RAM1_96x32.v

rec_DF_RAM1_96x32.v ( File view )

From:H264 Verilog
  • By culourwq 2016-05-23
  • View(s):0
  • Download(s):2
  • Point(s): 1
			// 
// Copyright (C) 2004 Virtual Silicon Technology Inc.. All Rights Reserved.
// Silicon Ready, The Heart of Great Silicon, and the Virtual Silicon logo are
// registered trademarks of Virtual Silicon Technology Inc.
// All other trademarks are the property of their respective owner.
// 
// Virtual Silicon Technology Inc.
// 1322 Orleans Drive          
// Sunnyvale, CA 94089-1135
// Phone : 408-548-2700
// Fax : 408-548-2750
// Web Site : www.virtual-silicon.com
// 
// VST Library Release: UMCL18G415T3_1.0
// Product:  High Density Single Port SRAM Compiler
// Process:  L180 Generic II
// 
// High Density one-Port RAM 96 words by 32 bits
// column mux = 4
// bytewrite  = n
// test       = n
// powerbus   = b
// frequency  = 10
// 
`timescale 1 ns / 1 ps

`celldefine
module rec_DF_RAM1_96x32 (
  CK,
  CEN,
  WEN,
  OEN,
  ADR,
  DI,
  DOUT
  );

// parameter and port declaration block
  parameter words = 96;
  parameter bits = 32;
  parameter addMsb = 6;
  parameter bytes= 4;
  parameter bitMsb = 31;

  input CK;
  input CEN;
  input WEN;
  input OEN;
  input [addMsb:0] ADR;
  input [bitMsb:0] DI;
  output [bitMsb:0] DOUT;

// input buffer block
  buf (buf_CK, CK);
  buf (buf_CEN, CEN);
  buf (buf_WEN, WEN);
  buf (buf_OEN, OEN);

  wire [addMsb:0] buf_ADR;
  wire [bitMsb:0] buf_DI;
  assign buf_ADR = ADR;
  assign buf_DI = DI;


// internal variable declarations
  reg int_CEN;
  reg int_WEN;
  reg [addMsb:0] int_ADR;
  reg [bitMsb:0] int_DI;
  reg [bitMsb:0] int_DOUT;
  reg [bitMsb:0] memory_array [95:0];

  reg old_CK;
  reg write_error;
  reg read_error;
  reg risingTmp;
  always @(posedge buf_CK)
     risingTmp = 1'b1;
  always @(negedge buf_CK)
     risingTmp = 1'b0;

  wire risingCK = risingTmp;

  wire rflag = risingCK & (buf_WEN!==1'b0);
  wire wflag = risingCK & (buf_WEN!==1'b1);


// DOUT processing
  wire [bitMsb:0] out_DOUT;
  assign out_DOUT = int_DOUT;

  wire int_OEN = buf_OEN;
  bufif0(DOUT[0], out_DOUT[0], int_OEN);
  bufif0(DOUT[1], out_DOUT[1], int_OEN);
  bufif0(DOUT[2], out_DOUT[2], int_OEN);
  bufif0(DOUT[3], out_DOUT[3], int_OEN);
  bufif0(DOUT[4], out_DOUT[4], int_OEN);
  bufif0(DOUT[5], out_DOUT[5], int_OEN);
  bufif0(DOUT[6], out_DOUT[6], int_OEN);
  bufif0(DOUT[7], out_DOUT[7], int_OEN);
  bufif0(DOUT[8], out_DOUT[8], int_OEN);
  bufif0(DOUT[9], out_DOUT[9], int_OEN);
  bufif0(DOUT[10], out_DOUT[10], int_OEN);
  bufif0(DOUT[11], out_DOUT[11], int_OEN);
  bufif0(DOUT[12], out_DOUT[12], int_OEN);
  bufif0(DOUT[13], out_DOUT[13], int_OEN);
  bufif0(DOUT[14], out_DOUT[14], int_OEN);
  bufif0(DOUT[15], out_DOUT[15], int_OEN);
  bufif0(DOUT[16], out_DOUT[16], int_OEN);
  bufif0(DOUT[17], out_DOUT[17], int_OEN);
  bufif0(DOUT[18], out_DOUT[18], int_OEN);
  bufif0(DOUT[19], out_DOUT[19], int_OEN);
  bufif0(DOUT[20], out_DOUT[20], int_OEN);
  bufif0(DOUT[21], out_DOUT[21], int_OEN);
  bufif0(DOUT[22], out_DOUT[22], int_OEN);
  bufif0(DOUT[23], out_DOUT[23], int_OEN);
  bufif0(DOUT[24], out_DOUT[24], int_OEN);
  bufif0(DOUT[25], out_DOUT[25], int_OEN);
  bufif0(DOUT[26], out_DOUT[26], int_OEN);
  bufif0(DOUT[27], out_DOUT[27], int_OEN);
  bufif0(DOUT[28], out_DOUT[28], int_OEN);
  bufif0(DOUT[29], out_DOUT[29], int_OEN);
  bufif0(DOUT[30], out_DOUT[30], int_OEN);
  bufif0(DOUT[31], out_DOUT[31], int_OEN);


  and (chk_DI, ~buf_CEN, ~buf_WEN);

  reg mpwCK_notifier;
  reg pwhCK_notifier;
  reg shCEN_notifier;
  reg shADR_notifier;
  reg shWEN_notifier;
  reg shDI_notifier;

  integer i, j, h, k, m;

  parameter x_data = 32'bx;
  parameter data_0 = {
32{
1'b0
}
};
  parameter x_adr  = 7'bx;
  parameter adr_0  = {
7{
1'b0
}
};

initial begin
   for (i = 0; i < words; i=i+1) 
   	memory_array[i] = x_data;
end

initial begin
    read_error = 1'b0;
    write_error = 1'b0;
	 old_CK = 1'b0;
    // Wait for valid initial transition
    wait (buf_CK === 1'b0);

    forever @(buf_CK) begin
		case ({
old_CK,buf_CK
})
      // 0->1 transition
      2'b01:
		begin
        int_CEN = buf_CEN;
        int_WEN = buf_WEN;
        int_ADR = buf_ADR;
        int_DI = buf_DI;

        	if (int_CEN === 1'b0) begin
          		// Read cycle
				if( ^int_ADR === 1'bx)  begin
					ADR_error;
          		end else if (int_WEN === 1'b1) begin
              		int_DOUT = memory_array[int_ADR];
          		// Write cycle
          		end else if (int_WEN === 1'b0) begin 
					if (write_error === 1'b0) begin
              			memory_array[int_ADR] = int_DI; // Write cycle
              			int_DOUT = int_DI;
            		end
          		// Unknown cycle
          		end else begin // int_WEN = x
            		SHWrite_error;
          		end
        	end else if (int_CEN === 1'bx) begin
        		wipe_memory_output;
        	end
      // 0->unknown transition, wait until returns to 0
      end 
	  2'b0x, 2'b1x, 2'bx1, 2'bx0: begin
        int_CEN = 1'bx;
        wipe_memory_output;
      	end
	 endcase
		old_CK <= #0.002 buf_CK;
    end
  end  // end memory loop


//====================
// Task and procedure
//====================

// This task process entire MEM and OUTPUTs
task wipe_memory_output;
integer i;
  begin
    write_error = 1'b1;
    int_DOUT = x_data;
    int_ADR = x_adr;
    int_WEN = 1'bx;
    int_DI = x_data;


    for (i = 0; i < words; i=i+1) begin
    	memory_array[i] = x_data;
    end
    write_error = 1'b0;
  end
endtask

// This task process write through violation
task SHWrite_error;
integer ic, ib;
  begin
  	write_error = 1'b1;
  	read_error = 1'b1;
    if (int_WEN===1'bx) begin
    	memory_array[int_ADR] = x_data;
		int_DOUT = x_data;
    end else if (int_WEN===1'b0) begin
    	memory_array[int_ADR] = int_DI;
		int_DOUT = int_DI;
    end

  	write_error = 1'b0;
  	read_error = 1'b0;
  end
endtask

// This task process read violation
task SHRead_error;
  begin
    read_error = 1'b1;
    int_DOUT = x_data;
    //wait (buf_CK === 1'b0);
    read_error = 1'b0;
  end
endtask

// This task process ADR violation
task ADR_error;
integer i;
  begin
	write_error = 1'b1;
	read_error = 1'b1;
	int_DOUT = x_data;
	for (i = 0; i < words; i=i+1) 
		memory_array[i] = x_data;
   write_error = 1'b0;
	read_error = 1'b0;
  end
endtask

//=======================
// Violation processing 
//=======================
// CK violation
always @(pwhCK_notifier) begin
  $display ("%m CLK cycle pulse width high timing violation detected %t", $realtime);
  int_CEN = 1'bx;
  wipe_memory_output;
end

always @(mpwCK_notifier) begin
  $display ("%m CLK cycle timing violation detected %t", $realtime);
  #0.001;
  wipe_memory_output;
  risingTmp = 1'b0;
end


// CEN violation
always @(shCEN_notifier) begin
  int_CEN = 1'bx;
  $display ("%m Cell enable timing violation detected %t", $realtime);
  wipe_memory_output;
end

// ADR violation
always @(shADR_notifier) begin
  int_ADR = x_adr;
  $display ("%m Address timing violation detected %t", $realtime);
  ADR_error;
end

// WEN violation
always @(shWEN_notifier) begin
  int_WEN = 1'bx;
  $display ("%m Write enable timing violation detected %t", $realtime);
  if( ^int_ADR !== 1'bx)
  	  SHWrite_error;
end


// DI violation
always @(shDI_notifier) begin
  int_DI = x_data;
  $display ("%m Input data timing violation detected %t", $realtime);
  if( ^int_ADR !== 1'bx)
  	  SHWrite_error;
end



specify

    // Path delays
   if (rflag)  (CK *> DOUT[0]) = 0.1;
   if (wflag)  (CK *> DOUT[0]) = 0.1;
   if (rflag)  (CK *> DOUT[1]) = 0.1;
   if (wflag)  (CK *> DOUT[1]) = 0.1;
   if (rflag)  (CK *> DOUT[2]) = 0.1;
   if (wflag)  (CK *> DOUT[2]) = 0.1;
   if (rflag)  (CK *> DOUT[3]) = 0.1;
   if (wflag)  (CK *> DOUT[3]) = 0.1;
   if (rflag)  (CK *> DOUT[4]) = 0.1;
   if (wflag)  (CK *> DOUT[4]) = 0.1;
   if (rflag)  (CK *> DOUT[5]) = 0.1;
   if (wflag)  (CK *> DOUT[5]) = 0.1;
   if (rflag)  (CK *> DOUT[6]) = 0.1;
   if (wflag)  (CK *> DOUT[6]) = 0.1;
   if (rflag)  (CK *> DOUT[7]) = 0.1;
   if (wflag)  (CK *> DOUT[7]) = 0.1;
   if (rflag)  (CK *> DOUT[8]) = 0.1;
   if (wflag)  (CK *> DOUT[8]) = 0.1;
   if (rflag)  (CK *> DOUT[9]) = 0.1;
   if (wflag)  (CK *> DOUT[9]) = 0.1;
   if (rflag)  (CK *> DOUT[10]) = 0.1;
   if (wflag)  (CK *> DOUT[10]) = 0.1;
   if (rflag)  (CK *> DOUT[11]) = 0.1;
   if (wflag)  (CK *> DOUT[11]) = 0.1;
   if (rflag)  (CK *> DOUT[12]) = 0.1;
   if (wflag)  (CK *> DOUT[12]) = 0.1;
   if (rflag)  (CK *> DOUT[13]) = 0.1;
   if (wflag)  (CK *> DOUT[13]) = 0.1;
   if (rflag)  (CK *> DOUT[14]) = 0.1;
   if (wflag)  (CK *> DOUT[14]) = 0.1;
   if (rflag)  (CK *> DOUT[15]) = 0.1;
   if (wflag)  (CK *> DOUT[15]) = 0.1;
   if (rflag)  (CK *> DOUT[16]) = 0.1;
   if (wflag)  (CK *> DOUT[16]) = 0.1;
   if (rflag)  (CK *> DOUT[17]) = 0.1;
   if (wflag)  (CK *> DOUT[17]) = 0.1;
   if (rflag)  (CK *> DOUT[18]) = 0.1;
   if (wflag)  (CK *> DOUT[18]) = 0.1;
   if (rflag)  (CK *> DOUT[19]) = 0.1;
   if (wflag)  (CK *> DOUT[19]) = 0.1;
   if (rflag)  (CK *> DOUT[20]) = 0.1;
   if (wflag)  (CK *> DOUT[20]) = 0.1;
   if (rflag)  (CK *> DOUT[21]) = 0.1;
   if (wflag)  (CK *> DOUT[21]) = 0.1;
   if (rflag)  (CK *> DOUT[22]) = 0.1;
   if (wflag)  (CK *> DOUT[22]) = 0.1;
   if (rflag)  (CK *> DOUT[23]) = 0.1;
   if (wflag)  (CK *> DOUT[23]) = 0.1;
   if (rflag)  (CK *> DOUT[24]) = 0.1;
   if (wflag)  (CK *> DOUT[24]) = 0.1;
   if (rflag)  (CK *> DOUT[25]) = 0.1;
   if (wflag)  (CK *> DOUT[25]) = 0.1;
   if (rflag)  (CK *> DOUT[26]) = 0.1;
   if (wflag)  (CK *> DOUT[26]) = 0.1;
   if (rflag)  (CK *> DOUT[27]) = 0.1;
   if (wflag)  (CK *> DOUT[27]) = 0.1;
   if (rflag)  (CK *> DOUT[28]) = 0.1;
   if (wflag)  (CK *> DOUT[28]) = 0.1;
   if (rflag)  (CK *> DOUT[29]) = 0.1;
   if (wflag)  (CK *> DOUT[29]) = 0.1;
   if (rflag)  (CK *> DOUT[30]) = 0.1;
   if (wflag)  (CK *> DOUT[30]) = 0.1;
   if (rflag)  (CK *> DOUT[31]) = 0.1;
   if (wflag)  (CK *> DOUT[31]) = 0.1;

 (OEN *> DOUT[0]) = 0.1; 
 (OEN *> DOUT[1]) = 0.1; 
 (OEN *> DOUT[2]) = 0.1; 
 (OEN *> DOUT[3]) = 0.1; 
 (OEN *> DOUT[4]) = 0.1; 
 (OEN *> DOUT[5]) = 0.1; 
 (OEN *> DOUT[6]) = 0.1; 
 (OEN *> DOUT[7]) = 0.1; 
 (OEN *> DOUT[8]) = 0.1; 
 (OEN *> DOUT[9]) = 0.1; 
 (OEN *> DOUT[10]) = 0.1; 
 (OEN *> DOUT[11]) = 0.1; 
 (OEN *> DOUT[12]) = 0.1; 
 (OEN *> DOUT[13]) = 0.1; 
 (OEN *> DOUT[14]) = 0.1; 
 (OEN *> DOUT[15]) = 0.1; 
 (OEN *> DOUT[16]) = 0.1; 
 (OEN *> DOUT[17]) = 0.1; 
 (OEN *> DOUT[18]) = 0.1; 
...
...
(Not finished, please download and read the complete file)
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 1

Download
0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
Beha_BitStream_ram.v1.16 kB30-04-08|11:58
BitStream_buffer.v11.65 kB30-04-08|11:58
BitStream_controller.v25.60 kB30-04-08|11:58
bitstream_gclk_gen.v12.67 kB30-04-08|11:58
BitStream_parser_FSM_gating.v27.58 kB30-04-08|11:58
bs_decoding.v45.34 kB30-04-08|11:58
cavlc_consumed_bits_decoding.v1.85 kB30-04-08|11:58
cavlc_decoder.v10.33 kB30-04-08|11:58
CodedBlockPattern_decoding.v5.83 kB30-04-08|11:58
dependent_variable_decoding.v2.42 kB30-04-08|11:58
DF_mem_ctrl.v29.69 kB30-04-08|11:58
DF_pipeline.v33.65 kB30-04-08|11:58
DF_reg_ctrl.v15.94 kB30-04-08|11:58
DF_top.v7.41 kB30-04-08|11:58
end_of_blk_decoding.v2.82 kB30-04-08|11:58
exp_golomb_decoding.v6.17 kB30-04-08|11:58
ext_frame_RAM0_wrapper.v5.09 kB30-04-08|11:58
ext_frame_RAM1_wrapper.v5.10 kB30-04-08|11:58
ext_RAM_ctrl.v3.46 kB30-04-08|11:58
H.264.cr.mti2.20 kB28-02-09|13:54
H.264.mpf55.79 kB28-02-09|00:05
heading_one_detector.v2.51 kB30-04-08|11:58
hybrid_pipeline_ctrl.v10.79 kB30-04-08|11:58
Inter_mv_decoding.v93.25 kB30-04-08|11:58
Inter_pred_CPE.v3.74 kB30-04-08|11:58
Inter_pred_LPE.v23.87 kB30-04-08|11:58
Inter_pred_pipeline.v33.29 kB30-04-08|11:58
Inter_pred_reg_ctrl.v124.27 kB30-04-08|11:58
Inter_pred_sliding_window.v130.18 kB30-04-08|11:58
Inter_pred_top.v28.66 kB30-04-08|11:58
Intra4x4_PredMode_decoding.v14.99 kB30-04-08|11:58
Intra_pred_PE.v69.16 kB30-04-08|11:58
Intra_pred_pipeline.v32.46 kB24-02-09|22:46
Intra_pred_reg_ctrl.v36.37 kB30-04-08|11:58
Intra_pred_top.v14.40 kB30-04-08|11:58
IQIT.v32.48 kB30-04-08|11:58
level_decoding.v7.45 kB30-04-08|11:58
nC_decoding.v30.47 kB30-04-08|11:58
nova.v8.19 kB30-04-08|11:58
nova_defines.v12.10 kB30-04-08|11:58
nova_tb.v2.92 kB30-04-08|11:58
NumCoeffTrailingOnes_decoding.v25.79 kB30-04-08|11:58
pc_decoding.v10.34 kB30-04-08|11:58
QP_decoding.v2.31 kB30-04-08|11:58
ram_async_1r_sync_1w.v2.71 kB30-04-08|11:58
ram_sync_1r_sync_1w.v3.01 kB30-04-08|11:58
reconstruction.v22.49 kB30-04-08|11:58
rec_DF_RAM0_96x32.v18.23 kB30-04-08|11:58
rec_DF_RAM0_wrapper.v1.73 kB30-04-08|11:58
rec_DF_RAM1_96x32.v18.23 kB30-04-08|11:58
rec_DF_RAM1_wrapper.v1.73 kB30-04-08|11:58
rec_DF_RAM_ctrl.v6.42 kB30-04-08|11:58
rec_gclk_gen.v16.68 kB30-04-08|11:58
Intra_pred_PE.areasrr10.14 kB22-02-09|14:06
Intra_pred_PE.edn2.76 MB22-02-09|14:06
Intra_pred_PE.fse0.00 B22-02-09|14:06
Intra_pred_PE.sdf2.05 MB22-02-09|14:06
Intra_pred_PE.srd1.03 MB22-02-09|14:06
Intra_pred_PE.srm1.61 MB22-02-09|14:06
Intra_pred_PE.srr34.82 kB22-02-09|14:06
Intra_pred_PE.srs102.69 kB22-02-09|14:06
Intra_pred_PE.tlg418.00 B22-02-09|14:06
Intra_pred_PE_sdc.sdc310.00 B22-02-09|14:06
Intra_pred_PE.msg0.00 B22-02-09|14:46
Intra_pred_PE.plg441.00 B22-02-09|14:06
run_decoding.v11.61 kB30-04-08|11:58
sum.v23.78 kB30-04-08|11:58
syntax_decoding.v24.94 kB30-04-08|11:58
timescale.v546.00 B30-04-08|11:58
total_zeros_decoding.v14.96 kB30-04-08|11:58
vsim.wlf32.00 kB24-02-09|16:06
_primary.dat73.20 kB24-02-09|15:26
_primary.vhd11.00 kB24-02-09|15:26
verilog.asm49.59 kB21-02-09|17:50
_primary.dat7.28 kB21-02-09|17:50
_primary.vhd1.23 kB21-02-09|17:50
verilog.asm275.78 kB24-02-09|15:27
_primary.dat39.36 kB24-02-09|15:27
_primary.vhd4.99 kB24-02-09|15:27
_primary.dat15.08 kB26-02-09|11:49
_primary.vhd3.73 kB26-02-09|11:49
_primary.dat17.38 kB26-02-09|11:49
_primary.vhd4.65 kB26-02-09|11:49
verilog.asm61.01 kB22-02-09|21:56
_primary.dat8.81 kB19-02-09|20:59
_primary.vhd3.04 kB22-02-09|21:56
verilog.asm15.53 kB24-02-09|15:27
_primary.dat1.24 kB24-02-09|15:27
_primary.vhd902.00 B24-02-09|15:27
_primary.dat986.00 B26-02-09|11:49
_primary.vhd419.00 B26-02-09|11:49
_primary.dat1.40 kB26-02-09|11:49
_primary.vhd749.00 B26-02-09|11:49
_primary.dat328.00 B26-02-09|11:49
_primary.vhd307.00 B26-02-09|11:49
_primary.dat687.00 B26-02-09|11:49
_primary.vhd291.00 B26-02-09|11:49
_primary.dat1.73 kB26-02-09|11:24
_primary.vhd585.00 B26-02-09|11:24
_info2.66 kB26-02-09|11:49
syntmp0.00 B22-02-09|14:46
@inter_pred_reg_ctrl0.00 B24-02-09|15:26
@intra4x4_@pred@mode_decoding0.00 B21-02-09|17:50
@intra_pred_@p@e0.00 B24-02-09|15:27
@intra_pred_pipeline0.00 B26-02-09|11:49
@intra_pred_reg_ctrl0.00 B26-02-09|11:49
@intra_pred_top0.00 B22-02-09|21:56
@p@e0.00 B24-02-09|15:27
main_seed_precomputation0.00 B26-02-09|11:49
plane_@h@v_precomputation0.00 B26-02-09|11:49
plane_a_precomputation0.00 B26-02-09|11:49
plane_bc_precomputation0.00 B26-02-09|11:49
ram_sync_1r_sync_1w0.00 B26-02-09|11:24
_temp0.00 B26-02-09|11:49
rev_10.00 B22-02-09|14:06
work0.00 B26-02-09|11:49
H.2640.00 B08-03-09|19:18
...
Sponsored links

rec_DF_RAM1_96x32.v (808.37 kB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D