• 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
  • vivkr
    vivkr over 13 years ago

     Quek,

    I think you misunderstood my question. The example you show above will simply run a fresh TRAN analysis and write out fixed measure outputs performed on fixed, pre-defined signals. So, if I wanted to run the same set of measurements on 100 different signals, then I would need to key in all those expressions 100 times over and over. That's what I want to avoid. I want to make a measurement module or a function, which may be called to act upon different signals.

    So, somewhere in my MDL file or within the measurement alias, I want to declare a function or subroutine which looks like this

    EXAMPLE:

    [max_signal, min_signal, average_signal, ....] = my_measure_function(input_signal)

    {

    max_signal = definition of max_signal

    min_signal = definition of min_signal

    ...

    }

    Inside my measure alias, I'd now do:

    alias measurement {

    [max1, min1, average1, ...] = my_measure_function(sig1)

    [max2, min2, average2, ...] = my_measure_function(sig2)

     ...

    }

    Can you see that such a modular  approach would not only save a lot of typing (and associated errors/omissions), it would also be very easy to use especially when dozens of signals are being evaluated.

    I cannot believe that it would not be possible, just how?

    Best regards,

    Vivek

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

     Quek,

    I think you misunderstood my question. The example you show above will simply run a fresh TRAN analysis and write out fixed measure outputs performed on fixed, pre-defined signals. So, if I wanted to run the same set of measurements on 100 different signals, then I would need to key in all those expressions 100 times over and over. That's what I want to avoid. I want to make a measurement module or a function, which may be called to act upon different signals.

    So, somewhere in my MDL file or within the measurement alias, I want to declare a function or subroutine which looks like this

    EXAMPLE:

    [max_signal, min_signal, average_signal, ....] = my_measure_function(input_signal)

    {

    max_signal = definition of max_signal

    min_signal = definition of min_signal

    ...

    }

    Inside my measure alias, I'd now do:

    alias measurement {

    [max1, min1, average1, ...] = my_measure_function(sig1)

    [max2, min2, average2, ...] = my_measure_function(sig2)

     ...

    }

    Can you see that such a modular  approach would not only save a lot of typing (and associated errors/omissions), it would also be very easy to use especially when dozens of signals are being evaluated.

    I cannot believe that it would not be possible, just how?

    Best regards,

    Vivek

    • 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