Merge remote-tracking branch 'origin/nr-dmrs-fixes' into integration_2021_wk19
This commit is contained in:
@@ -1729,6 +1729,47 @@ uint8_t compute_nr_root_seq(NR_RACH_ConfigCommon_t *rach_config,
|
||||
}
|
||||
}
|
||||
|
||||
// TS 38.211 Table 7.4.1.1.2-3: PDSCH DMRS positions l' within a slot for single-symbol DMRS and intra-slot frequency hopping disabled.
|
||||
// The first 4 colomns are PDSCH mapping type A and the last 4 colomns are PDSCH mapping type B.
|
||||
// When l' = l0, it is represented by 1
|
||||
// E.g. when symbol duration is 12 in colomn 7, value 1057 ('10000100001') which means l' = l0, 5, 10.
|
||||
|
||||
int32_t table_7_4_1_1_2_3_pdsch_dmrs_positions_l [13][8] = { // Duration in symbols
|
||||
{-1, -1, -1, -1, 1, 1, 1, 1}, //2 // (DMRS l' position)
|
||||
{0, 0, 0, 0, 1, 1, 1, 1}, //3 // (DMRS l' position)
|
||||
{0, 0, 0, 0, 1, 1, 1, 1}, //4 // (DMRS l' position)
|
||||
{0, 0, 0, 0, 1, 17, 17, 17}, //5 // (DMRS l' position)
|
||||
{0, 0, 0, 0, 1, 17, 17, 17}, //6 // (DMRS l' position)
|
||||
{0, 0, 0, 0, 1, 17, 17, 17}, //7 // (DMRS l' position)
|
||||
{0, 128, 128, 128, 1, 65, 73, 73}, //8 // (DMRS l' position)
|
||||
{0, 128, 128, 128, 1, 129, 145, 145}, //9 // (DMRS l' position)
|
||||
{0, 512, 576, 576, 1, 129, 145, 145}, //10 // (DMRS l' position)
|
||||
{0, 512, 576, 576, 1, 257, 273, 585}, //11 // (DMRS l' position)
|
||||
{0, 512, 576, 2336, 1, 513, 545, 585}, //12 // (DMRS l' position)
|
||||
{0, 2048, 2176, 2336, 1, 513, 545, 585}, //13 // (DMRS l' position)
|
||||
{0, 2048, 2176, 2336, -1, -1, -1, -1}, //14 // (DMRS l' position)
|
||||
};
|
||||
|
||||
|
||||
// TS 38.211 Table 7.4.1.1.2-4: PDSCH DMRS positions l' within a slot for double-symbol DMRS and intra-slot frequency hopping disabled.
|
||||
// The first 4 colomns are PDSCH mapping type A and the last 4 colomns are PDSCH mapping type B.
|
||||
// When l' = l0, it is represented by 1
|
||||
|
||||
int32_t table_7_4_1_1_2_4_pdsch_dmrs_positions_l [12][8] = { // Duration in symbols
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1}, //<4 // (DMRS l' position)
|
||||
{0, 0, -1, -1, -1, -1, -1, -1}, //4 // (DMRS l' position)
|
||||
{0, 0, -1, -1, 3, 3, -1, -1}, //5 // (DMRS l' position)
|
||||
{0, 0, -1, -1, 3, 3, -1, -1}, //6 // (DMRS l' position)
|
||||
{0, 0, -1, -1, 3, 3, -1, -1}, //7 // (DMRS l' position)
|
||||
{0, 0, -1, -1, 3, 99, -1, -1}, //8 // (DMRS l' position)
|
||||
{0, 0, -1, -1, 3, 99, -1, -1}, //9 // (DMRS l' position)
|
||||
{0, 768, -1, -1, 3, 387, -1, -1}, //10 // (DMRS l' position)
|
||||
{0, 768, -1, -1, 3, 387, -1, -1}, //11 // (DMRS l' position)
|
||||
{0, 768, -1, -1, 3, 771, -1, -1}, //12 // (DMRS l' position)
|
||||
{0, 3072, -1, -1, 3, 771, -1, -1}, //13 // (DMRS l' position)
|
||||
{0, 3072, -1, -1, -1, -1, -1, -1}, //14 // (DMRS l' position)
|
||||
};
|
||||
|
||||
// TS 38.211 Table 6.4.1.1.3-3: PUSCH DMRS positions l' within a slot for single-symbol DMRS and intra-slot frequency hopping disabled.
|
||||
// The first 4 colomns are PUSCH mapping type A and the last 4 colomns are PUSCH mapping type B.
|
||||
// When l' = l0, it is represented by 1
|
||||
@@ -1736,17 +1777,17 @@ uint8_t compute_nr_root_seq(NR_RACH_ConfigCommon_t *rach_config,
|
||||
|
||||
int32_t table_6_4_1_1_3_3_pusch_dmrs_positions_l [12][8] = { // Duration in symbols
|
||||
{-1, -1, -1, -1, 1, 1, 1, 1}, //<4 // (DMRS l' position)
|
||||
{1, 1, 1, 1, 1, 1, 1, 1}, //4 // (DMRS l' position)
|
||||
{1, 1, 1, 1, 1, 5, 5, 5}, //5 // (DMRS l' position)
|
||||
{1, 1, 1, 1, 1, 5, 5, 5}, //6 // (DMRS l' position)
|
||||
{1, 1, 1, 1, 1, 5, 5, 5}, //7 // (DMRS l' position)
|
||||
{1, 129, 129, 129, 1, 65, 73, 73}, //8 // (DMRS l' position)
|
||||
{1, 129, 129, 129, 1, 65, 73, 73}, //9 // (DMRS l' position)
|
||||
{1, 513, 577, 577, 1, 257, 273, 585}, //10 // (DMRS l' position)
|
||||
{1, 513, 577, 577, 1, 257, 273, 585}, //11 // (DMRS l' position)
|
||||
{1, 513, 577, 2337, 1, 1025, 1057, 585}, //12 // (DMRS l' position)
|
||||
{1, 2049, 2177, 2337, 1, 1025, 1057, 585}, //13 // (DMRS l' position)
|
||||
{1, 2049, 2177, 2337, 1, 1025, 1057, 585}, //14 // (DMRS l' position)
|
||||
{0, 0, 0, 0, 1, 1, 1, 1}, //4 // (DMRS l' position)
|
||||
{0, 0, 0, 0, 1, 17, 17, 17}, //5 // (DMRS l' position)
|
||||
{0, 0, 0, 0, 1, 17, 17, 17}, //6 // (DMRS l' position)
|
||||
{0, 0, 0, 0, 1, 17, 17, 17}, //7 // (DMRS l' position)
|
||||
{0, 128, 128, 128, 1, 65, 73, 73}, //8 // (DMRS l' position)
|
||||
{0, 128, 128, 128, 1, 65, 73, 73}, //9 // (DMRS l' position)
|
||||
{0, 512, 576, 576, 1, 257, 273, 585}, //10 // (DMRS l' position)
|
||||
{0, 512, 576, 576, 1, 257, 273, 585}, //11 // (DMRS l' position)
|
||||
{0, 512, 576, 2336, 1, 1025, 1057, 585}, //12 // (DMRS l' position)
|
||||
{0, 2048, 2176, 2336, 1, 1025, 1057, 585}, //13 // (DMRS l' position)
|
||||
{0, 2048, 2176, 2336, 1, 1025, 1057, 585}, //14 // (DMRS l' position)
|
||||
};
|
||||
|
||||
|
||||
@@ -1756,17 +1797,17 @@ int32_t table_6_4_1_1_3_3_pusch_dmrs_positions_l [12][8] = {
|
||||
|
||||
int32_t table_6_4_1_1_3_4_pusch_dmrs_positions_l [12][8] = { // Duration in symbols
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1}, //<4 // (DMRS l' position)
|
||||
{1, 1, -1, -1, -1, -1, -1, -1}, //4 // (DMRS l' position)
|
||||
{1, 1, -1, -1, 1, 1, -1, -1}, //5 // (DMRS l' position)
|
||||
{1, 1, -1, -1, 1, 1, -1, -1}, //6 // (DMRS l' position)
|
||||
{1, 1, -1, -1, 1, 1, -1, -1}, //7 // (DMRS l' position)
|
||||
{1, 1, -1, -1, 1, 33, -1, -1}, //8 // (DMRS l' position)
|
||||
{1, 1, -1, -1, 1, 33, -1, -1}, //9 // (DMRS l' position)
|
||||
{1, 257, -1, -1, 1, 129, -1, -1}, //10 // (DMRS l' position)
|
||||
{1, 257, -1, -1, 1, 129, -1, -1}, //11 // (DMRS l' position)
|
||||
{1, 257, -1, -1, 1, 513, -1, -1}, //12 // (DMRS l' position)
|
||||
{1, 1025, -1, -1, 1, 513, -1, -1}, //13 // (DMRS l' position)
|
||||
{1, 1025, -1, -1, 1, 513, -1, -1}, //14 // (DMRS l' position)
|
||||
{0, 0, -1, -1, -1, -1, -1, -1}, //4 // (DMRS l' position)
|
||||
{0, 0, -1, -1, 3, 3, -1, -1}, //5 // (DMRS l' position)
|
||||
{0, 0, -1, -1, 3, 3, -1, -1}, //6 // (DMRS l' position)
|
||||
{0, 0, -1, -1, 3, 3, -1, -1}, //7 // (DMRS l' position)
|
||||
{0, 0, -1, -1, 3, 99, -1, -1}, //8 // (DMRS l' position)
|
||||
{0, 0, -1, -1, 3, 99, -1, -1}, //9 // (DMRS l' position)
|
||||
{0, 768, -1, -1, 3, 387, -1, -1}, //10 // (DMRS l' position)
|
||||
{0, 768, -1, -1, 3, 387, -1, -1}, //11 // (DMRS l' position)
|
||||
{0, 768, -1, -1, 3, 1539, -1, -1}, //12 // (DMRS l' position)
|
||||
{0, 3072, -1, -1, 3, 1539, -1, -1}, //13 // (DMRS l' position)
|
||||
{0, 3072, -1, -1, 3, 1539, -1, -1}, //14 // (DMRS l' position)
|
||||
};
|
||||
|
||||
// Returns the corresponding row index of the NR table
|
||||
@@ -2312,8 +2353,8 @@ int get_num_dmrs(uint16_t dmrs_mask ) {
|
||||
return(num_dmrs);
|
||||
}
|
||||
/* 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){
|
||||
return get_num_dmrs(fill_dmrs_mask(pdsch_Config,dmrs_TypeA_Position,NrOfSymbols,startSymbol));
|
||||
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
|
||||
@@ -2377,29 +2418,46 @@ uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position) {
|
||||
|
||||
}
|
||||
|
||||
int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmrs_AdditionalPosition_t additional_pos, pusch_maxLength_t pusch_maxLength) {
|
||||
int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmrs_AdditionalPosition_t additional_pos, pusch_maxLength_t pusch_maxLength, uint8_t start_symbol, uint8_t dmrs_typeA_position) {
|
||||
|
||||
uint8_t row, colomn;
|
||||
int32_t l_prime;
|
||||
|
||||
LOG_D(MAC, "PUSCH: NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d\n", duration_in_symbols, start_symbol, mapping_type, dmrs_typeA_position);
|
||||
|
||||
// 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
|
||||
// For TypeB, ld is the duration of the scheduled PUSCH resources
|
||||
uint8_t ld = (mapping_type == typeA) ? (duration_in_symbols + start_symbol) : duration_in_symbols;
|
||||
uint8_t l0 = (dmrs_typeA_position == NR_MIB__dmrs_TypeA_Position_pos2) ? 2 : 3 ;
|
||||
|
||||
colomn = additional_pos;
|
||||
|
||||
if (mapping_type == typeB)
|
||||
colomn += 4;
|
||||
|
||||
if (duration_in_symbols < 4)
|
||||
if (ld < 4)
|
||||
row = 0;
|
||||
else
|
||||
row = duration_in_symbols - 3;
|
||||
row = ld - 3;
|
||||
|
||||
if (pusch_maxLength == pusch_len1)
|
||||
if (pusch_maxLength == pusch_len1) {
|
||||
l_prime = table_6_4_1_1_3_3_pusch_dmrs_positions_l[row][colomn];
|
||||
else
|
||||
l0 = 1 << l0;
|
||||
}
|
||||
else {
|
||||
l_prime = table_6_4_1_1_3_4_pusch_dmrs_positions_l[row][colomn];
|
||||
l0 = 1<<l0 | 1<<(l0+1);
|
||||
}
|
||||
|
||||
AssertFatal(l_prime>0,"invalid l_prime < 0\n");
|
||||
LOG_D(MAC, "PUSCH - l0:%d, ld:%d,row:%d, column:%d, addpos:%d, maxlen:%d\n", l0, ld, row, colomn, additional_pos, pusch_maxLength);
|
||||
AssertFatal(l_prime>=0,"invalid l_prime < 0\n");
|
||||
|
||||
l_prime = (mapping_type == typeA) ? (l_prime | l0) : (l_prime << start_symbol);
|
||||
LOG_D(MAC, " PUSCH DMRS MASK in HEX:%x\n", l_prime);
|
||||
|
||||
return l_prime;
|
||||
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
@@ -2952,92 +3010,90 @@ int is_nr_UL_slot(NR_ServingCellConfigCommon_t *scc, slot_t slot, lte_frame_type
|
||||
else return(slot_in_period >= slots1+scc->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) {
|
||||
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols, int startSymbol, int mappingtype_fromDCI) {
|
||||
|
||||
int l0;int dmrs_AdditionalPosition = 0;int maxLength = 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);
|
||||
|
||||
int l0;
|
||||
int ld = NrOfSymbols+startSymbol;
|
||||
if (dmrs_TypeA_Position == NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2) l0=2;
|
||||
else if (dmrs_TypeA_Position == NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos3) l0=3;
|
||||
else AssertFatal(1==0,"Illegal dmrs_TypeA_Position %d\n",(int)dmrs_TypeA_Position);
|
||||
if (pdsch_Config == NULL) { // Initial BWP
|
||||
if (ld <= 7) return(1<<l0);
|
||||
else if (ld <= 9) return(1<<l0 | 1<<7);
|
||||
else if (ld <= 12) return(1<<l0 | 1<<6 | 1<<9);
|
||||
else if (ld <= 14) return(1<<l0 | 1<<7 | 1<<11);
|
||||
|
||||
// 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
|
||||
if (pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA && pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->present == NR_SetupRelease_DMRS_DownlinkConfig_PR_setup)
|
||||
dmrs_config = (NR_DMRS_DownlinkConfig_t *)pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup;
|
||||
} else if (mappingtype_fromDCI == typeB) {
|
||||
if (pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB && pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->present == NR_SetupRelease_DMRS_DownlinkConfig_PR_setup)
|
||||
dmrs_config = (NR_DMRS_DownlinkConfig_t *)pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup;
|
||||
} else {
|
||||
AssertFatal(1==0,"Incorrect Mappingtype\n");
|
||||
}
|
||||
|
||||
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;
|
||||
if (dmrs_config->dmrs_AdditionalPosition != NULL) dmrs_AdditionalPosition = *dmrs_config->dmrs_AdditionalPosition;
|
||||
}
|
||||
|
||||
uint8_t ld, row, column;
|
||||
int32_t l_prime = -1;
|
||||
|
||||
// columns 0-3 for TypeA, 4-7 for TypeB
|
||||
column = (mappingtype_fromDCI == typeA) ? dmrs_AdditionalPosition : (dmrs_AdditionalPosition + 4);
|
||||
|
||||
// Section 7.4.1.1.2 in Spec 38.211
|
||||
// For PDSCH Mapping TypeA, ld is duration between first OFDM of the slot and last OFDM symbol of the scheduled PDSCH resources
|
||||
// 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);
|
||||
|
||||
if (mappingtype_fromDCI == typeA) {
|
||||
|
||||
// Section 7.4.1.1.2 in Spec 38.211
|
||||
AssertFatal((l0 == 2) || (l0 == 3 && dmrs_AdditionalPosition != 3),"Wrong config, If dmrs_TypeA_Position POS3, ADD POS cannot be POS3 \n");
|
||||
|
||||
// Table 5.1.2.1-1 in Spec 38.214
|
||||
AssertFatal(startSymbol <= l0, "Wrong config, Start symbol %d cannot be later than dmrs_TypeA_Position %d \n", startSymbol, l0);
|
||||
|
||||
// Section 7.4.1.1.2 in Spec 38.211
|
||||
AssertFatal(l0 == 2 || (l0 == 3 && (ld != 3 || ld != 4)), "ld 3 or 4 symbols only possible with dmrs_TypeA_Position POS2 \n");
|
||||
|
||||
}
|
||||
|
||||
if (maxLength == 1) {
|
||||
row = ld - 2;
|
||||
l_prime = table_7_4_1_1_2_3_pdsch_dmrs_positions_l[row][column];
|
||||
l0 = 1 << l0;
|
||||
}
|
||||
else {
|
||||
if (pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA &&
|
||||
pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->present == NR_SetupRelease_DMRS_DownlinkConfig_PR_setup) {
|
||||
// Relative to start of slot
|
||||
NR_DMRS_DownlinkConfig_t *dmrs_config = (NR_DMRS_DownlinkConfig_t *)pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup;
|
||||
AssertFatal(ld>1 && ld < 15,"Illegal l_d %d\n",ld);
|
||||
int pos2=0;
|
||||
if (dmrs_config->maxLength == NULL) {
|
||||
// this is Table 7.4.1.1.2-3: PDSCH DM-RS positions l for single-symbol DM-RS
|
||||
if (dmrs_config->dmrs_AdditionalPosition == NULL) pos2=1;
|
||||
else if (dmrs_config->dmrs_AdditionalPosition && *dmrs_config->dmrs_AdditionalPosition == NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0 )
|
||||
return(1<<l0);
|
||||
|
||||
|
||||
switch (ld) {
|
||||
case 2 :
|
||||
case 3 :
|
||||
case 4 :
|
||||
case 5 :
|
||||
case 6 :
|
||||
case 7 :
|
||||
return(1<<l0);
|
||||
break;
|
||||
case 8 :
|
||||
case 9:
|
||||
return(1<<l0 | 1<<7);
|
||||
break;
|
||||
case 10:
|
||||
case 11:
|
||||
if (dmrs_config->dmrs_AdditionalPosition && *dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos1)
|
||||
return(1<<l0 | 1<<9);
|
||||
else
|
||||
return(1<<l0 | 1<<6 | 1<<9);
|
||||
break;
|
||||
case 12:
|
||||
if (dmrs_config->dmrs_AdditionalPosition && *dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos1)
|
||||
return(1<<l0 | 1<<9);
|
||||
else if (pos2==1)
|
||||
return(1<<l0 | 1<<6 | 1<<9);
|
||||
else if (dmrs_config->dmrs_AdditionalPosition && *dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos3)
|
||||
return(1<<l0 | 1<<5 | 1<<8 | 1<<11);
|
||||
break;
|
||||
case 13:
|
||||
case 14:
|
||||
if (dmrs_config->dmrs_AdditionalPosition && *dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos1)
|
||||
return(1<<l0 | 1<<11);
|
||||
else if (pos2==1)
|
||||
return(1<<l0 | 1<<7 | 1<<11);
|
||||
else if (dmrs_config->dmrs_AdditionalPosition && *dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos3)
|
||||
return(1<<l0 | 1<<5 | 1<<8 | 1<<11);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Table 7.4.1.1.2-4: PDSCH DM-RS positions l for double-symbol DM-RS.
|
||||
AssertFatal(ld>3,"Illegal l_d %d for len2 DMRS\n",ld);
|
||||
if (ld < 10) return(1<<l0);
|
||||
if (ld < 13 && *dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0) return(1<<l0);
|
||||
if (ld < 13 && *dmrs_config->dmrs_AdditionalPosition!=NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0) return(1<<l0 | 1<<8);
|
||||
if (*dmrs_config->dmrs_AdditionalPosition!=NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0) return(1<<l0);
|
||||
if (*dmrs_config->dmrs_AdditionalPosition!=NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos1) return(1<<l0 | 1<<10);
|
||||
if (*dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0) return(1<<l0);
|
||||
if (*dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos1) return(1<<l0 | 1<<10);
|
||||
}
|
||||
}
|
||||
else if (pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB &&
|
||||
pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->present == NR_SetupRelease_DMRS_DownlinkConfig_PR_setup) {
|
||||
// Relative to start of PDSCH resource
|
||||
AssertFatal(1==0,"TypeB DMRS not supported yet\n");
|
||||
}
|
||||
row = (ld < 4) ? 0 : (ld - 3);
|
||||
l_prime = table_7_4_1_1_2_4_pdsch_dmrs_positions_l[row][column];
|
||||
l0 = 1<<l0 | 1<<(l0+1);
|
||||
}
|
||||
AssertFatal(1==0,"Shouldn't get here\n");
|
||||
return(-1);
|
||||
|
||||
LOG_D(MAC, "l0:%d, ld:%d,row:%d, column:%d, addpos:%d, maxlen:%d\n", l0, ld, row, column, dmrs_AdditionalPosition, maxLength);
|
||||
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);
|
||||
LOG_D(MAC, " PDSCH DMRS MASK in HEX:%x\n", l_prime);
|
||||
|
||||
return l_prime;
|
||||
}
|
||||
|
||||
uint8_t get_pusch_mcs_table(long *mcs_Table,
|
||||
|
||||
@@ -47,7 +47,7 @@ uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn);
|
||||
|
||||
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw);
|
||||
|
||||
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol);
|
||||
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol,int mappingtype_fromDCI);
|
||||
|
||||
int is_nr_DL_slot(NR_ServingCellConfigCommon_t *scc,slot_t slotP);
|
||||
|
||||
@@ -121,7 +121,7 @@ uint16_t get_NCS(uint8_t index, uint16_t format, uint8_t restricted_set_config);
|
||||
|
||||
int get_num_dmrs(uint16_t dmrs_mask );
|
||||
uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position);
|
||||
int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmrs_AdditionalPosition_t additional_pos, pusch_maxLength_t pusch_maxLength);
|
||||
int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmrs_AdditionalPosition_t additional_pos, pusch_maxLength_t pusch_maxLength, uint8_t start_symbolt, uint8_t dmrs_typeA_position);
|
||||
|
||||
uint8_t get_L_ptrs(uint8_t mcs1, uint8_t mcs2, uint8_t mcs3, uint8_t I_mcs, uint8_t mcs_table);
|
||||
uint8_t get_K_ptrs(uint16_t nrb0, uint16_t nrb1, uint16_t N_RB);
|
||||
@@ -153,7 +153,7 @@ bool set_ul_ptrs_values(NR_PTRS_UplinkConfig_t *ul_ptrs_config,
|
||||
uint8_t *reOffset, uint8_t *maxNumPorts, uint8_t *ulPower,
|
||||
uint8_t NrOfSymbols);
|
||||
|
||||
uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol);
|
||||
uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol,int mappingtype);
|
||||
|
||||
/* \brief Set the transform precoding according to 6.1.3 of 3GPP TS 38.214 version 16.3.0 Release 16
|
||||
@param *pusch_config, pointer to pusch config
|
||||
|
||||
@@ -640,12 +640,26 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
LOG_W(MAC, "[%d.%d] Invalid time_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot);
|
||||
return -1;
|
||||
}
|
||||
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList = NULL;
|
||||
if (mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList)
|
||||
pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList->choice.setup;
|
||||
else if (mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList)
|
||||
pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
|
||||
int mappingtype = pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType;
|
||||
|
||||
/* dmrs symbol positions*/
|
||||
dlsch_config_pdu_1_0->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config,
|
||||
dlsch_config_pdu_1_0->dlDmrsSymbPos = fill_dmrs_mask(NULL,
|
||||
mac->scc->dmrs_TypeA_Position,
|
||||
dlsch_config_pdu_1_0->number_symbols,
|
||||
dlsch_config_pdu_1_0->start_symbol);
|
||||
dlsch_config_pdu_1_0->dmrsConfigType = (pdsch_config) ? (mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0;
|
||||
dlsch_config_pdu_1_0->start_symbol,
|
||||
mappingtype);
|
||||
|
||||
// For DCI 1_0, dmrs type is type1. referred to section 5.1.6.2 of 3GPP TS 38.214
|
||||
dlsch_config_pdu_1_0->dmrsConfigType = 0;
|
||||
LOG_D(MAC, "DCI 1_0 start_sym:%d NR Symb:%d, DMRS_symb_pos:%x\n", dlsch_config_pdu_1_0->start_symbol, dlsch_config_pdu_1_0->number_symbols, dlsch_config_pdu_1_0->dlDmrsSymbPos);
|
||||
|
||||
/* number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214 version 15.9.0 Release 15 */
|
||||
if (dlsch_config_pdu_1_0->number_symbols == 2)
|
||||
dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 1;
|
||||
@@ -783,10 +797,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_DLSCH;
|
||||
dl_config->dl_config_list[dl_config->number_pdus].dlsch_config_pdu.rnti = rnti;
|
||||
|
||||
// FIXME: fix number of additional dmrs
|
||||
if(pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition == NULL)
|
||||
pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition=calloc(1,sizeof(*pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition));
|
||||
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu_1_1 = &dl_config->dl_config_list[dl_config->number_pdus].dlsch_config_pdu.dlsch_config_rel15;
|
||||
|
||||
dlsch_config_pdu_1_1->BWPSize = NRRIV2BW(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
@@ -807,11 +817,21 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
LOG_W(MAC, "[%d.%d] Invalid time_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot);
|
||||
return -1;
|
||||
}
|
||||
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList = NULL;
|
||||
if (mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList)
|
||||
pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList->choice.setup;
|
||||
else if (mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList)
|
||||
pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
|
||||
int mappingtype = pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType;
|
||||
|
||||
/* dmrs symbol positions*/
|
||||
dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config,
|
||||
mac->scc->dmrs_TypeA_Position,
|
||||
dlsch_config_pdu_1_1->number_symbols,
|
||||
dlsch_config_pdu_1_1->start_symbol);
|
||||
dlsch_config_pdu_1_1->start_symbol,
|
||||
mappingtype);
|
||||
dlsch_config_pdu_1_1->dmrsConfigType = mac->DLbwp[dl_bwp_id-1]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1;
|
||||
/* TODO: fix number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214,
|
||||
using tables 7.3.1.2.2-1, 7.3.1.2.2-2, 7.3.1.2.2-3, 7.3.1.2.2-4 of 3GPP TS 38.212 */
|
||||
|
||||
@@ -492,7 +492,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
int NrOfSymbols;
|
||||
uint8_t nb_dmrs_re_per_rb;
|
||||
|
||||
uint16_t l_prime_mask = 1;
|
||||
uint16_t l_prime_mask = 0;
|
||||
uint16_t number_dmrs_symbols = 0;
|
||||
int N_PRB_oh = 0;
|
||||
|
||||
@@ -505,6 +505,9 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
pusch_config_pdu->nrOfLayers = 1;
|
||||
pusch_config_pdu->rnti = rnti;
|
||||
|
||||
pusch_dmrs_AdditionalPosition_t add_pos = pusch_dmrs_pos2;
|
||||
pusch_maxLength_t dmrslength = pusch_len1;
|
||||
|
||||
if (rar_grant) {
|
||||
|
||||
// Note: for Msg3 or MsgA PUSCH transmission the N_PRB_oh is always set to 0
|
||||
@@ -513,6 +516,8 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
NR_BWP_UplinkDedicated_t *ibwp = mac->scg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP;
|
||||
NR_PUSCH_Config_t *pusch_Config = ibwp->pusch_Config->choice.setup;
|
||||
int startSymbolAndLength = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[rar_grant->Msg3_t_alloc]->startSymbolAndLength;
|
||||
int mappingtype = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[rar_grant->Msg3_t_alloc]->mappingType;
|
||||
|
||||
|
||||
// active BWP start
|
||||
int abwp_start = NRRIV2PRBOFFSET(ubwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
@@ -550,6 +555,9 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
pusch_config_pdu->start_symbol_index = StartSymbolIndex;
|
||||
pusch_config_pdu->nr_of_symbols = NrOfSymbols;
|
||||
|
||||
l_prime_mask = get_l_prime(NrOfSymbols, mappingtype, add_pos, dmrslength, StartSymbolIndex, scc->dmrs_TypeA_Position);
|
||||
LOG_D(MAC, "MSG3 start_sym:%d NR Symb:%d mappingtype:%d , DMRS_MASK:%x\n", pusch_config_pdu->start_symbol_index, pusch_config_pdu->nr_of_symbols, mappingtype, l_prime_mask);
|
||||
|
||||
#ifdef DEBUG_MSG3
|
||||
LOG_D(MAC, "In %s BWP assignment (BWP (start %d, size %d) \n", __FUNCTION__, pusch_config_pdu->bwp_start, pusch_config_pdu->bwp_size);
|
||||
#endif
|
||||
@@ -629,18 +637,26 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
|
||||
}
|
||||
|
||||
NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = NULL;
|
||||
if (pusch_Config->pusch_TimeDomainAllocationList) {
|
||||
pusch_TimeDomainAllocationList = pusch_Config->pusch_TimeDomainAllocationList->choice.setup;
|
||||
}
|
||||
else if (mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList) {
|
||||
pusch_TimeDomainAllocationList = mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
}
|
||||
|
||||
int mappingtype = pusch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType;
|
||||
|
||||
NR_DMRS_UplinkConfig_t *NR_DMRS_ulconfig = NULL;
|
||||
NR_DMRS_ulconfig = (mappingtype == NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeA)
|
||||
? pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup : pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup;
|
||||
|
||||
/* TRANSFORM PRECODING ------------------------------------------------------------------------------------------*/
|
||||
|
||||
if (pusch_config_pdu->transform_precoding == transform_precoder_enabled) {
|
||||
|
||||
pusch_config_pdu->num_dmrs_cdm_grps_no_data = 2;
|
||||
|
||||
NR_DMRS_UplinkConfig_t *NR_DMRS_ulconfig = NULL;
|
||||
if(pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA != NULL)
|
||||
NR_DMRS_ulconfig = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup;
|
||||
else
|
||||
NR_DMRS_ulconfig = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup;
|
||||
|
||||
uint32_t n_RS_Id = 0;
|
||||
if (NR_DMRS_ulconfig->transformPrecodingEnabled->nPUSCH_Identity != NULL)
|
||||
n_RS_Id = *NR_DMRS_ulconfig->transformPrecodingEnabled->nPUSCH_Identity;
|
||||
@@ -709,8 +725,13 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
pusch_config_pdu->absolute_delta_PUSCH = 4;
|
||||
}
|
||||
|
||||
if (NR_DMRS_ulconfig != NULL) {
|
||||
add_pos = (NR_DMRS_ulconfig->dmrs_AdditionalPosition == NULL) ? 2 : *NR_DMRS_ulconfig->dmrs_AdditionalPosition;
|
||||
dmrslength = NR_DMRS_ulconfig->maxLength == NULL ? pusch_len1 : pusch_len2;
|
||||
}
|
||||
|
||||
/* DMRS */
|
||||
l_prime_mask = get_l_prime(pusch_config_pdu->nr_of_symbols, typeB, pusch_dmrs_pos0, pusch_len1);
|
||||
l_prime_mask = get_l_prime(pusch_config_pdu->nr_of_symbols, mappingtype, add_pos, dmrslength, pusch_config_pdu->start_symbol_index, scc->dmrs_TypeA_Position);
|
||||
if (pusch_config_pdu->transform_precoding == transform_precoder_disabled)
|
||||
pusch_config_pdu->num_dmrs_cdm_grps_no_data = 1;
|
||||
|
||||
@@ -748,7 +769,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
pusch_config_pdu->nr_of_symbols,
|
||||
rnti_types[rnti_type]);
|
||||
|
||||
pusch_config_pdu->ul_dmrs_symb_pos = l_prime_mask << pusch_config_pdu->start_symbol_index;;
|
||||
pusch_config_pdu->ul_dmrs_symb_pos = l_prime_mask;
|
||||
pusch_config_pdu->target_code_rate = nr_get_code_rate_ul(pusch_config_pdu->mcs_index, pusch_config_pdu->mcs_table);
|
||||
pusch_config_pdu->qam_mod_order = nr_get_Qm_ul(pusch_config_pdu->mcs_index, pusch_config_pdu->mcs_table);
|
||||
|
||||
|
||||
@@ -806,6 +806,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t
|
||||
int startSymbolAndLength = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[ra->Msg3_tda_id]->startSymbolAndLength;
|
||||
int start_symbol_index,nr_of_symbols;
|
||||
SLIV2SL(startSymbolAndLength, &start_symbol_index, &nr_of_symbols);
|
||||
int mappingtype = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[ra->Msg3_tda_id]->mappingType;
|
||||
|
||||
pusch_pdu->pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA;
|
||||
pusch_pdu->rnti = ra->rnti;
|
||||
@@ -831,7 +832,10 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t
|
||||
pusch_pdu->transform_precoding = 0;
|
||||
pusch_pdu->data_scrambling_id = *scc->physCellId;
|
||||
pusch_pdu->nrOfLayers = 1;
|
||||
pusch_pdu->ul_dmrs_symb_pos = 1<<start_symbol_index; // ok for now but use fill dmrs mask later
|
||||
|
||||
pusch_pdu->ul_dmrs_symb_pos = get_l_prime(nr_of_symbols,mappingtype,pusch_dmrs_pos2,pusch_len1,start_symbol_index, scc->dmrs_TypeA_Position);
|
||||
LOG_D(MAC, "MSG3 start_sym:%d NR Symb:%d mappingtype:%d , ul_dmrs_symb_pos:%x\n", start_symbol_index, nr_of_symbols, mappingtype, pusch_pdu->ul_dmrs_symb_pos);
|
||||
|
||||
pusch_pdu->dmrs_config_type = 0;
|
||||
pusch_pdu->ul_dmrs_scrambling_id = *scc->physCellId; //If provided and the PUSCH is not a msg3 PUSCH, otherwise, L2 should set this to physical cell id.
|
||||
pusch_pdu->scid = 0; //DMRS sequence initialization [TS38.211, sec 6.4.1.1.1]. Should match what is sent in DCI 0_1, otherwise set to 0.
|
||||
@@ -946,6 +950,10 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols);
|
||||
AssertFatal(startSymbolIndex >= 0, "StartSymbolIndex is negative\n");
|
||||
|
||||
int mappingtype = ra->secondaryCellGroup->spCellConfig->spCellConfigDedicated->
|
||||
downlinkBWP_ToAddModList->list.array[ra->bwp_id-1]->bwp_Common->pdsch_ConfigCommon->choice.setup->
|
||||
pdsch_TimeDomainAllocationList->list.array[time_domain_assignment]->mappingType;
|
||||
|
||||
uint8_t numDmrsCdmGrpsNoData = 2;
|
||||
if (nrOfSymbols == 2) {
|
||||
numDmrsCdmGrpsNoData = 1;
|
||||
@@ -1031,7 +1039,8 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(NULL,
|
||||
nr_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position,
|
||||
nrOfSymbols,
|
||||
startSymbolIndex);
|
||||
startSymbolIndex,
|
||||
mappingtype);
|
||||
|
||||
int x_Overhead = 0;
|
||||
uint8_t tb_scaling = 0;
|
||||
@@ -1188,10 +1197,15 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols);
|
||||
AssertFatal(startSymbolIndex >= 0, "StartSymbolIndex is negative\n");
|
||||
|
||||
int mappingtype = ra->secondaryCellGroup->spCellConfig->spCellConfigDedicated->
|
||||
downlinkBWP_ToAddModList->list.array[ra->bwp_id-1]->bwp_Common->pdsch_ConfigCommon->choice.setup->
|
||||
pdsch_TimeDomainAllocationList->list.array[time_domain_assignment]->mappingType;
|
||||
|
||||
uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL,
|
||||
nr_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position,
|
||||
nrOfSymbols,
|
||||
startSymbolIndex);
|
||||
startSymbolIndex,
|
||||
mappingtype);
|
||||
|
||||
uint16_t N_DMRS_SLOT = get_num_dmrs(dlDmrsSymbPos);
|
||||
|
||||
|
||||
@@ -357,6 +357,7 @@ void schedule_control_sib1(module_id_t module_id,
|
||||
|
||||
int startSymbolIndex = 0;
|
||||
int nrOfSymbols = 0;
|
||||
|
||||
if(gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position == 0) {
|
||||
startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[gNB_mac->sched_ctrlCommon->pdsch_semi_static.time_domain_allocation][1];
|
||||
nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[gNB_mac->sched_ctrlCommon->pdsch_semi_static.time_domain_allocation][2];
|
||||
@@ -365,6 +366,9 @@ void schedule_control_sib1(module_id_t module_id,
|
||||
nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[gNB_mac->sched_ctrlCommon->pdsch_semi_static.time_domain_allocation][2];
|
||||
}
|
||||
|
||||
// TODO: There are exceptions to this in table 5.1.2.1.1-4,5 (Default time domain allocation tables B, C)
|
||||
int mappingtype = (startSymbolIndex <= 3)? typeA: typeB;
|
||||
|
||||
if (nrOfSymbols == 2) {
|
||||
gNB_mac->sched_ctrlCommon->pdsch_semi_static.numDmrsCdmGrpsNoData = 1;
|
||||
} else {
|
||||
@@ -373,7 +377,7 @@ void schedule_control_sib1(module_id_t module_id,
|
||||
|
||||
// Calculate number of PRB_DMRS
|
||||
uint8_t N_PRB_DMRS = gNB_mac->sched_ctrlCommon->pdsch_semi_static.numDmrsCdmGrpsNoData * 6;
|
||||
uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex);
|
||||
uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype);
|
||||
uint16_t dmrs_length = get_num_dmrs(dlDmrsSymbPos);
|
||||
|
||||
int rbSize = 0;
|
||||
@@ -394,6 +398,7 @@ void schedule_control_sib1(module_id_t module_id,
|
||||
LOG_D(MAC,"nrOfSymbols = %i\n", nrOfSymbols);
|
||||
LOG_D(MAC, "rbSize = %i\n", gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize);
|
||||
LOG_D(MAC,"TBS = %i\n", TBS);
|
||||
LOG_D(MAC,"mappingtype = %d\n", mappingtype);
|
||||
|
||||
// Mark the corresponding RBs as used
|
||||
for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize; rb++) {
|
||||
@@ -406,7 +411,8 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
|
||||
NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config,
|
||||
uint32_t TBS,
|
||||
int StartSymbolIndex,
|
||||
int NrOfSymbols) {
|
||||
int NrOfSymbols,
|
||||
uint16_t dlDmrsSymbPos) {
|
||||
|
||||
gNB_MAC_INST *gNB_mac = RC.nrmac[Mod_idP];
|
||||
NR_COMMON_channels_t *cc = gNB_mac->common_channels;
|
||||
@@ -478,9 +484,7 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
|
||||
pdsch_pdu_rel15->mcsTable[0] = gNB_mac->sched_ctrlCommon->pdsch_semi_static.mcsTableIdx;
|
||||
pdsch_pdu_rel15->StartSymbolIndex = StartSymbolIndex;
|
||||
pdsch_pdu_rel15->NrOfSymbols = NrOfSymbols;
|
||||
|
||||
pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(NULL, scc->dmrs_TypeA_Position, pdsch_pdu_rel15->NrOfSymbols, pdsch_pdu_rel15->StartSymbolIndex);
|
||||
|
||||
pdsch_pdu_rel15->dlDmrsSymbPos = dlDmrsSymbPos;
|
||||
LOG_D(MAC,"dlDmrsSymbPos = 0x%x\n", pdsch_pdu_rel15->dlDmrsSymbPos);
|
||||
|
||||
/* Fill PDCCH DL DCI PDU */
|
||||
@@ -605,9 +609,12 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
|
||||
nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[gNB_mac->sched_ctrlCommon->pdsch_semi_static.time_domain_allocation][2];
|
||||
}
|
||||
|
||||
// TODO: There are exceptions to this in table 5.1.2.1.1-4,5 (Default time domain allocation tables B, C)
|
||||
int mappingtype = (startSymbolIndex <= 3) ? typeA : typeB;
|
||||
|
||||
// Calculate number of PRB_DMRS
|
||||
uint8_t N_PRB_DMRS = gNB_mac->sched_ctrlCommon->pdsch_semi_static.numDmrsCdmGrpsNoData * 6;
|
||||
uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex);
|
||||
uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype);
|
||||
uint16_t dmrs_length = get_num_dmrs(dlDmrsSymbPos);
|
||||
|
||||
const uint32_t TBS = nr_compute_tbs(nr_get_Qm_dl(gNB_mac->sched_ctrlCommon->sched_pdsch.mcs, gNB_mac->sched_ctrlCommon->pdsch_semi_static.mcsTableIdx),
|
||||
@@ -615,7 +622,7 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
|
||||
gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize, nrOfSymbols, N_PRB_DMRS * dmrs_length,0 ,0 ,1 ) >> 3;
|
||||
|
||||
nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body;
|
||||
nr_fill_nfapi_dl_sib1_pdu(module_idP, dl_req, type0_PDCCH_CSS_config, TBS, startSymbolIndex, nrOfSymbols);
|
||||
nr_fill_nfapi_dl_sib1_pdu(module_idP, dl_req, type0_PDCCH_CSS_config, TBS, startSymbolIndex, nrOfSymbols, dlDmrsSymbPos);
|
||||
|
||||
const int ntx_req = gNB_mac->TX_req[CC_id].Number_of_PDUs;
|
||||
nfapi_nr_pdu_t *tx_req = &gNB_mac->TX_req[CC_id].pdu_list[ntx_req];
|
||||
|
||||
@@ -146,15 +146,18 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
|
||||
int startSymbolAndLength=0;
|
||||
int StartSymbolIndex=-1,NrOfSymbols=14;
|
||||
int StartSymbolIndex_tmp,NrOfSymbols_tmp;
|
||||
int mappingtype_tmp, mappingtype;
|
||||
|
||||
for (int i=0;
|
||||
i<scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count;
|
||||
i++) {
|
||||
startSymbolAndLength = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength;
|
||||
SLIV2SL(startSymbolAndLength,&StartSymbolIndex_tmp,&NrOfSymbols_tmp);
|
||||
mappingtype_tmp = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->mappingType;
|
||||
if (NrOfSymbols_tmp < NrOfSymbols) {
|
||||
NrOfSymbols = NrOfSymbols_tmp;
|
||||
StartSymbolIndex = StartSymbolIndex_tmp;
|
||||
mappingtype = mappingtype_tmp;
|
||||
// k0 = *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0;
|
||||
// time_domain_assignment = i;
|
||||
}
|
||||
@@ -165,7 +168,8 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
|
||||
pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(NULL,
|
||||
scc->dmrs_TypeA_Position,
|
||||
NrOfSymbols,
|
||||
StartSymbolIndex);
|
||||
StartSymbolIndex,
|
||||
mappingtype);
|
||||
|
||||
/*
|
||||
AssertFatal(k0==0,"k0 is not zero for Initial DL BWP TimeDomain Alloc\n");
|
||||
|
||||
@@ -268,6 +268,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList =
|
||||
bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
AssertFatal(tda < tdaList->list.count, "time_domain_allocation %d>=%d\n", tda, tdaList->list.count);
|
||||
const int mapping_type = tdaList->list.array[tda]->mappingType;
|
||||
const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength;
|
||||
SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols);
|
||||
|
||||
@@ -291,9 +292,9 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
// if no data in dmrs cdm group is 2 both odd and even REs have no data
|
||||
ps->N_PRB_DMRS = num_dmrs_cdm_grps_no_data * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4);
|
||||
ps->N_DMRS_SLOT =
|
||||
get_num_dmrs_symbols(bwp->bwp_Dedicated->pdsch_Config->choice.setup, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex);
|
||||
get_num_dmrs_symbols(bwp->bwp_Dedicated->pdsch_Config->choice.setup, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, mapping_type);
|
||||
ps->dl_dmrs_symb_pos =
|
||||
fill_dmrs_mask(bwp->bwp_Dedicated->pdsch_Config->choice.setup, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex);
|
||||
fill_dmrs_mask(bwp->bwp_Dedicated->pdsch_Config->choice.setup, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, mapping_type);
|
||||
}
|
||||
|
||||
void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
@@ -354,11 +355,12 @@ void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
: *ps->NR_DMRS_UplinkConfig->dmrs_AdditionalPosition);
|
||||
const pusch_maxLength_t pusch_maxLength =
|
||||
ps->NR_DMRS_UplinkConfig->maxLength == NULL ? 1 : 2;
|
||||
const uint16_t l_prime_mask = get_l_prime(ps->nrOfSymbols,
|
||||
ps->ul_dmrs_symb_pos = get_l_prime(ps->nrOfSymbols,
|
||||
ps->mapping_type,
|
||||
additional_pos,
|
||||
pusch_maxLength);
|
||||
ps->ul_dmrs_symb_pos = l_prime_mask << ps->startSymbolIndex;
|
||||
pusch_maxLength,
|
||||
ps->startSymbolIndex,
|
||||
scc->dmrs_TypeA_Position);
|
||||
uint8_t num_dmrs_symb = 0;
|
||||
for(int i = ps->startSymbolIndex; i < ps->startSymbolIndex + ps->nrOfSymbols; i++)
|
||||
num_dmrs_symb += (ps->ul_dmrs_symb_pos >> i) & 1;
|
||||
|
||||
Reference in New Issue
Block a user