You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like this should work, but results in errors. This is using the latest pull: nmigen-0.1.dev664+g1976310.
fromnmigenimport*fromnmigen.cliimportmainfromnmigen.hdl.recimport*classThing(Elaboratable):
def__init__(self):
self.useIX=Signal()
self.useIY=Signal()
self.H1=Signal(8)
self.L1=Signal(8)
self.IX=Signal(8)
self.IY=Signal(8)
self.choice=Signal()
self.input=Signal(8)
self.output=Signal(8)
defports(self):
return [
self.useIX, self.useIY, self.H1, self.L1, self.IX, self.IY,
self.choice, self.input, self.output
]
defelaborate(self, platform):
""" If choice is 0, then output H1 or IX depending on whether useIX is 0 or 1. If choice is 1, then output L1 or IY depending on whether useIY is 0 or 1. """m=Module()
H=Array([self.H1, self.IX])[self.useIX]
ifplatform=="bug":
L=Array([self.L1, self.IY])[self.useIY]
else:
L=self.L1reg=Array([H, L])[self.choice]
m.d.comb+=self.output.eq(reg)
returnmif__name__=="__main__":
m=Module()
m.submodules.thing=thing=Thing()
sync=ClockDomain()
main(m, ports=[sync.clk, sync.rst] +thing.ports(), platform="bug")
Traceback (most recent call last):
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 702, in on_statement
super().on_statement(stmt)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 219, in on_statement
new_stmt = self.on_Assign(stmt)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 645, in on_Assign
rhs_sigspec = self.rhs_compiler(stmt.rhs)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 134, in __call__
return self.on_value(value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 402, in on_value
return super().on_value(self.s.expand(value))
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 119, in on_value
new_value = self.on_ArrayProxy(value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 370, in on_ArrayProxy
raise LegalizeValue(value.index, range(len(value.elems)), value.src_loc)
nmigen.back.rtlil.LegalizeValue: ((sig choice), range(0, 2), ('test_array.py', 39))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 702, in on_statement
super().on_statement(stmt)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 230, in on_statement
new_stmt = self.on_statements(stmt)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 719, in on_statements
self.on_statement(stmt)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 714, in on_statement
super().on_statement(stmt)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 219, in on_statement
new_stmt = self.on_Assign(stmt)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 645, in on_Assign
rhs_sigspec = self.rhs_compiler(stmt.rhs)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 134, in __call__
return self.on_value(value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 402, in on_value
return super().on_value(self.s.expand(value))
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 119, in on_value
new_value = self.on_ArrayProxy(value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 368, in on_ArrayProxy
return self.match_shape(elem, *value.shape())
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 464, in match_shape
return self(ast.Slice(value, 0, new_bits))
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 134, in __call__
return self.on_value(value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 402, in on_value
return super().on_value(self.s.expand(value))
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 110, in on_value
new_value = self.on_Slice(value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 351, in on_Slice
return self(value.value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 134, in __call__
return self.on_value(value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 402, in on_value
return super().on_value(self.s.expand(value))
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 119, in on_value
new_value = self.on_ArrayProxy(value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 370, in on_ArrayProxy
raise LegalizeValue(value.index, range(len(value.elems)), value.src_loc)
nmigen.back.rtlil.LegalizeValue: ((sig useIX), range(0, 2), ('test_array.py', 32))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 702, in on_statement
super().on_statement(stmt)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 219, in on_statement
new_stmt = self.on_Assign(stmt)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 645, in on_Assign
rhs_sigspec = self.rhs_compiler(stmt.rhs)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 134, in __call__
return self.on_value(value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 402, in on_value
return super().on_value(self.s.expand(value))
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 119, in on_value
new_value = self.on_ArrayProxy(value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 370, in on_ArrayProxy
raise LegalizeValue(value.index, range(len(value.elems)), value.src_loc)
nmigen.back.rtlil.LegalizeValue: ((sig choice), range(0, 2), ('test_array.py', 39))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test_array.py", line 52, in <module>
main(m, ports=[sync.clk, sync.rst] + thing.ports(), platform="bug")
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/cli.py", line 76, in main
main_runner(parser, parser.parse_args(), *args, **kwargs)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/cli.py", line 58, in main_runner
output = verilog.convert(fragment, name=name, ports=ports)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/verilog.py", line 67, in convert
il_text = rtlil.convert(*args, **kwargs)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 959, in convert
il_text, name_map = convert_fragment(fragment, name)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 953, in convert_fragment
_convert_fragment(builder, fragment, name_map, hierarchy=(name,))
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 810, in _convert_fragment
hierarchy=hierarchy + (sub_name,))
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 854, in _convert_fragment
stmt_compiler(group_stmts)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 240, in __call__
return self.on_statement(stmt)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 714, in on_statement
super().on_statement(stmt)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 230, in on_statement
new_stmt = self.on_statements(stmt)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 719, in on_statements
self.on_statement(stmt)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 714, in on_statement
super().on_statement(stmt)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 219, in on_statement
new_stmt = self.on_Assign(stmt)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 645, in on_Assign
rhs_sigspec = self.rhs_compiler(stmt.rhs)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 134, in __call__
return self.on_value(value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 402, in on_value
return super().on_value(self.s.expand(value))
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 119, in on_value
new_value = self.on_ArrayProxy(value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 368, in on_ArrayProxy
return self.match_shape(elem, *value.shape())
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 464, in match_shape
return self(ast.Slice(value, 0, new_bits))
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 134, in __call__
return self.on_value(value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 402, in on_value
return super().on_value(self.s.expand(value))
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 110, in on_value
new_value = self.on_Slice(value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 351, in on_Slice
return self(value.value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 134, in __call__
return self.on_value(value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 402, in on_value
return super().on_value(self.s.expand(value))
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/hdl/xfrm.py", line 119, in on_value
new_value = self.on_ArrayProxy(value)
File "/home/robertbaruch/.local/lib/python3.6/site-packages/nmigen/back/rtlil.py", line 370, in on_ArrayProxy
raise LegalizeValue(value.index, range(len(value.elems)), value.src_loc)
nmigen.back.rtlil.LegalizeValue: ((sig useIY), range(0, 2), ('test_array.py', 35))
The text was updated successfully, but these errors were encountered:
It seems like this should work, but results in errors. This is using the latest pull: nmigen-0.1.dev664+g1976310.
The text was updated successfully, but these errors were encountered: