-
Notifications
You must be signed in to change notification settings - Fork 910
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
abc9 crash on synth_ice40 in Yosys 0.38 #4249
Comments
Your code really does have a logic loop.
And Verilator agrees, e.g.:
Even the original ABC flow reports it needs to break loops, e.g.
I would suggest fixing this; most timing analysis tools do not handle logic loops like this. |
Well, I'm new to Verilog synthesis (I did use Verilog for CPLDs a bit many years ago, but never for a bigger design), so it is not surprising that I write bad code. While a compiler might emit diagnostics (errors or warnings) for bad code, I think it shouldn't crash with an internal assertion failure. |
Yes, it shouldn't, this is a valid issue with Yosys. |
Line 359 in 8d00466
|
I think this might be a bug in the |
What If you change it to break all outputs of each cells in every SCC (e.g. using the diff below) diff --git a/passes/techmap/abc9_ops.cc b/passes/techmap/abc9_ops.cc
index 4eaed1f75..f1bcea735 100644
--- a/passes/techmap/abc9_ops.cc
+++ b/passes/techmap/abc9_ops.cc
@@ -584,11 +584,9 @@ void break_scc(RTLIL::Module *module)
for (auto cell : scc_cells) {
auto it = cell->attributes.find(ID::abc9_scc_id);
log_assert(it != cell->attributes.end());
- auto id = it->second;
- auto r = ids_seen.insert(id);
- cell->attributes.erase(it);
- if (!r.second)
+ if (ids_seen.count(it->second))
continue;
+ cell->attributes.erase(it);
for (auto &c : cell->connections_) {
if (c.second.is_fully_const()) continue;
if (cell->output(c.first)) { |
Agreed, we were just discussing the same with @Ravenslofty and I offer to change |
#4260 has a minimal testcase with a logic SCC that won't be fully broken by |
Either way, since this is an issue on the Yosys side of things rather than with ABC itself, does anybody object to me removing the ABC tag here? |
Version
Yosys 0.38 (git sha1 543faed, gcc 13.2.0-13 -fPIC -Os)
On which OS did this happen?
Linux
Reproduction Steps
cpu_flat.v.gz
Expected Behavior
synthesis completes (as it does when using -noabc9)
Actual Behavior
The text was updated successfully, but these errors were encountered: