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

[Calyx] Generate non-combinational reads for memories #393

Closed
rachitnigam opened this issue Aug 19, 2022 · 2 comments
Closed

[Calyx] Generate non-combinational reads for memories #393

rachitnigam opened this issue Aug 19, 2022 · 2 comments

Comments

@rachitnigam
Copy link
Member

With calyxir/calyx#1145 merged, Calyx has basic support for memories with non-combinational reads. We should change the Calyx backend for Dahlia to generate these sequential read memories instead of the default memories. There are a couple of challenges with doing this:

We probably need to address #384. This is because the pass currently generates a bunch of code that all assigns to the addr0 signal of the memory and reads from the out port. However, with sequential reads, there is no guarantee when a particular read will appear and it is doubly dubious to be assigning to the same ports of the memory.

We should probably switch to a "prime-and-read" model of reading memories: one group is responsible for "priming" the read from a memory by setting the read_en signal and waiting for read_done. Since the memory registers the last address, the next group can just read from the memory's out port.

One thing to be careful about is that if there ever a write_en between the read_en and use of out, the value on out will be invalidated. However, I think Dahlia's guarantees will make sure this doesn't happen.

@rachitnigam rachitnigam changed the title [Calyx] Generated non-combinational reads for memories [Calyx] Generate non-combinational reads for memories Aug 19, 2022
@rachitnigam
Copy link
Member Author

Addressed for 1-dimensional memories by #394

@rachitnigam
Copy link
Member Author

Fixed by #396

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant