summaryrefslogtreecommitdiff
path: root/def.c
diff options
context:
space:
mode:
Diffstat (limited to 'def.c')
-rw-r--r--def.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/def.c b/def.c
index 20eee3f..a86cdfa 100644
--- a/def.c
+++ b/def.c
@@ -178,7 +178,7 @@ DefAddRoutes(FILE *f, float oscale, NET net, char special)
}
paintLayer = routeLayer;
- if (special)
+ if (special == (char)1)
{
/* SPECIALNETS has the additional width */
token = LefNextToken(f, TRUE);
@@ -719,9 +719,14 @@ DefReadNets(FILE *f, char *sname, float oscale, char special, int total)
case DEF_NETPROP_COVER:
// Treat fixed nets like specialnets: read them
// in as obstructions, and write them out as-is.
+ // Use special = 2 so it is treated like a
+ // specialnet but does not expect the specialnet
+ // syntax (unless it is, in fact, a specialnet
+ // entry).
while (token && (*token != ';'))
- token = DefAddRoutes(f, oscale, net, (u_char)1);
+ token = DefAddRoutes(f, oscale, net,
+ (special == (char)0) ? (char)2 : special);
break;
}
}
@@ -953,6 +958,16 @@ DefReadPins(FILE *f, char *sname, float oscale, int total)
gate->width = gate->height = 0;
curlayer = -1;
+ /* Pin record has one node; allocate memory for it */
+ gate->taps = (DSEG *)malloc(sizeof(DSEG));
+ gate->noderec = (NODE *)malloc(sizeof(NODE));
+ gate->netnum = (int *)malloc(sizeof(int));
+ gate->node = (char **)malloc(sizeof(char *));
+ gate->taps[0] = NULL;
+ gate->noderec[0] = NULL;
+ gate->netnum[0] = -1;
+ gate->node[0] = NULL;
+
/* Now do a search through the line for "+" entries */
/* And process each. */
@@ -1031,6 +1046,10 @@ DefReadPins(FILE *f, char *sname, float oscale, int total)
else {
LefError("Pin %s is defined outside of route layer area!\n",
pinname);
+ free(gate->taps);
+ free(gate->noderec);
+ free(gate->netnum);
+ free(gate->node);
free(gate);
}
@@ -1404,7 +1423,6 @@ DefReadComponents(FILE *f, char *sname, float oscale, int total)
gate->gatename = strdup(usename);
gate->gatetype = gateginfo;
}
-
/* Now do a search through the line for "+" entries */
/* And process each. */
@@ -1450,6 +1468,11 @@ DefReadComponents(FILE *f, char *sname, float oscale, int total)
gate->nodes = gateginfo->nodes;
gate->obs = (DSEG)NULL;
+ gate->taps = (DSEG *)malloc(gate->nodes * sizeof(DSEG));
+ gate->noderec = (NODE *)malloc(gate->nodes * sizeof(NODE));
+ gate->netnum = (int *)malloc(gate->nodes * sizeof(int));
+ gate->node = (char **)malloc(gate->nodes * sizeof(char *));
+
for (i = 0; i < gate->nodes; i++) {
/* Let the node names point to the master cell; */
/* this is just diagnostic; allows us, for */