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.

<strong>6.</strong> <strong>Digital</strong> <strong>simulation</strong> <strong>in</strong> <strong>Alecsis</strong> 91}}}// code activates at the edge of clock signal...In this example, wait command is sensitive to the clock signal, with the condition of a transition to '1' (ifaction parameter mode equals Ris<strong>in</strong>gEdge) or '0' (if mode equals Fall<strong>in</strong>gEdge). The appropriateedge of the clock activates the code that follows (omitted <strong>in</strong> the example above). At the end of the process, thecontrol is back at its beg<strong>in</strong>n<strong>in</strong>g, and the execution stops aga<strong>in</strong> at wait command, wait<strong>in</strong>g the appropriate clockedge.<strong>6.</strong>2.4. Predef<strong>in</strong>ed signal attributesAll signals, regardless of their data type, have a number of attributes, whose value can be accessed <strong>in</strong> aprocess. All attributes are of <strong>in</strong>t type, and can be accessed us<strong>in</strong>g <strong>in</strong>direction operator -> (signal name istreated as a po<strong>in</strong>ter, i.e. address <strong>in</strong> memory). Signal attributes are:− active -- 1 if the signal is active <strong>in</strong> the present moment, otherwise 0− event -- 1 if an event is currently happen<strong>in</strong>g on the signal, otherwise 0− quiet -- 1 if the signal is not processed <strong>in</strong> the present moment (!active), otherwise 0− stable --1 if the signal is not chang<strong>in</strong>g value (!event), otherwise 0− fan<strong>in</strong> -- number of processes sensitive to this signal− fanout -- number of drivers of this signal− hybrid -- 1 if the signal has also analogue aspect, otherwise 0It can happen that the signal is processed, but the result is the same value as it was before.Processed signal is active, while an event happened to it only when the new value is differentfrom the old one. The term sensitivity has already been expla<strong>in</strong>ed, while the concept of driverswill be expla<strong>in</strong>ed <strong>in</strong> the follow<strong>in</strong>g section. The last attribute <strong>in</strong>dicates the hybrid aspect of thepresent signal, that is the coupl<strong>in</strong>g of analogue elements (which can have effect on delaycalculations and other activities).Note: The <strong>in</strong>direction operator -> can be used without restrictions, s<strong>in</strong>ce the members ofsignals-structures can be accessed us<strong>in</strong>g character '.', and the signal cannot be declared as apo<strong>in</strong>ter.Composite signals have attributes active, event, quiet, and stable. Attributes hybrid,fan<strong>in</strong>, and fanout are not allowed it the signal is not a scalar. Attributes active and event are obta<strong>in</strong>edas a result of or operation on attributes of all scalars of the signal (for example, a vector is active if at least oneposition is active). Attribute quiet is negation of active, and stable is negation of event.signal four_t v[4];...v[0]->fan<strong>in</strong>; // o.k.v->fan<strong>in</strong>; // error - composite signals cannot that attributeWe use attributes <strong>in</strong> the follow<strong>in</strong>g example for detection of static hazard - simultaneousand opposite change of the <strong>in</strong>puts of an AND circuit).

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

Saved successfully!

Ooh no, something went wrong!