Commit 16870b62 authored by rmagueta's avatar rmagueta

Merge remote-tracking branch 'origin/NR_SA_F1AP_5GRECORDS' into develop-NR_SA_F1AP_5GRECORDS

# Conflicts:
#	openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
parents a7d4ecb3 5f0e2e74
...@@ -1218,16 +1218,20 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, ...@@ -1218,16 +1218,20 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
rel15_ul); rel15_ul);
nr_gnb_measurements(gNB, ulsch_id, harq_pid, symbol); nr_gnb_measurements(gNB, ulsch_id, harq_pid, symbol);
int num_symb = rel15_ul->nr_of_symbols;
for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) { for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
gNB->pusch_vars[ulsch_id]->ulsch_power[aarx] = signal_energy_nodc(&gNB->pusch_vars[ulsch_id]->ul_ch_estimates[aarx][symbol*frame_parms->ofdm_symbol_size], if (symbol == rel15_ul->start_symbol_index) {
rel15_ul->rb_size*12); gNB->pusch_vars[ulsch_id]->ulsch_power[aarx]=0;
LOG_D(PHY,"ulsch_power[%d] symbol %d %f (%p)\n",aarx,symbol,dB_fixed_x10( gNB->pusch_vars[ulsch_id]->ulsch_power[aarx])/10.0, gNB->pusch_vars[ulsch_id]->ulsch_noise_power[aarx]=0;
&gNB->pusch_vars[ulsch_id]->ul_ch_estimates[aarx][symbol*frame_parms->ofdm_symbol_size]); }
gNB->pusch_vars[ulsch_id]->ulsch_power[aarx] += signal_energy_nodc(&gNB->pusch_vars[ulsch_id]->ul_ch_estimates[aarx][symbol*frame_parms->ofdm_symbol_size],
rel15_ul->rb_size*12)/num_symb;
if (gNB->pusch_vars[ulsch_id]->ulsch_power[aarx]==1) return (1); if (gNB->pusch_vars[ulsch_id]->ulsch_power[aarx]==1) return (1);
gNB->pusch_vars[ulsch_id]->ulsch_noise_power[aarx]=0; for (int rb=0;rb<rel15_ul->rb_size;rb++) {
for (int rb=0;rb<rel15_ul->rb_size;rb++) printf("aarx %d symbol %d, rb %d => %d\n",aarx,symbol,rb,dB_fixed(gNB->measurements.n0_subband_power[aarx][rel15_ul->bwp_start+rel15_ul->rb_start+rb]));
gNB->pusch_vars[ulsch_id]->ulsch_noise_power[aarx]+=gNB->measurements.n0_subband_power[aarx][rel15_ul->bwp_start+rel15_ul->rb_start+rb]/rel15_ul->rb_size; gNB->pusch_vars[ulsch_id]->ulsch_noise_power[aarx]+=gNB->measurements.n0_subband_power[aarx][rel15_ul->bwp_start+rel15_ul->rb_start+rb]/rel15_ul->rb_size/num_symb;
}
} }
} }
stop_meas(&gNB->ulsch_channel_estimation_stats); stop_meas(&gNB->ulsch_channel_estimation_stats);
......
...@@ -232,96 +232,6 @@ void nr_dlsch_unscrambling(int16_t* llr, ...@@ -232,96 +232,6 @@ void nr_dlsch_unscrambling(int16_t* llr,
} }
void dump_nrdlsch(PHY_VARS_NR_UE *ue,uint8_t gNB_id,uint8_t nr_slot_rx,unsigned int *coded_bits_per_codeword,int round, unsigned char harq_pid)
{
unsigned int nsymb = (ue->frame_parms.Ncp == 0) ? 14 : 12;
char fname[32],vname[32];
int N_RB_DL=ue->frame_parms.N_RB_DL;
snprintf(fname, 32, "dlsch%d_rxF_r%d_ext0.m", gNB_id, round);
snprintf(vname, 32, "dl%d_rxF_r%d_ext0", gNB_id, round);
write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->rxdataF_ext[0],12*N_RB_DL*nsymb,1,1);
if (ue->frame_parms.nb_antennas_rx >1) {
snprintf(fname, 32, "dlsch%d_rxF_r%d_ext1.m", gNB_id, round);
snprintf(vname, 32, "dl%d_rxF_r%d_ext1", gNB_id, round);
write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->rxdataF_ext[1],12*N_RB_DL*nsymb,1,1);
}
snprintf(fname, 32, "dlsch%d_ch_r%d_ext00.m", gNB_id, round);
snprintf(vname, 32, "dl%d_ch_r%d_ext00", gNB_id, round);
write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->dl_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
if (ue->transmission_mode[gNB_id]==7){
snprintf(fname, 32, "dlsch%d_bf_ch_r%d.m", gNB_id, round);
snprintf(vname, 32, "dl%d_bf_ch_r%d", gNB_id, round);
write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->dl_bf_ch_estimates[0],512*nsymb,1,1);
//write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[gNB_id]->dl_bf_ch_estimates[0],512,1,1);
snprintf(fname, 32, "dlsch%d_bf_ch_r%d_ext00.m", gNB_id, round);
snprintf(vname, 32, "dl%d_bf_ch_r%d_ext00", gNB_id, round);
write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->dl_bf_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
}
if (ue->frame_parms.nb_antennas_rx == 2) {
snprintf(fname, 32, "dlsch%d_ch_r%d_ext01.m", gNB_id, round);
snprintf(vname, 32, "dl%d_ch_r%d_ext01", gNB_id, round);
write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1);
}
if (ue->frame_parms.nb_antenna_ports_gNB == 2) {
snprintf(fname, 32, "dlsch%d_ch_r%d_ext10.m", gNB_id, round);
snprintf(vname, 32, "dl%d_ch_r%d_ext10", gNB_id, round);
write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1);
if (ue->frame_parms.nb_antennas_rx == 2) {
snprintf(fname, 32, "dlsch%d_ch_r%d_ext11.m",gNB_id,round);
snprintf(vname, 32, "dl%d_ch_r%d_ext11",gNB_id,round);
write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1);
}
}
snprintf(fname, 32, "dlsch%d_rxF_r%d_uespec0.m", gNB_id, round);
snprintf(vname, 32, "dl%d_rxF_r%d_uespec0", gNB_id, round);
write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->rxdataF_uespec_pilots[0],12*N_RB_DL,1,1);
/*
write_output("dlsch%d_ch_ext01.m","dl01_ch0_ext",pdsch_vars[gNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1);
write_output("dlsch%d_ch_ext10.m","dl10_ch0_ext",pdsch_vars[gNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1);
write_output("dlsch%d_ch_ext11.m","dl11_ch0_ext",pdsch_vars[gNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1);
*/
snprintf(fname, 32, "dlsch%d_r%d_rho.m", gNB_id, round);
snprintf(vname, 32, "dl_rho_r%d_%d", gNB_id, round);
write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->dl_ch_rho_ext[harq_pid][round][0],12*N_RB_DL*nsymb,1,1);
snprintf(fname, 32, "dlsch%d_r%d_rho2.m", gNB_id, round);
snprintf(vname, 32, "dl_rho2_r%d_%d", gNB_id, round);
write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->dl_ch_rho2_ext[0],12*N_RB_DL*nsymb,1,1);
snprintf(fname, 32, "dlsch%d_rxF_r%d_comp0.m", gNB_id, round);
snprintf(vname, 32, "dl%d_rxF_r%d_comp0", gNB_id, round);
write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb,1,1);
if (ue->frame_parms.nb_antenna_ports_gNB == 2) {
snprintf(fname, 32, "dlsch%d_rxF_r%d_comp1.m", gNB_id, round);
snprintf(vname, 32, "dl%d_rxF_r%d_comp1", gNB_id, round);
write_output(fname,vname,ue->pdsch_vars[0][gNB_id]->rxdataF_comp1[harq_pid][round][0],12*N_RB_DL*nsymb,1,1);
}
snprintf(fname, 32, "dlsch%d_rxF_r%d_llr.m", gNB_id, round);
snprintf(vname, 32, "dl%d_r%d_llr", gNB_id, round);
write_output(fname, vname, ue->pdsch_vars[0][gNB_id]->llr[0], coded_bits_per_codeword[0], 1, 0);
snprintf(fname, 32, "dlsch%d_r%d_mag1.m", gNB_id, round);
snprintf(vname, 32, "dl%d_r%d_mag1", gNB_id, round);
write_output(fname, vname, ue->pdsch_vars[0][gNB_id]->dl_ch_mag0[0], 12*N_RB_DL*nsymb, 1, 1);
snprintf(fname, 32, "dlsch%d_r%d_mag2.m", gNB_id, round);
snprintf(vname, 32, "dl%d_r%d_mag2", gNB_id, round);
write_output(fname, vname, ue->pdsch_vars[0][gNB_id]->dl_ch_magb0[0], 12*N_RB_DL*nsymb, 1, 1);
// printf("log2_maxh = %d\n",ue->pdsch_vars[gNB_id]->log2_maxh);
}
uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
int eNB_id, int eNB_id,
...@@ -679,8 +589,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -679,8 +589,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
else { else {
LOG_D(PHY,"CRC NOT OK\n\033[0m"); LOG_D(PHY,"CRC NOT OK\n\033[0m");
ret = 1 + dlsch->max_ldpc_iterations; ret = 1 + dlsch->max_ldpc_iterations;
//dump_nrdlsch(phy_vars_ue,0,nr_slot_rx,&E,0,0);
//exit(-1);
} }
......
...@@ -452,10 +452,18 @@ void pf_dl(module_id_t module_id, ...@@ -452,10 +452,18 @@ void pf_dl(module_id_t module_id,
if (UE_info->Msg4_ACKed[UE_id] != true) continue; if (UE_info->Msg4_ACKed[UE_id] != true) continue;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
int bwp_Id = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0; int bwp_Id = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0;
sched_ctrl->search_space = get_searchspace(scc,sched_ctrl->active_bwp, NR_BWP_DownlinkDedicated_t *bwp_Dedicated=NULL;
sched_ctrl->active_bwp ? if (sched_ctrl->active_bwp) bwp_Dedicated = sched_ctrl->active_bwp->bwp_Dedicated;
NR_SearchSpace__searchSpaceType_PR_ue_Specific: else if (UE_info->CellGroup[UE_id] &&
NR_SearchSpace__searchSpaceType_PR_common); UE_info->CellGroup[UE_id]->spCellConfig &&
UE_info->CellGroup[UE_id]->spCellConfig->spCellConfigDedicated)
bwp_Dedicated = UE_info->CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->initialDownlinkBWP;
sched_ctrl->search_space = get_searchspace(scc,bwp_Dedicated,
bwp_Dedicated ?
NR_SearchSpace__searchSpaceType_PR_ue_Specific:
NR_SearchSpace__searchSpaceType_PR_common);
sched_ctrl->coreset = get_coreset(scc,sched_ctrl->active_bwp, sched_ctrl->search_space, 1 /* dedicated */); sched_ctrl->coreset = get_coreset(scc,sched_ctrl->active_bwp, sched_ctrl->search_space, 1 /* dedicated */);
if (sched_ctrl->coreset == NULL) sched_ctrl->coreset = mac->sched_ctrlCommon->coreset; if (sched_ctrl->coreset == NULL) sched_ctrl->coreset = mac->sched_ctrlCommon->coreset;
/* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */ /* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */
......
...@@ -154,16 +154,15 @@ NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc, ...@@ -154,16 +154,15 @@ NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc,
} }
NR_SearchSpace_t *get_searchspace(NR_ServingCellConfigCommon_t *scc, NR_SearchSpace_t *get_searchspace(NR_ServingCellConfigCommon_t *scc,
NR_BWP_Downlink_t *bwp, NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
NR_SearchSpace__searchSpaceType_PR target_ss) { NR_SearchSpace__searchSpaceType_PR target_ss) {
const int n = bwp_Dedicated ?
const int n = bwp ? bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.count:
bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.count:
scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.count; scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.count;
for (int i=0;i<n;i++) { for (int i=0;i<n;i++) {
NR_SearchSpace_t *ss = bwp ? NR_SearchSpace_t *ss = bwp_Dedicated ?
bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.array[i]: bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.array[i]:
scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.array[i]; scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.array[i];
AssertFatal(ss->controlResourceSetId != NULL, "ss->controlResourceSetId is null\n"); AssertFatal(ss->controlResourceSetId != NULL, "ss->controlResourceSetId is null\n");
AssertFatal(ss->searchSpaceType != NULL, "ss->searchSpaceType is null\n"); AssertFatal(ss->searchSpaceType != NULL, "ss->searchSpaceType is null\n");
...@@ -171,7 +170,7 @@ NR_SearchSpace_t *get_searchspace(NR_ServingCellConfigCommon_t *scc, ...@@ -171,7 +170,7 @@ NR_SearchSpace_t *get_searchspace(NR_ServingCellConfigCommon_t *scc,
return ss; return ss;
} }
} }
AssertFatal(0, "Couldn't find an adequate searchspace\n"); AssertFatal(0, "Couldn't find an adequate searchspace bwp_Dedicated %p\n",bwp_Dedicated);
} }
int allocate_nr_CCEs(gNB_MAC_INST *nr_mac, int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
......
...@@ -697,8 +697,14 @@ void pf_ul(module_id_t module_id, ...@@ -697,8 +697,14 @@ void pf_ul(module_id_t module_id,
* every TTI if we can save it, so check whether dci_format, TDA, or * every TTI if we can save it, so check whether dci_format, TDA, or
* num_dmrs_cdm_grps_no_data has changed and only then recompute */ * num_dmrs_cdm_grps_no_data has changed and only then recompute */
sched_ctrl->sched_pusch.time_domain_allocation = tda; sched_ctrl->sched_pusch.time_domain_allocation = tda;
sched_ctrl->search_space = get_searchspace(scc,sched_ctrl->active_bwp, NR_BWP_DownlinkDedicated_t *bwp_Dedicated=NULL;
sched_ctrl->active_bwp ? if (sched_ctrl->active_bwp) bwp_Dedicated = sched_ctrl->active_bwp->bwp_Dedicated;
else if (UE_info->CellGroup[UE_id] &&
UE_info->CellGroup[UE_id]->spCellConfig &&
UE_info->CellGroup[UE_id]->spCellConfig->spCellConfigDedicated)
bwp_Dedicated = UE_info->CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->initialDownlinkBWP;
sched_ctrl->search_space = get_searchspace(scc,bwp_Dedicated,
bwp_Dedicated ?
NR_SearchSpace__searchSpaceType_PR_ue_Specific: NR_SearchSpace__searchSpaceType_PR_ue_Specific:
NR_SearchSpace__searchSpaceType_PR_common); NR_SearchSpace__searchSpaceType_PR_common);
sched_ctrl->coreset = get_coreset(scc,sched_ctrl->active_bwp, sched_ctrl->search_space, 1 /* dedicated */); sched_ctrl->coreset = get_coreset(scc,sched_ctrl->active_bwp, sched_ctrl->search_space, 1 /* dedicated */);
......
...@@ -271,8 +271,8 @@ NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc, ...@@ -271,8 +271,8 @@ NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc,
/* find a search space within a BWP */ /* find a search space within a BWP */
NR_SearchSpace_t *get_searchspace(NR_ServingCellConfigCommon_t *scc, NR_SearchSpace_t *get_searchspace(NR_ServingCellConfigCommon_t *scc,
NR_BWP_Downlink_t *bwp, NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
NR_SearchSpace__searchSpaceType_PR target_ss); NR_SearchSpace__searchSpaceType_PR target_ss);
long get_K2(NR_ServingCellConfigCommon_t *scc, NR_BWP_Uplink_t *ubwp, int time_domain_assignment, int mu); long get_K2(NR_ServingCellConfigCommon_t *scc, NR_BWP_Uplink_t *ubwp, int time_domain_assignment, int mu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment