1
0
mirror of https://github.com/Gehstock/Mist_FPGA.git synced 2026-01-17 00:22:41 +00:00

Amazing Maze WIP

This commit is contained in:
Marcel 2021-05-24 22:05:54 +02:00
parent d8fc2fd4d4
commit 8527640c12
20 changed files with 2544 additions and 3 deletions

View File

@ -0,0 +1,30 @@
# -------------------------------------------------------------------------- #
#
# 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.
#
# -------------------------------------------------------------------------- #
#
# Quartus II 64-Bit
# Version 13.1.0 Build 162 10/23/2013 SJ Web Edition
# Date created = 21:27:39 November 20, 2017
#
# -------------------------------------------------------------------------- #
QUARTUS_VERSION = "13.1"
DATE = "21:27:39 November 20, 2017"
# Revisions
PROJECT_REVISION = "AmazingMaze"

View File

@ -0,0 +1,178 @@
# -------------------------------------------------------------------------- #
#
# Copyright (C) 1991-2014 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.
#
# -------------------------------------------------------------------------- #
#
# Quartus II 64-Bit
# Version 13.1.4 Build 182 03/12/2014 SJ Web Edition
# Date created = 22:12:52 July 17, 2019
#
# -------------------------------------------------------------------------- #
#
# Notes:
#
# 1) The default values for assignments are stored in the file:
# GunFight_assignment_defaults.qdf
# If this file doesn't exist, see file:
# assignment_defaults.qdf
#
# 2) Altera recommends that you do not modify this file. This
# file is updated automatically by the Quartus II software
# and any changes you make may be lost or overwritten.
#
# -------------------------------------------------------------------------- #
# Project-Wide Assignments
# ========================
set_global_assignment -name ORIGINAL_QUARTUS_VERSION 13.1
set_global_assignment -name PROJECT_CREATION_TIME_DATE "21:27:39 NOVEMBER 20, 2017"
set_global_assignment -name LAST_QUARTUS_VERSION 13.1
set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files
set_global_assignment -name PRE_FLOW_SCRIPT_FILE "quartus_sh:rtl/build_id.tcl"
# Pin & Location Assignments
# ==========================
set_location_assignment PIN_7 -to LED
set_location_assignment PIN_54 -to CLOCK_27
set_location_assignment PIN_144 -to VGA_R[5]
set_location_assignment PIN_143 -to VGA_R[4]
set_location_assignment PIN_142 -to VGA_R[3]
set_location_assignment PIN_141 -to VGA_R[2]
set_location_assignment PIN_137 -to VGA_R[1]
set_location_assignment PIN_135 -to VGA_R[0]
set_location_assignment PIN_133 -to VGA_B[5]
set_location_assignment PIN_132 -to VGA_B[4]
set_location_assignment PIN_125 -to VGA_B[3]
set_location_assignment PIN_121 -to VGA_B[2]
set_location_assignment PIN_120 -to VGA_B[1]
set_location_assignment PIN_115 -to VGA_B[0]
set_location_assignment PIN_114 -to VGA_G[5]
set_location_assignment PIN_113 -to VGA_G[4]
set_location_assignment PIN_112 -to VGA_G[3]
set_location_assignment PIN_111 -to VGA_G[2]
set_location_assignment PIN_110 -to VGA_G[1]
set_location_assignment PIN_106 -to VGA_G[0]
set_location_assignment PIN_136 -to VGA_VS
set_location_assignment PIN_119 -to VGA_HS
set_location_assignment PIN_65 -to AUDIO_L
set_location_assignment PIN_80 -to AUDIO_R
set_location_assignment PIN_105 -to SPI_DO
set_location_assignment PIN_88 -to SPI_DI
set_location_assignment PIN_126 -to SPI_SCK
set_location_assignment PIN_127 -to SPI_SS2
set_location_assignment PIN_91 -to SPI_SS3
set_location_assignment PIN_13 -to CONF_DATA0
set_location_assignment PLL_1 -to "pll:pll|altpll:altpll_component"
# Classic Timing Assignments
# ==========================
set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0
set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85
# Analysis & Synthesis Assignments
# ================================
set_global_assignment -name FAMILY "Cyclone III"
set_global_assignment -name DEVICE_FILTER_PIN_COUNT 144
set_global_assignment -name DEVICE_FILTER_SPEED_GRADE 8
set_global_assignment -name TOP_LEVEL_ENTITY AmazingMaze_mist
# Fitter Assignments
# ==================
set_global_assignment -name DEVICE EP3C25E144C8
set_global_assignment -name ERROR_CHECK_FREQUENCY_DIVISOR 1
set_global_assignment -name STRATIX_DEVICE_IO_STANDARD "3.3-V LVTTL"
set_global_assignment -name CYCLONEIII_CONFIGURATION_SCHEME "PASSIVE SERIAL"
set_global_assignment -name CRC_ERROR_OPEN_DRAIN OFF
set_global_assignment -name FORCE_CONFIGURATION_VCCIO ON
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 RESERVE_DCLK_AFTER_CONFIGURATION "USE AS REGULAR IO"
# EDA Netlist Writer Assignments
# ==============================
set_global_assignment -name EDA_SIMULATION_TOOL "<None>"
# Assembler Assignments
# =====================
set_global_assignment -name USE_CONFIGURATION_DEVICE OFF
set_global_assignment -name GENERATE_RBF_FILE ON
# Power Estimation Assignments
# ============================
set_global_assignment -name POWER_PRESET_COOLING_SOLUTION "23 MM HEAT SINK WITH 200 LFPM AIRFLOW"
set_global_assignment -name POWER_BOARD_THERMAL_MODEL "NONE (CONSERVATIVE)"
# Advanced I/O Timing Assignments
# ===============================
set_global_assignment -name OUTPUT_IO_TIMING_NEAR_END_VMEAS "HALF VCCIO" -rise
set_global_assignment -name OUTPUT_IO_TIMING_NEAR_END_VMEAS "HALF VCCIO" -fall
set_global_assignment -name OUTPUT_IO_TIMING_FAR_END_VMEAS "HALF SIGNAL SWING" -rise
set_global_assignment -name OUTPUT_IO_TIMING_FAR_END_VMEAS "HALF SIGNAL SWING" -fall
# start EDA_TOOL_SETTINGS(eda_simulation)
# ---------------------------------------
# EDA Netlist Writer Assignments
# ==============================
set_global_assignment -name EDA_OUTPUT_DATA_FORMAT NONE -section_id eda_simulation
# end EDA_TOOL_SETTINGS(eda_simulation)
# -------------------------------------
# ---------------------------
# start ENTITY(GunFight_mist)
# start DESIGN_PARTITION(Top)
# ---------------------------
# Incremental Compilation Assignments
# ===================================
set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top
set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top
# end DESIGN_PARTITION(Top)
# -------------------------
# end ENTITY(GunFight_mist)
# -------------------------
# --------------------------------
# start ENTITY(spaceinvaders_mist)
# end ENTITY(spaceinvaders_mist)
# ------------------------------
set_global_assignment -name SYSTEMVERILOG_FILE rtl/AmazingMaze_mist.sv
set_global_assignment -name VHDL_FILE rtl/invaders.vhd
set_global_assignment -name VHDL_FILE rtl/mw8080.vhd
set_global_assignment -name VHDL_FILE rtl/invaders_audio.vhd
set_global_assignment -name SYSTEMVERILOG_FILE rtl/AmazingMaze_memory.sv
set_global_assignment -name VHDL_FILE rtl/AmazingMaze_overlay.vhd
set_global_assignment -name VHDL_FILE rtl/sprom.vhd
set_global_assignment -name VHDL_FILE rtl/spram.vhd
set_global_assignment -name VHDL_FILE rtl/pll.vhd
set_global_assignment -name QIP_FILE ../../../common/CPU/T80/T80.qip
set_global_assignment -name QIP_FILE ../../../common/mist/mist.qip
set_global_assignment -name TIMEQUEST_MULTICORNER_ANALYSIS ON
set_global_assignment -name SMART_RECOMPILE ON
set_global_assignment -name ENABLE_SIGNALTAP ON
set_global_assignment -name USE_SIGNALTAP_FILE output_files/stp3.stp
set_global_assignment -name SIGNALTAP_FILE output_files/stp3.stp
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top

View File

@ -0,0 +1,126 @@
## Generated SDC file "vectrex_MiST.out.sdc"
## 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.
## VENDOR "Altera"
## PROGRAM "Quartus II"
## VERSION "Version 13.1.0 Build 162 10/23/2013 SJ Web Edition"
## DATE "Sun Jun 24 12:53:00 2018"
##
## DEVICE "EP3C25E144C8"
##
# Clock constraints
# Automatically constrain PLL and other generated clocks
derive_pll_clocks -create_base_clocks
# Automatically calculate clock uncertainty to jitter and other effects.
derive_clock_uncertainty
# tsu/th constraints
# tco constraints
# tpd constraints
#**************************************************************
# Time Information
#**************************************************************
set_time_format -unit ns -decimal_places 3
#**************************************************************
# Create Clock
#**************************************************************
create_clock -name {SPI_SCK} -period 41.666 -waveform { 20.8 41.666 } [get_ports {SPI_SCK}]
#**************************************************************
# Create Generated Clock
#**************************************************************
#**************************************************************
# Set Clock Latency
#**************************************************************
#**************************************************************
# Set Clock Uncertainty
#**************************************************************
#**************************************************************
# Set Input Delay
#**************************************************************
set_input_delay -add_delay -clock_fall -clock [get_clocks {CLOCK_27}] 1.000 [get_ports {CLOCK_27}]
set_input_delay -add_delay -clock_fall -clock [get_clocks {SPI_SCK}] 1.000 [get_ports {CONF_DATA0}]
set_input_delay -add_delay -clock_fall -clock [get_clocks {SPI_SCK}] 1.000 [get_ports {SPI_DI}]
set_input_delay -add_delay -clock_fall -clock [get_clocks {SPI_SCK}] 1.000 [get_ports {SPI_SCK}]
set_input_delay -add_delay -clock_fall -clock [get_clocks {SPI_SCK}] 1.000 [get_ports {SPI_SS2}]
set_input_delay -add_delay -clock_fall -clock [get_clocks {SPI_SCK}] 1.000 [get_ports {SPI_SS3}]
#**************************************************************
# Set Output Delay
#**************************************************************
set_output_delay -add_delay -clock_fall -clock [get_clocks {SPI_SCK}] 1.000 [get_ports {SPI_DO}]
set_output_delay -add_delay -clock_fall -clock [get_clocks {pll|altpll_component|auto_generated|pll1|clk[0]}] 1.000 [get_ports {AUDIO_L}]
set_output_delay -add_delay -clock_fall -clock [get_clocks {pll|altpll_component|auto_generated|pll1|clk[0]}] 1.000 [get_ports {AUDIO_R}]
set_output_delay -add_delay -clock_fall -clock [get_clocks {pll|altpll_component|auto_generated|pll1|clk[0]}] 1.000 [get_ports {LED}]
set_output_delay -add_delay -clock_fall -clock [get_clocks {pll|altpll_component|auto_generated|pll1|clk[1]}] 1.000 [get_ports {VGA_*}]
#**************************************************************
# Set Clock Groups
#**************************************************************
set_clock_groups -asynchronous -group [get_clocks {SPI_SCK}] -group [get_clocks {pll|altpll_component|auto_generated|pll1|clk[*]}]
#**************************************************************
# Set False Path
#**************************************************************
#**************************************************************
# Set Multicycle Path
#**************************************************************
set_multicycle_path -to {VGA_*[*]} -setup 2
set_multicycle_path -to {VGA_*[*]} -hold 1
#**************************************************************
# Set Maximum Delay
#**************************************************************
#**************************************************************
# Set Minimum Delay
#**************************************************************
#**************************************************************
# Set Input Transition
#**************************************************************

View File

@ -0,0 +1,29 @@
---------------------------------------------------------------------------------
--
-- Arcade: Gun Fight port to MiST by Gehstock
-- 17 July 2019
--
---------------------------------------------------------------------------------
--
-- Midway 8080 Hardware
-- Audio based on work by Paul Walsh.
-- Audio and scan converter by MikeJ.
---------------------------------------------------------------------------------
--
--
-- Keyboard inputs :
--
-- ESC : Start
-- Joystick 1 / 2 : Movement
-- Q : Player 1 Gun Up
-- Y : Player 1 Gun Down
-- Arrow Up : Player 2 Gun Up
-- ArrowDown : Player 2 Gun Down
-- Joystick only
--
--
---------------------------------------------------------------------------------
ToDo: Sound
Controls

View File

@ -0,0 +1,15 @@
@echo off
del /s *.bak
del /s *.orig
del /s *.rej
rmdir /s /q db
rmdir /s /q incremental_db
rmdir /s /q output_files
rmdir /s /q simulation
rmdir /s /q greybox_tmp
del PLLJ_PLLSPE_INFO.txt
del *.qws
del *.ppf
del *.qip
del *.ddb
pause

View File

@ -0,0 +1,49 @@
module AmazingMaze_memory(
input Clock,
input RW_n,
input [15:0]Addr,
input [15:0]Ram_Addr,
output [7:0]Ram_out,
input [7:0]Ram_in,
output [7:0]Rom_out
);
wire [7:0]rom_data_0;
wire [7:0]rom_data_1;
sprom #(
.init_file("./roms/maze.h.hex"),
.widthad_a(11),
.width_a(8))
u_rom_h (
.clock(Clock),
.Address(Addr[10:0]),
.q(rom_data_0)
);
sprom #(
.init_file("./roms/maze.g.hex"),
.widthad_a(11),
.width_a(8))
u_rom_g (
.clock(Clock),
.Address(Addr[10:0]),
.q(rom_data_1)
);
assign Rom_out = ~Addr[11] ? rom_data_0 : rom_data_1;
spram #(
.addr_width_g(13),
.data_width_g(8))
u_ram0(
.address(Ram_Addr[12:0]),
.clken(1'b1),
.clock(Clock),
.data(Ram_in),
.wren(~RW_n),
.q(Ram_out)
);
endmodule

View File

@ -0,0 +1,199 @@
module AmazingMaze_mist(
output LED,
output [5:0] VGA_R,
output [5:0] VGA_G,
output [5:0] VGA_B,
output VGA_HS,
output VGA_VS,
output AUDIO_L,
output AUDIO_R,
input SPI_SCK,
output SPI_DO,
input SPI_DI,
input SPI_SS2,
input SPI_SS3,
input CONF_DATA0,
input CLOCK_27
);
`include "rtl\build_id.v"
localparam CONF_STR = {
"Am.Maze;;",
"O34,Scanlines,Off,25%,50%,75%;",
"O6,Joystick swap,Off,On;",
"T0,Reset;",
"V,v1.20.",`BUILD_DATE
};
wire [1:0] scanlines = status[4:3];
wire rotate = 0;
wire joyswap = status[6];
assign LED = 1;
assign AUDIO_R = AUDIO_L;
wire clk_sys, clk_vid;
wire pll_locked;
pll pll
(
.inclk0(CLOCK_27),
.areset(),
.c0(clk_sys),
.c1(clk_vid)
);
wire [63:0] status;
wire [1:0] buttons;
wire [1:0] switches;
wire [31:0] joystick_0,joystick_1;
wire scandoublerD;
wire ypbpr;
wire no_csync;
wire key_pressed;
wire [7:0] key_code;
wire key_strobe;
wire [7:0] audio;
wire hsync,vsync;
wire hs, vs;
wire r,g,b;
wire [15:0]RAB;
wire [15:0]AD;
wire [7:0]RDB;
wire [7:0]RWD;
wire [7:0]IB;
wire [5:0]SoundCtrl3;
wire [5:0]SoundCtrl5;
wire Rst_n_s;
wire RWE_n;
wire Video;
wire HSync;
wire VSync;
wire [7:0] GDB0;
wire [7:0] GDB1;
wire [7:0] GDB2;
reg [7:0] sw[8];
invaderst invaderst(
.Rst_n(~(status[0] | buttons[1])),
.Clk(clk_sys),
.ENA(),
.GDB0({ m_up2, m_down2, m_right2, m_left2, m_up, m_down, m_right, m_left}),
.GDB1({ 1'b0, 1'b0,1'b0,1'b0,m_coin1, 1'b0, m_two_players, m_one_player}),
.GDB2(8'b0),
.RDB(RDB),
.IB(IB),
.RWD(RWD),
.RAB(RAB),
.AD(AD),
.SoundCtrl3(SoundCtrl3),
.SoundCtrl5(SoundCtrl5),
.Rst_n_s(Rst_n_s),
.RWE_n(RWE_n),
.Video(Video),
.HSync(hs),
.VSync(vs)
);
AmazingMaze_memory AmazingMaze_memory (
.Clock(clk_sys),
.RW_n(RWE_n),
.Addr(AD),
.Ram_Addr(RAB),
.Ram_out(RDB),
.Ram_in(RWD),
.Rom_out(IB)
);
invaders_audio invaders_audio (
.Clk(clk_sys),
.S1(SoundCtrl3),
.S2(SoundCtrl5),
.Aud(audio)
);
mist_video #(.COLOR_DEPTH(1)) mist_video(
.clk_sys(clk_vid),
.SPI_SCK(SPI_SCK),
.SPI_SS3(SPI_SS3),
.SPI_DI(SPI_DI),
.R(Video),
.G(Video),
.B(1'b0),
.HSync(hs),
.VSync(vs),
.VGA_R(VGA_R),
.VGA_G(VGA_G),
.VGA_B(VGA_B),
.VGA_VS(VGA_VS),
.VGA_HS(VGA_HS),
.rotate({1'b0,rotate}),
.scandoubler_disable(scandoublerD),
.scanlines(scanlines),
.ce_divider(1'b0),
.ypbpr(ypbpr),
.no_csync(no_csync)
);
user_io #(
.STRLEN(($size(CONF_STR)>>3)))
user_io(
.clk_sys (clk_sys ),
.conf_str (CONF_STR ),
.SPI_CLK (SPI_SCK ),
.SPI_SS_IO (CONF_DATA0 ),
.SPI_MISO (SPI_DO ),
.SPI_MOSI (SPI_DI ),
.buttons (buttons ),
.switches (switches ),
.scandoubler_disable (scandoublerD ),
.ypbpr (ypbpr ),
.no_csync (no_csync ),
.key_strobe (key_strobe ),
.key_pressed (key_pressed ),
.key_code (key_code ),
.joystick_0 (joystick_0 ),
.joystick_1 (joystick_1 ),
.status (status )
);
dac #(
.c_bits(8))
dac (
.clk_i(clk_sys),
.res_n_i(1),
.dac_i(audio),
.dac_o(AUDIO_L)
);
wire m_up, m_down, m_left, m_right, m_fireA, m_fireB, m_fireC, m_fireD, m_fireE, m_fireF;
wire m_up2, m_down2, m_left2, m_right2, m_fire2A, m_fire2B, m_fire2C, m_fire2D, m_fire2E, m_fire2F;
wire m_tilt, m_coin1, m_coin2, m_coin3, m_coin4, m_one_player, m_two_players, m_three_players, m_four_players;
arcade_inputs inputs (
.clk ( clk_sys ),
.key_strobe ( key_strobe ),
.key_pressed ( key_pressed ),
.key_code ( key_code ),
.joystick_0 ( joystick_0 ),
.joystick_1 ( joystick_1 ),
.rotate ( rotate ),
.orientation ( 2'b00 ),
.joyswap ( joyswap ),
.oneplayer ( 1'b0 ),
.controls ( {m_tilt, m_coin4, m_coin3, m_coin2, m_coin1, m_four_players, m_three_players, m_two_players, m_one_player} ),
.player1 ( {m_fireF, m_fireE, m_fireD, m_fireC, m_fireB, m_fireA, m_up, m_down, m_left, m_right} ),
.player2 ( {m_fire2F, m_fire2E, m_fire2D, m_fire2C, m_fire2B, m_fire2A, m_up2, m_down2, m_left2, m_right2} )
);
endmodule
//mod_amazingmaze:
// begin
// WDEnabled <= 1'b0;
// software_flip <= 0;
// end

View File

@ -0,0 +1,127 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity AmazingMaze_overlay is
port(
Video : in std_logic;
Overlay : in std_logic;
CLK : in std_logic;
Rst_n_s : in std_logic;
HSync : in std_logic;
VSync : in std_logic;
O_VIDEO_R : out std_logic;
O_VIDEO_G : out std_logic;
O_VIDEO_B : out std_logic;
O_HSYNC : out std_logic;
O_VSYNC : out std_logic
);
end AmazingMaze_overlay;
architecture rtl of AmazingMaze_overlay is
signal HCnt : std_logic_vector(11 downto 0);
signal VCnt : std_logic_vector(11 downto 0);
signal HSync_t1 : std_logic;
signal Overlay_G1 : boolean;
signal Overlay_G2 : boolean;
signal Overlay_R1 : boolean;
signal Overlay_G1_VCnt : boolean;
signal VideoRGB : std_logic_vector(2 downto 0);
begin
process (Rst_n_s, Clk)
variable cnt : unsigned(3 downto 0);
begin
if Rst_n_s = '0' then
cnt := "0000";
elsif Clk'event and Clk = '1' then
if cnt = 9 then
cnt := "0000";
else
cnt := cnt + 1;
end if;
end if;
end process;
p_overlay : process(Rst_n_s, Clk)
variable HStart : boolean;
begin
if Rst_n_s = '0' then
HCnt <= (others => '0');
VCnt <= (others => '0');
HSync_t1 <= '0';
Overlay_G1_VCnt <= false;
Overlay_G1 <= false;
Overlay_G2 <= false;
Overlay_R1 <= false;
elsif Clk'event and Clk = '1' then
HSync_t1 <= HSync;
HStart := (HSync_t1 = '0') and (HSync = '1');
if HStart then
HCnt <= (others => '0');
else
HCnt <= HCnt + "1";
end if;
if (VSync = '0') then
VCnt <= (others => '0');
elsif HStart then
VCnt <= VCnt + "1";
end if;
if HStart then
if (Vcnt = x"1F") then
Overlay_G1_VCnt <= true;
elsif (Vcnt = x"95") then
Overlay_G1_VCnt <= false;
end if;
end if;
if (HCnt = x"027") and Overlay_G1_VCnt then
Overlay_G1 <= true;
elsif (HCnt = x"046") then
Overlay_G1 <= false;
end if;
if (HCnt = x"046") then
Overlay_G2 <= true;
elsif (HCnt = x"0B6") then
Overlay_G2 <= false;
end if;
if (HCnt = x"1A6") then
Overlay_R1 <= true;
elsif (HCnt = x"1E6") then
Overlay_R1 <= false;
end if;
end if;
end process;
p_video_out_comb : process(Video, Overlay_G1, Overlay_G2, Overlay_R1)
begin
if (Video = '0') then
VideoRGB <= "000";
else
if Overlay_G1 or Overlay_G2 then
VideoRGB <= "010";
elsif Overlay_R1 then
VideoRGB <= "100";
else
VideoRGB <= "111";
end if;
end if;
end process;
O_VIDEO_R <= VideoRGB(2) when (Overlay = '1') else VideoRGB(0) or VideoRGB(1) or VideoRGB(2);
O_VIDEO_G <= VideoRGB(1) when (Overlay = '1') else VideoRGB(0) or VideoRGB(1) or VideoRGB(2);
O_VIDEO_B <= VideoRGB(0) when (Overlay = '1') else VideoRGB(0) or VideoRGB(1) or VideoRGB(2);
O_HSYNC <= HSync;
O_VSYNC <= VSync;
end;

View File

@ -0,0 +1,35 @@
# ================================================================================
#
# Build ID Verilog Module Script
# Jeff Wiencrot - 8/1/2011
#
# Generates a Verilog module that contains a timestamp,
# from the current build. These values are available from the build_date, build_time,
# physical_address, and host_name output ports of the build_id module in the build_id.v
# Verilog source file.
#
# ================================================================================
proc generateBuildID_Verilog {} {
# Get the timestamp (see: http://www.altera.com/support/examples/tcl/tcl-date-time-stamp.html)
set buildDate [ clock format [ clock seconds ] -format %y%m%d ]
set buildTime [ clock format [ clock seconds ] -format %H%M%S ]
# Create a Verilog file for output
set outputFileName "rtl/build_id.v"
set outputFile [open $outputFileName "w"]
# Output the Verilog source
puts $outputFile "`define BUILD_DATE \"$buildDate\""
puts $outputFile "`define BUILD_TIME \"$buildTime\""
close $outputFile
# Send confirmation message to the Messages window
post_message "Generated build identification Verilog module: [pwd]/$outputFileName"
post_message "Date: $buildDate"
post_message "Time: $buildTime"
}
# Comment out this line to prevent the process from automatically executing when the file is sourced:
generateBuildID_Verilog

View File

@ -0,0 +1,13 @@
module gun(
input clk,
input gun1up,
input gun1dw,
input gun2up,
input gun2dw,
output [2:0] gun1out,
output [2:0] gun2out
);
//0x06, 0x02, 0x00, 0x04, 0x05, 0x01, 0x03
wire [6:0]gun[6:0]gun = ()
endmodule

View File

@ -0,0 +1,249 @@
-- Space Invaders core logic
-- 9.984MHz clock
--
-- Version : 0242
--
-- Copyright (c) 2002 Daniel Wallner (jesus@opencores.org)
--
-- All rights reserved
--
-- Redistribution and use in source and synthezised forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
--
-- Redistributions in synthesized form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
--
-- Neither the name of the author nor the names of other contributors may
-- be used to endorse or promote products derived from this software without
-- specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
--
-- Please report bugs to the author, but before you do so, please
-- make sure that this is not a derivative work and that
-- you have the latest version of this file.
--
-- The latest version of this file can be found at:
-- http://www.fpgaarcade.com
--
-- Limitations :
--
-- File history :
--
-- 0241 : First release
--
-- 0242 : Cleaned up reset logic
--
-- 0300 : MikeJ tidyup for audio release
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.NUMERIC_STD.ALL;
entity invaderst is
port(
Rst_n : in std_logic;
Clk : in std_logic;
ENA : out std_logic;
Coin : in std_logic;
GDB0 : in std_logic_vector(7 downto 0);
GDB1 : in std_logic_vector(7 downto 0);
GDB2 : in std_logic_vector(7 downto 0);
RDB : in std_logic_vector(7 downto 0);
IB : in std_logic_vector(7 downto 0);
RWD : out std_logic_vector(7 downto 0);
RAB : out std_logic_vector(12 downto 0);
AD : out std_logic_vector(15 downto 0);
SoundCtrl3 : out std_logic_vector(5 downto 0);
SoundCtrl5 : out std_logic_vector(5 downto 0);
Rst_n_s : out std_logic;
RWE_n : out std_logic;
Video : out std_logic;
HSync : out std_logic;
VSync : out std_logic
);
end invaderst;
architecture rtl of invaderst is
component mw8080
port(
Rst_n : in std_logic;
Clk : in std_logic;
ENA : out std_logic;
RWE_n : out std_logic;
RDB : in std_logic_vector(7 downto 0);
RAB : out std_logic_vector(12 downto 0);
Sounds : out std_logic_vector(7 downto 0);
Ready : out std_logic;
GDB : in std_logic_vector(7 downto 0);
IB : in std_logic_vector(7 downto 0);
DB : out std_logic_vector(7 downto 0);
AD : out std_logic_vector(15 downto 0);
Status : out std_logic_vector(7 downto 0);
Systb : out std_logic;
Int : out std_logic;
Hold_n : in std_logic;
IntE : out std_logic;
DBin_n : out std_logic;
Vait : out std_logic;
HldA : out std_logic;
Sample : out std_logic;
Wr : out std_logic;
Video : out std_logic;
HSync : out std_logic;
VSync : out std_logic);
end component;
signal S : std_logic_vector(7 downto 0);
signal GDB : std_logic_vector(7 downto 0);
signal DB : std_logic_vector(7 downto 0);
signal Sounds : std_logic_vector(7 downto 0);
signal AD_i : std_logic_vector(15 downto 0);
signal PortWr : std_logic_vector(6 downto 2);
signal EA : std_logic_vector(2 downto 0);
signal D5 : std_logic_vector(15 downto 0);
signal WD_Cnt : unsigned(7 downto 0);
signal Sample : std_logic;
signal Rst_n_s_i : std_logic;
signal Gun1 : std_logic_vector(3 downto 0);
signal Gun2 : std_logic_vector(3 downto 0);
signal GunUp1_d : std_logic;
signal GunDown1_d : std_logic;
signal GunUp2_d : std_logic;
signal GunDown2_d : std_logic;
signal state1 : unsigned(2 downto 0);
signal state2 : unsigned(2 downto 0);
begin
Rst_n_s <= Rst_n_s_i;
RWD <= DB;
AD <= AD_i;
-- no Watchdog
process (Rst_n, Clk)
variable Rst_n_r : std_logic;
begin
if Rst_n = '0' then
Rst_n_r := '0';
Rst_n_s_i <= '0';
elsif Clk'event and Clk = '1' then
Rst_n_s_i <= Rst_n_r;
-- if WD_Cnt = 255 then
-- Rst_n_s_i <= '0';
-- end if;
Rst_n_r := '1';
end if;
end process;
process (Rst_n_s_i, Clk)
variable Old_S0 : std_logic;
begin
if Rst_n_s_i = '0' then
-- WD_Cnt <= (others => '0');
Old_S0 := '1';
elsif Clk'event and Clk = '1' then
-- if Sounds(0) = '1' and Old_S0 = '0' then
-- WD_Cnt <= WD_Cnt + 1;
-- end if;
-- if PortWr(6) = '1' then
-- WD_Cnt <= (others => '0');
-- end if;
Old_S0 := Sounds(0);
end if;
end process;
u_mw8080: mw8080
port map(
Rst_n => Rst_n_s_i,
Clk => Clk,
ENA => ENA,
RWE_n => RWE_n,
RDB => RDB,
IB => IB,
RAB => RAB,
Sounds => Sounds,
Ready => open,
GDB => GDB,
DB => DB,
AD => AD_i,
Status => open,
Systb => open,
Int => open,
Hold_n => '1',
IntE => open,
DBin_n => open,
Vait => open,
HldA => open,
Sample => Sample,
Wr => open,
Video => Video,
HSync => HSync,
VSync => VSync);
with AD_i(9 downto 8) select
GDB <= GDB0 when "00",
GDB1 when "01",
GDB2 when "10",
S when others;
PortWr(2) <= '1' when AD_i(10 downto 8) = "010" and Sample = '1' else '0';
PortWr(3) <= '1' when AD_i(10 downto 8) = "011" and Sample = '1' else '0';
PortWr(4) <= '1' when AD_i(10 downto 8) = "100" and Sample = '1' else '0';
PortWr(5) <= '1' when AD_i(10 downto 8) = "101" and Sample = '1' else '0';
PortWr(6) <= '1' when AD_i(10 downto 8) = "110" and Sample = '1' else '0';
process (Rst_n_s_i, Clk)
variable OldSample : std_logic;
begin
if Rst_n_s_i = '0' then
D5 <= (others => '0');
EA <= (others => '0');
SoundCtrl3 <= (others => '0');
SoundCtrl5 <= (others => '0');
OldSample := '0';
elsif Clk'event and Clk = '1' then
if PortWr(2) = '1' then
EA <= DB(2 downto 0);
end if;
if PortWr(3) = '1' then
SoundCtrl3 <= DB(5 downto 0);
end if;
if PortWr(4) = '1' and OldSample = '0' then
D5(15 downto 8) <= DB;
D5(7 downto 0) <= D5(15 downto 8);
end if;
if PortWr(5) = '1' then
SoundCtrl5 <= DB(5 downto 0);
end if;
OldSample := Sample;
end if;
end process;
with EA select
S <= D5(15 downto 8) when "000",
D5(14 downto 7) when "001",
D5(13 downto 6) when "010",
D5(12 downto 5) when "011",
D5(11 downto 4) when "100",
D5(10 downto 3) when "101",
D5( 9 downto 2) when "110",
D5( 8 downto 1) when others;
end;

View File

@ -0,0 +1,496 @@
-- Version : 0300
-- The latest version of this file can be found at:
-- http://www.fpgaarcade.com
-- minor tidy up by MikeJ
-------------------------------------------------------------------------------
-- Company:
-- Engineer: PaulWalsh
--
-- Create Date: 08:45:29 11/04/05
-- Design Name:
-- Module Name: Invaders Audio
-- Project Name: Space Invaders
-- Target Device:
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
--------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity invaders_audio is
Port (
Clk : in std_logic;
S1 : in std_logic_vector(5 downto 0);
S2 : in std_logic_vector(5 downto 0);
Aud : out std_logic_vector(7 downto 0)
);
end;
--* Port 3: (S1)
--* bit 0=UFO (repeats)
--* bit 1=Shot
--* bit 2=Base hit
--* bit 3=Invader hit
--* bit 4=Bonus base
--*
--* Port 5: (S2)
--* bit 0=Fleet movement 1
--* bit 1=Fleet movement 2
--* bit 2=Fleet movement 3
--* bit 3=Fleet movement 4
--* bit 4=UFO 2
architecture Behavioral of invaders_audio is
signal ClkDiv : unsigned(10 downto 0) := (others => '0');
signal ClkDiv2 : std_logic_vector(7 downto 0) := (others => '0');
signal Clk7680_ena : std_logic;
signal Clk480_ena : std_logic;
signal Clk240_ena : std_logic;
signal Clk60_ena : std_logic;
signal s1_t1 : std_logic_vector(5 downto 0);
signal s2_t1 : std_logic_vector(5 downto 0);
signal tempsum : std_logic_vector(7 downto 0);
signal vco_cnt : std_logic_vector(3 downto 0);
signal TriDir1 : std_logic;
signal Fnum : std_logic_vector(3 downto 0);
signal comp : std_logic;
signal SS : std_logic;
signal TrigSH : std_logic;
signal SHCnt : std_logic_vector(8 downto 0);
signal SH : std_logic_vector(7 downto 0);
signal SauHit : std_logic_vector(8 downto 0);
signal SHitTri : std_logic_vector(5 downto 0);
signal TrigIH : std_logic;
signal IHDir : std_logic;
signal IHDir1 : std_logic;
signal IHCnt : std_logic_vector(8 downto 0);
signal IH : std_logic_vector(7 downto 0);
signal InHit : std_logic_vector(8 downto 0);
signal IHitTri : std_logic_vector(5 downto 0);
signal TrigEx : std_logic;
signal Excnt : std_logic_vector(9 downto 0);
signal ExShift : std_logic_vector(15 downto 0);
signal Ex : std_logic_vector(2 downto 0);
signal Explo : std_logic;
signal TrigMis : std_logic;
signal MisShift : std_logic_vector(15 downto 0);
signal MisCnt : std_logic_vector(8 downto 0);
signal miscnt1 : unsigned(7 downto 0);
signal Mis : std_logic_vector(2 downto 0);
signal Missile : std_logic;
signal EnBG : std_logic;
signal BGFnum : std_logic_vector(7 downto 0);
signal BGCnum : std_logic_vector(7 downto 0);
signal bg_cnt : unsigned(7 downto 0);
signal BG : std_logic;
begin
-- do a crude addition of all sound samples
p_audio_mix : process
variable IHVol : std_logic_vector(6 downto 0);
variable SHVol : std_logic_vector(6 downto 0);
begin
wait until rising_edge(Clk);
IHVol(6 downto 0) := InHit(6 downto 0) and IH(6 downto 0);
SHVol(6 downto 0) := SauHit(6 downto 0) and SH(6 downto 0);
tempsum(7 downto 0) <= ('0' & IHVol) + ('0' & SHVol);
Aud(7) <= tempsum (7);
Aud(6) <= tempsum (6) xor (Mis(2) and Missile) xor (Ex(2) and Explo) xor BG;
Aud(5) <= tempsum (5) xor (Mis(1) and Missile) xor (Ex(1) and Explo) xor SS;
Aud(4) <= tempsum (4) xor (Mis(0) and Missile) xor (Ex(0) and Explo);
Aud(3 downto 0) <= tempsum (3 downto 0);
end process;
p_clkdiv : process
begin
wait until rising_edge(Clk);
Clk7680_ena <= '0';
if ClkDiv = 1277 then
Clk7680_ena <= '1';
ClkDiv <= (others => '0');
else
ClkDiv <= ClkDiv + 1;
end if;
end process;
p_clkdiv2 : process
begin
wait until rising_edge(Clk);
Clk480_ena <= '0';
Clk240_ena <= '0';
Clk60_ena <= '0';
if (Clk7680_ena = '1') then
ClkDiv2 <= ClkDiv2 + 1;
if (ClkDiv2(3 downto 0) = "0000") then
Clk480_ena <= '1';
end if;
if (ClkDiv2(4 downto 0) = "00000") then
Clk240_ena <= '1';
end if;
if (ClkDiv2(7 downto 0) = "00000000") then
Clk60_ena <= '1';
end if;
end if;
end process;
p_delay : process
begin
wait until rising_edge(Clk);
s1_t1 <= S1;
s2_t1 <= S2;
end process;
--*************************Saucer Sound***************************************
-- Implement a VCOscilator: frequency is set using counter end point(Fnum)
p_saucer_vco : process
variable term : std_logic_vector(3 downto 0);
begin
wait until rising_edge(Clk);
term := 8 + Fnum;
if (S1(0) = '1') and (Clk7680_ena = '1') then
if vco_cnt = term then
vco_cnt <= (others => '0');
SS <= not SS;
else
vco_cnt <= vco_cnt + 1;
end if;
end if;
end process;
-- Implement a 5.3Hz trianglular wave LFO control the Variable oscilator
-- this is 6Hz ?? 0123454321
p_saucer_lfo : process
begin
wait until rising_edge(Clk);
if (Clk60_ena = '1') then
if Fnum = 4 then -- 5 -1
Comp <= '1';
elsif Fnum = 1 then -- 0 +1
Comp <= '0';
end if;
if comp = '1' then
Fnum <= Fnum - 1 ;
else
Fnum <= Fnum + 1 ;
end if;
end if;
end process;
--**********************SAUCER HIT Sound**************************
-- Implement a 10Hz saw tooth LFO to control the Saucer Hit VCO
p_saucer_hit_vco : process
begin
wait until rising_edge(Clk);
if (Clk480_ena = '1') then
if SHitTri = 48 then
SHitTri <= "000000";
else
SHitTri <= SHitTri+1;
end if;
end if;
end process;
-- Implement a trianglular wave VCO for Saucer Hit 200Hz to 1kHz approx
p_saucer_hit_lfo : process
begin
wait until rising_edge(Clk);
if (Clk7680_ena = '1') then
if TriDir1 = '1' then
if (SauHit +58 - SHitTri) < 190 + 256 then
SauHit <= SauHit +58 - SHitTri;
else
SauHit <= "110111110";
TriDir1 <= '0';
end if;
else
if (SauHit -58 + SHitTri) > 256 then
SauHit <= SauHit -58 + SHitTri;
else
SauHit <= "100000000";
TriDir1 <= '1';
end if;
end if;
end if;
end process;
-- Implement the ADSR for Saucer Hit Sound
p_saucer_adsr : process
begin
wait until rising_edge(Clk);
if (Clk480_ena = '1') then
if (TrigSH = '1') then
SHCnt <= "100000000";
SH <= "11111111";
elsif (SHCnt(8) = '1') then
SHCnt <= SHCnt + "1";
if SHCnt(7 downto 0) = x"60" then -- 96
SH <= "01111111";
elsif SHCnt(7 downto 0) = x"90" then -- 144
SH <= "00111111";
elsif SHCnt(7 downto 0) = x"C0" then -- 192
SH <= "00000000";
end if;
end if;
end if;
end process;
-- Implement the trigger for The Saucer Hit Sound
p_saucer_hit : process
begin
wait until rising_edge(Clk);
if (S2(4) = '1') and (s2_t1(4) = '0') then -- rising_edge
TrigSH <= '1';
elsif (Clk480_ena = '1') then
TrigSH <= '0';
end if;
end process;
--***********************Invader Hit Sound*****************************
-- Implement a 5Hz Triangular Wave LFO to control the Invaders Hit VCO
p_invader_hit_lfo : process
begin
wait until rising_edge(Clk);
if (Clk480_ena = '1') then
if IHitTri = 48-2 then
IHDir <= '0';
elsif IHitTri =0+2 then
IHDir <= '1';
end if;
if IHDir ='1' then
IHitTri <= IHitTri + 2;
else
IHitTri <= IHitTri - 2;
end if;
end if;
end process;
-- Implement a trianglular wave VCO for Invader Hit 700Hz to 3kHz approx
p_invader_hit_vco : process
begin
wait until rising_edge(Clk);
if (Clk7680_ena = '1') then
if IHDir1 = '1' then
if (InHit +10 + IHitTri) < 110 + 256 then
InHit <= InHit +10 + IHitTri;
else
InHit <= "101101110";
IHDir1 <= '0';
end if;
else
if (InHit -10 - IHitTri) > 256 then
InHit <= InHit -10 - IHitTri;
else
InHit <= "100000000";
IHDir1 <= '1';
end if;
end if;
end if;
end process;
-- Implement the ADSR for Invader Hit Sound
p_invader_adsr : process
begin
wait until rising_edge(Clk);
if (Clk480_ena = '1') then
if (TrigIH = '1') then
IHCnt <= "100000000";
IH <= "11111111";
elsif (IHCnt(8) = '1') then
IHCnt <= IHCnt + "1";
if IHCnt(7 downto 0) = x"14" then -- 20
IH <= "01111111";
elsif IHCnt(7 downto 0) = x"1C" then -- 28
IH <= "11111111";
elsif IHCnt(7 downto 0) = x"30" then -- 48
IH <= "00000000";
end if;
end if;
end if;
end process;
-- Implement the trigger for The Invader Hit Sound
p_invader_hit : process
begin
wait until rising_edge(Clk);
if (S1(3) = '1') and (s1_t1(3) = '0') then -- rising_edge
TrigIH <= '1';
elsif (Clk480_ena = '1') then
TrigIH <= '0';
end if;
end process;
--***********************Explosion*****************************
-- Implement a Pseudo Random Noise Generator
p_explosion_pseudo : process
begin
wait until rising_edge(Clk);
if (Clk480_ena = '1') then
if (ExShift = x"0000") then
ExShift <= "0000000010101001";
else
ExShift(0) <= Exshift(14) xor ExShift(15);
ExShift(15 downto 1) <= ExShift (14 downto 0);
end if;
end if;
end process;
Explo <= ExShift(0);
p_explosion_adsr : process
begin
wait until rising_edge(Clk);
if (Clk480_ena = '1') then
if (TrigEx = '1') then
ExCnt <= "1000000000";
Ex <= "100";
elsif (ExCnt(9) = '1') then
ExCnt <= ExCnt + "1";
if ExCnt(8 downto 0) = '0' & x"64" then -- 100
Ex <= "010";
elsif ExCnt(8 downto 0) = '0' & x"c8" then -- 200
Ex <= "001";
elsif ExCnt(8 downto 0) = '1' & x"2c" then -- 300
Ex <= "000";
end if;
end if;
end if;
end process;
-- Implement the trigger for The Explosion Sound
p_explosion_trig : process
begin
wait until rising_edge(Clk);
if (S1(2) = '1') and (s1_t1(2) = '0') then -- rising_edge
TrigEx <= '1';
elsif (Clk480_ena = '1') then
TrigEx <= '0';
end if;
end process;
--***********************Missile*****************************
-- Implement a Pseudo Random Noise Generator
p_missile_pseudo : process
begin
wait until rising_edge(Clk);
if (Clk7680_ena = '1') then
if (MisShift = x"0000") then
MisShift <= "0000000010101001";
else
MisShift(0) <= MisShift(14) xor MisShift(15);
MisShift(15 downto 1) <= MisShift (14 downto 0);
end if;
miscnt1 <= miscnt1 + 20 + unsigned(MisShift(2 downto 0));
if miscnt1 > 60 then
miscnt1 <= "00000000";
Missile <= not Missile;
end if;
end if;
end process;
-- Implement the ADSR for The Missile Sound
p_missile_adsr : process
begin
wait until rising_edge(Clk);
if (Clk480_ena = '1') then
if (TrigMis = '1') then
MisCnt <= "100000000";
Mis <= "100";
elsif (MisCnt(8) = '1') then
MisCnt <= MisCnt + "1";
if MisCnt(7 downto 0) = x"4b" then -- 75
Mis <= "010";
elsif MisCnt(7 downto 0) = x"70" then -- 112
Mis <= "001";
elsif MisCnt(7 downto 0) = x"96" then -- 150
Mis <= "000";
end if;
end if;
end if;
end process;
-- Implement the trigger for The Missile Sound
p_missile_trig : process
begin
wait until rising_edge(Clk);
if (S1(1) = '1') and (s1_t1(1) = '0') then -- rising_edge
TrigMis <= '1';
elsif (Clk480_ena = '1') then
TrigMis <= '0';
end if;
end process;
-- ******************************** Background invader moving tones **************************
EnBG <= S2(0) or S2(1) or S2(2) or S2(3);
with S2(3 downto 0) select
BGFnum <= x"66" when "0001",
x"74" when "0010",
x"7C" when "0100",
x"87" when "1000",
x"87" when others;
with S2(3 downto 0) select
BGCnum <= x"33" when "0001",
x"3A" when "0010",
x"3E" when "0100",
x"43" when "1000",
x"43" when others;
-- Implement a Variable Oscilator: set frequency using counter mid(Cnum) and end points(Fnum)
p_background : process
begin
wait until rising_edge(Clk);
if (Clk7680_ena = '1') then
if EnBG = '0' then
bg_cnt <= x"00";
BG <= '0';
else
bg_cnt <= bg_cnt + 1;
if bg_cnt = unsigned(BGfnum) then
bg_cnt <= x"00";
BG <= '0';
elsif bg_cnt=unsigned(BGCnum) then
BG <='1';
end if;
end if;
end if;
end process;
end Behavioral;

View File

@ -0,0 +1,336 @@
-- Midway 8080 main board
-- 9.984MHz Clock
--
-- Version : 0242
--
-- Copyright (c) 2002 Daniel Wallner (jesus@opencores.org)
--
-- All rights reserved
--
-- Redistribution and use in source and synthezised forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
--
-- Redistributions in synthesized form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
--
-- Neither the name of the author nor the names of other contributors may
-- be used to endorse or promote products derived from this software without
-- specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
--
-- Please report bugs to the author, but before you do so, please
-- make sure that this is not a derivative work and that
-- you have the latest version of this file.
--
-- The latest version of this file can be found at:
-- http://www.fpgaarcade.com
--
-- Limitations :
--
-- File history :
--
-- 0241 : First release
--
-- 0242 : Removed the ROM
--
-- 0300 : MikeJ tidyup for audio release
--
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
entity mw8080 is
port(
Rst_n : in std_logic;
Clk : in std_logic;
ENA : out std_logic;
RWE_n : out std_logic;
RDB : in std_logic_vector(7 downto 0);
RAB : out std_logic_vector(12 downto 0);
Sounds : out std_logic_vector(7 downto 0);
Ready : out std_logic;
GDB : in std_logic_vector(7 downto 0);
IB : in std_logic_vector(7 downto 0);
DB : out std_logic_vector(7 downto 0);
AD : out std_logic_vector(15 downto 0);
Status : out std_logic_vector(7 downto 0);
Systb : out std_logic;
Int : out std_logic;
Hold_n : in std_logic;
IntE : out std_logic;
DBin_n : out std_logic;
Vait : out std_logic;
HldA : out std_logic;
Sample : out std_logic;
Wr : out std_logic;
Video : out std_logic;
HSync : out std_logic;
VSync : out std_logic);
end mw8080;
architecture struct of mw8080 is
component T8080se
generic(
Mode : integer := 2;
T2Write : integer := 0);
port(
RESET_n : in std_logic;
CLK : in std_logic;
CLKEN : in std_logic;
READY : in std_logic;
HOLD : in std_logic;
INT : in std_logic;
INTE : out std_logic;
DBIN : out std_logic;
SYNC : out std_logic;
VAIT : out std_logic;
HLDA : out std_logic;
WR_n : out std_logic;
A : out std_logic_vector(15 downto 0);
DI : in std_logic_vector(7 downto 0);
DO : out std_logic_vector(7 downto 0));
end component;
signal Ready_i : std_logic;
signal Hold : std_logic;
signal IntTrig : std_logic;
signal IntTrigOld : std_logic;
signal Int_i : std_logic;
signal IntE_i : std_logic;
signal DBin : std_logic;
signal Sync : std_logic;
signal Wr_n, Rd_n : std_logic;
signal ClkEnCnt : unsigned(2 downto 0);
signal Status_i : std_logic_vector(7 downto 0);
signal A : std_logic_vector(15 downto 0);
signal ISel : std_logic_vector(1 downto 0);
signal DI : std_logic_vector(7 downto 0);
signal DO : std_logic_vector(7 downto 0);
signal RR : std_logic_vector(9 downto 0);
signal VidEn : std_logic;
signal CntD5 : unsigned(3 downto 0); -- Horizontal counter / 320
signal CntE5 : unsigned(4 downto 0); -- Horizontal counter 2
signal CntE6 : unsigned(3 downto 0); -- Vertical counter / 262
signal CntE7 : unsigned(4 downto 0); -- Vertical counter 2
signal Shift : std_logic_vector(7 downto 0);
begin
ENA <= ClkEnCnt(2);
Status <= Status_i;
Ready <= Ready_i;
DB <= DO;
Systb <= Sync;
Int <= Int_i;
Hold <= not Hold_n;
IntE <= IntE_i;
DBin_n <= not DBin;
Sample <= not Wr_n and Status_i(4);
Wr <= not Wr_n;
AD <= A;
Sounds(0) <= CntE7(3);
Sounds(1) <= CntE7(2);
Sounds(2) <= CntE7(1);
Sounds(3) <= CntE7(0);
Sounds(4) <= CntE6(3);
Sounds(5) <= CntE6(2);
Sounds(6) <= CntE6(1);
Sounds(7) <= CntE6(0);
IntTrig <= (not CntE7(2) nand CntE7(3)) nand not CntE7(4);
ISel(0) <= Status_i(0) nor (Status_i(6) nor A(13));
ISel(1) <= Status_i(0) nor Status_i(6);
with ISel select
DI <= "110" & CntE7(2) & not CntE7(2) & "111" when "00",
GDB when "01",
IB when "10",
RR(7 downto 0) when others;
RWE_n <= Wr_n or not (RR(8) xor RR(9)) or not CntD5(2);
RAB <= A(12 downto 0) when CntD5(2) = '1' else
std_logic_vector(CntE7(3 downto 0) & CntE6(3 downto 0) & CntE5(3 downto 0) & CntD5(3));
u_8080: T8080se
generic map (
Mode => 2,
T2Write => 1)
port map (
RESET_n => Rst_n,
CLK => Clk,
CLKEN => ClkEnCnt(2),
READY => Ready_i,
HOLD => Hold,
INT => Int_i,
INTE => IntE_i,
DBIN => DBin,
SYNC => Sync,
VAIT => Vait,
HLDA => HLDA,
WR_n => Wr_n,
A => A,
DI => DI,
DO => DO);
-- Clock enables
process (Rst_n, Clk)
begin
if Rst_n = '0' then
ClkEnCnt <= "000";
VidEn <= '0';
elsif Clk'event and Clk = '1' then
VidEn <= not VidEn;
if ClkEnCnt = 4 then
ClkEnCnt <= "000";
else
ClkEnCnt <= ClkEnCnt + 1;
end if;
end if;
end process;
-- Glue
process (Rst_n, Clk)
variable OldASEL : std_logic;
begin
if Rst_n = '0' then
Status_i <= (others => '0');
IntTrigOld <= '0';
Int_i <= '0';
OldASEL := '0';
Ready_i <= '0';
RR <= (others => '0');
elsif Clk'event and Clk = '1' then
-- E3
-- Interrupt
IntTrigOld <= IntTrig;
if Status_i(0) = '1' then
Int_i <= '0';
elsif IntTrigOld = '0' and IntTrig = '1' then
Int_i <= IntE_i;
end if;
-- D7
-- Status register
if Sync = '1' then
Status_i <= DO;
end if;
-- A3, C3, E3
-- RAM register/ready logic
if Sync = '1' and A(13) = '1' then
Ready_i <= '0';
elsif Ready_i = '1' then
Ready_i <= '1';
else
Ready_i <= RR(9);
end if;
if Sync = '1' and A(13) = '1' then
RR <= (others => '0');
elsif (CntD5(2) = '1' and OldASEL = '0') or -- ASEL pos edge
(CntD5(2) = '0' and OldASEL = '1' and RR(8) = '1') then -- ASEL neg edge
RR(7 downto 0) <= RDB;
RR(8) <= '1';
RR(9) <= RR(8);
end if;
OldASEL := CntD5(2);
end if;
end process;
-- Video counters
process (Rst_n, Clk)
begin
if Rst_n = '0' then
CntD5 <= (others => '0');
CntE5 <= (others => '0');
CntE6 <= (others => '0');
CntE7 <= (others => '0');
elsif Clk'event and Clk = '1' then
if VidEn = '1' then
CntD5 <= CntD5 + 1;
if CntD5 = 15 then
CntE5 <= CntE5 + 1;
if CntE5(3 downto 0) = 15 then
if CntE5(4) = '0' then
CntE5 <= "11100";
CntE6 <= CntE6 + 1;
if CntE6 = 15 then
CntE7 <= CntE7 + 1;
if CntE7(3 downto 0) = 15 then
if CntE7(4) = '0' then
CntE6 <= "1010";
CntE7 <= "11101";
else
CntE7 <= "00010";
end if;
end if;
end if;
end if;
else
end if;
end if;
end if;
end if;
end process;
-- Video shift register
process (Rst_n, Clk)
begin
if Rst_n = '0' then
Shift <= (others => '0');
Video <= '0';
elsif Clk'event and Clk = '1' then
if VidEn = '1' then
if CntE7(4) = '0' and CntE5(4) = '0' and CntD5(2 downto 0) = "011" then
Shift(7 downto 0) <= RDB(7 downto 0);
else
Shift(6 downto 0) <= Shift(7 downto 1);
Shift(7) <= '0';
end if;
Video <= Shift(0);
end if;
end if;
end process;
-- Sync
process (Rst_n, Clk)
begin
if Rst_n = '0' then
HSync <= '1';
VSync <= '1';
elsif Clk'event and Clk = '1' then
if VidEn = '1' then
if CntE5(4) = '1' and CntE5(1 downto 0) = "10" then
HSync <= '0';
else
HSync <= '1';
end if;
if CntE7(4) = '1' and CntE7(0) = '0' and CntE6(3 downto 2) = "11" then
VSync <= '0';
else
VSync <= '1';
end if;
end if;
end if;
end process;
end;

View File

@ -0,0 +1,4 @@
set_global_assignment -name IP_TOOL_NAME "ALTPLL"
set_global_assignment -name IP_TOOL_VERSION "13.1"
set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "pll.vhd"]
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "pll.ppf"]

View File

@ -0,0 +1,382 @@
-- megafunction wizard: %ALTPLL%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altpll
-- ============================================================
-- File Name: pll.vhd
-- Megafunction Name(s):
-- altpll
--
-- Simulation Library Files(s):
-- altera_mf
-- ============================================================
-- ************************************************************
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
--
-- 13.1.4 Build 182 03/12/2014 Patches 4.26 SJ Web Edition
-- ************************************************************
--Copyright (C) 1991-2014 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.
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY altera_mf;
USE altera_mf.all;
ENTITY pll IS
PORT
(
inclk0 : IN STD_LOGIC := '0';
c0 : OUT STD_LOGIC ;
c1 : OUT STD_LOGIC
);
END pll;
ARCHITECTURE SYN OF pll IS
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (4 DOWNTO 0);
SIGNAL sub_wire1 : STD_LOGIC ;
SIGNAL sub_wire2 : STD_LOGIC ;
SIGNAL sub_wire3 : STD_LOGIC ;
SIGNAL sub_wire4 : STD_LOGIC_VECTOR (1 DOWNTO 0);
SIGNAL sub_wire5_bv : BIT_VECTOR (0 DOWNTO 0);
SIGNAL sub_wire5 : STD_LOGIC_VECTOR (0 DOWNTO 0);
COMPONENT altpll
GENERIC (
bandwidth_type : STRING;
clk0_divide_by : NATURAL;
clk0_duty_cycle : NATURAL;
clk0_multiply_by : NATURAL;
clk0_phase_shift : STRING;
clk1_divide_by : NATURAL;
clk1_duty_cycle : NATURAL;
clk1_multiply_by : NATURAL;
clk1_phase_shift : STRING;
compensate_clock : STRING;
inclk0_input_frequency : NATURAL;
intended_device_family : STRING;
lpm_hint : STRING;
lpm_type : STRING;
operation_mode : STRING;
pll_type : STRING;
port_activeclock : STRING;
port_areset : STRING;
port_clkbad0 : STRING;
port_clkbad1 : STRING;
port_clkloss : STRING;
port_clkswitch : STRING;
port_configupdate : STRING;
port_fbin : STRING;
port_inclk0 : STRING;
port_inclk1 : STRING;
port_locked : STRING;
port_pfdena : STRING;
port_phasecounterselect : STRING;
port_phasedone : STRING;
port_phasestep : STRING;
port_phaseupdown : STRING;
port_pllena : STRING;
port_scanaclr : STRING;
port_scanclk : STRING;
port_scanclkena : STRING;
port_scandata : STRING;
port_scandataout : STRING;
port_scandone : STRING;
port_scanread : STRING;
port_scanwrite : STRING;
port_clk0 : STRING;
port_clk1 : STRING;
port_clk2 : STRING;
port_clk3 : STRING;
port_clk4 : STRING;
port_clk5 : STRING;
port_clkena0 : STRING;
port_clkena1 : STRING;
port_clkena2 : STRING;
port_clkena3 : STRING;
port_clkena4 : STRING;
port_clkena5 : STRING;
port_extclk0 : STRING;
port_extclk1 : STRING;
port_extclk2 : STRING;
port_extclk3 : STRING;
width_clock : NATURAL
);
PORT (
clk : OUT STD_LOGIC_VECTOR (4 DOWNTO 0);
inclk : IN STD_LOGIC_VECTOR (1 DOWNTO 0)
);
END COMPONENT;
BEGIN
sub_wire5_bv(0 DOWNTO 0) <= "0";
sub_wire5 <= To_stdlogicvector(sub_wire5_bv);
sub_wire2 <= sub_wire0(1);
sub_wire1 <= sub_wire0(0);
c0 <= sub_wire1;
c1 <= sub_wire2;
sub_wire3 <= inclk0;
sub_wire4 <= sub_wire5(0 DOWNTO 0) & sub_wire3;
altpll_component : altpll
GENERIC MAP (
bandwidth_type => "AUTO",
clk0_divide_by => 1125,
clk0_duty_cycle => 50,
clk0_multiply_by => 416,
clk0_phase_shift => "0",
clk1_divide_by => 1125,
clk1_duty_cycle => 50,
clk1_multiply_by => 832,
clk1_phase_shift => "0",
compensate_clock => "CLK0",
inclk0_input_frequency => 37037,
intended_device_family => "Cyclone III",
lpm_hint => "CBX_MODULE_PREFIX=pll",
lpm_type => "altpll",
operation_mode => "NORMAL",
pll_type => "AUTO",
port_activeclock => "PORT_UNUSED",
port_areset => "PORT_UNUSED",
port_clkbad0 => "PORT_UNUSED",
port_clkbad1 => "PORT_UNUSED",
port_clkloss => "PORT_UNUSED",
port_clkswitch => "PORT_UNUSED",
port_configupdate => "PORT_UNUSED",
port_fbin => "PORT_UNUSED",
port_inclk0 => "PORT_USED",
port_inclk1 => "PORT_UNUSED",
port_locked => "PORT_UNUSED",
port_pfdena => "PORT_UNUSED",
port_phasecounterselect => "PORT_UNUSED",
port_phasedone => "PORT_UNUSED",
port_phasestep => "PORT_UNUSED",
port_phaseupdown => "PORT_UNUSED",
port_pllena => "PORT_UNUSED",
port_scanaclr => "PORT_UNUSED",
port_scanclk => "PORT_UNUSED",
port_scanclkena => "PORT_UNUSED",
port_scandata => "PORT_UNUSED",
port_scandataout => "PORT_UNUSED",
port_scandone => "PORT_UNUSED",
port_scanread => "PORT_UNUSED",
port_scanwrite => "PORT_UNUSED",
port_clk0 => "PORT_USED",
port_clk1 => "PORT_USED",
port_clk2 => "PORT_UNUSED",
port_clk3 => "PORT_UNUSED",
port_clk4 => "PORT_UNUSED",
port_clk5 => "PORT_UNUSED",
port_clkena0 => "PORT_UNUSED",
port_clkena1 => "PORT_UNUSED",
port_clkena2 => "PORT_UNUSED",
port_clkena3 => "PORT_UNUSED",
port_clkena4 => "PORT_UNUSED",
port_clkena5 => "PORT_UNUSED",
port_extclk0 => "PORT_UNUSED",
port_extclk1 => "PORT_UNUSED",
port_extclk2 => "PORT_UNUSED",
port_extclk3 => "PORT_UNUSED",
width_clock => 5
)
PORT MAP (
inclk => sub_wire4,
clk => sub_wire0
);
END SYN;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ACTIVECLK_CHECK STRING "0"
-- Retrieval info: PRIVATE: BANDWIDTH STRING "1.000"
-- Retrieval info: PRIVATE: BANDWIDTH_FEATURE_ENABLED STRING "1"
-- Retrieval info: PRIVATE: BANDWIDTH_FREQ_UNIT STRING "MHz"
-- Retrieval info: PRIVATE: BANDWIDTH_PRESET STRING "Low"
-- Retrieval info: PRIVATE: BANDWIDTH_USE_AUTO STRING "1"
-- Retrieval info: PRIVATE: BANDWIDTH_USE_PRESET STRING "0"
-- Retrieval info: PRIVATE: CLKBAD_SWITCHOVER_CHECK STRING "0"
-- Retrieval info: PRIVATE: CLKLOSS_CHECK STRING "0"
-- Retrieval info: PRIVATE: CLKSWITCH_CHECK STRING "0"
-- Retrieval info: PRIVATE: CNX_NO_COMPENSATE_RADIO STRING "0"
-- Retrieval info: PRIVATE: CREATE_CLKBAD_CHECK STRING "0"
-- Retrieval info: PRIVATE: CREATE_INCLK1_CHECK STRING "0"
-- Retrieval info: PRIVATE: CUR_DEDICATED_CLK STRING "c0"
-- Retrieval info: PRIVATE: CUR_FBIN_CLK STRING "c0"
-- Retrieval info: PRIVATE: DEVICE_SPEED_GRADE STRING "8"
-- Retrieval info: PRIVATE: DIV_FACTOR0 NUMERIC "27"
-- Retrieval info: PRIVATE: DIV_FACTOR1 NUMERIC "27"
-- Retrieval info: PRIVATE: DUTY_CYCLE0 STRING "50.00000000"
-- Retrieval info: PRIVATE: DUTY_CYCLE1 STRING "50.00000000"
-- Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE0 STRING "9.984000"
-- Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE1 STRING "19.968000"
-- Retrieval info: PRIVATE: EXPLICIT_SWITCHOVER_COUNTER STRING "0"
-- Retrieval info: PRIVATE: EXT_FEEDBACK_RADIO STRING "0"
-- Retrieval info: PRIVATE: GLOCKED_COUNTER_EDIT_CHANGED STRING "1"
-- Retrieval info: PRIVATE: GLOCKED_FEATURE_ENABLED STRING "0"
-- Retrieval info: PRIVATE: GLOCKED_MODE_CHECK STRING "0"
-- Retrieval info: PRIVATE: GLOCK_COUNTER_EDIT NUMERIC "1048575"
-- Retrieval info: PRIVATE: HAS_MANUAL_SWITCHOVER STRING "1"
-- Retrieval info: PRIVATE: INCLK0_FREQ_EDIT STRING "27.000"
-- Retrieval info: PRIVATE: INCLK0_FREQ_UNIT_COMBO STRING "MHz"
-- Retrieval info: PRIVATE: INCLK1_FREQ_EDIT STRING "100.000"
-- Retrieval info: PRIVATE: INCLK1_FREQ_EDIT_CHANGED STRING "1"
-- Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_CHANGED STRING "1"
-- Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_COMBO STRING "MHz"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone III"
-- Retrieval info: PRIVATE: INT_FEEDBACK__MODE_RADIO STRING "1"
-- Retrieval info: PRIVATE: LOCKED_OUTPUT_CHECK STRING "0"
-- Retrieval info: PRIVATE: LONG_SCAN_RADIO STRING "1"
-- Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE STRING "Not Available"
-- Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE_DIRTY NUMERIC "0"
-- Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT0 STRING "deg"
-- Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT1 STRING "ps"
-- Retrieval info: PRIVATE: MIG_DEVICE_SPEED_GRADE STRING "Any"
-- Retrieval info: PRIVATE: MIRROR_CLK0 STRING "0"
-- Retrieval info: PRIVATE: MIRROR_CLK1 STRING "0"
-- Retrieval info: PRIVATE: MULT_FACTOR0 NUMERIC "10"
-- Retrieval info: PRIVATE: MULT_FACTOR1 NUMERIC "20"
-- Retrieval info: PRIVATE: NORMAL_MODE_RADIO STRING "1"
-- Retrieval info: PRIVATE: OUTPUT_FREQ0 STRING "9.98400000"
-- Retrieval info: PRIVATE: OUTPUT_FREQ1 STRING "19.96800000"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_MODE0 STRING "1"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_MODE1 STRING "1"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT0 STRING "MHz"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT1 STRING "MHz"
-- Retrieval info: PRIVATE: PHASE_RECONFIG_FEATURE_ENABLED STRING "1"
-- Retrieval info: PRIVATE: PHASE_RECONFIG_INPUTS_CHECK STRING "0"
-- Retrieval info: PRIVATE: PHASE_SHIFT0 STRING "0.00000000"
-- Retrieval info: PRIVATE: PHASE_SHIFT1 STRING "0.00000000"
-- Retrieval info: PRIVATE: PHASE_SHIFT_STEP_ENABLED_CHECK STRING "0"
-- Retrieval info: PRIVATE: PHASE_SHIFT_UNIT0 STRING "deg"
-- Retrieval info: PRIVATE: PHASE_SHIFT_UNIT1 STRING "deg"
-- Retrieval info: PRIVATE: PLL_ADVANCED_PARAM_CHECK STRING "0"
-- Retrieval info: PRIVATE: PLL_ARESET_CHECK STRING "0"
-- Retrieval info: PRIVATE: PLL_AUTOPLL_CHECK NUMERIC "1"
-- Retrieval info: PRIVATE: PLL_ENHPLL_CHECK NUMERIC "0"
-- Retrieval info: PRIVATE: PLL_FASTPLL_CHECK NUMERIC "0"
-- Retrieval info: PRIVATE: PLL_FBMIMIC_CHECK STRING "0"
-- Retrieval info: PRIVATE: PLL_LVDS_PLL_CHECK NUMERIC "0"
-- Retrieval info: PRIVATE: PLL_PFDENA_CHECK STRING "0"
-- Retrieval info: PRIVATE: PLL_TARGET_HARCOPY_CHECK NUMERIC "0"
-- Retrieval info: PRIVATE: PRIMARY_CLK_COMBO STRING "inclk0"
-- Retrieval info: PRIVATE: RECONFIG_FILE STRING "pll.mif"
-- Retrieval info: PRIVATE: SACN_INPUTS_CHECK STRING "0"
-- Retrieval info: PRIVATE: SCAN_FEATURE_ENABLED STRING "1"
-- Retrieval info: PRIVATE: SELF_RESET_LOCK_LOSS STRING "0"
-- Retrieval info: PRIVATE: SHORT_SCAN_RADIO STRING "0"
-- Retrieval info: PRIVATE: SPREAD_FEATURE_ENABLED STRING "0"
-- Retrieval info: PRIVATE: SPREAD_FREQ STRING "50.000"
-- Retrieval info: PRIVATE: SPREAD_FREQ_UNIT STRING "KHz"
-- Retrieval info: PRIVATE: SPREAD_PERCENT STRING "0.500"
-- Retrieval info: PRIVATE: SPREAD_USE STRING "0"
-- Retrieval info: PRIVATE: SRC_SYNCH_COMP_RADIO STRING "0"
-- Retrieval info: PRIVATE: STICKY_CLK0 STRING "1"
-- Retrieval info: PRIVATE: STICKY_CLK1 STRING "1"
-- Retrieval info: PRIVATE: SWITCHOVER_COUNT_EDIT NUMERIC "1"
-- Retrieval info: PRIVATE: SWITCHOVER_FEATURE_ENABLED STRING "1"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: USE_CLK0 STRING "1"
-- Retrieval info: PRIVATE: USE_CLK1 STRING "1"
-- Retrieval info: PRIVATE: USE_CLKENA0 STRING "0"
-- Retrieval info: PRIVATE: USE_CLKENA1 STRING "0"
-- Retrieval info: PRIVATE: USE_MIL_SPEED_GRADE NUMERIC "0"
-- Retrieval info: PRIVATE: ZERO_DELAY_RADIO STRING "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: BANDWIDTH_TYPE STRING "AUTO"
-- Retrieval info: CONSTANT: CLK0_DIVIDE_BY NUMERIC "1125"
-- Retrieval info: CONSTANT: CLK0_DUTY_CYCLE NUMERIC "50"
-- Retrieval info: CONSTANT: CLK0_MULTIPLY_BY NUMERIC "416"
-- Retrieval info: CONSTANT: CLK0_PHASE_SHIFT STRING "0"
-- Retrieval info: CONSTANT: CLK1_DIVIDE_BY NUMERIC "1125"
-- Retrieval info: CONSTANT: CLK1_DUTY_CYCLE NUMERIC "50"
-- Retrieval info: CONSTANT: CLK1_MULTIPLY_BY NUMERIC "832"
-- Retrieval info: CONSTANT: CLK1_PHASE_SHIFT STRING "0"
-- Retrieval info: CONSTANT: COMPENSATE_CLOCK STRING "CLK0"
-- Retrieval info: CONSTANT: INCLK0_INPUT_FREQUENCY NUMERIC "37037"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone III"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altpll"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "NORMAL"
-- Retrieval info: CONSTANT: PLL_TYPE STRING "AUTO"
-- Retrieval info: CONSTANT: PORT_ACTIVECLOCK STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_ARESET STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CLKBAD0 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CLKBAD1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CLKLOSS STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CLKSWITCH STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CONFIGUPDATE STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_FBIN STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_INCLK0 STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_INCLK1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_LOCKED STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PFDENA STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PHASECOUNTERSELECT STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PHASEDONE STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PHASESTEP STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PHASEUPDOWN STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PLLENA STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANACLR STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANCLK STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANCLKENA STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANDATA STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANDATAOUT STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANDONE STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANREAD STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANWRITE STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clk0 STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_clk1 STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_clk2 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clk3 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clk4 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clk5 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena0 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena2 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena3 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena4 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena5 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_extclk0 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_extclk1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_extclk2 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_extclk3 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: WIDTH_CLOCK NUMERIC "5"
-- Retrieval info: USED_PORT: @clk 0 0 5 0 OUTPUT_CLK_EXT VCC "@clk[4..0]"
-- Retrieval info: USED_PORT: @inclk 0 0 2 0 INPUT_CLK_EXT VCC "@inclk[1..0]"
-- Retrieval info: USED_PORT: c0 0 0 0 0 OUTPUT_CLK_EXT VCC "c0"
-- Retrieval info: USED_PORT: c1 0 0 0 0 OUTPUT_CLK_EXT VCC "c1"
-- Retrieval info: USED_PORT: inclk0 0 0 0 0 INPUT_CLK_EXT GND "inclk0"
-- Retrieval info: CONNECT: @inclk 0 0 1 1 GND 0 0 0 0
-- Retrieval info: CONNECT: @inclk 0 0 1 0 inclk0 0 0 0 0
-- Retrieval info: CONNECT: c0 0 0 0 0 @clk 0 0 1 0
-- Retrieval info: CONNECT: c1 0 0 0 0 @clk 0 0 1 1
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll.ppf TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf
-- Retrieval info: CBX_MODULE_PREFIX: ON

View File

@ -0,0 +1,66 @@
:020000040000FA
:2000000001C304083A1D20EE08B6B277C90C3E18B9CA1D08CD40097E0FD20D08C90E00048C
:200020003E1AB8C2140806003A2220B7C83E00322220C3140821023E16003A262001440DF7
:20004000BAC24A08CDA30801D401CDDB08143E18BAC23A0821233E116620061A0E18E5C5A3
:2000600036FF01E0FF09C1C51A01440DE640CA740801D401E5CDDB08E11A13014C0DE6202B
:20008000CA860801D401CDDB08C10DC26708E12305C25C083A242024253DF29808015C0D54
:2000A000C3DB08E501540DCDDB08E1C921033E116620061A0E18E5C51A13013C0DE680C271
:2000C000C50801D401CDDB08C10DC2B708E12305C2B4083A1F20A7CAEE05C9D51E080A0349
:2000E000B677D511E0FF19D11DC2DE08D1C9F3E1010000110000310040C513BAC2F90831E8
:200100000024E9C5CD19094F06001DCA160981D20A0904C30A0978C1C9E5C5210420060884
:200120007E070707AE17172104207E1777237E1777237E1777237E177705C22109C1E1C916
:20014000D51E18160021000078C5060905CA59092917D24C0919C34C09C159191166201965
:20016000D1C97EA7F0E5235E23560FF5DC9909F10FF5DCB709F10FF5DCDB09F10FDCC9097B
:20018000E17BFE0FC87A01EF00FE60D2900906107EA1B07723732372C9CDEF09C2B509CD99
:2001A0001D0A05F2AE093A2620B9C0C3B509CD40097EE640C81DC9CDEF09C2C709CD1D0A3D
:2001C000CD40097EE640C81CC9CD000AC2D909CD1D0ACD40097EE620C815C9CD000AC2ED83
:2001E00009CD1D0A0DF8CD40097EE620C814C97AE607FE03C1C0C5CD110A7BE607FE07C9F2
:200200007BE607FE07C1C0C5CD110A7AE607FE03C90120200AA7C03C02322920C97B1F1F25
:200220001FE61FD602477A1F1F1FE61F4F3E19914FC92146207EE607FE03C02B7EE607FE09
:2002400007C02B7E2B462B4E1FDA590A1FDA850A1FDA6F0A1FDA9B0AC9CDBE0ADAB10A0C51
:20026000CDCE0ADAB10A04CDDD0ADAB10A0DC9CDF00ADAB10A05CDBE0ADAB10A0CCDCE0AE5
:20028000DAB10A04C9CDBE0ADAB10A0CCDDD0ADAB10A0DCDF00ADAB10A05C9CDF00ADAB1F4
:2002A0000A05CDDD0ADAB10A0DCDCE0ADAB10A04C9214220712370237EE6F0B277C9AF0D26
:2002C000F8CD40097EE620C87E17D016C4C905F8CD40097EE640C87E17D016C1C9CD400922
:2002E0000C7EE620C83E18B9C8237E17D016C8C9CD4009047EE640C83E1AB8CA090B111803
:2003000000197E17D016C237C93A2420B9CA050BAFC93E0EC3EE08F3EB5E2356234E23466A
:2003200023EB702B712BEB4E2346230A2FC61A070707C603121B0E00FE60D23F0B0E107E6B
:2003400023121B7E23220020B112C9210600DB01E640CA570B2E04222A202F322C20C9EB8A
:200360007E23220020320C20C9EB7E320B20235E235623220020EB220820C9EB5E2356EBA3
:20038000220020C9EB7E235E23562322002012C9EB7E235E235623D55E235623220020E137
:2003A000C329011113201A3DFE01C812C9EB4E2346235E2356230AA7C9CDAD0BC2C00BEBDD
:2003C000220020C9CDAD0BCACB0BEB220020C9EB5E235623013620CD34065E235623220098
:2003E00020213620CD8C053E02C329010000BD04120B3508170B4B0B1904900B5F0B690BB2
:20040000AC087B0B840BA30BB90BC40BCF0BD905404040404040404040404040404040401A
:200420004054484540414D415A494E474D415A45404D415A455340574F4E53454C45435473
:200440001953494E474C4540504C41594552184F521654574F40504C415945521833404D06
:20046000415A4553405045524047414D45494E5345525440434F494E405147455440524542
:20048000414459504C4159404153404C4F4E474041531B594F554057494E4D415A4553402A
:2004A000544F40504C415953545544594054494D4550114C11411159114511524F114E113A
:2004C00045541157114F11571149114E114E1145115240114011401140114011401140114B
:2004E00040114011404B45455040504C4159494E4757414954504C415945524057494E531E
:20050000504C41594552404C4F534553505245535340425554544F4E40544F1C5354415266
:20052000544047414D45404F5645524F564552414C4C10386C38107C4454447C0000102874
:2005400010000000808080808080808000000000000000FF183060FE6030180000180C0614
:200560007F060C180C002C200C0031200C0032200C002D2011090A940D0710100C0824073B
:2005800009220D0B24081E000709100C0B24081E000B7F0D02090AD50D0703210C0A2C084A
:2005A0000F00070B210C0A2C080F0007042C0C0B32080F000704220D1032083C00070B1027
:2005C0000C0A2C0709100C0B32070D6D0C093A080F000B990D02070D6D0C093A0719410C99
:2005E0000A2A0908FB0D07105D0C0836081E000701100C0836081E000BE60D02071F3A0CD6
:200600000C2A09081B0E070D6D0C093A0814000701100C153A0814000B060E02060308F0CD
:20062000000A0904940D000207190C0D0828070D410C0934070A520C0B380C0134200701DE
:20064000100C17340701790C0938081E000701790C17340701100C0938081E000B3E0E0283
:200660000C041320070D410C092C07075D0C0C3007024F0C0F320716830C083408F0000B5E
:20068000A60E0F2E208C0E0F3220640D020902A60E07097A0C0B32081E000709100C0B32BA
:2006A000080F000B910E020603070AA70CA03E0F2E20C10E070CE50C08240C012E200BCC3E
:2006C0000E070D9A0C0824102E2016240709310CB13E103120BB3E044820320D262017C22E
:2006E000045920370D2420E0C00C060E200C062920000904820E0710100C0824103120BBA2
:200700003E0E1A201C0F0D070BF50C0824081E00070B100C0824081E000B070F070C000DF5
:200720000824081E00070C100C0824081E000B1C0F0205070A520C0B2C07075D0C0C300848
:20074000B4000B640F0E2E20640D020902640F07097A0C0B32081E000709100C0B32081E92
:20076000000B4F0F0206030706B10C01260703C10CE134103220003C0706B10C1E26070372
:20078000BC0CFE341031201D3C070D9A0C0824102E2016240704AD0CA33E07072B0DB13E4D
:2007A000044820370D262017C0045920320D2420E0C00C010D200C01202000102E201624AD
:2007C0000904450F0E1B20E30F103220003C070AD20C0126081E000706C70C0126081E0076
:2007E0000BCE0F1031201D3C070AD20C1E26081E000706C70C1E26081E000BE80F000000B2
:00000001FF

View File

@ -0,0 +1,66 @@
:020000040000FA
:200000000000310024C31700F5C5D5E5C30B0300F5C5D5E5C3E202DB0117D27703060111FA
:200020000000210020D302707EA8CA3C004F7DE60179C23A00B257C33C00B35F237CFE40EF
:20004000C22500D3022B7CFE1FCA79007EA8CA60004F7DE60179C25E00B257C36000B35F03
:20006000782F77AECA43004F7DE60179C27400B257C37600B35FC34300D302237CFE40CA6F
:200080009C00782FAECA97004F7DE60179C29500B257C39700B35FAF77C37900780747D21C
:2000A00022007AB3CACC00EBF91100200600210000390E10AF29DABA002F1213AF12130D27
:2000C000C2B40005C2AE00D302C3C7003100242100001100000E04AFD30286234779BC781C
:2000E000C2D800E521200119BE3E40CAF300212501197E2136201977E1130C0C0C0C3E14D2
:20010000B9C2D7002139207E2BB62BB62BB6E6BFCA00001108303E04CD2901D302C31B014D
:2001200000A1C1EE5848484747F57E23D630F2420147137BE61FC23B01141404C23201C36C
:200140002A01E5D53CFE0BFA4C01D606216601010A00093DC25201EB0120003E0AF51A13EE
:200160007709F13DC25D01D1E113F13DC22901C93C7E6666666666667E3C181C181818189D
:2001800018183C3C3C7E66607C3E06067E7E3C7E6660387860667E3C666666667E7E606071
:2001A00060603E3E06063E7E60667E3C3C3E06063E7E66667E3C7E7E60703038181C0C0C73
:2001C0003C7E66663C7E66667E3C3C7E66667E7C60607C3C00000000000000000000183C0D
:2001E0007E6666667E7E66663E7E66663E7E66667E3E3C7E6606060606667E3C3E7E6666DB
:20020000666666667E3E7E7E06063E3E06067E7E7E7E06063E3E060606063C7E66060676C0
:2002200076667E3C666666667E7E666666663C3C1818181818183C3CC0C0C0C0C0C00000FC
:20024000C0C06666763E1E1E3E76666606060606060606067E7EC3C3E7E7FFFFDBC3C3C340
:2002600066666E6E7E7E767666663C7E6666666666667E3C3E7E66667E3E060606060000EE
:20028000080808496B3E1C083E7E66667E3E766666663C7E66063E7C60667E3C7E7E1818B8
:2002A00018181818181866666666666666667E3C66666666667E3C3C1818C3C3C3DBFFFF7E
:2002C000E7E7C3C30018180000000018180066667E3C1818181818187E7E6070381C0E0620
:2002E0007E7EAFCD020377CD1E06CD4103215520CD6209CDBE04CD9B04CD5304E1D1C1F1B7
:20030000FBC9212F20BEC0E1C3FC023E10CD020377CD1E06CDA205CDF9053A30203DC23801
:20032000033A2020A7CAFC02213320343A1320BEC2FC023600CD320A214420CD6209C3FC83
:20034000022135207EA7C047210A2035C25703363C210B20CD6903210C20CD690323CD6987
:200360000323CD6903323520C97EA7CA730335C2730337781747C93E10CDEE0821640D2261
:20038000022021FFFF220420220620FB218B03E5D3022A02207CB5CAAA03AF320B20320CEC
:2003A000202200202100002202202A00207EA7CACA0323220020EB21EE0B3DFE11D277036E
:2003C000874F0600097E23666FE93A1F20A7CCD403C90000CD0304AF321C20CDE806CDF5DF
:2003E00006CD0E07D3027BA7CAF103CD8007C3E1033A1D20A7CAD403CD0D08DAE1033C3298
:200400001F20C9116620061A0E181AE6F012130DC20A0405C20804C9C9CD3D04AF2115208D
:20042000060D772305C222042123207E2377237E23772140204E234623712370C9116620AC
:200440000170031A8787878712130DC2430405C24304C93A1E20A7C00601214520115620ED
:200460001AD610CA6B04047ED6E6C0772B77EB772B77320D2078320C20321E202131201100
:200480001A203DCA880413237E3C277712212E207EC69927FAAC0877C3AC08DB0047DB00E3
:2004A000B8C0115520CDB5043A30203DC8780F0F0F0F114420E60F4F1AE6F0B112C92135EA
:2004C000207EA7C836001FF5DCDB04F11FF5DC1405F11FDC93051FDC9B05C921292035C2C7
:2004E00000053E01320D2032202021100C11A03E3E0ACD290121AD0C11A33E3E04C3290181
:200500003E3C320E207EF630213620773E0111AB3EC329013E3C320D203A2C20A7CA540520
:20052000212B207EC6992777F24B0536592B35F24B0521640D220220210B200605AF7723EB
:2005400005C23E05324420325520C921B83E112A20CD6D052119207E3C2777FE60C267059C
:2005600036002B7E3C277721A83E111820013620CD34063E580203CD3406EB213620E5CD5E
:200580008C0523CD8C05E13E05C329017EFE30C03640C92A002023220020C92A082022029F
:2005A00020C9212820DB014FE60847AEC87078A7C8D30121142034791F1F1F1FE601BEF0D5
:2005C00036002127203479E620CAD4053479E610CAD405343A2D20A7C0212720AFBEC835ED
:2005E0003E03322E20322D2021270E22022021F10C11A33E3E04C329011134201AA7C8DB19
:200600000147215F0EE6013E01C2150621310F78E6023E02C8323020220220AF12C9214483
:2006200020E5CDAF06215520E5CDAF06E1CD4806E1C348061A1F1F1F1FE60FC63002031AA8
:2006400013E60FC6300203C93A2F20AEE610C07EA7F0F62047E640C25C06060070235E230B
:2006600056237BE607321520CDD6064E23462373237223EB3E05F57E12130A03CD9706B691
:2006800077237E1213AFCD9706B677D5111F0019D1F13DC27606C9E52A16206C6722162043
:2006A0003A1520A7CAAC06293DC2A7067CE1C93A2F20AEE610C07EE620C8010500095E23E4
:2006C0005623EB0E051A1377231A1377790E1F094F0DC2C506C90603AF7A1F577B1F5F0531
:2006E000C2D8067AC62457C93A0A20F5CD1909F13DC2EB06C91E18CD0309322520324020CC
:200700004FAF32412047CD40097EF60977C9160078FE00CA240705CD4009047E0FDA2407FC
:200720007AF601573E19B8C23C073A1D20B7C24A073A1C20FE46DA4A07C3460704CD40098D
:20074000057E0FDA4A077AF6025779FE00CA5E070DCD40090C7E0FDA5E077AF604573E1752
:20076000B9CA72070CCD40090D7E0FDA72077AF608571E007AB71FD27B071CB7C27607C902
:200780003A1D20A7C28B07211C20343E01322220CD03095F7A1C1D0FD29F07CAB1071D0F83
:2007A000D2A707CABA071D0FD2F307CAE807C3F30705CD40091605C30408CD40091604CDBE
:2007C00004083E19B8CAD10704CD40091601C304083A1D20A7C2E1073E08321D2079322311
:2007E0002006193A23204FC90DCD40091603C304080000CD40091602CD04080CCD400916DB
:00000001FF

View File

@ -0,0 +1,55 @@
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY altera_mf;
USE altera_mf.altera_mf_components.all;
ENTITY spram IS
generic (
addr_width_g : integer := 8;
data_width_g : integer := 8
);
PORT
(
address : IN STD_LOGIC_VECTOR (addr_width_g-1 DOWNTO 0);
clken : IN STD_LOGIC := '1';
clock : IN STD_LOGIC := '1';
data : IN STD_LOGIC_VECTOR (data_width_g-1 DOWNTO 0);
wren : IN STD_LOGIC ;
q : OUT STD_LOGIC_VECTOR (data_width_g-1 DOWNTO 0)
);
END spram;
ARCHITECTURE SYN OF spram IS
BEGIN
altsyncram_component : altsyncram
GENERIC MAP (
clock_enable_input_a => "NORMAL",
clock_enable_output_a => "BYPASS",
intended_device_family => "Cyclone III",
lpm_hint => "ENABLE_RUNTIME_MOD=NO",
lpm_type => "altsyncram",
numwords_a => 2**addr_width_g,
operation_mode => "SINGLE_PORT",
outdata_aclr_a => "NONE",
outdata_reg_a => "UNREGISTERED",
power_up_uninitialized => "FALSE",
read_during_write_mode_port_a => "NEW_DATA_NO_NBE_READ",
widthad_a => addr_width_g,
width_a => data_width_g,
width_byteena_a => 1
)
PORT MAP (
address_a => address,
clock0 => clock,
clocken0 => clken,
data_a => data,
wren_a => wren,
q_a => q
);
END SYN;

View File

@ -0,0 +1,82 @@
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY altera_mf;
USE altera_mf.all;
ENTITY sprom IS
GENERIC
(
init_file : string := "";
widthad_a : natural;
width_a : natural := 8;
outdata_reg_a : string := "UNREGISTERED"
);
PORT
(
address : IN STD_LOGIC_VECTOR (widthad_a-1 DOWNTO 0);
clock : IN STD_LOGIC ;
q : OUT STD_LOGIC_VECTOR (width_a-1 DOWNTO 0)
);
END sprom;
ARCHITECTURE SYN OF sprom IS
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (width_a-1 DOWNTO 0);
COMPONENT altsyncram
GENERIC (
address_aclr_a : STRING;
clock_enable_input_a : STRING;
clock_enable_output_a : STRING;
init_file : STRING;
intended_device_family : STRING;
lpm_hint : STRING;
lpm_type : STRING;
numwords_a : NATURAL;
operation_mode : STRING;
outdata_aclr_a : STRING;
outdata_reg_a : STRING;
widthad_a : NATURAL;
width_a : NATURAL;
width_byteena_a : NATURAL
);
PORT (
clock0 : IN STD_LOGIC ;
address_a : IN STD_LOGIC_VECTOR (widthad_a-1 DOWNTO 0);
q_a : OUT STD_LOGIC_VECTOR (width_a-1 DOWNTO 0)
);
END COMPONENT;
BEGIN
q <= sub_wire0(width_a-1 DOWNTO 0);
altsyncram_component : altsyncram
GENERIC MAP (
address_aclr_a => "NONE",
clock_enable_input_a => "BYPASS",
clock_enable_output_a => "BYPASS",
init_file => init_file,
intended_device_family => "Cyclone III",
lpm_hint => "ENABLE_RUNTIME_MOD=NO",
lpm_type => "altsyncram",
numwords_a => 2**widthad_a,
operation_mode => "ROM",
outdata_aclr_a => "NONE",
outdata_reg_a => outdata_reg_a,
widthad_a => widthad_a,
width_a => width_a,
width_byteena_a => 1
)
PORT MAP (
clock0 => clock,
address_a => address,
q_a => sub_wire0
);
END SYN;

View File

@ -44,10 +44,10 @@ pll pll
.c1(clk_vid)
);
wire [31:0] status;
wire [63:0] status;
wire [1:0] buttons;
wire [1:0] switches;
wire [7:0] joystick_0,joystick_1;
wire [31:0] joystick_0,joystick_1;
wire scandoublerD;
wire ypbpr;
wire no_csync;
@ -72,6 +72,10 @@ wire Video;
wire HSync;
wire VSync;
wire [7:0] GDB0;
wire [7:0] GDB1;
wire [7:0] GDB2;
invaderst invaderst(
.Rst_n(~(status[0] | buttons[1])),
.Clk(clk_sys),
@ -198,4 +202,4 @@ arcade_inputs inputs (
.player2 ( {m_fire2F, m_fire2E, m_fire2D, m_fire2C, m_fire2B, m_fire2A, m_up2, m_down2, m_left2, m_right2} )
);
endmodule
endmodule