isNegedge static method
- LogicValue previousValue,
- LogicValue newValue,
- {bool ignoreInvalid = false}
Returns true iff the transition represents a negative edge.
Only returns true from 1 -> 0. If previousValue
or newValue
is
invalid, an Exception will be thrown, unless ignoreInvalid
is set
to true
.
Implementation
static bool isNegedge(LogicValue previousValue, LogicValue newValue,
{bool ignoreInvalid = false}) {
_assertSingleBit(previousValue);
_assertSingleBit(newValue);
if (!ignoreInvalid && (!previousValue.isValid | !newValue.isValid)) {
throw Exception(
'Edge detection on invalid value from $previousValue to $newValue');
}
return previousValue == LogicValue.one && newValue == LogicValue.zero;
}