09.07.2015 Views

6. Digital simulation in Alecsis - LEDA

6. Digital simulation in Alecsis - LEDA

6. Digital simulation in Alecsis - LEDA

SHOW MORE
SHOW LESS

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

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

98 <strong>Alecsis</strong> 2.3 - User’s manualadditional mechanism, we can ban the use of add_tcap method, and thus fix term<strong>in</strong>al capacitance to be readonly.<strong>6.</strong>4. Leav<strong>in</strong>g out actual signals -- voidSome formal signals can appear to be unnecessary dur<strong>in</strong>g connect<strong>in</strong>g. For example, one can use only non<strong>in</strong>vert<strong>in</strong>goutput of a flip-flop <strong>in</strong> the circuit, while the <strong>in</strong>vert<strong>in</strong>g output is not used -- it rema<strong>in</strong>s unconnected. InAleC++, this is enabled by <strong>in</strong>sert<strong>in</strong>g the word void <strong>in</strong>stead the actual signal, when such component is connected.Compiler will generate an implicit signal whose dimensionality and <strong>in</strong>itial value will be determ<strong>in</strong>ed from the formaldeclaration. If the formal signal has direction <strong>in</strong>, processes sensitive to it will never activate (if we do not countone pass dur<strong>in</strong>g the <strong>in</strong>itialization). Signals with direction <strong>in</strong>out can still be active if they have drivers <strong>in</strong>side themodule that is to be connected.module rsff(three_t <strong>in</strong> reset='1', set='0';three_t out q='0', qbar='1') rsff1;signal three_t r='1', s='0', q;ruffs (r, s, q, void);The implicit signal, generated automatically as a consequence of omission of actual signal, cannot bereferenced to <strong>in</strong> the pr<strong>in</strong>tout control (command plot). Its activity are known only to processes on the formal sideof the <strong>in</strong>terface.<strong>6.</strong>5. Variable number of formal signals -- operators '$' and '$$'In C/C++, one can declare and def<strong>in</strong>e functions with a variable number of arguments. The number of formalparameters of a module can be variable, too:module andx (three_t out y; three_t <strong>in</strong> ...) {action (double delay) {process structural {if ($$ < 2) warn<strong>in</strong>g("module andx has no <strong>in</strong>puts",1):}process ($2 ...) {three_t result = $2;<strong>in</strong>t i;for (i=3; i

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

Saved successfully!

Ooh no, something went wrong!