• 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. Help regarding pop-push of a LIST

Stats

  • Locked Locked
  • Replies 37
  • Subscribers 144
  • Views 26788
  • 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

Help regarding pop-push of a LIST

Neeraj Vardhan
Neeraj Vardhan over 12 years ago

Hi,

I was trying to save my path coordinates as a list. But when i was trying to print the list of points, got errors "unbound variable-plist" . the code is mentioned below.

 

procedure(nvToGetMyLocation()

let((point plist)

cvw=getCurrentWindow()

point=hiGetPoint(cvw)

plist=append(plist list(point))

print(point)

print(plist)

); let

); procedure_nvToGetMyLocation

 

  • Cancel
  • skillUser
    skillUser over 12 years ago

    Hi Neeraj,

    I can't test your code right now, but one thing that springs to mind is that plist is a function, and possibly a special variable... As I read your code I don't see anything that would cause plist to be undefined - it is declared in the let statement, so it should always have a value in that scope, at the very least it would be nil.

    Try using a different name for the variable...

    Hope this helps,

    Lawrence. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Neeraj Vardhan
    Neeraj Vardhan over 12 years ago
    Hi lawrence,

    I tried with different variable name, and got the below error. Hope i am doing some mistake as there are other functions too in this code.

    3.965 6.48)((3.965 6.48))
    (6.61 6.51)((6.61 6.51))
    (6.47 5.21)((6.47 5.21))
    (3.7 5.055)((3.7 5.055))
    (2.345 6.535)((2.345 6.535))
    (2.79 5.72)((2.79 5.72))
    s
    *Error* toplevel: undefined variable - s

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

    I'm guessing that your code cannot be what you've posted, because that works fine. There's nothing wrong with it (well, apart from you using the obsolete getCurrentWindow() rather than hiGetCurrentWindow() - but that shouldn't cause any problems).

    Have you really loaded that version of the code? Or maybe your real code is more complicated than what you've posted?

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Neeraj Vardhan
    Neeraj Vardhan over 12 years ago

    I was trying to upload the code from morning, but failed to upload... below is the code i am  working on

    procedure(nvMyDirection()

    let((xy1 xy2 x1 x2 y1 y2)

    i=0

    for(i 1 n

    xy1=nth(i p_list)

    xy2=nth((i+1) p_list)

    x1=xCoord(xy1)

    y1=yCoord(xy1)

    x2=xCoord(xy2)

    y2=yCoord(xy2)

     

    if(x2-x1>0 && y2-y1 == 0 then print("RIGHT"))

    if(x2-x1<0 && y2-y1 == 0 then print("LEFT"))  

    if(y2-y1>0 && x2-x1 == 0 then print("TOP"))

    if(y2-y1>0 && x2-x1 == 0 then print("BOTTOM"))

    print(xy1)

    print(xy2)

    print(x1)

    print(x2)

    ) ; for

    ) ; let

    ) ; procedure_nvMyDirection

     

    procedure(nvGetMyLayer()

    let((layer cur_layer)

    layer=leGetEntryLayer()

    cur_layer=append(cur_layer list(layer))

    ); let

    ); procedure_nvGetMyLayer

     

    procedure(nvGetMyLocation()

    n++

    prog((p_curt p_list)

    cvw=getCurrentWindow()

    p_curt=hiGetPoint(cvw)

    p_list=append(p_list list(p_curt))

    print(p_curt)

    print(p_list)

    ); let

    ); procedure_nvGetMyLocation 

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

    Not clear what your problem is now - please elaborate. You have four separate functions there, which are variously referring to global variable. For example, nvGetLocation is referring to a variable n which would need to be defined. nvMyDirection is referring to global variable p_list (which is not the same as the variable p_list in nvGetMyLocation, since that is local to the prog() call within that function).

    So what are you calling, and what is happening that is not what you expect?

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Neeraj Vardhan
    Neeraj Vardhan over 12 years ago
    "3.965 6.48)((3.965 6.48)) (6.61 6.51)((6.61 6.51)) (6.47 5.21)((6.47 5.21)) (3.7 5.055)((3.7 5.055)) (2.345 6.535)((2.345 6.535)) (2.79 5.72)((2.79 5.72))   error* toplevel: undefined variable - p_list"  this is the error its pouping up . And when i tried to print p_list it didnt return the list of points, insted it gave undefined variable-p_list
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    Yes, but what functions are you running? 

    If you're calling nvGetMyLocation() (assuming you have a variable n defined), then p_list will be set within that function, but will be discarded (and hence no longer defined) after the prog() has finished. So if you're then trying to look at p_list in the CIW, it will be undefined - hardly surprising since it is a local variable. Similarly if you call nvMyDirection() it will be looking for a global variable p_list, which won't be defined. If it was, then it could compute local variables xy1, xy2, x1, x2 (which are defined in the let()), but these will be thrown away when the let() exits and hence when nvMyDirection exits. If you then call nvMyPath, it won't know what xy1 and xy2 are - plus the fact that the code is wrong in this function because the list of points is improperly specified.

    So PLEASE explain what you're doing. Nobody can debug by reading your mind!

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Neeraj Vardhan
    Neeraj Vardhan over 12 years ago
    i am trying to create an auto_route function. For that, first i am saving my start and end points of the metal paths. So for that i started making a list of points with in p_list. And then accessing it later to create the path and vias. The direction will help me the VIA placement, so that it dont create a notch. I am just trying but it started failing from yesterday. when i started writing the rest of the code.. Regards Neeraj
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    Neeraj,

    OK, but you still haven't said which functions you are calling, and in what order. In other words, the sequence of events that led to the error you saw.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Neeraj Vardhan
    Neeraj Vardhan over 12 years ago
    i am using these key one by one to get the location and the entry layer at that moment.


    hiSetBindKey("Layout" "<key>1" "nvGetMyLocation() nvGetMyLayer() leSetEntryLayer(\"M1\")")
    hiSetBindKey("Layout" "<key>2" "nvGetMyLocation() nvGetMyLayer() leSetEntryLayer(\"M2\")")
    hiSetBindKey("Layout" "<key>3" "nvGetMyLocation() nvGetMyLayer() leSetEntryLayer(\"M3\")")
    hiSetBindKey("Layout" "<key>4" "nvGetMyLocation() nvGetMyLayer() leSetEntryLayer(\"M4\")")
    hiSetBindKey("Layout" "<key>5" "nvGetMyLocation() nvGetMyLayer() leSetEntryLayer(\"M5\")")
    hiSetBindKey("Layout" "<key>6" "nvGetMyLocation() nvGetMyLayer() leSetEntryLayer(\"M6\")")
    hiSetBindKey("Layout" "<key>7" "nvGetMyLocation() nvGetMyLayer() leSetEntryLayer(\"M7\")")
    hiSetBindKey("Layout" "<key>8" "nvGetMyLocation() nvGetMyLayer() leSetEntryLayer(\"M8\")")
    hiSetBindKey("Layout" "<key>e" "nvGetMyLocation() nvMyDirection()")

    Regards
    Neeraj</key></key></key></key></key></key></key></key></key>
    • 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