Thanks in advance,
Jackson Harvey
Probably the thing to do is to traverse down through the hierarchy, using
a recursive function, and use dbConcatTransform() to concatenate the
transformation of each instance as you go down (use the orient, xy and mag
attributes). That way you can build up the cumulative transformation back to
the top level of hierarchy. Then in each cellView that you encounter down the
hierarchy, look over the shapes on that layer purpose pair, and use dbCopyFig,
with the concatenated transform, to the destination (possibly top level?)
cellView.
This wouldn't be that much code. In fact, I just spent 10 minutes putting
something together:
/* abFlattenLayer.il
Author A.D.Beckett
Group Custom IC (UK), Cadence Design Systems Ltd.
Language SKILL
Date Apr 10, 2003
Modified
By
Example usage:
shapes=ABflattenLayer(?layerName "metal3")
shapes~>layerName="metal2"
This finds all shapes on metal3 down the hierarchy,
and copies them into the top level view, and puts
them onto metal2.
***************************************************
SCCS Info: @(#) abFlattenLayer.il 04/10/03.17:37:30 1.1
*/
/***************************************************************
* *
* (ABflattenLayer @layerName (purpose "drawing") *
* destination *
* (cellView (geGetEditCellView)) *
* (transform list(0:0 "R0" 1)) *
* shapes *
* ) *
* *
* Function to search down the hierarchy for shapes on a *
* layer, and copy those shapes to the top level (the *
* destination cellView), returning a list of those shapes. *
* The shapes are transformed into the top level coordinate *
* system. Returns a list of the shapes *
* *
***************************************************************/
(procedure (ABflattenLayer @key layerName (purpose "drawing")
destination
(cellView (geGetEditCellView))
(transform list(0:0 "R0" 1))
shapes
)
(let (newTransform LP)
(unless destination (setq destination cellView))
;-----------------------------------------------------------------
; Find the layer purpose pair
;-----------------------------------------------------------------
(setq LP
(car (exists lpp (dbGetq cellView lpps)
(and (equal (dbGetq lpp layerName) layerName)
(equal (dbGetq lpp purpose) purpose)))))
;-----------------------------------------------------------------
; Transform all the shapes on that lpp
;-----------------------------------------------------------------
(foreach shape (dbGetq LP shapes)
(setq shapes
(cons (dbCopyFig shape destination transform)
shapes))
)
;-----------------------------------------------------------------
; Now process each instance and recurse down
;-----------------------------------------------------------------
(foreach inst (dbGetq cellView instances)
;--------------------------------------------------------
; Compute the new transform
;--------------------------------------------------------
(setq newTransform
(dbConcatTransform
transform
(list (dbGetq inst xy)
(dbGetq inst orient)
(dbGetq inst mag)
)
))
;--------------------------------------------------------
; And recurse
;--------------------------------------------------------
(setq shapes
(ABflattenLayer
?layerName layerName
?purpose purpose
?cellView (dbGetq inst master)
?destination destination
?transform newTransform
?shapes shapes
))
)
shapes
))
Note, I didn't do anything in this code to handle mosaics - they'd need some
special handling - I just wanted to show how it would work for the simple
instance case (which is the majority of occurrences, I suspect).
Apologies for the LISP syntax (I just find it easier to do in a hurry).
Actually, I won't apologize - SKILL _is_ LISP after all ;->
Regards,
Andrew.
--
Andrew Beckett
Senior Technical Leader
Custom IC Solutions
Cadence Design Systems Ltd
Perfect. Much thanks.
--
Jackson Harvey
Bermai, Inc.
jha...@bermai.com
This email message may contain confidential information. All
rights under law are reserved by the author of the message,
or by Bermai, Inc.