router2: Improve robustness when critical nets conflict

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2023-08-24 08:55:53 +02:00 committed by myrtle
parent 977180524a
commit e08471dfaf

View File

@ -626,7 +626,7 @@ struct Router2
int dst_wire_idx = wire_to_idx.at(dst_wire); int dst_wire_idx = wire_to_idx.at(dst_wire);
// Calculate a timing weight based on criticality // Calculate a timing weight based on criticality
float crit = get_arc_crit(net, i); float crit = get_arc_crit(net, i);
float crit_weight = (1.0f - std::pow(crit, 2)); float crit_weight = std::max<float>(0.05f, (1.0f - std::pow(crit, 2)));
ROUTE_LOG_DBG(" crit=%.3f crit_weight=%.3f\n", crit, crit_weight); ROUTE_LOG_DBG(" crit=%.3f crit_weight=%.3f\n", crit, crit_weight);
// Check if arc was already done _in this iteration_ // Check if arc was already done _in this iteration_
if (t.processed_sinks.count(dst_wire)) if (t.processed_sinks.count(dst_wire))