mulAssign method

Conditional mulAssign(
  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.mulAssign(val: b),
]);

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

Implementation

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