Commit 185477dc authored by Francesco Mani's avatar Francesco Mani

fix for ULSCH ok when PRBs are empty

parent 927d97fa
...@@ -46,12 +46,12 @@ ...@@ -46,12 +46,12 @@
@param symbol Symbol on which to act (within-in nr_TTI_rx) @param symbol Symbol on which to act (within-in nr_TTI_rx)
@param harq_pid HARQ process ID @param harq_pid HARQ process ID
*/ */
void nr_rx_pusch(PHY_VARS_gNB *gNB, int nr_rx_pusch(PHY_VARS_gNB *gNB,
uint8_t UE_id, uint8_t UE_id,
uint32_t frame, uint32_t frame,
uint8_t nr_tti_rx, uint8_t nr_tti_rx,
unsigned char symbol, unsigned char symbol,
unsigned char harq_pid); unsigned char harq_pid);
/** \brief This function performs RB extraction (signal and channel estimates) (currently signal only until channel estimation and compensation are implemented) /** \brief This function performs RB extraction (signal and channel estimates) (currently signal only until channel estimation and compensation are implemented)
......
...@@ -1013,12 +1013,12 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext, ...@@ -1013,12 +1013,12 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
} }
void nr_rx_pusch(PHY_VARS_gNB *gNB, int nr_rx_pusch(PHY_VARS_gNB *gNB,
uint8_t ulsch_id, uint8_t ulsch_id,
uint32_t frame, uint32_t frame,
uint8_t nr_tti_rx, uint8_t nr_tti_rx,
unsigned char symbol, unsigned char symbol,
unsigned char harq_pid) unsigned char harq_pid)
{ {
uint8_t aarx, aatx, dmrs_symbol_flag, ptrs_symbol_flag; // dmrs_symbol_flag, a flag to indicate DMRS REs in current symbol uint8_t aarx, aatx, dmrs_symbol_flag, ptrs_symbol_flag; // dmrs_symbol_flag, a flag to indicate DMRS REs in current symbol
...@@ -1159,6 +1159,12 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB, ...@@ -1159,6 +1159,12 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
gNB->pusch_vars[ulsch_id]->log2_maxh); gNB->pusch_vars[ulsch_id]->log2_maxh);
stop_meas(&gNB->ulsch_channel_compensation_stats); stop_meas(&gNB->ulsch_channel_compensation_stats);
int rxsig = signal_energy(&gNB->pusch_vars[ulsch_id]->rxdataF_comp[0][(symbol*rel15_ul->rb_size*12)],
rel15_ul->rb_size*12);
if (rxsig==1) return (rxsig);
#ifdef NR_SC_FDMA #ifdef NR_SC_FDMA
nr_idft(&((uint32_t*)gNB->pusch_vars[ulsch_id]->rxdataF_ext[0])[symbol * rel15_ul->rb_size * NR_NB_SC_PER_RB], nb_re_pusch); nr_idft(&((uint32_t*)gNB->pusch_vars[ulsch_id]->rxdataF_ext[0])[symbol * rel15_ul->rb_size * NR_NB_SC_PER_RB], nb_re_pusch);
#endif #endif
...@@ -1181,5 +1187,5 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB, ...@@ -1181,5 +1187,5 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
} }
gNB->pusch_vars[ulsch_id]->rxdataF_ext_offset = gNB->pusch_vars[ulsch_id]->rxdataF_ext_offset + nb_re_pusch; gNB->pusch_vars[ulsch_id]->rxdataF_ext_offset = gNB->pusch_vars[ulsch_id]->rxdataF_ext_offset + nb_re_pusch;
return (0);
} }
...@@ -424,6 +424,7 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) ...@@ -424,6 +424,7 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
for (int ULSCH_id=0;ULSCH_id<NUMBER_OF_NR_ULSCH_MAX;ULSCH_id++) { for (int ULSCH_id=0;ULSCH_id<NUMBER_OF_NR_ULSCH_MAX;ULSCH_id++) {
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0]; NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
int harq_pid; int harq_pid;
int no_sig;
NR_UL_gNB_HARQ_t *ulsch_harq; NR_UL_gNB_HARQ_t *ulsch_harq;
if ((ulsch) && if ((ulsch) &&
...@@ -438,6 +439,8 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) ...@@ -438,6 +439,8 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
(ulsch_harq->handled == 0)){ (ulsch_harq->handled == 0)){
#ifdef DEBUG_RXDATA #ifdef DEBUG_RXDATA
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
RU_t *ru = gNB->RU_list[0];
int slot_offset = frame_parms->get_samples_slot_timestamp(slot_rx,frame_parms,0); int slot_offset = frame_parms->get_samples_slot_timestamp(slot_rx,frame_parms,0);
slot_offset -= ru->N_TA_offset; slot_offset -= ru->N_TA_offset;
char name[128]; char name[128];
...@@ -451,7 +454,8 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) ...@@ -451,7 +454,8 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
uint8_t symbol_start = ulsch_harq->ulsch_pdu.start_symbol_index; uint8_t symbol_start = ulsch_harq->ulsch_pdu.start_symbol_index;
uint8_t symbol_end = symbol_start + ulsch_harq->ulsch_pdu.nr_of_symbols; uint8_t symbol_end = symbol_start + ulsch_harq->ulsch_pdu.nr_of_symbols;
for(uint8_t symbol = symbol_start; symbol < symbol_end; symbol++) { for(uint8_t symbol = symbol_start; symbol < symbol_end; symbol++) {
nr_rx_pusch(gNB, ULSCH_id, frame_rx, slot_rx, symbol, harq_pid); no_sig = nr_rx_pusch(gNB, ULSCH_id, frame_rx, slot_rx, symbol, harq_pid);
if (no_sig) return;
} }
//LOG_M("rxdataF_comp.m","rxF_comp",gNB->pusch_vars[0]->rxdataF_comp[0],6900,1,1); //LOG_M("rxdataF_comp.m","rxF_comp",gNB->pusch_vars[0]->rxdataF_comp[0],6900,1,1);
//LOG_M("rxdataF_ext.m","rxF_ext",gNB->pusch_vars[0]->rxdataF_ext[0],6900,1,1); //LOG_M("rxdataF_ext.m","rxF_ext",gNB->pusch_vars[0]->rxdataF_ext[0],6900,1,1);
......
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