Files
openairinterface5g/openair1/SIMULATION/NR_PHY/nr_unitary_common.c
T
Robert Schmidt 463a3ad1cf Merge remote-tracking branch 'origin/l1-rx-use-queues' into integration_2026_w16 (!3991)
L1 RX: use queues instead of arrays and linear search for PUCCH, PUSCH, SRS, PRACH

This MR is an attempt to reduce the time L1 RX searches in array for the
next job to process, and instead use a queue. This queue is a FIFO,
because the various jobs (FAPI messages) to process come in order, and
need to be processed in order. The MR (hopefully, to be measured)
reduces the amount of time spent searching for the next UE (because the
next job is always at the beginning of the queue), and should scale
better for many UEs.

It does the following:

- introduce two helper libraries for (1) Frame.Slot calculation (sfn_t),
  already introduced in !3521 (merged) commit 3102068e, and (2) a ring
  buffer with fixed size
- use sfn_t and ring buffer (gNB->pucch_queue) to remove the linear
  array for PUCCH (gNB->pucch)
- use sfn_t and ring buffer (gNB->pusch_queue) for some PUSCH lookups.
  Because we need to still store PUSCH contexts, gNB->pusch is still
  there
- use sfn_t and ring buffer (gNB->srs_queue) to remove the linear array
  for SRS (gNB->srs)
- use sfn_t and ring buffers (gNB->prach_ru_queue and
  gNB->prach_l1rx_queue) to remove the linear array for PRACH
  (gNB->prach_list)
- some minor cleanups, e.g., additional loops over the PUSCH array,
  using const, using pointers instead of indices, etc
2026-04-16 13:50:53 +02:00

71 lines
1.7 KiB
C

/*
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
*/
/*!\file openair1/SIMULATION/NR_PHY/nr_unitary_common.c
* \brief common functions to NR PHY unitary tests
* \company EURECOM
*/
#include "nfapi/oai_integration/vendor_ext.h"
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h"
#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h"
#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h"
#include "openair1/PHY/defs_nr_UE.h"
#include "position_interface.h"
// Define signal handler to attempt graceful termination
bool stop = false;
void sigint_handler(int arg)
{
static const char msg[] = "\nCaught SIGINT, shutting down\nPress again CTRL+C to force shutdown\n";
__attribute__((unused)) int unused = write(STDOUT_FILENO, msg, sizeof(msg) - 1);
UNUSED(arg);
stop = true;
}
int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind)
{
UNUSED(ind);
return (0);
}
int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind)
{
UNUSED(ind);
return (0);
}
int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind)
{
UNUSED(ind);
return (0);
}
int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind)
{
UNUSED(ind);
return (0);
}
int oai_nfapi_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind)
{
UNUSED(ind);
return 0;
}
void handle_nr_slot_ind(uint16_t sfn, uint16_t slot)
{
UNUSED(sfn);
UNUSED(slot);
}
void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port)
{
UNUSED(vnf_ip_addr);
UNUSED(vnf_p5_port);
UNUSED(pnf_ip_addr);
UNUSED(pnf_p7_port);
UNUSED(vnf_p7_port);
}
void configure_nr_nfapi_vnf(eth_params_t params)
{
UNUSED(params);
}