Switch Block
Declares a switch block or a switch block bundle using the keyword switch
.
Declaration
#switch block
switch LABEL {
default: off
reset: MasterReset
meta: none
}
#switch block bundle
switch LABEL [SIZE] {
default: off | [ off, ...]
reset: MasterReset
meta: none
}
- LABEL
definition: | the label of the block |
- SIZE
definition: | the size of the block bundle |
type: | constant integer port (CIP) |
Shorthand Declaration
# constant block
Boolean >> LABEL;
# constant block bundle
BooleanList >> LABEL;
- LABEL
definition: | the label of the block |
- Boolean
-
- BooleanList
definition: | a list of on and off |
Ports Table
|
|
|
|
|
|
|
|
Port |
Name |
Direction |
Type |
Connection |
Access |
Default |
Required |
1 |
input |
input |
CBP |
single |
>> LABEL |
none |
no (1) |
assignment |
2 |
output |
output |
CBP |
multiple |
LABEL >> |
none |
no (1) |
assignment |
3 |
default |
input |
CBP |
single |
property |
off |
yes |
4 |
reset |
input |
CBP |
single |
property |
MasterReset |
yes |
5 |
meta |
input |
CSP |
single |
property |
none |
no |
CBP: | constant boolean port |
CSBP: | control stream boolean port |
CSP: | constant string port |
LABEL: | block label |
1 Warning issued during compilation if the port is left unconnected.
Description
Switches are asynchronous blocks. They propegate the rate none
upstream.
Code Examples
switch Switch {
default: off
reset: MasterReset
meta: 'A switch'
}
# Shorthand
off >> Switch;
switch SwitchBundle [2] {
default: off
reset: MasterReset
meta: 'A switch'
}
# Shorthand
[off, off] >> SwitchBundle;