verific: do not assert if wire not found; warn instead
authorEddie Hung <eddie@fpgeh.com>
Thu, 23 Apr 2020 23:28:11 +0000 (16:28 -0700)
committerEddie Hung <eddie@fpgeh.com>
Thu, 23 Apr 2020 23:28:11 +0000 (16:28 -0700)
frontends/verific/verific.cc
kernel/constids.inc

index ae7fcefa786e2ce91ed9a3f64042aaf1882f466b..89606a5bd2b88143cbae9a8ae0ee3614f6b63d66 100644 (file)
@@ -1162,8 +1162,12 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::se
                if (!type_range->IsTypeEnum())
                        continue;
                auto wire = module->wire(RTLIL::escape_id(id_name));
-               log_assert(wire);
-               wire->set_string_attribute(ID(wiretype), type_range->GetTypeName());
+               if (!wire) {
+                       if (net->IsUserDeclared())
+                               log_warning("Unable to find imported net '%s'.\n", net->Name());
+                       continue;
+               }
+               wire->set_string_attribute(ID::wiretype, type_range->GetTypeName());
 
                MapIter mj;
                char *k, *v;
index 68a5782fde8ef8390e7ab95e1508a9f5556460d9..c5f672d094abf211f3b01ef2cb9cdd2328333d1d 100644 (file)
@@ -199,6 +199,7 @@ X(wand)
 X(whitebox)
 X(WIDTH)
 X(wildcard_port_conns)
+X(wiretype)
 X(wor)
 X(WORDS)
 X(WR_ADDR)