tb: Move BIT to util
This function may be useful for other testbenches. Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
parent
a179ccb9ab
commit
afbb64023e
|
@ -6,8 +6,7 @@ from cocotb.clock import Clock
|
||||||
from cocotb.triggers import FallingEdge, Timer
|
from cocotb.triggers import FallingEdge, Timer
|
||||||
from cocotb.types import LogicArray
|
from cocotb.types import LogicArray
|
||||||
|
|
||||||
def BIT(n):
|
from .util import BIT
|
||||||
return 1 << n
|
|
||||||
|
|
||||||
BMCR = 0
|
BMCR = 0
|
||||||
BMSR = 1
|
BMSR = 1
|
||||||
|
|
|
@ -16,6 +16,9 @@ async def async_iter(it):
|
||||||
for i in it:
|
for i in it:
|
||||||
yield i
|
yield i
|
||||||
|
|
||||||
|
def BIT(n):
|
||||||
|
return 1 << n
|
||||||
|
|
||||||
# From https://stackoverflow.com/a/7864317/5086505
|
# From https://stackoverflow.com/a/7864317/5086505
|
||||||
class classproperty(property):
|
class classproperty(property):
|
||||||
def __get__(self, cls, owner):
|
def __get__(self, cls, owner):
|
||||||
|
|
Loading…
Reference in New Issue