candence skill問題
我有一個修正layout offgrid的skill如下====================================
;;---------------------------------------------------------
;; Process each selected object and fix the off grid issue
;;---------------------------------------------------------
procedure( howFixOffGrid(@optional (selset geGetSelSet()))
foreach( obj selset()
howPutObjOnGrid(obj car(howSnapGetGrids()) cadr(howSnapGetGrids()) 0 0)
);foreach
);proc
;;--------------------------------------
;; Get manufacturing grid from techFile
;;;-------------------------------------
procedure( howSnapGetGrids(@optional (cv geGetEditCellView()))
let(( grids grid (dft list(0.001 0.001)) )
if( cv then
grid = techGetMfgGridResolution(techGetTechFile(cv))
grids = list(grid grid)
else
grids = dft
)
grids
);let
);proc
;;----------------------------
;; Process input obj to grid
;;----------------------------
procedure( howPutObjOnGrid(obj @optional
(gridX 0.001)
(gridY 0.001)
(offsetX 0.0)
(offsetY 0.0))
let(( changeFlag newPoints newObj)
case( obj~>objType
(("rect")
when( (newPoints = _howPutObjOnGridGtPts( obj~>bBox gridX gridY offsetX offsetY ))
obj~>bBox = newPoints
changeFlag = t
);when
)
(("stdVia")
when( (newPoints = _howPutObjOnGridGtPts( list(obj~>origin) gridX gridY offsetX offsetY ))
obj~>origin = car(newPoints)
changeFlag = t
);when
)
(("pathSeg" )
when( (newPoints = _howPutObjOnGridGtPts( list(obj~>beginPt obj~>endPt) gridX gridY offsetX offsetY )) newObj = dbCreatePathSeg(obj~>cellView obj~>lpp car(newPoints) cadr(newPoints) obj~>width
obj~>beginStyle obj~>endStyle)
newObj~>net = obj~>net
dbDeleteObject(obj)
changeFlag = t
);when
)
(("path" "polygon" "layerBlockage")
when( (newPoints = _howPutObjOnGridGtPts( obj~>points gridX gridY offsetX offsetY ))
obj~>points = newPoints
changeFlag = t
)
)
(("inst" "label" "mosaic")
when( (newPoints = _howPutObjOnGridGtPts( list(obj~>xy) gridX gridY offsetX offsetY ))
obj~>xy = car(newPoints)
changeFlag = t
)
)
(("PRBoundary")
when( (newPoints = _howPutObjOnGridGtPts( obj~>points gridX gridY offsetX offsetY ))
dbSetBoundaryEdge(obj newPoints)
changeFlag = t
)
)
);case
changeFlag
);let
);proc
;;-------------------
;; Get new points
;;-------------------
procedure( _howPutObjOnGridGtPts( pts gridX gridY offsetX offsetY )
let(( newListOfPts newPt changedFlag )
foreach( pt pts
if( (newPt = _howPutObjOnGridGtLoc( pt gridX gridY offsetX offsetY )) then
newListOfPts = cons(newPt newListOfPts)
changedFlag = t
else
newListOfPts = cons(pt newListOfPts)
);if
);foreach
if( changedFlag then
newListOfPts = reverse(newListOfPts)
else
newListOfPts = nil
)
newListOfPts
);let
);proc
;;---------------------
;; Get obj new point
;; --------------------
procedure( _howPutObjOnGridGtLoc( pt gridX gridY offsetX offsetY)
let(( newPt (factor 10000.0) compFactor tempPt )
;--------------------------------------------------------------------
; Get compare factor with smaller tolerance up to 4 decimal points
;-------------------------------------------------------------------
compFactor = 1 / factor
if( zerop(offsetX) && zerop(offsetY) then
newPt = _howPutObjOnGridRoundCor( pt gridX gridY compFactor )
when( newPt == pt newPt = nil)
else
;---------------------------------
; Substract offset before round up
;---------------------------------
tempPt = list(car(pt)-offsetX cadr(pt)-offsetY)
newPt = _howPutObjOnGridRoundCor( tempPt gridX gridY compFactor )
newPt = list(car(newPt)+offsetX cadr(newPt)+offsetY)
when( newPt == pt newPt = nil)
);if
newPt
);let
);pro
;;--------------------
;; Round coordinate
;;--------------------
procedure( _howPutObjOnGridRoundCor( point gridX gridY compFactor "gfff")
let( (x y)
x = round((xCoord(point) + compFactor) / gridX) * gridX
y = round((yCoord(point) + compFactor) / gridY) * gridY
list( x y )
);let
);proc
===============================================================
我使用之後出現undefine function selset,我已經有選了可是還是無法運作
該怎麼修改才可以選取layout之後可以運作這skill
謝謝各位大大
页:
[1]