-
Notifications
You must be signed in to change notification settings - Fork 0
/
tb_InstMem.sv
51 lines (49 loc) · 1.5 KB
/
tb_InstMem.sv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
module tb_InstMem;
reg [31:0] tb_addr;
wire [31:0] tb_dout;
InstMem dut(.pcin(tb_addr), .dout(tb_dout));
initial begin
tb_addr = 0; //5'b00000;
#10;
$display("[tb] Address = %0b: Data = %0h", tb_addr, tb_dout);
tb_addr = 4; //5'b00100;
#10;
$display("[tb] Address = %0b: Data = %0h", tb_addr, tb_dout);
tb_addr = 8; //5'b01000;
#10;
$display("[tb] Address = %0b: Data = %0h", tb_addr, tb_dout);
tb_addr = 12; //5'b01100;
#10;
$display("[tb] Address = %0b: Data = %0h", tb_addr, tb_dout);
tb_addr = 16; //5'b10000;
#10;
$display("[tb] Address = %0b: Data = %0h", tb_addr, tb_dout);
tb_addr = 20; //5'b10100;
#10;
$display("[tb] Address = %0b: Data = %0h", tb_addr, tb_dout);
tb_addr = 24; //5'b11000;
#10;
$display("[tb] Address = %0b: Data = %0h", tb_addr, tb_dout);
tb_addr = 28; //5'b11100;
#10;
$display("[tb] Address = %0b: Data = %0h", tb_addr, tb_dout);
tb_addr = 32; //5'b100000 - It loops cause lower 5 bits are sent to DUT
#10;
$display("[tb] Address = %0b: Data = %0h", tb_addr, tb_dout);
tb_addr = 36;
#10;
$display("[tb] Address = %0b: Data = %0h", tb_addr, tb_dout);
tb_addr = 40;
#10;
$display("[tb] Address = %0b: Data = %0h", tb_addr, tb_dout);
tb_addr = 44;
#10;
$display("[tb] Address = %0b: Data = %0h", tb_addr, tb_dout);
tb_addr = 48;
#10;
$display("[tb] Address = %0b: Data = %0h", tb_addr, tb_dout);
tb_addr = 52;
#10;
$display("[tb] Address = %0b: Data = %0h", tb_addr, tb_dout);
end
endmodule