-
Notifications
You must be signed in to change notification settings - Fork 299
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
[FIRRTL] Add a new op interface for combinational loop detection. #7120
Conversation
de60a3e
to
8002102
Compare
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.
Is this interface flexible enough to model dependency for probe?
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 not sure how to handle Reftypes, since it cannot be determined locally, it requires a lot of state information like, "What the Ref type is pointing to ?", "What are the aliases for FieldRefs". I don't think this interface can handle refs.
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 not sure how to handle Reftypes, since it cannot be determined locally, it requires a lot of state information like, "What the Ref type is pointing to ?", "What are the aliases for FieldRefs". I don't think this interface can handle refs.
That's fair. LGTM.
The pairs of dataflow between FieldRef's are required to be leaf-most/ground types, is that right? This would be good to note. Having interface for this is great! I have some doubts about default being assuming the operation is indeed "combinatorial" (since that means mixing in operations we don't understand will cause this pass to /error out/ until those operations implement this interface to opt-out appropriately)-- that is to say, from a "safety" perspective it's conservatively more correct to over-record the dataflow (well, from operands -> results at least, it may have more complicated behavior re:side-effects beyond flowing to its results locally) through unknown operations but from a "don't abort the compilation if we really don't know" perspective it seems like maybe default should be to ignore unknown operations? If Dialects wish to participate in /FIRRTL/'s notion of comb-loop-checking, they can opt-in. Just some thoughts, probably this serves our needs for now without overdoing it. Implementing it for our operations is a nice way to show this working, neat! Looking at this a bit, it seems for registers this interface only tells part of the story -- looks like the pass still hardcodes knowledge of those operations (reg/regreset) -- can this be refactored? (If a new op wants to be register-like, can it use this interface to accomplish that?) |
@dtzSiFive , thanks for your comments,
Right, I will add a comment with this note.
Actually, here I took the shortcut, that is the assumption is that every operation, other than just the 3 in FIRRTL, have the default behavior. So, you should need to annotate only the very few special ops. That's why initially I was suggesting a
That's a good idea, so you mean a new |
Add a new
CombDataflow
op interface toFIRRTL
.This interface is used for specifying the combinational dataflow that exists
in the results and operands of an operation. Any operation that doesn't
implement this interface is assumed to have a combinational dependence
from each operand to each result.
Only
FIRRTL
register and memory ops implement this interface, but it can be used in otherdialects that intend to use the
CheckCombCycles
pass.