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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [processor/] [VHDL/] [common/] [scarts_pkg.vhd] - Blame information for rev 18

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

Line No. Rev Author Line
1 3 jlechner
-----------------------------------------------------------------------
2
-- This file is part of SCARTS.
3
-- 
4
-- SCARTS is free software: you can redistribute it and/or modify
5
-- it under the terms of the GNU General Public License as published by
6
-- the Free Software Foundation, either version 3 of the License, or
7
-- (at your option) any later version.
8
-- 
9
-- SCARTS is distributed in the hope that it will be useful,
10
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
-- GNU General Public License for more details.
13
-- 
14
-- You should have received a copy of the GNU General Public License
15
-- along with SCARTS.  If not, see <http://www.gnu.org/licenses/>.
16
-----------------------------------------------------------------------
17
 
18
 
19
library ieee;
20
use ieee.std_logic_1164.all;
21
 
22
use work.scarts_amba_pkg.all;
23
 
24
--library grlib;
25
--use grlib.amba.all;
26
 
27
package scarts_pkg is
28
 
29
  -- supported technologies
30
  constant NTECH : natural := 2;
31
  type tech_type is array (0 to NTECH) of natural;
32
 
33
  constant NO_TARGET  : natural := 0;
34
  constant XILINX     : natural := 1;
35
  constant ALTERA     : natural := 2;
36
 
37
  type scarts_conf_type is record
38
    --
39
    --  Specify the target technology
40
    --
41
    tech : natural range 0 to NTECH;
42
 
43
    --
44
    --  word_size == 1  =>  16 bit configuration
45
    --
46
    --  word_size == 2  =>  32 bit configuration
47
    --
48
    word_size : natural range 16 to 32;
49
 
50
    --
51
    --  Defines the size of the boot rom
52
    --  Size is 2**boot_rom_size instructions
53
    --
54
    boot_rom_size : natural range 0 to 16;
55
 
56
    --
57
    --  Defines the size of the instruction memory
58
    --  Size is 2**instr_ram_cfg instructions
59
    --  Range for 16 bit version is only 5 to 16
60
    --
61
    instr_ram_size : natural range 5 to 32;
62
 
63
    --
64
    --  Defines the size of the data memory
65
    --  Size is 2**data_ram_size bytes
66
    --  Range for 16 bit version is only 5 to 16
67
    --
68
    data_ram_size : natural range 5 to 32;
69
 
70
    --
71
    --  Defines if the instruction memory and 
72
    --  programmer are used
73
    --
74
    use_iram : boolean;
75
 
76
    --
77
    --  Defines if the AMBA modules should be loaded
78
    --
79
    use_amba : boolean;
80
 
81
    --
82
    -- Defines size of AMBA shared memory (2**amba_shm_size bytes)
83
    --
84
    amba_shm_size    : natural;
85
 
86
    --
87
    -- Defines word size for AMBA bus
88
    --
89
    amba_word_size   : natural;
90
 
91
    --
92
    --  Configures the SCARTS-Core, so that it can execute the GDB remote-stub.
93
    --  The Boot-ROM is always visible and mapped directly after the instruction-ram.
94
    --  Execution does not start at Instruction-Adress 0x0, but at the first Boot-ROM instruction.
95
    --
96
    gdb_mode : natural range 0 to 1;
97
 
98
    --
99
    --  Defines the address where the boot-rom is mapped to.
100
    --  Boot-Rom starts at 2**bootrom_base_address.
101
    --  Range for 16 bit version is only 5 to 15
102
    --
103
    bootrom_base_address : natural range 5 to 31;
104
 
105
  end record;
106
 
107
  type scarts_in_type is record
108
    hold        : std_ulogic;
109
    interruptin : std_logic_vector(7 downto 0);
110
    data        : std_logic_vector(31 downto 0);
111
  end record;
112
 
113
  type scarts_out_type is record
114
    reset     : std_ulogic;
115
    data      : std_logic_vector(31 downto 0);
116
    addr      : std_logic_vector(14 downto 0);
117
    byte_en   : std_logic_vector(3 downto 0);
118
    write_en  : std_ulogic;
119
    extsel    : std_ulogic;
120
    cpu_halt  : std_ulogic;
121
  end record;
122
 
123
  type debug_if_out_type is record
124
    D_TxD : std_ulogic;
125
  end record;
126
 
127
 
128
  type debug_if_in_type is record
129
    D_RxD : std_ulogic;
130
  end record;
131
 
132
  --
133
  -- Scarts component declaration
134
  --
135
 
136
  component scarts is
137
  generic (
138
    CONF : scarts_conf_type);
139
  port (
140
    clk       : in  std_ulogic;
141
    extrst    : in  std_ulogic;
142
    sysrst    : out std_ulogic;
143
    --Extensiom Module Interface                                                                                                                                                                               
144
    scarts_i    : in  scarts_in_type;
145
    scarts_o    : out scarts_out_type;
146
 
147
    -- AMBA Interface                                                                                                                                                                                          
148
    ahbmi     : in  ahb_master_in_type;
149
    ahbmo     : out ahb_master_out_type;
150
 
151
--    ahbsl2sp  : in  ahb_slv_out_vector_type(NAHBSLV-1 downto 1);
152
--    ahbsp2sl  : out ahb_slv_in_type;
153
--    apbsl2sp  : in  apb_slv_out_vector;
154
--    apbsp2sl  : out apb_slv_in_type;
155
    -- Debug Interface                                                                                                                                                                                         
156
    debugi_if : IN  debug_if_in_type;
157
    debugo_if : OUT debug_if_out_type);
158
  end component scarts;
159
 
160
 
161
  --
162
  -- Declarations for extension modules
163
  --
164
 
165
  type module_in_type is record
166
    reset     : std_ulogic;
167
    write_en  : std_ulogic;
168
    byte_en   : std_logic_vector(3 downto 0);
169
    data      : std_logic_vector(31 downto 0);
170
    addr      : std_logic_vector(14 downto 0);
171
  end record;
172
 
173
  type module_out_type is record
174
    data      : std_logic_vector(31 downto 0);
175
    intreq    : std_ulogic;
176
  end record;
177
 
178
  constant MODULE_OUT_VOID : module_out_type := ((others => '0'), '0');
179
 
180
  constant RST_ACT            : std_ulogic := '0';
181
  constant EXT_SEL            : std_ulogic := '1';
182
 
183
  constant STATUSREG      : integer := 0;
184
  constant CONFIGREG      : integer := 2;
185
 
186
  constant DATA0          : integer := 2;
187
  constant DATA1          : integer := 3;
188
  constant DATA2          : integer := 4;
189
  constant DATA3          : integer := 5;
190
  constant DATA4          : integer := 6;
191
  constant DATA5          : integer := 7;
192
 
193
  -- Status Register Flags
194
  constant STA_LOOR       : integer := 7;
195
  constant STA_RESH       : integer := 6;
196
  constant STA_RESL       : integer := 5;
197
  constant STA_FSS        : integer := 4;
198
  constant STA_BUSY       : integer := 3;
199
  constant STA_ERR        : integer := 2;
200
  constant STA_RDY        : integer := 1;
201
  constant STA_INT        : integer := 0;
202
 
203
  -- Control Register Flags
204
  constant CONF_LOOW     : integer := 7;
205
  constant CONF_RESH     : integer := 6;
206
  constant CONF_RESL     : integer := 5;
207
  constant CONF_EFSS     : integer := 4;
208
  constant CONF_OUTD     : integer := 3;
209
  constant CONF_SRES     : integer := 2;
210
  constant CONF_ID       : integer := 1;
211
  constant CONF_INTA     : integer := 0;
212
 
213
  constant MODULE_ID      : std_logic_vector(15 downto 0) := "0000000000000000";
214
  constant MODULE_VER     : std_logic_vector(15 downto 0) := "0000000000000000";
215
 
216
  constant CONF_PREXE         : integer := 7;
217
 
218
  constant CONF_INSTRSRC      : integer := 0;
219
  constant CONF_CLR           : integer := 1;
220
 
221
end scarts_pkg;

powered by: WebSVN 2.1.0

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