You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed something strange abot the MaxSlvTrans and MaxMstTrans parameters of the axi crossbar.
First, I realized that they don't limit the number of transactions to exactly the parameter value, but is rather a lower bound. For example, adding registers (LatencyMode = CUT_ALL_AX) increase the number of transactions for all crossbar slaves. For the masters, there are FIFOs in the axi_mux and demux, which limit as expected the number of in flight transactions for the write channels. However, the reads are limited by the id counters present in the demux.
The issue I wanted to talk about is the width of these counters. In line 63 of axi_demux.sv we can see how the width is calculated:
The demux can send in flight transactions as long as the corresponfing id counter doesn't overflow (and for the case of writes, the FIFO is not full), which is usually more than the number specified in MaxTrans. However, when this value is a power of 2, the limit is reduced, and the maximum number of in flight transactions is MaxTrans-1, because the counter can't store the value MaxTrans.
For me it is not a problem that the crossbar can hold more in flight transactions that the specified number in MaxSlvTrans and MaxMstTrans (maybe it should be at least documented), but I it is an issue that it sends less than the specified number.
The solution I think is simple, just changing that line by:
localparam int unsigned IdCounterWidth = $clog2(MaxTrans+1);
The crossbar will still support more in flight transactions, but at least the parameters will set a lower bound.
What do you think on this? I am not an expert of this code so maybe I am leaving something out. Also, If you agree with the solution I can make a PR.
Thanks!
The text was updated successfully, but these errors were encountered:
Hello,
I noticed something strange abot the
MaxSlvTrans
andMaxMstTrans
parameters of the axi crossbar.First, I realized that they don't limit the number of transactions to exactly the parameter value, but is rather a lower bound. For example, adding registers (
LatencyMode = CUT_ALL_AX
) increase the number of transactions for all crossbar slaves. For the masters, there are FIFOs in the axi_mux and demux, which limit as expected the number of in flight transactions for the write channels. However, the reads are limited by the id counters present in the demux.The issue I wanted to talk about is the width of these counters. In line 63 of
axi_demux.sv
we can see how the width is calculated:The demux can send in flight transactions as long as the corresponfing id counter doesn't overflow (and for the case of writes, the FIFO is not full), which is usually more than the number specified in
MaxTrans
. However, when this value is a power of 2, the limit is reduced, and the maximum number of in flight transactions isMaxTrans-1
, because the counter can't store the valueMaxTrans
.For me it is not a problem that the crossbar can hold more in flight transactions that the specified number in
MaxSlvTrans
andMaxMstTrans
(maybe it should be at least documented), but I it is an issue that it sends less than the specified number.The solution I think is simple, just changing that line by:
The crossbar will still support more in flight transactions, but at least the parameters will set a lower bound.
What do you think on this? I am not an expert of this code so maybe I am leaving something out. Also, If you agree with the solution I can make a PR.
Thanks!
The text was updated successfully, but these errors were encountered: