Hi,
I have noticed that the use of shadow signals lead often to conversion problems. I have not found the exact conditions yet, so I have no small reproducible example.
But in my github repo https://github.com/bonfireprocessor/bonfire-core (which is just WIP…)
I have a branch “slice_problem” which exemplifies the problem.
To reproduce clone the repo, checkot branch slice_problem and than run tb_run.py.
The resulitng trace should be:
File "tb_run.py", line 30, in <module>
test(tb_alu.tb(c_shifter_mode="pipelined"),trace=True)
File "/usr/local/lib/python2.7/dist-packages/myhdl/_block.py", line 196, in __call__
self.srcline, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/myhdl/_block.py", line 218, in __init__
self.subs = _flatten(func(*args, **kwargs))
File "/home/thomas/development/bonfire/bonfire-core/tb/tb_alu.py", line 39, in tb
inst.convert(hdl='VHDL',std_logic_ports=True,path='vhdl_gen', name="alu_" + c_shifter_mode )
File "/usr/local/lib/python2.7/dist-packages/myhdl/_block.py", line 342, in convert
return converter(self)
File "/usr/local/lib/python2.7/dist-packages/myhdl/conversion/_toVHDL.py", line 255, in __call__
_convertGens(genlist, siglist, memlist, vfile)
File "/usr/local/lib/python2.7/dist-packages/myhdl/conversion/_toVHDL.py", line 600, in _convertGens
v.visit(tree)
File "/usr/lib/python2.7/ast.py", line 241, in visit
return visitor(node)
File "/usr/local/lib/python2.7/dist-packages/myhdl/conversion/_toVHDL.py", line 1403, in visit_Module
self.visit(stmt)
File "/usr/lib/python2.7/ast.py", line 241, in visit
return visitor(node)
File "/usr/local/lib/python2.7/dist-packages/myhdl/conversion/_toVHDL.py", line 1770, in visit_FunctionDef
senslist = compressSensitivityList(self.tree.senslist)
File "/usr/local/lib/python2.7/dist-packages/myhdl/conversion/_toVHDL.py", line 1762, in compressSensitivityList
name = item._name.split('(', 1)[0]
AttributeError: 'NoneType' object has no attribute 'split'
When doing the same with the master branch, everthing works.
The difference is line 78 in alu.py:
branch slice_problem:
shift_inst=shift_pipelined(clock,reset,self.op1_i,shifter_out,self.op2_i(5,0), \
shift_right,fill_v,shift_en,shift_ready, 3 if c_shifter_mode=="pipelined" else 0 )
branch master:
shift_amount=Signal(intbv(0)[5:])
shift_inst=shift_pipelined(clock,reset,self.op1_i,shifter_out,shift_amount, \
shift_right,fill_v,shift_en,shift_ready, 3 if c_shifter_mode=="pipelined" else 0 )
@always_comb
def shift_comb():
shift_valid.next = shift_ready
shift_amount.next = self.op2_i[5:0]
.....
From simulation perspective both variants run the same.
Is there any rule when I can use a shadow signal?
BTW: The conversion call in the test bench (tb.alu.py) is only for testing convertiblty of the design.