Skip to content

Conversation

tmckay-sifive
Copy link
Contributor

In order to generate accurate file lists for a subset of the circuit, we must know what files correspond to extmodules if they are emitted by firtool (for example, FIRRTL extmodules with a BlackBoxInlineAnno).

This change adds an optional attribute files to the hw.module.extern op which refers to any emit.file ops corresponding to it.

@tmckay-sifive tmckay-sifive marked this pull request as ready for review October 2, 2025 16:48
Copy link
Contributor

@fabianschuiki fabianschuiki left a comment

Choose a reason for hiding this comment

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

If I understand correctly, this makes hw.module.extern refer to an emit.file, and emit.file already refers to hw.module.extern. Do we want circular symbol/name references in the IR? Since the emit.file op and its nested ops already refer to hw.module.extern ops by their symbol, that should give us the extmodule -> file association that you're looking for.

(This probably makes generating file lists easier because there's less IR traversal that needs to happen in that tool. But I'm wondering if we shouldn't put the complexity of this reverse lookup into that tool instead of making the IR more complex.)

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 this pull request may close these issues.

3 participants