-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflagsTest.sv
51 lines (39 loc) · 1.23 KB
/
flagsTest.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
51
//-----------------------------------------------------
// Bryan Chan
// Project 2 - Nibble - Testbench
//-----------------------------------------------------
module testbench();
reg c;
reg z;
reg reset;
reg clk;
wire [1:0] flagsOut;
Flags flags(c, z, reset, clk, flagsOut);
initial
begin
// Initial values
{c, z, reset, clk} = 4'b0;
//Logging
$display("Time\tClock\tC\tZ\tReset\tFlags");
$monitor("%d\t %b\t%b\t%b\t%b\t%b", $time, clk, c, z, reset, flagsOut);
#2 {c, z, reset} = 3'b000;
#2 {c, z, reset} = 3'b100;
#2 {c, z, reset} = 3'b010;
#2 {c, z, reset} = 3'b110;
#2 {c, z, reset} = 3'b000;
end
/**********************************************************/
/* CLOCK */
/* */
/**********************************************************/
// Clock
always
#1 clk = ~clk;
/**********************************************************/
/* CLOCK */
/* */
/**********************************************************/
//Finish simulation
initial
#25 $finish;
endmodule