• 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. Program to place the bus pins

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 144
  • Views 16100
  • 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

Program to place the bus pins

Muralidhar
Muralidhar over 8 years ago

Hi,

I am trying to write a program to place the buspins for example APT<4:46> in given pitch in given layer.  For this I wrote a program as given below

procedure( buspins()

cv=geGetEditCellView()

point=enterpoint()

pin="APT<4:46>"

pins=parseString(pin "<>")

name=car(pins)

num1=cadr(pins)

num2=parseString(num1 ":")

start_num=car(num2)

start_num=evalstring(start_num)

end_num=cadr(num2)

end_num=evalstring(end_num)

when(start_num!=end_num

label1=buildString(list(name "<") "")

label2=buildString(list(label1 start_num) "")

label1=buildString(list(label2 ">") "")

dbCreateLabel(cv list("M2"  "label") point label "centerCenter"  "R0"   "roman"   0.28)

start_num=start_num+1

return()

))))

when I am trying to excute this progrm I got the error in virtuoso is        "Error* ilGetString: arg must be symbol or string "

I think this is due to start_num variable is a number not a symbol or string. start_num contains a number without double quotes.

If that number is in double quotes (by removing start_num=evalstring(start_num) line)  label created but we can't do addition operation for it i.e., start_num=start_num+1.

So, how to add double quotes to a number. Is there any instruction for it. otherwise please tell me how to do this program.

Thanks,

  • Cancel
  • Eugene201
    Eugene201 over 8 years ago
    Muralidhar,

    I think what you are looking for is a way to convert the integer to string. You can use sprintf(start_num "%d" start_num) as described in a previous post community.cadence.com/.../14701 . You can also create another variable as string using the same method sprintf(start_num_str "%d" start_num) if you intend to use the integer for further calculations.

    Hope this helps,

    Eugene
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    There are so many things wrong with this code, it's hard to know where to start:

    1. There are two too many close parentheses at the end
    2. It's calling enterpoint when the function is called enterPoint()
    3. It is trying to use buildString() to assemble a string from a list of a string and a number. In fact this seems unnecessarily complicated - it would have been better to just use:
      sprintf(label "%s<%d>" name start_num)
    4. You are creating the label from a variable called label when that variable has not been set in the code
    5. You are calling return() at the end but that's only valid inside a prog()
    6. It's bad practice to use evalstring() to convert strings into numbers. It's risky, because if you don't know what's in the string, it may have nasty side effects. Imagine if the string you were trying to do an evalstring() accidentally had "exit()" in?
    7. There are no local variables - everything is global

    Overall, there's a much easier way of parsing the bus name - use dbProduceMemName - this will expand the bus name into a list of its member elements:

    procedure( buspins()
      let((cv point step pin)
        cv=geGetEditCellView()
        point=enterPoint()
        pin="APT<4:46>"
        step=0.5
        foreach(pinName dbProduceMemName(pin)
          dbCreateLabel(cv list("Metal2" "label") point pinName "centerCenter" "R0" "roman" 0.28)
          point=xCoord(point):yCoord(point)+step
        )
        t
      )
    )

    So that's significantly shorter, and actually has the loop to create all the labels.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Muralidhar
    Muralidhar over 8 years ago
    Thanks you Eugene.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Muralidhar
    Muralidhar over 8 years ago
    Thanks Andrew for the simple program.
    Using symbolToString() and stringToSymbol() we can convert symbol to string and viceversa
    similarly using sprintf(a "%d" a) we can convert integer to string like 123 to "123"
    But how to convert "123" to 123 ? I am using evalstring() function for this. Is there any other function for this?

    Thanks,
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago
    atoi()
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Muralidhar
    Muralidhar over 8 years ago
    Thank you. How to find all these functions? Just now you introduced two functions to me (atoi() and dbProduceMemName()). How to know that there is a function for this operation for a new guys like me?
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Read the documentation? There's a wealth of documentation on SKILL functions available. In particular, you should start with the core language:

    • Cadence SKILL Language User Guide
    • Cadence SKILL Language Reference
    • Virtuoso Design Environment SKILL Reference (this is where the "db" functions are covered)

    There's also the "cdsFinder" utility (from the command line, or startFinder() in the CIW) which allows you to easily search for functions if you know part of the name. There's also the SKILL IDE (particularly in IC617) which has a lot of nice debugging features to help you diagnose what is wrong with your code. With your original code this showed precisely which line was causing the problem with the strange error message.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Muralidhar
    Muralidhar over 8 years ago
    Thanks for the help 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