-
Notifications
You must be signed in to change notification settings - Fork 61
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
Document setWhen and clearWhen #137
Comments
hmm setWhen isn't only for register. It can also be used for signals val myOutput = out(False)
myOutput setWhen(xxxx)
myOutput clearWhen(yyy) |
Hmm, if I understand correctly, in your example for a simple wire, the Is it equivalent to the line below? val myOutput = xxxx && !yyy To me it is a different use for a register and a wire. So in Scaladoc it would be the same documentation, but in RTD (which is more tutorial-like) it would be good to explain how it is useful in different contexts.
|
For the priority, as it is coded def setWhen(cond: Bool)(implicit loc: Location): Bool = { when(cond){ this := True }; this }
def clearWhen(cond: Bool)(implicit loc: Location): Bool = { when(cond){ this := False }; this } Then according to the last win policy, for "setWhen(cond1) clearWhen(cond2)", clearWhen have high priority, as I understand. |
Right
Yes
Sure, no problem with it ^^
Not realy equiation, but more as Readon said, a priority based logic. |
Great, yakafokon (fr, phonetic expression « (il n')y a qu'à…, (il) faut qu'on… » (en: "one just has to…, one has to…") to tell that we defined what to do but there is nobody yet to do it). Contributions appreciated 🙏 ❤️ |
Should be in: https://spinalhdl.github.io/SpinalDoc-RTD/master/SpinalHDL/Sequential%20logic/registers.html
(source: https://github.com/SpinalHDL/SpinalDoc-RTD/blob/master/source/SpinalHDL/Sequential%20logic/registers.rst)
Simplified example:
The text was updated successfully, but these errors were encountered: