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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [orp/] [orp_soc/] [bench/] [verilog/] [xess_top.v] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 779 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 948 lampret
// Revision 1.1  2002/03/28 19:59:55  lampret
48
// Added bench directory
49
//
50 779 lampret
// Revision 1.2  2002/01/03 08:40:15  lampret
51
// Added second clock as RISC main clock. Updated or120_monitor.
52
//
53
// Revision 1.1.1.1  2001/11/04 18:51:07  lampret
54
// First import.
55
//
56
//
57
// Xess board - top bench module
58
 
59
`include "timescale.v"
60
`include "bench_defines.v"
61
 
62
module xess_top (
63
);
64
 
65
`ifdef SRAM_INIT
66
sram_init sram_init1();
67
`endif
68
 
69
reg             r_rstn;
70
reg             r_clk;
71
wire            rstn;
72
wire            clk;
73
 
74
wire            flash_rstn;
75
wire            flash_oen;
76
wire            flash_cen;
77
wire            flash_wen;
78
wire            flash_rdy;
79
wire [7:0]       flash_d;
80
wire [20:0]      flash_a;
81
wire [31:0]      flash_vpp;              // Special flash inputs
82
wire [31:0]      flash_vcc;              // Special flash inputs
83
wire [1:0]       flash_rpblevel;         // Special flash inputs
84
wire            sram_r_cen;
85
wire            sram_r0_wen;
86
wire            sram_r1_wen;
87
wire            sram_r_oen;
88
wire [18:0]      sram_r_a;
89
wire [15:0]      sram_r_d;
90
wire            sram_l_cen;
91
wire            sram_l0_wen;
92
wire            sram_l1_wen;
93
wire            sram_l_oen;
94
wire [18:0]      sram_l_a;
95
wire [15:0]      sram_l_d;
96
wire            codec_mclk;
97
wire            codec_lrclk;
98
wire            codec_sclk;
99
wire            codec_sdin;
100
wire            codec_sdout;
101
wire            vga_hsyncn;
102
wire            vga_vsyncn;
103
wire [1:0]       vga_r;
104
wire [1:0]       vga_g;
105
wire [1:0]       vga_b;
106
wire            eth_tx_er;
107
wire            eth_tx_clk;
108
wire            eth_tx_en;
109
wire [4:0]       eth_txd;
110
wire            eth_rx_er;
111
wire            eth_rx_clk;
112
wire            eth_rx_dv;
113
wire [4:0]       eth_rxd;
114
wire            eth_col;
115
wire            eth_crs;
116
wire            eth_trste;
117
wire            eth_fds_mdint;
118
wire            eth_mdio;
119
wire            eth_mdc;
120
wire [2:1]      switch;
121
wire            USB_VPO;
122
wire            USB_VMO;
123
wire            gdb_tms;
124
wire            gdb_tck;
125
wire            gdb_trst;
126
wire            gdb_tdi;
127
wire            gdb_tdo;
128
wire    [6:3]   pps;
129
 
130
// Putting here the following blocks
131
 
132
// The xfpga_top
133
 
134 948 lampret
xsv_fpga_top i_xess_fpga(
135 779 lampret
        .clk( clk ),
136
        .rstn( rstn ),
137
 
138
        .flash_rstn( flash_rstn ),
139
        .flash_cen( flash_cen ),
140
        .flash_oen( flash_oen ),
141
        .flash_wen( flash_wen ),
142
        .flash_rdy( flash_rdy ),
143
        .flash_d( flash_d ),
144
        .flash_a( flash_a ),
145
 
146
        .sram_r_cen( sram_r_cen ),
147
        .sram_r_oen( sram_r_oen ),
148
        .sram_r0_wen( sram_r0_wen ),
149
        .sram_r1_wen( sram_r1_wen ),
150
        .sram_r_d( sram_r_d ),
151
        .sram_r_a( sram_r_a ),
152
 
153
        .sram_l_cen( sram_l_cen ),
154
        .sram_l_oen( sram_l_oen ),
155
        .sram_l0_wen( sram_l0_wen ),
156
        .sram_l1_wen( sram_l1_wen ),
157
        .sram_l_d( sram_l_d ),
158
        .sram_l_a( sram_l_a ),
159
 
160
        .codec_mclk( codec_mclk ),
161
        .codec_lrclk( codec_lrclk ),
162
        .codec_sclk( codec_sclk ),
163
        .codec_sdin( codec_sdin ),
164
        .codec_sdout( codec_sdout ),
165
 
166
        .vga_blank(),
167
        .vga_pclk(),
168
        .vga_hsyncn( vga_hsyncn ),
169
        .vga_vsyncn( vga_vsyncn ),
170
        .vga_r( vga_r ),
171
        .vga_g( vga_g ),
172
        .vga_b( vga_b ),
173
 
174
        .eth_col( eth_col ),
175
        .eth_crs( eth_crs ),
176
        .eth_trste( eth_trste ),
177
        .eth_tx_clk( eth_tx_clk ),
178
        .eth_tx_en( eth_tx_en ),
179
        .eth_tx_er( eth_tx_er ),
180
        .eth_txd( eth_txd ),
181
        .eth_rx_clk( eth_rx_clk ),
182
        .eth_rx_dv( eth_rx_dv ),
183
        .eth_rx_er( eth_rx_er ),
184
        .eth_rxd( eth_rxd ),
185
        .eth_fds_mdint( eth_fds_mdint ),
186
        .eth_mdc( eth_mdc ),
187
        .eth_mdio( eth_mdio ),
188
 
189
        .sw( switch ),
190
 
191
        .ps2_clk( ps2_clk ),
192
        .ps2_data( ps2_data ),
193
 
194
        .tdmfrm(1'b0),
195
        .tdmrx(1'b0),
196
        .tdmtx()
197
//        .cpld_tdo(cpld_tdo)
198
 
199
);
200
 
201
// The Flash RAM
202
 
203
assign flash_vpp = 32'h00002ee0;
204
assign flash_vcc = 32'h00001388;
205
assign flash_rpblevel = 2'b10;
206
 
207
i28f016s3 Flash (
208
        .rpb( flash_rstn ),
209
        .ceb( flash_cen ),
210
        .oeb( flash_oen ),
211
        .web( flash_wen ),
212
        .ryby( flash_rdy ),
213
        .dq( flash_d ),
214
        .addr( flash_a ),
215
        .vpp( flash_vpp ),
216
        .vcc( flash_vcc ),
217
        .rpblevel( flash_rpblevel )
218
);
219
 
220
// The SRAM
221
 
222
A512Kx8 Sram_r0 (
223
        .CE_bar( sram_r_cen ),
224
        .OE_bar( sram_r_oen ),
225
        .WE_bar( sram_r0_wen ),
226
        .dataIO( sram_r_d[7:0] ),
227
        .Address( sram_r_a )
228
);
229
 
230
A512Kx8 Sram_r1 (
231
        .CE_bar( sram_r_cen ),
232
        .OE_bar( sram_r_oen ),
233
        .WE_bar( sram_r1_wen ),
234
        .dataIO( sram_r_d[15:8] ),
235
        .Address( sram_r_a )
236
);
237
 
238
A512Kx8 Sram_l0 (
239
        .CE_bar( sram_l_cen ),
240
        .OE_bar( sram_l_oen ),
241
        .WE_bar( sram_l0_wen ),
242
        .dataIO( sram_l_d[7:0] ),
243
        .Address( sram_l_a )
244
);
245
 
246
A512Kx8 Sram_l1 (
247
        .CE_bar( sram_l_cen ),
248
        .OE_bar( sram_l_oen ),
249
        .WE_bar( sram_l1_wen ),
250
        .dataIO( sram_l_d[15:8] ),
251
        .Address( sram_l_a )
252
);
253
 
254
// The Codec
255
 
256
codec_model codec (
257
        .mclk( codec_mclk ),
258
        .lrclk( codec_lrclk ),
259
        .sclk( codec_sclk ),
260
        .sdin( codec_sdin ),
261
        .sdout( codec_sdout )
262
);
263
 
264
// The VGA
265
 
266
vga_model VGA (
267
        .pclk( clk ),
268
        .hsyncn( vga_hsyncn ),
269
        .vsyncn( vga_vsyncn ),
270
        .r( vga_r ),
271
        .g( vga_g ),
272
        .b( vga_b )
273
);
274
 
275
// We simulate CPLD because it has GDB JTAG multiplexer that
276
// works together with demultiplexer in FPGA to connect GDB to
277
// the RISC
278
`ifdef UNUSED
279
config_gdb xcpld (
280
        .clk(clk),
281
        .a(flash_a),
282
        .ceb(),
283
        .oeb(),
284
        .web(),
285
        .resetb(),
286
        .V_progb(),
287
        .V_cclk(),
288
        .V_csb(),
289
        .V_wrb(),
290
        .V_initb(cpld_tdo),
291
        .V_dout(1'b0),
292
        .V_done(1'b1),
293
        .V_m(),
294
 
295
        .ppd({2'b00, gdb_tms, gdb_tdi, gdb_trst, gdb_tck, 2'b00}),
296
        .pps(pps),
297
        .ppc(4'h0)
298
);
299
assign gdb_tdo = pps[4];
300
`else
301
/* SIMON */
302
 
303
assign flash_a[6] = flash_cen ? gdb_tms : 1'bz;
304
assign flash_a[7] = flash_cen ? gdb_tdi : 1'bz;
305
assign flash_a[8] = flash_cen ? gdb_trst : 1'bz;
306
assign flash_a[9] = flash_cen ? gdb_tck : 1'bz;
307
//assign gdb_tdo = cpld_tdo;
308
/*
309
assign flash_a[6] =  gdb_tms;
310
assign flash_a[7] =  gdb_tdi;
311
assign flash_a[8] =  gdb_trst;
312
assign flash_a[9] =  gdb_tck;
313
assign gdb_tdo = cpld_tdo;
314
*/
315
`endif
316
 
317
// DBG i/f
318
`ifdef DBG_IF_COMM
319
dbg_comm dbg_comm(
320
`else
321
`ifdef DBG2_IF_COMM
322
dbg_comm2 dbg_comm(
323
        .P_TMS(gdb_tms),
324
        .P_TCK(gdb_tck),
325
        .P_TRST(gdb_trst),
326
        .P_TDI(gdb_tdi),
327
        .P_TDO(gdb_tdo)
328
);
329
`else
330
assign gdb_tms = 1'b0;
331
assign gdb_tck = 1'b0;
332
assign gdb_trst = rstn;
333
assign gdb_tdi = 1'b0;
334
`endif
335
`endif
336
        assign eth_tx_clk = 1'b0;
337
        assign eth_rx_er = 1'b0;
338
        assign eth_rx_clk = 1'b0;
339
        assign eth_rx_dv = 1'b0;
340
        assign eth_rxd = 5'b0;
341
        assign eth_col= 1'b0;
342
        assign eth_crs = 1'b0;
343
        assign eth_fds_mdint = 1'b0;
344
        assign eth_mdio = 1'bZ;
345
        assign switch = 2'b0;
346
 
347
        assign ps2_clk = 1'b0;
348
        assign ps2_data = 1'b0;
349
 
350
initial
351
begin
352
   #0 r_rstn = 1;
353
   #1 r_rstn = 0;
354
`ifdef SRAM_INIT
355
   sram_init1.init_sram;
356
`endif
357
   repeat (`BENCH_RESET_TIME) @(negedge r_clk);
358
   r_rstn = 1;
359
end
360
 
361
assign rstn = r_rstn;
362
 
363
initial begin
364
   r_clk = 1'b0;
365
end
366
 
367
always
368
begin
369
   #`BENCH_CLK_HALFPERIOD r_clk <= ~r_clk;
370
end
371
 
372
assign clk = r_clk;
373
 
374
endmodule

powered by: WebSVN 2.1.0

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