So others benefit...
Here is another simple SKILL code example for
modifying label text in Virtuoso based on a recent thread
from comp.cad.cadence asking...
> I have a library with a few hundred cells, half of which have layouts
> that contain multiple labels whose text I would like to change.
> In each layout, there is one label with text 'VDD' that I would like to
> change to 'vdd!', and there is another label with text 'VSS' that I
> would like to change to 'gnd!'. The schematics are already correct.
> Is there a way to do this with SKILL code?
/*
TrChangeStrings.il
This SKILL sample will search all the labels in your layout view,
and judge whether the labels contain the old-string you want
to replace, and then rename them to the desired new-string.
TrChangeStrings( "oldString" "newString" )
-OR-
TrChangeStrings( "oldString" "newString" t );==> test mode won't save
changes
Ex. TrChangeStrings( "VDD" "vdd!" )
Ex. TrChangeStrings( "VDD" "vdd!" t )
The number of labels changed per cell will be reported along with
the total number of labels changed.
*/
procedure(
TrChangeStrings( oldstring newstring @optional (test nil) )
let( ( cv cnt (totalcnt 0) (view "layout") )
cv=geGetEditCellView()
cnt=0
when( test printf("*** TEST MODE *** changes not saved\n") )
foreach( shape cv~>shapes
;when( shape~>objType == "label" && shape~>theLabel ==
oldstring
when( shape~>objType == "label" && rexMatchp(oldstring
shape~>theLabel
)
;shape~>theLabel = newstring
rexCompile(oldstring)
shape~>theLabel = rexReplace(shape~>theLabel newstring 0)
cnt++
) ; when label
) ; foreach shape
unless( test dbSave( cv ))
printf("%s %s : %d labels changed\n" cv~>cellName view cnt)
totalcnt = totalcnt + cnt
printf("** Total labels changed : %d\n" totalcnt)
when( test printf("*** TEST MODE *** changes not saved\n") )
) ; let
) ;
;; End of TrChangeLabels.il
Originally posted in cdnusers.org by John