from migen.fhdl.structure import *
from migen.fhdl.specials import Memory
-class Register(HUID):
+class _Register(HUID):
pass
-class RegisterRaw(Register):
+class RegisterRaw(_Register):
def __init__(self, name, size=1):
- Register.__init__(self)
+ _Register.__init__(self)
self.name = name
self.size = size
self.re = Signal()
self.w = Signal(self.size)
self.we = Signal()
-class RegisterFields(Register):
+class RegisterFields(_Register):
def __init__(self, name, fields):
- Register.__init__(self)
+ _Register.__init__(self)
self.name = name
self.fields = fields
def get_registers(self):
r = []
for k, v in self.__dict__.items():
- if isinstance(v, Register):
+ if isinstance(v, _Register):
r.append(v)
elif hasattr(v, "get_registers") and callable(v.get_registers):
r += regprefix(k + "_", v.get_registers())
from migen.bank.description import *
from migen.genlib.misc import optree
-class EventSource(HUID):
+class _EventSource(HUID):
def __init__(self):
HUID.__init__(self)
self.trigger = Signal()
self.pending = Signal()
-class EventSourcePulse(EventSource):
+class EventSourcePulse(_EventSource):
pass
-class EventSourceLevel(EventSource):
+class EventSourceLevel(_EventSource):
pass
class EventManager(Module, AutoReg):
self.irq = Signal()
def do_finalize(self):
- sources_u = [v for v in self.__dict__.values() if isinstance(v, EventSource)]
+ sources_u = [v for v in self.__dict__.values() if isinstance(v, _EventSource)]
sources = sorted(sources_u, key=lambda x: x.huid)
n = len(sources)
self.status = RegisterRaw("status", n)
self.comb += self.irq.eq(optree("|", irqs))
def __setattr__(self, name, value):
- if isinstance(value, EventSource) and self.finalized:
+ if isinstance(value, _EventSource) and self.finalized:
raise FinalizeError
object.__setattr__(self, name, value)