Skip to content

Commit 495a780

Browse files
committed
aiger2: Support $extern: hierarchy
`$extern:...` modules inserted by `techmap -extern` are special in the regard that they have a private ID (starting with a dollar sign) but are not an internal cell. Support those modules in xaiger export.
1 parent 87736a2 commit 495a780

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

backends/aiger2/aiger.cc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -832,12 +832,8 @@ struct XAigerAnalysis : Index<XAigerAnalysis, int, 0, 0> {
832832
return false;
833833

834834
Cell *driver = bit.wire->driverCell();
835-
if (!driver->type.isPublic())
836-
return false;
837-
838835
Module *mod = design->module(driver->type);
839-
log_assert(mod);
840-
if (!mod->has_attribute(ID::abc9_box_id))
836+
if (!mod || !mod->has_attribute(ID::abc9_box_id))
841837
return false;
842838

843839
int max = 1;
@@ -870,7 +866,7 @@ struct XAigerAnalysis : Index<XAigerAnalysis, int, 0, 0> {
870866
HierCursor cursor;
871867
for (auto box : top_minfo->found_blackboxes) {
872868
Module *def = design->module(box->type);
873-
if (!box->type.isPublic() || (def && !def->has_attribute(ID::abc9_box_id)))
869+
if (!(def && def->has_attribute(ID::abc9_box_id)))
874870
for (auto &conn : box->connections_)
875871
if (box->output(conn.first))
876872
for (auto bit : conn.second)
@@ -885,7 +881,7 @@ struct XAigerAnalysis : Index<XAigerAnalysis, int, 0, 0> {
885881

886882
for (auto box : top_minfo->found_blackboxes) {
887883
Module *def = design->module(box->type);
888-
if (!box->type.isPublic() || (def && !def->has_attribute(ID::abc9_box_id)))
884+
if (!(def && def->has_attribute(ID::abc9_box_id)))
889885
for (auto &conn : box->connections_)
890886
if (box->input(conn.first))
891887
for (auto bit : conn.second)

0 commit comments

Comments
 (0)