calyxir / calyx

Intermediate Language (IL) for Hardware Accelerator Generators
https://calyxir.org
MIT License
450 stars 44 forks source link

Add a `StaticSchedule` Analysis #2033

Closed calebmkim closed 2 weeks ago

calebmkim commented 2 weeks ago

Making progress towards #520.

This PR doesn't actually add optimizations (e.g., one-hot encoding). It just refactors the code to make it easy to support this in subsequent PRs. In fact, it shouldn't change anything about the compiled designs (apart from the order cells and groups are instantiated).

The main contribution of this PR is a StaticSchedule struct that is used by compile-static, and includes a lot of code that is simply lifted from thecompile-static pass. It has a realize_schedule() method that instantiates the FSM. In order to introduce optimizations, we'll just have to edit the realize_schedule() method, which shouldn't be difficult.

(Edit): This PR also merges the compile-static and compile-static-interface pass into a single pass.

calebmkim commented 2 weeks ago

Merging this-- it doesn't change the generated code, just refactors and abstracts a lot of things.

Should make implementing FSM optimizations a lot easier.