Internals: Minor refactoring of checker parsing/tests. No functional change.

This commit is contained in:
Wilson Snyder
2025-04-06 23:13:24 -04:00
parent c7ff82f06b
commit c8a945f363
8 changed files with 72 additions and 54 deletions
+2 -2
View File
@@ -114,7 +114,7 @@ public:
callp->argTypes("vlSymsp");
} else {
if (m_type.isCoverage()) callp->argTypes("first");
callp->selfPointer(VSelfPointerText{VSelfPointerText::This()});
callp->selfPointer(VSelfPointerText{VSelfPointerText::This{}});
}
rootFuncp->addStmtsp(callp->makeStmt());
}
@@ -235,7 +235,7 @@ void V3CCtors::evalAsserts() {
// if (signal & CONST(upper_non_clean_mask)) { fail; }
AstVarRef* const vrefp
= new AstVarRef{varp->fileline(), varp, VAccess::READ};
vrefp->selfPointer(VSelfPointerText{VSelfPointerText::This()});
vrefp->selfPointer(VSelfPointerText{VSelfPointerText::This{}});
AstNodeExpr* newp = vrefp;
if (varp->isWide()) {
newp = new AstWordSel{
+3 -3
View File
@@ -74,7 +74,7 @@ class DescopeVisitor final : public VNVisitor {
string name = scopep->name();
string::size_type pos;
if ((pos = name.rfind('.')) != string::npos) name.erase(0, pos + 1);
ret.thisPtr = VSelfPointerText{VSelfPointerText::This(), name};
ret.thisPtr = VSelfPointerText{VSelfPointerText::This{}, name};
}
return ret.thisPtr;
}
@@ -104,9 +104,9 @@ class DescopeVisitor final : public VNVisitor {
if (VN_IS(scopep->modp(), Class)) {
// Direct reference to class members are from within the class itself, references from
// outside the class must go via AstMemberSel
return VSelfPointerText{VSelfPointerText::This()};
return VSelfPointerText{VSelfPointerText::This{}};
} else if (relativeRefOk && scopep == m_scopep) {
return VSelfPointerText{VSelfPointerText::This()};
return VSelfPointerText{VSelfPointerText::This{}};
} else if (relativeRefOk && !m_modSingleton && scopep->aboveScopep() == m_scopep
&& VN_IS(scopep->modp(), Module)) {
// Reference to scope of instance directly under this module, can just "this->cell",
+11 -7
View File
@@ -1496,7 +1496,7 @@ list_of_ports<nodep>: // IEEE: list_of_ports + list_of_port_declaratio
portAndTagE<nodep>:
/* empty */
{ int p = PINNUMINC();
{ const int p = PINNUMINC();
const string name = "__pinNumber" + cvtToStr(p);
$$ = new AstPort{CRELINE(), p, name};
AstVar* varp = new AstVar{CRELINE(), VVarType::WIRE, name, VFlagChildDType{},
@@ -6304,22 +6304,26 @@ property_port_item<nodep>: // IEEE: property_port_item/sequence_port_item
// // id {variable_dimension} [ '=' property_actual_arg ]
// // seq IEEE: [ yLOCAL [ sequence_lvar_port_direction ] ] sequence_formal_type
// // id {variable_dimension} [ '=' sequence_actual_arg ]
property_port_itemFront property_port_itemAssignment { $$ = $2; }
property_port_itemFront property_port_itemAssignment { $$ = $2; }
;
property_port_itemFront: // IEEE: part of property_port_item/sequence_port_item
property_port_itemDirE property_formal_typeNoDt { VARDTYPE($2); }
property_port_itemDirE property_formal_typeNoDt
{ VARDTYPE($2); }
// // data_type_or_implicit
| property_port_itemDirE data_type
{ VARDTYPE($2); GRAMMARP->m_typedPropertyPort = true; }
| property_port_itemDirE yVAR data_type
{ VARDTYPE($3); GRAMMARP->m_typedPropertyPort = true; }
| property_port_itemDirE yVAR implicit_typeE { VARDTYPE($3); }
| property_port_itemDirE implicit_typeE { VARDTYPE($2); }
| property_port_itemDirE yVAR implicit_typeE
{ VARDTYPE($3); }
| property_port_itemDirE implicit_typeE
{ VARDTYPE($2); }
;
property_port_itemAssignment<nodep>: // IEEE: part of property_port_item/sequence_port_item/checker_port_direction
id variable_dimensionListE { $$ = VARDONEA($<fl>1, *$1, $2, nullptr); }
id variable_dimensionListE
{ $$ = VARDONEA($<fl>1, *$1, $2, nullptr); }
| id variable_dimensionListE '=' property_actual_arg
{ $$ = VARDONEA($<fl>1, *$1, $2, $4);
BBUNSUP($3, "Unsupported: property variable default value"); }
@@ -7128,7 +7132,7 @@ rs_case_item<nodep>: // ==IEEE: rs_case_item
//**********************************************************************
// Checker
checker_declaration<nodep>: // ==IEEE: part of checker_declaration
checker_declaration<nodeModulep>: // ==IEEE: part of checker_declaration
checkerFront checker_port_listE ';'
checker_or_generate_itemListE yENDCHECKER endLabelE
{ $$ = $1;