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

Functions<br />

For Loops<br />

This construct is comparable to the C for loop:<br />

set i = 0<br />

set wstr = ""<br />

for (; i != n; i++)<br />

endif<br />

endfor<br />

cload[i] = cloadstart + i*(cloadstop-cloadstart)/(n-1)<br />

simulation(\<br />

tran_options( ),\<br />

measure_trop(cload=cload[i], trise=1n,\<br />

signal="v(out)"), tprop[i]=@tp , passfail = @passfail)<br />

if (passfail != 1)<br />

sprint (wstr, "Cannot complete measure_tprop() task for\<br />

cload=%.5g\n",\cload[i])<br />

fprint (stdout, wstr)<br />

See “Variables” on page 821, “Flow Control Statements” on page 835, “Defining and Running<br />

Simulations” on page 841, and the fprint and sprint functions for more information on the<br />

concepts used in the example.<br />

Related Topics<br />

Flow Control Statements<br />

Functions<br />

A function is similar to a task, except that it returns a value. The return type can be a number, a<br />

string, or a vector. The keywords .define_function and .end_define_function tell the compiler<br />

that an object must be returned.<br />

The following example rewrites the second example in the topic “Passing Vectors as Task<br />

Arguments” on page 830 using a function rather than a task:<br />

Eldo® User's Manual, 15.3 839

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

Saved successfully!

Ooh no, something went wrong!