calyx icon indicating copy to clipboard operation
calyx copied to clipboard

Unstable reads

Open rachitnigam opened this issue 4 years ago • 1 comments

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.
  }
}

rachitnigam avatar Dec 10 '20 18:12 rachitnigam

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.

rachitnigam avatar Oct 07 '21 03:10 rachitnigam