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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [rtl/] [misclib/] [types_misc.vhd] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 sergeykhbr
--!
2
--! Copyright 2018 Sergey Khabarov, sergeykhbr@gmail.com
3
--!
4
--! Licensed under the Apache License, Version 2.0 (the "License");
5
--! you may not use this file except in compliance with the License.
6
--! You may obtain a copy of the License at
7
--!
8
--!     http://www.apache.org/licenses/LICENSE-2.0
9
--! Unless required by applicable law or agreed to in writing, software
10
--! distributed under the License is distributed on an "AS IS" BASIS,
11
--! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
--! See the License for the specific language governing permissions and
13
--! limitations under the License.
14
--!
15
 
16
--! Standard library.
17
library ieee;
18
use ieee.std_logic_1164.all;
19
use ieee.numeric_std.all;
20
library commonlib;
21
use commonlib.types_common.all;
22
--! Technology definition library.
23
library techmap;
24
use techmap.gencomp.all;
25
--! CPU, System Bus and common peripheries library.
26
library ambalib;
27
use ambalib.types_amba4.all;
28
 
29
--! @brief   Declaration of components visible on SoC top level.
30
package types_misc is
31
 
32
--! @brief SOC global reset former.
33
--! @details This module produces output reset signal in a case if
34
--!          button 'Reset' was pushed or PLL isn't a 'lock' state.
35
--! param[in]  inSysReset Button generated signal
36
--! param[in]  inSysClk Clock from the PLL. Bus clock.
37
--! param[in]  inPllLock PLL status.
38
--! param[out] outReset Output reset signal with active 'High' (1 = reset).
39
component reset_global
40
port (
41
  inSysReset  : in std_ulogic;
42
  inSysClk    : in std_ulogic;
43
  inPllLock   : in std_ulogic;
44
  outReset    : out std_ulogic );
45
end component;
46
 
47
 
48
--! Boot ROM with AXI4 interface declaration.
49
component nasti_bootrom is
50
  generic (
51
    memtech  : integer := inferred;
52
    xaddr    : integer := 0;
53
    xmask    : integer := 16#fffff#;
54
    sim_hexfile : string
55
  );
56
  port (
57
    clk  : in std_logic;
58
    nrst : in std_logic;
59
    cfg  : out nasti_slave_config_type;
60
    i    : in  nasti_slave_in_type;
61
    o    : out nasti_slave_out_type
62
  );
63
end component;
64
 
65
--! AXI4 ROM with the default FW version declaration.
66
  component nasti_romimage is
67
  generic (
68
    memtech  : integer := inferred;
69
    xaddr    : integer := 0;
70
    xmask    : integer := 16#fffff#;
71
    sim_hexfile : string
72
  );
73
  port (
74
    clk  : in std_logic;
75
    nrst : in std_logic;
76
    cfg  : out nasti_slave_config_type;
77
    i    : in  nasti_slave_in_type;
78
    o    : out nasti_slave_out_type
79
  );
80
  end component;
81
 
82
--! Internal RAM with AXI4 interface declaration.
83
component nasti_sram is
84
  generic (
85
    memtech  : integer := inferred;
86
    xaddr    : integer := 0;
87
    xmask    : integer := 16#fffff#;
88
    abits    : integer := 17;
89
    init_file : string := "" -- only for 'inferred'
90
  );
91
  port (
92
    clk  : in std_logic;
93
    nrst : in std_logic;
94
    cfg  : out nasti_slave_config_type;
95
    i    : in  nasti_slave_in_type;
96
    o    : out nasti_slave_out_type
97
  );
98
end component;
99
 
100
 
101
--! @brief NASTI (AXI4) GPIO controller
102
component nasti_gpio is
103
  generic (
104
    xaddr    : integer := 0;
105
    xmask    : integer := 16#fffff#;
106
         xirq     : integer := 0
107
  );
108
  port (
109
    clk  : in std_logic;
110
    nrst : in std_logic;
111
    cfg  : out nasti_slave_config_type;
112
    i    : in  nasti_slave_in_type;
113
    o    : out nasti_slave_out_type;
114
    i_dip : in std_logic_vector(3 downto 0);
115
    o_led : out std_logic_vector(7 downto 0)
116
  );
117
end component;
118
 
119
type uart_in_type is record
120
  rd    : std_ulogic;
121
  cts   : std_ulogic;
122
end record;
123
 
124
type uart_out_type is record
125
  td    : std_ulogic;
126
  rts   : std_ulogic;
127
end record;
128
 
129
--! UART with the AXI4 interface declaration.
130
component nasti_uart is
131
  generic (
132
    xaddr   : integer := 0;
133
    xmask   : integer := 16#fffff#;
134
    xirq    : integer := 0;
135
    fifosz  : integer := 16
136
  );
137
  port (
138
    clk    : in  std_logic;
139
    nrst   : in  std_logic;
140
    cfg    : out  nasti_slave_config_type;
141
    i_uart : in  uart_in_type;
142
    o_uart : out uart_out_type;
143
    i_axi  : in  nasti_slave_in_type;
144
    o_axi  : out nasti_slave_out_type;
145
    o_irq  : out std_logic);
146
end component;
147
 
148
--! Test Access Point via UART (debug access)
149
component uart_tap is
150
  port (
151
    nrst     : in std_logic;
152
    clk      : in std_logic;
153
    i_uart   : in  uart_in_type;
154
    o_uart   : out uart_out_type;
155
    i_msti   : in nasti_master_in_type;
156
    o_msto   : out nasti_master_out_type;
157
    o_mstcfg : out nasti_master_config_type
158
  );
159
end component;
160
 
161
-- JTAG TAP
162
component tap_jtag is
163
  generic (
164
    ainst  : integer range 0 to 255 := 2;
165
    dinst  : integer range 0 to 255 := 3);
166
  port (
167
    nrst  : in std_logic;
168
    clk  : in std_logic;
169
    i_tck   : in std_logic;   -- in: Test Clock
170
    i_ntrst   : in std_logic;   -- in: 
171
    i_tms   : in std_logic;   -- in: Test Mode State
172
    i_tdi   : in std_logic;   -- in: Test Data Input
173
    o_tdo   : out std_logic;   -- out: Test Data Output
174
    o_jtag_vref : out std_logic;
175
    i_msti   : in nasti_master_in_type;
176
    o_msto   : out nasti_master_out_type;
177
    o_mstcfg : out nasti_master_config_type
178
    );
179
end component;
180
 
181
 
182
--! @brief   Interrupt controller with the AXI4 interface declaration.
183
--! @details To rise interrupt on certain CPU HostIO interface is used.
184
component nasti_irqctrl is
185
  generic (
186
    xaddr    : integer := 0;
187
    xmask    : integer := 16#fffff#
188
  );
189
  port
190
 (
191
    clk    : in std_logic;
192
    nrst   : in std_logic;
193
    i_irqs : in std_logic_vector(CFG_IRQ_TOTAL-1 downto 1);
194
    o_cfg  : out nasti_slave_config_type;
195
    i_axi  : in nasti_slave_in_type;
196
    o_axi  : out nasti_slave_out_type;
197
    o_irq_meip : out std_logic
198
  );
199
  end component;
200
 
201
  --! @brief   General Purpose Timers with the AXI interface.
202
  --! @details This module provides high precision counter and
203
  --!          generic number of GP timers.
204
  component nasti_gptimers is
205
  generic (
206
    xaddr   : integer := 0;
207
    xmask   : integer := 16#fffff#;
208
    xirq    : integer := 0;
209
    tmr_total  : integer := 2
210
  );
211
  port (
212
    clk    : in  std_logic;
213
    nrst   : in  std_logic;
214
    cfg    : out nasti_slave_config_type;
215
    i_axi  : in  nasti_slave_in_type;
216
    o_axi  : out nasti_slave_out_type;
217
    o_irq  : out std_logic
218
  );
219
  end component;
220
 
221
--! @brief   Plug-n-Play support module with AXI4 interface declaration.
222
--! @details Each device in a system hase to implements sideband signal
223
--!          structure 'nasti_slave_config_type' that allows FW to
224
--!          detect Hardware configuration in a run-time.
225
--! @todo Implements PnP signals for all Masters devices.
226
component nasti_pnp is
227
  generic (
228
    xaddr   : integer := 0;
229
    xmask   : integer := 16#fffff#;
230
    tech    : integer := 0;
231
    hw_id   : std_logic_vector(31 downto 0) := X"20170101"
232
  );
233
  port (
234
    sys_clk : in  std_logic;
235
    adc_clk : in  std_logic;
236
    nrst   : in  std_logic;
237
    mstcfg : in  nasti_master_cfg_vector;
238
    slvcfg : in  nasti_slave_cfg_vector;
239
    cfg    : out  nasti_slave_config_type;
240
    i      : in  nasti_slave_in_type;
241
    o      : out nasti_slave_out_type
242
  );
243
end component;
244
 
245
 
246
 
247
end; -- package declaration

powered by: WebSVN 2.1.0

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