Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

framebuffer: work around dysfunctional Xst retiming

  • Loading branch information...
commit fd7c2ba0bf1426b2bafa1987faa2f9db0aa4bbd9 1 parent 6f2c05d
Sébastien Bourdeauducq authored June 13, 2013

Showing 1 changed file with 7 additions and 3 deletions. Show diff stats Hide diff stats

  1. 10  milkymist/framebuffer/__init__.py
10  milkymist/framebuffer/__init__.py
@@ -53,7 +53,8 @@ def get_csrs(self):
53 53
 
54 54
 class Blender(PipelinedActor, AutoCSR):
55 55
 	def __init__(self, nimages, latency):
56  
-		self.sink = Sink([("i"+str(i), pixel_layout) for i in range(nimages)])
  56
+		sink_layout = [("i"+str(i), pixel_layout) for i in range(nimages)]
  57
+		self.sink = Sink(sink_layout)
57 58
 		self.source = Source(pixel_layout)
58 59
 		factors = []
59 60
 		for i in range(nimages):
@@ -65,7 +66,10 @@ def __init__(self, nimages, latency):
65 66
 
66 67
 		###
67 68
 
68  
-		imgs = [getattr(self.sink.payload, "i"+str(i)) for i in range(nimages)]
  69
+		sink_registered = Record(sink_layout)
  70
+		self.sync += If(self.pipe_ce, sink_registered.eq(self.sink.payload))
  71
+
  72
+		imgs = [getattr(sink_registered, "i"+str(i)) for i in range(nimages)]
69 73
 		outval = Record(pixel_layout)
70 74
 		for e in pixel_layout:
71 75
 			name = e[0]
@@ -85,7 +89,7 @@ def __init__(self, nimages, latency):
85 89
 				]
86 90
 
87 91
 		pipe_stmts = []
88  
-		for i in range(latency):
  92
+		for i in range(latency-1):
89 93
 			new_outval = Record(pixel_layout)
90 94
 			pipe_stmts.append(new_outval.eq(outval))
91 95
 			outval = new_outval

0 notes on commit fd7c2ba

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