diff --git a/src/V3Options.cpp b/src/V3Options.cpp index 5f30e9cf8..e5fcf30e1 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -429,7 +429,7 @@ void V3Options::parseOpts (FileLine* fl, int argc, char** argv) { } // Default prefix to the filename - if (prefix()=="") m_prefix = string("V")+topModule(); + if (prefix()=="" && topModule()!="") m_prefix = string("V")+topModule(); if (prefix()=="") m_prefix = string("V")+filenameNonExt(*(vFiles().begin())); if (modPrefix()=="") m_modPrefix = prefix();