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 />

Statement Overview<br />

set w1 = 0<br />

set w2 = 0<br />

set w3 = 0<br />

set w4 = 0<br />

simulation(tb(), w1=@wave1, w2=@wave2)<br />

w3 = w1 + 1<br />

w4 = w1 + w2<br />

Examples<br />

Example One<br />

.define_testbench follower<br />

.connect inn out<br />

.ac dec 10 1 1g<br />

* need to give a name to the waveform like this to be able to get it back<br />

from the simulation command:<br />

.plot ac voutdb_wave=vdb(out)<br />

.end_define_testbench<br />

.define_task opamp_gain_max_from_wave<br />

/* This example shows how to retrieve a simple AC waveform,<br />

and use it to extract its maximum value (a very complicated way).<br />

*/<br />

set vout=0<br />

set i=0 max_gain=-1000 imax=0 x=0.0 y=0.0 iter=0<br />

simulation(<br />

+ powersupply(pvdd = 2.0),<br />

+ follower(),<br />

+ vout = @voutdb_wave)<br />

iter = beginval(vout, x, y)<br />

while (iter != 0)<br />

if (y > max_gain)<br />

max_gain = y<br />

imax = x<br />

endif<br />

iter = nextval(vout, x, y)<br />

endwhile<br />

fprint (stdout, "Maximum gain : %.5g at frequency = %.5g.\n",\<br />

max_gain, vout.x[imax])<br />

.end_define_task<br />

.opamp_gain_max_from_wave()<br />

See “Testbenches” on page 809, “Tasks” on page 814, “Variables” on page 821, “Flow Control<br />

Statements” on page 835, “Defining and Running Simulations” on page 841, and the fprint,<br />

beginval, and nextval functions for more information on the concepts used in the example.<br />

832<br />

Eldo® User's Manual, 15.3

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

Saved successfully!

Ooh no, something went wrong!