-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_wrapped.sv
69 lines (58 loc) · 1.37 KB
/
test_wrapped.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
module prng_test;
logic reset, en, sel, clk;
logic [7:0] seed;
logic valid;
logic [7:0] rand_num;
my_chip dut (
.clock(clk), .reset(reset),
.io_in({seed, sel, en}),
.io_out({valid, rand_num})
);
initial begin
clk <= 0;
forever #1000000 clk <= ~clk;
end
// prng_test.dut.
initial begin
reset = 1;
@(negedge clk)
@(negedge clk)
@(negedge clk)
@(negedge clk)
reset = 0;
@(negedge clk)
@(negedge clk)
@(negedge clk)
@(negedge clk)
reset = 1;
$monitor($time, " :rand_num = %b, valid = %b\n", rand_num, valid);
@(negedge clk)
@(negedge clk)
@(negedge clk)
@(negedge clk)
@(negedge clk)
@(negedge clk)
reset = 0;
// @(negedge clk)
// @(negedge clk)
// @(negedge clk)
en = 1;
sel = 0;
seed = 8'b11001100;
// seed <= 8'b00011000;
// seed <= 8'b10101010;
@(negedge clk)
@(negedge clk)
@(negedge clk)
en = 0;
repeat (50) begin
en = 1;
@(negedge clk)
@(negedge clk)
@(negedge clk)
en = 0;
repeat (100) @(negedge clk);
end
$finish;
end
endmodule: prng_test