circt/test/Conversion/FIRRTLToHW
Fabian Schuiki bd8e050044
[FIRRTL][LowerToHW] Lower contract ops (#8159)
Lower `firrtl.contract` to `verif.contract` ops. The lowering itself is
pretty straightforward, since the ops are basically equivalent. The only
exception are block arguments in FIRRTL that get replaced with op
results in Verif due to the switch from an SSACFG region with dominance
to a graph region.

The block arguments require a slight change to how nested operations are
handled by the pass. Currently, a post-order walk over the operations is
used. This is problematic since the parent operation does not get an
opportunity to lower its block arguments before its child operations are
lowered, which may need access to those block arguments. Switching to a
pre-order walk does not work, since that wouldn't allow us to modify
the operations during the walk, which we obviously do during the
lowering. This commit therefore adds a worklist that tracks operation
ranges that are yet to be lowered. The worklist allows parent operations
to lower themselves and any of their block arguments, and then add the
nested regions, blocks, or operations onto the worklist for lowering.
It's basically a pre-walk with the ability to mutate the parent
operation before children are lowered.

Block arguments are also no longer automatically assumed to be already
lowered. This was only valid for modules, since we lower the module
ports before we lower the module body. In case of ops like contracts,
the block arguments still need to be lowered. To fix this, modules push
a 1-1 mapping of their block arguments into the map of lowered values,
which allows other ops to provide some other lowering for their block
arguments.
2025-02-07 15:34:34 -08:00
..
emit-chisel-asserts-as-sva.mlir [SV] Add MacroRefOp to represet macro statement (#7607) 2024-09-25 17:29:57 +09:00
errors.mlir [FIRRTL] Update subfield format (#4430) 2022-12-10 06:54:57 -08:00
intrinsics-errors.mlir [NFC, FIRRTL] Rename StrictConnect to MatchingConnect. (#7116) 2024-06-04 09:19:00 -05:00
intrinsics.mlir [FIRRTL][LowerToHW] Lower contract ops (#8159) 2025-02-07 15:34:34 -08:00
lower-to-hw-errors.mlir [FIRRTL] Error when seeing inner symbols on zero-width wires and nodes in LowerToHW 2024-07-01 10:40:44 -05:00
lower-to-hw-memories.mlir [NFC, FIRRTL] Rename StrictConnect to MatchingConnect. (#7116) 2024-06-04 09:19:00 -05:00
lower-to-hw-module.mlir [FIRRTL] Use PRINTF_FD macro instead of 0x80000002 as printf fd 2025-01-07 13:07:26 -08:00
lower-to-hw.mlir [FIRRTL][LowerToHW] Lower contract ops (#8159) 2025-02-07 15:34:34 -08:00
module-hierarchy-file.mlir [NFC] test/*: Add newline to files missing EOF newline. 2023-07-07 15:30:10 -05:00
zero-width.mlir [FIRRTL] Change min width of shr for UInt to 0 (#6698) 2024-02-15 14:17:02 -08:00