-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathram_dual_tb.v
57 lines (49 loc) · 1.04 KB
/
ram_dual_tb.v
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
`include "ram_dual.v"
module ram_dual_tb;
localparam ADDRESS_BITS = 1;
localparam DATA_BITS = 1;
reg clock, reset, write;
reg [ADDRESS_BITS-1:0] address_in, address_out;
reg [DATA_BITS-1:0] data_in;
wire [DATA_BITS-1:0] data_out;
ram_dual #(
.ADDRESS_BITS(ADDRESS_BITS),
.DATA_BITS(DATA_BITS)
) top (
clock,
reset,
write,
address_in,
address_out,
data_in,
data_out
);
initial begin
$dumpfile("ram_dual_tb.vcd");
$dumpvars;
/* Start. */
address_in = 0;
address_out = 0;
data_in = 0;
clock = 0;
reset = 0;
write = 0;
/* Reset. */
#2 reset = 1;
#2 reset = 0;
#2
write = 1;
address_out = 1;
address_in = 0;
data_in = 1;
#2
write = 0;
address_out = 0;
address_in = 1;
data_in = 1;
#2 $finish;
end
always begin
#1 clock = ~clock;
end
endmodule