Commit afb95b10 authored by Raymond Knopp's avatar Raymond Knopp

Merge branch 'NR_RRC_harq_hacks' of...

Merge branch 'NR_RRC_harq_hacks' of https://gitlab.eurecom.fr/oai/openairinterface5g into NR_RRC_harq_hacks
parents 2ca4137c 12354bb6
...@@ -1116,7 +1116,7 @@ ...@@ -1116,7 +1116,7 @@
-n100 -s1 -t33 -n100 -s1 -t33
-n100 -s1 -t50 -n100 -s1 -t50
</main_exec_args> </main_exec_args>
<tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 nr_dlsim.test11 nr_dlsim.test12 nr_dlsim.test13 </tags> <tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 nr_dlsim.test11 nr_dlsim.test12 nr_dlsim.test13</tags>
<search_expr_true>PDSCH test OK</search_expr_true> <search_expr_true>PDSCH test OK</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
<nruns>3</nruns> <nruns>3</nruns>
...@@ -1227,8 +1227,7 @@ ...@@ -1227,8 +1227,7 @@
-R 106 -i 1 -P 2 -q8 -b 19 -s-3 -n1000 -R 106 -i 1 -P 2 -q8 -b 19 -s-3 -n1000
-R 106 -i 1 -P 2 -q8 -b 32 -s-3 -n1000 -R 106 -i 1 -P 2 -q8 -b 32 -s-3 -n1000
-R 106 -i 1 -P 2 -q16 -b 32 -s-3 -n1000 -R 106 -i 1 -P 2 -q16 -b 32 -s-3 -n1000
-R 106 -i 1 -P 2 -q16 -b 64 -s-3 -n1000 -R 106 -i 1 -P 2 -q16 -b 64 -s-3 -n1000</main_exec_args>
</main_exec_args>
<tags>nr_pucchsim.test1 nr_pucchsim.test2 nr_pucchsim.test3 nr_pucchsim.test4 nr_pucchsim.test5 nr_pucchsim.test6 nr_pucchsim.test7 nr_pucchsim.test8 nr_pucchsim.test9 nr_pucchsim.test10 nr_pucchsim.test11 nr_pucchsim.test12 nr_pucchsim.test13 nr_pucchsim.test14 nr_pucchsim.test15 nr_pucchsim.test16 nr_pucchsim.test17</tags> <tags>nr_pucchsim.test1 nr_pucchsim.test2 nr_pucchsim.test3 nr_pucchsim.test4 nr_pucchsim.test5 nr_pucchsim.test6 nr_pucchsim.test7 nr_pucchsim.test8 nr_pucchsim.test9 nr_pucchsim.test10 nr_pucchsim.test11 nr_pucchsim.test12 nr_pucchsim.test13 nr_pucchsim.test14 nr_pucchsim.test15 nr_pucchsim.test16 nr_pucchsim.test17</tags>
<search_expr_true>PUCCH test OK</search_expr_true> <search_expr_true>PUCCH test OK</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
......
...@@ -54,7 +54,8 @@ ...@@ -54,7 +54,8 @@
void nr_generate_pucch0(PHY_VARS_NR_UE *ue, void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
int32_t **txdataF, int32_t **txdataF,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated, long pucch_GroupHopping,
long hoppingId,
int16_t amp, int16_t amp,
int nr_tti_tx, int nr_tti_tx,
uint8_t m0, uint8_t m0,
...@@ -111,7 +112,7 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue, ...@@ -111,7 +112,7 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
for (int l=0; l<nrofSymbols; l++) { for (int l=0; l<nrofSymbols; l++) {
// if frequency hopping is enabled n_hop = 1 for second hop. Not sure frequency hopping concerns format 0. FIXME!!! // if frequency hopping is enabled n_hop = 1 for second hop. Not sure frequency hopping concerns format 0. FIXME!!!
// if ((PUCCH_Frequency_Hopping == 1)&&(l == (nrofSymbols-1))) n_hop = 1; // if ((PUCCH_Frequency_Hopping == 1)&&(l == (nrofSymbols-1))) n_hop = 1;
nr_group_sequence_hopping(ue->pucch_config_common_nr->pucch_GroupHopping,ue->pucch_config_common_nr->hoppingId,n_hop,nr_tti_tx,&u,&v); // calculating u and v value nr_group_sequence_hopping(pucch_GroupHopping,hoppingId,n_hop,nr_tti_tx,&u,&v); // calculating u and v value
alpha = nr_cyclic_shift_hopping(ue->pucch_config_common_nr->hoppingId,m0,mcs,l,startingSymbolIndex,nr_tti_tx); alpha = nr_cyclic_shift_hopping(ue->pucch_config_common_nr->hoppingId,m0,mcs,l,startingSymbolIndex,nr_tti_tx);
#ifdef DEBUG_NR_PUCCH_TX #ifdef DEBUG_NR_PUCCH_TX
printf("\t [nr_generate_pucch0] sequence generation \tu=%d \tv=%d \talpha=%lf \t(for symbol l=%d)\n",u,v,alpha,l); printf("\t [nr_generate_pucch0] sequence generation \tu=%d \tv=%d \talpha=%lf \t(for symbol l=%d)\n",u,v,alpha,l);
......
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
void nr_generate_pucch0(PHY_VARS_NR_UE *ue, void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
int32_t **txdataF, int32_t **txdataF,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated, long pucch_GroupHopping,
long hoppingId,
int16_t amp, int16_t amp,
int nr_tti_tx, int nr_tti_tx,
uint8_t m0, uint8_t m0,
......
...@@ -2227,6 +2227,8 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, ...@@ -2227,6 +2227,8 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,VCD_FUNCTION_IN);
memset(ue->common_vars.txdataF[0], 0, sizeof(int)*14*ue->frame_parms.ofdm_symbol_size);
LOG_I(PHY,"****** start TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx); LOG_I(PHY,"****** start TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx);
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
...@@ -2247,11 +2249,13 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, ...@@ -2247,11 +2249,13 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
} // UE_mode==PUSCH } // UE_mode==PUSCH
*/ */
LOG_D(PHY, "Sending PUCCH\n"); if (get_softmodem_params()->do_ra==1) {
pucch_procedures_ue_nr(ue, LOG_D(PHY, "Sending PUCCH\n");
gNB_id, pucch_procedures_ue_nr(ue,
proc, gNB_id,
TRUE); proc,
TRUE);
}
LOG_D(PHY, "Sending data \n"); LOG_D(PHY, "Sending data \n");
nr_ue_pusch_common_procedures(ue, nr_ue_pusch_common_procedures(ue,
......
...@@ -580,7 +580,8 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_ ...@@ -580,7 +580,8 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_
{ {
nr_generate_pucch0(ue,ue->common_vars.txdataF, nr_generate_pucch0(ue,ue->common_vars.txdataF,
&ue->frame_parms, &ue->frame_parms,
&ue->pucch_config_dedicated[gNB_id], mac->ULbwp[bwp_id-1]->bwp_Common->pucch_ConfigCommon->choice.setup->pucch_GroupHopping,
mac->ULbwp[bwp_id-1]->bwp_Common->pucch_ConfigCommon->choice.setup->hoppingId[0],
tx_amp, tx_amp,
nr_tti_tx, nr_tti_tx,
(uint8_t)m_0, (uint8_t)m_0,
......
...@@ -430,7 +430,7 @@ int main(int argc, char **argv) ...@@ -430,7 +430,7 @@ int main(int argc, char **argv)
uint8_t is_crnti = 0, llr8_flag = 0; uint8_t is_crnti = 0, llr8_flag = 0;
unsigned int TBS = 8424; unsigned int TBS = 8424;
unsigned int available_bits; unsigned int available_bits;
uint8_t nb_re_dmrs = 12; // 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;
unsigned char mod_order; unsigned char mod_order;
uint16_t rate; uint16_t rate;
...@@ -457,6 +457,7 @@ int main(int argc, char **argv) ...@@ -457,6 +457,7 @@ int main(int argc, char **argv)
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;
double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc
short *channel_output_fixed = malloc16(sizeof(short) * 16 * 68 * 384); short *channel_output_fixed = malloc16(sizeof(short) * 16 * 68 * 384);
short *channel_output_uncoded = malloc16(sizeof(unsigned short) * 16 * 68 * 384); short *channel_output_uncoded = malloc16(sizeof(unsigned short) * 16 * 68 * 384);
......
...@@ -113,7 +113,7 @@ int main(int argc, char **argv) ...@@ -113,7 +113,7 @@ int main(int argc, char **argv)
double sigma, sigma_dB; double sigma, sigma_dB;
double snr_step = 1; double snr_step = 1;
uint8_t snr1set = 0; uint8_t snr1set = 0;
int slot = 17, frame = 0; int slot = 8, frame = 0;
FILE *output_fd = NULL; FILE *output_fd = NULL;
//uint8_t write_output_file = 0; //uint8_t write_output_file = 0;
int trial, n_trials = 1, n_errors = 0, n_false_positive = 0, delay = 0; int trial, n_trials = 1, n_errors = 0, n_false_positive = 0, delay = 0;
...@@ -693,6 +693,7 @@ int main(int argc, char **argv) ...@@ -693,6 +693,7 @@ int main(int argc, char **argv)
ul_config.ul_config_list[0].pusch_config_pdu.dmrs_config_type = 0; ul_config.ul_config_list[0].pusch_config_pdu.dmrs_config_type = 0;
ul_config.ul_config_list[0].pusch_config_pdu.mcs_index = Imcs; ul_config.ul_config_list[0].pusch_config_pdu.mcs_index = Imcs;
ul_config.ul_config_list[0].pusch_config_pdu.mcs_table = mcs_table; ul_config.ul_config_list[0].pusch_config_pdu.mcs_table = mcs_table;
ul_config.ul_config_list[0].pusch_config_pdu.num_dmrs_cdm_grps_no_data = 1;
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.new_data_indicator = 0; ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.new_data_indicator = 0;
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.rv_index = 0; ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.rv_index = 0;
ul_config.ul_config_list[0].pusch_config_pdu.nrOfLayers = precod_nbr_layers; ul_config.ul_config_list[0].pusch_config_pdu.nrOfLayers = precod_nbr_layers;
...@@ -710,7 +711,7 @@ int main(int argc, char **argv) ...@@ -710,7 +711,7 @@ int main(int argc, char **argv)
TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs * number_dmrs_symbols, 0, 0, precod_nbr_layers); TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs * number_dmrs_symbols, 0, 0, precod_nbr_layers);
if (input_fd != NULL) { if (input_fd == NULL) {
pusch_pdu->pusch_data.tb_size = TBS>>3; pusch_pdu->pusch_data.tb_size = TBS>>3;
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.tb_size = TBS; ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.tb_size = TBS;
// set FAPI parameters for UE, put them in the scheduled response and call // set FAPI parameters for UE, put them in the scheduled response and call
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "LAYER2/MAC/mac_proto.h" #include "LAYER2/MAC/mac_proto.h"
#include "LAYER2/NR_MAC_gNB/mac_proto.h" #include "LAYER2/NR_MAC_gNB/mac_proto.h"
#include "common/ran_context.h" #include "common/ran_context.h"
#include "executables/softmodem-common.h"
#define MAX_IF_MODULES 100 #define MAX_IF_MODULES 100
...@@ -87,34 +88,36 @@ void handle_nr_uci(NR_UL_IND_t *UL_info, NR_UE_sched_ctrl_t *sched_ctrl) { ...@@ -87,34 +88,36 @@ void handle_nr_uci(NR_UL_IND_t *UL_info, NR_UE_sched_ctrl_t *sched_ctrl) {
case NFAPI_NR_UCI_PDCCH_PDU_TYPE: break; case NFAPI_NR_UCI_PDCCH_PDU_TYPE: break;
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: { case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &uci_list[i].pucch_pdu_format_0_1; if (get_softmodem_params()->phy_test == 0) {
// handle harq nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &uci_list[i].pucch_pdu_format_0_1;
int harq_idx_s = 0; // handle harq
// iterate over received harq bits int harq_idx_s = 0;
for (int harq_bit = 0; harq_bit < uci_pdu->harq->num_harq; harq_bit++) { // iterate over received harq bits
// search for the right harq process for (int harq_bit = 0; harq_bit < uci_pdu->harq->num_harq; harq_bit++) {
for (int harq_idx = harq_idx_s; harq_idx < NR_MAX_NB_HARQ_PROCESSES-1; harq_idx++) { // search for the right harq process
if ((UL_info->slot-1) == sched_ctrl->harq_processes[harq_idx].feedback_slot) { for (int harq_idx = harq_idx_s; harq_idx < NR_MAX_NB_HARQ_PROCESSES-1; harq_idx++) {
if (uci_pdu->harq->harq_list[harq_bit].harq_value == 0) if ((UL_info->slot-1) == sched_ctrl->harq_processes[harq_idx].feedback_slot) {
sched_ctrl->harq_processes[harq_idx].round++; if (uci_pdu->harq->harq_list[harq_bit].harq_value == 0)
if ((uci_pdu->harq->harq_list[harq_bit].harq_value == 1) || sched_ctrl->harq_processes[harq_idx].round++;
(sched_ctrl->harq_processes[harq_idx].round == max_harq_rounds)) { if ((uci_pdu->harq->harq_list[harq_bit].harq_value == 1) ||
sched_ctrl->harq_processes[harq_idx].ndi ^= 1; (sched_ctrl->harq_processes[harq_idx].round == max_harq_rounds)) {
sched_ctrl->harq_processes[harq_idx].round = 0; sched_ctrl->harq_processes[harq_idx].ndi ^= 1;
sched_ctrl->harq_processes[harq_idx].round = 0;
}
sched_ctrl->harq_processes[harq_idx].is_waiting = 0;
harq_idx_s = harq_idx + 1;
break;
} }
sched_ctrl->harq_processes[harq_idx].is_waiting = 0; // if gNB fails to receive a ACK/NACK
harq_idx_s = harq_idx + 1; else if (((UL_info->slot-1) > sched_ctrl->harq_processes[harq_idx].feedback_slot) &&
break; (sched_ctrl->harq_processes[harq_idx].is_waiting)) {
} sched_ctrl->harq_processes[harq_idx].round++;
// if gNB fails to receive a ACK/NACK if (sched_ctrl->harq_processes[harq_idx].round == max_harq_rounds) {
else if (((UL_info->slot-1) > sched_ctrl->harq_processes[harq_idx].feedback_slot) && sched_ctrl->harq_processes[harq_idx].ndi ^= 1;
(sched_ctrl->harq_processes[harq_idx].is_waiting)) { sched_ctrl->harq_processes[harq_idx].round = 0;
sched_ctrl->harq_processes[harq_idx].round++; }
if (sched_ctrl->harq_processes[harq_idx].round == max_harq_rounds) { sched_ctrl->harq_processes[harq_idx].is_waiting = 0;
sched_ctrl->harq_processes[harq_idx].ndi ^= 1;
sched_ctrl->harq_processes[harq_idx].round = 0;
} }
sched_ctrl->harq_processes[harq_idx].is_waiting = 0;
} }
} }
} }
......
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