Blocks and Guards
Unique to blocks is the GUARD construct
- A guarded signal assignment statement schedules an assignment to the signal driver only if the GUARD expression is true. If the GUARD is false, the corresponding signal drivers are disconnected
- Example
ARCHITECTURE guarded_assignments OF n_1_mux IS
bi: FOR j IN i’RANGE GENERATE
bj: BLOCK (s(j)=‘1’ OR s(j)=‘Z’)
Notes:
A conditional GUARD can be included in the BLOCK declaration. If such a GUARD expression exists, then any signal assignment statement in the block which has the keyword GUARDED will disconnect the corresponding signal driver if the GUARD expression evaluates to false. This is one mechanism which can be used to guarantee that there be only one active driver on any signal at any one time.