• 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. Mixed-Signal Design
  3. How to refer to runs in a mdl loop from outside the loop...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 64
  • Views 13855
  • 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

How to refer to runs in a mdl loop from outside the loop?

szier
szier over 5 years ago

I have a question on something I have running OK but feel there's  a better way to run the jobs, as in a loop it. Here is what I have working:

alias measurement trans {
run tran

real arise=cross(sig=V(A),dir='rise,n=1,thresh=pvdda/2, start=0)
real afall=cross(sig=V(A),dir='fall,n=2,thresh=pvdda/2, start=0)
real outrise=cross(sig=V(OUT),dir='rise,n=1,thresh=pvdda/2, start=0)
real outfall=cross(sig=V(OUT),dir='fall,n=2,thresh=pvdda/2, start=0)
export real vdd=pvdda
export real ppvdd=pvdd
export real rdelay=(outrise-arise)*1E12
export real fdelay=(outfall-afall)*1E12
export real delta=(abs(rdelay-fdelay))
export real delay =(rdelay+fdelay)/2
}
real f1,f2,fout

print fmt("%10s %10s %10s %10s\n","rdelay","fdelay","delta","delay") to="gaout"
analysis process_array[]={SS,FF}
analysis proces

proces=process_array[0]
run proces

cout=1.2
run trans as r0
print fmt("%10V %10V %10V %10V\n",r0->rdelay,r0->fdelay,r0->delta,r0->delay) addto="gaout"

proces=process_array[1]
run proces

cout=0.8
run trans as r1
print fmt("%10V %10V %10V %10V\n",r1->rdelay,r1->fdelay,r1->delta,r1->delay) addto="gaout"

f1=max(r0->delta,r1->delta)
f2=max(r0->delay,r1->delay)
fout=(f1+f2)

print fmt("f1=%g\n",f1) addto="gaout"
print fmt("f2=%g\n",f2) addto="gaout"
print fmt("fout=%g\n",fout) addto="gaout"

I would like to extend it for 10 different process corners, which I can do but thought that there might be a way to do it like this:

alias measurement trans {
run tran

real arise=cross(sig=V(A),dir='rise,n=1,thresh=pvdda/2, start=0)
real afall=cross(sig=V(A),dir='fall,n=2,thresh=pvdda/2, start=0)
real outrise=cross(sig=V(OUT),dir='rise,n=1,thresh=pvdda/2, start=0)
real outfall=cross(sig=V(OUT),dir='fall,n=2,thresh=pvdda/2, start=0)
export real vdd=pvdda
export real ppvdd=pvdd
export real rdelay=(outrise-arise)*1E12
export real fdelay=(outfall-afall)*1E12
export real delta=(abs(rdelay-fdelay))
export real delay =(rdelay+fdelay)/2
}
real f1,f2,fout

print fmt("%10s %10s %10s %10s\n","rdelay","fdelay","delta","delay") to="gaout"
analysis process_array[]={SS,FF}
analysis proces

int i=0
real couti[]={1.2,0.8}

foreach i from{0,1}{
proces=process_array[i]
cout=couti[i]
run proces
run trans as r[i]
print fmt("%10V %10V %10V %10V\n",r[i]->rdelay,r[i]->fdelay,r[i]->delta,r[i]->delay) addto="gaout"
}
f1=max(r[0]->delta,r[1]->delta)
f2=max(r[0]->delay,r[1]->delay)
fout=(f1+f2)

print fmt("f1=%g\n",f1) addto="gaout"
print fmt("f2=%g\n",f2) addto="gaout"
print fmt("fout=%g\n",fout) addto="gaout"

If I change r[i] to r and remove the the f1,f2,fout lines this runs. The thing I haven't figured out is how to refer to the runs inside the foreach loop in the f1, f2, fout lines. Is there a way to do this (I don't need r to be an array, it just seemed like a good way to explain what I was looking for)?


  • I realize that this is not that great an example of what I'm trying to do as in this case the f1,f2 coud be moved into the foreach loop with f1,f2 set to 0:

    f1=max(f1,r)

    This works in this case but I'm looking to access each of the runs results outside the loop in the general, is there a way to do that?

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    Please contact customer support. I'd love to help but I'm on vacation for a week and this needs some detailed experimentation, most likely. There may be others that can help, but from recall I've not normally seen too much response from the community at large for MDL questions.

    Andrew.

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

    Enjoy your vacation. We're currently running as is so there's no problem, just looking for more elegant ways to do things as they are more concise and less error prone. I've found you most knowledgeable about MDL (as you say, there are not many people like that) and would be more than happy to wait until you're back from vacation and had some time to catch up with more important matters. Cheers!

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

    Enjoy your vacation. We're currently running as is so there's no problem, just looking for more elegant ways to do things as they are more concise and less error prone. I've found you most knowledgeable about MDL (as you say, there are not many people like that) and would be more than happy to wait until you're back from vacation and had some time to catch up with more important matters. Cheers!

    • 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