-
Notifications
You must be signed in to change notification settings - Fork 615
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
Implement a SyncReadMem wrapper with explicit read, write, and read/write ports #3228
Conversation
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.
The overall code here is really good with a couple of minor issues. My main comments are bikeshedding about names but as this is probably going to become the main SRAM API for a lot of users, I think we should spend the time to get the names right.
This also needs to consider #3278, it should probably be illegal to mix masked and unmasked write ports. |
Comments on names: simply call it |
As a inspiration for names the Altera/Intel on-chip memory documentation, see around page 4-2 |
Yeah this should definitely be called SyncReadMem, and if we want we could do something like One thing I want to agree on is whether we want to distinguish a |
1 similar comment
Yeah this should definitely be called SyncReadMem, and if we want we could do something like One thing I want to agree on is whether we want to distinguish a |
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.
For the memory wrapper, I have these questions:
- what IR it will be lowered to in the future?(hopefully a memory intrinsic).
- why not use a Module to wrap it like Structural Memory #3131 does.
- for DFT flow, how to meet the MBIST needs.
I personally suggest using the
case class SRAMPortInfo(hasRead: Boolean, hasWrite: Boolean, hasMask: Boolean, portDelay: Int = 1)
class SRAMPort(portInfo: SRAMPortInfo, addressWidth: Int, dataWidth: Int) extends Bundle
class SRAM(width: Int, depth: Int, memoryPorts: Seq[SRAMPortInfo], extraIO: Option[Record] = None, contents: Option[os.Path] = None, macroName: Option[String] = None) extends Module
from #3131, since I think:
- unlike register/wires, memory are always hard-marco from IP vendors, post-syn flow need it to be module and instance.
- API in this PR(chisel types for data,
object
user interfaces) is less intuitive than a singleModule
andBundle
I suggest using that and let users handleData
toUInt
conversion and byte-level granularity mask. - a custom port should be provided in the future PR, it's too much suffer for MBIST design experience with Chisel :(
@sequencer these are all great questions, I think we should discuss at Chisel dev on Monday! |
a48a18d
to
38e3d29
Compare
cb4e198
to
5302feb
Compare
Co-authored-by: Jiuyang Liu <[email protected]>
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.
Looks good, would like a couple of changes to the explanation, then let's get this merged!
…hisel into chisel-mem-interface-api
Concerns have been addressed or are established as future work
…ite ports (#3228) Co-authored-by: Jiuyang Liu <[email protected]> Co-authored-by: Jack Koenig <[email protected]> (cherry picked from commit 8851fae)
…ite ports (#3228) Co-authored-by: Jiuyang Liu <[email protected]> Co-authored-by: Jack Koenig <[email protected]> (cherry picked from commit 8851fae)
…ite ports (#3228) (#3362) Co-authored-by: Jiuyang Liu <[email protected]> Co-authored-by: Jack Koenig <[email protected]> (cherry picked from commit 8851fae) Co-authored-by: Jared Barocsi <[email protected]>
…rite ports (backport #3228) (#3361) * Implement a SyncReadMem wrapper with explicit read, write, and readwrite ports (#3228) Co-authored-by: Jiuyang Liu <[email protected]> Co-authored-by: Jack Koenig <[email protected]> (cherry picked from commit 8851fae) * Delete typeName def --------- Co-authored-by: Jared Barocsi <[email protected]> Co-authored-by: Jared Barocsi <[email protected]>
This PR implements a
SRAM
object, which wraps aSyncReadMem
and instantiates a desired number of read, write, and read/write ports.For example:
generates a 1R, 2W, 1RW
SyncReadMem
with a size of 1000, and is controlled like so:Contributor Checklist
docs/src
?Type of Improvement
Desired Merge Strategy
Squash and merge
Release Notes
This
SyncReadMem
wrapper is instantiated using a new object,SRAM.apply
, and invokes.write
,.read
, and.readWrite
to generate a desired number of read, write, and read/write ports. This function returns a newBundle
wire containing the control signals for each requested port.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
.