srsLTE/lib/include/srslte/phy/phch/pdcch.h

183 lines
7.0 KiB
C
Raw Normal View History

2014-04-17 03:28:21 -07:00
/**
*
* \section COPYRIGHT
*
2015-11-13 04:22:33 -08:00
* Copyright 2013-2015 Software Radio Systems Limited
2014-04-17 03:28:21 -07:00
*
* \section LICENSE
*
* This file is part of the srsLTE library.
2014-04-17 03:28:21 -07:00
*
* srsLTE is free software: you can redistribute it and/or modify
2015-05-08 08:05:40 -07:00
* it under the terms of the GNU Affero General Public License as
2014-04-17 03:28:21 -07:00
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* srsLTE is distributed in the hope that it will be useful,
2014-04-17 03:28:21 -07:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2015-05-08 08:05:40 -07:00
* GNU Affero General Public License for more details.
2014-04-17 03:28:21 -07:00
*
2015-05-08 08:05:40 -07:00
* A copy of the GNU Affero General Public License can be found in
2014-04-17 03:28:21 -07:00
* the LICENSE file in the top-level directory of this distribution
* and at http://www.gnu.org/licenses/.
*
*/
/******************************************************************************
* File: pdcch.h
*
* Description: Physical downlink control channel.
*
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.8
*****************************************************************************/
2014-04-17 03:28:21 -07:00
#ifndef PDCCH_
#define PDCCH_
#include "srslte/config.h"
2017-05-18 00:48:24 -07:00
#include "srslte/phy/common/phy_common.h"
#include "srslte/phy/mimo/precoding.h"
#include "srslte/phy/mimo/layermap.h"
#include "srslte/phy/modem/mod.h"
#include "srslte/phy/modem/demod_soft.h"
#include "srslte/phy/scrambling/scrambling.h"
#include "srslte/phy/fec/rm_conv.h"
#include "srslte/phy/fec/convcoder.h"
#include "srslte/phy/fec/viterbi.h"
#include "srslte/phy/fec/crc.h"
#include "srslte/phy/phch/dci.h"
#include "srslte/phy/phch/regs.h"
2014-04-17 03:28:21 -07:00
2014-04-17 03:28:21 -07:00
typedef enum SRSLTE_API {
SEARCH_UE, SEARCH_COMMON
2015-03-18 11:14:24 -07:00
} srslte_pdcch_search_mode_t;
2014-04-17 03:28:21 -07:00
/* PDCCH object */
typedef struct SRSLTE_API {
2015-03-18 05:41:50 -07:00
srslte_cell_t cell;
uint32_t nof_regs;
uint32_t nof_cce;
uint32_t max_bits;
2017-02-17 00:34:55 -08:00
uint32_t nof_rx_antennas;
2015-03-18 11:14:24 -07:00
srslte_regs_t *regs;
2014-06-17 02:11:41 -07:00
/* buffers */
cf_t *ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
cf_t *symbols[SRSLTE_MAX_PORTS];
2015-03-18 11:14:24 -07:00
cf_t *x[SRSLTE_MAX_PORTS];
cf_t *d;
uint8_t *e;
2015-05-08 01:35:39 -07:00
float rm_f[3 * (SRSLTE_DCI_MAX_BITS + 16)];
2015-03-18 11:14:24 -07:00
float *llr;
2014-06-17 02:11:41 -07:00
/* tx & rx objects */
srslte_modem_table_t mod;
2015-03-18 11:14:24 -07:00
srslte_sequence_t seq[SRSLTE_NSUBFRAMES_X_FRAME];
2015-03-18 08:05:38 -07:00
srslte_viterbi_t decoder;
srslte_crc_t crc;
2015-03-18 11:14:24 -07:00
} srslte_pdcch_t;
2014-04-17 03:28:21 -07:00
SRSLTE_API int srslte_pdcch_init(srslte_pdcch_t *q,
uint32_t max_prb);
SRSLTE_API int srslte_pdcch_init_multi(srslte_pdcch_t *q,
uint32_t max_prb,
2017-02-17 00:34:55 -08:00
uint32_t nof_rx_antennas);
SRSLTE_API int srslte_pdcch_set_cell(srslte_pdcch_t *q,
srslte_regs_t *regs,
srslte_cell_t cell);
2015-03-18 11:14:24 -07:00
SRSLTE_API void srslte_pdcch_free(srslte_pdcch_t *q);
2014-04-17 03:28:21 -07:00
2016-11-09 01:47:28 -08:00
SRSLTE_API void srslte_pdcch_set_cfi(srslte_pdcch_t *q,
uint32_t cfi);
SRSLTE_API float srslte_pdcch_coderate(uint32_t nof_bits,
uint32_t l);
/* Encoding function */
2015-03-18 11:14:24 -07:00
SRSLTE_API int srslte_pdcch_encode(srslte_pdcch_t *q,
srslte_dci_msg_t *msg,
srslte_dci_location_t location,
uint16_t rnti,
cf_t *sf_symbols[SRSLTE_MAX_PORTS],
uint32_t nsubframe,
uint32_t cfi);
/* Decoding functions: Extract the LLRs and save them in the srslte_pdcch_t object */
SRSLTE_API int srslte_pdcch_extract_llr(srslte_pdcch_t *q,
cf_t *sf_symbols,
cf_t *ce[SRSLTE_MAX_PORTS],
float noise_estimate,
uint32_t nsubframe,
uint32_t cfi);
2017-02-17 00:34:55 -08:00
SRSLTE_API int srslte_pdcch_extract_llr_multi(srslte_pdcch_t *q,
cf_t *sf_symbols[SRSLTE_MAX_PORTS],
cf_t *ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS],
2017-02-17 00:34:55 -08:00
float noise_estimate,
uint32_t nsubframe,
uint32_t cfi);
2015-03-18 11:14:24 -07:00
/* Decoding functions: Try to decode a DCI message after calling srslte_pdcch_extract_llr */
SRSLTE_API int srslte_pdcch_decode_msg(srslte_pdcch_t *q,
srslte_dci_msg_t *msg,
srslte_dci_location_t *location,
srslte_dci_format_t format,
uint16_t *crc_rem);
2016-08-05 09:57:40 -07:00
SRSLTE_API int srslte_pdcch_dci_decode(srslte_pdcch_t *q,
float *e,
uint8_t *data,
uint32_t E,
uint32_t nof_bits,
uint16_t *crc);
SRSLTE_API int srslte_pdcch_dci_encode(srslte_pdcch_t *q,
uint8_t *data,
uint8_t *e,
uint32_t nof_bits,
uint32_t E,
uint16_t rnti);
SRSLTE_API void srslte_pdcch_dci_encode_conv(srslte_pdcch_t *q,
uint8_t *data,
uint32_t nof_bits,
uint8_t *coded_data,
uint16_t rnti);
/* Function for generation of UE-specific search space DCI locations */
2015-03-18 11:14:24 -07:00
SRSLTE_API uint32_t srslte_pdcch_ue_locations(srslte_pdcch_t *q,
srslte_dci_location_t *locations,
uint32_t max_locations,
uint32_t nsubframe,
uint32_t cfi,
uint16_t rnti);
2016-05-31 06:56:32 -07:00
SRSLTE_API uint32_t srslte_pdcch_ue_locations_ncce(uint32_t nof_cce,
srslte_dci_location_t *c,
uint32_t max_candidates,
uint32_t nsubframe, uint16_t rnti);
/* Function for generation of common search space DCI locations */
2015-03-18 11:14:24 -07:00
SRSLTE_API uint32_t srslte_pdcch_common_locations(srslte_pdcch_t *q,
srslte_dci_location_t *locations,
uint32_t max_locations,
uint32_t cfi);
2014-04-17 03:28:21 -07:00
2016-05-13 01:27:09 -07:00
SRSLTE_API uint32_t srslte_pdcch_common_locations_ncce(uint32_t nof_cce,
srslte_dci_location_t *c,
uint32_t max_candidates);
2016-05-31 06:56:32 -07:00
2014-04-17 03:28:21 -07:00
#endif