S
Svenn Are Bjerkem
Guest
Hi,
trying to do some duty cycle monte carlo calculations using the monte*
functions.
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
somewhere.
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_tl=cross(clip(VT("/c2c_rec_out_dp"),1.85n,4n),0.54,1,"either")
dcd_dp_tm=cross(clip(VT("/c2c_rec_out_dp"),1.85n,4n),0.54,2,"either")
dcd_dp_th=cross(clip(VT("/c2c_rec_out_dp"),1.85n,4n),0.54,3,"either")
(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
trying to do some duty cycle monte carlo calculations using the monte*
functions.
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
somewhere.
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_tl=cross(clip(VT("/c2c_rec_out_dp"),1.85n,4n),0.54,1,"either")
dcd_dp_tm=cross(clip(VT("/c2c_rec_out_dp"),1.85n,4n),0.54,2,"either")
dcd_dp_th=cross(clip(VT("/c2c_rec_out_dp"),1.85n,4n),0.54,3,"either")
(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