Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

framebuffer: use ASMI reader factory

  • Loading branch information...
commit 58d1e8a541fd0dee8bc3c435339fa3758ae2f1b8 1 parent 73a5897
Sébastien Bourdeauducq authored July 12, 2012

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

  1. 25  milkymist/framebuffer/__init__.py
25  milkymist/framebuffer/__init__.py
@@ -207,24 +207,6 @@ def sim_fifo_gen():
207 207
 		print("H/V:" + str(t.value["hsync"]) + str(t.value["vsync"])
208 208
 			+ " " + str(t.value["r"]) + " " + str(t.value["g"]) + " " + str(t.value["b"]))
209 209
 
210  
-class FakeDMA(Actor):
211  
-	def __init__(self, port):
212  
-		self.port = port
213  
-		super().__init__(
214  
-				("address", Sink, [("a", BV(self.port.hub.aw))]),
215  
-				("data", Source, [("d", BV(self.port.hub.dw))]))
216  
-	
217  
-	def get_fragment(self):
218  
-		pixel = Signal(BV(32))
219  
-		comb = [
220  
-			self.endpoints["address"].ack.eq(1),
221  
-			self.endpoints["data"].stb.eq(1),
222  
-			self.token("data").d.eq(Replicate(pixel, 4))
223  
-		]
224  
-		sync = [
225  
-			If(self.endpoints["data"].ack, pixel.eq(pixel + 1))
226  
-		]
227  
-		return Fragment(comb, sync)
228 210
 
229 211
 class Framebuffer:
230 212
 	def __init__(self, address, asmiport, simulation=False):
@@ -237,8 +219,8 @@ def __init__(self, address, asmiport, simulation=False):
237 219
 		fi = ActorNode(_FrameInitiator(asmi_bits, length_bits, alignment_bits))
238 220
 		adrloop = ActorNode(misc.IntSequence(length_bits, asmi_bits))
239 221
 		adrbuffer = ActorNode(plumbing.Buffer)
240  
-		#dma = ActorNode(dma_asmi.SequentialReader(asmiport))
241  
-		dma = ActorNode(FakeDMA(asmiport))
  222
+		dma = ActorNode(dma_asmi.Reader(asmiport))
  223
+		datbuffer = ActorNode(plumbing.Buffer)
242 224
 		cast = ActorNode(structuring.Cast(asmiport.hub.dw, packed_pixels))
243 225
 		unpack = ActorNode(structuring.Unpack(pack_factor, _pixel_layout))
244 226
 		vtg = ActorNode(VTG())
@@ -251,7 +233,8 @@ def __init__(self, address, asmiport, simulation=False):
251 233
 		g.add_connection(fi, adrloop, source_subr=["length", "base"])
252 234
 		g.add_connection(adrloop, adrbuffer)
253 235
 		g.add_connection(adrbuffer, dma)
254  
-		g.add_connection(dma, cast)
  236
+		g.add_connection(dma, datbuffer)
  237
+		g.add_connection(datbuffer, cast)
255 238
 		g.add_connection(cast, unpack)
256 239
 		g.add_connection(unpack, vtg, sink_ep="pixels")
257 240
 		g.add_connection(fi, vtg, sink_ep="timing", source_subr=[

0 notes on commit 58d1e8a

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