Skip to content

Add simple automatic enum based clock gating

Frans Skarman requested to merge clkgate into master

A decent chunk of chip energy usage is caused by signals switching from 1 to 0. It can be mitigated by keeping previous values in registers when they are unused. Normally this is done manually, but since we know which signals enable registers storing enums, we can do it manually in Spade.

This is an initial implementation of that idea, that is hard coded for the Option type and can be used to get an idea of the usefulness.

I also added an optimize attribute which can be added to modules to optimize them using specific passes. This isn't really meant to be used in practice, but it is useful if we want to test passes in the swim_test_project without changing configuration or passing flags around

Author checklist

  • New Diagnostics have at least one snapshot test that triggers it
  • Added a line to CHANGELOG.md, if relevant

Merge request reports