This commit introduces a standardized synthesis pipeline and restructures the codebase:
* Creates a new SynthesisPipeline class to define the default synthesis pipeline. This pipeline serves both circt-synth and is exposed through the C API for Python bindings.
* Added a dedicated Synthesis directory under `lib/` to house synthesis-related code. This architectural change is aimed to promote synthesis capabilities to a first-class component within CIRCT rather than limiting it to the circt-synth tool.
Add a new pass that allows running passes under hierarchy. This is useful when
we want to run synthesis passes only on real designs.
This implementation is based on MLIR's upstream CompositePass and Inliner utilities.
The pass takes a pipeline string and runs it on modules in the design hierarchy.
It supports configurable options including the pipeline to run under hierarchy,
the name of the top-level module, and whether to include bound instances in
the hierarchy traversal.
The implementation updates circt-synth tool with the required library
dependencies and necessary dialect and pass headers.
This PR adds a new pass `HWAggregateToComb` that lowers array operations to comb operations. The pass converts:
- `hw.array_get` to a mux tree using comb operations
- `hw.array_create` and `hw.array_concat` to `comb.concat`
- `hw.aggregate_constant` to `comb.concat` of individual constants
The PR also moves two utility functions from CombToAIG to the Comb dialect:
- `extractBits`: Extracts individual bits from a value
- `constructMuxTree`: Builds a multiplexer tree from selectors and leaf nodes
The pass is required to run before CombToAIG to ensure array operations are
properly lowered to AIG. Strictly speaking other than array_get operations can be preserved
but array values prevent optimizations at AIG level. So for the simplicity, I think it's reasonable
to lower array operations within circt-synth pipeline.
This adds a conversion pass from AIG dialect to Comb dialect. AndInverterOp can be easily converted into comb.and + comb.xor + hw.constant.
This enables us to utilize core dialects tools for synthesis results without any addition. Primarly use case is running LEC on IR before and after synthesis.