-
Notifications
You must be signed in to change notification settings - Fork 16
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
Shift storage #709
base: master
Are you sure you want to change the base?
Shift storage #709
Conversation
@def_method(m, self.delete, ready=self._last > 0) | ||
def _(addr): | ||
m.d.top_comb += delete_address.eq(addr) | ||
with m.If(addr < self._last): |
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.
What's the purpose of this If
? It makes the delete not happen if a wrong address is passed. What's the use case? I believe this behavior could create silent bugs. Maybe use an assertion instead?
|
||
@def_method(m, self.read) | ||
def _(addr): | ||
return {"data": self._data[addr], "valid": addr < self._last} |
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.
Do you have an use case for reading invalid addresses?
m.d.top_comb += affected_by_delete.eq(addr > delete_address) | ||
with m.If(update_req_valid & (last_decr.implies(delete_address != addr))): | ||
m.d.sync += self._data[addr - Mux(last_decr, affected_by_delete, 0)].eq(data) | ||
return {"err": ~update_req_valid} |
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.
Same as above. If there is no use case, I prefer an assertion to a bit which can be easily ignored.
Here is a PR with implemtation of shift storage to be used in LSU RS. I used hypothesis to do tests and now working with it was much more comfortable than previously.
TODO: