-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzReg_tb.sv
More file actions
49 lines (38 loc) · 701 Bytes
/
zReg_tb.sv
File metadata and controls
49 lines (38 loc) · 701 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
37
38
39
40
41
42
43
44
45
46
47
48
49
module zReg_tb();
timeunit 1ns;
timeprecision 1ps;
localparam CLK_PERIOD = 20;
logic clk;
initial begin
clk <= 0;
forever begin
#(CLK_PERIOD/2);
clk <= ~clk;
end
end
localparam WIDTH = 12;
logic [WIDTH-1:0]dataIn;
logic rstN, wrEn, Zout;
zReg #(.WIDTH(WIDTH)) dut(.*);
initial begin
@(posedge clk);
rstN <= 0;
@(posedge clk);
rstN <= 1;
dataIn <= 0;
wrEn <= 0;
@(posedge clk);
dataIn <= 0;
wrEn <= 1;
@(posedge clk);
dataIn <= 4;
wrEn <= 1;
repeat(10) begin
@(posedge clk);
dataIn = $urandom();
wrEn = $urandom();
rstN = $urandom();
end
$stop;
end
endmodule: zReg_tb