-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore_tb.v
More file actions
36 lines (28 loc) · 663 Bytes
/
Copy pathcore_tb.v
File metadata and controls
36 lines (28 loc) · 663 Bytes
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
module core_tb;
reg clk;
reg reset;
wire [31:0] pc_current;
wire [31:0] instruction;
wire [31:0] result;
core uut (
.clk(clk),
.reset(reset),
.pc_current(pc_current),
.instruction(instruction),
.result(result)
);
always #5 clk = ~clk;
initial begin
clk = 0;
reset = 1;
#10 reset = 0;
end
initial begin
$readmemh("program.txt", uut.instr_mem_inst.memory);
end
initial begin
$monitor("Time: %0t | PC: %h | Inst: %h | Result (x4): %h", $time, pc_current, instruction, result);
#200;
$finish;
end
endmodule