+ Post New Thread
Results 1 to 9 of 9
  1. #1
    Full Member level 4
    Points: 1,238, Level: 7

    Join Date
    Jan 2018
    Posts
    202
    Helped
    1 / 1
    Points
    1,238
    Level
    7

    Help on Ocean scripting: run one analysis and use that results in another

    Hi, I know I need to learn ocean scripting but I just need a fix on this at the moment.

    I want to run a simulation which has two analysis, but the second analysis gets one of it's desvar() value from the first. any ideas? Thanks in advance.

  2. #2
    Advanced Member level 5
    Points: 39,734, Level: 48

    Join Date
    Mar 2008
    Location
    USA
    Posts
    6,419
    Helped
    1873 / 1873
    Points
    39,734
    Level
    48

    Re: Help on Ocean scripting: run one analysis and use that results in another

    Can't help you with Ocean but used to do this a lot in
    cdsSpice, never could get the hang of it in bare Spectre
    or Ocean.

    But basically I'd make up a simple data structure (for
    example, verifying trim-in range of a laser trimmed op
    amp, save the best trim code from each MC iteration
    using APPEND.1 and PRINT.1 MCCNT TRIMVAR,
    and for subsequent runs reuse that trim-code file by
    OPEN.1, LOOP X FROM 1 to 50 BY 1, READ.1 dummy TRIMV(X)
    and inside each core loop TRIMVAR=TRIMV(MCCNT).

    I'd imagine there is similar file I/O in Ocean but back
    when that was my tools set, never did find it.

    You could also manually edit the setup stuff once you
    have the data in hand, declare and populate an array
    to hold it and then do the same per-iteration assignment
    from the data array. Maybe a little Perl / Python / ???
    script (or sed -e, even) could get you from a raw data
    pile and a header / footer fixed file, to something that
    drops in easy (or maybe you find the file I/O handle).
    reading it back to



    •   AltAdvertisement

        
       

  3. #3
    Advanced Member level 5
    Points: 17,011, Level: 31
    pancho_hideboo's Avatar
    Join Date
    Oct 2006
    Location
    Real Homeless
    Posts
    2,615
    Helped
    701 / 701
    Points
    17,011
    Level
    31

    Re: Help on Ocean scripting: run one analysis and use that results in another

    Quote Originally Posted by circuitslave View Post
    but the second analysis gets one of it's desvar() value from the first.
    What do you want to mean ?
    Show me your OCEAN scripts.



    •   AltAdvertisement

        
       

  4. #4
    Full Member level 4
    Points: 1,400, Level: 8

    Join Date
    Jan 2019
    Location
    Belgium
    Posts
    199
    Helped
    83 / 83
    Points
    1,400
    Level
    8

    Re: Help on Ocean scripting: run one analysis and use that results in another

    I did not follow the question. The design variable for your second analysis is a result of the first analysis?

    If that is the case, then split your simulation into two different simulations and use calcVal.

    If you have ADE-XL, it is the easiest. Set the variable in your second simulation as:
    calcVal("simulation1_output_name" "name_of_the_test")

    Alternatively, in your OCEAN script (never tried this):
    desVar( "new_var" "calcVal(\"simulation1_output_name\" \"name_of_the_test\")" )

    Make sure you don't miss the '\'.


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  5. #5
    Full Member level 4
    Points: 1,238, Level: 7

    Join Date
    Jan 2018
    Posts
    202
    Helped
    1 / 1
    Points
    1,238
    Level
    7

    Re: Help on Ocean scripting: run one analysis and use that results in another

    Quote Originally Posted by vivekroy View Post
    I did not follow the question. The design variable for your second analysis is a result of the first analysis?

    If that is the case, then split your simulation into two different simulations and use calcVal.

    If you have ADE-XL, it is the easiest. Set the variable in your second simulation as:
    calcVal("simulation1_output_name" "name_of_the_test")

    Alternatively, in your OCEAN script (never tried this):
    desVar( "new_var" "calcVal("simulation1_output_name" "name_of_the_test")" )

    Make sure you don't miss the '\'.
    Nice.Thanks vivekroy. Tried with ADE-XL, it does the job.

    Also I found found this using the keywork "calcVal()" you mentioned.

    https://community.cadence.com/cadenc...351387#1351387

    By the way, what is calcVal(), is it a calculator function? I don't think so, because I didn't find any function like that. I searched all relevant documents for it's syntax, description and usage but I didn't find any. In which document should I look for it?



  6. #6
    Advanced Member level 5
    Points: 17,011, Level: 31
    pancho_hideboo's Avatar
    Join Date
    Oct 2006
    Location
    Real Homeless
    Posts
    2,615
    Helped
    701 / 701
    Points
    17,011
    Level
    31

    Re: Help on Ocean scripting: run one analysis and use that results in another

    Quote Originally Posted by circuitslave View Post
    In which document should I look for it?
    Launch Skill finder from CIW.

    However I don’t think calcVal() is required for your purpose, since what you want to do is no more than very easy task.

    Generally OCEAN-XL is not required.



  7. #7
    Full Member level 4
    Points: 1,400, Level: 8

    Join Date
    Jan 2019
    Location
    Belgium
    Posts
    199
    Helped
    83 / 83
    Points
    1,400
    Level
    8

    Re: Help on Ocean scripting: run one analysis and use that results in another

    Yeah, it is not a calculator function.

    I think maybe the SKILL Language Reference Manual?

    Or maybe in the SKILL API Finder which can be invoked from the Virtuoso CIW Window.



  8. #8
    Full Member level 4
    Points: 1,238, Level: 7

    Join Date
    Jan 2018
    Posts
    202
    Helped
    1 / 1
    Points
    1,238
    Level
    7

    Re: Help on Ocean scripting: run one analysis and use that results in another

    Quote Originally Posted by vivekroy View Post
    desVar( "new_var" "calcVal("simulation1_output_name" "name_of_the_test")" )
    You wrote this "new_var" and in the link I gave, the author says "and that the design variable is a global variable which is used by the second test but not the first test".

    I am not sure why he says that "it is not used in the first test" because I am using the same variable in both tests but, yeah, it is a global variable.



    •   AltAdvertisement

        
       

  9. #9
    Full Member level 4
    Points: 1,400, Level: 8

    Join Date
    Jan 2019
    Location
    Belgium
    Posts
    199
    Helped
    83 / 83
    Points
    1,400
    Level
    8

    Re: Help on Ocean scripting: run one analysis and use that results in another

    I don't like using calcVal in global variables. I always prefer using it in local variables. (Make sure to disable the global variables by unchecking the box next to the respective global variable)



--[[ ]]--