OpenCores
URL https://opencores.org/ocsvn/t80/t80/trunk

Subversion Repositories t80

[/] [t80/] [trunk/] [rtl/] [vhdl/] [T80_Pack.vhd] - Blame information for rev 25

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 jesus
--
2
-- Z80 compatible microprocessor core
3
--
4 25 jesus
-- Version : 0238
5 7 jesus
--
6 15 jesus
-- Copyright (c) 2001-2002 Daniel Wallner (jesus@opencores.org)
7 7 jesus
--
8
-- All rights reserved
9
--
10
-- Redistribution and use in source and synthezised forms, with or without
11
-- modification, are permitted provided that the following conditions are met:
12
--
13
-- Redistributions of source code must retain the above copyright notice,
14
-- this list of conditions and the following disclaimer.
15
--
16
-- Redistributions in synthesized form must reproduce the above copyright
17
-- notice, this list of conditions and the following disclaimer in the
18
-- documentation and/or other materials provided with the distribution.
19
--
20
-- Neither the name of the author nor the names of other contributors may
21
-- be used to endorse or promote products derived from this software without
22
-- specific prior written permission.
23
--
24
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
26
-- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27
-- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
28
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34
-- POSSIBILITY OF SUCH DAMAGE.
35
--
36
-- Please report bugs to the author, but before you do so, please
37
-- make sure that this is not a derivative work and that
38
-- you have the latest version of this file.
39
--
40
-- The latest version of this file can be found at:
41 15 jesus
--      http://www.opencores.org/cvsweb.shtml/t80/
42 7 jesus
--
43
-- Limitations :
44
--
45
-- File history :
46
--
47
 
48
library IEEE;
49
use IEEE.std_logic_1164.all;
50
 
51
package T80_Pack is
52
 
53
        component T80
54
        generic(
55
                Mode : integer := 0      -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB
56
        );
57
        port(
58
                RESET_n         : in std_logic;
59
                CLK_n           : in std_logic;
60 15 jesus
                CEN                     : in std_logic;
61 7 jesus
                WAIT_n          : in std_logic;
62
                INT_n           : in std_logic;
63
                NMI_n           : in std_logic;
64
                BUSRQ_n         : in std_logic;
65
                M1_n            : out std_logic;
66
                IORQ            : out std_logic;
67 25 jesus
                NoRead          : out std_logic;
68 7 jesus
                Write           : out std_logic;
69
                RFSH_n          : out std_logic;
70
                HALT_n          : out std_logic;
71
                BUSAK_n         : out std_logic;
72
                A                       : out std_logic_vector(15 downto 0);
73
                DInst           : in std_logic_vector(7 downto 0);
74
                DI                      : in std_logic_vector(7 downto 0);
75
                DO                      : out std_logic_vector(7 downto 0);
76
                MC                      : out std_logic_vector(2 downto 0);
77
                TS                      : out std_logic_vector(2 downto 0);
78
                False_M1        : out std_logic;
79 22 jesus
                IntCycle_n      : out std_logic;
80
                IntE            : out std_logic
81 7 jesus
        );
82
        end component;
83
 
84
        type AddressOutput is (aXY,aIOA,aSP,aBC,aDE,aZI,aNone);
85
 
86
        component T80_MCode
87
        generic(
88
                Mode : integer := 0
89
        );
90
        port(
91
                IR                              : in std_logic_vector(7 downto 0);
92
                ISet                    : in std_logic_vector(1 downto 0);
93
                MCycle                  : in std_logic_vector(2 downto 0);
94
                F                               : in std_logic_vector(7 downto 0);
95
                NMICycle                : in std_logic;
96
                IntCycle                : in std_logic;
97
                MCycles                 : out std_logic_vector(2 downto 0);
98
                TStates                 : out std_logic_vector(2 downto 0);
99
                Prefix                  : out std_logic_vector(1 downto 0); -- None,BC,ED,DD/FD
100
                Inc_PC                  : out std_logic;
101
                Inc_WZ                  : out std_logic;
102
                IncDec_16               : out std_logic_vector(3 downto 0); -- BC,DE,HL,SP   0 is inc
103
                Read_To_Reg             : out std_logic;
104
                Read_To_Acc             : out std_logic;
105
                Set_BusA_To     : out std_logic_vector(3 downto 0); -- B,C,D,E,H,L,DI/DB,A,SP(L),SP(M),0,F
106
                Set_BusB_To     : out std_logic_vector(3 downto 0); -- B,C,D,E,H,L,DI,A,SP(L),SP(M),1,F,PC(L),PC(M)
107
                ALU_Op                  : out std_logic_vector(3 downto 0);
108
                        -- (ir)ADD, (ir)ADC, (ir)SUB, (ir)SBC, (ir)AND, (ir)XOR, (ir)OR, (ir)CP, ADD, ADC, SUB, SBC, DAA, RLD, RRD, CP
109
                Rot_Op                  : out std_logic;
110
                Bit_Op                  : out std_logic_vector(1 downto 0); -- None, BIT, SET, RES
111
                Save_ALU                : out std_logic;
112
                PreserveC               : out std_logic;
113
                Arith16                 : out std_logic;
114
                Set_Addr_To             : out AddressOutput; -- aXY,aIOA,aSP,aBC,aDE,aZI,aNone
115
                IORQ                    : out std_logic;
116
                Jump                    : out std_logic;
117
                JumpE                   : out std_logic;
118
                JumpXY                  : out std_logic;
119
                Call                    : out std_logic;
120
                RstP                    : out std_logic;
121
                LDZ                             : out std_logic;
122
                LDW                             : out std_logic;
123
                LDSPHL                  : out std_logic;
124
                Special_LD              : out std_logic_vector(2 downto 0); -- A,I;A,R;I,A;R,A;None
125
                ExchangeDH              : out std_logic;
126
                ExchangeRp              : out std_logic;
127
                ExchangeAF              : out std_logic;
128
                ExchangeRS              : out std_logic;
129
                I_DJNZ                  : out std_logic;
130
                I_CPL                   : out std_logic;
131
                I_CCF                   : out std_logic;
132
                I_SCF                   : out std_logic;
133
                I_RETN                  : out std_logic;
134
                I_BT                    : out std_logic;
135
                I_BC                    : out std_logic;
136
                I_BTR                   : out std_logic;
137
                I_RLD                   : out std_logic;
138
                I_RRD                   : out std_logic;
139
                I_INRC                  : out std_logic;
140
                SetDI                   : out std_logic;
141
                SetEI                   : out std_logic;
142
                IMode                   : out std_logic_vector(1 downto 0);
143
                Halt                    : out std_logic;
144 25 jesus
                NoRead                  : out std_logic;
145 7 jesus
                Write                   : out std_logic
146
        );
147
        end component;
148
 
149
        component T80_ALU
150
        port(
151
                Arith16         : in std_logic;
152 25 jesus
                Z16                     : in std_logic;
153 7 jesus
                ALU_Op          : in std_logic_vector(3 downto 0);
154
                Rot_Op          : in std_logic;
155
                Bit_Op          : in std_logic_vector(1 downto 0);
156
                IR                      : in std_logic_vector(7 downto 0);
157
                ISet            : in std_logic_vector(1 downto 0);
158
                BusA            : in std_logic_vector(7 downto 0);
159
                BusB            : in std_logic_vector(7 downto 0);
160
                F_In            : in std_logic_vector(7 downto 0);
161
                Q                       : out std_logic_vector(7 downto 0);
162
                F_Out           : out std_logic_vector(7 downto 0);
163
                F_Save          : out std_logic_vector(7 downto 0)
164
        );
165
        end component;
166
 
167
end;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.