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

Subversion Repositories tg68kc

[/] [tg68kc/] [trunk/] [TG68K_Pack.vhd] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 tobiflex
------------------------------------------------------------------------------
2
------------------------------------------------------------------------------
3
--                                                                          --
4 8 tobiflex
-- Copyright (c) 2009-2019 Tobias Gubener                                   -- 
5
-- Patches by MikeJ, Till Harbaum, Rok Krajnk, ...                          --
6 2 tobiflex
-- Subdesign fAMpIGA by TobiFlex                                            --
7
--                                                                          --
8
-- This source file is free software: you can redistribute it and/or modify --
9
-- it under the terms of the GNU Lesser General Public License as published --
10
-- by the Free Software Foundation, either version 3 of the License, or     --
11
-- (at your option) any later version.                                      --
12
--                                                                          --
13
-- This source file is distributed in the hope that it will be useful,      --
14
-- but WITHOUT ANY WARRANTY; without even the implied warranty of           --
15
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            --
16
-- GNU General Public License for more details.                             --
17
--                                                                          --
18
-- You should have received a copy of the GNU General Public License        --
19
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.    --
20
--                                                                          --
21
------------------------------------------------------------------------------
22
------------------------------------------------------------------------------
23
library IEEE;
24
use IEEE.std_logic_1164.all;
25
 
26
package TG68K_Pack is
27
 
28
        type micro_states is (idle, nop, ld_nn, st_nn, ld_dAn1, ld_AnXn1, ld_AnXn2, st_dAn1, ld_AnXnbd1, ld_AnXnbd2, ld_AnXnbd3,
29
                                                  ld_229_1, ld_229_2, ld_229_3, ld_229_4, st_229_1, st_229_2, st_229_3, st_229_4,
30
                                                  st_AnXn1, st_AnXn2, bra1, bsr1, bsr2, nopnop, dbcc1, movem1, movem2, movem3,
31
                                                  andi, pack1, pack2, pack3, op_AxAy, cmpm, link1, link2, unlink1, unlink2, int1, int2, int3, int4, rte1, rte2, rte3,
32 11 tobiflex
                                                  rte4, rte5, rtd1, rtd2, trap00, trap0, trap1, trap2, trap3, cas1, cas2, cas21, cas22, cas23, cas24,
33
                                                  cas25, cas26, cas27, cas28, chk20, chk21, chk22, chk23, chk24,
34 2 tobiflex
                                                  trap4, trap5, trap6, movec1, movep1, movep2, movep3, movep4, movep5, rota1, bf1,
35
                                                  mul1, mul2, mul_end1,  mul_end2, div1, div2, div3, div4, div_end1, div_end2);
36
 
37 8 tobiflex
        constant opcMOVE                                : integer := 0; --
38
        constant opcMOVEQ                               : integer := 1; --
39
        constant opcMOVESR                      : integer := 2; --
40
        constant opcADD                         : integer := 3; --
41
        constant opcADDQ                                : integer := 4; --
42
        constant opcOR                                  : integer := 5; --
43
        constant opcAND                         : integer := 6; --
44
        constant opcEOR                         : integer := 7; --
45
        constant opcCMP                         : integer := 8; --
46
        constant opcROT                         : integer := 9; --
47
        constant opcCPMAW                               : integer := 10;
48
        constant opcEXT                         : integer := 11; --
49
        constant opcABCD                                : integer := 12; --
50
        constant opcSBCD                                : integer := 13; --
51
        constant opcBITS                                : integer := 14; --
52
        constant opcSWAP                                : integer := 15; --
53
        constant opcScc                         : integer := 16; --
54
        constant andiSR                         : integer := 17; --
55
        constant eoriSR                         : integer := 18; --
56
        constant oriSR                                  : integer := 19; --
57
        constant opcMULU                                : integer := 20; --
58
        constant opcDIVU                                : integer := 21; --
59
        constant dispouter                      : integer := 22; --
60
        constant rot_nop                                : integer := 23; --
61
        constant ld_rot_cnt                     : integer := 24; --
62
        constant writePC_add                    : integer := 25; --
63
        constant ea_data_OP1                    : integer := 26; --
64
        constant ea_data_OP2                    : integer := 27; --
65
        constant use_XZFlag                     : integer := 28; --
66
        constant get_bfoffset           : integer := 29; --
67
        constant save_memaddr           : integer := 30; --
68
        constant opcCHK                         : integer := 31; --
69
        constant movec_rd                               : integer := 32; --
70
        constant movec_wr                               : integer := 33; --
71
        constant Regwrena                               : integer := 34; --
72
        constant update_FC                      : integer := 35; --
73
        constant linksp                         : integer := 36; --
74
        constant movepl                         : integer := 37; --
75
        constant update_ld                      : integer := 38; --
76
        constant OP1addr                                : integer := 39; --
77
        constant write_reg                      : integer := 40; --
78
        constant changeMode                     : integer := 41; --
79
        constant ea_build                               : integer := 42; --
80
        constant trap_chk                               : integer := 43; --
81
        constant store_ea_data          : integer := 44; --
82
        constant addrlong                               : integer := 45; --
83
        constant postadd                                : integer := 46; --
84
        constant presub                         : integer := 47; --
85
        constant subidx                         : integer := 48; --
86
        constant no_Flags                               : integer := 49; --
87
        constant use_SP                         : integer := 50; --
88
        constant to_CCR                         : integer := 51; --
89
        constant to_SR                                  : integer := 52; --
90
        constant OP2out_one                     : integer := 53; --
91
        constant OP1out_zero                    : integer := 54; --
92
        constant mem_addsub                     : integer := 55; --
93
        constant addsub                         : integer := 56; --
94
        constant directPC                               : integer := 57; --
95
        constant direct_delta           : integer := 58; --
96
        constant directSR                               : integer := 59; --
97
        constant directCCR                      : integer := 60; --
98
        constant exg                                    : integer := 61; --
99
        constant get_ea_now                     : integer := 62; --
100
        constant ea_to_pc                               : integer := 63; --
101
        constant hold_dwr                               : integer := 64; --
102
        constant to_USP                         : integer := 65; --
103
        constant from_USP                               : integer := 66; --
104
        constant write_lowlong          : integer := 67; --
105
        constant write_reminder         : integer := 68; --
106
        constant movem_action           : integer := 69; --
107
        constant briefext                               : integer := 70; --
108
        constant get_2ndOPC                     : integer := 71; --
109
        constant mem_byte                               : integer := 72; --
110
        constant longaktion                     : integer := 73; --
111
        constant opcRESET                               : integer := 74; --
112
        constant opcBF                                  : integer := 75; --
113
        constant opcBFwb                                : integer := 76; --
114
        constant opcPACK                                : integer := 77; --
115
        constant opcUNPACK                      : integer := 78; --
116
        constant hold_ea_data           : integer := 79; --
117
        constant store_ea_packdata      : integer := 80; --
118
        constant exec_BS                                : integer := 81; --
119 9 tobiflex
        constant hold_OP2                               : integer := 82; --
120 11 tobiflex
        constant restore_ADDR           : integer := 83; --
121
        constant alu_exec                               : integer := 84; --
122
        constant alu_move                               : integer := 85; --
123
        constant alu_setFlags           : integer := 86; --
124
        constant opcCHK2                                : integer := 87; --
125
        constant opcEXTB                                : integer := 88; --
126 2 tobiflex
 
127 11 tobiflex
        constant lastOpcBit                     : integer := 88;
128 2 tobiflex
 
129
        component TG68K_ALU
130
        generic(
131 8 tobiflex
                MUL_Mode :integer;                      --0=>16Bit,             1=>32Bit,       2=>switchable with CPU(1),              3=>no MUL,  
132
                MUL_Hardware :integer;          --0=>no,                        1=>yes,  
133
                DIV_Mode :integer;                      --0=>16Bit,             1=>32Bit,       2=>switchable with CPU(1),              3=>no DIV,  
134
                BarrelShifter :integer          --0=>no,                        1=>yes,         2=>switchable with CPU(1)  
135 2 tobiflex
                );
136
        port(
137 8 tobiflex
                clk                                             : in std_logic;
138
                Reset                                           : in std_logic;
139 11 tobiflex
                CPU                                             : in std_logic_vector(1 downto 0):="00";  -- 00->68000  01->68010  11->68020(only some parts - yet)
140 8 tobiflex
                clkena_lw                               : in std_logic:='1';
141
                execOPC                                 : in bit;
142
                decodeOPC                               : in bit;
143
                exe_condition                   : in std_logic;
144
                exec_tas                                        : in std_logic;
145
                long_start                              : in bit;
146
                non_aligned                             : in  std_logic;
147
                movem_presub                    : in bit;
148
                set_stop                                        : in bit;
149
                Z_error                                 : in bit;
150
                rot_bits                                        : in std_logic_vector(1 downto 0);
151
                exec                                            : in bit_vector(lastOpcBit downto 0);
152
                OP1out                                  : in std_logic_vector(31 downto 0);
153
                OP2out                                  : in std_logic_vector(31 downto 0);
154
                reg_QA                                  : in std_logic_vector(31 downto 0);
155
                reg_QB                                  : in std_logic_vector(31 downto 0);
156
                opcode                                  : in std_logic_vector(15 downto 0);
157
--              datatype                                        : in std_logic_vector(1 downto 0);
158
                exe_opcode                              : in std_logic_vector(15 downto 0);
159
                exe_datatype                    : in std_logic_vector(1 downto 0);
160
                sndOPC                                  : in std_logic_vector(15 downto 0);
161
                last_data_read                  : in std_logic_vector(15 downto 0);
162
                data_read                               : in std_logic_vector(15 downto 0);
163
                FlagsSR                                 : in std_logic_vector(7 downto 0);
164
                micro_state                             : in micro_states;
165
                bf_ext_in                               : in std_logic_vector(7 downto 0);
166
                bf_ext_out                              : out std_logic_vector(7 downto 0);
167
                bf_shift                                        : in std_logic_vector(5 downto 0);
168
                bf_width                                        : in std_logic_vector(5 downto 0);
169
                bf_ffo_offset                   : in std_logic_vector(31 downto 0);
170
                bf_loffset                              : in std_logic_vector(4 downto 0);
171
 
172
                set_V_Flag                              : buffer bit;
173
                Flags                                           : buffer std_logic_vector(7 downto 0);
174
                c_out                                           : buffer std_logic_vector(2 downto 0);
175
                addsub_q                                        : buffer std_logic_vector(31 downto 0);
176
                ALUout                                  : out std_logic_vector(31 downto 0)
177 2 tobiflex
        );
178
        end component;
179
 
180
end;

powered by: WebSVN 2.1.0

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