calyxir/calyx

Change well-formedness check to allow for toplevel `ref` memories

Closed this issue · 2 comments

As part of #1932 and #1733 we probably want to allow toplevel modules to contain ref memories and still be considered wellformed. Perhaps only if we designate that we wish to compile for synthesis/AXI wrapped. Not sure where this well-formed check lives as of writing.

The check lives here!

// Main component cannot use `ref` cells
if comp.name == ctx.entrypoint {
for cell in comp.cells.iter() {
if cell.borrow().is_reference() {
return Err(Error::malformed_structure(
"ref cells are not allowed for main component",
)
.with_pos(cell.borrow().get_attributes()));
}
}
}

I say we can just delete this. No fuss, no muss.

Closed via #1952