-
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
Add condition
based MethodFilter
#504
Add condition
based MethodFilter
#504
Conversation
A remark to remember is that the usage of |
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.
Approved, but maybe if it doesn't cause any logic penalty this:
with condition(m, nonblocking=True) as branch:
with branch(cond):
m.d.comb += ret.eq(self.target(m, arg))
would be cleaner? (nonblocking=True
to automatically generate empty default condition - equivalent to ~cond)
transactron/lib/transformers.py
Outdated
if self.use_condition: | ||
cond = Signal() | ||
m.d.top_comb += cond.eq(self.condition(m, arg)) | ||
with condition(m, nonblocking=False) as branch: |
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 conditions are mutually exclusive - maybe priority=False
should be used?
Or remove the second branch and use nonblocking=True
, as @piotro888 suggested. Right now you use both exclusivity and transaction priorities - do you see any advantage of this, or is this accidental?
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.
I'm waiting with merge until this is resolved.
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.
We can not use nonblocking=True
here. The condition
class doesn't use two state logic. We have:
- True and ready
- False and ready
- Not ready
If the cond=1
and target
is not ready, then with nonblocking=True
the transaction will execute and so the whole method will execute, which will be wrong because the data instead of being forwarded will be dropped.
I added priority=False
, this shouldn't impact the logic.
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.
Address the review comment.
This MR is the first fragment of #395 to port to the trunk. Here I extend
MethodFilter
with possibility to usecondition
under the hood to ignore situations, where method is not ready and condition is false. This has the caveats that resulting filter issingle_caller
so both versions should coexistence.