Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

dvisampler/dma: bugfixes

  • Loading branch information...
commit d685ed21fc456b83180e2435fb0ae9696d553f03 1 parent 66b4bae
Sébastien Bourdeauducq authored May 08, 2013

Showing 1 changed file with 4 additions and 5 deletions. Show diff stats Hide diff stats

  1. 9  milkymist/dvisampler/dma.py
9  milkymist/dvisampler/dma.py
@@ -107,7 +107,8 @@ def __init__(self, asmiport, nslots):
107 107
 		pack_counter = Signal(max=pack_factor)
108 108
 		self.comb += last_pixel.eq(pack_counter == (pack_factor - 1))
109 109
 		self.sync += If(write_pixel,
110  
-				[If(pack_counter == i, cur_memory_word[32*i:32*(i+1)].eq(encoded_pixel)) for i in range(pack_factor)],
  110
+				[If(pack_counter == (pack_factor-i-1),
  111
+					cur_memory_word[32*i:32*(i+1)].eq(encoded_pixel)) for i in range(pack_factor)],
111 112
 				pack_counter.eq(pack_counter + 1)
112 113
 			)
113 114
 
@@ -123,11 +124,9 @@ def __init__(self, asmiport, nslots):
123 124
 		self.submodules += fsm
124 125
 
125 126
 		fsm.act(fsm.WAIT_SOF,
126  
-			self.frame.ack.eq(~sof),
127 127
 			reset_words.eq(1),
128  
-			If(self._slot_array.address_valid,
129  
-				If(self.frame.stb & sof, fsm.next_state(fsm.TRANSFER_PIXEL))
130  
-			)
  128
+			self.frame.ack.eq(~self._slot_array.address_valid | ~sof),
  129
+			If(self._slot_array.address_valid & sof & self.frame.stb, fsm.next_state(fsm.TRANSFER_PIXEL))
131 130
 		)
132 131
 		fsm.act(fsm.TRANSFER_PIXEL,
133 132
 			self.frame.ack.eq(1),

0 notes on commit d685ed2

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