diff --git a/tb/mdio_regs.py b/tb/mdio_regs.py index cff6287..b9a609a 100644 --- a/tb/mdio_regs.py +++ b/tb/mdio_regs.py @@ -6,8 +6,7 @@ from cocotb.clock import Clock from cocotb.triggers import FallingEdge, Timer from cocotb.types import LogicArray -def BIT(n): - return 1 << n +from .util import BIT BMCR = 0 BMSR = 1 diff --git a/tb/util.py b/tb/util.py index b3a3910..aec0935 100644 --- a/tb/util.py +++ b/tb/util.py @@ -16,6 +16,9 @@ async def async_iter(it): for i in it: yield i +def BIT(n): + return 1 << n + # From https://stackoverflow.com/a/7864317/5086505 class classproperty(property): def __get__(self, cls, owner):