Merge pull request #731 from YosysHQ/gatecat/timing-mem-error

sta: Fix a memory error introduced by using dict instead of unordered_map
This commit is contained in:
gatecat 2021-06-17 18:32:43 +01:00 committed by GitHub
commit 0f9a88b2cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -807,13 +807,20 @@ struct Timing
} }
// Go forwards topologically to find the maximum arrival time and max path length for each net // Go forwards topologically to find the maximum arrival time and max path length for each net
std::vector<ClockEvent> startdomains;
for (auto net : topological_order) { for (auto net : topological_order) {
if (!net_data.count(net)) if (!net_data.count(net))
continue; continue;
// Updates later on might invalidate a reference taken here to net_data, so iterate over a list of domains
// instead
startdomains.clear();
{
auto &nd_map = net_data.at(net); auto &nd_map = net_data.at(net);
for (auto &startdomain : nd_map) { for (auto &startdomain : nd_map)
ClockEvent start_clk = startdomain.first; startdomains.push_back(startdomain.first);
auto &nd = startdomain.second; }
for (auto &start_clk : startdomains) {
auto &nd = net_data.at(net).at(start_clk);
if (nd.false_startpoint) if (nd.false_startpoint)
continue; continue;
const auto net_arrival = nd.max_arrival; const auto net_arrival = nd.max_arrival;