Well-formedness of done
signals
#788
Replies: 1 comment 2 replies
-
I agree that both of these examples are clearly examples of mistakes based on our current interpretation of To think about what might be a good condition to put on the code, I think it would be best to reason about the exact correspondence between the static conditions and the dynamic behavior that constitutes a "correct" use of I think the |
Beta Was this translation helpful? Give feedback.
-
I've been a little more deeply about what makes the
done
signal of a group and a component to be well-formed. Here are a few examples ofdone
conditions that don't make sense.Examples
done
conditions:The likely intention of the program is to say that the group is done when both registers
reg0
andreg1
have set theirdone
signal high once. However, in reality, this says that the group is done in the cycle whenreg0
andreg1
simultaneously set their done signals high.To encode the intended behavior, we need some state:
done
conditions:Here is a
done
condition I was recently thinking about:This component says that its
done
whencount - in == 10
. However, theeq
component is combinational which means that when the component is invoked, we'll have something like:Which means that the assignment
eq.left
etc. will have a guard that depends oneq.out
creating a combinational loop.A Well-Formedness Definition
One possible definition for well-formedness is that only signals that have the
@done
annotation or@stable
annotation can be assigned as the right hand side of a done condition and logical combinations thereof. Using this definition, we have:&
is neither@done
nor@stable
whereasout
signal of registers is@stable
which means the logical and is also@stable
.eq.out
is not@stable
nor@done
.I'm not sure if this definition is actually the right one but it's a start.
Beta Was this translation helpful? Give feedback.
All reactions