Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 2 | lvd | 1 | // part of NeoGS project (c) 2007-2008 NedoPC |
| 2 | // |
||
| 3 | // main top-level module |
||
| 4 | |||
| 5 | module main( |
||
| 6 | |||
| 7 | clk_fpga, // clocks |
||
| 8 | clk_24mhz, // |
||
| 9 | |||
| 10 | clksel0, // clock selection |
||
| 11 | clksel1, // |
||
| 12 | |||
| 13 | warmres_n, // warm reset |
||
| 14 | |||
| 15 | |||
| 16 | d, // Z80 data bus |
||
| 17 | a, // Z80 address bus |
||
| 18 | |||
| 19 | iorq_n, // Z80 control signals |
||
| 20 | mreq_n, // |
||
| 21 | rd_n, // |
||
| 22 | wr_n, // |
||
| 23 | m1_n, // |
||
| 24 | int_n, // |
||
| 25 | nmi_n, // |
||
| 26 | busrq_n, // |
||
| 27 | busak_n, // |
||
| 28 | z80res_n, // |
||
| 29 | |||
| 30 | |||
| 31 | mema14, // memory control |
||
| 32 | mema15, // |
||
| 33 | mema16, // |
||
| 34 | mema17, // |
||
| 35 | mema18, // |
||
| 36 | ram0cs_n, // |
||
| 37 | ram1cs_n, // |
||
| 38 | ram2cs_n, // |
||
| 39 | ram3cs_n, // |
||
| 40 | romcs_n, // |
||
| 41 | memoe_n, // |
||
| 42 | memwe_n, // |
||
| 43 | |||
| 44 | |||
| 45 | zxid, // zxbus signals |
||
| 46 | zxa, // |
||
| 47 | zxa14, // |
||
| 48 | zxa15, // |
||
| 49 | zxiorq_n, // |
||
| 50 | zxmreq_n, // |
||
| 51 | zxrd_n, // |
||
| 52 | zxwr_n, // |
||
| 53 | zxcsrom_n, // |
||
| 54 | zxblkiorq_n, // |
||
| 55 | zxblkrom_n, // |
||
| 56 | zxgenwait_n, // |
||
| 57 | zxbusin, // |
||
| 58 | zxbusena_n, // |
||
| 59 | |||
| 60 | |||
| 61 | dac_bitck, // audio-DAC signals |
||
| 62 | dac_lrck, // |
||
| 63 | dac_dat, // |
||
| 64 | |||
| 65 | |||
| 66 | sd_clk, // SD card interface |
||
| 67 | sd_cs, // |
||
| 68 | sd_do, // |
||
| 69 | sd_di, // |
||
| 70 | sd_wp, // |
||
| 71 | sd_det, // |
||
| 72 | |||
| 73 | |||
| 74 | ma_clk, // control interface of MP3 chip |
||
| 75 | ma_cs, |
||
| 76 | ma_do, |
||
| 77 | ma_di, |
||
| 78 | |||
| 79 | mp3_xreset, // data interface of MP3 chip |
||
| 80 | mp3_req, // |
||
| 81 | mp3_clk, // |
||
| 82 | mp3_dat, // |
||
| 83 | mp3_sync, // |
||
| 84 | |||
| 85 | led_diag // LED driver |
||
| 86 | |||
| 87 | ); |
||
| 88 | |||
| 89 | |||
| 90 | // input-output description |
||
| 91 | |||
| 92 | input clk_fpga; |
||
| 93 | input clk_24mhz; |
||
| 94 | |||
| 95 | output clksel0; |
||
| 96 | output clksel1; |
||
| 97 | |||
| 98 | |||
| 99 | input warmres_n; |
||
| 100 | |||
| 101 | inout reg [7:0] d; |
||
| 102 | |||
| 103 | inout reg [15:0] a; |
||
| 104 | |||
| 105 | input iorq_n; |
||
| 106 | input mreq_n; |
||
| 107 | input rd_n; |
||
| 108 | input wr_n; |
||
| 109 | input m1_n; |
||
| 110 | output int_n; |
||
| 111 | output nmi_n; |
||
| 112 | output busrq_n; |
||
| 113 | input busak_n; |
||
| 114 | output reg z80res_n; |
||
| 115 | |||
| 116 | |||
| 117 | output reg mema14; |
||
| 118 | output reg mema15; |
||
| 119 | output reg mema16; |
||
| 120 | output reg mema17; |
||
| 121 | output reg mema18; |
||
| 122 | output reg ram0cs_n; |
||
| 123 | output reg ram1cs_n; |
||
| 124 | output reg ram2cs_n; |
||
| 125 | output reg ram3cs_n; |
||
| 126 | output reg romcs_n; |
||
| 127 | output reg memoe_n; |
||
| 128 | output reg memwe_n; |
||
| 129 | |||
| 130 | |||
| 131 | inout [7:0] zxid; |
||
| 132 | input [7:0] zxa; |
||
| 133 | input zxa14; |
||
| 134 | input zxa15; |
||
| 135 | input zxiorq_n; |
||
| 136 | input zxmreq_n; |
||
| 137 | input zxrd_n; |
||
| 138 | input zxwr_n; |
||
| 139 | input zxcsrom_n; |
||
| 140 | output zxblkiorq_n; |
||
| 141 | output zxblkrom_n; |
||
| 142 | output zxgenwait_n; |
||
| 143 | output zxbusin; |
||
| 144 | output zxbusena_n; |
||
| 145 | |||
| 146 | |||
| 147 | output dac_bitck; |
||
| 148 | output dac_lrck; |
||
| 149 | output dac_dat; |
||
| 150 | |||
| 151 | |||
| 152 | output sd_clk; |
||
| 153 | output sd_cs; |
||
| 154 | output sd_do; |
||
| 155 | input sd_di; |
||
| 156 | input sd_wp; |
||
| 157 | input sd_det; |
||
| 158 | |||
| 159 | |||
| 160 | output ma_clk; |
||
| 161 | output ma_cs; |
||
| 162 | output ma_do; |
||
| 163 | input ma_di; |
||
| 164 | |||
| 165 | output mp3_xreset; |
||
| 166 | input mp3_req; |
||
| 167 | output mp3_clk; |
||
| 168 | output mp3_dat; |
||
| 169 | output mp3_sync; |
||
| 170 | |||
| 171 | output led_diag; |
||
| 172 | |||
| 173 | |||
| 174 | // global signals |
||
| 175 | |||
| 176 | wire internal_reset_n; // internal reset for everything |
||
| 177 | |||
| 178 | |||
| 179 | // zxbus-ports interconnection |
||
| 180 | |||
| 181 | wire rst_from_zx_n; // internal z80 reset |
||
| 182 | |||
| 183 | wire [7:0] command_zx2gs; |
||
| 184 | wire [7:0] data_zx2gs; |
||
| 185 | wire [7:0] data_gs2zx; |
||
| 186 | wire command_bit_2gs; |
||
| 187 | wire command_bit_2zx; |
||
| 188 | wire command_bit_wr; |
||
| 189 | wire data_bit_2gs; |
||
| 190 | wire data_bit_2zx; |
||
| 191 | wire data_bit_wr; |
||
| 192 | |||
| 193 | // memmap-bus interconnection |
||
| 194 | wire [18:14] memmap_a; |
||
| 195 | wire [3:0] memmap_ramcs_n; |
||
| 196 | wire memmap_romcs_n; |
||
| 197 | wire memmap_memoe_n; |
||
| 198 | wire memmap_memwe_n; |
||
| 199 | |||
| 200 | // dma-bus interconnection |
||
| 201 | wire [20:0] mem_dma_addr; |
||
| 202 | wire [7:0] mem_dma_wd; |
||
| 203 | |||
| 204 | wire mem_dma_bus; |
||
| 205 | wire mem_dma_rnw; |
||
| 206 | wire mem_dma_oe; |
||
| 207 | wire mem_dma_we; |
||
| 208 | |||
| 209 | wire dma_takeover_enabled; |
||
| 210 | |||
| 211 | wire dma_ack; |
||
| 212 | wire dma_end; |
||
| 213 | wire dma_req; |
||
| 214 | wire [20:0] dma_addr; |
||
| 215 | wire dma_rnw; |
||
| 216 | wire [7:0] dma_rd; |
||
| 217 | wire [7:0] dma_wd; |
||
| 218 | |||
| 219 | wire zx_dmaread,zx_dmawrite; |
||
| 220 | wire zx_wait_ena; |
||
| 221 | |||
| 222 | wire [7:0] dma_zxrd_data; |
||
| 223 | wire [7:0] dma_zxwr_data; |
||
| 224 | |||
| 225 | |||
| 226 | wire [7:0] dma_dout_zx; |
||
| 227 | wire dma_on_zx; |
||
| 228 | wire dma_select_zx; |
||
| 229 | |||
| 230 | wire [7:0] dma_din_modules; |
||
| 231 | |||
| 232 | wire [1:0] dma_regsel; |
||
| 233 | wire dma_wrstb; |
||
| 234 | |||
| 235 | |||
| 236 | // ports-memmap interconnection |
||
| 237 | wire mode_ramro,mode_norom; |
||
| 238 | wire [6:0] mode_pg0,mode_pg1; |
||
| 239 | |||
| 240 | // ports databus |
||
| 241 | wire [7:0] ports_dout; |
||
| 242 | wire ports_busin; |
||
| 243 | |||
| 244 | // ports-sound interconnection |
||
| 245 | wire snd_wrtoggle; |
||
| 246 | wire snd_datnvol; |
||
| 247 | wire [2:0] snd_addr; |
||
| 248 | wire [7:0] snd_data; |
||
| 249 | |||
| 6 | lvd | 250 | wire mode_8chans,mode_pan4ch,mode_inv7b; |
| 2 | lvd | 251 | |
| 252 | // ports-SPIs interconnection |
||
| 253 | |||
| 254 | wire [7:0] md_din; |
||
| 255 | wire [7:0] mc_din; |
||
| 256 | wire [7:0] mc_dout; |
||
| 257 | wire [7:0] sd_din; |
||
| 258 | wire [7:0] sd_dout; |
||
| 259 | |||
| 260 | wire mc_start; |
||
| 261 | wire [1:0] mc_speed; |
||
| 262 | wire mc_rdy; |
||
| 263 | |||
| 264 | wire md_start; |
||
| 265 | wire md_halfspeed; |
||
| 266 | |||
| 267 | wire sd_start; |
||
| 268 | |||
| 269 | |||
| 270 | // LED related |
||
| 271 | |||
| 272 | wire led_toggle; |
||
| 273 | |||
| 274 | |||
| 275 | |||
| 276 | |||
| 277 | |||
| 278 | |||
| 279 | // CODE STARTS |
||
| 280 | |||
| 281 | // reset handling |
||
| 282 | |||
| 283 | resetter my_rst( .clk(clk_fpga), |
||
| 284 | .rst_in1_n( warmres_n ), .rst_in2_n( rst_from_zx_n ), |
||
| 285 | .rst_out_n( internal_reset_n ) ); |
||
| 286 | |||
| 287 | always @* // reset for Z80 |
||
| 288 | begin |
||
| 289 | if( internal_reset_n == 1'b0 ) |
||
| 290 | z80res_n <= 1'b0; |
||
| 291 | else |
||
| 292 | z80res_n <= 1'bZ; |
||
| 293 | end |
||
| 294 | |||
| 295 | |||
| 296 | |||
| 297 | |||
| 298 | // control Z80 busses & memory signals |
||
| 299 | |||
| 300 | |||
| 301 | // data bus: |
||
| 302 | |||
| 303 | assign dma_takeover_enabled = (~busak_n) & mem_dma_bus; |
||
| 304 | |||
| 305 | always @* |
||
| 306 | begin |
||
| 307 | if( dma_takeover_enabled ) |
||
| 308 | begin |
||
| 309 | if( mem_dma_rnw ) |
||
| 310 | d <= 8'bZZZZZZZZ; |
||
| 311 | else |
||
| 312 | d <= mem_dma_wd; |
||
| 313 | end |
||
| 314 | else if( (!m1_n) && (!iorq_n) ) |
||
| 315 | begin |
||
| 316 | d <= 8'hFF; |
||
| 317 | end |
||
| 318 | else |
||
| 319 | begin |
||
| 320 | if( ports_busin==1'b1 ) // FPGA inputs on data bus |
||
| 321 | d <= 8'bZZZZZZZZ; |
||
| 322 | else // FPGA outputs |
||
| 323 | d <= ports_dout; |
||
| 324 | end |
||
| 325 | end |
||
| 326 | |||
| 327 | // address bus (both Z80 and memmap module) |
||
| 328 | |||
| 329 | always @* |
||
| 330 | begin |
||
| 331 | a[15:14] <= 2'bZZ; |
||
| 332 | |||
| 333 | if( dma_takeover_enabled ) |
||
| 334 | begin |
||
| 335 | a[13:0] <= mem_dma_addr[13:0]; |
||
| 336 | |||
| 337 | {mema18,mema17,mema16,mema15,mema14} <= mem_dma_addr[18:14]; |
||
| 338 | |||
| 339 | {ram3cs_n,ram2cs_n,ram1cs_n,ram0cs_n} <= ~( 4'b0001<<mem_dma_addr[20:19] ); |
||
| 340 | |||
| 341 | romcs_n <= 1'b1; |
||
| 342 | |||
| 343 | memoe_n <= mem_dma_oe; |
||
| 344 | memwe_n <= mem_dma_we; |
||
| 345 | end |
||
| 346 | else |
||
| 347 | begin |
||
| 348 | a[13:0] <= 14'bZZ_ZZZZ_ZZZZ_ZZZZ; |
||
| 349 | |||
| 350 | {mema18,mema17,mema16,mema15,mema14} <= memmap_a[18:14]; |
||
| 351 | |||
| 352 | ram0cs_n <= memmap_ramcs_n[0]; |
||
| 353 | ram1cs_n <= memmap_ramcs_n[1]; |
||
| 354 | ram2cs_n <= memmap_ramcs_n[2]; |
||
| 355 | ram3cs_n <= memmap_ramcs_n[3]; |
||
| 356 | |||
| 357 | romcs_n <= memmap_romcs_n; |
||
| 358 | |||
| 359 | memoe_n <= memmap_memoe_n; |
||
| 360 | memwe_n <= memmap_memwe_n; |
||
| 361 | end |
||
| 362 | end |
||
| 363 | |||
| 364 | |||
| 365 | |||
| 366 | |||
| 367 | // ZXBUS module |
||
| 368 | |||
| 369 | zxbus my_zxbus( .cpu_clock(clk_fpga), |
||
| 370 | .rst_n(internal_reset_n), |
||
| 371 | .rst_from_zx_n(rst_from_zx_n), |
||
| 372 | |||
| 373 | .nmi_n(nmi_n), |
||
| 374 | |||
| 375 | .zxid(zxid), |
||
| 376 | .zxa(zxa), |
||
| 377 | .zxa14(zxa14), |
||
| 378 | .zxa15(zxa15), |
||
| 379 | .zxiorq_n(zxiorq_n), |
||
| 380 | .zxmreq_n(zxmreq_n), |
||
| 381 | .zxrd_n(zxrd_n), |
||
| 382 | .zxwr_n(zxwr_n), |
||
| 383 | .zxblkiorq_n(zxblkiorq_n), |
||
| 384 | .zxblkrom_n(zxblkrom_n), |
||
| 385 | .zxcsrom_n(zxcsrom_n), |
||
| 386 | .zxgenwait_n(zxgenwait_n), |
||
| 387 | .zxbusin(zxbusin), |
||
| 388 | .zxbusena_n(zxbusena_n), |
||
| 389 | |||
| 390 | .command_reg_out(command_zx2gs), |
||
| 391 | .data_reg_out(data_zx2gs), |
||
| 392 | .data_reg_in(data_gs2zx), |
||
| 393 | .command_bit(command_bit_2gs), |
||
| 394 | .command_bit_in(command_bit_2zx), |
||
| 395 | .command_bit_wr(command_bit_wr), |
||
| 396 | .data_bit(data_bit_2gs), |
||
| 397 | .data_bit_in(data_bit_2zx), |
||
| 398 | .data_bit_wr(data_bit_wr), |
||
| 399 | |||
| 400 | .wait_ena(zx_wait_ena), |
||
| 401 | .dma_on(dma_on_zx), |
||
| 402 | .dmaread(zx_dmaread), |
||
| 403 | .dmawrite(zx_dmawrite), |
||
| 404 | .dma_data_written(dma_zxwr_data), |
||
| 405 | .dma_data_toberead(dma_zxrd_data), |
||
| 406 | |||
| 407 | .led_toggle(led_toggle) ); |
||
| 408 | |||
| 409 | |||
| 410 | |||
| 411 | |||
| 412 | // DMA modules |
||
| 413 | |||
| 414 | dma_access my_dma( .clk(clk_fpga), |
||
| 415 | .rst_n(internal_reset_n), |
||
| 416 | |||
| 417 | .busrq_n(busrq_n), |
||
| 418 | .busak_n(busak_n), |
||
| 419 | |||
| 420 | .mem_dma_addr(mem_dma_addr), |
||
| 421 | .mem_dma_wd(mem_dma_wd), |
||
| 422 | .mem_dma_rd(d), |
||
| 423 | .mem_dma_bus(mem_dma_bus), |
||
| 424 | .mem_dma_rnw(mem_dma_rnw), |
||
| 425 | .mem_dma_oe(mem_dma_oe), |
||
| 426 | .mem_dma_we(mem_dma_we), |
||
| 427 | |||
| 428 | .dma_req(dma_req), |
||
| 429 | .dma_ack(dma_ack), |
||
| 430 | .dma_end(dma_end), |
||
| 431 | .dma_rnw(dma_rnw), |
||
| 432 | .dma_rd(dma_rd), |
||
| 433 | .dma_wd(dma_wd), |
||
| 434 | .dma_addr(dma_addr) ); |
||
| 435 | |||
| 436 | dma_zx zxdma( .clk(clk_fpga), |
||
| 437 | .rst_n(internal_reset_n), |
||
| 438 | |||
| 439 | .module_select(dma_select_zx), |
||
| 440 | .write_strobe(dma_wrstb), |
||
| 441 | .regsel(dma_regsel), |
||
| 442 | |||
| 443 | .din(dma_din_modules), |
||
| 444 | .dout(dma_dout_zx), |
||
| 445 | |||
| 446 | .wait_ena(zx_wait_ena), |
||
| 447 | .dma_on(dma_on_zx), |
||
| 448 | .zxdmaread(zx_dmaread), |
||
| 449 | .zxdmawrite(zx_dmawrite), |
||
| 450 | .dma_wr_data(dma_zxwr_data), |
||
| 451 | .dma_rd_data(dma_zxrd_data), |
||
| 452 | |||
| 453 | .dma_req(dma_req), |
||
| 454 | .dma_ack(dma_ack), |
||
| 455 | .dma_end(dma_end), |
||
| 456 | .dma_rnw(dma_rnw), |
||
| 457 | .dma_rd(dma_rd), |
||
| 458 | .dma_wd(dma_wd), |
||
| 459 | .dma_addr(dma_addr) ); |
||
| 460 | |||
| 461 | |||
| 462 | |||
| 463 | |||
| 464 | // MEMMAP module |
||
| 465 | |||
| 466 | memmap my_memmap( .a14(a[14]), |
||
| 467 | .a15(a[15]), |
||
| 468 | .mreq_n(mreq_n), |
||
| 469 | .rd_n(rd_n), |
||
| 470 | .wr_n(wr_n), |
||
| 471 | .mema14(memmap_a[14]), |
||
| 472 | .mema15(memmap_a[15]), |
||
| 473 | .mema16(memmap_a[16]), |
||
| 474 | .mema17(memmap_a[17]), |
||
| 475 | .mema18(memmap_a[18]), |
||
| 476 | |||
| 477 | .ram0cs_n(memmap_ramcs_n[0]), |
||
| 478 | .ram1cs_n(memmap_ramcs_n[1]), |
||
| 479 | .ram2cs_n(memmap_ramcs_n[2]), |
||
| 480 | .ram3cs_n(memmap_ramcs_n[3]), |
||
| 481 | .romcs_n(memmap_romcs_n), |
||
| 482 | .memoe_n(memmap_memoe_n), |
||
| 483 | .memwe_n(memmap_memwe_n), |
||
| 484 | |||
| 485 | .mode_ramro(mode_ramro), |
||
| 486 | .mode_norom(mode_norom), |
||
| 487 | .mode_pg0(mode_pg0), |
||
| 488 | .mode_pg1(mode_pg1) ); |
||
| 489 | |||
| 490 | |||
| 491 | |||
| 492 | // PORTS module |
||
| 493 | |||
| 494 | ports my_ports( .dout(ports_dout), |
||
| 495 | .din(d), |
||
| 496 | .busin(ports_busin), |
||
| 497 | .a(a), |
||
| 498 | .iorq_n(iorq_n), |
||
| 499 | .mreq_n(mreq_n), |
||
| 500 | .rd_n(rd_n), |
||
| 501 | .wr_n(wr_n), |
||
| 502 | |||
| 503 | .rst_n(internal_reset_n), |
||
| 504 | |||
| 505 | .cpu_clock(clk_fpga), |
||
| 506 | |||
| 507 | .clksel0(clksel0), |
||
| 508 | .clksel1(clksel1), |
||
| 509 | |||
| 510 | .snd_wrtoggle(snd_wrtoggle), |
||
| 511 | .snd_datnvol(snd_datnvol), |
||
| 512 | .snd_addr(snd_addr), |
||
| 513 | .snd_data(snd_data), |
||
| 514 | .mode_8chans(mode_8chans), |
||
| 515 | .mode_pan4ch(mode_pan4ch), |
||
| 6 | lvd | 516 | .mode_inv7b(mode_inv7b), |
| 2 | lvd | 517 | |
| 518 | .command_port_input(command_zx2gs), |
||
| 519 | .command_bit_input(command_bit_2gs), |
||
| 520 | .command_bit_output(command_bit_2zx), |
||
| 521 | .command_bit_wr(command_bit_wr), |
||
| 522 | .data_port_input(data_zx2gs), |
||
| 523 | .data_port_output(data_gs2zx), |
||
| 524 | .data_bit_input(data_bit_2gs), |
||
| 525 | .data_bit_output(data_bit_2zx), |
||
| 526 | .data_bit_wr(data_bit_wr), |
||
| 527 | |||
| 528 | .mode_ramro(mode_ramro), |
||
| 529 | .mode_norom(mode_norom), |
||
| 530 | .mode_pg0(mode_pg0), |
||
| 531 | .mode_pg1(mode_pg1), |
||
| 532 | |||
| 533 | .md_din(md_din), |
||
| 534 | .md_start(md_start), |
||
| 535 | .md_dreq(mp3_req), |
||
| 536 | .md_halfspeed(md_halfspeed), |
||
| 537 | |||
| 538 | .mc_ncs(ma_cs), |
||
| 539 | .mc_xrst(mp3_xreset), |
||
| 540 | .mc_dout(mc_dout), |
||
| 541 | .mc_din(mc_din), |
||
| 542 | .mc_start(mc_start), |
||
| 543 | .mc_speed(mc_speed), |
||
| 544 | .mc_rdy(mc_rdy), |
||
| 545 | |||
| 546 | .sd_ncs(sd_cs), |
||
| 547 | .sd_wp(sd_wp), |
||
| 548 | .sd_det(sd_det), |
||
| 549 | .sd_din(sd_din), |
||
| 550 | .sd_dout(sd_dout), |
||
| 551 | .sd_start(sd_start), |
||
| 552 | |||
| 553 | |||
| 554 | .dma_din_modules(dma_din_modules), |
||
| 555 | .dma_regsel(dma_regsel), |
||
| 556 | .dma_wrstb(dma_wrstb), |
||
| 557 | // |
||
| 558 | .dma_dout_zx(dma_dout_zx), |
||
| 559 | .dma_select_zx(dma_select_zx), |
||
| 560 | |||
| 561 | |||
| 562 | .led(led_diag), |
||
| 563 | .led_toggle(led_toggle) |
||
| 564 | |||
| 565 | ); |
||
| 566 | |||
| 567 | |||
| 568 | |||
| 569 | // SOUND_MAIN module |
||
| 570 | |||
| 571 | sound_main my_sound_main( .clock(clk_24mhz), |
||
| 572 | |||
| 573 | .mode_8chans(mode_8chans), |
||
| 574 | .mode_pan4ch(mode_pan4ch), |
||
| 6 | lvd | 575 | .mode_inv7b(mode_inv7b), |
| 2 | lvd | 576 | |
| 577 | .in_wrtoggle(snd_wrtoggle), |
||
| 578 | .in_datnvol(snd_datnvol), |
||
| 579 | .in_wraddr(snd_addr), |
||
| 580 | .in_data(snd_data), |
||
| 581 | |||
| 582 | .dac_clock(dac_bitck), |
||
| 583 | .dac_leftright(dac_lrck), |
||
| 584 | .dac_data(dac_dat) ); |
||
| 585 | |||
| 586 | |||
| 587 | |||
| 588 | // INTERRUPTS module |
||
| 589 | |||
| 590 | interrupts my_interrupts( .clk_24mhz(clk_24mhz), |
||
| 591 | .clk_z80(clk_fpga), |
||
| 592 | |||
| 593 | .m1_n(m1_n), |
||
| 594 | .iorq_n(iorq_n), |
||
| 595 | |||
| 596 | .int_n(int_n) ); |
||
| 597 | |||
| 598 | |||
| 599 | |||
| 600 | |||
| 601 | |||
| 602 | |||
| 603 | |||
| 604 | // MP3, SDcard spi modules |
||
| 605 | |||
| 606 | |||
| 607 | spi2 spi_mp3_data( .clock(clk_fpga), |
||
| 608 | .sck(mp3_clk), |
||
| 609 | .sdo(mp3_dat), |
||
| 610 | .bsync(mp3_sync), |
||
| 611 | .din(md_din), |
||
| 612 | .start(md_start), |
||
| 613 | .speed( {1'b0,md_halfspeed} ), |
||
| 614 | .sdi(1'b0) ); |
||
| 615 | |||
| 616 | spi2 spi_mp3_control( .clock(clk_fpga), |
||
| 617 | .sck(ma_clk), |
||
| 618 | .sdo(ma_do), |
||
| 619 | .sdi(ma_di), |
||
| 620 | .din(mc_din), |
||
| 621 | .dout(mc_dout), |
||
| 622 | .start(mc_start), |
||
| 623 | .rdy(mc_rdy), |
||
| 624 | .speed(mc_speed) ); |
||
| 625 | |||
| 626 | spi2 spi_sd( .clock(clk_fpga), |
||
| 627 | .sck(sd_clk), |
||
| 628 | .sdo(sd_do), |
||
| 629 | .sdi(sd_di), |
||
| 630 | .din(sd_din), |
||
| 631 | .dout(sd_dout), |
||
| 632 | .start(sd_start), |
||
| 633 | .speed(2'b00) ); |
||
| 634 | |||
| 635 | |||
| 636 | |||
| 637 | |||
| 638 | endmodule |
||
| 639 |