Internals: Remove VAR_MEM to match Verilog-Perl, towards bug586.

This commit is contained in:
Wilson Snyder 2012-12-31 13:47:34 -05:00
parent cf445898ce
commit a547133efe
5 changed files with 10 additions and 16 deletions

View File

@ -507,7 +507,6 @@ public:
PX_NONE, // Used in V3LinkParse only
PX_TEXT, // Unknown ID component
PX_PREDOT, // Module name or misc component above var/task/func/member
PX_VAR_MEM, // Variable that must be a memory
PX_VAR_ANY, // Variable/structure member
PX_FTASK // Task/Function (AstParse::ftaskrefp() will be set)
};

View File

@ -1229,8 +1229,7 @@ private:
expectWhat = "scope/variable";
allowScope = true;
allowVar = true;
} else if (nodep->expect() == AstParseRefExp::PX_VAR_MEM
|| nodep->expect() == AstParseRefExp::PX_VAR_ANY) {
} else if (nodep->expect() == AstParseRefExp::PX_VAR_ANY) {
expectWhat = "variable";
onlyVar = true;
allowVar = true;

View File

@ -197,8 +197,6 @@ private:
nodep->v3error("Syntax Error: Range ':', '+:' etc are not allowed in the cell part of a dotted reference");
} else if (m_exp==AstParseRefExp::PX_FTASK) {
nodep->v3error("Syntax Error: Range ':', '+:' etc are not allowed as part of function/task names");
} else if (m_exp==AstParseRefExp::PX_VAR_MEM) {
nodep->v3error("Syntax Error: Range ':', '+:' etc are not allowed when expecting memory reference");
} else {
nodep->lhsp()->iterateAndNext(*this);
AstParseRefExp lastExp = m_exp;

View File

@ -1341,6 +1341,9 @@ private:
virtual void visit(AstReadMem* nodep, AstNUser*) {
nodep->filenamep()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
nodep->memp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
if (!nodep->memp()->dtypep()->skipRefp()->castArrayDType()) {
nodep->memp()->v3error("Unsupported: $readmem into non-array");
}
nodep->lsbp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
nodep->msbp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
}

View File

@ -2385,12 +2385,12 @@ system_t_call<nodep>: // IEEE: system_tf_call (as task)
| yD_FATAL '(' expr ')' { $$ = new AstDisplay($1,AstDisplayType::DT_FATAL, "", NULL,NULL); $$->addNext(new AstStop($1)); DEL($3); }
| yD_FATAL '(' expr ',' str commaEListE ')' { $$ = new AstDisplay($1,AstDisplayType::DT_FATAL, *$5,NULL,$6); $$->addNext(new AstStop($1)); DEL($3); }
//
| yD_READMEMB '(' expr ',' varRefMem ')' { $$ = new AstReadMem($1,false,$3,$5,NULL,NULL); }
| yD_READMEMB '(' expr ',' varRefMem ',' expr ')' { $$ = new AstReadMem($1,false,$3,$5,$7,NULL); }
| yD_READMEMB '(' expr ',' varRefMem ',' expr ',' expr ')' { $$ = new AstReadMem($1,false,$3,$5,$7,$9); }
| yD_READMEMH '(' expr ',' varRefMem ')' { $$ = new AstReadMem($1,true, $3,$5,NULL,NULL); }
| yD_READMEMH '(' expr ',' varRefMem ',' expr ')' { $$ = new AstReadMem($1,true, $3,$5,$7,NULL); }
| yD_READMEMH '(' expr ',' varRefMem ',' expr ',' expr ')' { $$ = new AstReadMem($1,true, $3,$5,$7,$9); }
| yD_READMEMB '(' expr ',' idClassSel ')' { $$ = new AstReadMem($1,false,$3,$5,NULL,NULL); }
| yD_READMEMB '(' expr ',' idClassSel ',' expr ')' { $$ = new AstReadMem($1,false,$3,$5,$7,NULL); }
| yD_READMEMB '(' expr ',' idClassSel ',' expr ',' expr ')' { $$ = new AstReadMem($1,false,$3,$5,$7,$9); }
| yD_READMEMH '(' expr ',' idClassSel ')' { $$ = new AstReadMem($1,true, $3,$5,NULL,NULL); }
| yD_READMEMH '(' expr ',' idClassSel ',' expr ')' { $$ = new AstReadMem($1,true, $3,$5,$7,NULL); }
| yD_READMEMH '(' expr ',' idClassSel ',' expr ',' expr ')' { $$ = new AstReadMem($1,true, $3,$5,$7,$9); }
;
system_f_call<nodep>: // IEEE: system_tf_call (as func)
@ -3162,11 +3162,6 @@ variable_lvalueConcList<nodep>: // IEEE: part of variable_lvalue: '{' variable_l
| variable_lvalueConcList ',' variable_lvalue { $$ = new AstConcat($2,$1,$3); }
;
// VarRef to a Memory
varRefMem<parserefp>:
idDotted { $$ = new AstParseRef($1->fileline(), AstParseRefExp::PX_VAR_MEM, "", $1, NULL); $$->start(true); }
;
// VarRef to dotted, and/or arrayed, and/or bit-ranged variable
idClassSel<parserefp>: // Misc Ref to dotted, and/or arrayed, and/or bit-ranged variable
idDotted { $$ = new AstParseRef($1->fileline(), AstParseRefExp::PX_VAR_ANY, "", $1, NULL); $$->start(true); }