Code format improvements in differences for develop
This commit is contained in:
@@ -255,10 +255,7 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
dlsch->harq_mask |= (1<<harq_pid);
|
||||
dlsch->rnti = pdcch_pdu_rel15->dci_pdu[i].RNTI;
|
||||
|
||||
// nr_fill_cce_list(gNB,0);
|
||||
|
||||
|
||||
|
||||
// nr_fill_cce_list(gNB,0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -82,7 +82,6 @@ void nr_pdsch_codeword_scrambling_optim(uint8_t *in,
|
||||
|
||||
s=lte_gold_generic(&x1, &x2, 1);
|
||||
|
||||
|
||||
#if defined(__AVX2__)
|
||||
for (int i=0; i<((size>>5)+((size&0x1f) > 0 ? 1 : 0)); i++) {
|
||||
in32=_mm256_movemask_epi8(_mm256_slli_epi16(((__m256i*)in)[i],7));
|
||||
@@ -162,7 +161,6 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
|
||||
uint32_t encoded_length = nb_re*Qm;
|
||||
int16_t mod_dmrs[14][n_dmrs<<1] __attribute__ ((aligned(16)));
|
||||
|
||||
|
||||
/* PTRS */
|
||||
uint16_t beta_ptrs = 1;
|
||||
uint8_t ptrs_symbol = 0;
|
||||
|
||||
@@ -296,7 +296,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
|
||||
for(i=0;i<nr_sequences;i++){
|
||||
for (l=0;l<pucch_pdu->nr_of_symbols;l++) {
|
||||
corr_re[l]=0;corr_im[l]=0;
|
||||
corr_re[l]=0;
|
||||
corr_im[l]=0;
|
||||
seq_index = (pucch_pdu->initial_cyclic_shift+
|
||||
mcs[i]+
|
||||
gNB->pucch0_lut.lut[cs_ind][slot][l+pucch_pdu->start_symbol_index])%12;
|
||||
@@ -346,7 +347,6 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
|
||||
index=maxpos;
|
||||
|
||||
|
||||
// estimate CQI for MAC (from antenna port 0 only)
|
||||
int max_n0 = uci_stats->pucch0_n00>uci_stats->pucch0_n01 ? uci_stats->pucch0_n00:uci_stats->pucch0_n01;
|
||||
int SNRtimes10 = dB_fixed_times10(signal_energy_nodc(&rxdataF[0][pucch_pdu->start_symbol_index*frame_parms->ofdm_symbol_size+re_offset[0]],12)) - (10*max_n0);
|
||||
@@ -399,7 +399,6 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
uci_stats->pucch0_positive_SR++;
|
||||
}
|
||||
uci_stats->pucch01_trials++;
|
||||
|
||||
}
|
||||
else {
|
||||
uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq));
|
||||
@@ -1643,7 +1642,6 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void dump_uci_stats(FILE *fd,PHY_VARS_gNB *gNB,int frame) {
|
||||
|
||||
int strpos=0;
|
||||
|
||||
@@ -701,7 +701,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_COMBINE_SEG, VCD_FUNCTION_OUT);
|
||||
|
||||
dlsch->last_iteration_cnt = ret;
|
||||
// log_dump(PHY, harq_process->b, 60, LOG_DUMP_CHAR,"nrue pdsch rx frame %d %d: ", frame, nr_slot_rx );
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@@ -218,12 +218,12 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
|
||||
k *= 2;
|
||||
|
||||
LOG_I(PHY, "PRACH [UE %d] in slot %d, placing PRACH in position %d, msg1 frequency start %d (k1 %d), preamble_offset %d, first_nonzero_root_idx %d\n", Mod_id,
|
||||
slot,
|
||||
k,
|
||||
n_ra_prb,
|
||||
nrUE_config->prach_config.num_prach_fd_occasions_list[fd_occasion].k1,
|
||||
preamble_offset,
|
||||
first_nonzero_root_idx);
|
||||
slot,
|
||||
k,
|
||||
n_ra_prb,
|
||||
nrUE_config->prach_config.num_prach_fd_occasions_list[fd_occasion].k1,
|
||||
preamble_offset,
|
||||
first_nonzero_root_idx);
|
||||
|
||||
Xu = (int16_t*)ue->X_u[preamble_offset-first_nonzero_root_idx];
|
||||
|
||||
|
||||
@@ -164,8 +164,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
|
||||
///////////
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//log_dump(PHY, harq_process_ul_ue->a, 16, LOG_DUMP_CHAR,"nrue pusch tx frame %d %d: ", frame, slot);
|
||||
|
||||
|
||||
/////////////////////////ULSCH scrambling/////////////////////////
|
||||
///////////
|
||||
|
||||
@@ -365,7 +364,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
|
||||
// TODO: performance improvement, we can skip the modulation of DMRS symbols outside the bandwidth part
|
||||
// Perform this on gold sequence, not required when SC FDMA operation is done,
|
||||
LOG_D(PHY,"DMRS in symbol %d\n",l);
|
||||
LOG_D(PHY,"DMRS in symbol %d\n",l);
|
||||
nr_modulation(pusch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
|
||||
|
||||
} else {
|
||||
|
||||
@@ -54,11 +54,12 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t m0,
|
||||
uint8_t mcs,
|
||||
uint8_t mcs,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint16_t startingPRB,
|
||||
uint16_t secondHopPRB);
|
||||
uint16_t secondHopPRB);
|
||||
|
||||
void nr_generate_pucch1(PHY_VARS_NR_UE *ue,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
@@ -73,10 +74,11 @@ void nr_generate_pucch1(PHY_VARS_NR_UE *ue,
|
||||
uint16_t startingPRB_intraSlotHopping,
|
||||
uint8_t timeDomainOCC,
|
||||
uint8_t nr_bit);
|
||||
|
||||
void nr_generate_pucch2(PHY_VARS_NR_UE *ue,
|
||||
uint16_t crnti,
|
||||
uint32_t dmrs_scrambling_id,
|
||||
uint32_t data_scrambling_id,
|
||||
uint32_t dmrs_scrambling_id,
|
||||
uint32_t data_scrambling_id,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
@@ -88,6 +90,7 @@ void nr_generate_pucch2(PHY_VARS_NR_UE *ue,
|
||||
uint8_t nrofPRB,
|
||||
uint16_t startingPRB,
|
||||
uint8_t nr_bit);
|
||||
|
||||
void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
uint16_t crnti,
|
||||
int32_t **txdataF,
|
||||
|
||||
@@ -121,8 +121,7 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot) {
|
||||
max_preamble_delay[0],
|
||||
gNB->prach_energy_counter);
|
||||
|
||||
if ((gNB->prach_energy_counter == 100) &&
|
||||
(max_preamble_energy[0] > gNB->measurements.prach_I0+gNB->prach_thres)) {
|
||||
if ((gNB->prach_energy_counter == 100) && (max_preamble_energy[0] > gNB->measurements.prach_I0+gNB->prach_thres)) {
|
||||
|
||||
LOG_I(PHY,"[gNB %d][RAPROC] Frame %d, slot %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d start symbol %u freq index %u\n",
|
||||
gNB->Mod_id,
|
||||
|
||||
@@ -259,7 +259,6 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
|
||||
|
||||
LOG_D(PHY, "ULSCH received ok \n");
|
||||
nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 0);
|
||||
//log_dump(PHY, ulsch_harq->b, 16, LOG_DUMP_CHAR,"gnb pusch rx frame %d %d: ", ulsch_harq->frame, ulsch_harq->slot);
|
||||
} else {
|
||||
LOG_D(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d) r %d\n",
|
||||
gNB->Mod_id, ulsch_harq->frame, ulsch_harq->slot,
|
||||
|
||||
@@ -274,7 +274,7 @@ int8_t nr_ue_phy_config_request(nr_phy_config_t *phy_config){
|
||||
if(phy_config != NULL) {
|
||||
memcpy(nrUE_config,&phy_config->config_req,sizeof(fapi_nr_config_request_t));
|
||||
if (PHY_vars_UE_g[phy_config->Mod_id][phy_config->CC_id]->UE_mode[0] == NOT_SYNCHED)
|
||||
PHY_vars_UE_g[phy_config->Mod_id][phy_config->CC_id]->UE_mode[0] = PRACH;
|
||||
PHY_vars_UE_g[phy_config->Mod_id][phy_config->CC_id]->UE_mode[0] = PRACH;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2062,7 +2062,6 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
nr_prach = nr_ue_get_rach(prach_resources, &ue->prach_vars[0]->prach_pdu, mod_id, ue->CC_id, frame_tx, gNB_id, nr_slot_tx);
|
||||
LOG_D(PHY, "In %s:[%d.%d] getting PRACH resources : %d\n", __FUNCTION__, frame_tx, nr_slot_tx,nr_prach);
|
||||
}
|
||||
|
||||
@@ -564,10 +564,8 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_
|
||||
|
||||
int N_CS = initial_pucch_resource[initial_pucch_id].nb_CS_indexes;
|
||||
/* see TS 38213 Table 9.2.1-1: PUCCH resource sets before dedicated PUCCH resource configuration */
|
||||
BWPsize = NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth,
|
||||
MAX_BWP_SIZE);
|
||||
BWPstart = NRRIV2PRBOFFSET(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth,
|
||||
MAX_BWP_SIZE);
|
||||
BWPsize = NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
BWPstart = NRRIV2PRBOFFSET(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
int RB_BWP_offset;
|
||||
if (initial_pucch_id == 15) {
|
||||
RB_BWP_offset =BWPsize/4;
|
||||
@@ -601,9 +599,8 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_
|
||||
else if ((pucch_resource_set != MAX_NB_OF_PUCCH_RESOURCE_SETS) && (pucch_resource_id != MAX_NB_OF_PUCCH_RESOURCES)) {
|
||||
/* check that current configuration is supported */
|
||||
if (mac->cg &&
|
||||
mac->cg->physicalCellGroupConfig &&
|
||||
(mac->cg->physicalCellGroupConfig->harq_ACK_SpatialBundlingPUCCH != NULL ||
|
||||
mac->cg->physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook != 1)) {
|
||||
mac->cg->physicalCellGroupConfig &&
|
||||
(mac->cg->physicalCellGroupConfig->harq_ACK_SpatialBundlingPUCCH != NULL || mac->cg->physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook != 1)) {
|
||||
LOG_E(PHY,"PUCCH Unsupported cell group configuration : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
|
||||
return(FALSE);
|
||||
}
|
||||
@@ -618,17 +615,17 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_
|
||||
}
|
||||
NR_PUCCH_Config_t *pucch_Config;
|
||||
if (bwp_id>0 &&
|
||||
mac->ULbwp[bwp_id-1] &&
|
||||
mac->ULbwp[bwp_id-1]->bwp_Dedicated &&
|
||||
mac->ULbwp[bwp_id-1] &&
|
||||
mac->ULbwp[bwp_id-1]->bwp_Dedicated &&
|
||||
mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config &&
|
||||
mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup)
|
||||
pucch_Config = mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup;
|
||||
else if (bwp_id==0 &&
|
||||
mac->cg &&
|
||||
mac->cg->spCellConfig &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP &&
|
||||
mac->cg &&
|
||||
mac->cg->spCellConfig &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup) {
|
||||
pucch_Config = mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup;
|
||||
@@ -683,9 +680,7 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_
|
||||
int O_CRC = 0;
|
||||
|
||||
nb_symbols = nb_symbols_total; /* by default, it can be reduced due to symbols reserved for dmrs */
|
||||
pucch_resource = format>1 ?
|
||||
mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList->list.array[pucch_resource_id]:
|
||||
0;
|
||||
pucch_resource = format>1 ? mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList->list.array[pucch_resource_id] : 0;
|
||||
|
||||
switch(format) {
|
||||
case pucch_format0_nr:
|
||||
@@ -864,13 +859,13 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_
|
||||
case pucch_format0_nr:
|
||||
{
|
||||
int pucch_GroupHopping = mac->ULbwp[bwp_id-1] ?
|
||||
mac->ULbwp[bwp_id-1]->bwp_Common->pucch_ConfigCommon->choice.setup->pucch_GroupHopping:
|
||||
mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pucch_ConfigCommon->choice.setup->pucch_GroupHopping;
|
||||
mac->ULbwp[bwp_id-1]->bwp_Common->pucch_ConfigCommon->choice.setup->pucch_GroupHopping:
|
||||
mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pucch_ConfigCommon->choice.setup->pucch_GroupHopping;
|
||||
int hoppingId = mac->ULbwp[bwp_id-1] ?
|
||||
mac->ULbwp[bwp_id-1]->bwp_Common->pucch_ConfigCommon->choice.setup->hoppingId[0]:
|
||||
(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pucch_ConfigCommon->choice.setup->hoppingId?
|
||||
mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pucch_ConfigCommon->choice.setup->hoppingId[0]:
|
||||
mac->physCellId);
|
||||
mac->ULbwp[bwp_id-1]->bwp_Common->pucch_ConfigCommon->choice.setup->hoppingId[0]:
|
||||
(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pucch_ConfigCommon->choice.setup->hoppingId?
|
||||
mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pucch_ConfigCommon->choice.setup->hoppingId[0]:
|
||||
mac->physCellId);
|
||||
nr_generate_pucch0(ue,ue->common_vars.txdataF,
|
||||
&ue->frame_parms,
|
||||
pucch_GroupHopping,
|
||||
@@ -1319,7 +1314,7 @@ boolean_t select_pucch_resource(PHY_VARS_NR_UE *ue, NR_UE_MAC_INST_t *mac, uint8
|
||||
current_resource_id = r_PUCCH;
|
||||
}
|
||||
else {
|
||||
current_resource_id = resourceSetToAddModList->list.array[pucch_resource_set_id]->resourceList.list.array[pucch_resource_indicator][0];
|
||||
current_resource_id = resourceSetToAddModList->list.array[pucch_resource_set_id]->resourceList.list.array[pucch_resource_indicator][0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user