diff --git a/src/V3AstNodes.cpp b/src/V3AstNodes.cpp index 0e465a305..b110e5749 100644 --- a/src/V3AstNodes.cpp +++ b/src/V3AstNodes.cpp @@ -543,9 +543,7 @@ AstBasicDType* AstTypeTable::findLogicBitDType(FileLine* fl, AstBasicDTypeKwd kw LogicMap::const_iterator it = mapr.find(widths); if (it != mapr.end()) return it->second; // - AstBasicDType* new1p = new AstBasicDType(fl, AstBasicDTypeKwd::BIT, numeric, width, widthMin); - // Above should be below, but fails --x-initial-edge test - //AstBasicDType* new1p = new AstBasicDType(fl, kwd, numeric, width, widthMin); + AstBasicDType* new1p = new AstBasicDType(fl, kwd, numeric, width, widthMin); // Because the detailed map doesn't update this map, // check the detailed map for this same node, and if found update this map // Also adds this new node to the detailed map diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 56340555a..316f64c19 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -1368,17 +1368,16 @@ void EmitCImp::emitVarResets(AstNodeModule* modp) { } else { puts(varp->name()); for (int v=0; vname().find("__Vclklast__"))) { - puts(" = 1;\n"); - } else { - puts(" = 0;\n"); - } + // If --x-initial-edge is set, we want to force an initial + // edge on uninitialized clocks (from 'X' to whatever the + // first value is). Since the class is instantiated before + // initial blocks are evaluated, this should not clash + // with any initial block settings. + if (zeroit || (v3Global.opt.xInitialEdge() && varp->isUsedClock())) { + puts(" = 0;\n"); + } else if (v3Global.opt.xInitialEdge() + && (0 == varp->name().find("__Vclklast__"))) { + puts(" = 1;\n"); } else { puts(" = VL_RAND_RESET_"); emitIQW(varp); diff --git a/test_regress/t/t_cover_toggle.pl b/test_regress/t/t_cover_toggle.pl index d1e3e68fe..9b6805861 100755 --- a/test_regress/t/t_cover_toggle.pl +++ b/test_regress/t/t_cover_toggle.pl @@ -18,7 +18,7 @@ execute ( # Read the input .v file and do any CHECK_COVER requests inline_checks(); -file_grep ($Self->{stats}, qr/Coverage, Toggle points joined\s+(\d+)/i, 24) +file_grep ($Self->{stats}, qr/Coverage, Toggle points joined\s+(\d+)/i, 25) if $Self->{vlt}; ok(1);