-
Notifications
You must be signed in to change notification settings - Fork 317
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
[SCFToCalyx] Add support for sequential read MemRefType memories #4857
base: main
Are you sure you want to change the base?
Conversation
77cfef5
to
0dd38b0
Compare
@mortbopet Thanks for the feedback! Also thinking that maybe Another problem is that if the |
If a FuncOp argument is of MemRefType and has the boolean attribute calyx.sequential_reads set to true, consider the read acceses to that memory as being sequential, which adds a "read_en" signal to the external memory interface. This "read_en" signal is driven by a memref::LoadOp to a memref with has sequential reads. A register that stores the data read from memory and being forwarded to the next group is created. Currently, the memory access ports contain a single "done" signal, therefore it's not possible to perfom a memory write and load at the same time. This allows interfacing (with extra logic) with protocols such as AXI4. Signed-off-by: Sergi Granell <[email protected]>
0dd38b0
to
5633f0a
Compare
Hmm... In the spirit of keeping this pass atomic, would it make more sense to have a later pass which legalizes the Calyx IR? That is, there may be other passes and optimizations which end up removing output signal drivers, and so these will also require some legalization to drive those outputs to either |
Indeed, sounds good to me! |
Some extra relevant information: Calyx does have memories that support sequential reads and writes and we have a plan to deprecate the current |
// the memory will be considered as having sequential reads. | ||
// This adds a "read_en" signal to the external memory interface, driven by | ||
// memref::LoadOp. | ||
static constexpr std::string_view sSequentialReads = "calyx.sequential_reads"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does std::string_view's static constructor result in a blob in the right segment or is there a function at startup? LLVM has strong feelings about the latter.
@xerpi are you still trying to get this merged? If so, can you fix the merge conflicts? |
I see a couple of differences between what this MR implements and Calyx memory primitives (if I'm not mistaken):
Should the implementation be changed to align it with the Calyx standard for consistency? |
Yeah, I think that sounds like a reasonable plan! @andrewb1999 has proposed a change to the |
If a FuncOp argument is of
MemRefType
and has the boolean attributecalyx.sequential_reads
set to true, consider the read accesses to that memory as sequential, which adds a "read_en" signal to the external memory interface. Thisread_en
signal is driven by amemref::LoadOp
to amemref
with sequential reads.A register that stores the data read from memory and forwarded to the next group is created.
Currently, the memory access ports contain a single "done" signal, therefore it's not possible to perform a memory write and load at the same time.
This allows interfacing (with extra logic) with protocols such as AXI4.