Commit ea72306c authored by Sakthivel Velumani's avatar Sakthivel Velumani

Moved DLSCH PHY structure to stack

parent 4940146f
...@@ -646,7 +646,7 @@ void UE_processing(nr_rxtx_thread_data_t *rxtxD) { ...@@ -646,7 +646,7 @@ void UE_processing(nr_rxtx_thread_data_t *rxtxD) {
UE_nr_rxtx_proc_t *proc = &rxtxD->proc; UE_nr_rxtx_proc_t *proc = &rxtxD->proc;
PHY_VARS_NR_UE *UE = rxtxD->UE; PHY_VARS_NR_UE *UE = rxtxD->UE;
uint8_t gNB_id = 0; uint8_t gNB_id = 0;
NR_UE_PDCCH_CONFIG phy_pdcch_config={0}; nr_phy_data_t phy_data = {0};
if (IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa) { if (IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa) {
/* send tick to RLC and PDCP every ms */ /* send tick to RLC and PDCP every ms */
...@@ -662,7 +662,7 @@ void UE_processing(nr_rxtx_thread_data_t *rxtxD) { ...@@ -662,7 +662,7 @@ void UE_processing(nr_rxtx_thread_data_t *rxtxD) {
if(UE->if_inst != NULL && UE->if_inst->dl_indication != NULL) { if(UE->if_inst != NULL && UE->if_inst->dl_indication != NULL) {
nr_downlink_indication_t dl_indication; nr_downlink_indication_t dl_indication;
nr_fill_dl_indication(&dl_indication, NULL, NULL, proc, UE, gNB_id, &phy_pdcch_config); nr_fill_dl_indication(&dl_indication, NULL, NULL, proc, UE, gNB_id, &phy_data);
UE->if_inst->dl_indication(&dl_indication, NULL); UE->if_inst->dl_indication(&dl_indication, NULL);
} }
...@@ -671,7 +671,7 @@ void UE_processing(nr_rxtx_thread_data_t *rxtxD) { ...@@ -671,7 +671,7 @@ void UE_processing(nr_rxtx_thread_data_t *rxtxD) {
phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, no_relay, NULL ); phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, no_relay, NULL );
#else #else
uint64_t a=rdtsc_oai(); uint64_t a=rdtsc_oai();
phy_procedures_nrUE_RX(UE, proc, gNB_id, &phy_pdcch_config, &rxtxD->txFifo); phy_procedures_nrUE_RX(UE, proc, gNB_id, &phy_data, &rxtxD->txFifo);
LOG_D(PHY, "In %s: slot %d, time %llu\n", __FUNCTION__, proc->nr_slot_rx, (rdtsc_oai()-a)/3500); LOG_D(PHY, "In %s: slot %d, time %llu\n", __FUNCTION__, proc->nr_slot_rx, (rdtsc_oai()-a)/3500);
#endif #endif
...@@ -889,7 +889,7 @@ void *UE_thread(void *arg) { ...@@ -889,7 +889,7 @@ void *UE_thread(void *arg) {
continue; continue;
} }
if (start_rx_stream==0) { if (start_rx_stream == 0) {
start_rx_stream=1; start_rx_stream=1;
syncInFrame(UE, &timestamp); syncInFrame(UE, &timestamp);
UE->rx_offset=0; UE->rx_offset=0;
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "PHY/NR_REFSIG/nr_refsig.h" #include "PHY/NR_REFSIG/nr_refsig.h"
#include "PHY/MODULATION/nr_modulation.h" #include "PHY/MODULATION/nr_modulation.h"
#include "openair2/COMMON/prs_nr_paramdef.h" #include "openair2/COMMON/prs_nr_paramdef.h"
#include "SCHED_NR_UE/harq_nr.h"
extern uint16_t beta_cqi[16]; extern uint16_t beta_cqi[16];
...@@ -627,21 +628,74 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) ...@@ -627,21 +628,74 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
} }
} }
void free_nr_ue_dl_harq(NR_DL_UE_HARQ_t* harq_list, int number_of_processes, int num_rb) {
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS;
if (num_rb != 273) {
a_segments = a_segments*num_rb;
a_segments = (a_segments/273)+1;
}
for (int i=0; i<number_of_processes; i++) {
free_and_zero(harq_list[i].b);
for (int r=0; r<a_segments; r++) {
free_and_zero(harq_list[i].c[r]);
free_and_zero(harq_list[i].d[r]);
}
free_and_zero(harq_list[i].c);
free_and_zero(harq_list[i].d);
}
}
void term_nr_ue_transport(PHY_VARS_NR_UE *ue) void term_nr_ue_transport(PHY_VARS_NR_UE *ue)
{ {
const int N_RB_DL = ue->frame_parms.N_RB_DL; const int N_RB_DL = ue->frame_parms.N_RB_DL;
int num_cw = NR_MAX_NB_LAYERS > 4? 2:1;
for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) { for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) {
for (int j = 0; j < 2; j++) { for (int j = 0; j < num_cw; j++) {
free_nr_ue_dlsch(&ue->dlsch[i][j], N_RB_DL); free_nr_ue_dl_harq(ue->dl_harq_processes[j], NR_MAX_DLSCH_HARQ_PROCESSES, N_RB_DL);
if (j==0) free_nr_ue_ulsch(&ue->ulsch[i], N_RB_DL, &ue->frame_parms);
free_nr_ue_ulsch(&ue->ulsch[i], N_RB_DL, &ue->frame_parms);
} }
}
}
void nr_init_harq_processes(NR_DL_UE_HARQ_t* harq_list, int number_of_processes, int num_rb) {
free_nr_ue_dlsch(&ue->dlsch_SI[i], N_RB_DL); int a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS; //number of segments to be allocated
free_nr_ue_dlsch(&ue->dlsch_ra[i], N_RB_DL); if (num_rb != 273) {
a_segments = a_segments*num_rb;
a_segments = (a_segments/273)+1;
} }
free_nr_ue_dlsch(&ue->dlsch_MCH[0], N_RB_DL); uint32_t dlsch_bytes = a_segments*1056; // allocated bytes per segment
for (int i=0; i<number_of_processes; i++) {
memset(harq_list + i, 0, sizeof(NR_DL_UE_HARQ_t));
init_downlink_harq_status(harq_list + i);
harq_list[i].b = malloc16(dlsch_bytes);
if (harq_list[i].b)
memset(harq_list[i].b, 0, dlsch_bytes);
else
AssertFatal(true, "Unable to reset harq memory \"b\"\n");
harq_list[i].c = malloc16(a_segments*sizeof(uint8_t *));
harq_list[i].d = malloc16(a_segments*sizeof(int16_t *));
for (int r=0; r<a_segments; r++) {
harq_list[i].c[r] = malloc16(1056);
harq_list[i].d[r] = malloc16(5*8448*sizeof(int16_t));
if (harq_list[i].c[r])
memset(harq_list[i].c[r],0,1056);
else
AssertFatal(true, "Unable to reset harq memory \"c\"\n");
if (harq_list[i].d[r])
memset(harq_list[i].d[r],0,5*8448);
else
AssertFatal(true, "Unable to reset harq memory \"d\"\n");
}
}
} }
void init_nr_ue_transport(PHY_VARS_NR_UE *ue) { void init_nr_ue_transport(PHY_VARS_NR_UE *ue) {
...@@ -650,21 +704,14 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue) { ...@@ -650,21 +704,14 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue) {
for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) { for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) {
for (int j=0; j<num_codeword; j++) { for (int j=0; j<num_codeword; j++) {
AssertFatal((ue->dlsch[i][j] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,ue->max_ldpc_iterations,ue->frame_parms.N_RB_DL))!=NULL,"Can't get ue dlsch structures\n"); nr_init_harq_processes(ue->dl_harq_processes[j], NR_MAX_DLSCH_HARQ_PROCESSES, ue->frame_parms.N_RB_DL);
LOG_D(PHY,"dlsch[%d][%d] => %p\n",i,j,ue->dlsch[i][j]);
if (j==0) { if (j==0) {
AssertFatal((ue->ulsch[i] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES,&ue->frame_parms))!=NULL,"Can't get ue ulsch structures\n"); AssertFatal((ue->ulsch[i] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES,&ue->frame_parms))!=NULL,"Can't get ue ulsch structures\n");
LOG_D(PHY,"ulsch[%d] => %p\n",i,ue->ulsch[i]); LOG_D(PHY,"ulsch[%d] => %p\n",i,ue->ulsch[i]);
} }
} }
ue->dlsch_SI[i] = new_nr_ue_dlsch(1,1,NSOFT,ue->max_ldpc_iterations,ue->frame_parms.N_RB_DL);
ue->dlsch_ra[i] = new_nr_ue_dlsch(1,1,NSOFT,ue->max_ldpc_iterations,ue->frame_parms.N_RB_DL);
} }
//ue->frame_parms.pucch_config_common.deltaPUCCH_Shift = 1;
ue->dlsch_MCH[0] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS_MBSFN,ue->frame_parms.N_RB_DL);
for(int i=0; i<5; i++) for(int i=0; i<5; i++)
ue->dl_stats[i] = 0; ue->dl_stats[i] = 0;
} }
......
...@@ -418,6 +418,8 @@ void reset_DLSCH_struct(const PHY_VARS_gNB *gNB, processingData_L1tx_t *msg); ...@@ -418,6 +418,8 @@ void reset_DLSCH_struct(const PHY_VARS_gNB *gNB, processingData_L1tx_t *msg);
void RCconfig_nrUE_prs(void *cfg); void RCconfig_nrUE_prs(void *cfg);
void init_nr_prs_ue_vars(PHY_VARS_NR_UE *ue); void init_nr_prs_ue_vars(PHY_VARS_NR_UE *ue);
void nr_init_harq_processes(NR_DL_UE_HARQ_t* harq_list, int number_of_processes, int num_rb);
void free_nr_ue_dl_harq(NR_DL_UE_HARQ_t* harq_list, int number_of_processes, int num_rb);
/** @} */ /** @} */
#endif #endif
......
...@@ -2206,7 +2206,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, ...@@ -2206,7 +2206,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
unsigned char symbol, unsigned char symbol,
uint32_t nb_re_pdsch, uint32_t nb_re_pdsch,
uint16_t rnti, uint16_t rnti,
RX_type_t rx_type) NR_UE_DLSCH_t dlsch[2])
{ {
//#define DEBUG_DL_PTRS 1 //#define DEBUG_DL_PTRS 1
int32_t *ptrs_re_symbol = NULL; int32_t *ptrs_re_symbol = NULL;
...@@ -2225,30 +2225,30 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, ...@@ -2225,30 +2225,30 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
uint16_t *nb_rb = NULL; uint16_t *nb_rb = NULL;
if(dlsch0_harq->status == ACTIVE) { if(dlsch0_harq->status == ACTIVE) {
symbInSlot = dlsch0_harq->start_symbol + dlsch0_harq->nb_symbols; symbInSlot = dlsch[0].dlsch_config.start_symbol + dlsch[0].dlsch_config.number_symbols;
startSymbIndex = &dlsch0_harq->start_symbol; startSymbIndex = &dlsch[0].dlsch_config.start_symbol;
nbSymb = &dlsch0_harq->nb_symbols; nbSymb = &dlsch[0].dlsch_config.number_symbols;
L_ptrs = &dlsch0_harq->PTRSTimeDensity; L_ptrs = &dlsch[0].dlsch_config.PTRSTimeDensity;
K_ptrs = &dlsch0_harq->PTRSFreqDensity; K_ptrs = &dlsch[0].dlsch_config.PTRSFreqDensity;
dmrsSymbPos = &dlsch0_harq->dlDmrsSymbPos; dmrsSymbPos = &dlsch[0].dlsch_config.dlDmrsSymbPos;
ptrsSymbPos = &dlsch0_harq->ptrs_symbols; ptrsReOffset = &dlsch[0].dlsch_config.PTRSReOffset;
ptrsSymbIdx = &dlsch0_harq->ptrs_symbol_index; dmrsConfigType = &dlsch[0].dlsch_config.dmrsConfigType;
ptrsReOffset = &dlsch0_harq->PTRSReOffset; nb_rb = &dlsch[0].dlsch_config.number_rbs;
dmrsConfigType = &dlsch0_harq->dmrsConfigType; ptrsSymbPos = &dlsch[0].ptrs_symbols;
nb_rb = &dlsch0_harq->nb_rb; ptrsSymbIdx = &dlsch[0].ptrs_symbol_index;
} }
if(dlsch1_harq) { if(dlsch1_harq) {
symbInSlot = dlsch1_harq->start_symbol + dlsch0_harq->nb_symbols; symbInSlot = dlsch[1].dlsch_config.start_symbol + dlsch[1].dlsch_config.number_symbols;
startSymbIndex = &dlsch1_harq->start_symbol; startSymbIndex = &dlsch[1].dlsch_config.start_symbol;
nbSymb = &dlsch1_harq->nb_symbols; nbSymb = &dlsch[1].dlsch_config.number_symbols;
L_ptrs = &dlsch1_harq->PTRSTimeDensity; L_ptrs = &dlsch[1].dlsch_config.PTRSTimeDensity;
K_ptrs = &dlsch1_harq->PTRSFreqDensity; K_ptrs = &dlsch[1].dlsch_config.PTRSFreqDensity;
dmrsSymbPos = &dlsch1_harq->dlDmrsSymbPos; dmrsSymbPos = &dlsch[1].dlsch_config.dlDmrsSymbPos;
ptrsSymbPos = &dlsch1_harq->ptrs_symbols; ptrsReOffset = &dlsch[1].dlsch_config.PTRSReOffset;
ptrsSymbIdx = &dlsch1_harq->ptrs_symbol_index; dmrsConfigType = &dlsch[1].dlsch_config.dmrsConfigType;
ptrsReOffset = &dlsch1_harq->PTRSReOffset; nb_rb = &dlsch[1].dlsch_config.number_rbs;
dmrsConfigType = &dlsch1_harq->dmrsConfigType; ptrsSymbPos = &dlsch[1].ptrs_symbols;
nb_rb = &dlsch1_harq->nb_rb; ptrsSymbIdx = &dlsch[1].ptrs_symbol_index;
} }
/* loop over antennas */ /* loop over antennas */
for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
......
...@@ -107,7 +107,8 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms, ...@@ -107,7 +107,8 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
void nr_ue_measurements(PHY_VARS_NR_UE *ue, void nr_ue_measurements(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
uint8_t slot); uint8_t slot,
NR_UE_DLSCH_t *dlsch);
void nr_ue_ssb_rsrp_measurements(PHY_VARS_NR_UE *ue, void nr_ue_ssb_rsrp_measurements(PHY_VARS_NR_UE *ue,
uint8_t gNB_index, uint8_t gNB_index,
...@@ -134,7 +135,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, ...@@ -134,7 +135,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
unsigned char symbol, unsigned char symbol,
uint32_t nb_re_pdsch, uint32_t nb_re_pdsch,
uint16_t rnti, uint16_t rnti,
RX_type_t rx_type); NR_UE_DLSCH_t dlsch[2]);
float_t get_nr_RSRP(module_id_t Mod_id,uint8_t CC_id,uint8_t gNB_index); float_t get_nr_RSRP(module_id_t Mod_id,uint8_t CC_id,uint8_t gNB_index);
......
...@@ -112,14 +112,13 @@ float_t get_nr_RSRP(module_id_t Mod_id,uint8_t CC_id,uint8_t gNB_index) ...@@ -112,14 +112,13 @@ float_t get_nr_RSRP(module_id_t Mod_id,uint8_t CC_id,uint8_t gNB_index)
void nr_ue_measurements(PHY_VARS_NR_UE *ue, void nr_ue_measurements(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
uint8_t slot) uint8_t slot,
NR_UE_DLSCH_t *dlsch)
{ {
int aarx, aatx, gNB_id = 0; int aarx, aatx, gNB_id = 0;
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
int ch_offset = frame_parms->ofdm_symbol_size*2; int ch_offset = frame_parms->ofdm_symbol_size*2;
NR_UE_DLSCH_t *dlsch = ue->dlsch[gNB_id][0]; int N_RB_DL = dlsch->dlsch_config.number_rbs;
uint8_t harq_pid = dlsch->current_harq_pid;
int N_RB_DL = dlsch->harq_processes[harq_pid]->nb_rb;
ue->measurements.nb_antennas_rx = frame_parms->nb_antennas_rx; ue->measurements.nb_antennas_rx = frame_parms->nb_antennas_rx;
......
...@@ -863,8 +863,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, ...@@ -863,8 +863,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
int16_t *pdcch_e_rx, int16_t *pdcch_e_rx,
fapi_nr_dci_indication_t *dci_ind, fapi_nr_dci_indication_t *dci_ind,
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15) {
NR_UE_PDCCH_CONFIG *phy_pdcch_config) {
//int gNB_id = 0; //int gNB_id = 0;
int16_t tmp_e[16*108]; int16_t tmp_e[16*108];
...@@ -941,7 +940,6 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, ...@@ -941,7 +940,6 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
} }
e_rx_cand_idx += 9*L*6*2; //e_rx index for next candidate (L CCEs, 6 REGs per CCE and 9 REs per REG and 2 uint16_t per RE) e_rx_cand_idx += 9*L*6*2; //e_rx index for next candidate (L CCEs, 6 REGs per CCE and 9 REs per REG and 2 uint16_t per RE)
} }
phy_pdcch_config->nb_search_space = 0;
return(dci_ind->number_of_dcis); return(dci_ind->number_of_dcis);
} }
......
...@@ -57,107 +57,12 @@ notifiedFIFO_t freeBlocks_dl; ...@@ -57,107 +57,12 @@ notifiedFIFO_t freeBlocks_dl;
notifiedFIFO_elt_t *msgToPush_dl; notifiedFIFO_elt_t *msgToPush_dl;
int nbDlProcessing =0; int nbDlProcessing =0;
void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr, uint16_t N_RB_DL) { void nr_ue_dlsch_init(NR_UE_DLSCH_t *dlsch_list, int num_dlsch, uint8_t max_ldpc_iterations) {
for (int i=0; i < num_dlsch; i++) {
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS; NR_UE_DLSCH_t *dlsch = dlsch_list + i;
memset(dlsch, 0, sizeof(NR_UE_DLSCH_t));
NR_UE_DLSCH_t *dlsch=*dlschptr;
if (dlsch) {
if (N_RB_DL != 273) {
a_segments = a_segments*N_RB_DL;
a_segments = a_segments/273 +1;
}
for (int i=0; i<dlsch->Mdlharq; i++) {
if (dlsch->harq_processes[i]) {
if (dlsch->harq_processes[i]->b) {
free16(dlsch->harq_processes[i]->b,a_segments*1056);
dlsch->harq_processes[i]->b = NULL;
}
for (int r=0; r<a_segments; r++) {
free16(dlsch->harq_processes[i]->c[r],1056);
dlsch->harq_processes[i]->c[r] = NULL;
free16(dlsch->harq_processes[i]->d[r],5*8448);
dlsch->harq_processes[i]->d[r] = NULL;
}
free16(dlsch->harq_processes[i]->c,a_segments);
free16(dlsch->harq_processes[i]->d,a_segments);
free16(dlsch->harq_processes[i],sizeof(NR_DL_UE_HARQ_t));
dlsch->harq_processes[i] = NULL;
}
}
free16(dlsch,sizeof(NR_UE_DLSCH_t));
dlsch = NULL;
}
}
NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_ldpc_iterations,uint16_t N_RB_DL) {
NR_UE_DLSCH_t *dlsch;
uint8_t exit_flag = 0;
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS; //number of segments to be allocated
if (N_RB_DL != 273) {
a_segments = a_segments*N_RB_DL;
a_segments = (a_segments/273)+1;
}
uint32_t dlsch_bytes = a_segments*1056; // allocated bytes per segment
dlsch = (NR_UE_DLSCH_t *)malloc16(sizeof(NR_UE_DLSCH_t));
if (dlsch) {
memset(dlsch,0,sizeof(NR_UE_DLSCH_t));
dlsch->Kmimo = Kmimo;
dlsch->Mdlharq = Mdlharq;
dlsch->number_harq_processes_for_pdsch = Mdlharq;
dlsch->Nsoft = Nsoft;
dlsch->max_ldpc_iterations = max_ldpc_iterations; dlsch->max_ldpc_iterations = max_ldpc_iterations;
for (int i=0; i<Mdlharq; i++) {
dlsch->harq_processes[i] = (NR_DL_UE_HARQ_t *)malloc16(sizeof(NR_DL_UE_HARQ_t));
if (dlsch->harq_processes[i]) {
memset(dlsch->harq_processes[i],0,sizeof(NR_DL_UE_HARQ_t));
init_downlink_harq_status(dlsch->harq_processes[i]);
dlsch->harq_processes[i]->first_rx=1;
dlsch->harq_processes[i]->b = (uint8_t *)malloc16(dlsch_bytes);
if (dlsch->harq_processes[i]->b)
memset(dlsch->harq_processes[i]->b,0,dlsch_bytes);
else
exit_flag=3;
dlsch->harq_processes[i]->c = (uint8_t **)malloc16(a_segments*sizeof(uint8_t *));
dlsch->harq_processes[i]->d = (int16_t **)malloc16(a_segments*sizeof(int16_t *));
for (int r=0; r<a_segments; r++) {
dlsch->harq_processes[i]->c[r] = (uint8_t *)malloc16(1056);
dlsch->harq_processes[i]->d[r] = (int16_t *)malloc16(5*8448*sizeof(int16_t));
if (dlsch->harq_processes[i]->c[r])
memset(dlsch->harq_processes[i]->c[r],0,1056);
if (dlsch->harq_processes[i]->d[r])
memset(dlsch->harq_processes[i]->d[r],0,5*8448);
else
exit_flag=2;
}
} else {
exit_flag=1;
}
}
if (exit_flag==0)
return(dlsch);
} }
LOG_D(PHY,"new_ue_dlsch with size %zu: exit_flag = %u\n",sizeof(NR_DL_UE_HARQ_t), exit_flag);
free_nr_ue_dlsch(&dlsch,N_RB_DL);
return(NULL);
} }
void nr_dlsch_unscrambling(int16_t *llr, uint32_t size, uint8_t q, uint32_t Nid, uint32_t n_RNTI) void nr_dlsch_unscrambling(int16_t *llr, uint32_t size, uint8_t q, uint32_t Nid, uint32_t n_RNTI)
...@@ -300,7 +205,7 @@ void nr_processDLSegment(void* arg) { ...@@ -300,7 +205,7 @@ void nr_processDLSegment(void* arg) {
harq_process->d[r], harq_process->d[r],
w, w,
harq_process->C, harq_process->C,
harq_process->rvidx, dlsch->dlsch_config.rv,
harq_process->first_rx, harq_process->first_rx,
E, E,
harq_process->F, harq_process->F,
...@@ -400,8 +305,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -400,8 +305,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
uint32_t frame, uint32_t frame,
uint16_t nb_symb_sch, uint16_t nb_symb_sch,
uint8_t nr_slot_rx, uint8_t nr_slot_rx,
uint8_t harq_pid, uint8_t harq_pid) {
uint8_t is_crnti) {
uint32_t A,E; uint32_t A,E;
uint32_t G; uint32_t G;
uint32_t ret,offset; uint32_t ret,offset;
...@@ -416,20 +320,20 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -416,20 +320,20 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
// HARQ stats // HARQ stats
phy_vars_ue->dl_stats[harq_process->DLround]++; phy_vars_ue->dl_stats[harq_process->DLround]++;
LOG_D(PHY,"Round %d RV idx %d\n",harq_process->DLround,harq_process->rvidx); LOG_D(PHY,"Round %d RV idx %d\n",harq_process->DLround,dlsch->dlsch_config.rv);
uint8_t kc; uint8_t kc;
uint16_t nb_rb;// = 30; uint16_t nb_rb;// = 30;
uint8_t dmrs_Type = harq_process->dmrsConfigType; uint8_t dmrs_Type = dlsch->dlsch_config.dmrsConfigType;
AssertFatal(dmrs_Type == 0 || dmrs_Type == 1, "Illegal dmrs_type %d\n", dmrs_Type); AssertFatal(dmrs_Type == 0 || dmrs_Type == 1, "Illegal dmrs_type %d\n", dmrs_Type);
uint8_t nb_re_dmrs; uint8_t nb_re_dmrs;
if (dmrs_Type==NFAPI_NR_DMRS_TYPE1) { if (dmrs_Type==NFAPI_NR_DMRS_TYPE1) {
nb_re_dmrs = 6*harq_process->n_dmrs_cdm_groups; nb_re_dmrs = 6*dlsch->dlsch_config.n_dmrs_cdm_groups;
} else { } else {
nb_re_dmrs = 4*harq_process->n_dmrs_cdm_groups; nb_re_dmrs = 4*dlsch->dlsch_config.n_dmrs_cdm_groups;
} }
uint16_t dmrs_length = get_num_dmrs(harq_process->dlDmrsSymbPos); uint16_t dmrs_length = get_num_dmrs(dlsch->dlsch_config.dlDmrsSymbPos);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_SEGMENTATION, VCD_FUNCTION_IN); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_SEGMENTATION, VCD_FUNCTION_IN);
//NR_DL_UE_HARQ_t *harq_process = dlsch->harq_processes[0]; //NR_DL_UE_HARQ_t *harq_process = dlsch->harq_processes[0];
...@@ -466,18 +370,18 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -466,18 +370,18 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
return(max_ldpc_iterations + 1); return(max_ldpc_iterations + 1);
} }
*/ */
nb_rb = harq_process->nb_rb; nb_rb = dlsch->dlsch_config.number_rbs;
A = harq_process->TBS; A = dlsch->dlsch_config.TBS;
ret = dlsch->max_ldpc_iterations + 1; ret = dlsch->max_ldpc_iterations + 1;
dlsch->last_iteration_cnt = ret; dlsch->last_iteration_cnt = ret;
harq_process->G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, dmrs_length, harq_process->Qm,harq_process->Nl); harq_process->G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, dmrs_length, dlsch->dlsch_config.qamModOrder,dlsch->Nl);
G = harq_process->G; G = harq_process->G;
// target_code_rate is in 0.1 units // target_code_rate is in 0.1 units
float Coderate = (float) harq_process->R / 10240.0f; float Coderate = (float) dlsch->dlsch_config.targetCodeRate / 10240.0f;
LOG_D(PHY,"%d.%d DLSCH Decoding, harq_pid %d TBS %d (%d) G %d nb_re_dmrs %d length dmrs %d mcs %d Nl %d nb_symb_sch %d nb_rb %d Qm %d Coderate %f\n", LOG_D(PHY,"%d.%d DLSCH Decoding, harq_pid %d TBS %d (%d) G %d nb_re_dmrs %d length dmrs %d mcs %d Nl %d nb_symb_sch %d nb_rb %d Qm %d Coderate %f\n",
frame,nr_slot_rx,harq_pid,A,A/8,G, nb_re_dmrs, dmrs_length, harq_process->mcs, harq_process->Nl, nb_symb_sch, nb_rb, harq_process->Qm, Coderate); frame,nr_slot_rx,harq_pid,A,A/8,G, nb_re_dmrs, dmrs_length, dlsch->dlsch_config.mcs, dlsch->Nl, nb_symb_sch, nb_rb, dlsch->dlsch_config.qamModOrder, Coderate);
if ((A <=292) || ((A <= NR_MAX_PDSCH_TBS) && (Coderate <= 0.6667)) || Coderate <= 0.25) { if ((A <=292) || ((A <= NR_MAX_PDSCH_TBS) && (Coderate <= 0.6667)) || Coderate <= 0.25) {
p_decParams->BG = 2; p_decParams->BG = 2;
...@@ -503,13 +407,13 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -503,13 +407,13 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
&harq_process->F, &harq_process->F,
p_decParams->BG); p_decParams->BG);
if (harq_process->C>MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*harq_process->Nl) { if (harq_process->C>MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*dlsch->Nl) {
LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d\n",harq_process->C,harq_process->B); LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d\n",harq_process->C,harq_process->B);
return(-1); return(-1);
} }
if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD) && (!frame%100)) if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD) && (!frame%100))
LOG_I(PHY,"K %d C %d Z %d nl %d \n", harq_process->K, harq_process->C, harq_process->Z, harq_process->Nl); LOG_I(PHY,"K %d C %d Z %d nl %d \n", harq_process->K, harq_process->C, harq_process->Z, dlsch->Nl);
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_SEGMENTATION, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_SEGMENTATION, VCD_FUNCTION_OUT);
...@@ -519,7 +423,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -519,7 +423,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
p_decParams->numMaxIter = dlsch->max_ldpc_iterations; p_decParams->numMaxIter = dlsch->max_ldpc_iterations;
p_decParams->outMode= 0; p_decParams->outMode= 0;
r_offset = 0; r_offset = 0;
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*harq_process->Nl; //number of segments to be allocated uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*dlsch->Nl; //number of segments to be allocated
if (nb_rb != 273) { if (nb_rb != 273) {
a_segments = a_segments*nb_rb; a_segments = a_segments*nb_rb;
...@@ -542,7 +446,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -542,7 +446,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
initNotifiedFIFO(&nf); initNotifiedFIFO(&nf);
for (r=0; r<harq_process->C; r++) { for (r=0; r<harq_process->C; r++) {
//printf("start rx segment %d\n",r); //printf("start rx segment %d\n",r);
E = nr_get_E(G, harq_process->C, harq_process->Qm, harq_process->Nl, r); E = nr_get_E(G, harq_process->C, dlsch->dlsch_config.qamModOrder, dlsch->Nl, r);
union ldpcReqUnion id = {.s={dlsch->rnti,frame,nr_slot_rx,0,0}}; union ldpcReqUnion id = {.s={dlsch->rnti,frame,nr_slot_rx,0,0}};
notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(ldpcDecode_ue_t), id.p, &nf, nr_processDLSegment_ptr); notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(ldpcDecode_ue_t), id.p, &nf, nr_processDLSegment_ptr);
ldpcDecode_ue_t * rdata=(ldpcDecode_ue_t *) NotifiedFifoData(req); ldpcDecode_ue_t * rdata=(ldpcDecode_ue_t *) NotifiedFifoData(req);
...@@ -557,11 +461,11 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -557,11 +461,11 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
rdata->nbSegments = harq_process->C; rdata->nbSegments = harq_process->C;
rdata->E = E; rdata->E = E;
rdata->A = A; rdata->A = A;
rdata->Qm = harq_process->Qm; rdata->Qm = dlsch->dlsch_config.qamModOrder;
rdata->r_offset = r_offset; rdata->r_offset = r_offset;
rdata->Kr_bytes = Kr_bytes; rdata->Kr_bytes = Kr_bytes;
rdata->rv_index = harq_process->rvidx; rdata->rv_index = dlsch->dlsch_config.rv;
rdata->Tbslbrm = harq_process->tbslbrm; rdata->Tbslbrm = dlsch->dlsch_config.tbslbrm;
rdata->offset = offset; rdata->offset = offset;
rdata->dlsch = dlsch; rdata->dlsch = dlsch;
rdata->dlsch_id = 0; rdata->dlsch_id = 0;
......
...@@ -634,8 +634,7 @@ int nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms, ...@@ -634,8 +634,7 @@ int nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
uint8_t symbol, uint8_t symbol,
uint32_t len, uint32_t len,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
uint16_t nb_rb, uint16_t nb_rb)
uint8_t beamforming_mode)
{ {
c16_t *rxF = (c16_t *)&rxdataF_comp[((int32_t)symbol*nb_rb*12)]; c16_t *rxF = (c16_t *)&rxdataF_comp[((int32_t)symbol*nb_rb*12)];
...@@ -677,8 +676,7 @@ void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms, ...@@ -677,8 +676,7 @@ void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
uint8_t symbol, uint8_t symbol,
uint32_t len, uint32_t len,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
uint16_t nb_rb, uint16_t nb_rb)
uint8_t beamforming_mode)
{ {
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
...@@ -780,8 +778,7 @@ void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms, ...@@ -780,8 +778,7 @@ void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
uint8_t symbol, uint8_t symbol,
uint32_t len, uint32_t len,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
uint16_t nb_rb, uint16_t nb_rb)
uint8_t beamforming_mode)
{ {
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
__m128i *rxF = (__m128i*)&rxdataF_comp[(symbol*nb_rb*12)]; __m128i *rxF = (__m128i*)&rxdataF_comp[(symbol*nb_rb*12)];
...@@ -923,8 +920,7 @@ void nr_dlsch_256qam_llr(NR_DL_FRAME_PARMS *frame_parms, ...@@ -923,8 +920,7 @@ void nr_dlsch_256qam_llr(NR_DL_FRAME_PARMS *frame_parms,
uint8_t symbol, uint8_t symbol,
uint32_t len, uint32_t len,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
uint16_t nb_rb, uint16_t nb_rb)
uint8_t beamforming_mode)
{ {
__m128i *rxF = (__m128i*)&rxdataF_comp[(symbol*nb_rb*12)]; __m128i *rxF = (__m128i*)&rxdataF_comp[(symbol*nb_rb*12)];
__m128i *ch_mag,*ch_magb,*ch_magr; __m128i *ch_mag,*ch_magb,*ch_magr;
......
...@@ -101,7 +101,7 @@ void free_list(NR_UE_SSB *node) { ...@@ -101,7 +101,7 @@ void free_list(NR_UE_SSB *node) {
} }
int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_initial_symbol, NR_UE_PDCCH_CONFIG *phy_pdcch_config) int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_initial_symbol, nr_phy_data_t *phy_data)
{ {
NR_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; NR_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
int ret =-1; int ret =-1;
...@@ -165,7 +165,7 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini ...@@ -165,7 +165,7 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini
0, 0,
temp_ptr->i_ssb, temp_ptr->i_ssb,
SISO, SISO,
phy_pdcch_config, phy_data,
&result); &result);
temp_ptr=temp_ptr->next_ssb; temp_ptr=temp_ptr->next_ssb;
...@@ -216,7 +216,8 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, ...@@ -216,7 +216,8 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
int ret=-1; int ret=-1;
int rx_power=0; //aarx, int rx_power=0; //aarx,
NR_UE_PDCCH_CONFIG phy_pdcch_config={0}; nr_phy_data_t phy_data = {0};
NR_UE_PDCCH_CONFIG *phy_pdcch_config = &phy_data.phy_pdcch_config;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INITIAL_UE_SYNC, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INITIAL_UE_SYNC, VCD_FUNCTION_IN);
...@@ -336,7 +337,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, ...@@ -336,7 +337,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
if (ret==0) { //we got sss channel if (ret==0) { //we got sss channel
nr_gold_pbch(ue); nr_gold_pbch(ue);
ret = nr_pbch_detection(proc, ue, 1, &phy_pdcch_config); // start pbch detection at first symbol after pss ret = nr_pbch_detection(proc, ue, 1, &phy_data); // start pbch detection at first symbol after pss
} }
if (ret == 0) { if (ret == 0) {
...@@ -518,6 +519,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, ...@@ -518,6 +519,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
// if stand alone and sync on ssb do sib1 detection as part of initial sync // if stand alone and sync on ssb do sib1 detection as part of initial sync
if (sa==1 && ret==0) { if (sa==1 && ret==0) {
nr_ue_dlsch_init(phy_data.dlsch, 1, ue->max_ldpc_iterations);
bool dec = false; bool dec = false;
int gnb_id = 0; //FIXME int gnb_id = 0; //FIXME
...@@ -525,65 +527,59 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, ...@@ -525,65 +527,59 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
int32_t pdcch_est_size = ((((fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH))+15)/16)*16); int32_t pdcch_est_size = ((((fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH))+15)/16)*16);
__attribute__ ((aligned(16))) int32_t pdcch_dl_ch_estimates[4*fp->nb_antennas_rx][pdcch_est_size]; __attribute__ ((aligned(16))) int32_t pdcch_dl_ch_estimates[4*fp->nb_antennas_rx][pdcch_est_size];
for(int n_ss = 0; n_ss<phy_pdcch_config.nb_search_space; n_ss++) { for(int n_ss = 0; n_ss<phy_pdcch_config->nb_search_space; n_ss++) {
proc->nr_slot_rx = phy_pdcch_config.slot; // setting PDCCH slot to proc proc->nr_slot_rx = phy_pdcch_config->slot; // setting PDCCH slot to proc
uint8_t nb_symb_pdcch = phy_pdcch_config.pdcch_config[n_ss].coreset.duration; uint8_t nb_symb_pdcch = phy_pdcch_config->pdcch_config[n_ss].coreset.duration;
int start_symb = phy_pdcch_config.pdcch_config[n_ss].coreset.StartSymbolIndex; int start_symb = phy_pdcch_config->pdcch_config[n_ss].coreset.StartSymbolIndex;
for (uint16_t l=start_symb; l<start_symb+nb_symb_pdcch; l++) { for (uint16_t l=start_symb; l<start_symb+nb_symb_pdcch; l++) {
nr_slot_fep_init_sync(ue, nr_slot_fep_init_sync(ue,
proc, proc,
l, // the UE PHY has no notion of the symbols to be monitored in the search space l, // the UE PHY has no notion of the symbols to be monitored in the search space
phy_pdcch_config.slot, phy_pdcch_config->slot,
is*fp->samples_per_frame+phy_pdcch_config.sfn*fp->samples_per_frame+ue->rx_offset, is*fp->samples_per_frame+phy_pdcch_config->sfn*fp->samples_per_frame+ue->rx_offset,
true); true);
nr_pdcch_channel_estimation(ue, nr_pdcch_channel_estimation(ue,
proc, proc,
0, 0,
phy_pdcch_config.slot, phy_pdcch_config->slot,
l, l,
&phy_pdcch_config.pdcch_config[n_ss].coreset, &phy_pdcch_config->pdcch_config[n_ss].coreset,
fp->first_carrier_offset, fp->first_carrier_offset,
phy_pdcch_config.pdcch_config[n_ss].BWPStart, phy_pdcch_config->pdcch_config[n_ss].BWPStart,
pdcch_est_size, pdcch_est_size,
pdcch_dl_ch_estimates); pdcch_dl_ch_estimates);
} }
int dci_cnt = nr_ue_pdcch_procedures(gnb_id, ue, proc, pdcch_est_size, pdcch_dl_ch_estimates, &phy_pdcch_config, n_ss); int dci_cnt = nr_ue_pdcch_procedures(gnb_id, ue, proc, pdcch_est_size, pdcch_dl_ch_estimates, &phy_data, n_ss);
if (dci_cnt>0){ if (dci_cnt>0){
NR_UE_DLSCH_t *dlsch = ue->dlsch_SI[gnb_id]; NR_UE_DLSCH_t *dlsch = phy_data.dlsch;
if (dlsch && (dlsch->active == 1)) { if (dlsch[0].active == 1) {
uint8_t harq_pid = dlsch->current_harq_pid; uint16_t nb_symb_sch = dlsch->dlsch_config.number_symbols;
NR_DL_UE_HARQ_t *dlsch0_harq = dlsch->harq_processes[harq_pid]; uint16_t start_symb_sch = dlsch->dlsch_config.start_symbol;
uint16_t nb_symb_sch = dlsch0_harq->nb_symbols;
uint16_t start_symb_sch = dlsch0_harq->start_symbol;
for (uint16_t m=start_symb_sch;m<(nb_symb_sch+start_symb_sch) ; m++){ for (uint16_t m=start_symb_sch;m<(nb_symb_sch+start_symb_sch) ; m++){
nr_slot_fep_init_sync(ue, nr_slot_fep_init_sync(ue,
proc, proc,
m, m,
phy_pdcch_config.slot, // same slot and offset as pdcch phy_pdcch_config->slot, // same slot and offset as pdcch
is*fp->samples_per_frame+phy_pdcch_config.sfn*fp->samples_per_frame+ue->rx_offset, is*fp->samples_per_frame+phy_pdcch_config->sfn*fp->samples_per_frame+ue->rx_offset,
true); true);
} }
int ret = nr_ue_pdsch_procedures(ue, int ret = nr_ue_pdsch_procedures(ue,
proc, proc,
gnb_id, gnb_id,
SI_PDSCH, dlsch);
ue->dlsch_SI[gnb_id],
NULL);
if (ret >= 0) if (ret >= 0)
dec = nr_ue_dlsch_procedures(ue, dec = nr_ue_dlsch_procedures(ue,
proc, proc,
gnb_id, gnb_id,
SI_PDSCH, dlsch,
ue->dlsch_SI[gnb_id], NULL);
NULL,
&ue->dlsch_SI_errors[gnb_id]);
// deactivate dlsch once dlsch proc is done // deactivate dlsch once dlsch proc is done
ue->dlsch_SI[gnb_id]->active = 0; dlsch->active = 0;
} }
} }
} }
......
...@@ -391,7 +391,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, ...@@ -391,7 +391,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
uint8_t gNB_id, uint8_t gNB_id,
uint8_t i_ssb, uint8_t i_ssb,
MIMO_mode_t mimo_mode, MIMO_mode_t mimo_mode,
NR_UE_PDCCH_CONFIG *phy_pdcch_config, nr_phy_data_t *phy_data,
fapiPbch_t *result) { fapiPbch_t *result) {
NR_UE_COMMON *nr_ue_common_vars = &ue->common_vars; NR_UE_COMMON *nr_ue_common_vars = &ue->common_vars;
...@@ -580,7 +580,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, ...@@ -580,7 +580,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
fapi_nr_rx_indication_t *rx_ind=calloc(sizeof(*rx_ind),1); fapi_nr_rx_indication_t *rx_ind=calloc(sizeof(*rx_ind),1);
uint16_t number_pdus = 1; uint16_t number_pdus = 1;
nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id, phy_pdcch_config); nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id, phy_data);
nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc,(void *)result); nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc,(void *)result);
if (ue->if_inst && ue->if_inst->dl_indication) if (ue->if_inst && ue->if_inst->dl_indication)
......
...@@ -47,22 +47,10 @@ ...@@ -47,22 +47,10 @@
* @{ * @{
*/ */
/** \fn free_ue_dlsch(NR_UE_DLSCH_t *dlsch)
\brief This function frees memory allocated for a particular DLSCH at UE
@param dlsch Pointer to DLSCH to be removed
*/
void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlsch, uint16_t N_RB_DL);
/** \fn new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft) /** \brief This function initialises structures for DLSCH at UE
\brief This function allocates structures for a particular DLSCH at UE
@returns Pointer to DLSCH to be removed
@param Kmimo Kmimo factor from 36-212/36-213
@param Mdlharq Maximum number of HARQ rounds (36-212/36-213)
@param Nsoft Soft-LLR buffer size from UE-Category
@params N_RB_DL total number of resource blocks (determine the operating BW)
*/ */
NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint16_t N_RB_DL); void nr_ue_dlsch_init(NR_UE_DLSCH_t *dlsch_list, int num_dlsch, uint8_t max_ldpc_iterations);
void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr, void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr,
uint16_t N_RB_UL, uint16_t N_RB_UL,
...@@ -478,8 +466,7 @@ int32_t nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms, ...@@ -478,8 +466,7 @@ int32_t nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
uint8_t symbol, uint8_t symbol,
uint32_t len, uint32_t len,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
uint16_t nb_rb, uint16_t nb_rb);
uint8_t beamforming_mode);
/** /**
\brief This function generates log-likelihood ratios (decoder input) for single-stream 16QAM received waveforms \brief This function generates log-likelihood ratios (decoder input) for single-stream 16QAM received waveforms
...@@ -502,8 +489,7 @@ void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms, ...@@ -502,8 +489,7 @@ void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
uint8_t symbol, uint8_t symbol,
uint32_t len, uint32_t len,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
uint16_t nb_rb, uint16_t nb_rb);
uint8_t beamforming_mode);
/** /**
\brief This function generates log-likelihood ratios (decoder input) for single-stream 16QAM received waveforms \brief This function generates log-likelihood ratios (decoder input) for single-stream 16QAM received waveforms
@param frame_parms Frame descriptor structure @param frame_parms Frame descriptor structure
...@@ -526,8 +512,7 @@ void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms, ...@@ -526,8 +512,7 @@ void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
uint8_t symbol, uint8_t symbol,
uint32_t len, uint32_t len,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
uint16_t nb_rb, uint16_t nb_rb);
uint8_t beamforming_mode);
void nr_dlsch_256qam_llr(NR_DL_FRAME_PARMS *frame_parms, void nr_dlsch_256qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int32_t *rxdataF_comp, int32_t *rxdataF_comp,
...@@ -538,8 +523,7 @@ void nr_dlsch_256qam_llr(NR_DL_FRAME_PARMS *frame_parms, ...@@ -538,8 +523,7 @@ void nr_dlsch_256qam_llr(NR_DL_FRAME_PARMS *frame_parms,
uint8_t symbol, uint8_t symbol,
uint32_t len, uint32_t len,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
uint16_t nb_rb, uint16_t nb_rb);
uint8_t beamforming_mode);
/** \fn dlsch_extract_rbs(int32_t **rxdataF, /** \fn dlsch_extract_rbs(int32_t **rxdataF,
...@@ -683,7 +667,6 @@ void nr_dlsch_scale_channel(int32_t **dl_ch_estimates_ext, ...@@ -683,7 +667,6 @@ void nr_dlsch_scale_channel(int32_t **dl_ch_estimates_ext,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
uint8_t n_tx, uint8_t n_tx,
uint8_t n_rx, uint8_t n_rx,
NR_UE_DLSCH_t **dlsch_ue,
uint8_t symbol, uint8_t symbol,
uint8_t start_symbol, uint8_t start_symbol,
uint32_t len, uint32_t len,
...@@ -718,8 +701,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -718,8 +701,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
uint32_t frame, uint32_t frame,
uint16_t nb_symb_sch, uint16_t nb_symb_sch,
uint8_t nr_slot_rx, uint8_t nr_slot_rx,
uint8_t harq_pid, uint8_t harq_pid);
uint8_t is_crnti);
int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
NR_UE_ULSCH_t *ulsch, NR_UE_ULSCH_t *ulsch,
...@@ -800,13 +782,13 @@ int nr_rx_pbch(PHY_VARS_NR_UE *ue, ...@@ -800,13 +782,13 @@ int nr_rx_pbch(PHY_VARS_NR_UE *ue,
uint8_t eNB_id, uint8_t eNB_id,
uint8_t i_ssb, uint8_t i_ssb,
MIMO_mode_t mimo_mode, MIMO_mode_t mimo_mode,
NR_UE_PDCCH_CONFIG *phy_pdcch_config, nr_phy_data_t *phy_data,
fapiPbch_t* result); fapiPbch_t* result);
int nr_pbch_detection(UE_nr_rxtx_proc_t *proc, int nr_pbch_detection(UE_nr_rxtx_proc_t *proc,
PHY_VARS_NR_UE *ue, PHY_VARS_NR_UE *ue,
int pbch_initial_symbol, int pbch_initial_symbol,
NR_UE_PDCCH_CONFIG *phy_pdcch_config); nr_phy_data_t *phy_data);
#ifndef modOrder #ifndef modOrder
...@@ -865,8 +847,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, ...@@ -865,8 +847,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
int16_t *pdcch_e_rx, int16_t *pdcch_e_rx,
fapi_nr_dci_indication_t *dci_ind, fapi_nr_dci_indication_t *dci_ind,
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15);
NR_UE_PDCCH_CONFIG *phy_pdcch_config);
/** \brief This function is the top-level entry point to PDSCH demodulation, after frequency-domain transformation and channel estimation. It performs /** \brief This function is the top-level entry point to PDSCH demodulation, after frequency-domain transformation and channel estimation. It performs
...@@ -884,21 +865,17 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, ...@@ -884,21 +865,17 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
@param nr_slot_rx Slot number @param nr_slot_rx Slot number
@param symbol Symbol on which to act (within sub-frame) @param symbol Symbol on which to act (within sub-frame)
@param first_symbol_flag set to 1 on first DLSCH symbol @param first_symbol_flag set to 1 on first DLSCH symbol
@param rx_type. rx_type=RX_IC_single_stream will enable interference cancellation of a second stream when decoding the first stream. In case of TM1, 2, 5, and this can cancel interference from a neighbouring cell given by eNB_id_i. In case of TM5, eNB_id_i should be set to n_connected_eNB to perform multi-user interference cancellation. In case of TM3, eNB_id_i should be set to eNB_id to perform co-channel interference cancellation; this option should be used together with an interference cancellation step [...]. In case of TM3, if rx_type=RX_IC_dual_stream, both streams will be decoded by applying the IC single stream receiver twice.
@param i_mod Modulation order of the interfering stream
*/ */
int nr_rx_pdsch(PHY_VARS_NR_UE *ue, int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
PDSCH_t type, NR_UE_DLSCH_t *dlsch,
unsigned char eNB_id, unsigned char gNB_id,
unsigned char eNB_id_i, //if this == ue->n_connected_eNB, we assume MU interference unsigned char gNB_id_i, //if this == ue->n_connected_eNB, we assume MU interference
uint32_t frame, uint32_t frame,
uint8_t nr_slot_rx, uint8_t nr_slot_rx,
unsigned char symbol, unsigned char symbol,
unsigned char first_symbol_flag, unsigned char first_symbol_flag,
RX_type_t rx_type, unsigned char harq_pid);
unsigned char i_mod,
unsigned char harq_pid);
int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int frame, uint8_t slot); int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int frame, uint8_t slot);
......
...@@ -183,16 +183,6 @@ typedef struct { ...@@ -183,16 +183,6 @@ typedef struct {
int16_t **d; int16_t **d;
/// Index of current HARQ round for this DLSCH /// Index of current HARQ round for this DLSCH
uint8_t DLround; uint8_t DLround;
/// MCS table for this DLSCH
uint8_t mcs_table;
/// MCS format for this DLSCH
uint8_t mcs;
/// Qm (modulation order) for this DLSCH
uint8_t Qm;
/// target code rate R x 1024
uint16_t R;
/// Redundancy-version of the current sub-frame
uint8_t rvidx;
/// MIMO mode for this DLSCH /// MIMO mode for this DLSCH
MIMO_nrmode_t mimo_mode; MIMO_nrmode_t mimo_mode;
/// Number of code segments /// Number of code segments
...@@ -203,32 +193,10 @@ typedef struct { ...@@ -203,32 +193,10 @@ typedef struct {
uint32_t F; uint32_t F;
/// LDPC lifting factor /// LDPC lifting factor
uint32_t Z; uint32_t Z;
/// Number of MIMO layers (streams)
uint8_t Nl;
/// current delta_pucch /// current delta_pucch
int8_t delta_PUCCH; int8_t delta_PUCCH;
/// Number of soft channel bits /// Number of soft channel bits
uint32_t G; uint32_t G;
/// Start PRB of BWP
uint16_t BWPStart;
/// Number of PRBs in BWP
uint16_t BWPSize;
/// Current Number of RBs
uint16_t nb_rb;
/// Starting RB number
uint16_t start_rb;
/// Number of Symbols
uint16_t nb_symbols;
/// DMRS symbol positions
uint16_t dlDmrsSymbPos;
/// DMRS Configuration Type
uint8_t dmrsConfigType;
// Number of DMRS CDM groups with no data
uint8_t n_dmrs_cdm_groups;
/// DMRS ports bitmap
uint16_t dmrs_ports;
/// Starting Symbol number
uint16_t start_symbol;
/// Current subband PMI allocation /// Current subband PMI allocation
uint16_t pmi_alloc; uint16_t pmi_alloc;
/// Current RB allocation (even slots) /// Current RB allocation (even slots)
...@@ -243,22 +211,6 @@ typedef struct { ...@@ -243,22 +211,6 @@ typedef struct {
uint8_t codeword; uint8_t codeword;
/// HARQ-ACKs /// HARQ-ACKs
uint8_t ack; uint8_t ack;
/// PTRS Frequency Density
uint8_t PTRSFreqDensity;
/// PTRS Time Density
uint8_t PTRSTimeDensity;
uint8_t PTRSPortIndex ;
uint8_t nEpreRatioOfPDSCHToPTRS;
uint8_t PTRSReOffset;
/// bit mask of PT-RS ofdm symbol indicies
uint16_t ptrs_symbols;
// PTRS symbol index, to be updated every PTRS symbol within a slot.
uint8_t ptrs_symbol_index;
uint32_t tbslbrm;
uint8_t nscid;
uint16_t dlDmrsScramblingId;
/// PDU BITMAP
uint16_t pduBitmap;
/// Last index of LLR buffer that contains information. /// Last index of LLR buffer that contains information.
/// Used for computing LDPC decoder R /// Used for computing LDPC decoder R
int llrLen; int llrLen;
...@@ -270,17 +222,13 @@ typedef struct { ...@@ -270,17 +222,13 @@ typedef struct {
/// RNTI type /// RNTI type
uint8_t rnti_type; uint8_t rnti_type;
/// Active flag for DLSCH demodulation /// Active flag for DLSCH demodulation
uint8_t active; bool active;
/// accumulated tx power adjustment for PUCCH
int8_t g_pucch;
/// Transmission mode /// Transmission mode
uint8_t mode1_flag; uint8_t mode1_flag;
/// amplitude of PDSCH (compared to RS) in symbols without pilots /// amplitude of PDSCH (compared to RS) in symbols without pilots
int16_t sqrt_rho_a; int16_t sqrt_rho_a;
/// amplitude of PDSCH (compared to RS) in symbols containing pilots /// amplitude of PDSCH (compared to RS) in symbols containing pilots
int16_t sqrt_rho_b; int16_t sqrt_rho_b;
/// Current HARQ process id threadRx Odd and threadRx Even
uint8_t current_harq_pid;
/// Current subband antenna selection /// Current subband antenna selection
uint32_t antenna_alloc; uint32_t antenna_alloc;
/// Current subband RI allocation /// Current subband RI allocation
...@@ -291,24 +239,22 @@ typedef struct { ...@@ -291,24 +239,22 @@ typedef struct {
uint32_t cqi_alloc2; uint32_t cqi_alloc2;
/// saved subband PMI allocation from last PUSCH/PUCCH report /// saved subband PMI allocation from last PUSCH/PUCCH report
uint16_t pmi_alloc; uint16_t pmi_alloc;
/// Pointers to up to HARQ processes /// Structure to hold dlsch config from MAC
NR_DL_UE_HARQ_t *harq_processes[NR_MAX_DLSCH_HARQ_PROCESSES]; fapi_nr_dl_config_dlsch_pdu_rel15_t dlsch_config;
// DL number of harq processes
uint8_t number_harq_processes_for_pdsch;
/* higher layer parameter for reception of two transport blocks TS 38.213 9.1.3.1 Type-2 HARQ-ACK codebook dtermination */ /* higher layer parameter for reception of two transport blocks TS 38.213 9.1.3.1 Type-2 HARQ-ACK codebook dtermination */
uint8_t Number_MCS_HARQ_DL_DCI; uint8_t Number_MCS_HARQ_DL_DCI;
/* spatial bundling of PUCCH */ /* spatial bundling of PUCCH */
uint8_t HARQ_ACK_spatial_bundling_PUCCH; uint8_t HARQ_ACK_spatial_bundling_PUCCH;
/// Maximum number of HARQ processes(for definition see 36-212 V8.6 2009-03, p.17 /// Number of MIMO layers (streams)
uint8_t Mdlharq; uint8_t Nl;
/// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
uint8_t Kmimo;
/// Nsoft parameter related to UE Category
uint32_t Nsoft;
/// Maximum number of LDPC iterations /// Maximum number of LDPC iterations
uint8_t max_ldpc_iterations; uint8_t max_ldpc_iterations;
/// number of iterations used in last turbo decoding /// number of iterations used in last turbo decoding
uint8_t last_iteration_cnt; uint8_t last_iteration_cnt;
/// bit mask of PT-RS ofdm symbol indicies
uint16_t ptrs_symbols;
// PTRS symbol index, to be updated every PTRS symbol within a slot.
uint8_t ptrs_symbol_index;
} NR_UE_DLSCH_t; } NR_UE_DLSCH_t;
typedef enum {format0_0, typedef enum {format0_0,
......
...@@ -538,14 +538,10 @@ typedef struct { ...@@ -538,14 +538,10 @@ typedef struct {
NR_UE_CSI_IM *csiim_vars[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_CSI_IM *csiim_vars[NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_CSI_RS *csirs_vars[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_CSI_RS *csirs_vars[NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_SRS *srs_vars[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_SRS *srs_vars[NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_DLSCH_t *dlsch[NUMBER_OF_CONNECTED_gNB_MAX][NR_MAX_NB_LAYERS>4 ? 2:1];
NR_UE_ULSCH_t *ulsch[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_ULSCH_t *ulsch[NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_DLSCH_t *dlsch_SI[NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_DLSCH_t *dlsch_ra[NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_DLSCH_t *dlsch_p[NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_DLSCH_t *dlsch_MCH[NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_PRS *prs_vars[NR_MAX_PRS_COMB_SIZE]; NR_UE_PRS *prs_vars[NR_MAX_PRS_COMB_SIZE];
uint8_t prs_active_gNBs; uint8_t prs_active_gNBs;
NR_DL_UE_HARQ_t dl_harq_processes[NR_MAX_NB_LAYERS>4 ? 2:1][NR_MAX_DLSCH_HARQ_PROCESSES];
//Paging parameters //Paging parameters
uint32_t IMSImod1024; uint32_t IMSImod1024;
...@@ -760,6 +756,8 @@ typedef struct { ...@@ -760,6 +756,8 @@ typedef struct {
typedef struct nr_phy_data_s { typedef struct nr_phy_data_s {
NR_UE_PUCCH pucch_vars; NR_UE_PUCCH pucch_vars;
NR_UE_PDCCH_CONFIG phy_pdcch_config;
NR_UE_DLSCH_t dlsch[NR_MAX_NB_LAYERS>4 ? 2:1];
} nr_phy_data_t; } nr_phy_data_t;
/* this structure is used to pass both UE phy vars and /* this structure is used to pass both UE phy vars and
* proc to the function UE_thread_rxn_txnp4 * proc to the function UE_thread_rxn_txnp4
......
...@@ -96,7 +96,7 @@ typedef struct { ...@@ -96,7 +96,7 @@ typedef struct {
@param proc Pointer to RXn-TXnp4 proc information @param proc Pointer to RXn-TXnp4 proc information
@param eNB_id Local id of eNB on which to act @param eNB_id Local id of eNB on which to act
*/ */
void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t eNB_id); void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id);
/*! \brief Scheduling for UE RX procedures in normal subframes. /*! \brief Scheduling for UE RX procedures in normal subframes.
@param ue Pointer to UE variables on which to act @param ue Pointer to UE variables on which to act
...@@ -109,10 +109,10 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ...@@ -109,10 +109,10 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
uint8_t gNB_id, uint8_t gNB_id,
NR_UE_PDCCH_CONFIG *phy_pdcch_config, nr_phy_data_t *phy_data,
notifiedFIFO_t *txFifo); notifiedFIFO_t *txFifo);
int phy_procedures_slot_parallelization_nrUE_RX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t eNB_id, uint8_t abstraction_flag, uint8_t do_pdcch_flag, relaying_type_t r_type); int phy_procedures_slot_parallelization_nrUE_RX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id, uint8_t abstraction_flag, uint8_t do_pdcch_flag, relaying_type_t r_type);
void processSlotTX(void *arg); void processSlotTX(void *arg);
...@@ -176,22 +176,20 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind, ...@@ -176,22 +176,20 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
int gNB_id, int gNB_id,
PDSCH_t pdsch,
NR_UE_DLSCH_t *dlsch0, NR_UE_DLSCH_t *dlsch0,
NR_UE_DLSCH_t *dlsch1, NR_UE_DLSCH_t *dlsch1);
int *dlsch_errors);
int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
int eNB_id, PDSCH_t pdsch, int gNB_id,
NR_UE_DLSCH_t *dlsch0, NR_UE_DLSCH_t *dlsch1); NR_UE_DLSCH_t *dlsch);
int nr_ue_pdcch_procedures(uint8_t gNB_id, int nr_ue_pdcch_procedures(uint8_t gNB_id,
PHY_VARS_NR_UE *ue, PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
int32_t pdcch_est_size, int32_t pdcch_est_size,
int32_t pdcch_dl_ch_estimates[][pdcch_est_size], int32_t pdcch_dl_ch_estimates[][pdcch_est_size],
NR_UE_PDCCH_CONFIG *phy_pdcch_config, nr_phy_data_t *phy_data,
int n_ss); int n_ss);
int nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id); int nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id);
......
...@@ -289,61 +289,32 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response ...@@ -289,61 +289,32 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
void configure_dlsch(NR_UE_DLSCH_t *dlsch0, void configure_dlsch(NR_UE_DLSCH_t *dlsch0,
NR_DL_UE_HARQ_t *harq_list,
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu, fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu,
module_id_t module_id, module_id_t module_id,
int rnti) { int rnti) {
const uint8_t current_harq_pid = dlsch_config_pdu->harq_process_nbr; const uint8_t current_harq_pid = dlsch_config_pdu->harq_process_nbr;
dlsch0->current_harq_pid = current_harq_pid; dlsch0->active = true;
dlsch0->active = 1;
dlsch0->rnti = rnti; dlsch0->rnti = rnti;
LOG_D(PHY,"current_harq_pid = %d\n", current_harq_pid); LOG_D(PHY,"current_harq_pid = %d\n", current_harq_pid);
NR_DL_UE_HARQ_t *dlsch0_harq = dlsch0->harq_processes[current_harq_pid]; NR_DL_UE_HARQ_t *dlsch0_harq = &harq_list[current_harq_pid];
AssertFatal(dlsch0_harq, "no harq_process for HARQ PID %d\n", current_harq_pid);
dlsch0_harq->BWPStart = dlsch_config_pdu->BWPStart;
dlsch0_harq->BWPSize = dlsch_config_pdu->BWPSize;
dlsch0_harq->nb_rb = dlsch_config_pdu->number_rbs;
dlsch0_harq->start_rb = dlsch_config_pdu->start_rb;
dlsch0_harq->nb_symbols = dlsch_config_pdu->number_symbols;
dlsch0_harq->start_symbol = dlsch_config_pdu->start_symbol;
dlsch0_harq->dlDmrsSymbPos = dlsch_config_pdu->dlDmrsSymbPos;
dlsch0_harq->dmrsConfigType = dlsch_config_pdu->dmrsConfigType;
dlsch0_harq->n_dmrs_cdm_groups = dlsch_config_pdu->n_dmrs_cdm_groups;
dlsch0_harq->dmrs_ports = dlsch_config_pdu->dmrs_ports;
dlsch0_harq->mcs = dlsch_config_pdu->mcs;
dlsch0_harq->rvidx = dlsch_config_pdu->rv;
dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH;
dlsch0_harq->R = dlsch_config_pdu->targetCodeRate;
dlsch0_harq->Qm = dlsch_config_pdu->qamModOrder;
dlsch0_harq->TBS = dlsch_config_pdu->TBS;
dlsch0_harq->tbslbrm = dlsch_config_pdu->tbslbrm;
dlsch0_harq->nscid = dlsch_config_pdu->nscid;
dlsch0_harq->dlDmrsScramblingId = dlsch_config_pdu->dlDmrsScramblingId;
//get nrOfLayers from DCI info //get nrOfLayers from DCI info
uint8_t Nl = 0; uint8_t Nl = 0;
for (int i = 0; i < 12; i++) { // max 12 ports for (int i = 0; i < 12; i++) { // max 12 ports
if ((dlsch_config_pdu->dmrs_ports>>i)&0x01) Nl += 1; if ((dlsch_config_pdu->dmrs_ports>>i)&0x01) Nl += 1;
} }
dlsch0_harq->Nl = Nl; dlsch0->Nl = Nl;
dlsch0_harq->mcs_table=dlsch_config_pdu->mcs_table; downlink_harq_process(dlsch0_harq, current_harq_pid, dlsch_config_pdu->ndi, dlsch_config_pdu->rv, dlsch0->rnti_type);
downlink_harq_process(dlsch0_harq, dlsch0->current_harq_pid, dlsch_config_pdu->ndi, dlsch_config_pdu->rv, dlsch0->rnti_type);
if (dlsch0_harq->status != ACTIVE) { if (dlsch0_harq->status != ACTIVE) {
// dlsch0_harq->status not ACTIVE due to false retransmission // dlsch0_harq->status not ACTIVE due to false retransmission
// Reset the following flag to skip PDSCH procedures in that case and retrasmit harq status // Reset the following flag to skip PDSCH procedures in that case and retrasmit harq status
dlsch0->active = 0; dlsch0->active = false;
update_harq_status(module_id,dlsch0->current_harq_pid,dlsch0_harq->ack); update_harq_status(module_id, current_harq_pid, dlsch0_harq->ack);
} }
/* PTRS */
dlsch0_harq->PTRSFreqDensity = dlsch_config_pdu->PTRSFreqDensity;
dlsch0_harq->PTRSTimeDensity = dlsch_config_pdu->PTRSTimeDensity;
dlsch0_harq->PTRSPortIndex = dlsch_config_pdu->PTRSPortIndex;
dlsch0_harq->nEpreRatioOfPDSCHToPTRS = dlsch_config_pdu->nEpreRatioOfPDSCHToPTRS;
dlsch0_harq->PTRSReOffset = dlsch_config_pdu->PTRSReOffset;
dlsch0_harq->pduBitmap = dlsch_config_pdu->pduBitmap;
LOG_D(MAC, ">>>> \tdlsch0->g_pucch = %d\tdlsch0_harq.mcs = %d\n", dlsch0->g_pucch, dlsch0_harq->mcs);
} }
...@@ -357,7 +328,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ ...@@ -357,7 +328,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
int slot = scheduled_response->slot; int slot = scheduled_response->slot;
// Note: we have to handle the thread IDs for this. To be revisited completely. // Note: we have to handle the thread IDs for this. To be revisited completely.
NR_UE_DLSCH_t *dlsch0 = NULL; NR_UE_DLSCH_t *dlsch0 = &((nr_phy_data_t *)scheduled_response->phy_data)->dlsch[0];
NR_UE_ULSCH_t *ulsch = PHY_vars_UE_g[module_id][cc_id]->ulsch[0]; NR_UE_ULSCH_t *ulsch = PHY_vars_UE_g[module_id][cc_id]->ulsch[0];
NR_UE_PUCCH *pucch_vars = &((nr_phy_data_t *)scheduled_response->phy_data)->pucch_vars; NR_UE_PUCCH *pucch_vars = &((nr_phy_data_t *)scheduled_response->phy_data)->pucch_vars;
NR_UE_CSI_IM *csiim_vars = PHY_vars_UE_g[module_id][cc_id]->csiim_vars[0]; NR_UE_CSI_IM *csiim_vars = PHY_vars_UE_g[module_id][cc_id]->csiim_vars[0];
...@@ -380,7 +351,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ ...@@ -380,7 +351,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
switch(dl_config->dl_config_list[i].pdu_type) { switch(dl_config->dl_config_list[i].pdu_type) {
case FAPI_NR_DL_CONFIG_TYPE_DCI: case FAPI_NR_DL_CONFIG_TYPE_DCI:
if (NULL == phy_pdcch_config) { if (NULL == phy_pdcch_config) {
phy_pdcch_config = (NR_UE_PDCCH_CONFIG *)scheduled_response->phy_data; phy_pdcch_config = &((nr_phy_data_t *)scheduled_response->phy_data)->phy_pdcch_config;
phy_pdcch_config->nb_search_space = 0; phy_pdcch_config->nb_search_space = 0;
} }
pdcch_config = &dl_config->dl_config_list[i].dci_config_pdu.dci_config_rel15; pdcch_config = &dl_config->dl_config_list[i].dci_config_pdu.dci_config_rel15;
...@@ -402,24 +373,23 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ ...@@ -402,24 +373,23 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
break; break;
case FAPI_NR_DL_CONFIG_TYPE_RA_DLSCH: case FAPI_NR_DL_CONFIG_TYPE_RA_DLSCH:
dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15; dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15;
dlsch0 = PHY_vars_UE_g[module_id][cc_id]->dlsch_ra[0];
dlsch0->rnti_type = _RA_RNTI_; dlsch0->rnti_type = _RA_RNTI_;
dlsch0->harq_processes[dlsch_config_pdu->harq_process_nbr]->status = ACTIVE; dlsch0->dlsch_config = *dlsch_config_pdu;
configure_dlsch(dlsch0, dlsch_config_pdu, module_id, configure_dlsch(dlsch0, PHY_vars_UE_g[module_id][cc_id]->dl_harq_processes[0], dlsch_config_pdu, module_id,
dl_config->dl_config_list[i].dlsch_config_pdu.rnti); dl_config->dl_config_list[i].dlsch_config_pdu.rnti);
break; break;
case FAPI_NR_DL_CONFIG_TYPE_SI_DLSCH: case FAPI_NR_DL_CONFIG_TYPE_SI_DLSCH:
dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15; dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15;
dlsch0 = PHY_vars_UE_g[module_id][cc_id]->dlsch_SI[0];
dlsch0->rnti_type = _SI_RNTI_; dlsch0->rnti_type = _SI_RNTI_;
dlsch0->harq_processes[dlsch_config_pdu->harq_process_nbr]->status = ACTIVE; dlsch0->dlsch_config = *dlsch_config_pdu;
configure_dlsch(dlsch0, dlsch_config_pdu, module_id, configure_dlsch(dlsch0, PHY_vars_UE_g[module_id][cc_id]->dl_harq_processes[0], dlsch_config_pdu, module_id,
dl_config->dl_config_list[i].dlsch_config_pdu.rnti); dl_config->dl_config_list[i].dlsch_config_pdu.rnti);
break; break;
case FAPI_NR_DL_CONFIG_TYPE_DLSCH: case FAPI_NR_DL_CONFIG_TYPE_DLSCH:
dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15; dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15;
dlsch0 = PHY_vars_UE_g[module_id][cc_id]->dlsch[0][0]; dlsch0->rnti_type = _C_RNTI_;
configure_dlsch(dlsch0, dlsch_config_pdu, module_id, dlsch0->dlsch_config = *dlsch_config_pdu;
configure_dlsch(dlsch0, PHY_vars_UE_g[module_id][cc_id]->dl_harq_processes[0], dlsch_config_pdu, module_id,
dl_config->dl_config_list[i].dlsch_config_pdu.rnti); dl_config->dl_config_list[i].dlsch_config_pdu.rnti);
break; break;
} }
......
This diff is collapsed.
...@@ -106,8 +106,6 @@ int main(int argc, char **argv) ...@@ -106,8 +106,6 @@ int main(int argc, char **argv)
int frame_length_complex_samples; int frame_length_complex_samples;
//int frame_length_complex_samples_no_prefix; //int frame_length_complex_samples_no_prefix;
NR_DL_FRAME_PARMS *frame_parms; NR_DL_FRAME_PARMS *frame_parms;
uint8_t Kmimo = 0;
uint32_t Nsoft = 0;
double sigma; double sigma;
unsigned char qbits = 8; unsigned char qbits = 8;
int ret; int ret;
...@@ -403,24 +401,19 @@ int main(int argc, char **argv) ...@@ -403,24 +401,19 @@ int main(int argc, char **argv)
//nr_init_frame_parms_ue(&UE->frame_parms); //nr_init_frame_parms_ue(&UE->frame_parms);
//init_nr_ue_transport(UE, 0); //init_nr_ue_transport(UE, 0);
int num_codeword = NR_MAX_NB_LAYERS > 4? 2:1; NR_UE_DLSCH_t dlsch_ue[NR_MAX_NB_LAYERS > 4? 2:1] = {0};
for (i = 0; i < num_codeword; i++) { int num_codeword = NR_MAX_NB_LAYERS > 4? 2:1;
UE->dlsch[0][i] = new_nr_ue_dlsch(Kmimo, 8, Nsoft, 5, N_RB_DL); nr_ue_dlsch_init(dlsch_ue, num_codeword, 5);
if (!UE->dlsch[0][i]) { for (int i=0; i < num_codeword; i++)
printf("Can't get ue dlsch structures\n"); dlsch_ue[0].rnti = n_rnti;
exit(-1); nr_init_harq_processes(UE->dl_harq_processes[0], 8, nb_rb);
}
UE->dlsch[0][i]->rnti = n_rnti;
}
unsigned char harq_pid = 0; //dlsch->harq_ids[subframe]; unsigned char harq_pid = 0; //dlsch->harq_ids[subframe];
processingData_L1tx_t msgDataTx; processingData_L1tx_t msgDataTx;
init_DLSCH_struct(gNB, &msgDataTx); init_DLSCH_struct(gNB, &msgDataTx);
NR_gNB_DLSCH_t *dlsch = msgDataTx.dlsch[0][0]; NR_gNB_DLSCH_t *dlsch = msgDataTx.dlsch[0][0];
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->harq_process.pdsch_pdu.pdsch_pdu_rel15; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->harq_process.pdsch_pdu.pdsch_pdu_rel15;
//time_stats_t *rm_stats, *te_stats, *i_stats; //time_stats_t *rm_stats, *te_stats, *i_stats;
uint8_t is_crnti = 0;
unsigned int TBS = 8424; unsigned int TBS = 8424;
uint8_t nb_re_dmrs = 6; // No data in dmrs symbol uint8_t nb_re_dmrs = 6; // No data in dmrs symbol
uint16_t length_dmrs = 1; uint16_t length_dmrs = 1;
...@@ -432,7 +425,7 @@ int main(int argc, char **argv) ...@@ -432,7 +425,7 @@ int main(int argc, char **argv)
//printf("dlschsim harqid %d nb_rb %d, mscs %d\n",dlsch->harq_ids[subframe], //printf("dlschsim harqid %d nb_rb %d, mscs %d\n",dlsch->harq_ids[subframe],
// dlsch->harq_processes[0]->nb_rb,dlsch->harq_processes[0]->mcs,dlsch->harq_processes[0]->Nl); // dlsch->harq_processes[0]->nb_rb,dlsch->harq_processes[0]->mcs,dlsch->harq_processes[0]->Nl);
unsigned char mod_order = nr_get_Qm_dl(Imcs, mcs_table); unsigned char mod_order = nr_get_Qm_dl(Imcs, mcs_table);
uint16_t rate = nr_get_code_rate_dl(Imcs, mcs_table); uint16_t rate = nr_get_code_rate_dl(Imcs, mcs_table);
unsigned int available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, 1); unsigned int available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, 1);
TBS = nr_compute_tbs(mod_order,rate, nb_rb, nb_symb_sch, nb_re_dmrs*length_dmrs, 0, 0, Nl); TBS = nr_compute_tbs(mod_order,rate, nb_rb, nb_symb_sch, nb_re_dmrs*length_dmrs, 0, 0, Nl);
printf("available bits %u TBS %u mod_order %d\n", available_bits, TBS, mod_order); printf("available bits %u TBS %u mod_order %d\n", available_bits, TBS, mod_order);
...@@ -442,14 +435,14 @@ int main(int argc, char **argv) ...@@ -442,14 +435,14 @@ int main(int argc, char **argv)
rel15->qamModOrder[0] = mod_order; rel15->qamModOrder[0] = mod_order;
rel15->nrOfLayers = Nl; rel15->nrOfLayers = Nl;
rel15->TBSize[0] = TBS>>3; rel15->TBSize[0] = TBS>>3;
rel15->targetCodeRate[0] = rate; rel15->targetCodeRate[0] = rate;
rel15->NrOfCodewords = 1; rel15->NrOfCodewords = 1;
rel15->dmrsConfigType = NFAPI_NR_DMRS_TYPE1; rel15->dmrsConfigType = NFAPI_NR_DMRS_TYPE1;
rel15->dlDmrsSymbPos = 4; rel15->dlDmrsSymbPos = 4;
rel15->mcsIndex[0] = Imcs; rel15->mcsIndex[0] = Imcs;
rel15->numDmrsCdmGrpsNoData = 1; rel15->numDmrsCdmGrpsNoData = 1;
rel15->maintenance_parms_v3.tbSizeLbrmBytes = Tbslbrm; rel15->maintenance_parms_v3.tbSizeLbrmBytes = Tbslbrm;
rel15->maintenance_parms_v3.ldpcBaseGraph = get_BG(TBS, rate); rel15->maintenance_parms_v3.ldpcBaseGraph = get_BG(TBS, rate);
double modulated_input[16 * 68 * 384]; // [hna] 16 segments, 68*Zc double modulated_input[16 * 68 * 384]; // [hna] 16 segments, 68*Zc
short channel_output_fixed[16 * 68 * 384]; short channel_output_fixed[16 * 68 * 384];
//unsigned char *estimated_output; //unsigned char *estimated_output;
...@@ -457,21 +450,22 @@ int main(int argc, char **argv) ...@@ -457,21 +450,22 @@ int main(int argc, char **argv)
unsigned char test_input_bit[16 * 68 * 384]; unsigned char test_input_bit[16 * 68 * 384];
//estimated_output = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384); //estimated_output = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
unsigned char estimated_output_bit[16 * 68 * 384]; unsigned char estimated_output_bit[16 * 68 * 384];
NR_UE_DLSCH_t *dlsch0_ue = UE->dlsch[0][0]; NR_UE_DLSCH_t *dlsch0_ue = &dlsch_ue[0];
NR_DL_UE_HARQ_t *harq_process = dlsch0_ue->harq_processes[harq_pid]; NR_DL_UE_HARQ_t *harq_process = &UE->dl_harq_processes[0][harq_pid];
harq_process->mcs = Imcs; harq_process->first_rx = 1;
harq_process->mcs_table = mcs_table; dlsch0_ue->dlsch_config.mcs = Imcs;
harq_process->Nl = Nl; dlsch0_ue->dlsch_config.mcs_table = mcs_table;
harq_process->nb_rb = nb_rb; dlsch0_ue->Nl = Nl;
harq_process->Qm = mod_order; dlsch0_ue->dlsch_config.number_rbs = nb_rb;
harq_process->rvidx = rvidx; dlsch0_ue->dlsch_config.qamModOrder = mod_order;
harq_process->R = rate; dlsch0_ue->dlsch_config.rv = rvidx;
harq_process->TBS = TBS; dlsch0_ue->dlsch_config.targetCodeRate = rate;
harq_process->dmrsConfigType = NFAPI_NR_DMRS_TYPE1; dlsch0_ue->dlsch_config.TBS = TBS;
harq_process->dlDmrsSymbPos = 4; dlsch0_ue->dlsch_config.dmrsConfigType = NFAPI_NR_DMRS_TYPE1;
harq_process->n_dmrs_cdm_groups = 1; dlsch0_ue->dlsch_config.dlDmrsSymbPos = 4;
harq_process->tbslbrm = Tbslbrm; dlsch0_ue->dlsch_config.n_dmrs_cdm_groups = 1;
printf("harq process ue mcs = %d Qm = %d, symb %d\n", harq_process->mcs, harq_process->Qm, nb_symb_sch); dlsch0_ue->dlsch_config.tbslbrm = Tbslbrm;
printf("harq process ue mcs = %d Qm = %d, symb %d\n", dlsch0_ue->dlsch_config.mcs, dlsch0_ue->dlsch_config.qamModOrder, nb_symb_sch);
unsigned char *test_input=dlsch->harq_process.pdu; unsigned char *test_input=dlsch->harq_process.pdu;
//unsigned char test_input[TBS / 8] __attribute__ ((aligned(16))); //unsigned char test_input[TBS / 8] __attribute__ ((aligned(16)));
...@@ -539,8 +533,8 @@ int main(int argc, char **argv) ...@@ -539,8 +533,8 @@ int main(int argc, char **argv)
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DECODING0, VCD_FUNCTION_IN); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DECODING0, VCD_FUNCTION_IN);
ret = nr_dlsch_decoding(UE, &proc, 0, channel_output_fixed, &UE->frame_parms, ret = nr_dlsch_decoding(UE, &proc, 0, channel_output_fixed, &UE->frame_parms,
dlsch0_ue, dlsch0_ue->harq_processes[0], frame, nb_symb_sch, dlsch0_ue, harq_process, frame, nb_symb_sch,
slot,harq_pid, is_crnti); slot,harq_pid);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DECODING0, VCD_FUNCTION_OUT); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DECODING0, VCD_FUNCTION_OUT);
...@@ -551,7 +545,7 @@ int main(int argc, char **argv) ...@@ -551,7 +545,7 @@ int main(int argc, char **argv)
errors_bit = 0; errors_bit = 0;
for (i = 0; i < TBS; i++) { for (i = 0; i < TBS; i++) {
estimated_output_bit[i] = (dlsch0_ue->harq_processes[0]->b[i / 8] & (1 << (i & 7))) >> (i & 7); estimated_output_bit[i] = (harq_process->b[i / 8] & (1 << (i & 7))) >> (i & 7);
test_input_bit[i] = (test_input[i / 8] & (1 << (i & 7))) >> (i & 7); // Further correct for multiple segments test_input_bit[i] = (test_input[i / 8] & (1 << (i & 7))) >> (i & 7); // Further correct for multiple segments
if (estimated_output_bit[i] != test_input_bit[i]) { if (estimated_output_bit[i] != test_input_bit[i]) {
...@@ -620,7 +614,7 @@ int main(int argc, char **argv) ...@@ -620,7 +614,7 @@ int main(int argc, char **argv)
int num_cw = NR_MAX_NB_LAYERS > 4? 2:1; int num_cw = NR_MAX_NB_LAYERS > 4? 2:1;
for (int i = 0; i < num_cw; i++) for (int i = 0; i < num_cw; i++)
free_nr_ue_dlsch(&UE->dlsch[0][i], N_RB_DL); free_nr_ue_dl_harq(UE->dl_harq_processes[i], 8, nb_rb);
term_nr_ue_signal(UE, 1); term_nr_ue_signal(UE, 1);
free(UE); free(UE);
......
...@@ -1015,7 +1015,7 @@ int main(int argc, char **argv) ...@@ -1015,7 +1015,7 @@ int main(int argc, char **argv)
nr_dcireq_t dcireq; nr_dcireq_t dcireq;
nr_scheduled_response_t scheduled_response; nr_scheduled_response_t scheduled_response;
NR_UE_PDCCH_CONFIG phy_pdcch_config={0}; nr_phy_data_t phy_data = {0};
memset((void*)&dcireq,0,sizeof(dcireq)); memset((void*)&dcireq,0,sizeof(dcireq));
memset((void*)&scheduled_response,0,sizeof(scheduled_response)); memset((void*)&scheduled_response,0,sizeof(scheduled_response));
...@@ -1030,7 +1030,7 @@ int main(int argc, char **argv) ...@@ -1030,7 +1030,7 @@ int main(int argc, char **argv)
scheduled_response.CC_id = 0; scheduled_response.CC_id = 0;
scheduled_response.frame = frame; scheduled_response.frame = frame;
scheduled_response.slot = slot; scheduled_response.slot = slot;
scheduled_response.phy_data = &phy_pdcch_config; scheduled_response.phy_data = &phy_data;
nr_ue_phy_config_request(&UE_mac->phy_config); nr_ue_phy_config_request(&UE_mac->phy_config);
//NR_COMMON_channels_t *cc = RC.nrmac[0]->common_channels; //NR_COMMON_channels_t *cc = RC.nrmac[0]->common_channels;
...@@ -1084,10 +1084,10 @@ int main(int argc, char **argv) ...@@ -1084,10 +1084,10 @@ int main(int argc, char **argv)
dcireq.frame = frame; dcireq.frame = frame;
dcireq.slot = slot; dcireq.slot = slot;
NR_UE_DLSCH_t *dlsch0 = UE->dlsch[0][0]; NR_UE_DLSCH_t *dlsch0 = &phy_data.dlsch[0];
int harq_pid = slot; int harq_pid = slot;
NR_DL_UE_HARQ_t *UE_harq_process = dlsch0->harq_processes[harq_pid]; NR_DL_UE_HARQ_t *UE_harq_process = &UE->dl_harq_processes[0][harq_pid];
NR_gNB_DLSCH_t *gNB_dlsch = msgDataTx->dlsch[0][0]; NR_gNB_DLSCH_t *gNB_dlsch = msgDataTx->dlsch[0][0];
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &gNB_dlsch->harq_process.pdsch_pdu.pdsch_pdu_rel15; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &gNB_dlsch->harq_process.pdsch_pdu.pdsch_pdu_rel15;
...@@ -1262,24 +1262,24 @@ int main(int argc, char **argv) ...@@ -1262,24 +1262,24 @@ int main(int argc, char **argv)
phy_procedures_nrUE_RX(UE, phy_procedures_nrUE_RX(UE,
&UE_proc, &UE_proc,
0, 0,
&phy_pdcch_config, &phy_data,
NULL); NULL);
//---------------------------------------------------------- //----------------------------------------------------------
//---------------------- count errors ---------------------- //---------------------- count errors ----------------------
//---------------------------------------------------------- //----------------------------------------------------------
if (UE->dlsch[0][0]->last_iteration_cnt >= if (dlsch0->last_iteration_cnt >=
UE->dlsch[0][0]->max_ldpc_iterations+1) dlsch0->max_ldpc_iterations+1)
n_errors[round][snrRun]++; n_errors[round][snrRun]++;
NR_UE_PDSCH **pdsch_vars = UE->pdsch_vars; NR_UE_PDSCH **pdsch_vars = UE->pdsch_vars;
int16_t *UE_llr = pdsch_vars[0]->llr[0]; int16_t *UE_llr = pdsch_vars[0]->llr[0];
TBS = UE_harq_process->TBS;//rel15->TBSize[0]; TBS = dlsch0->dlsch_config.TBS;//rel15->TBSize[0];
uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos); uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos);
uint16_t nb_rb = rel15->rbSize; uint16_t nb_rb = rel15->rbSize;
uint8_t nb_re_dmrs = rel15->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6*UE_harq_process->n_dmrs_cdm_groups : 4*UE_harq_process->n_dmrs_cdm_groups; uint8_t nb_re_dmrs = rel15->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6*dlsch0->dlsch_config.n_dmrs_cdm_groups : 4*dlsch0->dlsch_config.n_dmrs_cdm_groups;
uint8_t mod_order = rel15->qamModOrder[0]; uint8_t mod_order = rel15->qamModOrder[0];
uint8_t nb_symb_sch = rel15->NrOfSymbols; uint8_t nb_symb_sch = rel15->NrOfSymbols;
......
...@@ -86,25 +86,23 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id, ...@@ -86,25 +86,23 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
int32_t pdcch_est_size, int32_t pdcch_est_size,
int32_t pdcch_dl_ch_estimates[][pdcch_est_size], int32_t pdcch_dl_ch_estimates[][pdcch_est_size],
NR_UE_PDCCH_CONFIG *phy_pdcch_config, nr_phy_data_t *phy_data,
int n_ss) { int n_ss) {
return 0; return 0;
} }
int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
int eNB_id, PDSCH_t pdsch, int eNB_id,
NR_UE_DLSCH_t *dlsch0, NR_UE_DLSCH_t *dlsch1) { NR_UE_DLSCH_t *dlsch) {
return 0; return 0;
} }
bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
int gNB_id, int gNB_id,
PDSCH_t pdsch,
NR_UE_DLSCH_t *dlsch0, NR_UE_DLSCH_t *dlsch0,
NR_UE_DLSCH_t *dlsch1, NR_UE_DLSCH_t *dlsch1) {
int *dlsch_errors) {
return false; return false;
} }
...@@ -746,7 +744,7 @@ int main(int argc, char **argv) ...@@ -746,7 +744,7 @@ int main(int argc, char **argv)
} }
else { else {
UE_nr_rxtx_proc_t proc={0}; UE_nr_rxtx_proc_t proc={0};
NR_UE_PDCCH_CONFIG phy_pdcch_config={0}; nr_phy_data_t phy_data={0};
UE->rx_offset=0; UE->rx_offset=0;
uint8_t ssb_index = 0; uint8_t ssb_index = 0;
...@@ -776,7 +774,7 @@ int main(int argc, char **argv) ...@@ -776,7 +774,7 @@ int main(int argc, char **argv)
0, 0,
ssb_index%8, ssb_index%8,
SISO, SISO,
&phy_pdcch_config, &phy_data,
&result); &result);
if (ret==0) { if (ret==0) {
......
...@@ -1131,21 +1131,19 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){ ...@@ -1131,21 +1131,19 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon = mac->scc != NULL ? mac->scc->tdd_UL_DL_ConfigurationCommon : mac->scc_SIB->tdd_UL_DL_ConfigurationCommon; NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon = mac->scc != NULL ? mac->scc->tdd_UL_DL_ConfigurationCommon : mac->scc_SIB->tdd_UL_DL_ConfigurationCommon;
LOG_T(NR_MAC, "In %s():%d not calling scheduler. sched mode = %d and mac->ra.ra_state = %d\n",
__FUNCTION__, __LINE__, ul_info->ue_sched_mode, mac->ra.ra_state);
switch (ul_info->ue_sched_mode) { switch (ul_info->ue_sched_mode) {
case SCHED_PUSCH: case SCHED_PUSCH:
ret = nr_ue_scheduler(NULL, ul_info); ret = nr_ue_scheduler(NULL, ul_info);
if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) && !get_softmodem_params()->phy_test) if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) && !get_softmodem_params()->phy_test)
nr_ue_prach_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx); nr_ue_prach_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx);
LOG_T(NR_MAC, "In %s():%d not calling scheduler. sched mode = %d and mac->ra.ra_state = %d\n",
__FUNCTION__, __LINE__, ul_info->ue_sched_mode, mac->ra.ra_state);
break; break;
case SCHED_PUCCH: case SCHED_PUCCH:
if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type)) if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type))
nr_ue_pucch_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->phy_data); nr_ue_pucch_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->phy_data);
LOG_T(NR_MAC, "In %s():%d not calling scheduler. sched mode = %d and mac->ra.ra_state = %d\n",
__FUNCTION__, __LINE__, ul_info->ue_sched_mode, mac->ra.ra_state);
break; break;
} }
...@@ -1241,7 +1239,6 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ ...@@ -1241,7 +1239,6 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_
(dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.ack_nack, (dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.ack_nack,
(dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu, (dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu,
(dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu_length)) << FAPI_NR_RX_PDU_TYPE_SIB; (dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu_length)) << FAPI_NR_RX_PDU_TYPE_SIB;
free((dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu);
break; break;
case FAPI_NR_RX_PDU_TYPE_DLSCH: case FAPI_NR_RX_PDU_TYPE_DLSCH:
ret_mask |= (handle_dlsch(dl_info, ul_time_alignment, i)) << FAPI_NR_RX_PDU_TYPE_DLSCH; ret_mask |= (handle_dlsch(dl_info, ul_time_alignment, i)) << FAPI_NR_RX_PDU_TYPE_DLSCH;
......
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