Skip to content
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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

lekcyjna123
Copy link
Contributor

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:

  • refactor test_transactron_lib_storage to have common generic_process function

@lekcyjna123 lekcyjna123 added the enhancement New feature or request label May 21, 2024
@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):
Copy link
Member

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}
Copy link
Member

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}
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants