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

Reason for duplication toolchain_program function #141

Closed
hellow554 opened this issue Feb 5, 2021 · 6 comments
Closed

Reason for duplication toolchain_program function #141

hellow554 opened this issue Feb 5, 2021 · 6 comments
Labels

Comments

@hellow554
Copy link

hellow554 commented Feb 5, 2021

I'm playing around with a intel/altera based platform and found it very easy to define my own platform, that's amazing! ❤️ (I'm probably doing a PR in the near future for it).

What wonders me is that (at least this is true for IntelPlatform devices) the boards share (almost) the same programming code. The only difference I found is that they appear in a different position in the JTAG chain.

What is the reason for not having the code in (...) the IntelPlatform class?

I also would like to see the quartus_pgm program in the required tools list if do_program is True.

What are your thoughts about it? I would like to take that as an approach to commit to this project (:

@whitequark
Copy link
Member

The problem with using a common toolchain_program function is that almost every board is unique in some way, and so every change to the common function would, to be robust, require re-testing of every Intel board. That's unfeasible.

Also, not everything programs through Quartus.

@hellow554
Copy link
Author

hellow554 commented Feb 5, 2021

It seems that you got me wrong.
I don't mean that every board should be have the same toolchain_program function, only the board that share the same programming procedure, e.g. all IntelPlatform boards (which all of them require the quartus_pgm tool ;) )

Does that make more sense to you?

@whitequark
Copy link
Member

Not all Intel FPGA boards inherently require quartus_pgm. The ones we currently have might, but there is no such inherent requirement as boards can and do have custom programming tools.

@hellow554
Copy link
Author

Okay, you're right, that may be a possibility. So don't require quartus_pgm as a tool.

But for the second part, what do you think about promiting the toolchain_program method to the IntelPlatform class (and let possible future board override that method to have their own logic)

@whitequark
Copy link
Member

That would be a liability for the reason I have described: right now toolchain_program is entirely self-contained and can be tested just once when the board is added, and with your proposed design, that won't be possible.

@hellow554
Copy link
Author

I'm not entirely getting your point here, but I'm ok with it.
For me it is that 8 boards do (almost) exactly the same when programming, so we have that code 8 times in our database.

As said, if you think that's the right way to go because of the reasons you listed above, I'm fine with it.
Thanks for the clarification :)

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

No branches or pull requests

2 participants