-
Notifications
You must be signed in to change notification settings - Fork 18
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
Wiki proposal: explain and demonstrate parametrizable BlackBox in-line implementation #83
Comments
This looks pretty straightforward to me. @albert-magyar do you have any comments |
If possible, is prefer to have this as a website update. |
can you guys add instructions to the readme how to make updates to the website...? And if Wiki is not the right thing to point to website instead...? |
I think it might be good to come up with a canonical phrase to describe this. Using the term "parameter" and "blackbox" together might just make some people miss what you're actually doing and assume it's just Verilog module-level parameters. |
@ucbjrl I feel like you might have documented the wiki update process at some point in the past. |
I agree with @seldridge, that this would be better as website update (I think you just submit a pull request to https://github.com/freechipsproject/www.chisel-lang.org). If you think it's a good idea to update the wiki as well, submit a pull request to https://github.com/ucb-bar/chisel3-wiki. |
Type of issue: documentation
Impact: no functional change
Development Phase: proposal
Other information
This is a proposal to add some content to the BlackBoxes github wiki page explaining how to write a Verilog BlackBox with an inline implementation that can be parametrized in simple ways. The example I have in mind (relevant to my work) is writing a block RAM generator aimed at Vivado which can handle any bus width and memory depth. Below is my proposed addition to the wiki, to be appended to section BlackBoxes with in-line Verilog. It might also be interesting to add a page to the wiki containing a complete example of a Chisel -> Vivado block RAM generator, since several people I talked to at the Chisel conference expressed a need for that. I'm happy to write such a page if it's desired.
The in-line implementation can be dynamically parametrized at compile time by using Scala string interpolation. However, if you use the BlackBox more than once with differing parameters, the generated Verilog files will conflict. To avoid this, you must specify a new unique
desiredName
for theBlackBox
module, which must exactly match the Verilog filename and Verilog module name generated. For example, within theBlackBox
module definition, this might look like:This will result in a new generated Verilog file for each instance of
MyBlackBox
with different parameters. For example, if you somewhere instantiateModule(new MyBlackBox(32))
then the filemy_blackbox_32.v
will be generated containing a Verilog definition for the modulemy_blackbox_32
.The text was updated successfully, but these errors were encountered: