Moved NR MAX MIMO layers to carrier

master
Xavier Arteaga 4 years ago committed by Andre Puschmann
parent df5e3414dc
commit eed9405e40

@ -13,15 +13,15 @@
#ifndef SRSLTE_DMRS_PDSCH_H
#define SRSLTE_DMRS_PDSCH_H
#ifdef __cplusplus
extern "C" {
#endif
#include "srslte/phy/common/phy_common_nr.h"
#include "srslte/phy/phch/pdsch_cfg_nr.h"
#include "srslte/srslte.h"
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define SRSLTE_DMRS_PDSCH_MAX_SYMBOLS 4
/**

@ -171,6 +171,10 @@ typedef struct SRSLTE_API {
uint32_t numerology;
uint32_t nof_prb;
uint32_t start;
uint32_t max_mimo_layers; ///< @brief DL: Indicates the maximum number of MIMO layers to be used for PDSCH in all BWPs
///< of this serving cell. (see TS 38.212 [17], clause 5.4.2.1). UL: Indicates the maximum
///< MIMO layer to be used for PUSCH in all BWPs of the normal UL of this serving cell (see
///< TS 38.212 [17], clause 5.4.2.1)
} srslte_carrier_nr_t;
/**

@ -37,8 +37,7 @@ typedef struct SRSLTE_API {
SRSLTE_API int
srslte_enb_dl_nr_init(srslte_enb_dl_nr_t* q, cf_t* output[SRSLTE_MAX_PORTS], const srslte_enb_dl_nr_args_t* args);
SRSLTE_API int
srslte_enb_dl_nr_set_carrier(srslte_enb_dl_nr_t* q, const srslte_carrier_nr_t* carrier, const srslte_sch_cfg_t* common);
SRSLTE_API int srslte_enb_dl_nr_set_carrier(srslte_enb_dl_nr_t* q, const srslte_carrier_nr_t* carrier);
SRSLTE_API void srslte_enb_dl_nr_free(srslte_enb_dl_nr_t* q);

@ -67,8 +67,7 @@ SRSLTE_API int srslte_pdsch_nr_init_ue(srslte_pdsch_nr_t* q, const srslte_pdsch_
SRSLTE_API void srslte_pdsch_nr_free(srslte_pdsch_nr_t* q);
SRSLTE_API int
srslte_pdsch_nr_set_carrier(srslte_pdsch_nr_t* q, const srslte_carrier_nr_t* carrier, const srslte_sch_cfg_t* sch_cfg);
SRSLTE_API int srslte_pdsch_nr_set_carrier(srslte_pdsch_nr_t* q, const srslte_carrier_nr_t* carrier);
SRSLTE_API int srslte_pdsch_nr_encode(srslte_pdsch_nr_t* q,
const srslte_pdsch_cfg_nr_t* cfg,

@ -18,10 +18,7 @@
typedef struct SRSLTE_API {
srslte_mcs_table_t mcs_table; ///< @brief Indicates the MCS table the UE shall use for PDSCH and/or PUSCH without
///< transform precoding
uint32_t max_mimo_layers; ///< @brief DL: Indicates the maximum number of MIMO layers to be used for PDSCH in all BWPs
///< of this serving cell. (see TS 38.212 [17], clause 5.4.2.1). UL: Indicates the maximum
///< MIMO layer to be used for PUSCH in all BWPs of the normal UL of this serving cell (see
///< TS 38.212 [17], clause 5.4.2.1)
srslte_xoverhead_t xoverhead; ///< Accounts for overhead from CSI-RS, CORESET, etc. If the field is absent, the UE
///< applies value xOh0 (see TS 38.214 [19], clause 5.1.3.2).
} srslte_sch_cfg_t;

@ -17,6 +17,10 @@
#include "srslte/phy/dft/ofdm.h"
#include "srslte/phy/phch/pdsch_nr.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct SRSLTE_API {
srslte_pdsch_args_t pdsch;
uint32_t nof_rx_antennas;
@ -38,8 +42,7 @@ typedef struct SRSLTE_API {
SRSLTE_API int
srslte_ue_dl_nr_init(srslte_ue_dl_nr_t* q, cf_t* input[SRSLTE_MAX_PORTS], const srslte_ue_dl_nr_args_t* args);
SRSLTE_API int
srslte_ue_dl_nr_set_carrier(srslte_ue_dl_nr_t* q, const srslte_carrier_nr_t* carrier, const srslte_sch_cfg_t* common);
SRSLTE_API int srslte_ue_dl_nr_set_carrier(srslte_ue_dl_nr_t* q, const srslte_carrier_nr_t* carrier);
SRSLTE_API void srslte_ue_dl_nr_free(srslte_ue_dl_nr_t* q);
@ -50,5 +53,8 @@ SRSLTE_API int srslte_ue_dl_nr_pdsch_get(srslte_ue_dl_nr_t* q,
const srslte_pdsch_cfg_nr_t* cfg,
const srslte_pdsch_grant_nr_t* grant,
srslte_pdsch_res_nr_t* res);
#ifdef __cplusplus
}
#endif
#endif // SRSLTE_UE_DL_NR_H

@ -24,7 +24,8 @@ static srslte_carrier_nr_t carrier = {
0, // cell_id
0, // numerology
50, // nof_prb
0 // start
0, // start
1 // max_mimo_layers
};
typedef struct {

@ -94,9 +94,9 @@ void srslte_enb_dl_nr_free(srslte_enb_dl_nr_t* q)
memset(q, 0, sizeof(srslte_enb_dl_nr_t));
}
int srslte_enb_dl_nr_set_carrier(srslte_enb_dl_nr_t* q, const srslte_carrier_nr_t* carrier, const srslte_sch_cfg_t* sch)
int srslte_enb_dl_nr_set_carrier(srslte_enb_dl_nr_t* q, const srslte_carrier_nr_t* carrier)
{
if (srslte_pdsch_nr_set_carrier(&q->pdsch, carrier, sch) < SRSLTE_SUCCESS) {
if (srslte_pdsch_nr_set_carrier(&q->pdsch, carrier) < SRSLTE_SUCCESS) {
return SRSLTE_ERROR;
}

@ -72,16 +72,14 @@ int srslte_pdsch_nr_init_ue(srslte_pdsch_nr_t* q, const srslte_pdsch_args_t* arg
return SRSLTE_SUCCESS;
}
int srslte_pdsch_nr_set_carrier(srslte_pdsch_nr_t* q,
const srslte_carrier_nr_t* carrier,
const srslte_sch_cfg_t* sch_cfg)
int srslte_pdsch_nr_set_carrier(srslte_pdsch_nr_t* q, const srslte_carrier_nr_t* carrier)
{
// Set carrier
q->carrier = *carrier;
// Reallocate symbols if necessary
if (q->max_layers < sch_cfg->max_mimo_layers || q->max_prb < carrier->nof_prb) {
q->max_layers = sch_cfg->max_mimo_layers;
if (q->max_layers < carrier->max_mimo_layers || q->max_prb < carrier->nof_prb) {
q->max_layers = carrier->max_mimo_layers;
q->max_prb = carrier->nof_prb;
// Free current allocations

@ -112,7 +112,7 @@ int srslte_dlsch_nr_fill_cfg(srslte_sch_nr_t* q,
uint32_t N_re_lbrm = 156 * sch_nr_n_prb_lbrm(q->carrier.nof_prb);
double R_lbrm = 948.0 / 1024.0;
uint32_t Qm_lbrm = (sch_cfg->mcs_table == srslte_mcs_table_256qam) ? 8 : 6;
uint32_t TBS_LRBM = srslte_ra_nr_tbs(N_re_lbrm, 1.0, R_lbrm, Qm_lbrm, sch_cfg->max_mimo_layers);
uint32_t TBS_LRBM = srslte_ra_nr_tbs(N_re_lbrm, 1.0, R_lbrm, Qm_lbrm, q->carrier.max_mimo_layers);
cfg->Nref = ceil(TBS_LRBM / (cbsegm.C * 2.0 / 3.0));
// Calculate number of code blocks after applying CBGTI... not implemented, activate all CB

@ -22,7 +22,8 @@ static srslte_carrier_nr_t carrier = {
0, // cell_id
0, // numerology
SRSLTE_MAX_PRB_NR, // nof_prb
0 // start
0, // start
1 // max_mimo_layers
};
static uint32_t n_prb = 0; // Set to 0 for steering
@ -37,7 +38,7 @@ void usage(char* prog)
printf("\t-m MCS PRB, set to >28 for steering [Default %d]\n", mcs);
printf("\t-T Provide MCS table (64qam, 256qam, 64qamLowSE) [Default %s]\n",
srslte_mcs_table_to_str(pdsch_cfg.sch_cfg.mcs_table));
printf("\t-L Provide number of layers [Default %d]\n", pdsch_cfg.sch_cfg.max_mimo_layers);
printf("\t-L Provide number of layers [Default %d]\n", carrier.max_mimo_layers);
printf("\t-v [set srslte_verbose to debug, default none]\n");
}
@ -56,7 +57,7 @@ int parse_args(int argc, char** argv)
pdsch_cfg.sch_cfg.mcs_table = srslte_mcs_table_from_str(argv[optind]);
break;
case 'L':
pdsch_cfg.sch_cfg.max_mimo_layers = (uint32_t)strtol(argv[optind], NULL, 10);
carrier.max_mimo_layers = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;
@ -84,7 +85,6 @@ int main(int argc, char** argv)
// Set default PDSCH configuration
pdsch_cfg.sch_cfg.mcs_table = srslte_mcs_table_64qam;
pdsch_cfg.sch_cfg.max_mimo_layers = 1;
if (parse_args(argc, argv) < SRSLTE_SUCCESS) {
goto clean_exit;
@ -137,7 +137,7 @@ int main(int argc, char** argv)
ERROR("Error loading default grant\n");
goto clean_exit;
}
pdsch_grant.nof_layers = pdsch_cfg.sch_cfg.max_mimo_layers;
pdsch_grant.nof_layers = carrier.max_mimo_layers;
pdsch_grant.dci_format = srslte_dci_format_nr_1_0;
uint32_t n_prb_start = 1;

@ -22,7 +22,8 @@ static srslte_carrier_nr_t carrier = {
0, // cell_id
0, // numerology
SRSLTE_MAX_PRB_NR, // nof_prb
0 // start
0, // start
1 // max_mimo_layers
};
static uint32_t n_prb = 0; // Set to 0 for steering
@ -37,7 +38,7 @@ void usage(char* prog)
printf("\t-m MCS PRB, set to >28 for steering [Default %d]\n", mcs);
printf("\t-T Provide MCS table (64qam, 256qam, 64qamLowSE) [Default %s]\n",
srslte_mcs_table_to_str(pdsch_cfg.sch_cfg.mcs_table));
printf("\t-L Provide number of layers [Default %d]\n", pdsch_cfg.sch_cfg.max_mimo_layers);
printf("\t-L Provide number of layers [Default %d]\n", carrier.max_mimo_layers);
printf("\t-v [set srslte_verbose to debug, default none]\n");
}
@ -56,7 +57,7 @@ int parse_args(int argc, char** argv)
pdsch_cfg.sch_cfg.mcs_table = srslte_mcs_table_from_str(argv[optind]);
break;
case 'L':
pdsch_cfg.sch_cfg.max_mimo_layers = (uint32_t)strtol(argv[optind], NULL, 10);
carrier.max_mimo_layers = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;
@ -85,7 +86,7 @@ int main(int argc, char** argv)
// Set default PDSCH configuration
pdsch_cfg.sch_cfg.mcs_table = srslte_mcs_table_64qam;
pdsch_cfg.sch_cfg.max_mimo_layers = 1;
if (parse_args(argc, argv) < SRSLTE_SUCCESS) {
goto clean_exit;
}
@ -104,17 +105,17 @@ int main(int argc, char** argv)
goto clean_exit;
}
if (srslte_pdsch_nr_set_carrier(&pdsch_tx, &carrier, &pdsch_cfg.sch_cfg)) {
if (srslte_pdsch_nr_set_carrier(&pdsch_tx, &carrier)) {
ERROR("Error setting SCH NR carrier\n");
goto clean_exit;
}
if (srslte_pdsch_nr_set_carrier(&pdsch_rx, &carrier, &pdsch_cfg.sch_cfg)) {
if (srslte_pdsch_nr_set_carrier(&pdsch_rx, &carrier)) {
ERROR("Error setting SCH NR carrier\n");
goto clean_exit;
}
for (uint32_t i = 0; i < pdsch_cfg.sch_cfg.max_mimo_layers; i++) {
for (uint32_t i = 0; i < carrier.max_mimo_layers; i++) {
sf_symbols[i] = srslte_vec_cf_malloc(SRSLTE_SLOT_LEN_RE_NR(carrier.nof_prb));
if (sf_symbols[i] == NULL) {
ERROR("Error malloc\n");
@ -154,7 +155,7 @@ int main(int argc, char** argv)
ERROR("Error loading default grant\n");
goto clean_exit;
}
pdsch_grant.nof_layers = pdsch_cfg.sch_cfg.max_mimo_layers;
pdsch_grant.nof_layers = carrier.max_mimo_layers;
pdsch_grant.dci_format = srslte_dci_format_nr_1_0;
uint32_t n_prb_start = 1;

@ -100,9 +100,9 @@ void srslte_ue_dl_nr_free(srslte_ue_dl_nr_t* q)
memset(q, 0, sizeof(srslte_ue_dl_nr_t));
}
int srslte_ue_dl_nr_set_carrier(srslte_ue_dl_nr_t* q, const srslte_carrier_nr_t* carrier, const srslte_sch_cfg_t* sch)
int srslte_ue_dl_nr_set_carrier(srslte_ue_dl_nr_t* q, const srslte_carrier_nr_t* carrier)
{
if (srslte_pdsch_nr_set_carrier(&q->pdsch, carrier, sch) < SRSLTE_SUCCESS) {
if (srslte_pdsch_nr_set_carrier(&q->pdsch, carrier) < SRSLTE_SUCCESS) {
return SRSLTE_ERROR;
}

@ -23,7 +23,9 @@ static srslte_carrier_nr_t carrier = {
0, // cell_id
0, // numerology
100, // nof_prb
0 // start
0, // start
1 // max_mimo_layers
};
static uint32_t n_prb = 0; // Set to 0 for steering
@ -38,7 +40,7 @@ void usage(char* prog)
printf("\t-m MCS PRB, set to >28 for steering [Default %d]\n", mcs);
printf("\t-T Provide MCS table (64qam, 256qam, 64qamLowSE) [Default %s]\n",
srslte_mcs_table_to_str(pdsch_cfg.sch_cfg.mcs_table));
printf("\t-L Provide number of layers [Default %d]\n", pdsch_cfg.sch_cfg.max_mimo_layers);
printf("\t-L Provide number of layers [Default %d]\n", carrier.max_mimo_layers);
printf("\t-v [set srslte_verbose to debug, default none]\n");
}
@ -57,7 +59,7 @@ int parse_args(int argc, char** argv)
pdsch_cfg.sch_cfg.mcs_table = srslte_mcs_table_from_str(argv[optind]);
break;
case 'L':
pdsch_cfg.sch_cfg.max_mimo_layers = (uint32_t)strtol(argv[optind], NULL, 10);
carrier.max_mimo_layers = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;
@ -100,8 +102,8 @@ int main(int argc, char** argv)
enb_dl_args.pdsch.sch.disable_simd = true;
// Set default PDSCH configuration
pdsch_cfg.sch_cfg.mcs_table = srslte_mcs_table_64qam;
pdsch_cfg.sch_cfg.max_mimo_layers = 1;
pdsch_cfg.sch_cfg.mcs_table = srslte_mcs_table_64qam;
if (parse_args(argc, argv) < SRSLTE_SUCCESS) {
goto clean_exit;
}
@ -120,12 +122,12 @@ int main(int argc, char** argv)
goto clean_exit;
}
if (srslte_ue_dl_nr_set_carrier(&ue_dl, &carrier, &pdsch_cfg.sch_cfg)) {
if (srslte_ue_dl_nr_set_carrier(&ue_dl, &carrier)) {
ERROR("Error setting SCH NR carrier\n");
goto clean_exit;
}
if (srslte_enb_dl_nr_set_carrier(&enb_dl, &carrier, &pdsch_cfg.sch_cfg)) {
if (srslte_enb_dl_nr_set_carrier(&enb_dl, &carrier)) {
ERROR("Error setting SCH NR carrier\n");
goto clean_exit;
}
@ -162,7 +164,7 @@ int main(int argc, char** argv)
ERROR("Error loading default grant\n");
goto clean_exit;
}
pdsch_grant.nof_layers = pdsch_cfg.sch_cfg.max_mimo_layers;
pdsch_grant.nof_layers = carrier.max_mimo_layers;
pdsch_grant.dci_format = srslte_dci_format_nr_1_0;
uint32_t n_prb_start = 1;

@ -19,8 +19,8 @@
*
*/
#ifndef SRSLTE_WORKER_POOL_H
#define SRSLTE_WORKER_POOL_H
#ifndef SRSUE_LTE_WORKER_POOL_H
#define SRSUE_LTE_WORKER_POOL_H
#include "sf_worker.h"
#include "srslte/common/thread_pool.h"
@ -51,4 +51,4 @@ public:
} // namespace lte
} // namespace srsue
#endif // SRSLTE_WORKER_POOL_H
#endif // SRSUE_LTE_WORKER_POOL_H

Loading…
Cancel
Save