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

Subversion Repositories zx_ula

[/] [zx_ula/] [branches/] [xilinx/] [spectrum_48k_spartan3a_for_gameduino_mod_vga_timex_hicolor_ulaplus/] [T80_Pack.vhd] - Blame information for rev 29

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 29 mcleod_ide
-- ****
2
-- T80(b) core. In an effort to merge and maintain bug fixes ....
3
--
4
--
5
-- Ver 303 add undocumented DDCB and FDCB opcodes by TobiFlex 20.04.2010
6
-- Ver 300 started tidyup
7
-- MikeJ March 2005
8
-- Latest version from www.fpgaarcade.com (original www.opencores.org)
9
--
10
-- ****
11
--
12
-- Z80 compatible microprocessor core
13
--
14
-- Version : 0242
15
--
16
-- Copyright (c) 2001-2002 Daniel Wallner (jesus@opencores.org)
17
--
18
-- All rights reserved
19
--
20
-- Redistribution and use in source and synthezised forms, with or without
21
-- modification, are permitted provided that the following conditions are met:
22
--
23
-- Redistributions of source code must retain the above copyright notice,
24
-- this list of conditions and the following disclaimer.
25
--
26
-- Redistributions in synthesized form must reproduce the above copyright
27
-- notice, this list of conditions and the following disclaimer in the
28
-- documentation and/or other materials provided with the distribution.
29
--
30
-- Neither the name of the author nor the names of other contributors may
31
-- be used to endorse or promote products derived from this software without
32
-- specific prior written permission.
33
--
34
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
35
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
36
-- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
37
-- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
38
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
39
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
40
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
41
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
42
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
43
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
44
-- POSSIBILITY OF SUCH DAMAGE.
45
--
46
-- Please report bugs to the author, but before you do so, please
47
-- make sure that this is not a derivative work and that
48
-- you have the latest version of this file.
49
--
50
-- The latest version of this file can be found at:
51
--      http://www.opencores.org/cvsweb.shtml/t80/
52
--
53
-- Limitations :
54
--
55
-- File history :
56
--
57
 
58
library IEEE;
59
use IEEE.std_logic_1164.all;
60
 
61
package T80_Pack is
62
 
63
        component T80
64
        generic(
65
                Mode : integer := 0;    -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB
66
                IOWait : integer := 0;  -- 1 => Single cycle I/O, 1 => Std I/O cycle
67
                Flag_C : integer := 0;
68
                Flag_N : integer := 1;
69
                Flag_P : integer := 2;
70
                Flag_X : integer := 3;
71
                Flag_H : integer := 4;
72
                Flag_Y : integer := 5;
73
                Flag_Z : integer := 6;
74
                Flag_S : integer := 7
75
        );
76
        port(
77
                RESET_n         : in std_logic;
78
                CLK_n           : in std_logic;
79
                CEN                     : in std_logic;
80
                WAIT_n          : in std_logic;
81
                INT_n           : in std_logic;
82
                NMI_n           : in std_logic;
83
                BUSRQ_n         : in std_logic;
84
                M1_n            : out std_logic;
85
                IORQ            : out std_logic;
86
                NoRead          : out std_logic;
87
                Write           : out std_logic;
88
                RFSH_n          : out std_logic;
89
                HALT_n          : out std_logic;
90
                BUSAK_n         : out std_logic;
91
                A                       : out std_logic_vector(15 downto 0);
92
                DInst           : in std_logic_vector(7 downto 0);
93
                DI                      : in std_logic_vector(7 downto 0);
94
                DO                      : out std_logic_vector(7 downto 0);
95
                MC                      : out std_logic_vector(2 downto 0);
96
                TS                      : out std_logic_vector(2 downto 0);
97
                IntCycle_n      : out std_logic;
98
                IntE            : out std_logic;
99
                Stop            : out std_logic
100
        );
101
        end component;
102
 
103
        component T80_Reg
104
        port(
105
                Clk                     : in std_logic;
106
                CEN                     : in std_logic;
107
                WEH                     : in std_logic;
108
                WEL                     : in std_logic;
109
                AddrA           : in std_logic_vector(2 downto 0);
110
                AddrB           : in std_logic_vector(2 downto 0);
111
                AddrC           : in std_logic_vector(2 downto 0);
112
                DIH                     : in std_logic_vector(7 downto 0);
113
                DIL                     : in std_logic_vector(7 downto 0);
114
                DOAH            : out std_logic_vector(7 downto 0);
115
                DOAL            : out std_logic_vector(7 downto 0);
116
                DOBH            : out std_logic_vector(7 downto 0);
117
                DOBL            : out std_logic_vector(7 downto 0);
118
                DOCH            : out std_logic_vector(7 downto 0);
119
                DOCL            : out std_logic_vector(7 downto 0)
120
        );
121
        end component;
122
 
123
        component T80_MCode
124
        generic(
125
                Mode   : integer := 0;
126
                Flag_C : integer := 0;
127
                Flag_N : integer := 1;
128
                Flag_P : integer := 2;
129
                Flag_X : integer := 3;
130
                Flag_H : integer := 4;
131
                Flag_Y : integer := 5;
132
                Flag_Z : integer := 6;
133
                Flag_S : integer := 7
134
        );
135
        port(
136
                IR                      : in  std_logic_vector(7 downto 0);
137
                ISet                    : in  std_logic_vector(1 downto 0);
138
                MCycle                  : in  std_logic_vector(2 downto 0);
139
                F                       : in  std_logic_vector(7 downto 0);
140
                NMICycle                : in  std_logic;
141
                IntCycle                : in  std_logic;
142
                XY_State                : in  std_logic_vector(1 downto 0);
143
                MCycles                 : out std_logic_vector(2 downto 0);
144
                TStates                 : out std_logic_vector(2 downto 0);
145
                Prefix                  : out std_logic_vector(1 downto 0); -- None,BC,ED,DD/FD
146
                Inc_PC                  : out std_logic;
147
                Inc_WZ                  : out std_logic;
148
                IncDec_16               : out std_logic_vector(3 downto 0); -- BC,DE,HL,SP   0 is inc
149
                Read_To_Reg             : out std_logic;
150
                Read_To_Acc             : out std_logic;
151
                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
152
                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),0
153
                ALU_Op                  : out std_logic_vector(3 downto 0);
154
                        -- ADD, ADC, SUB, SBC, AND, XOR, OR, CP, ROT, BIT, SET, RES, DAA, RLD, RRD, None
155
                Save_ALU                : out std_logic;
156
                PreserveC               : out std_logic;
157
                Arith16                 : out std_logic;
158
                Set_Addr_To             : out std_logic_vector(2 downto 0); -- aNone,aXY,aIOA,aSP,aBC,aDE,aZI
159
                IORQ                    : out std_logic;
160
                Jump                    : out std_logic;
161
                JumpE                   : out std_logic;
162
                JumpXY                  : out std_logic;
163
                Call                    : out std_logic;
164
                RstP                    : out std_logic;
165
                LDZ                     : out std_logic;
166
                LDW                     : out std_logic;
167
                LDSPHL                  : out std_logic;
168
                Special_LD              : out std_logic_vector(2 downto 0); -- A,I;A,R;I,A;R,A;None
169
                ExchangeDH              : out std_logic;
170
                ExchangeRp              : out std_logic;
171
                ExchangeAF              : out std_logic;
172
                ExchangeRS              : out std_logic;
173
                I_DJNZ                  : out std_logic;
174
                I_CPL                   : out std_logic;
175
                I_CCF                   : out std_logic;
176
                I_SCF                   : out std_logic;
177
                I_RETN                  : out std_logic;
178
                I_BT                    : out std_logic;
179
                I_BC                    : out std_logic;
180
                I_BTR                   : out std_logic;
181
                I_RLD                   : out std_logic;
182
                I_RRD                   : out std_logic;
183
                I_INRC                  : out std_logic;
184
                SetDI                   : out std_logic;
185
                SetEI                   : out std_logic;
186
                IMode                   : out std_logic_vector(1 downto 0);
187
                Halt                    : out std_logic;
188
                NoRead                  : out std_logic;
189
                Write                   : out std_logic;
190
                XYbit_undoc             : out std_logic
191
        );
192
        end component;
193
 
194
        component T80_ALU
195
        generic(
196
                Mode   : integer := 0;
197
                Flag_C : integer := 0;
198
                Flag_N : integer := 1;
199
                Flag_P : integer := 2;
200
                Flag_X : integer := 3;
201
                Flag_H : integer := 4;
202
                Flag_Y : integer := 5;
203
                Flag_Z : integer := 6;
204
                Flag_S : integer := 7
205
        );
206
        port(
207
                Arith16         : in  std_logic;
208
                Z16             : in  std_logic;
209
                ALU_Op          : in  std_logic_vector(3 downto 0);
210
                IR              : in  std_logic_vector(5 downto 0);
211
                ISet            : in  std_logic_vector(1 downto 0);
212
                BusA            : in  std_logic_vector(7 downto 0);
213
                BusB            : in  std_logic_vector(7 downto 0);
214
                F_In            : in  std_logic_vector(7 downto 0);
215
                Q               : out std_logic_vector(7 downto 0);
216
                F_Out           : out std_logic_vector(7 downto 0)
217
        );
218
        end component;
219
 
220
end;

powered by: WebSVN 2.1.0

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