Replacing Label Text with SKILL

Discussion in 'Cadence' started by BimmerCzech, Jun 21, 2006.

  1. BimmerCzech

    BimmerCzech Guest

    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? Thanks.
    BimmerCzech, Jun 21, 2006
    1. Advertisements

  2. BimmerCzech

    BimmerCzech Guest

    This is absolutely phenomenal... it worked perfectly! I am forever
    indebted to you...
    BimmerCzech, Jun 21, 2006
    1. Advertisements

  3. BimmerCzech

    John Gianni Guest

    Bernd is a long-time valued member of comp.cad.cadence who writes good

    Since his short SKILL snippet seemed to be useful as a basic example of
    SKILL coding, I took the liberty of running a quick Virtuoso DFII CIW:
    Tools -> SKILL -> Survey on it to check for "syntactical goodness" and
    sending the results back to Bernd as a courtesy to him.

    That almost-instant SKILL Survey reported Bernd's SKILL example
    contained 15 function calls, 14 of which were known Cadence-defined
    public functions and 1 was a user-defined function. The one user
    defined-function didn't start with a capital-letter prefix; so, in the
    suggested snippet below, I made that one trivially minor modification
    so as to propagate code that 100% meets Cadence recommendations.

    Of the 14 other function calls, none have been changed or deleted in
    any release since IC44x up to and including the IC610 release slated
    for Q4 release this year. Two functions didn't exist in IC434, namely
    dbOpenCellViewByType, and,
    so the sample SKILL code won't work with IC434 - but that's ancient
    DFII software so that's not of great import to the vast majority of

    Other than those inconsequential issues, this simple SKILL coding
    example should work for all users of IC440 up to and including IC610
    based on the results of this quick painless two-minute SKILL Survey
    (which each of you can run yourselves if you have the product #900
    SKILL Development Environment license which puts the "Tools -> SKILL
    Development Environment" menu on your VIrtuoso DFII command interpreter

    As always, thanks for taking the time to help others,
    John Gianni
    Nothing stated by me is prior reviewed nor is it sanctioned by anyone!

    ; (passed syntactical goodness IC440 to IC610)
    procedure( MyReplaceLabels( libName viewName "tt" )
    let( ( d_libId d_cvId l_cellList l_labelList )
    d_libId = ddGetObj( libName )
    l_cellList = setof(
    d_cell d_libId~>cells
    member( viewName d_cell~>views~>name )
    foreach( d_cell l_cellList
    d_cvId = dbOpenCellViewByType( libName d_cell~>name viewName nil "a"
    l_labelList = setof( d_shape d_cvId~>shapes d_shape~>objType ==
    "label" )
    foreach( d_label l_labelList
    case( d_label~>theLabel
    ( "VDD"
    d_label~>theLabel = "vdd!"
    ( "VSS"
    d_label~>theLabel = "gnd!"
    ) ;; close case
    dbSave( d_cvId )
    dbClose( d_cvId )
    ; End of
    John Gianni, Jun 26, 2006
  4. BimmerCzech

    John Gianni Guest

    Here's a related sample from the SKILL Training class database. Of
    course, this passed the "DFII->SKILL->Survey" or I wouldn't have posted
    it as example SKILL code.

    You can also try the more general-purpose "" SKILL
    example in solution #1835335.

    For specific label character-conversion, see the Cadence Customer
    Support SKILL example in solution #11091278 and
    the SKILL example in solution #11094824.

    There's also a product change request (PCR 586533) asking for
    leHiSearch() to be able to modify substrings of labels which you can
    ask your support personnel to keep you abreast of.

    As always, to help others with each posting,
    John Gianni
    Nothing posted by me is prior reviewed nor is it sanctioned by anyone!


    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" )
    TrChangeStrings( "oldString" "newString" t );==> test mode won't save

    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") )
    when( test printf("*** TEST MODE *** changes not saved\n") )
    foreach( shape cv~>shapes
    ;when( shape~>objType == "label" && shape~>theLabel ==
    when( shape~>objType == "label" && rexMatchp(oldstring
    ;shape~>theLabel = newstring
    shape~>theLabel = rexReplace(shape~>theLabel newstring 0)
    ) ; 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
    ) ; procedure TrChangeLabels
    John Gianni, Jun 26, 2006
  5. BimmerCzech

    LindaM Guest

    LindaM, Jun 26, 2006
  6. BimmerCzech

    John Gianni Guest

    Hi Linda,

    I posted five of the aforementioned example SKILL programs which modify
    label & pin text to the suggested "Custom IC > Shared
    code - SKILL" forum.

    The thread is titled:
    "SKILL examples to modify Virtuoso label text on schematic & layout"

    It has the Forum ID of:

    I only posted those five SKILL examples which had passed the Virtuoso
    CIW: Tools -> SKILL -> Survey so as to provide examples of SKILL code
    which not only work in the release the Customer is using ... but also
    to serve as good SKILL programming examples for modification as needed.

    Hope these SKILL examples help to inspire the Virtuoso in everyone!
    John Gianni
    John Gianni, Jun 27, 2006
  7. Hi Linda, Hi John,
    with all respect for the effort put into the work, I do not think that a
    bulletin board service like the one used on cdnusers is appropriate to
    capture the current knowledge of the cadence community. Lately a concept
    called Wiki has emerged to enable a community to do collaborative editing
    of knowledge in written form. Currently Wikipedia at is
    the best example of such a working common knowledge collection.

    In my opinion, MediaWiki (the engine that drives Wikipedia) should also be
    installed on cdsnuser in order to consolidate the knowledge of the
    community in a format where the content can be edited at any point by any

    The nature of a buletin board system, like the one used currently on
    cdnusers, is not to capture knowledge, but to capture opinions of
    individuals in a discussion chain, much like USENET already has provided
    for years. The search function of such a bulletin board system is not an
    argument to use it as most useres do not know how to search, or to select
    the proper keywords for the search and then choose to ask a questioin that
    has already been asked many times before. (This is also a weakness of
    USENET, or _any_ system that has to do with user support.) USENET is in my
    opinion still superior to any bulletin board system as it is focused on
    textual content, as bulletin board systems put focus on looking good.

    Most bulletin boards systems do not allow the user to edit content written
    by other users. This make it difficult to correct SKILL code posted to the
    board without creating a copy. This limitation is also present in USENET
    articles, but proper threading of articles can keep the level of confusion
    a bit lower.

    I guess that few cadence users have had much contact with a Wiki. In my
    organisation there are very few who has discovered how much easier it is to
    keep common knowledge up to date with a wiki than with _any_ other database
    system. It seem to take longer time to accept that content can be edited by
    anyone, and that the content do not belong to anyone but the community.

    If I had had space myself to start a CadenceWiki I would have done that a
    long time ago. The problem is to find a suitable ISP or organisation to
    host the wiki. Now, cdnusers seem to have space for a bulletin board
    system, and I hope you have time and space to install a MediaWiki dedicated
    to capturing common knowledge on use of Cadence EDA tools.

    Kind regards,
    Svenn Are Bjerkem, Jun 28, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.