divAssign method

Conditional divAssign(
  1. dynamic val, {
  2. Logic s(
    1. Logic
    )?,
})

Shorthand for a Conditional which increments this by val.

For a Logic variable, this is variable /= val.

If using Combinational, you will need to provide s as a remapping function since otherwise this will cause a "write after read" violation.


Sequential(clk, [
  pOut.divAssign(val: b),
]);

Combinational.ssa((s) => [
      s(pOut) < a,
      pOut.divAssign(val: b, s: s),
    ]);

Implementation

Conditional divAssign(dynamic val, {Logic Function(Logic)? s}) =>
    s == null ? (this < this / val) : (s(this) < s(this) / val);