§ Главное

Ссылка на загрузку шаблона
Компилятор и IDE: Quartus 9.1 SP2
  • update.bat
  • marsohod2.v
  • marsohod2.qsf
  • marsohod2.qpf
  • .gitignore
  • vga.v
  • pll.v

§ Команда обновления MIF (update.bat)

Запуск этой команды позволяет быстро обновить MIF-файлы без перекомпиляции проекта.
@echo off
quartus_cdb marsohod2 -c marsohod2 --update_mif
quartus_asm --read_settings_files=on --write_settings_files=off marsohod2 -c marsohod2

§ marsohod2.v

module marsohod2(

    /* ----------------
     * Archectural Marsohod2
     * ---------------- */

    // CLOCK    100 Mhz
    input   wire        clk,

    // LED      4
    output  wire [3:0]  led,

    // KEYS     2
    input   wire [1:0]  keys,

    // ADC      8 bit
    output  wire        adc_clock_20mhz,
    input   wire [7:0]  adc_input,

    // SDRAM
    output  wire        sdram_clock,
    output  wire [11:0] sdram_addr,
    output  wire [1:0]  sdram_bank,
    inout   wire [15:0] sdram_dq,
    output  wire        sdram_ldqm,
    output  wire        sdram_udqm,
    output  wire        sdram_ras,
    output  wire        sdram_cas,
    output  wire        sdram_we,

    // VGA
    output  wire [4:0]  vga_red,
    output  wire [5:0]  vga_green,
    output  wire [4:0]  vga_blue,
    output  wire        vga_hs,
    output  wire        vga_vs,

    // FTDI (PORT-B)
    input   wire        ftdi_rx,
    output  wire        ftdi_tx,

    /* ----------------
     * Extension Shield
     * ---------------- */

    // USB-A    2 pins
    inout   wire [1:0]  usb,

    // SOUND    2 channel
    output  wire        sound_left,
    output  wire        sound_right,

    // PS/2     keyb / mouse
    inout   wire [1:0]  ps2_keyb,   // ps2_keyb[0] = DAT,   ps2_mouse[0] = DAT
    inout   wire [1:0]  ps2_mouse   // ps2_keyb[1] = CLK,   ps2_mouse[0] = CLK
);
// --------------------------------------------------------------------------

pll PLL(

    .clk        (clk),          // Входящие 100 Мгц
    .locked     (locked),       // 1 - готово и стабильно
    .c0         (clock_25),     // 25,0 Mhz
    .c1         (clock_12),     // 12,0 Mhz
    .c2         (clock_6),      //  6,0 Mhz
    .c3         (clock_50)      // 50,0 Mhz
);

vga VGA
(
    // Опорная частота
    .CLOCK (clock_25),

    // Выходные данные
    .VGA_R  (vga_red[4:1]),
    .VGA_G  (vga_green[5:2]),
    .VGA_B  (vga_blue[4:1]),
    .VGA_HS (vga_hs),
    .VGA_VS (vga_vs)
);

endmodule

§ marsohod2.qsf

set_global_assignment -name FAMILY "Cyclone III"
set_global_assignment -name DEVICE EP3C10E144C8
set_global_assignment -name TOP_LEVEL_ENTITY marsohod2
set_global_assignment -name ORIGINAL_QUARTUS_VERSION "9.1 SP2"
set_global_assignment -name PROJECT_CREATION_TIME_DATE "11:30:40  JULY 19, 2017"
set_global_assignment -name LAST_QUARTUS_VERSION "9.1 SP2"
set_global_assignment -name USE_GENERATED_PHYSICAL_CONSTRAINTS OFF -section_id eda_blast_fpga
set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0
set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85
set_global_assignment -name NOMINAL_CORE_SUPPLY_VOLTAGE 1.2V
set_global_assignment -name VERILOG_FILE marsohod2.v
set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top
set_global_assignment -name LL_ROOT_REGION ON -section_id "Root Region"
set_global_assignment -name LL_MEMBER_STATE LOCKED -section_id "Root Region"
set_global_assignment -name MISC_FILE "marsohod2.dpf"
set_global_assignment -name TIMEQUEST_MULTICORNER_ANALYSIS ON
set_global_assignment -name TIMEQUEST_DO_CCPP_REMOVAL ON
set_global_assignment -name USE_CONFIGURATION_DEVICE OFF
set_global_assignment -name RESERVE_ALL_UNUSED_PINS_WEAK_PULLUP "AS INPUT TRI-STATED"
set_global_assignment -name STRATIX_DEVICE_IO_STANDARD "2.5 V"
set_location_assignment PIN_79 -to led[3]
set_location_assignment PIN_83 -to led[2]
set_location_assignment PIN_84 -to led[1]
set_location_assignment PIN_85 -to led[0]
set_location_assignment PIN_23 -to keys[0]
set_location_assignment PIN_22 -to keys[1]
set_location_assignment PIN_100 -to adc_input[0]
set_location_assignment PIN_99 -to adc_input[1]
set_location_assignment PIN_98 -to adc_input[2]
set_location_assignment PIN_91 -to adc_input[3]
set_location_assignment PIN_90 -to adc_input[4]
set_location_assignment PIN_89 -to adc_input[5]
set_location_assignment PIN_87 -to adc_input[7]
set_location_assignment PIN_88 -to adc_input[6]
set_location_assignment PIN_25 -to clk
set_location_assignment PIN_86 -to adc_clock_20mhz
set_location_assignment PIN_128 -to vga_blue[4]
set_location_assignment PIN_129 -to vga_blue[3]
set_location_assignment PIN_132 -to vga_blue[2]
set_location_assignment PIN_133 -to vga_blue[1]
set_location_assignment PIN_135 -to vga_blue[0]
set_location_assignment PIN_144 -to vga_red[4]
set_location_assignment PIN_1 -to vga_red[3]
set_location_assignment PIN_2 -to vga_red[2]
set_location_assignment PIN_3 -to vga_red[1]
set_location_assignment PIN_7 -to vga_red[0]
set_location_assignment PIN_136 -to vga_green[5]
set_location_assignment PIN_137 -to vga_green[4]
set_location_assignment PIN_138 -to vga_green[3]
set_location_assignment PIN_141 -to vga_green[2]
set_location_assignment PIN_142 -to vga_green[1]
set_location_assignment PIN_143 -to vga_green[0]
set_location_assignment PIN_127 -to vga_hs
set_location_assignment PIN_126 -to vga_vs
set_location_assignment PIN_60 -to sdram_addr[0]
set_location_assignment PIN_64 -to sdram_addr[1]
set_location_assignment PIN_65 -to sdram_addr[2]
set_location_assignment PIN_66 -to sdram_addr[3]
set_location_assignment PIN_46 -to sdram_addr[4]
set_location_assignment PIN_49 -to sdram_addr[5]
set_location_assignment PIN_50 -to sdram_addr[6]
set_location_assignment PIN_51 -to sdram_addr[7]
set_location_assignment PIN_52 -to sdram_addr[8]
set_location_assignment PIN_53 -to sdram_addr[9]
set_location_assignment PIN_59 -to sdram_addr[10]
set_location_assignment PIN_54 -to sdram_addr[11]
set_location_assignment PIN_55 -to sdram_bank[0]
set_location_assignment PIN_58 -to sdram_bank[1]
set_location_assignment PIN_30 -to sdram_dq[15]
set_location_assignment PIN_31 -to sdram_dq[14]
set_location_assignment PIN_32 -to sdram_dq[13]
set_location_assignment PIN_33 -to sdram_dq[12]
set_location_assignment PIN_34 -to sdram_dq[11]
set_location_assignment PIN_38 -to sdram_dq[10]
set_location_assignment PIN_39 -to sdram_dq[9]
set_location_assignment PIN_42 -to sdram_dq[8]
set_location_assignment PIN_71 -to sdram_dq[7]
set_location_assignment PIN_72 -to sdram_dq[6]
set_location_assignment PIN_73 -to sdram_dq[5]
set_location_assignment PIN_74 -to sdram_dq[4]
set_location_assignment PIN_75 -to sdram_dq[3]
set_location_assignment PIN_76 -to sdram_dq[2]
set_location_assignment PIN_77 -to sdram_dq[1]
set_location_assignment PIN_80 -to sdram_dq[0]
set_location_assignment PIN_68 -to sdram_cas
set_location_assignment PIN_44 -to sdram_clock
set_location_assignment PIN_70 -to sdram_ldqm
set_location_assignment PIN_67 -to sdram_ras
set_location_assignment PIN_43 -to sdram_udqm
set_location_assignment PIN_69 -to sdram_we
set_location_assignment PIN_111 -to sound_left
set_location_assignment PIN_112 -to sound_right
set_location_assignment PIN_103 -to usb[1]
set_location_assignment PIN_104 -to usb[0]
set_location_assignment PIN_113 -to ps2_keyb[1]
set_location_assignment PIN_114 -to ps2_keyb[0]
set_location_assignment PIN_115 -to ps2_mouse[1]
set_location_assignment PIN_119 -to ps2_mouse[0]
set_location_assignment PIN_24 -to ftdi_rx
set_location_assignment PIN_28 -to ftdi_tx
set_global_assignment -name VECTOR_WAVEFORM_FILE marsohod2.vwf
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top
Дополнительно сюда можно вписать еще вот это
set_global_assignment -name CYCLONEII_RESERVE_NCEO_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name RESERVE_DATA0_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name RESERVE_DATA1_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name RESERVE_FLASH_NCE_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name FORCE_CONFIGURATION_VCCIO ON
Это сделает возможным использование некоторых пинов для второго USB на шилде.

§ marsohod2.qpf

QUARTUS_VERSION = "9.1"
DATE = "11:30:40 July 19, 2017"
PROJECT_REVISION = "marsohod2"

§ .gitignore

db
incremental_db
simulation
timing
*.rpt
*.summary
*.sof
*.done
*.pin
*.qws
*.bak
*.smsg
*.qws
*.vcd
*.qqq
*.jic
*.map
*.qqq
undo_redo.txt
PLLJ_PLLSPE_INFO.txt