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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [rtl/] [gnsslib/] [types_gnss.vhd] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 sergeykhbr
-----------------------------------------------------------------------------
2
--! @file
3
--! @copyright Copyright 2015 GNSS Sensor Ltd. All right reserved.
4
--! @author    Sergey Khabarov - sergeykhbr@gmail.com
5
--! @brief     Components declaration of the types_gnss package..
6
-----------------------------------------------------------------------------
7
 
8
--! Standard library
9
library ieee;
10
use ieee.std_logic_1164.all;
11
use ieee.numeric_std.all;
12
 
13
--! Math and data type transforamtion library
14
library commonlib;
15
use commonlib.types_common.all;
16
 
17
--! Leon3 technologies definition library
18
library techmap;
19
use techmap.gencomp.all;  -- technology enumerator
20
 
21
--! AMBA AXI4 interconnect types
22
library ambalib;
23
use ambalib.types_amba4.all;
24
 
25
--! @brief Declaration of the GNSS modules visible outside of the package.
26
--! @details This package provides User's API and general configuration 
27
--!          of the library. User should directly include this package into
28
--!          developing System with appropriate configuration values.
29
--!          Configuraiton constants allow to enable/disable GNSS systems
30
--!          separetedly, change channels configuration and flexibly tune
31
--!          Fast Search Engines.
32
--!
33
--! This library provides several key features:
34
--!   <ul>
35
--!     <li>Control external RF-boards including loading synthezises</li>
36
--!     <li>DSP of the input quantized samples such as correlation with 
37
--!         reference signals</li>
38
--!     <li>Generate the raw measurements independenetly from the firmware</li>
39
--!     <li>Implement hardware symbol synchronization</li>
40
--!     <li>Hardware timescale counter for different systems</li>
41
--!     <li>Implementing multi-path mitigation algrothims</li>
42
--!     <li>Noise estimators</li>
43
--!     <li>Multi-systems Fast Engines component</li>
44
--!   </ul>
45
package types_gnss is
46
 
47
  --! Maximal input bus width per complex component
48
  constant ADC_BIT_WIDTH             : integer := 2;
49
 
50
  --! GPS FSE module enable/disable
51
  constant CFG_GNSSLIB_FSEGPS_ENABLE : boolean := true;
52
 
53
  --! @brief Recording time interval for the FSE samples in msec.
54
  --! @details Fast Search Engine processing is splitted on two phases:
55
  --!          recording samples, post-processing. Duration of the recording
56
  --!          phase defines memory requirements and maximal accumulation
57
  --!          interval. Each milliseconds requires 2 KB of the dual-port RAM.
58
  constant CFG_FSE_MSEC_MAX          : integer := 16;
59
 
60
  --! Instantiated number of the GPS L1-CA channels. 0 is the valid value.
61
  constant CFG_GNSS_GPS_L1CA_NUM     : integer := 8;--12;
62
  --! Instantiated number of the Glonass L1-CA channels. 0 is the valid value.
63
  constant CFG_GNSS_GLONASS_L1_NUM   : integer := 8;--12;
64
  --! Instantiated number of the SBAS L1-CA channels. 0 is the valid value.
65
  constant CFG_GNSS_SBAS_L1_NUM      : integer := 0;--2; 
66
  --! Instantiated number of the Galileo E1 channels. 0 is the valid value.
67
  constant CFG_GNSS_GALILEO_E1_NUM   : integer := 0;--6;
68
  --! @brief Total number of the instantiated channels
69
  --! @details This value computes as a sum of all channels and is limited
70
  --!          only by address bus width that connects System Bus and GNSS
71
  --!          Top level. 
72
  --! @todo    refine maximal possible number
73
  constant CFG_GNSS_CHANNELS_TOTAL   : integer := (CFG_GNSS_GPS_L1CA_NUM
74
                                                + CFG_GNSS_GLONASS_L1_NUM
75
                                                + CFG_GNSS_SBAS_L1_NUM
76
                                                + CFG_GNSS_GALILEO_E1_NUM);
77
  --! Total number of GNSS timers. Shouldn't be modified by user.
78
  constant CFG_GNSS_TIMERS_TOTAL     : integer := 1;
79
  --! Total number of GNSS noise estimators. Shouldn't be modified by user.
80
  constant CFG_GNSS_NOISE            : integer := 1;
81
  --! Total number of Misc. modules. Shouldn't be modified by user.
82
  constant CFG_GNSS_MISC             : integer := 1;
83
 
84
  --! Total number of GNSS modules connected to internal Core Simplified Bus
85
  --! (SCB)
86
  constant CFG_GNSS_MODULES_TOTAL    : integer := CFG_GNSS_CHANNELS_TOTAL
87
                                                + CFG_GNSS_TIMERS_TOTAL
88
                                                + CFG_GNSS_NOISE
89
                                                + CFG_GNSS_MISC;
90
  constant CFG_GNSS_DWORD_PER_MODULE : integer := 8;
91
  constant CFG_GNSS_ADDR_WIDTH       : integer := log2(CFG_GNSS_MODULES_TOTAL)+6;
92
 
93
  constant MODULE_ID_MISC            : integer := 0;
94
  constant MODULE_ID_GLB_TIMER       : integer := MODULE_ID_MISC+CFG_GNSS_MISC;
95
  constant MODULE_ID_NOISE           : integer := MODULE_ID_GLB_TIMER+CFG_GNSS_TIMERS_TOTAL;
96
  constant MODULE_ID_CHN             : integer := MODULE_ID_NOISE + CFG_GNSS_NOISE;
97
 
98
  constant GEN_SYSTEM_GPSCA          : integer := 0;
99
  constant GEN_SYSTEM_GLOCA          : integer := GEN_SYSTEM_GPSCA+1;
100
  constant GEN_SYSTEM_SBAS           : integer := GEN_SYSTEM_GLOCA+1;
101
  constant GEN_SYSTEM_GALE1          : integer := GEN_SYSTEM_SBAS+1;
102
  constant GEN_SYSTEM_TOTAL          : integer := GEN_SYSTEM_GALE1+1;
103
 
104
  type gnss_system_type is array (0 to GEN_SYSTEM_TOTAL) of integer;
105
  constant fse_section_num : gnss_system_type := (GEN_SYSTEM_GLOCA => 1, others => 4);
106
 
107
  constant CFG_GNSS_PRNROM_BUSWIDTH  : integer := 5+8;--256 words(pilot+data) x 32 prn
108
  -- Galileo E1-pilot overlay code:
109
  constant CODE_CS25_1  : std_logic_vector(24 downto 0) := "0011100000001010110110010";
110
  constant CODE_CS25_1I : std_logic_vector(24 downto 0) := "1100011111110101001001101";
111
 
112
 
113
  type sys_parameter is array (0 to GEN_SYSTEM_TOTAL-1) of integer;
114
 
115
  ------------------------------------------------------------------------------
116
  -- GNSS Engine, top level
117
  component gnssengine is
118
  generic
119
  (
120
    tech   : integer range 0 to NTECH := 0;
121
    xaddr  : integer := 0;
122
    xmask  : integer := 16#FFFFF#;
123
    xirq   : integer := 0
124
  );
125
  port
126
  (
127
    nrst         : in std_logic;
128
    clk_bus      : in std_logic;
129
    clk_adc      : in std_logic;
130
    o_cfg        : out nasti_slave_config_type;
131
    i_axi        : in  nasti_slave_in_type;
132
    o_axi        : out nasti_slave_out_type;
133
    i_gps_I      : in std_logic_vector(1 downto 0);
134
    i_gps_Q      : in std_logic_vector(1 downto 0);
135
    i_glo_I      : in std_logic_vector(1 downto 0);
136
    i_glo_Q      : in std_logic_vector(1 downto 0);
137
    o_ms_pulse   : out std_logic;
138
    o_pps        : out std_logic
139
  );
140
  end component;
141
 
142
 
143
  ------------------------------------------------------------------------------
144
  -- Fast Search Engine v.2 (GPS only, 32 channels)
145
  component TopFSE is
146
  generic
147
  (
148
    tech   : integer := 0;
149
    xaddr  : integer := 0;
150
    xmask  : integer := 16#FFFFF#;
151
    sys    : integer := GEN_SYSTEM_GPSCA
152
  );
153
  port (
154
    nrst         : in std_logic;
155
    clk_bus      : in std_logic;
156
    clk_adc      : in std_logic;
157
    o_cfg        : out nasti_slave_config_type;
158
    i_axi        : in  nasti_slave_in_type;
159
    o_axi        : out nasti_slave_out_type;
160
    i_I          : in std_logic_vector(1 downto 0);
161
    i_Q          : in std_logic_vector(1 downto 0);
162
    i_ms_pulse   : in std_logic;
163
    i_pps        : in std_logic;
164
    i_2ms_only   : in std_logic
165
  );
166
  end component;
167
 
168
  --! @brief     RF-front controller based on MAX2769 ICs.
169
  --! @details   This unit implements SPI interface with MAX2769 ICs
170
  --!            and interacts with the antenna control signals.
171
  component axi_rfctrl is
172
  generic (
173
    xaddr    : integer := 0;
174
    xmask    : integer := 16#fffff#
175
  );
176
  port (
177
    nrst    : in  std_logic;
178
    clk    : in  std_logic;
179
    o_cfg  : out nasti_slave_config_type;
180
    i_axi   : in  nasti_slave_in_type;
181
    o_axi   : out nasti_slave_out_type;
182
    i_gps_ld : in std_logic;
183
    i_glo_ld : in std_logic;
184
    --! @name  Synthezator's SPI interface signals:
185
    --! @brief Connects to MAX2769 IC.
186
    --! @{
187
    outSCLK  : out std_logic;
188
    outSDATA : out std_logic;
189
    outCSn   : out std_logic_vector(1 downto 0);
190
    --! @}
191
 
192
    --! @name  Antenna control signals:
193
    --! @brief RF front-end IO analog signals.
194
    --! @{
195
    inExtAntStat   : in std_logic;
196
    inExtAntDetect : in std_logic;
197
    outExtAntEna   : out std_logic;
198
    outIntAntContr   : out std_logic
199
    --! @}
200
  );
201
end component;
202
 
203
  component axi_recorder is generic (
204
    tech     : integer := 0;
205
    xaddr    : integer := 0;
206
    xmask    : integer := 16#ffff0#
207
  );
208
  port (
209
    nrst    : in  std_logic;
210
    clk_bus : in  std_logic;
211
    clk_adc : in  std_logic;
212
    o_cfg   : out nasti_slave_config_type;
213
    i_axi   : in  nasti_slave_in_type;
214
    o_axi   : out nasti_slave_out_type;
215
    i_gps_I : in std_logic_vector(1 downto 0);
216
    i_gps_Q : in std_logic_vector(1 downto 0)
217
  );
218
  end component;
219
 
220
 
221
  ------------------------------------------------------------------------------
222
  -- 3-axis STMicroelectronics Gyroscope SPI controller (4-wires mode)
223
 
224
  component gyrospi is
225
  generic (
226
    xaddr    : integer := 0;
227
    xmask    : integer := 16#fffff#
228
  );
229
  port (
230
    rst    : in  std_ulogic;
231
    clk    : in  std_ulogic;
232
    i_axi  : in  nasti_slave_in_type;
233
    o_axi  : out nasti_slave_out_type;
234
    inInt1 : in std_ulogic;
235
    inInt2 : in std_ulogic;
236
    inSDI  : in std_ulogic;
237
    outSPC : out std_ulogic;
238
    outSDO : out std_ulogic;
239
    outCSn : out std_ulogic
240
  );
241
  end component;
242
 
243
  ------------------------------------------------------------------------------
244
  -- 3-axis STMicroelectronics Accelerometer SPI controller (4-wires mode)
245
 
246
  component accelspi is
247
    generic (
248
      xaddr    : integer := 0;
249
      xmask    : integer := 16#fffff#
250
    );
251
    port (
252
      rst    : in  std_ulogic;
253
      clk    : in  std_ulogic;
254
      i_axi  : in  nasti_slave_in_type;
255
      o_axi  : out nasti_slave_out_type;
256
      inInt1 : in std_ulogic;
257
      inInt2 : in std_ulogic;
258
      inSDI  : in std_ulogic;
259
      outSPC : out std_ulogic;
260
      outSDO : out std_ulogic;
261
      outCSn : out std_ulogic
262
    );
263
  end component;
264
 
265
 
266
 
267
 
268
end;

powered by: WebSVN 2.1.0

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