We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm interested in how the If statement actually works. The m module seems to track the current "state" in some way?
If
m
with m.If(self.a): m.d.comb += self.o.eq(self.sub.o) with m.If(self.b): m.d.comb += self.o.eq(self.add.o) with m.Else(): m.d.comb += self.o.eq(self.rnd.o) return m.lower(platform)
How does it actually know that the m.Else() applies to the first m.If(?
m.Else()
m.If(
The text was updated successfully, but these errors were encountered:
It doesn't, just like it wouldn't in the following Python code:
if a: o = sub.o if b: o = add.o else: o = rnd.o
The m.Else() applies to the second m.If().
m.If()
Sorry, something went wrong.
I actually meant the second m.If(). Is m tracking what the current if is?
Ah. Yes. It is tracking the current nesting level and pending statement. Effectively, there is a small FSM inside fhdl.dsl implementing a parser.
fhdl.dsl
No branches or pull requests
I'm interested in how the
If
statement actually works. Them
module seems to track the current "state" in some way?How does it actually know that the
m.Else()
applies to the firstm.If(
?The text was updated successfully, but these errors were encountered: