10.06.2016 Views

eldo_user

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Eldo Control Language<br />

Simulation Dynamic Control<br />

.define_task main_simu<br />

set ov = 0<br />

set max_g = 0<br />

set f_max_g = 0<br />

set res = simulation(<br />

/* netlist to simulate. */<br />

+ tb_filter(),<br />

/* The callback defined below will be called each time<br />

* 10% of the simulation has been computed.<br />

*/<br />

+ callback=f_callback(), progress_period=10,<br />

/* Results to get at the end. */<br />

+ ov=@overshoot, max_g=@max_gain, f_max_g=@f_max_gain)<br />

/* Output. */<br />

if (res.simu_status == 0)<br />

fprint(stdout, "\n\nSimulation succeeded.\n\n")<br />

fprint(stdout, "\tovershoot=%.1e V.\n", ov)<br />

fprint(stdout, "\tmax_gain=%.1e dB at %.1e Hz.\n", max_g, f_max_g)<br />

else<br />

fprint(stdout, "Simulation failed.\n")<br />

endif<br />

.end_define_task<br />

.define_function f_callback ()<br />

/* It is the callback function that will be called<br />

* regularly during the simulation.<br />

*/<br />

/* Use the functions '_simu_get' to access the current<br />

* simulation time and the progress.<br />

*/<br />

set curtime = _simu_get("time")<br />

set progress = _simu_get("progress")<br />

/* Output. */<br />

fprint(stdout, "Progress=%d%% (current simulation time=%.1e)\n",<br />

progress, curtime)<br />

/* Return 0: mandatory for the simulation to go on. */<br />

return 0<br />

.end_define_function<br />

* Call the task<br />

.main_simu<br />

* Remove temporary simulation files<br />

.option remove_<strong>eldo</strong>_cl_temp_files=3<br />

* Netlist<br />

.define_testbench tb_filter<br />

*4th Order Butterworth Filter<br />

1016<br />

Eldo® User's Manual, 15.3

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

Saved successfully!

Ooh no, something went wrong!