Support vpi_put/vpi_get forcing of signals (#5933) (#6704).

This commit is contained in:
Christian Hecken
2026-01-10 03:48:46 -05:00
committed by Wilson Snyder
parent a98eb4fa04
commit 338afff23c
20 changed files with 2146 additions and 56 deletions
+14
View File
@@ -457,6 +457,20 @@ class ForceConvertVisitor final : public VNVisitor {
void visit(AstVarScope* nodep) override {
// If this signal is marked externally forceable, create the public force signals
if (nodep->varp()->isForceable()) {
if (VN_IS(nodep->varp()->dtypeSkipRefp(), UnpackArrayDType)) {
nodep->varp()->v3warn(
E_UNSUPPORTED,
"Unsupported: Forcing unpacked arrays: " << nodep->varp()->name()); // (#4735)
return;
}
const AstBasicDType* const bdtypep = nodep->varp()->basicp();
const bool strtype = bdtypep && bdtypep->keyword() == VBasicDTypeKwd::STRING;
if (strtype) {
nodep->varp()->v3error(
"Forcing strings is not permitted: " << nodep->varp()->name());
}
const ForceState::ForceComponentsVarScope& fc = m_state.getForceComponents(nodep);
fc.m_enVscp->varp()->sigUserRWPublic(true);
fc.m_valVscp->varp()->sigUserRWPublic(true);