// -------------------------------------------------------------------- // Copyright (c) 2005 by Terasic Technologies Inc. // -------------------------------------------------------------------- // // Permission: // // Terasic grants permission to use and modify this code for use // in synthesis for all Terasic Development Boards and Altera Development // Kits made by Terasic. Other use of this code, including the selling // ,duplication, or modification of any portion is strictly prohibited. // // Disclaimer: // // This VHDL/Verilog or C/C++ source code is intended as a design reference // which illustrates how these types of functions can be implemented. // It is the user's responsibility to verify their design for // consistency and functionality through the use of formal // verification methods. Terasic provides no warranty regarding the use // or functionality of this code. // // -------------------------------------------------------------------- // // Terasic Technologies Inc // 356 Fu-Shin E. Rd Sec. 1. JhuBei City, // HsinChu County, Taiwan // 302 // // web: http://www.terasic.com/ // email: support@terasic.com // // -------------------------------------------------------------------- // // Major Functions: DE2 TOP LEVEL // // -------------------------------------------------------------------- // // Revision History : // -------------------------------------------------------------------- // Ver :| Author :| Mod. Date :| Changes Made: // V1.0 :| Johnny Chen :| 05/08/19 :| Initial Revision // V1.1 :| Johnny Chen :| 05/11/16 :| Add to FLASH Address FL_ADDR[21:20] // V1.2 :| Johnny Chen :| 05/11/16 :| Fixed ISP1362 INT/DREQ Pin Direction. // -------------------------------------------------------------------- module TwoProcessor ( //////////////////// Clock Input //////////////////// CLOCK_27, // 27 MHz CLOCK_50, // 50 MHz EXT_CLOCK, // External Clock //////////////////// Push Button //////////////////// KEY, // Pushbutton[3:0] //////////////////// DPDT Switch //////////////////// SW, // Toggle Switch[17:0] //////////////////////// LED //////////////////////// LEDG, // LED Green[8:0] LEDR, // LED Red[17:0] //////////////////// USB JTAG link //////////////////// TDI, // CPLD -> FPGA (data in) TCK, // CPLD -> FPGA (clk) TCS, // CPLD -> FPGA (CS) TDO, // FPGA -> CPLD (data out) ///////////////////// SDRAM Interface //////////////// DRAM_DQ, // SDRAM Data bus 16 Bits DRAM_ADDR, // SDRAM Address bus 12 Bits DRAM_LDQM, // SDRAM Low-byte Data Mask DRAM_UDQM, // SDRAM High-byte Data Mask DRAM_WE_N, // SDRAM Write Enable DRAM_CAS_N, // SDRAM Column Address Strobe DRAM_RAS_N, // SDRAM Row Address Strobe DRAM_CS_N, // SDRAM Chip Select DRAM_BA_0, // SDRAM Bank Address 0 DRAM_BA_1, // SDRAM Bank Address 0 DRAM_CLK, // SDRAM Clock DRAM_CKE // SDRAM Clock Enable ); //////////////////////// Clock Input //////////////////////// input CLOCK_27; // 27 MHz input CLOCK_50; // 50 MHz input EXT_CLOCK; // External Clock //////////////////////// Push Button //////////////////////// input [3:0] KEY; // Pushbutton[3:0] //////////////////////// DPDT Switch //////////////////////// input [17:0] SW; // Toggle Switch[17:0] //////////////////////////// LED //////////////////////////// output [8:0] LEDG; // LED Green[8:0] output [17:0] LEDR; // LED Red[17:0] //////////////////// USB JTAG link //////////////////////////// input TDI; // CPLD -> FPGA (data in) input TCK; // CPLD -> FPGA (clk) input TCS; // CPLD -> FPGA (CS) output TDO; // FPGA -> CPLD (data out) //// SDRAM ///////////////////////////////////////////////////////// output [11:0] DRAM_ADDR; output DRAM_BA_1, DRAM_BA_0, DRAM_CAS_N, DRAM_RAS_N, DRAM_CLK; output DRAM_CKE, DRAM_CS_N, DRAM_WE_N, DRAM_UDQM, DRAM_LDQM; inout [15:0] DRAM_DQ; //////////////////////////////////////////////////////////////////// //From SOPC builder /* module TwoProc ( //global signals: clk, reset_n, // the_in_0 in_port_to_the_in_0, // the_in_1 in_port_to_the_in_1, // the_out_0 out_port_from_the_out_0, // the_out_1 out_port_from_the_out_1, // the_sdram_0 zs_addr_from_the_sdram_0, zs_ba_from_the_sdram_0, zs_cas_n_from_the_sdram_0, zs_cke_from_the_sdram_0, zs_cs_n_from_the_sdram_0, zs_dq_to_and_from_the_sdram_0, zs_dqm_from_the_sdram_0, zs_ras_n_from_the_sdram_0, zs_we_n_from_the_sdram_0 ) ; */ TwoProc mytwo(CLOCK_50, KEY[0], SW[15:8], SW[7:0], LEDR, LEDG, DRAM_ADDR, {DRAM_BA_1, DRAM_BA_0}, DRAM_CAS_N, DRAM_CKE, DRAM_CS_N, DRAM_DQ, {DRAM_UDQM, DRAM_LDQM}, DRAM_RAS_N, DRAM_WE_N ); // Instantiate the module sdram_pll (inclk0, c0) // to shift sdram clock -3 ns as suggested in // tut_DE2_sdram_verilog.pdf sdram_pll neg_3ns (CLOCK_50, DRAM_CLK); endmodule