Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bus/asmibus: fix slot aging timer

  • Loading branch information...
commit 0c52c08989d3bee4b78572efc69ac583bd0fa757 1 parent 1ec1fb9
@sbourdeauducq sbourdeauducq authored
Showing with 8 additions and 7 deletions.
  1. +8 −7 migen/bus/asmibus.py
View
15 migen/bus/asmibus.py
@@ -9,10 +9,11 @@
class Slot(Module):
def __init__(self, aw, time):
+ self.time = time
self.state = Signal(2)
self.we = Signal()
self.adr = Signal(aw)
- if time:
+ if self.time:
self.mature = Signal()
self.allocate = Signal()
@@ -32,14 +33,14 @@ def __init__(self, aw, time):
If(self.process, self.state.eq(SLOT_PROCESSING)),
If(self.call, self.state.eq(SLOT_EMPTY))
]
- if time:
- _counter = Signal(max=time+1)
- self.comb += self.mature.eq(self._counter == 0)
+ if self.time:
+ counter = Signal(max=self.time+1)
+ self.comb += self.mature.eq(counter == 0)
self.sync += [
If(self.allocate,
- self._counter.eq(self.time)
- ).Elif(self._counter != 0,
- self._counter.eq(self._counter - 1)
+ counter.eq(self.time)
+ ).Elif(counter != 0,
+ counter.eq(counter - 1)
)
]
Please sign in to comment.
Something went wrong with that request. Please try again.