Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

axi crossbar MaxSlvTrans and MaxMstTrans not working as expected #249

Open
jmdeharor opened this issue Aug 11, 2022 · 0 comments
Open

axi crossbar MaxSlvTrans and MaxMstTrans not working as expected #249

jmdeharor opened this issue Aug 11, 2022 · 0 comments

Comments

@jmdeharor
Copy link
Contributor

jmdeharor commented Aug 11, 2022

Hello,

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:

localparam int unsigned IdCounterWidth = MaxTrans > 1 ? $clog2(MaxTrans) : 1;

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant