3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-12-04 19:16:48 +00:00

Forbid creating IdStrings and incrementing autoidx during multithreaded phases, and add dynamic checks for that

We could make it safe to increment autoidx during multithreaded passes, but that's
actually undesirable because it would lead to nondeterminism. If/when we need new
IDs during parallel passes, we'll have to figure out how to allocate them in a
deterministic way, and that will depend on the details of what the pass does.
So don't try to tackle that now.
This commit is contained in:
Robert O'Callahan 2025-11-24 22:29:06 +00:00
parent 4c8b537d71
commit 8f0ecce53f
5 changed files with 55 additions and 4 deletions

View file

@ -98,7 +98,7 @@ int RTLIL::IdString::really_insert(std::string_view p, std::unordered_map<std::s
return -*p_autoidx;
// Ensure NEW_ID/NEW_ID_SUFFIX will not create collisions with the ID
// we're about to create.
autoidx = std::max(autoidx, *p_autoidx + 1);
autoidx.ensure_at_least(*p_autoidx + 1);
}
}