Counter.simple constructor
A simplified constructor for Counter that accepts a single fixed amount
to count by
(up or down based on increments
) along with much of the
other available configuration in the default Counter constructor.
Implementation
Counter.simple({
required Logic clk,
required Logic reset,
int by = 1,
Logic? enable,
int minValue = 0,
int? maxValue,
int? width,
Logic? restart,
bool saturates = false,
bool increments = true,
int resetValue = 0,
String name = 'counter',
}) : this([
SumInterface(
width: width,
fixedAmount: by,
hasEnable: enable != null,
increments: increments)
..enable?.gets(enable!),
],
clk: clk,
reset: reset,
resetValue: resetValue,
restart: restart,
maxValue: maxValue,
minValue: minValue,
width: width,
saturates: saturates,
name: name);