mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Fix library method argument references (#8252)
Each VCMethod now carries a signature describing the access required of the references passed as arguments to the call. 'r' if the argument is read, 'w' if it is fully assigned so the old value does not matter, 'm' if it is modified (or only conditionally assigned), with a trailing '+' repeating the preceding entry for all remaining arguments. Signatures are validated at compile time, and V3Broken checks the arguments of every AstCMethodHard against them. The incorrect references this found and that are easy to fix are repaired in this patch. "TODO" marks method that are currently broken or not yet fit the scheme, these will be fixed in follow up patches. Also renames SCHED_COMMIT and SCHED_ENQUEUE to NBA_COMMIT and NBA_ENQUEUE, and remove unused methods.
This commit is contained in:
+3
-2
@@ -865,8 +865,9 @@ class DelayedVisitor final : public VNVisitor {
|
||||
activep->addStmtsp(postp);
|
||||
// Add the commit
|
||||
AstCMethodHard* const callp = new AstCMethodHard{
|
||||
flp, new AstVarRef{flp, queueVscp, VAccess::READWRITE}, VCMethod::SCHED_COMMIT};
|
||||
flp, new AstVarRef{flp, queueVscp, VAccess::READWRITE}, VCMethod::NBA_COMMIT};
|
||||
callp->dtypeSetVoid();
|
||||
// TODO: this is a partial update, so must be READWRITE, but that breaks scheduling
|
||||
callp->addPinsp(new AstVarRef{flp, vscp, VAccess::WRITE});
|
||||
postp->addStmtsp(callp->makeStmt());
|
||||
}
|
||||
@@ -975,7 +976,7 @@ class DelayedVisitor final : public VNVisitor {
|
||||
// Enqueue the update at the site of the original NBA
|
||||
AstCMethodHard* const callp = new AstCMethodHard{
|
||||
flp, new AstVarRef{flp, vscpInfo.valueQueueKit().vscp, VAccess::READWRITE},
|
||||
VCMethod::SCHED_ENQUEUE};
|
||||
VCMethod::NBA_ENQUEUE};
|
||||
callp->dtypeSetVoid();
|
||||
callp->addPinsp(valuep);
|
||||
if (partial) callp->addPinsp(maskp);
|
||||
|
||||
Reference in New Issue
Block a user