Counter.ofLogics constructor
Creates a Counter that counts up by all of the provided logics
,
including much of the other available configuration in the default
constructor.
All logics
are always incrementing and controlled optionally by a single
enable
.
Implementation
factory Counter.ofLogics(
List<Logic> logics, {
required Logic clk,
required Logic reset,
Logic? restart,
dynamic resetValue = 0,
dynamic maxValue,
dynamic minValue = 0,
Logic? enable,
int? width,
bool saturates = false,
String name = 'counter',
}) =>
Counter(
logics
.map((e) => SumInterface(width: e.width, hasEnable: enable != null)
..amount.gets(e)
..enable?.gets(enable!))
.toList(),
clk: clk,
reset: reset,
resetValue: resetValue,
maxValue: maxValue,
minValue: minValue,
width: width,
saturates: saturates,
restart: restart,
name: name,
);