Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

bus/asmibus: fix slot aging timer

  • Loading branch information...
commit 0c52c08989d3bee4b78572efc69ac583bd0fa757 1 parent 1ec1fb9
Sébastien Bourdeauducq authored June 14, 2013

Showing 1 changed file with 8 additions and 7 deletions. Show diff stats Hide diff stats

  1. 15  migen/bus/asmibus.py
15  migen/bus/asmibus.py
@@ -9,10 +9,11 @@
9 9
 
10 10
 class Slot(Module):
11 11
 	def __init__(self, aw, time):
  12
+		self.time = time
12 13
 		self.state = Signal(2)
13 14
 		self.we = Signal()
14 15
 		self.adr = Signal(aw)
15  
-		if time:
  16
+		if self.time:
16 17
 			self.mature = Signal()
17 18
 		
18 19
 		self.allocate = Signal()
@@ -32,14 +33,14 @@ def __init__(self, aw, time):
32 33
 			If(self.process, self.state.eq(SLOT_PROCESSING)),
33 34
 			If(self.call, self.state.eq(SLOT_EMPTY))
34 35
 		]
35  
-		if time:
36  
-			_counter = Signal(max=time+1)
37  
-			self.comb += self.mature.eq(self._counter == 0)
  36
+		if self.time:
  37
+			counter = Signal(max=self.time+1)
  38
+			self.comb += self.mature.eq(counter == 0)
38 39
 			self.sync += [
39 40
 				If(self.allocate,
40  
-					self._counter.eq(self.time)
41  
-				).Elif(self._counter != 0,
42  
-					self._counter.eq(self._counter - 1)
  41
+					counter.eq(self.time)
  42
+				).Elif(counter != 0,
  43
+					counter.eq(counter - 1)
43 44
 				)
44 45
 			]
45 46
 

0 notes on commit 0c52c08

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