Commit 909f0ad4 authored by francescomani's avatar francescomani

changing the name of a function

parent 366c42e6
...@@ -473,7 +473,7 @@ int get_subband_size(int NPRB,int size) { ...@@ -473,7 +473,7 @@ int get_subband_size(int NPRB,int size) {
} }
// from start symbol index and nb or symbols to symbol occupation bitmap in a slot // from start symbol index and nb or symbols to symbol occupation bitmap in a slot
uint16_t startandlength_to_bitmat(int startSymbolIndex, int nrOfSymbols) { uint16_t SL_to_bitmap(int startSymbolIndex, int nrOfSymbols) {
return (((1<<nrOfSymbols)-1)<<startSymbolIndex); return (((1<<nrOfSymbols)-1)<<startSymbolIndex);
} }
......
...@@ -71,7 +71,7 @@ uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx); ...@@ -71,7 +71,7 @@ uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx);
int get_subband_size(int NPRB,int size); int get_subband_size(int NPRB,int size);
void SLIV2SL(int SLIV,int *S,int *L); void SLIV2SL(int SLIV,int *S,int *L);
int get_dmrs_port(int nl, uint16_t dmrs_ports); int get_dmrs_port(int nl, uint16_t dmrs_ports);
uint16_t startandlength_to_bitmat(int startSymbolIndex, int nrOfSymbols); uint16_t SL_to_bitmap(int startSymbolIndex, int nrOfSymbols);
#define CEILIDIV(a,b) ((a+b-1)/b) #define CEILIDIV(a,b) ((a+b-1)/b)
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1)) #define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
......
...@@ -739,7 +739,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t ...@@ -739,7 +739,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t
int BWPSize = nr_mac->type0_PDCCH_CSS_config[ra->beam_id].num_rbs; int BWPSize = nr_mac->type0_PDCCH_CSS_config[ra->beam_id].num_rbs;
int rbStart = 0; int rbStart = 0;
for (int i = 0; (i < ra->msg3_nb_rb) && (rbStart <= (BWPSize - ra->msg3_nb_rb)); i++) { for (int i = 0; (i < ra->msg3_nb_rb) && (rbStart <= (BWPSize - ra->msg3_nb_rb)); i++) {
if (vrb_map_UL[rbStart + BWPStart + i]&startandlength_to_bitmat(StartSymbolIndex, NrOfSymbols)) { if (vrb_map_UL[rbStart + BWPStart + i]&SL_to_bitmap(StartSymbolIndex, NrOfSymbols)) {
rbStart += i; rbStart += i;
i = 0; i = 0;
} }
...@@ -844,7 +844,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t ...@@ -844,7 +844,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t
// Mark the corresponding RBs as used // Mark the corresponding RBs as used
for (int rb = 0; rb < ra->msg3_nb_rb; rb++) { for (int rb = 0; rb < ra->msg3_nb_rb; rb++) {
vrb_map_UL[rbStart + BWPStart + rb] |= startandlength_to_bitmat(StartSymbolIndex, NrOfSymbols); vrb_map_UL[rbStart + BWPStart + rb] |= SL_to_bitmap(StartSymbolIndex, NrOfSymbols);
} }
// reset state to wait msg3 // reset state to wait msg3
...@@ -943,11 +943,11 @@ void nr_get_Msg3alloc(module_id_t module_id, ...@@ -943,11 +943,11 @@ void nr_get_Msg3alloc(module_id_t module_id,
rbStart += rbSize; /* last iteration rbSize was not enough, skip it */ rbStart += rbSize; /* last iteration rbSize was not enough, skip it */
rbSize = 0; rbSize = 0;
while (rbStart < bwpSize && while (rbStart < bwpSize &&
(vrb_map_UL[rbStart + bwpStart]&startandlength_to_bitmat(StartSymbolIndex, NrOfSymbols))) (vrb_map_UL[rbStart + bwpStart]&SL_to_bitmap(StartSymbolIndex, NrOfSymbols)))
rbStart++; rbStart++;
AssertFatal(rbStart < bwpSize - msg3_nb_rb, "no space to allocate Msg 3 for RA!\n"); AssertFatal(rbStart < bwpSize - msg3_nb_rb, "no space to allocate Msg 3 for RA!\n");
while (rbStart + rbSize < bwpSize while (rbStart + rbSize < bwpSize
&& !(vrb_map_UL[rbStart + bwpStart + rbSize]&startandlength_to_bitmat(StartSymbolIndex, NrOfSymbols)) && !(vrb_map_UL[rbStart + bwpStart + rbSize]&SL_to_bitmap(StartSymbolIndex, NrOfSymbols))
&& rbSize < msg3_nb_rb) && rbSize < msg3_nb_rb)
rbSize++; rbSize++;
} }
...@@ -1044,7 +1044,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t ...@@ -1044,7 +1044,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t
i + ra->msg3_first_rb, i + ra->msg3_first_rb,
ra->Msg3_frame, ra->Msg3_frame,
ra->Msg3_slot); ra->Msg3_slot);
vrb_map_UL[i + ra->msg3_first_rb + ra->msg3_bwp_start] |= startandlength_to_bitmat(ra->msg3_startsymb, ra->msg3_nrsymb); vrb_map_UL[i + ra->msg3_first_rb + ra->msg3_bwp_start] |= SL_to_bitmap(ra->msg3_startsymb, ra->msg3_nrsymb);
} }
LOG_D(NR_MAC, "[gNB %d][RAPROC] Frame %d, Slot %d : CC_id %d RA is active, Msg3 in (%d,%d)\n", module_idP, frameP, slotP, CC_id, ra->Msg3_frame, ra->Msg3_slot); LOG_D(NR_MAC, "[gNB %d][RAPROC] Frame %d, Slot %d : CC_id %d RA is active, Msg3 in (%d,%d)\n", module_idP, frameP, slotP, CC_id, ra->Msg3_frame, ra->Msg3_slot);
......
...@@ -474,7 +474,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ ...@@ -474,7 +474,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_
uint16_t *vrb_map_UL = uint16_t *vrb_map_UL =
&RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[sched_slot * MAX_BWP_SIZE]; &RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[sched_slot * MAX_BWP_SIZE];
for (int i = rbStart; i < rbStart + rbSize; ++i) { for (int i = rbStart; i < rbStart + rbSize; ++i) {
if ((vrb_map_UL[i+BWPStart] & startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols)) != 0) { if ((vrb_map_UL[i+BWPStart] & SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)) != 0) {
LOG_E(MAC, LOG_E(MAC,
"%s(): %4d.%2d RB %d is already reserved, cannot schedule UE\n", "%s(): %4d.%2d RB %d is already reserved, cannot schedule UE\n",
__func__, __func__,
...@@ -543,6 +543,6 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ ...@@ -543,6 +543,6 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_
/* mark the corresponding RBs as used */ /* mark the corresponding RBs as used */
for (int rb = rbStart; rb < rbStart + rbSize; rb++) for (int rb = rbStart; rb < rbStart + rbSize; rb++)
vrb_map_UL[rb+BWPStart] |= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); vrb_map_UL[rb+BWPStart] |= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
return true; return true;
} }
...@@ -951,7 +951,7 @@ bool allocate_ul_retransmission(module_id_t module_id, ...@@ -951,7 +951,7 @@ bool allocate_ul_retransmission(module_id_t module_id,
/* Check the resource is enough for retransmission */ /* Check the resource is enough for retransmission */
while (rbStart < bwpSize && while (rbStart < bwpSize &&
!(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)))
rbStart++; rbStart++;
if (rbStart + retInfo->rbSize > bwpSize) { if (rbStart + retInfo->rbSize > bwpSize) {
LOG_W(NR_MAC, "cannot allocate retransmission of UE %d/RNTI %04x: no resources (rbStart %d, retInfo->rbSize %d, bwpSize %d\n", UE_id, UE_info->rnti[UE_id], rbStart, retInfo->rbSize, bwpSize); LOG_W(NR_MAC, "cannot allocate retransmission of UE %d/RNTI %04x: no resources (rbStart %d, retInfo->rbSize %d, bwpSize %d\n", UE_id, UE_info->rnti[UE_id], rbStart, retInfo->rbSize, bwpSize);
...@@ -966,11 +966,11 @@ bool allocate_ul_retransmission(module_id_t module_id, ...@@ -966,11 +966,11 @@ bool allocate_ul_retransmission(module_id_t module_id,
/* the retransmission will use a different time domain allocation, check /* the retransmission will use a different time domain allocation, check
* that we have enough resources */ * that we have enough resources */
while (rbStart < bwpSize && while (rbStart < bwpSize &&
!(rballoc_mask[rbStart]&startandlength_to_bitmat(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) !(rballoc_mask[rbStart]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols)))
rbStart++; rbStart++;
int rbSize = 0; int rbSize = 0;
while (rbStart + rbSize < bwpSize && while (rbStart + rbSize < bwpSize &&
(rballoc_mask[rbStart + rbSize]&startandlength_to_bitmat(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols)))
rbSize++; rbSize++;
uint32_t new_tbs; uint32_t new_tbs;
uint16_t new_rbSize; uint16_t new_rbSize;
...@@ -1027,7 +1027,7 @@ bool allocate_ul_retransmission(module_id_t module_id, ...@@ -1027,7 +1027,7 @@ bool allocate_ul_retransmission(module_id_t module_id,
/* Mark the corresponding RBs as used */ /* Mark the corresponding RBs as used */
n_rb_sched -= sched_pusch->rbSize; n_rb_sched -= sched_pusch->rbSize;
for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++) for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++)
rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= startandlength_to_bitmat(sched_ctrl->pusch_semi_static.startSymbolIndex, sched_ctrl->pusch_semi_static.nrOfSymbols); rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= SL_to_bitmap(sched_ctrl->pusch_semi_static.startSymbolIndex, sched_ctrl->pusch_semi_static.nrOfSymbols);
return true; return true;
} }
...@@ -1140,7 +1140,7 @@ void pf_ul(module_id_t module_id, ...@@ -1140,7 +1140,7 @@ void pf_ul(module_id_t module_id,
LOG_D(NR_MAC,"Looking for min_rb %d RBs, starting at %d\n", min_rb, rbStart); LOG_D(NR_MAC,"Looking for min_rb %d RBs, starting at %d\n", min_rb, rbStart);
while (rbStart < bwpSize && while (rbStart < bwpSize &&
!(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)))
rbStart++; rbStart++;
if (rbStart + min_rb >= bwpSize) { if (rbStart + min_rb >= bwpSize) {
LOG_W(NR_MAC, "cannot allocate continuous UL data for UE %d/RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d\n", LOG_W(NR_MAC, "cannot allocate continuous UL data for UE %d/RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d\n",
...@@ -1166,7 +1166,7 @@ void pf_ul(module_id_t module_id, ...@@ -1166,7 +1166,7 @@ void pf_ul(module_id_t module_id,
/* Mark the corresponding RBs as used */ /* Mark the corresponding RBs as used */
n_rb_sched -= sched_pusch->rbSize; n_rb_sched -= sched_pusch->rbSize;
for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++) for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++)
rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
continue; continue;
} }
...@@ -1237,12 +1237,12 @@ void pf_ul(module_id_t module_id, ...@@ -1237,12 +1237,12 @@ void pf_ul(module_id_t module_id,
update_ul_ue_R_Qm(sched_pusch, ps); update_ul_ue_R_Qm(sched_pusch, ps);
while (rbStart < bwpSize && while (rbStart < bwpSize &&
!(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)))
rbStart++; rbStart++;
sched_pusch->rbStart = rbStart; sched_pusch->rbStart = rbStart;
uint16_t max_rbSize = 1; uint16_t max_rbSize = 1;
while (rbStart + max_rbSize < bwpSize && while (rbStart + max_rbSize < bwpSize &&
(rballoc_mask[rbStart + max_rbSize]&&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) (rballoc_mask[rbStart + max_rbSize]&&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)))
max_rbSize++; max_rbSize++;
if (rbStart + min_rb >= bwpSize) { if (rbStart + min_rb >= bwpSize) {
...@@ -1273,7 +1273,7 @@ void pf_ul(module_id_t module_id, ...@@ -1273,7 +1273,7 @@ void pf_ul(module_id_t module_id,
/* Mark the corresponding RBs as used */ /* Mark the corresponding RBs as used */
n_rb_sched -= sched_pusch->rbSize; n_rb_sched -= sched_pusch->rbSize;
for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++) for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++)
rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
} }
} }
...@@ -1342,7 +1342,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t ...@@ -1342,7 +1342,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength;
int startSymbolIndex, nrOfSymbols; int startSymbolIndex, nrOfSymbols;
SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols); SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols);
const uint16_t symb = startandlength_to_bitmat(startSymbolIndex, nrOfSymbols); const uint16_t symb = SL_to_bitmap(startSymbolIndex, nrOfSymbols);
int st = 0, e = 0, len = 0; int st = 0, e = 0, len = 0;
...@@ -1365,7 +1365,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t ...@@ -1365,7 +1365,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
/* Calculate mask: if any RB in vrb_map_UL is blocked (1), the current RB will be 0 */ /* Calculate mask: if any RB in vrb_map_UL is blocked (1), the current RB will be 0 */
for (int i = 0; i < bwpSize; i++) for (int i = 0; i < bwpSize; i++)
rballoc_mask[i] = (i >= st && i <= e)*startandlength_to_bitmat(startSymbolIndex, nrOfSymbols); rballoc_mask[i] = (i >= st && i <= e)*SL_to_bitmap(startSymbolIndex, nrOfSymbols);
/* proportional fair scheduling algorithm */ /* proportional fair scheduling algorithm */
pf_ul(module_id, pf_ul(module_id,
......
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