Updated gNB part to handle CI test
This commit is contained in:
@@ -413,6 +413,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
if (pucch_pdu->bit_len_harq==0) {
|
||||
uci_pdu->harq = NULL;
|
||||
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
|
||||
AssertFatal ( uci_pdu->sr != NULL, "Memory allocation failed when pucch_pdu->bit_len_harq == 0\n");
|
||||
uci_pdu->sr->sr_confidence_level = no_conf ? 1 : 0;
|
||||
uci_stats->pucch0_sr_trials++;
|
||||
if (xrtmag_dBtimes10>(10*gNB->measurements.n0_power_tot_dB)) {
|
||||
@@ -421,10 +422,13 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
} else {
|
||||
uci_pdu->sr->sr_indication = 0;
|
||||
}
|
||||
LOG_I(PHY, "uci_01->harq->num_harq == 0\n");
|
||||
}
|
||||
else if (pucch_pdu->bit_len_harq==1) {
|
||||
uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq));
|
||||
AssertFatal ( uci_pdu->harq != NULL, "Memory allocation failed when pucch_pdu->bit_len_harq == 1\n");
|
||||
uci_pdu->harq->num_harq = 1;
|
||||
LOG_I(PHY, "uci_01->harq->num_harq %u with uci_pdu %p harq %p\n", uci_pdu->harq->num_harq, uci_pdu, uci_pdu->harq);
|
||||
uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0;
|
||||
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1);
|
||||
uci_pdu->harq->harq_list[0].harq_value = index&0x01;
|
||||
@@ -440,7 +444,9 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
else {
|
||||
uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq));
|
||||
AssertFatal ( uci_pdu->harq != NULL, "Memory allocation failed when pucch_pdu->bit_len_harq > 1\n");
|
||||
uci_pdu->harq->num_harq = 2;
|
||||
LOG_I(PHY, "uci_01->harq->num_harq %u with uci_pdu %p harq %p\n", uci_pdu->harq->num_harq, uci_pdu, uci_pdu->harq);
|
||||
uci_pdu->harq->harq_confidence_level = (no_conf) ? 1 : 0;
|
||||
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2);
|
||||
uci_pdu->harq->harq_list[1].harq_value = index&0x01;
|
||||
|
||||
@@ -221,11 +221,8 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
|
||||
k += kbar;
|
||||
k *= 2;
|
||||
|
||||
LOG_I(PHY, "PRACH [UE %d] in slot %d, mu %d, fp->samples_per_subframe %d, prach_sequence_length %d, placing PRACH in position %d, msg1 frequency start %d (k1 %d), preamble_offset %d, first_nonzero_root_idx %d\n", Mod_id,
|
||||
LOG_I(PHY, "PRACH [UE %d] in slot %d, placing PRACH in position %d, msg1 frequency start %d (k1 %d), preamble_offset %d, first_nonzero_root_idx %d\n", Mod_id,
|
||||
slot,
|
||||
mu,
|
||||
fp->samples_per_subframe,
|
||||
prach_sequence_length,
|
||||
k,
|
||||
n_ra_prb,
|
||||
nrUE_config->prach_config.num_prach_fd_occasions_list[fd_occasion].k1,
|
||||
|
||||
@@ -682,6 +682,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
offset = pucch_pdu->start_symbol_index*gNB->frame_parms.ofdm_symbol_size + (gNB->frame_parms.first_carrier_offset+pucch_pdu->prb_start*12);
|
||||
power_rxF = signal_energy_nodc(&gNB->common_vars.rxdataF[0][offset],12);
|
||||
LOG_D(PHY,"frame %d, slot %d: PUCCH signal energy %d\n",frame_rx,slot_rx,power_rxF);
|
||||
LOG_D(PHY,"num_ucis = %d *expecting 0 since it is index in array also (case 0)\n",num_ucis);
|
||||
|
||||
nr_decode_pucch0(gNB,
|
||||
frame_rx,
|
||||
@@ -691,6 +692,11 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
|
||||
gNB->UL_INFO.uci_ind.num_ucis += 1;
|
||||
pucch->active = 0;
|
||||
if (((uci_pdu_format0->pduBitmap >> 1) & 0x01)){
|
||||
LOG_I(NR_PHY, "uci_01->harq->num_harq with uci_pdu %p\n", uci_pdu_format0);
|
||||
LOG_I(NR_PHY, "uci_01->harq->num_harq with uci_pdu %p harq %p\n", uci_pdu_format0, uci_pdu_format0->harq);
|
||||
LOG_I(NR_PHY, "uci_01->harq->num_harq %u\n", uci_pdu_format0->harq->num_harq);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
num_ucis = gNB->UL_INFO.uci_ind.num_ucis;
|
||||
@@ -700,6 +706,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
gNB->uci_pdu_list[num_ucis].pdu_type = NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE;
|
||||
gNB->uci_pdu_list[num_ucis].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_2_3_4_t);
|
||||
nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu_format2 = &gNB->uci_pdu_list[num_ucis].pucch_pdu_format_2_3_4;
|
||||
LOG_D(PHY,"num_ucis = %d in case 1\n",num_ucis);
|
||||
|
||||
nr_decode_pucch2(gNB,
|
||||
slot_rx,
|
||||
|
||||
@@ -2079,13 +2079,11 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
|
||||
prach_resources->init_msg1 = 1;
|
||||
|
||||
} else {
|
||||
|
||||
nr_prach = nr_ue_get_rach(prach_resources, &ue->prach_vars[0]->prach_pdu, mod_id, ue->CC_id, frame_tx, gNB_id, nr_slot_tx);
|
||||
LOG_D(PHY, "In %s:[%d.%d] getting PRACH resources : %d\n", __FUNCTION__, frame_tx, nr_slot_tx,nr_prach);
|
||||
}
|
||||
|
||||
if (nr_prach > 0)
|
||||
LOG_I(PHY, "In %s: We are here with nr_prach = %u (GENERATE_PREAMBLE: 1)\n", __FUNCTION__, nr_prach);
|
||||
|
||||
if (nr_prach == GENERATE_PREAMBLE) {
|
||||
|
||||
if (ue->mac_enabled == 1) {
|
||||
@@ -2117,9 +2115,7 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_IN);
|
||||
|
||||
LOG_I(PHY, "In %s: We are here to call generate_nr_prach \n", __FUNCTION__);
|
||||
prach_power = generate_nr_prach(ue, gNB_id, nr_slot_tx);
|
||||
LOG_I(PHY, "In %s: We are here after calling generate_nr_prach \n", __FUNCTION__);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_OUT);
|
||||
|
||||
@@ -2132,10 +2128,8 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
|
||||
dB_fixed(prach_power),
|
||||
ue->prach_vars[gNB_id]->amp);
|
||||
|
||||
if (ue->mac_enabled == 1){
|
||||
if (ue->mac_enabled == 1)
|
||||
nr_Msg1_transmitted(mod_id, ue->CC_id, frame_tx, gNB_id);
|
||||
LOG_I(PHY, "In %s: We are here after nr_Msg1_transmitted\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
} else if (nr_prach == WAIT_CONTENTION_RESOLUTION) {
|
||||
LOG_D(PHY, "In %s: [UE %d] RA waiting contention resolution\n", __FUNCTION__, mod_id);
|
||||
|
||||
Reference in New Issue
Block a user