• 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. SpectreMDL: creating own subroutines for repetitive tas...

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 126
  • Views 14333
  • 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

SpectreMDL: creating own subroutines for repetitive tasks

vivkr
vivkr over 13 years ago

Hello everyone,

I use SpectreMDL measure expressions to get numbers out of my batch simulations. As you may guess, one often ends up making the same measurements, e.g. max, min, avg, various crossing points etc. on many signals.

Now, at present, I do this by writing out all the measure statements for a signal and then doing copy-modify-paste to finally get all measure expressions for all signals of interest. 

Surely, there is a more efficient method to do that. Is there any way to declare a set of measurement routines as part of a user-defined function or subroutine which might be called to act upon different signals. Ideally, one would be able to support wildcards so as to automatically assign signal-specific names to the measures.

E.g. if I were to define my subroutine like this

 

subroutine my_measurements {

export real meas1 = <meas1_expression>

export real meas2 = <meas2_expression>

..

export real measN = <measN_expression}

}

and call this one, say

do my_measurements { sig1, sig2, ...sigL }, 

then I'd automatically have the measurements

sig1_meas1, sig1_meas2, ...sig1_measN

sig2_meas1, sig2_meas2, ...

..., sigL_measN

Is there any chance of getting stuff done like this or is this a pipe dream? I'd even be happy if I could atleast define a subroutine and call it to do:

[sig1_meas1, sig1_meas2, ..sig1_measL] = my_subroutine(sig1), where everything is explicitly typed and the subroutine doesn't need to automatically assign the names.

Vivek

  • Cancel
Parents
  • Quek
    Quek over 13 years ago

    1024x768

    Normal 0 false false false EN-US JA X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

    Hi Vivek

    I think it is really not possible to do it. Each alias measurement section must have a "run" cmd. If foreach loops are supported inside the measurement section, then we can do something like this:

     alias measurement test {
       input net sig1
       input net sig2
       ...
       input net sig9
       run tran(stop=1u)
       foreach net from {sig1,sig2,sig3,...,sig9} {
          export real myOut=max(V(net))
       }
    }

    run test(sig1=net1,sig2=net2,sig3=net3,...,sig9=net9)

    But unfortunately currently foreach loops are not supported inside measurement section. This feature is being implemented through CCR969523. You can file a service request with your local Cadence support and request for a duplicated CCR to be created.

    I think using ocean would be much more simpler:

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; measurements.il ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    procedure( CCSmeasure(runDir @rest myNets)
       let( (wave)
          openResults(runDir)
          selectResults('tran)
          outPort=outfile("./myMeasurements")
          foreach( net myNets
             printf("Processing net: %s\n" net)
             wave=getData(net)
             fprintf(outPort "Max value of net %L: %g\n" net ymax(wave))
         ) ;foreach
         close(outPort)
         printf("Job completed\n")
       ) ;let
    ) ;procedure

    CCSmeasure("/your-path/psf" list("net1" "net2" "net3"))
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    terminal>ocean < measurements.il

     

    Best regards
    Quek

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Quek
    Quek over 13 years ago

    1024x768

    Normal 0 false false false EN-US JA X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

    Hi Vivek

    I think it is really not possible to do it. Each alias measurement section must have a "run" cmd. If foreach loops are supported inside the measurement section, then we can do something like this:

     alias measurement test {
       input net sig1
       input net sig2
       ...
       input net sig9
       run tran(stop=1u)
       foreach net from {sig1,sig2,sig3,...,sig9} {
          export real myOut=max(V(net))
       }
    }

    run test(sig1=net1,sig2=net2,sig3=net3,...,sig9=net9)

    But unfortunately currently foreach loops are not supported inside measurement section. This feature is being implemented through CCR969523. You can file a service request with your local Cadence support and request for a duplicated CCR to be created.

    I think using ocean would be much more simpler:

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; measurements.il ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    procedure( CCSmeasure(runDir @rest myNets)
       let( (wave)
          openResults(runDir)
          selectResults('tran)
          outPort=outfile("./myMeasurements")
          foreach( net myNets
             printf("Processing net: %s\n" net)
             wave=getData(net)
             fprintf(outPort "Max value of net %L: %g\n" net ymax(wave))
         ) ;foreach
         close(outPort)
         printf("Job completed\n")
       ) ;let
    ) ;procedure

    CCSmeasure("/your-path/psf" list("net1" "net2" "net3"))
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    terminal>ocean < measurements.il

     

    Best regards
    Quek

     

    • 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