-
Notifications
You must be signed in to change notification settings - Fork 175
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
FSM state transition weirdness #336
Comments
Right, so this is working as intended. The semantics of nMigen is that later assignments to the same signal ( with m.If(self.counter == self.max):
m.d.sync += state.eq(1)
m.d.sync += state.eq(0) i.e. state would always be 0. |
Ok, I understand now. Still a bit of a gotcha, if you are used to linear programming. Thanks WQ. |
What do you mean by "linear programming" here? |
My brain expected the commands to be executed one at a time and that the m.next was a GOTO statement, so the floating m.next was never executed. Converting my thinking across to RTL where it is compiled into logic constructs is still a work in progress. |
Ah, yeah, I can see how that can be confusing. I'll make sure to cover that in the docs. |
I have no issue with the assign (although maybe it should be an `.eq`?). I
just think it should be `fsm.next` instead of `m.next`.
…On Mon, Mar 16, 2020, 10:10 PM whitequark ***@***.***> wrote:
@awygle <https://github.com/awygle> @emilazy <https://github.com/emilazy>
I think this is actually an argument in favor of keeping the assign-y m.next
= ... syntax as opposed to making it more like a normal function call.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#336 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB35VVSXJ6PNNWKIKSLN2W3RH4A5DANCNFSM4LM5ZYDA>
.
|
Ah, right, that makes a lot of sense. |
When building an FSM I came across a weird issue where an internal state was not executed if a hanging m.next was used.
BOUNCE never gets executed with the m.next = "NEXT" un wrapped.
does work.
full file with simulation
https://github.com/zignig/tinybx_stuff/blob/master/weird_fsm/FSM_weird.py
The text was updated successfully, but these errors were encountered: