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

Fix ECP5 BRAM packing #262

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

madscientist159
Copy link

@madscientist159 madscientist159 commented Jul 7, 2022

The ecpbram utility expects the ROM data file to be in a fixed width (i.e. zero-padded) format. migen should be able to adhere more strictly to that format without breaking other users of the ROM data file.

See https://bugs.libre-soc.org/show_bug.cgi?id=855#c45 for an example of the old data format failing when used with ecpbram.

Co-authored-by: Jacob Lifshay <[email protected]>
@sbourdeauducq
Copy link
Member

Why is it not already doing it? The formatter string is already designed to do this zero padding (see l. 389).
Why the double - in your patch?

@sbourdeauducq
Copy link
Member

sbourdeauducq commented Jul 9, 2022

Maybe you want it to emit one more digit when the memory width is not a multiple of 4?
I suggest changing l.389 to (memory.width + 3)//4 in this case.

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

Successfully merging this pull request may close these issues.

3 participants