diff --git a/src/Makefile_obj.in b/src/Makefile_obj.in index d3178364f..ed778ee64 100644 --- a/src/Makefile_obj.in +++ b/src/Makefile_obj.in @@ -228,8 +228,8 @@ $(TGT): V3Ast__gen_classes.h $(OBJS) @echo " Linking $@..." -rm -rf $@ $@.exe ${LINK} ${LDFLAGS} -o $@ $(OBJS) $(CCMALLOC) ${LIBS} - @-cp $@.exe $@ -# ok if cp failes on linux, it's there to insure make works on NT + @-(cp $@.exe $@ || true) +# ok if cp failes on linux, it's there to insure executable works on NT V3Number_test: V3Number_test.o ${LINK} ${LDFLAGS} -o $@ $^ ${LIBS} diff --git a/src/V3Error.cpp b/src/V3Error.cpp index 4385b7ae8..4bd1b2242 100644 --- a/src/V3Error.cpp +++ b/src/V3Error.cpp @@ -38,6 +38,7 @@ FileLine FileLine::s_defaultFileLine = FileLine(EmptySecret()); int V3Error::s_errCount = 0; int V3Error::s_warnCount = 0; int V3Error::s_debugDefault = 0; +int V3Error::s_tellManual = 0; ostringstream V3Error::s_errorStr; // Error string being formed V3ErrorCode V3Error::s_errorCode = V3ErrorCode::FATAL; bool V3Error::s_describedEachWarn[V3ErrorCode::MAX]; @@ -285,6 +286,7 @@ bool V3Error::isError(V3ErrorCode code) { if (code==V3ErrorCode::SUPPRESS) return false; else if (code==V3ErrorCode::INFO) return false; else if (code==V3ErrorCode::FATAL) return true; + else if (code==V3ErrorCode::FATALSRC) return true; else if (code==V3ErrorCode::ERROR) return true; else if (codedumpTreeFile(v3Global.debugFilename("final.tree",99)); diff --git a/src/V3Error.h b/src/V3Error.h index 727497aea..ba65e150c 100644 --- a/src/V3Error.h +++ b/src/V3Error.h @@ -39,6 +39,7 @@ public: SUPPRESS, // Warning suppressed by user INFO, // General information out FATAL, // Kill the program + FATALSRC, // Kill the program, for internal source errors ERROR, // General error out, can't suppress // Boolean information we track per-line, but aren't errors I_COVERAGE, // Coverage is on/off from /*verilator coverage_on/off*/ @@ -83,7 +84,7 @@ public: const char* ascii() const { const char* names[] = { // Leading spaces indicate it can't be disabled. - " MIN", " SUPPRESS", " INFO", " FATAL", " ERROR", + " MIN", " SUPPRESS", " INFO", " FATAL", " FATALSRC", " ERROR", // Boolean " I_COVERAGE", " I_TRACING", // Errors @@ -132,6 +133,7 @@ class V3Error { static int s_debugDefault; // Default debugging level static int s_errCount; // Error count static int s_warnCount; // Error count + static int s_tellManual; // Tell user to see manual, 0=not yet, 1=doit, 2=disable static ostringstream s_errorStr; // Error string being formed static V3ErrorCode s_errorCode; // Error string being formed will abort enum MaxErrors { MAX_ERRORS = 50 }; // Fatal after this may errors @@ -175,12 +177,12 @@ inline void v3errorEnd(ostringstream& sstr) { V3Error::v3errorEnd(sstr); } // These allow errors using << operators: v3error("foo"<<"bar"); // Careful, you can't put () around msg, as you would in most macro definitions -#define v3info(msg) v3errorEnd(((V3Error::v3errorPrep(V3ErrorCode::INFO)<=(level)) { cout<<"- "<=(level)) { cout<v3fatalSrc("Only one topscope supported"); + if (m_topScopep) nodep->v3fatalSrc("Only one topscope should ever be created"); UINFO(2," Loading tree...\n"); //VV***** We reset userp() AstNode::user1ClearTree(); diff --git a/src/V3Trace.cpp b/src/V3Trace.cpp index 14eee85bc..260f2aa7e 100644 --- a/src/V3Trace.cpp +++ b/src/V3Trace.cpp @@ -89,7 +89,7 @@ public: virtual ~TraceActivityVertex() {} // Accessors AstNode* insertp() const { - if (!m_insertp) v3fatal("Null insertp; probably called on a special always/slow."); + if (!m_insertp) v3fatalSrc("Null insertp; probably called on a special always/slow."); return m_insertp; } virtual string name() const {