-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtb.v
38 lines (32 loc) · 1.29 KB
/
tb.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
38
/////////////////////////////////////////////////////////////////////////////////
// Michael Tangy //
// ECE 483-001 //
// //
// 7/14/2015 //
// //
// This file contains our testbench for simulating our single cycle and //
// pipelined CPU's //
/////////////////////////////////////////////////////////////////////////////////
//Stimulus for testing
module tb;
reg CLK,RST; //inputs for circuit
//reg [31:0] instruction;
reg [7:0] clk_count = 'd0;
// ======================================
// Counter of system clock ticks
// ======================================
CPU cpu(CLK,RST);
always @ ( posedge CLK )
clk_count <= clk_count + 1'd1;
initial
begin
RST = 1;
CLK = 0;
#3 CLK = 1;
#3 CLK = 0;
#4 RST = 0;
repeat (128)
#6 CLK = ~CLK;
end
initial #750 $finish;
endmodule