mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Fix DFG removing forceable signals (#4942)
DFG could remove forceable signals by replacing them with their in-design driver. This is a bit of a pain to prevent, and ideally the forcing transform should happen before DFG, but implementing it there is a pain due to having to rewrite ports based on direction. This is an attempted fix in DFG. More cases might remain.
This commit is contained in:
@@ -439,11 +439,14 @@ class AstToDfgVisitor final : public VNVisitor {
|
||||
if (nodep->isSc()) return;
|
||||
// No need to (and in fact cannot) handle variables with unsupported dtypes
|
||||
if (!DfgVertex::isSupportedDType(nodep->dtypep())) return;
|
||||
// Mark ports as having external references
|
||||
if (nodep->isIO()) getNet(nodep)->setHasExtRefs();
|
||||
// Mark variables that are the target of a hierarchical reference
|
||||
// (these flags were set up in DataflowPrepVisitor)
|
||||
if (nodep->user2()) getNet(nodep)->setHasExtRefs();
|
||||
|
||||
// Mark variables with external references
|
||||
if (nodep->isIO() // Ports
|
||||
|| nodep->user2() // Target of a hierarchical reference
|
||||
|| nodep->isForceable() // Forceable
|
||||
) {
|
||||
getNet(nodep)->setHasExtRefs();
|
||||
}
|
||||
}
|
||||
|
||||
void visit(AstAssignW* nodep) override {
|
||||
|
||||
Reference in New Issue
Block a user