Skip to content

Commit b4d0c7d

Browse files
authored
Merge pull request #166 from lucat1/master
sim/rdma: drive local RDMA signals to satisfy assertions
2 parents b3728f6 + 6245e37 commit b4d0c7d

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

sim/hw/memory_simulation.svh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ class memory_simulation;
5959
mem_mock #(N_CARD_AXI) card_mem_mock;
6060
`endif
6161
`ifdef EN_RDMA
62-
mem_mock #(N_RDMA_AXI) rdma_mem_mock;
62+
mem_mock #(N_RDMA_AXI) rdma_mem_mock_remote;
63+
mem_mock #(N_RDMA_AXI) rdma_mem_mock_local;
6364
`endif
6465

6566
c_meta #(.ST(req_t)) sq_rd_mon;
@@ -86,7 +87,8 @@ class memory_simulation;
8687
mem_mock #(N_CARD_AXI) card_mem_mock,
8788
`endif
8889
`ifdef EN_RDMA
89-
mem_mock #(N_RDMA_AXI) rdma_mem_mock,
90+
mem_mock #(N_RDMA_AXI) rdma_mem_mock_remote,
91+
mem_mock #(N_RDMA_AXI) rdma_mem_mock_local,
9092
`endif
9193
c_meta #(.ST(req_t)) sq_rd_mon,
9294
c_meta #(.ST(req_t)) sq_wr_mon,
@@ -112,7 +114,8 @@ class memory_simulation;
112114
this.card_mem_mock = card_mem_mock;
113115
`endif
114116
`ifdef EN_RDMA
115-
this.rdma_mem_mock = rdma_mem_mock;
117+
this.rdma_mem_mock_remote = rdma_mem_mock_remote;
118+
this.rdma_mem_mock_local = rdma_mem_mock_local;
116119
`endif
117120

118121
this.sq_rd_mon = sq_rd_mon;
@@ -146,8 +149,8 @@ class memory_simulation;
146149

147150
`ifdef EN_RDMA
148151
task rdmaRemoteWrite(vaddr_t vaddr, ref byte data[]);
149-
rdma_mem_mock.malloc(vaddr, $size(data));
150-
mem_utils#(N_RDMA_AXI)::mem_mock_write(rdma_mem_mock, vaddr, data);
152+
rdma_mem_mock_remote.malloc(vaddr, $size(data));
153+
mem_utils#(N_RDMA_AXI)::mem_mock_write(rdma_mem_mock_remote, vaddr, data);
151154
endtask
152155

153156
task rdmaLocalRead(vaddr_t vaddr, vaddr_t len);

sim/hw/tb_user.sv

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ module tb_user;
142142
c_axisr rdma_rrsp_recv_drv[N_RDMA_AXI];
143143
c_axisr rdma_rrsp_send_drv[N_RDMA_AXI];
144144

145-
mem_mock #(N_RDMA_AXI) rdma_mem_mock;
145+
mem_mock #(N_RDMA_AXI) rdma_mem_mock_remote;
146+
mem_mock #(N_RDMA_AXI) rdma_mem_mock_local;
146147
`endif
147148

148149
memory_simulation mem_sim;
@@ -208,7 +209,8 @@ module tb_user;
208209
card_mem_mock.run();
209210
`endif
210211
`ifdef EN_RDMA
211-
rdma_mem_mock.run();
212+
rdma_mem_mock_remote.run();
213+
rdma_mem_mock_local.run();
212214
`endif
213215
join_none
214216
endtask
@@ -304,15 +306,24 @@ module tb_user;
304306

305307
// RDMA
306308
`ifdef EN_RDMA
307-
rdma_mem_mock = new(
308-
"RDMA",
309+
rdma_mem_mock_remote = new(
310+
"RDMA-REMOTE",
309311
ack_mbx,
310312
rdma_rreq_recv_mbx, // queue to send read requests
311313
rdma_rreq_send_mbx, // queue to send write requests
312314
rdma_rreq_send_drv, // data input for write
313315
rdma_rreq_recv_drv, // data output for read
314316
scb
315317
);
318+
rdma_mem_mock_local = new(
319+
"RDMA-LOCAL",
320+
ack_mbx,
321+
rdma_rrsp_recv_mbx, // queue to reply to read requests
322+
rdma_rrsp_send_mbx, // queue to reply to write requests
323+
rdma_rrsp_send_drv, // data output for write
324+
rdma_rrsp_recv_drv, // data input for read
325+
scb
326+
);
316327
`endif
317328

318329
mem_sim = new(
@@ -330,7 +341,8 @@ module tb_user;
330341
card_mem_mock,
331342
`endif
332343
`ifdef EN_RDMA
333-
rdma_mem_mock,
344+
rdma_mem_mock_remote,
345+
rdma_mem_mock_local,
334346
`endif
335347
sq_rd_mon,
336348
sq_wr_mon,
@@ -360,7 +372,8 @@ module tb_user;
360372
card_mem_mock.initialize();
361373
`endif
362374
`ifdef EN_RDMA
363-
rdma_mem_mock.initialize();
375+
rdma_mem_mock_remote.initialize();
376+
rdma_mem_mock_local.initialize();
364377
`endif
365378

366379
#(RST_PERIOD) aresetn = 1'b1;

0 commit comments

Comments
 (0)