Another router1 bugfix
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
parent
f93129634b
commit
f9a5126338
@ -459,77 +459,72 @@ struct Router1
|
|||||||
WireId conflictWireWire = WireId(), conflictPipWire = WireId();
|
WireId conflictWireWire = WireId(), conflictPipWire = WireId();
|
||||||
NetInfo *conflictWireNet = nullptr, *conflictPipNet = nullptr;
|
NetInfo *conflictWireNet = nullptr, *conflictPipNet = nullptr;
|
||||||
|
|
||||||
bool wire_reuse = net_info->wires.count(next_wire);
|
if (net_info->wires.count(next_wire) && net_info->wires.at(next_wire).pip == pip) {
|
||||||
bool pip_reuse = wire_reuse && net_info->wires.at(next_wire).pip == pip;
|
next_bonus += cfg.reuseBonus;
|
||||||
|
} else {
|
||||||
if (!ctx->checkWireAvail(next_wire) && !wire_reuse) {
|
if (!ctx->checkWireAvail(next_wire)) {
|
||||||
if (!ripup)
|
if (!ripup)
|
||||||
continue;
|
|
||||||
conflictWireWire = ctx->getConflictingWireWire(next_wire);
|
|
||||||
if (conflictWireWire == WireId()) {
|
|
||||||
conflictWireNet = ctx->getConflictingWireNet(next_wire);
|
|
||||||
if (conflictWireNet == nullptr)
|
|
||||||
continue;
|
continue;
|
||||||
|
conflictWireWire = ctx->getConflictingWireWire(next_wire);
|
||||||
|
if (conflictWireWire == WireId()) {
|
||||||
|
conflictWireNet = ctx->getConflictingWireNet(next_wire);
|
||||||
|
if (conflictWireNet == nullptr)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!ctx->checkPipAvail(pip) && !pip_reuse) {
|
if (!ctx->checkPipAvail(pip)) {
|
||||||
if (!ripup)
|
if (!ripup)
|
||||||
continue;
|
|
||||||
conflictPipWire = ctx->getConflictingPipWire(pip);
|
|
||||||
if (conflictPipWire == WireId()) {
|
|
||||||
conflictPipNet = ctx->getConflictingPipNet(pip);
|
|
||||||
if (conflictPipNet == nullptr)
|
|
||||||
continue;
|
continue;
|
||||||
|
conflictPipWire = ctx->getConflictingPipWire(pip);
|
||||||
|
if (conflictPipWire == WireId()) {
|
||||||
|
conflictPipNet = ctx->getConflictingPipNet(pip);
|
||||||
|
if (conflictPipNet == nullptr)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (conflictWireNet != nullptr && conflictPipWire != WireId() && conflictWireNet->wires.count(conflictPipWire))
|
if (conflictWireNet != nullptr && conflictPipWire != WireId() && conflictWireNet->wires.count(conflictPipWire))
|
||||||
conflictPipWire = WireId();
|
conflictPipWire = WireId();
|
||||||
|
|
||||||
if (conflictPipNet != nullptr && conflictWireWire != WireId() && conflictPipNet->wires.count(conflictWireWire))
|
if (conflictPipNet != nullptr && conflictWireWire != WireId() && conflictPipNet->wires.count(conflictWireWire))
|
||||||
conflictWireWire = WireId();
|
conflictWireWire = WireId();
|
||||||
|
|
||||||
if (conflictWireWire == conflictPipWire)
|
if (conflictWireWire == conflictPipWire)
|
||||||
conflictWireWire = WireId();
|
conflictWireWire = WireId();
|
||||||
|
|
||||||
if (conflictWireNet == conflictPipNet)
|
if (conflictWireNet == conflictPipNet)
|
||||||
conflictWireNet = nullptr;
|
conflictWireNet = nullptr;
|
||||||
|
|
||||||
if (wire_reuse)
|
if (conflictWireWire != WireId()) {
|
||||||
next_bonus += cfg.wireReuseBonus;
|
auto scores_it = wireScores.find(conflictWireWire);
|
||||||
|
if (scores_it != wireScores.end())
|
||||||
|
next_penalty += scores_it->second * cfg.wireRipupPenalty;
|
||||||
|
next_penalty += cfg.wireRipupPenalty;
|
||||||
|
}
|
||||||
|
|
||||||
if (pip_reuse)
|
if (conflictPipWire != WireId()) {
|
||||||
next_bonus += cfg.pipReuseBonus;
|
auto scores_it = wireScores.find(conflictPipWire);
|
||||||
|
if (scores_it != wireScores.end())
|
||||||
|
next_penalty += scores_it->second * cfg.wireRipupPenalty;
|
||||||
|
next_penalty += cfg.wireRipupPenalty;
|
||||||
|
}
|
||||||
|
|
||||||
if (conflictWireWire != WireId()) {
|
if (conflictWireNet != nullptr) {
|
||||||
auto scores_it = wireScores.find(conflictWireWire);
|
auto scores_it = netScores.find(conflictWireNet);
|
||||||
if (scores_it != wireScores.end())
|
if (scores_it != netScores.end())
|
||||||
next_penalty += scores_it->second * cfg.wireRipupPenalty;
|
next_penalty += scores_it->second * cfg.netRipupPenalty;
|
||||||
next_penalty += cfg.wireRipupPenalty;
|
next_penalty += cfg.netRipupPenalty;
|
||||||
}
|
next_penalty += conflictWireNet->wires.size() * cfg.wireRipupPenalty;
|
||||||
|
}
|
||||||
|
|
||||||
if (conflictPipWire != WireId()) {
|
if (conflictPipNet != nullptr) {
|
||||||
auto scores_it = wireScores.find(conflictPipWire);
|
auto scores_it = netScores.find(conflictPipNet);
|
||||||
if (scores_it != wireScores.end())
|
if (scores_it != netScores.end())
|
||||||
next_penalty += scores_it->second * cfg.wireRipupPenalty;
|
next_penalty += scores_it->second * cfg.netRipupPenalty;
|
||||||
next_penalty += cfg.wireRipupPenalty;
|
next_penalty += cfg.netRipupPenalty;
|
||||||
}
|
next_penalty += conflictPipNet->wires.size() * cfg.wireRipupPenalty;
|
||||||
|
}
|
||||||
if (conflictWireNet != nullptr) {
|
|
||||||
auto scores_it = netScores.find(conflictWireNet);
|
|
||||||
if (scores_it != netScores.end())
|
|
||||||
next_penalty += scores_it->second * cfg.netRipupPenalty;
|
|
||||||
next_penalty += cfg.netRipupPenalty;
|
|
||||||
next_penalty += conflictWireNet->wires.size() * cfg.wireRipupPenalty;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (conflictPipNet != nullptr) {
|
|
||||||
auto scores_it = netScores.find(conflictPipNet);
|
|
||||||
if (scores_it != netScores.end())
|
|
||||||
next_penalty += scores_it->second * cfg.netRipupPenalty;
|
|
||||||
next_penalty += cfg.netRipupPenalty;
|
|
||||||
next_penalty += conflictPipNet->wires.size() * cfg.wireRipupPenalty;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delay_t next_score = next_delay + next_penalty;
|
delay_t next_score = next_delay + next_penalty;
|
||||||
@ -676,9 +671,7 @@ Router1Cfg::Router1Cfg(Context *ctx) : Settings(ctx)
|
|||||||
|
|
||||||
wireRipupPenalty = ctx->getRipupDelayPenalty();
|
wireRipupPenalty = ctx->getRipupDelayPenalty();
|
||||||
netRipupPenalty = 10*ctx->getRipupDelayPenalty();
|
netRipupPenalty = 10*ctx->getRipupDelayPenalty();
|
||||||
|
reuseBonus = wireRipupPenalty/2;
|
||||||
wireReuseBonus = wireRipupPenalty/8;
|
|
||||||
pipReuseBonus = wireRipupPenalty/2;
|
|
||||||
|
|
||||||
estimatePrecision = 100 * ctx->getRipupDelayPenalty();
|
estimatePrecision = 100 * ctx->getRipupDelayPenalty();
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,7 @@ struct Router1Cfg : Settings
|
|||||||
bool useEstimate;
|
bool useEstimate;
|
||||||
delay_t wireRipupPenalty;
|
delay_t wireRipupPenalty;
|
||||||
delay_t netRipupPenalty;
|
delay_t netRipupPenalty;
|
||||||
delay_t wireReuseBonus;
|
delay_t reuseBonus;
|
||||||
delay_t pipReuseBonus;
|
|
||||||
delay_t estimatePrecision;
|
delay_t estimatePrecision;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user