-
Notifications
You must be signed in to change notification settings - Fork 895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Co-simulation fails for $fa cell #4638
Comments
My guess is this is for faithful x-propagation, i.e. it's to arrange for X to be in x-state whenever Y is in x-state. |
This issue might be because |
I can confirm this is not about the functional backend at all, it's the lack of an eval implementation. I ran into this while writing the tests for the functional backend, the actual functional backend tests work around this issue by using one of the yosys passes to map $fa and $alu to other cells before co-simulation. |
yes, also the |
|
Not really. Maybe then we could mark |
Note evaluability is currently conflated with the cell being combinational, see #4034 |
Version
Yosys 0.45+153 (git sha1 b3b88e5, g++ 13.2.0 -Og -fPIC)
On which OS did this happen?
Linux
Reproduction Steps
cd tests/functional
../../yosys -p "test_cell -n 1 -w test_cell \$fa; read_rtlil test_cell_fa_00000.il; write_functional_cxx my_module_functional_cxx.cc"
The generated .il file in my case is the following:
g++ -g vcd_harness.cc -I ../../backends/functional/cxx_runtime/ -std=c++17 -o vcd_harness
./vcd_harness test_cell_fa_00000.il_functional_cxx.vcd 100 1
../../yosys -p "read_rtlil test_cell_fa_00000.il; sim -r test_cell_fa_00000.il_functional_cxx.vcd -vcd test_cell_fa_00000.il_yosys_sim.vcd -scope gold -timescale 1us -n 100"
Note:
The issue may not be with the functional backend, but with
simlib.v
or elsewhere.For example https://github.com/YosysHQ/yosys/blob/main/techlibs/common/simlib.v#L583 seems a bit suspect, since
Y ^ Y
is always 0.I think it should be:
assign Y = t1 ^ C, X = (t2 | t3);
but the problem persists even with that change.
Expected Behavior
Co-simulation successful:
Actual Behavior
The text was updated successfully, but these errors were encountered: