mirror of
https://github.com/verilator/verilator.git
synced 2026-09-03 16:28:53 +02:00
Internals: Refactor generate construct Ast handling (#6280) We introduce AstNodeGen, the common base class of AstGenBlock, AstGenCase, AstGenFor, and AstGenIf, which together represent all SV generate constructs. Subsequently remove AstNodeFor, AstNodeCase (AstCase is now directly derived from AstNodeStmt) and adjust internals to work on the new representation. Output is identical modulo hashes do to changed AstNode type ids, no functional change intended. Step towards #6280.
This commit is contained in:
+11
-1
@@ -710,6 +710,16 @@ class CoverageVisitor final : public VNVisitor {
|
||||
lineTrack(nodep);
|
||||
}
|
||||
}
|
||||
void visit(AstGenBlock* nodep) override {
|
||||
// Similar to AstBegin
|
||||
VL_RESTORER(m_beginHier);
|
||||
if (nodep->name() != "") {
|
||||
m_beginHier = m_beginHier + (m_beginHier != "" ? "__DOT__" : "") + nodep->name();
|
||||
}
|
||||
iterateChildren(nodep);
|
||||
lineTrack(nodep);
|
||||
}
|
||||
|
||||
void visit(AstBegin* nodep) override {
|
||||
// Record the hierarchy of any named begins, so we can apply to user
|
||||
// coverage points. This is because there may be cov points inside
|
||||
@@ -718,7 +728,7 @@ class CoverageVisitor final : public VNVisitor {
|
||||
// covers the code in that line.)
|
||||
VL_RESTORER(m_beginHier);
|
||||
VL_RESTORER(m_inToggleOff);
|
||||
if (!nodep->generate()) m_inToggleOff = true;
|
||||
m_inToggleOff = true;
|
||||
if (nodep->name() != "") {
|
||||
m_beginHier = m_beginHier + (m_beginHier != "" ? "__DOT__" : "") + nodep->name();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user