-
Notifications
You must be signed in to change notification settings - Fork 170
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
Assignment to a Record with zero-width fields generates invalid Verilog #312
Labels
Milestone
Comments
Comment by whitequark Hm, arguably this is a bug in Yosys, but I think we can just not generate assignments to zero width lvalues. |
A variant of this bug can still occur accross module boundaries. Repro: from nmigen import *
from nmigen.back import rtlil, verilog
class Top(Elaboratable):
def elaborate(self, platform):
m = Module()
r1 = Record([("addr", 0), ("data", 8)])
r2 = Record([("addr", 0), ("data", 8)])
r3 = Record([("addr", 0), ("data", 8)])
m.submodules.a = a = Module()
m.submodules.b = b = Module()
a.d.comb += r1.eq(0)
m.d.comb += r2.eq(r1)
b.d.comb += r3.eq(r2)
return m
print(verilog.convert(Top()))
# print(rtlil.convert(Top())) This time Yosys chokes with a parser error:
RTLIL output:
|
@jfng That's a slightly different bug with a different cause--could you open another issue to track that one? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue by jfng
Friday Jan 24, 2020 at 16:39 GMT
Originally opened as m-labs/nmigen#312
Repro:
Verilog output:
RTLIL output:
The text was updated successfully, but these errors were encountered: