From 41555e5aa3bb23ee3a16cac1db917dd3ce7f7567 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Mon, 5 Jan 2009 14:16:09 -0500 Subject: [PATCH] Coverage of each parametarized module is counted separately. --- Changes | 2 ++ bin/verilator | 4 +++- src/V3Coverage.cpp | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index 08563ab04..f8f67d76c 100644 --- a/Changes +++ b/Changes @@ -19,6 +19,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Minor performance improvements of Verilator compiler runtime. +**** Coverage of each parametarized module is counted separately. [Bob Fredieu] + **** Fix certain generate-if cells causing "clone" error. [Stephane Laurent] **** Fix line coverage of public functions. [Soon Koh] diff --git a/bin/verilator b/bin/verilator index 773ad2ee9..a5a5a02d3 100755 --- a/bin/verilator +++ b/bin/verilator @@ -334,7 +334,9 @@ are also not covered. Hierarchy is compressed, such that if a module is instantiated multiple times, coverage will be summed for that bit across ALL instantiations of -that module. +that module with the same parameter set. A module instantiated with +different parameter values is considered a different module, and will get +counted separately. Verilator makes a minimally-intelligent decision about what clock domain the signal goes to, and only looks for edges in that clock domain. This diff --git a/src/V3Coverage.cpp b/src/V3Coverage.cpp index 953f2707c..17801ed4b 100644 --- a/src/V3Coverage.cpp +++ b/src/V3Coverage.cpp @@ -90,9 +90,10 @@ private: // We could use the basename of the filename to the page, but seems better for code // from an include file to be listed under the module using it rather than the include file. - // Note the module name could have parameters appended, thus we use origName. + // Note the module name could have parameters appended, we'll consider this + // a feature as it allows for each parameterized block to be counted separately. // Someday the user might be allowed to specify a different page suffix - string page = page_prefix + "/" + m_modp->origName(); + string page = page_prefix + "/" + m_modp->prettyName(); AstCoverDecl* declp = new AstCoverDecl(fl, column, page, comment); declp->hier(hier);