• 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. assign a sub list to the range of nested foreach loop

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 125
  • Views 14183
  • 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

assign a sub list to the range of nested foreach loop

yxie
yxie over 5 years ago

I would like to use Ocean to group a few corner cases to a single plot after ADE XL corner sim. For example, I have these corner numbers (for fetching tran analysis results), and I could group them like these, at temperature = 0 degC, plot VT("/out") from data directory list(1 2 3), and at temperature = 65degC, plot VT("/out") from data directory list(4 5 6), the Ocean script would be something like this:

foreach((temp corners) list(0 65) list(list(1 2 3) list(4 5 6))

newWindow()

foreach(corner car(corners)

openResults(corner)

plot( VT("/out") )

)

So that for each temperature, there is a window of plot of three curves of VT("/out"). But the above syntax is obviously not quite right. Any suggests, please?

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    I don't really understand what the title of your post has to do with the rest of the thread. I assume you need to build the real path to the openResults? I don't think you'd want car(corners) either. I suspect you want something like this:

    foreach((temp corners) list(0 65) list(list(1 2 3) list(4 5 6))
      newWindow()
      foreach(corner corners
        sprintf(resultLocation "/path/to/wherever/%d/test/psf" corner) ; you'll need to get this path correct
        openResults(resultLocation)
        plot( VT("/out") )
      )
    )

    However, I may have completely misunderstood you.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • yxie
    yxie over 5 years ago in reply to Andrew Beckett

    Yes, I need to set the result path, which is based on "corner", 1,2,3, etc. My question is, will the above code pass list(1 2 3) to "corners" for the second foreach loop when temp = 0, and pass list(4 5 6) to "corners" when temp = 65?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to yxie

    Couldn't you just try this? It's pretty easy to test:

    foreach((temp corners) list(0 65) list(list(1 2 3) list(4 5 6))
      printf("temp=%L corners=%L\n" temp corners)
    )

    That outputs this:

    temp=0 corners=(1 2 3)
    temp=65 corners=(4 5 6)

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • yxie
    yxie over 5 years ago in reply to Andrew Beckett

    Thanks.

    • 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