Wednesday, February 08, 2012     Register | Login | Search | Contact Us
     

Many of you already received communications about the move of the Cadence user community into cadence.com. And many of you have already joined, with over 4000 registrations in the first two weeks.

The new Cadence Community enhances the ability of Cadence users to connect and collaborate. In addition to moving the community into cadence.com -- enabling single sign-on for community, Sourcelink and Cadence events -- the new site is organized around nine technology segments, giving you easy access to product information, training, forums and blogs. Some of the new features include:
  • Ability to respond to posts via e-mail
  • Technology-specific blogs
  • Latest Web 2.0 social networking capabilities
  • Public profile options
  • Private messaging
  • Friends lists
Visit the new Cadence Community today at www.cadence.com/community and join the discussions!

Registration note: Due to the scope of the enhancements and the new SSO registration system, we were not able to migrate existing cdnusers.org member accounts. So new registrations are required, but this enables a broader set of functionality we think you'll enjoy.

Forum note: Under the guidance of forum moderators, we have taken the 20+ cdnusers.org forums and consolidated them into 11 forums on the new site. Posts have been brought over so you can leverage that posting history. CDNusers forums will be set to read only starting 7/30, and cdnusers.org will be redirected to the new community on 8/4.

Best regards,
Mike and Tom

Michael A. Catrambone - Steering Committee Chairman
Distinguished Engineer
PCB/Mechanical
UTStarcom, Inc.

Tom Diederich
Cadence Community Manager
Home
Forums
Subject: SKILL examples to modify Virtuoso label text on schematic & layout
Posting to forums is available to community members only.
Login or Register
Rate this topic:
   
Author Messages
John
Posts: 6
Online: User is Offline
6/27/2006 8:33 AM  
So others benefit...

Here is a simple SKILL code example for modifying label text in Virtuoso schematic or layout based on a thread from comp.cad.cadence thanks to our good friend Bernd Fischer...

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 MyReplaceLabels.il

John
Posts: 6
Online: User is Offline
6/27/2006 8:37 AM  
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
John
Posts: 6
Online: User is Offline
6/27/2006 8:50 AM  
So others benefit...

This SKILL code sample for changing label text, kindly provided by our good
friend Jay Singh, is more generic than the previous two examples in that
it can easily be modified to get the desired functionality for any object
in the design database.

Prior to posting, this code has passed the Virtuoso SKILL Survey
CIW: Tools -> SKILL -> Survey
for all releases from IC400 to IC610 (beta) to date.


/*************************************************************************
* DISCLAIMER: The following code is provided for Cadence customers *
* to use at their own risk. The code may require modification to *
* satisfy the requirements of any user. The code and any modifications *
* to the code may not be compatible with current or future versions of *
* Cadence products. THE CODE IS PROVIDED "AS IS" AND WITH NO WARRANTIES, *
* INCLUDING WITHOUT LIMITATION ANY EXPRESS WARRANTIES OR IMPLIED *
* WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. *
*************************************************************************/

;; Author : Cadence Design Systems
;; FileName: JayChangeLabel.il
;; Tested : IC442 IC443
;;
;; This procedure may be used to traverse through the hierarchy of a library.
;; If cellList is specified then the operation will be performed only on cellList.
;; default is all cells in the library.
;; viewName = layout or schematic
;;
;; Usage In CIW:
;; JayChangeLabel("library_name" "schematic" "old_label" "new_label")
;; SKILL LINT SCORE 100 (BEST MAXIMUM IS 100)

procedure(JayChangeLabel(libName viewName oldLabel newLabel @optional listOfCells)

let((cv libId cellId cellList)

libId = ddGetObj(libName)
if(!listOfCells then
cellList = libId~>cells
else
cellList = nil
foreach(cellName listOfCells
cellId = ddGetObj(libName cellName)
cellList = append(list(cellId) cellList)
);end foreach
);end if

foreach(cell cellList
foreach(view cell~>views
;; using views matching viewName variable.
if(view~>name == viewName && (cv = dbOpenCellViewByType(libName cell->name
view~>name "" "a")) then
printf("\nOpened view %L from cell %L of library %L for edit.\n"
cv~>viewName cv~>cellName cv~>libName)
;; Operate on the desired objects, Here it's shape with the property
;; theLabel = oldLabel
foreach(shape cv~>shapes
if(shape~>theLabel && (shape~>theLabel == oldLabel) then
printf("\n Changing the label %L with %L. " shape~>theLabel newLabel )
shape~>theLabel = newLabel
);end if
);end foreach

dbSave(cv)
dbClose(cv)
);end if
);end foreach view
);end foreach cell

ddReleaseObj(libId)
);let
);proc JayChangeLabel
;; End of JayChangeLabel.il
John
Posts: 6
Online: User is Offline
6/27/2006 9:00 AM  
So others benefit...

Here is sample SKILL code to replace all occurances of slash '/' in a given
layout hierarchy with the underscore '_' that can be modified to fit specific
requirements as needed.

If a text label is i_iopad/tied1_75, this program will change that text label
to i_iopads_tied1_75 for text labels on all levels of the layout hierarchy.

This SKILL had passed a Virtuoso CIW: Tools -> SKILL -> Survey before posting.

/*******************************************************************************
* DISCLAIMER: The following code is provided for Cadence customers to use at *
* their own risk. The code may require modification to satisfy the *
* requirements of any user. The code and any modifications to the code may *
* not be compatible with current or future versions of Cadence products. *
* THE CODE IS PROVIDED "AS IS" AND WITH NO WARRANTIES, INCLUDING WITHOUT *
* LIMITATION ANY EXPRESS WARRANTIES OR IMPLIED WARRANTIES OF MERCHANTABILITY *
* OR FITNESS FOR A PARTICULAR USE. *
*******************************************************************************/

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 32 "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)
;dbClose(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
John
Posts: 6
Online: User is Offline
6/27/2006 9:16 AM  
So others benefit...

This SKILL code example from Cadence solution #11094824 will convert symbolic
pin angle brackets "< >" text to square brackets "[ ]" in a Virtuoso layout.

Specifically, this sample SKILL code replaces all labels starting with "A"
and ending with ">" to have delimiters replaced with "[ ]".

Please note this sample SKILL changes ONLY the labels and does not modify the
connectivity information on a pin that may have been created using the
original label.

This sample SKILL code passed a Virtuoso CIW: Tools -> SKILL -> Survey prior to
posting.

/*******************************************************************************
* DISCLAIMER: The following code is provided for Cadence customers to use at *
* their own risk. The code may require modification to satisfy the *
* requirements of any user. The code and any modifications to the code may *
* not be compatible with current or future versions of Cadence products. *
* THE CODE IS PROVIDED "AS IS" AND WITH NO WARRANTIES, INCLUDING WITHOUT *
* LIMITATION ANY EXPRESS WARRANTIES OR IMPLIED WARRANTIES OF MERCHANTABILITY *
* OR FITNESS FOR A PARTICULAR USE. *
*******************************************************************************/
; *Solution_No: 11094824
; *Title: How to change Pin labels from "<>" to "[]"
; Name: CCSchangeLabelDelimiter.il
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Save this code to a file such as CCSchangeLabelDelimiter.il
; and then load in CIW as
; load("CCSchangeLabelDelimiter.il").
; Then type CCSchangeLabelDelimiter() in CIW.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
procedure(CCSchangeLabelDelimiter()
let( (cv mylabels myUniquelabels tmpcv labelText name
index newlab)
;;cv = geGetEditCellView()
cv = dbOpenCellViewByType("master" "MUX"
"layout_test" nil "a")
;;search the cell hierarchy for labels that start
with "A" and end with ">"
;;The third argument defines the number of hierarchy
levels you wish to search
mylabels=leSearchHierarchy( cv cv~>bBox 32
"label"
list( list( "text" "==" "^A" ) list("text"
"==" ">$"))
)
;;create a list of unique labels
myUniquelabels = nil
foreach(x mylabels
unless(member(x myUniquelabels)
myUniquelabels = cons(x
myUniquelabels)
)
)
foreach(lab myUniquelabels
labelText =
lab~>theLabel
name =
car(parseString(labelText
"["))
index=
car(parseString(cadr(parseString(labelText
"<")) ">"))
newlab=
buildString(list(buildString(list(name
index ) "[") "]") "")
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")
;;println(lab~>name)
lab~>theLabel = newlab
dbSave(tmpcv)
dbClose(tmpcv)
)
;; for top level labels
;;println(lab~>name)
lab~>theLabel = newlab
)
dbSave(cv)
dbClose(cv)
);let
);procedure
;
; Save this code to a file such as CCSchangeLabelDelimiter.il
; Load in the Virtuoso CIW using load("CCSchangeLabelDelimiter.il")
; Then type CCSchangeLabelDelimiter() in the CIW.
;
;; End of CCSchangeLabelDelimiter.il
Posting to forums is available to community members only.
Login or Register

Forums > Custom IC > Shared code - SKILL > SKILL examples to modify Virtuoso label text on schematic & layout


ActiveForums 3.6
     
Copyright 2006 Cadence Design Systems, Inc.