-
Notifications
You must be signed in to change notification settings - Fork 902
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
clockgate: centralize clock enables out of FFs #4583
Conversation
33ac046
to
7294ef2
Compare
Hi @widlarizer, this looks very interesting! Thanks for your work 🙌 |
Those should be converted to an FF with a clock enable input by the application of |
That's great, thanks! |
Sure thing! |
7294ef2
to
e64fcee
Compare
Related work:
|
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.
Looks good, there's a nit with setting the tie-low port and some rephrasing suggestions
passes/techmap/clockgate.cc
Outdated
log("Creates gated clock nets for sets of FFs with clock enable\n"); | ||
log("sharing a clock and replaces the FFs with versions without\n"); | ||
log("clock enable inputs. Intended to reduce power consumption\n"); | ||
log("in ASIC designs.\n"); |
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.
log("Creates gated clock nets for sets of FFs with clock enable\n"); | |
log("sharing a clock and replaces the FFs with versions without\n"); | |
log("clock enable inputs. Intended to reduce power consumption\n"); | |
log("in ASIC designs.\n"); | |
log("This pass transforms a set of FFs sharing the same clock and\n"); | |
log("enable signal into a set of enable-less FFs and a clock gating\n"); | |
log("cell. This is primarily a power-saving transformation on ASIC\n"); | |
log("designs.\n"); |
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.
It does many sets at once, typically. Hence the plural, even if it's awkward, is more correct. It's good that you found a way to add mentioning the ICG, I'll def adapt that
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.
In that case let me suggest "This pass transforms each set of FFs"
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.
Adapted
Co-authored-by: Martin Povišer <[email protected]>
What are the reasons/motivation for this change?
According to several users, large power savings in ASICs can be achieved by centralizing clock gating per clock domain rather than routing CLK and EN into many FFs.
Explain how this is achieved.
The new
clock_gate
command allows the user to specify a rising edge clock gating cell ("ICG") with-pos
and a falling one with-neg
. Within each selected module, flip flops driven with the same clock and enable signals of the same polarities are grouped. If this group has more flops than the threshold set by-min_net_size N
, they are converted viakernel/ff.h
to versions withouth clock enable, and corrsepondingly, clock gating cells are emitted to create one GCLK net per flop group.Since clock gates often have DFT ports, those are assumed to be required tied low. They can be listed with repeated
-tie_lo
pass args.It's also assumed that ICGs have active-high CE pins. This is based on the fact that there doesn't seem to be a provision in the liberty file format to describe that polarity either way. This pass may in the future be adapted to search for usable cells in a provided
.lib
file.clock_gate -pos pdk_icg ce:clkin:clkout -tie_lo scanen
If applicable, please suggest to reviewers how they can test the change.
Run the included test which doesn't test anything but shows off the design. Use
-min_net_size
to show that you can eliminate small cases.