From 5d2675e38adfe666f932267eb690708be80953fa Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 5 Nov 2008 09:14:49 -0500 Subject: [PATCH] Repair of last 2 checkins; dots in wrong place when 2 level deep inline --- src/V3EmitC.cpp | 2 +- src/V3Inline.cpp | 4 +++- test_v/t_clk_two.v | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 161df0aa7..b1f7a2e55 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -217,7 +217,7 @@ public: puts(", \""); puts(nodep->fileline()->filename()); puts("\""); puts(", "); puts(cvtToStr(nodep->fileline()->lineno())); puts(", "); puts(cvtToStr(nodep->column())); - puts(", \""); puts(nodep->hier()); puts("\""); + puts(", \""); puts((nodep->hier()!=""?".":"")+nodep->hier()); puts("\""); puts(", \""); puts(nodep->typeText()); puts("\""); puts(", \""); puts(nodep->comment()); puts("\""); puts(");\n"); diff --git a/src/V3Inline.cpp b/src/V3Inline.cpp index 85058f026..ab32f37e3 100644 --- a/src/V3Inline.cpp +++ b/src/V3Inline.cpp @@ -249,7 +249,9 @@ private: virtual void visit(AstCoverDecl* nodep, AstNUser*) { // Fix path in coverage statements if (m_cellp) { - nodep->hier(m_cellp->prettyName()+"."+nodep->hier()); + nodep->hier(m_cellp->prettyName() + + (nodep->hier()!="" ? ".":"") + + nodep->hier()); } nodep->iterateChildren(*this); } diff --git a/test_v/t_clk_two.v b/test_v/t_clk_two.v index 05578df52..ba60fa808 100644 --- a/test_v/t_clk_two.v +++ b/test_v/t_clk_two.v @@ -16,6 +16,8 @@ module t_clk_two (/*AUTOARG*/ // verilator lint_on GENCLK reg [31:0] count; + t_clk_twob tb (.*); + wire reset_h = ~reset_l; always @ (posedge fastclk) begin if (reset_h) clk2 <= 0; @@ -26,3 +28,17 @@ module t_clk_two (/*AUTOARG*/ else count <= count + 1; end endmodule + +module t_clk_twob (/*AUTOARG*/ + // Inputs + fastclk, reset_l + ); + input fastclk; + input reset_l; + + always @ (posedge fastclk) begin + // Extra line coverage point, just to make sure coverage + // hierarchy under inlining lands properly + if (reset_l) ; + end +endmodule