Open alchitry opened 2 months ago
I don't have any experience with using inout ports or tristate logic, but having a quick play with the show
command and stepping through the synth command (cough cough) it looks like any semblance of tristate logic is being dropped as soon as it reaches proc
. Looking at a few examples online for tristate logic it seems like you need to assign it with conditional logic, i.e. assign P_button = P_button ? P_button : 'bz;
for it to correctly identify the tristate logic, rather than simply writing z's because then it will optimise to always read back z's (which, again you can see with show
). This is probably also why your other issue, #4371, works with IO_P_button = D_flip_q ? 5'bzzzzz : 5'h0;
.
For what it's worth, this works correctly in both iCEcube2 and Vivado.
I understand this case is kind of pointless since the inout is always z
but it should act just like an input at that point and have its value driven externally.
I agree, but given that read_verilog
does report back Warning: Yosys has only limited support for tri-state logic at the moment.
for the relevant line, I think this is more of a feature request than a bug.
Version
Yosys 0.40+45 (git sha1 dd2195543, g++ 13.2.1 -march=x86-64 -mtune=generic -O2 -fstack-protector-strong -fPIC -Os)
On which OS did this happen?
Linux
Reproduction Steps
Here's a minimal example.
I'm targeting the iCE40HX8K-CB132
Expected Behavior
The
P_button
signal to be read and output onP_led
.Actual Behavior
The
P_button
signal is treated as a constant and the LEDs never turn on.