Source code for hwt.synthesizer.interfaceLevel.getDefaultClkRts

from hwt.synthesizer.exceptions import IntfLvlConfErr
from hwt.synthesizer.interfaceLevel.mainBases import UnitBase


[docs]def getClk(unit: UnitBase): """ Get clock signal from unit instance """ try: return unit.clk except AttributeError: pass raise IntfLvlConfErr(f"Can not find clock signal on unit {unit}")
[docs]def getRst(unit: UnitBase): """ Get reset signal from unit instance """ try: return unit.rst except AttributeError: pass try: return unit.rst_n except AttributeError: pass raise IntfLvlConfErr(f"Can not find reset signal on unit {unit}")