Commit c30f478d authored by luis_pereira87's avatar luis_pereira87

Improve PUCCH configuration procedures

parent 0166cd05
...@@ -1488,12 +1488,8 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra ...@@ -1488,12 +1488,8 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
return; return;
} }
int n_rb=0; int n_rb,rb_offset;
for (int i=0;i<6;i++) get_coreset_rballoc(coreset->frequencyDomainResources.buf,&n_rb,&rb_offset);
for (int j=0;j<8;j++) {
n_rb+=((coreset->frequencyDomainResources.buf[i]>>j)&1);
}
n_rb*=6;
const uint16_t N_cce = n_rb * coreset->duration / NR_NB_REG_PER_CCE; const uint16_t N_cce = n_rb * coreset->duration / NR_NB_REG_PER_CCE;
const int delta_PRI=0; const int delta_PRI=0;
int r_pucch = ((CCEIndex<<1)/N_cce)+(delta_PRI<<1); int r_pucch = ((CCEIndex<<1)/N_cce)+(delta_PRI<<1);
......
...@@ -635,7 +635,13 @@ bool allocate_dl_retransmission(module_id_t module_id, ...@@ -635,7 +635,13 @@ bool allocate_dl_retransmission(module_id_t module_id,
/* Find PUCCH occasion: if it fails, undo CCE allocation (undoing PUCCH /* Find PUCCH occasion: if it fails, undo CCE allocation (undoing PUCCH
* allocation after CCE alloc fail would be more complex) */ * allocation after CCE alloc fail would be more complex) */
const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, -1, 0); int n_rb,rb_offset;
get_coreset_rballoc(sched_ctrl->coreset->frequencyDomainResources.buf,&n_rb,&rb_offset);
const uint16_t N_cce = n_rb * sched_ctrl->coreset->duration / NR_NB_REG_PER_CCE;
const int delta_PRI=0;
int r_pucch = ((sched_ctrl->cce_index<<1)/N_cce)+(delta_PRI<<1);
const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, r_pucch, 0);
if (alloc<0) { if (alloc<0) {
LOG_D(MAC, LOG_D(MAC,
"%s(): could not find PUCCH for UE %d/%04x@%d.%d\n", "%s(): could not find PUCCH for UE %d/%04x@%d.%d\n",
...@@ -789,7 +795,13 @@ void pf_dl(module_id_t module_id, ...@@ -789,7 +795,13 @@ void pf_dl(module_id_t module_id,
/* Find PUCCH occasion: if it fails, undo CCE allocation (undoing PUCCH /* Find PUCCH occasion: if it fails, undo CCE allocation (undoing PUCCH
* allocation after CCE alloc fail would be more complex) */ * allocation after CCE alloc fail would be more complex) */
const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, -1, 0); int n_rb,rb_offset;
get_coreset_rballoc(sched_ctrl->coreset->frequencyDomainResources.buf,&n_rb,&rb_offset);
const uint16_t N_cce = n_rb * sched_ctrl->coreset->duration / NR_NB_REG_PER_CCE;
const int delta_PRI=0;
int r_pucch = ((sched_ctrl->cce_index<<1)/N_cce)+(delta_PRI<<1);
const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, r_pucch, 0);
if (alloc<0) { if (alloc<0) {
LOG_D(NR_MAC, LOG_D(NR_MAC,
"%s(): could not find PUCCH for UE %d/%04x@%d.%d\n", "%s(): could not find PUCCH for UE %d/%04x@%d.%d\n",
......
...@@ -348,7 +348,13 @@ void nr_preprocessor_phytest(module_id_t module_id, ...@@ -348,7 +348,13 @@ void nr_preprocessor_phytest(module_id_t module_id,
__func__, __func__,
UE_id); UE_id);
const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, -1, 0); int n_rb,rb_offset;
get_coreset_rballoc(sched_ctrl->coreset->frequencyDomainResources.buf,&n_rb,&rb_offset);
const uint16_t N_cce = n_rb * sched_ctrl->coreset->duration / NR_NB_REG_PER_CCE;
const int delta_PRI=0;
int r_pucch = ((sched_ctrl->cce_index<<1)/N_cce)+(delta_PRI<<1);
const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, r_pucch, 0);
if (alloc < 0) { if (alloc < 0) {
LOG_D(MAC, LOG_D(MAC,
"%s(): could not find PUCCH for UE %d/%04x@%d.%d\n", "%s(): could not find PUCCH for UE %d/%04x@%d.%d\n",
......
...@@ -947,7 +947,7 @@ void nr_configure_pucch(module_id_t module_id, ...@@ -947,7 +947,7 @@ void nr_configure_pucch(module_id_t module_id,
pucch_pdu->bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); pucch_pdu->bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE);
pucch_pdu->subcarrier_spacing = genericParameters->subcarrierSpacing; pucch_pdu->subcarrier_spacing = genericParameters->subcarrierSpacing;
pucch_pdu->cyclic_prefix = (genericParameters->cyclicPrefix==NULL) ? 0 : *genericParameters->cyclicPrefix; pucch_pdu->cyclic_prefix = (genericParameters->cyclicPrefix==NULL) ? 0 : *genericParameters->cyclicPrefix;
if (r_pucch<0 || bwp ){ if (bwp || bwpd) {
LOG_D(NR_MAC,"pucch_acknak: Filling dedicated configuration for PUCCH\n"); LOG_D(NR_MAC,"pucch_acknak: Filling dedicated configuration for PUCCH\n");
// we have either a dedicated BWP or Dedicated PUCCH configuration on InitialBWP // we have either a dedicated BWP or Dedicated PUCCH configuration on InitialBWP
AssertFatal(bwp!=NULL || bwpd!=NULL,"We need one dedicated configuration for a BWP (neither additional or initial BWP has a dedicated configuration)\n"); AssertFatal(bwp!=NULL || bwpd!=NULL,"We need one dedicated configuration for a BWP (neither additional or initial BWP has a dedicated configuration)\n");
......
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