SKILL go into all instances and do something:
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
SKILL go into all instances and do something:

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Cadence
Author Message
raf
Guest





Posted: Sun Oct 24, 2004 6:00 pm    Post subject: SKILL go into all instances and do something: Reply with quote

Hi,

I have this piece of skill code someone provided me with:

cv = geGetEditCellView()
leLayerSize(cv, list("via12" "drawing") 0.05 list("via12" "drawing"))
leLayerSize(cv, list("via12" "drawing") 0.2 list("metal1" "drawing"))

and I'm wondering if there is a way I can apply it to every level of
hierarchy in my layout.

-Raf

Back to top
Jim Newton
Guest





Posted: Sun Oct 24, 2004 9:56 pm    Post subject: Re: SKILL go into all instances and do something: Reply with quote

how about the following?


;; call a given function on every level of the hierarchy
;; if the same cv appears twice then only apply the function to it once.
(defun do_something_to_hierarchy ( d_cv u_fun done_cvs)

;; call the function on this level
(funcall u_fun d_cv)

;; remember the cellview so we don't call the function twice on it
;; in case it appears multiple times in the hierarchy
(tconc done_cvs d_cv)

;; if there are any instances, take a look at their masters
(foreach d_im (or d_cv~>instanceMasters
d_cv~>instMasters)
(cond
;; if we have already examined the cv then simply skip it
((member d_im (car done_cvs)))

;; if it is a pcell then also skip it
((is_pcell d_im))

;; otherwise descend into this cellview recursively
(t
(do_something_to_hierarchy d_im u_fun done_cvs)))))

(defun is_pcell ( d_cv)
(or master~>superMaster
master~>isParamCell))

(defun the_layer_operation ( d_cv)
(leLayerSize d_cv '("via12" "drawing") 0.05 '("via12" "drawing"))
(leLayerSize d_cv '("via12" "drawing") 0.2 '("metal1" "drawing")))

(defun layer_op_on_hier ( d_cv)
(do_something_to_hierarchy d_cv 'the_layer_operation (list nil)))



Diva Physical Verification wrote:
Quote:
procedure( AddReps(rep repss)
prog( (masters master reps)
reps = cons(rep repss)
masters = rep~>instHeaders~>master
while(masters
master = car(masters)
masters = cdr(masters)
unless(master~>superMaster || master~>isParamCell ||
member(master reps)
reps = AddReps(master reps)
)
)
return(reps)
)
)

procedure( doSomething( (rootrep getEditRep()) )
prog( (reps rep)
reps = AddReps(rootrep nil)
while( reps && result
rep = car(reps)
reps = cdr(reps)
leLayerSize(rep, list("via12" "drawing") 0.05 list("via12"
"drawing"))
leLayerSize(rep, list("via12" "drawing") 0.2 list("metal1"
"drawing"))
)
)
)

On Sun, 24 Oct 2004 10:00:09 -0400, raf
rafal_REMOVETHIS_@eecg.utoronto.ca> wrote:


Hi,

I have this piece of skill code someone provided me with:

cv = geGetEditCellView()
leLayerSize(cv, list("via12" "drawing") 0.05 list("via12" "drawing"))
leLayerSize(cv, list("via12" "drawing") 0.2 list("metal1" "drawing"))

and I'm wondering if there is a way I can apply it to every level of
hierarchy in my layout.

-Raf


Back to top
Diva Physical Verificatio
Guest





Posted: Sun Oct 24, 2004 10:15 pm    Post subject: Re: SKILL go into all instances and do something: Reply with quote

procedure( AddReps(rep repss)
prog( (masters master reps)
reps = cons(rep repss)
masters = rep~>instHeaders~>master
while(masters
master = car(masters)
masters = cdr(masters)
unless(master~>superMaster || master~>isParamCell ||
member(master reps)
reps = AddReps(master reps)
)
)
return(reps)
)
)

procedure( doSomething( (rootrep getEditRep()) )
prog( (reps rep)
reps = AddReps(rootrep nil)
while( reps && result
rep = car(reps)
reps = cdr(reps)
leLayerSize(rep, list("via12" "drawing") 0.05 list("via12"
"drawing"))
leLayerSize(rep, list("via12" "drawing") 0.2 list("metal1"
"drawing"))
)
)
)

On Sun, 24 Oct 2004 10:00:09 -0400, raf
<rafal_REMOVETHIS_@eecg.utoronto.ca> wrote:

Quote:
Hi,

I have this piece of skill code someone provided me with:

cv = geGetEditCellView()
leLayerSize(cv, list("via12" "drawing") 0.05 list("via12" "drawing"))
leLayerSize(cv, list("via12" "drawing") 0.2 list("metal1" "drawing"))

and I'm wondering if there is a way I can apply it to every level of
hierarchy in my layout.

-Raf


Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Cadence All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB