diff --git a/Changes b/Changes index 877a19082..4e3e5a0c5 100644 --- a/Changes +++ b/Changes @@ -15,6 +15,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Fix multiple .v files being read in random order. [Stefan Thiede] +**** Fix internal error when params get non-constants. [Johan Wouters] + * Verilator 3.661 2008/04/04 *** The --enable-defenv configure option added in 3.660 is now the default. diff --git a/src/V3Param.cpp b/src/V3Param.cpp index 471977631..3ebe929d6 100644 --- a/src/V3Param.cpp +++ b/src/V3Param.cpp @@ -254,6 +254,7 @@ void ParamVisitor::visit(AstCell* nodep, AstNUser*) { if (!constp) { //if (debug()) pinp->dumpTree(cout,"error:"); pinp->v3error("Can't convert defparam value to constant: Param "<name()<<" of "<prettyName()); + pinp->exprp()->replaceWith(new AstConst(pinp->fileline(), V3Number(pinp->fileline(), pinp->width(), 0))); } else { longname += "_" + paramSmallName(nodep->modp(),pinp->modVarp())+constp->num().ascii(false); }