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

Chisel design with inline blackbox verilog generates .sv output with filenames at the end #4249

Open
carlosedp opened this issue Nov 4, 2022 · 4 comments

Comments

@carlosedp
Copy link
Contributor

On my Chisel design, I have some modules that use inline blackbox Verilog code (Eg. https://github.com/carlosedp/chiselv/blob/dd33dc558fb703adc95fd2c719367e5f2dc0e709/chiselv/src/GPIO.scala#L49)

When going thru firtool, the generated .sv file have the "blackboxed" verilog code inlined (which is neat) but it appended the file names from my blackboxes to the end of the file:

image

Commenting-out those two lines, make Verilator compile it fine.

I was pointed to use --split-verilog -o=generated to generate separate .sv files to each module but then my Toplevel module file ended blank (which might be or not another issue).

@carlosedp
Copy link
Contributor Author

I believe even having the split files option, this is still a bug since the two resource files were correctly inlined in the generated SV file but the filenames were appended to the end.

@carlosedp
Copy link
Contributor Author

Bump. Any feedback if this is supposed to be a bug and the filelist output could be suppressed from the output SV?

I could look into providing a PR with some guidance on where to look :)

unlsycn added a commit to unlsycn/circt that referenced this issue Feb 6, 2024
Add the `--disable-blackbox-resource-file` option to firtool and the
BlackBoxReaderPass.

Fix llvm#4249. Another way to resolve it is adding an optional output
filename for this file, but this would break the uniformity of the
behavior when split-verilog is turn on or off.

Note that this option also works for targets other than
verilog/systemverilog.

This switch does not affect the workflows that exists.

Signed-off-by: unlsycn <unlsycn@unlsycn.com>
@darthscsi
Copy link
Contributor

Yes, if the modules existed, they should not be in a file list, though much of that is from maintaining past chisel behavior (which is woofully unspecified for lots of combinations of blackblox).

That said, single-file output is purely for writing testcases, it will not produce valid verilog in many cases. I intend to hide it as an option at some point.

@carlosedp
Copy link
Contributor Author

Closing thoughts here... so I understand the '-o' option to output a single-file .sv plans to be deprecated and the way to go is keep generating split files for each module, right?
If not, I could take a look into excluding from the single file output, everything that is a filelist (*.f). I just need some guidance on it.
Thanks!

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 a pull request may close this issue.

2 participants