calyx
calyx copied to clipboard
Unstable reads
A pass that marks ports as stable or unstable depending on where they receive values from. If the value comes from a continuous assignment rooted in stateful elements, the read is stable. Otherwise it is unstable.
component foo(in: 32) -> (out: 32) {
cells { }
wires { out = in; }
control { }
}
component main() -> (out: 32) {
cells { f = foo; }
wires {
out = f.out; // unstable read because f.out depends on f.go and f.in being high.
}
}
With #715 merged, this can be implemented as a check to propagate and reject invalid uses of @stable ports. If the output port of a component is unconditionally connected to a @stable port then that port is stable. Reads of ports that are not marked @stable from a group/control operator that does not run the corresponding component should be rejected because the port may not be stable.