Skip to content

Commit fbc7c91

Browse files
committed
Address final TODOs
1 parent 05af798 commit fbc7c91

File tree

4 files changed

+36
-41
lines changed

4 files changed

+36
-41
lines changed

src/axi_mcast_demux_mapped.sv

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,10 @@ module axi_mcast_demux_mapped #(
378378
// Assertions
379379
// -----------------
380380

381+
// pragma translate_off
382+
`ifndef VERILATOR
383+
`ifndef XSIM
384+
381385
// Check that multicast address map rules expressed in interval form can be converted to
382386
// mask form, see https://arxiv.org/pdf/2502.19215
383387
for (genvar i = 0; i < NoMulticastRules; i++) begin : gen_multicast_rule_assertion
@@ -404,6 +408,36 @@ module axi_mcast_demux_mapped #(
404408
default_mst_port_i.start_addr, size))
405409
end
406410

411+
// Check that addrmap and default slave do not change while there is an unserved Ax
412+
`ASSERT(default_mst_port_en_aw_stable,
413+
(slv_req_cut.aw_valid && !slv_resp_cut.aw_ready) |=> $stable(en_default_mst_port_i),
414+
clk_i, !rst_ni,
415+
"It is not allowed to change the default mst port enable when there is an unserved Aw beat.")
416+
`ASSERT(default_mst_port_aw_stable,
417+
(slv_req_cut.aw_valid && !slv_resp_cut.aw_ready) |=> $stable(default_mst_port_i),
418+
clk_i, !rst_ni,
419+
"It is not allowed to change the default mst port when there is an unserved Aw beat.")
420+
`ASSERT(addrmap_aw_stable,
421+
(slv_req_cut.aw_valid && !slv_resp_cut.aw_ready) |=> $stable(addr_map_i),
422+
clk_i, !rst_ni,
423+
"It is not allowed to change the address map when there is an unserved Aw beat.")
424+
`ASSERT(default_mst_port_en_ar_stable,
425+
(slv_req_cut.ar_valid && !slv_resp_cut.ar_ready) |=> $stable(en_default_mst_port_i),
426+
clk_i, !rst_ni,
427+
"It is not allowed to change the default mst port enable when there is an unserved Ar beat.")
428+
`ASSERT(default_mst_port_ar_stable,
429+
(slv_req_cut.ar_valid && !slv_resp_cut.ar_ready) |=> $stable(default_mst_port_i),
430+
clk_i, !rst_ni,
431+
"It is not allowed to change the default mst port when there is an unserved Ar beat.")
432+
`ASSERT(addrmap_ar_stable,
433+
(slv_req_cut.ar_valid && !slv_resp_cut.ar_ready) |=> $stable(addr_map_i),
434+
clk_i, !rst_ni,
435+
"It is not allowed to change the address map when there is an unserved Ar beat.")
436+
437+
`endif
438+
`endif
439+
// pragma translate_on
440+
407441
endmodule
408442

409443
// interface wrapper

src/axi_mcast_mux.sv

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ module axi_mcast_mux #(
6767
input mst_resp_t mst_resp_i
6868
);
6969

70-
// TODO colluca: can this be merged with MstIdxBits?
71-
localparam int unsigned SlvPortIdxBits = cf_math_pkg::idx_width(NoSlvPorts);
72-
typedef logic [SlvPortIdxBits-1:0] mst_idx_t;
73-
7470
localparam int unsigned MstIdxBits = $clog2(NoSlvPorts);
7571
localparam int unsigned MstAxiIDWidth = SlvAxiIDWidth + MstIdxBits;
7672

@@ -182,7 +178,7 @@ module axi_mcast_mux #(
182178
logic ucast_aw_valid, ucast_aw_ready;
183179
logic mcast_aw_valid, mcast_aw_ready, mcast_aw_commit;
184180
logic mcast_not_aw_valid;
185-
mst_idx_t mcast_sel_q, mcast_sel_d;
181+
logic [MstIdxBits-1:0] mcast_sel_q, mcast_sel_d;
186182
logic [NoSlvPorts-1:0] mcast_sel_mask;
187183
logic [NoSlvPorts-1:0] ucast_aw_readies, mcast_aw_readies;
188184

@@ -299,7 +295,6 @@ module axi_mcast_mux #(
299295
);
300296

301297
// Arbitrate multicast requests in priority encoder fashion
302-
// TODO colluca: extend lzc to return mask form instead of cnt?
303298
lzc #(
304299
.WIDTH ( NoSlvPorts ),
305300
.MODE ( 1'b0 ) // Trailing zero mode
@@ -314,8 +309,7 @@ module axi_mcast_mux #(
314309
assign mcast_aw_commit = |slv_aw_commit_i;
315310
assign mcast_aw_readies = {NoSlvPorts{mcast_aw_ready}} & mcast_sel_mask;
316311

317-
// TODO colluca: change all FFxARN to FFx
318-
`FFLARN(mcast_sel_q, mcast_sel_d, mcast_aw_valid && mcast_aw_ready, '0, clk_i, rst_ni)
312+
`FFL(mcast_sel_q, mcast_sel_d, mcast_aw_valid && mcast_aw_ready, '0, clk_i, rst_ni)
319313

320314
// Arbitrate "winners" of unicast and multicast arbitrations
321315
// giving priority to multicast
@@ -546,7 +540,6 @@ module axi_mcast_mux #(
546540
// pragma translate_on
547541
endmodule
548542

549-
// TODO colluca: adapt this
550543
// interface wrap
551544
`include "axi/assign.svh"
552545
`include "axi/typedef.svh"

src/axi_mcast_xbar_unmuxed.sv

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -91,37 +91,6 @@ import cf_math_pkg::idx_width;
9191

9292
for (genvar i = 0; i < Cfg.NoSlvPorts; i++) begin : gen_slv_port_demux
9393

94-
// make sure that the default slave does not get changed, if there is an unserved Ax
95-
// pragma translate_off
96-
// TODO(colluca): is this still the right place for these? and are they still correct after
97-
// moving the address decoders past the spill registers
98-
`ifndef VERILATOR
99-
`ifndef XSIM
100-
default disable iff (~rst_ni);
101-
default_aw_mst_port_en: assert property(
102-
@(posedge clk_i) (slv_ports_req_i[i].aw_valid && !slv_ports_resp_o[i].aw_ready)
103-
|=> $stable(en_default_mst_port_i[i]))
104-
else $fatal (1, $sformatf("It is not allowed to change the default mst port\
105-
enable, when there is an unserved Aw beat. Slave Port: %0d", i));
106-
default_aw_mst_port: assert property(
107-
@(posedge clk_i) (slv_ports_req_i[i].aw_valid && !slv_ports_resp_o[i].aw_ready)
108-
|=> $stable(default_mst_port_i[i]))
109-
else $fatal (1, $sformatf("It is not allowed to change the default mst port\
110-
when there is an unserved Aw beat. Slave Port: %0d", i));
111-
default_ar_mst_port_en: assert property(
112-
@(posedge clk_i) (slv_ports_req_i[i].ar_valid && !slv_ports_resp_o[i].ar_ready)
113-
|=> $stable(en_default_mst_port_i[i]))
114-
else $fatal (1, $sformatf("It is not allowed to change the enable, when\
115-
there is an unserved Ar beat. Slave Port: %0d", i));
116-
default_ar_mst_port: assert property(
117-
@(posedge clk_i) (slv_ports_req_i[i].ar_valid && !slv_ports_resp_o[i].ar_ready)
118-
|=> $stable(default_mst_port_i[i]))
119-
else $fatal (1, $sformatf("It is not allowed to change the default mst port\
120-
when there is an unserved Ar beat. Slave Port: %0d", i));
121-
`endif
122-
`endif
123-
// pragma translate_on
124-
12594
axi_mcast_demux_mapped #(
12695
.AxiIdWidth ( Cfg.AxiIdWidthSlvPorts ), // ID Width
12796
.AxiAddrWidth ( Cfg.AxiAddrWidth ),

src/axi_test.sv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,6 @@ package axi_test;
906906
// Determine memory type.
907907
ax_beat.ax_cache = is_read ? axi_pkg::get_arcache(mem_region.mem_type) : axi_pkg::get_awcache(mem_region.mem_type);
908908
// Randomize beat size.
909-
// TODO colluca: how do we handle traffic shaping w/ multicast?
910909
if (TRAFFIC_SHAPING) begin
911910
rand_success = std::randomize(cprob) with {
912911
cprob >= 0; cprob < max_cprob;

0 commit comments

Comments
 (0)