Support extraction of enum bits, bug951.

This commit is contained in:
Wilson Snyder 2015-08-12 21:33:40 -04:00
parent c87c66efb1
commit a950e4816d
5 changed files with 9 additions and 5 deletions

View File

@ -7,6 +7,8 @@ indicates the contributor was also the author of the fix; Thanks!
*** Add tracing_on, etc to vlt files, bug932. [Frederic Requin]
**** Support extraction of enum bits, bug951. [Jonathon Donaldson]
**** Fix MinGW compiler error, bug927, bug929. [Hans Tichelaar]
**** Fix .c files to be treated as .cpp, bug930. [Jonathon Donaldson]

View File

@ -239,6 +239,7 @@ public:
//
DT_PUBLIC, // V3LinkParse moves to AstTypedef::attrPublic
//
ENUM_BASE, // V3LinkResolve creates for AstPreSel, V3LinkParam removes
ENUM_FIRST, // V3Width processes
ENUM_LAST, // V3Width processes
ENUM_NUM, // V3Width processes
@ -268,7 +269,7 @@ public:
"DIM_BITS", "DIM_DIMENSIONS", "DIM_HIGH", "DIM_INCREMENT", "DIM_LEFT",
"DIM_LOW", "DIM_RIGHT", "DIM_SIZE", "DIM_UNPK_DIMENSIONS",
"DT_PUBLIC",
"ENUM_FIRST", "ENUM_LAST", "ENUM_NUM", "ENUM_NEXT", "ENUM_PREV", "ENUM_NAME",
"ENUM_BASE", "ENUM_FIRST", "ENUM_LAST", "ENUM_NUM", "ENUM_NEXT", "ENUM_PREV", "ENUM_NAME",
"MEMBER_BASE",
"VAR_BASE", "VAR_CLOCK", "VAR_CLOCK_ENABLE", "VAR_PUBLIC",
"VAR_PUBLIC_FLAT", "VAR_PUBLIC_FLAT_RD","VAR_PUBLIC_FLAT_RW",

View File

@ -207,7 +207,11 @@ private:
} else if (AstMemberSel* fromp = basefromp->castMemberSel()) {
nodep->attrp(new AstAttrOf(nodep->fileline(), AstAttrType::MEMBER_BASE,
fromp->cloneTree(false)));
} else if (AstEnumItemRef* fromp = basefromp->castEnumItemRef()) {
nodep->attrp(new AstAttrOf(nodep->fileline(), AstAttrType::ENUM_BASE,
fromp->cloneTree(false)));
} else {
if (basefromp) { UINFO(1," Related node: "<<basefromp<<endl); }
nodep->v3fatalSrc("Illegal bit select; no signal/member being extracted from");
}
}

View File

@ -834,9 +834,8 @@ private:
// Don't iterate children, don't want to lose VarRef.
switch (nodep->attrType()) {
case AstAttrType::VAR_BASE:
// Soon to be handled in V3LinkWidth SEL generation, under attrp() and newSubLsbOf
break;
case AstAttrType::MEMBER_BASE:
case AstAttrType::ENUM_BASE:
// Soon to be handled in V3LinkWidth SEL generation, under attrp() and newSubLsbOf
break;
case AstAttrType::DIM_DIMENSIONS:

View File

@ -7,8 +7,6 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
$Self->skip("Not supported by commercial simulators");
compile (
);