[Libre-soc-bugs] [Bug 671] convert spec pseudocode to use XLEN width
bugzilla-daemon at libre-soc.org
bugzilla-daemon at libre-soc.org
Mon Aug 30 12:50:52 BST 2021
https://bugs.libre-soc.org/show_bug.cgi?id=671
--- Comment #34 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
a new test in power_pseudo.py
[0]*16]
produces this:
Module(body=[Expr(value=Call(func=Name(id='concat', ctx=Load()),
args=[Constant(value=0)], keywords=[keyword(arg='repeat',
value=Constant(value=16))]))])
astor dump
Module(
body=[
Expr(
value=Call(func=Name(id='concat'),
args=[Constant(value=0)],
keywords=[keyword(arg='repeat', value=Constant(value=16))]))])
to source
concat(0, repeat=16)
where the following:
[0]*(XLEN-16)
instead produces this:
Module(body=[BinOp(left=List(elts=[Constant(value=0)], ctx=Load()), op=Mult(),
right=BinOp(left=Name(id='XLEN', ctx=Load()), op=Sub(),
right=Constant(value=16)))])
astor dump
Module(
body=[
BinOp(left=List(elts=[Constant(value=0)]),
op=Mult,
right=BinOp(left=Name(id='XLEN'), op=Sub,
right=Constant(value=16)))])
to source
([0] * (XLEN - 16))
this is a bug.
the source code generated should have been:
concat(0, repeat=XLEN-16)
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-soc-bugs
mailing list