Skip to content

Conversation

seldridge
Copy link
Member

Set +incdir for every primary source directory. Previously, only the
root primary source directory would be set.

This change is done to allow for the FIRRTL ABI related to bind layers to
be changed to not use an FIRRTL compiler output directory-relative path
for `include [1]. This is necessary because some flows are
rearranging the directory structure of Chisel-generated Verilog, which
includes layers, and paths relative to the root will break.

This is a compromise between complexity of the build system, ABI
simplicitly, and ease of directory manipulation. This has the effect of
users with custom build flows will need to recognize that they need to set
the +incdir recursively based on all output directories that were
created. Practically, this is easy to do.

Set `+incdir` for every primary source directory.  Previously, only the
root primary source directory would be set.

This change is done to allow for the FIRRTL ABI related to bind layers to
be changed to _not_ use an FIRRTL compiler output directory-relative path
for `` `include `` [[1]].  This is necessary because some flows are
rearranging the directory structure of Chisel-generated Verilog, which
includes layers, and paths relative to the root will break.

This is a compromise between complexity of the build system, ABI
simplicitly, and ease of directory manipulation.  This has the effect of
users with custom build flows will need to recognize that they need to set
the `+incdir` recursively based on all output directories that were
created.  Practically, this is easy to do.

[1]: llvm/circt#8474

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
@seldridge seldridge added the Internal Internal change, does not affect users, will be included in release notes label May 12, 2025
@seldridge seldridge requested a review from jackkoenig May 12, 2025 19:17
}

override def postVisitDirectory(dir: Path, ioe: java.io.IOException): FileVisitResult = {
primarySourcesDirectories += dir.toString()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
primarySourcesDirectories += dir.toString()
primarySourcesDirectories += dir.toString

Nit but I don't think the parentheses are necessary (would be an error if toString were a Scala API, but not for Java APIs).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Fixed in: a92bbc0

@seldridge seldridge merged commit 119630f into main May 12, 2025
15 checks passed
@seldridge seldridge deleted the dev/seldridge/chiselsim-incdir-everything branch May 12, 2025 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal Internal change, does not affect users, will be included in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants