• 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

    Hi Vivek

    Yes, it can be done using a measurement alias. Please search for "Using a measurement alias" in $MMSIMHOME/doc/mdlref/mdlref.pdf. Here is an example from the manual: 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;}

    alias measurement falldelay {

       input real transtop=2u    // This variable is given a default value.

       input real prop_thresh    // This variable has no default value.

       run tran(stop=transtop)   // A run statement is required.

       export real prop_delay_fall=deltax(sig1=V(inp), sig2=V(out),

       dir1=’fall, n1=1, start1=0, thresh1=prop_thresh,

       dir2=’fall, n2=2, start2=0, thresh2=prop_thresh)

    }

     run falldelay(transtop=1u, prop_thresh=2)


    Best regards
    Quek

     

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

    Hi Vivek

    Yes, it can be done using a measurement alias. Please search for "Using a measurement alias" in $MMSIMHOME/doc/mdlref/mdlref.pdf. Here is an example from the manual: 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;}

    alias measurement falldelay {

       input real transtop=2u    // This variable is given a default value.

       input real prop_thresh    // This variable has no default value.

       run tran(stop=transtop)   // A run statement is required.

       export real prop_delay_fall=deltax(sig1=V(inp), sig2=V(out),

       dir1=’fall, n1=1, start1=0, thresh1=prop_thresh,

       dir2=’fall, n2=2, start2=0, thresh2=prop_thresh)

    }

     run falldelay(transtop=1u, prop_thresh=2)


    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