From e061eb30030bda166dd32a935d1fe396d939277b Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 20 Jan 2016 22:09:11 -0500 Subject: [PATCH] Fix using short parameter names on negative params, bug1022. --- Changes | 2 ++ src/V3Param.cpp | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index 910316009..fd26a615e 100644 --- a/Changes +++ b/Changes @@ -9,6 +9,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Fix stats file containing multiple unroll entries, bug1020. [Johan Bjork] +**** Fix using short parameter names on negative params, bug1022. [Duraid Madina] + * Verilator 3.880 2015-12-19 diff --git a/src/V3Param.cpp b/src/V3Param.cpp index 084eea7c3..529baba2d 100644 --- a/src/V3Param.cpp +++ b/src/V3Param.cpp @@ -474,12 +474,13 @@ void ParamVisitor::visitCell(AstCell* nodep) { // Setting parameter to its default value. Just ignore it. // This prevents making additional modules, and makes coverage more // obvious as it won't show up under a unique module page name. - } else if (!constp->num().isDouble() && !constp->num().isString() - && !constp->num().isFourState() && !constp->num().isNegative()) { - longname += "_" + paramSmallName(nodep->modp(),pinp->modVarp())+constp->num().ascii(false); + } else if (constp->num().isDouble() + || constp->num().isString() + || constp->num().isFourState()) { + longname += "_" + paramSmallName(nodep->modp(),pinp->modVarp())+paramValueNumber(constp); any_overrides = true; } else { - longname += "_" + paramSmallName(nodep->modp(),pinp->modVarp())+paramValueNumber(constp); + longname += "_" + paramSmallName(nodep->modp(),pinp->modVarp())+constp->num().ascii(false); any_overrides = true; } }