-
Notifications
You must be signed in to change notification settings - Fork 0
/
tb_MA.sv
55 lines (49 loc) · 1.65 KB
/
tb_MA.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
/*
memctrl┌──────────────────────────────┐
──────► mem_controller │
[2:0] │ ┌──────────────────────┐ │
│ │ │ │
addr │ │ │ │dataR
──────► │addr ┌────────┐dataR │ ├──────►
[31:0]│ ├──────► ├──────► │[31:0]
│ │[11:0]│ │[31:0]│ │
│ │ │DataMem │ │ │
dataW │ │dataW │ │ │ │
──────► ├──────► │ │ │
[31:0]│ │[31:0]└─▲────▲─┘ │ │
└───┘ │ │ └───┘
│ memW
memR
*/
module tb_MA(dataR_tb, dataW_tb, addr_tb, mem_ctrl_tb, memR_tb, memW_tb);
output logic [31:0] addr_tb;
output logic [31:0] dataW_tb;
output bit memR_tb;
output bit memW_tb;
bit clk_tb;
output logic [2:0] mem_ctrl_tb;
input logic [31:0] dataR_tb;
always
begin
clk_tb = 0;
#5;
clk_tb = 1;
#5;
end
MA dut(.dataR(dataR_tb),
.dataW(dataW_tb),
.addr(addr_tb),
.mem_ctrl(mem_ctrl_tb),
.memR(memR_tb),
.memW(memW_tb),
.clk(clk_tb)
);
initial
begin
$dumpfile("dump.vcd");
$dumpvars(0, tb_MA);
mem_ctrl_tb <= 3'b0;
addr_tb <= 32'b0;
dataW_tb <= 32'b0;
memR_tb <= 0;
memW_tb <= 0;