mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Internals: Assign trace codes starting from zero (#7007)
Use uint32_t max value instead of zero as sentinel value for a trace code being unassigned. Prep for follow on patch. Note the actual trace file will still start codes from one, the codes in the model are just an offset from the base code.
This commit is contained in:
+3
-8
@@ -190,7 +190,6 @@ class TraceVisitor final : public VNVisitor {
|
||||
|
||||
VDouble0 m_statSetters; // Statistic tracking
|
||||
VDouble0 m_statSettersSlow; // Statistic tracking
|
||||
VDouble0 m_statUniqCodes; // Statistic tracking
|
||||
VDouble0 m_statUniqSigs; // Statistic tracking
|
||||
|
||||
// All activity numbers applying to a given trace
|
||||
@@ -595,19 +594,18 @@ class TraceVisitor final : public VNVisitor {
|
||||
// no need to create a TraceInc node.
|
||||
const AstTraceDecl* const canonDeclp = canonVtxp->nodep();
|
||||
UASSERT_OBJ(!canonVtxp->duplicatep(), canonDeclp, "Canonical node is a duplicate");
|
||||
UASSERT_OBJ(canonDeclp->code() != 0, canonDeclp,
|
||||
UASSERT_OBJ(canonDeclp->codeAssigned(), canonDeclp,
|
||||
"Canonical node should have code assigned already");
|
||||
declp->code(canonDeclp->code());
|
||||
continue;
|
||||
}
|
||||
|
||||
// This is a canonical trace node. Assign trace code (signal number).
|
||||
UASSERT_OBJ(declp->code() == 0, declp,
|
||||
UASSERT_OBJ(!declp->codeAssigned(), declp,
|
||||
"Canonical node should not have code assigned yet");
|
||||
declp->code(m_code);
|
||||
const uint32_t codeInc = declp->codeInc();
|
||||
m_code += codeInc;
|
||||
m_statUniqCodes += codeInc;
|
||||
++m_statUniqSigs;
|
||||
|
||||
// If this is a const signal, add the AstTraceInc
|
||||
@@ -839,9 +837,6 @@ class TraceVisitor final : public VNVisitor {
|
||||
|
||||
// VISITORS
|
||||
void visit(AstNetlist* nodep) override {
|
||||
m_code = 1; // Multiple TopScopes will require fixing how code#s
|
||||
// are assigned as duplicate varscopes must result in the same tracing code#.
|
||||
|
||||
// Add vertexes for all TraceDecl, and edges from VARs each trace looks at
|
||||
m_finding = false;
|
||||
iterateChildren(nodep);
|
||||
@@ -945,7 +940,7 @@ public:
|
||||
~TraceVisitor() override {
|
||||
V3Stats::addStat("Tracing, Activity setters", m_statSetters);
|
||||
V3Stats::addStat("Tracing, Activity slow blocks", m_statSettersSlow);
|
||||
V3Stats::addStat("Tracing, Unique trace codes", m_statUniqCodes);
|
||||
V3Stats::addStat("Tracing, Unique trace codes", m_code);
|
||||
V3Stats::addStat("Tracing, Unique traced signals", m_statUniqSigs);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user