llvm / llvm/circt

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

Open
#4,249 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

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).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the inline blackbox Verilog case through firtool and inspect the generated .sv output, including the behavior with --split-verilog -o=generated. Trace where blackbox filenames are emitted and verify that the resulting output no longer appends them and compiles successfully with Verilator; check whether the blank top-level file is a separate failure.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.