circt icon indicating copy to clipboard operation
circt copied to clipboard

[SCFToCalyx] Use `ref` construct when lowering `memref`

Open rachitnigam opened this issue 2 years ago • 1 comments

The current scf to calyx conversion handles memref arguments by directly inlining all the ports for the memory into the component's interface. Instead of doing this, we should use the new ref keyword from Calyx and let lower passes handle the transformation of a ref cell by inlining its ports into the component.

The ref keyword is more general–it allows you to pass in any component by reference into another component to express component sharing–and it allows the compiler to simultaneously generate simulatable and synthesizable code. In the current state of affairs, the compiler cannot simulate designs that only have toplevel memrefs in them.

Note that this also requires changing the invoke construct to accept components by name (see documentation from Calyx above).

rachitnigam avatar Mar 15 '23 05:03 rachitnigam

This also requires solving #1679 because the ref syntax only works with invoke

rachitnigam avatar May 18 '23 15:05 rachitnigam

Addressed by #7164.

cgyurgyik avatar Jan 18 '25 05:01 cgyurgyik