2014-04-17 03:28:21 -07:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* \section COPYRIGHT
|
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* Copyright 2013-2014 The srsLTE Developers. See the
|
2014-04-17 03:28:21 -07:00
|
|
|
* COPYRIGHT file at the top-level directory of this distribution.
|
|
|
|
*
|
|
|
|
* \section LICENSE
|
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* This file is part of the srsLTE library.
|
2014-04-17 03:28:21 -07:00
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* srsLTE is free software: you can redistribute it and/or modify
|
2014-04-17 03:28:21 -07:00
|
|
|
* it under the terms of the GNU Lesser General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* 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
|
|
|
|
* GNU Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* A copy of the GNU Lesser General Public License can be found in
|
|
|
|
* the LICENSE file in the top-level directory of this distribution
|
|
|
|
* and at http://www.gnu.org/licenses/.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PDCCH_
|
|
|
|
#define PDCCH_
|
|
|
|
|
2015-03-18 05:16:28 -07:00
|
|
|
#include "srslte/config.h"
|
2015-03-18 05:31:13 -07:00
|
|
|
#include "srslte/common/phy_common.h"
|
|
|
|
#include "srslte/mimo/precoding.h"
|
|
|
|
#include "srslte/mimo/layermap.h"
|
|
|
|
#include "srslte/modem/mod.h"
|
|
|
|
#include "srslte/modem/demod_soft.h"
|
|
|
|
#include "srslte/scrambling/scrambling.h"
|
|
|
|
#include "srslte/fec/rm_conv.h"
|
|
|
|
#include "srslte/fec/convcoder.h"
|
|
|
|
#include "srslte/fec/viterbi.h"
|
|
|
|
#include "srslte/fec/crc.h"
|
|
|
|
#include "srslte/phch/dci.h"
|
|
|
|
#include "srslte/phch/regs.h"
|
2014-04-17 03:28:21 -07:00
|
|
|
|
|
|
|
typedef _Complex float cf_t;
|
|
|
|
|
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
typedef enum SRSLTE_API {
|
2014-07-05 12:00:32 -07:00
|
|
|
SEARCH_UE, SEARCH_COMMON
|
2014-06-17 07:32:19 -07:00
|
|
|
} pdcch_search_mode_t;
|
2014-04-17 03:28:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
/* PDCCH object */
|
2015-03-18 05:31:13 -07:00
|
|
|
typedef struct SRSLTE_API {
|
2014-06-29 10:51:25 -07:00
|
|
|
lte_cell_t cell;
|
2014-07-01 01:48:51 -07:00
|
|
|
uint32_t nof_regs;
|
|
|
|
uint32_t nof_cce;
|
|
|
|
uint32_t max_bits;
|
2014-06-17 02:11:41 -07:00
|
|
|
|
|
|
|
regs_t *regs;
|
|
|
|
|
|
|
|
/* buffers */
|
2014-06-27 09:36:25 -07:00
|
|
|
cf_t *ce[MAX_PORTS];
|
|
|
|
cf_t *pdcch_symbols[MAX_PORTS];
|
|
|
|
cf_t *pdcch_x[MAX_PORTS];
|
2014-06-17 02:11:41 -07:00
|
|
|
cf_t *pdcch_d;
|
2014-10-17 11:44:01 -07:00
|
|
|
uint8_t *pdcch_e;
|
2014-12-01 13:15:32 -08:00
|
|
|
float pdcch_rm_f[3 * (DCI_MAX_BITS + 16)];
|
2014-06-17 02:11:41 -07:00
|
|
|
float *pdcch_llr;
|
|
|
|
|
|
|
|
/* tx & rx objects */
|
|
|
|
modem_table_t mod;
|
|
|
|
demod_soft_t demod;
|
|
|
|
sequence_t seq_pdcch[NSUBFRAMES_X_FRAME];
|
|
|
|
viterbi_t decoder;
|
|
|
|
crc_t crc;
|
2014-11-13 07:14:22 -08:00
|
|
|
precoding_t precoding;
|
|
|
|
|
2014-06-17 07:32:19 -07:00
|
|
|
} pdcch_t;
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API int pdcch_init(pdcch_t *q,
|
2014-06-29 10:51:25 -07:00
|
|
|
regs_t *regs,
|
|
|
|
lte_cell_t cell);
|
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API void pdcch_free(pdcch_t *q);
|
2014-04-17 03:28:21 -07:00
|
|
|
|
2014-06-27 09:36:25 -07:00
|
|
|
|
2014-07-05 12:00:32 -07:00
|
|
|
/* Encoding function */
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API int pdcch_encode(pdcch_t *q,
|
2014-07-05 12:00:32 -07:00
|
|
|
dci_msg_t *msg,
|
|
|
|
dci_location_t location,
|
2014-07-06 12:08:11 -07:00
|
|
|
uint16_t rnti,
|
|
|
|
cf_t *sf_symbols[MAX_PORTS],
|
|
|
|
uint32_t nsubframe,
|
|
|
|
uint32_t cfi);
|
2014-06-29 10:51:25 -07:00
|
|
|
|
2014-07-05 12:00:32 -07:00
|
|
|
/* Decoding functions: Extract the LLRs and save them in the pdcch_t object */
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API int pdcch_extract_llr(pdcch_t *q,
|
2014-07-05 12:00:32 -07:00
|
|
|
cf_t *sf_symbols,
|
2014-06-29 10:51:25 -07:00
|
|
|
cf_t *ce[MAX_PORTS],
|
2014-11-13 07:14:22 -08:00
|
|
|
float noise_estimate,
|
2014-07-05 12:00:32 -07:00
|
|
|
uint32_t nsubframe,
|
2014-07-01 01:48:51 -07:00
|
|
|
uint32_t cfi);
|
2014-06-29 10:51:25 -07:00
|
|
|
|
2014-07-05 12:00:32 -07:00
|
|
|
/* Decoding functions: Try to decode a DCI message after calling pdcch_extract_llr */
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API int pdcch_decode_msg(pdcch_t *q,
|
2014-07-05 12:00:32 -07:00
|
|
|
dci_msg_t *msg,
|
2014-11-16 11:40:41 -08:00
|
|
|
dci_location_t *location,
|
2014-07-05 12:00:32 -07:00
|
|
|
dci_format_t format,
|
2014-07-06 12:08:11 -07:00
|
|
|
uint16_t *crc_rem);
|
2014-07-05 12:00:32 -07:00
|
|
|
|
|
|
|
/* Function for generation of UE-specific search space DCI locations */
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API uint32_t pdcch_ue_locations(pdcch_t *q,
|
2014-07-05 12:00:32 -07:00
|
|
|
dci_location_t *locations,
|
|
|
|
uint32_t max_locations,
|
|
|
|
uint32_t nsubframe,
|
|
|
|
uint32_t cfi,
|
|
|
|
uint16_t rnti);
|
|
|
|
|
|
|
|
/* Function for generation of common search space DCI locations */
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API uint32_t pdcch_common_locations(pdcch_t *q,
|
2014-07-05 12:00:32 -07:00
|
|
|
dci_location_t *locations,
|
|
|
|
uint32_t max_locations,
|
|
|
|
uint32_t cfi);
|
2014-04-17 03:28:21 -07:00
|
|
|
|
|
|
|
#endif
|