Commit 6d82e7df authored by Robert Schmidt's avatar Robert Schmidt

Allow to use multiple PUCCH at once

We are required to store multiple PUCCH (e.g., for multiple UEs).
However, nr_fill_pucch() automatically freed the previously active PUCCH
structure. Of course(!) this does not make sense.

However, the problem is that init_nr_transport() allocated only one
PUCCH structure. Also this does not make sense to me. The problem was
that slot_ahead was 0, which logically cannot happen in this function
(because slot_ahead is illogical, we must give the radio some time). The
reason is that it uses if_inst->sl_ahead, which, prior to this commit,
was not set.

The init_nr_transport() function is called normally from main() through
init_eNB_afterRU(). In this case, we initialize if_inst->sl_ahead to
what is set in main(). In the PNF case, however, we call
init_nr_transport() from the PNF thread, when receiving the start
request. In the main(), we wait for this to happen, before setting
if_inst->sl_ahead. Hence, initializing this variable (which we should
safely be able to do) before solves the problem.
parent be5844db
......@@ -744,6 +744,9 @@ int main( int argc, char **argv ) {
nvIPC_Init();
#endif
for (int idx = 0; idx < RC.nb_nr_L1_inst; idx++)
RC.gNB[idx]->if_inst->sl_ahead = sl_ahead;
if (NFAPI_MODE==NFAPI_MODE_PNF) {
wait_nfapi_init("main?");
}
......@@ -756,7 +759,6 @@ int main( int argc, char **argv ) {
// once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration)
printf("ALL RUs ready - init gNBs\n");
for (int idx=0;idx<RC.nb_nr_L1_inst;idx++) RC.gNB[idx]->if_inst->sl_ahead = sl_ahead;
if(IS_SOFTMODEM_DOSCOPE) {
sleep(1);
scopeParms_t p;
......
......@@ -639,6 +639,7 @@ void init_nr_transport(PHY_VARS_gNB *gNB)
int buffer_ul_slots; // the UL channels are scheduled sl_ahead before they are transmitted
int slot_ahead = gNB->if_inst ? gNB->if_inst->sl_ahead : 6;
DevAssert(slot_ahead > 0);
if (slot_ahead > nb_slots_per_period)
buffer_ul_slots = nb_ul_slots_period + (slot_ahead - nb_slots_per_period);
else
......
......@@ -60,10 +60,6 @@ void nr_fill_pucch(PHY_VARS_gNB *gNB,
int slot,
nfapi_nr_pucch_pdu_t *pucch_pdu)
{
if (NFAPI_MODE == NFAPI_MODE_PNF)
gNB->pucch[0].active = 0; // check if ture in monolithic mode
bool found = false;
for (int i = 0; i < gNB->max_nb_pucch; i++) {
NR_gNB_PUCCH_t *pucch = &gNB->pucch[i];
......
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