• 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 16120
  • 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
Parents
  • 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
Reply
  • 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
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