Skip to content

Commit 89668b4

Browse files
committed
Fix: #20 issue - misrouted write completion
WCH FIFO in slv_switch_wr now stores AWID & misrouted flag. The FIFO content is used to feed OoO module for write response coompletion. This changes will prevent to complete a misrouted transaction while the write data channel is still transmitting data. Change: Synthesis flow update Slight updates to extract logic usage and estimates NAND2 gate count
1 parent df225c8 commit 89668b4

File tree

9 files changed

+45
-19
lines changed

9 files changed

+45
-19
lines changed

rtl/axicb_slv_ooo.sv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ module axicb_slv_ooo
155155

156156
// Back pressure to address channel, block any further transaction
157157
// as soon an ID FIFO is full.
158-
// TODO: could be optimized but the loop back to the initiatior
159-
// from the FIFO could be unavoidable.
160158
always_comb a_full = |id_full;
161159

162160
end

rtl/axicb_slv_switch_rd.sv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ module axicb_slv_switch_rd
221221

222222
assign c_end = i_rvalid & i_rready & i_rlast;
223223

224-
// Follow-up rcompletion len for mis-routed traffic
225-
// which need to be recreated
224+
// Follow-up completion len for misrouted traffic
225+
// to create RLAST flag
226226
always @ (posedge aclk or negedge aresetn) begin
227227
if (!aresetn) begin
228228
rlen <= 8'h0;

rtl/axicb_slv_switch_wr.sv

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ module axicb_slv_switch_wr
9191
logic bch_full;
9292
logic wch_empty;
9393

94+
logic [AXI_ID_W -1:0] a_id;
95+
logic a_mr;
96+
9497
logic bch_en;
9598
logic bch_en_c;
9699
logic bch_en_r;
@@ -161,7 +164,7 @@ module axicb_slv_switch_wr
161164
aw_misrouting;
162165

163166
assign o_awch = i_awch;
164-
167+
165168
assign aw_misrouting_c = slv_aw_targeted=='0;
166169

167170
// Create a fake ready handshake in case a master agent targets a
@@ -192,18 +195,18 @@ module axicb_slv_switch_wr
192195
#(
193196
.PASS_THRU (0),
194197
.ADDR_WIDTH (8),
195-
.DATA_WIDTH (SLV_NB)
198+
.DATA_WIDTH (1 + SLV_NB + AXI_ID_W)
196199
)
197200
wch_gnt_fifo
198201
(
199202
.aclk (aclk),
200203
.aresetn (aresetn),
201204
.srst (srst),
202205
.flush (1'b0),
203-
.data_in (slv_aw_targeted),
206+
.data_in ({aw_misrouting_c, slv_aw_targeted, i_awch[AXI_ADDR_W+:AXI_ID_W]}),
204207
.push (i_awvalid & i_awready),
205208
.full (wch_full),
206-
.data_out (slv_w_targeted),
209+
.data_out ({a_mr, slv_w_targeted, a_id}),
207210
.pull (i_wvalid & i_wready & i_wlast),
208211
.empty (wch_empty)
209212
);
@@ -234,7 +237,7 @@ module axicb_slv_switch_wr
234237
///////////////////////////////////////////////////////////////////////////
235238

236239
// OoO ID Management
237-
axicb_slv_ooo
240+
axicb_slv_ooo
238241
#(
239242
.RD_PATH (0),
240243
.AXI_ID_W (AXI_ID_W),
@@ -243,18 +246,18 @@ module axicb_slv_switch_wr
243246
.MST_ID_MASK (MST_ID_MASK),
244247
.CCH_W (BCH_W)
245248
)
246-
bresp_ooo
249+
bresp_ooo
247250
(
248251
.aclk (aclk),
249252
.aresetn (aresetn),
250253
.srst (srst),
251-
.a_valid (i_awvalid),
252-
.a_ready (i_awready),
254+
.a_valid (i_wvalid & i_wlast & !wch_empty),
255+
.a_ready (i_wready),
253256
.a_full (bch_full),
254-
.a_id (i_awch[AXI_ADDR_W+:AXI_ID_W]),
257+
.a_id (a_id),
255258
.a_len ('0),
256-
.a_ix (slv_aw_targeted),
257-
.a_mr (aw_misrouting_c),
259+
.a_ix (slv_w_targeted),
260+
.a_mr (a_mr),
258261
.c_en (bch_en),
259262
.c_grant (bch_grant),
260263
.c_mr (bch_mr),
@@ -283,7 +286,7 @@ module axicb_slv_switch_wr
283286
end
284287
end
285288

286-
// TODO: is it really usefull ? round-robin should pass anyway a
289+
// TODO: is it really usefull ? round-robin should pass anyway a
287290
// grant value if unmasked value > 0
288291
assign bch_en = bch_en_c | bch_en_r;
289292

syn/yosys/area.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Synthesis with cmos.lib
2+
3+
DFF: 10 NAND2
4+
DFFSR: 16 NAND2
5+
NOR: 3 NAND2
6+
NOT: 1 NAND2
7+
NAND: 1 NAND2
8+
9+
AXI4 Crossbar:
10+
11+
Name Count NAND2 Count
12+
------------------------------------------------------
13+
DFF 10656 106560
14+
DFFSR 2928 46848
15+
NAND 67013 67013
16+
NOR 23796 71388
17+
NOT 9831 9831
18+
19+
Total 228448 301640

syn/yosys/axicb_axi4.ys

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ clean
3939

4040
# write synthesized design
4141
write_verilog axicb_crossbar_top.v
42+
43+
# drop usage report
44+
stat -liberty cmos.lib

syn/yosys/axicb_axi4lite.ys

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ clean
4040

4141
# write synthesized design
4242
write_verilog axicb_crossbar_lite_top.v
43+
44+
# drop usage report
45+
stat -liberty cmos.lib

syn/yosys/cmos.lib

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// test comment
2-
/* test comment */
31
library(demo) {
42
cell(BUF) {
53
area: 6;

syn/yosys/constraints.sdc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
create_clock -name aclk -period 100 [get_ports aclk]
2+

syn/yosys/syn_asic.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ fi
1515
echo "INFO: Start synthesis flow"
1616
yosys -V
1717

18-
yosys "$design"
18+
yosys "$design" > "$design.log"
1919

2020
exit 0

0 commit comments

Comments
 (0)