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 Netlist Setup<br />

String Operator on If Expressions<br />

Related Topics<br />

Directives<br />

String Operator on If Expressions<br />

String Operator on If Expressions<br />

It is possible to use C-like functions strcmp and strncmp inside if statements used for netlist<br />

configuration. strcmp and strncmp return “0” when the string matches, “not 0” otherwise.<br />

Examples:<br />

.param p1 = "myp1"<br />

if (strcmp(p1,"myp1") == 0)<br />

i1 1 0 1<br />

else<br />

i1 1 0 2<br />

endif<br />

r1 1 0 1<br />

Here, i1 will be 1A.<br />

if (strcmp($(p1),"myp1") == 0)<br />

i1 2 0 3<br />

else<br />

i1 2 0 4<br />

endif<br />

r1 2 0 1<br />

Similarly, i1 will be 3A because the if statement is true.<br />

Related Topics<br />

Directives<br />

Directives Interpreted by the Eldo Parser (Default)<br />

Directives Interpreted by the Eldo Parser (Default)<br />

By default, (without the -E or -EE argument) Eldo understands the following simple preprocessor<br />

commands: #if, #define , #undef , #ifdef , #ifndef <br />

#else, #endif. These can be used as conditional statements to select a part of the netlist.<br />

For example:<br />

#define NO_RESISTOR<br />

...<br />

#ifndef NO_RESISTOR<br />

R1 A B 1k<br />

#endif<br />

...<br />

122<br />

Eldo® User's Manual, 15.3

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

Saved successfully!

Ooh no, something went wrong!