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

Cleaner nextpnr BBA generation #66

Open
gatecat opened this issue Apr 23, 2021 · 2 comments
Open

Cleaner nextpnr BBA generation #66

gatecat opened this issue Apr 23, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@gatecat
Copy link
Contributor

gatecat commented Apr 23, 2021

Currently the nextpnr BBA generation code includes a lot of duplication, particularly where lists are concerned. e.g. patterns like https://github.com/SymbiFlow/python-fpga-interchange/blob/6a80233ca97427c9b1a1cdd16349c3724914d008/fpga_interchange/chip_info.py#L658-L672 crop up a lot

I think a custom decorator might be the nicest solution here, although I don't have enough Python experience personally to comment on how much work it would be to implement this.

Longer term, the structures in nextpnr (https://github.com/YosysHQ/nextpnr/blob/master/fpga_interchange/chipdb.h) and Python should come from the same source to reduce the risk of mismatches, although I don't know which should be definitive.

@gatecat gatecat added the enhancement New feature or request label Apr 23, 2021
@kowalewskijan
Copy link

As for me, I think an auto-alignment feature is worth to add too (as a part of this issue) to avoid manual padding for some fields like it is done in BelInfo.

@kowalewskijan
Copy link

kowalewskijan commented Apr 26, 2021

Longer term, the structures in nextpnr (https://github.com/YosysHQ/nextpnr/blob/master/fpga_interchange/chipdb.h) and Python should come from the same source to reduce the risk of mismatches, although I don't know which should be definitive.

I think the header (chipdb.h) could be generated as a part of nextpnr_emit.py script. Currently in the Nextpnr we call the nextpnr_emit.py from the cmake during bba generation - probably this is the best place to generate the header as we won't re-generate the bba file too frequently.

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

No branches or pull requests

2 participants