Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toplevel ref cells are not kept after compile_invoke pass #1993

Open
nathanielnrn opened this issue Apr 3, 2024 · 0 comments
Open

Toplevel ref cells are not kept after compile_invoke pass #1993

nathanielnrn opened this issue Apr 3, 2024 · 0 comments
Labels
C: Calyx Extension or change to the Calyx IL C: FPGA Changes for the FPGA backend

Comments

@nathanielnrn
Copy link
Contributor

nathanielnrn commented Apr 3, 2024

The external-to-ref PR #1952 also removed a well-formedness check so that toplevel components can now contain ref cells. In terms of eventually deprecating @external in favor of ref, it seems like we may want to change the behavior of how the compiler handles ref cells in the toplevel in particular. Namely, the standard compilation currently removes these cells from the top level, so that they are not part of the components' struct. I believe this removal happens in the compile_invoke pass, but I'm not certain about that.

To keep ref in line with how @external behaves, I think it would make sense to both raise the ports of cells to the toplevel, and keep them in the struct. This is in line with how @external doesn't cause cell removal from toplevel components.

In terms of immediate consequences, this would allow yxi to interface with programs that have ref cells in their toplevel, as yxi relies on traversing through memory cells to determine the interface of a program.

Unfortunately this means that #1932 should be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Calyx Extension or change to the Calyx IL C: FPGA Changes for the FPGA backend
Projects
None yet
Development

No branches or pull requests

1 participant