[myhdl-list] Tristate 8 bit bi-directional
Brought to you by:
jandecaluwe
From: Edward V. <dev...@sb...> - 2016-05-13 14:23:57
|
Hello All I came across Josy Boelen simpletristateexample.py. Josy code works great. I started from his code and created mul_ts.py https://gist.github.com/441d86f67d3fdac12d53d1f93e44fcea.git in hopes of getting to a 8 bit Bi-directional Signal. I import his simpletristateexample.py https://gist.github.com/c816d585e12ae397627b.git My code converts and I can simulate with the following cmds python mul_ts.py --convert & python mul_ts.py --trace When I uncoment lines 73-75 my code. ''' @always_comb def rtl2(): t_rpi2B.next = concat(ts7,ts6,ts5,ts4,ts3,ts2,ts1,ts0) ''' My code will not convert or trace. This is the error that I get. t_rpi2B.next = concat(ts7,ts6,ts5,ts4,ts3,ts2,ts1,ts0) File "/usr/local/lib/python2.7/dist-packages/myhdl-1.0dev-py2.7.egg/myhdl/_concat.py", line 79, in concat val = val << w | v & (long(1) << w)-1 TypeError: unsupported operand type(s) for <<: 'NoneType' and 'int' I have also tried which converts but will not trace @always_comb def rtl2(): t_rpi2B.next = ts7*128+ts6*64+ts5*32+ts4*16+ts3*8+ts2*4+ts1*2+ts0 With this error t_rpi2B.next = ts7*128+ts6*64+ts5*32+ts4*16+ts3*8+ts2*4+ts1*2+ts0 File "/usr/local/lib/python2.7/dist-packages/myhdl-1.0dev-py2.7.egg/myhdl/_Signal.py", line 379, in __mul__ return self._val * other TypeError: unsupported operand type(s) for *: 'NoneType' and 'int' My issue is that I can not combine the 8 tristate signals to a bus. I appreciate any help. Edward Vidal Jr. e-mail dev...@sb... 915-595-1613 |