Fix handling of zero-length cell connections in SMT2 back-end
authorClifford Wolf <clifford@clifford.at>
Thu, 8 Feb 2018 18:12:12 +0000 (19:12 +0100)
committerClifford Wolf <clifford@clifford.at>
Thu, 8 Feb 2018 18:12:12 +0000 (19:12 +0100)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
backends/smt2/smt2.cc

index e6e96901189227f5606b8da580692d1ff5ac9b3c..dbbf01843f97cea3f08f4c0737268496b614670c 100644 (file)
@@ -112,6 +112,8 @@ struct Smt2Worker
 
                for (auto cell : module->cells())
                for (auto &conn : cell->connections()) {
+                       if (GetSize(conn.second) == 0)
+                               continue;
                        bool is_input = ct.cell_input(cell->type, conn.first);
                        bool is_output = ct.cell_output(cell->type, conn.first);
                        if (is_output && !is_input)
@@ -659,6 +661,9 @@ struct Smt2Worker
 
                        for (auto &conn : cell->connections())
                        {
+                               if (GetSize(conn.second) == 0)
+                                       continue;
+
                                Wire *w = m->wire(conn.first);
                                SigSpec sig = sigmap(conn.second);
 
@@ -829,6 +834,9 @@ struct Smt2Worker
 
                                for (auto &conn : cell->connections())
                                {
+                                       if (GetSize(conn.second) == 0)
+                                               continue;
+
                                        Wire *w = m->wire(conn.first);
                                        SigSpec sig = sigmap(conn.second);