From 152276ddbb5a64c2b1a9ecd05c87803df409e455 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 11 Sep 2018 19:21:11 +0200 Subject: [PATCH] Corrected coordinates policy in stratus1. * Bug: In stratus1, all coordinates given to the functions are now assumed to be in DbU instead of lambda. Designer must convert himself his coordinates from the unit of his choice into DbU. See helpers.l(), or helpers.m(). --- stratus1/src/stratus/st_placement.py | 37 ++++++++++++---------------- stratus1/src/stratus/util_Defs.py | 3 ++- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/stratus1/src/stratus/st_placement.py b/stratus1/src/stratus/st_placement.py index 86371dd9..f1882635 100644 --- a/stratus1/src/stratus/st_placement.py +++ b/stratus1/src/stratus/st_placement.py @@ -79,7 +79,7 @@ def Place ( ins, sym, ref, plac = FIXED, cell = None ) : if ( plac != PLACED ) and ( plac != FIXED ) : raise Exception ( "\n[Stratus ERROR] Place : wrong argument for placement type.\n" ) #placement ( ins, sym, getUnit(ref._x), getUnit(ref._y), plac, cell = cell ) - placement ( ins, sym, DbU_lambda(ref._x), DbU_lambda(ref._y), plac, cell = cell ) + placement ( ins, sym, ref._x, ref._y, plac, cell = cell ) ############### def PlaceTop ( ins, symetry, offsetX = 0, offsetY = 0, plac = FIXED ) : @@ -117,7 +117,7 @@ def PlaceTop ( ins, symetry, offsetX = 0, offsetY = 0, plac = FIXED ) : if vertical ( cell._insref._sym ) : y += height ( cell._insref ) else : y += width ( cell._insref ) - placement ( ins, symetry, x + DbU_lambda ( offsetX ), y + DbU_lambda ( offsetY ), plac ) + placement ( ins, symetry, x + offsetX, y + offsetY, plac ) ################# def PlaceRight ( ins, symetry, offsetX = 0, offsetY = 0, plac = FIXED ) : @@ -159,7 +159,7 @@ def PlaceRight ( ins, symetry, offsetX = 0, offsetY = 0, plac = FIXED ) : if vertical ( cell._insref._sym ) : y -= height ( cell._insref ) else : y -= width ( cell._insref ) - placement ( ins, symetry, x + DbU_lambda ( offsetX ), y + DbU_lambda ( offsetY ), plac ) + placement ( ins, symetry, x + offsetX, y + offsetY, plac ) ################ def PlaceLeft ( ins, symetry, offsetX = 0, offsetY = 0, plac = FIXED ) : @@ -199,7 +199,7 @@ def PlaceLeft ( ins, symetry, offsetX = 0, offsetY = 0, plac = FIXED ) : if vertical ( cell._insref._sym ) : y -= height ( cell._insref ) else : y -= width ( cell._insref ) - placement ( ins, symetry, x - DbU_lambda ( offsetX ), y + DbU_lambda ( offsetY ), plac, fonction = "Left" ) + placement ( ins, symetry, x - offsetX, y + offsetY, plac, fonction = "Left" ) ################## def PlaceBottom ( ins, symetry, offsetX = 0, offsetY = 0, plac = FIXED ) : @@ -239,7 +239,7 @@ def PlaceBottom ( ins, symetry, offsetX = 0, offsetY = 0, plac = FIXED ) : if vertical ( cell._insref._sym ) : y -= height ( cell._insref ) else : y -= width ( cell._insref ) - placement ( ins, symetry, x + DbU_lambda ( offsetX ), y - DbU_lambda ( offsetY ), plac, fonction = "Bottom" ) + placement ( ins, symetry, x + offsetX, y - offsetY, plac, fonction = "Bottom" ) ################# def SetRefIns ( ins ) : @@ -299,12 +299,7 @@ def DefAb ( ref1, ref2 ) : + ". Maybe you should use ResizeAb function.\n" raise Exception ( err ) - cell._hur_cell.setAbutmentBox ( Box ( DbU_lambda ( x1 ) - , DbU_lambda ( y1 ) - , DbU_lambda ( x2 ) - , DbU_lambda ( y2 ) - ) - ) + cell._hur_cell.setAbutmentBox ( Box ( x1, y1, x2, y2 ) ) UpdateSession.close () @@ -313,6 +308,11 @@ def ResizeAb ( dx1, dy1, dx2, dy2 ) : global CELLS from st_model import CELLS + print "ResizeAb()", DbU.getValueString(dx1) \ + , DbU.getValueString(dy1) \ + , DbU.getValueString(dx2) \ + , DbU.getValueString(dy2) + global MYSLICE, MYPITCH cell = CELLS[-1] @@ -332,10 +332,10 @@ def ResizeAb ( dx1, dy1, dx2, dy2 ) : old_ymin = ab.getYMin() old_ymax = ab.getYMax() - new_xmin = old_xmin - DbU_lambda ( dx1 ) - new_ymin = old_ymin - DbU_lambda ( dy1 ) - new_xmax = old_xmax + DbU_lambda ( dx2 ) - new_ymax = old_ymax + DbU_lambda ( dy2 ) + new_xmin = old_xmin - dx1 + new_ymin = old_ymin - dy1 + new_xmax = old_xmax + dx2 + new_ymax = old_ymax + dy2 if new_xmin >= new_xmax : err = "\n[Stratus ERROR] ResizeAb : one of the values of dx1 or dx2 is incompatible with the size of the abutment box.\n" @@ -365,12 +365,7 @@ def DefInstanceAb ( instance, x1, y1, x2, y2 ) : + " : Coordinates of an abutment Box in x must be multiple of the pitch.\n" raise Exception ( err ) - cell.setAbutmentBox ( Box ( DbU_lambda ( x1 ) - , DbU_lambda ( y1 ) - , DbU_lambda ( x2 ) - , DbU_lambda ( y2 ) - ) - ) + cell.setAbutmentBox ( Box ( x1, y1, x2, y2 ) ) #################################### diff --git a/stratus1/src/stratus/util_Defs.py b/stratus1/src/stratus/util_Defs.py index dd35384f..f607ef62 100644 --- a/stratus1/src/stratus/util_Defs.py +++ b/stratus1/src/stratus/util_Defs.py @@ -47,11 +47,12 @@ # x-----------------------------------------------------------------x +from Hurricane import DbU from st_placement import Place, NOSYM, SYM_Y, FIXED from st_ref import XY from util_Gen import F_MSB_FIRST -Y_SLICE = 50 +Y_SLICE = DbU.fromLambda(50.0) # for DpgenAdder F_ADDER_CIN = 0x00000001