srsLTE/lib/include/srsran/phy/phch/regs.h

114 lines
3.7 KiB
C
Raw Normal View History

/**
2014-03-27 09:31:25 -07:00
*
* \section COPYRIGHT
2014-03-27 09:31:25 -07:00
*
2021-03-19 03:45:56 -07:00
* Copyright 2013-2021 Software Radio Systems Limited
2014-03-27 09:31:25 -07:00
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the distribution.
2014-03-27 09:31:25 -07:00
*
*/
/******************************************************************************
* File: regs.h
*
* Description: Resource element mapping functions.
*
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10
*****************************************************************************/
2014-03-27 09:31:25 -07:00
2021-03-19 03:45:56 -07:00
#ifndef SRSRAN_REGS_H
#define SRSRAN_REGS_H
2014-03-27 09:31:25 -07:00
2021-03-19 03:45:56 -07:00
#include "srsran/config.h"
#include "srsran/phy/common/phy_common.h"
#include <stdbool.h>
2014-03-27 09:31:25 -07:00
#define REGS_PHICH_NSYM 12
#define REGS_PHICH_REGS_X_GROUP 3
2014-03-27 09:31:25 -07:00
#define REGS_PCFICH_NSYM 16
#define REGS_PCFICH_NREGS 4
2014-03-27 09:31:25 -07:00
#define REGS_RE_X_REG 4
2014-03-27 09:31:25 -07:00
2021-03-19 03:45:56 -07:00
typedef struct SRSRAN_API {
uint32_t k[4];
uint32_t k0;
uint32_t l;
bool assigned;
2021-03-19 03:45:56 -07:00
} srsran_regs_reg_t;
2014-03-27 09:31:25 -07:00
2021-03-19 03:45:56 -07:00
typedef struct SRSRAN_API {
uint32_t nof_regs;
2021-03-19 03:45:56 -07:00
srsran_regs_reg_t** regs;
} srsran_regs_ch_t;
2014-03-27 09:31:25 -07:00
2021-03-19 03:45:56 -07:00
typedef struct SRSRAN_API {
srsran_cell_t cell;
uint32_t max_ctrl_symbols;
uint32_t ngroups_phich;
2019-05-02 10:31:46 -07:00
uint32_t ngroups_phich_m1;
2019-04-23 01:53:11 -07:00
2021-03-19 03:45:56 -07:00
srsran_phich_r_t phich_res;
srsran_phich_length_t phich_len;
2021-03-19 03:45:56 -07:00
srsran_regs_ch_t pcfich;
srsran_regs_ch_t* phich; // there are several phich
srsran_regs_ch_t pdcch[3]; /* PDCCH indexing, permutation and interleaving is computed for
the three possible CFI value */
2019-04-23 01:53:11 -07:00
uint32_t phich_mi;
uint32_t nof_regs;
2021-03-19 03:45:56 -07:00
srsran_regs_reg_t* regs;
} srsran_regs_t;
2014-03-27 09:31:25 -07:00
2021-03-19 03:45:56 -07:00
SRSRAN_API int srsran_regs_init(srsran_regs_t* h, srsran_cell_t cell);
2021-03-19 03:45:56 -07:00
SRSRAN_API int srsran_regs_init_opts(srsran_regs_t* h, srsran_cell_t cell, uint32_t phich_mi, bool mbsfn_or_sf1_6_tdd);
2021-03-19 03:45:56 -07:00
SRSRAN_API void srsran_regs_free(srsran_regs_t* h);
2021-03-19 03:45:56 -07:00
SRSRAN_API int srsran_regs_pdcch_nregs(srsran_regs_t* h, uint32_t cfi);
2021-03-19 03:45:56 -07:00
SRSRAN_API int srsran_regs_pdcch_ncce(srsran_regs_t* h, uint32_t cfi);
2021-03-19 03:45:56 -07:00
SRSRAN_API int srsran_regs_pcfich_put(srsran_regs_t* h, cf_t symbols[REGS_PCFICH_NSYM], cf_t* slot_symbols);
2021-03-19 03:45:56 -07:00
SRSRAN_API int srsran_regs_pcfich_get(srsran_regs_t* h, cf_t* slot_symbols, cf_t symbols[REGS_PCFICH_NSYM]);
2014-03-27 09:31:25 -07:00
2021-03-19 03:45:56 -07:00
SRSRAN_API uint32_t srsran_regs_phich_nregs(srsran_regs_t* h);
2019-04-23 01:53:11 -07:00
2021-03-19 03:45:56 -07:00
SRSRAN_API int
srsran_regs_phich_add(srsran_regs_t* h, cf_t symbols[REGS_PHICH_NSYM], uint32_t ngroup, cf_t* slot_symbols);
2014-03-27 09:31:25 -07:00
2021-03-19 03:45:56 -07:00
SRSRAN_API int
srsran_regs_phich_get(srsran_regs_t* h, cf_t* slot_symbols, cf_t symbols[REGS_PHICH_NSYM], uint32_t ngroup);
2014-03-27 09:31:25 -07:00
2021-03-19 03:45:56 -07:00
SRSRAN_API uint32_t srsran_regs_phich_ngroups(srsran_regs_t* h);
2019-05-02 10:31:46 -07:00
2021-03-19 03:45:56 -07:00
SRSRAN_API uint32_t srsran_regs_phich_ngroups_m1(srsran_regs_t* h);
2019-05-02 10:31:46 -07:00
2021-03-19 03:45:56 -07:00
SRSRAN_API int srsran_regs_phich_reset(srsran_regs_t* h, cf_t* slot_symbols);
2021-03-19 03:45:56 -07:00
SRSRAN_API int srsran_regs_pdcch_put(srsran_regs_t* h, uint32_t cfi, cf_t* d, cf_t* slot_symbols);
2021-03-19 03:45:56 -07:00
SRSRAN_API int srsran_regs_pdcch_put_offset(srsran_regs_t* h,
uint32_t cfi,
cf_t* d,
cf_t* slot_symbols,
uint32_t start_reg,
uint32_t nof_regs);
2021-03-19 03:45:56 -07:00
SRSRAN_API int srsran_regs_pdcch_get(srsran_regs_t* h, uint32_t cfi, cf_t* slot_symbols, cf_t* d);
2021-03-19 03:45:56 -07:00
SRSRAN_API int srsran_regs_pdcch_get_offset(srsran_regs_t* h,
uint32_t cfi,
cf_t* slot_symbols,
cf_t* d,
uint32_t start_reg,
uint32_t nof_regs);
2021-03-19 03:45:56 -07:00
#endif // SRSRAN_REGS_H