MultiCycleDivider.ofLogics constructor

MultiCycleDivider.ofLogics({
  1. required Logic clk,
  2. required Logic reset,
  3. required Logic validIn,
  4. required Logic dividend,
  5. required Logic divisor,
  6. required Logic isSigned,
  7. required Logic readyOut,
})

Factory method to create a MultiCycleDivider from explicit Logic signals instead of an interface

Implementation

factory MultiCycleDivider.ofLogics({
  required Logic clk,
  required Logic reset,
  required Logic validIn,
  required Logic dividend,
  required Logic divisor,
  required Logic isSigned,
  required Logic readyOut,
}) {
  assert(dividend.width == divisor.width,
      'Widths of all data signals do not match!');
  final dataWidth = dividend.width;
  final intf = MultiCycleDividerInterface(dataWidth: dataWidth);
  intf.clk <= clk;
  intf.reset <= reset;
  intf.validIn <= validIn;
  intf.dividend <= dividend;
  intf.divisor <= divisor;
  intf.isSigned <= isSigned;
  intf.readyOut <= readyOut;
  return MultiCycleDivider(intf);
}