Internals: Remove VAR_MEM to match Verilog-Perl, towards bug586.
This commit is contained in:
parent
cf445898ce
commit
a547133efe
|
|
@ -507,7 +507,6 @@ public:
|
||||||
PX_NONE, // Used in V3LinkParse only
|
PX_NONE, // Used in V3LinkParse only
|
||||||
PX_TEXT, // Unknown ID component
|
PX_TEXT, // Unknown ID component
|
||||||
PX_PREDOT, // Module name or misc component above var/task/func/member
|
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_VAR_ANY, // Variable/structure member
|
||||||
PX_FTASK // Task/Function (AstParse::ftaskrefp() will be set)
|
PX_FTASK // Task/Function (AstParse::ftaskrefp() will be set)
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1229,8 +1229,7 @@ private:
|
||||||
expectWhat = "scope/variable";
|
expectWhat = "scope/variable";
|
||||||
allowScope = true;
|
allowScope = true;
|
||||||
allowVar = true;
|
allowVar = true;
|
||||||
} else if (nodep->expect() == AstParseRefExp::PX_VAR_MEM
|
} else if (nodep->expect() == AstParseRefExp::PX_VAR_ANY) {
|
||||||
|| nodep->expect() == AstParseRefExp::PX_VAR_ANY) {
|
|
||||||
expectWhat = "variable";
|
expectWhat = "variable";
|
||||||
onlyVar = true;
|
onlyVar = true;
|
||||||
allowVar = true;
|
allowVar = true;
|
||||||
|
|
|
||||||
|
|
@ -197,8 +197,6 @@ private:
|
||||||
nodep->v3error("Syntax Error: Range ':', '+:' etc are not allowed in the cell part of a dotted reference");
|
nodep->v3error("Syntax Error: Range ':', '+:' etc are not allowed in the cell part of a dotted reference");
|
||||||
} else if (m_exp==AstParseRefExp::PX_FTASK) {
|
} else if (m_exp==AstParseRefExp::PX_FTASK) {
|
||||||
nodep->v3error("Syntax Error: Range ':', '+:' etc are not allowed as part of function/task names");
|
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 {
|
} else {
|
||||||
nodep->lhsp()->iterateAndNext(*this);
|
nodep->lhsp()->iterateAndNext(*this);
|
||||||
AstParseRefExp lastExp = m_exp;
|
AstParseRefExp lastExp = m_exp;
|
||||||
|
|
|
||||||
|
|
@ -1341,6 +1341,9 @@ private:
|
||||||
virtual void visit(AstReadMem* nodep, AstNUser*) {
|
virtual void visit(AstReadMem* nodep, AstNUser*) {
|
||||||
nodep->filenamep()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->filenamep()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
nodep->memp()->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->lsbp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
nodep->msbp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->msbp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 ')' { $$ = 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_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 ',' idClassSel ')' { $$ = new AstReadMem($1,false,$3,$5,NULL,NULL); }
|
||||||
| yD_READMEMB '(' expr ',' varRefMem ',' expr ')' { $$ = new AstReadMem($1,false,$3,$5,$7,NULL); }
|
| yD_READMEMB '(' expr ',' idClassSel ',' expr ')' { $$ = new AstReadMem($1,false,$3,$5,$7,NULL); }
|
||||||
| yD_READMEMB '(' expr ',' varRefMem ',' expr ',' expr ')' { $$ = new AstReadMem($1,false,$3,$5,$7,$9); }
|
| yD_READMEMB '(' expr ',' idClassSel ',' 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 ',' idClassSel ')' { $$ = new AstReadMem($1,true, $3,$5,NULL,NULL); }
|
||||||
| yD_READMEMH '(' expr ',' varRefMem ',' expr ')' { $$ = new AstReadMem($1,true, $3,$5,$7,NULL); }
|
| yD_READMEMH '(' expr ',' idClassSel ',' expr ')' { $$ = new AstReadMem($1,true, $3,$5,$7,NULL); }
|
||||||
| yD_READMEMH '(' expr ',' varRefMem ',' expr ',' expr ')' { $$ = new AstReadMem($1,true, $3,$5,$7,$9); }
|
| yD_READMEMH '(' expr ',' idClassSel ',' expr ',' expr ')' { $$ = new AstReadMem($1,true, $3,$5,$7,$9); }
|
||||||
;
|
;
|
||||||
|
|
||||||
system_f_call<nodep>: // IEEE: system_tf_call (as func)
|
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); }
|
| 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
|
// 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
|
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); }
|
idDotted { $$ = new AstParseRef($1->fileline(), AstParseRefExp::PX_VAR_ANY, "", $1, NULL); $$->start(true); }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue