10.06.2016 Views

eldo_user

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Eldo Control Language<br />

Defining and Running Simulations<br />

.define_testbench tb_rc(v_extract=4)<br />

.param param_r = 10k<br />

.step param param_r 10k 50k 10k<br />

v1 1 0 5<br />

r1 1 2 param_r<br />

c1 2 0 100u ic=0<br />

.tran 1 20 uic<br />

.plot tran v(1,0)<br />

.plot tran v(2,0)<br />

.extract tran catvect label=x_extract xthres(v(2,0), v_extract)<br />

* Need to do this extract to be able to get all the values of param_v<br />

* otherwise only the last one would be available if getting the value<br />

* of param_r instead of r_vect in the task..<br />

.extract tran catvect label=r_vect param_r<br />

.end_define_testbench<br />

.define_task t_simu<br />

set extract_res [] = 0<br />

set r_res [] = 0<br />

set i = 0<br />

/* Run the simulation and get the vector results. */<br />

if (simulation( \<br />

name="simu_rc/simu_rc.cir", \<br />

tb_rc(), \<br />

extract_res=@x_extract, r_res=@r_vect).simu_status == 0)<br />

fprint(stdout, "Simulation succeeded:\n")<br />

fprint(stdout, "uv crosses 4V at:\n")<br />

for (i=extract_res.imin; i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!