let state = reg r_sync enable 2 in
let a = wire 8 in
compile [
if_ a#q ==: consti 8 4 [
a $== consti 8 2
] [
switch (q state) [
(consti 2 0) [
a $==. 3;
state $== const 2 1;
];
(consti 2 1) [
a $==. 2;
state $== const 2 2;
];
(consti 2 2) [
a $==. 1;
state $== const 2 3;
];
(consti 2 3) [
a $==. 0;
state $== const 2 4;
]
]
];
let state = state#q in
let a = a#q in
....
The type of variables in guarded assignments. Variables may be asychronous wires, or synchronous regs. The current value of the variable may be accessed through the value field below.