diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index d76aa4c99..480ac0fbb 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -103,6 +103,7 @@ public: if (!diddump && v3Global.opt.dumpTree()) { diddump = true; m_syms.dumpFilePrefixed("linkdot-preerr"); + v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("linkdot-preerr.tree")); } } @@ -1445,6 +1446,10 @@ private: } } } + virtual void visit(AstEnumItemRef* nodep, AstNUser*) { + // EnumItemRef may be under a dot. Should already be resolved. + nodep->iterateChildren(*this); + } virtual void visit(AstVar* nodep, AstNUser*) { checkNoDot(nodep); nodep->iterateChildren(*this); diff --git a/test_regress/t/t_package_enum.pl b/test_regress/t/t_package_enum.pl new file mode 100755 index 000000000..f91289753 --- /dev/null +++ b/test_regress/t/t_package_enum.pl @@ -0,0 +1,18 @@ +#!/usr/bin/perl +if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } +# DESCRIPTION: Verilator: Verilog Test driver/expect definition +# +# Copyright 2003 by Wilson Snyder. This program is free software; you can +# redistribute it and/or modify it under the terms of either the GNU +# Lesser General Public License Version 3 or the Perl Artistic License +# Version 2.0. + +compile ( + ); + +execute ( + check_finished=>1, + ); + +ok(1); +1; diff --git a/test_regress/t/t_package_enum.v b/test_regress/t/t_package_enum.v new file mode 100644 index 000000000..0e6014521 --- /dev/null +++ b/test_regress/t/t_package_enum.v @@ -0,0 +1,30 @@ +// DESCRIPTION: Verilator: Verilog Test module +// +// This file ONLY is placed into the Public Domain, for any use, +// without warranty, 2013 by Wilson Snyder. + +package pkg; + typedef enum bit [1:0] + { + E__NOT = 2'b00, + E__VAL = 2'b11 + } E_t; +endpackage + +module t; + reg [1:0] ttype; + reg m; + + initial begin + ttype = pkg::E__NOT; + m = (ttype == pkg::E__VAL); + if (m != 1'b0) $stop; + + ttype = pkg::E__VAL; + m = (ttype == pkg::E__VAL); + if (m != 1'b1) $stop; + + $write("*-* All Finished *-*\n"); + $finish; + end +endmodule