mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
DFG: Support AstSel and AstConcat on LHS of assignments
Added DfgVertexVariadic to represent DFG vetices with a varying number of source operands. Converted DfgVar to be a variadic vertex, with each driver corresponding to a fixed range of bits in the packed variable. This allows us to handle AstSel on the LHS of assignments. Also added support for AstConcat on the LHS by selecting into the RHS as appropriate. This improves OpenTitan ST speed by ~13%
This commit is contained in:
+7
-3
@@ -251,7 +251,7 @@ static void dumpDotVertexAndSourceEdges(std::ostream& os, const DfgVertex& vtx)
|
||||
vtx.forEachSourceEdge([&](const DfgEdge& edge, size_t idx) { //
|
||||
if (edge.sourcep()) {
|
||||
string headLabel;
|
||||
if (vtx.arity() > 1) headLabel = std::toupper(vtx.srcName(idx)[0]);
|
||||
if (vtx.arity() > 1) headLabel = vtx.srcName(idx);
|
||||
dumpDotEdge(os, edge, headLabel);
|
||||
}
|
||||
});
|
||||
@@ -502,11 +502,15 @@ void DfgVertex::replaceWith(DfgVertex* newSorucep) {
|
||||
void DfgVar::accept(DfgVisitor& visitor) { visitor.visit(this); }
|
||||
|
||||
bool DfgVar::selfEquals(const DfgVertex& that) const {
|
||||
if (const DfgVar* otherp = that.cast<DfgVar>()) return varp() == otherp->varp();
|
||||
if (const DfgVar* otherp = that.cast<DfgVar>()) {
|
||||
UASSERT_OBJ(varp() != otherp->varp() || this == otherp, this,
|
||||
"There should only be one DfgVar for a given AstVar");
|
||||
return this == otherp;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
V3Hash DfgVar::selfHash() const { return V3Hasher::uncachedHash(m_varp); }
|
||||
V3Hash DfgVar::selfHash() const { return V3Hasher::uncachedHash(varp()); }
|
||||
|
||||
// DfgConst ----------
|
||||
void DfgConst::accept(DfgVisitor& visitor) { visitor.visit(this); }
|
||||
|
||||
Reference in New Issue
Block a user