Commit 8ad3b40c authored by francescomani's avatar francescomani

fixes in pucch configuration for SA

parent 5055023d
...@@ -91,6 +91,9 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue, ...@@ -91,6 +91,9 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
// the value of u,v (delta always 0 for PUCCH) has to be calculated according to TS 38.211 Subclause 6.3.2.2.1 // the value of u,v (delta always 0 for PUCCH) has to be calculated according to TS 38.211 Subclause 6.3.2.2.1
uint8_t u[2]={0,0},v[2]={0,0}; uint8_t u[2]={0,0},v[2]={0,0};
LOG_D(PHY,"pucch0: nr_symbols %d, start_symbol %d, prb_start %d, second_hop_prb %d, group_hop_flag %d, sequence_hop_flag %d, mcs %d\n",pucch_pdu->nr_of_symbols,pucch_pdu->start_symbol_index,pucch_pdu->prb_start,pucch_pdu->second_hop_prb,pucch_pdu->group_hop_flag,pucch_pdu->sequence_hop_flag,pucch_pdu->mcs);
#ifdef DEBUG_NR_PUCCH_TX #ifdef DEBUG_NR_PUCCH_TX
printf("\t [nr_generate_pucch0] sequence generation: variable initialization for test\n"); printf("\t [nr_generate_pucch0] sequence generation: variable initialization for test\n");
#endif #endif
......
...@@ -1310,6 +1310,27 @@ void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac, ...@@ -1310,6 +1310,27 @@ void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac,
} }
pucch_pdu->freq_hop_flag = 1; pucch_pdu->freq_hop_flag = 1;
pucch_pdu->time_domain_occ_idx = 0; pucch_pdu->time_domain_occ_idx = 0;
if (O_SR == 0 || pucch->sr_payload == 0) { /* only ack is transmitted TS 36.213 9.2.3 UE procedure for reporting HARQ-ACK */
if (O_ACK == 1)
pucch_pdu->mcs = sequence_cyclic_shift_1_harq_ack_bit[pucch->ack_payload & 0x1]; /* only harq of 1 bit */
else
pucch_pdu->mcs = sequence_cyclic_shift_2_harq_ack_bits[pucch->ack_payload & 0x3]; /* only harq with 2 bits */
}
else { /* SR + eventually ack are transmitted TS 36.213 9.2.5.1 UE procedure for multiplexing HARQ-ACK or CSI and SR */
if (pucch->sr_payload == 1) { /* positive scheduling request */
if (O_ACK == 1)
pucch_pdu->mcs = sequence_cyclic_shift_1_harq_ack_bit_positive_sr[pucch->ack_payload & 0x1]; /* positive SR and harq of 1 bit */
else if (O_ACK == 2)
pucch_pdu->mcs = sequence_cyclic_shift_2_harq_ack_bits_positive_sr[pucch->ack_payload & 0x3]; /* positive SR and harq with 2 bits */
else
pucch_pdu->mcs = 0; /* only positive SR */
}
}
// TODO verify if SR can be transmitted in this mode
pucch_pdu->payload = (pucch->sr_payload << O_ACK) | pucch->ack_payload;
} }
else if (pucch->pucch_resource != NULL) { else if (pucch->pucch_resource != NULL) {
...@@ -1522,6 +1543,10 @@ int16_t get_pucch_tx_power_ue(NR_UE_MAC_INST_t *mac, ...@@ -1522,6 +1543,10 @@ int16_t get_pucch_tx_power_ue(NR_UE_MAC_INST_t *mac,
else P_O_NOMINAL_PUCCH = *mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pucch_ConfigCommon->choice.setup->p0_nominal; else P_O_NOMINAL_PUCCH = *mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pucch_ConfigCommon->choice.setup->p0_nominal;
struct NR_PUCCH_PowerControl *power_config = pucch_Config->pucch_PowerControl; struct NR_PUCCH_PowerControl *power_config = pucch_Config->pucch_PowerControl;
if (!power_config)
return (PUCCH_POWER_DEFAULT);
int16_t P_O_UE_PUCCH; int16_t P_O_UE_PUCCH;
int16_t G_b_f_c = 0; int16_t G_b_f_c = 0;
...@@ -1730,7 +1755,7 @@ void select_pucch_resource(NR_UE_MAC_INST_t *mac, ...@@ -1730,7 +1755,7 @@ void select_pucch_resource(NR_UE_MAC_INST_t *mac,
NR_BWP_Id_t bwp_id = mac->UL_BWP_Id; NR_BWP_Id_t bwp_id = mac->UL_BWP_Id;
int n_list; int n_list;
if ((bwp_id ==0 && if ((bwp_id == 0 &&
mac->cg == NULL) || mac->cg == NULL) ||
(bwp_id == 0 && (bwp_id == 0 &&
mac->cg && mac->cg &&
...@@ -2033,6 +2058,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, ...@@ -2033,6 +2058,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
} }
pucch->ack_payload = o_ACK; pucch->ack_payload = o_ACK;
return(number_harq_feedback); return(number_harq_feedback);
} }
......
...@@ -1879,7 +1879,10 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in ...@@ -1879,7 +1879,10 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
// if multiplexing of HARQ and CSI is not possible, transmit only HARQ bits // if multiplexing of HARQ and CSI is not possible, transmit only HARQ bits
if ((O_ACK != 0) && (O_ACK != 0) && pucch_Config && (pucch_Config->format2->choice.setup->simultaneousHARQ_ACK_CSI == NULL)) { if ((O_ACK != 0) && (O_CSI != 0) &&
pucch_Config &&
pucch_Config->format2 &&
(pucch_Config->format2->choice.setup->simultaneousHARQ_ACK_CSI == NULL)) {
O_CSI = 0; O_CSI = 0;
pucch->csi_part1_payload = 0; pucch->csi_part1_payload = 0;
pucch->csi_part2_payload = 0; pucch->csi_part2_payload = 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