hammer icon indicating copy to clipboard operation
hammer copied to clipboard

Manual clock gating

Open edwardcwang opened this issue 5 years ago • 8 comments

We'll leave manual clock gating until we need/want it.

Originally posted by @colinschmidt in https://github.com/ucb-bar/hammer/pull/362#issuecomment-485517427

edwardcwang avatar Apr 22 '19 19:04 edwardcwang

What do you mean by "Manual clock gating"? Generally the next step up from #362 is to do architectural clock gating, which is when you instantiate the clock gating cells in RTL. The technique from #362 tries to opportunistically find registers that it can prove won't update and then skip clock cycles there with a tool-generated control signal.

jwright6323 avatar Apr 22 '19 19:04 jwright6323

Yeah we just need to make sure things like this: https://github.com/freechipsproject/rocket-chip/blob/a457f658a7104e2d8e50b003e3a350c72e18df13/src/main/scala/rocket/RocketCore.scala#L105 work correctly. I believe there shouldn't be anything aside maybe some mapping to a tech cell?

colinschmidt avatar Apr 22 '19 19:04 colinschmidt

Yeah I was thinking an API that lets you do FIRRTL Annotation -> Hammer IR -> Hammer maps something like the above to a tech-specific clock gating cell (which I believe is what Colin is also getting at).

edwardcwang avatar Apr 22 '19 19:04 edwardcwang

👍

jwright6323 avatar Apr 22 '19 20:04 jwright6323

This might be more than "low priority" in that case, if we want to use rocket's clock-gating features.

jwright6323 avatar Apr 22 '19 20:04 jwright6323

Also if freechipsproject/firrtl#1017 ever happens this might no longer be needed due to native firrtl support

jwright6323 avatar May 09 '19 07:05 jwright6323

Well, in that case we'll need a corresponding Hammer pass to extract the FIRRTL primitive and replace it with a greybox. e.g. certain CAD tool vendors may have their own syntax to force something to be synthesized/mapped in a certain way, and clock-related things often need special attention.

edwardcwang avatar May 09 '19 15:05 edwardcwang

Maybe. The tools should be able to map RTL descriptions of clock latches, but we may want to do it manually anyway. I think we'll need to play with it.

jwright6323 avatar May 09 '19 16:05 jwright6323