From d5553117c38966e51b52b7fb26ee433db5d664c9 Mon Sep 17 00:00:00 2001 From: James Date: Sat, 12 Oct 2013 11:31:04 +0100 Subject: Main_makefile --- Makefile | 88 ++++++++++++++++++++ pong3.pin | 274 ------------------------------------------------------------- tools/wrap | 11 +++ 3 files changed, 99 insertions(+), 274 deletions(-) create mode 100644 Makefile delete mode 100644 pong3.pin create mode 100755 tools/wrap diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..980969e --- /dev/null +++ b/Makefile @@ -0,0 +1,88 @@ +PROJ=pong3 + +SRCS=$(wildcard *.vhd *.v *.qsf *.qpf ) +SRCS += $(shell find DM9000A -type f -print ) +SRCS += $(shell find GPU -type f -print ) + +#CSRC=${SRC:src/%=%} +#CSDIRS=${SDIRS:src/%=%} + +#ELFDIR=../software/pong3 +BSPDIR=../software/pong3_bsp + + +sta.stamp:asm.stamp + tools/wrap quartus_sta pong3 -c pong3 + touch $@ + +asm.stamp:fit.stamp + tools/wrap quartus_asm --read_settings_files=off --write_settings_files=off pong3 -c pong3 + touch $@ + +fit.stamp: ans.stamp + tools/wrap quartus_fit --read_settings_files=off --write_settings_files=off pong3 -c pong3 + touch $@ + +ans.stamp: source.stamp + tools/wrap quartus_map --read_settings_files=on --write_settings_files=off ${PROJ} -c ${PROJ} + touch $@ + +source.stamp:${SRC} + touch source.stamp + + +ELF=pong3.elf + +SOPCINFO=../my_sys.sopcinfo +SOF=../pong3.sof + +run: load_elf.stamp + ./wrap.sh nios2-terminal + +flash: load_sof.stamp sof.flash elf.flash ${BSPDIR}/system.h + BASE=` grep EPCS_FLASH_CONTROLLER_0_BASE ${BSPDIR}/system.h | awk '{print $$3}' ` && \ + ./wrap.sh nios2-flash-programmer sof.flash --base=$${BASE} --epcs --accept-bad-sysid --device=1 --instance=0 --program --verbose && \ + ./wrap.sh nios2-flash-programmer elf.flash --base=$${BASE} --epcs --accept-bad-sysid --device=1 --instance=0 --program --verbose -g + +sof.flash: ${SOF} + ./wrap.sh sof2flash --input=$< --output=$@ --epcs --verbose + +elf.flash: ${ELFDIR}/${ELF} sof.flash + ./wrap.sh elf2flash --input=${ELFDIR}/${ELF} --output=$@ --epcs --after=sof.flash --verbose + + + + + + + +load_elf.stamp:${ELFDIR}/${ELF} load_sof.stamp + ./wrap.sh nios2-download ${ELFDIR}/${ELF} -g + +load_sof.stamp: ${SOF} + ./wrap.sh quartus_pgm -m JTAG -o 'p;../pong3.sof' + +${ELFDIR}/${ELF}: ${BSPDIR}/libhal_bsp.a $(wildcard ${ELFDIR}/*.[chHC]) + ./wrap.sh ${MAKE} -C ${ELFDIR} + + +${BSPDIR}/libhal_bsp.a:${BSPDIR}/system.h + ./wrap.sh ${MAKE} -C ${BSPDIR} + +${BSPDIR}/system.h:${SOPCINFO} + rm -f $@ + (cd ${BSPDIR} && ${PWD}/wrap.sh ./create-this-bsp ) + + +clean: + ./wrap.sh ${MAKE} -C ${BSPDIR} clean + ./wrap.sh ${MAKE} -C ${ELFDIR} clean + /bin/rm -f sof.flash elf.flash + /bin/rm -rf ${BSPDIR}/drivers ${BSPDIR}/HAL ${BSPDIR}/linker.h ${BSPDIR}/linker.x ${BSPDIR}/system.h ${BSPDIR}/summary.html ${BSPDIR}/public.mk ${BSPDIR}/mem_init.mk ${BSPDIR}/memory.gdb ${BSPDIR}/alt_sys_init.c + + + + + + + diff --git a/pong3.pin b/pong3.pin deleted file mode 100644 index cc630e7..0000000 --- a/pong3.pin +++ /dev/null @@ -1,274 +0,0 @@ - -- Copyright (C) 1991-2013 Altera Corporation - -- Your use of Altera Corporation's design tools, logic functions - -- and other software and tools, and its AMPP partner logic - -- functions, and any output files from any of the foregoing - -- (including device programming or simulation files), and any - -- associated documentation or information are expressly subject - -- to the terms and conditions of the Altera Program License - -- Subscription Agreement, Altera MegaCore Function License - -- Agreement, or other applicable license agreement, including, - -- without limitation, that your use is for the sole purpose of - -- programming logic devices manufactured by Altera and sold by - -- Altera or its authorized distributors. Please refer to the - -- applicable agreement for further details. - -- - -- This is a Quartus II output file. It is for reporting purposes only, and is - -- not intended for use as a Quartus II input file. This file cannot be used - -- to make Quartus II pin assignments - for instructions on how to make pin - -- assignments, please see Quartus II help. - --------------------------------------------------------------------------------- - - - - --------------------------------------------------------------------------------- - -- NC : No Connect. This pin has no internal connection to the device. - -- DNU : Do Not Use. This pin MUST NOT be connected. - -- VCCINT : Dedicated power pin, which MUST be connected to VCC (1.2V). - -- VCCIO : Dedicated power pin, which MUST be connected to VCC - -- of its bank. - -- Bank 1: 3.3V - -- Bank 2: 3.3V - -- Bank 3: 3.3V - -- Bank 4: 3.3V - -- GND : Dedicated ground pin. Dedicated GND pins MUST be connected to GND. - -- It can also be used to report unused dedicated pins. The connection - -- on the board for unused dedicated pins depends on whether this will - -- be used in a future design. One example is device migration. When - -- using device migration, refer to the device pin-tables. If it is a - -- GND pin in the pin table or if it will not be used in a future design - -- for another purpose the it MUST be connected to GND. If it is an unused - -- dedicated pin, then it can be connected to a valid signal on the board - -- (low, high, or toggling) if that signal is required for a different - -- revision of the design. - -- GND+ : Unused input pin. It can also be used to report unused dual-purpose pins. - -- This pin should be connected to GND. It may also be connected to a - -- valid signal on the board (low, high, or toggling) if that signal - -- is required for a different revision of the design. - -- GND* : Unused I/O pin. Connect each pin marked GND* directly to GND - -- or leave it unconnected. - -- RESERVED : Unused I/O pin, which MUST be left unconnected. - -- RESERVED_INPUT : Pin is tri-stated and should be connected to the board. - -- RESERVED_INPUT_WITH_WEAK_PULLUP : Pin is tri-stated with internal weak pull-up resistor. - -- RESERVED_INPUT_WITH_BUS_HOLD : Pin is tri-stated with bus-hold circuitry. - -- RESERVED_OUTPUT_DRIVEN_HIGH : Pin is output driven high. - --------------------------------------------------------------------------------- - - - - --------------------------------------------------------------------------------- - -- Pin directions (input, output or bidir) are based on device operating in user mode. - --------------------------------------------------------------------------------- - -Quartus II 32-bit Version 13.0.1 Build 232 06/12/2013 Service Pack 1 SJ Web Edition -CHIP "pong3" ASSIGNED TO AN: EP2C8Q208C8 - -Pin Name/Usage : Location : Dir. : I/O Standard : Voltage : I/O Bank : User Assignment -------------------------------------------------------------------------------------------------------------- -~ASDO~ / RESERVED_INPUT : 1 : input : 3.3-V LVTTL : : 1 : N -~nCSO~ / RESERVED_INPUT : 2 : input : 3.3-V LVTTL : : 1 : N -GND* : 3 : : : : 1 : -GND* : 4 : : : : 1 : -GND* : 5 : : : : 1 : -GND* : 6 : : : : 1 : -VCCIO1 : 7 : power : : 3.3V : 1 : -GND* : 8 : : : : 1 : -GND : 9 : gnd : : : : -GND* : 10 : : : : 1 : -GND* : 11 : : : : 1 : -GND* : 12 : : : : 1 : -GND* : 13 : : : : 1 : -GND* : 14 : : : : 1 : -GND* : 15 : : : : 1 : -altera_reserved_tdo : 16 : output : 3.3-V LVTTL : : 1 : N -altera_reserved_tms : 17 : input : 3.3-V LVTTL : : 1 : N -altera_reserved_tck : 18 : input : 3.3-V LVTTL : : 1 : N -altera_reserved_tdi : 19 : input : 3.3-V LVTTL : : 1 : N -DATA0 : 20 : input : : : 1 : -DCLK : 21 : : : : 1 : -nCE : 22 : : : : 1 : -clk : 23 : input : 3.3-V LVTTL : : 1 : Y -GND+ : 24 : : : : 1 : -GND : 25 : gnd : : : : -nCONFIG : 26 : : : : 1 : -rst_n : 27 : input : 3.3-V LVTTL : : 1 : Y -GND+ : 28 : : : : 1 : -VCCIO1 : 29 : power : : 3.3V : 1 : -GND* : 30 : : : : 1 : -GND* : 31 : : : : 1 : -VCCINT : 32 : power : : 1.2V : : -GND* : 33 : : : : 1 : -seven_seg[0] : 34 : output : 3.3-V LVTTL : : 1 : Y -seven_seg[1] : 35 : output : 3.3-V LVTTL : : 1 : Y -GND : 36 : gnd : : : : -seven_seg[5] : 37 : output : 3.3-V LVTTL : : 1 : Y -GND : 38 : gnd : : : : -seven_seg[2] : 39 : output : 3.3-V LVTTL : : 1 : Y -seven_seg[6] : 40 : output : 3.3-V LVTTL : : 1 : Y -seven_seg[7] : 41 : output : 3.3-V LVTTL : : 1 : Y -VCCIO1 : 42 : power : : 3.3V : 1 : -seven_seg[4] : 43 : output : 3.3-V LVTTL : : 1 : Y -seven_seg[3] : 44 : output : 3.3-V LVTTL : : 1 : Y -sdram_cs_n : 45 : output : 3.3-V LVTTL : : 1 : Y -sdram_cke : 46 : output : 3.3-V LVTTL : : 1 : Y -sdram_clk : 47 : output : 3.3-V LVTTL : : 1 : Y -GND* : 48 : : : : 1 : -GND : 49 : gnd : : : : -GND_PLL1 : 50 : gnd : : : : -VCCD_PLL1 : 51 : power : : 1.2V : : -GND_PLL1 : 52 : gnd : : : : -VCCA_PLL1 : 53 : power : : 1.2V : : -GNDA_PLL1 : 54 : gnd : : : : -GND : 55 : gnd : : : : -sdram_dqm[0] : 56 : output : 3.3-V LVTTL : : 4 : Y -sdram_dq[7] : 57 : bidir : 3.3-V LVTTL : : 4 : Y -sdram_dq[6] : 58 : bidir : 3.3-V LVTTL : : 4 : Y -sdram_dq[5] : 59 : bidir : 3.3-V LVTTL : : 4 : Y -sdram_dq[4] : 60 : bidir : 3.3-V LVTTL : : 4 : Y -sdram_dq[3] : 61 : bidir : 3.3-V LVTTL : : 4 : Y -VCCIO4 : 62 : power : : 3.3V : 4 : -sdram_dq[2] : 63 : bidir : 3.3-V LVTTL : : 4 : Y -sdram_dq[1] : 64 : bidir : 3.3-V LVTTL : : 4 : Y -GND : 65 : gnd : : : : -VCCINT : 66 : power : : 1.2V : : -sdram_dq[0] : 67 : bidir : 3.3-V LVTTL : : 4 : Y -sdram_we_n : 68 : output : 3.3-V LVTTL : : 4 : Y -sdram_cas_n : 69 : output : 3.3-V LVTTL : : 4 : Y -sdram_ras_n : 70 : output : 3.3-V LVTTL : : 4 : Y -VCCIO4 : 71 : power : : 3.3V : 4 : -sdram_ba[0] : 72 : output : 3.3-V LVTTL : : 4 : Y -GND : 73 : gnd : : : : -sdram_ba[1] : 74 : output : 3.3-V LVTTL : : 4 : Y -sdram_addr[10] : 75 : output : 3.3-V LVTTL : : 4 : Y -sdram_addr[0] : 76 : output : 3.3-V LVTTL : : 4 : Y -sdram_addr[1] : 77 : output : 3.3-V LVTTL : : 4 : Y -GND : 78 : gnd : : : : -VCCINT : 79 : power : : 1.2V : : -sdram_addr[2] : 80 : output : 3.3-V LVTTL : : 4 : Y -sdram_addr[3] : 81 : output : 3.3-V LVTTL : : 4 : Y -sdram_addr[4] : 82 : output : 3.3-V LVTTL : : 4 : Y -VCCIO4 : 83 : power : : 3.3V : 4 : -sdram_addr[5] : 84 : output : 3.3-V LVTTL : : 4 : Y -GND : 85 : gnd : : : : -sdram_addr[6] : 86 : output : 3.3-V LVTTL : : 4 : Y -sdram_addr[7] : 87 : output : 3.3-V LVTTL : : 4 : Y -sdram_addr[8] : 88 : output : 3.3-V LVTTL : : 4 : Y -sdram_addr[9] : 89 : output : 3.3-V LVTTL : : 4 : Y -sdram_addr[11] : 90 : output : 3.3-V LVTTL : : 4 : Y -VCCIO4 : 91 : power : : 3.3V : 4 : -sdram_addr[12] : 92 : output : 3.3-V LVTTL : : 4 : Y -GND : 93 : gnd : : : : -sdram_dq[15] : 94 : bidir : 3.3-V LVTTL : : 4 : Y -sdram_dq[14] : 95 : bidir : 3.3-V LVTTL : : 4 : Y -sdram_dq[13] : 96 : bidir : 3.3-V LVTTL : : 4 : Y -sdram_dq[12] : 97 : bidir : 3.3-V LVTTL : : 4 : Y -VCCIO4 : 98 : power : : 3.3V : 4 : -sdram_dq[11] : 99 : bidir : 3.3-V LVTTL : : 4 : Y -GND : 100 : gnd : : : : -sdram_dq[10] : 101 : bidir : 3.3-V LVTTL : : 4 : Y -sdram_dq[9] : 102 : bidir : 3.3-V LVTTL : : 4 : Y -sdram_dq[8] : 103 : bidir : 3.3-V LVTTL : : 4 : Y -sdram_dqm[1] : 104 : output : 3.3-V LVTTL : : 4 : Y -GND* : 105 : : : : 3 : -GND* : 106 : : : : 3 : -GND* : 107 : : : : 3 : -vga_red[0] : 108 : output : 3.3-V LVTTL : : 3 : Y -VCCIO3 : 109 : power : : 3.3V : 3 : -GND* : 110 : : : : 3 : -GND : 111 : gnd : : : : -vga_red[2] : 112 : output : 3.3-V LVTTL : : 3 : Y -vga_red[1] : 113 : output : 3.3-V LVTTL : : 3 : Y -vga_green[1] : 114 : output : 3.3-V LVTTL : : 3 : Y -vga_green[0] : 115 : output : 3.3-V LVTTL : : 3 : Y -vga_blue[0] : 116 : output : 3.3-V LVTTL : : 3 : Y -vga_green[2] : 117 : output : 3.3-V LVTTL : : 3 : Y -vga_blue[2] : 118 : output : 3.3-V LVTTL : : 3 : Y -GND : 119 : gnd : : : : -VCCINT : 120 : power : : 1.2V : : -nSTATUS : 121 : : : : 3 : -VCCIO3 : 122 : power : : 3.3V : 3 : -CONF_DONE : 123 : : : : 3 : -GND : 124 : gnd : : : : -MSEL1 : 125 : : : : 3 : -MSEL0 : 126 : : : : 3 : -vga_blue[1] : 127 : output : 3.3-V LVTTL : : 3 : Y -vga_hs : 128 : output : 3.3-V LVTTL : : 3 : Y -GND+ : 129 : : : : 3 : -GND+ : 130 : : : : 3 : -GND+ : 131 : : : : 3 : -GND+ : 132 : : : : 3 : -vga_vs : 133 : output : 3.3-V LVTTL : : 3 : Y -dm9000_data[6] : 134 : bidir : 3.3-V LVTTL : : 3 : Y -dm9000_data[7] : 135 : bidir : 3.3-V LVTTL : : 3 : Y -VCCIO3 : 136 : power : : 3.3V : 3 : -dm9000_data[4] : 137 : bidir : 3.3-V LVTTL : : 3 : Y -dm9000_data[5] : 138 : bidir : 3.3-V LVTTL : : 3 : Y -dm9000_data[2] : 139 : bidir : 3.3-V LVTTL : : 3 : Y -GND : 140 : gnd : : : : -dm9000_data[3] : 141 : bidir : 3.3-V LVTTL : : 3 : Y -dm9000_data[0] : 142 : bidir : 3.3-V LVTTL : : 3 : Y -dm9000_data[1] : 143 : bidir : 3.3-V LVTTL : : 3 : Y -dm9000_data[15] : 144 : bidir : 3.3-V LVTTL : : 3 : Y -dm9000_data[14] : 145 : bidir : 3.3-V LVTTL : : 3 : Y -dm9000_data[13] : 146 : bidir : 3.3-V LVTTL : : 3 : Y -dm9000_data[12] : 147 : bidir : 3.3-V LVTTL : : 3 : Y -VCCIO3 : 148 : power : : 3.3V : 3 : -dm9000_data[11] : 149 : bidir : 3.3-V LVTTL : : 3 : Y -dm9000_data[10] : 150 : bidir : 3.3-V LVTTL : : 3 : Y -dm9000_data[9] : 151 : bidir : 3.3-V LVTTL : : 3 : Y -dm9000_data[8] : 152 : bidir : 3.3-V LVTTL : : 3 : Y -GND : 153 : gnd : : : : -GND_PLL2 : 154 : gnd : : : : -VCCD_PLL2 : 155 : power : : 1.2V : : -GND_PLL2 : 156 : gnd : : : : -VCCA_PLL2 : 157 : power : : 1.2V : : -GNDA_PLL2 : 158 : gnd : : : : -GND : 159 : gnd : : : : -dm9000_cmd : 160 : output : 3.3-V LVTTL : : 2 : Y -dm9000_int : 161 : input : 3.3-V LVTTL : : 2 : Y -dm9000_rd_n : 162 : output : 3.3-V LVTTL : : 2 : Y -dm9000_wr_n : 163 : output : 3.3-V LVTTL : : 2 : Y -dm9000_rst_n : 164 : output : 3.3-V LVTTL : : 2 : Y -dm9000_cs_n : 165 : output : 3.3-V LVTTL : : 2 : Y -VCCIO2 : 166 : power : : 3.3V : 2 : -GND : 167 : gnd : : : : -GND* : 168 : : : : 2 : -GND* : 169 : : : : 2 : -GND* : 170 : : : : 2 : -GND* : 171 : : : : 2 : -VCCIO2 : 172 : power : : 3.3V : 2 : -GND* : 173 : : : : 2 : -GND : 174 : gnd : : : : -GND* : 175 : : : : 2 : -GND* : 176 : : : : 2 : -GND : 177 : gnd : : : : -VCCINT : 178 : power : : 1.2V : : -GND* : 179 : : : : 2 : -GND* : 180 : : : : 2 : -GND* : 181 : : : : 2 : -GND* : 182 : : : : 2 : -VCCIO2 : 183 : power : : 3.3V : 2 : -GND : 184 : gnd : : : : -GND* : 185 : : : : 2 : -GND : 186 : gnd : : : : -GND* : 187 : : : : 2 : -GND* : 188 : : : : 2 : -GND* : 189 : : : : 2 : -VCCINT : 190 : power : : 1.2V : : -GND* : 191 : : : : 2 : -GND* : 192 : : : : 2 : -GND* : 193 : : : : 2 : -VCCIO2 : 194 : power : : 3.3V : 2 : -GND* : 195 : : : : 2 : -GND : 196 : gnd : : : : -GND* : 197 : : : : 2 : -GND* : 198 : : : : 2 : -GND* : 199 : : : : 2 : -GND* : 200 : : : : 2 : -GND* : 201 : : : : 2 : -VCCIO2 : 202 : power : : 3.3V : 2 : -GND* : 203 : : : : 2 : -GND : 204 : gnd : : : : -GND* : 205 : : : : 2 : -GND* : 206 : : : : 2 : -GND* : 207 : : : : 2 : -GND* : 208 : : : : 2 : diff --git a/tools/wrap b/tools/wrap new file mode 100755 index 0000000..4caed0f --- /dev/null +++ b/tools/wrap @@ -0,0 +1,11 @@ +#!/bin/sh + +AD=/software/apps/altera/quartus_ii_13.0sp1 +LL=linux +QUARTUS_ROOTDIR="${AD}/quartus" +PATH="${AD}/quartus/bin:${AD}/nios2eds/sdk2/bin:${AD}/nios2eds/bin:${AD}/nios2eds/bin/gnu/H-i686-pc-linux-gnu/bin:${PATH}" +LD_LIBRARY_PATH="${AD}/quartus/${LL}:${LD_LIBRARY_PATH}" + +export LD_LIBRARY_PATH PATH QUARTUS_ROOTDIR + +"$@" -- cgit v1.2.3