OpenCores
URL https://opencores.org/ocsvn/test_project/test_project/trunk

Subversion Repositories test_project

[/] [test_project/] [trunk/] [rtl/] [verilog/] [orpsoc_top.v] - Blame information for rev 87

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 40 julius
//module ref_design_top
2
module orpsoc_top
3
  (
4
   output spi_sd_sclk_pad_o  ,
5
   output spi_sd_ss_pad_o    ,
6
   input  spi_sd_miso_pad_i  ,
7 46 julius
   output spi_sd_mosi_pad_o  ,
8
`ifdef USE_SDRAM
9
   // SDRAM bus signals
10 40 julius
   inout [15:0]  mem_dat_pad_io,
11
   output [12:0] mem_adr_pad_o ,
12
   output [1:0]  mem_dqm_pad_o ,
13
   output [1:0]  mem_ba_pad_o  ,
14
   output        mem_cs_pad_o  ,
15
   output        mem_ras_pad_o ,
16
   output        mem_cas_pad_o ,
17
   output        mem_we_pad_o  ,
18
   output        mem_cke_pad_o ,
19 46 julius
   // SPI bus signals for flash memory
20
   output spi_flash_sclk_pad_o  ,
21
   output spi_flash_ss_pad_o    ,
22
   input  spi_flash_miso_pad_i  ,
23
   output spi_flash_mosi_pad_o  ,
24
   output spi_flash_w_n_pad_o   ,
25
   output spi_flash_hold_n_pad_o,
26
`endif //  `ifdef USE_SDRAM
27
`ifdef USE_ETHERNET
28 40 julius
   output [1:1] eth_sync_pad_o,
29
   output [1:1] eth_tx_pad_o,
30
   input [1:1]  eth_rx_pad_i,
31 46 julius
   input        eth_clk_pad_i,
32 40 julius
   inout [1:1]  eth_md_pad_io,
33 46 julius
   output [1:1] eth_mdc_pad_o,
34
`endif //  `ifdef USE_ETHERNET
35 40 julius
   output spi1_mosi_pad_o,
36
   input  spi1_miso_pad_i,
37
   output spi1_ss_pad_o  ,
38
   output spi1_sclk_pad_o,
39 46 julius
`ifdef DISABLE_IOS_FOR_VERILATOR
40
   output [8-1:0] gpio_a_pad_io,
41
`else
42 40 julius
   inout [8-1:0] gpio_a_pad_io,
43 46 julius
`endif
44 40 julius
   input  uart0_srx_pad_i ,
45
   output uart0_stx_pad_o ,
46
   input  dbg_tdi_pad_i,
47
   input  dbg_tck_pad_i,
48
   input  dbg_tms_pad_i,
49
   output dbg_tdo_pad_o,
50
   input rst_pad_i,
51
   output rst_pad_o,
52
   input clk_pad_i
53
   )
54
;
55
   wire          wb_rst;
56
   wire          wb_clk, clk50, clk100, usbClk, dbg_tck;
57
   wire          pll_lock;
58
   wire          mem_io_req, mem_io_gnt, mem_io_busy;
59
   wire [15:0]    mem_dat_pad_i, mem_dat_pad_o;
60
   wire [30:0]    pic_ints;
61
   wire          spi3_irq, spi2_irq, spi1_irq, spi0_irq, uart0_irq;
62
   wire          eth0_int_o;
63
parameter [31:0] wbm_or12_i_dat_o = 32'h0;
64
wire [31:0] wbm_or12_i_adr_o;
65
wire [3:0] wbm_or12_i_sel_o;
66
wire wbm_or12_i_we_o;
67
wire [1:0] wbm_or12_i_bte_o;
68
wire [2:0] wbm_or12_i_cti_o;
69
wire wbm_or12_i_stb_o;
70
wire wbm_or12_i_cyc_o;
71
wire [31:0] wbm_or12_i_dat_i;
72
wire wbm_or12_i_ack_i;
73
wire wbm_or12_i_err_i;
74
wire wbm_or12_i_rty_i;
75
wire [31:0] wbm_or12_debug_dat_o;
76
wire [31:0] wbm_or12_debug_adr_o;
77
wire [3:0] wbm_or12_debug_sel_o;
78
wire wbm_or12_debug_we_o;
79
wire [1:0] wbm_or12_debug_bte_o;
80
wire [2:0] wbm_or12_debug_cti_o;
81
wire wbm_or12_debug_stb_o;
82
wire wbm_or12_debug_cyc_o;
83
wire [31:0] wbm_or12_debug_dat_i;
84
wire wbm_or12_debug_ack_i;
85
wire wbm_or12_debug_err_i;
86
wire wbm_or12_debug_rty_i;
87
wire [31:0] wbm_or12_d_dat_o;
88
wire [31:0] wbm_or12_d_adr_o;
89
wire [3:0] wbm_or12_d_sel_o;
90
wire wbm_or12_d_we_o;
91
wire [1:0] wbm_or12_d_bte_o;
92
wire [2:0] wbm_or12_d_cti_o;
93
wire wbm_or12_d_stb_o;
94
wire wbm_or12_d_cyc_o;
95
wire [31:0] wbm_or12_d_dat_i;
96
wire wbm_or12_d_ack_i;
97
wire wbm_or12_d_err_i;
98
wire wbm_or12_d_rty_i;
99
wire [31:0] wbm_eth1_dat_o;
100
wire [31:0] wbm_eth1_adr_o;
101
wire [3:0] wbm_eth1_sel_o;
102
wire wbm_eth1_we_o;
103
wire [1:0] wbm_eth1_bte_o;
104
wire [2:0] wbm_eth1_cti_o;
105
wire wbm_eth1_stb_o;
106
wire wbm_eth1_cyc_o;
107
wire [31:0] wbm_eth1_dat_i;
108
wire wbm_eth1_ack_i;
109
wire wbm_eth1_err_i;
110
wire wbm_eth1_rty_i;
111
wire [31:0] wbs_eth1_cfg_dat_o;
112
wire [31:0] wbs_eth1_cfg_dat_i;
113
wire [31:0] wbs_eth1_cfg_adr_i;
114
wire [3:0] wbs_eth1_cfg_sel_i;
115
wire [1:0] wbs_eth1_cfg_bte_i;
116
wire [2:0] wbs_eth1_cfg_cti_i;
117
wire wbs_eth1_cfg_stb_i;
118
wire wbs_eth1_cfg_cyc_i;
119
wire wbs_eth1_cfg_ack_o;
120
wire wbs_eth1_cfg_err_o;
121
parameter wbs_eth1_cfg_rty_o = 1'b0;
122
wire [31:0] wbs_rom_dat_o;
123
wire [31:0] wbs_rom_dat_i;
124
wire [31:0] wbs_rom_adr_i;
125
wire [3:0] wbs_rom_sel_i;
126
wire [1:0] wbs_rom_bte_i;
127
wire [2:0] wbs_rom_cti_i;
128
wire wbs_rom_stb_i;
129
wire wbs_rom_cyc_i;
130
wire wbs_rom_ack_o;
131
parameter wbs_rom_err_o = 1'b0;
132
parameter wbs_rom_rty_o = 1'b0;
133
wire [31:0] wbs_mc_m_dat_o;
134
wire [31:0] wbs_mc_m_dat_i;
135
wire [31:0] wbs_mc_m_adr_i;
136
wire [3:0] wbs_mc_m_sel_i;
137
wire [1:0] wbs_mc_m_bte_i;
138
wire [2:0] wbs_mc_m_cti_i;
139
wire wbs_mc_m_stb_i;
140
wire wbs_mc_m_cyc_i;
141
wire wbs_mc_m_ack_o;
142
wire wbs_mc_m_err_o;
143
parameter wbs_mc_m_rty_o = 1'b0;
144
wire [31:0] wbs_spi_flash_dat_o;
145
wire [31:0] wbs_spi_flash_dat_i;
146
wire [31:0] wbs_spi_flash_adr_i;
147
wire [3:0] wbs_spi_flash_sel_i;
148
wire [1:0] wbs_spi_flash_bte_i;
149
wire [2:0] wbs_spi_flash_cti_i;
150
wire wbs_spi_flash_stb_i;
151
wire wbs_spi_flash_cyc_i;
152
wire wbs_spi_flash_ack_o;
153
parameter wbs_spi_flash_err_o = 1'b0;
154
parameter wbs_spi_flash_rty_o = 1'b0;
155
wire [31:0] wbs_uart0_dat_o;
156
wire [31:0] wbs_uart0_dat_i;
157
wire [31:0] wbs_uart0_adr_i;
158
wire [3:0] wbs_uart0_sel_i;
159
wire [1:0] wbs_uart0_bte_i;
160
wire [2:0] wbs_uart0_cti_i;
161
wire wbs_uart0_stb_i;
162
wire wbs_uart0_cyc_i;
163
wire wbs_uart0_ack_o;
164
parameter wbs_uart0_err_o = 1'b0;
165
parameter wbs_uart0_rty_o = 1'b0;
166
wire [31:0] wbs_ds1_dat_o;
167
wire [31:0] wbs_ds1_dat_i;
168
wire [31:0] wbs_ds1_adr_i;
169
wire [3:0] wbs_ds1_sel_i;
170
wire [1:0] wbs_ds1_bte_i;
171
wire [2:0] wbs_ds1_cti_i;
172
wire wbs_ds1_stb_i;
173
wire wbs_ds1_cyc_i;
174
wire wbs_ds1_ack_o;
175
parameter wbs_ds1_err_o = 1'b0;
176
parameter wbs_ds1_rty_o = 1'b0;
177
wire [31:0] wbs_ds2_dat_o;
178
wire [31:0] wbs_ds2_dat_i;
179
wire [31:0] wbs_ds2_adr_i;
180
wire [3:0] wbs_ds2_sel_i;
181
wire [1:0] wbs_ds2_bte_i;
182
wire [2:0] wbs_ds2_cti_i;
183
wire wbs_ds2_stb_i;
184
wire wbs_ds2_cyc_i;
185
wire wbs_ds2_ack_o;
186
parameter wbs_ds2_err_o = 1'b0;
187
parameter wbs_ds2_rty_o = 1'b0;
188
   wire                eth_clk;
189
   wire [1:1] eth_int;
190
intercon intercon1 (
191
    .wbm_or12_isaw_dat_o(wbm_or12_i_dat_o),
192
    .wbm_or12_isaw_adr_o(wbm_or12_i_adr_o),
193
    .wbm_or12_isaw_sel_o(wbm_or12_i_sel_o),
194
    .wbm_or12_isaw_we_o(wbm_or12_i_we_o),
195
    .wbm_or12_isaw_bte_o(wbm_or12_i_bte_o),
196
    .wbm_or12_isaw_cti_o(wbm_or12_i_cti_o),
197
    .wbm_or12_isaw_stb_o(wbm_or12_i_stb_o),
198
    .wbm_or12_isaw_cyc_o(wbm_or12_i_cyc_o),
199
    .wbm_or12_isaw_dat_i(wbm_or12_i_dat_i),
200
    .wbm_or12_isaw_ack_i(wbm_or12_i_ack_i),
201
    .wbm_or12_isaw_err_i(wbm_or12_i_err_i),
202
    .wbm_or12_isaw_rty_i(wbm_or12_i_rty_i),
203
    .wbm_or12_debug_dat_o(wbm_or12_debug_dat_o),
204
    .wbm_or12_debug_adr_o(wbm_or12_debug_adr_o),
205
    .wbm_or12_debug_sel_o(wbm_or12_debug_sel_o),
206
    .wbm_or12_debug_we_o(wbm_or12_debug_we_o),
207
    .wbm_or12_debug_bte_o(wbm_or12_debug_bte_o),
208
    .wbm_or12_debug_cti_o(wbm_or12_debug_cti_o),
209
    .wbm_or12_debug_stb_o(wbm_or12_debug_stb_o),
210
    .wbm_or12_debug_cyc_o(wbm_or12_debug_cyc_o),
211
    .wbm_or12_debug_dat_i(wbm_or12_debug_dat_i),
212
    .wbm_or12_debug_ack_i(wbm_or12_debug_ack_i),
213
    .wbm_or12_debug_err_i(wbm_or12_debug_err_i),
214
    .wbm_or12_debug_rty_i(wbm_or12_debug_rty_i),
215
    .wbm_or12_d_dat_o(wbm_or12_d_dat_o),
216
    .wbm_or12_d_adr_o(wbm_or12_d_adr_o),
217
    .wbm_or12_d_sel_o(wbm_or12_d_sel_o),
218
    .wbm_or12_d_we_o(wbm_or12_d_we_o),
219
    .wbm_or12_d_bte_o(wbm_or12_d_bte_o),
220
    .wbm_or12_d_cti_o(wbm_or12_d_cti_o),
221
    .wbm_or12_d_stb_o(wbm_or12_d_stb_o),
222
    .wbm_or12_d_cyc_o(wbm_or12_d_cyc_o),
223
    .wbm_or12_d_dat_i(wbm_or12_d_dat_i),
224
    .wbm_or12_d_ack_i(wbm_or12_d_ack_i),
225
    .wbm_or12_d_err_i(wbm_or12_d_err_i),
226
    .wbm_or12_d_rty_i(wbm_or12_d_rty_i),
227
    .wbm_eth1_dat_o(wbm_eth1_dat_o),
228
    .wbm_eth1_adr_o(wbm_eth1_adr_o),
229
    .wbm_eth1_sel_o(wbm_eth1_sel_o),
230
    .wbm_eth1_we_o(wbm_eth1_we_o),
231
    .wbm_eth1_bte_o(wbm_eth1_bte_o),
232
    .wbm_eth1_cti_o(wbm_eth1_cti_o),
233
    .wbm_eth1_stb_o(wbm_eth1_stb_o),
234
    .wbm_eth1_cyc_o(wbm_eth1_cyc_o),
235
    .wbm_eth1_dat_i(wbm_eth1_dat_i),
236
    .wbm_eth1_ack_i(wbm_eth1_ack_i),
237
    .wbm_eth1_err_i(wbm_eth1_err_i),
238
    .wbm_eth1_rty_i(wbm_eth1_rty_i),
239
    .wbs_eth1_cfg_dat_i(wbs_eth1_cfg_dat_i),
240
    .wbs_eth1_cfg_adr_i(wbs_eth1_cfg_adr_i),
241
    .wbs_eth1_cfg_sel_i(wbs_eth1_cfg_sel_i),
242
    .wbs_eth1_cfg_we_i(wbs_eth1_cfg_we_i),
243
    .wbs_eth1_cfg_bte_i(wbs_eth1_cfg_bte_i),
244
    .wbs_eth1_cfg_cti_i(wbs_eth1_cfg_cti_i),
245
    .wbs_eth1_cfg_stb_i(wbs_eth1_cfg_stb_i),
246
    .wbs_eth1_cfg_cyc_i(wbs_eth1_cfg_cyc_i),
247
    .wbs_eth1_cfg_dat_o(wbs_eth1_cfg_dat_o),
248
    .wbs_eth1_cfg_ack_o(wbs_eth1_cfg_ack_o),
249
    .wbs_eth1_cfg_err_o(wbs_eth1_cfg_err_o),
250
    .wbs_eth1_cfg_rty_o(wbs_eth1_cfg_rty_o),
251
    .wbs_rom_dat_i(wbs_rom_dat_i),
252
    .wbs_rom_adr_i(wbs_rom_adr_i),
253
    .wbs_rom_sel_i(wbs_rom_sel_i),
254
    .wbs_rom_we_i(wbs_rom_we_i),
255
    .wbs_rom_bte_i(wbs_rom_bte_i),
256
    .wbs_rom_cti_i(wbs_rom_cti_i),
257
    .wbs_rom_stb_i(wbs_rom_stb_i),
258
    .wbs_rom_cyc_i(wbs_rom_cyc_i),
259
    .wbs_rom_dat_o(wbs_rom_dat_o),
260
    .wbs_rom_ack_o(wbs_rom_ack_o),
261
    .wbs_rom_err_o(wbs_rom_err_o),
262
    .wbs_rom_rty_o(wbs_rom_rty_o),
263
    .wbs_mc_m_dat_i(wbs_mc_m_dat_i),
264
    .wbs_mc_m_adr_i(wbs_mc_m_adr_i),
265
    .wbs_mc_m_sel_i(wbs_mc_m_sel_i),
266
    .wbs_mc_m_we_i(wbs_mc_m_we_i),
267
    .wbs_mc_m_bte_i(wbs_mc_m_bte_i),
268
    .wbs_mc_m_cti_i(wbs_mc_m_cti_i),
269
    .wbs_mc_m_stb_i(wbs_mc_m_stb_i),
270
    .wbs_mc_m_cyc_i(wbs_mc_m_cyc_i),
271
    .wbs_mc_m_dat_o(wbs_mc_m_dat_o),
272
    .wbs_mc_m_ack_o(wbs_mc_m_ack_o),
273
    .wbs_mc_m_err_o(wbs_mc_m_err_o),
274
    .wbs_mc_m_rty_o(wbs_mc_m_rty_o),
275
    .wbs_spi_flash_dat_i(wbs_spi_flash_dat_i),
276
    .wbs_spi_flash_adr_i(wbs_spi_flash_adr_i),
277
    .wbs_spi_flash_sel_i(wbs_spi_flash_sel_i),
278
    .wbs_spi_flash_we_i(wbs_spi_flash_we_i),
279
    .wbs_spi_flash_bte_i(wbs_spi_flash_bte_i),
280
    .wbs_spi_flash_cti_i(wbs_spi_flash_cti_i),
281
    .wbs_spi_flash_stb_i(wbs_spi_flash_stb_i),
282
    .wbs_spi_flash_cyc_i(wbs_spi_flash_cyc_i),
283
    .wbs_spi_flash_dat_o(wbs_spi_flash_dat_o),
284
    .wbs_spi_flash_ack_o(wbs_spi_flash_ack_o),
285
    .wbs_spi_flash_err_o(wbs_spi_flash_err_o),
286
    .wbs_spi_flash_rty_o(wbs_spi_flash_rty_o),
287
    .wbs_uart0_dat_i(wbs_uart0_dat_i),
288
    .wbs_uart0_adr_i(wbs_uart0_adr_i),
289
    .wbs_uart0_sel_i(wbs_uart0_sel_i),
290
    .wbs_uart0_we_i(wbs_uart0_we_i),
291
    .wbs_uart0_bte_i(wbs_uart0_bte_i),
292
    .wbs_uart0_cti_i(wbs_uart0_cti_i),
293
    .wbs_uart0_stb_i(wbs_uart0_stb_i),
294
    .wbs_uart0_cyc_i(wbs_uart0_cyc_i),
295
    .wbs_uart0_dat_o(wbs_uart0_dat_o),
296
    .wbs_uart0_ack_o(wbs_uart0_ack_o),
297
    .wbs_uart0_err_o(wbs_uart0_err_o),
298
    .wbs_uart0_rty_o(wbs_uart0_rty_o),
299
    .wbs_ds1_dat_i(wbs_ds1_dat_i),
300
    .wbs_ds1_adr_i(wbs_ds1_adr_i),
301
    .wbs_ds1_sel_i(wbs_ds1_sel_i),
302
    .wbs_ds1_we_i(wbs_ds1_we_i),
303
    .wbs_ds1_bte_i(wbs_ds1_bte_i),
304
    .wbs_ds1_cti_i(wbs_ds1_cti_i),
305
    .wbs_ds1_stb_i(wbs_ds1_stb_i),
306
    .wbs_ds1_cyc_i(wbs_ds1_cyc_i),
307
    .wbs_ds1_dat_o(wbs_ds1_dat_o),
308
    .wbs_ds1_ack_o(wbs_ds1_ack_o),
309
    .wbs_ds1_err_o(wbs_ds1_err_o),
310
    .wbs_ds1_rty_o(wbs_ds1_rty_o),
311
    .wbs_ds2_dat_i(wbs_ds2_dat_i),
312
    .wbs_ds2_adr_i(wbs_ds2_adr_i),
313
    .wbs_ds2_sel_i(wbs_ds2_sel_i),
314
    .wbs_ds2_we_i(wbs_ds2_we_i),
315
    .wbs_ds2_bte_i(wbs_ds2_bte_i),
316
    .wbs_ds2_cti_i(wbs_ds2_cti_i),
317
    .wbs_ds2_stb_i(wbs_ds2_stb_i),
318
    .wbs_ds2_cyc_i(wbs_ds2_cyc_i),
319
    .wbs_ds2_dat_o(wbs_ds2_dat_o),
320
    .wbs_ds2_ack_o(wbs_ds2_ack_o),
321
    .wbs_ds2_err_o(wbs_ds2_err_o),
322
    .wbs_ds2_rty_o(wbs_ds2_rty_o),
323
    .wb_clk_i(wb_clk),
324
    .wb_rst_i(wb_rst)
325
);
326
    assign       pic_ints[30] = 1'b0;
327
   assign        pic_ints[29] = 1'b0;
328
   assign        pic_ints[28] = 1'b0;
329
   assign        pic_ints[27] = 1'b0;
330
   assign        pic_ints[26] = 1'b0;
331
   assign        pic_ints[25] = 1'b0;
332
   assign        pic_ints[24] = 1'b0;
333
   assign        pic_ints[23] = 1'b0;
334
   assign        pic_ints[22] = 1'b0;
335
   assign        pic_ints[21] = 1'b0;
336
   assign        pic_ints[20] = 1'b0;
337
   assign        pic_ints[19] = 1'b0;
338
   assign        pic_ints[18] = 1'b0;
339
   assign        pic_ints[17] = 1'b0;
340
   assign        pic_ints[16] = 1'b0;
341
   assign        pic_ints[15] = 1'b0;
342
   assign        pic_ints[14] = 1'b0;
343
   assign        pic_ints[13] = 1'b0;
344
   assign        pic_ints[12] = 1'b0;
345
   assign        pic_ints[11] = 1'b0;
346
   assign        pic_ints[10] = 1'b0;
347
   assign        pic_ints[9]  = 1'b0;
348
   assign        pic_ints[8]  = 1'b0;
349
   assign        pic_ints[7] = 1'b0;
350
   assign        pic_ints[6] = 1'b0;
351
   assign        pic_ints[5] = 1'b0;
352
   assign        pic_ints[4] = 1'b0;
353
   assign        pic_ints[3] = 1'b0;
354
   assign        pic_ints[2] = uart0_irq;
355
   assign        pic_ints[1] = 1'b0;
356
   assign        pic_ints[0] = 1'b0;
357 42 julius
    or1k_top i_or1k
358 40 julius
     (
359
      .clk_i      (wb_clk),
360
      .rst_i      (wb_rst),
361
      .pic_ints_i (pic_ints[19:0]),
362
      .iwb_clk_i  (wb_clk),
363
      .iwb_rst_i  (wb_rst),
364
      .iwb_ack_i  (wbm_or12_i_ack_i),
365
      .iwb_err_i  (wbm_or12_i_err_i),
366
      .iwb_rty_i  (wbm_or12_i_rty_i),
367
      .iwb_dat_i  (wbm_or12_i_dat_i),
368
      .iwb_cyc_o  (wbm_or12_i_cyc_o),
369
      .iwb_adr_o  (wbm_or12_i_adr_o),
370
      .iwb_stb_o  (wbm_or12_i_stb_o),
371
      .iwb_we_o   (wbm_or12_i_we_o ),
372
      .iwb_sel_o  (wbm_or12_i_sel_o),
373
      .iwb_cti_o  (wbm_or12_i_cti_o),
374
      .iwb_bte_o  (wbm_or12_i_bte_o),
375
      .dwb_clk_i  (wb_clk),
376
      .dwb_rst_i  (wb_rst),
377
      .dwb_ack_i  (wbm_or12_d_ack_i),
378
      .dwb_err_i  (wbm_or12_d_err_i),
379
      .dwb_rty_i  (wbm_or12_d_rty_i),
380
      .dwb_dat_i  (wbm_or12_d_dat_i),
381
      .dwb_cyc_o  (wbm_or12_d_cyc_o),
382
      .dwb_adr_o  (wbm_or12_d_adr_o),
383
      .dwb_stb_o  (wbm_or12_d_stb_o),
384
      .dwb_we_o   (wbm_or12_d_we_o),
385
      .dwb_sel_o  (wbm_or12_d_sel_o),
386
      .dwb_dat_o  (wbm_or12_d_dat_o),
387
      .dwb_cti_o  (wbm_or12_d_cti_o),
388
      .dwb_bte_o  (wbm_or12_d_bte_o),
389
      .dbgwb_clk_i (wb_clk),
390
      .dbgwb_rst_i (wb_rst),
391
      .dbgwb_ack_i (wbm_or12_debug_ack_i),
392
      .dbgwb_err_i (wbm_or12_debug_err_i),
393
      .dbgwb_dat_i (wbm_or12_debug_dat_i),
394
      .dbgwb_cyc_o (wbm_or12_debug_cyc_o),
395
      .dbgwb_adr_o (wbm_or12_debug_adr_o),
396
      .dbgwb_stb_o (wbm_or12_debug_stb_o),
397
      .dbgwb_we_o  (wbm_or12_debug_we_o),
398
      .dbgwb_sel_o (wbm_or12_debug_sel_o),
399
      .dbgwb_dat_o (wbm_or12_debug_dat_o),
400
      .dbgwb_cti_o (wbm_or12_debug_cti_o),
401
      .dbgwb_bte_o (wbm_or12_debug_bte_o),
402
      .tms_pad_i   (dbg_tms_pad_i),
403
      .tck_pad_i   (dbg_tck),
404
      .tdi_pad_i   (dbg_tdi_pad_i),
405
      .tdo_pad_o   (dbg_tdo_pad_o),
406
      .tdo_padoe_o (             )
407
      );
408
 OR1K_startup OR1K_startup0
409
  (
410
    .wb_adr_i(wbs_rom_adr_i[6:2]),
411
    .wb_stb_i(wbs_rom_stb_i),
412
    .wb_cyc_i(wbs_rom_cyc_i),
413
    .wb_dat_o(wbs_rom_dat_o),
414
    .wb_ack_o(wbs_rom_ack_o),
415
    .wb_clk(wb_clk),
416
    .wb_rst(wb_rst)
417
   );
418
wire spi_flash_mosi, spi_flash_miso, spi_flash_sclk;
419
wire [1:0] spi_flash_ss;
420
spi_flash_top #
421
  (
422
   .divider(0),
423
   .divider_len(2)
424
   )
425
spi_flash_top0
426
  (
427
   .wb_clk_i(wb_clk),
428
   .wb_rst_i(wb_rst),
429
   .wb_adr_i(wbs_spi_flash_adr_i[4:2]),
430
   .wb_dat_i(wbs_spi_flash_dat_i),
431
   .wb_dat_o(wbs_spi_flash_dat_o),
432
   .wb_sel_i(wbs_spi_flash_sel_i),
433
   .wb_we_i(wbs_spi_flash_we_i),
434
   .wb_stb_i(wbs_spi_flash_stb_i),
435
   .wb_cyc_i(wbs_spi_flash_cyc_i),
436
   .wb_ack_o(wbs_spi_flash_ack_o),
437
   .mosi_pad_o(spi_flash_mosi),
438
   .miso_pad_i(spi_flash_miso),
439
   .sclk_pad_o(spi_flash_sclk),
440
   .ss_pad_o(spi_flash_ss)
441
   );
442 46 julius
 
443
 
444 45 julius
`ifdef USE_SDRAM
445 40 julius
  wb_sdram_ctrl wb_sdram_ctrl0
446
  (
447
    .wb_dat_i(wbs_mc_m_dat_i),
448
    .wb_dat_o(wbs_mc_m_dat_o),
449
    .wb_sel_i(wbs_mc_m_sel_i),
450
    .wb_adr_i(wbs_mc_m_adr_i[24:2]),
451
    .wb_we_i (wbs_mc_m_we_i),
452
    .wb_cti_i(wbs_mc_m_cti_i),
453
    .wb_stb_i(wbs_mc_m_stb_i),
454
    .wb_cyc_i(wbs_mc_m_cyc_i),
455
    .wb_ack_o(wbs_mc_m_ack_o),
456
    .sdr_cke_o(mem_cke_pad_o),
457
    .sdr_cs_n_o(mem_cs_pad_o),
458
    .sdr_ras_n_o(mem_ras_pad_o),
459
    .sdr_cas_n_o(mem_cas_pad_o),
460
    .sdr_we_n_o(mem_we_pad_o),
461
    .sdr_a_o(mem_adr_pad_o),
462
    .sdr_ba_o(mem_ba_pad_o),
463
    .sdr_dq_io(mem_dat_pad_io),
464
    .sdr_dqm_o(mem_dqm_pad_o),
465
    .sdram_clk(wb_clk),
466
    .wb_clk(wb_clk),
467
    .wb_rst(wb_rst)
468
   );
469 46 julius
 
470
   // SPI flash memory signals
471
   assign spi_flash_mosi_pad_o = !spi_flash_ss[0] ? spi_flash_mosi : 1'b1;
472
   assign spi_flash_sclk_pad_o = !spi_flash_ss[0] ? spi_flash_sclk : 1'b1;
473
   assign spi_flash_ss_pad_o   =  spi_flash_ss[0];
474
   assign spi_flash_w_n_pad_o    = 1'b1;
475
   assign spi_flash_hold_n_pad_o = 1'b1;
476
   assign spi_sd_mosi_pad_o = !spi_flash_ss[1] ? spi_flash_mosi : 1'b1;
477
   assign spi_sd_sclk_pad_o = !spi_flash_ss[1] ? spi_flash_sclk : 1'b1;
478
   assign spi_sd_ss_pad_o   =  spi_flash_ss[1];
479
   assign spi_flash_miso = !spi_flash_ss[0] ? spi_flash_miso_pad_i :
480
                        !spi_flash_ss[1] ? spi_sd_miso_pad_i :
481
                        1'b0;
482
 
483 45 julius
`else // !`ifdef USE_SDRAM
484
 
485
   parameter ram_wb_dat_width = 32;
486
   parameter ram_wb_adr_width = 24;
487 54 julius
   //parameter ram_wb_mem_size  = 2097152; // 8MB
488
   parameter ram_wb_mem_size  = 8388608; // 32MB -- for linux test
489 45 julius
 
490
  ram_wb
491
    #
492
    (
493
     .dat_width(ram_wb_dat_width),
494
     .adr_width(ram_wb_adr_width),
495
     .mem_size(ram_wb_mem_size)
496
     )
497
   ram_wb0
498
   (
499
    .dat_i(wbs_mc_m_dat_i),
500
    .dat_o(wbs_mc_m_dat_o),
501
    .sel_i(wbs_mc_m_sel_i),
502
    .adr_i(wbs_mc_m_adr_i[ram_wb_adr_width-1:2]),
503
    .we_i (wbs_mc_m_we_i),
504
    .cti_i(wbs_mc_m_cti_i),
505
    .stb_i(wbs_mc_m_stb_i),
506
    .cyc_i(wbs_mc_m_cyc_i),
507
    .ack_o(wbs_mc_m_ack_o),
508
    .clk_i(wb_clk),
509
    .rst_i(wb_rst)
510
   );
511 46 julius
 
512 45 julius
`endif // !`ifdef USE_SDRAM
513
 
514 40 julius
assign wbs_mc_m_err_o = 1'b0;
515 45 julius
 
516 40 julius
     uart_top
517
     #( 32, 5)
518
   i_uart_0_top
519
     (
520
      .wb_dat_o   (wbs_uart0_dat_o),
521
      .wb_dat_i   (wbs_uart0_dat_i),
522
      .wb_sel_i   (wbs_uart0_sel_i),
523
      .wb_adr_i   (wbs_uart0_adr_i[4:0]),
524
      .wb_we_i    (wbs_uart0_we_i),
525
      .wb_stb_i   (wbs_uart0_stb_i),
526
      .wb_cyc_i   (wbs_uart0_cyc_i),
527
      .wb_ack_o   (wbs_uart0_ack_o),
528
      .wb_clk_i   (wb_clk),
529
      .wb_rst_i   (wb_rst),
530
      .int_o      (uart0_irq),
531
      .srx_pad_i  (uart0_srx_pad_i),
532
      .stx_pad_o  (uart0_stx_pad_o),
533
      .cts_pad_i  (1'b0),
534
      .rts_pad_o  ( ),
535
      .dtr_pad_o  ( ),
536
      .dcd_pad_i  (1'b0),
537
      .dsr_pad_i  (1'b0),
538
      .ri_pad_i   (1'b0)
539
      );
540
   assign gpio_a_pad_io[7:0] = 8'hfe;
541 46 julius
 
542
`ifdef USE_ETHERNET
543 40 julius
  wire       m1tx_clk;
544
wire [3:0]            m1txd;
545
wire         m1txen;
546
wire         m1txerr;
547
wire         m1rx_clk;
548
wire [3:0]            m1rxd;
549
wire         m1rxdv;
550
wire         m1rxerr;
551
wire         m1coll;
552
wire         m1crs;
553 42 julius
//wire [1:10]        state;
554
wire [10:1]          state;   // Changed for verilator -- jb
555 40 julius
wire              sync;
556
wire [1:1]    rx, tx;
557
wire [1:1]    mdc_o, md_i, md_o, md_oe;
558
smii_sync smii_sync1
559
  (
560
   .sync(sync),
561
   .state(state),
562
   .clk(eth_clk),
563
   .rst(wb_rst)
564
   );
565
eth_top eth_top1
566
        (
567
         .wb_clk_i(wb_clk),
568
         .wb_rst_i(wb_rst),
569
         .wb_dat_i(wbs_eth1_cfg_dat_i),
570
         .wb_dat_o(wbs_eth1_cfg_dat_o),
571
         .wb_adr_i(wbs_eth1_cfg_adr_i[11:2]),
572
         .wb_sel_i(wbs_eth1_cfg_sel_i),
573
         .wb_we_i(wbs_eth1_cfg_we_i),
574
         .wb_cyc_i(wbs_eth1_cfg_cyc_i),
575
         .wb_stb_i(wbs_eth1_cfg_stb_i),
576
         .wb_ack_o(wbs_eth1_cfg_ack_o),
577
         .wb_err_o(wbs_eth1_cfg_err_o),
578
         .m_wb_adr_o(wbm_eth1_adr_o),
579
         .m_wb_sel_o(wbm_eth1_sel_o),
580
         .m_wb_we_o(wbm_eth1_we_o),
581
         .m_wb_dat_o(wbm_eth1_dat_o),
582
         .m_wb_dat_i(wbm_eth1_dat_i),
583
         .m_wb_cyc_o(wbm_eth1_cyc_o),
584
         .m_wb_stb_o(wbm_eth1_stb_o),
585
         .m_wb_ack_i(wbm_eth1_ack_i),
586
         .m_wb_err_i(wbm_eth1_err_i),
587
         .m_wb_cti_o(wbm_eth1_cti_o),
588
         .m_wb_bte_o(wbm_eth1_bte_o),
589
         .mtx_clk_pad_i(m1tx_clk),
590
         .mtxd_pad_o(m1txd),
591
         .mtxen_pad_o(m1txen),
592
         .mtxerr_pad_o(m1txerr),
593
         .mrx_clk_pad_i(m1rx_clk),
594
         .mrxd_pad_i(m1rxd),
595
         .mrxdv_pad_i(m1rxdv),
596
         .mrxerr_pad_i(m1rxerr),
597
         .mcoll_pad_i(m1coll),
598
         .mcrs_pad_i(m1crs),
599
         .mdc_pad_o(mdc_o[1]),
600
         .md_pad_i(md_i[1]),
601
         .md_pad_o(md_o[1]),
602
         .md_padoe_o(md_oe[1]),
603
         .int_o(eth_int[1])
604
         );
605
iobuftri iobuftri1
606
  (
607
   .i(md_o[1]),
608
   .oe(md_oe[1]),
609
   .o(md_i[1]),
610
   .pad(eth_md_pad_io[1])
611
   );
612
obuf obuf1
613
  (
614
   .i(mdc_o[1]),
615
   .pad(eth_mdc_pad_o[1])
616
   );
617
smii_txrx smii_txrx1
618
  (
619
   .tx(tx[1]),
620
   .rx(rx[1]),
621
   .mtx_clk(m1tx_clk),
622
   .mtxd(m1txd),
623
   .mtxen(m1txen),
624
   .mtxerr(m1txerr),
625
   .mrx_clk(m1rx_clk),
626
   .mrxd(m1rxd),
627
   .mrxdv(m1rxdv),
628
   .mrxerr(m1rxerr),
629
   .mcoll(m1coll),
630
   .mcrs(m1crs),
631
   .state(state),
632
   .clk(eth_clk),
633
   .rst(wb_rst)
634
   );
635
obufdff obufdff_sync1
636
  (
637
   .d(sync),
638
   .pad(eth_sync_pad_o[1]),
639
   .clk(eth_clk),
640
   .rst(wb_rst)
641
   );
642
obufdff obufdff_tx1
643
  (
644
   .d(tx[1]),
645
   .pad(eth_tx_pad_o[1]),
646
   .clk(eth_clk),
647
   .rst(wb_rst)
648
   );
649
ibufdff ibufdff_rx1
650
  (
651
   .pad(eth_rx_pad_i[1]),
652
   .q(rx[1]),
653
   .clk(eth_clk),
654
   .rst(wb_rst)
655
   );
656 46 julius
`else // !`ifdef USE_ETHERNET
657 54 julius
   // If ethernet core is disabled, still ack anyone who tries
658
   // to access its config port. This allows linux to boot in
659
   // the verilated ORPSoC.
660
   reg        wbs_eth1_cfg_ack_r;
661
   always @(posedge wb_clk)
662
     wbs_eth1_cfg_ack_r <= (wbs_eth1_cfg_cyc_i & wbs_eth1_cfg_stb_i);
663
 
664 46 julius
   // Tie off WB arbitor inputs
665
   assign wbs_eth1_cfg_dat_o = 0;
666 54 julius
   assign wbs_eth1_cfg_ack_o = wbs_eth1_cfg_ack_r;
667 46 julius
   assign wbs_eth1_cfg_err_o = 0;
668 54 julius
   // Tie off ethernet master ctrl signals
669 46 julius
   assign wbm_eth1_adr_o = 0;
670
   assign wbm_eth1_sel_o = 0;
671
   assign wbm_eth1_we_o = 0;
672
   assign wbm_eth1_dat_o = 0;
673
   assign wbm_eth1_cyc_o = 0;
674
   assign wbm_eth1_stb_o = 0;
675
   assign wbm_eth1_cti_o = 0;
676
   assign wbm_eth1_bte_o = 0;
677
`endif //  `ifdef USE_ETHERNET
678
 
679 40 julius
   dummy_slave
680
     # ( .value(32'hc0000000))
681
   ds1
682
     (
683
       .dat_o(wbs_ds1_dat_o),
684
       .stb_i(wbs_ds1_stb_i),
685
       .cyc_i(wbs_ds1_cyc_i),
686
       .ack_o(wbs_ds1_ack_o),
687
       .clk(wb_clk),
688
       .rst(wb_rst)
689
       );
690
   dummy_slave
691
     # ( .value(32'hf0000000))
692
     ds2
693
     (
694
       .dat_o(wbs_ds2_dat_o),
695
       .stb_i(wbs_ds2_stb_i),
696
       .cyc_i(wbs_ds2_cyc_i),
697
       .ack_o(wbs_ds2_ack_o),
698
       .clk(wb_clk),
699
       .rst(wb_rst)
700
       );
701
   clk_gen iclk_gen
702
     (
703
      .POWERDOWN (1'b1),
704
      .CLKA (clk_pad_i),
705
      .LOCK (pll_lock),
706
      .GLA(wb_clk),
707
      .GLB(usbClk_pll),
708
      .GLC()
709
      );
710 46 julius
 
711
   assign rst_pad_o = pll_lock;
712
 
713 40 julius
   gbuf gbufi1
714
     (
715
      .CLK(~(pll_lock & rst_pad_i)),
716
      .GL(wb_rst));
717
   gbuf gbufi2
718
     (
719
      .CLK(dbg_tck_pad_i),
720
      .GL(dbg_tck));
721
   gbuf gbufi3
722
     (
723
      .CLK(usbClk_pll),
724
      .GL(usbClk));
725
   gbuf gbufi4
726
     (
727
      .CLK(eth_clk_pad_i),
728
      .GL(eth_clk));
729 46 julius
 
730
 
731 40 julius
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.