Skip to content

Fix crash in eqy_partition #81

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/eqy_partition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ struct EqyPartitionWorker
SigBit firstBit;
bool foundFirstBit = false;
for (int i = 1; i < GetSize(rule); i++) {
SigSpec sig = gold_sigmap(gold->wire("\\" + rule[i]));
auto wire = gold->wire("\\" + rule[i]);
if (wire == nullptr)
continue;
SigSpec sig = gold_sigmap(wire);
sig.remove_const();
for (auto bit : sig) {
if (!queue.count(bit))
Expand All @@ -140,14 +143,20 @@ struct EqyPartitionWorker
}

if (rule[0] == "bind" && GetSize(rule) == 2) {
for (SigBit bit : gold_sigmap(gold->wire("\\" + rule[1])))
auto wire = gold->wire("\\" + rule[1]);
if (wire == nullptr)
return;
for (SigBit bit : gold_sigmap(wire))
if (gold_drivers.count(bit))
bind_database.insert(bit);
return;
}

if (rule[0] == "solo" && GetSize(rule) == 2) {
for (SigBit bit : gold_sigmap(gold->wire("\\" + rule[1])))
auto wire = gold->wire("\\" + rule[1]);
if (wire == nullptr)
return;
for (SigBit bit : gold_sigmap(wire))
solo_database.insert(bit);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ passing_tests:
@$(EQY) -f counter_cells.eqy 2>&1 | grep -i "counter.state__SDFF_PP0__Q" # matching cells
@$(EQY) - < counter.eqy 2>&1 | grep -i "Cannot derive workdir name from config file name" # stdin
@$(EQY) -f counter.eqy --setup | grep -i "DONE (UNKNOWN, rc=0)" # setup only
@$(EQY) -f failed_partition.eqy > /dev/null

failing_tests:
@$(EQY) 2>&1 | grep -i "No config file given"
Expand Down Expand Up @@ -46,7 +47,6 @@ failing_tests:
@$(EQY) -f expected_opt_bool_on_off.eqy 2>&1 | grep -i "expected one of"
@$(EQY) -f expected_opt_int_integer.eqy 2>&1 | grep -i "expected integer option"
@$(EQY) -f unknown_opt_other.eqy 2>&1 | grep -i "unknown option 'unknown'"
@$(EQY) -f failed_partition.eqy 2>&1 | grep -i "Failed to partition design."
@$(EQY) -f equivalence_problem.eqy 2>&1 | grep -i "A problem occurred during equivalence check."
@$(EQY) -f problem_occured.eqy 2>&1 | grep -i "No configured strategy supports partition"
@$(EQY) -f missing_gate_section.eqy 2>&1 | grep -i "section \[gate\] missing"
Expand Down