-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogramCounterTest.sv
More file actions
52 lines (42 loc) · 1.92 KB
/
programCounterTest.sv
File metadata and controls
52 lines (42 loc) · 1.92 KB
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
51
52
/****************************************************************************************
* *
* https://www.bigmessowires.com/nibbler/ *
* Implementation by: Bryan Chan and Diego Regalado *
* *
*****************************************************************************************/
module testbench();
reg [11:0] addressIn;
reg incPC;
reg notReset;
reg notLoadPC;
reg clk;
wire [11:0] addressOut;
ProgramCounter pc(addressIn, incPC, notReset, notLoadPC, clk, addressOut);
initial
begin
// Initial values
{addressIn, incPC, notReset, notLoadPC, clk} = 16'b0000000000001010;
//Logging
$display("Time\tD\tQ");
$monitor("%d\t %b\t%b\t%b\t%b\t%b\t%b", $time, clk, addressIn, incPC, notReset, notLoadPC, addressOut);
#2 {addressIn, incPC, notReset, notLoadPC} = 16'b000000000000111;
#10 {addressIn, incPC, notReset, notLoadPC} = 16'b101010101010010;
#2 {addressIn, incPC, notReset, notLoadPC} = 16'b000000000000111;
#5 {addressIn, incPC, notReset, notLoadPC} = 16'b000000000000001;
#2 {addressIn, incPC, notReset, notLoadPC} = 16'b000000000000111;
end
/**********************************************************/
/* CLOCK */
/* */
/**********************************************************/
// Clock
always
#1 clk = ~clk;
/**********************************************************/
/* CLOCK */
/* */
/**********************************************************/
//Finish simulation
initial
#25 $finish;
endmodule