summaryrefslogtreecommitdiff
path: root/qrouter.c
diff options
context:
space:
mode:
authorTim Edwards <tim@opencircuitdesign.com>2015-11-13 08:58:30 -0500
committerTim Edwards <tim@opencircuitdesign.com>2015-11-13 08:58:30 -0500
commit88898ad88f58f68e28f64baf7dfbc36c8816022c (patch)
treeef1800883e7b03ac166c63197cad9efec092187d /qrouter.c
parent2a60cf4971140c02feb9290669da588004b62db9 (diff)
Corrected a really bad error that I don't know how long has been
there; second stage routes a net but never commits that route back to the obstruction array, so subsequent nets will not see it and route over top it.
Diffstat (limited to 'qrouter.c')
-rw-r--r--qrouter.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/qrouter.c b/qrouter.c
index 66770aa..05ea739 100644
--- a/qrouter.c
+++ b/qrouter.c
@@ -620,7 +620,7 @@ void read_def(char *filename)
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
-int dofirststage(u_char graphdebug)
+int dofirststage(u_char graphdebug, int debug_netnum)
{
int i, failcount, remaining, result;
NET net;
@@ -629,17 +629,20 @@ int dofirststage(u_char graphdebug)
// Clear the lists of failed routes, in case first
// stage is being called more than once.
- while (FailedNets) {
- nl = FailedNets->next;
- free(FailedNets);
- FailedNets = nl;
+ if (debug_netnum <= 0) {
+ while (FailedNets) {
+ nl = FailedNets->next;
+ free(FailedNets);
+ FailedNets = nl;
+ }
}
// Now find and route all the nets
remaining = Numnets;
- for (i = 0; i < Numnets; i++) {
+ for (i = (debug_netnum >= 0) ? debug_netnum : 0; i < Numnets; i++) {
+
net = getnettoroute(i);
if ((net != NULL) && (net->netnodes != NULL)) {
result = doroute(net, (u_char)0, graphdebug);
@@ -660,8 +663,10 @@ int dofirststage(u_char graphdebug)
}
remaining--;
}
+ if (debug_netnum >= 0) break;
}
failcount = countlist(FailedNets);
+ if (debug_netnum >= 0) return failcount;
if (Verbose > 0) {
Flush(stdout);
@@ -1111,7 +1116,7 @@ int route_net_ripup(NET net, u_char graphdebug)
/*--------------------------------------------------------------*/
int
-dosecondstage(u_char graphdebug)
+dosecondstage(u_char graphdebug, u_char singlestep)
{
int failcount, origcount, result, maxtries, lasttries;
NET net;
@@ -1190,6 +1195,9 @@ dosecondstage(u_char graphdebug)
// to the end of the FailedNets list.
ripup_colliding(net);
+ // Write back the original route to the grid array
+ writeback_all_routes(net);
+
// Failsafe---if we have been looping enough times to exceed
// maxtries (which is set to 8 route attempts per original failed
// net), then we check progress. If we have reduced the number
@@ -1213,6 +1221,7 @@ dosecondstage(u_char graphdebug)
origcount = failcount;
}
}
+ if (singlestep && (FailedNets != NULL)) return countlist(FailedNets);
}
// If the list of abandoned nets is non-null, attach it to the