summaryrefslogtreecommitdiff
path: root/lef.c
diff options
context:
space:
mode:
authorTim Edwards <tim@opencircuitdesign.com>2016-02-24 09:01:05 -0500
committerTim Edwards <tim@opencircuitdesign.com>2016-02-24 09:01:05 -0500
commite405277e71a40cc484cb470982709627ef17ba7b (patch)
treeab75b8a8e079ee55841b2f0a625aa5e6f14e04dd /lef.c
parentec1e4e293976a9496289b9e3c3a3d00d44ec79de (diff)
Uncovered a major error that was causing some routes not to reach
a terminal because it was attempting to define an offset on a via outside of the geometry defining the pin, where it would need a stub route to reach the tap. Since the flags are set up to make stub routes and offset routes mutually exclusive, the stub route got lost.
Diffstat (limited to 'lef.c')
-rw-r--r--lef.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/lef.c b/lef.c
index be1cd4f..9b65786 100644
--- a/lef.c
+++ b/lef.c
@@ -717,22 +717,48 @@ LefGetRouteOffset(int layer)
* because the center can be on a half-grid position; so,
* return half the value obtained.
*
- * To-do: Differentiate between X and Y vias when doing
- * checkerboard via patterning.
+ * This routine always uses a horizontally oriented via if
+ * available. See the specific LefGetXYViaWidth() routine
+ * for differentiation between via orientations.
*------------------------------------------------------------
*/
double
LefGetViaWidth(int base, int layer, int dir)
{
+ return LefGetXYViaWidth(base, layer, dir, 0);
+}
+
+/*
+ *------------------------------------------------------------
+ * The base routing used by LefGetViaWidth(), with an
+ * additional argument that specifies which via orientation
+ * to use, if an alternative orientation is available. This
+ * is necessary for doing checkerboard via patterning and
+ * for certain standard cells with ports that do not always
+ * fit one orientation of via.
+ *------------------------------------------------------------
+ */
+
+double
+LefGetXYViaWidth(int base, int layer, int dir, int orient)
+{
DSEG lrect;
LefList lefl;
double width;
+ char **viatable;
- lefl = LefFindLayer(ViaX[base]);
+ viatable = (orient == 1) ? ViaY : ViaX;
+
+ lefl = LefFindLayer(*(viatable + base));
+ if (!lefl) {
+ viatable = (orient == 1) ? ViaX : ViaY;
+ lefl = LefFindLayer(*(viatable + base));
+ viatable = (orient == 1) ? ViaY : ViaX;
+ }
if (!lefl) {
if (base == Num_layers)
- lefl = LefFindLayer(ViaX[base - 1]);
+ lefl = LefFindLayer(*(viatable + base - 1));
}
if (lefl) {
if (lefl->lefClass == CLASS_VIA) {