summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Edwards <tim@opencircuitdesign.com>2014-10-24 13:42:02 -0400
committerTim Edwards <tim@opencircuitdesign.com>2014-10-24 13:42:02 -0400
commite3381a31bb222f37ed0646ff178d641af7caefc7 (patch)
treeeca13353f53f82c282ec486cf9bc1501908fb155
parent97714c1935ad3d90d712c7582ae6866c1f7fd51a (diff)
Corrections to restore the ability to handle an already-routed input
net (in which case it basically verifies the routing).
-rw-r--r--maze.c1
-rw-r--r--node.c12
-rw-r--r--qrouter.c14
3 files changed, 18 insertions, 9 deletions
diff --git a/maze.c b/maze.c
index 7b83594..8917cf6 100644
--- a/maze.c
+++ b/maze.c
@@ -60,6 +60,7 @@ NODE find_unrouted_node(NET net)
for (rt = net->routes; rt; rt = rt->next) {
seg1 = rt->segments;
+ if (seg1 == NULL) continue;
seg2 = seg1;
while (seg2->next) seg2 = seg2->next;
diff --git a/node.c b/node.c
index 429784d..319e5b2 100644
--- a/node.c
+++ b/node.c
@@ -286,7 +286,7 @@ void defineRouteTree(NET net)
net->trunkx = xmin;
net->trunky = ymin;
}
- else {
+ else if (net->numnodes > 0) {
// Use the first tap point for each node to get a rough
// centroid of all taps
@@ -508,12 +508,12 @@ void create_obstructions_from_variable_pitch()
void
disable_gridpos(int x, int y, int lay)
{
- int apos = OGRID(x, y, lay);
+ int apos = OGRID(x, y, lay);
- Obs[lay][apos] = (u_int)(NO_NET | OBSTRUCT_MASK);
- Nodeloc[lay][apos] = NULL;
- Nodesav[lay][apos] = NULL;
- Stub[lay][apos] = 0.0;
+ Obs[lay][apos] = (u_int)(NO_NET | OBSTRUCT_MASK);
+ Nodeloc[lay][apos] = NULL;
+ Nodesav[lay][apos] = NULL;
+ Stub[lay][apos] = 0.0;
}
/*--------------------------------------------------------------*/
diff --git a/qrouter.c b/qrouter.c
index 0a444e2..c426b39 100644
--- a/qrouter.c
+++ b/qrouter.c
@@ -290,19 +290,26 @@ void reinitialize()
// Free up all of the matrices
- for (i = 0; i < Num_layers; i++) {
+ for (i = 0; i < Pinlayers; i++) {
free(Stub[i]);
free(Nodeloc[i]);
free(Nodesav[i]);
- free(Obs2[i]);
- free(Obs[i]);
Stub[i] = NULL;
Nodeloc[i] = NULL;
Nodesav[i] = NULL;
+ }
+ for (i = 0; i < Num_layers; i++) {
+ free(Obs2[i]);
+ free(Obs[i]);
+
Obs2[i] = NULL;
Obs[i] = NULL;
}
+ if (RMask != NULL) {
+ free(RMask);
+ RMask = NULL;
+ }
// Free the netlist of failed nets (if there is one)
@@ -2449,6 +2456,7 @@ void cleanup_net(NET net)
// segl is the last segment of the route.
segf = rt->segments;
+ if (segf == NULL) continue;
lastlayer = -1;
for (segl = segf->next; segl && segl->next; segl = segl->next)
if (segl->segtype != ST_VIA) lastlayer = segl->layer;