def __init__(self, addr_bits, alignment_bits):
self.ev_source = EventSourceLevel()
self.address = Signal(addr_bits)
+ self.address_reached = Signal(addr_bits)
self.address_valid = Signal()
self.address_done = Signal()
self._r_status = CSRStorage(2, write_from_dev=True)
- self._r_address = CSRStorage(addr_bits + alignment_bits, alignment_bits=alignment_bits)
+ self._r_address = CSRStorage(addr_bits + alignment_bits, alignment_bits=alignment_bits, write_from_dev=True)
###
self.address_valid.eq(self._r_status.storage[0]),
self._r_status.dat_w.eq(2),
self._r_status.we.eq(self.address_done),
+ self._r_address.dat_w.eq(self.address_reached),
+ self._r_address.we.eq(self.address_done),
self.ev_source.trigger.eq(self._r_status.storage[1])
]
def __init__(self, nslots, addr_bits, alignment_bits):
self.submodules.ev = EventManager()
self.address = Signal(addr_bits)
+ self.address_reached = Signal(addr_bits)
self.address_valid = Signal()
self.address_done = Signal()
self.address.eq(Array(slot.address for slot in slots)[current_slot]),
self.address_valid.eq(Array(slot.address_valid for slot in slots)[current_slot])
]
+ self.comb += [slot.address_reached.eq(self.address_reached) for slot in slots]
self.comb += [slot.address_done.eq(self.address_done & (current_slot == n)) for n, slot in enumerate(slots)]
class DMA(Module):
last_word = Signal()
current_address = Signal(bus_aw)
mwords_remaining = Signal(bus_aw)
- self.comb += last_word.eq(mwords_remaining == 1)
+ self.comb += [
+ self._slot_array.address_reached.eq(current_address),
+ last_word.eq(mwords_remaining == 1)
+ ]
self.sync += [
If(reset_words,
current_address.eq(self._slot_array.address),