• 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 Design
  3. Mapping a 'cv~>prop' array with any other array

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 126
  • Views 1442
  • 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

Mapping a 'cv~>prop' array with any other array

shazzy
shazzy over 12 years ago

A set of selected pin labels are put into a list by doing :-

 

cv=geGetSelSet()

cv~>theLabel 

=>  ("A<0>" "A<1>" "A<2>")

 

Another array after some operation increments the set of these pin labels by 3, i.e. :-

 

a = ("A<3>" "A<4>" "A<5>")

 

If one wants to sequentially substitute every element of array 'a' into the cv~>theLabel array ( in order to change the pin labels in the layout view also ) then how to proceed ?

 

I tried the following things which arent working :-

1.A simple assignment operator

2. foreach mapcar

3. setof 

 

There is though one important finding which shows that when one label is selected, then even a simple assignment operator works i.e.

 

cv~>theLabel   =>    ("A<0>")

a                     =>   ("A<4>")

cv~>theLabel=a

cv~>theLabel   =>    ("A<4>")

 

but the challenge remains when multiple pin labels are selected

  • Cancel
  • theopaone
    theopaone over 12 years ago

     You have a list of objects which must be processed separately. If you have the text selected, you get all the selected objects using txtObjs = geGetSelectedSet()

    Then process the individual objects in  a foreach loop:

    foreach( obj txtObjs
       when(obj~>objType == "label"
          obj~>theLabel = newLabel ))

    Ted

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • shazzy
    shazzy over 12 years ago

    Hi Ted

    Thanks for the help  but when I tried ur following code, in that every label in the txtObjs array becomes equal to the newLabel.

     

    I tried this :- 

     

    A set of pins were selected   =>   A<0>  A<1>  A<2> 

    After which I wrote the following code

     

    txtObjs = geGetSelectedSet()            =>     (" a set of cv numbers")

    foreach(obj txtObjs

       when(obj~>objType == "label"
          obj~>theLabel = newLabel ))       =>     ("newLabel" "newLabel" "newLabel")

     

     

    What I want to do is that every element of the cv~theLabel array ( i.e.  ("A<0>" "A<1>" "A<2>" "nil") )  should  be mapped with the element of an array ' a '  (  i.e.  ("A<3>" "A<4>" "A<5>" "nil")  )  such that  finally the  cv~theLabel array becomes equal to  ( ("A<3>" "A<4>" "A<5>" "nil")  and the pin labels in the layout window changes accordingly.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • theopaone
    theopaone over 12 years ago

     You supply the algorithm to map the original name to the new name and puts the new value into the variable newLabel inside the loop.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    foreach((obj labelVal) txtObjs a
      when(obj~>objType=="label"
        obj~>theLabel=labelVal
      )
    )

    This assumes that txtObjs has the same number of entries as the list in variable a. By making the first argument to foreach a list of two variables, it will process both lists in parallel.

    Note: A bit of terminology here - "cv" normally means "cellView" and so it's rather confusing to call a list of objects "cv". These are lists not arrays (arrays are normally random access whereas lists are sequential).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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