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

Example<br />

.define_testbench tb_top<br />

v1 1 0 ac 1<br />

r1 1 2 10k<br />

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

*Extract gain and phase at 1Hz as a complex number.<br />

.extract ac label=gp_1 yval(v(2,0),1)<br />

.ac dec 19 1e-9 1e9<br />

.end_define_testbench<br />

.define_task t_simu<br />

set gp = 0<br />

/* Run simulation and get the complex result gp_1. */<br />

if (simulation(tb_top(), gp=@gp_1).simu_status == 0)<br />

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

fprint(stdout, "1Hz: gain = %.2f dB phase = %.2f rad\n", db(gp),\<br />

phase(gp))<br />

else<br />

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

endif<br />

.end_define_task<br />

.t_simu<br />

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

Simulations” on page 841, and the fprint function for more information on the concepts used in<br />

the example.<br />

Related Topics<br />

Variables<br />

Library of Functions for Tasks<br />

Strings<br />

Case-sensitivity of strings (for comparison operators) is set through a global option (.option<br />

set_<strong>eldo</strong>_cl_string_comparison_case_sensitive=1). Strings are case-insensitive by default, and<br />

it is recommended that this is left unchanged to ensure compatibility.<br />

Tip<br />

See “.OPTION SET_ELDO_CL_STRING_COMPARISON_CASE_SENSITIVE” in the<br />

Eldo Reference Manual.<br />

String variables are manipulated with simple operators. The == and != operators can be used to<br />

test equality or inequality of two strings. The < and > operators are used to test the lexical<br />

ordering of two strings, based on the alphabetical order. For example:<br />

set s_ok = "success" s_fail = "failed" s_code1 = "" s_code2 = "whatever"<br />

824<br />

Eldo® User's Manual, 15.3

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

Saved successfully!

Ooh no, something went wrong!