Hi,
I have a code downloaded from cadence solution archive, which I tried to used to change a character inside a label. The code is below:
procedure(CCSchangeCharInLabel(srcChar dstChar "tt")
let( (cv mylabels myUniquelabels tmpcv labelText newlab )
cv = geGetEditCellView()
;; search the cell hierarchy for labels that contain 'srcChar'
;; The third argument defines the number of hierarchy levels you wish to search
mylabels=leSearchHierarchy( cv cv~>bBox 0 "label"
list( list("text" "==" buildString(list(srcChar ) "") ))
)
;; create a list of unique labels
myUniquelabels = nil
foreach(x mylabels
unless(member(x myUniquelabels)
myUniquelabels = cons(x myUniquelabels)
)
)
;
;
;; Do the actual change of labels
foreach(lab myUniquelabels
labelText = lab~>theLabel
newlab = buildString(parseString(labelText srcChar) dstChar)
printf("Original Label was %s\n" labelText)
printf("The new Label would be %s\n" newlab)
;
;
;; if label is not in top level, we need to open the instance master in
;;edit
;; mode to modify the label
;
;
if(lab~>cellView~>cellName != cv~>cellName then
tmpcv = dbOpenCellViewByType(lab~>cellView~>libName lab~>cellView~>cellName
lab~>cellView~>viewName nil "a")
lab~>theLabel = newlab
dbSave(tmpcv)
dbClose(tmpcv)
else
;; for top level labels
lab~>theLabel = newlab
);if
);foreach
dbSave(cv)
);let
);procedure
;
; Please make a backup of your original layout data before testing the script.
; Thescript actually alters the layout database.
; - Save the above SKILL script in a file.
; - Load the saved file into the CIW window with the command : load ""
; - Open the top level layout cellview in edit mode.
; - Type the following command in CIW window to execute the SKILL script:
; CCSchangeCharInLabel("<" "[")
;
;; End of CCSchangeCharInLabel.il
First I execute the code as --> CCSchangeCharInLabel("<" "[")
The result is --> Original Label was dbg_bp_in<5>
The new Label would be dbg_bp_in[5>
So it works, then I execute the code again as --> CCSchangeCharInLabel(">" "]")
The result is --> Original Label was dbg_bp_in[5>
The new Label would be dbg_bp_in[5
?????? It doesn't work. It's missing the ] at the end.
Could someone help me debugging this code.
Thanks a lot,
HP