-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaTest.sv
More file actions
48 lines (40 loc) · 1.24 KB
/
aTest.sv
File metadata and controls
48 lines (40 loc) · 1.24 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
/****************************************************************************************
* *
* https://www.bigmessowires.com/nibbler/ *
* Implementation by: Bryan Chan and Diego Regalado *
* *
*****************************************************************************************/
module testbench();
reg [3:0] dataIn;
reg reset;
reg clk;
reg enable;
wire [3:0] dataOut;
A a(dataIn, reset, clk, enable, dataOut);
initial
begin
// Initial values
{dataIn, reset, clk, enable} = 7'b0;
//Logging
$display("Time\tClock\tEnable\tDataIn\tReset\tDataOut");
$monitor("%d\t %b\t%b\t%b\t%b\t%b", $time, clk, enable, dataIn, reset, dataOut);
#2 {dataIn, reset} = 5'b00010;
#2 {dataIn, reset} = 5'b00110;
#2 {dataIn, reset} = 5'b11000;
#2 {enable} = 1'b1;
#2 {dataIn, reset} = 5'b01100;
#2 {dataIn, reset} = 5'b10010;
#2 {dataIn, reset} = 5'b00001;
#2 {dataIn, reset} = 5'b00000;
end
/**********************************************************/
/* CLOCK */
/* */
/**********************************************************/
// Clock
always
#1 clk = ~clk;
//Finish simulation
initial
#25 $finish;
endmodule