-
Notifications
You must be signed in to change notification settings - Fork 293
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
Advanced LayerSink #7548
base: main
Are you sure you want to change the base?
Advanced LayerSink #7548
Conversation
5464ac7
to
5031be0
Compare
lib/Firtool/Firtool.cpp
Outdated
// implementation assumes it can run at a time where every register is | ||
// currently in the final module it will be emitted in, all registers have | ||
// been created, and no registers have yet been removed. | ||
if (opt.isRandomEnabled(FirtoolOptions::RandomKind::Reg)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving register randomization to before layerSink, which, as an optimization, can delete registers.
@@ -1,5 +1,5 @@ | |||
// RUN: circt-opt %s -split-input-file | circt-opt -split-input-file | |||
// RUN: firtool %s -split-input-file | |||
// RUN: firtool %s -preserve-values=named -split-input-file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using interesting_name
and preserve-values=named
together to prevent layer-sink from deleting instances or wires that are necessary for the test.
ef5e5c2
to
82c3e10
Compare
5b5a10e
to
f81954a
Compare
c8ac255
to
89335f5
Compare
Add advanced layer sink, a new FIRRTL-dialect transform pass. Advanced layer sink serves the same purpose as the original layer sink pass: move ops into layers if their uses permits it. Advanced layer sink works by finding the shallowest block a value is used by an effectful op, and then sinking the defining op to that block. Compared to the original layer sink pass, which only relied on dominance info, this pass can sink cyclical structures, such as registers.