Assert that box_unique_id is indeed unique
authorEddie Hung <eddie@fpgeh.com>
Mon, 3 Jun 2019 19:33:47 +0000 (12:33 -0700)
committerEddie Hung <eddie@fpgeh.com>
Mon, 3 Jun 2019 19:33:47 +0000 (12:33 -0700)
frontends/aiger/aigerparse.cc

index c951e1fbb4c239b6a277216cabe2b173a6dc87e2..95335a0290d4a2b4b476ca7b29cd19a6e7bb8aad 100644 (file)
@@ -198,11 +198,12 @@ void AigerReader::parse_xaiger()
 
     dict<int,IdString> box_lookup;
     for (auto m : design->modules()) {
-        if (m->name[0] == '$') continue;
         auto it = m->attributes.find("\\abc_box_id");
         if (it == m->attributes.end())
             continue;
-        box_lookup[it->second.as_int()] = m->name;
+        if (m->name[0] == '$') continue;
+        auto r = box_lookup.insert(std::make_pair(it->second.as_int(), m->name));
+        log_assert(r.second);
     }
 
     // Parse footer (symbol table, comments, etc.)