Fix process comparison compile error with --public-flat-rw (#7592).

Fixes #7592.
This commit is contained in:
Wilson Snyder
2026-05-14 17:52:28 -04:00
parent dff2606c0c
commit d66733aeb8
5 changed files with 37 additions and 5 deletions
+2 -1
View File
@@ -1677,7 +1677,7 @@ class AstSystemCSection final : public AstNode {
// containing arbitrary text that is emitted to the C++ output in various
// locations depending on the sectionType.
const VSystemCSectionType m_sectionType; // The section type
const std::string m_text; // The text content
std::string m_text; // The text content
public:
AstSystemCSection(FileLine* fl, VSystemCSectionType sectionType, const std::string& text)
@@ -1689,6 +1689,7 @@ public:
ASTGEN_MEMBERS_AstSystemCSection;
VSystemCSectionType sectionType() const { return m_sectionType; }
const std::string& text() const { return m_text; }
void text(const std::string& value) { m_text = value; }
void dump(std::ostream&) const override;
void dumpJson(std::ostream&) const override;
bool sameNode(const AstNode*) const override { return false; }
+14 -4
View File
@@ -24,6 +24,7 @@
#include "V3Name.h"
#include "V3LanguageWords.h"
#include "V3MemberMap.h"
#include "V3UniqueNames.h"
#include <vector>
@@ -80,10 +81,8 @@ class NameVisitor final : public VNVisitorConst {
// VISITORS
void visit(AstNodeModule* nodep) override {
VL_RESTORER(m_modp);
{
m_modp = nodep;
iterateChildrenConst(nodep);
}
m_modp = nodep;
iterateChildrenConst(nodep);
}
// Add __PVT__ to names of local signals
void visit(AstVar* nodep) override {
@@ -154,6 +153,17 @@ class NameVisitor final : public VNVisitorConst {
iterateChildrenConst(nodep);
}
}
void visit(AstSystemCSection* nodep) override {
// include/verilated_std.sv assumes that V3Name does renaming of std::process;
// if V3Name does not, remove the __PVT__.
if (m_modp && m_modp->name() == "std__03a__03aprocess") {
VMemberMap memberMap;
if (memberMap.findMember(m_modp, "m_process")) {
nodep->text(VString::replaceSubstr(nodep->text(), "__PVT__", ""));
}
}
iterateChildrenConst(nodep);
}
//--------------------
void visit(AstNode* nodep) override { iterateChildrenConst(nodep); }