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

Subversion Repositories or1k

[/] [or1k/] [tags/] [first/] [mp3/] [bench/] [verilog/] [xess_top.v] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 266 lampret
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  MP3 demo Test bench top level                               ////
4
////                                                              ////
5
////  This file is part of the MP3 demo application               ////
6
////  http://www.opencores.org/cores/or1k/mp3/                    ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  Top level of MP3 demo test bench.                           ////
10
////                                                              ////
11
////  To Do:                                                      ////
12
////   - nothing really                                           ////
13
////                                                              ////
14
////  Author(s):                                                  ////
15
////      - Lior Shtram, lior.shtram@flextronicssemi.com          ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2001 Authors                                   ////
20
////                                                              ////
21
//// This source file may be used and distributed without         ////
22
//// restriction provided that this copyright statement is not    ////
23
//// removed from the file and that any derivative work contains  ////
24
//// the original copyright notice and the associated disclaimer. ////
25
////                                                              ////
26
//// This source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE.  See the GNU Lesser General Public License for more ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from http://www.opencores.org/lgpl.shtml                     ////
41
////                                                              ////
42
//////////////////////////////////////////////////////////////////////
43
//
44
// CVS Revision History
45
//
46
// $Log: not supported by cvs2svn $
47
//
48
// Xess board - top bench module
49
 
50
`include "timescale.v"
51
`include "bench_define.v"
52
 
53
module xess_top (
54
);
55
 
56
`ifdef SRAM_INIT
57
sram_init sram_init1();
58
`endif
59
 
60
reg             r_rstn;
61
reg             r_clk;
62
reg             r_clk2;
63
wire            rstn;
64
wire            clk;
65
wire            clk2;
66
 
67
wire            flash_rstn;
68
wire            flash_oen;
69
wire            flash_cen;
70
wire            flash_wen;
71
wire            flash_rdy;
72
wire [7:0]       flash_d;
73
wire [20:0]      flash_a;
74
wire [31:0]      flash_vpp;              // Special flash inputs
75
wire [31:0]      flash_vcc;              // Special flash inputs
76
wire [1:0]       flash_rpblevel;         // Special flash inputs
77
wire            sram_r_cen;
78
wire            sram_r0_wen;
79
wire            sram_r1_wen;
80
wire            sram_r_oen;
81
wire [18:0]      sram_r_a;
82
wire [15:0]      sram_r_d;
83
wire            sram_l_cen;
84
wire            sram_l0_wen;
85
wire            sram_l1_wen;
86
wire            sram_l_oen;
87
wire [18:0]      sram_l_a;
88
wire [15:0]      sram_l_d;
89
wire            codec_mclk;
90
wire            codec_lrclk;
91
wire            codec_sclk;
92
wire            codec_sdin;
93
wire            codec_sdout;
94
wire            vga_hsyncn;
95
wire            vga_vsyncn;
96
wire [1:0]       vga_r;
97
wire [1:0]       vga_g;
98
wire [1:0]       vga_b;
99
wire            eth_tx_er;
100
wire            eth_tx_clk;
101
wire            eth_tx_en;
102
wire [4:0]       eth_txd;
103
wire            eth_rx_er;
104
wire            eth_rx_clk;
105
wire            eth_rx_dv;
106
wire [4:0]       eth_rxd;
107
wire            eth_col;
108
wire            eth_crs;
109
wire            eth_trste;
110
wire            eth_fds_mdint;
111
wire            eth_mdio;
112
wire            eth_mdc;
113
wire [2:1]      switch;
114
wire            USB_VPO;
115
wire            USB_VMO;
116
wire            gdb_tms;
117
wire            gdb_tck;
118
wire            gdb_trst;
119
wire            gdb_tdi;
120
wire            gdb_tdo;
121
wire    [6:3]   pps;
122
 
123
// Putting here the following blocks
124
 
125
// The xfpga_top
126
 
127
xfpga_top i_xess_fpga(
128
        .clk( clk ),
129
//      .clk2(clk2),
130
        .rstn( rstn ),
131
 
132
        .flash_rstn( flash_rstn ),
133
        .flash_cen( flash_cen ),
134
        .flash_oen( flash_oen ),
135
        .flash_wen( flash_wen ),
136
        .flash_rdy( flash_rdy ),
137
        .flash_d( flash_d ),
138
        .flash_a( flash_a ),
139
 
140
        .sram_r_cen( sram_r_cen ),
141
        .sram_r_oen( sram_r_oen ),
142
        .sram_r0_wen( sram_r0_wen ),
143
        .sram_r1_wen( sram_r1_wen ),
144
        .sram_r_d( sram_r_d ),
145
        .sram_r_a( sram_r_a ),
146
 
147
        .sram_l_cen( sram_l_cen ),
148
        .sram_l_oen( sram_l_oen ),
149
        .sram_l0_wen( sram_l0_wen ),
150
        .sram_l1_wen( sram_l1_wen ),
151
        .sram_l_d( sram_l_d ),
152
        .sram_l_a( sram_l_a ),
153
 
154
        .codec_mclk( codec_mclk ),
155
        .codec_lrclk( codec_lrclk ),
156
        .codec_sclk( codec_sclk ),
157
        .codec_sdin( codec_sdin ),
158
        .codec_sdout( codec_sdout ),
159
 
160
        .vga_blank(),
161
        .vga_pclk(),
162
        .vga_hsyncn( vga_hsyncn ),
163
        .vga_vsyncn( vga_vsyncn ),
164
        .vga_r( vga_r ),
165
        .vga_g( vga_g ),
166
        .vga_b( vga_b ),
167
 
168
        .eth_col( eth_col ),
169
        .eth_crs( eth_crs ),
170
        .eth_trste( eth_trste ),
171
        .eth_tx_clk( eth_tx_clk ),
172
        .eth_tx_en( eth_tx_en ),
173
        .eth_tx_er( eth_tx_er ),
174
        .eth_txd( eth_txd ),
175
        .eth_rx_clk( eth_rx_clk ),
176
        .eth_rx_dv( eth_rx_dv ),
177
        .eth_rx_er( eth_rx_er ),
178
        .eth_rxd( eth_rxd ),
179
        .eth_fds_mdint( eth_fds_mdint ),
180
        .eth_mdc( eth_mdc ),
181
        .eth_mdio( eth_mdio ),
182
 
183
        .sw( switch ),
184
        .USB_VPO(USB_VPO),
185
        .USB_VMO(USB_VMO),
186
 
187
 
188
        .ps2_clk( ps2_clk ),
189
        .ps2_data( ps2_data ),
190
 
191
        .cpld_tdo(cpld_tdo)
192
 
193
);
194
 
195
// The Flash RAM
196
 
197
assign flash_vpp = 32'h00002ee0;
198
assign flash_vcc = 32'h00001388;
199
assign flash_rpblevel = 2'b10;
200
 
201
i28f016s3 Flash (
202
        .rpb( flash_rstn ),
203
        .ceb( flash_cen ),
204
        .oeb( flash_oen ),
205
        .web( flash_wen ),
206
        .ryby( flash_rdy ),
207
        .dq( flash_d ),
208
        .addr( flash_a ),
209
        .vpp( flash_vpp ),
210
        .vcc( flash_vcc ),
211
        .rpblevel( flash_rpblevel )
212
);
213
 
214
// The SRAM
215
 
216
A512Kx8 Sram_r0 (
217
        .CE_bar( sram_r_cen ),
218
        .OE_bar( sram_r_oen ),
219
        .WE_bar( sram_r0_wen ),
220
        .dataIO( sram_r_d[7:0] ),
221
        .Address( sram_r_a )
222
);
223
 
224
A512Kx8 Sram_r1 (
225
        .CE_bar( sram_r_cen ),
226
        .OE_bar( sram_r_oen ),
227
        .WE_bar( sram_r1_wen ),
228
        .dataIO( sram_r_d[15:8] ),
229
        .Address( sram_r_a )
230
);
231
 
232
A512Kx8 Sram_l0 (
233
        .CE_bar( sram_l_cen ),
234
        .OE_bar( sram_l_oen ),
235
        .WE_bar( sram_l0_wen ),
236
        .dataIO( sram_l_d[7:0] ),
237
        .Address( sram_l_a )
238
);
239
 
240
A512Kx8 Sram_l1 (
241
        .CE_bar( sram_l_cen ),
242
        .OE_bar( sram_l_oen ),
243
        .WE_bar( sram_l1_wen ),
244
        .dataIO( sram_l_d[15:8] ),
245
        .Address( sram_l_a )
246
);
247
 
248
// The Codec
249
 
250
codec_model codec (
251
        .mclk( codec_mclk ),
252
        .lrclk( codec_lrclk ),
253
        .sclk( codec_sclk ),
254
        .sdin( codec_sdin ),
255
        .sdout( codec_sdout )
256
);
257
 
258
// The VGA
259
 
260
vga_model VGA (
261
        .pclk( clk ),
262
        .hsyncn( vga_hsyncn ),
263
        .vsyncn( vga_vsyncn ),
264
        .r( vga_r ),
265
        .g( vga_g ),
266
        .b( vga_b )
267
);
268
 
269
// We simulate CPLD because it has GDB JTAG multiplexer that
270
// works together with demultiplexer in FPGA to connect GDB to
271
// the RISC
272
`ifdef UNUSED
273
config_gdb xcpld (
274
        .clk(clk),
275
        .a(flash_a),
276
        .ceb(),
277
        .oeb(),
278
        .web(),
279
        .resetb(),
280
        .V_progb(),
281
        .V_cclk(),
282
        .V_csb(),
283
        .V_wrb(),
284
        .V_initb(cpld_tdo),
285
        .V_dout(1'b0),
286
        .V_done(1'b1),
287
        .V_m(),
288
 
289
        .ppd({2'b00, gdb_tms, gdb_tdi, gdb_trst, gdb_tck, 2'b00}),
290
        .pps(pps),
291
        .ppc(4'h0)
292
);
293
assign gdb_tdo = pps[4];
294
`else
295
/* SIMON */
296
 
297
assign flash_a[6] = flash_cen ? gdb_tms : 1'bz;
298
assign flash_a[7] = flash_cen ? gdb_tdi : 1'bz;
299
assign flash_a[8] = flash_cen ? gdb_trst : 1'bz;
300
assign flash_a[9] = flash_cen ? gdb_tck : 1'bz;
301
assign gdb_tdo = cpld_tdo;
302
/*
303
assign flash_a[6] =  gdb_tms;
304
assign flash_a[7] =  gdb_tdi;
305
assign flash_a[8] =  gdb_trst;
306
assign flash_a[9] =  gdb_tck;
307
assign gdb_tdo = cpld_tdo;
308
*/
309
`endif
310
 
311
// DBG i/f
312
`ifdef DBG_IF_COMM
313
dbg_comm dbg_comm(
314
`else
315
`ifdef DBG2_IF_COMM
316
dbg_comm2 dbg_comm(
317
        .P_TMS(gdb_tms),
318
        .P_TCK(gdb_tck),
319
        .P_TRST(gdb_trst),
320
        .P_TDI(gdb_tdi),
321
        .P_TDO(gdb_tdo)
322
);
323
`else
324
assign gdb_tms = 1'b0;
325
assign gdb_tck = 1'b0;
326
assign gdb_trst = rstn;
327
assign gdb_tdi = 1'b0;
328
`endif
329
`endif
330
        assign eth_tx_clk = 1'b0;
331
        assign eth_rx_er = 1'b0;
332
        assign eth_rx_clk = 1'b0;
333
        assign eth_rx_dv = 1'b0;
334
        assign eth_rxd = 5'b0;
335
        assign eth_col= 1'b0;
336
        assign eth_crs = 1'b0;
337
        assign eth_fds_mdint = 1'b0;
338
        assign eth_mdio = 1'bZ;
339
        assign switch = 2'b0;
340
 
341
        assign ps2_clk = 1'b0;
342
        assign ps2_data = 1'b0;
343
 
344
initial
345
begin
346
   #0 r_rstn = 1;
347
   #1 r_rstn = 0;
348
`ifdef SRAM_INIT
349
   sram_init1.init_sram;
350
`endif
351
   repeat (`RESET_TIME) @(negedge r_clk);
352
   r_rstn = 1;
353
end
354
 
355
assign rstn = r_rstn;
356
 
357
initial begin
358
   r_clk = `INIT_CLK_VALUE;
359
   r_clk2 = `INIT_CLK2_VALUE;
360
end
361
 
362
always
363
begin
364
   #`CLK_PERIOD_DIV2 r_clk <= ~r_clk;
365
end
366
 
367
always
368
begin
369
   #`CLK2_PERIOD_DIV2 r_clk2 <= ~r_clk2;
370
end
371
 
372
assign clk = r_clk;
373
assign clk2 = r_clk2;
374
 
375
endmodule

powered by: WebSVN 2.1.0

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