mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
This commit is contained in:
+7
-6
@@ -1856,7 +1856,7 @@ V3TaskConnects V3Task::taskConnects(AstNodeFTaskRef* nodep, AstNode* taskStmtsp,
|
||||
if (!makeChanges) return tconnects;
|
||||
|
||||
// Connect missing ones
|
||||
std::set<const AstVar*> argWrap; // Which ports are defaulted, forcing arg wrapper creation
|
||||
VInsertionSet<const AstVar*> argWrap; // Which ports are defaulted; need arg wrapper creation
|
||||
for (int i = 0; i < tpinnum; ++i) {
|
||||
AstVar* const portp = tconnects[i].first;
|
||||
if (!tconnects[i].second || !tconnects[i].second->exprp()) {
|
||||
@@ -1882,7 +1882,7 @@ V3TaskConnects V3Task::taskConnects(AstNodeFTaskRef* nodep, AstNode* taskStmtsp,
|
||||
if (statep) {
|
||||
portp->pinNum(i + 1); // Make sure correct, will use to build name
|
||||
UINFO(9, "taskConnects arg wrapper needed " << portp->valuep());
|
||||
argWrap.emplace(portp);
|
||||
argWrap.insert(portp);
|
||||
} else { // statep = nullptr, called too late or otherwise to handle args
|
||||
// Problem otherwise is we might have a varref, task
|
||||
// call, or something else that only makes sense in the
|
||||
@@ -1956,7 +1956,8 @@ V3TaskConnects V3Task::taskConnects(AstNodeFTaskRef* nodep, AstNode* taskStmtsp,
|
||||
}
|
||||
|
||||
void V3Task::taskConnectWrap(AstNodeFTaskRef* nodep, const V3TaskConnects& tconnects,
|
||||
V3TaskConnectState* statep, const std::set<const AstVar*>& argWrap) {
|
||||
V3TaskConnectState* statep,
|
||||
const VInsertionSet<const AstVar*>& argWrap) {
|
||||
statep->setDidWrap();
|
||||
// Make wrapper name such that is same iff same args are defaulted
|
||||
std::string newname = nodep->name() + "__Vtcwrap";
|
||||
@@ -1973,7 +1974,7 @@ void V3Task::taskConnectWrap(AstNodeFTaskRef* nodep, const V3TaskConnects& tconn
|
||||
for (const auto& tconnect : tconnects) {
|
||||
const AstVar* const portp = tconnect.first;
|
||||
AstArg* const argp = tconnect.second;
|
||||
if (argWrap.find(portp) != argWrap.end()) { // Removed arg
|
||||
if (argWrap.exists(portp)) { // Removed arg
|
||||
statep->pushDeletep(argp->unlinkFrBack());
|
||||
}
|
||||
}
|
||||
@@ -1985,7 +1986,7 @@ void V3Task::taskConnectWrap(AstNodeFTaskRef* nodep, const V3TaskConnects& tconn
|
||||
|
||||
AstNodeFTask* V3Task::taskConnectWrapNew(AstNodeFTask* taskp, const string& newname,
|
||||
const V3TaskConnects& tconnects,
|
||||
const std::set<const AstVar*>& argWrap) {
|
||||
const VInsertionSet<const AstVar*>& argWrap) {
|
||||
std::map<const AstVar*, AstVar*> oldNewVars; // Old -> new var mappings
|
||||
|
||||
AstNodeFTask* const newTaskp = taskp->cloneType(newname);
|
||||
@@ -2019,7 +2020,7 @@ AstNodeFTask* V3Task::taskConnectWrapNew(AstNodeFTask* taskp, const string& newn
|
||||
for (const auto& tconnect : tconnects) {
|
||||
AstVar* const portp = tconnect.first;
|
||||
AstVar* newPortp;
|
||||
if (argWrap.find(portp) == argWrap.end()) { // Not removed arg
|
||||
if (!argWrap.exists(portp)) { // Not removed arg
|
||||
newPortp = new AstVar{portp->fileline(), portp->varType(), portp->name(), portp};
|
||||
newPortp->propagateWrapAttrFrom(portp);
|
||||
newPortp->funcLocal(true);
|
||||
|
||||
Reference in New Issue
Block a user