From c3c9e5a02f91eeb9d0871c94c3d883feb2619e93 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 24 Mar 2013 10:40:40 +0100 Subject: [PATCH] Added hansimem testcase (memory with async reset) --- tests/simple/hansimem.v | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/simple/hansimem.v diff --git a/tests/simple/hansimem.v b/tests/simple/hansimem.v new file mode 100644 index 000000000..b02b6c686 --- /dev/null +++ b/tests/simple/hansimem.v @@ -0,0 +1,44 @@ + +module MyMem #( + parameter AddrWidth = 4, + parameter DataWidth = 4) ( + (* gentb_constant = 1 *) + input Reset_n_i, + input Clk_i, + input [AddrWidth-1:0] Addr_i, + input [DataWidth-1:0] Data_i, + output [DataWidth-1:0] Data_o, + input WR_i); + + reg Data_o; + + localparam Size = 2**AddrWidth; + + (* mem2reg *) + reg [DataWidth-1:0] Mem[Size-1:0]; + + integer i; + + always @(negedge Reset_n_i or posedge Clk_i) + begin + //$display("Data1 = %b, Data11 = %b, Data12 = %b, Data2 = %b, Data21 = %b, Data22 = %b",Data1_i,Data11,Data12,Data2_i,Data21,Data22); + if (!Reset_n_i) + begin + Data_o <= 'bx; + for (i=0; i