Line 1... |
Line 1... |
--
|
--
|
-- Z80 compatible microprocessor core
|
-- Z80 compatible microprocessor core
|
--
|
--
|
-- Version : 0238
|
-- Version : 0240
|
--
|
--
|
-- Copyright (c) 2001-2002 Daniel Wallner (jesus@opencores.org)
|
-- Copyright (c) 2001-2002 Daniel Wallner (jesus@opencores.org)
|
--
|
--
|
-- All rights reserved
|
-- All rights reserved
|
--
|
--
|
Line 50... |
Line 50... |
|
|
package T80_Pack is
|
package T80_Pack is
|
|
|
component T80
|
component T80
|
generic(
|
generic(
|
Mode : integer := 0 -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB
|
Mode : integer := 0; -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB
|
|
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(
|
port(
|
RESET_n : in std_logic;
|
RESET_n : in std_logic;
|
CLK_n : in std_logic;
|
CLK_n : in std_logic;
|
CEN : in std_logic;
|
CEN : in std_logic;
|
Line 73... |
Line 81... |
DInst : in std_logic_vector(7 downto 0);
|
DInst : in std_logic_vector(7 downto 0);
|
DI : in std_logic_vector(7 downto 0);
|
DI : in std_logic_vector(7 downto 0);
|
DO : out std_logic_vector(7 downto 0);
|
DO : out std_logic_vector(7 downto 0);
|
MC : out std_logic_vector(2 downto 0);
|
MC : out std_logic_vector(2 downto 0);
|
TS : out std_logic_vector(2 downto 0);
|
TS : out std_logic_vector(2 downto 0);
|
False_M1 : out std_logic;
|
|
IntCycle_n : out std_logic;
|
IntCycle_n : out std_logic;
|
IntE : out std_logic
|
IntE : out std_logic;
|
|
Stop : out std_logic
|
);
|
);
|
end component;
|
end component;
|
|
|
type AddressOutput is (aXY,aIOA,aSP,aBC,aDE,aZI,aNone);
|
type AddressOutput is (aXY,aIOA,aSP,aBC,aDE,aZI,aNone);
|
|
|
component T80_MCode
|
component T80_MCode
|
generic(
|
generic(
|
Mode : integer := 0
|
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(
|
port(
|
IR : in std_logic_vector(7 downto 0);
|
IR : in std_logic_vector(7 downto 0);
|
ISet : in std_logic_vector(1 downto 0);
|
ISet : in std_logic_vector(1 downto 0);
|
MCycle : in std_logic_vector(2 downto 0);
|
MCycle : in std_logic_vector(2 downto 0);
|
Line 145... |
Line 161... |
Write : out std_logic
|
Write : out std_logic
|
);
|
);
|
end component;
|
end component;
|
|
|
component T80_ALU
|
component T80_ALU
|
|
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(
|
port(
|
Arith16 : in std_logic;
|
Arith16 : in std_logic;
|
Z16 : in std_logic;
|
Z16 : in std_logic;
|
ALU_Op : in std_logic_vector(3 downto 0);
|
ALU_Op : in std_logic_vector(3 downto 0);
|
Rot_Op : in std_logic;
|
Rot_Op : in std_logic;
|