mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Internals: Add special Dfg vertex for replication (#7471)
This commit is contained in:
@@ -384,6 +384,26 @@ class AstToDfgConverter final : public VNVisitor {
|
||||
nodep->user2p(vtxp);
|
||||
}
|
||||
}
|
||||
void visit(AstReplicate* nodep) override {
|
||||
UASSERT_OBJ(m_converting, nodep, "AstToDfg visit called without m_converting");
|
||||
UASSERT_OBJ(!nodep->user2p(), nodep, "Already has Dfg vertex");
|
||||
if (unhandled(nodep)) return;
|
||||
|
||||
const DfgDataType* const dtypep = DfgDataType::fromAst(nodep->dtypep());
|
||||
if (!dtypep) {
|
||||
m_foundUnhandled = true;
|
||||
++m_ctx.m_conv.nonRepDType;
|
||||
return;
|
||||
}
|
||||
|
||||
iterate(nodep->srcp());
|
||||
if (m_foundUnhandled) return;
|
||||
|
||||
FileLine* const flp = nodep->fileline();
|
||||
DfgRep* const vtxp = make<DfgRep>(flp, *dtypep);
|
||||
vtxp->srcp(nodep->srcp()->user2u().to<DfgVertex*>());
|
||||
nodep->user2p(vtxp);
|
||||
}
|
||||
void visit(AstSel* nodep) override {
|
||||
UASSERT_OBJ(m_converting, nodep, "AstToDfg visit called without m_converting");
|
||||
UASSERT_OBJ(!nodep->user2p(), nodep, "Already has Dfg vertex");
|
||||
@@ -426,6 +446,7 @@ class AstToDfgConverter final : public VNVisitor {
|
||||
}
|
||||
nodep->user2p(vtxp);
|
||||
}
|
||||
|
||||
// The rest of the visit methods for expressions are generated by 'astgen'
|
||||
#include "V3Dfg__gen_ast_to_dfg.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user