From f8680cf5c2e08fff753e469d85eaf6c5c4916263 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 2 Mar 2007 21:14:22 +0000 Subject: [PATCH] Don't constant prop public signals git-svn-id: file://localhost/svn/verilator/trunk/verilator@890 77ca24e4-aefa-0310-84f0-b9a241c72d87 --- Changes | 2 ++ src/V3Const.cpp | 3 ++- src/V3PreProc.cpp | 12 ++++++------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Changes b/Changes index e23d0f5c0..27172d161 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Try all +libext's in the exact order given. [Michael Shinkarovsky] +**** Fix elimination of public signals assigned to constants. [Eugene Weber] + **** Fix internal error when public for loop has empty body. [David Addison] * Verilator 3.633 2/7/2007 diff --git a/src/V3Const.cpp b/src/V3Const.cpp index 3611ee6fd..ae1f5cf96 100644 --- a/src/V3Const.cpp +++ b/src/V3Const.cpp @@ -757,7 +757,8 @@ private: nodep->varp()->initp()->iterateAndNext(*this); if (operandConst(nodep->varp()->initp()) && !nodep->lvalue() - && ((v3Global.opt.oConst() && !m_params) // Can reduce constant wires into equations + && ((v3Global.opt.oConst() && !m_params // Can reduce constant wires into equations + && !nodep->varp()->isSigPublic()) || nodep->varp()->isParam())) { AstConst* constp = nodep->varp()->initp()->castConst(); const V3Number& num = constp->num(); diff --git a/src/V3PreProc.cpp b/src/V3PreProc.cpp index 6e9dc1fc8..79a4046c2 100644 --- a/src/V3PreProc.cpp +++ b/src/V3PreProc.cpp @@ -301,12 +301,12 @@ void V3PreProcImp::comment(const string& text) { if (commentTokenMatch(cmd/*ref*/, "parallel_case")) { insertUnreadback ("/*verilator parallel_case*/"); } - if (commentTokenMatch(cmd/*ref*/, "one_hot")) { - insertUnreadback ("/*verilator one_hot*/ "+cmd+";"); - } - if (commentTokenMatch(cmd/*ref*/, "one_cold")) { - insertUnreadback ("/*verilator one_cold*/ "+cmd+";"); - } + //if (commentTokenMatch(cmd/*ref*/, "one_hot")) { + // insertUnreadback ("/*verilator one_hot*/ "+cmd+";"); + //} + //if (commentTokenMatch(cmd/*ref*/, "one_cold")) { + // insertUnreadback ("/*verilator one_cold*/ "+cmd+";"); + //} // else ignore the comment we don't recognize } // else no assertions } else {