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

[circt-reduce] Add FIRRTL name sanitization #5723

Merged
merged 2 commits into from
Jul 29, 2023

Conversation

seldridge
Copy link
Member

Add two new pseudo-reduction patterns:

  • module-name-sanitizer
  • module-internal-name-sanitizer

These are not true reductions as they only do cleanup of the circuit.
However, they make a number of modifications which are typically made by a
circt-reduce user before sharing the result of a circt-reduce run:

  • All internal names are converted to generic names
  • All modules are replaced with metasyntactic names

These have the lowest priority, are one-shot, and will accept a larger
circuit result (even though they should almost always produce a smaller
output).

@seldridge seldridge marked this pull request as draft July 28, 2023 19:30
@seldridge seldridge changed the base branch from main to dev/seldridge/circt-reduce-operation-forwarder-one-operand July 28, 2023 20:39
@seldridge seldridge marked this pull request as ready for review July 28, 2023 21:34
@seldridge
Copy link
Member Author

Note that the utility of this is slightly hampered by the FIRRTL exporter not creating unique names (#5721) and by some FIRRTL passes having problems with duplicate port names (#5727).

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.

This is great! LGTM

Comment on lines +1000 to +1007
const char *names[48] = {
"Foo", "Bar", "Baz", "Qux", "Quux", "Quuux", "Quuuux",
"Quz", "Corge", "Grault", "Bazola", "Ztesch", "Thud", "Grunt",
"Bletch", "Fum", "Fred", "Jim", "Sheila", "Barney", "Flarp",
"Zxc", "Spqr", "Wombat", "Shme", "Bongo", "Spam", "Eggs",
"Snork", "Zot", "Blarg", "Wibble", "Toto", "Titi", "Tata",
"Tutu", "Pippo", "Pluto", "Paperino", "Aap", "Noot", "Mies",
"Oogle", "Foogle", "Boogle", "Zork", "Gork", "Bork"};
Copy link
Contributor

Choose a reason for hiding this comment

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

Love it!

@seldridge seldridge changed the base branch from dev/seldridge/circt-reduce-operation-forwarder-one-operand to main July 29, 2023 20:16
Move the SymbolCache struct used by the FIRRTL circt-reduce library into
its own "detail" namespace to avoid future conflicts with SymbolCache
inside FIRRTLUtils.h.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
Add two new pseudo-reduction patterns:

  - module-name-sanitizer
  - module-internal-name-sanitizer

These are not true reductions as they only do cleanup of the circuit.
However, they make a number of modifications which are typically made by a
circt-reduce user before sharing the result of a circt-reduce run:

  - All internal names are converted to generic names
  - All modules are replaced with metasyntactic names

These have the lowest priority, are one-shot, and will accept a larger
circuit result (even though they should almost always produce a smaller
output).

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
@seldridge seldridge force-pushed the dev/seldridge/circt-reduce-name-sanitizer branch from b24f2b0 to 1a45ea5 Compare July 29, 2023 20:17
@seldridge seldridge merged commit 1a45ea5 into main Jul 29, 2023
5 checks passed
@darthscsi darthscsi deleted the dev/seldridge/circt-reduce-name-sanitizer branch June 4, 2024 14:46
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