Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix Register name conflict between Pytholite and Bank

  • Loading branch information...
commit b04275718748023518a7486aa28322804ee11570 1 parent f93695f
Sébastien Bourdeauducq authored March 10, 2013
12  migen/bank/description.py
@@ -3,12 +3,12 @@
3 3
 from migen.fhdl.structure import *
4 4
 from migen.fhdl.specials import Memory
5 5
 
6  
-class Register(HUID):
  6
+class _Register(HUID):
7 7
 	pass
8 8
 
9  
-class RegisterRaw(Register):
  9
+class RegisterRaw(_Register):
10 10
 	def __init__(self, name, size=1):
11  
-		Register.__init__(self)
  11
+		_Register.__init__(self)
12 12
 		self.name = name
13 13
 		self.size = size
14 14
 		self.re = Signal()
@@ -34,9 +34,9 @@ def __init__(self, name, size=1, access_bus=READ_WRITE, access_dev=READ_ONLY, re
34 34
 				self.w = Signal(self.size)
35 35
 				self.we = Signal()
36 36
 
37  
-class RegisterFields(Register):
  37
+class RegisterFields(_Register):
38 38
 	def __init__(self, name, fields):
39  
-		Register.__init__(self)
  39
+		_Register.__init__(self)
40 40
 		self.name = name
41 41
 		self.fields = fields
42 42
 
@@ -74,7 +74,7 @@ def get_memories(self):
74 74
 	def get_registers(self):
75 75
 		r = []
76 76
 		for k, v in self.__dict__.items():
77  
-			if isinstance(v, Register):
  77
+			if isinstance(v, _Register):
78 78
 				r.append(v)
79 79
 			elif hasattr(v, "get_registers") and callable(v.get_registers):
80 80
 				r += regprefix(k + "_", v.get_registers())
10  migen/bank/eventmanager.py
@@ -3,16 +3,16 @@
3 3
 from migen.bank.description import *
4 4
 from migen.genlib.misc import optree
5 5
 
6  
-class EventSource(HUID):
  6
+class _EventSource(HUID):
7 7
 	def __init__(self):
8 8
 		HUID.__init__(self)
9 9
 		self.trigger = Signal()
10 10
 		self.pending = Signal()
11 11
 
12  
-class EventSourcePulse(EventSource):
  12
+class EventSourcePulse(_EventSource):
13 13
 	pass
14 14
 
15  
-class EventSourceLevel(EventSource):
  15
+class EventSourceLevel(_EventSource):
16 16
 	pass
17 17
 
18 18
 class EventManager(Module, AutoReg):
@@ -20,7 +20,7 @@ def __init__(self):
20 20
 		self.irq = Signal()
21 21
 	
22 22
 	def do_finalize(self):
23  
-		sources_u = [v for v in self.__dict__.values() if isinstance(v, EventSource)]
  23
+		sources_u = [v for v in self.__dict__.values() if isinstance(v, _EventSource)]
24 24
 		sources = sorted(sources_u, key=lambda x: x.huid)
25 25
 		n = len(sources)
26 26
 		self.status = RegisterRaw("status", n)
@@ -60,6 +60,6 @@ def do_finalize(self):
60 60
 		self.comb += self.irq.eq(optree("|", irqs))
61 61
 
62 62
 	def __setattr__(self, name, value):
63  
-		if isinstance(value, EventSource) and self.finalized:
  63
+		if isinstance(value, _EventSource) and self.finalized:
64 64
 			raise FinalizeError
65 65
 		object.__setattr__(self, name, value)

0 notes on commit b042757

Please sign in to comment.
Something went wrong with that request. Please try again.