summaryrefslogtreecommitdiff
path: root/lef.c
diff options
context:
space:
mode:
authorTim Edwards <tim@opencircuitdesign.com>2015-06-09 11:26:51 -0400
committerTim Edwards <tim@opencircuitdesign.com>2015-06-09 11:26:51 -0400
commitb1c970048f5e88365439e264ea10c4b30245ae93 (patch)
tree5705c7f0e8399b71d8e0cf292c834ae656bae88e /lef.c
parent6effed8e4ea188bd83bfbfd464dad1fbe0ea15c6 (diff)
Discovered that the reason I keep needing to add OFFSET lines to
route layer descriptions in LEF files is due to an obscure statement in the LEF/DEF reference which states that OFFSET, if not specified, defaults to 1/2 the pitch.
Diffstat (limited to 'lef.c')
-rw-r--r--lef.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lef.c b/lef.c
index a0d4d46..a7721f2 100644
--- a/lef.c
+++ b/lef.c
@@ -2029,7 +2029,9 @@ LefReadLayerSection(f, lname, mode, lefl)
lefl->info.route.width = 0.0;
lefl->info.route.spacing = NULL;
lefl->info.route.pitch = 0.0;
- lefl->info.route.offset = 0.0;
+ // Use -1.0 as an indication that offset has not
+ // been specified and needs to be set to default.
+ lefl->info.route.offset = -1.0;
lefl->info.route.hdirection = (u_char)0;
/* A routing type has been declared. Assume */
@@ -2173,6 +2175,12 @@ LefReadLayerSection(f, lname, mode, lefl)
token = LefNextToken(f, TRUE);
sscanf(token, "%lg", &dvalue);
lefl->info.route.pitch = dvalue / (double)oscale;
+
+ /* Offset default is 1/2 the pitch. Offset is */
+ /* intialized to -1 to tell whether or not the value */
+ /* has been set by an OFFSET statement. */
+ if (lefl->info.route.offset < 0.0)
+ lefl->info.route.offset = lefl->info.route.pitch / 2.0;
LefEndStatement(f);
break;
case LEF_LAYER_DIRECTION: