From 6c332a2f8eec0ea272dc457740a3256d8c6f686b Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Wed, 16 Jun 2021 13:02:46 +0100 Subject: [PATCH] Emit: Remove emitVarCmtChg emitVarCmtChg used to emit MTask affinity of variables in comments in the generated header. This causes unnecessary changes in the output when scheduling changes slightly between compilation, hindering ccache reuse. If needing this info for debugging Verilator, add a separate dump file instead of emitting it in the generated code. --- src/V3AstNodes.cpp | 7 ------- src/V3AstNodes.h | 1 - src/V3EmitC.cpp | 14 +------------- 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/V3AstNodes.cpp b/src/V3AstNodes.cpp index 399ceb3b9..4b607309c 100644 --- a/src/V3AstNodes.cpp +++ b/src/V3AstNodes.cpp @@ -640,13 +640,6 @@ AstVar* AstVar::scVarRecurse(AstNode* nodep) { return nullptr; } -string AstVar::mtasksString() const { - std::ostringstream os; - os << "all: "; - for (const auto& id : m_mtaskIds) os << id << " "; - return os.str(); -} - class AstNodeDType::CTypeRecursed final { public: string m_type; // The base type, e.g.: "Foo_t"s diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index 7f583f929..19dea6a9b 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -2227,7 +2227,6 @@ public: void addProducingMTaskId(int id) { m_mtaskIds.insert(id); } void addConsumingMTaskId(int id) { m_mtaskIds.insert(id); } const MTaskIdSet& mtaskIds() const { return m_mtaskIds; } - string mtasksString() const; }; class AstDefParam final : public AstNode { diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 290608961..671eecf5c 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -124,13 +124,6 @@ public: puts("[" + cvtToStr(arrayp->elementsConst()) + "]"); } } - void emitVarCmtChg(const AstVar* varp, string* curVarCmtp) { - string newVarCmt = varp->mtasksString(); - if (*curVarCmtp != newVarCmt) { - *curVarCmtp = newVarCmt; - if (v3Global.opt.threads()) puts("// Begin mtask footprint " + *curVarCmtp + "\n"); - } - } void emitTypedefs(AstNode* firstp) { bool first = true; for (AstNode* loopp = firstp; loopp; loopp = loopp->nextp()) { @@ -3097,7 +3090,6 @@ void EmitCStmts::emitSortedVarList(const VarVec& anons, const VarVec& nonanons, if (anonL1s != 1) puts("struct {\n"); for (int l0 = 0; l0 < lim && it != anons.cend(); ++l0) { const AstVar* varp = *it; - emitVarCmtChg(varp, &curVarCmt); emitVarDecl(varp, prefixIfImp); ++it; } @@ -3110,15 +3102,11 @@ void EmitCStmts::emitSortedVarList(const VarVec& anons, const VarVec& nonanons, // Leftovers, just in case off by one error somewhere above for (; it != anons.end(); ++it) { const AstVar* varp = *it; - emitVarCmtChg(varp, &curVarCmt); emitVarDecl(varp, prefixIfImp); } } // Output nonanons - for (const AstVar* varp : nonanons) { - emitVarCmtChg(varp, &curVarCmt); - emitVarDecl(varp, prefixIfImp); - } + for (const AstVar* varp : nonanons) { emitVarDecl(varp, prefixIfImp); } } void EmitCImp::emitThreadingState() {