Add valid & done to DataPortInterface#274
Add valid & done to DataPortInterface#274RossComputerGuy wants to merge 2 commits intointel:mainfrom
Conversation
6f3c66b to
e08aeef
Compare
daaacdd to
d62d867
Compare
mkorbel1
left a comment
There was a problem hiding this comment.
Thank you for the thoughtful contribution! A few questions and comments
| DataPortGroup.data | ||
| ]); | ||
|
|
||
| setPorts([ |
There was a problem hiding this comment.
thought: do we want to make these integrity signals optional/nullable via a flag and hardware components can dynamically choose whether to generated related logic based on their presence?
There was a problem hiding this comment.
Maybe, though would that just be not connecting those up then? If they're not connected, I think ROHD would just not generate those.
There was a problem hiding this comment.
One other consideration here is backwards compatibility. Making them nullable allows for existing implementations using DataPortInterface not to have to do anything should they not want to.
| If( | ||
| wrPort.en & wrPort.addr.eq(entry), | ||
| then: [ | ||
| wrPort.valid < 1, |
There was a problem hiding this comment.
I wonder if including valid and done as part of the RF would impact synthesis' ability to identify these as RFs? Also, I wonder if this generates more logic than is necessary (i.e., can we just do an address range check and a shift-register instead of a per-entry case statement, and would that synthesize differently)?
There was a problem hiding this comment.
Afaict, it doesn't impact yosys's ability to generate RF's. Yosys doesn't even recognize RF's as memories. Also, there's a chance that yosys would just optimize it better than how we have it. Though, idk if we even need an address range check. We might be able to get away with just having wrPort.valid < wrPort.en.
| Logic get data => port('data'); | ||
|
|
||
| /// Whether the data was successfully read or written | ||
| Logic get valid => port('valid'); |
There was a problem hiding this comment.
thought: does calling this valid overload the terminology related to "ready/valid" protocols in a confusing way? @desmonddak what do you think?
There was a problem hiding this comment.
I think valid is the most sensible name since it lets you know whether the request was able to complete. In terms of reading, that means data is valid. In terms of writing, it means the address which was written to is valid.
There was a problem hiding this comment.
it would probably be good to add some testing for when valid and done should be false
There was a problem hiding this comment.
Been trying to but the sim is being picky.
d62d867 to
66bb37a
Compare
66bb37a to
811db00
Compare
kimmeljo
left a comment
There was a problem hiding this comment.
Per the discussion on the ports being required versus optional, for backward compatibility reasons, I'd make the case that they should be optional. This can (probably will) simplify the change set for this PR.
| DataPortGroup.data | ||
| ]); | ||
|
|
||
| setPorts([ |
There was a problem hiding this comment.
One other consideration here is backwards compatibility. Making them nullable allows for existing implementations using DataPortInterface not to have to do anything should they not want to.
|
The dilemma we face is that we are going to start using the Furthermore, we are extending it with a valid bit to call it In that same PR, we are also extending the If we add valid/done to the base memory, we may later find it difficult to create a broad array of memory components (CAM/TCAM/RF/FIFO/SRAM/WriteBuffer) with the various configurations they need. So I want to be careful incrementally extending I think the fork in the road is: do we add nullable For now, I would propose a nullable interface to keep this PR simple, but I am a bit concerned about the concept of 'done' when we want to build a read/valid protocol set of components and 'done' is introducing new semantics potentially. |
Yeah, that is a good idea.
I wouldn't really consider this overloading since having a way to indicate the success & completion of an access is good.
Ah, I wasn't aware of that PR doing it.
I think the nullable way is simpler for this PR. I am not sure about the other way. The thing that I mainly needed from this was knowing when memory, registers, and CSRs access was done and valid.
Imo, ready isn't a great name either since it sounds like it mostly fits read since a write being ready sounds like the data port is ready to be written into and not that it is done writing. |
|
I think in the intervening interval, we merged a PR with significant filesystem reorganization, which means you currently have merge conflicts. I think you should consider a new interface that inherits (which may make it easier for the future I mentioned, which was to consider a tree of data-oriented interfaces for memory-like devices. Or you can proceed with a Logic? add to the existing. The interface is a contract, so if we push too much into the bottom, then there are more exceptions to document for rudimentary components (like a flop-based RF would probably have few features supported). |
Description & Motivation
Adds a valid output to
DataPortInterface. This makes it possible to know whether the read or write has completed successfully.Adds a done output to
DataPortInterface. This makes it possible to know whether the read or write has completed.Related Issue(s)
Seems like #146 is somewhat related since this allows for polling if
validis set and knowing that marks things are valid.Testing
Ensure
test/memory_model.dartpassesBackwards-compatibility
Documentation