Support implicit enum declarations with packed dimensions
This commit is contained in:
parent
03e0d49d99
commit
caf3522364
|
|
@ -2226,10 +2226,11 @@ data_typeNoRef<nodeDTypep>: // ==IEEE: data_type, excluding class_ty
|
||||||
new AstDefImplicitDType{$1->fileline(),
|
new AstDefImplicitDType{$1->fileline(),
|
||||||
"__typeimpsu" + cvtToStr(GRAMMARP->s_typeImpNum++),
|
"__typeimpsu" + cvtToStr(GRAMMARP->s_typeImpNum++),
|
||||||
VFlagChildDType{}, $1}, $2, true); }
|
VFlagChildDType{}, $1}, $2, true); }
|
||||||
| enumDecl
|
| enumDecl packed_dimensionListE
|
||||||
{ $$ = new AstDefImplicitDType{$1->fileline(),
|
{ $$ = GRAMMARP->createArray(
|
||||||
"__typeimpenum" + cvtToStr(GRAMMARP->s_typeImpNum++),
|
new AstDefImplicitDType{$1->fileline(),
|
||||||
VFlagChildDType{}, $1}; }
|
"__typeimpenum" + cvtToStr(GRAMMARP->s_typeImpNum++),
|
||||||
|
VFlagChildDType{}, $1}, $2, true); }
|
||||||
| ySTRING
|
| ySTRING
|
||||||
{ $$ = new AstBasicDType{$1, VBasicDTypeKwd::STRING}; }
|
{ $$ = new AstBasicDType{$1, VBasicDTypeKwd::STRING}; }
|
||||||
| yCHANDLE
|
| yCHANDLE
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,10 @@ module t (/*AUTOARG*/);
|
||||||
var enum logic [3:0] { QINVALID='1, QSEND={2'b0,2'h0}, QOP={2'b0,2'h1}, QCL={2'b0,2'h2},
|
var enum logic [3:0] { QINVALID='1, QSEND={2'b0,2'h0}, QOP={2'b0,2'h1}, QCL={2'b0,2'h2},
|
||||||
QPR={2'b0,2'h3 }, QACK, QRSP } inv;
|
QPR={2'b0,2'h3 }, QACK, QRSP } inv;
|
||||||
|
|
||||||
|
enum logic [7:0] {
|
||||||
|
ENARRAY = 6
|
||||||
|
} [3:2] enarray;
|
||||||
|
|
||||||
initial begin
|
initial begin
|
||||||
if (e0 !== 0) $stop;
|
if (e0 !== 0) $stop;
|
||||||
if (e1 !== 1) $stop;
|
if (e1 !== 1) $stop;
|
||||||
|
|
@ -86,6 +90,11 @@ module t (/*AUTOARG*/);
|
||||||
if ($size(array5) != 5) $stop;
|
if ($size(array5) != 5) $stop;
|
||||||
if ($size(array5i) != 5) $stop;
|
if ($size(array5i) != 5) $stop;
|
||||||
|
|
||||||
|
enarray[2] = ENARRAY;
|
||||||
|
enarray[3] = ENARRAY;
|
||||||
|
if (enarray[2] !== ENARRAY) $stop;
|
||||||
|
if (enarray[3] !== ENARRAY) $stop;
|
||||||
|
|
||||||
$write("*-* All Finished *-*\n");
|
$write("*-* All Finished *-*\n");
|
||||||
$finish;
|
$finish;
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue