-
Notifications
You must be signed in to change notification settings - Fork 637
Structural Memory #3131
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
base: main
Are you sure you want to change the base?
Structural Memory #3131
Conversation
c9a6195
to
4d82ac3
Compare
I agree with the need for a new Chisel interface to create memories. However, why do we need an intrinsic for that instead of using the standard |
4d82ac3
to
45982eb
Compare
Sorry for the late reply, I was in the hospital these days. I just read the spec, I think this should be a good idea, but I think there are some issues in spec that we need concern:
I think this issue should follow #3162, in the future, we should add more metadata to firrtl spec, and switch to it. and then deprecate and remove the memory behavior model get rid of firrtl mem. |
45982eb
to
177a14f
Compare
34b6430
to
939778e
Compare
I thought about today, here is my solution to this:
|
We should totally add that.
Most firrtl runs are for simulation and for that, there should be an accurate simulation model. This is why I think using a firrtl mem by default and replacing it with a hard macro for physical design makes the most sense. For FPGAs we can even make sure that the Verilog generated gets correctly inferred as BRAM thus making things work well by default.
But what is the behavior of this? Ideally there should be one specification of how a Memory behaves and that the RTL designer has to know to make sure the high-level description is correct. For the mapping to different memory technologies you then just need to ensure that the physical macro is a valid refinement of the memory spec, i.e., it correctly implements all defined behaviors. So to summarize: Yes, you could use an intrinsic for memory. However, I believe you then need to precisely define the semantics of this module and also add a behavioral default implementation for simulation. Which in the end means you just end up with something which is pretty much the same as the firrtl.mem today (plus some small additional features that we could also just add to the firrtl.mem). |
Like I said, I think a memory should be a instance rather a
I just come across llvm/circt#5009, I think it should be directly map to this Op.
Agree, the only reason I wanna use |
This PR implements #3162, by creating a
RawModule
which should represent a SRAM macro.Contributor Checklist
docs/src
?Type of Improvement
API Impact
Backend Code Generation Impact
Desired Merge Strategy
Release Notes
Reviewer Checklist (only modified by reviewer)
3.5.x
or3.6.x
depending on impact, API modification or big change:5.0.0
)?Enable auto-merge (squash)
, clean up the commit message, and label withPlease Merge
.Create a merge commit
.