mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
Make the decidated structure the PRACH decoding values contextual
The function rx_nr_prach become autonomous, it doesn't read anymore global variables So, it can become (later) a threadpool work, that will send a message when it finishes rx_nr_prach_ru() still use some global variables, but it is executed in sequence, inside the ru main loop, that limits the probability of race conditions
This commit is contained in:
committed by
Robert Schmidt
parent
4f39ba8f51
commit
d745e6fcd3
@@ -1034,7 +1034,7 @@ void *ru_thread(void *param)
|
||||
RU_t *ru = (RU_t *)param;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
PHY_VARS_gNB *gNB = RC.gNB[0];
|
||||
PHY_VARS_gNB *gNB = RC.gNB[0]; // this RU main loop handes only one RU
|
||||
int ret;
|
||||
int slot = fp->slots_per_frame-1;
|
||||
int frame = 1023;
|
||||
@@ -1047,7 +1047,7 @@ void *ru_thread(void *param)
|
||||
// set default return value
|
||||
sprintf(threadname,"ru_thread %u",ru->idx);
|
||||
LOG_I(PHY,"Starting RU %d (%s,%s) on cpu %d\n",ru->idx,NB_functions[ru->function],NB_timing[ru->if_timing],sched_getcpu());
|
||||
ru->config = RC.gNB[0]->gNB_config;
|
||||
ru->config = gNB->gNB_config;
|
||||
|
||||
nr_init_frame_parms(&ru->config, fp);
|
||||
nr_dump_frame_parms(fp);
|
||||
@@ -1179,12 +1179,17 @@ void *ru_thread(void *param)
|
||||
proc->timestamp_tx += fp->get_samples_per_slot(i % fp->slots_per_frame, fp);
|
||||
proc->tti_tx = (proc->tti_rx + ru->sl_ahead) % fp->slots_per_frame;
|
||||
proc->frame_tx = proc->tti_rx > proc->tti_tx ? (proc->frame_rx + 1) & 1023 : proc->frame_rx;
|
||||
LOG_D(PHY,"AFTER fh_south_in - SFN/SL:%d%d RU->proc[RX:%d.%d TX:%d.%d] RC.gNB[0]:[RX:%d%d TX(SFN):%d]\n",
|
||||
frame,slot,
|
||||
proc->frame_rx,proc->tti_rx,
|
||||
proc->frame_tx,proc->tti_tx,
|
||||
RC.gNB[0]->proc.frame_rx,RC.gNB[0]->proc.slot_rx,
|
||||
RC.gNB[0]->proc.frame_tx);
|
||||
LOG_D(PHY,
|
||||
"AFTER fh_south_in - SFN/SL:%d%d RU->proc[RX:%d.%d TX:%d.%d] RC.gNB[0]:[RX:%d%d TX(SFN):%d]\n",
|
||||
frame,
|
||||
slot,
|
||||
proc->frame_rx,
|
||||
proc->tti_rx,
|
||||
proc->frame_tx,
|
||||
proc->tti_tx,
|
||||
gNB->proc.frame_rx,
|
||||
gNB->proc.slot_rx,
|
||||
gNB->proc.frame_tx);
|
||||
|
||||
if (ru->idx != 0)
|
||||
proc->frame_tx = (proc->frame_tx + proc->frame_offset) & 1023;
|
||||
@@ -1199,7 +1204,7 @@ void *ru_thread(void *param)
|
||||
LOG_D(NR_PHY, "Setting %d.%d (%d) to busy\n", proc->frame_rx, proc->tti_rx, proc->tti_rx % RU_RX_SLOT_DEPTH);
|
||||
//LOG_M("rxdata.m","rxs",ru->common.rxdata[0],1228800,1,1);
|
||||
LOG_D(PHY,"RU proc: frame_rx = %d, tti_rx = %d\n", proc->frame_rx, proc->tti_rx);
|
||||
gNBscopeCopy(RC.gNB[0],
|
||||
gNBscopeCopy(gNB,
|
||||
gNBRxdataF,
|
||||
ru->common.rxdataF[0],
|
||||
sizeof(c16_t),
|
||||
@@ -1208,33 +1213,12 @@ void *ru_thread(void *param)
|
||||
proc->tti_rx * gNB->frame_parms.samples_per_slot_wCP);
|
||||
|
||||
// Do PRACH RU processing
|
||||
prach_item_t *p = find_nr_prach(&ru->prach_list, proc->frame_rx, proc->tti_rx, SEARCH_EXIST);
|
||||
prach_item_t *p = find_nr_prach(&gNB->prach_list, proc->frame_rx, proc->tti_rx, SEARCH_EXIST);
|
||||
if (p) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 1 );
|
||||
|
||||
T(T_GNB_PHY_PRACH_INPUT_SIGNAL,
|
||||
T_INT(proc->frame_rx),
|
||||
T_INT(proc->tti_rx),
|
||||
T_INT(0),
|
||||
T_BUFFER(&ru->common.rxdata[0][fp->get_samples_slot_timestamp(proc->tti_rx - 1, fp, 0) /*-ru->N_TA_offset*/],
|
||||
(fp->get_samples_per_slot(proc->tti_rx - 1, fp) + fp->get_samples_per_slot(proc->tti_rx, fp)) * 4));
|
||||
int N_dur = get_nr_prach_duration(p->pdu.prach_format);
|
||||
LOG_D(NR_PHY_RACH, "%d.%d try to decode %d occasions \n", frame, slot, p->pdu.num_prach_ocas);
|
||||
for (int prach_oc = 0; prach_oc < p->pdu.num_prach_ocas; prach_oc++) {
|
||||
int prachStartSymbol = p->pdu.prach_start_symbol + prach_oc * N_dur;
|
||||
int beam_id = p->beams[prach_oc];
|
||||
//comment FK: the standard 38.211 section 5.3.2 has one extra term +14*N_RA_slot. This is because there prachStartSymbol is given wrt to start of the 15kHz slot or 60kHz slot. Here we work slot based, so this function is anyway only called in slots where there is PRACH. Its up to the MAC to schedule another PRACH PDU in the case there are there N_RA_slot \in {0,1}.
|
||||
rx_nr_prach_ru(ru,
|
||||
p->pdu.prach_format, // could also use format
|
||||
p->pdu.num_ra,
|
||||
beam_id,
|
||||
prachStartSymbol,
|
||||
p->slot,
|
||||
prach_oc,
|
||||
proc->frame_rx,
|
||||
proc->tti_rx);
|
||||
}
|
||||
free_nr_prach_entry(&ru->prach_list, p);
|
||||
// this fills ru->prach_rxsigF for processing by gNB
|
||||
p->rxsigF = (c16_t ***)ru->prach_rxsigF;
|
||||
rx_nr_prach_ru(p, ru->common.rxdata, ru->nr_frame_parms, ru->N_TA_offset);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 0);
|
||||
} // end if (prach_id >= 0)
|
||||
} // end if (ru->feprx)
|
||||
|
||||
Reference in New Issue
Block a user