mirror of https://github.com/pvnis/srsRAN_4G.git
Added DCI Format 0_0 unpacking and more NR-PUSCH procedures
parent
b150e45129
commit
77f0a53abd
@ -0,0 +1,29 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* @file ue_dl_nr.h
|
||||
*
|
||||
* Description: NR UE uplink physical layer procedures for data
|
||||
*
|
||||
* This module is a frontend to all the uplink data channel processing modules.
|
||||
*
|
||||
* Reference:
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_UE_UL_DATA_H
|
||||
#define SRSLTE_UE_UL_DATA_H
|
||||
|
||||
#include "srslte/phy/common/phy_common_nr.h"
|
||||
#include "srslte/phy/phch/phch_cfg_nr.h"
|
||||
|
||||
#endif // SRSLTE_UE_UL_DATA_H
|
@ -1,54 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* @file ue_dl_nr.h
|
||||
*
|
||||
* Description: NR UE uplink physical layer procedures for data
|
||||
*
|
||||
* This module is a frontend to all the uplink data channel processing modules.
|
||||
*
|
||||
* Reference:
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_UE_UL_DATA_H
|
||||
#define SRSLTE_UE_UL_DATA_H
|
||||
|
||||
#include "srslte/phy/common/phy_common_nr.h"
|
||||
#include "srslte/phy/phch/phch_cfg_nr.h"
|
||||
|
||||
/**
|
||||
* @brief Calculates the PUSCH time resource default A and stores it in the provided PUSCH NR grant.
|
||||
*
|
||||
* @remark Defined by TS 38.214 V15.10.0 Table 6.1.2.1.1-2: Default PUSCH time domain resource allocation A for normal
|
||||
* CP
|
||||
*
|
||||
* @param m Time domain resource assignment field value m of the DCI
|
||||
* @param[out] grant PUSCH grant
|
||||
* @return Returns SRSLTE_SUCCESS if the provided allocation is valid, otherwise it returns SRSLTE_ERROR code
|
||||
*/
|
||||
SRSLTE_API int srslte_ue_ul_nr_pdsch_time_resource_default_A(uint32_t m, srslte_sch_grant_nr_t* grant);
|
||||
|
||||
/**
|
||||
* @brief Calculates the number of PUSCH-DMRS CDM groups without data for DCI format 0_0
|
||||
*
|
||||
* @remark Defined by TS 38.214 V15.10.0 6.2.2 UE DM-RS transmission procedure
|
||||
*
|
||||
* @param cfg PUSCH NR configuration by upper layers
|
||||
* @param[out] grant Provides grant pointer to fill
|
||||
* @return Returns SRSLTE_SUCCESS if the provided data is valid, otherwise it returns SRSLTE_ERROR code
|
||||
*/
|
||||
SRSLTE_API int srslte_ue_ul_nr_nof_dmrs_cdm_groups_without_data_format_0_0(const srslte_sch_cfg_nr_t* cfg,
|
||||
srslte_sch_grant_nr_t* grant);
|
||||
|
||||
|
||||
#endif // SRSLTE_UE_UL_DATA_H
|
@ -0,0 +1,59 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_RA_HELPER_H
|
||||
#define SRSLTE_RA_HELPER_H
|
||||
|
||||
#include "srslte/phy/utils/debug.h"
|
||||
#include <stdint.h>
|
||||
|
||||
static inline void ra_helper_compute_s_and_l(uint32_t N, uint32_t v, uint32_t* S, uint32_t* L)
|
||||
{
|
||||
uint32_t low = v % N;
|
||||
uint32_t high = v / N;
|
||||
if (high + 1 + low <= N) {
|
||||
*S = low;
|
||||
*L = high + 1;
|
||||
} else {
|
||||
*S = N - 1 - low;
|
||||
*L = N - high + 1;
|
||||
}
|
||||
}
|
||||
|
||||
static int ra_helper_freq_type1(uint32_t N_bwp_size, uint32_t riv, srslte_sch_grant_nr_t* grant)
|
||||
{
|
||||
uint32_t start = 0;
|
||||
uint32_t len = 0;
|
||||
ra_helper_compute_s_and_l(N_bwp_size, riv, &start, &len);
|
||||
|
||||
if (start + len > N_bwp_size) {
|
||||
ERROR("RIV 0x%x for BWP size %d resulted in freq=%d:%d\n", riv, N_bwp_size, start, len);
|
||||
return SRSLTE_ERROR;
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < start; i++) {
|
||||
grant->prb_idx[i] = false;
|
||||
}
|
||||
|
||||
for (uint32_t i = start; i < start + len; i++) {
|
||||
grant->prb_idx[i] = true;
|
||||
}
|
||||
|
||||
for (uint32_t i = start + len; i < SRSLTE_MAX_PRB_NR; i++) {
|
||||
grant->prb_idx[i] = false;
|
||||
}
|
||||
grant->nof_prb = len;
|
||||
|
||||
return SRSLTE_SUCCESS;
|
||||
}
|
||||
|
||||
#endif // SRSLTE_RA_HELPER_H
|
@ -0,0 +1,13 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
#include "srslte/phy/ue/ue_ul_nr.h"
|
||||
#include "srslte/phy/utils/debug.h"
|
@ -1,84 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
#include "srslte/phy/ue/ue_ul_nr_data.h"
|
||||
#include "srslte/phy/utils/debug.h"
|
||||
|
||||
typedef struct {
|
||||
srslte_sch_mapping_type_t mapping;
|
||||
uint32_t K2;
|
||||
uint32_t S;
|
||||
uint32_t L;
|
||||
} ue_ul_time_resource_t;
|
||||
|
||||
static const ue_ul_time_resource_t ue_ul_default_A_lut[16] = {{srslte_sch_mapping_type_A, 0, 0, 14},
|
||||
{srslte_sch_mapping_type_A, 0, 0, 12},
|
||||
{srslte_sch_mapping_type_A, 0, 0, 10},
|
||||
{srslte_sch_mapping_type_B, 0, 2, 10},
|
||||
{srslte_sch_mapping_type_B, 0, 4, 10},
|
||||
{srslte_sch_mapping_type_B, 0, 4, 8},
|
||||
{srslte_sch_mapping_type_B, 0, 4, 6},
|
||||
{srslte_sch_mapping_type_A, 1, 0, 14},
|
||||
{srslte_sch_mapping_type_A, 1, 0, 12},
|
||||
{srslte_sch_mapping_type_A, 1, 0, 10},
|
||||
{srslte_sch_mapping_type_A, 2, 0, 14},
|
||||
{srslte_sch_mapping_type_A, 2, 0, 12},
|
||||
{srslte_sch_mapping_type_A, 2, 0, 10},
|
||||
{srslte_sch_mapping_type_B, 0, 8, 6},
|
||||
{srslte_sch_mapping_type_A, 3, 0, 14},
|
||||
{srslte_sch_mapping_type_A, 3, 0, 10}};
|
||||
|
||||
int srslte_ue_ul_nr_pdsch_time_resource_default_A(uint32_t m, srslte_sch_grant_nr_t* grant)
|
||||
{
|
||||
if (grant == NULL) {
|
||||
return SRSLTE_ERROR_INVALID_INPUTS;
|
||||
}
|
||||
|
||||
if (m >= 16) {
|
||||
ERROR("m (%d) is out-of-range\n", m);
|
||||
return SRSLTE_ERROR_INVALID_INPUTS;
|
||||
}
|
||||
|
||||
// Select mapping
|
||||
grant->mapping = ue_ul_default_A_lut[m].mapping;
|
||||
grant->k2 = ue_ul_default_A_lut[m].K2;
|
||||
grant->S = ue_ul_default_A_lut[m].S;
|
||||
grant->L = ue_ul_default_A_lut[m].L;
|
||||
|
||||
return SRSLTE_SUCCESS;
|
||||
}
|
||||
|
||||
int srslte_ue_ul_nr_nof_dmrs_cdm_groups_without_data_format_0_0(const srslte_sch_cfg_nr_t* cfg,
|
||||
srslte_sch_grant_nr_t* grant)
|
||||
{
|
||||
if (cfg == NULL || grant == NULL) {
|
||||
return SRSLTE_ERROR_INVALID_INPUTS;
|
||||
}
|
||||
|
||||
/* According to TS 38.214 V15.10.0 6.2.2 UE DM-RS transmission procedure:
|
||||
* For PUSCH scheduled by DCI format 0_0 or by activation DCI format 0_0 with CRC scrambled by CS-RNTI, the UE
|
||||
* shall assume the number of DM-RS CDM groups without data is 1 which corresponds to CDM group 0 for the case of
|
||||
* PUSCH with allocation duration of 2 or less OFDM symbols with transform precoding disabled, the UE shall assume
|
||||
* that the number of DM-RS CDM groups without data is 3 which corresponds to CDM group {0,1,2} for the case of PUSCH
|
||||
* scheduled by activation DCI format 0_0 and the dmrs-Type in cg-DMRS-Configuration equal to 'type2' and the PUSCH
|
||||
* allocation duration being more than 2 OFDM symbols, and the UE shall assume that the number of DM-RS CDM groups
|
||||
* without data is 2 which corresponds to CDM group {0,1} for all other cases.
|
||||
*/
|
||||
if (grant->L <= 2 && !cfg->enable_transform_precoder) {
|
||||
grant->nof_dmrs_cdm_groups_without_data = 1;
|
||||
// } else if (grant->L > 2 && cfg->dmrs_cg.type == srslte_dmrs_sch_type_2){
|
||||
// grant->nof_dmrs_cdm_groups_without_data = 3;
|
||||
} else {
|
||||
grant->nof_dmrs_cdm_groups_without_data = 2;
|
||||
}
|
||||
|
||||
return SRSLTE_SUCCESS;
|
||||
}
|
Loading…
Reference in New Issue