Implement 'forceable' attribute

Using the 'forceable' directive in a configuration file, or the /*
verilator forceable */ metacomment on a variable declaration will
generate additional public signals that allow the specified signals to
be forced/released from the C++ code.
This commit is contained in:
Geza Lore
2022-01-16 15:31:37 +00:00
parent 539c9d4c63
commit f8c0169e82
27 changed files with 1196 additions and 6 deletions
+9
View File
@@ -256,6 +256,15 @@ class ForceConvertVisitor final : public VNVisitor {
relinker.relink(resetEnp);
}
void visit(AstVarScope* nodep) override {
// If this signal is marked externally forceable, create the public force signals
if (nodep->varp()->isForceable()) {
const ForceComponentsVarScope& fc = getForceComponents(nodep);
fc.m_enVscp->varp()->sigPublic(true);
fc.m_valVscp->varp()->sigPublic(true);
}
}
// CONSTRUCTOR
explicit ForceConvertVisitor(AstNetlist* nodep) {
// Transform all force and release statements