Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
dvisampler/dma: bugfixes
  • Loading branch information
Sebastien Bourdeauducq committed May 8, 2013
1 parent 66b4bae commit d685ed2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions milkymist/dvisampler/dma.py
Expand Up @@ -107,7 +107,8 @@ def __init__(self, asmiport, nslots):
pack_counter = Signal(max=pack_factor)
self.comb += last_pixel.eq(pack_counter == (pack_factor - 1))
self.sync += If(write_pixel,
[If(pack_counter == i, cur_memory_word[32*i:32*(i+1)].eq(encoded_pixel)) for i in range(pack_factor)],
[If(pack_counter == (pack_factor-i-1),
cur_memory_word[32*i:32*(i+1)].eq(encoded_pixel)) for i in range(pack_factor)],
pack_counter.eq(pack_counter + 1)
)

Expand All @@ -123,11 +124,9 @@ def __init__(self, asmiport, nslots):
self.submodules += fsm

fsm.act(fsm.WAIT_SOF,
self.frame.ack.eq(~sof),
reset_words.eq(1),
If(self._slot_array.address_valid,
If(self.frame.stb & sof, fsm.next_state(fsm.TRANSFER_PIXEL))
)
self.frame.ack.eq(~self._slot_array.address_valid | ~sof),
If(self._slot_array.address_valid & sof & self.frame.stb, fsm.next_state(fsm.TRANSFER_PIXEL))
)
fsm.act(fsm.TRANSFER_PIXEL,
self.frame.ack.eq(1),
Expand Down

0 comments on commit d685ed2

Please sign in to comment.