FPGC6.v 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  1. /*
  2. * Top level design of the FPGC6
  3. */
  4. module FPGC6(
  5. input clk, //50MHz
  6. input clk_SDRAM, //100MHz
  7. input nreset,
  8. //HDMI
  9. output wire [3:0] TMDS_p,
  10. output wire [3:0] TMDS_n,
  11. //SDRAM
  12. output SDRAM_CLK,
  13. output SDRAM_CSn,
  14. output SDRAM_WEn,
  15. output SDRAM_CASn,
  16. output SDRAM_RASn,
  17. output SDRAM_CKE,
  18. output [12:0] SDRAM_A,
  19. output [1:0] SDRAM_BA,
  20. output [3:0] SDRAM_DQM,
  21. inout [31:0] SDRAM_DQ,
  22. //SPI0 flash
  23. output SPI0_clk,
  24. output SPI0_cs,
  25. inout SPI0_data,
  26. inout SPI0_q,
  27. inout SPI0_wp,
  28. inout SPI0_hold,
  29. //SPI1 CH376 bottom
  30. output SPI1_clk,
  31. output SPI1_cs,
  32. output SPI1_mosi,
  33. input SPI1_miso,
  34. input SPI1_nint,
  35. output SPI1_rst,
  36. //SPI2 CH376 top
  37. output SPI2_clk,
  38. output SPI2_cs,
  39. output SPI2_mosi,
  40. input SPI2_miso,
  41. input SPI2_nint,
  42. output SPI2_rst,
  43. //SPI3 W5500
  44. output SPI3_clk,
  45. output SPI3_cs,
  46. output SPI3_mosi,
  47. input SPI3_miso,
  48. input SPI3_int,
  49. output SPI3_nrst,
  50. //SPI4 GP
  51. output SPI4_clk,
  52. output SPI4_cs,
  53. output SPI4_mosi,
  54. input SPI4_miso,
  55. input SPI4_gp,
  56. //UART0
  57. input UART0_in,
  58. output UART0_out,
  59. input UART0_dtr,
  60. //UART1 (currently unused because no UART midi synth anymore)
  61. //input UART1_in,
  62. //output UART1_out,
  63. //UART2
  64. input UART2_in,
  65. output UART2_out,
  66. //PS/2
  67. input PS2_clk, PS2_data,
  68. //Led for debugging
  69. output led,
  70. //GPIO
  71. input [3:0] GPI,
  72. output [3:0] GPO,
  73. //DIP switch
  74. input [3:0] DIPS,
  75. //I2S audio
  76. output I2S_SDIN, I2S_SCLK, I2S_LRCLK, I2S_MCLK,
  77. //Status leds
  78. output led_Booted, led_Eth, led_Flash, led_USB0, led_USB1, led_PS2, led_HDMI, led_QSPI, led_GPU, led_I2S
  79. );
  80. // TMP FIXES FOR NEW PCB
  81. assign I2S_SDIN = 1'b0;
  82. assign I2S_SCLK = 1'b0;
  83. assign I2S_LRCLK = 1'b0;
  84. assign I2S_MCLK = 1'b0;
  85. //-------------------CLK-------------------------
  86. //In hardware a PLL should be used here
  87. // to create the clk and crt_clk
  88. //assign crt_clk = clk; //'fix' for simulation
  89. //Run VGA at CRT speed
  90. //assign vga_clk = crt_clk;
  91. wire clkTMDShalf; // TMDS clock (pre-DDR), 5x pixel clock
  92. wire clkPixel; // Pixel clock
  93. wire clk14; // NTSC clock
  94. wire clk114; // NTSC color clock
  95. wire clkMuxOut; // HDMI or NTSC clock, depending on selectOutput
  96. // everything at clk speed for simulation
  97. assign clkTMDShalf = clk;
  98. assign clkPixel = clk;
  99. assign clk14 = clk;
  100. assign clk114 = clk;
  101. assign clkMuxOut = clk;
  102. //Run SDRAM at 100MHz
  103. assign SDRAM_CLK = clk_SDRAM;
  104. //--------------------Reset&Stabilizers-----------------------
  105. //Reset signals
  106. wire nreset_stable, UART0_dtr_stable, reset;
  107. //Dip switch
  108. wire boot_mode_stable;
  109. //GPU: High when frame just rendered (needs to be stabilized)
  110. wire frameDrawn, frameDrawn_stable;
  111. //Stabilized SPI interrupt signals
  112. wire SPI1_nint_stable, SPI2_nint_stable, SPI3_int_stable, SPI4_gp_stable;
  113. MultiStabilizer multistabilizer (
  114. .clk(clk),
  115. .u0(nreset),
  116. .s0(nreset_stable),
  117. .u1(UART0_dtr),
  118. .s1(UART0_dtr_stable),
  119. .u2(SPI1_nint),
  120. .s2(SPI1_nint_stable),
  121. .u3(SPI2_nint),
  122. .s3(SPI2_nint_stable),
  123. .u4(SPI3_int),
  124. .s4(SPI3_int_stable),
  125. .u5(SPI4_gp),
  126. .s5(SPI4_gp_stable),
  127. .u6(frameDrawn),
  128. .s6(frameDrawn_stable),
  129. .u7(DIPS[0]),
  130. .s7(boot_mode_stable)
  131. );
  132. //Indicator for opened Serial port
  133. assign led = UART0_dtr_stable;
  134. //DRT to reset pulse
  135. wire dtrRst;
  136. DtrReset dtrReset (
  137. .clk(clk),
  138. .dtr(UART0_dtr_stable),
  139. .dtrRst(dtrRst)
  140. );
  141. assign reset = (~nreset_stable) || dtrRst;
  142. //External reset outputs
  143. assign SPI1_rst = reset;
  144. assign SPI2_rst = reset;
  145. assign SPI3_nrst = ~reset;
  146. //---------------------------VRAM32---------------------------------
  147. //VRAM32 I/O
  148. wire vram32_gpu_clk;
  149. wire [13:0] vram32_gpu_addr;
  150. wire [31:0] vram32_gpu_d;
  151. wire vram32_gpu_we;
  152. wire [31:0] vram32_gpu_q;
  153. wire vram32_cpu_clk;
  154. wire [13:0] vram32_cpu_addr;
  155. wire [31:0] vram32_cpu_d;
  156. wire vram32_cpu_we;
  157. wire [31:0] vram32_cpu_q;
  158. //because FSX will not write to VRAM
  159. assign vram32_gpu_we = 1'b0;
  160. assign vram32_gpu_d = 32'd0;
  161. VRAM #(
  162. .WIDTH(32),
  163. .WORDS(1056),
  164. .ADDR_BITS(14),
  165. .LIST("/home/bart/Documents/FPGA/FPGC6/Verilog/memory/vram32.list")
  166. ) vram32(
  167. //CPU port
  168. .cpu_clk (clk),
  169. .cpu_d (vram32_cpu_d),
  170. .cpu_addr (vram32_cpu_addr),
  171. .cpu_we (vram32_cpu_we),
  172. .cpu_q (vram32_cpu_q),
  173. //GPU port
  174. .gpu_clk (clkMuxOut),
  175. .gpu_d (vram32_gpu_d),
  176. .gpu_addr (vram32_gpu_addr),
  177. .gpu_we (vram32_gpu_we),
  178. .gpu_q (vram32_gpu_q)
  179. );
  180. //---------------------------VRAM322--------------------------------
  181. //VRAM322 I/O
  182. wire vram322_gpu_clk;
  183. wire [13:0] vram322_gpu_addr;
  184. wire [31:0] vram322_gpu_d;
  185. wire vram322_gpu_we;
  186. wire [31:0] vram322_gpu_q;
  187. //because FSX will not write to VRAM
  188. assign vram322_gpu_we = 1'b0;
  189. assign vram322_gpu_d = 32'd0;
  190. VRAM #(
  191. .WIDTH(32),
  192. .WORDS(1056),
  193. .ADDR_BITS(14),
  194. .LIST("/home/bart/Documents/FPGA/FPGC6/Verilog/memory/vram32.list")
  195. ) vram322(
  196. //CPU port
  197. .cpu_clk (clk),
  198. .cpu_d (vram32_cpu_d),
  199. .cpu_addr (vram32_cpu_addr),
  200. .cpu_we (vram32_cpu_we),
  201. .cpu_q (),
  202. //GPU port
  203. .gpu_clk (clkMuxOut),
  204. .gpu_d (vram322_gpu_d),
  205. .gpu_addr (vram322_gpu_addr),
  206. .gpu_we (vram322_gpu_we),
  207. .gpu_q (vram322_gpu_q)
  208. );
  209. //--------------------------VRAM8--------------------------------
  210. //VRAM8 I/O
  211. wire vram8_gpu_clk;
  212. wire [13:0] vram8_gpu_addr;
  213. wire [7:0] vram8_gpu_d;
  214. wire vram8_gpu_we;
  215. wire [7:0] vram8_gpu_q;
  216. wire vram8_cpu_clk;
  217. wire [13:0] vram8_cpu_addr;
  218. wire [7:0] vram8_cpu_d;
  219. wire vram8_cpu_we;
  220. wire [7:0] vram8_cpu_q;
  221. //because FSX will not write to VRAM
  222. assign vram8_gpu_we = 1'b0;
  223. assign vram8_gpu_d = 8'd0;
  224. VRAM #(
  225. .WIDTH(8),
  226. .WORDS(8194),
  227. .ADDR_BITS(14),
  228. .LIST("/home/bart/Documents/FPGA/FPGC6/Verilog/memory/vram8.list")
  229. ) vram8(
  230. //CPU port
  231. .cpu_clk (clk),
  232. .cpu_d (vram8_cpu_d),
  233. .cpu_addr (vram8_cpu_addr),
  234. .cpu_we (vram8_cpu_we),
  235. .cpu_q (vram8_cpu_q),
  236. //GPU port
  237. .gpu_clk (clkMuxOut),
  238. .gpu_d (vram8_gpu_d),
  239. .gpu_addr (vram8_gpu_addr),
  240. .gpu_we (vram8_gpu_we),
  241. .gpu_q (vram8_gpu_q)
  242. );
  243. //--------------------------VRAMSPR--------------------------------
  244. //VRAMSPR I/O
  245. wire vramSPR_gpu_clk;
  246. wire [13:0] vramSPR_gpu_addr;
  247. wire [8:0] vramSPR_gpu_d;
  248. wire vramSPR_gpu_we;
  249. wire [8:0] vramSPR_gpu_q;
  250. wire vramSPR_cpu_clk;
  251. wire [13:0] vramSPR_cpu_addr;
  252. wire [8:0] vramSPR_cpu_d;
  253. wire vramSPR_cpu_we;
  254. wire [8:0] vramSPR_cpu_q;
  255. //because FSX will not write to VRAM
  256. assign vramSPR_gpu_we = 1'b0;
  257. assign vramSPR_gpu_d = 9'd0;
  258. VRAM #(
  259. .WIDTH(9),
  260. .WORDS(256),
  261. .ADDR_BITS(14),
  262. .LIST("/home/bart/Documents/FPGA/FPGC6/Verilog/memory/vramSPR.list")
  263. ) vramSPR(
  264. //CPU port
  265. .cpu_clk (clk),
  266. .cpu_d (vramSPR_cpu_d),
  267. .cpu_addr (vramSPR_cpu_addr),
  268. .cpu_we (vramSPR_cpu_we),
  269. .cpu_q (vramSPR_cpu_q),
  270. //GPU port
  271. .gpu_clk (clkMuxOut),
  272. .gpu_d (vramSPR_gpu_d),
  273. .gpu_addr (vramSPR_gpu_addr),
  274. .gpu_we (vramSPR_gpu_we),
  275. .gpu_q (vramSPR_gpu_q)
  276. );
  277. //--------------------------VRAMPX--------------------------------
  278. //VRAMPX I/O
  279. wire vramPX_gpu_clk;
  280. wire [16:0] vramPX_gpu_addr;
  281. wire [7:0] vramPX_gpu_d;
  282. wire vramPX_gpu_we;
  283. wire [7:0] vramPX_gpu_q;
  284. wire vramPX_cpu_clk;
  285. wire [16:0] vramPX_cpu_addr;
  286. wire [7:0] vramPX_cpu_d;
  287. wire vramPX_cpu_we;
  288. wire [7:0] vramPX_cpu_q;
  289. // FSX will not write to VRAM
  290. assign vramPX_gpu_we = 1'b0;
  291. assign vramPX_gpu_d = 8'd0;
  292. VRAM #(
  293. .WIDTH(8),
  294. .WORDS(76800),
  295. .ADDR_BITS(17),
  296. .LIST("memory/vramPX.list")
  297. ) vramPX(
  298. // CPU port
  299. .cpu_clk (clk),
  300. .cpu_d (vramPX_cpu_d),
  301. .cpu_addr (vramPX_cpu_addr),
  302. .cpu_we (vramPX_cpu_we),
  303. .cpu_q (vramPX_cpu_q),
  304. // GPU port
  305. .gpu_clk (clkMuxOut),
  306. .gpu_d (vramPX_gpu_d),
  307. .gpu_addr (vramPX_gpu_addr),
  308. .gpu_we (vramPX_gpu_we),
  309. .gpu_q (vramPX_gpu_q)
  310. );
  311. //-------------------ROM-------------------------
  312. //ROM I/O
  313. wire [8:0] rom_addr;
  314. wire [31:0] rom_q;
  315. ROM rom(
  316. .clk (clk),
  317. .reset (reset),
  318. .address (rom_addr),
  319. .q (rom_q)
  320. );
  321. //----------------SDRAM Controller------------------
  322. // inputs
  323. wire [23:0] sdc_addr; // address to write or to start reading from
  324. wire [31:0] sdc_data; // data to write
  325. wire sdc_we; // write enable
  326. wire sdc_start; // start trigger
  327. // outputs
  328. wire [31:0] sdc_q; // memory output
  329. wire sdc_done; // output ready
  330. SDRAMcontroller sdramcontroller(
  331. // clock/reset inputs
  332. .clk (clk_SDRAM),
  333. .reset (reset),
  334. // interface inputs
  335. .sdc_addr (sdc_addr),
  336. .sdc_data (sdc_data),
  337. .sdc_we (sdc_we),
  338. .sdc_start (sdc_start),
  339. // interface outputs
  340. .sdc_q (sdc_q),
  341. .sdc_done (sdc_done),
  342. // SDRAM signals
  343. .SDRAM_CKE (SDRAM_CKE),
  344. .SDRAM_CSn (SDRAM_CSn),
  345. .SDRAM_WEn (SDRAM_WEn),
  346. .SDRAM_CASn (SDRAM_CASn),
  347. .SDRAM_RASn (SDRAM_RASn),
  348. .SDRAM_A (SDRAM_A),
  349. .SDRAM_BA (SDRAM_BA),
  350. .SDRAM_DQM (SDRAM_DQM),
  351. .SDRAM_DQ (SDRAM_DQ)
  352. );
  353. //-----------------------FSX-------------------------
  354. //FSX I/O
  355. wire [7:0] composite; // NTSC composite video signal
  356. reg selectOutput = 1'b1; // 1 -> HDMI, 0 -> Composite
  357. FSX fsx(
  358. //Clocks
  359. .clkPixel (clkPixel),
  360. .clkTMDShalf (clkTMDShalf),
  361. //.clk14 (clk14),
  362. //.clk114 (clk114),
  363. .clkMuxOut (clkMuxOut),
  364. //HDMI
  365. .TMDS_p (TMDS_p),
  366. .TMDS_n (TMDS_n),
  367. //NTSC composite
  368. //.composite (composite),
  369. //Select output method
  370. //.selectOutput (selectOutput),
  371. //VRAM32
  372. .vram32_addr (vram32_gpu_addr),
  373. .vram32_q (vram32_gpu_q),
  374. //VRAM32
  375. .vram322_addr (vram322_gpu_addr),
  376. .vram322_q (vram322_gpu_q),
  377. //VRAM8
  378. .vram8_addr (vram8_gpu_addr),
  379. .vram8_q (vram8_gpu_q),
  380. //VRAMSPR
  381. .vramSPR_addr (vramSPR_gpu_addr),
  382. .vramSPR_q (vramSPR_gpu_q),
  383. //VRAMPX
  384. .vramPX_addr (vramPX_gpu_addr),
  385. .vramPX_q (vramPX_gpu_q),
  386. //Interrupt signal
  387. .frameDrawn (frameDrawn)
  388. );
  389. //----------------Memory Unit--------------------
  390. //Memory Unit I/O
  391. //Bus
  392. wire [26:0] bus_addr;
  393. wire [31:0] bus_data;
  394. wire bus_we;
  395. wire bus_start;
  396. wire [31:0] bus_q;
  397. wire bus_done;
  398. //Interrupt signals
  399. wire OST1_int, OST2_int, OST3_int;
  400. wire UART0_rx_int, UART2_rx_int;
  401. wire PS2_int;
  402. wire SPI0_QSPI;
  403. MemoryUnit mu(
  404. //clock
  405. .clk (clk),
  406. .reset (reset),
  407. //CPU connection (Bus)
  408. .bus_addr (bus_addr),
  409. .bus_data (bus_data),
  410. .bus_we (bus_we),
  411. .bus_start (bus_start),
  412. .bus_q (bus_q),
  413. .bus_done (bus_done),
  414. /********
  415. * MEMORY
  416. ********/
  417. //SPI Flash / SPI0
  418. .SPIflash_data (SPI0_data),
  419. .SPIflash_q (SPI0_q),
  420. .SPIflash_wp (SPI0_wp),
  421. .SPIflash_hold (SPI0_hold),
  422. .SPIflash_cs (SPI0_cs),
  423. .SPIflash_clk (SPI0_clk),
  424. //VRAM32 cpu port
  425. .VRAM32_cpu_d (vram32_cpu_d),
  426. .VRAM32_cpu_addr (vram32_cpu_addr),
  427. .VRAM32_cpu_we (vram32_cpu_we),
  428. .VRAM32_cpu_q (vram32_cpu_q),
  429. //VRAM8 cpu port
  430. .VRAM8_cpu_d (vram8_cpu_d),
  431. .VRAM8_cpu_addr (vram8_cpu_addr),
  432. .VRAM8_cpu_we (vram8_cpu_we),
  433. .VRAM8_cpu_q (vram8_cpu_q),
  434. //VRAMspr cpu port
  435. .VRAMspr_cpu_d (vramSPR_cpu_d),
  436. .VRAMspr_cpu_addr (vramSPR_cpu_addr),
  437. .VRAMspr_cpu_we (vramSPR_cpu_we),
  438. .VRAMspr_cpu_q (vramSPR_cpu_q),
  439. // VRAMpx cpu port
  440. .VRAMpx_cpu_d (vramPX_cpu_d),
  441. .VRAMpx_cpu_addr (vramPX_cpu_addr),
  442. .VRAMpx_cpu_we (vramPX_cpu_we),
  443. .VRAMpx_cpu_q (vramPX_cpu_q),
  444. //ROM
  445. .ROM_addr (rom_addr),
  446. .ROM_q (rom_q),
  447. /********
  448. * I/O
  449. ********/
  450. //UART0 (Main USB)
  451. .UART0_in (UART0_in),
  452. .UART0_out (UART0_out),
  453. .UART0_rx_interrupt (UART0_rx_int),
  454. //UART1 (APU)
  455. /*.UART1_in (),
  456. .UART1_out (),
  457. .UART1_rx_interrupt (),
  458. */
  459. //UART2 (GP)
  460. .UART2_in (UART2_in),
  461. .UART2_out (UART2_out),
  462. .UART2_rx_interrupt (UART2_rx_int),
  463. //SPI0 (Flash)
  464. //declared under MEMORY
  465. .SPI0_QSPI (SPI0_QSPI),
  466. //SPI1 (USB0/CH376T)
  467. .SPI1_clk (SPI1_clk),
  468. .SPI1_cs (SPI1_cs),
  469. .SPI1_mosi (SPI1_mosi),
  470. .SPI1_miso (SPI1_miso),
  471. .SPI1_nint (SPI1_nint_stable),
  472. //SPI2 (USB1/CH376T)
  473. .SPI2_clk (SPI2_clk),
  474. .SPI2_cs (SPI2_cs),
  475. .SPI2_mosi (SPI2_mosi),
  476. .SPI2_miso (SPI2_miso),
  477. .SPI2_nint (SPI2_nint_stable),
  478. //SPI3 (W5500)
  479. .SPI3_clk (SPI3_clk),
  480. .SPI3_cs (SPI3_cs),
  481. .SPI3_mosi (SPI3_mosi),
  482. .SPI3_miso (SPI3_miso),
  483. .SPI3_int (SPI3_int_stable),
  484. //SPI4 (EXT/GP)
  485. .SPI4_clk (SPI4_clk),
  486. .SPI4_cs (SPI4_cs),
  487. .SPI4_mosi (SPI4_mosi),
  488. .SPI4_miso (SPI4_miso),
  489. .SPI4_GP (SPI4_gp_stable),
  490. //GPIO (Separated GPI and GPO until GPIO module is implemented)
  491. .GPI (GPI[3:0]),
  492. .GPO (GPO[3:0]),
  493. //OStimers
  494. .OST1_int (OST1_int),
  495. .OST2_int (OST2_int),
  496. .OST3_int (OST3_int),
  497. //SNESpad
  498. /*
  499. .SNES_clk (),
  500. .SNES_latch (),
  501. .SNES_data (),
  502. */
  503. //PS/2
  504. .PS2_clk (PS2_clk),
  505. .PS2_data (PS2_data),
  506. .PS2_int (PS2_int), //Scan code ready signal
  507. //Boot mode
  508. .boot_mode (boot_mode_stable)
  509. );
  510. //------------L2 Cache--------------
  511. //CPU bus
  512. wire [23:0] l2_addr; // address to write or to start reading from
  513. wire [31:0] l2_data; // data to write
  514. wire l2_we; // write enable
  515. wire l2_start; // start trigger
  516. wire [31:0] l2_q; // memory output
  517. wire l2_done; // output ready
  518. L2cache l2cache(
  519. .clk (clk_SDRAM),
  520. .reset (reset),
  521. // CPU bus
  522. .l2_addr (l2_addr),
  523. .l2_data (l2_data),
  524. .l2_we (l2_we),
  525. .l2_start (l2_start),
  526. .l2_q (l2_q),
  527. .l2_done (l2_done),
  528. // sdram bus
  529. .sdc_addr (sdc_addr),
  530. .sdc_data (sdc_data),
  531. .sdc_we (sdc_we),
  532. .sdc_start (sdc_start),
  533. .sdc_q (sdc_q),
  534. .sdc_done (sdc_done)
  535. );
  536. //---------------CPU----------------
  537. //CPU I/O
  538. wire [26:0] PC;
  539. CPU cpu(
  540. .clk (clk),
  541. .reset (reset),
  542. // bus
  543. .bus_addr (bus_addr),
  544. .bus_data (bus_data),
  545. .bus_we (bus_we),
  546. .bus_start (bus_start),
  547. .bus_q (bus_q),
  548. .bus_done (bus_done),
  549. // sdram bus
  550. .sdc_addr (l2_addr),
  551. .sdc_data (l2_data),
  552. .sdc_we (l2_we),
  553. .sdc_start (l2_start),
  554. .sdc_q (l2_q),
  555. .sdc_done (l2_done),
  556. .int1 (OST1_int), //OStimer1
  557. .int2 (OST2_int), //OStimer2
  558. .int3 (UART0_rx_int), //UART0 rx (MAIN)
  559. .int4 (frameDrawn_stable), //GPU Frame Drawn
  560. .int5 (OST3_int), //OStimer3
  561. .int6 (PS2_int), //PS/2 scancode ready
  562. .int7 (1'b0), //UART1 rx (APU)
  563. .int8 (UART2_rx_int), //UART2 rx (EXT)
  564. .PC (PC)
  565. );
  566. //-----------STATUS LEDS-----------
  567. assign led_Booted = (PC >= 27'hC02522 | reset);
  568. assign led_HDMI = (~selectOutput | reset);
  569. assign led_QSPI = (~SPI0_QSPI | reset);
  570. LEDvisualizer #(.MIN_CLK(100000))
  571. LEDvisUSB0
  572. (
  573. .clk(clk),
  574. .reset(reset),
  575. .activity(~SPI1_cs),
  576. .LED(led_USB0)
  577. );
  578. LEDvisualizer #(.MIN_CLK(100000))
  579. LEDvisUSB1
  580. (
  581. .clk(clk),
  582. .reset(reset),
  583. .activity(~SPI2_cs),
  584. .LED(led_USB1)
  585. );
  586. LEDvisualizer #(.MIN_CLK(100000))
  587. LEDvisEth
  588. (
  589. .clk(clk),
  590. .reset(reset),
  591. .activity(~SPI3_cs),
  592. .LED(led_Eth)
  593. );
  594. LEDvisualizer #(.MIN_CLK(100000))
  595. LEDvisPS2
  596. (
  597. .clk(clk),
  598. .reset(reset),
  599. .activity(PS2_int),
  600. .LED(led_PS2)
  601. );
  602. LEDvisualizer #(.MIN_CLK(100000))
  603. LEDvisFlash
  604. (
  605. .clk(clk),
  606. .reset(reset),
  607. .activity(~SPI0_cs),
  608. .LED(led_Flash)
  609. );
  610. LEDvisualizer #(.MIN_CLK(100000))
  611. LEDvisGPU
  612. (
  613. .clk(clk),
  614. .reset(reset),
  615. .activity(vram32_cpu_we|vram8_cpu_we|vramSPR_cpu_we|vramPX_cpu_we),
  616. .LED(led_GPU)
  617. );
  618. LEDvisualizer #(.MIN_CLK(100000))
  619. LEDvisI2S
  620. (
  621. .clk(clk),
  622. .reset(reset),
  623. .activity(I2S_SDIN),
  624. .LED(led_I2S)
  625. );
  626. endmodule