Skip to content

Conversation

@SimonEbner
Copy link
Contributor

Break out the circt-verilog import pipeline so it can reused easily.

@SimonEbner SimonEbner force-pushed the circt-verilog-pipeline branch 2 times, most recently from f231527 to 7c48b5e Compare November 7, 2025 19:46
@SimonEbner SimonEbner changed the title Move circt-verilog pipeline into ImportVerilog. [circt-verilog] Move pipeline into ImportVerilog. Nov 8, 2025
@SimonEbner SimonEbner force-pushed the circt-verilog-pipeline branch 4 times, most recently from a25df3d to f97b81c Compare November 8, 2025 21:41
Copy link
Member

@jpienaar jpienaar left a comment

Choose a reason for hiding this comment

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

It would be nice to be able to reuse this - much less guess work and enables mixing and matching in pass pipeline.

const ImportVerilogOptions *options = nullptr);

/// Optimize and simplify the Moore dialect IR.
void verilogToMoorePipeline(mlir::PassManager &pm);
Copy link
Member

Choose a reason for hiding this comment

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

Could we just forward declare PassManager too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, done.

/// command line options.
static void populatePasses(PassManager &pm) {
populateMooreTransforms(pm);
verilogToMoorePipeline(pm);
Copy link
Member

Choose a reason for hiding this comment

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

Is the main reason you made 3 instead of 1 populate method so that you could have this same split?

Copy link
Contributor Author

@SimonEbner SimonEbner Nov 9, 2025

Choose a reason for hiding this comment

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

Yes, basically just moved the pipelines into the lib. On one hand it seems cleaner to have the flow control outside the pipeline (opts.loweringMode). OTOH, having just one pipeline seems easier to use. No strong preference on my end, happy to coalesce the pipelines into one if preferred.

@SimonEbner SimonEbner force-pushed the circt-verilog-pipeline branch 2 times, most recently from 415aa14 to 3e2e27c Compare November 10, 2025 08:46
Break out the circt-verilog import pipeline so it can reused easily.
@SimonEbner SimonEbner force-pushed the circt-verilog-pipeline branch from 3e2e27c to f0e54b7 Compare November 10, 2025 08:48
Copy link
Member

@jpienaar jpienaar left a comment

Choose a reason for hiding this comment

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

Seems good refactoring to enable reuse as library. Lets perhaps give one day if there is any objection, but seems good to me.

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.

LGTM! Great idea having this factored out and reusable!

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