Why does a procedure not get properly evaluated with montecarlo?

Discussion in 'Cadence' started by Svenn Are Bjerkem, Sep 11, 2007.

  1. Hi,

    trying to do some duty cycle monte carlo calculations using the monte*
    With cross, and clip it is possible to set a tl, tm and th as three
    separate monteExpr's and then calculate the dutyCycle in a fourth
    monteExpr like this: monteExpr("dcd" "(tm-tl)/(th-tl)*100") and a
    followint histogram("dcd_27") give me a nice histogram of my duty
    cycle for one period that I cut out of the transient simulation

    Then I try to be smart and define a procedure that calculates the duty
    cycle for me. This is always failing due to evaluation error. Ocean is
    not user friendly enough to tell me what it doesn't like with my
    procedure, it just says "does not compute".

    My procedure is like this:
    (procedure (dutyCycle4)
    (dcd_dp_tm-dcd_dp_tl)/(dcd_dp_th- dcd_dp_tl)*100

    monteExpr("dcd_proc" "dutyCycle4()")

    And it works very nice with single wave simulations: It returns a
    number that correspond to the duty cycle. With monte carlo I get a
    waveform of the duty cycles over the iterations. When I simulate with
    ocean inside DFII then I just get an error message and no histogram.

    What is wrong here?
    Svenn Are Bjerkem, Sep 11, 2007
  2. I'll just fill in for myself here as I also asked this question to
    Cadence Support, and this is a known problem with monteExpr(). Andrew
    Beckett (who else?) provided a description of the problem and a
    solution. The problem can be solved by loading the home-made skill
    functions as a part of a monteExpr() since the monteExpr's are
    evaluate in a child process. The cadence functions are loaded, but
    your homemade not.

    If you need more help, ask Cadence Support about this, and they will
    also add your service request to the bottom of the already growing
    list of service requests on this problem. Maybe it gets fixed one day,
    but then I guess that very many ocean-scripts will have to be modified
    again :)
    Svenn Are Bjerkem, Sep 13, 2007
  3. Indeed. The other way of solving this (covered in the sourcelink solution I
    wrote) is to create a wrapper around "artil" which loads your custom functions.

    The PCR I filed on this was to ask for a ".artilrc" file so that custom
    calculator functions could be loaded automatically at artil start time, and
    hence be available in monte-carlo.


    Andrew Beckett, Sep 16, 2007
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.