1
0
mirror of https://github.com/Gehstock/Mist_FPGA.git synced 2026-01-13 23:26:43 +00:00

Some Changes

This commit is contained in:
Gehstock 2019-02-09 15:36:17 +01:00
parent 20ff9d3d14
commit 2aeee7f0b1
144 changed files with 6636 additions and 7999 deletions

View File

@ -14,5 +14,4 @@
-- Joystick support.
--
--
---------------------------------------------------------------------------------
todo: Fix Controls
----------------------------------------------------------------

View File

@ -217,33 +217,78 @@ end process;
-- Program ROMs
A1: entity work.prog_rom1
A1: entity work.sprom
generic map(
init_file => "rtl/roms/6290-01b1.hex",
widthad_a => 11,
width_a => 8)
port map(
clock => clk6,
address => A(10) & ADR(9 downto 0),
q => rom1_dout
);
C1: entity work.prog_rom2
--A1: entity work.prog_rom1
--port map(
-- clock => clk6,
-- address => A(10) & ADR(9 downto 0),
-- q => rom1_dout
-- );
C1: entity work.sprom
generic map(
init_file => "rtl/roms/6291-01c1.hex",
widthad_a => 11,
width_a => 8)
port map(
clock => clk6,
address => A(10) & ADR(9 downto 0),
q => rom2_dout
);
--C1: entity work.prog_rom2
--port map(
-- clock => clk6,
-- address => A(10) & ADR(9 downto 0),
-- q => rom2_dout
-- );
D1: entity work.prog_rom3
D1: entity work.sprom
generic map(
init_file => "rtl/roms/6404d1.hex",
widthad_a => 11,
width_a => 8)
port map(
clock => clk6,
address => A(10) & ADR(9 downto 0),
q => rom3_dout
);
E1: entity work.prog_rom4
--D1: entity work.prog_rom3
--port map(
-- clock => clk6,
-- address => A(10) & ADR(9 downto 0),
-- q => rom3_dout
-- );
E1: entity work.sprom
generic map(
init_file => "rtl/roms/6405-02e1.hex",
widthad_a => 11,
width_a => 8)
port map(
clock => clk6,
address => A(10) & ADR(9 downto 0),
q => rom4_dout
);
--E1: entity work.prog_rom4
--port map(
-- clock => clk6,
-- address => A(10) & ADR(9 downto 0),
-- q => rom4_dout
-- );
-- ROM data mux
ROM_mux_in <= (ROM1 & ROM2 & ROM3 & ROM4);
@ -302,12 +347,24 @@ end process;
-- Original circuit uses a bipolar PROM in the address decoder, this could be replaced with combinational logic
-- E2 PROM
E2: entity work.addec_prom
K6: entity work.sprom
generic map(
init_file => "rtl/roms/6401-01e2.hex",
widthad_a => 5,
width_a => 8)
port map(
clock => clk12,
clock => clk12,
address => A(13 downto 9),
q => addec_bus
);
--E2: entity work.addec_prom
--port map(
-- clock => clk12,
-- address => A(13 downto 9),
-- q => addec_bus
-- );
F2_in <= addec_bus(0) & addec_bus(1) & addec_bus(2) & addec_bus(3);
WRAM <= addec_bus(4);

View File

@ -3,7 +3,7 @@
//
// MSBI is the highest bit number. NOT amount of bits!
//
module dac #(parameter MSBI=6, parameter INV=1'b1)
module dac #(parameter MSBI=15, parameter INV=1'b1)
(
output reg DACout, //Average Output feeding analog lowpass
input [MSBI:0] DACin, //DAC input (excess 2**MSBI)

View File

@ -0,0 +1,94 @@
//============================================================================
// gearshift
//
// Turn gearup and geardown buttons into state that can flip the correct switches
// for sprint
//
//
// Copyright (c) 2019 Alan Steremberg - alanswx
//
//
//============================================================================
module gearshift
(
input CLK,
input gearup,
input geardown,
output gear1,
output gear2,
output gear3
);
reg [2:0] gear=3'b0;
always @(posedge CLK) begin
reg old_gear_up;
reg old_gear_down;
if (gearup==1)
begin
if (old_gear_up==0)
begin
old_gear_up=1;
if (gear<4)
begin
gear=gear+1;
end
end
end
else
begin
old_gear_up=0;
end
if (geardown==1)
begin
if (old_gear_down==0)
begin
old_gear_down=1;
if (gear>0)
begin
gear=gear-1;
end
end
end
else
begin
old_gear_up=0;
end
casex(gear)
3'b000:
begin
gear1=0;
gear2=1;
gear3=1;
end
3'b001:
begin
gear1=1;
gear2=0;
gear3=1;
end
3'b010:
begin
gear1=1;
gear2=1;
gear3=0;
end
3'b011:
begin
gear1=1;
gear2=1;
gear3=1;
end
endcase
end
endmodule

View File

@ -0,0 +1,100 @@
//============================================================================
// joy2quad
//
// Take in digital joystick buttons, and try to estimate a quadrature encoder
//
//
// This makes an offset wave pattern for each keyboard stroke. It might
// be a good extension to change the size of the wave based on how long the joystick
// is held down.
//
// Copyright (c) 2019 Alan Steremberg - alanswx
//
//
//============================================================================
// digital joystick button to quadrature encoder
module joy2quad
(
input CLK,
input [31:0] clkdiv,
input right,
input left,
output reg [1:0] steer
);
reg [3:0] state = 0;
always @(posedge CLK) begin
reg [31:0] count = 0;
if (count >0)
begin
count=count-1;
end
else
begin
count=clkdiv;
casex(state)
4'b0000:
begin
steer=2'b00;
if (left==1)
begin
state=4'b0001;
end
if (right==1)
begin
state=4'b0101;
end
end
4'b0001:
begin
steer=2'b00;
state=4'b0010;
end
4'b0010:
begin
steer=2'b01;
state=3'b0011;
end
4'b0011:
begin
steer=2'b11;
state=4'b0100;
end
4'b0100:
begin
steer=2'b10;
state=4'b000;
end
4'b0101:
begin
steer=2'b00;
state=4'b0110;
end
4'b0110:
begin
steer=2'b10;
state=4'b0111;
end
4'b0111:
begin
steer=2'b11;
state=4'b1000;
end
4'b1000:
begin
steer=2'b01;
state=4'b0000;
end
endcase
end
end
endmodule

View File

@ -123,19 +123,42 @@ end process;
-- Motion object PROMs - These contain the car images for all 32 possible orientations
J6: entity work.j6_prom
J6: entity work.sprom
generic map(
init_file => "rtl/roms/6399-01j6.hex",
widthad_a => 9,
width_a => 4)
port map(
clock => clk6,
address => Display(7 downto 3) & L5_reg(2 downto 0) & phi2,
q => Vid(7 downto 4)
);
clock => clk6,
address => Display(7 downto 3) & L5_reg(2 downto 0) & phi2,
q => Vid(7 downto 4)
);
--J6: entity work.j6_prom
--port map(
-- clock => clk6,
-- address => Display(7 downto 3) & L5_reg(2 downto 0) & phi2,
-- q => Vid(7 downto 4)
-- );
K6: entity work.k6_prom
K6: entity work.sprom
generic map(
init_file => "rtl/roms/6398-01k6.hex",
widthad_a => 9,
width_a => 4)
port map(
clock => clk6,
address => Display(7 downto 3) & L5_reg(2 downto 0) & phi2,
q => Vid(3 downto 0)
);
clock => clk6,
address => Display(7 downto 3) & L5_reg(2 downto 0) & phi2,
q => Vid(3 downto 0)
);
--K6: entity work.k6_prom
--port map(
-- clock => clk6,
-- address => Display(7 downto 3) & L5_reg(2 downto 0) & phi2,
-- q => Vid(3 downto 0)
-- );
-- Some glue logic

View File

@ -93,19 +93,42 @@ P3_6 <= (HBlank or VBlank);
char_addr <= display(5 downto 0) & V4 & V2 & V1;
-- Background character ROMs
R4: entity work.Char_MSB
R4: entity work.sprom
generic map(
init_file => "rtl/roms/6397-01r4.hex",
widthad_a => 9,
width_a => 4)
port map(
clock => clk6,
Address => char_addr,
q => char_data(3 downto 0)
);
clock => clk6,
Address => char_addr,
q => char_data(3 downto 0)
);
--R4: entity work.Char_MSB
--port map(
-- clock => clk6,
-- Address => char_addr,
-- q => char_data(3 downto 0)
-- );
P4: entity work.Char_LSB
P4: entity work.sprom
generic map(
init_file => "rtl/roms/6396-01p4.hex",
widthad_a => 9,
width_a => 4)
port map(
clock => clk6,
Address => char_addr,
q => char_data(7 downto 4)
);
clock => clk6,
Address => char_addr,
q => char_data(7 downto 4)
);
--P4: entity work.Char_LSB
--port map(
-- clock => clk6,
-- Address => char_addr,
-- q => char_data(7 downto 4)
-- );
-- 74LS166 video shift register

View File

@ -243,7 +243,7 @@ endmodule
// 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: PHASE_SHIFT_UNIT2 STRING "ps"
// Retrieval info: PRIVATE: PHASE_SHIFT_UNIT2 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"

View File

@ -1,3 +0,0 @@
set_global_assignment -name IP_TOOL_NAME "ROM: 1-PORT"
set_global_assignment -name IP_TOOL_VERSION "13.1"
set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "Char_LSB.vhd"]

View File

@ -1,141 +0,0 @@
-- megafunction wizard: %ROM: 1-PORT%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altsyncram
-- ============================================================
-- File Name: Char_LSB.vhd
-- Megafunction Name(s):
-- altsyncram
--
-- 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 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.altera_mf_components.all;
ENTITY Char_LSB IS
PORT
(
address : IN STD_LOGIC_VECTOR (8 DOWNTO 0);
clock : IN STD_LOGIC := '1';
q : OUT STD_LOGIC_VECTOR (3 DOWNTO 0)
);
END Char_LSB;
ARCHITECTURE SYN OF char_lsb IS
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (3 DOWNTO 0);
BEGIN
q <= sub_wire0(3 DOWNTO 0);
altsyncram_component : altsyncram
GENERIC MAP (
clock_enable_input_a => "BYPASS",
clock_enable_output_a => "BYPASS",
init_file => "./rtl/roms/6396-01p4.hex",
intended_device_family => "Cyclone II",
lpm_hint => "ENABLE_RUNTIME_MOD=NO",
lpm_type => "altsyncram",
numwords_a => 512,
operation_mode => "ROM",
outdata_aclr_a => "NONE",
outdata_reg_a => "CLOCK0",
widthad_a => 9,
width_a => 4,
width_byteena_a => 1
)
PORT MAP (
address_a => address,
clock0 => clock,
q_a => sub_wire0
);
END SYN;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
-- Retrieval info: PRIVATE: AclrAddr NUMERIC "0"
-- Retrieval info: PRIVATE: AclrByte NUMERIC "0"
-- Retrieval info: PRIVATE: AclrOutput NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_ENABLE NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
-- Retrieval info: PRIVATE: BlankMemory NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: Clken NUMERIC "0"
-- Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
-- Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_A"
-- Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
-- Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
-- Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
-- Retrieval info: PRIVATE: MIFfilename STRING "./rtl/roms/6396-01p4.hex"
-- Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "512"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: RegAddr NUMERIC "1"
-- Retrieval info: PRIVATE: RegOutput NUMERIC "1"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: SingleClock NUMERIC "1"
-- Retrieval info: PRIVATE: UseDQRAM NUMERIC "0"
-- Retrieval info: PRIVATE: WidthAddr NUMERIC "9"
-- Retrieval info: PRIVATE: WidthData NUMERIC "4"
-- Retrieval info: PRIVATE: rden NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: INIT_FILE STRING "./rtl/roms/6396-01p4.hex"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
-- Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "512"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "ROM"
-- Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE"
-- Retrieval info: CONSTANT: OUTDATA_REG_A STRING "CLOCK0"
-- Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "9"
-- Retrieval info: CONSTANT: WIDTH_A NUMERIC "4"
-- Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
-- Retrieval info: USED_PORT: address 0 0 9 0 INPUT NODEFVAL "address[8..0]"
-- Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC "clock"
-- Retrieval info: USED_PORT: q 0 0 4 0 OUTPUT NODEFVAL "q[3..0]"
-- Retrieval info: CONNECT: @address_a 0 0 9 0 address 0 0 9 0
-- Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0
-- Retrieval info: CONNECT: q 0 0 4 0 @q_a 0 0 4 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL Char_LSB.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL Char_LSB.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL Char_LSB.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL Char_LSB.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL Char_LSB_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View File

@ -1,3 +0,0 @@
set_global_assignment -name IP_TOOL_NAME "ROM: 1-PORT"
set_global_assignment -name IP_TOOL_VERSION "13.1"
set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "Char_MSB.vhd"]

View File

@ -1,141 +0,0 @@
-- megafunction wizard: %ROM: 1-PORT%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altsyncram
-- ============================================================
-- File Name: Char_MSB.vhd
-- Megafunction Name(s):
-- altsyncram
--
-- 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 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.altera_mf_components.all;
ENTITY Char_MSB IS
PORT
(
address : IN STD_LOGIC_VECTOR (8 DOWNTO 0);
clock : IN STD_LOGIC := '1';
q : OUT STD_LOGIC_VECTOR (3 DOWNTO 0)
);
END Char_MSB;
ARCHITECTURE SYN OF char_msb IS
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (3 DOWNTO 0);
BEGIN
q <= sub_wire0(3 DOWNTO 0);
altsyncram_component : altsyncram
GENERIC MAP (
clock_enable_input_a => "BYPASS",
clock_enable_output_a => "BYPASS",
init_file => "./rtl/roms/6397-01r4.hex",
intended_device_family => "Cyclone II",
lpm_hint => "ENABLE_RUNTIME_MOD=NO",
lpm_type => "altsyncram",
numwords_a => 512,
operation_mode => "ROM",
outdata_aclr_a => "NONE",
outdata_reg_a => "CLOCK0",
widthad_a => 9,
width_a => 4,
width_byteena_a => 1
)
PORT MAP (
address_a => address,
clock0 => clock,
q_a => sub_wire0
);
END SYN;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
-- Retrieval info: PRIVATE: AclrAddr NUMERIC "0"
-- Retrieval info: PRIVATE: AclrByte NUMERIC "0"
-- Retrieval info: PRIVATE: AclrOutput NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_ENABLE NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
-- Retrieval info: PRIVATE: BlankMemory NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: Clken NUMERIC "0"
-- Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
-- Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_A"
-- Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
-- Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
-- Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
-- Retrieval info: PRIVATE: MIFfilename STRING "./rtl/roms/6397-01r4.hex"
-- Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "512"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: RegAddr NUMERIC "1"
-- Retrieval info: PRIVATE: RegOutput NUMERIC "1"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: SingleClock NUMERIC "1"
-- Retrieval info: PRIVATE: UseDQRAM NUMERIC "0"
-- Retrieval info: PRIVATE: WidthAddr NUMERIC "9"
-- Retrieval info: PRIVATE: WidthData NUMERIC "4"
-- Retrieval info: PRIVATE: rden NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: INIT_FILE STRING "./rtl/roms/6397-01r4.hex"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
-- Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "512"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "ROM"
-- Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE"
-- Retrieval info: CONSTANT: OUTDATA_REG_A STRING "CLOCK0"
-- Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "9"
-- Retrieval info: CONSTANT: WIDTH_A NUMERIC "4"
-- Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
-- Retrieval info: USED_PORT: address 0 0 9 0 INPUT NODEFVAL "address[8..0]"
-- Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC "clock"
-- Retrieval info: USED_PORT: q 0 0 4 0 OUTPUT NODEFVAL "q[3..0]"
-- Retrieval info: CONNECT: @address_a 0 0 9 0 address 0 0 9 0
-- Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0
-- Retrieval info: CONNECT: q 0 0 4 0 @q_a 0 0 4 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL Char_MSB.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL Char_MSB.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL Char_MSB.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL Char_MSB.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL Char_MSB_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View File

@ -1,3 +0,0 @@
set_global_assignment -name IP_TOOL_NAME "ROM: 1-PORT"
set_global_assignment -name IP_TOOL_VERSION "13.1"
set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "addec_prom.vhd"]

View File

@ -1,141 +0,0 @@
-- megafunction wizard: %ROM: 1-PORT%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altsyncram
-- ============================================================
-- File Name: addec_prom.vhd
-- Megafunction Name(s):
-- altsyncram
--
-- 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 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.altera_mf_components.all;
ENTITY addec_prom IS
PORT
(
address : IN STD_LOGIC_VECTOR (4 DOWNTO 0);
clock : IN STD_LOGIC := '1';
q : OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
);
END addec_prom;
ARCHITECTURE SYN OF addec_prom IS
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (7 DOWNTO 0);
BEGIN
q <= sub_wire0(7 DOWNTO 0);
altsyncram_component : altsyncram
GENERIC MAP (
clock_enable_input_a => "BYPASS",
clock_enable_output_a => "BYPASS",
init_file => "./rtl/roms/6401-01e2.hex",
intended_device_family => "Cyclone II",
lpm_hint => "ENABLE_RUNTIME_MOD=NO",
lpm_type => "altsyncram",
numwords_a => 32,
operation_mode => "ROM",
outdata_aclr_a => "NONE",
outdata_reg_a => "UNREGISTERED",
widthad_a => 5,
width_a => 8,
width_byteena_a => 1
)
PORT MAP (
address_a => address,
clock0 => clock,
q_a => sub_wire0
);
END SYN;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
-- Retrieval info: PRIVATE: AclrAddr NUMERIC "0"
-- Retrieval info: PRIVATE: AclrByte NUMERIC "0"
-- Retrieval info: PRIVATE: AclrOutput NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_ENABLE NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
-- Retrieval info: PRIVATE: BlankMemory NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: Clken NUMERIC "0"
-- Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
-- Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_A"
-- Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
-- Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
-- Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
-- Retrieval info: PRIVATE: MIFfilename STRING "./rtl/roms/6401-01e2.hex"
-- Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "32"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: RegAddr NUMERIC "1"
-- Retrieval info: PRIVATE: RegOutput NUMERIC "0"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: SingleClock NUMERIC "1"
-- Retrieval info: PRIVATE: UseDQRAM NUMERIC "0"
-- Retrieval info: PRIVATE: WidthAddr NUMERIC "5"
-- Retrieval info: PRIVATE: WidthData NUMERIC "8"
-- Retrieval info: PRIVATE: rden NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: INIT_FILE STRING "./rtl/roms/6401-01e2.hex"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
-- Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "32"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "ROM"
-- Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE"
-- Retrieval info: CONSTANT: OUTDATA_REG_A STRING "UNREGISTERED"
-- Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "5"
-- Retrieval info: CONSTANT: WIDTH_A NUMERIC "8"
-- Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
-- Retrieval info: USED_PORT: address 0 0 5 0 INPUT NODEFVAL "address[4..0]"
-- Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC "clock"
-- Retrieval info: USED_PORT: q 0 0 8 0 OUTPUT NODEFVAL "q[7..0]"
-- Retrieval info: CONNECT: @address_a 0 0 5 0 address 0 0 5 0
-- Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0
-- Retrieval info: CONNECT: q 0 0 8 0 @q_a 0 0 8 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL addec_prom.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL addec_prom.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL addec_prom.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL addec_prom.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL addec_prom_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View File

@ -1,3 +0,0 @@
set_global_assignment -name IP_TOOL_NAME "ROM: 1-PORT"
set_global_assignment -name IP_TOOL_VERSION "13.1"
set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "j6_prom.vhd"]

View File

@ -1,141 +0,0 @@
-- megafunction wizard: %ROM: 1-PORT%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altsyncram
-- ============================================================
-- File Name: j6_prom.vhd
-- Megafunction Name(s):
-- altsyncram
--
-- 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 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.altera_mf_components.all;
ENTITY j6_prom IS
PORT
(
address : IN STD_LOGIC_VECTOR (8 DOWNTO 0);
clock : IN STD_LOGIC := '1';
q : OUT STD_LOGIC_VECTOR (3 DOWNTO 0)
);
END j6_prom;
ARCHITECTURE SYN OF j6_prom IS
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (3 DOWNTO 0);
BEGIN
q <= sub_wire0(3 DOWNTO 0);
altsyncram_component : altsyncram
GENERIC MAP (
clock_enable_input_a => "BYPASS",
clock_enable_output_a => "BYPASS",
init_file => "./rtl/roms/6399-01j6.hex",
intended_device_family => "Cyclone II",
lpm_hint => "ENABLE_RUNTIME_MOD=NO",
lpm_type => "altsyncram",
numwords_a => 512,
operation_mode => "ROM",
outdata_aclr_a => "NONE",
outdata_reg_a => "CLOCK0",
widthad_a => 9,
width_a => 4,
width_byteena_a => 1
)
PORT MAP (
address_a => address,
clock0 => clock,
q_a => sub_wire0
);
END SYN;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
-- Retrieval info: PRIVATE: AclrAddr NUMERIC "0"
-- Retrieval info: PRIVATE: AclrByte NUMERIC "0"
-- Retrieval info: PRIVATE: AclrOutput NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_ENABLE NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
-- Retrieval info: PRIVATE: BlankMemory NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: Clken NUMERIC "0"
-- Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
-- Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_A"
-- Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
-- Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
-- Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
-- Retrieval info: PRIVATE: MIFfilename STRING "./rtl/roms/6399-01j6.hex"
-- Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "512"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: RegAddr NUMERIC "1"
-- Retrieval info: PRIVATE: RegOutput NUMERIC "1"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: SingleClock NUMERIC "1"
-- Retrieval info: PRIVATE: UseDQRAM NUMERIC "0"
-- Retrieval info: PRIVATE: WidthAddr NUMERIC "9"
-- Retrieval info: PRIVATE: WidthData NUMERIC "4"
-- Retrieval info: PRIVATE: rden NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: INIT_FILE STRING "./rtl/roms/6399-01j6.hex"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
-- Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "512"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "ROM"
-- Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE"
-- Retrieval info: CONSTANT: OUTDATA_REG_A STRING "CLOCK0"
-- Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "9"
-- Retrieval info: CONSTANT: WIDTH_A NUMERIC "4"
-- Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
-- Retrieval info: USED_PORT: address 0 0 9 0 INPUT NODEFVAL "address[8..0]"
-- Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC "clock"
-- Retrieval info: USED_PORT: q 0 0 4 0 OUTPUT NODEFVAL "q[3..0]"
-- Retrieval info: CONNECT: @address_a 0 0 9 0 address 0 0 9 0
-- Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0
-- Retrieval info: CONNECT: q 0 0 4 0 @q_a 0 0 4 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL j6_prom.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL j6_prom.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL j6_prom.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL j6_prom.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL j6_prom_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View File

@ -1,3 +0,0 @@
set_global_assignment -name IP_TOOL_NAME "ROM: 1-PORT"
set_global_assignment -name IP_TOOL_VERSION "13.1"
set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "k6_prom.vhd"]

View File

@ -1,141 +0,0 @@
-- megafunction wizard: %ROM: 1-PORT%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altsyncram
-- ============================================================
-- File Name: k6_prom.vhd
-- Megafunction Name(s):
-- altsyncram
--
-- 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 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.altera_mf_components.all;
ENTITY k6_prom IS
PORT
(
address : IN STD_LOGIC_VECTOR (8 DOWNTO 0);
clock : IN STD_LOGIC := '1';
q : OUT STD_LOGIC_VECTOR (3 DOWNTO 0)
);
END k6_prom;
ARCHITECTURE SYN OF k6_prom IS
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (3 DOWNTO 0);
BEGIN
q <= sub_wire0(3 DOWNTO 0);
altsyncram_component : altsyncram
GENERIC MAP (
clock_enable_input_a => "BYPASS",
clock_enable_output_a => "BYPASS",
init_file => "./rtl/roms/6398-01k6.hex",
intended_device_family => "Cyclone II",
lpm_hint => "ENABLE_RUNTIME_MOD=NO",
lpm_type => "altsyncram",
numwords_a => 512,
operation_mode => "ROM",
outdata_aclr_a => "NONE",
outdata_reg_a => "CLOCK0",
widthad_a => 9,
width_a => 4,
width_byteena_a => 1
)
PORT MAP (
address_a => address,
clock0 => clock,
q_a => sub_wire0
);
END SYN;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
-- Retrieval info: PRIVATE: AclrAddr NUMERIC "0"
-- Retrieval info: PRIVATE: AclrByte NUMERIC "0"
-- Retrieval info: PRIVATE: AclrOutput NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_ENABLE NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
-- Retrieval info: PRIVATE: BlankMemory NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: Clken NUMERIC "0"
-- Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
-- Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_A"
-- Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
-- Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
-- Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
-- Retrieval info: PRIVATE: MIFfilename STRING "./rtl/roms/6398-01k6.hex"
-- Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "512"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: RegAddr NUMERIC "1"
-- Retrieval info: PRIVATE: RegOutput NUMERIC "1"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: SingleClock NUMERIC "1"
-- Retrieval info: PRIVATE: UseDQRAM NUMERIC "0"
-- Retrieval info: PRIVATE: WidthAddr NUMERIC "9"
-- Retrieval info: PRIVATE: WidthData NUMERIC "4"
-- Retrieval info: PRIVATE: rden NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: INIT_FILE STRING "./rtl/roms/6398-01k6.hex"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
-- Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "512"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "ROM"
-- Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE"
-- Retrieval info: CONSTANT: OUTDATA_REG_A STRING "CLOCK0"
-- Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "9"
-- Retrieval info: CONSTANT: WIDTH_A NUMERIC "4"
-- Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
-- Retrieval info: USED_PORT: address 0 0 9 0 INPUT NODEFVAL "address[8..0]"
-- Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC "clock"
-- Retrieval info: USED_PORT: q 0 0 4 0 OUTPUT NODEFVAL "q[3..0]"
-- Retrieval info: CONNECT: @address_a 0 0 9 0 address 0 0 9 0
-- Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0
-- Retrieval info: CONNECT: q 0 0 4 0 @q_a 0 0 4 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL k6_prom.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL k6_prom.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL k6_prom.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL k6_prom.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL k6_prom_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View File

@ -1,3 +0,0 @@
set_global_assignment -name IP_TOOL_NAME "ROM: 1-PORT"
set_global_assignment -name IP_TOOL_VERSION "13.1"
set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "prog_rom1.vhd"]

View File

@ -1,141 +0,0 @@
-- megafunction wizard: %ROM: 1-PORT%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altsyncram
-- ============================================================
-- File Name: prog_rom1.vhd
-- Megafunction Name(s):
-- altsyncram
--
-- 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 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.altera_mf_components.all;
ENTITY prog_rom1 IS
PORT
(
address : IN STD_LOGIC_VECTOR (10 DOWNTO 0);
clock : IN STD_LOGIC := '1';
q : OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
);
END prog_rom1;
ARCHITECTURE SYN OF prog_rom1 IS
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (7 DOWNTO 0);
BEGIN
q <= sub_wire0(7 DOWNTO 0);
altsyncram_component : altsyncram
GENERIC MAP (
clock_enable_input_a => "BYPASS",
clock_enable_output_a => "BYPASS",
init_file => "./rtl/roms/6290-01b1.hex",
intended_device_family => "Cyclone II",
lpm_hint => "ENABLE_RUNTIME_MOD=NO",
lpm_type => "altsyncram",
numwords_a => 2048,
operation_mode => "ROM",
outdata_aclr_a => "NONE",
outdata_reg_a => "CLOCK0",
widthad_a => 11,
width_a => 8,
width_byteena_a => 1
)
PORT MAP (
address_a => address,
clock0 => clock,
q_a => sub_wire0
);
END SYN;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
-- Retrieval info: PRIVATE: AclrAddr NUMERIC "0"
-- Retrieval info: PRIVATE: AclrByte NUMERIC "0"
-- Retrieval info: PRIVATE: AclrOutput NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_ENABLE NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
-- Retrieval info: PRIVATE: BlankMemory NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: Clken NUMERIC "0"
-- Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
-- Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_A"
-- Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
-- Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
-- Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
-- Retrieval info: PRIVATE: MIFfilename STRING "./rtl/roms/6290-01b1.hex"
-- Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "2048"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: RegAddr NUMERIC "1"
-- Retrieval info: PRIVATE: RegOutput NUMERIC "1"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: SingleClock NUMERIC "1"
-- Retrieval info: PRIVATE: UseDQRAM NUMERIC "0"
-- Retrieval info: PRIVATE: WidthAddr NUMERIC "11"
-- Retrieval info: PRIVATE: WidthData NUMERIC "8"
-- Retrieval info: PRIVATE: rden NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: INIT_FILE STRING "./rtl/roms/6290-01b1.hex"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
-- Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "2048"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "ROM"
-- Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE"
-- Retrieval info: CONSTANT: OUTDATA_REG_A STRING "CLOCK0"
-- Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "11"
-- Retrieval info: CONSTANT: WIDTH_A NUMERIC "8"
-- Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
-- Retrieval info: USED_PORT: address 0 0 11 0 INPUT NODEFVAL "address[10..0]"
-- Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC "clock"
-- Retrieval info: USED_PORT: q 0 0 8 0 OUTPUT NODEFVAL "q[7..0]"
-- Retrieval info: CONNECT: @address_a 0 0 11 0 address 0 0 11 0
-- Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0
-- Retrieval info: CONNECT: q 0 0 8 0 @q_a 0 0 8 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom1.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom1.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom1.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom1.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom1_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View File

@ -1,3 +0,0 @@
set_global_assignment -name IP_TOOL_NAME "ROM: 1-PORT"
set_global_assignment -name IP_TOOL_VERSION "13.1"
set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "prog_rom2.vhd"]

View File

@ -1,141 +0,0 @@
-- megafunction wizard: %ROM: 1-PORT%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altsyncram
-- ============================================================
-- File Name: prog_rom2.vhd
-- Megafunction Name(s):
-- altsyncram
--
-- 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 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.altera_mf_components.all;
ENTITY prog_rom2 IS
PORT
(
address : IN STD_LOGIC_VECTOR (10 DOWNTO 0);
clock : IN STD_LOGIC := '1';
q : OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
);
END prog_rom2;
ARCHITECTURE SYN OF prog_rom2 IS
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (7 DOWNTO 0);
BEGIN
q <= sub_wire0(7 DOWNTO 0);
altsyncram_component : altsyncram
GENERIC MAP (
clock_enable_input_a => "BYPASS",
clock_enable_output_a => "BYPASS",
init_file => "./rtl/roms/6291-01c1.hex",
intended_device_family => "Cyclone II",
lpm_hint => "ENABLE_RUNTIME_MOD=NO",
lpm_type => "altsyncram",
numwords_a => 2048,
operation_mode => "ROM",
outdata_aclr_a => "NONE",
outdata_reg_a => "CLOCK0",
widthad_a => 11,
width_a => 8,
width_byteena_a => 1
)
PORT MAP (
address_a => address,
clock0 => clock,
q_a => sub_wire0
);
END SYN;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
-- Retrieval info: PRIVATE: AclrAddr NUMERIC "0"
-- Retrieval info: PRIVATE: AclrByte NUMERIC "0"
-- Retrieval info: PRIVATE: AclrOutput NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_ENABLE NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
-- Retrieval info: PRIVATE: BlankMemory NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: Clken NUMERIC "0"
-- Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
-- Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_A"
-- Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
-- Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
-- Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
-- Retrieval info: PRIVATE: MIFfilename STRING "./rtl/roms/6291-01c1.hex"
-- Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "2048"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: RegAddr NUMERIC "1"
-- Retrieval info: PRIVATE: RegOutput NUMERIC "1"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: SingleClock NUMERIC "1"
-- Retrieval info: PRIVATE: UseDQRAM NUMERIC "0"
-- Retrieval info: PRIVATE: WidthAddr NUMERIC "11"
-- Retrieval info: PRIVATE: WidthData NUMERIC "8"
-- Retrieval info: PRIVATE: rden NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: INIT_FILE STRING "./rtl/roms/6291-01c1.hex"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
-- Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "2048"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "ROM"
-- Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE"
-- Retrieval info: CONSTANT: OUTDATA_REG_A STRING "CLOCK0"
-- Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "11"
-- Retrieval info: CONSTANT: WIDTH_A NUMERIC "8"
-- Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
-- Retrieval info: USED_PORT: address 0 0 11 0 INPUT NODEFVAL "address[10..0]"
-- Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC "clock"
-- Retrieval info: USED_PORT: q 0 0 8 0 OUTPUT NODEFVAL "q[7..0]"
-- Retrieval info: CONNECT: @address_a 0 0 11 0 address 0 0 11 0
-- Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0
-- Retrieval info: CONNECT: q 0 0 8 0 @q_a 0 0 8 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom2.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom2.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom2.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom2.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom2_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View File

@ -1,3 +0,0 @@
set_global_assignment -name IP_TOOL_NAME "ROM: 1-PORT"
set_global_assignment -name IP_TOOL_VERSION "13.1"
set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "prog_rom3.vhd"]

View File

@ -1,141 +0,0 @@
-- megafunction wizard: %ROM: 1-PORT%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altsyncram
-- ============================================================
-- File Name: prog_rom3.vhd
-- Megafunction Name(s):
-- altsyncram
--
-- 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 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.altera_mf_components.all;
ENTITY prog_rom3 IS
PORT
(
address : IN STD_LOGIC_VECTOR (10 DOWNTO 0);
clock : IN STD_LOGIC := '1';
q : OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
);
END prog_rom3;
ARCHITECTURE SYN OF prog_rom3 IS
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (7 DOWNTO 0);
BEGIN
q <= sub_wire0(7 DOWNTO 0);
altsyncram_component : altsyncram
GENERIC MAP (
clock_enable_input_a => "BYPASS",
clock_enable_output_a => "BYPASS",
init_file => "./rtl/roms/6404d1.hex",
intended_device_family => "Cyclone II",
lpm_hint => "ENABLE_RUNTIME_MOD=NO",
lpm_type => "altsyncram",
numwords_a => 2048,
operation_mode => "ROM",
outdata_aclr_a => "NONE",
outdata_reg_a => "CLOCK0",
widthad_a => 11,
width_a => 8,
width_byteena_a => 1
)
PORT MAP (
address_a => address,
clock0 => clock,
q_a => sub_wire0
);
END SYN;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
-- Retrieval info: PRIVATE: AclrAddr NUMERIC "0"
-- Retrieval info: PRIVATE: AclrByte NUMERIC "0"
-- Retrieval info: PRIVATE: AclrOutput NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_ENABLE NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
-- Retrieval info: PRIVATE: BlankMemory NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: Clken NUMERIC "0"
-- Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
-- Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_A"
-- Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
-- Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
-- Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
-- Retrieval info: PRIVATE: MIFfilename STRING "./rtl/roms/6404d1.hex"
-- Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "2048"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: RegAddr NUMERIC "1"
-- Retrieval info: PRIVATE: RegOutput NUMERIC "1"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: SingleClock NUMERIC "1"
-- Retrieval info: PRIVATE: UseDQRAM NUMERIC "0"
-- Retrieval info: PRIVATE: WidthAddr NUMERIC "11"
-- Retrieval info: PRIVATE: WidthData NUMERIC "8"
-- Retrieval info: PRIVATE: rden NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: INIT_FILE STRING "./rtl/roms/6404d1.hex"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
-- Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "2048"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "ROM"
-- Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE"
-- Retrieval info: CONSTANT: OUTDATA_REG_A STRING "CLOCK0"
-- Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "11"
-- Retrieval info: CONSTANT: WIDTH_A NUMERIC "8"
-- Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
-- Retrieval info: USED_PORT: address 0 0 11 0 INPUT NODEFVAL "address[10..0]"
-- Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC "clock"
-- Retrieval info: USED_PORT: q 0 0 8 0 OUTPUT NODEFVAL "q[7..0]"
-- Retrieval info: CONNECT: @address_a 0 0 11 0 address 0 0 11 0
-- Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0
-- Retrieval info: CONNECT: q 0 0 8 0 @q_a 0 0 8 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom3.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom3.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom3.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom3.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom3_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View File

@ -1,3 +0,0 @@
set_global_assignment -name IP_TOOL_NAME "ROM: 1-PORT"
set_global_assignment -name IP_TOOL_VERSION "13.1"
set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "prog_rom4.vhd"]

View File

@ -1,141 +0,0 @@
-- megafunction wizard: %ROM: 1-PORT%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altsyncram
-- ============================================================
-- File Name: prog_rom4.vhd
-- Megafunction Name(s):
-- altsyncram
--
-- 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 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.altera_mf_components.all;
ENTITY prog_rom4 IS
PORT
(
address : IN STD_LOGIC_VECTOR (10 DOWNTO 0);
clock : IN STD_LOGIC := '1';
q : OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
);
END prog_rom4;
ARCHITECTURE SYN OF prog_rom4 IS
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (7 DOWNTO 0);
BEGIN
q <= sub_wire0(7 DOWNTO 0);
altsyncram_component : altsyncram
GENERIC MAP (
clock_enable_input_a => "BYPASS",
clock_enable_output_a => "BYPASS",
init_file => "./rtl/roms/6405-02e1.hex",
intended_device_family => "Cyclone II",
lpm_hint => "ENABLE_RUNTIME_MOD=NO",
lpm_type => "altsyncram",
numwords_a => 2048,
operation_mode => "ROM",
outdata_aclr_a => "NONE",
outdata_reg_a => "CLOCK0",
widthad_a => 11,
width_a => 8,
width_byteena_a => 1
)
PORT MAP (
address_a => address,
clock0 => clock,
q_a => sub_wire0
);
END SYN;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
-- Retrieval info: PRIVATE: AclrAddr NUMERIC "0"
-- Retrieval info: PRIVATE: AclrByte NUMERIC "0"
-- Retrieval info: PRIVATE: AclrOutput NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_ENABLE NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
-- Retrieval info: PRIVATE: BlankMemory NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: Clken NUMERIC "0"
-- Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
-- Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_A"
-- Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
-- Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
-- Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
-- Retrieval info: PRIVATE: MIFfilename STRING "./rtl/roms/6405-02e1.hex"
-- Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "2048"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: RegAddr NUMERIC "1"
-- Retrieval info: PRIVATE: RegOutput NUMERIC "1"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: SingleClock NUMERIC "1"
-- Retrieval info: PRIVATE: UseDQRAM NUMERIC "0"
-- Retrieval info: PRIVATE: WidthAddr NUMERIC "11"
-- Retrieval info: PRIVATE: WidthData NUMERIC "8"
-- Retrieval info: PRIVATE: rden NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: INIT_FILE STRING "./rtl/roms/6405-02e1.hex"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
-- Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "2048"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "ROM"
-- Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE"
-- Retrieval info: CONSTANT: OUTDATA_REG_A STRING "CLOCK0"
-- Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "11"
-- Retrieval info: CONSTANT: WIDTH_A NUMERIC "8"
-- Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
-- Retrieval info: USED_PORT: address 0 0 11 0 INPUT NODEFVAL "address[10..0]"
-- Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC "clock"
-- Retrieval info: USED_PORT: q 0 0 8 0 OUTPUT NODEFVAL "q[7..0]"
-- Retrieval info: CONNECT: @address_a 0 0 11 0 address 0 0 11 0
-- Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0
-- Retrieval info: CONNECT: q 0 0 8 0 @q_a 0 0 8 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom4.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom4.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom4.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom4.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL prog_rom4_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View File

@ -1,3 +0,0 @@
set_global_assignment -name IP_TOOL_NAME "ROM: 1-PORT"
set_global_assignment -name IP_TOOL_VERSION "13.1"
set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "sync_prom.vhd"]

View File

@ -1,141 +0,0 @@
-- megafunction wizard: %ROM: 1-PORT%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altsyncram
-- ============================================================
-- File Name: sync_prom.vhd
-- Megafunction Name(s):
-- altsyncram
--
-- 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 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.altera_mf_components.all;
ENTITY sync_prom IS
PORT
(
address : IN STD_LOGIC_VECTOR (7 DOWNTO 0);
clock : IN STD_LOGIC := '1';
q : OUT STD_LOGIC_VECTOR (3 DOWNTO 0)
);
END sync_prom;
ARCHITECTURE SYN OF sync_prom IS
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (3 DOWNTO 0);
BEGIN
q <= sub_wire0(3 DOWNTO 0);
altsyncram_component : altsyncram
GENERIC MAP (
clock_enable_input_a => "BYPASS",
clock_enable_output_a => "BYPASS",
init_file => "./rtl/roms/6400-01m2.hex",
intended_device_family => "Cyclone II",
lpm_hint => "ENABLE_RUNTIME_MOD=NO",
lpm_type => "altsyncram",
numwords_a => 256,
operation_mode => "ROM",
outdata_aclr_a => "NONE",
outdata_reg_a => "UNREGISTERED",
widthad_a => 8,
width_a => 4,
width_byteena_a => 1
)
PORT MAP (
address_a => address,
clock0 => clock,
q_a => sub_wire0
);
END SYN;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
-- Retrieval info: PRIVATE: AclrAddr NUMERIC "0"
-- Retrieval info: PRIVATE: AclrByte NUMERIC "0"
-- Retrieval info: PRIVATE: AclrOutput NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_ENABLE NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
-- Retrieval info: PRIVATE: BlankMemory NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: Clken NUMERIC "0"
-- Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
-- Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_A"
-- Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
-- Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
-- Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
-- Retrieval info: PRIVATE: MIFfilename STRING "./rtl/roms/6400-01m2.hex"
-- Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "256"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: RegAddr NUMERIC "1"
-- Retrieval info: PRIVATE: RegOutput NUMERIC "0"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: SingleClock NUMERIC "1"
-- Retrieval info: PRIVATE: UseDQRAM NUMERIC "0"
-- Retrieval info: PRIVATE: WidthAddr NUMERIC "8"
-- Retrieval info: PRIVATE: WidthData NUMERIC "4"
-- Retrieval info: PRIVATE: rden NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: INIT_FILE STRING "./rtl/roms/6400-01m2.hex"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
-- Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
-- Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "256"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "ROM"
-- Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE"
-- Retrieval info: CONSTANT: OUTDATA_REG_A STRING "UNREGISTERED"
-- Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "8"
-- Retrieval info: CONSTANT: WIDTH_A NUMERIC "4"
-- Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
-- Retrieval info: USED_PORT: address 0 0 8 0 INPUT NODEFVAL "address[7..0]"
-- Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC "clock"
-- Retrieval info: USED_PORT: q 0 0 4 0 OUTPUT NODEFVAL "q[3..0]"
-- Retrieval info: CONNECT: @address_a 0 0 8 0 address 0 0 8 0
-- Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0
-- Retrieval info: CONNECT: q 0 0 4 0 @q_a 0 0 4 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL sync_prom.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL sync_prom.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL sync_prom.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL sync_prom.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL sync_prom_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View File

@ -1,313 +0,0 @@
-- Top level file for Kee Games Sprint 1
-- (c) 2017 James Sweet
--
-- This is free software: you can redistribute
-- it and/or modify it under the terms of the GNU General
-- Public License as published by the Free Software
-- Foundation, either version 3 of the License, or (at your
-- option) any later version.
--
-- This is distributed in the hope that it will
-- be useful, but WITHOUT ANY WARRANTY; without even the
-- implied warranty of MERCHANTABILITY or FITNESS FOR A
-- PARTICULAR PURPOSE. See the GNU General Public License
-- for more details.
-- Targeted to EP2C5T144C8 mini board but porting to nearly any FPGA should be fairly simple
-- See Sprint 1 manual for video output details. Resistor values listed here have been scaled
-- for 3.3V logic.
-- R48 1k Ohm
-- R49 1k Ohm
-- R50 680R
-- R51 330R
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_ARITH.all;
use IEEE.STD_LOGIC_UNSIGNED.all;
entity sprint1 is
port(
Clk_50_I : in std_logic; -- 50MHz input clock
clk_12 : in std_logic; -- 12MHz input clock
Reset_n : in std_logic; -- Reset button (Active low)
VideoW_O : out std_logic; -- White video output (680 Ohm)
VideoB_O : out std_logic; -- Black video output (1.2k)
Sync_O : out std_logic; -- Composite sync output (1.2k)
Hs : out std_logic;
Vs : out std_logic;
Vb : out std_logic;
Hb : out std_logic;
Video : out std_logic;
Audio : out std_logic_vector(6 downto 0);
Coin1_I : in std_logic; -- Coin switches (Active low)
Coin2_I : in std_logic;
Start_I : in std_logic; -- Start button
Gas_I : in std_logic; -- Gas pedal
Gear1_I : in std_logic; -- Gear shifter, 4th gear = no other gear selected
Gear2_I : in std_logic;
Gear3_I : in std_logic;
Test_I : in std_logic; -- Self-test switch
SteerA_I : in std_logic; -- Steering wheel inputs, these are quadrature encoders
SteerB_I : in std_logic;
StartLamp_O : out std_logic -- Start button lamp
);
end sprint1;
architecture rtl of sprint1 is
signal clk_6 : std_logic;
signal phi1 : std_logic;
signal phi2 : std_logic;
signal Hcount : std_logic_vector(8 downto 0) := (others => '0');
signal H256 : std_logic;
signal H256_s : std_logic;
signal H256_n : std_logic;
signal H128 : std_logic;
signal H64 : std_logic;
signal H32 : std_logic;
signal H16 : std_logic;
signal H8 : std_logic;
signal H8_n : std_logic;
signal H4 : std_logic;
signal H4_n : std_logic;
signal H2 : std_logic;
signal H1 : std_logic;
signal Vcount : std_logic_vector(7 downto 0) := (others => '0');
signal V128 : std_logic;
signal V64 : std_logic;
signal V32 : std_logic;
signal V16 : std_logic;
signal V8 : std_logic;
signal V4 : std_logic;
signal V2 : std_logic;
signal V1 : std_logic;
signal Vreset : std_logic;
signal Vblank_s : std_logic;
signal Vblank_n_s : std_logic;
signal Vblank : std_logic;
signal Hblank : std_logic;
signal Hsync : std_logic;
signal Vsync : std_logic;
signal CompBlank_s : std_logic;
signal CompSync_n_s : std_logic;
signal WhitePF_n : std_logic;
signal BlackPF_n : std_logic;
signal Display : std_logic_vector(7 downto 0);
-- Address decoder
signal addec_bus : std_logic_vector(7 downto 0);
signal RnW : std_logic;
signal Write_n : std_logic;
signal ROM1 : std_logic;
signal ROM2 : std_logic;
signal ROM3 : std_logic;
signal WRAM : std_logic;
signal RAM_n : std_logic;
signal Sync_n : std_logic;
signal Switch_n : std_logic;
signal Collision1_n : std_logic;
signal Collision2_n : std_logic;
signal Display_n : std_logic;
signal TimerReset_n : std_logic;
signal CollRst1_n : std_logic;
signal CollRst2_n : std_logic;
signal SteerRst1_n : std_logic;
signal SteerRst2_n : std_logic;
signal NoiseRst_n : std_logic;
signal Attract : std_logic;
signal Skid1 : std_logic;
signal Skid2 : std_logic;
signal Crash_n : std_logic;
signal Motor1_n : std_logic;
signal Motor2_n : std_logic;
signal Car1 : std_logic;
signal Car1_n : std_logic;
signal Car2 : std_logic;
signal Car2_n : std_logic;
signal Car3_4_n : std_logic;
signal NMI_n : std_logic;
signal Adr : std_logic_vector(9 downto 0);
signal SW1 : std_logic_vector(7 downto 0);
signal Inputs : std_logic_vector(1 downto 0);
signal Collisions1 : std_logic_vector(1 downto 0);
signal Collisions2 : std_logic_vector(1 downto 0);
begin
-- Configuration DIP switches, these can be brought out to external switches if desired
-- See Sprint 2 manual page 11 for complete information. Active low (0 = On, 1 = Off)
-- 1 Oil slicks (0 - Oil slicks enabled)
-- 2 Cycle tracks (0/1 - Cycle every lap/every two laps)
-- 3 4 Coins per play (00 - 1 Coin per player)
-- 5 Extended Play (0 - Extended Play enabled)
-- 6 Not used (X - Don't care)
-- 7 8 Game time (01 - 120 Seconds)
SW1 <= "11000101"; -- Config dip switches
Vid_sync: entity work.synchronizer
port map(
clk_12 => clk_12,
clk_6 => clk_6,
hcount => hcount,
vcount => vcount,
hsync => hsync,
hblank => hblank,
vblank_s => vblank_s,
vblank_n_s => vblank_n_s,
vblank => vblank,
vsync => vsync,
vreset => vreset
);
Background: entity work.playfield
port map(
clk6 => clk_6,
display => display,
HCount => HCount,
VCount => VCount,
HBlank => HBlank,
H256_s => H256_s,
VBlank => VBlank,
VBlank_n_s => Vblank_n_s,
HSync => Hsync,
VSync => VSync,
CompSync_n_s => CompSync_n_s,
CompBlank_s => CompBlank_s,
WhitePF_n => WhitePF_n,
BlackPF_n => BlackPF_n
);
Cars: entity work.motion
port map(
CLK6 => clk_6,
CLK12 => clk_12,
PHI2 => phi2,
DISPLAY => Display,
H256_s => H256_s,
VCount => VCount,
HCount => HCount,
Crash_n => Crash_n,
Motor1_n => Motor1_n,
Car1 => Car1,
Car1_n => Car1_n,
Car2 => Car2,
Car2_n => Car2_n,
Car3_4_n => Car3_4_n
);
PF_Comparator: entity work.collision_detect
port map(
Clk6 => Clk_6,
Car1 => Car1,
Car1_n => Car1_n,
Car2 => Car2,
Car2_n => Car2_n,
Car3_4_n => Car3_4_n,
WhitePF_n => WhitePF_n,
BlackPF_n => BlackPF_n,
CollRst1_n => CollRst1_n,
Collisions1 => Collisions1
);
CPU: entity work.cpu_mem
port map(
Clk12 => clk_12,
Clk6 => clk_6,
Reset_n => reset_n,
VCount => VCount,
HCount => HCount,
Hsync_n => not Hsync,
Vblank_s => Vblank_s,
Vreset => Vreset,
Test_n => not Test_I,
Attract => Attract,
Skid1 => Skid1,
Skid2 => Skid2,
NoiseReset_n => NoiseRst_n,
CollRst1_n => CollRst1_n,
CollRst2_n => CollRst2_n,
SteerRst1_n => SteerRst1_n,
Lamp1 => StartLamp_O,
Phi1_o => Phi1,
Phi2_o => Phi2,
Display => Display,
IO_Adr => Adr,
Collisions1 => Collisions1,
Collisions2 => Collisions2,
Inputs => Inputs
);
Input: entity work.Control_Inputs
port map(
clk6 => clk_6,
SW1 => SW1, -- DIP switches
Coin1_n => Coin1_I,
Coin2_n => Coin2_I,
Start => not Start_I, -- Active high in real hardware, inverting these makes more sense with the FPGA
Gas => not Gas_I,
Gear1 => not Gear1_I,
Gear2 => not Gear2_I,
Gear3 => not Gear3_I,
Self_Test => not Test_I,
Steering1A_n => SteerA_I,
Steering1B_n => SteerB_I,
SteerRst1_n => SteerRst1_n,
Adr => Adr,
Inputs => Inputs
);
Sound: entity work.audio
port map(
Clk_50 => Clk_50_I,
Clk_6 => Clk_6,
Reset_n => Reset_n,
Motor1_n => Motor1_n,
Skid1 => Skid1,
Crash_n => Crash_n,
NoiseReset_n => NoiseRst_n,
Attract => Attract,
Display => Display,
HCount => HCount,
VCount => VCount,
Audio1 => Audio
);
-- Video mixing
VideoB_O <= (not(BlackPF_n and Car2_n and Car3_4_n)) nor CompBlank_s;
VideoW_O <= not(WhitePF_n and Car1_n);
Sync_O <= CompSync_n_s;
Vb <= VBLANK;
Hb <= HBLANK;
Hs <= Hsync;
Vs <= Vsync;
Video <= (WhitePF_n and blackpf_n and car1_n and Car2_n and Car3_4_n) nor CompBlank_s;
end rtl;

View File

@ -31,16 +31,14 @@ entity sprint2 is
port(
clk_12 : in std_logic; -- 12MHz input clock
Reset_n : in std_logic; -- Reset button (Active low)
Video : out std_logic_vector(1 downto 0);
Video : out std_logic_vector(1 downto 0);
Sync_O : out std_logic; -- Composite sync output (1.2k)
Audio1_O : out std_logic_vector(6 downto 0); -- Ideally this should have a simple low pass filter
Audio2_O : out std_logic_vector(6 downto 0);
Audio2_O : out std_logic_vector(6 downto 0);
Hs : out std_logic;
Vs : out std_logic;
Vb : out std_logic;
Hb : out std_logic;
Coin1_I : in std_logic; -- Coin switches (Active low)
Coin2_I : in std_logic;
Start1_I : in std_logic; -- Start buttons
@ -322,16 +320,12 @@ port map(
);
-- Video mixing
--VideoB_O <= (not(BlackPF_n and Car2_n and Car3_4_n)) nor CompBlank_s;
--VideoW_O <= not(WhitePF_n and Car1_n and Car3_4_n);
Video(0) <= (not(BlackPF_n and Car2_n and Car3_4_n)) nor CompBlank_s;
Video(1) <= not(WhitePF_n and Car1_n and Car3_4_n);
Sync_O <= CompSync_n_s;
Vb <= VBLANK;
Hb <= HBLANK;
Hs <= Hsync;
Vs <= Vsync;
Video(0) <= (not(BlackPF_n and Car2_n and Car3_4_n)) nor CompBlank_s;
Video(1) <= not(WhitePF_n and Car1_n and Car3_4_n);
end rtl;

View File

@ -21,91 +21,141 @@ module sprint2_mist(
localparam CONF_STR = {
"Sprint2;;",
"O1,Test Mode,Off,On;",
// "T2,Next Track;",
"T2,Next Track;",
"O34,Scandoubler Fx,None,HQ2x,CRT 25%,CRT 50%;",
"T6,Reset;",
"V,v1.00.",`BUILD_DATE
"V,v1.10.",`BUILD_DATE
};
wire [31:0] status;
wire [1:0] buttons;
wire [1:0] switches;
wire [9:0] kbjoy;
wire [11:0] kbjoy;
wire [7:0] joystick_0;
wire [7:0] joystick_1;
wire scandoubler_disable;
wire ypbpr;
wire ps2_kbd_clk, ps2_kbd_data;
wire [6:0] audio1, audio2;
wire [1:0] video;
wire [1:0] Video;
assign LED = 1'b1;
wire clk_24, clk_12, clk_6;
wire locked;
pll pll
(
.inclk0(CLOCK_27),
.c0(clk_24),
.c1(clk_12),
.c2(clk_6),
.c0(clk_24),//24.192
.c1(clk_12),//12.096
.c2(clk_6),//6.048
.locked(locked)
);
wire led1, led2;
assign LED = (led1 | led2);
wire m_up1 = (kbjoy[3] | joystick_1[3]);
wire m_down1 = (kbjoy[2] | joystick_1[2]);
wire m_left1 = (kbjoy[1] | joystick_1[1]);
wire m_right1 = (kbjoy[0] | joystick_1[0]);
wire m_up2 = (joystick_0[3]);
wire m_down2 = (joystick_0[2]);
wire m_left2 = (joystick_0[1]);
wire m_right2 = (joystick_0[0]);
wire m_fire1 = ~(kbjoy[4] | joystick_1[4]);
wire m_fire2 = ~(joystick_0[4]);
wire m_start1 = ~(kbjoy[5]);
wire m_start2 = ~(kbjoy[6]);
wire m_coin = ~(kbjoy[7]);
wire m_gearup1 = (kbjoy[8] | joystick_1[5]);
wire m_geardown1 = (kbjoy[9] | joystick_1[6]);
wire m_gearup2 = (joystick_0[5]);
wire m_geardown2 = (joystick_0[6]);
wire [1:0] steer1;
joy2quad steerp1
(
.CLK(clk_24),
.clkdiv('d22500),
.right(m_right1),
.left(m_left1),
.steer(steer1)
);
wire [1:0] steer2;
joy2quad steerp2
(
.CLK(clk_24),
.clkdiv('d22500),
.right(m_right2),
.left(m_left2),
.steer(steer2)
);
wire gear11,gear12,gear13;
gearshift gearshiftp1
(
.CLK(clk_12),
.gearup(m_gearup1),
.geardown(m_geardown1),
.gear1(gear11),
.gear2(gear12),
.gear3(gear13)
);
wire gear21,gear22,gear23;
gearshift gearshiftp2
(
.CLK(clk_12),
.gearup(m_gearup2),
.geardown(m_geardown2),
.gear1(gear21),
.gear2(gear22),
.gear3(gear23)
);
sprint2 sprint2 (
.clk_12(clk_12),
.Reset_n(~(status[0] | status[6] | buttons[1])),
.VideoW_O(),
.VideoB_O(),
.Sync_O(),
.Reset_n(~(status[0] | status[6] | buttons[1])),
.Hs(hs),
.Vs(vs),
.Vb(vb),
.Hb(hb),
.Video(video),
.Video(Video),
.Audio1_O(audio1),
.Audio2_O(audio2),
.Coin1_I(~kbjoy[7]),
.Coin2_I(~kbjoy[7]),
.Coin2_I(1'b1),
.Start1_I(~kbjoy[5]),
.Start2_I(~kbjoy[6]),
.Trak_Sel_I(),//~status[2]),
.Gas1_I(~kbjoy[4]),
.Gas2_I(),
// .Gear1_1_I(),// Gear shifters, 4th gear = no other gear selected
// .Gear1_2_I(),
// .Gear1_3_I(),
// .Gear2_1_I(),
// .Gear2_2_I(),
// .Gear2_3_I(),
.Trak_Sel_I(~status[2]),
.Gas1_I(m_fire1),
.Gas2_I(m_fire2),
.Gear1_1_I(gear11),
.Gear1_2_I(gear21),
.Gear2_1_I(gear12),
.Gear2_2_I(gear22),
.Gear3_1_I(gear13),
.Gear3_2_I(gear23),
.Test_I(~status[1]),
.Steer_1A_I(~kbjoy[1]),// Steering wheel inputs, these are quadrature encoders
.Steer_1B_I(~kbjoy[0]),
// .Steer_2A_I(),
// .Steer_2B_I(),
.Lamp1_O(led1),
.Lamp2_O(led2)
.Steer_1A_I(steer1[1]),
.Steer_1B_I(steer1[0]),
.Steer_2A_I(steer2[1]),
.Steer_2B_I(steer2[0]),
.Lamp1_O(),
.Lamp2_O()
);
dac dac1 (
dac dac (
.CLK(clk_24),
.RESET(1'b0),
.DACin(audio1),
.DACin({audio1,"00",audio2}),
.DACout(AUDIO_L)
);
dac dacr (
.CLK(clk_24),
.RESET(1'b0),
.DACin(audio2),
.DACout(AUDIO_R)
);
assign AUDIO_R = AUDIO_L;
wire hs, vs;
wire hb, vb;
wire blankn = ~(hb | vb);
video_mixer #(.LINE_LENGTH(480), .HALF_DEPTH(1)) video_mixer
video_mixer #(.LINE_LENGTH(480), .HALF_DEPTH(0)) video_mixer
(
.clk_sys(clk_24),
.ce_pix(clk_6),
@ -113,12 +163,12 @@ video_mixer #(.LINE_LENGTH(480), .HALF_DEPTH(1)) video_mixer
.SPI_SCK(SPI_SCK),
.SPI_SS3(SPI_SS3),
.SPI_DI(SPI_DI),
.R({video,video,video}),
.G({video,video,video}),
.B({video,video,video}),
// .R(blankn ? {video,video,video} : "000"),
// .G(blankn ? {video,video,video} : "000"),
// .B(blankn ? {video,video,video} : "000"),
.R({Video,Video,Video,Video,Video,Video}),
.G({Video,Video,Video,Video,Video,Video}),
.B({Video,Video,Video,Video,Video,Video}),
// .R(blankn ? {video,video,video} : "000000"),
// .G(blankn ? {video,video,video} : "000000"),
// .B(blankn ? {video,video,video} : "000000"),
.HSync(hs),
.VSync(vs),
.VGA_R(VGA_R),

View File

@ -99,12 +99,24 @@ end process;
-- Many Atari raster games use a 256 x 4 bit prom to decode vertical sync signals
-- This could be replaced by combinatorial logic
M2: entity work.sync_prom
M2: entity work.sprom
generic map(
init_file => "rtl/roms/6400-01m2.hex",
widthad_a => 8,
width_a => 4)
port map(
clock => clk_12,
address => sync_reg(3) & V128 & V64 & V16 & V8 & V4 & V2 & V1,
q => sync_bus
);
--M2: entity work.sync_prom
--port map(
-- clock => clk_12,
-- address => sync_reg(3) & V128 & V64 & V16 & V8 & V4 & V2 & V1,
-- q => sync_bus
-- );
-- Register fed by the sync PROM, in the original hardware this also creates the complements of these signals
sync_register: process(hsync_int)

View File

@ -153,6 +153,8 @@ set_global_assignment -name VHDL_FILE rtl/T65/T65_MCode.vhd
set_global_assignment -name VHDL_FILE rtl/T65/T65_ALU.vhd
set_global_assignment -name VHDL_FILE rtl/T65/T65.vhd
set_global_assignment -name VHDL_FILE rtl/sync.vhd
set_global_assignment -name SYSTEMVERILOG_FILE rtl/joy2quad.sv
set_global_assignment -name SYSTEMVERILOG_FILE rtl/gearshift.sv
set_global_assignment -name VHDL_FILE rtl/playfield.vhd
set_global_assignment -name VHDL_FILE rtl/motion.vhd
set_global_assignment -name VHDL_FILE rtl/collision.vhd
@ -168,16 +170,7 @@ set_global_assignment -name SYSTEMVERILOG_FILE rtl/hq2x.sv
set_global_assignment -name SYSTEMVERILOG_FILE rtl/keyboard.sv
set_global_assignment -name SYSTEMVERILOG_FILE rtl/mist_io.sv
set_global_assignment -name SYSTEMVERILOG_FILE rtl/osd.sv
set_global_assignment -name QIP_FILE rtl/roms/addec_prom.qip
set_global_assignment -name QIP_FILE rtl/roms/Char_LSB.qip
set_global_assignment -name QIP_FILE rtl/roms/Char_MSB.qip
set_global_assignment -name QIP_FILE rtl/roms/j6_prom.qip
set_global_assignment -name QIP_FILE rtl/roms/k6_prom.qip
set_global_assignment -name QIP_FILE rtl/roms/prog_rom1.qip
set_global_assignment -name QIP_FILE rtl/roms/prog_rom2.qip
set_global_assignment -name QIP_FILE rtl/roms/prog_rom3.qip
set_global_assignment -name QIP_FILE rtl/roms/prog_rom4.qip
set_global_assignment -name QIP_FILE rtl/roms/sync_prom.qip
set_global_assignment -name VERILOG_FILE rtl/pll.v
set_global_assignment -name VHDL_FILE rtl/dpram.vhd
set_global_assignment -name VHDL_FILE rtl/sprom.vhd
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top

View File

@ -14,5 +14,4 @@
-- Joystick support.
--
--
---------------------------------------------------------------------------------
todo: Fix Controls
----------------------------------------------------------------

View File

@ -0,0 +1,94 @@
//============================================================================
// gearshift
//
// Turn gearup and geardown buttons into state that can flip the correct switches
// for sprint
//
//
// Copyright (c) 2019 Alan Steremberg - alanswx
//
//
//============================================================================
module gearshift
(
input CLK,
input gearup,
input geardown,
output gear1,
output gear2,
output gear3
);
reg [2:0] gear=3'b0;
always @(posedge CLK) begin
reg old_gear_up;
reg old_gear_down;
if (gearup==1)
begin
if (old_gear_up==0)
begin
old_gear_up=1;
if (gear<4)
begin
gear=gear+1;
end
end
end
else
begin
old_gear_up=0;
end
if (geardown==1)
begin
if (old_gear_down==0)
begin
old_gear_down=1;
if (gear>0)
begin
gear=gear-1;
end
end
end
else
begin
old_gear_up=0;
end
casex(gear)
3'b000:
begin
gear1=0;
gear2=1;
gear3=1;
end
3'b001:
begin
gear1=1;
gear2=0;
gear3=1;
end
3'b010:
begin
gear1=1;
gear2=1;
gear3=0;
end
3'b011:
begin
gear1=1;
gear2=1;
gear3=1;
end
endcase
end
endmodule

View File

@ -0,0 +1,100 @@
//============================================================================
// joy2quad
//
// Take in digital joystick buttons, and try to estimate a quadrature encoder
//
//
// This makes an offset wave pattern for each keyboard stroke. It might
// be a good extension to change the size of the wave based on how long the joystick
// is held down.
//
// Copyright (c) 2019 Alan Steremberg - alanswx
//
//
//============================================================================
// digital joystick button to quadrature encoder
module joy2quad
(
input CLK,
input [31:0] clkdiv,
input right,
input left,
output reg [1:0] steer
);
reg [3:0] state = 0;
always @(posedge CLK) begin
reg [31:0] count = 0;
if (count >0)
begin
count=count-1;
end
else
begin
count=clkdiv;
casex(state)
4'b0000:
begin
steer=2'b00;
if (left==1)
begin
state=4'b0001;
end
if (right==1)
begin
state=4'b0101;
end
end
4'b0001:
begin
steer=2'b00;
state=4'b0010;
end
4'b0010:
begin
steer=2'b01;
state=3'b0011;
end
4'b0011:
begin
steer=2'b11;
state=4'b0100;
end
4'b0100:
begin
steer=2'b10;
state=4'b000;
end
4'b0101:
begin
steer=2'b00;
state=4'b0110;
end
4'b0110:
begin
steer=2'b10;
state=4'b0111;
end
4'b0111:
begin
steer=2'b11;
state=4'b1000;
end
4'b1000:
begin
steer=2'b01;
state=4'b0000;
end
endcase
end
end
endmodule

View File

@ -294,11 +294,9 @@ port map(
Video(0) <= (not(BlackPF_n and Car2_n and Car3_4_n)) nor CompBlank_s;
Video(1) <= not(WhitePF_n and Car1_n);
Sync_O <= CompSync_n_s;
Vb <= VBLANK;
Hb <= HBLANK;
Hs <= Hsync;
Vs <= Vsync;
end rtl;

View File

@ -36,9 +36,9 @@ wire scandoubler_disable;
wire ypbpr;
wire ps2_kbd_clk, ps2_kbd_data;
wire [6:0] audio;
wire [1:0] video;
wire clk_48, clk_12, clk_6;
wire [1:0] Video;
assign LED = 1'b1;
wire clk_24, clk_12, clk_6;
wire locked;
pll pll
(
@ -49,30 +49,47 @@ pll pll
.locked(locked)
);
wire [1:0] steer;
joy2quad steer1
(
.CLK(clk_24),
.clkdiv('d22500),
.right(m_right),
.left(m_left),
.steer(steer)
);
wire gear1,gear2,gear3;
gearshift gearshift1
(
.CLK(clk_12),
.gearup(m_gearup),
.geardown(m_geardown),
.gear1(gear1),
.gear2(gear2),
.gear3(gear3)
);
sprint1 sprint1 (
.clk_12(clk_12),
.Reset_n(~(status[0] | status[6] | buttons[1])),
.VideoW_O(),
.VideoB_O(),
.Sync_O(),
.Video(Video),
.Hs(hs),
.Vs(vs),
.Vb(vb),
.Hb(hb),
.Video(video),
.Hb(hb),
.Audio(audio),
.Coin1_I(~kbjoy[7]),
.Coin2_I(~kbjoy[7]),
.Start_I(~kbjoy[5]),
.Gas_I(~kbjoy[4]),
// .Gear1_I(~kbjoy[8]),
// .Gear2_I(~kbjoy[9]),
// .Gear3_I(~kbjoy[10]),
.Coin1_I(m_coin),
.Coin2_I(1'b1),
.Start_I(m_start1),
.Gas_I(m_fire),
.Gear1_I(gear1),
.Gear2_I(gear2),
.Gear3_I(gear3),
.Test_I(~status[1]),
.SteerA_I(),
.SteerB_I(),
.StartLamp_O(~LED)
.SteerA_I(steer[1]),
.SteerB_I(steer[0]),
.StartLamp_O()
);
dac dac (
@ -95,9 +112,9 @@ video_mixer #(.LINE_LENGTH(480), .HALF_DEPTH(0)) video_mixer
.SPI_SCK(SPI_SCK),
.SPI_SS3(SPI_SS3),
.SPI_DI(SPI_DI),
.R({video,video,video}),
.G({video,video,video}),
.B({video,video,video}),
.R({Video,Video,Video,Video,Video,Video}),
.G({Video,Video,Video,Video,Video,Video}),
.B({Video,Video,Video,Video,Video,Video}),
// .R(blankn ? {video,video,video} : "000000"),
// .G(blankn ? {video,video,video} : "000000"),
// .B(blankn ? {video,video,video} : "000000"),
@ -116,6 +133,17 @@ video_mixer #(.LINE_LENGTH(480), .HALF_DEPTH(0)) video_mixer
.mono(0)
);
wire m_up = (kbjoy[3] | joystick_0[3] | joystick_1[3]);
wire m_down = (kbjoy[2] | joystick_0[2] | joystick_1[2]);
wire m_left = (kbjoy[1] | joystick_0[1] | joystick_1[1]);
wire m_right = (kbjoy[0] | joystick_0[0] | joystick_1[0]);
wire m_fire = ~(kbjoy[4] | joystick_0[4] | joystick_1[4]);
wire m_start1 = ~(kbjoy[5]);
wire m_start2 = ~(kbjoy[6]);
wire m_coin = ~(kbjoy[7]);
wire m_gearup = (kbjoy[8] | joystick_0[5] | joystick_1[5]);
wire m_geardown = (kbjoy[9] | joystick_0[6] | joystick_1[6]);
mist_io #(.STRLEN(($size(CONF_STR)>>3))) mist_io
(
.clk_sys (clk_24 ),

View File

@ -154,6 +154,8 @@ set_global_assignment -name VHDL_FILE rtl/playfield.vhd
set_global_assignment -name VHDL_FILE rtl/EngineSound.vhd
set_global_assignment -name VHDL_FILE rtl/Inputs.vhd
set_global_assignment -name VHDL_FILE rtl/motion.vhd
set_global_assignment -name SYSTEMVERILOG_FILE rtl/gearshift.sv
set_global_assignment -name SYSTEMVERILOG_FILE rtl/joy2quad.sv
set_global_assignment -name SYSTEMVERILOG_FILE rtl/video_mixer.sv
set_global_assignment -name SYSTEMVERILOG_FILE rtl/scandoubler.sv
set_global_assignment -name SYSTEMVERILOG_FILE rtl/osd.sv

View File

@ -0,0 +1,10 @@
{ "" "" "" "Verilog HDL information at scandoubler.sv(102): always construct contains both blocking and non-blocking assignments" { } { } 0 10268 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Verilog HDL warning at hq2x.sv(247): extended using \"x\" or \"z\"" { } { } 0 10273 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "VHDL warning at dpram.vhd(10): ignored assignment of value to null range" { } { } 0 10296 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "VHDL warning at T65.vhd(185): comparison between unequal length operands always returns TRUE" { } { } 0 10620 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "VHDL warning at dpram.vhd(94): ignored assignment of value to null range" { } { } 0 10296 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "VHDL Process Statement warning at audio.vhd(54): inferring latch(es) for signal or variable \"tone_reg\", which holds its previous value in one or more paths through the process" { } { } 0 10631 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "VHDL Process Statement warning at playfield.vhd(128): signal \"shift_data\" is read inside the Process Statement but isn't in the Process Statement's sensitivity list" { } { } 0 10492 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 10036 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 113007 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 113015 "" 0 0 "Quartus II" 0 -1 0 ""}

View File

@ -37,7 +37,7 @@ wire ypbpr;
wire ps2_kbd_clk, ps2_kbd_data;
wire [7:0] audio;
wire video;
assign LED = 1'b1;
wire clk_24, clk_12, clk_6;
wire locked;
pll pll
@ -49,6 +49,16 @@ pll pll
.locked(locked)
);
wire m_up = (kbjoy[3] | joystick_0[3] | joystick_1[3]);
wire m_down = (kbjoy[2] | joystick_0[2] | joystick_1[2]);
wire m_left = (kbjoy[1] | joystick_0[1] | joystick_1[1]);
wire m_right = (kbjoy[0] | joystick_0[0] | joystick_1[0]);
wire m_fire = ~(kbjoy[4] | joystick_0[4] | joystick_1[4]);
wire m_start1 = ~(kbjoy[5]);
wire m_start2 = ~(kbjoy[6]);
wire m_coin = ~(kbjoy[7]);
super_breakout super_breakout (
.clk_12(clk_12),
@ -60,17 +70,17 @@ super_breakout super_breakout (
.HB(hb),
.Video_O(video),
.Audio_O(audio),
.Coin1_I(~kbjoy[7]),
.Coin2_I(~kbjoy[7]),
.Start1_I(~kbjoy[5]),
.Start2_I(~kbjoy[6]),
.Coin1_I(m_coin),
.Coin2_I(1'b1),
.Start1_I(m_start1),
.Start2_I(m_start2),
.Select1_I(),
.Select2_I(),
.Enc_A(),
.Enc_B(),
.Pot_Comp1_I(),
.Slam_I(),
.Serve_I(~kbjoy[4]),
.Serve_I(m_fire),
.Test_I(~status[1]),
.Lamp1_O(),
.Lamp2_O(),
@ -79,7 +89,7 @@ super_breakout super_breakout (
);
dac dac (
.CLK(clk_48),
.CLK(clk_24),
.RESET(1'b0),
.DACin(audio),
.DACout(AUDIO_L)
@ -90,7 +100,7 @@ assign AUDIO_R = AUDIO_L;
wire hs, vs;
wire hb, vb;
wire blankn = ~(hb | vb);
video_mixer #(.LINE_LENGTH(480), .HALF_DEPTH(1)) video_mixer
video_mixer #(.LINE_LENGTH(480), .HALF_DEPTH(0)) video_mixer
(
.clk_sys(clk_24),
.ce_pix(clk_6),
@ -98,9 +108,9 @@ video_mixer #(.LINE_LENGTH(480), .HALF_DEPTH(1)) video_mixer
.SPI_SCK(SPI_SCK),
.SPI_SS3(SPI_SS3),
.SPI_DI(SPI_DI),
.R({video,video,video}),
.G({video,video,video}),
.B({video,video,video}),
.R({video,video,video,video,video,video}),
.G({video,video,video,video,video,video}),
.B({video,video,video,video,video,video}),
// .R(blankn ? {video,video,video} : "000"),
// .G(blankn ? {video,video,video} : "000"),
// .B(blankn ? {video,video,video} : "000"),

View File

@ -41,8 +41,6 @@ always @(negedge clk) begin
'h69: joystick[8] <= ~release_btn; // 1
'h72: joystick[9] <= ~release_btn; // 2
'h7A: joystick[10] <= ~release_btn; // 3
'h6B: joystick[11] <= ~release_btn; // 4
endcase
end
end

View File

@ -36,9 +36,9 @@ wire scandoubler_disable;
wire ypbpr;
wire ps2_kbd_clk, ps2_kbd_data;
wire [6:0] audio1, audio2;
wire [1:0] video;
wire clk_48, clk_12;
wire [1:0] Video;
assign LED = 1'b1;
wire clk_24, clk_12, clk_6;
wire locked;
pll pll
(
@ -49,10 +49,31 @@ pll pll
.locked(locked)
);
wire m_up1 = (kbjoy[3] | joystick_1[3]);
wire m_down1 = (kbjoy[2] | joystick_1[2]);
wire m_left1 = (kbjoy[1] | joystick_1[1]);
wire m_right1 = (kbjoy[0] | joystick_1[0]);
wire m_up2 = (joystick_0[3]);
wire m_down2 = (joystick_0[2]);
wire m_left2 = (joystick_0[1]);
wire m_right2 = (joystick_0[0]);
wire m_fire1 = ~(kbjoy[4] | joystick_1[4]);
wire m_fire2 = ~(joystick_0[4]);
wire m_start1 = ~(kbjoy[5]);
wire m_start2 = ~(kbjoy[6]);
wire m_coin = ~(kbjoy[7]);
wire m_gearup1 = (kbjoy[8] | joystick_1[5]);
wire m_geardown1 = (kbjoy[9] | joystick_1[6]);
wire m_gearup2 = (joystick_0[5]);
wire m_geardown2 = (joystick_0[6]);
ultra_tank ultra_tank (
.clk_12(clk_12),
.Reset_n(~(status[0] | status[6] | buttons[1])),
.Video(video),
.Video(Video),
.Sync_O(),
.Blank_O(),
.HS(hs),
@ -66,10 +87,10 @@ ultra_tank ultra_tank (
.White_O(),
.Audio1_O(audio1),
.Audio2_O(audio2),
.Coin1_I(~kbjoy[7]),
.Coin2_I(~kbjoy[7]),
.Start1_I(~kbjoy[5]),
.Start2_I(~kbjoy[6]),
.Coin1_I(m_coin),
.Coin2_I(1'b1),
.Start1_I(m_start1),
.Start2_I(m_start2),
.Invisible_I(),// Invisible tanks switch
.Rebound_I(),// Rebounding shells switch
.Barrier_I(),// Barriers switch
@ -77,12 +98,12 @@ ultra_tank ultra_tank (
.JoyW_Bk_I(~kbjoy[2]),
.JoyY_Fw_I(~kbjoy[1]),
.JoyY_Bk_I(~kbjoy[0]),
.JoyX_Fw_I(),
.JoyX_Bk_I(),
.JoyZ_Fw_I(),
.JoyZ_Bk_I(),
.FireA_I(~kbjoy[4]),
.FireB_I(),
.JoyX_Fw_I(1'b1),
.JoyX_Bk_I(1'b1),
.JoyZ_Fw_I(1'b1),
.JoyZ_Bk_I(1'b1),
.FireA_I(m_fire1),
.FireB_I(m_fire2),
.Test_I(~status[1]),
.Slam_I(),
.LED1_O(),
@ -90,26 +111,20 @@ ultra_tank ultra_tank (
.Lockout_O()
);
dac dac1 (
dac dac (
.CLK(clk_24),
.RESET(1'b0),
.DACin(audio1),
.DACin({audio1,"00",audio2}),
.DACout(AUDIO_L)
);
dac dac2 (
.CLK(clk_24),
.RESET(1'b0),
.DACin(audio2),
.DACout(AUDIO_R)
);
assign AUDIO_R = AUDIO_L;
wire hs, vs;
wire hb, vb;
wire blankn = ~(hb | vb);
video_mixer #(
.LINE_LENGTH(480),
.HALF_DEPTH(1)) // to dark if set to 0
.HALF_DEPTH(0))
video_mixer(
.clk_sys(clk_24),
.ce_pix(clk_6),
@ -117,9 +132,12 @@ video_mixer(
.SPI_SCK(SPI_SCK),
.SPI_SS3(SPI_SS3),
.SPI_DI(SPI_DI),
.R({video&video,video}),
.G({video&video,video}),
.B({video&video,video}),
.R({Video,Video,Video,Video,Video,Video}),
.G({Video,Video,Video,Video,Video,Video}),
.B({Video,Video,Video,Video,Video,Video}),
// .R(blankn ? {video,video,video} : "000000"),
// .G(blankn ? {video,video,video} : "000000"),
// .B(blankn ? {video,video,video} : "000000"),
.HSync(hs),
.VSync(vs),
.VGA_R(VGA_R),

View File

@ -0,0 +1,5 @@
{ "" "" "" "Verilog HDL warning at hq2x.sv(247): extended using \"x\" or \"z\"" { } { } 0 10273 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Verilog HDL information at scandoubler.sv(102): always construct contains both blocking and non-blocking assignments" { } { } 0 10268 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "VHDL warning at T65.vhd(185): comparison between unequal length operands always returns TRUE" { } { } 0 10620 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 10036 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 10296 "" 0 0 "Quartus II" 0 -1 0 ""}

View File

@ -14,7 +14,7 @@ reg [3:0]prom_do;
sprom #(
.init_file("./rom/prom5c.hex"),
.widthad_a(7),
.width_a(8))
.width_a(4))
c5C(
.address(addr[15:9]),
.clock(clk),

View File

@ -79,7 +79,7 @@ c9A(
.q(rom5_do)
);
`ifndef targ
`ifdef targ
sprom #(
.init_file(""),
.widthad_a(10),
@ -94,7 +94,7 @@ sprom #(
.init_file(""),
.widthad_a(10),
.width_a(8))
c8A(
c7A(
.address(addr[9:0]),
.clock(clk),//pcs[6]
.q(rom7_do)
@ -104,7 +104,7 @@ sprom #(
.init_file(""),
.widthad_a(10),
.width_a(8))
c8A(
c6A(
.address(addr[9:0]),
.clock(clk),//pcs[7]
.q(rom8_do)

View File

@ -1,2 +1,2 @@
`define BUILD_DATE "181028"
`define BUILD_TIME "105037"
`define BUILD_DATE "190101"
`define BUILD_TIME "170231"

View File

@ -342,19 +342,9 @@ port map(
O_SDAT => W_SDAT_B
);
--------- ROM -------------------------------------------------------
-- mc_roms : entity work.ROM_PGM_0
-- port map (
-- CLK => W_CLK_12M,
-- ADDR => W_A(13 downto 0),
-- DATA => W_CPU_ROM_DO
-- );
mc_roms : entity work.sprom
generic map (
init_file => "./ROM/kb_prog.hex",
init_file => "./ROM/prog.hex",
widthad_a => 14,
width_a => 8)
port map (

View File

@ -63,16 +63,9 @@ begin
--- COL ROM --------------------------------------------------------
--wire W_COL_ROM_OEn = W_6M_DO[1];
-- galaxian_6l : entity work.GALAXIAN_6L
-- port map (
-- CLK => I_CLK_12M,
-- ADDR => W_6M_DO(6 downto 2),
-- DATA => W_COL_ROM_DO
-- );
galaxian_6l : entity work.sprom
generic map (
init_file => "./ROM/prom.hex",
init_file => "./ROM/col.hex",
widthad_a => 5,
width_a => 8)
port map (

View File

@ -219,25 +219,9 @@ begin
O_DB => W_VID_RAM_DOB
);
-- 1K VID-Rom
-- k_rom : entity work.GALAXIAN_1K
-- port map (
-- CLK => I_CLK_12M,
-- ADDR => W_O_OBJ_ROM_A,
-- DATA => W_1K_D
-- );
-- 1H VID-Rom
-- h_rom : entity work.GALAXIAN_1H
-- port map(
-- CLK => I_CLK_12M,
-- ADDR => W_O_OBJ_ROM_A,
-- DATA => W_1H_D
-- );
k_rom : entity work.sprom
generic map (
init_file => "./ROM/GALAXIAN_1K.hex",
init_file => "./ROM/k.hex",
widthad_a => 11,
width_a => 8)
port map (
@ -248,7 +232,7 @@ begin
h_rom : entity work.sprom
generic map (
init_file => "./ROM/GALAXIAN_1H.hex",
init_file => "./ROM/h.hex",
widthad_a => 11,
width_a => 8)
port map (

View File

@ -30,7 +30,8 @@ sprom #(
`ifdef seawolf .init_file("./roms/Seawolf/sw0041_h.hex"), `endif//not working
`ifdef dogpatch .init_file("./roms/Dogpatch/dogpatch_h.hex"), `endif//not working
`ifdef jspecter .init_file("./roms/jspecter/rom_h.hex"), `endif//not working
`ifdef invadrev .init_file("./roms/InvadersRevenge/invrvnge_e.hex"), `endif//not working
`ifdef invadrev .init_file("./roms/InvadersRevenge/invrvnge_e.hex"), `endif//not
`ifdef blueshark .init_file("./roms/BlueShark/blueshrk_h.hex"), `endif//
`ifdef zzzap280 .widthad_a(10), `endif//
`ifdef generic .widthad_a(11), `endif//
// .widthad_a(11),
@ -54,6 +55,7 @@ sprom #(
`ifdef dogpatch .init_file("./roms/Dogpatch/dogpatch_g.hex"), `endif//not working
`ifdef jspecter .init_file("./roms/jspecter/rom_g.hex"), `endif//not working
`ifdef invadrev .init_file("./roms/InvadersRevenge/invrvnge_f.hex"), `endif//not working
`ifdef blueshark .init_file("./roms/BlueShark/blueshrk_g.hex"), `endif//
`ifdef zzzap280 .widthad_a(10), `endif//
`ifdef generic .widthad_a(11), `endif//
// .widthad_a(11),
@ -77,6 +79,7 @@ sprom #(
`ifdef dogpatch .init_file("./roms/Dogpatch/dogpatch_f.hex"), `endif//not working
`ifdef jspecter .init_file("./roms/jspecter/rom_f.hex"), `endif//not working
`ifdef invadrev .init_file("./roms/InvadersRevenge/invrvnge_g.hex"), `endif//not working
`ifdef blueshark .init_file("./roms/BlueShark/blueshrk_f.hex"), `endif//
`ifdef zzzap280 .widthad_a(10), `endif//
`ifdef generic .widthad_a(11), `endif//
// .widthad_a(11),
@ -88,6 +91,7 @@ u_rom_f (
.q(rom_data_2)
);
`ifndef blueshark
sprom #(
`ifdef sflush .init_file("./roms/Strightflush/fr04_sc3.hex"), `endif//
`ifdef zzzap280 .init_file("./roms/280zzz/zzzap_f.hex"), `endif//not working
@ -109,7 +113,7 @@ u_rom_e (
`ifdef generic .Address(Addr[10:0]), `endif
.q(rom_data_3)
);
`endif//
`ifndef generic
sprom #(
`ifdef sflush .init_file("./roms/Strightflush/fr05_sc2.hex"), `endif//

View File

@ -0,0 +1,129 @@
:1000000066667E3C181C1818181818183C3C3C7E74
:1000100066607C3E06067E7E3C7E66603878606662
:100020007E3C666666667E7E606060603E3E06067A
:100030003E7E60667E3C3C3E06063E7E66667E3CBC
:100040007E7E60703038181C0C0C3C7E66663C7EF0
:1000500066667E3C3C7E66667E7C60667E3C00001A
:100060000000000000000000183C7E6666667E7E90
:1000700066663E7E66663E7E66667E3E3C7E6606C2
:10008000060606667E3C3E7E6666666666667E3E62
:100090007E7E06063E3E06067E7E7E7E06063E3E50
:1000A000060606063C7E6606067676667E3C666634
:1000B00066667E7E666666663C3C181818181818D8
:1000C0003C3C60606060606060667E3C6666763E78
:1000D0001E1E3E76666606060606060606067E7E38
:1000E000C3C3E7E7FFFFDBC3C3C366666E6E7E7EF6
:1000F000767666663E7E66667E3E060606063C7E32
:100100006666666666767E5C3E7E66667E3E766681
:1001100066663C7E66063E7C60667E3C7E7E181887
:1001200018181818181866666666666666667E3C55
:1001300066666666667E3C3C1818C3C3C3DBFFFF79
:10014000E7E7C3C366667E3C18183C7E6666666653
:100150007E3C1818181818187E7E6070381C0E0621
:100160007E7E3C7E6666703818001818000000001D
:100170003C3C00000000050D0000C000000100F83C
:1001800001000300FF030086E0FF0F000CFFFF7F6C
:1001900000FCFFFFDF01F8FFFFFFFF18FFFF7F00FC
:1001A0008C01FFFF00068001060003000002000131
:1001B000000001000000800000050D00008001002B
:1001C0004000F003004000FE070040C4FF1F00C0D5
:1001D000F8FF7F0080FFFFDF0180FFFFFFFFC0F817
:1001E000FFFF004008FCFF014000060C0040000239
:1001F000060000000003000000000000041E0001D3
:1002000000000000000000000000000000000000EE
:10021000000000400000000000000000000000009E
:1002200000000000000000000000000000000000CE
:100230000E0000FC1E0000CC1E0000301E0000FE60
:100240000F0000F7C77F00FF6F0280F71F07800FC6
:10025000FC03C107F800FF030000FF010000FF00DE
:10026000000001000000010000000100000001008A
:10027000000000000000041E00000000000000005C
:10028000000000000004000000000000000000006A
:10029000000000000000010000400000000000001D
:1002A000000002000000000000001C0000F83D00FB
:1002B00000983D0004603C000EFC1F001EEE8FFF06
:1002C0003BFFDF04F1EF3F0EE11FF807C003F00131
:1002D0008000000020000000700000001C000000F2
:1002E0000C000000040000000400000004000000F6
:1002F00002118003C007E007E007A006E0036003E7
:10030000C0018003C007F60FEC5BB073D8064E0C3B
:100310004238C000021100008007C00FE00F400FFC
:10032000F00FF0C78483CCC7F06FD83BED06A74D24
:1003300030791003180E0000021500002000200084
:1003400038003C0060006001C000C000C000C00177
:10035000C001D009700D200740034001C001C0005A
:10036000C001800102150001000100010007800F9B
:10037000A001C000C000C000E000E000E402AC0347
:100380003801B000A000E000C000E0006000000004
:1003900002158001C001C000C001400140032007D8
:1003A000700DD009C001C001C000C000C0006001D4
:1003B00060003C0038002000200000000215000012
:1003C0006000E000C000E000A000B0003801AC0315
:1003D000E402E000E000C000C000C000A001800F07
:1003E0000007000100010001040C000008000100EA
:1003F00018000300380006007C008CC0FF071CFFBB
:10040000FF3FF8FFFFDFF8FFFFFF0C81DF3F06C073
:10041000C0000000600000003000040C000010006C
:1004200000003000200070002000F8002084FF0F42
:1004300060FCFF3FC0FFFFDFC0FFFFFF6004BF1F86
:10044000200081012000C0000000400003100000D7
:10045000E00000F800F0BF00E07F00C01F00E00FE8
:1004600000F809047F080C5E00980700F005007092
:1004700000002000002000002000002000000310E9
:10048000080000180000300000600000C00402F006
:100490000502001F03007E0300F90300E00700F0DF
:1004A0001F00803F00007E0000FF0080D90000E0B8
:1004B000040B0000080060001800C0003800800134
:1004C00078000013FC0300FFFF3F00FFFFDF8013F5
:1004D000FF7FC08000030000800100008000011346
:1004E0000814080808080808080808080808080880
:1004F000080808011008140808080808080808086F
:100500000808080808010D08000808080808080875
:1005100008080808010A0800080808080808080868
:10052000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDB
:10053000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCB
:10054000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBB
:10055000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAB
:10056000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9B
:10057000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8B
:10058000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7B
:10059000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6B
:1005A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5B
:1005B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4B
:1005C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3B
:1005D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2B
:1005E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1B
:1005F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0B
:10060000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA
:10061000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEA
:10062000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDA
:10063000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCA
:10064000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBA
:10065000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAA
:10066000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9A
:10067000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8A
:10068000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7A
:10069000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6A
:1006A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5A
:1006B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4A
:1006C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3A
:1006D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2A
:1006E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1A
:1006F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A
:10070000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9
:10071000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9
:10072000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9
:10073000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC9
:10074000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB9
:10075000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9
:10076000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF99
:10077000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF89
:10078000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF79
:10079000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF69
:1007A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF59
:1007B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF49
:1007C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF39
:1007D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF29
:1007E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF19
:1007F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF09
:00000001FF

View File

@ -0,0 +1,129 @@
:10000000A7F2050837171213230605CD7D0F21022D
:1000100021CD930DC83A3620A7C8AF323620210132
:10002000217EE6F0F60677C90606C30B08CD860FDB
:10003000210221E6014F3A2020CA5D08A7F24508B7
:100040003606C3470836032B7881C24F08F60447AB
:100050007EE6F0B0772B36022323C31108A7F266A1
:100060000836F9C3470836FCC347083A3620A713B9
:10007000EBCA7D08CD9D0DCA8008C32209CD8D0D28
:100080003A0121E603475F160021F508195E235661
:100090003A0421BBDAD208BAD22D083A0121E6404F
:1000A0003A0621CAB708FE76C2B10821B911C3C504
:1000B00008217611C3C508FEFCC2C208217612C30E
:1000C000C50821FC1122062121002136012323C36A
:1000D000110805C32D0801E103001082761101B15A
:1000E00003001080FC1101E3FC00C882761101B30B
:1000F000FC00C880FC11104890C83A3620A713EBCA
:10010000CA0C09CD9D0DCA0F09C32209CD8D0DCD95
:10011000860FF60FE67F6F2680220021C913EBCDF4
:100120008D0DAF3236202A0421CD2F0E222B203EFA
:10013000FF3238203E043232203A0121E640CA9E86
:10014000092100213601237EE6F7F6077723CD8DBE
:100150000D0604C3F30C13EBCD8D0D21322035CAEF
:1001600080093A0621FE76C2700921B911C37309CC
:1001700021761122062121002136012323C38D0D72
:10018000AF3238202100213606237EE640CA92098C
:100190003EFFF6803226207EE6F0F60577C906108F
:1001A000CDF30CC3800906EBCDFF0C1AE640CAB3B1
:1001B000093EFFF680322520211080220021C90649
:1001C00020CDF30C3A22203223202101612210217C
:1001D000210000221221CD860FE60E4F06002107D6
:1001E0000A091114217E1213237E1221F012221605
:1001F00021211221CD930DC83A3620A7C8AF32363F
:10020000203E63321121C910E820D028D870B08078
:10021000D0A0E8C0A0E0E006DFCDFF0C3A3620A772
:1002200013EBCA2E0ACD9D0DCA310AC3660ACD8DC5
:100230000D3A23203D322320CA5A0A3E01321021B2
:100240003A1621FEF0C24E0A211413C3510A21F0BE
:1002500012221621211221C3F409210200221021A9
:10026000C913EBCD8D0DAF3236202A1421CD2F0EC0
:10027000222F203EFF3238203E043234202110212C
:10028000360123360423CD8D0D0604CDF30C06DF95
:10029000C3FF0C13EBCD8D0D21342035CABD0A3AB6
:1002A0001621FEF0C2AD0A211413C3B00A21F012C8
:1002B00022162121102136012323C38D0DAF3238A0
:1002C000203EFF322A20210602221021C906FBCD42
:1002D000FF0C3EFF322920210400221021C9060212
:1002E000CDF30C3EFF323720211C213A3920D608AD
:1002F00087772336FD211D20360023360421DE14A6
:10030000221E212101012218212100F4221A21217B
:100310001A21CD930DAF323520323620C913EBCDE3
:100320009D0DCA360B3A1D21FEECD2360B211A2147
:10033000CD8D0DC36F0B211E2035C25C0B2B7EFEB5
:1003400003D2990B3C77878623EBC6B46F3E00CE71
:100350000B677E12235E2356EB221E212101012210
:100360001821211A21CD930DC83A1D21FEECD03E53
:10037000FF323620210202221821C93A3620A7CAAC
:10038000890B210104221821C92101032218213AD5
:100390003820A7C013EBCD8D0DAF32362032372079
:1003A00021000022182106FDC3FF0C13EBCD8D0D9B
:1003B000AF323620C3360B04F314040515041415AC
:1003C000E5C3CA0BE5010400CD3E0C11E50F2A2F51
:1003D00020CD080DE1AF77C9E57EE67FC2FE0B11A7
:1003E000E90FC3010CE57EE67FC2F80B019509CD4C
:1003F000780C11E90FC3010C010200CD3E0C11D99C
:100400000F2A2B20CD080DE1AF77C9E57EE67FCA24
:10041000310C11E10FC3340CE57EE67FCA2B0C01D1
:100420000500CD3E0C11E10FC3340C010300CD3E9D
:100430000C11DD0F2A2D20CD080DE1AF77C9C511B4
:100440000F2021D5253E03CD0A0DC1111120213FDA
:10045000207E812777F54FE60F121B790F0F0F0FC4
:10046000E60F121B23F17E8827E60F1277110F206B
:1004700021D5253E03C30A0DC5110F2021D5253EE8
:1004800003CD0A0DC1111120213F207E812777F570
:100490004FE60F121B790F0F0F0FE60F121B23F100
:1004A0007E88277712E6F0CABA0C7EE60F12771123
:1004B0000F2021D5253E03C30A0DAF772B771213EA
:1004C000121312C3AF0CCD630F119C0F214324CD27
:1004D000080D110A2021C6253E05CD0A0D11142054
:1004E00021CF253E02CD0A0D110F2021D5253E0535
:1004F000C30A0D2141207E0FD007B077D303C92155
:1005000041207EA077D303C91A13F5D5CD770DE529
:10051000060A1AF3AE77FBC501200009C11305C214
:10052000120DE123D113F13DC20A0DC91A13F5D5FD
:10053000CD770D060AC51AD5010300E5210000118B
:100540000800292907D2490D091DC2420DEB011FE0
:1005500000E17BF3AE77237AAE77097BAE77237A1F
:10056000AE77FB09D113C105C2350D0182FD09D15A
:1005700013F13DC22E0DC9E51A6F260029292987DE
:10058000856F7CCE006701FA0F09EBE1C9CDF00D54
:10059000C31A0FAF323520CDA70DC3AB0EAF323526
:1005A00020CDF00DC3420E7EF5234623A7F2D30DD6
:1005B0003C86775F2FD3012378867757EBCD2F0EBC
:1005C000EBD5235E2356EB4E793D835F234623D143
:1005D000EBF1C986775FD3012378867757EBCD2F70
:1005E0000EEBD5235E2356EB4E234623D1EBF1C908
:1005F0007EF52323A7F2160E7E5F2FD3012356EB41
:10060000CD2F0EEBD5235E2356EB4E793D835F2332
:100610004623D1EBF1C97E5FD3012356EBCD2F0EDC
:10062000EBD5235E2356EB4E234623D1EBF1C906CF
:10063000037C1F677D1F6F05C2310E7CE63FF620ED
:1006400067C9A7FA770EC5E51AD302DB03AE77DBDD
:1006500003A6C4140F13230DC2480EAFD302DB034D
:10066000AE77DB03A6C4140F012000E109C105C267
:10067000460E3A3520A7C97D816FC5E51AD302DB46
:1006800000AE77DB00A6C4140F132B0DC27C0EAF97
:10069000D302DB00AE77DB00A6C4140F012000E11B
:1006A00009C105C27A0E3A3520A7C9A7FAE00EC5DE
:1006B000E51AD302DB03A6C4140FDB03AE771323C2
:1006C0000DC2B10EAFD302DB03A6C4140FDB03AE21
:1006D00077012000E109C105C2AF0E3A3520A7C954
:1006E0007D816FC5E51AD302DB00A6C4140FDB00C1
:1006F000AE77132B0DC2E50EAFD302DB00A6C414F8
:100700000FDB00AE77012000E109C105C2E30E3A1C
:100710003520A7C93EFF323520C9A7FA3F0FC5E5EE
:100720001AD302DB03AE7713230DC2200FAFD3021F
:10073000DB03AE77012000E109C105C21E0FC97DB0
:10074000816FC5E51AD302DB00AE77132B0DC244CF
:100750000FAFD302DB00AE77012000E109C105C273
:10076000420FC92100240120E0C5E53600230DC257
:100770006B0FE101200009C105C2690FC97E121388
:100780002305C27D0FC9E52A0520291717AD17AD2E
:100790001F1F2FE601B56F220520E1C9171213258F
:1007A0001C0D001B0F0A0A0A1D13170F0A0A0A1C48
:1007B0000D001B0F07251C1D0B1B1D2509110B17F9
:1007C0000F0A001F0F1B061B0F19160B220B110B14
:1007D000170F0A1B0F0B0E22240302000003030055
:1007E00000030500000304000004250500000B13AE
:1007F000181C0F1B1D0A0D0013183C7E66666666EA
:00000001FF

View File

@ -0,0 +1,129 @@
:10000000310024C31800FFFFF5E5D5C5FBC342024C
:10001000F5E5D5C5FBC3710321002001201FCD6983
:100020000FDB02E680CA3300CDC60CAFD302D30388
:10003000C3B100CD630FFBC33700AF3200200120F6
:1000400018211420F3CD690FAFD303FBCD630F113B
:100050000A20210F2006031ABECA6200DA6B00D202
:100060007300132305C25700C373007E12132305C8
:10007000C26B00CDC60C11BC0F210630CD2C0D3E3D
:10008000783208203A0820A7D304C2840001201443
:10009000210630CD690F210220AFBECAA60036006E
:1000A0002B3600C3B1002BBECAB1002336FFC313E9
:1000B00001012018211420F3CD690FAFD303FBCD2C
:1000C000C60C3E20323E203A0420A7C23901F3CDAF
:1000D000FB00FB11EE0F210430CD2C0D3E783208D1
:1000E000203A0420A7C239013A0820A7D304C2E16C
:1000F00000213E2035C2D300C3B10021018022007F
:100100002121010022082121010022102121222089
:100110003618C9CD630F11C60F210A2CCD2C0D1135
:10012000CD0F210432CD2C0D3E5A3208203A082042
:10013000A7D304C22D01C33E01F3210420350120C1
:1001400018210F20CD690F3E01D303324120FB213E
:1001500014203609233609CD630FCDC60C3E9932E3
:100160003C2011B40F210930CD2C0D3E4032082027
:100170003A0820A7C27001CD630FCDC60CCDFB009D
:100180003EFF320020D304AF212520BEC4D80B236C
:10019000BEC4E50B23BEC40B0C23BEC4180C23BE87
:1001A000C4C00B23BEC4C40B2A3F2029292929E53A
:1001B0003A1F20A7C2CA017CFE07DACA01211F200C
:1001C0003EFF7723772377233610E13A0220A7C238
:1001D00007023A0120A7C20702DB02E660CA070253
:1001E000FE40CAED01D2F2010614C3F4010618C3A1
:1001F000F40106227CB8DA07023EFF32012011C664
:100200000F215427CD080D3A3D20A7F23F02AF320F
:100210003D2021CF251114203E02CD0A0D211520AD
:100220003A3C20F547E60F77780F0F0F0FE60F2BBC
:1002300077EB21CF253E02CD0A0DF1A7CA3A00C3C4
:1002400085012117203EFFBECA440377DB02E60882
:10025000C2CA02F300000000AF3209203E01323C66
:10026000203E01323B203EFF323D2011C502210CD1
:100270002CCD2C0D1E0121FFFF2DC2790225C27944
:10028000021DC27902D3041E0121FF0FDB02E60228
:10029000CAAC022DC28C0225C28C021DC28C021176
:1002A000C502210C2CCD2C0DFBC3DA0211C5022195
:1002B0000C2CCD2C0DFBDB02E602C2DA023E023230
:1002C0000920C3DA02041D13161D210920AFBECA7E
:1002D000B60235C2B602210420343A0020A7CA046F
:1002E000033A3720A7C20403211C20DB02E601CA1F
:1002F000F7023600C30403AFBEC2040336FF210178
:10030000002218213A1A20A7C23D03211620357E6B
:10031000E603CA1D03E601C22603C36503111F04D9
:10032000210121C33103112F042109217EA7F26588
:1003300003CD4B03AF321720C1D1E1F1C921182001
:1003400034C3340321182034C338032BAFBECA642E
:100350000335C26403237EE60F874F0600EB097E58
:1003600023666FE9C1211820AFBECA340335C30B21
:1003700003DB02E680CA5704211A203EFFBECADD15
:100380000377DB01323920213B2035CCE4032108FF
:1003900020AFBECA9703353A1720A7C2D60321194A
:1003A00020357EE603CAB603E601C2BF03114D0441
:1003B000211921C3C503114304211121C3CA03110B
:1003C0002F042109217EA7FA1304CDF903AF321AB5
:1003D00020C1D1E1F1C9211B2034C3CD03211B2051
:1003E00034C3D103363C3A3C20A7CAF303C699274D
:1003F000323C203EFF323D20C92BAFBECA1204352D
:10040000C21204237EE60F874F0600EB097E2366A7
:100410006FE9C1211B20AFBECACD0335C39E03DAED
:10042000076B086B086B08FA08A6091D095609AE88
:10043000045805F905580539068206D106C2071089
:10044000074107BF09170ACD0A610A930ADE0A1D90
:100450000B7B0B890BAB0BF3214220AFBEDB0132D0
:100460003920C26A0436FFC370043A1C21CD8204CD
:100470003A3920D60887321C21CD8204C1D1E1F15E
:10048000FBC96F2690D301CD2F0E010138C5E53E83
:10049000FFD302DB03AE77230DC28F04AFD302DBA1
:1004A00003AE77012000E109C105C28D04C9060829
:1004B000CDF30CCD860FE638C3C1043A0520E6081B
:1004C000B04F0600211805091108217E1213237E62
:1004D0001213233A2120A7F210057EA7F2E0043779
:1004E000171213237EA7F2EA043717121323060408
:1004F000CD7D0F210A21CD930DC83A3620A7C8AF74
:100500003236202109217E323120E6F0F60877C903
:100510007E1213237EC3EB0404A604FD08704C1462
:1005200004E1000408703813046100FB08B0901364
:100530000462040008C0E8130462FB00E0C0E81392
:100540000463FFFBE0B0901304E3FF04E070381392
:1005500004A4FBFDE0704C141A47E690CABD05EEFA
:1005600080CAC8053A3620A713EBC5CA7805CD9DC9
:100570000DCA7B05C1C30707CD8D0DC13A0D21FE04
:1005800070DAD905FEB0D2E9053A0E21FE38CAADBF
:1005900005FE64CAA705FE90CAA105219013C3B049
:1005A0000521BC13C3B005213813C3B00521641362
:1005B000220E2121082136022323C3F6043A0D21FD
:1005C000FE80DAD005C364053A0D21FE80DA6405A9
:1005D00078F610EE8012C3640578E602CAE40506D8
:1005E00030C3BB040600C3BB0478E602CAF40506A8
:1005F00020C3BB040610C3BB043A3620A713EBCAC2
:100600000B06CD9D0DCA0E06C30707CD8D0D3A0C06
:1006100021FE08DAF405FEE0D2EF053A0E21FEE8ED
:10062000C22906211A14C32C0621E813220E212107
:10063000082136022323C3F6043A3620A713EBCA57
:100640004B06CD9D0DCA4E06C30707CD8D0D3A0C46
:1006500021FEB0DA6506FEE0D2DF05210821360171
:100660002323C3F6042108213601233423237E2FBC
:100670003C322420360021B014220E21210A21C34D
:10068000930D3A3620A713EBCA9406CD9D0DCA9759
:1006900006C30707CD8D0D3A0C21FE40DAAE06FEEB
:1006A000B0D2C70621082136012323C3F60421084E
:1006B000213601233423233A242077217E14220E6D
:1006C00021210A21C3F60421082136012335C3B5AF
:1006D000063A3620A713EBCAE306CD9D0DCAE606FF
:1006E000C30707CD8D0D3A0C21FE40D2FD06FE0852
:1006F000DAE40521082136012323C3F60421082169
:1007000036012335C36C063A0921323120C315075F
:1007100013EBCD8D0DAF3236202A0C21CD2F0E22BA
:100720002D203EFF3238203E08323320210821366A
:1007300001237EE6F9F6097723CD8D0D0604C3F378
:100740000C13EBCD8D0D21332035CAA1073A312092
:10075000E60FFE04D29707FE023A0E21CA8607FE74
:1007600038CA8007FE64CA7A07FE90CA74072190CF
:1007700013C3940721BC13C39407213813C39407F0
:10078000216413C39407FEE8CA910721E813C394B8
:1007900007211A14220E2121082136012323C38D9B
:1007A0000DAF323820210821360B237EE64007C2E8
:1007B000B4073EFF3228207EE6F0F6077706F7C33F
:1007C000FF0C06FBCDFF0C1AE64007C2D0073EFF28
:1007D000322720210400220821C9CD860FE638FEE9
:1007E00020DAE607E6104F060021D608091100219D
:1007F0007E1213237E1213233A2020A7F228087EAC
:00000001FF

View File

@ -48,7 +48,6 @@ set_global_assignment -name SYSTEMVERILOG_FILE rtl/Invaders_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 VHDL_FILE rtl/invaders_video.vhd
set_global_assignment -name SYSTEMVERILOG_FILE rtl/invaders_memory.sv
set_global_assignment -name QIP_FILE rtl/pll.qip
set_global_assignment -name SYSTEMVERILOG_FILE rtl/video_mixer.sv
@ -177,4 +176,5 @@ set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top
# end ENTITY(Invaders_mist)
# -------------------------
set_global_assignment -name SYSTEMVERILOG_FILE rtl/cpu8080.sv
set_global_assignment -name VHDL_FILE rtl/invaders_video.vhd
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top

View File

@ -1,21 +1,25 @@
`define generic
//`define noDIP
`define invaders
`ifdef invaders
`define dip = 8'b00000000
`endif
//`define supearth
`ifdef supearth
`define dip = 8'b11000000 //4 lifes check this
`endif
//`define slaser
`ifdef slaser
`define dip = 8'b00000000 //untested
`endif
//`define sflush
`ifdef sflush
`define dip = 8'b00000000 //untested
//`define blueshark Sync Problems
`ifdef blueshark
`define dip = "00100100" //todo
`endif
//TODO
//`define lrescue
@ -58,9 +62,11 @@ localparam CONF_STR = {
`ifdef invaders "Space Inv.;;", `endif
`ifdef supearth "SEarthInv.;;", `endif
`ifdef slaser "Space Laser;;", `endif
"Midway 8080.;;",
`ifdef blueshark "Blue Shark;;", `endif
`ifdef noDIP "Midway 8080.;;", `endif
"O2,Joystick Control,Upright,Normal;",
"O34,Scandoubler Fx,None,HQ2x,CRT 25%,CRT 50%;",
"O5,Overlay, On, Off;",
"T6,Reset;",
"V,v1.00.",`BUILD_DATE
};
@ -221,6 +227,7 @@ invaders_audio invaders_audio (
invaders_video invaders_video (
.Video(Video),
.Overlay(~status[5]),
.CLK(clk_sys),
.Rst_n_s(Rst_n_s),
.HSync(HSync),

View File

@ -1,2 +1,2 @@
`define BUILD_DATE "181229"
`define BUILD_TIME "040306"
`define BUILD_DATE "190102"
`define BUILD_TIME "031130"

View File

@ -210,20 +210,20 @@ begin
GDB1(0) <= not Coin;-- Active High !
GDB1(1) <= not Sel2Player;
GDB1(2) <= not Sel1Player;
GDB1(3) <= '1'; -- Unused ?
GDB1(3) <= '1';-- Unused ?
GDB1(4) <= not Fire;
GDB1(5) <= not MoveLeft;
GDB1(6) <= not MoveRight;
GDB1(7) <= '1'; -- Unused ?
GDB1(7) <= '1';-- Unused ?
GDB2(0) <= DIP(4); -- LSB Lives 3-6
GDB2(1) <= DIP(3); -- MSB Lives 3-6
GDB2(2) <= '0'; -- Tilt ?
GDB2(3) <= DIP(2); -- Bonus life at 1000 or 1500
GDB2(2) <= '0';-- Tilt ?
GDB2(3) <= '0';--DIP(2); -- Bonus life at 1000 or 1500
GDB2(4) <= not Fire;
GDB2(5) <= not MoveLeft;
GDB2(6) <= not MoveRight;
GDB2(7) <= DIP(1); -- Coin info
GDB2(7) <= '1';--DIP(1); -- Coin info
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';

View File

@ -6,7 +6,8 @@ library ieee;
entity invaders_video is
port(
Video : in std_logic;
Video : in std_logic;
Overlay : in std_logic;
CLK : in std_logic;
Rst_n_s : in std_logic;
HSync : in std_logic;
@ -116,9 +117,9 @@ begin
end process;
O_VIDEO_R <= VideoRGB(2);
O_VIDEO_G <= VideoRGB(1);
O_VIDEO_B <= VideoRGB(0);
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 <= not HSync;
O_VSYNC <= not VSync;

View File

@ -44,25 +44,6 @@ set_global_assignment -name PROJECT_CREATION_TIME_DATE "23:59:05 MARCH 16, 2017
set_global_assignment -name LAST_QUARTUS_VERSION "13.0 SP1"
set_global_assignment -name PROJECT_OUTPUT_DIRECTORY Output
set_global_assignment -name PRE_FLOW_SCRIPT_FILE "quartus_sh:rtl/build_id.tcl"
set_global_assignment -name VERILOG_FILE rtl/mist_io.v
set_global_assignment -name SYSTEMVERILOG_FILE rtl/hq2x.sv
set_global_assignment -name VERILOG_FILE rtl/osd.v
set_global_assignment -name VERILOG_FILE rtl/scandoubler.v
set_global_assignment -name VERILOG_FILE rtl/glue.v
set_global_assignment -name VERILOG_FILE rtl/T80/tv80n.v
set_global_assignment -name VERILOG_FILE rtl/T80/tv80_reg.v
set_global_assignment -name VERILOG_FILE rtl/T80/tv80_mcode.v
set_global_assignment -name VERILOG_FILE rtl/T80/tv80_core.v
set_global_assignment -name VERILOG_FILE rtl/T80/tv80_alu.v
set_global_assignment -name SYSTEMVERILOG_FILE rtl/video_mixer.sv
set_global_assignment -name SYSTEMVERILOG_FILE rtl/ace_mist.sv
set_global_assignment -name QIP_FILE rtl/pll.qip
set_global_assignment -name VERILOG_FILE rtl/sigma_delta_dac.v
set_global_assignment -name VERILOG_FILE rtl/jupiter_ace.v
set_global_assignment -name VERILOG_FILE rtl/keyboard.v
set_global_assignment -name VERILOG_FILE rtl/rom_ram.v
set_global_assignment -name VERILOG_FILE rtl/ps2_port.v
set_global_assignment -name VERILOG_FILE rtl/io_write_to_rom.v
# Pin & Location Assignments
# ==========================
@ -202,14 +183,32 @@ set_global_assignment -name EDA_OUTPUT_DATA_FORMAT VHDL -section_id eda_simulati
# 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(ace_mist)
# --------------------
set_global_assignment -name VERILOG_FILE rtl/sram.v
set_global_assignment -name VERILOG_INPUT_VERSION SYSTEMVERILOG_2005
set_global_assignment -name VERILOG_SHOW_LMF_MAPPING_MESSAGES OFF
set_global_assignment -name SYSTEMVERILOG_FILE rtl/ace_mist.sv
set_global_assignment -name VERILOG_FILE rtl/jupiter_ace.v
set_global_assignment -name VHDL_FILE rtl/T80/T80_Reg.vhd
set_global_assignment -name VHDL_FILE rtl/T80/T80_MCode.vhd
set_global_assignment -name VHDL_FILE rtl/T80/T80_ALU.vhd
set_global_assignment -name VHDL_FILE rtl/T80/T80.vhd
set_global_assignment -name VHDL_FILE rtl/T80/T80pa.vhd
set_global_assignment -name VERILOG_FILE rtl/mist_io.v
set_global_assignment -name SYSTEMVERILOG_FILE rtl/hq2x.sv
set_global_assignment -name VERILOG_FILE rtl/osd.v
set_global_assignment -name VERILOG_FILE rtl/scandoubler.v
set_global_assignment -name SYSTEMVERILOG_FILE rtl/video_mixer.sv
set_global_assignment -name QIP_FILE rtl/pll.qip
set_global_assignment -name VERILOG_FILE rtl/sigma_delta_dac.v
set_global_assignment -name VERILOG_FILE rtl/keyboard.v
set_global_assignment -name SYSTEMVERILOG_FILE rtl/video.sv
set_global_assignment -name VERILOG_FILE rtl/dpram.v
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
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,376 @@
--------------------------------------------------------------------------------
-- ****
-- T80(c) core. Attempt to finish all undocumented features and provide
-- accurate timings.
-- Version 350.
-- Copyright (c) 2018 Sorgelig
-- Test passed: ZEXDOC, ZEXALL, Z80Full(*), Z80memptr
-- (*) Currently only SCF and CCF instructions aren't passed X/Y flags check as
-- correct implementation is still unclear.
--
-- ****
-- T80(b) core. In an effort to merge and maintain bug fixes ....
--
-- Ver 301 parity flag is just parity for 8080, also overflow for Z80, by Sean Riddle
-- Ver 300 started tidyup
-- MikeJ March 2005
-- Latest version from www.fpgaarcade.com (original www.opencores.org)
--
-- ****
-- Z80 compatible microprocessor core
--
-- Version : 0247
-- Copyright (c) 2001-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.opencores.org/cvsweb.shtml/t80/
--
-- Limitations :
--
-- File history :
--
-- 0214 : Fixed mostly flags, only the block instructions now fail the zex regression test
-- 0238 : Fixed zero flag for 16 bit SBC and ADC
-- 0240 : Added GB operations
-- 0242 : Cleanup
-- 0247 : Cleanup
--
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
entity T80_ALU is
generic(
Mode : integer := 0;
Flag_C : integer := 0;
Flag_N : integer := 1;
Flag_P : integer := 2;
Flag_X : integer := 3;
Flag_H : integer := 4;
Flag_Y : integer := 5;
Flag_Z : integer := 6;
Flag_S : integer := 7
);
port(
Arith16 : in std_logic;
Z16 : in std_logic;
WZ : in std_logic_vector(15 downto 0);
XY_State : in std_logic_vector(1 downto 0);
ALU_Op : in std_logic_vector(3 downto 0);
IR : in std_logic_vector(5 downto 0);
ISet : in std_logic_vector(1 downto 0);
BusA : in std_logic_vector(7 downto 0);
BusB : in std_logic_vector(7 downto 0);
F_In : in std_logic_vector(7 downto 0);
Q : out std_logic_vector(7 downto 0);
F_Out : out std_logic_vector(7 downto 0)
);
end T80_ALU;
architecture rtl of T80_ALU is
procedure AddSub(A : std_logic_vector;
B : std_logic_vector;
Sub : std_logic;
Carry_In : std_logic;
signal Res : out std_logic_vector;
signal Carry : out std_logic) is
variable B_i : unsigned(A'length - 1 downto 0);
variable Res_i : unsigned(A'length + 1 downto 0);
begin
if Sub = '1' then
B_i := not unsigned(B);
else
B_i := unsigned(B);
end if;
Res_i := unsigned("0" & A & Carry_In) + unsigned("0" & B_i & "1");
Carry <= Res_i(A'length + 1);
Res <= std_logic_vector(Res_i(A'length downto 1));
end;
-- AddSub variables (temporary signals)
signal UseCarry : std_logic;
signal Carry7_v : std_logic;
signal Overflow_v : std_logic;
signal HalfCarry_v : std_logic;
signal Carry_v : std_logic;
signal Q_v : std_logic_vector(7 downto 0);
signal BitMask : std_logic_vector(7 downto 0);
begin
with IR(5 downto 3) select BitMask <= "00000001" when "000",
"00000010" when "001",
"00000100" when "010",
"00001000" when "011",
"00010000" when "100",
"00100000" when "101",
"01000000" when "110",
"10000000" when others;
UseCarry <= not ALU_Op(2) and ALU_Op(0);
AddSub(BusA(3 downto 0), BusB(3 downto 0), ALU_Op(1), ALU_Op(1) xor (UseCarry and F_In(Flag_C)), Q_v(3 downto 0), HalfCarry_v);
AddSub(BusA(6 downto 4), BusB(6 downto 4), ALU_Op(1), HalfCarry_v, Q_v(6 downto 4), Carry7_v);
AddSub(BusA(7 downto 7), BusB(7 downto 7), ALU_Op(1), Carry7_v, Q_v(7 downto 7), Carry_v);
-- bug fix - parity flag is just parity for 8080, also overflow for Z80
process (Carry_v, Carry7_v, Q_v)
begin
if(Mode=2) then
OverFlow_v <= not (Q_v(0) xor Q_v(1) xor Q_v(2) xor Q_v(3) xor
Q_v(4) xor Q_v(5) xor Q_v(6) xor Q_v(7)); else
OverFlow_v <= Carry_v xor Carry7_v;
end if;
end process;
process (Arith16, ALU_OP, F_In, BusA, BusB, IR, Q_v, Carry_v, HalfCarry_v, OverFlow_v, BitMask, ISet, Z16, WZ, XY_State)
variable Q_t : std_logic_vector(7 downto 0);
variable DAA_Q : unsigned(8 downto 0);
begin
Q_t := "--------";
F_Out <= F_In;
DAA_Q := "---------";
case ALU_Op is
when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" | "0110" | "0111" =>
F_Out(Flag_N) <= '0';
F_Out(Flag_C) <= '0';
case ALU_OP(2 downto 0) is
when "000" | "001" => -- ADD, ADC
Q_t := Q_v;
F_Out(Flag_C) <= Carry_v;
F_Out(Flag_H) <= HalfCarry_v;
F_Out(Flag_P) <= OverFlow_v;
when "010" | "011" | "111" => -- SUB, SBC, CP
Q_t := Q_v;
F_Out(Flag_N) <= '1';
F_Out(Flag_C) <= not Carry_v;
F_Out(Flag_H) <= not HalfCarry_v;
F_Out(Flag_P) <= OverFlow_v;
when "100" => -- AND
Q_t(7 downto 0) := BusA and BusB;
F_Out(Flag_H) <= '1';
when "101" => -- XOR
Q_t(7 downto 0) := BusA xor BusB;
F_Out(Flag_H) <= '0';
when others => -- OR "110"
Q_t(7 downto 0) := BusA or BusB;
F_Out(Flag_H) <= '0';
end case;
if ALU_Op(2 downto 0) = "111" then -- CP
F_Out(Flag_X) <= BusB(3);
F_Out(Flag_Y) <= BusB(5);
else
F_Out(Flag_X) <= Q_t(3);
F_Out(Flag_Y) <= Q_t(5);
end if;
if Q_t(7 downto 0) = "00000000" then
F_Out(Flag_Z) <= '1';
if Z16 = '1' then
F_Out(Flag_Z) <= F_In(Flag_Z); -- 16 bit ADC,SBC
end if;
else
F_Out(Flag_Z) <= '0';
end if;
F_Out(Flag_S) <= Q_t(7);
case ALU_Op(2 downto 0) is
when "000" | "001" | "010" | "011" | "111" => -- ADD, ADC, SUB, SBC, CP
when others =>
F_Out(Flag_P) <= not (Q_t(0) xor Q_t(1) xor Q_t(2) xor Q_t(3) xor
Q_t(4) xor Q_t(5) xor Q_t(6) xor Q_t(7));
end case;
if Arith16 = '1' then
F_Out(Flag_S) <= F_In(Flag_S);
F_Out(Flag_Z) <= F_In(Flag_Z);
F_Out(Flag_P) <= F_In(Flag_P);
end if;
when "1100" =>
-- DAA
F_Out(Flag_H) <= F_In(Flag_H);
F_Out(Flag_C) <= F_In(Flag_C);
DAA_Q(7 downto 0) := unsigned(BusA);
DAA_Q(8) := '0';
if F_In(Flag_N) = '0' then
-- After addition
-- Alow > 9 or H = 1
if DAA_Q(3 downto 0) > 9 or F_In(Flag_H) = '1' then
if (DAA_Q(3 downto 0) > 9) then
F_Out(Flag_H) <= '1';
else
F_Out(Flag_H) <= '0';
end if;
DAA_Q := DAA_Q + 6;
end if;
-- new Ahigh > 9 or C = 1
if DAA_Q(8 downto 4) > 9 or F_In(Flag_C) = '1' then
DAA_Q := DAA_Q + 96; -- 0x60
end if;
else
-- After subtraction
if DAA_Q(3 downto 0) > 9 or F_In(Flag_H) = '1' then
if DAA_Q(3 downto 0) > 5 then
F_Out(Flag_H) <= '0';
end if;
DAA_Q(7 downto 0) := DAA_Q(7 downto 0) - 6;
end if;
if unsigned(BusA) > 153 or F_In(Flag_C) = '1' then
DAA_Q := DAA_Q - 352; -- 0x160
end if;
end if;
F_Out(Flag_X) <= DAA_Q(3);
F_Out(Flag_Y) <= DAA_Q(5);
F_Out(Flag_C) <= F_In(Flag_C) or DAA_Q(8);
Q_t := std_logic_vector(DAA_Q(7 downto 0));
if DAA_Q(7 downto 0) = "00000000" then
F_Out(Flag_Z) <= '1';
else
F_Out(Flag_Z) <= '0';
end if;
F_Out(Flag_S) <= DAA_Q(7);
F_Out(Flag_P) <= not (DAA_Q(0) xor DAA_Q(1) xor DAA_Q(2) xor DAA_Q(3) xor
DAA_Q(4) xor DAA_Q(5) xor DAA_Q(6) xor DAA_Q(7));
when "1101" | "1110" =>
-- RLD, RRD
Q_t(7 downto 4) := BusA(7 downto 4);
if ALU_Op(0) = '1' then
Q_t(3 downto 0) := BusB(7 downto 4);
else
Q_t(3 downto 0) := BusB(3 downto 0);
end if;
F_Out(Flag_H) <= '0';
F_Out(Flag_N) <= '0';
F_Out(Flag_X) <= Q_t(3);
F_Out(Flag_Y) <= Q_t(5);
if Q_t(7 downto 0) = "00000000" then
F_Out(Flag_Z) <= '1';
else
F_Out(Flag_Z) <= '0';
end if;
F_Out(Flag_S) <= Q_t(7);
F_Out(Flag_P) <= not (Q_t(0) xor Q_t(1) xor Q_t(2) xor Q_t(3) xor
Q_t(4) xor Q_t(5) xor Q_t(6) xor Q_t(7));
when "1001" =>
-- BIT
Q_t(7 downto 0) := BusB and BitMask;
F_Out(Flag_S) <= Q_t(7);
if Q_t(7 downto 0) = "00000000" then
F_Out(Flag_Z) <= '1';
F_Out(Flag_P) <= '1';
else
F_Out(Flag_Z) <= '0';
F_Out(Flag_P) <= '0';
end if;
F_Out(Flag_H) <= '1';
F_Out(Flag_N) <= '0';
if IR(2 downto 0) = "110" or XY_State /= "00" then
F_Out(Flag_X) <= WZ(11);
F_Out(Flag_Y) <= WZ(13);
else
F_Out(Flag_X) <= BusB(3);
F_Out(Flag_Y) <= BusB(5);
end if;
when "1010" =>
-- SET
Q_t(7 downto 0) := BusB or BitMask;
when "1011" =>
-- RES
Q_t(7 downto 0) := BusB and not BitMask;
when "1000" =>
-- ROT
case IR(5 downto 3) is
when "000" => -- RLC
Q_t(7 downto 1) := BusA(6 downto 0);
Q_t(0) := BusA(7);
F_Out(Flag_C) <= BusA(7);
when "010" => -- RL
Q_t(7 downto 1) := BusA(6 downto 0);
Q_t(0) := F_In(Flag_C);
F_Out(Flag_C) <= BusA(7);
when "001" => -- RRC
Q_t(6 downto 0) := BusA(7 downto 1);
Q_t(7) := BusA(0);
F_Out(Flag_C) <= BusA(0);
when "011" => -- RR
Q_t(6 downto 0) := BusA(7 downto 1);
Q_t(7) := F_In(Flag_C);
F_Out(Flag_C) <= BusA(0);
when "100" => -- SLA
Q_t(7 downto 1) := BusA(6 downto 0);
Q_t(0) := '0';
F_Out(Flag_C) <= BusA(7);
when "110" => -- SLL (Undocumented) / SWAP
if Mode = 3 then
Q_t(7 downto 4) := BusA(3 downto 0);
Q_t(3 downto 0) := BusA(7 downto 4);
F_Out(Flag_C) <= '0';
else
Q_t(7 downto 1) := BusA(6 downto 0);
Q_t(0) := '1';
F_Out(Flag_C) <= BusA(7);
end if;
when "101" => -- SRA
Q_t(6 downto 0) := BusA(7 downto 1);
Q_t(7) := BusA(7);
F_Out(Flag_C) <= BusA(0);
when others => -- SRL
Q_t(6 downto 0) := BusA(7 downto 1);
Q_t(7) := '0';
F_Out(Flag_C) <= BusA(0);
end case;
F_Out(Flag_H) <= '0';
F_Out(Flag_N) <= '0';
F_Out(Flag_X) <= Q_t(3);
F_Out(Flag_Y) <= Q_t(5);
F_Out(Flag_S) <= Q_t(7);
if Q_t(7 downto 0) = "00000000" then
F_Out(Flag_Z) <= '1';
else
F_Out(Flag_Z) <= '0';
end if;
F_Out(Flag_P) <= not (Q_t(0) xor Q_t(1) xor Q_t(2) xor Q_t(3) xor
Q_t(4) xor Q_t(5) xor Q_t(6) xor Q_t(7));
if ISet = "00" then
F_Out(Flag_P) <= F_In(Flag_P);
F_Out(Flag_S) <= F_In(Flag_S);
F_Out(Flag_Z) <= F_In(Flag_Z);
end if;
when others =>
null;
end case;
Q <= Q_t;
end process;
end;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,152 @@
--------------------------------------------------------------------------------
-- ****
-- T80(c) core. Attempt to finish all undocumented features and provide
-- accurate timings.
-- Version 350.
-- Copyright (c) 2018 Sorgelig
-- Test passed: ZEXDOC, ZEXALL, Z80Full(*), Z80memptr
-- (*) Currently only SCF and CCF instructions aren't passed X/Y flags check as
-- correct implementation is still unclear.
--
-- ****
-- T80(b) core. In an effort to merge and maintain bug fixes ....
--
--
-- Ver 300 started tidyup
-- MikeJ March 2005
-- Latest version from www.fpgaarcade.com (original www.opencores.org)
--
-- ****
--
-- T80 Registers, technology independent
--
-- Version : 0244
--
-- 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.opencores.org/cvsweb.shtml/t51/
--
-- Limitations :
--
-- File history :
--
-- 0242 : Initial release
--
-- 0244 : Changed to single register file
--
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
entity T80_Reg is
port(
Clk : in std_logic;
CEN : in std_logic;
WEH : in std_logic;
WEL : in std_logic;
AddrA : in std_logic_vector(2 downto 0);
AddrB : in std_logic_vector(2 downto 0);
AddrC : in std_logic_vector(2 downto 0);
DIH : in std_logic_vector(7 downto 0);
DIL : in std_logic_vector(7 downto 0);
DOAH : out std_logic_vector(7 downto 0);
DOAL : out std_logic_vector(7 downto 0);
DOBH : out std_logic_vector(7 downto 0);
DOBL : out std_logic_vector(7 downto 0);
DOCH : out std_logic_vector(7 downto 0);
DOCL : out std_logic_vector(7 downto 0);
DOR : out std_logic_vector(127 downto 0);
DIRSet : in std_logic;
DIR : in std_logic_vector(127 downto 0)
);
end T80_Reg;
architecture rtl of T80_Reg is
type Register_Image is array (natural range <>) of std_logic_vector(7 downto 0);
signal RegsH : Register_Image(0 to 7);
signal RegsL : Register_Image(0 to 7);
begin
process (Clk)
begin
if rising_edge(Clk) then
if DIRSet = '1' then
RegsL(0) <= DIR( 7 downto 0);
RegsH(0) <= DIR( 15 downto 8);
RegsL(1) <= DIR( 23 downto 16);
RegsH(1) <= DIR( 31 downto 24);
RegsL(2) <= DIR( 39 downto 32);
RegsH(2) <= DIR( 47 downto 40);
RegsL(3) <= DIR( 55 downto 48);
RegsH(3) <= DIR( 63 downto 56);
RegsL(4) <= DIR( 71 downto 64);
RegsH(4) <= DIR( 79 downto 72);
RegsL(5) <= DIR( 87 downto 80);
RegsH(5) <= DIR( 95 downto 88);
RegsL(6) <= DIR(103 downto 96);
RegsH(6) <= DIR(111 downto 104);
RegsL(7) <= DIR(119 downto 112);
RegsH(7) <= DIR(127 downto 120);
elsif CEN = '1' then
if WEH = '1' then
RegsH(to_integer(unsigned(AddrA))) <= DIH;
end if;
if WEL = '1' then
RegsL(to_integer(unsigned(AddrA))) <= DIL;
end if;
end if;
end if;
end process;
DOAH <= RegsH(to_integer(unsigned(AddrA)));
DOAL <= RegsL(to_integer(unsigned(AddrA)));
DOBH <= RegsH(to_integer(unsigned(AddrB)));
DOBL <= RegsL(to_integer(unsigned(AddrB)));
DOCH <= RegsH(to_integer(unsigned(AddrC)));
DOCL <= RegsL(to_integer(unsigned(AddrC)));
DOR <= RegsH(7) & RegsL(7) & RegsH(6) & RegsL(6) & RegsH(5) & RegsL(5) & RegsH(4) & RegsL(4) & RegsH(3) & RegsL(3) & RegsH(2) & RegsL(2) & RegsH(1) & RegsL(1) & RegsH(0) & RegsL(0);
end;

View File

@ -0,0 +1,216 @@
--
-- Z80 compatible microprocessor core, preudo-asynchronous top level (by Sorgelig)
--
-- Copyright (c) 2001-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.opencores.org/cvsweb.shtml/t80/
--
-- File history :
--
-- v1.0: convert to preudo-asynchronous model with original Z80 timings.
--
-- v2.0: rewritten for more precise timings.
-- support for both CEN_n and CEN_p set to 1. Effective clock will be CLK/2.
--
-- v2.1: Output Address 0 during non-bus MCycle (fix ZX contention)
--
-- v2.2: Interrupt acknowledge cycle has been corrected
-- WAIT_n is broken in T80.vhd. Simulate correct WAIT_n locally.
--
-- v2.3: Output last used Address during non-bus MCycle seems more correct.
--
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
entity T80pa is
generic(
Mode : integer := 0 -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB
);
port(
RESET_n : in std_logic;
CLK : in std_logic;
CEN_p : in std_logic := '1';
CEN_n : in std_logic := '1';
WAIT_n : in std_logic := '1';
INT_n : in std_logic := '1';
NMI_n : in std_logic := '1';
BUSRQ_n : in std_logic := '1';
M1_n : out std_logic;
MREQ_n : out std_logic;
IORQ_n : out std_logic;
RD_n : out std_logic;
WR_n : out std_logic;
RFSH_n : out std_logic;
HALT_n : out std_logic;
BUSAK_n : out std_logic;
OUT0 : in std_logic := '0'; -- 0 => OUT(C),0, 1 => OUT(C),255
A : out std_logic_vector(15 downto 0);
DI : in std_logic_vector(7 downto 0);
DO : out std_logic_vector(7 downto 0);
REG : out std_logic_vector(211 downto 0); -- IFF2, IFF1, IM, IY, HL', DE', BC', IX, HL, DE, BC, PC, SP, R, I, F', A', F, A
DIRSet : in std_logic := '0';
DIR : in std_logic_vector(211 downto 0) := (others => '0') -- IFF2, IFF1, IM, IY, HL', DE', BC', IX, HL, DE, BC, PC, SP, R, I, F', A', F, A
);
end T80pa;
architecture rtl of T80pa is
signal IntCycle_n : std_logic;
signal IntCycleD_n : std_logic_vector(1 downto 0);
signal IORQ : std_logic;
signal NoRead : std_logic;
signal Write : std_logic;
signal BUSAK : std_logic;
signal DI_Reg : std_logic_vector (7 downto 0); -- Input synchroniser
signal MCycle : std_logic_vector(2 downto 0);
signal TState : std_logic_vector(2 downto 0);
signal CEN_pol : std_logic;
signal A_int : std_logic_vector(15 downto 0);
signal A_last : std_logic_vector(15 downto 0);
begin
A <= A_int when NoRead = '0' or Write = '1' else A_last;
BUSAK_n <= BUSAK;
u0 : work.T80
generic map(
Mode => Mode,
IOWait => 1
)
port map(
CEN => CEN_p and not CEN_pol,
M1_n => M1_n,
IORQ => IORQ,
NoRead => NoRead,
Write => Write,
RFSH_n => RFSH_n,
HALT_n => HALT_n,
WAIT_n => '1',
INT_n => INT_n,
NMI_n => NMI_n,
RESET_n => RESET_n,
BUSRQ_n => BUSRQ_n,
BUSAK_n => BUSAK,
CLK_n => CLK,
A => A_int,
DInst => DI, -- valid at beginning of T3
DI => DI_Reg, -- latched at middle of T3
DO => DO,
REG => REG,
MC => MCycle,
TS => TState,
OUT0 => OUT0,
IntCycle_n => IntCycle_n,
DIRSet => DIRSet,
DIR => DIR
);
process(CLK)
begin
if rising_edge(CLK) then
if RESET_n = '0' then
WR_n <= '1';
RD_n <= '1';
IORQ_n <= '1';
MREQ_n <= '1';
DI_Reg <= "00000000";
CEN_pol <= '0';
elsif CEN_p = '1' and CEN_pol = '0' then
CEN_pol <= '1';
if MCycle = "001" then
if TState = "010" then
IORQ_n <= '1';
MREQ_n <= '1';
RD_n <= '1';
end if;
else
if TState = "001" and IORQ = '1' then
WR_n <= not Write;
RD_n <= Write;
IORQ_n <= '0';
end if;
end if;
elsif CEN_n = '1' and CEN_pol = '1' then
if TState = "010" then
CEN_pol <= not WAIT_n;
else
CEN_pol <= '0';
end if;
if TState = "011" and BUSAK = '1' then
DI_Reg <= DI;
end if;
if MCycle = "001" then
if TState = "001" then
IntCycleD_n <= IntCycleD_n(0) & IntCycle_n;
RD_n <= not IntCycle_n;
MREQ_n <= not IntCycle_n;
IORQ_n <= IntCycleD_n(1);
A_last <= A_int;
end if;
if TState = "011" then
IntCycleD_n <= "11";
RD_n <= '1';
MREQ_n <= '0';
end if;
if TState = "100" then
MREQ_n <= '1';
end if;
else
if NoRead = '0' and IORQ = '0' then
if TState = "001" then
RD_n <= Write;
MREQ_n <= '0';
A_last <= A_int;
end if;
end if;
if TState = "010" then
WR_n <= not Write;
end if;
if TState = "011" then
WR_n <= '1';
RD_n <= '1';
IORQ_n <= '1';
MREQ_n <= '1';
end if;
end if;
end if;
end if;
end process;
end;

View File

@ -1,442 +0,0 @@
//
// TV80 8-Bit Microprocessor Core
// Based on the VHDL T80 core by Daniel Wallner (jesus@opencores.org)
//
// Copyright (c) 2004 Guy Hutchison (ghutchis@opencores.org)
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
module tv80_alu (/*AUTOARG*/
// Outputs
Q, F_Out,
// Inputs
Arith16, Z16, ALU_Op, IR, ISet, BusA, BusB, F_In
);
parameter Mode = 0;
parameter Flag_C = 0;
parameter Flag_N = 1;
parameter Flag_P = 2;
parameter Flag_X = 3;
parameter Flag_H = 4;
parameter Flag_Y = 5;
parameter Flag_Z = 6;
parameter Flag_S = 7;
input Arith16;
input Z16;
input [3:0] ALU_Op ;
input [5:0] IR;
input [1:0] ISet;
input [7:0] BusA;
input [7:0] BusB;
input [7:0] F_In;
output [7:0] Q;
output [7:0] F_Out;
reg [7:0] Q;
reg [7:0] F_Out;
function [4:0] AddSub4;
input [3:0] A;
input [3:0] B;
input Sub;
input Carry_In;
begin
AddSub4 = { 1'b0, A } + { 1'b0, (Sub)?~B:B } + Carry_In;
end
endfunction // AddSub4
function [3:0] AddSub3;
input [2:0] A;
input [2:0] B;
input Sub;
input Carry_In;
begin
AddSub3 = { 1'b0, A } + { 1'b0, (Sub)?~B:B } + Carry_In;
end
endfunction // AddSub4
function [1:0] AddSub1;
input A;
input B;
input Sub;
input Carry_In;
begin
AddSub1 = { 1'b0, A } + { 1'b0, (Sub)?~B:B } + Carry_In;
end
endfunction // AddSub4
// AddSub variables (temporary signals)
reg UseCarry;
reg Carry7_v;
reg OverFlow_v;
reg HalfCarry_v;
reg Carry_v;
reg [7:0] Q_v;
reg [7:0] BitMask;
always @(/*AUTOSENSE*/ALU_Op or BusA or BusB or F_In or IR)
begin
case (IR[5:3])
3'b000 : BitMask = 8'b00000001;
3'b001 : BitMask = 8'b00000010;
3'b010 : BitMask = 8'b00000100;
3'b011 : BitMask = 8'b00001000;
3'b100 : BitMask = 8'b00010000;
3'b101 : BitMask = 8'b00100000;
3'b110 : BitMask = 8'b01000000;
default: BitMask = 8'b10000000;
endcase // case(IR[5:3])
UseCarry = ~ ALU_Op[2] && ALU_Op[0];
{ HalfCarry_v, Q_v[3:0] } = AddSub4(BusA[3:0], BusB[3:0], ALU_Op[1], ALU_Op[1] ^ (UseCarry && F_In[Flag_C]) );
{ Carry7_v, Q_v[6:4] } = AddSub3(BusA[6:4], BusB[6:4], ALU_Op[1], HalfCarry_v);
{ Carry_v, Q_v[7] } = AddSub1(BusA[7], BusB[7], ALU_Op[1], Carry7_v);
OverFlow_v = Carry_v ^ Carry7_v;
end // always @ *
reg [7:0] Q_t;
reg [8:0] DAA_Q;
always @ (/*AUTOSENSE*/ALU_Op or Arith16 or BitMask or BusA or BusB
or Carry_v or F_In or HalfCarry_v or IR or ISet
or OverFlow_v or Q_v or Z16)
begin
Q_t = 8'hxx;
DAA_Q = {9{1'bx}};
F_Out = F_In;
case (ALU_Op)
4'b0000, 4'b0001, 4'b0010, 4'b0011, 4'b0100, 4'b0101, 4'b0110, 4'b0111 :
begin
F_Out[Flag_N] = 1'b0;
F_Out[Flag_C] = 1'b0;
case (ALU_Op[2:0])
3'b000, 3'b001 : // ADD, ADC
begin
Q_t = Q_v;
F_Out[Flag_C] = Carry_v;
F_Out[Flag_H] = HalfCarry_v;
F_Out[Flag_P] = OverFlow_v;
end
3'b010, 3'b011, 3'b111 : // SUB, SBC, CP
begin
Q_t = Q_v;
F_Out[Flag_N] = 1'b1;
F_Out[Flag_C] = ~ Carry_v;
F_Out[Flag_H] = ~ HalfCarry_v;
F_Out[Flag_P] = OverFlow_v;
end
3'b100 : // AND
begin
Q_t[7:0] = BusA & BusB;
F_Out[Flag_H] = 1'b1;
end
3'b101 : // XOR
begin
Q_t[7:0] = BusA ^ BusB;
F_Out[Flag_H] = 1'b0;
end
default : // OR 3'b110
begin
Q_t[7:0] = BusA | BusB;
F_Out[Flag_H] = 1'b0;
end
endcase // case(ALU_OP[2:0])
if (ALU_Op[2:0] == 3'b111 )
begin // CP
F_Out[Flag_X] = BusB[3];
F_Out[Flag_Y] = BusB[5];
end
else
begin
F_Out[Flag_X] = Q_t[3];
F_Out[Flag_Y] = Q_t[5];
end
if (Q_t[7:0] == 8'b00000000 )
begin
F_Out[Flag_Z] = 1'b1;
if (Z16 == 1'b1 )
begin
F_Out[Flag_Z] = F_In[Flag_Z]; // 16 bit ADC,SBC
end
end
else
begin
F_Out[Flag_Z] = 1'b0;
end // else: !if(Q_t[7:0] == 8'b00000000 )
F_Out[Flag_S] = Q_t[7];
case (ALU_Op[2:0])
3'b000, 3'b001, 3'b010, 3'b011, 3'b111 : // ADD, ADC, SUB, SBC, CP
;
default :
F_Out[Flag_P] = ~(^Q_t);
endcase // case(ALU_Op[2:0])
if (Arith16 == 1'b1 )
begin
F_Out[Flag_S] = F_In[Flag_S];
F_Out[Flag_Z] = F_In[Flag_Z];
F_Out[Flag_P] = F_In[Flag_P];
end
end // case: 4'b0000, 4'b0001, 4'b0010, 4'b0011, 4'b0100, 4'b0101, 4'b0110, 4'b0111
4'b1100 :
begin
// DAA
F_Out[Flag_H] = F_In[Flag_H];
F_Out[Flag_C] = F_In[Flag_C];
DAA_Q[7:0] = BusA;
DAA_Q[8] = 1'b0;
if (F_In[Flag_N] == 1'b0 )
begin
// After addition
// Alow > 9 || H == 1
if (DAA_Q[3:0] > 9 || F_In[Flag_H] == 1'b1 )
begin
if ((DAA_Q[3:0] > 9) )
begin
F_Out[Flag_H] = 1'b1;
end
else
begin
F_Out[Flag_H] = 1'b0;
end
DAA_Q = DAA_Q + 6;
end // if (DAA_Q[3:0] > 9 || F_In[Flag_H] == 1'b1 )
// new Ahigh > 9 || C == 1
if (DAA_Q[8:4] > 9 || F_In[Flag_C] == 1'b1 )
begin
DAA_Q = DAA_Q + 96; // 0x60
end
end
else
begin
// After subtraction
if (DAA_Q[3:0] > 9 || F_In[Flag_H] == 1'b1 )
begin
if (DAA_Q[3:0] > 5 )
begin
F_Out[Flag_H] = 1'b0;
end
DAA_Q[7:0] = DAA_Q[7:0] - 6;
end
if (BusA > 153 || F_In[Flag_C] == 1'b1 )
begin
DAA_Q = DAA_Q - 352; // 0x160
end
end // else: !if(F_In[Flag_N] == 1'b0 )
F_Out[Flag_X] = DAA_Q[3];
F_Out[Flag_Y] = DAA_Q[5];
F_Out[Flag_C] = F_In[Flag_C] || DAA_Q[8];
Q_t = DAA_Q[7:0];
if (DAA_Q[7:0] == 8'b00000000 )
begin
F_Out[Flag_Z] = 1'b1;
end
else
begin
F_Out[Flag_Z] = 1'b0;
end
F_Out[Flag_S] = DAA_Q[7];
F_Out[Flag_P] = ~ (^DAA_Q);
end // case: 4'b1100
4'b1101, 4'b1110 :
begin
// RLD, RRD
Q_t[7:4] = BusA[7:4];
if (ALU_Op[0] == 1'b1 )
begin
Q_t[3:0] = BusB[7:4];
end
else
begin
Q_t[3:0] = BusB[3:0];
end
F_Out[Flag_H] = 1'b0;
F_Out[Flag_N] = 1'b0;
F_Out[Flag_X] = Q_t[3];
F_Out[Flag_Y] = Q_t[5];
if (Q_t[7:0] == 8'b00000000 )
begin
F_Out[Flag_Z] = 1'b1;
end
else
begin
F_Out[Flag_Z] = 1'b0;
end
F_Out[Flag_S] = Q_t[7];
F_Out[Flag_P] = ~(^Q_t);
end // case: when 4'b1101, 4'b1110
4'b1001 :
begin
// BIT
Q_t[7:0] = BusB & BitMask;
F_Out[Flag_S] = Q_t[7];
if (Q_t[7:0] == 8'b00000000 )
begin
F_Out[Flag_Z] = 1'b1;
F_Out[Flag_P] = 1'b1;
end
else
begin
F_Out[Flag_Z] = 1'b0;
F_Out[Flag_P] = 1'b0;
end
F_Out[Flag_H] = 1'b1;
F_Out[Flag_N] = 1'b0;
F_Out[Flag_X] = 1'b0;
F_Out[Flag_Y] = 1'b0;
if (IR[2:0] != 3'b110 )
begin
F_Out[Flag_X] = BusB[3];
F_Out[Flag_Y] = BusB[5];
end
end // case: when 4'b1001
4'b1010 :
// SET
Q_t[7:0] = BusB | BitMask;
4'b1011 :
// RES
Q_t[7:0] = BusB & ~ BitMask;
4'b1000 :
begin
// ROT
case (IR[5:3])
3'b000 : // RLC
begin
Q_t[7:1] = BusA[6:0];
Q_t[0] = BusA[7];
F_Out[Flag_C] = BusA[7];
end
3'b010 : // RL
begin
Q_t[7:1] = BusA[6:0];
Q_t[0] = F_In[Flag_C];
F_Out[Flag_C] = BusA[7];
end
3'b001 : // RRC
begin
Q_t[6:0] = BusA[7:1];
Q_t[7] = BusA[0];
F_Out[Flag_C] = BusA[0];
end
3'b011 : // RR
begin
Q_t[6:0] = BusA[7:1];
Q_t[7] = F_In[Flag_C];
F_Out[Flag_C] = BusA[0];
end
3'b100 : // SLA
begin
Q_t[7:1] = BusA[6:0];
Q_t[0] = 1'b0;
F_Out[Flag_C] = BusA[7];
end
3'b110 : // SLL (Undocumented) / SWAP
begin
if (Mode == 3 )
begin
Q_t[7:4] = BusA[3:0];
Q_t[3:0] = BusA[7:4];
F_Out[Flag_C] = 1'b0;
end
else
begin
Q_t[7:1] = BusA[6:0];
Q_t[0] = 1'b1;
F_Out[Flag_C] = BusA[7];
end // else: !if(Mode == 3 )
end // case: 3'b110
3'b101 : // SRA
begin
Q_t[6:0] = BusA[7:1];
Q_t[7] = BusA[7];
F_Out[Flag_C] = BusA[0];
end
default : // SRL
begin
Q_t[6:0] = BusA[7:1];
Q_t[7] = 1'b0;
F_Out[Flag_C] = BusA[0];
end
endcase // case(IR[5:3])
F_Out[Flag_H] = 1'b0;
F_Out[Flag_N] = 1'b0;
F_Out[Flag_X] = Q_t[3];
F_Out[Flag_Y] = Q_t[5];
F_Out[Flag_S] = Q_t[7];
if (Q_t[7:0] == 8'b00000000 )
begin
F_Out[Flag_Z] = 1'b1;
end
else
begin
F_Out[Flag_Z] = 1'b0;
end
F_Out[Flag_P] = ~(^Q_t);
if (ISet == 2'b00 )
begin
F_Out[Flag_P] = F_In[Flag_P];
F_Out[Flag_S] = F_In[Flag_S];
F_Out[Flag_Z] = F_In[Flag_Z];
end
end // case: 4'b1000
default :
;
endcase // case(ALU_Op)
Q = Q_t;
end // always @ (Arith16, ALU_OP, F_In, BusA, BusB, IR, Q_v, Carry_v, HalfCarry_v, OverFlow_v, BitMask, ISet, Z16)
endmodule // T80_ALU

View File

@ -1,68 +0,0 @@
//
// TV80 8-Bit Microprocessor Core
// Based on the VHDL T80 core by Daniel Wallner (jesus@opencores.org)
//
// Copyright (c) 2004 Guy Hutchison (ghutchis@opencores.org)
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
module tv80_reg (/*AUTOARG*/
// Outputs
DOBH, DOAL, DOCL, DOBL, DOCH, DOAH,
// Inputs
AddrC, AddrA, AddrB, DIH, DIL, clk, CEN, WEH, WEL
);
input [2:0] AddrC;
output [7:0] DOBH;
input [2:0] AddrA;
input [2:0] AddrB;
input [7:0] DIH;
output [7:0] DOAL;
output [7:0] DOCL;
input [7:0] DIL;
output [7:0] DOBL;
output [7:0] DOCH;
output [7:0] DOAH;
input clk, CEN, WEH, WEL;
reg [7:0] RegsH [0:7];
reg [7:0] RegsL [0:7];
always @(posedge clk)
begin
if (CEN)
begin
if (WEH) RegsH[AddrA] <= DIH;
if (WEL) RegsL[AddrA] <= DIL;
end
end
assign DOAH = RegsH[AddrA];
assign DOAL = RegsL[AddrA];
assign DOBH = RegsH[AddrB];
assign DOBL = RegsL[AddrB];
assign DOCH = RegsH[AddrC];
assign DOCL = RegsL[AddrC];
// break out ram bits for waveform debug
wire [7:0] H = RegsH[2];
wire [7:0] L = RegsL[2];
endmodule

View File

@ -1,182 +0,0 @@
//
// TV80 8-Bit Microprocessor Core
// Based on the VHDL T80 core by Daniel Wallner (jesus@opencores.org)
//
// Copyright (c) 2004 Guy Hutchison (ghutchis@opencores.org)
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// Negative-edge based wrapper allows memory wait_n signal to work
// correctly without resorting to asynchronous logic.
module tv80n (/*AUTOARG*/
// Outputs
m1_n, mreq_n, iorq_n, rd_n, wr_n, rfsh_n, halt_n, busak_n, A, dout,
// Inputs
reset_n, clk, wait_n, int_n, nmi_n, busrq_n, di
);
parameter Mode = 0; // 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB
parameter T2Write = 0; // 0 => wr_n active in T3, /=0 => wr_n active in T2
parameter IOWait = 1; // 0 => Single cycle I/O, 1 => Std I/O cycle
input reset_n;
input clk;
input wait_n;
input int_n;
input nmi_n;
input busrq_n;
output m1_n;
output mreq_n;
output iorq_n;
output rd_n;
output wr_n;
output rfsh_n;
output halt_n;
output busak_n;
output [15:0] A;
input [7:0] di;
output [7:0] dout;
reg mreq_n;
reg iorq_n;
reg rd_n;
reg wr_n;
reg nxt_mreq_n;
reg nxt_iorq_n;
reg nxt_rd_n;
reg nxt_wr_n;
wire cen;
wire intcycle_n;
wire no_read;
wire write;
wire iorq;
reg [7:0] di_reg;
wire [6:0] mcycle;
wire [6:0] tstate;
assign cen = 1;
tv80_core #(Mode, IOWait) i_tv80_core
(
.cen (cen),
.m1_n (m1_n),
.iorq (iorq),
.no_read (no_read),
.write (write),
.rfsh_n (rfsh_n),
.halt_n (halt_n),
.wait_n (wait_n),
.int_n (int_n),
.nmi_n (nmi_n),
.reset_n (reset_n),
.busrq_n (busrq_n),
.busak_n (busak_n),
.clk (clk),
.IntE (),
.stop (),
.A (A),
.dinst (di),
.di (di_reg),
.dout (dout),
.mc (mcycle),
.ts (tstate),
.intcycle_n (intcycle_n)
);
always @*
begin
nxt_mreq_n = 1;
nxt_rd_n = 1;
nxt_iorq_n = 1;
nxt_wr_n = 1;
if (mcycle[0])
begin
if (tstate[1] || tstate[2])
begin
nxt_rd_n = ~ intcycle_n;
nxt_mreq_n = ~ intcycle_n;
nxt_iorq_n = intcycle_n;
end
end // if (mcycle[0])
else
begin
if ((tstate[1] || tstate[2]) && !no_read && !write)
begin
nxt_rd_n = 1'b0;
nxt_iorq_n = ~ iorq;
nxt_mreq_n = iorq;
end
if (T2Write == 0)
begin
if (tstate[2] && write)
begin
nxt_wr_n = 1'b0;
nxt_iorq_n = ~ iorq;
nxt_mreq_n = iorq;
end
end
else
begin
if ((tstate[1] || (tstate[2] && !wait_n)) && write)
begin
nxt_wr_n = 1'b0;
nxt_iorq_n = ~ iorq;
nxt_mreq_n = iorq;
end
end // else: !if(T2write == 0)
end // else: !if(mcycle[0])
end // always @ *
always @(negedge clk)
begin
if (!reset_n)
begin
rd_n <= #1 1'b1;
wr_n <= #1 1'b1;
iorq_n <= #1 1'b1;
mreq_n <= #1 1'b1;
end
else
begin
rd_n <= #1 nxt_rd_n;
wr_n <= #1 nxt_wr_n;
iorq_n <= #1 nxt_iorq_n;
mreq_n <= #1 nxt_mreq_n;
end // else: !if(!reset_n)
end // always @ (posedge clk or negedge reset_n)
always @(posedge clk)
begin
if (!reset_n)
begin
di_reg <= #1 0;
end
else
begin
if (tstate[2] && wait_n == 1'b1)
di_reg <= #1 di;
end // else: !if(!reset_n)
end // always @ (posedge clk)
endmodule // t80n

View File

@ -0,0 +1,353 @@
-- http://srecord.sourceforge.net/
--
-- Generated automatically by srec -o --mif
--
DEPTH = 8192;
WIDTH = 8;
ADDRESS_RADIX = HEX;
DATA_RADIX = HEX;
CONTENT BEGIN
0000: F3 21 00 3C 3E FC 18 20 D9 DD CB 3E 5E C3 EE 03 2A 3B 3C 73 23 C3 5F 08;
0018: 2A 3B 3C 2B 56 C3 59 08 E1 7E 32 3D 3C C3 AD 00 24 77 BE 28 FB A4 67 22;
0030: 18 3C F9 21 0D 01 18 03 C3 3A 01 11 24 3C 01 2D 00 ED B0 DD 21 00 3C FD;
0048: 21 C8 04 CD 24 0A AF 32 00 27 21 00 2C 7D E6 BF 0F 0F 0F 30 02 0F 0F 0F;
0060: 47 9F CB 18 47 9F A8 E6 F0 A8 77 2C 20 E7 11 FF 2F 21 FB 1F 01 08 00 ED;
0078: B8 EB 3E 5F 0E 07 CB 6F 28 03 70 2B 0D EB ED B8 EB 70 2B 3D 20 EE ED 56;
0090: 18 09 51 55 49 D4 00 00 04 9B 00 ED 7B 18 3C FB C3 F2 04 41 42 4F 52 D4;
00A8: 98 00 05 AD 00 FD E5 FD 21 B9 04 2A 37 3C 22 3B 3C 21 3E 3C 7E E6 B3 CB;
00C0: 56 77 28 1A CD B9 04 90 04 B3 08 4B 10 05 D2 0D 6B 08 10 16 B5 15 11 10;
00D8: 37 3C C1 08 0E 1A DD CB 3D 7E 20 1B CD 08 18 45 52 52 4F D2 CD B9 04 11;
00F0: 10 3D 3C 96 08 B3 09 95 0A 0E 1A DD 36 3D FF 2A 37 3C 01 0C 00 09 22 3B;
0108: 3C FD E1 18 8E E0 26 00 00 00 00 00 00 00 00 00 00 00 4C 3C 4C 3C 4F 3C;
0120: 51 3C 45 3C 5D 3C FF 00 0A 46 4F 52 54 C8 00 00 FF 1F 05 B5 11 49 3C 00;
0138: 00 00 F5 08 F5 C5 D5 E5 06 3E 10 FE 21 2B 3C 34 23 28 FC CD 10 03 21 28;
0150: 3C CB 46 28 21 A7 28 1E FE 20 38 14 CB 4E C4 07 08 CB 56 28 02 E6 9F CB;
0168: 5E 28 02 F6 80 CD 96 01 CD E6 01 CD 82 02 E1 D1 C1 F1 08 F1 FB C9 FE 0D;
0180: 20 14 21 00 27 22 22 3C 22 20 3C AF CD 98 01 21 E0 26 22 1E 3C C9 A7 C8;
0198: 08 2A 22 3C 7E A7 28 06 11 00 D9 19 30 28 ED 5B 24 3C 21 A0 DB 19 30 34;
01B0: 2A 1C 3C 01 20 00 09 ED 52 D5 D4 21 04 CD B0 02 D1 CD 2F 04 21 1E 3C 06;
01C8: 04 CD 43 04 10 FB CD 02 03 54 5D 23 22 22 3C 2B 2B 28 02 ED B8 08 12 13;
01E0: ED 53 20 3C AF C9 21 F0 01 16 00 5F 19 5E 19 E9 20 13 0C 1E 0A 37 1A 50;
01F8: 06 9C C9 15 14 D3 21 28 3C AE 77 C9 2A 20 3C 2B 7E A7 C8 22 20 3C 23 77;
0210: C9 2A 20 3C 23 ED 5B 22 3C A7 ED 52 C8 19 22 20 3C 7E 2B 77 C9 2A 20 3C;
0228: 23 22 20 3C CD 02 03 62 6B 1B 1A A7 C8 ED 53 20 3C 78 B1 28 02 ED B0 2B;
0240: 36 20 22 22 3C 0C C9 CD 04 02 28 08 06 1F CD 04 02 10 FB C9 2A 1E 3C ED;
0258: 5B 24 3C A7 ED 52 C8 CD 25 02 2A 1E 3C 11 E0 FF AF 19 BE 20 FC 22 1E 3C;
0270: CD F4 02 22 20 3C 3E A0 CD 7E 01 2A 20 3C 2B 22 20 3C 2A 20 3C 3A 28 3C;
0288: 1F 36 97 1F 30 02 36 C3 1F D0 36 C7 C9 CD 11 02 28 08 06 1F CD 11 02 10;
02A0: FB C9 CD B0 02 E0 E5 CD 25 02 E1 CD ED 02 18 C6 21 00 27 ED 5B 1E 3C A7;
02B8: ED 52 44 4D EB 23 AF ED B1 2B C9 2A 22 3C 2B 22 20 3C CD 2C 02 20 FB C9;
02D0: 21 28 3C CB EE CB 86 C9 21 00 27 ED 5B 24 3C CD FA 07 21 E0 26 22 24 3C;
02E8: 36 00 2A 24 3C 22 1E 3C 23 22 20 3C CD B0 02 3E 20 2B BE 28 FC 23 22 22;
0300: 3C C9 2A 22 3C ED 5B 20 3C A7 ED 52 44 4D 19 C9 CD 36 03 47 2A 26 3C AD;
0318: 28 0B AD 28 03 AF BD C0 68 26 20 18 0D 25 7C FE 1E 28 06 AF BC 20 03 26;
0330: 04 7D 22 26 3C C9 01 FE FE ED 50 5A CB 3A 9F E6 D8 CB 3A 38 02 3E 28 C6;
0348: 57 6F 7B F6 03 1E FF 2F E6 1F 57 28 0D 7D 1C 20 12 D6 08 CB 3A 30 FA 5F;
0360: 20 09 2D CB 00 30 06 ED 78 18 E4 1E FF 7B 3C C8 21 76 03 19 7E C9 76 68;
0378: 79 36 35 74 67 63 62 6A 75 37 34 72 66 78 6E 6B 69 38 33 65 64 7A 6D 6C;
0390: 6F 39 32 77 73 00 20 0D 70 30 31 71 61 00 56 48 59 07 01 54 47 43 42 4A;
03A8: 55 09 08 52 46 58 4E 4B 49 03 33 45 44 5A 4D 4C 4F 04 02 57 53 00 20 0D;
03C0: 50 05 0A 51 41 00 2F 5E 5B 26 25 3E 7D 3F 2A 2D 5D 27 24 3C 7B 60 2C 2B;
03D8: 7F 28 23 45 5C 3A 2E 3D 3B 29 40 57 7C 00 20 0D 22 5F 21 51 7E 00 28 05;
03F0: CD 7E 01 D9 C9 47 2A 29 3C 7C B5 78 28 01 E9 2A 1C 3C ED 5B 24 3C EB 37;
0408: ED 52 EB DC 21 04 FE 0D 28 04 77 23 18 06 23 7D E6 1F 20 FA 22 1C 3C D9;
0420: C9 F5 21 1C 3C CD 43 04 F1 2A 24 3C 11 20 24 A7 ED 52 44 4D 21 E0 FF 19;
0438: EB ED B0 06 20 2B 36 20 10 FB C9 7E D6 20 77 23 30 01 35 23 C9 EB 5E 16;
0450: 00 21 00 3C 19 EB D7 FD E9 48 45 52 C5 AA 00 04 62 04 ED 5B 37 3C D7 FD;
0468: E9 43 4F 4E 54 45 58 D4 5F 04 07 4D 04 33 43 55 52 52 45 4E D4 72 04 07;
0480: 4D 04 31 42 41 53 C5 7F 04 04 4D 04 3F 4D 04 3E 4D 04 39 50 41 C4 89 04;
0498: 03 F5 0F 01 27 BB 98 04 41 08 11 B6 04 D8 12 0A 0E 1A 21 3E 3C 7E E6 BB;
04B0: 77 FD E9 00 E8 FF B8 04 E1 E1 5E 23 56 23 E5 EB 5E 23 56 23 EB E9 C8 04;
04C8: 01 0B 00 ED 5B 3B 3C 2A 37 3C 09 ED 52 38 02 E7 02 01 00 00 CD 8C 0F CD;
04E0: E4 04 18 D5 3E FE DB FE 1F D8 3E 7F DB FE 1F D8 E7 03 CD B9 04 8C 05 06;
04F8: 05 36 05 76 12 F7 FF 4C 49 4E C5 A0 04 04 C3 0E C6 04 3D 06 EE 08 83 12;
0510: 07 00 4F 05 76 12 F1 FF A9 06 EE 08 83 12 07 00 64 05 76 12 E3 FF 1B 06;
0528: 1A 0C 83 12 03 00 B6 04 78 05 76 12 D3 FF 38 05 3A 3E 3C CB 77 20 0E CB;
0540: 67 20 0A CD 08 18 20 4F 4B A0 3E 0D CF FD E9 51 05 DF 1B 1A 2F DD A6 3E;
0558: E6 40 13 28 04 D7 11 4E 0F C3 BF 04 66 05 DF DD CB 3E 76 20 F4 FD E9 52;
0570: 45 54 59 50 C5 8B 05 06 7A 05 CD EA 02 CD 76 02 36 BF 18 10 51 55 45 52;
0588: D9 05 05 05 8E 05 CD D8 02 CD 76 02 21 28 3C CB C6 CB AE CB 6E 28 FC CD;
05A0: 25 02 FD E9 57 4F 52 C4 77 05 04 AD 05 DF 21 FE 27 06 FD 36 20 2B 10 FB;
05B8: D5 EB D7 D1 CD E1 05 04 05 28 03 01 FF 00 21 01 27 71 23 3E FC B9 30 01;
05D0: 4F 0C D5 C5 EB ED B0 C1 D1 0D CD DA 07 FD E9 1E 20 2A 24 3C 22 1E 3C 01;
05E8: 00 00 23 7E BB 28 FB A7 28 0E E5 03 23 7E A7 28 03 BB 20 F7 D1 AF B8 C9;
0600: D5 CD B0 02 E2 14 06 ED 5B 24 3C CD FA 07 22 24 3C D1 18 CD EB C1 01 00;
0618: 00 37 C9 1D 06 CD DF 05 50 59 D7 FD E9 56 4C 49 53 D4 AA 05 05 2F 06 3E;
0630: 0D CF 0E 00 18 0E 46 49 4E C4 2C 06 04 3F 06 CD DF 05 38 46 2A 33 3C 7E;
0648: 23 66 6F 7E E6 3F 28 2F A9 28 04 79 A7 20 28 D5 E5 CD E8 15 B1 28 17 41;
0660: 1A CD 07 08 13 AE E6 7F 23 20 12 10 F3 D1 13 D7 D1 CD DA 07 FD E9 CD FB;
0678: 17 76 CD E4 04 E1 D1 2B 7E 2B 6E 67 B5 20 C4 C3 8A 06 11 00 00 D7 FD E9;
0690: 45 58 45 43 55 54 C5 3C 06 07 9C 06 DF C3 BF 04 4E 55 4D 42 45 D2 99 06;
06A8: 06 AB 06 CD DF 05 38 DA C5 D5 CD 4C 07 20 05 11 06 10 18 58 DF 11 00 00;
06C0: D7 11 00 45 C1 C5 0A FE 2D 20 03 16 C5 03 D7 50 59 2B 2B CD 23 07 23 34;
06D8: 2B 30 F8 FE FE 20 3D CD 23 07 30 FB C6 30 CD 7B 07 20 04 1E 00 18 0E E6;
06F0: DF FE 45 20 27 E5 CD 4C 07 DF E1 20 1F CD 40 07;
0700: 28 0F 23 7E E6 7F 83 FA 1C 07 28 10 AE E6 7F AE 77 11 55 10 D7 D1 C1 CD;
0718: DA 07 FD E9 E1 E1 DF DF C3 8A 06 1A 13 D6 30 D8 FE 0A 3F D8 4F 7E E6 F0;
0730: C0 79 2B 2B 0E 03 ED 6F 23 0D 20 FA 35 2B BF C9 06 06 AF CD 2C 07 C0 10;
0748: F9 23 70 C9 D7 CD B9 04 6B 08 96 08 4B 10 2D 4A 0C 6B 08 A9 0D D2 08 D2;
0760: 0D 1F 0E 88 06 88 06 FF 08 8A 07 FF 08 DF 08 94 0D FF 08 79 08 85 08 0E;
0778: 1A DF 1A FE 20 C8 A7 C9 43 4F 4E 56 45 52 D4 A8 06 07 C3 0E 09 0E 6B 08;
0790: D2 08 96 08 B8 07 83 12 1B 00 85 08 8A 04 96 08 A8 0C 79 08 FF 08 8A 04;
07A8: 96 08 A8 0C EE 0D DF 08 76 12 D9 FF DF 08 B6 04 BA 07 DF 7B CD 07 08 C6;
07C0: D0 30 14 FE 0A 38 06 C6 EF 30 0C C6 0A DD BE 3F 30 05 16 00 5F D7 37 C3;
07D8: 21 0C 62 6B 03 09 E5 DD CB 3E 66 CC 7F 09 CD B0 02 D1 A7 ED 52 44 4D 2A;
07F0: 1E 3C 23 EB 38 05 28 02 ED B0 A7 ED 52 EB 7A B3 C8 36 20 23 1B 18 F7 E6;
0808: 7F FE 61 D8 FE 7B D0 E6 5F C9 56 49 D3 89 07 03 1A 08 DD CB 3E A6 FD E9;
0820: 49 4E 56 49 D3 17 08 05 2A 08 DD CB 3E E6 FD E9 46 41 53 D4 27 08 04 39;
0838: 08 FD 21 B9 04 FD E9 53 4C 4F D7 36 08 04 48 08 FD 21 C8 04 FD E9 2A 3B;
0850: 3C 2B 46 2B 4E 22 3B 3C C9 2B 5E 22 3B 3C C9 72 23 22 3B 3C C9 44 55 D0;
0868: 45 08 03 6D 08 DF D7 D7 FD E9 44 52 4F D0 6A 08 04 7B 08 DF FD E9 53 57;
0880: 41 D0 78 08 04 87 08 DF CD 4E 08 D7 50 59 D7 FD E9 43 C0 84 08 02 98 08;
0898: DF 1A 5F 16 00 D7 FD E9 43 A1 95 08 02 A7 08 DF CD 4E 08 79 12 FD E9 C0;
08B0: A4 08 01 B5 08 DF EB 5E 23 56 D7 FD E9 A1 B2 08 01 C3 08 DF CD 4E 08 EB;
08C8: 71 23 70 FD E9 3E D2 C0 08 02 D4 08 DF C1 D5 C5 FD E9 52 BE D1 08 02 E1;
08E0: 08 C1 D1 C5 D7 FD E9 3F 44 55 D0 DE 08 04 F0 08 DF D7 7A B3 C4 10 00 FD;
08F8: E9 52 4F D4 ED 08 03 C3 0E D2 08 85 08 DF 08 85 08 B6 04 4F 56 45 D2 FE;
0910: 08 04 C3 0E D2 08 6B 08 DF 08 85 08 B6 04 50 49 43 CB 11 09 04 27 09 CD;
0928: 4D 09 FD E9 52 4F 4C CC 24 09 04 35 09 CD 4D 09 EB 2A 37 3C ED 52 D2 D7;
0940: 04 62 6B 23 23 ED B0 ED 53 3B 3C FD E9 CD 4E 08 0B CB 21 CB 10 03 03 30;
0958: 02 E7 07 2A 3B 3C ED 42 E5 5E 23 56 D7 E1 C9 54 59 50 C5 32 09 04 70 09;
0970: CD 4E 08 DF CD 7F 09 FD E9 1A 4F 13 1A 47 13 78 B1 C8 1A 13 0B CF 18 F7;
0988: 3C A3 6D 09 02 8F 09 21 FF 27 22 1A 3C FD E9 23 BE 8C 09 02 9E 09 DF DF;
09A0: ED 5B 1A 3C D7 21 FF 27 A7 ED 52 EB D7 FD E9 AE 49 0A 01 C3 0E 8D 09 6B;
09B8: 08 0D 0C 88 06 E1 09 FF 08 4A 0A 9C 09 6E 09 73 0A B6 04 55 AE B2 09 02;
09D0: C3 0E 88 06 8D 09 E1 09 76 12 E8 FF 23 D3 CF 09 02 C3 0E F7 09 12 09 12;
09E8: 09 36 0E 1A 0C 8D 12 F3 FF B6 04 A3 E0 09 01 C3 0E 8A 04 96 08 C4 0C FF;
0A00: 08 07 0A 5C 0A B6 04 09 0A DF 7B C6 30 FE 3A 38 02 C6 07 5F D7 FD E9 43;
0A18: 4C D3 F6 09 03 1F 0A CD 24 0A FD E9 11 FF 26 2A 24 3C 01 20 00 09 2B ED;
0A30: B8 ED 43 2F 3C 21 00 24 22 1C 3C 13 EB 22 24 3C C3 FA 07 53 49 47 CE 9B;
0A48: 09 04 4C 0A DF CB 12 1E 2D 38 0C FD E9 48 4F 4C C4 1C 0A 04 5E 0A DF 2A;
0A60: 1A 3C 2D 28 04 22 1A 3C 73 FD E9 53 50 41 43 C5 5B 0A 05 75 0A 3E 20 CF;
0A78: FD E9 53 50 41 43 45 D3 72 0A 06 85 0A DF 1B CB 7A 20 ED 3E 20 CF 18 F6;
0A90: 43 D2 82 0A 02 97 0A 3E 0D CF FD E9 45 4D 49 D4 94 0A 04 A5 0A DF 7B CF;
0AA8: FD E9 46 AE A2 0A 02 B1 0A 2A 3B 3C 2B CB 7E CB BE 28 03 3E 2D CF 1E 00;
0AC0: 7E 3D FE 49 30 04 FE 3C 30 04 36 41 3C 5F 3E 40 96 38 09 47 04 3E 2E CF;
0AD8: 3E 30 10 FB 3E 40 BE 9F 2B B6 2B B6 2B B6 23 23 28 12 AF CD 32 07 C6 30;
0AF0: CF 23 7E FE 40 20 E5 3E 2E CF 18 E0 7B A7 20 05 3E 20 CF 18 0B D6 41 6F;
0B08: 9F 67 3E 45 CF CD 0E 18 DF DF FD E9 41 D4 AE 0A 02 1B 0B DF CD 4E 08 79;
0B20: CD 28 0B 22 1C 3C FD E9 C6 20 6F 26 01 29 29 29 29 29 16 00 7B E6 1F 5F;
0B38: 19 ED 5B 24 3C ED 52 19 D8 E7 09 50 4C 4F D4 18 0B 04 4C 0B CD 4E 08 DF;
0B50: DD 73 30 CB 3B CB 11 3E 16 93 DF DD 73 2F CB 3B CB 11 CD 28 0B 7E E6 78;
0B68: FE 10 7E 28 02 3E 10 5F 16 87 79 E6 03 47 28 07 2F C6 02 CE 03 57 43 79;
0B80: 0F 0F 0F 9F CB 59 20 04 AB 07 9F A8 A2 AB 77 FD E9 42 45 45 D0 49 0B 04;
0B98: C3 0E 12 09 4B 10 7D 85 08 7A 0D 0E 1A DF CD 4E 08 21 F9 00 09 2C F3 3E;
0BB0: 7F DB FE 0F 30 11 CD C9 0B 1B 7A D3 FE CD C9 0B B3 C2 AF 0B FB FD E9 E7;
0BC8: 03 45 4C 10 FE 05 0D C2 CB 0B C9 49 4E 4B 45 D9 97 0B 05 DD 0B CD 36 03;
0BE0: 5F 16 00 D7 FD E9 49 CE DA 0B 02 ED 0B CD 4E 08 16 00 ED 58 D7 FD E9 4F;
0BF8: 55 D4 EA 0B 03 FF 0B CD 4E 08 DF ED 59 FD E9 41 42 D3 FC 0B 03 C3 0E 6B;
0C10: 08 94 0D B6 04 30 BD 0C 0C 02 1C 0C DF 7A B3 FE 01 3E 00 57 17 5F D7 FD;
0C28: E9 30 BC 19 0C 02 30 0C DF CB 12 18 EC 30 BE 2D 0C 02 3C 0C DF 7A B3 28;
0C40: E0 CB 12 3F 18 DB BD 39 0C 01 C3 0E E1 0D 1A 0C B6 04 BE 49 0C 01 58 0C;
0C58: DF D5 DF E1 CD 99 0C 18 C0 BC 55 0C 01 C3 0E 85 08 56 0C B6 04 55 BC 64;
0C70: 0C 02 74 0C CD 4E 08 DF EB A7 ED 42 18 A3 44 BC 71 0C 02 85 0C DF D5 CD;
0C88: 4E 08 DF E1 A7 ED 52 28 E6 19 EB CD 99 0C DF 18 88 7C AA FA A0 0C ED 52;
0CA0: CB 14 C9 55 AA 82 0C 02 AA 0C DF CD 4E 08 21 00 00 3E 10 29 EB ED 6A EB;
0CB8: 30 04 09 30 01 13 3D 20 F2 EB 18 2F C6 0C DF D9 DF D5 DF E1 7C B5 3E 21;
0CD0: 20 03 EB 3E 11 D9 47 AF 67 6F 4F ED 6A 9F A7 ED 52 99 30 01 19 3F D9 EB;
0CE8: ED 6A EB ED 6A D9 10 EB EB D7 D9 E5 D7 D1 D7 FD E9 2F 4D 4F C4 A7 0C 04;
0D00: C3 0E 85 08 D2 08 E9 12 0D 0C 4B 10 00 FF 08 6B 08 E9 12 60 0E D2 08 0D;
0D18: 0C 8C 0D DF 08 94 0D 85 08 DF 08 94 0D 85 08 B6 04 2A 2F 4D 4F C4 FF 0C;
0D30: 05 C3 0E FF 08 D2 08 E9 12 0D 0C FF 08 6B 08 DF 08 60 0E D2 08 0D 0C A8;
0D48: 0C 76 12 C1 FF AF 30 0D 01 C3 0E 00 0D 85 08 79 08 B6 04 4D 4F C4 50 0D;
0D60: 03 C3 0E 00 0D 79 08 B6 04 AA 60 0D 01 C3 0E A8 0C 79 08 B6 04 2A AF 6C;
0D78: 0D 02 C3 0E 31 0D 85 08 79 08 B6 04 55 2F 4D 4F C4 79 0D 05 C3 0E C4 0C;
0D90: 79 08 B6 04 C3 0E 2E 0C 83 12 03 00 A9 0D B6 04 4E 45 47 41 54 C5 8B 0D;
0DA8: 06 AB 0D 01 02 00 18 0F 44 4E 45 47 41 54 C5 A8 0D 07 BC 0D 01 04 00 2A;
0DC0: 3B 3C A7 ED 42 78 9E 77 23 0D 20 F9 FD E9 AB B9 0D 01 D4 0D DF D5 DF E1;
0DD8: 19 EB D7 FD E9 AD D1 0D 01 C3 0E A9 0D D2 0D B6 04 44 AB E0 0D 02 F0 0D;
0DF0: DF D5 CD 4E 08 DF D5 DF EB 09 EB D7 C1 E1 ED 4A;
0E00: EB D7 FD E9 31 AB ED 0D 02 0B 0E DF 18 09 32 AB 08 0E 02 15 0E DF 13 13;
0E18: 18 14 31 AD 12 0E 02 21 0E DF 18 09 32 AD 1E 0E 02 2B 0E DF 1B 1B D7 FD;
0E30: E9 4F D2 28 0E 02 38 0E DF CD 4E 08 7B B1 5F 7A B0 57 D7 FD E9 41 4E C4;
0E48: 35 0E 03 4D 0E DF CD 4E 08 7B A1 5F 7A A0 57 D7 FD E9 58 4F D2 4A 0E 03;
0E60: 62 0E DF CD 4E 08 7B A9 5F 7A A8 57 D7 FD E9 4D 41 D8 5F 0E 03 C3 0E 12;
0E78: 09 12 09 65 0C 71 12 0F 00 4D 49 CE 74 0E 03 C3 0E 12 09 12 09 56 0C 83;
0E90: 12 03 00 85 08 79 08 B6 04 44 45 43 49 4D 41 CC 86 0E 07 A5 0E DD 36 3F;
0EA8: 0A FD E9 BA A2 0E 01 85 10 C3 0E 4B 10 0A 0E 1A 21 3E 3C 7E F6 44 77 FD;
0EC0: E9 E9 FF EB C3 BA 04 43 52 45 41 54 C5 AE 0E 06 C3 0E 4B 10 20 AB 05 FB;
0ED8: 0E 88 06 4E 0F 80 04 B3 08 6B 08 B3 08 4E 0F 60 04 85 08 C1 08 99 04 96;
0EF0: 08 5F 0F 11 10 EC 0F 4E 0F B6 04 FD 0E CD 2E 0F DF 1A 3D FE 3F 38 02 E7;
0F08: 06 C6 08 4F 06 00 CD 8C 0F 1A 4F 2A 37 3C D5 CD 9E 0F D1 1A 47 13 1A CD;
0F20: 07 08 77 23 10 F7 22 39 3C 2B CB FE FD E9 DD CB 3E 56 28 02 E7 0C 2A 37;
0F38: 3C ED 5B 39 3C AF ED 52 EB 73 23 72 67 6F 22 39 3C C9 AC CF 0E 01 C3 0E;
0F50: 83 0F 60 04 29 0E C1 08 B6 04 43 AC 4D 0F 02 C3 0E 4B 10 01 76 0F 60 04;
0F68: 1F 0E A5 08 B6 04 41 4C 4C 4F D4 5E 0F 05 78 0F CD 4E 08 2A 37 3C CD 9E;
0F80: 0F FD E9 C3 0E 4B 10 02 76 0F B6 04 21 1E 00 C5 09 ED 4B 3B 3C 09 C1 38;
0F98: 03 ED 72 D8 E7 01 EB 21 28 00 CD 8F 0F 2A 37 3C 09 22 37 3C 2A 3B 3C E5;
0FB0: 09 22 3B 3C E3 E5 A7 ED 52 44 4D E1 D1 C8 2B 1B ED B8 23 C9 56 41 52 49;
0FC8: 41 42 4C C5 75 0F 08 85 10 F0 0F 4E 0F B6 04 43 4F 4E 53 54 41 4E D4 CE;
0FE0: 0F 08 85 10 F5 0F 4E 0F B6 04 DC FE 18 02 D5 FF D7 FD E9 E3 FF EB 5E 23;
0FF8: 56 D7 FD E9 4C 49 54 45 52 41 CC E1 0F 47 08 11 11 10 4E 0F B6 04 02 FF;
1010: FF 13 10 06 01 E1 5E 23 56 23 E5 D7 10 F7 FD E9 41 53 43 49 C9 05 10 45;
1028: C3 0E 4B 10 20 AB 05 09 0E 96 08 0E 1A DD CB 3E 76 28 E3 CD B9 04 11 10;
1040: 4B 10 4E 0F 5F 0F B6 04 01 D6 FF 4D 10 E1 5E 16 00 06 01 18 C4 08 11 64;
1058: 10 85 08 4E 0F 4E 0F B6 04 04 FF FF 66 10 06 02 18 AB 44 45 46 49 4E 45;
1070: D2 27 10 07 85 10 85 10 60 04 4B 10 0C 83 0F 76 12 34 FE E6 FF CD F0 0F;
1088: D0 0E 6B 08 B3 08 60 04 29 0E C1 08 13 0E 9A 10 B6 04 9C 10 DF C3 C3 0E;
10A0: 43 41 4C CC 73 10 04 A9 10 DF EB E9 44 4F 45 53 BE F4 10 45 08 11 E8 10;
10B8: D8 12 0C CD 10 4B 10 CD 5F 0F 11 10 F0 0F 4E 0F 4B 10 0A B6 04 C3 0E 6B;
10D0: 08 29 0E B5 15 60 04 E1 0D 1F 0E 4E 0F 60 04 85 08 C1 08 B6 04 05 C5 FF;
10E8: B8 04 43 4F 4D 50 49 4C 45 D2 A6 10 08 85 10 08 11 60 11 60 04 4B 10 0B;
1100: 83 0F 76 12 B1 FD E3 FF DD CB 3E 76 20 02 E7 04 CD F0 0F 6B 08 B3 08 4E;
1118: 0F 76 12 78 FF 52 55 4E 53 BE B3 10 45 08 11 40 11 D8 12 0B 85 08 5F 0F;
1130: CD 10 11 10 42 11 4E 0F 4B 10 0A B6 04 05 DE FF B8 04 E1 D5 EB D7 42 4B;
1148: D1 D5 1B 1B CD 9E 15 D1 C5 C3 C3 0E 49 4D 4D 45 44 49 41 54 C5 24 11 09;
1160: C3 0E 80 04 B3 08 B3 08 0E 1A DF EB CB F6 FD E9 56 4F 43 41 42 55 4C 41;
1178: 52 D9 5F 11 0A 85 10 B5 11 80 04 B3 08 13 0E 4E 0F 88 06 5F 0F 60 04 11;
1190: 10 35 3C 6B 08 B3 08 4E 0F C1 08 B6 04 44 45 46 49 4E 49 54 49 4F 4E D3;
11A8: 7C 11 0B AD 11 2A 33 3C 22 31 3C FD E9 ED 53 33 3C FD E9 49 C6 E0 13 42;
11C0: 08 11 83 12 60 04 4B 10 02 83 0F B6 04 57 48 49 4C C5 BF 11 45 08 11 88;
11D8: 12 D8 12 01 60 04 4B 10 04 83 0F B6 04 45 4C 53 C5 D4 11 44 08 11 71 12;
11F0: D8 12 02 83 0F 25 12 60 04 29 0E 4B 10 02 B6 04 54 48 45 CE EB 11 44 08;
1208: 11 A4 12 D8 12 02 25 12 B6 04 42 45 47 49 CE 06 12 45 08 11 9F 12 60 04;
1220: 4B 10 01 B6 04 C3 0E 6B 08 60 04 85 08 E1 0D 1F 0E 85 08 C1 08 B6 04 C3;
1238: 0E 60 04 E1 0D 1F 0E 4E 0F B6 04 52 45 50 45 41 D4 19 12 46 08 11 76 12;
1250: D8 12 04 85 08 37 12 25 12 B6 04 55 4E 54 49 CC 4B 12 45 08 11 8D 12 D8;
1268: 12 01 37 12 B6 04 02 75 FF 78 12 02 CE FF 78 12 E1 5E 23 56 19 C3 BA 04;
1280: 02 39 FF 8F 12 02 46 FF 8F 12 02 CF FF 8F 12 CD 4E 08 78 B1 28 E2 E1 23;
1298: 23 C3 BA 04 00 74 FF B9 04 00 5D FF B9 04 44 CF 62 12 42 08 11 23 13 60;
12B0: 04 4B 10 03 B6 04 4C 4F 4F D0 AA 12 44 08 11 32 13 D8 12 03 37 12 B6 04;
12C8: 2B 4C 4F 4F D0 BC 12 45 08 11 3C 13 76 12 EA FF DA 12 DF E1 7E 23 E5 93;
12E0: B2 28 4A E7 05 C9 AA 11 01 EB 12 C1 D1 D5 C5 D7 FD E9 49 A7 E8 12 02 F9;
12F8: 12 21 04 00 18 09 CA F6 12 01 04 13 21 06 00 39 5E 23 56 D7 FD E9 4C 45;
1310: 41 56 C5 01 13 05 18 13 C1 E1 E1 E5 E5 C5 FD E9 00 84 FF 25 13 CD 4E 08;
1328: DF E1 D5 C5 E5 FD E9 02 85 FF 34 13 11 01 00 18 06 02 8D FF 3E 13 DF C1;
1340: E1 A7 ED 5A 7A D1 37 EA 58 13 D5 E5 07 30 01 EB CD 99 0C 3F 30 02 E1 E1;
1358: C5 9F C3 94 12 A8 D4 13 41 08 11 79 13 4B 10 29 60 04 85 08 83 0F 9F 13;
1370: 85 08 C1 08 B6 04 FF E5 FF 7B 13 E1 5E 23 56 13 C3 7C 12 2E A2 60 13 42;
1388: 08 11 96 13 4B 10 22 76 12 D6 FF FF EE FF 98 13 D1 CD 79 09 D5 FD E9 A1;
13A0: 13 DF D5 CD E1 05 62 6B 09 7E E1 BD 28 0A EB D7 11 78 05 CD 15 18 18 E9;
13B8: D5 C5 2A 37 3C CD 9E 0F C1 D1 D5 C5 EB ED B0 C1 50 59 D7 D1 CD DA 07 FD;
13D0: E9 DB CF 12 41 D7 13 DD CB 3E B6 FD E9 DD 15 13 01 E3 13 DD CB 3E F6 FD;
13E8: E9 45 58 49 D4 87 13 04 B8 04 52 45 44 45 46 49 4E C5 EF 13 08 FF 13 CD;
1400: 2E 0F 2A 31 3C 5E 23 56 EB 23 22 05 27 E5 CD C0 15 22 0D 27 ED 43 07 27;
1418: ED 53 0B 27 2A 37 3C ED 52 C2 DA 14 D1 D7 CD B9 04 10 16 3D 06 0E 1A DF;
1430: 21 AF C3 19 D2 CF 14 EB 22 03 27 CD C0 15 22 01 27 E5 ED 53 09 27 78 B1;
1448: ED 5B 07 27 28 04 7A B3 28 7D E1 ED 4B 0D 27 ED 42 EB 19 22 07 27 2A 0B;
1460: 27 19 ED 4B 09 27 A7 ED 42 22 0B 27 01 2E 00 09 CB 7C 20 0B ED 4B 3B 3C;
1478: 09 38 54 ED 72 30 50 2A 03 27 E5 2B 2B 46 2B 4E 2A 05 27 E5 2B 2B 70 2B;
1490: 71 E1 19 C1 A7 ED 42 22 05 27 ED 5B 01 27 2A 09 27 A7 ED 52 44 4D D5 C5;
14A8: CD DC 14 2A 0B 27 C1 09 44 4D E1 C5 CD 9E 0F EB 2A 0D 27 ED 4B 0B 27 09;
14C0: C1 C5 E5 ED B0 D1 C1 CD DC 14 CD F8 14 FD E9 2A 31 3C ED 5B 05 27 1B 73;
14D8: 23 72 E7 0B 2A 37 3C A7 ED 42 22 37 3C 2A 3B 3C ED 42 22 3B 3C ED 52 C8;
14F0: C5 44 4D E1 19 ED B0 C9 01 31 3C CD 57 15 CD 57;
1500: 15 01 40 3C 2A 37 3C 37 ED 42 D8 0A 17 03 30 FB 03 03 CD 57 15 03 CD 57;
1518: 15 CD FB 15 C3 0E 1C 85 10 16 08 11 13 B5 11 18 00 00 21 F9 FF 09 4E 23;
1530: 46 2B 09 44 4D 18 CD CD 57 15 CD 48 15 18 C5 CD 57 15 03 CD 57 15 18 BC;
1548: CD 57 15 21 B6 04 A7 ED 52 C8 CD 9E 15 18 F1 0A 5F 03 0A 57 0B CD 68 15;
1560: EB 7B 02 03 7A 02 03 C9 2A 01 27 A7 ED 52 62 6B D0 2A 09 27 ED 52 30 0C;
1578: 2A 0D 27 ED 52 38 13 2A 0B 27 19 C9 2A 03 27 ED 52 2A 07 27 D8 2A 05 27;
1590: 19 C9 2A 01 27 19 ED 5B 0D 27 A7 ED 52 C9 1B 1A 17 D0 1B 1B 1A 6F 26 00;
15A8: 3C 20 06 0A 6F 03 0A 67 03 09 44 4D C9 B7 15 DF EB CD E7 15 EB D7 FD E9;
15C0: E5 5E 23 56 CD FB 15 08 11 0B 85 10 08 00 00 01 00 00 18 07 E1 E5 23 23;
15D8: 4E 23 46 E1 E5 2B 2B 2B 2B 56 2B 5E 19 EB E1 2B 7C FE 3C 7E CB B7 38 02;
15F0: C6 02 2B 2B 2B 3D 20 FC C9 23 E5 E1 7E 23 E5 66 6F B4 C8 ED 52 E1 23 20;
1608: F0 D5 16 00 5E 19 D1 E9 C3 0E 1F 0E 29 0E B3 08 80 04 B3 08 C1 08 B6 04;
1620: CD B9 04 3D 06 0E 1A DF 21 AF C3 19 D8 E7 0D 46 4F 52 47 45 D4 FC 13 06;
1638: 3A 16 2A 31 3C ED 5B 33 3C A7 ED 52 C2 DA 14 CD 20 16 21 FB FF 19 22 39;
1650: 3C DD CB 3E D6 E7 FF 45 44 49 D4 37 16 04 60 16 CD 20 16 DD CB 3E DE 18;
1668: 0C 4C 49 53 D4 5D 16 04 72 16 CD 20 16 3E 0D CF DD CB 3E 5E D5 C4 D8 02;
1680: C1 0A 5F 03 0A 57 0B CD FB 15 C3 0E 0B 08 11 0D 85 10 1F 00 00 E7 0E 21;
1698: 02 00 18 18 D5 21 02 00 09 7E 23 66 6F 2B 2B 2B 6E 7D 07 9F 67 CD 0E 18;
16B0: D1 21 04 00 09 E5 C5 CD E4 17 D1 C1 CD E4 17 DD 36 14 01 DD 36 16 10 CD;
16C8: 08 17 38 06 DD 35 16 F2 C7 16 DD CB 3E 5E 20 10 38 28 21 26 3C 36 00 7E;
16E0: A7 28 FC CD E4 04 18 DB F5 DD CB 3E 9E C5 CD B9 04 78 05 06 05 0E 1A DD;
16F8: CB 3E DE CD D8 02 C1 F1 30 C1 DD CB 3E 9E FD E9 3A 14 3C 32 15 3C DD 36;
1710: 13 05 0A 5F 03 0A 57 03 CD FB 15 83 12 40 71 12 44 A4 12 48 9F 12 37 8D;
1728: 12 42 88 12 38 76 12 3C 23 13 2B 32 13 36 3C 13 33 E8 10 29 40 11 26 11;
1740: 10 3B 64 10 47 4B 10 51 79 13 62 96 13 63 B6 04 54 00 00 CD E1 17 DD 35;
1758: 13 20 B7 A7 C9 2A 14 3C 65 2C 18 0C 2A 14 3C 65 25 18 05 2A 14 3C 2D 65;
1770: 22 14 3C DD 36 13 01 DD 35 16 18 D7 CD DA 17 D7 11 B3 09 CD C1 17 CD 15;
1788: 18 18 CB CD DA 17 D7 CD DA 17 D7 11 AF 0A 18 EB 0A F5 CD E1 17 F1 CF 3E;
17A0: 20 CF 18 B2 CD 08 18 0D 3B 8D 37 C9 3E 29 18 02 3E 22 F5 C5 CD E1 17 D1;
17B8: CD 79 09 42 4B F1 CF A7 C9 3A 15 3C A7 F8 C5 47 3E 0D CF 04 05 28 05 3E;
17D0: 20 CF 10 FB DD 36 15 FF C1 C9 0A 5F 03 0A 57 03 C9 CD C1 17 EB 2B 7E CB;
17E8: 7F 20 05 CD E8 15 18 0B EB CD A2 15 13 1A 6F 13 1A 67 19 7E E6 7F CF CB;
1800: 7E 23 28 F7 3E 20 CF C9 E3 CD FB 17 E3 C9 11 B3 09 D5 EB D7 D1 C5 CD BF;
1818: 04 1B 18 1D 18 C1 C1 C9 FD E5 E5 FD E1 21 92 18 E5 21 00 E0 CB 79 28 02;
1830: 26 FC 13 FD 2B F3 AF 06 97 10 FE D3 FE EE 08 2C 20 01 24 20 F2 06 2B 10;
1848: FE D3 FE 69 01 08 3B 10 FE 79 D3 FE 06 38 C3 8A 18 79 CB 78 10 FE 30 04;
1860: 06 3D 10 FE D3 FE 06 3A C2 59 18 05 AF CB 15 C2 5C 18 1B FD 23 06 2E 3E;
1878: 7F DB FE 1F D0 7A FE FF D0 B3 28 0B FD 6E 00 7C AD 67 AF 37 C3 6D 18 6C;
1890: 18 F5 FD E1 08 06 3B 10 FE AF D3 FE 3E 7F DB FE 1F FB D2 F0 04 08 C9 F3;
18A8: FD E5 E5 FD E1 21 92 18 E5 61 08 AF 4F C0 2E 00 06 B8 CD 11 19 30 F6 3E;
18C0: DF B8 30 F2 2C 20 F1 06 CF CD 15 19 30 E7 78 FE D8 30 F4 CD 15 19 D0 CD;
18D8: FC 18 D0 3F C0 18 11 08 30 05 FD 75 00 18 05 FD 7E 00 AD C0 FD 23 1B 08;
18F0: CD FC 18 D0 7A B3 20 E7 7C FE 01 C9 2E 01 06 C7 CD 11 19 D0 3E E2 B8 CB;
1908: 15 D2 FE 18 7C AD 67 37 C9 CD 15 19 D0 3E 14 3D 20 FD A7 04 C8 3E 7F DB;
1920: FE 1F D0 A9 E6 10 28 F3 79 2F 4F 37 C9 53 41 56 C5 6F 16 04 C3 0E 10 1A;
1938: 4F 1A B6 04 42 53 41 56 C5 33 19 05 C3 0E 3D 1A 4F 1A B6 04 42 4C 4F 41;
1950: C4 43 19 05 C3 0E 3D 1A 74 1A B8 1A B6 04 56 45 52 49 46 D9 53 19 06 C3;
1968: 0E 10 1A 71 12 0F 00 42 56 45 52 49 46 D9 66 19 07 C3 0E 3D 1A 74 1A BE;
1980: 1A B6 04 4C 4F 41 C4 78 19 04 C3 0E 10 1A 0E 1A 2A 37 3C 22 0E 23 EB 21;
1998: CC FF 39 A7 ED 52 22 0C 23 CD B9 04 74 1A B8 1A 0E 1A ED 4B 37 3C 21 50;
19B0: 3C 22 01 27 23 22 09 27 2A 25 23 09 22 37 3C 21 AF C3 09 22 0B 27 ED 5B;
19C8: 29 23 19 ED 5B 4C 3C 22 4C 3C C5 D5 ED 73 0D 27 CD 04 15 C1 E1 CB 7E 23;
19E0: 28 FB 23 23 71 23 70 2A 37 3C 01 0C 00 09 22 3B 3C FD E9 C3 0E 4B 10 20;
19F8: AB 05 0E 1A CD 2E 0F DF 3E 20 12 11 0C 27 21 FF 27 CD FA 07 FD E9 FB 18;
1A10: C3 0E F3 19 0E 1A AF 32 01 23 21 51 3C 22 0E 23 EB 2A 37 3C A7 ED 52 22;
1A28: 0C 23 2A 4C 3C 22 10 23 21 31 3C 11 12 23 01 08 00 ED B0 FD E9 C3 0E F3;
1A40: 19 11 10 0C 23 C1 08 11 10 0E 23 C1 08 B6 04 51 1A 3A 02 23 A7 28 5F 2A;
1A58: 0C 23 7C B5 28 58 E5 11 19 00 21 01 23 4A CD 20 18 D1 2A 0E 23 0E FF CD;
1A70: 20 18 FD E9 76 1A 11 19 00 21 1A 23 4A 37 CD A7 18 30 F3 11 1A 23 1A A7;
1A88: 20 0B CD 08 18 0D 44 69 63 74 BA 18 0A CD 08 18 0D 42 79 74 65 73 BA 21;
1AA0: 01 23 01 0B 0B 18 02 1A CF 1A BE 20 01 0D 23 13 10 F5 20 C2 FD E9 E7 0A;
1AB8: BA 1A 06 FF 18 12 C0 1A 21 12 23 11 2B 23 06 08 1A 13 BE 23 20 E8 10 F8;
1AD0: 2A 0C 23 ED 5B 25 23 7C B5 28 04 ED 52 38 D7 2A 0E 23 7C B5 20 03 2A 27;
1AE8: 23 0E FF CB 18 CD A7 18 30 C4 FD E9 01 0F 3C AF 02 0D 20 FC 2A 3B 3C 11;
1B00: FC FF 2B 4E 77 19 23 22 3B 3C 2B 46 77 79 0F A8 E6 7F A8 32 02 3C CB B8;
1B18: CB B9 ED 43 00 3C 23 EB 19 C9 3E 09 B8 30 01 47 0E 04 23 23 23 AF ED 67;
1B30: 2B 0D 20 FA 23 10 F1 C6 FB E5 7E 88 27 77 23 38 F9 E1 C9 C5 E5 06 04 A7;
1B48: 3E 00 9E 27 77 23 10 F8 E1 C1 C9 0E 01 E5 D5 C5 79 E6 0F 47 A9 4F 0F 0F;
1B60: 81 0F 80 4F 06 04 AF C5 D5 E5 86 27 6F 1A 26 00 54 CB 14 A7 28 1B 5F CB;
1B78: 39 30 08 7D 83 27 6F 7C 8A 27 67 0C 0D 28 0A 7B 87 27 5F 7A 8F 27 57 18;
1B90: E6 EB E1 73 7A D1 C1 13 23 10 CC C1 D1 E1 C9 46 AD 89 19 02 C3 0E 0F 1D;
1BA8: 0E 1A 18 07 46 AB A3 1B 02 B3 1B CD F4 1A 79 90 F5 30 06 EB ED 44 DD 70;
1BC0: 00 47 C4 22 1B F1 30 01 EB 06 02 DD 4E 02 CB 11 DC 43 1B EB 10 F8 CD 53;
1BD8: 1B 1B 1A C6 68 CB 18 DD 70 02 C4 43 1B 1A A7 20 19 DD 35 00 DD 35 00 D5;
1BF0: 62 6B 2B 01 FF 03 B6 ED A8 10 FB EB 70 D1 20 E5;
1C00: FD E9 54 5D D5 01 04 00 ED B0 E1 1B 1A A7 28 11 FE 10 9F 3C 3C 47 DD 86;
1C18: 00 32 00 3C CD 22 1B 18 EB 3A 00 3C 3D FE BF 3C 30 13 FE 80 30 0D 47 3A;
1C30: 02 3C 4F 17 A9 E6 80 A8 12 FD E9 E7 08 01 00 04 71 23 10 FC FD E9 46 AA;
1C48: B0 1B 02 4D 1C CD F4 1A AF B8 9F A1 28 E7 E5 01 02 3C C5 06 03 4E 23 E3;
1C60: 23 CD 55 1B E3 10 F6 ED 4B 00 3C 78 81 D6 42 32 00 3C E1 D1 18 8E 46 AF;
1C78: 4A 1C 02 7D 1C CD F4 1A AF B8 28 B9 B9 28 B4 13 13 1A 1B 1B C6 01 27 08;
1C90: EB CD 43 1B EB E5 11 10 3C 01 04 00 ED B0 EB 2B 06 05 D5 7E 2B 5E 08 4F;
1CA8: 08 0C 0D 20 03 5F 18 1B C5 06 02 16 10 CB 23 17 CB 12 30 F9 14 91 27 1C;
1CC0: 30 FB 15 20 F8 81 27 1D 10 E9 C1 4B D1 0C 0D 28 17 E5 2B 2B CD 55 1B D5;
1CD8: 11 FB FF 19 11 03 3C 79 12 CD 53 1B D1 E1 23 04 10 B8 2A 00 3C 7C 95 C6;
1CF0: 40 21 08 3C 47 3A 0B 3C A7 20 03 05 05 2B DD 70 00 D1 C3 04 1C 46 4E 45;
1D08: 47 41 54 C5 7A 1C 07 11 1D DF 7A A7 28 02 EE 80 57 D7 FD E9 49 4E D4 0E;
1D20: 1D 03 24 1D 2A 3B 3C 2B 11 00 00 7E 07 FE 82 38 14 AF 2B CD 32 07 23 EB;
1D38: 44 4D 29 29 09 29 4F 06 00 09 EB 18 E6 2B 2B 72 2B 73 11 94 0D C3 BF 04;
1D50: 55 46 4C 4F 41 D4 21 1D 06 5B 1D DF EB 01 00 10 51 59 29 7B 8F 27 5F 7A;
1D68: 8F 27 57 CB 11 10 F3 D7 16 46 59 D7 2B 2B CD 40 07 FD E9 00 00 00 00 00;
1D80: 00 00 10 10 10 10 00 10 00 24 24 00 00 00 00 00 24 7E 24 24 7E 24 00 08;
1D98: 3E 28 3E 0A 3E 08 62 64 08 10 26 46 00 10 28 10 2A 44 3A 00 08 10 00 00;
1DB0: 00 00 00 04 08 08 08 08 04 00 20 10 10 10 10 20 00 00 14 08 3E 08 14 00;
1DC8: 00 08 08 3E 08 08 00 00 00 00 00 08 08 10 00 00 00 3E 00 00 00 00 00 00;
1DE0: 00 18 18 00 00 02 04 08 10 20 00 3C 46 4A 52 62 3C 00 18 28 08 08 08 3E;
1DF8: 00 3C 42 02 3C 40 7E 00 3C 42 0C 02 42 3C 00 08 18 28 48 7E 08 00 7E 40;
1E10: 7C 02 42 3C 00 3C 40 7C 42 42 3C 00 7E 02 04 08 10 10 00 3C 42 3C 42 42;
1E28: 3C 00 3C 42 42 3E 02 3C 00 00 00 10 00 00 10 00 00 10 00 00 10 10 20 00;
1E40: 04 08 10 08 04 00 00 00 3E 00 3E 00 00 00 10 08 04 08 10 00 3C 42 04 08;
1E58: 00 08 3C 4A 56 5E 40 3C 3C 42 42 7E 42 42 7C 42 7C 42 42 7C 3C 42 40 40;
1E70: 42 3C 78 44 42 42 44 78 7E 40 7C 40 40 7E 7E 40 7C 40 40 40 3C 42 40 4E;
1E88: 42 3C 42 42 7E 42 42 42 3E 08 08 08 08 3E 02 02 02 42 42 3C 44 48 70 48;
1EA0: 44 42 40 40 40 40 40 7E 42 66 5A 42 42 42 42 62 52 4A 46 42 3C 42 42 42;
1EB8: 42 3C 7C 42 42 7C 40 40 3C 42 42 52 4A 3C 7C 42 42 7C 44 42 3C 40 3C 02;
1ED0: 42 3C FE 10 10 10 10 10 42 42 42 42 42 3E 42 42 42 42 24 18 42 42 42 42;
1EE8: 5A 24 42 24 18 18 24 42 82 44 28 10 10 10 7E 04 08 10 20 7E 0E 08 08 08;
1F00: 08 0E 00 40 20 10 08 04 70 10 10 10 10 70 10 38 54 10 10 10 00 00 00 00;
1F18: 00 00 FF 1C 22 78 20 20 7E 00 00 38 04 3C 44 3E 00 20 20 3C 22 22 3C 00;
1F30: 00 1C 20 20 20 1C 00 04 04 3C 44 44 3E 00 00 38 44 78 40 3C 00 0C 10 18;
1F48: 10 10 10 00 00 3C 44 44 3C 04 38 40 40 78 44 44 44 00 10 00 30 10 10 38;
1F60: 00 04 00 04 04 04 24 18 20 28 30 30 28 24 00 10 10 10 10 10 0C 00 00 68;
1F78: 54 54 54 54 00 00 78 44 44 44 44 00 00 38 44 44 44 38 00 00 78 44 44 78;
1F90: 40 40 00 3C 44 44 3C 04 06 00 1C 20 20 20 20 00 00 38 40 38 04 78 00 10;
1FA8: 38 10 10 10 0C 00 00 44 44 44 44 3C 00 00 44 44 28 28 10 00 00 44 54 54;
1FC0: 54 28 00 00 44 28 10 28 44 00 00 44 44 44 3C 04 38 00 7C 08 10 20 7C 00;
1FD8: 0E 08 30 30 08 0E 00 08 08 08 08 08 08 00 70 10 0C 0C 10 70 00 32 4C 00;
1FF0: 00 00 00 00 3C 42 99 A1 A1 99 42 3C FF 58 1D 00;
END;

View File

@ -19,68 +19,44 @@ module ace_mist(
input SPI_SS2,
input SPI_SS3,
input SPI_SS4,
input CONF_DATA0,
output [12:0] SDRAM_A,
inout [15:0] SDRAM_DQ,
output SDRAM_DQML,
output SDRAM_DQMH,
output SDRAM_nWE,
output SDRAM_nCAS,
output SDRAM_nRAS,
output SDRAM_nCS,
output [1:0] SDRAM_BA,
output SDRAM_CLK,
output SDRAM_CKE
input CONF_DATA0
);
`include "rtl\build_id.v"
localparam CONF_STR = {
"Jupiter ACE;;",
"F,ACE;",
"O34,Scandoubler Fx,None,HQ2x,CRT 25%,CRT 50%;",
"O67,CPU Speed,Normal,x2,x4;",
"T5,Reset;",
"V,v0.2.",`BUILD_DATE
"V,v0.5.",`BUILD_DATE
};
wire clk_sys;
wire clk_65;
wire clk_cpu;
wire clk_sdram;
wire locked;
wire scandoubler_disable;
wire ypbpr;
wire ps2_kbd_clk, ps2_kbd_data;
wire [10:0] ps2_key;
assign LED = ~ioctl_download;
wire [31:0] status;
wire [1:0] buttons;
wire [1:0] switches;
wire audio;
wire TapeIn;
wire TapeOut;
wire HSync, VSync;
wire HSync, VSync, HBlank, VBlank;
wire blankn = ~(HBlank | VBlank);
wire video;
wire [7:0] kbd_rows;
wire [4:0] kbd_columns;
wire ioctl_download;
wire ioctl_wr;
wire [24:0] ioctl_addr;
wire [7:0] ioctl_dout;
reg ioctl_wait = 0;
pll pll(
.areset(),
.inclk0(CLOCK_27),
.c0(clk_sys),//26.0Mhz
.c1(clk_65),//6.5Mhz
.c2(clk_cpu),//3.25Mhz
.c3(SDRAM_CLK),//100Mhz
.locked(locked)
.c0(clk_sys)
);
reg [7:0] reset_cnt;
always @(posedge clk_sys) begin
if(!locked || buttons[1] || status[0] || status[5])
reset_cnt <= 8'h0;
else if(reset_cnt != 8'd255)
reset_cnt <= reset_cnt + 8'd1;
end
wire reset = (reset_cnt != 8'd255);
mist_io #(.STRLEN(($size(CONF_STR)>>3))) mist_io
(
@ -96,15 +72,19 @@ mist_io #(.STRLEN(($size(CONF_STR)>>3))) mist_io
.scandoubler_disable(scandoubler_disable),
.ypbpr(ypbpr),
.status(status),
.ps2_kbd_clk(ps2_kbd_clk),
.ps2_kbd_data(ps2_kbd_data)
.ps2_key(ps2_key),
.ioctl_download(ioctl_download),
.ioctl_wr(ioctl_wr),
.ioctl_addr(ioctl_addr),
.ioctl_dout(ioctl_dout),
.ioctl_wait(ioctl_wait)
);
video_mixer #(.LINE_LENGTH(800), .HALF_DEPTH(1)) video_mixer
video_mixer #(.LINE_LENGTH(280), .HALF_DEPTH(1)) video_mixer
(
.clk_sys(clk_sys),
.ce_pix(clk_65),
.ce_pix_actual(clk_65),
.ce_pix(ce_pix),
.ce_pix_actual(ce_pix),
.SPI_SCK(SPI_SCK),
.SPI_SS3(SPI_SS3),
.SPI_DI(SPI_DI),
@ -113,12 +93,12 @@ video_mixer #(.LINE_LENGTH(800), .HALF_DEPTH(1)) video_mixer
.hq2x(status[4:3]==1),
.ypbpr(ypbpr),
.ypbpr_full(1),
.R({video,video,1'b0}),
.G({video,video,1'b0}),
.B({video,video,1'b0}),
.mono(1),
.HSync(HSync),
.VSync(VSync),
.R(blankn ? {video,video,video} : "000"),
.G(blankn ? {video,video,video} : "000"),
.B(blankn ? {video,video,video} : "000"),
.mono(0),
.HSync(~HSync),
.VSync(~VSync),
.line_start(0),
.VGA_R(VGA_R),
.VGA_G(VGA_G),
@ -127,79 +107,118 @@ video_mixer #(.LINE_LENGTH(800), .HALF_DEPTH(1)) video_mixer
.VGA_HS(VGA_HS)
);
wire [14:0]sd_addr;
wire [7:0]sd_dout;
wire [7:0]sd_din;
wire sd_we;
wire sd_rd;
wire sd_ready;
wire [1:0] turbo = status[7:6];
sram sram(
.SDRAM_DQ(SDRAM_DQ),
.SDRAM_A(SDRAM_A),
.SDRAM_DQML(SDRAM_DQML),
.SDRAM_DQMH(SDRAM_DQMH),
.SDRAM_BA(SDRAM_BA),
.SDRAM_nCS(SDRAM_nCS),
.SDRAM_nWE(SDRAM_nWE),
.SDRAM_nRAS(SDRAM_nRAS),
.SDRAM_nCAS(SDRAM_nCAS),
.SDRAM_CKE(SDRAM_CKE),
.init(~locked),
.clk_sdram(SDRAM_CLK),
.addr({10'b0000000000,sd_addr}), // 25 bit address
.dout(sd_dout), // data output to cpu
.din(sd_din), // data input from cpu
.we(sd_we), // cpu requests write
.rd(sd_rd), // cpu requests read
.ready(sd_ready)
);
reg ce_pix;
reg ce_cpu;
always @(negedge clk_sys) begin
reg [2:0] div;
jupiter_ace jupiter_ace
(
.clk_65(clk_65),
.clk_cpu(clk_cpu),
.reset(~reset),
.filas(kbd_rows),
.columnas(kbd_columns),
.video(video),
.hsync(HSync),
div <= div + 1'd1;
ce_pix <= !div[1:0];
ce_cpu <= (!div[2:0] && !turbo) | (!div[1:0] && turbo[0]) | turbo[1];
end
wire reset = ~(buttons[1] || status[0] || status[5]);
wire spk, mic;
jupiter_ace jupiter_ace(
.clk(clk_sys),
.ce_pix(ce_pix),
.ce_cpu(ce_cpu),
.no_wait(|turbo),
.reset(reset|loader_reset),
.kbd_row(kbd_row),
.kbd_col(kbd_col),
.video_out(video),
.hsync(HSync),
.vsync(VSync),
.ear(UART_RX),//Play
.mic(UART_TX),//Record
.spk(audio),
.sd_addr(sd_addr),
.sd_dout(sd_dout),
.sd_din(sd_din),
.sd_we(sd_we),
.sd_rd(sd_rd),
.sd_ready(sd_ready)
.hblank(HBlank),
.vblank(VBlank),
.mic(mic),
.spk(spk),
.loader_en(loader_en),
.loader_addr(loader_addr),
.loader_data(loader_data),
.loader_wr(loader_wr)
);
sigma_delta_dac sigma_delta_dac
(
.DACout(AUDIO_L),
.DACin({audio}),
.CLK(clk_65),
.RESET(0)
.DACin({1'b0, spk, mic, 13'd0}),
.CLK(clk_sys),
.RESET(reset)
);
assign AUDIO_R = AUDIO_L;
keyboard keyboard
(
.clk(clk_65),
.clkps2(ps2_kbd_clk),
.dataps2(ps2_kbd_data),
.rows(kbd_rows),
.columns(kbd_columns),
.kbd_reset(),
.kbd_nmi(),
.kbd_mreset()
wire [7:0] kbd_row;
wire [4:0] kbd_col;
keyboard keyboard(
.reset(reset),
.clk_sys(clk_sys),
.ps2_key(ps2_key),
.kbd_row(kbd_row),
.kbd_col(kbd_col)
);
reg [15:0] loader_addr;
reg [7:0] loader_data;
reg loader_wr;
reg loader_en;
reg loader_reset = 0;
always @(posedge clk_sys) begin
reg [7:0] cnt = 0;
reg [1:0] status = 0;
reg old_download;
integer timeout = 0;
old_download <= ioctl_download;
loader_reset <= 0;
if(~old_download && ioctl_download) begin
loader_addr <= 'h2000;
status <= 0;
loader_reset <=1;
ioctl_wait <= 1;
timeout <= 3000000;
cnt <= 0;
end
loader_wr <= 0;
if(loader_wr) loader_addr <= loader_addr + 1'd1;
if(ioctl_wr) begin
loader_en <= 1;
case(status)
0: if(ioctl_dout == 'hED) status <= 1;
else begin
loader_wr <= 1;
loader_data <= ioctl_dout;
end
1: begin
cnt <= ioctl_dout;
status <= ioctl_dout ? 2'd2 : 2'd3; // cnt = 0 => stop
end
2: begin
loader_data <= ioctl_dout;
ioctl_wait <= 1;
end
endcase
end
if(ioctl_wait && !loader_wr) begin
if(cnt) begin
cnt <= cnt - 1'd1;
loader_wr <= 1;
end
else if(timeout) timeout <= timeout - 1;
else {status,ioctl_wait} <= 0;
end
if(old_download & ~ioctl_download) loader_en <= 0;
if(reset) ioctl_wait <= 0;
end
endmodule

View File

@ -1,2 +1,2 @@
`define BUILD_DATE "180723"
`define BUILD_TIME "190837"
`define BUILD_DATE "181231"
`define BUILD_TIME "044701"

View File

@ -0,0 +1,80 @@
module dpram #(parameter ADDRWIDTH=8, DATAWIDTH=8, NUMWORDS=1<<ADDRWIDTH, MEM_INIT_FILE="")
(
input clock,
input [ADDRWIDTH-1:0] address_a,
input [DATAWIDTH-1:0] data_a,
input wren_a,
input oe_a_n,
output [DATAWIDTH-1:0] q_a,
input [ADDRWIDTH-1:0] address_b,
input [DATAWIDTH-1:0] data_b,
input wren_b,
input oe_b_n,
output [DATAWIDTH-1:0] q_b
);
wire [DATAWIDTH-1:0] out_a;
wire [DATAWIDTH-1:0] out_b;
assign q_a = oe_a_n ? {DATAWIDTH{1'b1}} : out_a;
assign q_b = oe_b_n ? {DATAWIDTH{1'b1}} : out_b;
altsyncram altsyncram_component (
.address_a (address_a),
.address_b (address_b),
.clock0 (clock),
.data_a (data_a),
.data_b (data_b),
.wren_a (wren_a),
.wren_b (wren_b),
.q_a (out_a),
.q_b (out_b),
.aclr0 (1'b0),
.aclr1 (1'b0),
.addressstall_a (1'b0),
.addressstall_b (1'b0),
.byteena_a (1'b1),
.byteena_b (1'b1),
.clock1 (1'b1),
.clocken0 (1'b1),
.clocken1 (1'b1),
.clocken2 (1'b1),
.clocken3 (1'b1),
.eccstatus (),
.rden_a (1'b1),
.rden_b (1'b1));
defparam
altsyncram_component.wrcontrol_wraddress_reg_b = "CLOCK0",
altsyncram_component.address_reg_b = "CLOCK0",
altsyncram_component.indata_reg_b = "CLOCK0",
altsyncram_component.numwords_a = NUMWORDS,
altsyncram_component.numwords_b = NUMWORDS,
altsyncram_component.widthad_a = ADDRWIDTH,
altsyncram_component.widthad_b = ADDRWIDTH,
altsyncram_component.width_a = DATAWIDTH,
altsyncram_component.width_b = DATAWIDTH,
altsyncram_component.width_byteena_a = 1,
altsyncram_component.width_byteena_b = 1,
altsyncram_component.init_file = MEM_INIT_FILE,
altsyncram_component.clock_enable_input_a = "BYPASS",
altsyncram_component.clock_enable_input_b = "BYPASS",
altsyncram_component.clock_enable_output_a = "BYPASS",
altsyncram_component.clock_enable_output_b = "BYPASS",
altsyncram_component.intended_device_family = "Cyclone V",
altsyncram_component.lpm_type = "altsyncram",
altsyncram_component.operation_mode = "BIDIR_DUAL_PORT",
altsyncram_component.outdata_aclr_a = "NONE",
altsyncram_component.outdata_aclr_b = "NONE",
altsyncram_component.outdata_reg_a = "UNREGISTERED",
altsyncram_component.outdata_reg_b = "UNREGISTERED",
altsyncram_component.power_up_uninitialized = "FALSE",
altsyncram_component.read_during_write_mode_mixed_ports = "DONT_CARE",
altsyncram_component.read_during_write_mode_port_a = "NEW_DATA_NO_NBE_READ",
altsyncram_component.read_during_write_mode_port_b = "NEW_DATA_NO_NBE_READ";
endmodule

View File

@ -1,217 +1,230 @@
`timescale 1ns / 1ps
`default_nettype none
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 20:06:40 03/19/2011
// Design Name:
// Module Name: jace_on_fpga
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//============================================================================
// Jupiter Ace main logic
// Copyright (C) 2018 Sorgelig
//
// Dependencies:
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 of the License, or (at your option)
// any later version.
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
//////////////////////////////////////////////////////////////////////////////////
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//============================================================================
module jupiter_ace (
input wire clk_65,
input wire clk_cpu,
input wire reset,
input wire ear,
output wire [7:0] filas,
input wire [4:0] columnas,
output wire video,
output wire hsync,
output wire vsync,
output wire mic,
output wire spk,
output wire [14:0] sd_addr,
input wire [7:0] sd_dout,
output wire [7:0] sd_din,
output wire sd_we,
output wire sd_rd,
input wire sd_ready
);
module jupiter_ace
(
input clk,
input ce_pix,
input ce_cpu,
input no_wait,
input reset,
wire [7:0] DinZ80;
wire [7:0] DoutZ80;
wire [15:0] AZ80;
output [7:0] kbd_row,
input [4:0] kbd_col,
output video_out,
output hsync,
output vsync,
output hblank,
output vblank,
output reg mic,
output reg spk,
input loader_en,
input [15:0] loader_addr,
input [7:0] loader_data,
input loader_wr
);
assign kbd_row = cpu_addr[15:8];
wire [15:0] addr = loader_en ? loader_addr : cpu_addr;
wire [7:0] data = loader_en ? loader_data : cpu_dout;
wire ram_we = loader_en ? loader_wr : ~wr_n;
wire rom_enable = (~mreq_n | loader_en) && (addr[15:13] == 0); // 0000 - 1FFF 8KB
wire sram_enable = (~mreq_n | loader_en) && (addr[15:11] == 'b00100); // 2000 - 27FF 1KB * 2
wire cram_enable = (~mreq_n | loader_en) && (addr[15:11] == 'b00101); // 2800 - 2FFF 1KB * 2
wire uram_enable = (~mreq_n | loader_en) && (addr[15:12] == 'b0011); // 3000 - 3FFF 1KB * 4
wire xram_enable = (~mreq_n | loader_en) && (addr[15:14] == 'b01); // 4000 - 7FFF 16KB
wire eram_enable = (~mreq_n | loader_en) && (addr[15]); // 8000 - FFFF 32KB
wire wait_n = no_wait | ~(sram_enable | cram_enable) | hblank | vblank | ~addr[10]; // 2400 - 27FF, 2C00 - 2FFF
always @(posedge clk) begin
if (~iorq_n & ~cpu_addr[0]) begin
if (~rd_n) spk <= 0;
if (~wr_n) {spk,mic} <= {1'b1,cpu_dout[3]};
end
end
wire [7:0] io_dout = {8{iorq_n|rd_n}} | (~cpu_addr[0] ? {3'b110, kbd_col} : (sram_data | cram_data));
wire [9:0] sram_addr;
wire [7:0] sram_data;
wire [7:0] sram_dout;
dpram #(10) sram
(
.clock(clk),
.address_a(addr[9:0]),
.data_a(data),
.wren_a(ram_we & sram_enable),
.oe_a_n(~sram_enable),
.q_a(sram_dout),
.address_b(sram_addr),
.q_b(sram_data)
);
wire [9:0] cram_addr;
wire [7:0] cram_data;
dpram #(10) cram
(
.clock(clk),
.address_a(addr[9:0]),
.data_a(data),
.wren_a(ram_we & cram_enable),
.address_b(cram_addr),
.q_b(cram_data)
);
wire [7:0] uram_dout;
dpram #(10) uram
(
.clock(clk),
.address_a(addr[9:0]),
.data_a(data),
.wren_a(ram_we & uram_enable),
.oe_a_n(~uram_enable),
.q_a(uram_dout)
);
wire [7:0] xram_dout;
dpram #(14) xram
(
.clock(clk),
.address_a(addr[13:0]),
.data_a(data),
.wren_a(ram_we & xram_enable),
.oe_a_n(~xram_enable),
.q_a(xram_dout)
);
wire [7:0] eram_dout;
dpram #(14) eram//15
(
.clock(clk),
.address_a(addr[13:0]),
.data_a(data),
.wren_a(ram_we & eram_enable),
.oe_a_n(~eram_enable),
.q_a(eram_dout)
);
wire [7:0] rom_dout;
dpram #(.ADDRWIDTH(13), .MEM_INIT_FILE("ace.mif")) rom
(
.clock(clk),
.address_a(cpu_addr[12:0]),
.oe_a_n(~rom_enable),
.q_a(rom_dout)
);
wire [7:0] cpu_dout;
wire [15:0] cpu_addr;
wire iorq_n, mreq_n, rd_n, wr_n, int_n;
T80pa cpu
(
.RESET_n(~(reset | loader_reset)),
.CLK(clk),
.CEN_p(ce_cpu),
.WAIT_n(wait_n),
.INT_n(vsync),
.MREQ_n(mreq_n),
.IORQ_n(iorq_n),
.RD_n(rd_n),
.WR_n(wr_n),
.A(cpu_addr),
.DI(rom_dout & sram_dout & uram_dout & xram_dout & eram_dout & io_dout),
.DO(cpu_dout),
.DIRSet(|regset),
.DIR(REG)
);
reg [211:0] REG; // IFF2, IFF1, IM, IY, HL', DE', BC', IX, HL, DE, BC, PC, SP, R, I, F', A', F, A
reg [1:0] regset = 0;
reg loader_reset;
always @(posedge clk) begin
reg old_loader;
reg old_vsync;
old_vsync <= vsync;
wire iorq_n, mreq_n, rd_n, wr_n, wait_n, int_n;
wire rom_enable, sram_enable, cram_enable, uram_enable, xram_enable, eram_enable, data_from_jace_oe;
wire [7:0] dout_rom, dout_sram, dout_cram, dout_uram, dout_xram, dout_eram, data_from_jace;
wire [7:0] sram_data, cram_data;
wire [9:0] sram_addr, cram_addr;
wire enable_write_to_rom;
wire [7:0] dout_modulo_enable_write;
wire modulo_enable_write_oe;
assign filas = AZ80[15:8];
// Multiplexer
assign DinZ80 = (rom_enable == 1'b1)? dout_rom :
(sram_enable == 1'b1)? dout_sram :
(cram_enable == 1'b1)? dout_cram :
(uram_enable == 1'b1)? dout_uram :
(xram_enable == 1'b1)? dout_xram :
(eram_enable == 1'b1)? dout_eram :
(modulo_enable_write_oe == 1'b1)? dout_modulo_enable_write :
(data_from_jace_oe == 1'b1)? data_from_jace :
sram_data | cram_data; // By default, this is what the data bus sees
ram1k_dualport sram (
.clk(clk_65),
.ce(sram_enable),
.a1(AZ80[9:0]),
.a2(sram_addr),
.din(DoutZ80),
.dout1(dout_sram),
.dout2(sram_data),
.we(~wr_n)
);
ram1k_dualport cram (
.clk(clk_65),
.ce(cram_enable),
.a1(AZ80[9:0]),
.a2(cram_addr),
.din(DoutZ80),
.dout1(dout_cram),
.dout2(cram_data),
.we(~wr_n)
);
ram1k uram(
.clk(clk_65),
.ce(uram_enable),
.a(AZ80[9:0]),
.din(DoutZ80),
.dout(dout_uram),
.we(~wr_n)
);
ram16k xram(
.clk(clk_65),
.ce(xram_enable),
.a(AZ80[13:0]),
.din(DoutZ80),
.dout(dout_xram),
.we(~wr_n)
);
assign sd_addr = AZ80[14:0];
assign dout_eram = sd_dout;
assign sd_din = DoutZ80;
assign sd_we = ~wr_n;
assign sd_rd = eram_enable;
// ram32k eram(//16k for now//todo 32k
// .clk(clk_65),
// .ce(eram_enable),
// .a(AZ80[13:0]),//14
// .din(DoutZ80),
// .dout(dout_eram),
// .we(~wr_n)
// );
// rom the_rom(
// .clk(clk_65),
// .a(AZ80[12:0]),
// .dout(dout_rom)
// );
rom2 the_rom(
.clk(clk_65),
.ce(rom_enable),
.a(AZ80[12:0]),
.din(DoutZ80),
.dout(dout_rom),
.we(~wr_n & enable_write_to_rom)
);
io_write_to_rom modulo_habilitador_escrituras (
.clk(clk_65),
.a(AZ80),
.iorq_n(iorq_n),
.rd_n(rd_n),
.wr_n(wr_n),
.din(DoutZ80),
.dout(dout_modulo_enable_write),
.dout_oe(modulo_enable_write_oe),
.enable_write_to_rom(enable_write_to_rom)
);
tv80n cpu(
// Outputs
.m1_n(),
.mreq_n(mreq_n),
.iorq_n(iorq_n),
.rd_n(rd_n),
.wr_n(wr_n),
.rfsh_n(),
.halt_n(),
.busak_n(),
.A(AZ80),
.dout(DoutZ80),
// Inputs
.di(DinZ80),
.reset_n(reset),
.clk(clk_cpu),
.wait_n(wait_n),
.int_n(int_n),
.nmi_n(1'b1),
.busrq_n(1'b1)
);
glue glogic (
.clk(clk_65),
// CPU interface
.cpu_addr(AZ80),
.mreq_n(mreq_n),
.iorq_n(iorq_n),
.rd_n(rd_n),
.wr_n(wr_n),
.data_from_cpu(DoutZ80),
.data_to_cpu(data_from_jace),
.data_to_cpu_oe(data_from_jace_oe),
.wait_n(wait_n),
.int_n(int_n),
// CPU-RAM interface
.rom_enable(rom_enable),
.sram_enable(sram_enable),
.cram_enable(cram_enable),
.uram_enable(uram_enable),
.xram_enable(xram_enable),
.eram_enable(eram_enable),
// Screen RAM and Char RAM interface
.screen_addr(sram_addr),
.screen_data(sram_data),
.char_addr(cram_addr),
.char_data(cram_data),
// Devices
.kbdcols(columnas),
.ear(ear),
.spk(spk),
.mic(mic),
.video(video),
.hsync_pal(hsync),
.vsync_pal(vsync)
);
endmodule
if(loader_en) begin
loader_reset <= 1;
regset <= 2'b11;
if(loader_wr && (loader_addr[15:8] == 8'h21) && !loader_addr[7]) begin
case(loader_addr[6:0])
'h00: REG[15:8] <= loader_data; //f
'h01: REG[7:0] <= loader_data; //a
'h04: REG[87:80] <= loader_data; //c
'h05: REG[95:88] <= loader_data; //b
'h08: REG[103:96] <= loader_data; //e
'h09: REG[111:104] <= loader_data; //d
'h0C: REG[119:112] <= loader_data; //l
'h0D: REG[127:120] <= loader_data; //h
'h10: REG[135:128] <= loader_data; //xl
'h11: REG[143:136] <= loader_data; //xh
'h14: REG[199:192] <= loader_data; //yl
'h15: REG[207:200] <= loader_data; //yh
'h18: REG[55:48] <= loader_data; //spl
'h19: REG[63:56] <= loader_data; //sph
'h1C: REG[71:64] <= loader_data; //pcl
'h1D: REG[79:72] <= loader_data; //pch
'h20: REG[31:24] <= loader_data; //f'
'h21: REG[23:16] <= loader_data; //a'
'h24: REG[151:144] <= loader_data; //c'
'h25: REG[159:152] <= loader_data; //b' //EightyOne wrongly restores it to B register
'h28: REG[167:160] <= loader_data; //e'
'h29: REG[175:168] <= loader_data; //d'
'h2C: REG[183:176] <= loader_data; //l'
'h2D: REG[191:184] <= loader_data; //h'
'h30: REG[209:208] <= loader_data[1:0]; //im
'h34: REG[210] <= loader_data[0]; //iff1
'h38: REG[211] <= loader_data[0]; //iff2
'h3C: REG[39:32] <= loader_data; //i
'h40: REG[47:40] <= loader_data; //r
endcase
end
end
else begin
if(~old_vsync & vsync) loader_reset <= 0;
if(~loader_reset && regset) begin
regset <= regset - 1'd1;
if(REG[63:48] > loader_addr) begin
REG[63:48] <= 16'hFFFE; // bug in dump!
end
end
end
end
video video(
.clk(clk),
.ce_pix(ce_pix),
.sram_addr(sram_addr),
.sram_data(sram_data),
.cram_addr(cram_addr),
.cram_data(cram_data),
.video_out(video_out),
.hsync(hsync),
.vsync(vsync),
.hblank(hblank),
.vblank(vblank)
);
endmodule

View File

@ -1,632 +1,253 @@
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 17:36:45 11/07/2015
// Design Name:
// Module Name: keyboard
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//============================================================================
// Jupiter Ace keyboard
// Copyright (C) 2018 Sorgelig
//
// Dependencies:
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 of the License, or (at your option)
// any later version.
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
//////////////////////////////////////////////////////////////////////////////////
module keyboard(
input wire clk,
input wire clkps2,
input wire dataps2,
input wire [7:0] rows,
output wire [4:0] columns,
output reg kbd_reset,
output reg kbd_nmi,
output reg kbd_mreset
);
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//============================================================================
initial begin
kbd_reset = 1'b1;
kbd_nmi = 1'b1;
kbd_mreset = 1'b1;
end
module keyboard
(
input reset,
input clk_sys,
// Teclas no extendidas
`define KEY_RELEASED 8'hf0
`define KEY_EXTENDED 8'he0
`define KEY_ESC 8'h76
`define KEY_F1 8'h05
`define KEY_F2 8'h06
`define KEY_F3 8'h04
`define KEY_F4 8'h0C
`define KEY_F5 8'h03
`define KEY_F6 8'h0B
`define KEY_F7 8'h83
`define KEY_F8 8'h0A
`define KEY_F9 8'h01
`define KEY_F10 8'h09
`define KEY_F11 8'h78
`define KEY_F12 8'h07
input [10:0] ps2_key,
`define KEY_BL 8'h0E
`define KEY_1 8'h16
`define KEY_2 8'h1E
`define KEY_3 8'h26
`define KEY_4 8'h25
`define KEY_5 8'h2E
`define KEY_6 8'h36
`define KEY_7 8'h3D
`define KEY_8 8'h3E
`define KEY_9 8'h46
`define KEY_0 8'h45
`define KEY_APOS 8'h4E
`define KEY_AEXC 8'h55
`define KEY_BKSP 8'h66
input [7:0] kbd_row,
output [4:0] kbd_col
);
`define KEY_TAB 8'h0D
`define KEY_Q 8'h15
`define KEY_W 8'h1D
`define KEY_E 8'h24
`define KEY_R 8'h2D
`define KEY_T 8'h2C
`define KEY_Y 8'h35
`define KEY_U 8'h3C
`define KEY_I 8'h43
`define KEY_O 8'h44
`define KEY_P 8'h4D
`define KEY_CORCHA 8'h54
`define KEY_CORCHC 8'h5B
`define KEY_ENTER 8'h5A
reg [4:0] keys[7:0];
wire press_n = ~ps2_key[9];
`define KEY_CPSLK 8'h58
`define KEY_A 8'h1C
`define KEY_S 8'h1B
`define KEY_D 8'h23
`define KEY_F 8'h2B
`define KEY_G 8'h34
`define KEY_H 8'h33
`define KEY_J 8'h3B
`define KEY_K 8'h42
`define KEY_L 8'h4B
`define KEY_NT 8'h4C
`define KEY_LLAVA 8'h52
`define KEY_LLAVC 8'h5D
// Output addressed row to ULA
assign kbd_col = ({5{kbd_row[0]}} | keys[0])
&({5{kbd_row[1]}} | keys[1])
&({5{kbd_row[2]}} | keys[2])
&({5{kbd_row[3]}} | keys[3])
&({5{kbd_row[4]}} | keys[4])
&({5{kbd_row[5]}} | keys[5])
&({5{kbd_row[6]}} | keys[6])
&({5{kbd_row[7]}} | keys[7]);
`define KEY_LSHIFT 8'h12
`define KEY_LT 8'h61
`define KEY_Z 8'h1A
`define KEY_X 8'h22
`define KEY_C 8'h21
`define KEY_V 8'h2A
`define KEY_B 8'h32
`define KEY_N 8'h31
`define KEY_M 8'h3A
`define KEY_COMA 8'h41
`define KEY_PUNTO 8'h49
`define KEY_MENOS 8'h4A
`define KEY_RSHIFT 8'h59
wire shift = ~keys[0][0];
`define KEY_LCTRL 8'h14
`define KEY_LALT 8'h11
`define KEY_SPACE 8'h29
always @(posedge clk_sys) begin
reg old_reset = 0;
reg old_state;
`define KEY_KP0 8'h70
`define KEY_KP1 8'h69
`define KEY_KP2 8'h72
`define KEY_KP3 8'h7A
`define KEY_KP4 8'h6B
`define KEY_KP5 8'h73
`define KEY_KP6 8'h74
`define KEY_KP7 8'h6C
`define KEY_KP8 8'h75
`define KEY_KP9 8'h7D
`define KEY_KPPUNTO 8'h71
`define KEY_KPMAS 8'h79
`define KEY_KPMENOS 8'h7B
`define KEY_KPASTER 8'h7C
old_state <= ps2_key[10];
`define KEY_BLKNUM 8'h77
`define KEY_BLKSCR 8'h7E
old_reset <= reset;
if(~old_reset & reset)begin
keys[0] <= 5'b11111;
keys[1] <= 5'b11111;
keys[2] <= 5'b11111;
keys[3] <= 5'b11111;
keys[4] <= 5'b11111;
keys[5] <= 5'b11111;
keys[6] <= 5'b11111;
keys[7] <= 5'b11111;
end
// Teclas extendidas (E0 + scancode)
`define KEY_WAKEUP 8'h5E
`define KEY_SLEEP 8'h3F
`define KEY_POWER 8'h37
`define KEY_INS 8'h70
`define KEY_SUP 8'h71
`define KEY_HOME 8'h6C
`define KEY_END 8'h69
`define KEY_PGU 8'h7D
`define KEY_PGD 8'h7A
`define KEY_UP 8'h75
`define KEY_DOWN 8'h72
`define KEY_LEFT 8'h6B
`define KEY_RIGHT 8'h74
`define KEY_RCTRL 8'h14
`define KEY_ALTGR 8'h11
`define KEY_KPENTER 8'h5A
`define KEY_KPSLASH 8'h4A
`define KEY_PRTSCR 8'h7C
if(old_state != ps2_key[10]) begin
case(ps2_key[7:0])
8'h12 : keys[0][0] <= press_n; // Left shift (CAPS SHIFT)
8'h59 : keys[0][0] <= press_n; // Right shift (CAPS SHIFT)
8'h14: keys[0][1] <= press_n; // ctrl
8'h1a : keys[0][2] <= press_n; // Z
8'h22 : keys[0][3] <= press_n; // X
8'h21 : keys[0][4] <= press_n; // C
8'h1c : keys[1][0] <= press_n; // A
8'h1b : keys[1][1] <= press_n; // S
8'h23 : keys[1][2] <= press_n; // D
8'h2b : keys[1][3] <= press_n; // F
8'h34 : keys[1][4] <= press_n; // G
wire new_key_aval;
wire [7:0] scancode;
wire is_released;
wire is_extended;
8'h15 : keys[2][0] <= press_n; // Q
8'h1d : keys[2][1] <= press_n; // W
8'h24 : keys[2][2] <= press_n; // E
8'h2d : keys[2][3] <= press_n; // R
8'h2c : keys[2][4] <= press_n; // T
reg shift_pressed = 1'b0;
reg ctrl_pressed = 1'b0;
reg alt_pressed = 1'b0;
8'h16 : keys[3][0] <= press_n; // 1
8'h1e : keys[3][1] <= press_n; // 2
8'h26 : keys[3][2] <= press_n; // 3
8'h25 : keys[3][3] <= press_n; // 4
8'h2e : keys[3][4] <= press_n; // 5
ps2_port ps2_kbd (
.clk(clk), // se recomienda 1 MHz <= clk <= 600 MHz
.enable_rcv(1'b1), // habilitar la maquina de estados de recepcion
.ps2clk_ext(clkps2),
.ps2data_ext(dataps2),
.kb_interrupt(new_key_aval), // a 1 durante 1 clk para indicar nueva tecla recibida
.scancode(scancode), // make o breakcode de la tecla
.released(is_released), // soltada=1, pulsada=0
.extended(is_extended) // extendida=1, no extendida=0
);
8'h45 : keys[4][0] <= press_n; // 0
8'h46 : keys[4][1] <= press_n; // 9
8'h3e : keys[4][2] <= press_n; // 8
8'h3d : keys[4][3] <= press_n; // 7
8'h36 : keys[4][4] <= press_n; // 6
reg [4:0] matrix[0:7]; // 40-key matrix keyboard
initial begin
matrix[0] = 5'b11111; // C X Z SS CS
matrix[1] = 5'b11111; // G F D S A
matrix[2] = 5'b11111; // T R E W Q
matrix[3] = 5'b11111; // 5 4 3 2 1
matrix[4] = 5'b11111; // 6 7 8 9 0
matrix[5] = 5'b11111; // Y U I O P
matrix[6] = 5'b11111; // H J K L ENT
matrix[7] = 5'b11111; // V B N M SP
end
8'h4d : keys[5][0] <= press_n; // P
8'h44 : keys[5][1] <= press_n; // O
8'h43 : keys[5][2] <= press_n; // I
8'h3c : keys[5][3] <= press_n; // U
8'h35 : keys[5][4] <= press_n; // Y
assign columns = (matrix[0] | { {8{rows[0]}} }) &
(matrix[1] | { {8{rows[1]}} }) &
(matrix[2] | { {8{rows[2]}} }) &
(matrix[3] | { {8{rows[3]}} }) &
(matrix[4] | { {8{rows[4]}} }) &
(matrix[5] | { {8{rows[5]}} }) &
(matrix[6] | { {8{rows[6]}} }) &
(matrix[7] | { {8{rows[7]}} });
8'h5a : keys[6][0] <= press_n; // ENTER
8'h4b : keys[6][1] <= press_n; // L
8'h42 : keys[6][2] <= press_n; // K
8'h3b : keys[6][3] <= press_n; // J
8'h33 : keys[6][4] <= press_n; // H
8'h29 : keys[7][0] <= press_n; // SPACE
8'h3a : keys[7][1] <= press_n; // M
8'h31 : keys[7][2] <= press_n; // N
8'h32 : keys[7][3] <= press_n; // B
8'h2a : keys[7][4] <= press_n; // V
8'h6B : begin // Left (CAPS 5)
keys[0][0] <= press_n;
keys[3][4] <= press_n;
end
8'h72 : begin // Up (CAPS 6)
keys[0][0] <= press_n;
keys[4][3] <= press_n;
end
8'h75 : begin // Down (CAPS 7)
keys[0][0] <= press_n;
keys[4][4] <= press_n;
end
8'h74 : begin // Right (CAPS 8)
keys[0][0] <= press_n;
keys[4][2] <= press_n;
end
8'h66 : begin // Backspace (CAPS 0)
keys[0][0] <= press_n;
keys[4][0] <= press_n;
end
8'h76 : begin // Escape (CAPS SPACE)
keys[0][0] <= press_n;
keys[7][0] <= press_n;
end
8'h58 : begin // Caps Lock
keys[0][0] <= press_n;
keys[3][1] <= press_n;
end
8'h0D : begin // TAB
keys[0][0] <= press_n;
keys[3][0] <= press_n;
end
8'h41 : begin // , <
keys[0][1] <= press_n;
if(press_n) begin
keys[7][2] <= 1;
keys[2][3] <= 1;
end
else if(shift) keys[2][3] <= 0;
else keys[7][2] <= 0;
end
8'h49 : begin // . >
keys[0][1] <= press_n;
if(press_n) begin
keys[7][1] <= 1;
keys[2][4] <= 1;
end
else if(shift) keys[2][4] <= 0;
else keys[7][1] <= 0;
end
8'h4C : begin // ; :
keys[0][1] <= press_n;
if(press_n) begin
keys[5][1] <= 1;
keys[0][2] <= 1;
end
else if(shift) keys[0][2] <= 0;
else keys[5][1] <= 0;
end
8'h52 : begin // " '
keys[0][1] <= press_n;
if(press_n) begin
keys[5][0] <= 1;
keys[4][3] <= 1;
end
else if(shift) keys[4][3] <= 0;
else keys[5][0] <= 0;
end
8'h4A : begin // / ?
keys[0][1] <= press_n;
if(press_n) begin
keys[0][4] <= 1;
keys[7][4] <= 1;
end
else if(shift) keys[0][4] <= 0;
else keys[7][4] <= 0;
end
8'h4E : begin // - _
keys[0][1] <= press_n;
if(press_n) begin
keys[6][3] <= 1;
keys[4][0] <= 1;
end
else if(shift) keys[4][0] <= 0;
else keys[6][3] <= 0;
end
8'h55 : begin // = +
keys[0][1] <= press_n;
if(press_n) begin
keys[6][1] <= 1;
keys[6][2] <= 1;
end
else if(shift) keys[6][2] <= 0;
else keys[6][1] <= 0;
end
8'h54 : begin // [ {
keys[0][1] <= press_n;
if(press_n) begin
keys[5][4] <= 1;
keys[1][3] <= 1;
end
else if(shift) keys[1][3] <= 0;
else keys[5][4] <= 0;
end
8'h5B : begin // ] }
keys[0][1] <= press_n;
if(press_n) begin
keys[5][3] <= 1;
keys[1][4] <= 1;
end
else if(shift) keys[1][4] <= 0;
else keys[5][3] <= 0;
end
8'h5D : begin // \ |
keys[0][1] <= press_n;
if(press_n) begin
keys[1][2] <= 1;
keys[1][1] <= 1;
end
else if(shift) keys[1][1] <= 0;
else keys[1][2] <= 0;
end
8'h0E : begin // ~ *
keys[0][1] <= press_n;
if(press_n) begin
keys[1][0] <= 1;
keys[7][3] <= 1;
end
else if(shift) keys[7][3] <= 0;
else keys[1][0] <= 0;
end
default: ;
endcase
end
end
always @(posedge clk) begin
if (new_key_aval == 1'b1) begin
case (scancode)
// Special and control keys
`KEY_LSHIFT,
`KEY_RSHIFT:
shift_pressed <= ~is_released;
`KEY_LCTRL,
`KEY_RCTRL:
begin
ctrl_pressed <= ~is_released;
if (is_extended)
matrix[0][1] <= is_released; // Right control = Symbol shift
else
matrix[0][0] <= is_released; // Left control = Caps shift
end
`KEY_LALT:
alt_pressed <= ~is_released;
`KEY_KPPUNTO:
if (ctrl_pressed && alt_pressed) begin
kbd_reset <= is_released;
if (is_released == 1'b0) begin
matrix[0] <= 5'b11111; // C X Z SS CS
matrix[1] <= 5'b11111; // G F D S A
matrix[2] <= 5'b11111; // T R E W Q
matrix[3] <= 5'b11111; // 5 4 3 2 1
matrix[4] <= 5'b11111; // 6 7 8 9 0
matrix[5] <= 5'b11111; // Y U I O P
matrix[6] <= 5'b11111; // H J K L ENT
matrix[7] <= 5'b11111; // V B N M SP
end
end
`KEY_F5:
if (ctrl_pressed && alt_pressed)
kbd_nmi <= is_released;
`KEY_ENTER:
matrix[6][0] <= is_released;
`KEY_ESC:
begin
matrix[0][0] <= is_released;
matrix[7][0] <= is_released;
end
`KEY_BKSP:
if (ctrl_pressed && alt_pressed) begin
kbd_mreset <= is_released;
end
else begin
matrix[0][0] <= is_released;
matrix[4][0] <= is_released;
end
`KEY_CPSLK:
begin
matrix[0][0] <= is_released;
matrix[3][1] <= is_released; // CAPS LOCK
end
`KEY_F2:
begin
matrix[0][0] <= is_released;
matrix[3][0] <= is_released; // EDIT
end
// Digits and puntuaction marks inside digits
`KEY_1:
begin
if (alt_pressed) begin
matrix[0][1] <= is_released;
matrix[1][1] <= is_released; // |
end
else if (shift_pressed) begin
matrix[0][1] <= is_released;
matrix[3][0] <= is_released; // !
end
else
matrix[3][0] <= is_released;
end
`KEY_2:
begin
if (alt_pressed) begin
matrix[0][1] <= is_released;
matrix[3][1] <= is_released; // @
end
else if (shift_pressed) begin
matrix[0][1] <= is_released;
matrix[5][0] <= is_released; // "
end
else
matrix[3][1] <= is_released;
end
`KEY_3:
begin
if (!shift_pressed)
matrix[3][2] <= is_released;
else begin
matrix[0][1] <= is_released;
matrix[3][2] <= is_released; // #
end
end
`KEY_4:
begin
if (shift_pressed) begin
matrix[0][1] <= is_released;
matrix[3][3] <= is_released; // $
end
else if (ctrl_pressed) begin
matrix[0][0] <= is_released;
matrix[3][3] <= is_released; // INV VIDEO
end
else
matrix[3][3] <= is_released;
end
`KEY_5:
begin
if (!shift_pressed)
matrix[3][4] <= is_released;
else begin
matrix[0][1] <= is_released;
matrix[3][4] <= is_released; // %
end
end
`KEY_6:
begin
if (!shift_pressed)
matrix[4][4] <= is_released;
else begin
matrix[0][1] <= is_released;
matrix[4][4] <= is_released; // &
end
end
`KEY_7:
begin
if (!shift_pressed)
matrix[4][3] <= is_released;
else begin
matrix[0][1] <= is_released;
matrix[7][4] <= is_released; // /
end
end
`KEY_8:
begin
if (!shift_pressed)
matrix[4][2] <= is_released;
else begin
matrix[0][1] <= is_released;
matrix[4][2] <= is_released; // (
end
end
`KEY_9:
begin
if (shift_pressed) begin
matrix[0][1] <= is_released;
matrix[4][1] <= is_released; // )
end
else if (ctrl_pressed) begin
matrix[0][0] <= is_released;
matrix[4][1] <= is_released;
end
else
matrix[4][1] <= is_released;
end
`KEY_0:
begin
if (!shift_pressed)
matrix[4][0] <= is_released;
else begin
matrix[0][1] <= is_released;
matrix[6][1] <= is_released; // =
end
end
// Alphabetic characters
`KEY_Z:
begin
matrix[0][2] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_X:
begin
matrix[0][3] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_C:
begin
matrix[0][4] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_A:
begin
matrix[1][0] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_S:
begin
matrix[1][1] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_D:
begin
matrix[1][2] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_F:
begin
matrix[1][3] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_G:
begin
matrix[1][4] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_Q:
begin
matrix[2][0] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_W:
begin
matrix[2][1] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_E:
begin
matrix[2][2] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_R:
begin
matrix[2][3] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_T:
begin
matrix[2][4] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_P:
begin
matrix[5][0] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_O:
begin
matrix[5][1] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_I:
begin
matrix[5][2] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_U:
begin
matrix[5][3] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_Y:
begin
matrix[5][4] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_L:
begin
matrix[6][1] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_K:
begin
matrix[6][2] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_J:
begin
matrix[6][3] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_H:
begin
matrix[6][4] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_M:
begin
matrix[7][1] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_N:
begin
matrix[7][2] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_B:
begin
matrix[7][3] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
`KEY_V:
begin
matrix[7][4] <= is_released;
if (shift_pressed)
matrix[0][0] <= is_released;
end
// Symbols
`KEY_APOS:
begin
matrix[0][1] <= is_released;
if (!shift_pressed)
matrix[4][3] <= is_released;
else
matrix[0][4] <= is_released; // ?
end
`KEY_CORCHA:
begin
matrix[0][1] <= is_released;
if (alt_pressed || shift_pressed)
matrix[5][4] <= is_released; // [
else
matrix[6][4] <= is_released; // ^
end
`KEY_CORCHC:
begin
matrix[0][1] <= is_released;
if (shift_pressed)
matrix[7][3] <= is_released; // *
else if (alt_pressed)
matrix[5][3] <= is_released; // ]
else
matrix[6][2] <= is_released; // +
end
`KEY_LLAVA:
begin
matrix[0][1] <= is_released;
if (alt_pressed || shift_pressed)
matrix[1][3] <= is_released; // {
else
matrix[0][3] <= is_released; // pound
end
`KEY_LLAVC:
begin
matrix[0][1] <= is_released;
if (alt_pressed || shift_pressed)
matrix[1][4] <= is_released; // }
else
matrix[5][2] <= is_released; // copyright
end
`KEY_COMA:
begin
matrix[0][1] <= is_released;
if (!shift_pressed)
matrix[7][2] <= is_released;
else
matrix[5][1] <= is_released; // ;
end
`KEY_PUNTO:
begin
matrix[0][1] <= is_released;
if (!shift_pressed)
matrix[7][1] <= is_released;
else
matrix[0][2] <= is_released; // :
end
`KEY_MENOS:
begin
matrix[0][1] <= is_released;
if (!shift_pressed)
matrix[6][3] <= is_released; //
else
matrix[4][0] <= is_released; // _
end
`KEY_LT:
begin
matrix[0][1] <= is_released;
if (!shift_pressed)
matrix[2][3] <= is_released; // <
else
matrix[2][4] <= is_released; // >
end
`KEY_BL:
begin
matrix[0][1] <= is_released;
matrix[1][2] <= is_released; // \
end
`KEY_SPACE:
matrix[7][0] <= is_released;
// Cursor keys
`KEY_UP:
begin
matrix[0][0] <= is_released;
matrix[4][4] <= is_released;
end
`KEY_DOWN:
begin
matrix[0][0] <= is_released;
matrix[4][3] <= is_released;
end
`KEY_LEFT:
begin
matrix[0][0] <= is_released;
matrix[3][4] <= is_released;
end
`KEY_RIGHT:
begin
matrix[0][0] <= is_released;
matrix[4][2] <= is_released;
end
endcase
end
end
endmodule

View File

@ -5,6 +5,7 @@
// http://code.google.com/p/mist-board/
//
// Copyright (c) 2014 Till Harbaum <till@harbaum.org>
// Copyright (c) 2015-2017 Sorgelig
//
// This source file is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published
@ -61,13 +62,13 @@ module mist_io #(parameter STRLEN=0, parameter PS2DIV=100)
// SD config
input sd_conf,
input sd_sdhc,
output img_mounted, // signaling that new image has been mounted
output [1:0] img_mounted, // signaling that new image has been mounted
output reg [31:0] img_size, // size of image in bytes
// SD block level access
input [31:0] sd_lba,
input sd_rd,
input sd_wr,
input [1:0] sd_rd,
input [1:0] sd_wr,
output reg sd_ack,
output reg sd_ack_conf,
@ -83,25 +84,27 @@ module mist_io #(parameter STRLEN=0, parameter PS2DIV=100)
output ps2_mouse_clk,
output reg ps2_mouse_data,
// ps2 alternative interface.
// [8] - extended, [9] - pressed, [10] - toggles with every press/release
output reg [10:0] ps2_key = 0,
// [24] - toggles with every event
output reg [24:0] ps2_mouse = 0,
// ARM -> FPGA download
input ioctl_force_erase,
input ioctl_ce,
output reg ioctl_download = 0, // signal indicating an active download
output reg ioctl_erasing = 0, // signal indicating an active erase
output reg [7:0] ioctl_index, // menu index used to upload the file
output reg ioctl_wr = 0,
output reg [24:0] ioctl_addr,
output reg [7:0] ioctl_dout
output reg [7:0] ioctl_dout,
input ioctl_wait
);
reg [7:0] b_data;
reg [6:0] sbuf;
reg [7:0] cmd;
reg [2:0] bit_cnt; // counts bits 0-7 0-7 ...
reg [7:0] byte_cnt; // counts bytes
reg [7:0] but_sw;
reg [2:0] stick_idx;
reg mount_strobe = 0;
reg [1:0] mount_strobe = 0;
assign img_mounted = mount_strobe;
assign buttons = but_sw[1:0];
@ -109,160 +112,189 @@ assign switches = but_sw[3:2];
assign scandoubler_disable = but_sw[4];
assign ypbpr = but_sw[5];
wire [7:0] spi_dout = { sbuf, SPI_DI};
// this variant of user_io is for 8 bit cores (type == a4) only
wire [7:0] core_type = 8'ha4;
// command byte read by the io controller
wire [7:0] sd_cmd = { 4'h5, sd_conf, sd_sdhc, sd_wr, sd_rd };
wire drive_sel = sd_rd[1] | sd_wr[1];
wire [7:0] sd_cmd = { 4'h6, sd_conf, sd_sdhc, sd_wr[drive_sel], sd_rd[drive_sel] };
reg [7:0] cmd;
reg [2:0] bit_cnt; // counts bits 0-7 0-7 ...
reg [9:0] byte_cnt; // counts bytes
reg spi_do;
assign SPI_DO = CONF_DATA0 ? 1'bZ : spi_do;
// drive MISO only when transmitting core id
always@(negedge SPI_SCK) begin
if(!CONF_DATA0) begin
// first byte returned is always core type, further bytes are
// command dependent
if(byte_cnt == 0) begin
spi_do <= core_type[~bit_cnt];
reg [7:0] spi_data_out;
end else begin
case(cmd)
// reading config string
8'h14: begin
// returning a byte from string
if(byte_cnt < STRLEN + 1) spi_do <= conf_str[{STRLEN - byte_cnt,~bit_cnt}];
else spi_do <= 0;
end
// SPI transmitter
always@(negedge SPI_SCK) spi_do <= spi_data_out[~bit_cnt];
// reading sd card status
8'h16: begin
if(byte_cnt == 1) spi_do <= sd_cmd[~bit_cnt];
else if((byte_cnt >= 2) && (byte_cnt < 6)) spi_do <= sd_lba[{5-byte_cnt, ~bit_cnt}];
else spi_do <= 0;
end
// reading sd card write data
8'h18:
spi_do <= b_data[~bit_cnt];
default:
spi_do <= 0;
endcase
end
end
end
reg b_wr2,b_wr3;
always @(negedge clk_sys) begin
b_wr3 <= b_wr2;
sd_buff_wr <= b_wr3;
end
reg [7:0] spi_data_in;
reg spi_data_ready = 0;
// SPI receiver
always@(posedge SPI_SCK or posedge CONF_DATA0) begin
reg [6:0] sbuf;
reg [31:0] sd_lba_r;
reg drive_sel_r;
if(CONF_DATA0) begin
b_wr2 <= 0;
bit_cnt <= 0;
byte_cnt <= 0;
sd_ack <= 0;
sd_ack_conf <= 0;
end else begin
b_wr2 <= 0;
sbuf <= spi_dout[6:0];
spi_data_out <= core_type;
end
else
begin
bit_cnt <= bit_cnt + 1'd1;
if(bit_cnt == 5) begin
if (byte_cnt == 0) sd_buff_addr <= 0;
if((byte_cnt != 0) & (sd_buff_addr != 511)) sd_buff_addr <= sd_buff_addr + 1'b1;
if((byte_cnt == 1) & ((cmd == 8'h17) | (cmd == 8'h19))) sd_buff_addr <= 0;
end
sbuf <= {sbuf[5:0], SPI_DI};
// finished reading command byte
if(bit_cnt == 7) begin
if(!byte_cnt) cmd <= {sbuf, SPI_DI};
spi_data_in <= {sbuf, SPI_DI};
spi_data_ready <= ~spi_data_ready;
if(~&byte_cnt) byte_cnt <= byte_cnt + 8'd1;
if(byte_cnt == 0) begin
cmd <= spi_dout;
if(spi_dout == 8'h19) begin
sd_ack_conf <= 1;
sd_buff_addr <= 0;
end
if((spi_dout == 8'h17) || (spi_dout == 8'h18)) begin
sd_ack <= 1;
sd_buff_addr <= 0;
end
if(spi_dout == 8'h18) b_data <= sd_buff_din;
mount_strobe <= 0;
end else begin
case(cmd)
// buttons and switches
8'h01: but_sw <= spi_dout;
8'h02: joystick_0 <= spi_dout;
8'h03: joystick_1 <= spi_dout;
spi_data_out <= 0;
case({(!byte_cnt) ? {sbuf, SPI_DI} : cmd})
// reading config string
8'h14: if(byte_cnt < STRLEN) spi_data_out <= conf_str[(STRLEN - byte_cnt - 1)<<3 +:8];
// store incoming ps2 mouse bytes
8'h04: begin
ps2_mouse_fifo[ps2_mouse_wptr] <= spi_dout;
ps2_mouse_wptr <= ps2_mouse_wptr + 1'd1;
end
// reading sd card status
8'h16: if(byte_cnt == 0) begin
spi_data_out <= sd_cmd;
sd_lba_r <= sd_lba;
drive_sel_r <= drive_sel;
end else if (byte_cnt == 1) begin
spi_data_out <= drive_sel_r;
end else if(byte_cnt < 6) spi_data_out <= sd_lba_r[(5-byte_cnt)<<3 +:8];
// store incoming ps2 keyboard bytes
8'h05: begin
ps2_kbd_fifo[ps2_kbd_wptr] <= spi_dout;
ps2_kbd_wptr <= ps2_kbd_wptr + 1'd1;
end
8'h15: status[7:0] <= spi_dout;
// send SD config IO -> FPGA
// flag that download begins
// sd card knows data is config if sd_dout_strobe is asserted
// with sd_ack still being inactive (low)
8'h19,
// send sector IO -> FPGA
// flag that download begins
8'h17: begin
sd_buff_dout <= spi_dout;
b_wr2 <= 1;
end
// reading sd card write data
8'h18: spi_data_out <= sd_buff_din;
endcase
end
end
end
8'h18: b_data <= sd_buff_din;
reg [31:0] ps2_key_raw = 0;
wire pressed = (ps2_key_raw[15:8] != 8'hf0);
wire extended = (~pressed ? (ps2_key_raw[23:16] == 8'he0) : (ps2_key_raw[15:8] == 8'he0));
// joystick analog
8'h1a: begin
// first byte is joystick index
if(byte_cnt == 1) stick_idx <= spi_dout[2:0];
else if(byte_cnt == 2) begin
// second byte is x axis
if(stick_idx == 0) joystick_analog_0[15:8] <= spi_dout;
else if(stick_idx == 1) joystick_analog_1[15:8] <= spi_dout;
end else if(byte_cnt == 3) begin
// third byte is y axis
if(stick_idx == 0) joystick_analog_0[7:0] <= spi_dout;
else if(stick_idx == 1) joystick_analog_1[7:0] <= spi_dout;
end
end
// transfer to clk_sys domain
always@(posedge clk_sys) begin
reg old_ss1, old_ss2;
reg old_ready1, old_ready2;
reg [2:0] b_wr;
reg got_ps2 = 0;
// notify image selection
8'h1c: mount_strobe <= 1;
old_ss1 <= CONF_DATA0;
old_ss2 <= old_ss1;
old_ready1 <= spi_data_ready;
old_ready2 <= old_ready1;
sd_buff_wr <= b_wr[0];
if(b_wr[2] && (~&sd_buff_addr)) sd_buff_addr <= sd_buff_addr + 1'b1;
b_wr <= (b_wr<<1);
// send image info
8'h1d: if(byte_cnt<5) img_size[(byte_cnt-1)<<3 +:8] <= spi_dout;
// status, 32bit version
8'h1e: if(byte_cnt<5) status[(byte_cnt-1)<<3 +:8] <= spi_dout;
default: ;
endcase
if(old_ss2) begin
got_ps2 <= 0;
sd_ack <= 0;
sd_ack_conf <= 0;
sd_buff_addr <= 0;
if(got_ps2) begin
if(cmd == 4) ps2_mouse[24] <= ~ps2_mouse[24];
if(cmd == 5) begin
ps2_key <= {~ps2_key[10], pressed, extended, ps2_key_raw[7:0]};
if(ps2_key_raw == 'hE012E07C) ps2_key[9:0] <= 'h37C; // prnscr pressed
if(ps2_key_raw == 'h7CE0F012) ps2_key[9:0] <= 'h17C; // prnscr released
if(ps2_key_raw == 'hF014F077) ps2_key[9:0] <= 'h377; // pause pressed
end
end
end
else
if(old_ready2 ^ old_ready1) begin
if(cmd == 8'h18 && ~&sd_buff_addr) sd_buff_addr <= sd_buff_addr + 1'b1;
if(byte_cnt < 2) begin
if (cmd == 8'h19) sd_ack_conf <= 1;
if((cmd == 8'h17) || (cmd == 8'h18)) sd_ack <= 1;
mount_strobe <= 0;
if(cmd == 5) ps2_key_raw <= 0;
end else begin
case(cmd)
// buttons and switches
8'h01: but_sw <= spi_data_in;
8'h02: joystick_0 <= spi_data_in;
8'h03: joystick_1 <= spi_data_in;
// store incoming ps2 mouse bytes
8'h04: begin
got_ps2 <= 1;
case(byte_cnt)
2: ps2_mouse[7:0] <= spi_data_in;
3: ps2_mouse[15:8] <= spi_data_in;
4: ps2_mouse[23:16] <= spi_data_in;
endcase
ps2_mouse_fifo[ps2_mouse_wptr] <= spi_data_in;
ps2_mouse_wptr <= ps2_mouse_wptr + 1'd1;
end
// store incoming ps2 keyboard bytes
8'h05: begin
got_ps2 <= 1;
ps2_key_raw[31:0] <= {ps2_key_raw[23:0], spi_data_in};
ps2_kbd_fifo[ps2_kbd_wptr] <= spi_data_in;
ps2_kbd_wptr <= ps2_kbd_wptr + 1'd1;
end
8'h15: status[7:0] <= spi_data_in;
// send SD config IO -> FPGA
// flag that download begins
// sd card knows data is config if sd_dout_strobe is asserted
// with sd_ack still being inactive (low)
8'h19,
// send sector IO -> FPGA
// flag that download begins
8'h17: begin
sd_buff_dout <= spi_data_in;
b_wr <= 1;
end
// joystick analog
8'h1a: begin
// first byte is joystick index
if(byte_cnt == 2) stick_idx <= spi_data_in[2:0];
else if(byte_cnt == 3) begin
// second byte is x axis
if(stick_idx == 0) joystick_analog_0[15:8] <= spi_data_in;
else if(stick_idx == 1) joystick_analog_1[15:8] <= spi_data_in;
end else if(byte_cnt == 4) begin
// third byte is y axis
if(stick_idx == 0) joystick_analog_0[7:0] <= spi_data_in;
else if(stick_idx == 1) joystick_analog_1[7:0] <= spi_data_in;
end
end
// notify image selection
8'h1c: mount_strobe[spi_data_in[0]] <= 1;
// send image info
8'h1d: if(byte_cnt<6) img_size[(byte_cnt-2)<<3 +:8] <= spi_data_in;
// status, 32bit version
8'h1e: if(byte_cnt<6) status[(byte_cnt-2)<<3 +:8] <= spi_data_in;
default: ;
endcase
end
end
end
@ -417,6 +449,8 @@ localparam UIO_FILE_TX = 8'h53;
localparam UIO_FILE_TX_DAT = 8'h54;
localparam UIO_FILE_INDEX = 8'h55;
reg rdownload = 0;
// data_io has its own SPI interface to the io controller
always@(posedge SPI_SCK, posedge SPI_SS2) begin
reg [6:0] sbuf;
@ -426,15 +460,10 @@ always@(posedge SPI_SCK, posedge SPI_SS2) begin
if(SPI_SS2) cnt <= 0;
else begin
rclk <= 0;
// don't shift in last bit. It is evaluated directly
// when writing to ram
if(cnt != 15) sbuf <= { sbuf[5:0], SPI_DI};
// increase target address after write
if(rclk) addr <= addr + 1'd1;
// count 0-7 8-15 8-15 ...
if(cnt < 15) cnt <= cnt + 1'd1;
else cnt <= 8;
@ -446,18 +475,11 @@ always@(posedge SPI_SCK, posedge SPI_SS2) begin
if((cmd == UIO_FILE_TX) && (cnt == 15)) begin
// prepare
if(SPI_DI) begin
case(ioctl_index)
0: addr <= 'h080000; // BOOT ROM
'h01: addr <= 'h000100; // ROM file
'h41: addr <= 'h000100; // COM file
'h81: addr <= 'h000000; // C00 file
'hC1: addr <= 'h010000; // EDD file
default: addr <= 'h100000; // FDD file
endcase
ioctl_download <= 1;
addr <= 25'h080000;
rdownload <= 1;
end else begin
addr_w <= addr;
ioctl_download <= 0;
rdownload <= 0;
end
end
@ -465,7 +487,8 @@ always@(posedge SPI_SCK, posedge SPI_SS2) begin
if((cmd == UIO_FILE_TX_DAT) && (cnt == 15)) begin
addr_w <= addr;
data_w <= {sbuf, SPI_DI};
rclk <= 1;
addr <= addr + 1'd1;
rclk <= ~rclk;
end
// expose file (menu) index
@ -473,60 +496,24 @@ always@(posedge SPI_SCK, posedge SPI_SS2) begin
end
end
reg [24:0] erase_mask;
wire [24:0] next_erase = (ioctl_addr + 1'd1) & erase_mask;
// transfer to ioctl_clk domain.
// ioctl_index is set before ioctl_download, so it's stable already
always@(posedge clk_sys) begin
reg rclkD, rclkD2;
reg old_force = 0;
reg [5:0] erase_clk_div;
reg [24:0] end_addr;
reg erase_trigger = 0;
rclkD <= rclk;
rclkD2 <= rclkD;
ioctl_wr <= 0;
if(ioctl_ce& ~ioctl_wait) begin
ioctl_download <= rdownload;
if(rclkD & ~rclkD2) begin
ioctl_dout <= data_w;
ioctl_addr <= addr_w;
ioctl_wr <= 1;
end
rclkD <= rclk;
rclkD2 <= rclkD;
ioctl_wr <= 0;
if(ioctl_download) begin
old_force <= 0;
ioctl_erasing <= 0;
erase_trigger <= (ioctl_index == 1);
end else begin
old_force <= ioctl_force_erase;
// start erasing
if(erase_trigger) begin
erase_trigger <= 0;
erase_mask <= 'hFFFF;
end_addr <= 'h0100;
erase_clk_div <= 1;
ioctl_erasing <= 1;
end else if((ioctl_force_erase & ~old_force)) begin
erase_trigger <= 0;
ioctl_addr <= 'h1FFFFFF;
erase_mask <= 'h1FFFFFF;
end_addr <= 'h0050000;
erase_clk_div <= 1;
ioctl_erasing <= 1;
end else if(ioctl_erasing) begin
erase_clk_div <= erase_clk_div + 1'd1;
if(!erase_clk_div) begin
if(next_erase == end_addr) ioctl_erasing <= 0;
else begin
ioctl_addr <= next_erase;
ioctl_dout <= 0;
ioctl_wr <= 1;
end
end
if(rclkD != rclkD2) begin
ioctl_dout <= data_w;
ioctl_addr <= addr_w;
ioctl_wr <= 1;
end
end
end
endmodule
endmodule

View File

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

View File

@ -14,7 +14,7 @@
// ************************************************************
// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
//
// 13.1.0 Build 162 10/23/2013 SJ Web Edition
// 13.0.1 Build 232 06/12/2013 SP 1 SJ Full Version
// ************************************************************
@ -40,17 +40,11 @@ module pll (
areset,
inclk0,
c0,
c1,
c2,
c3,
locked);
input areset;
input inclk0;
output c0;
output c1;
output c2;
output c3;
output locked;
`ifndef ALTERA_RESERVED_QIS
// synopsys translate_off
@ -60,26 +54,20 @@ module pll (
// synopsys translate_on
`endif
wire [4:0] sub_wire0;
wire sub_wire3;
wire [0:0] sub_wire8 = 1'h0;
wire [2:2] sub_wire5 = sub_wire0[2:2];
wire [0:0] sub_wire4 = sub_wire0[0:0];
wire [3:3] sub_wire2 = sub_wire0[3:3];
wire [1:1] sub_wire1 = sub_wire0[1:1];
wire c1 = sub_wire1;
wire c3 = sub_wire2;
wire locked = sub_wire3;
wire c0 = sub_wire4;
wire c2 = sub_wire5;
wire sub_wire6 = inclk0;
wire [1:0] sub_wire7 = {sub_wire8, sub_wire6};
wire sub_wire0;
wire [4:0] sub_wire1;
wire [0:0] sub_wire5 = 1'h0;
wire locked = sub_wire0;
wire [0:0] sub_wire2 = sub_wire1[0:0];
wire c0 = sub_wire2;
wire sub_wire3 = inclk0;
wire [1:0] sub_wire4 = {sub_wire5, sub_wire3};
altpll altpll_component (
.areset (areset),
.inclk (sub_wire7),
.clk (sub_wire0),
.locked (sub_wire3),
.inclk (sub_wire4),
.locked (sub_wire0),
.clk (sub_wire1),
.activeclock (),
.clkbad (),
.clkena ({6{1'b1}}),
@ -119,18 +107,6 @@ module pll (
altpll_component.clk0_duty_cycle = 50,
altpll_component.clk0_multiply_by = 26,
altpll_component.clk0_phase_shift = "0",
altpll_component.clk1_divide_by = 54,
altpll_component.clk1_duty_cycle = 50,
altpll_component.clk1_multiply_by = 13,
altpll_component.clk1_phase_shift = "0",
altpll_component.clk2_divide_by = 108,
altpll_component.clk2_duty_cycle = 50,
altpll_component.clk2_multiply_by = 13,
altpll_component.clk2_phase_shift = "0",
altpll_component.clk3_divide_by = 27,
altpll_component.clk3_duty_cycle = 50,
altpll_component.clk3_multiply_by = 104,
altpll_component.clk3_phase_shift = "0",
altpll_component.compensate_clock = "CLK0",
altpll_component.inclk0_input_frequency = 37037,
altpll_component.intended_device_family = "Cyclone III",
@ -164,9 +140,9 @@ module pll (
altpll_component.port_scanread = "PORT_UNUSED",
altpll_component.port_scanwrite = "PORT_UNUSED",
altpll_component.port_clk0 = "PORT_USED",
altpll_component.port_clk1 = "PORT_USED",
altpll_component.port_clk2 = "PORT_USED",
altpll_component.port_clk3 = "PORT_USED",
altpll_component.port_clk1 = "PORT_UNUSED",
altpll_component.port_clk2 = "PORT_UNUSED",
altpll_component.port_clk3 = "PORT_UNUSED",
altpll_component.port_clk4 = "PORT_UNUSED",
altpll_component.port_clk5 = "PORT_UNUSED",
altpll_component.port_clkena0 = "PORT_UNUSED",
@ -205,17 +181,8 @@ endmodule
// 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 "54"
// Retrieval info: PRIVATE: DIV_FACTOR2 NUMERIC "108"
// Retrieval info: PRIVATE: DIV_FACTOR3 NUMERIC "27"
// Retrieval info: PRIVATE: DUTY_CYCLE0 STRING "50.00000000"
// Retrieval info: PRIVATE: DUTY_CYCLE1 STRING "50.00000000"
// Retrieval info: PRIVATE: DUTY_CYCLE2 STRING "50.00000000"
// Retrieval info: PRIVATE: DUTY_CYCLE3 STRING "50.00000000"
// Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE0 STRING "26.000000"
// Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE1 STRING "6.500000"
// Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE2 STRING "3.250000"
// Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE3 STRING "104.000000"
// 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"
@ -236,42 +203,18 @@ endmodule
// 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 "deg"
// Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT2 STRING "deg"
// Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT3 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: MIRROR_CLK2 STRING "0"
// Retrieval info: PRIVATE: MIRROR_CLK3 STRING "0"
// Retrieval info: PRIVATE: MULT_FACTOR0 NUMERIC "26"
// Retrieval info: PRIVATE: MULT_FACTOR1 NUMERIC "13"
// Retrieval info: PRIVATE: MULT_FACTOR2 NUMERIC "13"
// Retrieval info: PRIVATE: MULT_FACTOR3 NUMERIC "104"
// Retrieval info: PRIVATE: NORMAL_MODE_RADIO STRING "1"
// Retrieval info: PRIVATE: OUTPUT_FREQ0 STRING "26.00000000"
// Retrieval info: PRIVATE: OUTPUT_FREQ1 STRING "6.50000000"
// Retrieval info: PRIVATE: OUTPUT_FREQ2 STRING "3.25000000"
// Retrieval info: PRIVATE: OUTPUT_FREQ3 STRING "104.00000000"
// Retrieval info: PRIVATE: OUTPUT_FREQ_MODE0 STRING "0"
// Retrieval info: PRIVATE: OUTPUT_FREQ_MODE1 STRING "0"
// Retrieval info: PRIVATE: OUTPUT_FREQ_MODE2 STRING "0"
// Retrieval info: PRIVATE: OUTPUT_FREQ_MODE3 STRING "0"
// Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT0 STRING "MHz"
// Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT1 STRING "MHz"
// Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT2 STRING "MHz"
// Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT3 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_SHIFT2 STRING "0.00000000"
// Retrieval info: PRIVATE: PHASE_SHIFT3 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: PHASE_SHIFT_UNIT2 STRING "deg"
// Retrieval info: PRIVATE: PHASE_SHIFT_UNIT3 STRING "ps"
// Retrieval info: PRIVATE: PLL_ADVANCED_PARAM_CHECK STRING "0"
// Retrieval info: PRIVATE: PLL_ARESET_CHECK STRING "1"
// Retrieval info: PRIVATE: PLL_AUTOPLL_CHECK NUMERIC "1"
@ -294,20 +237,11 @@ endmodule
// 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: STICKY_CLK2 STRING "1"
// Retrieval info: PRIVATE: STICKY_CLK3 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_CLK2 STRING "1"
// Retrieval info: PRIVATE: USE_CLK3 STRING "1"
// Retrieval info: PRIVATE: USE_CLKENA0 STRING "0"
// Retrieval info: PRIVATE: USE_CLKENA1 STRING "0"
// Retrieval info: PRIVATE: USE_CLKENA2 STRING "0"
// Retrieval info: PRIVATE: USE_CLKENA3 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
@ -316,18 +250,6 @@ endmodule
// Retrieval info: CONSTANT: CLK0_DUTY_CYCLE NUMERIC "50"
// Retrieval info: CONSTANT: CLK0_MULTIPLY_BY NUMERIC "26"
// Retrieval info: CONSTANT: CLK0_PHASE_SHIFT STRING "0"
// Retrieval info: CONSTANT: CLK1_DIVIDE_BY NUMERIC "54"
// Retrieval info: CONSTANT: CLK1_DUTY_CYCLE NUMERIC "50"
// Retrieval info: CONSTANT: CLK1_MULTIPLY_BY NUMERIC "13"
// Retrieval info: CONSTANT: CLK1_PHASE_SHIFT STRING "0"
// Retrieval info: CONSTANT: CLK2_DIVIDE_BY NUMERIC "108"
// Retrieval info: CONSTANT: CLK2_DUTY_CYCLE NUMERIC "50"
// Retrieval info: CONSTANT: CLK2_MULTIPLY_BY NUMERIC "13"
// Retrieval info: CONSTANT: CLK2_PHASE_SHIFT STRING "0"
// Retrieval info: CONSTANT: CLK3_DIVIDE_BY NUMERIC "27"
// Retrieval info: CONSTANT: CLK3_DUTY_CYCLE NUMERIC "50"
// Retrieval info: CONSTANT: CLK3_MULTIPLY_BY NUMERIC "104"
// Retrieval info: CONSTANT: CLK3_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"
@ -360,9 +282,9 @@ endmodule
// 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_USED"
// Retrieval info: CONSTANT: PORT_clk3 STRING "PORT_USED"
// Retrieval info: CONSTANT: PORT_clk1 STRING "PORT_UNUSED"
// 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"
@ -380,18 +302,12 @@ endmodule
// Retrieval info: USED_PORT: @clk 0 0 5 0 OUTPUT_CLK_EXT VCC "@clk[4..0]"
// Retrieval info: USED_PORT: areset 0 0 0 0 INPUT GND "areset"
// 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: c2 0 0 0 0 OUTPUT_CLK_EXT VCC "c2"
// Retrieval info: USED_PORT: c3 0 0 0 0 OUTPUT_CLK_EXT VCC "c3"
// Retrieval info: USED_PORT: inclk0 0 0 0 0 INPUT_CLK_EXT GND "inclk0"
// Retrieval info: USED_PORT: locked 0 0 0 0 OUTPUT GND "locked"
// Retrieval info: CONNECT: @areset 0 0 0 0 areset 0 0 0 0
// 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: CONNECT: c2 0 0 0 0 @clk 0 0 1 2
// Retrieval info: CONNECT: c3 0 0 0 0 @clk 0 0 1 3
// Retrieval info: CONNECT: locked 0 0 0 0 @locked 0 0 0 0
// Retrieval info: GEN_FILE: TYPE_NORMAL pll.v TRUE
// Retrieval info: GEN_FILE: TYPE_NORMAL pll.ppf TRUE

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

@ -0,0 +1,75 @@
//============================================================================
// Jupiter Ace video
// Copyright (C) 2018 Sorgelig
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 of the License, or (at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//============================================================================
module video
(
input clk,
input ce_pix,
output [9:0] sram_addr,
input [7:0] sram_data,
output [9:0] cram_addr,
input [7:0] cram_data,
output video_out,
output reg hsync,
output reg vsync,
output reg hblank,
output reg vblank
);
assign sram_addr = {vcnt[7:3], hcnt[7:3]};
assign cram_addr = {sram_data[6:0], vcnt[2:0]};
assign video_out = pix[7] ^ inv;
reg [8:0] hcnt;
reg [8:0] vcnt;
reg [7:0] pix;
reg inv;
always @(posedge clk) begin
reg ven,hen;
if(ce_pix) begin
if (hcnt != 415) hcnt <= hcnt + 1'd1;
else begin
hcnt <= 0;
if (vcnt != 311) vcnt <= vcnt + 1'd1;
else vcnt <= 0;
end
if (hcnt == 308) hsync <= 0;
if (hcnt == 340) hsync <= 1;
if (hcnt == 000) hen = 1;
if (hcnt == 256) hen = 0;
if (vcnt == 248) vsync <= 0;
if (vcnt == 256) vsync <= 1;
if (vcnt == 000) ven = 1;
if (vcnt == 192) ven = 0;
hblank <= ~hen;
vblank <= ~ven;
pix <= {pix[6:0], 1'b0};
if (!hcnt[2:0] && ven && hen) pix <= cram_data;
if (!hcnt[2:0]) inv <= ven & hen & sram_data[7];
end
end
endmodule

View File

@ -0,0 +1,3 @@
Quartus_Version = Version 13.0.1 Build 232 06/12/2013 Service Pack 1 SJ Full Version
Version_Index = 302049280
Creation_Time = Mon Dec 31 01:30:50 2018

Some files were not shown because too many files have changed in this diff Show More