flop function
Constructs a positive edge triggered flip flop on clk
.
It returns FlipFlop.q.
When the optional en
is provided, an additional input will be created for
flop. If optional en
is high or not provided, output will vary as per
inputd
. For low en
, output remains frozen irrespective of input d
.
When the optional reset
is provided, the flop will be reset (active-high).
If no resetValue
is provided, the reset value is always 0
. Otherwise,
it will reset to the provided resetValue
.
Implementation
Logic flop(
Logic clk,
Logic d, {
Logic? en,
Logic? reset,
dynamic resetValue,
}) =>
FlipFlop(
clk,
d,
en: en,
reset: reset,
resetValue: resetValue,
).q;