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

GenericAxiMaster wrap around of dynamic address part #4

Open
timksf opened this issue Feb 16, 2023 · 1 comment
Open

GenericAxiMaster wrap around of dynamic address part #4

timksf opened this issue Feb 16, 2023 · 1 comment

Comments

@timksf
Copy link
Contributor

timksf commented Feb 16, 2023

Wrap around of dynamic address part in GenericAxiMasters

Hi, I've encountered an issue with the generic axi masters.

Following situation:

  • start address: 0x6d900000
  • address_width: 32
  • amount_width: 24
  • data width: 128
  • burst size: 256

This leads to the following widths for the address partitioning:

  • address_static = 7
  • address_dynamic = 13
  • address_offset = 12

The start address then looks like this:
$$0110110 | 1100100000000 | 000000000000$$

A single burst has an address increment of
grafik
Since the first burst will not cross a 4096 barrier, addressing starts with the start address 0x6d900000.
The issue is now that there is a certain amount of bursts, after which the dynamic part of the address wraps around, this amount of bursts does not cover the whole range of the $24$ amount bits though:
grafik
The dynamic range is offset by some amount, the max. number of bytes that can be transferred before the wrap around is:
grafik
This equates to the following number of bursts:
grafik
Burst number $1791$ starts with address
grafik
translating to
grafik
The next burst, burst number $1792$, wraps around the dynamic address to $0$ and thus starts with
grafik
which is even below the start address.

To combat this, the start address needs to be taken into account when deciding on the width of the dynamic part of
the address. The issue is that the widths have to be calculated at compile time which would take away the flexibility
of being able to dispatch multiple requests with different starting addresses.
I think that the address partitioning was introduced to have slimmer logic for calculating new addresses (?).
The somewhat "dirty" fix I used, was to also increase the then-not-so-static-anymore part of the address, when the dynamic part wraps around. Maybe there could be an optional Parameter for that. This kind of defeats the purpose of the partitioned address I think.
Choosing more amount bits solves the issue in this case as well but I don't think thats a good way of handling it either.
If you have any other fixes or if this problem is beyond the scope of the intended use cases, let me know!

Please excuse the use of screenshots, I could not get the math environment working properly.

@jahofmann
Copy link
Collaborator

Thank you for the bug report. You're right, many of the design decisions trim the Generic AXI master for performance. The first target of the code is the BlueDMA used in TaPaSCo, which had to run at 250MHz on Virtex 7 devices. Without the precalculation this wasn't possible.

Using the static part might still be possible when you can predict that you have to increase and do that in the next cycle. Doing it in the same cycle with the dynamic part calculations might introduce a too long critical path.

I'll have to look at the code to see if I have another idea.

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

2 participants