Source code for hwt.hdl.types.eventCapableVal
from hwt.hdl.operator import Operator
from hwt.hdl.operatorDefs import AllOps
from hwt.hdl.types.defs import BOOL
from hwt.hdl.value import HValue
[docs]class EventCapableVal():
"""
Base class for event capable values
"""
[docs] def _onFallingEdge(self):
assert not isinstance(self, HValue), self
return Operator.withRes(AllOps.FALLING_EDGE, [self], BOOL)
[docs] def _onRisingEdge(self):
assert not isinstance(self, HValue), self
return Operator.withRes(AllOps.RISING_EDGE, [self], BOOL)