• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Change a character in a label

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 14677
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Change a character in a label

pham777
pham777 over 11 years ago

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

  • Cancel
Parents
  • psill000
    psill000 over 11 years ago

     Nice code.

    "[" and "]" are special characters they need \\ in front of characters so the script will see them as characters rather than a range.

     a more effective means of replace the charaters might be using the functions

    rexCompile("\\[")

    str = rexReplace(str "<" 0)

    rexCompile("\\]")

    str = rexReplace(str ">" 0)

     You might want to remove the part of the code that tests if the label is at top level. The function leSearchHierarchy is set to 0.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • psill000
    psill000 over 11 years ago

     Nice code.

    "[" and "]" are special characters they need \\ in front of characters so the script will see them as characters rather than a range.

     a more effective means of replace the charaters might be using the functions

    rexCompile("\\[")

    str = rexReplace(str "<" 0)

    rexCompile("\\]")

    str = rexReplace(str ">" 0)

     You might want to remove the part of the code that tests if the label is at top level. The function leSearchHierarchy is set to 0.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information