|
|
|
@@ -1725,9 +1725,11 @@ int get_nr_prach_info_from_index(uint8_t index,
|
|
|
|
|
subframe = slot >> mu;
|
|
|
|
|
s_map = table_6_3_3_2_2_prachConfig_Index[index][4];
|
|
|
|
|
if ( (s_map>>subframe)&0x01 ) {
|
|
|
|
|
*N_RA_slot = table_6_3_3_2_2_prachConfig_Index[index][6]; // Number of RACH slots within a subframe
|
|
|
|
|
if (mu == 1) {
|
|
|
|
|
if ( (table_6_3_3_2_2_prachConfig_Index[index][6] <= 1) && (slot%2 == 0) )
|
|
|
|
|
if ((*N_RA_slot <= 1) && (slot % 2 == 0)){
|
|
|
|
|
return 0; // no prach in even slots @ 30kHz for 1 prach per subframe
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for(int i = 0; i <= subframe ; i++) {
|
|
|
|
|
if ( (s_map >> i) & 0x01) {
|
|
|
|
@@ -1736,6 +1738,7 @@ int get_nr_prach_info_from_index(uint8_t index,
|
|
|
|
|
}
|
|
|
|
|
if (start_symbol != NULL && N_t_slot != NULL && N_dur != NULL && format != NULL){
|
|
|
|
|
*start_symbol = table_6_3_3_2_2_prachConfig_Index[index][5];
|
|
|
|
|
*config_period = x;
|
|
|
|
|
*N_t_slot = table_6_3_3_2_2_prachConfig_Index[index][7];
|
|
|
|
|
*N_dur = table_6_3_3_2_2_prachConfig_Index[index][8];
|
|
|
|
|
if (table_6_3_3_2_2_prachConfig_Index[index][1] != -1)
|
|
|
|
@@ -2325,11 +2328,6 @@ static inline uint8_t get_table_idx(uint8_t mcs_table, uint8_t dci_format, uint8
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* returns the total DMRS symbols in a slot*/
|
|
|
|
|
uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols, int startSymbol, int mappingtype){
|
|
|
|
|
return get_num_dmrs(fill_dmrs_mask(pdsch_Config,dmrs_TypeA_Position,NrOfSymbols, startSymbol, mappingtype));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Table 5.1.2.2.1-1 38.214
|
|
|
|
|
uint8_t getRBGSize(uint16_t bwp_size, long rbg_size_config) {
|
|
|
|
|
|
|
|
|
@@ -2396,7 +2394,14 @@ int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmr
|
|
|
|
|
uint8_t row, colomn;
|
|
|
|
|
int32_t l_prime;
|
|
|
|
|
|
|
|
|
|
LOG_D(NR_MAC, "PUSCH: NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d\n", duration_in_symbols, start_symbol, mapping_type, dmrs_typeA_position);
|
|
|
|
|
LOG_D(NR_MAC, "In %s: PUSCH NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d additional_pos:%d, pusch_maxLength:%d\n",
|
|
|
|
|
__FUNCTION__,
|
|
|
|
|
duration_in_symbols,
|
|
|
|
|
start_symbol,
|
|
|
|
|
mapping_type,
|
|
|
|
|
dmrs_typeA_position,
|
|
|
|
|
additional_pos,
|
|
|
|
|
pusch_maxLength);
|
|
|
|
|
|
|
|
|
|
// Section 6.4.1.1.3 in Spec 38.211
|
|
|
|
|
// For PDSCH Mapping TypeA, ld is duration between first OFDM of the slot and last OFDM symbol of the scheduled PUSCH resources
|
|
|
|
@@ -2495,6 +2500,61 @@ uint8_t get_K_ptrs(uint16_t nrb0, uint16_t nrb1, uint16_t N_RB) {
|
|
|
|
|
return 4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*******************************************************************
|
|
|
|
|
*
|
|
|
|
|
* NAME : get_nr_srs_offset
|
|
|
|
|
*
|
|
|
|
|
* PARAMETERS : periodicityAndOffset for SRS
|
|
|
|
|
*
|
|
|
|
|
* RETURN : the offset parameter for SRS
|
|
|
|
|
*
|
|
|
|
|
*********************************************************************/
|
|
|
|
|
|
|
|
|
|
uint16_t get_nr_srs_offset(NR_SRS_PeriodicityAndOffset_t periodicityAndOffset) {
|
|
|
|
|
|
|
|
|
|
switch(periodicityAndOffset.present) {
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl1:
|
|
|
|
|
return periodicityAndOffset.choice.sl1;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl2:
|
|
|
|
|
return periodicityAndOffset.choice.sl2;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl4:
|
|
|
|
|
return periodicityAndOffset.choice.sl4;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl5:
|
|
|
|
|
return periodicityAndOffset.choice.sl5;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl8:
|
|
|
|
|
return periodicityAndOffset.choice.sl8;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl10:
|
|
|
|
|
return periodicityAndOffset.choice.sl10;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl16:
|
|
|
|
|
return periodicityAndOffset.choice.sl16;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl20:
|
|
|
|
|
return periodicityAndOffset.choice.sl20;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl32:
|
|
|
|
|
return periodicityAndOffset.choice.sl32;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl40:
|
|
|
|
|
return periodicityAndOffset.choice.sl40;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl64:
|
|
|
|
|
return periodicityAndOffset.choice.sl64;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl80:
|
|
|
|
|
return periodicityAndOffset.choice.sl80;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl160:
|
|
|
|
|
return periodicityAndOffset.choice.sl160;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl320:
|
|
|
|
|
return periodicityAndOffset.choice.sl320;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl640:
|
|
|
|
|
return periodicityAndOffset.choice.sl640;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl1280:
|
|
|
|
|
return periodicityAndOffset.choice.sl1280;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_sl2560:
|
|
|
|
|
return periodicityAndOffset.choice.sl2560;
|
|
|
|
|
case NR_SRS_PeriodicityAndOffset_PR_NOTHING:
|
|
|
|
|
LOG_W(NR_MAC,"NR_SRS_PeriodicityAndOffset_PR_NOTHING\n");
|
|
|
|
|
return 0;
|
|
|
|
|
default:
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the transform precoding status according to 6.1.3 of 3GPP TS 38.214 version 16.3.0 Release 16:
|
|
|
|
|
// - "UE procedure for applying transform precoding on PUSCH"
|
|
|
|
|
uint8_t get_transformPrecoding(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
|
|
|
@@ -3050,9 +3110,9 @@ int is_nr_UL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, sl
|
|
|
|
|
else return(slot_in_period >= slots1+tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots ? 1 : 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols, int startSymbol, int mappingtype_fromDCI) {
|
|
|
|
|
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols, int startSymbol, int mappingtype_fromDCI, int length) {
|
|
|
|
|
|
|
|
|
|
int l0;int dmrs_AdditionalPosition = 0;int maxLength = 0;
|
|
|
|
|
int l0;int dmrs_AdditionalPosition = 0;
|
|
|
|
|
NR_DMRS_DownlinkConfig_t *dmrs_config = NULL;
|
|
|
|
|
|
|
|
|
|
LOG_D(MAC, "NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d\n", NrOfSymbols, startSymbol, mappingtype_fromDCI, dmrs_TypeA_Position);
|
|
|
|
@@ -3064,7 +3124,6 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
|
|
|
|
|
// in case of DCI FORMAT 1_0 or dedicated pdsch config not received additionposition = pos2, len1 should be used
|
|
|
|
|
// referred to section 5.1.6.2 in 38.214
|
|
|
|
|
dmrs_AdditionalPosition = 2;
|
|
|
|
|
maxLength = 1;
|
|
|
|
|
|
|
|
|
|
if (pdsch_Config != NULL) {
|
|
|
|
|
if (mappingtype_fromDCI == typeA) { // Type A
|
|
|
|
@@ -3079,8 +3138,7 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
|
|
|
|
|
|
|
|
|
|
AssertFatal(dmrs_config != NULL," DMRS configs not present in PDSCH DMRS Downlink config\n");
|
|
|
|
|
|
|
|
|
|
// default values of maxlength = len2, additionalposition is pos2
|
|
|
|
|
if (dmrs_config->maxLength != NULL) maxLength = 2;
|
|
|
|
|
// default values of additionalposition is pos2
|
|
|
|
|
if (dmrs_config->dmrs_AdditionalPosition != NULL) dmrs_AdditionalPosition = *dmrs_config->dmrs_AdditionalPosition;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -3095,11 +3153,6 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
|
|
|
|
|
// For TypeB, ld is the duration of the scheduled PDSCH resources
|
|
|
|
|
ld = (mappingtype_fromDCI == typeA) ? (NrOfSymbols + startSymbol) : NrOfSymbols;
|
|
|
|
|
|
|
|
|
|
// Section 7.4.1.1.2 in Spec 38.211
|
|
|
|
|
//For PDSCH Mapping typeB, if PDSCH duration ld <=4, only single symbol DMRS is supported
|
|
|
|
|
if (mappingtype_fromDCI == typeB && ld <= 4)
|
|
|
|
|
maxLength = 1;
|
|
|
|
|
|
|
|
|
|
AssertFatal(ld > 2 && ld < 15,"Illegal NrOfSymbols according to Table 5.1.2.1-1 Spec 38.214 %d\n",ld);
|
|
|
|
|
AssertFatal((NrOfSymbols + startSymbol) < 15,"Illegal S+L according to Table 5.1.2.1-1 Spec 38.214 S:%d L:%d\n",startSymbol, NrOfSymbols);
|
|
|
|
|
|
|
|
|
@@ -3116,7 +3169,8 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (maxLength == 1) {
|
|
|
|
|
// number of front loaded symbols
|
|
|
|
|
if (length == 1) {
|
|
|
|
|
row = ld - 2;
|
|
|
|
|
l_prime = table_7_4_1_1_2_3_pdsch_dmrs_positions_l[row][column];
|
|
|
|
|
l0 = 1 << l0;
|
|
|
|
@@ -3127,7 +3181,7 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
|
|
|
|
|
l0 = 1<<l0 | 1<<(l0+1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LOG_D(MAC, "l0:%d, ld:%d,row:%d, column:%d, addpos:%d, maxlen:%d\n", l0, ld, row, column, dmrs_AdditionalPosition, maxLength);
|
|
|
|
|
LOG_D(MAC, "l0:%d, ld:%d,row:%d, column:%d, addpos:%d, maxlen:%d\n", l0, ld, row, column, dmrs_AdditionalPosition, length);
|
|
|
|
|
AssertFatal(l_prime>=0,"ERROR in configuration.Check Time Domain allocation of this Grant. l_prime < 1. row:%d, column:%d\n", row, column);
|
|
|
|
|
|
|
|
|
|
l_prime = (mappingtype_fromDCI == typeA) ? (l_prime | l0) : (l_prime << startSymbol);
|
|
|
|
@@ -4095,4 +4149,3 @@ bool set_ul_ptrs_values(NR_PTRS_UplinkConfig_t *ul_ptrs_config,
|
|
|
|
|
}
|
|
|
|
|
return valid;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|