1 |
408 |
julius |
//////////////////////////////////////////////////////////////////////
|
2 |
|
|
/// ////
|
3 |
|
|
/// ORPSoC top for ordb1 board ////
|
4 |
|
|
/// ////
|
5 |
|
|
/// Instantiates modules, depending on ORPSoC defines file ////
|
6 |
|
|
/// ////
|
7 |
|
|
/// Julius Baxter, julius@opencores.org ////
|
8 |
|
|
/// ////
|
9 |
|
|
//////////////////////////////////////////////////////////////////////
|
10 |
|
|
//// ////
|
11 |
|
|
//// Copyright (C) 2009, 2010 Authors and OPENCORES.ORG ////
|
12 |
|
|
//// ////
|
13 |
|
|
//// This source file may be used and distributed without ////
|
14 |
|
|
//// restriction provided that this copyright statement is not ////
|
15 |
|
|
//// removed from the file and that any derivative work contains ////
|
16 |
|
|
//// the original copyright notice and the associated disclaimer. ////
|
17 |
|
|
//// ////
|
18 |
|
|
//// This source file is free software; you can redistribute it ////
|
19 |
|
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
20 |
|
|
//// Public License as published by the Free Software Foundation; ////
|
21 |
|
|
//// either version 2.1 of the License, or (at your option) any ////
|
22 |
|
|
//// later version. ////
|
23 |
|
|
//// ////
|
24 |
|
|
//// This source is distributed in the hope that it will be ////
|
25 |
|
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
26 |
|
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
27 |
|
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
28 |
|
|
//// details. ////
|
29 |
|
|
//// ////
|
30 |
|
|
//// You should have received a copy of the GNU Lesser General ////
|
31 |
|
|
//// Public License along with this source; if not, download it ////
|
32 |
|
|
//// from http://www.opencores.org/lgpl.shtml ////
|
33 |
|
|
//// ////
|
34 |
|
|
//////////////////////////////////////////////////////////////////////
|
35 |
|
|
|
36 |
|
|
`include "orpsoc-defines.v"
|
37 |
|
|
`include "synthesis-defines.v"
|
38 |
|
|
module orpsoc_top
|
39 |
|
|
(
|
40 |
|
|
`ifdef JTAG_DEBUG
|
41 |
|
|
tdo_pad_o, tms_pad_i, tck_pad_i, tdi_pad_i,
|
42 |
|
|
`endif
|
43 |
|
|
`ifdef VERSATILE_SDRAM
|
44 |
|
|
sdram_ba_pad_o,sdram_a_pad_o,sdram_cs_n_pad_o, sdram_ras_pad_o,
|
45 |
|
|
sdram_cas_pad_o, sdram_we_pad_o, sdram_dq_pad_io, sdram_dqm_pad_o,
|
46 |
|
|
sdram_cke_pad_o,
|
47 |
|
|
`endif
|
48 |
|
|
`ifdef UART0
|
49 |
|
|
uart0_srx_pad_i, uart0_stx_pad_o,
|
50 |
|
|
`endif
|
51 |
|
|
`ifdef SPI0
|
52 |
|
|
spi0_sck_o, spi0_mosi_o, spi0_miso_i, spi0_hold_n_o, spi0_w_n_o,
|
53 |
|
|
`ifdef SPI0_SLAVE_SELECTS
|
54 |
|
|
spi0_ss_o,
|
55 |
|
|
`endif
|
56 |
|
|
`endif
|
57 |
|
|
`ifdef SPI1
|
58 |
|
|
spi1_sck_o, spi1_mosi_o, spi1_miso_i,
|
59 |
|
|
`ifdef SPI1_SLAVE_SELECTS
|
60 |
|
|
spi1_ss_o,
|
61 |
|
|
`endif
|
62 |
|
|
`endif
|
63 |
|
|
`ifdef SPI2
|
64 |
|
|
spi2_sck_o, spi2_mosi_o, spi2_miso_i,
|
65 |
|
|
`ifdef SPI2_SLAVE_SELECTS
|
66 |
|
|
spi2_ss_o,
|
67 |
|
|
`endif
|
68 |
|
|
`endif
|
69 |
|
|
`ifdef I2C0
|
70 |
|
|
i2c0_sda_io, i2c0_scl_io,
|
71 |
|
|
`endif
|
72 |
|
|
`ifdef I2C1
|
73 |
|
|
i2c1_sda_io, i2c1_scl_io,
|
74 |
|
|
`endif
|
75 |
|
|
`ifdef I2C2
|
76 |
|
|
i2c2_sda_io, i2c2_scl_io,
|
77 |
|
|
`endif
|
78 |
|
|
`ifdef I2C3
|
79 |
|
|
i2c3_sda_io, i2c3_scl_io,
|
80 |
|
|
`endif
|
81 |
|
|
`ifdef USB0
|
82 |
|
|
usb0dat_pad_i, usb0dat_pad_o, usb0ctrl_pad_o, usb0fullspeed_pad_o,
|
83 |
|
|
`endif
|
84 |
|
|
`ifdef USB1
|
85 |
|
|
usb1dat_pad_i, usb1dat_pad_o, usb1ctrl_pad_o, usb1fullspeed_pad_o,
|
86 |
|
|
`endif
|
87 |
|
|
`ifdef GPIO0
|
88 |
|
|
gpio0_io,
|
89 |
|
|
`endif
|
90 |
|
|
|
91 |
|
|
`ifdef ETH0
|
92 |
|
|
`ifdef SMII0
|
93 |
|
|
eth0_smii_sync_pad_o, eth0_smii_tx_pad_o, eth0_smii_rx_pad_i,
|
94 |
|
|
`else
|
95 |
|
|
eth0_tx_clk, eth0_tx_data, eth0_tx_en, eth0_tx_er,
|
96 |
|
|
eth0_rx_clk, eth0_rx_data, eth0_dv, eth0_rx_er,
|
97 |
|
|
eth0_col, eth0_crs,
|
98 |
|
|
`endif
|
99 |
|
|
eth0_mdc_pad_o, eth0_md_pad_io,
|
100 |
|
|
`endif // `ifdef ETH0
|
101 |
|
|
`ifdef ETH0_PHY_RST
|
102 |
|
|
eth0_rst_n_o,
|
103 |
|
|
`endif
|
104 |
|
|
`ifdef ETH_CLK
|
105 |
|
|
eth_clk_pad_i,
|
106 |
|
|
`endif
|
107 |
|
|
|
108 |
|
|
sys_clk_pad_i,
|
109 |
|
|
|
110 |
|
|
rst_n_pad_i
|
111 |
|
|
|
112 |
|
|
) /* synthesis syn_global_buffers = 8; syn_hier = "flatten" */;
|
113 |
|
|
|
114 |
|
|
`include "orpsoc-params.v"
|
115 |
|
|
|
116 |
|
|
input sys_clk_pad_i;
|
117 |
|
|
|
118 |
|
|
input rst_n_pad_i;
|
119 |
|
|
|
120 |
|
|
`ifdef JTAG_DEBUG
|
121 |
|
|
output tdo_pad_o;
|
122 |
|
|
input tms_pad_i;
|
123 |
|
|
input tck_pad_i;
|
124 |
|
|
input tdi_pad_i;
|
125 |
|
|
`endif
|
126 |
|
|
`ifdef VERSATILE_SDRAM
|
127 |
|
|
output [1:0] sdram_ba_pad_o;
|
128 |
|
|
output [12:0] sdram_a_pad_o;
|
129 |
|
|
output sdram_cs_n_pad_o;
|
130 |
|
|
output sdram_ras_pad_o;
|
131 |
|
|
output sdram_cas_pad_o;
|
132 |
|
|
output sdram_we_pad_o;
|
133 |
|
|
inout [15:0] sdram_dq_pad_io;
|
134 |
|
|
output [1:0] sdram_dqm_pad_o;
|
135 |
|
|
output sdram_cke_pad_o;
|
136 |
|
|
`endif
|
137 |
|
|
`ifdef UART0
|
138 |
|
|
input uart0_srx_pad_i;
|
139 |
|
|
output uart0_stx_pad_o;
|
140 |
|
|
`endif
|
141 |
|
|
`ifdef SPI0
|
142 |
|
|
output spi0_sck_o;
|
143 |
|
|
output spi0_mosi_o;
|
144 |
|
|
`ifdef SPI0_SLAVE_SELECTS
|
145 |
|
|
output [spi0_ss_width-1:0] spi0_ss_o;
|
146 |
|
|
`endif
|
147 |
|
|
output spi0_hold_n_o;
|
148 |
|
|
output spi0_w_n_o;
|
149 |
|
|
input spi0_miso_i;
|
150 |
|
|
`endif
|
151 |
|
|
`ifdef SPI1
|
152 |
|
|
output spi1_sck_o;
|
153 |
|
|
output spi1_mosi_o;
|
154 |
|
|
`ifdef SPI1_SLAVE_SELECTS
|
155 |
|
|
output [spi1_ss_width-1:0] spi1_ss_o;
|
156 |
|
|
`endif
|
157 |
|
|
input spi1_miso_i;
|
158 |
|
|
`endif
|
159 |
|
|
`ifdef SPI2
|
160 |
|
|
output spi2_sck_o;
|
161 |
|
|
output spi2_mosi_o;
|
162 |
|
|
`ifdef SPI2_SLAVE_SELECTS
|
163 |
|
|
output [spi2_ss_width-1:0] spi2_ss_o;
|
164 |
|
|
`endif
|
165 |
|
|
input spi2_miso_i;
|
166 |
|
|
`endif
|
167 |
|
|
`ifdef I2C0
|
168 |
|
|
inout i2c0_sda_io, i2c0_scl_io;
|
169 |
|
|
`endif
|
170 |
|
|
`ifdef I2C1
|
171 |
|
|
inout i2c1_sda_io, i2c1_scl_io;
|
172 |
|
|
`endif
|
173 |
|
|
`ifdef I2C2
|
174 |
|
|
inout i2c2_sda_io, i2c2_scl_io;
|
175 |
|
|
`endif
|
176 |
|
|
`ifdef I2C3
|
177 |
|
|
inout i2c3_sda_io, i2c3_scl_io;
|
178 |
|
|
`endif
|
179 |
|
|
`ifdef USB0
|
180 |
|
|
input [1:0] usb0dat_pad_i;
|
181 |
|
|
// input usb0vbusdetect;
|
182 |
|
|
output [1:0] usb0dat_pad_o;
|
183 |
|
|
output usb0ctrl_pad_o;
|
184 |
|
|
output usb0fullspeed_pad_o;
|
185 |
|
|
`endif
|
186 |
|
|
`ifdef USB1
|
187 |
|
|
input [1:0] usb1dat_pad_i;
|
188 |
|
|
// input usb1vbusdetect;
|
189 |
|
|
output [1:0] usb1dat_pad_o;
|
190 |
|
|
output usb1ctrl_pad_o;
|
191 |
|
|
output usb1fullspeed_pad_o;
|
192 |
|
|
`endif
|
193 |
|
|
`ifdef GPIO0
|
194 |
|
|
inout [gpio0_io_width-1:0] gpio0_io;
|
195 |
|
|
`endif
|
196 |
|
|
`ifdef ETH0
|
197 |
|
|
`ifdef SMII0
|
198 |
|
|
output eth0_smii_sync_pad_o, eth0_smii_tx_pad_o;
|
199 |
|
|
input eth0_smii_rx_pad_i;
|
200 |
|
|
`else
|
201 |
|
|
input eth0_tx_clk;
|
202 |
|
|
output [3:0] eth0_tx_data;
|
203 |
|
|
output eth0_tx_en;
|
204 |
|
|
output eth0_tx_er;
|
205 |
|
|
input eth0_rx_clk;
|
206 |
|
|
input [3:0] eth0_rx_data;
|
207 |
|
|
input eth0_dv;
|
208 |
|
|
input eth0_rx_er;
|
209 |
|
|
input eth0_col;
|
210 |
|
|
input eth0_crs;
|
211 |
|
|
`endif // !`ifdef SMII0
|
212 |
|
|
output eth0_mdc_pad_o;
|
213 |
|
|
inout eth0_md_pad_io;
|
214 |
|
|
`endif // `ifdef ETH0
|
215 |
|
|
`ifdef ETH_CLK
|
216 |
|
|
input eth_clk_pad_i;
|
217 |
|
|
`endif
|
218 |
|
|
|
219 |
|
|
////////////////////////////////////////////////////////////////////////
|
220 |
|
|
//
|
221 |
|
|
// Clock and reset generation module
|
222 |
|
|
//
|
223 |
|
|
////////////////////////////////////////////////////////////////////////
|
224 |
|
|
|
225 |
|
|
//
|
226 |
|
|
// Wires
|
227 |
|
|
//
|
228 |
|
|
wire wb_clk, wb_rst;
|
229 |
|
|
wire sdram_clk, sdram_rst;
|
230 |
|
|
wire ddr2_if_clk, ddr2_if_rst;
|
231 |
|
|
wire clk200;
|
232 |
|
|
wire usb_clk;
|
233 |
|
|
wire spw_clk;
|
234 |
|
|
wire eth_smii_clk, eth_smii_rst;
|
235 |
|
|
wire dbg_tck;
|
236 |
|
|
|
237 |
|
|
|
238 |
|
|
clkgen clkgen0
|
239 |
|
|
(
|
240 |
|
|
.sys_clk_pad_i (sys_clk_pad_i),
|
241 |
|
|
|
242 |
|
|
.wb_clk_o (wb_clk),
|
243 |
|
|
.wb_rst_o (wb_rst),
|
244 |
|
|
|
245 |
|
|
`ifdef JTAG_DEBUG
|
246 |
|
|
.tck_pad_i (tck_pad_i),
|
247 |
|
|
.dbg_tck_o (dbg_tck),
|
248 |
|
|
`endif
|
249 |
|
|
`ifdef VERSATILE_SDRAM
|
250 |
|
|
.sdram_clk_o (sdram_clk),
|
251 |
|
|
.sdram_rst_o (sdram_rst),
|
252 |
|
|
`endif
|
253 |
|
|
`ifdef ETH_CLK
|
254 |
|
|
.eth_clk_pad_i (eth_clk_pad_i),
|
255 |
|
|
.eth_clk_o (eth_smii_clk),
|
256 |
|
|
.eth_rst_o (eth_smii_rst),
|
257 |
|
|
`endif
|
258 |
|
|
`ifdef USB_CLK
|
259 |
|
|
.usb_clk_o (usb_clk),
|
260 |
|
|
`endif
|
261 |
|
|
|
262 |
|
|
// Asynchronous active low reset
|
263 |
|
|
.rst_n_pad_i (rst_n_pad_i)
|
264 |
|
|
);
|
265 |
|
|
|
266 |
|
|
|
267 |
|
|
////////////////////////////////////////////////////////////////////////
|
268 |
|
|
//
|
269 |
|
|
// Arbiter
|
270 |
|
|
//
|
271 |
|
|
////////////////////////////////////////////////////////////////////////
|
272 |
|
|
|
273 |
|
|
// Wire naming convention:
|
274 |
|
|
// First: wishbone master or slave (wbm/wbs)
|
275 |
|
|
// Second: Which bus it's on instruction or data (i/d)
|
276 |
|
|
// Third: Between which module and the arbiter the wires are
|
277 |
|
|
// Fourth: Signal name
|
278 |
|
|
// Fifth: Direction relative to module (not bus/arbiter!)
|
279 |
|
|
// ie. wbm_d_or12_adr_o is address OUT from the or1200
|
280 |
|
|
|
281 |
|
|
// OR1200 instruction bus wires
|
282 |
|
|
wire [wb_aw-1:0] wbm_i_or12_adr_o;
|
283 |
|
|
wire [wb_dw-1:0] wbm_i_or12_dat_o;
|
284 |
|
|
wire [3:0] wbm_i_or12_sel_o;
|
285 |
|
|
wire wbm_i_or12_we_o;
|
286 |
|
|
wire wbm_i_or12_cyc_o;
|
287 |
|
|
wire wbm_i_or12_stb_o;
|
288 |
|
|
wire [2:0] wbm_i_or12_cti_o;
|
289 |
|
|
wire [1:0] wbm_i_or12_bte_o;
|
290 |
|
|
|
291 |
|
|
wire [wb_dw-1:0] wbm_i_or12_dat_i;
|
292 |
|
|
wire wbm_i_or12_ack_i;
|
293 |
|
|
wire wbm_i_or12_err_i;
|
294 |
|
|
wire wbm_i_or12_rty_i;
|
295 |
|
|
|
296 |
|
|
// OR1200 data bus wires
|
297 |
|
|
wire [wb_aw-1:0] wbm_d_or12_adr_o;
|
298 |
|
|
wire [wb_dw-1:0] wbm_d_or12_dat_o;
|
299 |
|
|
wire [3:0] wbm_d_or12_sel_o;
|
300 |
|
|
wire wbm_d_or12_we_o;
|
301 |
|
|
wire wbm_d_or12_cyc_o;
|
302 |
|
|
wire wbm_d_or12_stb_o;
|
303 |
|
|
wire [2:0] wbm_d_or12_cti_o;
|
304 |
|
|
wire [1:0] wbm_d_or12_bte_o;
|
305 |
|
|
|
306 |
|
|
wire [wb_dw-1:0] wbm_d_or12_dat_i;
|
307 |
|
|
wire wbm_d_or12_ack_i;
|
308 |
|
|
wire wbm_d_or12_err_i;
|
309 |
|
|
wire wbm_d_or12_rty_i;
|
310 |
|
|
|
311 |
|
|
// Debug interface bus wires
|
312 |
|
|
wire [wb_aw-1:0] wbm_d_dbg_adr_o;
|
313 |
|
|
wire [wb_dw-1:0] wbm_d_dbg_dat_o;
|
314 |
|
|
wire [3:0] wbm_d_dbg_sel_o;
|
315 |
|
|
wire wbm_d_dbg_we_o;
|
316 |
|
|
wire wbm_d_dbg_cyc_o;
|
317 |
|
|
wire wbm_d_dbg_stb_o;
|
318 |
|
|
wire [2:0] wbm_d_dbg_cti_o;
|
319 |
|
|
wire [1:0] wbm_d_dbg_bte_o;
|
320 |
|
|
|
321 |
|
|
wire [wb_dw-1:0] wbm_d_dbg_dat_i;
|
322 |
|
|
wire wbm_d_dbg_ack_i;
|
323 |
|
|
wire wbm_d_dbg_err_i;
|
324 |
|
|
wire wbm_d_dbg_rty_i;
|
325 |
|
|
|
326 |
|
|
// Byte bus bridge master signals
|
327 |
|
|
wire [wb_aw-1:0] wbm_b_d_adr_o;
|
328 |
|
|
wire [wb_dw-1:0] wbm_b_d_dat_o;
|
329 |
|
|
wire [3:0] wbm_b_d_sel_o;
|
330 |
|
|
wire wbm_b_d_we_o;
|
331 |
|
|
wire wbm_b_d_cyc_o;
|
332 |
|
|
wire wbm_b_d_stb_o;
|
333 |
|
|
wire [2:0] wbm_b_d_cti_o;
|
334 |
|
|
wire [1:0] wbm_b_d_bte_o;
|
335 |
|
|
|
336 |
|
|
wire [wb_dw-1:0] wbm_b_d_dat_i;
|
337 |
|
|
wire wbm_b_d_ack_i;
|
338 |
|
|
wire wbm_b_d_err_i;
|
339 |
|
|
wire wbm_b_d_rty_i;
|
340 |
|
|
|
341 |
|
|
// Instruction bus slave wires //
|
342 |
|
|
|
343 |
|
|
// rom0 instruction bus wires
|
344 |
|
|
wire [31:0] wbs_i_rom0_adr_i;
|
345 |
|
|
wire [wbs_i_rom0_data_width-1:0] wbs_i_rom0_dat_i;
|
346 |
|
|
wire [3:0] wbs_i_rom0_sel_i;
|
347 |
|
|
wire wbs_i_rom0_we_i;
|
348 |
|
|
wire wbs_i_rom0_cyc_i;
|
349 |
|
|
wire wbs_i_rom0_stb_i;
|
350 |
|
|
wire [2:0] wbs_i_rom0_cti_i;
|
351 |
|
|
wire [1:0] wbs_i_rom0_bte_i;
|
352 |
|
|
wire [wbs_i_rom0_data_width-1:0] wbs_i_rom0_dat_o;
|
353 |
|
|
wire wbs_i_rom0_ack_o;
|
354 |
|
|
wire wbs_i_rom0_err_o;
|
355 |
|
|
wire wbs_i_rom0_rty_o;
|
356 |
|
|
|
357 |
|
|
// mc0 instruction bus wires
|
358 |
|
|
wire [31:0] wbs_i_mc0_adr_i;
|
359 |
|
|
wire [wbs_i_mc0_data_width-1:0] wbs_i_mc0_dat_i;
|
360 |
|
|
wire [3:0] wbs_i_mc0_sel_i;
|
361 |
|
|
wire wbs_i_mc0_we_i;
|
362 |
|
|
wire wbs_i_mc0_cyc_i;
|
363 |
|
|
wire wbs_i_mc0_stb_i;
|
364 |
|
|
wire [2:0] wbs_i_mc0_cti_i;
|
365 |
|
|
wire [1:0] wbs_i_mc0_bte_i;
|
366 |
|
|
wire [wbs_i_mc0_data_width-1:0] wbs_i_mc0_dat_o;
|
367 |
|
|
wire wbs_i_mc0_ack_o;
|
368 |
|
|
wire wbs_i_mc0_err_o;
|
369 |
|
|
wire wbs_i_mc0_rty_o;
|
370 |
|
|
|
371 |
|
|
// Data bus slave wires //
|
372 |
|
|
|
373 |
|
|
// mc0 data bus wires
|
374 |
|
|
wire [31:0] wbs_d_mc0_adr_i;
|
375 |
|
|
wire [wbs_d_mc0_data_width-1:0] wbs_d_mc0_dat_i;
|
376 |
|
|
wire [3:0] wbs_d_mc0_sel_i;
|
377 |
|
|
wire wbs_d_mc0_we_i;
|
378 |
|
|
wire wbs_d_mc0_cyc_i;
|
379 |
|
|
wire wbs_d_mc0_stb_i;
|
380 |
|
|
wire [2:0] wbs_d_mc0_cti_i;
|
381 |
|
|
wire [1:0] wbs_d_mc0_bte_i;
|
382 |
|
|
wire [wbs_d_mc0_data_width-1:0] wbs_d_mc0_dat_o;
|
383 |
|
|
wire wbs_d_mc0_ack_o;
|
384 |
|
|
wire wbs_d_mc0_err_o;
|
385 |
|
|
wire wbs_d_mc0_rty_o;
|
386 |
|
|
|
387 |
|
|
// i2c0 wires
|
388 |
|
|
wire [31:0] wbs_d_i2c0_adr_i;
|
389 |
|
|
wire [wbs_d_i2c0_data_width-1:0] wbs_d_i2c0_dat_i;
|
390 |
|
|
wire [3:0] wbs_d_i2c0_sel_i;
|
391 |
|
|
wire wbs_d_i2c0_we_i;
|
392 |
|
|
wire wbs_d_i2c0_cyc_i;
|
393 |
|
|
wire wbs_d_i2c0_stb_i;
|
394 |
|
|
wire [2:0] wbs_d_i2c0_cti_i;
|
395 |
|
|
wire [1:0] wbs_d_i2c0_bte_i;
|
396 |
|
|
wire [wbs_d_i2c0_data_width-1:0] wbs_d_i2c0_dat_o;
|
397 |
|
|
wire wbs_d_i2c0_ack_o;
|
398 |
|
|
wire wbs_d_i2c0_err_o;
|
399 |
|
|
wire wbs_d_i2c0_rty_o;
|
400 |
|
|
|
401 |
|
|
// i2c1 wires
|
402 |
|
|
wire [31:0] wbs_d_i2c1_adr_i;
|
403 |
|
|
wire [wbs_d_i2c1_data_width-1:0] wbs_d_i2c1_dat_i;
|
404 |
|
|
wire [3:0] wbs_d_i2c1_sel_i;
|
405 |
|
|
wire wbs_d_i2c1_we_i;
|
406 |
|
|
wire wbs_d_i2c1_cyc_i;
|
407 |
|
|
wire wbs_d_i2c1_stb_i;
|
408 |
|
|
wire [2:0] wbs_d_i2c1_cti_i;
|
409 |
|
|
wire [1:0] wbs_d_i2c1_bte_i;
|
410 |
|
|
wire [wbs_d_i2c1_data_width-1:0] wbs_d_i2c1_dat_o;
|
411 |
|
|
wire wbs_d_i2c1_ack_o;
|
412 |
|
|
wire wbs_d_i2c1_err_o;
|
413 |
|
|
wire wbs_d_i2c1_rty_o;
|
414 |
|
|
|
415 |
|
|
// i2c2 wires
|
416 |
|
|
wire [31:0] wbs_d_i2c2_adr_i;
|
417 |
|
|
wire [wbs_d_i2c2_data_width-1:0] wbs_d_i2c2_dat_i;
|
418 |
|
|
wire [3:0] wbs_d_i2c2_sel_i;
|
419 |
|
|
wire wbs_d_i2c2_we_i;
|
420 |
|
|
wire wbs_d_i2c2_cyc_i;
|
421 |
|
|
wire wbs_d_i2c2_stb_i;
|
422 |
|
|
wire [2:0] wbs_d_i2c2_cti_i;
|
423 |
|
|
wire [1:0] wbs_d_i2c2_bte_i;
|
424 |
|
|
wire [wbs_d_i2c2_data_width-1:0] wbs_d_i2c2_dat_o;
|
425 |
|
|
wire wbs_d_i2c2_ack_o;
|
426 |
|
|
wire wbs_d_i2c2_err_o;
|
427 |
|
|
wire wbs_d_i2c2_rty_o;
|
428 |
|
|
|
429 |
|
|
// i2c3 wires
|
430 |
|
|
wire [31:0] wbs_d_i2c3_adr_i;
|
431 |
|
|
wire [wbs_d_i2c3_data_width-1:0] wbs_d_i2c3_dat_i;
|
432 |
|
|
wire [3:0] wbs_d_i2c3_sel_i;
|
433 |
|
|
wire wbs_d_i2c3_we_i;
|
434 |
|
|
wire wbs_d_i2c3_cyc_i;
|
435 |
|
|
wire wbs_d_i2c3_stb_i;
|
436 |
|
|
wire [2:0] wbs_d_i2c3_cti_i;
|
437 |
|
|
wire [1:0] wbs_d_i2c3_bte_i;
|
438 |
|
|
wire [wbs_d_i2c3_data_width-1:0] wbs_d_i2c3_dat_o;
|
439 |
|
|
wire wbs_d_i2c3_ack_o;
|
440 |
|
|
wire wbs_d_i2c3_err_o;
|
441 |
|
|
wire wbs_d_i2c3_rty_o;
|
442 |
|
|
|
443 |
|
|
// spi0 wires
|
444 |
|
|
wire [31:0] wbs_d_spi0_adr_i;
|
445 |
|
|
wire [wbs_d_spi0_data_width-1:0] wbs_d_spi0_dat_i;
|
446 |
|
|
wire [3:0] wbs_d_spi0_sel_i;
|
447 |
|
|
wire wbs_d_spi0_we_i;
|
448 |
|
|
wire wbs_d_spi0_cyc_i;
|
449 |
|
|
wire wbs_d_spi0_stb_i;
|
450 |
|
|
wire [2:0] wbs_d_spi0_cti_i;
|
451 |
|
|
wire [1:0] wbs_d_spi0_bte_i;
|
452 |
|
|
wire [wbs_d_spi0_data_width-1:0] wbs_d_spi0_dat_o;
|
453 |
|
|
wire wbs_d_spi0_ack_o;
|
454 |
|
|
wire wbs_d_spi0_err_o;
|
455 |
|
|
wire wbs_d_spi0_rty_o;
|
456 |
|
|
|
457 |
|
|
// spi1 wires
|
458 |
|
|
wire [31:0] wbs_d_spi1_adr_i;
|
459 |
|
|
wire [wbs_d_spi1_data_width-1:0] wbs_d_spi1_dat_i;
|
460 |
|
|
wire [3:0] wbs_d_spi1_sel_i;
|
461 |
|
|
wire wbs_d_spi1_we_i;
|
462 |
|
|
wire wbs_d_spi1_cyc_i;
|
463 |
|
|
wire wbs_d_spi1_stb_i;
|
464 |
|
|
wire [2:0] wbs_d_spi1_cti_i;
|
465 |
|
|
wire [1:0] wbs_d_spi1_bte_i;
|
466 |
|
|
wire [wbs_d_spi1_data_width-1:0] wbs_d_spi1_dat_o;
|
467 |
|
|
wire wbs_d_spi1_ack_o;
|
468 |
|
|
wire wbs_d_spi1_err_o;
|
469 |
|
|
wire wbs_d_spi1_rty_o;
|
470 |
|
|
|
471 |
|
|
// spi2 wires
|
472 |
|
|
wire [31:0] wbs_d_spi2_adr_i;
|
473 |
|
|
wire [wbs_d_spi2_data_width-1:0] wbs_d_spi2_dat_i;
|
474 |
|
|
wire [3:0] wbs_d_spi2_sel_i;
|
475 |
|
|
wire wbs_d_spi2_we_i;
|
476 |
|
|
wire wbs_d_spi2_cyc_i;
|
477 |
|
|
wire wbs_d_spi2_stb_i;
|
478 |
|
|
wire [2:0] wbs_d_spi2_cti_i;
|
479 |
|
|
wire [1:0] wbs_d_spi2_bte_i;
|
480 |
|
|
wire [wbs_d_spi2_data_width-1:0] wbs_d_spi2_dat_o;
|
481 |
|
|
wire wbs_d_spi2_ack_o;
|
482 |
|
|
wire wbs_d_spi2_err_o;
|
483 |
|
|
wire wbs_d_spi2_rty_o;
|
484 |
|
|
|
485 |
|
|
// uart0 wires
|
486 |
|
|
wire [31:0] wbs_d_uart0_adr_i;
|
487 |
|
|
wire [wbs_d_uart0_data_width-1:0] wbs_d_uart0_dat_i;
|
488 |
|
|
wire [3:0] wbs_d_uart0_sel_i;
|
489 |
|
|
wire wbs_d_uart0_we_i;
|
490 |
|
|
wire wbs_d_uart0_cyc_i;
|
491 |
|
|
wire wbs_d_uart0_stb_i;
|
492 |
|
|
wire [2:0] wbs_d_uart0_cti_i;
|
493 |
|
|
wire [1:0] wbs_d_uart0_bte_i;
|
494 |
|
|
wire [wbs_d_uart0_data_width-1:0] wbs_d_uart0_dat_o;
|
495 |
|
|
wire wbs_d_uart0_ack_o;
|
496 |
|
|
wire wbs_d_uart0_err_o;
|
497 |
|
|
wire wbs_d_uart0_rty_o;
|
498 |
|
|
|
499 |
|
|
// usb0 wires
|
500 |
|
|
wire [31:0] wbs_d_usb0_adr_i;
|
501 |
|
|
wire [wbs_d_usb0_data_width-1:0] wbs_d_usb0_dat_i;
|
502 |
|
|
wire [3:0] wbs_d_usb0_sel_i;
|
503 |
|
|
wire wbs_d_usb0_we_i;
|
504 |
|
|
wire wbs_d_usb0_cyc_i;
|
505 |
|
|
wire wbs_d_usb0_stb_i;
|
506 |
|
|
wire [2:0] wbs_d_usb0_cti_i;
|
507 |
|
|
wire [1:0] wbs_d_usb0_bte_i;
|
508 |
|
|
wire [wbs_d_usb0_data_width-1:0] wbs_d_usb0_dat_o;
|
509 |
|
|
wire wbs_d_usb0_ack_o;
|
510 |
|
|
wire wbs_d_usb0_err_o;
|
511 |
|
|
wire wbs_d_usb0_rty_o;
|
512 |
|
|
|
513 |
|
|
// usb1 wires
|
514 |
|
|
wire [31:0] wbs_d_usb1_adr_i;
|
515 |
|
|
wire [wbs_d_usb1_data_width-1:0] wbs_d_usb1_dat_i;
|
516 |
|
|
wire [3:0] wbs_d_usb1_sel_i;
|
517 |
|
|
wire wbs_d_usb1_we_i;
|
518 |
|
|
wire wbs_d_usb1_cyc_i;
|
519 |
|
|
wire wbs_d_usb1_stb_i;
|
520 |
|
|
wire [2:0] wbs_d_usb1_cti_i;
|
521 |
|
|
wire [1:0] wbs_d_usb1_bte_i;
|
522 |
|
|
wire [wbs_d_usb1_data_width-1:0] wbs_d_usb1_dat_o;
|
523 |
|
|
wire wbs_d_usb1_ack_o;
|
524 |
|
|
wire wbs_d_usb1_err_o;
|
525 |
|
|
wire wbs_d_usb1_rty_o;
|
526 |
|
|
|
527 |
|
|
// gpio0 wires
|
528 |
|
|
wire [31:0] wbs_d_gpio0_adr_i;
|
529 |
|
|
wire [wbs_d_gpio0_data_width-1:0] wbs_d_gpio0_dat_i;
|
530 |
|
|
wire [3:0] wbs_d_gpio0_sel_i;
|
531 |
|
|
wire wbs_d_gpio0_we_i;
|
532 |
|
|
wire wbs_d_gpio0_cyc_i;
|
533 |
|
|
wire wbs_d_gpio0_stb_i;
|
534 |
|
|
wire [2:0] wbs_d_gpio0_cti_i;
|
535 |
|
|
wire [1:0] wbs_d_gpio0_bte_i;
|
536 |
|
|
wire [wbs_d_gpio0_data_width-1:0] wbs_d_gpio0_dat_o;
|
537 |
|
|
wire wbs_d_gpio0_ack_o;
|
538 |
|
|
wire wbs_d_gpio0_err_o;
|
539 |
|
|
wire wbs_d_gpio0_rty_o;
|
540 |
|
|
|
541 |
|
|
// flashROM wires
|
542 |
|
|
wire [31:0] wbs_d_flashrom_adr_i;
|
543 |
|
|
wire [flashrom_wb_data_width-1:0] wbs_d_flashrom_dat_i;
|
544 |
|
|
wire [3:0] wbs_d_flashrom_sel_i;
|
545 |
|
|
wire wbs_d_flashrom_we_i;
|
546 |
|
|
wire wbs_d_flashrom_cyc_i;
|
547 |
|
|
wire wbs_d_flashrom_stb_i;
|
548 |
|
|
wire [2:0] wbs_d_flashrom_cti_i;
|
549 |
|
|
wire [1:0] wbs_d_flashrom_bte_i;
|
550 |
|
|
wire [flashrom_wb_data_width-1:0] wbs_d_flashrom_dat_o;
|
551 |
|
|
wire wbs_d_flashrom_ack_o;
|
552 |
|
|
wire wbs_d_flashrom_err_o;
|
553 |
|
|
wire wbs_d_flashrom_rty_o;
|
554 |
|
|
|
555 |
|
|
// eth0 slave wires
|
556 |
|
|
wire [31:0] wbs_d_eth0_adr_i;
|
557 |
|
|
wire [wbs_d_eth0_data_width-1:0] wbs_d_eth0_dat_i;
|
558 |
|
|
wire [3:0] wbs_d_eth0_sel_i;
|
559 |
|
|
wire wbs_d_eth0_we_i;
|
560 |
|
|
wire wbs_d_eth0_cyc_i;
|
561 |
|
|
wire wbs_d_eth0_stb_i;
|
562 |
|
|
wire [2:0] wbs_d_eth0_cti_i;
|
563 |
|
|
wire [1:0] wbs_d_eth0_bte_i;
|
564 |
|
|
wire [wbs_d_eth0_data_width-1:0] wbs_d_eth0_dat_o;
|
565 |
|
|
wire wbs_d_eth0_ack_o;
|
566 |
|
|
wire wbs_d_eth0_err_o;
|
567 |
|
|
wire wbs_d_eth0_rty_o;
|
568 |
|
|
// eth0 master wires
|
569 |
|
|
wire [wbm_eth0_addr_width-1:0] wbm_eth0_adr_o;
|
570 |
|
|
wire [wbm_eth0_data_width-1:0] wbm_eth0_dat_o;
|
571 |
|
|
wire [3:0] wbm_eth0_sel_o;
|
572 |
|
|
wire wbm_eth0_we_o;
|
573 |
|
|
wire wbm_eth0_cyc_o;
|
574 |
|
|
wire wbm_eth0_stb_o;
|
575 |
|
|
wire [2:0] wbm_eth0_cti_o;
|
576 |
|
|
wire [1:0] wbm_eth0_bte_o;
|
577 |
|
|
wire [wbm_eth0_data_width-1:0] wbm_eth0_dat_i;
|
578 |
|
|
wire wbm_eth0_ack_i;
|
579 |
|
|
wire wbm_eth0_err_i;
|
580 |
|
|
wire wbm_eth0_rty_i;
|
581 |
|
|
|
582 |
|
|
|
583 |
|
|
|
584 |
|
|
//
|
585 |
|
|
// Wishbone instruction bus arbiter
|
586 |
|
|
//
|
587 |
|
|
|
588 |
|
|
arbiter_ibus arbiter_ibus0
|
589 |
|
|
(
|
590 |
|
|
// Instruction Bus Master
|
591 |
|
|
// Inputs to arbiter from master
|
592 |
|
|
.wbm_adr_o (wbm_i_or12_adr_o),
|
593 |
|
|
.wbm_dat_o (wbm_i_or12_dat_o),
|
594 |
|
|
.wbm_sel_o (wbm_i_or12_sel_o),
|
595 |
|
|
.wbm_we_o (wbm_i_or12_we_o),
|
596 |
|
|
.wbm_cyc_o (wbm_i_or12_cyc_o),
|
597 |
|
|
.wbm_stb_o (wbm_i_or12_stb_o),
|
598 |
|
|
.wbm_cti_o (wbm_i_or12_cti_o),
|
599 |
|
|
.wbm_bte_o (wbm_i_or12_bte_o),
|
600 |
|
|
// Outputs to master from arbiter
|
601 |
|
|
.wbm_dat_i (wbm_i_or12_dat_i),
|
602 |
|
|
.wbm_ack_i (wbm_i_or12_ack_i),
|
603 |
|
|
.wbm_err_i (wbm_i_or12_err_i),
|
604 |
|
|
.wbm_rty_i (wbm_i_or12_rty_i),
|
605 |
|
|
|
606 |
|
|
// Slave 0
|
607 |
|
|
// Inputs to slave from arbiter
|
608 |
|
|
.wbs0_adr_i (wbs_i_rom0_adr_i),
|
609 |
|
|
.wbs0_dat_i (wbs_i_rom0_dat_i),
|
610 |
|
|
.wbs0_sel_i (wbs_i_rom0_sel_i),
|
611 |
|
|
.wbs0_we_i (wbs_i_rom0_we_i),
|
612 |
|
|
.wbs0_cyc_i (wbs_i_rom0_cyc_i),
|
613 |
|
|
.wbs0_stb_i (wbs_i_rom0_stb_i),
|
614 |
|
|
.wbs0_cti_i (wbs_i_rom0_cti_i),
|
615 |
|
|
.wbs0_bte_i (wbs_i_rom0_bte_i),
|
616 |
|
|
// Outputs from slave to arbiter
|
617 |
|
|
.wbs0_dat_o (wbs_i_rom0_dat_o),
|
618 |
|
|
.wbs0_ack_o (wbs_i_rom0_ack_o),
|
619 |
|
|
.wbs0_err_o (wbs_i_rom0_err_o),
|
620 |
|
|
.wbs0_rty_o (wbs_i_rom0_rty_o),
|
621 |
|
|
|
622 |
|
|
// Slave 1
|
623 |
|
|
// Inputs to slave from arbiter
|
624 |
|
|
.wbs1_adr_i (wbs_i_mc0_adr_i),
|
625 |
|
|
.wbs1_dat_i (wbs_i_mc0_dat_i),
|
626 |
|
|
.wbs1_sel_i (wbs_i_mc0_sel_i),
|
627 |
|
|
.wbs1_we_i (wbs_i_mc0_we_i),
|
628 |
|
|
.wbs1_cyc_i (wbs_i_mc0_cyc_i),
|
629 |
|
|
.wbs1_stb_i (wbs_i_mc0_stb_i),
|
630 |
|
|
.wbs1_cti_i (wbs_i_mc0_cti_i),
|
631 |
|
|
.wbs1_bte_i (wbs_i_mc0_bte_i),
|
632 |
|
|
// Outputs from slave to arbiter
|
633 |
|
|
.wbs1_dat_o (wbs_i_mc0_dat_o),
|
634 |
|
|
.wbs1_ack_o (wbs_i_mc0_ack_o),
|
635 |
|
|
.wbs1_err_o (wbs_i_mc0_err_o),
|
636 |
|
|
.wbs1_rty_o (wbs_i_mc0_rty_o),
|
637 |
|
|
|
638 |
|
|
// Clock, reset inputs
|
639 |
|
|
.wb_clk (wb_clk),
|
640 |
|
|
.wb_rst (wb_rst));
|
641 |
|
|
|
642 |
|
|
defparam arbiter_ibus0.wb_addr_match_width = ibus_arb_addr_match_width;
|
643 |
|
|
|
644 |
|
|
defparam arbiter_ibus0.slave0_adr = ibus_arb_slave0_adr; // FLASH ROM
|
645 |
|
|
defparam arbiter_ibus0.slave1_adr = ibus_arb_slave1_adr; // Main memory
|
646 |
|
|
|
647 |
|
|
//
|
648 |
|
|
// Wishbone data bus arbiter
|
649 |
|
|
//
|
650 |
|
|
|
651 |
|
|
arbiter_dbus arbiter_dbus0
|
652 |
|
|
(
|
653 |
|
|
// Master 0
|
654 |
|
|
// Inputs to arbiter from master
|
655 |
|
|
.wbm0_adr_o (wbm_d_or12_adr_o),
|
656 |
|
|
.wbm0_dat_o (wbm_d_or12_dat_o),
|
657 |
|
|
.wbm0_sel_o (wbm_d_or12_sel_o),
|
658 |
|
|
.wbm0_we_o (wbm_d_or12_we_o),
|
659 |
|
|
.wbm0_cyc_o (wbm_d_or12_cyc_o),
|
660 |
|
|
.wbm0_stb_o (wbm_d_or12_stb_o),
|
661 |
|
|
.wbm0_cti_o (wbm_d_or12_cti_o),
|
662 |
|
|
.wbm0_bte_o (wbm_d_or12_bte_o),
|
663 |
|
|
// Outputs to master from arbiter
|
664 |
|
|
.wbm0_dat_i (wbm_d_or12_dat_i),
|
665 |
|
|
.wbm0_ack_i (wbm_d_or12_ack_i),
|
666 |
|
|
.wbm0_err_i (wbm_d_or12_err_i),
|
667 |
|
|
.wbm0_rty_i (wbm_d_or12_rty_i),
|
668 |
|
|
|
669 |
|
|
// Master 0
|
670 |
|
|
// Inputs to arbiter from master
|
671 |
|
|
.wbm1_adr_o (wbm_d_dbg_adr_o),
|
672 |
|
|
.wbm1_dat_o (wbm_d_dbg_dat_o),
|
673 |
|
|
.wbm1_we_o (wbm_d_dbg_we_o),
|
674 |
|
|
.wbm1_cyc_o (wbm_d_dbg_cyc_o),
|
675 |
|
|
.wbm1_sel_o (wbm_d_dbg_sel_o),
|
676 |
|
|
.wbm1_stb_o (wbm_d_dbg_stb_o),
|
677 |
|
|
.wbm1_cti_o (wbm_d_dbg_cti_o),
|
678 |
|
|
.wbm1_bte_o (wbm_d_dbg_bte_o),
|
679 |
|
|
// Outputs to master from arbiter
|
680 |
|
|
.wbm1_dat_i (wbm_d_dbg_dat_i),
|
681 |
|
|
.wbm1_ack_i (wbm_d_dbg_ack_i),
|
682 |
|
|
.wbm1_err_i (wbm_d_dbg_err_i),
|
683 |
|
|
.wbm1_rty_i (wbm_d_dbg_rty_i),
|
684 |
|
|
|
685 |
|
|
// Slaves
|
686 |
|
|
|
687 |
|
|
.wbs0_adr_i (wbs_d_mc0_adr_i),
|
688 |
|
|
.wbs0_dat_i (wbs_d_mc0_dat_i),
|
689 |
|
|
.wbs0_sel_i (wbs_d_mc0_sel_i),
|
690 |
|
|
.wbs0_we_i (wbs_d_mc0_we_i),
|
691 |
|
|
.wbs0_cyc_i (wbs_d_mc0_cyc_i),
|
692 |
|
|
.wbs0_stb_i (wbs_d_mc0_stb_i),
|
693 |
|
|
.wbs0_cti_i (wbs_d_mc0_cti_i),
|
694 |
|
|
.wbs0_bte_i (wbs_d_mc0_bte_i),
|
695 |
|
|
.wbs0_dat_o (wbs_d_mc0_dat_o),
|
696 |
|
|
.wbs0_ack_o (wbs_d_mc0_ack_o),
|
697 |
|
|
.wbs0_err_o (wbs_d_mc0_err_o),
|
698 |
|
|
.wbs0_rty_o (wbs_d_mc0_rty_o),
|
699 |
|
|
|
700 |
|
|
.wbs1_adr_i (wbs_d_eth0_adr_i),
|
701 |
|
|
.wbs1_dat_i (wbs_d_eth0_dat_i),
|
702 |
|
|
.wbs1_sel_i (wbs_d_eth0_sel_i),
|
703 |
|
|
.wbs1_we_i (wbs_d_eth0_we_i),
|
704 |
|
|
.wbs1_cyc_i (wbs_d_eth0_cyc_i),
|
705 |
|
|
.wbs1_stb_i (wbs_d_eth0_stb_i),
|
706 |
|
|
.wbs1_cti_i (wbs_d_eth0_cti_i),
|
707 |
|
|
.wbs1_bte_i (wbs_d_eth0_bte_i),
|
708 |
|
|
.wbs1_dat_o (wbs_d_eth0_dat_o),
|
709 |
|
|
.wbs1_ack_o (wbs_d_eth0_ack_o),
|
710 |
|
|
.wbs1_err_o (wbs_d_eth0_err_o),
|
711 |
|
|
.wbs1_rty_o (wbs_d_eth0_rty_o),
|
712 |
|
|
|
713 |
|
|
.wbs2_adr_i (wbm_b_d_adr_o),
|
714 |
|
|
.wbs2_dat_i (wbm_b_d_dat_o),
|
715 |
|
|
.wbs2_sel_i (wbm_b_d_sel_o),
|
716 |
|
|
.wbs2_we_i (wbm_b_d_we_o),
|
717 |
|
|
.wbs2_cyc_i (wbm_b_d_cyc_o),
|
718 |
|
|
.wbs2_stb_i (wbm_b_d_stb_o),
|
719 |
|
|
.wbs2_cti_i (wbm_b_d_cti_o),
|
720 |
|
|
.wbs2_bte_i (wbm_b_d_bte_o),
|
721 |
|
|
.wbs2_dat_o (wbm_b_d_dat_i),
|
722 |
|
|
.wbs2_ack_o (wbm_b_d_ack_i),
|
723 |
|
|
.wbs2_err_o (wbm_b_d_err_i),
|
724 |
|
|
.wbs2_rty_o (wbm_b_d_rty_i),
|
725 |
|
|
|
726 |
|
|
// Clock, reset inputs
|
727 |
|
|
.wb_clk (wb_clk),
|
728 |
|
|
.wb_rst (wb_rst));
|
729 |
|
|
|
730 |
|
|
// These settings are from top level params file
|
731 |
|
|
defparam arbiter_dbus0.wb_addr_match_width = dbus_arb_wb_addr_match_width;
|
732 |
|
|
defparam arbiter_dbus0.wb_num_slaves = dbus_arb_wb_num_slaves;
|
733 |
|
|
defparam arbiter_dbus0.slave0_adr = dbus_arb_slave0_adr;
|
734 |
|
|
defparam arbiter_dbus0.slave1_adr = dbus_arb_slave1_adr;
|
735 |
|
|
|
736 |
|
|
//
|
737 |
|
|
// Wishbone byte-wide bus arbiter
|
738 |
|
|
//
|
739 |
|
|
|
740 |
|
|
arbiter_bytebus arbiter_bytebus0
|
741 |
|
|
(
|
742 |
|
|
|
743 |
|
|
// Master 0
|
744 |
|
|
// Inputs to arbiter from master
|
745 |
|
|
.wbm0_adr_o (wbm_b_d_adr_o),
|
746 |
|
|
.wbm0_dat_o (wbm_b_d_dat_o),
|
747 |
|
|
.wbm0_sel_o (wbm_b_d_sel_o),
|
748 |
|
|
.wbm0_we_o (wbm_b_d_we_o),
|
749 |
|
|
.wbm0_cyc_o (wbm_b_d_cyc_o),
|
750 |
|
|
.wbm0_stb_o (wbm_b_d_stb_o),
|
751 |
|
|
.wbm0_cti_o (wbm_b_d_cti_o),
|
752 |
|
|
.wbm0_bte_o (wbm_b_d_bte_o),
|
753 |
|
|
// Outputs to master from arbiter
|
754 |
|
|
.wbm0_dat_i (wbm_b_d_dat_i),
|
755 |
|
|
.wbm0_ack_i (wbm_b_d_ack_i),
|
756 |
|
|
.wbm0_err_i (wbm_b_d_err_i),
|
757 |
|
|
.wbm0_rty_i (wbm_b_d_rty_i),
|
758 |
|
|
|
759 |
|
|
// Byte bus slaves
|
760 |
|
|
|
761 |
|
|
.wbs0_adr_i (wbs_d_uart0_adr_i),
|
762 |
|
|
.wbs0_dat_i (wbs_d_uart0_dat_i),
|
763 |
|
|
.wbs0_we_i (wbs_d_uart0_we_i),
|
764 |
|
|
.wbs0_cyc_i (wbs_d_uart0_cyc_i),
|
765 |
|
|
.wbs0_stb_i (wbs_d_uart0_stb_i),
|
766 |
|
|
.wbs0_cti_i (wbs_d_uart0_cti_i),
|
767 |
|
|
.wbs0_bte_i (wbs_d_uart0_bte_i),
|
768 |
|
|
.wbs0_dat_o (wbs_d_uart0_dat_o),
|
769 |
|
|
.wbs0_ack_o (wbs_d_uart0_ack_o),
|
770 |
|
|
.wbs0_err_o (wbs_d_uart0_err_o),
|
771 |
|
|
.wbs0_rty_o (wbs_d_uart0_rty_o),
|
772 |
|
|
|
773 |
|
|
.wbs1_adr_i (wbs_d_gpio0_adr_i),
|
774 |
|
|
.wbs1_dat_i (wbs_d_gpio0_dat_i),
|
775 |
|
|
.wbs1_we_i (wbs_d_gpio0_we_i),
|
776 |
|
|
.wbs1_cyc_i (wbs_d_gpio0_cyc_i),
|
777 |
|
|
.wbs1_stb_i (wbs_d_gpio0_stb_i),
|
778 |
|
|
.wbs1_cti_i (wbs_d_gpio0_cti_i),
|
779 |
|
|
.wbs1_bte_i (wbs_d_gpio0_bte_i),
|
780 |
|
|
.wbs1_dat_o (wbs_d_gpio0_dat_o),
|
781 |
|
|
.wbs1_ack_o (wbs_d_gpio0_ack_o),
|
782 |
|
|
.wbs1_err_o (wbs_d_gpio0_err_o),
|
783 |
|
|
.wbs1_rty_o (wbs_d_gpio0_rty_o),
|
784 |
|
|
|
785 |
|
|
.wbs2_adr_i (wbs_d_usb0_adr_i),
|
786 |
|
|
.wbs2_dat_i (wbs_d_usb0_dat_i),
|
787 |
|
|
.wbs2_we_i (wbs_d_usb0_we_i),
|
788 |
|
|
.wbs2_cyc_i (wbs_d_usb0_cyc_i),
|
789 |
|
|
.wbs2_stb_i (wbs_d_usb0_stb_i),
|
790 |
|
|
.wbs2_cti_i (wbs_d_usb0_cti_i),
|
791 |
|
|
.wbs2_bte_i (wbs_d_usb0_bte_i),
|
792 |
|
|
.wbs2_dat_o (wbs_d_usb0_dat_o),
|
793 |
|
|
.wbs2_ack_o (wbs_d_usb0_ack_o),
|
794 |
|
|
.wbs2_err_o (wbs_d_usb0_err_o),
|
795 |
|
|
.wbs2_rty_o (wbs_d_usb0_rty_o),
|
796 |
|
|
|
797 |
|
|
.wbs3_adr_i (wbs_d_i2c0_adr_i),
|
798 |
|
|
.wbs3_dat_i (wbs_d_i2c0_dat_i),
|
799 |
|
|
.wbs3_we_i (wbs_d_i2c0_we_i),
|
800 |
|
|
.wbs3_cyc_i (wbs_d_i2c0_cyc_i),
|
801 |
|
|
.wbs3_stb_i (wbs_d_i2c0_stb_i),
|
802 |
|
|
.wbs3_cti_i (wbs_d_i2c0_cti_i),
|
803 |
|
|
.wbs3_bte_i (wbs_d_i2c0_bte_i),
|
804 |
|
|
.wbs3_dat_o (wbs_d_i2c0_dat_o),
|
805 |
|
|
.wbs3_ack_o (wbs_d_i2c0_ack_o),
|
806 |
|
|
.wbs3_err_o (wbs_d_i2c0_err_o),
|
807 |
|
|
.wbs3_rty_o (wbs_d_i2c0_rty_o),
|
808 |
|
|
|
809 |
|
|
.wbs4_adr_i (wbs_d_i2c1_adr_i),
|
810 |
|
|
.wbs4_dat_i (wbs_d_i2c1_dat_i),
|
811 |
|
|
.wbs4_we_i (wbs_d_i2c1_we_i),
|
812 |
|
|
.wbs4_cyc_i (wbs_d_i2c1_cyc_i),
|
813 |
|
|
.wbs4_stb_i (wbs_d_i2c1_stb_i),
|
814 |
|
|
.wbs4_cti_i (wbs_d_i2c1_cti_i),
|
815 |
|
|
.wbs4_bte_i (wbs_d_i2c1_bte_i),
|
816 |
|
|
.wbs4_dat_o (wbs_d_i2c1_dat_o),
|
817 |
|
|
.wbs4_ack_o (wbs_d_i2c1_ack_o),
|
818 |
|
|
.wbs4_err_o (wbs_d_i2c1_err_o),
|
819 |
|
|
.wbs4_rty_o (wbs_d_i2c1_rty_o),
|
820 |
|
|
|
821 |
|
|
.wbs5_adr_i (wbs_d_i2c2_adr_i),
|
822 |
|
|
.wbs5_dat_i (wbs_d_i2c2_dat_i),
|
823 |
|
|
.wbs5_we_i (wbs_d_i2c2_we_i),
|
824 |
|
|
.wbs5_cyc_i (wbs_d_i2c2_cyc_i),
|
825 |
|
|
.wbs5_stb_i (wbs_d_i2c2_stb_i),
|
826 |
|
|
.wbs5_cti_i (wbs_d_i2c2_cti_i),
|
827 |
|
|
.wbs5_bte_i (wbs_d_i2c2_bte_i),
|
828 |
|
|
.wbs5_dat_o (wbs_d_i2c2_dat_o),
|
829 |
|
|
.wbs5_ack_o (wbs_d_i2c2_ack_o),
|
830 |
|
|
.wbs5_err_o (wbs_d_i2c2_err_o),
|
831 |
|
|
.wbs5_rty_o (wbs_d_i2c2_rty_o),
|
832 |
|
|
|
833 |
|
|
.wbs6_adr_i (wbs_d_i2c3_adr_i),
|
834 |
|
|
.wbs6_dat_i (wbs_d_i2c3_dat_i),
|
835 |
|
|
.wbs6_we_i (wbs_d_i2c3_we_i),
|
836 |
|
|
.wbs6_cyc_i (wbs_d_i2c3_cyc_i),
|
837 |
|
|
.wbs6_stb_i (wbs_d_i2c3_stb_i),
|
838 |
|
|
.wbs6_cti_i (wbs_d_i2c3_cti_i),
|
839 |
|
|
.wbs6_bte_i (wbs_d_i2c3_bte_i),
|
840 |
|
|
.wbs6_dat_o (wbs_d_i2c3_dat_o),
|
841 |
|
|
.wbs6_ack_o (wbs_d_i2c3_ack_o),
|
842 |
|
|
.wbs6_err_o (wbs_d_i2c3_err_o),
|
843 |
|
|
.wbs6_rty_o (wbs_d_i2c3_rty_o),
|
844 |
|
|
|
845 |
|
|
.wbs7_adr_i (wbs_d_spi0_adr_i),
|
846 |
|
|
.wbs7_dat_i (wbs_d_spi0_dat_i),
|
847 |
|
|
.wbs7_we_i (wbs_d_spi0_we_i),
|
848 |
|
|
.wbs7_cyc_i (wbs_d_spi0_cyc_i),
|
849 |
|
|
.wbs7_stb_i (wbs_d_spi0_stb_i),
|
850 |
|
|
.wbs7_cti_i (wbs_d_spi0_cti_i),
|
851 |
|
|
.wbs7_bte_i (wbs_d_spi0_bte_i),
|
852 |
|
|
.wbs7_dat_o (wbs_d_spi0_dat_o),
|
853 |
|
|
.wbs7_ack_o (wbs_d_spi0_ack_o),
|
854 |
|
|
.wbs7_err_o (wbs_d_spi0_err_o),
|
855 |
|
|
.wbs7_rty_o (wbs_d_spi0_rty_o),
|
856 |
|
|
|
857 |
|
|
.wbs8_adr_i (wbs_d_spi1_adr_i),
|
858 |
|
|
.wbs8_dat_i (wbs_d_spi1_dat_i),
|
859 |
|
|
.wbs8_we_i (wbs_d_spi1_we_i),
|
860 |
|
|
.wbs8_cyc_i (wbs_d_spi1_cyc_i),
|
861 |
|
|
.wbs8_stb_i (wbs_d_spi1_stb_i),
|
862 |
|
|
.wbs8_cti_i (wbs_d_spi1_cti_i),
|
863 |
|
|
.wbs8_bte_i (wbs_d_spi1_bte_i),
|
864 |
|
|
.wbs8_dat_o (wbs_d_spi1_dat_o),
|
865 |
|
|
.wbs8_ack_o (wbs_d_spi1_ack_o),
|
866 |
|
|
.wbs8_err_o (wbs_d_spi1_err_o),
|
867 |
|
|
.wbs8_rty_o (wbs_d_spi1_rty_o),
|
868 |
|
|
|
869 |
|
|
.wbs9_adr_i (wbs_d_spi2_adr_i),
|
870 |
|
|
.wbs9_dat_i (wbs_d_spi2_dat_i),
|
871 |
|
|
.wbs9_we_i (wbs_d_spi2_we_i),
|
872 |
|
|
.wbs9_cyc_i (wbs_d_spi2_cyc_i),
|
873 |
|
|
.wbs9_stb_i (wbs_d_spi2_stb_i),
|
874 |
|
|
.wbs9_cti_i (wbs_d_spi2_cti_i),
|
875 |
|
|
.wbs9_bte_i (wbs_d_spi2_bte_i),
|
876 |
|
|
.wbs9_dat_o (wbs_d_spi2_dat_o),
|
877 |
|
|
.wbs9_ack_o (wbs_d_spi2_ack_o),
|
878 |
|
|
.wbs9_err_o (wbs_d_spi2_err_o),
|
879 |
|
|
.wbs9_rty_o (wbs_d_spi2_rty_o),
|
880 |
|
|
|
881 |
|
|
.wbs10_adr_i (wbs_d_flashrom_adr_i),
|
882 |
|
|
.wbs10_dat_i (wbs_d_flashrom_dat_i),
|
883 |
|
|
.wbs10_we_i (wbs_d_flashrom_we_i),
|
884 |
|
|
.wbs10_cyc_i (wbs_d_flashrom_cyc_i),
|
885 |
|
|
.wbs10_stb_i (wbs_d_flashrom_stb_i),
|
886 |
|
|
.wbs10_cti_i (wbs_d_flashrom_cti_i),
|
887 |
|
|
.wbs10_bte_i (wbs_d_flashrom_bte_i),
|
888 |
|
|
.wbs10_dat_o (wbs_d_flashrom_dat_o),
|
889 |
|
|
.wbs10_ack_o (wbs_d_flashrom_ack_o),
|
890 |
|
|
.wbs10_err_o (wbs_d_flashrom_err_o),
|
891 |
|
|
.wbs10_rty_o (wbs_d_flashrom_rty_o),
|
892 |
|
|
|
893 |
|
|
.wbs11_adr_i (wbs_d_usb1_adr_i),
|
894 |
|
|
.wbs11_dat_i (wbs_d_usb1_dat_i),
|
895 |
|
|
.wbs11_we_i (wbs_d_usb1_we_i),
|
896 |
|
|
.wbs11_cyc_i (wbs_d_usb1_cyc_i),
|
897 |
|
|
.wbs11_stb_i (wbs_d_usb1_stb_i),
|
898 |
|
|
.wbs11_cti_i (wbs_d_usb1_cti_i),
|
899 |
|
|
.wbs11_bte_i (wbs_d_usb1_bte_i),
|
900 |
|
|
.wbs11_dat_o (wbs_d_usb1_dat_o),
|
901 |
|
|
.wbs11_ack_o (wbs_d_usb1_ack_o),
|
902 |
|
|
.wbs11_err_o (wbs_d_usb1_err_o),
|
903 |
|
|
.wbs11_rty_o (wbs_d_usb1_rty_o),
|
904 |
|
|
|
905 |
|
|
// Clock, reset inputs
|
906 |
|
|
.wb_clk (wb_clk),
|
907 |
|
|
.wb_rst (wb_rst));
|
908 |
|
|
|
909 |
|
|
defparam arbiter_bytebus0.wb_addr_match_width = bbus_arb_wb_addr_match_width;
|
910 |
|
|
defparam arbiter_bytebus0.wb_num_slaves = bbus_arb_wb_num_slaves;
|
911 |
|
|
|
912 |
|
|
defparam arbiter_bytebus0.slave0_adr = bbus_arb_slave0_adr;
|
913 |
|
|
defparam arbiter_bytebus0.slave1_adr = bbus_arb_slave1_adr;
|
914 |
|
|
defparam arbiter_bytebus0.slave2_adr = bbus_arb_slave2_adr;
|
915 |
|
|
defparam arbiter_bytebus0.slave3_adr = bbus_arb_slave3_adr;
|
916 |
|
|
defparam arbiter_bytebus0.slave4_adr = bbus_arb_slave4_adr;
|
917 |
|
|
defparam arbiter_bytebus0.slave5_adr = bbus_arb_slave5_adr;
|
918 |
|
|
defparam arbiter_bytebus0.slave6_adr = bbus_arb_slave6_adr;
|
919 |
|
|
defparam arbiter_bytebus0.slave7_adr = bbus_arb_slave7_adr;
|
920 |
|
|
defparam arbiter_bytebus0.slave8_adr = bbus_arb_slave8_adr;
|
921 |
|
|
defparam arbiter_bytebus0.slave9_adr = bbus_arb_slave9_adr;
|
922 |
|
|
defparam arbiter_bytebus0.slave10_adr = bbus_arb_slave10_adr;
|
923 |
|
|
defparam arbiter_bytebus0.slave11_adr = bbus_arb_slave11_adr;
|
924 |
|
|
|
925 |
|
|
|
926 |
|
|
`ifdef JTAG_DEBUG
|
927 |
|
|
////////////////////////////////////////////////////////////////////////
|
928 |
|
|
//
|
929 |
|
|
// JTAG TAP
|
930 |
|
|
//
|
931 |
|
|
////////////////////////////////////////////////////////////////////////
|
932 |
|
|
|
933 |
|
|
//
|
934 |
|
|
// Wires
|
935 |
|
|
//
|
936 |
|
|
wire dbg_if_select;
|
937 |
|
|
wire dbg_if_tdo;
|
938 |
|
|
wire jtag_tap_tdo;
|
939 |
|
|
wire jtag_tap_shift_dr, jtag_tap_pause_dr,
|
940 |
|
|
jtag_tap_upate_dr, jtag_tap_capture_dr;
|
941 |
|
|
//
|
942 |
|
|
// Instantiation
|
943 |
|
|
//
|
944 |
|
|
|
945 |
|
|
jtag_tap jtag_tap0
|
946 |
|
|
(
|
947 |
|
|
// Ports to pads
|
948 |
|
|
.tdo_pad_o (tdo_pad_o),
|
949 |
|
|
.tms_pad_i (tms_pad_i),
|
950 |
|
|
.tck_pad_i (dbg_tck),
|
951 |
|
|
.trst_pad_i (async_rst),
|
952 |
|
|
.tdi_pad_i (tdi_pad_i),
|
953 |
|
|
|
954 |
|
|
.tdo_padoe_o (tdo_padoe_o),
|
955 |
|
|
|
956 |
|
|
.tdo_o (jtag_tap_tdo),
|
957 |
|
|
|
958 |
|
|
.shift_dr_o (jtag_tap_shift_dr),
|
959 |
|
|
.pause_dr_o (jtag_tap_pause_dr),
|
960 |
|
|
.update_dr_o (jtag_tap_update_dr),
|
961 |
|
|
.capture_dr_o (jtag_tap_capture_dr),
|
962 |
|
|
|
963 |
|
|
.extest_select_o (),
|
964 |
|
|
.sample_preload_select_o (),
|
965 |
|
|
.mbist_select_o (),
|
966 |
|
|
.debug_select_o (dbg_if_select),
|
967 |
|
|
|
968 |
|
|
|
969 |
|
|
.bs_chain_tdi_i (1'b0),
|
970 |
|
|
.mbist_tdi_i (1'b0),
|
971 |
|
|
.debug_tdi_i (dbg_if_tdo)
|
972 |
|
|
|
973 |
|
|
);
|
974 |
|
|
|
975 |
|
|
////////////////////////////////////////////////////////////////////////
|
976 |
|
|
`endif // `ifdef JTAG_DEBUG
|
977 |
|
|
|
978 |
|
|
////////////////////////////////////////////////////////////////////////
|
979 |
|
|
//
|
980 |
|
|
// OpenRISC processor
|
981 |
|
|
//
|
982 |
|
|
////////////////////////////////////////////////////////////////////////
|
983 |
|
|
|
984 |
|
|
//
|
985 |
|
|
// Wires
|
986 |
|
|
//
|
987 |
|
|
|
988 |
|
|
wire [30:0] or1200_pic_ints;
|
989 |
|
|
|
990 |
|
|
wire [31:0] or1200_dbg_dat_i;
|
991 |
|
|
wire [31:0] or1200_dbg_adr_i;
|
992 |
|
|
wire or1200_dbg_we_i;
|
993 |
|
|
wire or1200_dbg_stb_i;
|
994 |
|
|
wire or1200_dbg_ack_o;
|
995 |
|
|
wire [31:0] or1200_dbg_dat_o;
|
996 |
|
|
|
997 |
|
|
wire or1200_dbg_stall_i;
|
998 |
|
|
wire or1200_dbg_ewt_i;
|
999 |
|
|
wire [3:0] or1200_dbg_lss_o;
|
1000 |
|
|
wire [1:0] or1200_dbg_is_o;
|
1001 |
|
|
wire [10:0] or1200_dbg_wp_o;
|
1002 |
|
|
wire or1200_dbg_bp_o;
|
1003 |
|
|
wire or1200_dbg_rst;
|
1004 |
|
|
|
1005 |
|
|
wire or1200_clk, or1200_rst;
|
1006 |
|
|
wire sig_tick;
|
1007 |
|
|
|
1008 |
|
|
//
|
1009 |
|
|
// Assigns
|
1010 |
|
|
//
|
1011 |
|
|
assign or1200_clk = wb_clk;
|
1012 |
|
|
assign or1200_rst = wb_rst | or1200_dbg_rst;
|
1013 |
|
|
|
1014 |
|
|
//
|
1015 |
|
|
// Instantiation
|
1016 |
|
|
//
|
1017 |
|
|
or1200_top or1200_top0
|
1018 |
|
|
(
|
1019 |
|
|
// Instruction bus, clocks, reset
|
1020 |
|
|
.iwb_clk_i (wb_clk),
|
1021 |
|
|
.iwb_rst_i (wb_rst),
|
1022 |
|
|
.iwb_ack_i (wbm_i_or12_ack_i),
|
1023 |
|
|
.iwb_err_i (wbm_i_or12_err_i),
|
1024 |
|
|
.iwb_rty_i (wbm_i_or12_rty_i),
|
1025 |
|
|
.iwb_dat_i (wbm_i_or12_dat_i),
|
1026 |
|
|
|
1027 |
|
|
.iwb_cyc_o (wbm_i_or12_cyc_o),
|
1028 |
|
|
.iwb_adr_o (wbm_i_or12_adr_o),
|
1029 |
|
|
.iwb_stb_o (wbm_i_or12_stb_o),
|
1030 |
|
|
.iwb_we_o (wbm_i_or12_we_o),
|
1031 |
|
|
.iwb_sel_o (wbm_i_or12_sel_o),
|
1032 |
|
|
.iwb_dat_o (wbm_i_or12_dat_o),
|
1033 |
|
|
.iwb_cti_o (wbm_i_or12_cti_o),
|
1034 |
|
|
.iwb_bte_o (wbm_i_or12_bte_o),
|
1035 |
|
|
|
1036 |
|
|
// Data bus, clocks, reset
|
1037 |
|
|
.dwb_clk_i (wb_clk),
|
1038 |
|
|
.dwb_rst_i (wb_rst),
|
1039 |
|
|
.dwb_ack_i (wbm_d_or12_ack_i),
|
1040 |
|
|
.dwb_err_i (wbm_d_or12_err_i),
|
1041 |
|
|
.dwb_rty_i (wbm_d_or12_rty_i),
|
1042 |
|
|
.dwb_dat_i (wbm_d_or12_dat_i),
|
1043 |
|
|
|
1044 |
|
|
.dwb_cyc_o (wbm_d_or12_cyc_o),
|
1045 |
|
|
.dwb_adr_o (wbm_d_or12_adr_o),
|
1046 |
|
|
.dwb_stb_o (wbm_d_or12_stb_o),
|
1047 |
|
|
.dwb_we_o (wbm_d_or12_we_o),
|
1048 |
|
|
.dwb_sel_o (wbm_d_or12_sel_o),
|
1049 |
|
|
.dwb_dat_o (wbm_d_or12_dat_o),
|
1050 |
|
|
.dwb_cti_o (wbm_d_or12_cti_o),
|
1051 |
|
|
.dwb_bte_o (wbm_d_or12_bte_o),
|
1052 |
|
|
|
1053 |
|
|
// Debug interface ports
|
1054 |
|
|
.dbg_stall_i (or1200_dbg_stall_i),
|
1055 |
|
|
//.dbg_ewt_i (or1200_dbg_ewt_i),
|
1056 |
|
|
.dbg_ewt_i (1'b0),
|
1057 |
|
|
.dbg_lss_o (or1200_dbg_lss_o),
|
1058 |
|
|
.dbg_is_o (or1200_dbg_is_o),
|
1059 |
|
|
.dbg_wp_o (or1200_dbg_wp_o),
|
1060 |
|
|
.dbg_bp_o (or1200_dbg_bp_o),
|
1061 |
|
|
|
1062 |
|
|
.dbg_adr_i (or1200_dbg_adr_i),
|
1063 |
|
|
.dbg_we_i (or1200_dbg_we_i ),
|
1064 |
|
|
.dbg_stb_i (or1200_dbg_stb_i),
|
1065 |
|
|
.dbg_dat_i (or1200_dbg_dat_i),
|
1066 |
|
|
.dbg_dat_o (or1200_dbg_dat_o),
|
1067 |
|
|
.dbg_ack_o (or1200_dbg_ack_o),
|
1068 |
|
|
|
1069 |
|
|
.pm_clksd_o (),
|
1070 |
|
|
.pm_dc_gate_o (),
|
1071 |
|
|
.pm_ic_gate_o (),
|
1072 |
|
|
.pm_dmmu_gate_o (),
|
1073 |
|
|
.pm_immu_gate_o (),
|
1074 |
|
|
.pm_tt_gate_o (),
|
1075 |
|
|
.pm_cpu_gate_o (),
|
1076 |
|
|
.pm_wakeup_o (),
|
1077 |
|
|
.pm_lvolt_o (),
|
1078 |
|
|
|
1079 |
|
|
// Core clocks, resets
|
1080 |
|
|
.clk_i (or1200_clk),
|
1081 |
|
|
.rst_i (or1200_rst),
|
1082 |
|
|
|
1083 |
|
|
.clmode_i (2'b00),
|
1084 |
|
|
// Interrupts
|
1085 |
|
|
.pic_ints_i (or1200_pic_ints),
|
1086 |
|
|
.sig_tick(sig_tick),
|
1087 |
|
|
/*
|
1088 |
|
|
.mbist_so_o (),
|
1089 |
|
|
.mbist_si_i (0),
|
1090 |
|
|
.mbist_ctrl_i (0),
|
1091 |
|
|
*/
|
1092 |
|
|
|
1093 |
|
|
.pm_cpustall_i (1'b0)
|
1094 |
|
|
|
1095 |
|
|
);
|
1096 |
|
|
|
1097 |
|
|
////////////////////////////////////////////////////////////////////////
|
1098 |
|
|
|
1099 |
|
|
|
1100 |
|
|
`ifdef JTAG_DEBUG
|
1101 |
|
|
////////////////////////////////////////////////////////////////////////
|
1102 |
|
|
//
|
1103 |
|
|
// OR1200 Debug Interface
|
1104 |
|
|
//
|
1105 |
|
|
////////////////////////////////////////////////////////////////////////
|
1106 |
|
|
|
1107 |
|
|
dbg_if dbg_if0
|
1108 |
|
|
(
|
1109 |
|
|
// OR1200 interface
|
1110 |
|
|
.cpu0_clk_i (or1200_clk),
|
1111 |
|
|
.cpu0_rst_o (or1200_dbg_rst),
|
1112 |
|
|
.cpu0_addr_o (or1200_dbg_adr_i),
|
1113 |
|
|
.cpu0_data_o (or1200_dbg_dat_i),
|
1114 |
|
|
.cpu0_stb_o (or1200_dbg_stb_i),
|
1115 |
|
|
.cpu0_we_o (or1200_dbg_we_i),
|
1116 |
|
|
.cpu0_data_i (or1200_dbg_dat_o),
|
1117 |
|
|
.cpu0_ack_i (or1200_dbg_ack_o),
|
1118 |
|
|
|
1119 |
|
|
|
1120 |
|
|
.cpu0_stall_o (or1200_dbg_stall_i),
|
1121 |
|
|
.cpu0_bp_i (or1200_dbg_bp_o),
|
1122 |
|
|
|
1123 |
|
|
// TAP interface
|
1124 |
|
|
.tck_i (dbg_tck),
|
1125 |
|
|
.tdi_i (jtag_tap_tdo),
|
1126 |
|
|
.tdo_o (dbg_if_tdo),
|
1127 |
|
|
.rst_i (wb_rst),
|
1128 |
|
|
.shift_dr_i (jtag_tap_shift_dr),
|
1129 |
|
|
.pause_dr_i (jtag_tap_pause_dr),
|
1130 |
|
|
.update_dr_i (jtag_tap_update_dr),
|
1131 |
|
|
.debug_select_i (dbg_if_select),
|
1132 |
|
|
|
1133 |
|
|
// Wishbone debug master
|
1134 |
|
|
.wb_clk_i (wb_clk),
|
1135 |
|
|
.wb_dat_i (wbm_d_dbg_dat_i),
|
1136 |
|
|
.wb_ack_i (wbm_d_dbg_ack_i),
|
1137 |
|
|
.wb_err_i (wbm_d_dbg_err_i),
|
1138 |
|
|
.wb_adr_o (wbm_d_dbg_adr_o),
|
1139 |
|
|
.wb_dat_o (wbm_d_dbg_dat_o),
|
1140 |
|
|
.wb_cyc_o (wbm_d_dbg_cyc_o),
|
1141 |
|
|
.wb_stb_o (wbm_d_dbg_stb_o),
|
1142 |
|
|
.wb_sel_o (wbm_d_dbg_sel_o),
|
1143 |
|
|
.wb_we_o (wbm_d_dbg_we_o ),
|
1144 |
|
|
.wb_cti_o (wbm_d_dbg_cti_o),
|
1145 |
|
|
.wb_cab_o (/* UNUSED */),
|
1146 |
|
|
.wb_bte_o (wbm_d_dbg_bte_o)
|
1147 |
|
|
);
|
1148 |
|
|
|
1149 |
|
|
////////////////////////////////////////////////////////////////////////
|
1150 |
|
|
`else // !`ifdef JTAG_DEBUG
|
1151 |
|
|
|
1152 |
|
|
assign wbm_d_dbg_adr_o = 0;
|
1153 |
|
|
assign wbm_d_dbg_dat_o = 0;
|
1154 |
|
|
assign wbm_d_dbg_cyc_o = 0;
|
1155 |
|
|
assign wbm_d_dbg_stb_o = 0;
|
1156 |
|
|
assign wbm_d_dbg_sel_o = 0;
|
1157 |
|
|
assign wbm_d_dbg_we_o = 0;
|
1158 |
|
|
assign wbm_d_dbg_cti_o = 0;
|
1159 |
|
|
assign wbm_d_dbg_bte_o = 0;
|
1160 |
|
|
|
1161 |
|
|
assign or1200_dbg_adr_i = 0;
|
1162 |
|
|
assign or1200_dbg_dat_i = 0;
|
1163 |
|
|
assign or1200_dbg_stb_i = 0;
|
1164 |
|
|
assign or1200_dbg_we_i = 0;
|
1165 |
|
|
assign or1200_dbg_stall_i = 0;
|
1166 |
|
|
|
1167 |
|
|
////////////////////////////////////////////////////////////////////////
|
1168 |
|
|
`endif // !`ifdef JTAG_DEBUG
|
1169 |
|
|
|
1170 |
|
|
`ifdef VERSATILE_SDRAM
|
1171 |
|
|
////////////////////////////////////////////////////////////////////////
|
1172 |
|
|
//
|
1173 |
|
|
// Versatile Memory Controller (SDRAM configured)
|
1174 |
|
|
//
|
1175 |
|
|
////////////////////////////////////////////////////////////////////////
|
1176 |
|
|
|
1177 |
|
|
//
|
1178 |
|
|
// Wires
|
1179 |
|
|
//
|
1180 |
|
|
|
1181 |
|
|
wire [15:0] sdram_dq_i;
|
1182 |
|
|
wire [15:0] sdram_dq_o;
|
1183 |
|
|
wire sdram_dq_oe;
|
1184 |
|
|
|
1185 |
|
|
//
|
1186 |
|
|
// Assigns
|
1187 |
|
|
//
|
1188 |
|
|
|
1189 |
|
|
assign sdram_dq_i = sdram_dq_pad_io;
|
1190 |
|
|
assign sdram_dq_pad_io = sdram_dq_oe ? sdram_dq_o : 16'bz;
|
1191 |
|
|
|
1192 |
|
|
versatile_mem_ctrl versatile_mem_ctrl0
|
1193 |
|
|
(
|
1194 |
|
|
// External SDRAM interface
|
1195 |
|
|
.ba_pad_o (sdram_ba_pad_o[1:0]),
|
1196 |
|
|
.a_pad_o (sdram_a_pad_o[12:0]),
|
1197 |
|
|
.cs_n_pad_o (sdram_cs_n_pad_o),
|
1198 |
|
|
.ras_pad_o (sdram_ras_pad_o),
|
1199 |
|
|
.cas_pad_o (sdram_cas_pad_o),
|
1200 |
|
|
.we_pad_o (sdram_we_pad_o),
|
1201 |
|
|
.dq_i (sdram_dq_i[15:0]),
|
1202 |
|
|
.dq_o (sdram_dq_o[15:0]),
|
1203 |
|
|
.dqm_pad_o (sdram_dqm_pad_o[1:0]),
|
1204 |
|
|
.dq_oe (sdram_dq_oe),
|
1205 |
|
|
.cke_pad_o (sdram_cke_pad_o),
|
1206 |
|
|
.sdram_clk (sdram_clk),
|
1207 |
|
|
.sdram_rst (sdram_rst),
|
1208 |
|
|
`ifdef ETH0
|
1209 |
|
|
// Wishbone slave interface 0
|
1210 |
|
|
.wb_dat_i_0 ({{wbm_eth0_dat_o, wbm_eth0_sel_o},{wbs_d_mc0_dat_i, wbs_d_mc0_sel_i},{wbs_i_mc0_dat_i,wbs_i_mc0_sel_i}}),
|
1211 |
|
|
.wb_adr_i_0 ({{wbm_eth0_adr_o[31:2], wbm_eth0_we_o, wbm_eth0_bte_o, wbm_eth0_cti_o},
|
1212 |
|
|
{wbs_d_mc0_adr_i[31:2], wbs_d_mc0_we_i, wbs_d_mc0_bte_i, wbs_d_mc0_cti_i},
|
1213 |
|
|
{wbs_i_mc0_adr_i[31:2], wbs_i_mc0_we_i, wbs_i_mc0_bte_i, wbs_i_mc0_cti_i}}),
|
1214 |
|
|
.wb_cyc_i_0 ({wbm_eth0_cyc_o,wbs_d_mc0_cyc_i,wbs_i_mc0_cyc_i}),
|
1215 |
|
|
.wb_stb_i_0 ({wbm_eth0_stb_o,wbs_d_mc0_stb_i,wbs_i_mc0_stb_i}),
|
1216 |
|
|
.wb_dat_o_0 ({wbm_eth0_dat_i,wbs_d_mc0_dat_o,wbs_i_mc0_dat_o}),
|
1217 |
|
|
.wb_ack_o_0 ({wbm_eth0_ack_i,wbs_d_mc0_ack_o,wbs_i_mc0_ack_o}),
|
1218 |
|
|
`else // !`ifdef ETH0
|
1219 |
|
|
// Wishbone slave interface 0
|
1220 |
|
|
.wb_dat_i_0 ({{wbs_d_mc0_dat_i, wbs_d_mc0_sel_i},{wbs_i_mc0_dat_i,wbs_i_mc0_sel_i}}),
|
1221 |
|
|
.wb_adr_i_0 ({{wbs_d_mc0_adr_i[31:2], wbs_d_mc0_we_i, wbs_d_mc0_bte_i, wbs_d_mc0_cti_i},
|
1222 |
|
|
{wbs_i_mc0_adr_i[31:2], wbs_i_mc0_we_i, wbs_i_mc0_bte_i, wbs_i_mc0_cti_i}}),
|
1223 |
|
|
.wb_cyc_i_0 ({wbs_d_mc0_cyc_i,wbs_i_mc0_cyc_i}),
|
1224 |
|
|
.wb_stb_i_0 ({wbs_d_mc0_stb_i,wbs_i_mc0_stb_i}),
|
1225 |
|
|
.wb_dat_o_0 ({wbs_d_mc0_dat_o,wbs_i_mc0_dat_o}),
|
1226 |
|
|
.wb_ack_o_0 ({wbs_d_mc0_ack_o,wbs_i_mc0_ack_o}),
|
1227 |
|
|
`endif // !`ifdef ETH0
|
1228 |
|
|
|
1229 |
|
|
// Wishbone slave interface 1
|
1230 |
|
|
.wb_dat_i_1 (2'd0),
|
1231 |
|
|
.wb_adr_i_1 (2'd0),
|
1232 |
|
|
.wb_cyc_i_1 (2'd0),
|
1233 |
|
|
.wb_stb_i_1 (2'd0),
|
1234 |
|
|
.wb_dat_o_1 (),
|
1235 |
|
|
.wb_ack_o_1 (),
|
1236 |
|
|
|
1237 |
|
|
// Wishbone slave interface 2
|
1238 |
|
|
.wb_dat_i_2 (2'd0),
|
1239 |
|
|
.wb_adr_i_2 (2'd0),
|
1240 |
|
|
.wb_cyc_i_2 (2'd0),
|
1241 |
|
|
.wb_stb_i_2 (2'd0),
|
1242 |
|
|
.wb_dat_o_2 (),
|
1243 |
|
|
.wb_ack_o_2 (),
|
1244 |
|
|
|
1245 |
|
|
// Wishbone slave interface 3
|
1246 |
|
|
.wb_dat_i_3 (2'd0),
|
1247 |
|
|
.wb_adr_i_3 (2'd0),
|
1248 |
|
|
.wb_cyc_i_3 (2'd0),
|
1249 |
|
|
.wb_stb_i_3 (2'd0),
|
1250 |
|
|
.wb_dat_o_3 (),
|
1251 |
|
|
.wb_ack_o_3 (),
|
1252 |
|
|
|
1253 |
|
|
.wb_clk (wb_clk),
|
1254 |
|
|
.wb_rst (wb_rst)
|
1255 |
|
|
);
|
1256 |
|
|
|
1257 |
|
|
// If not using gatelevel, define parameters
|
1258 |
|
|
// Hard-set here to just 2 ports from the same domain
|
1259 |
|
|
|
1260 |
|
|
defparam versatile_mem_ctrl0.nr_of_wb_clk_domains = 1;
|
1261 |
|
|
`ifdef ETH0
|
1262 |
|
|
defparam versatile_mem_ctrl0.nr_of_wb_ports_clk0 = 3;
|
1263 |
|
|
`else
|
1264 |
|
|
defparam versatile_mem_ctrl0.nr_of_wb_ports_clk0 = 2;
|
1265 |
|
|
`endif
|
1266 |
|
|
defparam versatile_mem_ctrl0.nr_of_wb_ports_clk1 = 0;
|
1267 |
|
|
defparam versatile_mem_ctrl0.nr_of_wb_ports_clk2 = 0;
|
1268 |
|
|
defparam versatile_mem_ctrl0.nr_of_wb_ports_clk3 = 0;
|
1269 |
|
|
|
1270 |
|
|
assign wbs_i_mc0_err_o = 0;
|
1271 |
|
|
assign wbs_i_mc0_rty_o = 0;
|
1272 |
|
|
|
1273 |
|
|
assign wbs_d_mc0_err_o = 0;
|
1274 |
|
|
assign wbs_d_mc0_rty_o = 0;
|
1275 |
|
|
|
1276 |
|
|
assign wbm_eth0_err_i = 0;
|
1277 |
|
|
assign wbm_eth0_rty_i = 0;
|
1278 |
|
|
|
1279 |
|
|
|
1280 |
|
|
////////////////////////////////////////////////////////////////////////
|
1281 |
|
|
`endif // `ifdef VERSATILE_SDRAM
|
1282 |
|
|
|
1283 |
|
|
////////////////////////////////////////////////////////////////////////
|
1284 |
|
|
//
|
1285 |
|
|
// ROM
|
1286 |
|
|
//
|
1287 |
|
|
////////////////////////////////////////////////////////////////////////
|
1288 |
|
|
|
1289 |
|
|
rom rom0
|
1290 |
|
|
(
|
1291 |
|
|
.wb_dat_o (wbs_i_rom0_dat_o),
|
1292 |
|
|
.wb_ack_o (wbs_i_rom0_ack_o),
|
1293 |
|
|
.wb_adr_i (wbs_i_rom0_adr_i[(wbs_i_rom0_addr_width+2)-1:2]),
|
1294 |
|
|
.wb_stb_i (wbs_i_rom0_stb_i),
|
1295 |
|
|
.wb_cyc_i (wbs_i_rom0_cyc_i),
|
1296 |
|
|
.wb_cti_i (wbs_i_rom0_cti_i),
|
1297 |
|
|
.wb_bte_i (wbs_i_rom0_bte_i),
|
1298 |
|
|
.wb_clk (wb_clk),
|
1299 |
|
|
.wb_rst (wb_rst));
|
1300 |
|
|
|
1301 |
|
|
defparam rom0.addr_width = wbs_i_rom0_addr_width;
|
1302 |
|
|
|
1303 |
|
|
assign wbs_i_rom0_err_o = 0;
|
1304 |
|
|
assign wbs_i_rom0_rty_o = 0;
|
1305 |
|
|
|
1306 |
|
|
////////////////////////////////////////////////////////////////////////
|
1307 |
|
|
|
1308 |
|
|
|
1309 |
|
|
`ifdef ACTEL_UFR
|
1310 |
|
|
////////////////////////////////////////////////////////////////////////
|
1311 |
|
|
//
|
1312 |
|
|
// Flash ROM
|
1313 |
|
|
//
|
1314 |
|
|
////////////////////////////////////////////////////////////////////////
|
1315 |
|
|
flashrom flashrom0
|
1316 |
|
|
(
|
1317 |
|
|
.wb_dat_o (wbs_d_flashrom_dat_o),
|
1318 |
|
|
.wb_ack_o (wbs_d_flashrom_ack_o),
|
1319 |
|
|
.wb_err_o (wbs_d_flashrom_err_o),
|
1320 |
|
|
.wb_rty_o (wbs_d_flashrom_rty_o),
|
1321 |
|
|
.wb_adr_i (wbs_d_flashrom_adr_i[flashrom_wb_adr_width-1:0]),
|
1322 |
|
|
.wb_stb_i (wbs_d_flashrom_stb_i),
|
1323 |
|
|
.wb_cyc_i (wbs_d_flashrom_cyc_i),
|
1324 |
|
|
.wb_clk (wb_clk),
|
1325 |
|
|
.wb_rst (wb_rst));
|
1326 |
|
|
`else // !`ifdef ACTEL_UFR0
|
1327 |
|
|
assign wbs_d_flashrom_dat_o = 0;
|
1328 |
|
|
assign wbs_d_flashrom_ack_o = wbs_d_flashrom_stb_i;
|
1329 |
|
|
`endif // !`ifdef ACTEL_UFR0
|
1330 |
|
|
|
1331 |
|
|
assign wbs_i_rom0_err_o = 0;
|
1332 |
|
|
assign wbs_i_rom0_rty_o = 0;
|
1333 |
|
|
|
1334 |
|
|
`ifdef RAM_WB
|
1335 |
|
|
////////////////////////////////////////////////////////////////////////
|
1336 |
|
|
//
|
1337 |
|
|
// Generic RAM
|
1338 |
|
|
//
|
1339 |
|
|
////////////////////////////////////////////////////////////////////////
|
1340 |
|
|
|
1341 |
|
|
ram_wb ram_wb0
|
1342 |
|
|
(
|
1343 |
|
|
// Wishbone slave interface 0
|
1344 |
|
|
.wbm0_dat_i (wbs_i_mc0_dat_i),
|
1345 |
|
|
.wbm0_adr_i (wbs_i_mc0_adr_i),
|
1346 |
|
|
.wbm0_sel_i (wbs_i_mc0_sel_i),
|
1347 |
|
|
.wbm0_cti_i (wbs_i_mc0_cti_i),
|
1348 |
|
|
.wbm0_bte_i (wbs_i_mc0_bte_i),
|
1349 |
|
|
.wbm0_we_i (wbs_i_mc0_we_i ),
|
1350 |
|
|
.wbm0_cyc_i (wbs_i_mc0_cyc_i),
|
1351 |
|
|
.wbm0_stb_i (wbs_i_mc0_stb_i),
|
1352 |
|
|
.wbm0_dat_o (wbs_i_mc0_dat_o),
|
1353 |
|
|
.wbm0_ack_o (wbs_i_mc0_ack_o),
|
1354 |
|
|
.wbm0_err_o (),
|
1355 |
|
|
.wbm0_rty_o (),
|
1356 |
|
|
// Wishbone slave interface 1
|
1357 |
|
|
.wbm1_dat_i (wbs_d_mc0_dat_i),
|
1358 |
|
|
.wbm1_adr_i (wbs_d_mc0_adr_i),
|
1359 |
|
|
.wbm1_sel_i (wbs_d_mc0_sel_i),
|
1360 |
|
|
.wbm1_cti_i (wbs_d_mc0_cti_i),
|
1361 |
|
|
.wbm1_bte_i (wbs_d_mc0_bte_i),
|
1362 |
|
|
.wbm1_we_i (wbs_d_mc0_we_i ),
|
1363 |
|
|
.wbm1_cyc_i (wbs_d_mc0_cyc_i),
|
1364 |
|
|
.wbm1_stb_i (wbs_d_mc0_stb_i),
|
1365 |
|
|
.wbm1_dat_o (wbs_d_mc0_dat_o),
|
1366 |
|
|
.wbm1_ack_o (wbs_d_mc0_ack_o),
|
1367 |
|
|
.wbm1_err_o (),
|
1368 |
|
|
.wbm1_rty_o (),
|
1369 |
|
|
// Clock, reset
|
1370 |
|
|
.wb_clk_i (wb_clk),
|
1371 |
|
|
.wb_rst_i (wb_rst));
|
1372 |
|
|
|
1373 |
|
|
assign wbs_i_mc0_err_o = 0;
|
1374 |
|
|
assign wbs_i_mc0_rty_o = 0;
|
1375 |
|
|
|
1376 |
|
|
assign wbs_d_mc0_err_o = 0;
|
1377 |
|
|
assign wbs_d_mc0_rty_o = 0;
|
1378 |
|
|
|
1379 |
|
|
defparam ram_wb0.aw = wb_aw;
|
1380 |
|
|
defparam ram_wb0.dw = wb_dw;
|
1381 |
|
|
defparam ram_wb0.mem_span = internal_sram_mem_span;
|
1382 |
|
|
defparam ram_wb0.adr_width_for_span = internal_sram_adr_width_for_span;
|
1383 |
|
|
////////////////////////////////////////////////////////////////////////
|
1384 |
|
|
`endif // `ifdef RAM_WB
|
1385 |
|
|
|
1386 |
|
|
|
1387 |
|
|
`ifdef ETH0
|
1388 |
|
|
|
1389 |
|
|
//
|
1390 |
|
|
// Wires
|
1391 |
|
|
//
|
1392 |
|
|
wire eth0_irq;
|
1393 |
|
|
wire [3:0] eth0_mtxd;
|
1394 |
|
|
wire eth0_mtxen;
|
1395 |
|
|
wire eth0_mtxerr;
|
1396 |
|
|
wire eth0_mtx_clk;
|
1397 |
|
|
wire eth0_mrx_clk;
|
1398 |
|
|
wire [3:0] eth0_mrxd;
|
1399 |
|
|
wire eth0_mrxdv;
|
1400 |
|
|
wire eth0_mrxerr;
|
1401 |
|
|
wire eth0_mcoll;
|
1402 |
|
|
wire eth0_mcrs;
|
1403 |
|
|
wire eth0_speed;
|
1404 |
|
|
wire eth0_duplex;
|
1405 |
|
|
wire eth0_link;
|
1406 |
|
|
// Management interface wires
|
1407 |
|
|
wire eth0_md_i;
|
1408 |
|
|
wire eth0_md_o;
|
1409 |
|
|
wire eth0_md_oe;
|
1410 |
|
|
|
1411 |
|
|
|
1412 |
|
|
//
|
1413 |
|
|
// assigns
|
1414 |
|
|
`ifdef SMII0
|
1415 |
|
|
smii smii0
|
1416 |
|
|
(
|
1417 |
|
|
// SMII pads
|
1418 |
|
|
.eth_sync_pad_o (eth0_smii_sync_pad_o),
|
1419 |
|
|
.eth_tx_pad_o (eth0_smii_tx_pad_o),
|
1420 |
|
|
.eth_rx_pad_i (eth0_smii_rx_pad_i),
|
1421 |
|
|
|
1422 |
|
|
// MII interface to MAC
|
1423 |
|
|
// Transmit
|
1424 |
|
|
.mtx_clk (eth0_mtx_clk),
|
1425 |
|
|
.mtxd (eth0_mtxd[3:0]),
|
1426 |
|
|
.mtxen (eth0_mtxen),
|
1427 |
|
|
.mtxerr (eth0_mtxerr),
|
1428 |
|
|
.mrxd (eth0_mrxd[3:0]),
|
1429 |
|
|
// Receive
|
1430 |
|
|
.mrxdv (eth0_mrxdv),
|
1431 |
|
|
.mrxerr (eth0_mrxerr),
|
1432 |
|
|
.mrx_clk (eth0_mrx_clk),
|
1433 |
|
|
// Status signals
|
1434 |
|
|
.mcoll (eth0_mcoll),
|
1435 |
|
|
.mcrs (eth0_mcrs),
|
1436 |
|
|
.speed (eth0_speed),
|
1437 |
|
|
.duplex (eth0_duplex),
|
1438 |
|
|
.link (eth0_link),
|
1439 |
|
|
|
1440 |
|
|
// Inputs
|
1441 |
|
|
.eth_clk (eth_smii_clk),
|
1442 |
|
|
.eth_rst (eth_smii_rst)
|
1443 |
|
|
);
|
1444 |
|
|
|
1445 |
|
|
`else // !`ifdef SMII0
|
1446 |
|
|
|
1447 |
|
|
// Hook up MII wires
|
1448 |
|
|
assign eth0_mtx_clk = eth0_tx_clk;
|
1449 |
|
|
assign eth0_tx_data = eth0_mtxd[3:0];
|
1450 |
|
|
assign eth0_tx_en = eth0_mtxen;
|
1451 |
|
|
assign eth0_tx_er = eth0_mtxerr;
|
1452 |
|
|
assign eth0_mrxd[3:0] = eth0_rx_data;
|
1453 |
|
|
assign eth0_mrxdv = eth0_dv;
|
1454 |
|
|
assign eth0_mrxerr = eth0_rx_er;
|
1455 |
|
|
assign eth0_mrx_clk = eth0_rx_clk;
|
1456 |
|
|
assign eth0_mcoll = eth0_col;
|
1457 |
|
|
assign eth0_mcrs = eth0_crs;
|
1458 |
|
|
|
1459 |
|
|
`endif // !`ifdef SMII0
|
1460 |
|
|
|
1461 |
|
|
`ifdef XILINX
|
1462 |
|
|
// Xilinx primitive for MDIO tristate
|
1463 |
|
|
IOBUF iobuf_phy_smi_data
|
1464 |
|
|
(
|
1465 |
|
|
// Outputs
|
1466 |
|
|
.O (eth0_md_i),
|
1467 |
|
|
// Inouts
|
1468 |
|
|
.IO (eth0_md_pad_io),
|
1469 |
|
|
// Inputs
|
1470 |
|
|
.I (eth0_md_o),
|
1471 |
|
|
.T (!eth0_md_oe));
|
1472 |
|
|
`else // !`ifdef XILINX
|
1473 |
|
|
|
1474 |
|
|
// Generic technology tristate control for management interface
|
1475 |
|
|
assign eth0_md_pad_io = eth0_md_oe ? eth0_md_o : 1'bz;
|
1476 |
|
|
assign eth0_md_i = eth0_md_pad_io;
|
1477 |
|
|
|
1478 |
|
|
`endif // !`ifdef XILINX
|
1479 |
|
|
|
1480 |
|
|
`ifdef ETH0_PHY_RST
|
1481 |
|
|
assign eth0_rst_n_o = !wb_rst;
|
1482 |
|
|
`endif
|
1483 |
|
|
|
1484 |
409 |
julius |
ethmac ethmac0
|
1485 |
408 |
julius |
(
|
1486 |
|
|
// Wishbone Slave interface
|
1487 |
|
|
.wb_clk_i (wb_clk),
|
1488 |
|
|
.wb_rst_i (wb_rst),
|
1489 |
|
|
.wb_dat_i (wbs_d_eth0_dat_i[31:0]),
|
1490 |
|
|
.wb_adr_i (wbs_d_eth0_adr_i[wbs_d_eth0_addr_width-1:2]),
|
1491 |
|
|
.wb_sel_i (wbs_d_eth0_sel_i[3:0]),
|
1492 |
|
|
.wb_we_i (wbs_d_eth0_we_i),
|
1493 |
|
|
.wb_cyc_i (wbs_d_eth0_cyc_i),
|
1494 |
|
|
.wb_stb_i (wbs_d_eth0_stb_i),
|
1495 |
|
|
.wb_dat_o (wbs_d_eth0_dat_o[31:0]),
|
1496 |
|
|
.wb_err_o (wbs_d_eth0_err_o),
|
1497 |
|
|
.wb_ack_o (wbs_d_eth0_ack_o),
|
1498 |
|
|
// Wishbone Master Interface
|
1499 |
|
|
.m_wb_adr_o (wbm_eth0_adr_o[31:0]),
|
1500 |
|
|
.m_wb_sel_o (wbm_eth0_sel_o[3:0]),
|
1501 |
|
|
.m_wb_we_o (wbm_eth0_we_o),
|
1502 |
|
|
.m_wb_dat_o (wbm_eth0_dat_o[31:0]),
|
1503 |
|
|
.m_wb_cyc_o (wbm_eth0_cyc_o),
|
1504 |
|
|
.m_wb_stb_o (wbm_eth0_stb_o),
|
1505 |
|
|
.m_wb_cti_o (wbm_eth0_cti_o[2:0]),
|
1506 |
|
|
.m_wb_bte_o (wbm_eth0_bte_o[1:0]),
|
1507 |
|
|
.m_wb_dat_i (wbm_eth0_dat_i[31:0]),
|
1508 |
|
|
.m_wb_ack_i (wbm_eth0_ack_i),
|
1509 |
|
|
.m_wb_err_i (wbm_eth0_err_i),
|
1510 |
|
|
|
1511 |
|
|
// Ethernet MII interface
|
1512 |
|
|
// Transmit
|
1513 |
|
|
.mtxd_pad_o (eth0_mtxd[3:0]),
|
1514 |
|
|
.mtxen_pad_o (eth0_mtxen),
|
1515 |
|
|
.mtxerr_pad_o (eth0_mtxerr),
|
1516 |
|
|
.mtx_clk_pad_i (eth0_mtx_clk),
|
1517 |
|
|
// Receive
|
1518 |
|
|
.mrx_clk_pad_i (eth0_mrx_clk),
|
1519 |
|
|
.mrxd_pad_i (eth0_mrxd[3:0]),
|
1520 |
|
|
.mrxdv_pad_i (eth0_mrxdv),
|
1521 |
|
|
.mrxerr_pad_i (eth0_mrxerr),
|
1522 |
|
|
.mcoll_pad_i (eth0_mcoll),
|
1523 |
|
|
.mcrs_pad_i (eth0_mcrs),
|
1524 |
|
|
// Management interface
|
1525 |
|
|
.md_pad_i (eth0_md_i),
|
1526 |
|
|
.mdc_pad_o (eth0_mdc_pad_o),
|
1527 |
|
|
.md_pad_o (eth0_md_o),
|
1528 |
|
|
.md_padoe_o (eth0_md_oe),
|
1529 |
|
|
|
1530 |
|
|
// Processor interrupt
|
1531 |
|
|
.int_o (eth0_irq)
|
1532 |
|
|
|
1533 |
|
|
/*
|
1534 |
|
|
.mbist_so_o (),
|
1535 |
|
|
.mbist_si_i (),
|
1536 |
|
|
.mbist_ctrl_i ()
|
1537 |
|
|
*/
|
1538 |
|
|
|
1539 |
|
|
);
|
1540 |
|
|
|
1541 |
|
|
assign wbs_d_eth0_rty_o = 0;
|
1542 |
|
|
|
1543 |
|
|
`else
|
1544 |
|
|
assign wbs_d_eth0_dat_o = 0;
|
1545 |
|
|
assign wbs_d_eth0_err_o = 0;
|
1546 |
|
|
assign wbs_d_eth0_ack_o = 0;
|
1547 |
|
|
assign wbs_d_eth0_rty_o = 0;
|
1548 |
|
|
assign wbm_eth0_adr_o = 0;
|
1549 |
|
|
assign wbm_eth0_sel_o = 0;
|
1550 |
|
|
assign wbm_eth0_we_o = 0;
|
1551 |
|
|
assign wbm_eth0_dat_o = 0;
|
1552 |
|
|
assign wbm_eth0_cyc_o = 0;
|
1553 |
|
|
assign wbm_eth0_stb_o = 0;
|
1554 |
|
|
assign wbm_eth0_cti_o = 0;
|
1555 |
|
|
assign wbm_eth0_bte_o = 0;
|
1556 |
|
|
`endif
|
1557 |
|
|
|
1558 |
|
|
`ifdef UART0
|
1559 |
|
|
////////////////////////////////////////////////////////////////////////
|
1560 |
|
|
//
|
1561 |
|
|
// UART0
|
1562 |
|
|
//
|
1563 |
|
|
////////////////////////////////////////////////////////////////////////
|
1564 |
|
|
|
1565 |
|
|
//
|
1566 |
|
|
// Wires
|
1567 |
|
|
//
|
1568 |
|
|
wire uart0_irq;
|
1569 |
|
|
|
1570 |
|
|
//
|
1571 |
|
|
// Assigns
|
1572 |
|
|
//
|
1573 |
|
|
assign wbs_d_uart0_err_o = 0;
|
1574 |
|
|
assign wbs_d_uart0_rty_o = 0;
|
1575 |
|
|
|
1576 |
|
|
uart16550 uart16550_0
|
1577 |
|
|
(
|
1578 |
|
|
// Wishbone slave interface
|
1579 |
|
|
.wb_clk_i (wb_clk),
|
1580 |
|
|
.wb_rst_i (wb_rst),
|
1581 |
|
|
.wb_adr_i (wbs_d_uart0_adr_i[uart0_addr_width-1:0]),
|
1582 |
|
|
.wb_dat_i (wbs_d_uart0_dat_i),
|
1583 |
|
|
.wb_we_i (wbs_d_uart0_we_i),
|
1584 |
|
|
.wb_stb_i (wbs_d_uart0_stb_i),
|
1585 |
|
|
.wb_cyc_i (wbs_d_uart0_cyc_i),
|
1586 |
|
|
//.wb_sel_i (),
|
1587 |
|
|
.wb_dat_o (wbs_d_uart0_dat_o),
|
1588 |
|
|
.wb_ack_o (wbs_d_uart0_ack_o),
|
1589 |
|
|
|
1590 |
|
|
.int_o (uart0_irq),
|
1591 |
|
|
.stx_pad_o (uart0_stx_pad_o),
|
1592 |
|
|
.rts_pad_o (),
|
1593 |
|
|
.dtr_pad_o (),
|
1594 |
|
|
// .baud_o (),
|
1595 |
|
|
// Inputs
|
1596 |
|
|
.srx_pad_i (uart0_srx_pad_i),
|
1597 |
|
|
.cts_pad_i (1'b0),
|
1598 |
|
|
.dsr_pad_i (1'b0),
|
1599 |
|
|
.ri_pad_i (1'b0),
|
1600 |
|
|
.dcd_pad_i (1'b0));
|
1601 |
|
|
|
1602 |
|
|
////////////////////////////////////////////////////////////////////////
|
1603 |
|
|
`else // !`ifdef UART0
|
1604 |
|
|
|
1605 |
|
|
//
|
1606 |
|
|
// Assigns
|
1607 |
|
|
//
|
1608 |
|
|
assign wbs_d_uart0_err_o = 0;
|
1609 |
|
|
assign wbs_d_uart0_rty_o = 0;
|
1610 |
|
|
assign wbs_d_uart0_ack_o = 0;
|
1611 |
|
|
assign wbs_d_uart0_dat_o = 0;
|
1612 |
|
|
|
1613 |
|
|
////////////////////////////////////////////////////////////////////////
|
1614 |
|
|
`endif // !`ifdef UART0
|
1615 |
|
|
|
1616 |
|
|
`ifdef SPI0
|
1617 |
|
|
////////////////////////////////////////////////////////////////////////
|
1618 |
|
|
//
|
1619 |
|
|
// SPI0 controller
|
1620 |
|
|
//
|
1621 |
|
|
////////////////////////////////////////////////////////////////////////
|
1622 |
|
|
|
1623 |
|
|
//
|
1624 |
|
|
// Wires
|
1625 |
|
|
//
|
1626 |
|
|
wire spi0_irq;
|
1627 |
|
|
|
1628 |
|
|
//
|
1629 |
|
|
// Assigns
|
1630 |
|
|
//
|
1631 |
|
|
assign wbs_d_spi0_err_o = 0;
|
1632 |
|
|
assign wbs_d_spi0_rty_o = 0;
|
1633 |
|
|
assign spi0_hold_n_o = 1;
|
1634 |
|
|
assign spi0_w_n_o = 1;
|
1635 |
|
|
|
1636 |
|
|
|
1637 |
|
|
simple_spi spi0
|
1638 |
|
|
(
|
1639 |
|
|
// Wishbone slave interface
|
1640 |
|
|
.clk_i (wb_clk),
|
1641 |
|
|
.rst_i (wb_rst),
|
1642 |
|
|
.cyc_i (wbs_d_spi0_cyc_i),
|
1643 |
|
|
.stb_i (wbs_d_spi0_stb_i),
|
1644 |
|
|
.adr_i (wbs_d_spi0_adr_i[spi0_wb_adr_width-1:0]),
|
1645 |
|
|
.we_i (wbs_d_spi0_we_i),
|
1646 |
|
|
.dat_i (wbs_d_spi0_dat_i),
|
1647 |
|
|
.dat_o (wbs_d_spi0_dat_o),
|
1648 |
|
|
.ack_o (wbs_d_spi0_ack_o),
|
1649 |
|
|
// SPI IRQ
|
1650 |
|
|
.inta_o (spi0_irq),
|
1651 |
|
|
// External SPI interface
|
1652 |
|
|
.sck_o (spi0_sck_o),
|
1653 |
|
|
`ifdef SPI0_SLAVE_SELECTS
|
1654 |
|
|
.ss_o (spi0_ss_o),
|
1655 |
|
|
`else
|
1656 |
|
|
.ss_o (),
|
1657 |
|
|
`endif
|
1658 |
|
|
.mosi_o (spi0_mosi_o),
|
1659 |
|
|
.miso_i (spi0_miso_i)
|
1660 |
|
|
);
|
1661 |
|
|
|
1662 |
|
|
defparam spi0.slave_select_width = spi0_ss_width;
|
1663 |
|
|
|
1664 |
|
|
////////////////////////////////////////////////////////////////////////
|
1665 |
|
|
`else // !`ifdef SPI0
|
1666 |
|
|
|
1667 |
|
|
//
|
1668 |
|
|
// Assigns
|
1669 |
|
|
//
|
1670 |
|
|
assign wbs_d_spi0_dat_o = 0;
|
1671 |
|
|
assign wbs_d_spi0_ack_o = 0;
|
1672 |
|
|
assign wbs_d_spi0_err_o = 0;
|
1673 |
|
|
assign wbs_d_spi0_rty_o = 0;
|
1674 |
|
|
|
1675 |
|
|
////////////////////////////////////////////////////////////////////////
|
1676 |
|
|
`endif // !`ifdef SPI0
|
1677 |
|
|
|
1678 |
|
|
|
1679 |
|
|
`ifdef SPI1
|
1680 |
|
|
////////////////////////////////////////////////////////////////////////
|
1681 |
|
|
//
|
1682 |
|
|
// SPI1 controller
|
1683 |
|
|
//
|
1684 |
|
|
////////////////////////////////////////////////////////////////////////
|
1685 |
|
|
|
1686 |
|
|
//
|
1687 |
|
|
// Wires
|
1688 |
|
|
//
|
1689 |
|
|
wire spi1_irq;
|
1690 |
|
|
|
1691 |
|
|
//
|
1692 |
|
|
// Assigns
|
1693 |
|
|
//
|
1694 |
|
|
assign wbs_d_spi1_err_o = 0;
|
1695 |
|
|
assign wbs_d_spi1_rty_o = 0;
|
1696 |
|
|
|
1697 |
|
|
simple_spi spi1
|
1698 |
|
|
(
|
1699 |
|
|
// Wishbone slave interface
|
1700 |
|
|
.clk_i (wb_clk),
|
1701 |
|
|
.rst_i (wb_rst),
|
1702 |
|
|
.cyc_i (wbs_d_spi1_cyc_i),
|
1703 |
|
|
.stb_i (wbs_d_spi1_stb_i),
|
1704 |
|
|
.adr_i (wbs_d_spi1_adr_i[spi1_wb_adr_width-1:0]),
|
1705 |
|
|
.we_i (wbs_d_spi1_we_i),
|
1706 |
|
|
.dat_i (wbs_d_spi1_dat_i),
|
1707 |
|
|
.dat_o (wbs_d_spi1_dat_o),
|
1708 |
|
|
.ack_o (wbs_d_spi1_ack_o),
|
1709 |
|
|
// SPI IRQ
|
1710 |
|
|
.inta_o (spi1_irq),
|
1711 |
|
|
// External SPI interface
|
1712 |
|
|
.sck_o (spi1_sck_o),
|
1713 |
|
|
`ifdef SPI1_SLAVE_SELECTS
|
1714 |
|
|
.ss_o (spi1_ss_o),
|
1715 |
|
|
`else
|
1716 |
|
|
.ss_o (),
|
1717 |
|
|
`endif
|
1718 |
|
|
.mosi_o (spi1_mosi_o),
|
1719 |
|
|
.miso_i (spi1_miso_i)
|
1720 |
|
|
);
|
1721 |
|
|
|
1722 |
|
|
defparam spi1.slave_select_width = spi1_ss_width;
|
1723 |
|
|
|
1724 |
|
|
////////////////////////////////////////////////////////////////////////
|
1725 |
|
|
`else // !`ifdef SPI1
|
1726 |
|
|
|
1727 |
|
|
//
|
1728 |
|
|
// Assigns
|
1729 |
|
|
//
|
1730 |
|
|
assign wbs_d_spi1_dat_o = 0;
|
1731 |
|
|
assign wbs_d_spi1_ack_o = 0;
|
1732 |
|
|
assign wbs_d_spi1_err_o = 0;
|
1733 |
|
|
assign wbs_d_spi1_rty_o = 0;
|
1734 |
|
|
|
1735 |
|
|
////////////////////////////////////////////////////////////////////////
|
1736 |
|
|
`endif // !`ifdef SPI1
|
1737 |
|
|
|
1738 |
|
|
|
1739 |
|
|
`ifdef SPI2
|
1740 |
|
|
////////////////////////////////////////////////////////////////////////
|
1741 |
|
|
//
|
1742 |
|
|
// SPI2 controller
|
1743 |
|
|
//
|
1744 |
|
|
////////////////////////////////////////////////////////////////////////
|
1745 |
|
|
|
1746 |
|
|
//
|
1747 |
|
|
// Wires
|
1748 |
|
|
//
|
1749 |
|
|
wire spi2_irq;
|
1750 |
|
|
|
1751 |
|
|
//
|
1752 |
|
|
// Assigns
|
1753 |
|
|
//
|
1754 |
|
|
assign wbs_d_spi2_err_o = 0;
|
1755 |
|
|
assign wbs_d_spi2_rty_o = 0;
|
1756 |
|
|
|
1757 |
|
|
simple_spi spi2
|
1758 |
|
|
(
|
1759 |
|
|
// Wishbone slave interface
|
1760 |
|
|
.clk_i (wb_clk),
|
1761 |
|
|
.rst_i (wb_rst),
|
1762 |
|
|
.cyc_i (wbs_d_spi2_cyc_i),
|
1763 |
|
|
.stb_i (wbs_d_spi2_stb_i),
|
1764 |
|
|
.adr_i (wbs_d_spi2_adr_i[spi2_wb_adr_width-1:0]),
|
1765 |
|
|
.we_i (wbs_d_spi2_we_i),
|
1766 |
|
|
.dat_i (wbs_d_spi2_dat_i),
|
1767 |
|
|
.dat_o (wbs_d_spi2_dat_o),
|
1768 |
|
|
.ack_o (wbs_d_spi2_ack_o),
|
1769 |
|
|
// SPI IRQ
|
1770 |
|
|
.inta_o (spi2_irq),
|
1771 |
|
|
// External SPI interface
|
1772 |
|
|
.sck_o (spi2_sck_o),
|
1773 |
|
|
`ifdef SPI2_SLAVE_SELECTS
|
1774 |
|
|
.ss_o (spi2_ss_o),
|
1775 |
|
|
`else
|
1776 |
|
|
.ss_o (),
|
1777 |
|
|
`endif
|
1778 |
|
|
.mosi_o (spi2_mosi_o),
|
1779 |
|
|
.miso_i (spi2_miso_i)
|
1780 |
|
|
);
|
1781 |
|
|
|
1782 |
|
|
defparam spi2.slave_select_width = spi2_ss_width;
|
1783 |
|
|
|
1784 |
|
|
////////////////////////////////////////////////////////////////////////
|
1785 |
|
|
`else // !`ifdef SPI2
|
1786 |
|
|
|
1787 |
|
|
//
|
1788 |
|
|
// Assigns
|
1789 |
|
|
//
|
1790 |
|
|
assign wbs_d_spi2_dat_o = 0;
|
1791 |
|
|
assign wbs_d_spi2_ack_o = 0;
|
1792 |
|
|
assign wbs_d_spi2_err_o = 0;
|
1793 |
|
|
assign wbs_d_spi2_rty_o = 0;
|
1794 |
|
|
|
1795 |
|
|
////////////////////////////////////////////////////////////////////////
|
1796 |
|
|
`endif // !`ifdef SPI2
|
1797 |
|
|
|
1798 |
|
|
|
1799 |
|
|
`ifdef I2C0
|
1800 |
|
|
////////////////////////////////////////////////////////////////////////
|
1801 |
|
|
//
|
1802 |
|
|
// i2c controller 0
|
1803 |
|
|
//
|
1804 |
|
|
////////////////////////////////////////////////////////////////////////
|
1805 |
|
|
|
1806 |
|
|
//
|
1807 |
|
|
// Wires
|
1808 |
|
|
//
|
1809 |
|
|
wire i2c0_irq;
|
1810 |
|
|
wire scl0_pad_o;
|
1811 |
|
|
wire scl0_padoen_o;
|
1812 |
|
|
wire sda0_pad_o;
|
1813 |
|
|
wire sda0_padoen_o;
|
1814 |
|
|
|
1815 |
|
|
i2c_master_slave
|
1816 |
|
|
#
|
1817 |
|
|
(
|
1818 |
|
|
.DEFAULT_SLAVE_ADDR(HV0_SADR)
|
1819 |
|
|
)
|
1820 |
|
|
i2c_master_slave0
|
1821 |
|
|
(
|
1822 |
|
|
.wb_clk_i (wb_clk),
|
1823 |
|
|
.wb_rst_i (wb_rst),
|
1824 |
|
|
.arst_i (wb_rst),
|
1825 |
|
|
.wb_adr_i (wbs_d_i2c0_adr_i[i2c_0_wb_adr_width-1:0]),
|
1826 |
|
|
.wb_dat_i (wbs_d_i2c0_dat_i),
|
1827 |
|
|
.wb_we_i (wbs_d_i2c0_we_i ),
|
1828 |
|
|
.wb_cyc_i (wbs_d_i2c0_cyc_i),
|
1829 |
|
|
.wb_stb_i (wbs_d_i2c0_stb_i),
|
1830 |
|
|
.wb_dat_o (wbs_d_i2c0_dat_o),
|
1831 |
|
|
.wb_ack_o (wbs_d_i2c0_ack_o),
|
1832 |
|
|
.scl_pad_i (i2c0_scl_io ),
|
1833 |
|
|
.scl_pad_o (scl0_pad_o ),
|
1834 |
|
|
.scl_padoen_o (scl0_padoen_o ),
|
1835 |
|
|
.sda_pad_i (i2c0_sda_io ),
|
1836 |
|
|
.sda_pad_o (sda0_pad_o ),
|
1837 |
|
|
.sda_padoen_o (sda0_padoen_o ),
|
1838 |
|
|
|
1839 |
|
|
// Interrupt
|
1840 |
|
|
.wb_inta_o (i2c0_irq)
|
1841 |
|
|
|
1842 |
|
|
);
|
1843 |
|
|
|
1844 |
|
|
assign wbs_d_i2c0_err_o = 0;
|
1845 |
|
|
assign wbs_d_i2c0_rty_o = 0;
|
1846 |
|
|
|
1847 |
|
|
// i2c phy lines
|
1848 |
|
|
assign i2c0_scl_io = scl0_padoen_o ? 1'bz : scl0_pad_o;
|
1849 |
|
|
assign i2c0_sda_io = sda0_padoen_o ? 1'bz : sda0_pad_o;
|
1850 |
|
|
|
1851 |
|
|
|
1852 |
|
|
////////////////////////////////////////////////////////////////////////
|
1853 |
|
|
`else // !`ifdef I2C0
|
1854 |
|
|
|
1855 |
|
|
assign wbs_d_i2c0_dat_o = 0;
|
1856 |
|
|
assign wbs_d_i2c0_ack_o = 0;
|
1857 |
|
|
assign wbs_d_i2c0_err_o = 0;
|
1858 |
|
|
assign wbs_d_i2c0_rty_o = 0;
|
1859 |
|
|
|
1860 |
|
|
////////////////////////////////////////////////////////////////////////
|
1861 |
|
|
`endif // !`ifdef I2C0
|
1862 |
|
|
|
1863 |
|
|
`ifdef I2C1
|
1864 |
|
|
////////////////////////////////////////////////////////////////////////
|
1865 |
|
|
//
|
1866 |
|
|
// i2c controller 1
|
1867 |
|
|
//
|
1868 |
|
|
////////////////////////////////////////////////////////////////////////
|
1869 |
|
|
|
1870 |
|
|
//
|
1871 |
|
|
// Wires
|
1872 |
|
|
//
|
1873 |
|
|
wire i2c1_irq;
|
1874 |
|
|
wire scl1_pad_o;
|
1875 |
|
|
wire scl1_padoen_o;
|
1876 |
|
|
wire sda1_pad_o;
|
1877 |
|
|
wire sda1_padoen_o;
|
1878 |
|
|
|
1879 |
|
|
i2c_master_slave
|
1880 |
|
|
#
|
1881 |
|
|
(
|
1882 |
|
|
.DEFAULT_SLAVE_ADDR(HV1_SADR)
|
1883 |
|
|
)
|
1884 |
|
|
i2c_master_slave1
|
1885 |
|
|
(
|
1886 |
|
|
.wb_clk_i (wb_clk),
|
1887 |
|
|
.wb_rst_i (wb_rst),
|
1888 |
|
|
.arst_i (wb_rst),
|
1889 |
|
|
.wb_adr_i (wbs_d_i2c1_adr_i[i2c_1_wb_adr_width-1:0]),
|
1890 |
|
|
.wb_dat_i (wbs_d_i2c1_dat_i),
|
1891 |
|
|
.wb_we_i (wbs_d_i2c1_we_i ),
|
1892 |
|
|
.wb_cyc_i (wbs_d_i2c1_cyc_i),
|
1893 |
|
|
.wb_stb_i (wbs_d_i2c1_stb_i),
|
1894 |
|
|
.wb_dat_o (wbs_d_i2c1_dat_o),
|
1895 |
|
|
.wb_ack_o (wbs_d_i2c1_ack_o),
|
1896 |
|
|
.scl_pad_i (i2c1_scl_io ),
|
1897 |
|
|
.scl_pad_o (scl1_pad_o ),
|
1898 |
|
|
.scl_padoen_o (scl1_padoen_o ),
|
1899 |
|
|
.sda_pad_i (i2c1_sda_io ),
|
1900 |
|
|
.sda_pad_o (sda1_pad_o ),
|
1901 |
|
|
.sda_padoen_o (sda1_padoen_o ),
|
1902 |
|
|
|
1903 |
|
|
// Interrupt
|
1904 |
|
|
.wb_inta_o (i2c1_irq)
|
1905 |
|
|
|
1906 |
|
|
);
|
1907 |
|
|
|
1908 |
|
|
assign wbs_d_i2c1_err_o = 0;
|
1909 |
|
|
assign wbs_d_i2c1_rty_o = 0;
|
1910 |
|
|
|
1911 |
|
|
// i2c phy lines
|
1912 |
|
|
assign i2c1_scl_io = scl1_padoen_o ? 1'bz : scl1_pad_o;
|
1913 |
|
|
assign i2c1_sda_io = sda1_padoen_o ? 1'bz : sda1_pad_o;
|
1914 |
|
|
|
1915 |
|
|
////////////////////////////////////////////////////////////////////////
|
1916 |
|
|
`else // !`ifdef I2C1
|
1917 |
|
|
|
1918 |
|
|
assign wbs_d_i2c1_dat_o = 0;
|
1919 |
|
|
assign wbs_d_i2c1_ack_o = 0;
|
1920 |
|
|
assign wbs_d_i2c1_err_o = 0;
|
1921 |
|
|
assign wbs_d_i2c1_rty_o = 0;
|
1922 |
|
|
|
1923 |
|
|
////////////////////////////////////////////////////////////////////////
|
1924 |
|
|
`endif // !`ifdef I2C1
|
1925 |
|
|
|
1926 |
|
|
`ifdef I2C2
|
1927 |
|
|
////////////////////////////////////////////////////////////////////////
|
1928 |
|
|
//
|
1929 |
|
|
// i2c controller 2
|
1930 |
|
|
//
|
1931 |
|
|
////////////////////////////////////////////////////////////////////////
|
1932 |
|
|
|
1933 |
|
|
//
|
1934 |
|
|
// Wires
|
1935 |
|
|
//
|
1936 |
|
|
wire i2c2_irq;
|
1937 |
|
|
wire scl2_pad_o;
|
1938 |
|
|
wire scl2_padoen_o;
|
1939 |
|
|
wire sda2_pad_o;
|
1940 |
|
|
wire sda2_padoen_o;
|
1941 |
|
|
|
1942 |
|
|
i2c_master_slave
|
1943 |
|
|
#
|
1944 |
|
|
(
|
1945 |
|
|
.DEFAULT_SLAVE_ADDR(HV2_SADR)
|
1946 |
|
|
)
|
1947 |
|
|
hv_i2c_master_slave2
|
1948 |
|
|
(
|
1949 |
|
|
.wb_clk_i (wb_clk),
|
1950 |
|
|
.wb_rst_i (wb_rst),
|
1951 |
|
|
.arst_i (wb_rst),
|
1952 |
|
|
.wb_adr_i (wbs_d_i2c2_adr_i[i2c_2_wb_adr_width-1:0]),
|
1953 |
|
|
.wb_dat_i (wbs_d_i2c2_dat_i),
|
1954 |
|
|
.wb_we_i (wbs_d_i2c2_we_i ),
|
1955 |
|
|
.wb_cyc_i (wbs_d_i2c2_cyc_i),
|
1956 |
|
|
.wb_stb_i (wbs_d_i2c2_stb_i),
|
1957 |
|
|
.wb_dat_o (wbs_d_i2c2_dat_o),
|
1958 |
|
|
.wb_ack_o (wbs_d_i2c2_ack_o),
|
1959 |
|
|
.scl_pad_i (i2c2_scl_io ),
|
1960 |
|
|
.scl_pad_o (scl2_pad_o ),
|
1961 |
|
|
.scl_padoen_o (scl2_padoen_o ),
|
1962 |
|
|
.sda_pad_i (i2c2_sda_io ),
|
1963 |
|
|
.sda_pad_o (sda2_pad_o ),
|
1964 |
|
|
.sda_padoen_o (sda2_padoen_o ),
|
1965 |
|
|
|
1966 |
|
|
// Interrupt
|
1967 |
|
|
.wb_inta_o (i2c2_irq)
|
1968 |
|
|
|
1969 |
|
|
);
|
1970 |
|
|
|
1971 |
|
|
assign wbs_d_i2c2_err_o = 0;
|
1972 |
|
|
assign wbs_d_i2c2_rty_o = 0;
|
1973 |
|
|
|
1974 |
|
|
// i2c phy lines
|
1975 |
|
|
assign i2c2_sda_io = scl2_padoen_o ? 1'bz : scl2_pad_o;
|
1976 |
|
|
assign i2c2_scl_io = sda2_padoen_o ? 1'bz : sda2_pad_o;
|
1977 |
|
|
|
1978 |
|
|
////////////////////////////////////////////////////////////////////////
|
1979 |
|
|
|
1980 |
|
|
`else // !`ifdef I2C2
|
1981 |
|
|
|
1982 |
|
|
assign wbs_d_i2c2_dat_o = 0;
|
1983 |
|
|
assign wbs_d_i2c2_ack_o = 0;
|
1984 |
|
|
assign wbs_d_i2c2_err_o = 0;
|
1985 |
|
|
assign wbs_d_i2c2_rty_o = 0;
|
1986 |
|
|
|
1987 |
|
|
////////////////////////////////////////////////////////////////////////
|
1988 |
|
|
|
1989 |
|
|
`endif // !`ifdef I2C2
|
1990 |
|
|
|
1991 |
|
|
`ifdef I2C3
|
1992 |
|
|
////////////////////////////////////////////////////////////////////////
|
1993 |
|
|
//
|
1994 |
|
|
// i2c controller 3
|
1995 |
|
|
//
|
1996 |
|
|
////////////////////////////////////////////////////////////////////////
|
1997 |
|
|
|
1998 |
|
|
//
|
1999 |
|
|
// Wires
|
2000 |
|
|
//
|
2001 |
|
|
wire i2c3_irq;
|
2002 |
|
|
wire scl3_pad_o;
|
2003 |
|
|
wire scl3_padoen_o;
|
2004 |
|
|
wire sda3_pad_o;
|
2005 |
|
|
wire sda3_padoen_o;
|
2006 |
|
|
|
2007 |
|
|
hv_i2c_master_slave
|
2008 |
|
|
#
|
2009 |
|
|
(
|
2010 |
|
|
.DEFAULT_SLAVE_ADDR(HV3_SADR)
|
2011 |
|
|
)
|
2012 |
|
|
hv_i2c_master_slave3
|
2013 |
|
|
(
|
2014 |
|
|
.wb_clk_i (wb_clk),
|
2015 |
|
|
.wb_rst_i (wb_rst),
|
2016 |
|
|
.arst_i (wb_rst),
|
2017 |
|
|
.wb_adr_i (wbs_d_i2c3_adr_i[i2c_3_wb_adr_width-1:0]),
|
2018 |
|
|
.wb_dat_i (wbs_d_i2c3_dat_i),
|
2019 |
|
|
.wb_we_i (wbs_d_i2c3_we_i ),
|
2020 |
|
|
.wb_cyc_i (wbs_d_i2c3_cyc_i),
|
2021 |
|
|
.wb_stb_i (wbs_d_i2c3_stb_i),
|
2022 |
|
|
.wb_dat_o (wbs_d_i2c3_dat_o),
|
2023 |
|
|
.wb_ack_o (wbs_d_i2c3_ack_o),
|
2024 |
|
|
.scl_pad_i (i2c3_scl_io ),
|
2025 |
|
|
.scl_pad_o (scl3_pad_o ),
|
2026 |
|
|
.scl_padoen_o (scl3_padoen_o ),
|
2027 |
|
|
.sda_pad_i (i2c3_sda_io ),
|
2028 |
|
|
.sda_pad_o (sda3_pad_o ),
|
2029 |
|
|
.sda_padoen_o (sda3_padoen_o ),
|
2030 |
|
|
|
2031 |
|
|
// Interrupt
|
2032 |
|
|
.wb_inta_o (i2c3_irq)
|
2033 |
|
|
|
2034 |
|
|
);
|
2035 |
|
|
|
2036 |
|
|
assign wbs_d_i2c3_err_o = 0;
|
2037 |
|
|
assign wbs_d_i2c3_rty_o = 0;
|
2038 |
|
|
|
2039 |
|
|
// i2c phy lines
|
2040 |
|
|
assign i2c3_sda_io = scl3_padoen_o ? 1'bz : scl3_pad_o;
|
2041 |
|
|
assign i2c3_scl_io = sda3_padoen_o ? 1'bz : sda3_pad_o;
|
2042 |
|
|
|
2043 |
|
|
////////////////////////////////////////////////////////////////////////
|
2044 |
|
|
`else // !`ifdef I2C3
|
2045 |
|
|
|
2046 |
|
|
assign wbs_d_i2c3_dat_o = 0;
|
2047 |
|
|
assign wbs_d_i2c3_ack_o = 0;
|
2048 |
|
|
assign wbs_d_i2c3_err_o = 0;
|
2049 |
|
|
assign wbs_d_i2c3_rty_o = 0;
|
2050 |
|
|
|
2051 |
|
|
////////////////////////////////////////////////////////////////////////
|
2052 |
|
|
`endif // !`ifdef I2C3
|
2053 |
|
|
|
2054 |
|
|
`ifdef USB0
|
2055 |
|
|
////////////////////////////////////////////////////////////////////////
|
2056 |
|
|
//
|
2057 |
|
|
// USB Host/Slave controller 0
|
2058 |
|
|
//
|
2059 |
|
|
////////////////////////////////////////////////////////////////////////
|
2060 |
|
|
|
2061 |
|
|
//
|
2062 |
|
|
// Wires
|
2063 |
|
|
//
|
2064 |
|
|
wire usb0_slavesofrxed_irq;
|
2065 |
|
|
wire usb0_slaveresetevent_irq;
|
2066 |
|
|
wire usb0_slaveresume_irq;
|
2067 |
|
|
wire usb0_slavetransdone_irq;
|
2068 |
|
|
wire usb0_slavenaksent_irq;
|
2069 |
|
|
wire usb0_slavevbusdet_irq;
|
2070 |
|
|
wire usb0_hostSOFSentIntOut;
|
2071 |
|
|
wire usb0_hostConnEventIntOut;
|
2072 |
|
|
wire usb0_hostResumeIntOut;
|
2073 |
|
|
wire usb0_hostTransDoneIntOut;
|
2074 |
|
|
wire usb0_host_irq, usb0_slave_irq;
|
2075 |
|
|
wire usb0_oe;
|
2076 |
|
|
wire [1:0] usb0dat_o_int;
|
2077 |
|
|
|
2078 |
|
|
|
2079 |
|
|
//
|
2080 |
|
|
// Registers
|
2081 |
|
|
//
|
2082 |
|
|
reg [1:0] usb0_rx_data /*synthesis syn_useioff=1 syn_allow_retiming=0 */;
|
2083 |
|
|
reg [1:0] usb0_tx_data /*synthesis syn_useioff=1 syn_allow_retiming=0 */;
|
2084 |
|
|
reg usb0_oe_n /*synthesis syn_useioff=1 syn_allow_retiming=0 */;
|
2085 |
|
|
|
2086 |
|
|
always @(posedge usb_clk) usb0_rx_data <= usb0dat_pad_i;
|
2087 |
|
|
always @(posedge usb_clk) usb0_tx_data <= usb0dat_o_int;
|
2088 |
|
|
always @(posedge usb_clk) usb0_oe_n <= ~usb0_oe;
|
2089 |
|
|
|
2090 |
|
|
|
2091 |
|
|
//
|
2092 |
|
|
// Assigns
|
2093 |
|
|
//
|
2094 |
|
|
assign usb0dat_pad_o = usb0_tx_data;
|
2095 |
|
|
assign usb0ctrl_pad_o = usb0_oe_n; // Actual oe to transciever
|
2096 |
|
|
assign usb0_host_irq = usb0_hostSOFSentIntOut | usb0_hostConnEventIntOut |
|
2097 |
|
|
usb0_hostResumeIntOut | usb0_hostTransDoneIntOut;
|
2098 |
|
|
assign usb0_slave_irq = usb0_slavesofrxed_irq | usb0_slaveresetevent_irq |
|
2099 |
|
|
usb0_slaveresume_irq | usb0_slavetransdone_irq |
|
2100 |
|
|
usb0_slavenaksent_irq/* | usb0_slavevbusdet_irq */;
|
2101 |
|
|
|
2102 |
|
|
`ifdef USB0_ONLY_HOST
|
2103 |
|
|
usbhost usbhost0
|
2104 |
|
|
`else
|
2105 |
|
|
usbhostslave usbhostslave0
|
2106 |
|
|
`endif
|
2107 |
|
|
|
2108 |
|
|
(
|
2109 |
|
|
// USB PHY lines
|
2110 |
|
|
// In
|
2111 |
|
|
.usbClk (usb_clk), // logic clock,48MHz +/-0.25%
|
2112 |
|
|
.USBWireDataIn (usb0_rx_data), // Diff. data in
|
2113 |
|
|
// Out
|
2114 |
|
|
.USBWireDataOut (usb0dat_o_int), // Diff. dat out
|
2115 |
|
|
.USBWireCtrlOut (usb0_oe), // OE
|
2116 |
|
|
.USBFullSpeed (usb0fullspeed_pad_o),// Full speed en.
|
2117 |
|
|
//Debug
|
2118 |
|
|
.USBWireDataOutTick (), // Debug output
|
2119 |
|
|
.USBWireDataInTick (), // Debug ouptut
|
2120 |
|
|
|
2121 |
|
|
// Interrupt lines
|
2122 |
|
|
// Slave
|
2123 |
|
|
`ifndef USB0_ONLY_HOST
|
2124 |
|
|
.slaveSOFRxedIntOut (usb0_slavesofrxed_irq),
|
2125 |
|
|
.slaveResetEventIntOut (usb0_slaveresetevent_irq),
|
2126 |
|
|
.slaveResumeIntOut (usb0_slaveresume_irq),
|
2127 |
|
|
.slaveTransDoneIntOut (usb0_slavetransdone_irq),
|
2128 |
|
|
.slaveNAKSentIntOut (usb0_slavenaksent_irq),
|
2129 |
|
|
.USBDPlusPullup (),
|
2130 |
|
|
.USBDMinusPullup (),
|
2131 |
|
|
.vBusDetect (1'b1), // bus detect from phy
|
2132 |
|
|
`endif
|
2133 |
|
|
|
2134 |
|
|
// Host
|
2135 |
|
|
.hostSOFSentIntOut (usb0_hostSOFSentIntOut),
|
2136 |
|
|
.hostConnEventIntOut (usb0_hostConnEventIntOut),
|
2137 |
|
|
.hostResumeIntOut (usb0_hostResumeIntOut),
|
2138 |
|
|
.hostTransDoneIntOut (usb0_hostTransDoneIntOut),
|
2139 |
|
|
// Wishbone slave interface
|
2140 |
|
|
.address_i (wbs_d_usb0_adr_i[wbs_d_usb0_adr_width-1:0]),
|
2141 |
|
|
.data_i (wbs_d_usb0_dat_i),
|
2142 |
|
|
.we_i (wbs_d_usb0_we_i),
|
2143 |
|
|
.strobe_i (wbs_d_usb0_stb_i),
|
2144 |
|
|
.data_o (wbs_d_usb0_dat_o),
|
2145 |
|
|
.ack_o (wbs_d_usb0_ack_o),
|
2146 |
|
|
.clk_i (wb_clk),
|
2147 |
|
|
.rst_i (wb_rst)
|
2148 |
|
|
|
2149 |
|
|
);
|
2150 |
|
|
|
2151 |
|
|
assign wbs_d_usb0_err_o = 0;
|
2152 |
|
|
assign wbs_d_usb0_rty_o = 0;
|
2153 |
|
|
|
2154 |
|
|
`ifdef USB0_ONLY_HOST
|
2155 |
|
|
// Tie off unused IRQs if we're only a host
|
2156 |
|
|
assign usb0_slavesofrxed_irq = 0;
|
2157 |
|
|
assign usb0_slaveresetevent_irq = 0;
|
2158 |
|
|
assign usb0_slaveresume_irq = 0;
|
2159 |
|
|
assign usb0_slavetransdone_irq = 0;
|
2160 |
|
|
assign usb0_slavenaksent_irq = 0;
|
2161 |
|
|
assign usb0_slavevbusdet_irq = 0;
|
2162 |
|
|
`endif
|
2163 |
|
|
|
2164 |
|
|
`else
|
2165 |
|
|
|
2166 |
|
|
assign wbs_d_usb0_dat_o = 0;
|
2167 |
|
|
assign wbs_d_usb0_ack_o = 0;
|
2168 |
|
|
assign wbs_d_usb0_err_o = 0;
|
2169 |
|
|
assign wbs_d_usb0_rty_o = 0;
|
2170 |
|
|
|
2171 |
|
|
`endif // !`ifdef USB0
|
2172 |
|
|
|
2173 |
|
|
`ifdef USB1
|
2174 |
|
|
////////////////////////////////////////////////////////////////////////
|
2175 |
|
|
//
|
2176 |
|
|
// USB Host/Slave controller 1
|
2177 |
|
|
//
|
2178 |
|
|
////////////////////////////////////////////////////////////////////////
|
2179 |
|
|
|
2180 |
|
|
//
|
2181 |
|
|
// Wires
|
2182 |
|
|
//
|
2183 |
|
|
wire usb1_slavesofrxed_irq;
|
2184 |
|
|
wire usb1_slaveresetevent_irq;
|
2185 |
|
|
wire usb1_slaveresume_irq;
|
2186 |
|
|
wire usb1_slavetransdone_irq;
|
2187 |
|
|
wire usb1_slavenaksent_irq;
|
2188 |
|
|
wire usb1_slavevbusdet_irq;
|
2189 |
|
|
wire usb1_hostSOFSentIntOut;
|
2190 |
|
|
wire usb1_hostConnEventIntOut;
|
2191 |
|
|
wire usb1_hostResumeIntOut;
|
2192 |
|
|
wire usb1_hostTransDoneIntOut;
|
2193 |
|
|
wire usb1_host_irq, usb1_slave_irq;
|
2194 |
|
|
wire usb1_oe;
|
2195 |
|
|
wire [1:0] usb1dat_o_int;
|
2196 |
|
|
|
2197 |
|
|
|
2198 |
|
|
//
|
2199 |
|
|
// Registers
|
2200 |
|
|
//
|
2201 |
|
|
reg [1:0] usb1_rx_data /*synthesis syn_useioff=1 syn_allow_retiming=0 */;
|
2202 |
|
|
reg [1:0] usb1_tx_data /*synthesis syn_useioff=1 syn_allow_retiming=0 */;
|
2203 |
|
|
reg usb1_oe_n /*synthesis syn_useioff=1 syn_allow_retiming=0 */;
|
2204 |
|
|
|
2205 |
|
|
always @(posedge usb_clk) usb1_rx_data <= usb1dat_pad_i;
|
2206 |
|
|
always @(posedge usb_clk) usb1_tx_data <= usb1dat_o_int;
|
2207 |
|
|
always @(posedge usb_clk) usb1_oe_n <= ~usb1_oe;
|
2208 |
|
|
|
2209 |
|
|
|
2210 |
|
|
//
|
2211 |
|
|
// Assigns
|
2212 |
|
|
//
|
2213 |
|
|
assign usb1dat_pad_o = usb1_tx_data;
|
2214 |
|
|
assign usb1ctrl_pad_o = usb1_oe_n; // Actual oe to transciever
|
2215 |
|
|
assign usb1_host_irq = usb1_hostSOFSentIntOut | usb1_hostConnEventIntOut |
|
2216 |
|
|
usb1_hostResumeIntOut | usb1_hostTransDoneIntOut;
|
2217 |
|
|
assign usb1_slave_irq = usb1_slavesofrxed_irq | usb1_slaveresetevent_irq |
|
2218 |
|
|
usb1_slaveresume_irq | usb1_slavetransdone_irq |
|
2219 |
|
|
usb1_slavenaksent_irq /*| usb1_slavevbusdet_irq*/ ;
|
2220 |
|
|
|
2221 |
|
|
`ifdef USB1_ONLY_HOST
|
2222 |
|
|
usbhost usbhost1
|
2223 |
|
|
`else
|
2224 |
|
|
`ifdef USB1_ONLY_SLAVE
|
2225 |
|
|
usbslave usbslave1
|
2226 |
|
|
`else
|
2227 |
|
|
usbhostslave usbhostslave1
|
2228 |
|
|
`endif
|
2229 |
|
|
`endif
|
2230 |
|
|
(
|
2231 |
|
|
// USB PHY lines
|
2232 |
|
|
// In
|
2233 |
|
|
.usbClk (usb_clk), // logic clock,48MHz +/-0.25%
|
2234 |
|
|
.USBWireDataIn (usb1_rx_data), // Diff. data in
|
2235 |
|
|
// Out
|
2236 |
|
|
.USBWireDataOut (usb1dat_o_int), // Diff. dat out
|
2237 |
|
|
.USBWireCtrlOut (usb1_oe), // OE
|
2238 |
|
|
.USBFullSpeed (usb1fullspeed_pad_o),// Full speed en.
|
2239 |
|
|
//Debug
|
2240 |
|
|
.USBWireDataOutTick (), // Debug output
|
2241 |
|
|
.USBWireDataInTick (), // Debug ouptut
|
2242 |
|
|
|
2243 |
|
|
// Interrupt lines
|
2244 |
|
|
// Slave
|
2245 |
|
|
`ifndef USB1_ONLY_HOST
|
2246 |
|
|
.slaveSOFRxedIntOut (usb1_slavesofrxed_irq),
|
2247 |
|
|
.slaveResetEventIntOut (usb1_slaveresetevent_irq),
|
2248 |
|
|
.slaveResumeIntOut (usb1_slaveresume_irq),
|
2249 |
|
|
.slaveTransDoneIntOut (usb1_slavetransdone_irq),
|
2250 |
|
|
.slaveNAKSentIntOut (usb1_slavenaksent_irq),
|
2251 |
|
|
.slaveVBusDetIntOut (usb1_slavevbusdet_irq),
|
2252 |
|
|
.USBDPlusPullup (),
|
2253 |
|
|
.USBDMinusPullup (),
|
2254 |
|
|
.vBusDetect (1'b1), // bus detect from phy
|
2255 |
|
|
`endif
|
2256 |
|
|
`ifndef USB1_ONLY_SLAVE
|
2257 |
|
|
// Host
|
2258 |
|
|
.hostSOFSentIntOut (usb1_hostSOFSentIntOut),
|
2259 |
|
|
.hostConnEventIntOut (usb1_hostConnEventIntOut),
|
2260 |
|
|
.hostResumeIntOut (usb1_hostResumeIntOut),
|
2261 |
|
|
.hostTransDoneIntOut (usb1_hostTransDoneIntOut),
|
2262 |
|
|
`endif
|
2263 |
|
|
// Wishbone slave interface
|
2264 |
|
|
.address_i (wbs_d_usb1_adr_i[wbs_d_usb1_adr_width-1:0]),
|
2265 |
|
|
.data_i (wbs_d_usb1_dat_i),
|
2266 |
|
|
.we_i (wbs_d_usb1_we_i),
|
2267 |
|
|
.strobe_i (wbs_d_usb1_stb_i),
|
2268 |
|
|
.data_o (wbs_d_usb1_dat_o),
|
2269 |
|
|
.ack_o (wbs_d_usb1_ack_o),
|
2270 |
|
|
.clk_i (wb_clk),
|
2271 |
|
|
.rst_i (wb_rst)
|
2272 |
|
|
|
2273 |
|
|
);
|
2274 |
|
|
|
2275 |
|
|
assign wbs_d_usb1_err_o = 0;
|
2276 |
|
|
assign wbs_d_usb1_rty_o = 0;
|
2277 |
|
|
|
2278 |
|
|
`ifdef USB1_ONLY_HOST
|
2279 |
|
|
// Tie off unused IRQs if we're only a host
|
2280 |
|
|
assign usb1_slavesofrxed_irq = 0;
|
2281 |
|
|
assign usb1_slaveresetevent_irq = 0;
|
2282 |
|
|
assign usb1_slaveresume_irq = 0;
|
2283 |
|
|
assign usb1_slavetransdone_irq = 0;
|
2284 |
|
|
assign usb1_slavenaksent_irq = 0;
|
2285 |
|
|
assign usb1_slavevbusdet_irq = 0;
|
2286 |
|
|
`endif
|
2287 |
|
|
`ifdef USB1_ONLY_SLAVE
|
2288 |
|
|
assign usb1_hostSOFSentIntOut = 0;
|
2289 |
|
|
assign usb1_hostConnEventIntOut = 0;
|
2290 |
|
|
assign usb1_hostResumeIntOut = 0;
|
2291 |
|
|
assign usb1_hostTransDoneIntOut = 0;
|
2292 |
|
|
`endif
|
2293 |
|
|
|
2294 |
|
|
`else
|
2295 |
|
|
|
2296 |
|
|
assign wbs_d_usb1_dat_o = 0;
|
2297 |
|
|
assign wbs_d_usb1_ack_o = 0;
|
2298 |
|
|
assign wbs_d_usb1_err_o = 0;
|
2299 |
|
|
assign wbs_d_usb1_rty_o = 0;
|
2300 |
|
|
|
2301 |
|
|
`endif // !`ifdef USB1
|
2302 |
|
|
|
2303 |
|
|
`ifdef GPIO0
|
2304 |
|
|
////////////////////////////////////////////////////////////////////////
|
2305 |
|
|
//
|
2306 |
|
|
// GPIO 0
|
2307 |
|
|
//
|
2308 |
|
|
////////////////////////////////////////////////////////////////////////
|
2309 |
|
|
|
2310 |
|
|
gpio gpio0
|
2311 |
|
|
(
|
2312 |
|
|
// GPIO bus
|
2313 |
|
|
.gpio_io (gpio0_io[gpio0_io_width-1:0]),
|
2314 |
|
|
// Wishbone slave interface
|
2315 |
|
|
.wb_adr_i (wbs_d_gpio0_adr_i[gpio0_wb_adr_width-1:0]),
|
2316 |
|
|
.wb_dat_i (wbs_d_gpio0_dat_i),
|
2317 |
|
|
.wb_we_i (wbs_d_gpio0_we_i),
|
2318 |
|
|
.wb_cyc_i (wbs_d_gpio0_cyc_i),
|
2319 |
|
|
.wb_stb_i (wbs_d_gpio0_stb_i),
|
2320 |
|
|
.wb_cti_i (wbs_d_gpio0_cti_i),
|
2321 |
|
|
.wb_bte_i (wbs_d_gpio0_bte_i),
|
2322 |
|
|
.wb_dat_o (wbs_d_gpio0_dat_o),
|
2323 |
|
|
.wb_ack_o (wbs_d_gpio0_ack_o),
|
2324 |
|
|
.wb_err_o (wbs_d_gpio0_err_o),
|
2325 |
|
|
.wb_rty_o (wbs_d_gpio0_rty_o),
|
2326 |
|
|
|
2327 |
|
|
.wb_clk (wb_clk),
|
2328 |
|
|
.wb_rst (wb_rst)
|
2329 |
|
|
);
|
2330 |
|
|
|
2331 |
|
|
defparam gpio0.gpio_io_width = gpio0_io_width;
|
2332 |
|
|
defparam gpio0.gpio_dir_reset_val = gpio0_dir_reset_val;
|
2333 |
|
|
defparam gpio0.gpio_o_reset_val = gpio0_o_reset_val;
|
2334 |
|
|
|
2335 |
|
|
////////////////////////////////////////////////////////////////////////
|
2336 |
|
|
`else // !`ifdef GPIO0
|
2337 |
|
|
assign wbs_d_gpio0_dat_o = 0;
|
2338 |
|
|
assign wbs_d_gpio0_ack_o = 0;
|
2339 |
|
|
assign wbs_d_gpio0_err_o = 0;
|
2340 |
|
|
assign wbs_d_gpio0_rty_o = 0;
|
2341 |
|
|
////////////////////////////////////////////////////////////////////////
|
2342 |
|
|
`endif // !`ifdef GPIO0
|
2343 |
|
|
|
2344 |
|
|
////////////////////////////////////////////////////////////////////////
|
2345 |
|
|
//
|
2346 |
|
|
// OR1200 Interrupt assignment
|
2347 |
|
|
//
|
2348 |
|
|
////////////////////////////////////////////////////////////////////////
|
2349 |
|
|
|
2350 |
|
|
assign or1200_pic_ints[0] = 0; // Non-maskable inside OR1200
|
2351 |
|
|
assign or1200_pic_ints[1] = 0; // Non-maskable inside OR1200
|
2352 |
|
|
`ifdef UART0
|
2353 |
|
|
assign or1200_pic_ints[2] = uart0_irq;
|
2354 |
|
|
`else
|
2355 |
|
|
assign or1200_pic_ints[2] = 0;
|
2356 |
|
|
`endif
|
2357 |
|
|
`ifdef UART1
|
2358 |
|
|
assign or1200_pic_ints[3] = uart1_irq;
|
2359 |
|
|
`else
|
2360 |
|
|
assign or1200_pic_ints[3] = 0;
|
2361 |
|
|
`endif
|
2362 |
|
|
`ifdef ETH0
|
2363 |
|
|
assign or1200_pic_ints[4] = eth0_irq;
|
2364 |
|
|
`else
|
2365 |
|
|
assign or1200_pic_ints[4] = 0;
|
2366 |
|
|
`endif
|
2367 |
|
|
`ifdef UART2
|
2368 |
|
|
assign or1200_pic_ints[5] = uart2_irq;
|
2369 |
|
|
`else
|
2370 |
|
|
assign or1200_pic_ints[5] = 0;
|
2371 |
|
|
`endif
|
2372 |
|
|
`ifdef SPI0
|
2373 |
|
|
assign or1200_pic_ints[6] = spi0_irq;
|
2374 |
|
|
`else
|
2375 |
|
|
assign or1200_pic_ints[6] = 0;
|
2376 |
|
|
`endif
|
2377 |
|
|
`ifdef SPI1
|
2378 |
|
|
assign or1200_pic_ints[7] = spi1_irq;
|
2379 |
|
|
`else
|
2380 |
|
|
assign or1200_pic_ints[7] = 0;
|
2381 |
|
|
`endif
|
2382 |
|
|
`ifdef SPI2
|
2383 |
|
|
assign or1200_pic_ints[8] = spi2_irq;
|
2384 |
|
|
`else
|
2385 |
|
|
assign or1200_pic_ints[8] = 0;
|
2386 |
|
|
`endif
|
2387 |
|
|
assign or1200_pic_ints[9] = 0;
|
2388 |
|
|
`ifdef I2C0
|
2389 |
|
|
assign or1200_pic_ints[10] = i2c0_irq;
|
2390 |
|
|
`else
|
2391 |
|
|
assign or1200_pic_ints[10] = 0;
|
2392 |
|
|
`endif
|
2393 |
|
|
`ifdef I2C1
|
2394 |
|
|
assign or1200_pic_ints[11] = i2c1_irq;
|
2395 |
|
|
`else
|
2396 |
|
|
assign or1200_pic_ints[11] = 0;
|
2397 |
|
|
`endif
|
2398 |
|
|
`ifdef I2C2
|
2399 |
|
|
assign or1200_pic_ints[12] = i2c2_irq;
|
2400 |
|
|
`else
|
2401 |
|
|
assign or1200_pic_ints[12] = 0;
|
2402 |
|
|
`endif
|
2403 |
|
|
`ifdef I2C3
|
2404 |
|
|
assign or1200_pic_ints[13] = i2c3_irq;
|
2405 |
|
|
`else
|
2406 |
|
|
assign or1200_pic_ints[13] = 0;
|
2407 |
|
|
`endif
|
2408 |
|
|
assign or1200_pic_ints[14] = 0;
|
2409 |
|
|
assign or1200_pic_ints[15] = 0;
|
2410 |
|
|
assign or1200_pic_ints[16] = 0;
|
2411 |
|
|
assign or1200_pic_ints[17] = 0;
|
2412 |
|
|
assign or1200_pic_ints[18] = 0;
|
2413 |
|
|
assign or1200_pic_ints[19] = 0;
|
2414 |
|
|
`ifdef USB0
|
2415 |
|
|
assign or1200_pic_ints[20] = usb0_host_irq;
|
2416 |
|
|
assign or1200_pic_ints[21] = usb0_slave_irq;
|
2417 |
|
|
`else
|
2418 |
|
|
assign or1200_pic_ints[20] = 0;
|
2419 |
|
|
assign or1200_pic_ints[21] = 0;
|
2420 |
|
|
`endif
|
2421 |
|
|
`ifdef USB1
|
2422 |
|
|
assign or1200_pic_ints[22] = usb1_host_irq;
|
2423 |
|
|
assign or1200_pic_ints[23] = usb1_slave_irq;
|
2424 |
|
|
`else
|
2425 |
|
|
assign or1200_pic_ints[22] = 0;
|
2426 |
|
|
assign or1200_pic_ints[23] = 0;
|
2427 |
|
|
`endif
|
2428 |
|
|
assign or1200_pic_ints[24] = 0;
|
2429 |
|
|
assign or1200_pic_ints[25] = 0;
|
2430 |
|
|
assign or1200_pic_ints[26] = 0;
|
2431 |
|
|
assign or1200_pic_ints[27] = 0;
|
2432 |
|
|
assign or1200_pic_ints[28] = 0;
|
2433 |
|
|
assign or1200_pic_ints[29] = 0;
|
2434 |
|
|
assign or1200_pic_ints[30] = 0;
|
2435 |
|
|
|
2436 |
|
|
endmodule // orpsoc_top
|
2437 |
|
|
|
2438 |
|
|
|