• 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. variable sweep in ADEXL

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 125
  • Views 22752
  • 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

variable sweep in ADEXL

SteveRFIC
SteveRFIC over 6 years ago

I have two variables defined in ADEXL.

I want to sweep variable A, with Four values, 1,2,3,4.

Then I want to make variable B sweep dependent on A.

For instance, when A is 1, then B sweeps from 1 to 3. When A is 2, B sweeps from 3 to 5. When A is 3, then B sweeps to 6 to 9.

How can I achieve this? is there a way to use some logic expression in the variable definition?

Thanks!

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago

    Your sweep of B doesn't seem to follow a particular pattern. It could have been specified as follows:

    C: 1,2,3
    B: (A-1)*3+C
    A: 1:1:4     # assuming you wanted to sweep A from 1 to 4 as well

    and then B would have swept from 1 to 3 when A was 1, from 4 to 6 when A was 2, from 7 to 9 when A was 3 and so on. However, as you specified it above, the B value 3 is in the sweep when A is 1 or 2, and there are four sweep points in sweep B for A=3 which is different from the 3 points for the other values of A. 

    So you could do it with (only going up to A=3 because  you didn't say what happened with A=4):

    A: 1,1,1,2,2,2,3,3,3,3
    B: 1,2,3,3,4,5,6,7,8,9

    Then select both variables in the global variables list and do Right Mouse->Group as Parametric Set (the menu is something like that - I can't remember the exact wording as I'm not on my work computer). This will then sweep both variables so they track together and do 10 sweep points rather than 10*10 (100) if they hadn't been grouped as a parametric set.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SteveRFIC
    SteveRFIC over 6 years ago in reply to Andrew Beckett

    Thank you very much Andrew!

    I gave the A and B sweep as a simple example without much thinking of it. didn't expect that you find a pattern out of the sweep Slight smile

    the real case is much more complicated than that. the situation is that my circuit has different mode of operation, say mode 1,2,3,4... the number can be large

    depending on my mode of operation, the variables that I want to sweep can have different ranges.

    For instance,

    when in mode 1, A needs to be swept like this, A: 14:0.5:15.5.

    when in mode 2, A : 12:0.3:17

    etc. there is no patterns for a simple equation to cover these.

    Actually what I want to do is to use inclusion list. to have different inclusion lists defined for variable A. and then select one of it, depending on mode.

    It'll be perfect if I can do the following:

    A: (mode ==1) && inclusion_list_1, (mode == 2 ) && inclusion_list_2, etc.

    I tried this and it did not work. don't know if ADEXL supports such expressions in the variable definition field.

    Another case is that Variable A has total 10 values, 1 to 10. depending on the mode, I need to pick (randomly) a few numbers out of the 10 to sweep. I want to do something like the following

    define A: 1*(mode ==1), 2*(mode == 1 || mode ==3), 3 * (mode ==1 || mode ==2), etc.

    The problem is I will have 0 when mode is not true. So it always give me 10 sweeps, including those 0s, and 0 can cause simulator fails. I tried to exclude those 0s using an exclusion list at the end, but it does not work. combining inclusion and exclusion lists works fine when they both have only numbers. once some logical operation with another variable is involved, then it seems that exclusion_list can not recognize the variable correctly, like those 0s.

    When number of modes are not that many, I can define them as individual corners and put different variable sweep in the corner. that will work but I will end up with defining many corners. Would be great if any of the two things above can work. can they ? Slight smile

    Thank you!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to SteveRFIC

    Well, you can't define the variables as you've defined them - I think that's unlikely that we'd support that complexity of setup in the future either because it would get horribly complicated pretty quickly.

    However, if you use ADE Assembler (rather than ADE XL), there's a feature called "Run Plans" which allow you to define a sequence of runs to perform, and importantly there's the capability to specify a "preRun" script which runs before the runs start. So for example:

    The simplePreRun.il script I've used is this:

    mode=maeGetVar("mode")
    printf("MODE IS %L\n" mode)
    case(mode
        ("1"
    	maeSetVar("rval" "1k")
    	maeSetVar("cval" "1p")
        )
        ("2"
    	maeSetVar("rval" "1k:200:3k")
    	maeSetVar("cval" "1p")
        )
        ("3"
    	maeSetVar("rval" "1k")
    	maeSetVar("cval" "1p:0.5p:5p")
        )
    )
    

    This checks the value of "mode" and adjusts the sweeps accordingly. There are different numbers of sweeps in each mode, for example. This isn't attempting to handle the situation where mode was swept, but hopefully you get the idea. It's a simple piece of SKILL code that uses the simple Maestro mae functions to get and set variables (you can set either global variables, or test variables -  I kept it simple here and only adjusted global variables).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SteveRFIC
    SteveRFIC over 6 years ago in reply to Andrew Beckett

    Thank you Andrew! 

    it works fine without sweeping on "mode". If I put a sweep on mode in the Variable field, then it seems that the script won't be able to set the sweep correctly for the whole simulation.

    Still, it is good to learn something new Slight smile

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to SteveRFIC

    You could of course write the code to cope with a sweep value of mode (e.g. mode=1:1:7 if there are 7 modes), work out the range, and combine all the sweep points together. Something like that - although it would be a bit complicated. So it's not impossible.

    Unfortunately there's no public SKILL function (not sure there's even a private one) to expand the ADE XL sweep points for you, but potentially you could have your code expand a subset of sweep specifications (it's not hard to parse a MATLAB-style sweep definition such as the start:step:stop form).

    Regards,

    Andrew.

    • 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