-
Notifications
You must be signed in to change notification settings - Fork 0
/
mips_test.v
37 lines (32 loc) · 1002 Bytes
/
mips_test.v
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
`timescale 1ps/1ps
module MIPS_TEST();
reg clk = 0;
reg rst = 0;
integer duration = 0;
initial begin
forever begin
clk <= ~clk;
#5;
end
end
wire [31:0] writedata, dataadr, readdata, instr;
wire memwrite;
top DUT(clk, rst, writedata, readdata, dataadr, memwrite, instr);
initial begin
$dumpfile("top_test_dump.vcd");
$dumpvars;
$readmemh("memfile.dat",MIPS_TEST.DUT.imem.RAM); // initialize memory with test program. Change this with memfile2.dat for the modified code
rst = 1;
#20;
rst = 0;
while(duration < 2000)begin
$display(duration);
$display("MIPS_TEST.DUT.mips.dp.rf.rf[9] = ", MIPS_TEST.DUT.mips.dp.rf.rf[9]);
duration = duration + 100;
#100;
end
$display("done");
$display("MIPS_TEST.DUT.mips.dp.rf.rf[9] = ", MIPS_TEST.DUT.mips.dp.rf.rf[9]);
$finish;
end
endmodule