Open flaviens opened 9 months ago
I have run your testbench and there are several issues, as usual. First, it does not work in Icarus:
top.sv:10: error: Port in_data of module top is declared as input and as a reg type.
tb_icarus.sv:6: warning: input port in_data is coerced to inout.
tb_icarus.sv:13: error: in_data['sd31:'sd0]Part select is double-driving unresolved wire.
tb_icarus.sv:14: error: in_data['sd63:'sd32]Part select is double-driving unresolved wire.
tb_icarus.sv:15: error: in_data['sd95:'sd64]Part select is double-driving unresolved wire.
Second, the output with CXXRTL is:
CXXRTL
Output with CXXRTL 0
This is at commit 3c3788ee287017802c1b77879b5f8e9ceb1be8ec.
Hi @whitequark, thank you for your feedback!
I'm using "Icarus Verilog version 11.0 (stable) ()"
Hi Whitequark, thank you for your patience!
I created a Docker image in the repository to make it most convenient for you.
Please minimize the testcase further than this. In particular the two-level "wrapper_cxxrtl.sv" / "top.v" structure is making triage of your issues more difficult. In this particular case, I think you should also be able to remove some of the redundant arithmetics.
Thank you Whitequark for your update! In this commit, I:
Substituting any further arithmetics line would make the bug disappear, hence it is hard to simplify further on this specific aspect.
Thank you! Flavien
Version
Yosys 0.37+21 (git sha1 3d9e44d18, clang 10.0.0-4ubuntu1 -fPIC -Os)
On which OS did this happen?
Linux
Reproduction Steps
Hi there!
I stumbled into an issue where CXXRTL makes bad assignments, apparently under very specific conditions. Here is a repository for you to reproduce the issue. The issue survives tracing, which is convenient.
Please let me know if you require any more information.
Thank you! Flavien
Expected Behavior
The left-hand side
out_0
of the assignment gets the value of the right-hand side, eventually providing the value0
.Actual Behavior
The left-hand side
out_0
of the assignment gets a wrong value1
.