Merge remote-tracking branch 'origin/fix-msg2-gnb' into integration_2024_w14
This commit is contained in:
@@ -531,7 +531,6 @@ typedef struct {
|
||||
|
||||
|
||||
#define MAX_NUM_NR_RX_RACH_PDUS 4
|
||||
#define MAX_NUM_NR_RX_PRACH_PREAMBLES 4
|
||||
#define MAX_UL_PDUS_PER_SLOT 8
|
||||
#define MAX_NUM_NR_SRS_PDUS 8
|
||||
// the current RRC resource allocation is that each UE gets its
|
||||
@@ -573,8 +572,6 @@ typedef struct PHY_VARS_gNB_s {
|
||||
nfapi_nr_uci_t uci_pdu_list[MAX_NUM_NR_UCI_PDUS];
|
||||
/// NFAPI PRACH information
|
||||
nfapi_nr_prach_indication_pdu_t prach_pdu_indication_list[MAX_NUM_NR_RX_RACH_PDUS];
|
||||
/// NFAPI PRACH information
|
||||
nfapi_nr_prach_indication_preamble_t preamble_list[MAX_NUM_NR_RX_PRACH_PREAMBLES];
|
||||
|
||||
nfapi_nr_ul_tti_request_t UL_tti_req;
|
||||
nfapi_nr_uci_indication_t uci_indication;
|
||||
|
||||
@@ -152,38 +152,43 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot) {
|
||||
gNB->prach_energy_counter);
|
||||
|
||||
if ((gNB->prach_energy_counter == 100) && (max_preamble_energy[0] > gNB->measurements.prach_I0+gNB->prach_thres)) {
|
||||
|
||||
LOG_I(NR_PHY,"[gNB %d][RAPROC] Frame %d, slot %d Initiating RA procedure with preamble %d, energy %d.%d dB (I0 %d, thres %d), delay %d start symbol %u freq index %u\n",
|
||||
gNB->Mod_id,
|
||||
frame,
|
||||
slot,
|
||||
max_preamble[0],
|
||||
max_preamble_energy[0]/10,
|
||||
max_preamble_energy[0]%10,
|
||||
gNB->measurements.prach_I0,gNB->prach_thres,
|
||||
max_preamble_delay[0],
|
||||
prachStartSymbol,
|
||||
prach_pdu->num_ra);
|
||||
|
||||
T(T_ENB_PHY_INITIATE_RA_PROCEDURE, T_INT(gNB->Mod_id), T_INT(frame), T_INT(slot),
|
||||
T_INT(max_preamble[0]), T_INT(max_preamble_energy[0]), T_INT(max_preamble_delay[0]));
|
||||
|
||||
|
||||
gNB->UL_INFO.rach_ind.number_of_pdus += 1;
|
||||
|
||||
gNB->prach_pdu_indication_list[pdu_index].phy_cell_id = gNB->gNB_config.cell_config.phy_cell_id.value;
|
||||
gNB->prach_pdu_indication_list[pdu_index].symbol_index = prachStartSymbol;
|
||||
gNB->prach_pdu_indication_list[pdu_index].slot_index = slot;
|
||||
gNB->prach_pdu_indication_list[pdu_index].freq_index = prach_pdu->num_ra;
|
||||
gNB->prach_pdu_indication_list[pdu_index].avg_rssi = (max_preamble_energy[0]<631) ? (128+(max_preamble_energy[0]/5)) : 254;
|
||||
gNB->prach_pdu_indication_list[pdu_index].avg_snr = 0xff; // invalid for now
|
||||
|
||||
gNB->prach_pdu_indication_list[pdu_index].num_preamble = 1;
|
||||
gNB->prach_pdu_indication_list[pdu_index].preamble_list = gNB->preamble_list;
|
||||
gNB->prach_pdu_indication_list[pdu_index].preamble_list[0].preamble_index = max_preamble[0];
|
||||
gNB->prach_pdu_indication_list[pdu_index].preamble_list[0].timing_advance = max_preamble_delay[0];
|
||||
gNB->prach_pdu_indication_list[pdu_index].preamble_list[0].preamble_pwr = 0xffffffff;
|
||||
pdu_index++;
|
||||
LOG_I(NR_PHY,
|
||||
"[RAPROC] %d.%d Initiating RA procedure with preamble %d, energy %d.%d dB (I0 %d, thres %d), delay %d start symbol "
|
||||
"%u freq index %u\n",
|
||||
frame,
|
||||
slot,
|
||||
max_preamble[0],
|
||||
max_preamble_energy[0] / 10,
|
||||
max_preamble_energy[0] % 10,
|
||||
gNB->measurements.prach_I0,
|
||||
gNB->prach_thres,
|
||||
max_preamble_delay[0],
|
||||
prachStartSymbol,
|
||||
prach_pdu->num_ra);
|
||||
|
||||
T(T_ENB_PHY_INITIATE_RA_PROCEDURE,
|
||||
T_INT(gNB->Mod_id),
|
||||
T_INT(frame),
|
||||
T_INT(slot),
|
||||
T_INT(max_preamble[0]),
|
||||
T_INT(max_preamble_energy[0]),
|
||||
T_INT(max_preamble_delay[0]));
|
||||
|
||||
gNB->UL_INFO.rach_ind.number_of_pdus += 1;
|
||||
|
||||
nfapi_nr_prach_indication_pdu_t *ind = &gNB->prach_pdu_indication_list[pdu_index];
|
||||
ind->phy_cell_id = gNB->gNB_config.cell_config.phy_cell_id.value;
|
||||
ind->symbol_index = prachStartSymbol;
|
||||
ind->slot_index = slot;
|
||||
ind->freq_index = prach_pdu->num_ra;
|
||||
ind->avg_rssi = (max_preamble_energy[0] < 631) ? (128 + (max_preamble_energy[0] / 5)) : 254;
|
||||
ind->avg_snr = 0xff; // invalid for now
|
||||
|
||||
ind->num_preamble = 1;
|
||||
ind->preamble_list[0].preamble_index = max_preamble[0];
|
||||
ind->preamble_list[0].timing_advance = max_preamble_delay[0];
|
||||
ind->preamble_list[0].preamble_pwr = 0xffffffff;
|
||||
pdu_index++;
|
||||
}
|
||||
gNB->measurements.prach_I0 = ((gNB->measurements.prach_I0*900)>>10) + ((max_preamble_energy[0]*124)>>10);
|
||||
if (frame==0) LOG_I(PHY,"prach_I0 = %d.%d dB\n",gNB->measurements.prach_I0/10,gNB->measurements.prach_I0%10);
|
||||
|
||||
@@ -125,16 +125,14 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
|
||||
rach_ind->pdu_list[pdu_index].freq_index = prach_pdu->num_ra;
|
||||
rach_ind->pdu_list[pdu_index].avg_rssi = 128;
|
||||
rach_ind->pdu_list[pdu_index].avg_snr = 0xff; // invalid for now
|
||||
rach_ind->pdu_list[pdu_index].num_preamble = 1;
|
||||
const int num_p = rach_ind->pdu_list[pdu_index].num_preamble;
|
||||
rach_ind->pdu_list[pdu_index].preamble_list = calloc(num_p, sizeof(nfapi_nr_prach_indication_preamble_t));
|
||||
AssertFatal(num_p == 1, "can handle only one preamble in preamble_list\n");
|
||||
rach_ind->pdu_list[pdu_index].num_preamble = 1;
|
||||
rach_ind->pdu_list[pdu_index].preamble_list[0].preamble_index = prach_pdu->ra_PreambleIndex;
|
||||
rach_ind->pdu_list[pdu_index].preamble_list[0].timing_advance = 0;
|
||||
rach_ind->pdu_list[pdu_index].preamble_list[0].preamble_pwr = 0xffffffff;
|
||||
|
||||
if (!put_queue(&nr_rach_ind_queue, rach_ind)) {
|
||||
for (int pdu_index = 0; pdu_index < rach_ind->number_of_pdus; pdu_index++)
|
||||
free(rach_ind->pdu_list[pdu_index].preamble_list);
|
||||
free(rach_ind->pdu_list);
|
||||
free(rach_ind);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user