10.06.2016 Views

eldo_user

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Eldo Control Language<br />

Statement Overview<br />

Variables<br />

Several simple variable types are available. The simplest types are the number and string types,<br />

which are used to hold a single value, either a number (always a double-precision floating-point<br />

number) or a string. Vectors of scalar numbers and vectors of strings are also available, together<br />

with a set of functions operating directly on vectors. The waveform type is used to represent<br />

waveforms and communicate with Eldo. Finally, a file type is available for ASCII file<br />

manipulations.<br />

All variables have an identifier starting with a letter, or an “_” character, followed by a sequence<br />

of letters, digits, “_” and/or “#”. All variables, without exception, must be given an explicit<br />

initial value. There is no such thing as an uninitialized variable by construction.<br />

All types of variables can be passed as arguments (either input or output) to testbenches and<br />

tasks.<br />

All variables are local to the task in which they are declared.<br />

In this topic:<br />

Variable Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 821<br />

Variable Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 822<br />

Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823<br />

Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823<br />

Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824<br />

Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825<br />

Waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831<br />

Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833<br />

Predefined Constants. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 834<br />

Variable Declaration<br />

Variables are defined at the beginning of a task, before any other statement. It is not permitted to<br />

declare variables inside a for or while loop, or anywhere but at the very beginning of a task<br />

(except if .option restrict_<strong>eldo</strong>_cl_declarations=0 is specified in the netlist).<br />

Scalar variables containing numbers are similar to (local) .PARAM in regular simulation<br />

syntax.<br />

A scalar variable can hold either a numeric value, a string of characters, a vector of such<br />

numbers or strings, or a file (logical) name. An initial value is mandatory. For example:<br />

set a=1.3 b=2<br />

set s="hello"<br />

Eldo® User's Manual, 15.3 821

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

Saved successfully!

Ooh no, something went wrong!