Don't constant prop public signals

git-svn-id: file://localhost/svn/verilator/trunk/verilator@890 77ca24e4-aefa-0310-84f0-b9a241c72d87
This commit is contained in:
Wilson Snyder 2007-03-02 21:14:22 +00:00
parent 24c3424e51
commit f8680cf5c2
3 changed files with 10 additions and 7 deletions

View File

@ -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

View File

@ -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();

View File

@ -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 {