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

[Handshake] Expose pass options in pass constructor #3963

Merged
merged 2 commits into from
Sep 22, 2022

Conversation

Dinistro
Copy link
Contributor

No description provided.

@mortbopet
Copy link
Contributor

Do we need two separate constructors? Based on the following pattern, a single should be sufficient:

https://github.com/llvm/circt/blob/main/include/circt/Dialect/FIRRTL/Passes.h#L66-L69
and

def CreateSiFiveMetadata : Pass<"firrtl-emit-metadata", "firrtl::CircuitOp"> {
let summary = "Emit metadata of the FIRRTL modules";
let description = [{
This pass handles the emission of several different kinds of metadata.
}];
let constructor = "circt::firrtl::createCreateSiFiveMetadataPass()";
let options = [Option<"replSeqMem", "repl-seq-mem", "bool", "false",
"Lower the seq mem for macro replacement and emit relevant metadata">,
Option<"replSeqMemCircuit", "repl-seq-mem-circuit", "std::string", "",
"Circuit root for seq mem metadata">,
Option<"replSeqMemFile", "repl-seq-mem-file", "std::string", "",
"File to which emit seq meme metadata">
];
let dependentDialects = ["hw::HWDialect"];
}

@Dinistro
Copy link
Contributor Author

Duplicating the default arguments might not be the best idea, but we can change it. At some point, we will, either way, adopt the new mlir pass generation (#3962). This change will ensure that pass constructors are generated which take an option struct.

@mortbopet
Copy link
Contributor

new mlir pass generation (#3962)

Awesome, that seems like the right solution. I'm good with this for now, assuming that we migrate over ASAP.

@Dinistro Dinistro merged commit e06e2a2 into main Sep 22, 2022
@Dinistro Dinistro deleted the dinistro/hs-pass-options branch September 22, 2022 05:22
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.

2 participants