Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix Register name conflict between Pytholite and Bank

  • Loading branch information...
commit b04275718748023518a7486aa28322804ee11570 1 parent f93695f
@sbourdeauducq sbourdeauducq authored
Showing with 11 additions and 11 deletions.
  1. +6 −6 migen/bank/description.py
  2. +5 −5 migen/bank/eventmanager.py
View
12 migen/bank/description.py
@@ -3,12 +3,12 @@
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()
@@ -34,9 +34,9 @@ def __init__(self, name, size=1, access_bus=READ_WRITE, access_dev=READ_ONLY, re
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
@@ -74,7 +74,7 @@ def get_memories(self):
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())
View
10 migen/bank/eventmanager.py
@@ -3,16 +3,16 @@
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):
@@ -20,7 +20,7 @@ def __init__(self):
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)
@@ -60,6 +60,6 @@ def do_finalize(self):
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)
Please sign in to comment.
Something went wrong with that request. Please try again.