Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix instantiations

  • Loading branch information...
commit 053f8ed82ced5a14c29a500b3f8adeaa4497bdc0 1 parent 0392dd8
Sébastien Bourdeauducq authored December 06, 2012
26  milkymist/framebuffer/__init__.py
@@ -124,33 +124,35 @@ def __init__(self):
124 124
 	
125 125
 	def get_fragment(self):
126 126
 		data_width = 2+3*_bpc_dac
  127
+		fifo_full = Signal()
  128
+		fifo_write_en = Signal()
  129
+		fifo_data_out = Signal(data_width)
  130
+		fifo_data_in = Signal(data_width)
127 131
 		asfifo = Instance("asfifo",
128 132
 			Instance.Parameter("data_width", data_width),
129 133
 			Instance.Parameter("address_width", 8),
130 134
 	
131  
-			Instance.Output("data_out", data_width),
132  
-			Instance.Output("empty", 1),
  135
+			Instance.Output("data_out", fifo_data_out),
  136
+			Instance.Output("empty"),
133 137
 			Instance.Input("read_en", 1),
134 138
 			Instance.ClockPort("clk_read", "vga"),
135 139
 
136  
-			Instance.Input("data_in", data_width),
137  
-			Instance.Output("full", 1),
138  
-			Instance.Input("write_en", 1),
  140
+			Instance.Input("data_in", fifo_data_in),
  141
+			Instance.Output("full", fifo_full),
  142
+			Instance.Input("write_en", fifo_write_en),
139 143
 			Instance.ClockPort("clk_write"),
140 144
 			
141  
-			Instance.Input("rst", 1))
  145
+			Instance.Input("rst", 0))
142 146
 		t = self.token("dac")
143 147
 		return Fragment(
144 148
 			[
145  
-				asfifo.get_io("read_en").eq(1),
146 149
 				Cat(self.vga_hsync_n, self.vga_vsync_n, self.vga_r, self.vga_g, self.vga_b).eq(asfifo.get_io("data_out")),
147 150
 				
148  
-				self.endpoints["dac"].ack.eq(~asfifo.get_io("full")),
149  
-				asfifo.get_io("write_en").eq(self.endpoints["dac"].stb),
150  
-				asfifo.get_io("data_in").eq(Cat(~t.hsync, ~t.vsync, t.r, t.g, t.b)),
  151
+				self.endpoints["dac"].ack.eq(~fifo_full),
  152
+				fifo_write_en.eq(self.endpoints["dac"].stb),
  153
+				fifo_data_in.eq(Cat(~t.hsync, ~t.vsync, t.r, t.g, t.b)),
151 154
 				
152  
-				self.busy.eq(0),
153  
-				asfifo.get_io("rst").eq(0)
  155
+				self.busy.eq(0)
154 156
 			],
155 157
 			instances=[asfifo])
156 158
 
20  milkymist/lm32/__init__.py
@@ -7,6 +7,8 @@ def __init__(self):
7 7
 		self.dbus = d = wishbone.Interface()
8 8
 		self.interrupt = Signal(32)
9 9
 		self.ext_break = Signal()
  10
+		self._i_adr_o = Signal(32)
  11
+		self._d_adr_o = Signal(32)
10 12
 		self._inst = Instance("lm32_top",
11 13
 			Instance.ClockPort("clk_i"),
12 14
 			Instance.ResetPort("rst_i"),
@@ -14,39 +16,37 @@ def __init__(self):
14 16
 			Instance.Input("interrupt", self.interrupt),
15 17
 			#Instance.Input("ext_break", self.ext_break),
16 18
 		
17  
-			Instance.Output("I_ADR_O", 32),
  19
+			Instance.Output("I_ADR_O", self._i_adr_o),
18 20
 			Instance.Output("I_DAT_O", i.dat_w),
19 21
 			Instance.Output("I_SEL_O", i.sel),
20 22
 			Instance.Output("I_CYC_O", i.cyc),
21 23
 			Instance.Output("I_STB_O", i.stb),
22 24
 			Instance.Output("I_WE_O", i.we),
23 25
 			Instance.Output("I_CTI_O", i.cti),
24  
-			Instance.Output("I_LOCK_O", 1),
  26
+			Instance.Output("I_LOCK_O"),
25 27
 			Instance.Output("I_BTE_O", i.bte),
26 28
 			Instance.Input("I_DAT_I", i.dat_r),
27 29
 			Instance.Input("I_ACK_I", i.ack),
28 30
 			Instance.Input("I_ERR_I", i.err),
29  
-			Instance.Input("I_RTY_I", 1),
  31
+			Instance.Input("I_RTY_I", 0),
30 32
 			
31  
-			Instance.Output("D_ADR_O", 32),
  33
+			Instance.Output("D_ADR_O", self._d_adr_o),
32 34
 			Instance.Output("D_DAT_O", d.dat_w),
33 35
 			Instance.Output("D_SEL_O", d.sel),
34 36
 			Instance.Output("D_CYC_O", d.cyc),
35 37
 			Instance.Output("D_STB_O", d.stb),
36 38
 			Instance.Output("D_WE_O", d.we),
37 39
 			Instance.Output("D_CTI_O", d.cti),
38  
-			Instance.Output("D_LOCK_O", 1),
  40
+			Instance.Output("D_LOCK_O"),
39 41
 			Instance.Output("D_BTE_O", d.bte),
40 42
 			Instance.Input("D_DAT_I", d.dat_r),
41 43
 			Instance.Input("D_ACK_I", d.ack),
42 44
 			Instance.Input("D_ERR_I", d.err),
43  
-			Instance.Input("D_RTY_I", 1))
  45
+			Instance.Input("D_RTY_I", 0))
44 46
 
45 47
 	def get_fragment(self):
46 48
 		comb = [
47  
-			self._inst.get_io("I_RTY_I").eq(0),
48  
-			self._inst.get_io("D_RTY_I").eq(0),
49  
-			self.ibus.adr.eq(self._inst.get_io("I_ADR_O")[2:]),
50  
-			self.dbus.adr.eq(self._inst.get_io("D_ADR_O")[2:])
  49
+			self.ibus.adr.eq(self._i_adr_o[2:]),
  50
+			self.dbus.adr.eq(self._d_adr_o[2:])
51 51
 		]
52 52
 		return Fragment(comb=comb, instances=[self._inst])

0 notes on commit 053f8ed

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