create a trace group for nr rach

This commit is contained in:
Laurent THOMAS
2025-10-30 11:54:41 +01:00
committed by Robert Schmidt
parent 180f83d196
commit 4f39ba8f51
6 changed files with 39 additions and 9 deletions
+11 -4
View File
@@ -46,6 +46,8 @@ void init_prach_list(prach_list_t *l)
void free_nr_prach_entry(prach_list_t *l, prach_item_t *p)
{
pthread_mutex_lock(&l->prach_list_mutex);
if (p->frame == -1)
LOG_E(NR_PHY_RACH, "Freeing a not allocated prach entry\n");
*p = (prach_item_t){.frame = -1, .slot = -1, .num_slots = -1};
pthread_mutex_unlock(&l->prach_list_mutex);
}
@@ -421,7 +423,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
const int prach_fmt = prach_pdu->prach_format;
const int N_ZC = prach_sequence_length == 0 ? 839 : 139;
LOG_D(PHY,
LOG_D(NR_PHY_RACH,
"L1 PRACH RX: rooSequenceIndex %d, numRootSeqeuences %d, NCS %d, N_ZC %d, format %d \n",
rootSequenceIndex,
numrootSequenceIndex,
@@ -550,7 +552,12 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
en);
}
LOG_D(PHY,"PRACH RX preamble_index %d, preamble_offset %d\n",preamble_index,preamble_offset);
LOG_D(NR_PHY_RACH,
"PRACH RX preamble_index %d, preamble_offset %d, preamb shift %d new dft %d\n",
preamble_index,
preamble_offset,
preamble_shift,
new_dft);
if (new_dft) {
new_dft = false;
@@ -606,8 +613,8 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
for (int i = 0; i < NCS2; i++) {
int lev = prach_ifft[preamble_shift2 + i];
int levdB = dB_fixed_times10(lev);
if (levdB>*max_preamble_energy) {
LOG_D(PHY,"preamble_index %d, delay %d en %d dB > %d dB\n",preamble_index,i,levdB,*max_preamble_energy);
if (levdB > *max_preamble_energy || (levdB == *max_preamble_energy && *max_preamble_delay > i)) {
LOG_D(NR_PHY_RACH, "preamble_index %d, delay %d en %d dB > %d dB\n", preamble_index, i, levdB, *max_preamble_energy);
*max_preamble_energy = levdB;
*max_preamble_delay = i; // Note: This has to be normalized to the 30.72 Ms/s sampling rate
*max_preamble = preamble_index;
+1
View File
@@ -154,6 +154,7 @@ void nr_schedule_ul_tti_req(PHY_VARS_gNB *gNB, nfapi_nr_ul_tti_request_t *UL_tti
UL_tti_req->SFN,
UL_tti_req->Slot);
nfapi_nr_prach_pdu_t *prach_pdu = &UL_tti_req->pdus_list[i].prach_pdu;
LOG_D(NR_PHY_RACH, "Add prach decoding request for %d.%d\n", UL_tti_req->SFN, UL_tti_req->Slot);
prach_item_t *prach = nr_fill_prach(gNB, UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu);
if (prach && (gNB->RU_list[0]->if_south == LOCAL_RF || gNB->RU_list[0]->if_south == REMOTE_IF5))
nr_fill_prach_ru(gNB->RU_list[0], prach);
+2 -2
View File
@@ -64,8 +64,8 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_rac
return;
}
LOG_D(NR_PHY, "%d.%d Got prach entry\n", frame, slot);
nfapi_nr_prach_pdu_t *prach_pdu = &prach_id->pdu;
LOG_D(NR_PHY_RACH, "%d.%d, prachstart slot %d prach entry occas %d\n", frame, slot, prach_id->slot, prach_pdu->num_prach_ocas);
const int prach_start_slot = prach_id->slot;
int N_dur = get_nr_prach_duration(prach_pdu->prach_format);
@@ -137,7 +137,7 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_rac
gNB->prach_energy_counter++;
} // if prach_id>0
rach_ind->slot = prach_start_slot;
LOG_D(NR_PHY, "Freeing PRACH entry\n");
LOG_D(NR_PHY_RACH, "Freeing PRACH entry\n");
free_nr_prach_entry(&gNB->prach_list, prach_id);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0);
}