Applied clang formatting

This commit is contained in:
Sagar Parsawar
2023-08-08 18:35:05 +02:00
committed by francescomani
parent 4f9aa86510
commit f64179039e
12 changed files with 124 additions and 111 deletions
+7 -2
View File
@@ -777,8 +777,13 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
void *txp[ru->nb_tx]; void *txp[ru->nb_tx];
unsigned int txs; unsigned int txs;
int i; int i;
T(T_ENB_PHY_OUTPUT_SIGNAL, T_INT(0), T_INT(0), T_INT(frame), T_INT(slot), T(T_ENB_PHY_OUTPUT_SIGNAL,
T_INT(0), T_BUFFER(&ru->common.txdata[0][fp->get_samples_slot_timestamp(slot,fp,0)], fp->get_samples_per_slot(slot,fp) * 4)); T_INT(0),
T_INT(0),
T_INT(frame),
T_INT(slot),
T_INT(0),
T_BUFFER(&ru->common.txdata[0][fp->get_samples_slot_timestamp(slot, fp, 0)], fp->get_samples_per_slot(slot, fp) * 4));
int sf_extension = 0; int sf_extension = 0;
int siglen=fp->get_samples_per_slot(slot,fp); int siglen=fp->get_samples_per_slot(slot,fp);
radio_tx_burst_flag_t flags_burst = TX_BURST_INVALID; radio_tx_burst_flag_t flags_burst = TX_BURST_INVALID;
+2 -5
View File
@@ -944,11 +944,8 @@ void *UE_thread(void *arg)
return NULL; return NULL;
} }
void init_NR_UE(int nb_inst, void init_NR_UE(int nb_inst, char *uecap_file, char *rrc_config_path, char *reconfig_file, char *rbconfig_file)
char* uecap_file, {
char* rrc_config_path,
char* reconfig_file,
char* rbconfig_file) {
int inst; int inst;
NR_UE_MAC_INST_t *mac_inst; NR_UE_MAC_INST_t *mac_inst;
NR_UE_RRC_INST_t* rrc_inst; NR_UE_RRC_INST_t* rrc_inst;
@@ -61,13 +61,10 @@ void peak_estimator(int32_t *buffer, int32_t buf_len, int32_t *peak_idx, int32_t
// Check for detection threshold // Check for detection threshold
LOG_D(PHY, "PRS ToA estimator: max_val %d, mean_val %d, max_idx %d\n", max_val, mean_val, max_idx); LOG_D(PHY, "PRS ToA estimator: max_val %d, mean_val %d, max_idx %d\n", max_val, mean_val, max_idx);
if((mean_val !=0) && (max_val/mean_val > 10)) if ((mean_val != 0) && (max_val / mean_val > 10)) {
{
*peak_val = max_val; *peak_val = max_val;
*peak_idx = max_idx; *peak_idx = max_idx;
} } else {
else
{
*peak_val = 0; *peak_val = 0;
*peak_idx = 0; *peak_idx = 0;
} }
@@ -142,7 +139,8 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
for (rxAnt=0; rxAnt < frame_params->nb_antennas_rx; rxAnt++) for (rxAnt=0; rxAnt < frame_params->nb_antennas_rx; rxAnt++)
{ {
// reset variables // reset variables
snr = 0; rsrp = 0; snr = 0;
rsrp = 0;
// calculate RE offset // calculate RE offset
k = (prs_cfg->REOffset + k_prime) % prs_cfg->CombSize + prs_cfg->RBOffset * 12 + frame_params->first_carrier_offset; k = (prs_cfg->REOffset + k_prime) % prs_cfg->CombSize + prs_cfg->RBOffset * 12 + frame_params->first_carrier_offset;
@@ -276,7 +274,17 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
noiseFig[1] = rxF[1] - (int16_t)(((int32_t)ch[1] * pil[0] + (int32_t)ch[0] * pil[1]) >> 15); noiseFig[1] = rxF[1] - (int16_t)(((int32_t)ch[1] * pil[0] + (int32_t)ch[0] * pil[1]) >> 15);
snr += 10 * log10(squaredMod(*((c16_t *)rxF)) - squaredMod(*((c16_t *)noiseFig))) - 10 * log10(squaredMod(*((c16_t *)noiseFig))); snr += 10 * log10(squaredMod(*((c16_t *)rxF)) - squaredMod(*((c16_t *)noiseFig))) - 10 * log10(squaredMod(*((c16_t *)noiseFig)));
#ifdef DEBUG_PRS_PRINTS #ifdef DEBUG_PRS_PRINTS
printf("[Rx %d] pilot %3d, SNR %+2d dB: rxF - > (%+3d, %+3d) addr %p ch -> (%+3d, %+3d), pil -> (%+d, %+d) \n", rxAnt, num_pilots-1, snr/num_pilots, rxF[0],rxF[1],&rxF[0],ch[0],ch[1],pil[0],pil[1]); printf("[Rx %d] pilot %3d, SNR %+2d dB: rxF - > (%+3d, %+3d) addr %p ch -> (%+3d, %+3d), pil -> (%+d, %+d) \n",
rxAnt,
num_pilots - 1,
snr / num_pilots,
rxF[0],
rxF[1],
&rxF[0],
ch[0],
ch[1],
pil[0],
pil[1]);
#endif #endif
} }
else if(prs_cfg->CombSize == 4) else if(prs_cfg->CombSize == 4)
@@ -550,20 +558,13 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
// peak estimator // peak estimator
mean_val = squaredMod(((c16_t *)ch_tmp)[(prs_cfg->NumRB * 12) >> 1]); mean_val = squaredMod(((c16_t *)ch_tmp)[(prs_cfg->NumRB * 12) >> 1]);
peak_estimator(&chT_interpol[rxAnt][0], peak_estimator(&chT_interpol[rxAnt][0], NR_PRS_IDFT_OVERSAMP_FACTOR * frame_params->ofdm_symbol_size, &prs_toa, &ch_pwr, mean_val);
NR_PRS_IDFT_OVERSAMP_FACTOR*frame_params->ofdm_symbol_size,
&prs_toa,
&ch_pwr,
mean_val);
// adjusting the rx_gains for channel peak power // adjusting the rx_gains for channel peak power
ch_pwr_dbm = 10*log10(ch_pwr)+30 ch_pwr_dbm = 10 * log10(ch_pwr) + 30 - 10 * log10(pow(2, 30)) - ((int)openair0_cfg[0].rx_gain[0] - (int)openair0_cfg[0].rx_gain_offset[0]) - dB_fixed(frame_params->ofdm_symbol_size);
- 10*log10(pow(2,30)) - ((int)openair0_cfg[0].rx_gain[0]
- (int)openair0_cfg[0].rx_gain_offset[0]) - dB_fixed(frame_params->ofdm_symbol_size);
prs_meas[rxAnt]->rsrp_dBm = 10*log10(prs_meas[rxAnt]->rsrp) + 30 prs_meas[rxAnt]->rsrp_dBm =
- 10*log10(pow(2,30)) - ((int)openair0_cfg[0].rx_gain[0] 10 * log10(prs_meas[rxAnt]->rsrp) + 30 - 10 * log10(pow(2, 30)) - ((int)openair0_cfg[0].rx_gain[0] - (int)openair0_cfg[0].rx_gain_offset[0]) - dB_fixed(ue->frame_parms.ofdm_symbol_size);
- (int)openair0_cfg[0].rx_gain_offset[0]) - dB_fixed(ue->frame_parms.ofdm_symbol_size);
//prs measurements //prs measurements
prs_meas[rxAnt]->gNB_id = gNB_id; prs_meas[rxAnt]->gNB_id = gNB_id;
@@ -574,7 +575,18 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
prs_meas[rxAnt]->dl_toa = prs_toa / (float)NR_PRS_IDFT_OVERSAMP_FACTOR; prs_meas[rxAnt]->dl_toa = prs_toa / (float)NR_PRS_IDFT_OVERSAMP_FACTOR;
if ((frame_params->ofdm_symbol_size - prs_meas[rxAnt]->dl_toa) < frame_params->ofdm_symbol_size / 2) if ((frame_params->ofdm_symbol_size - prs_meas[rxAnt]->dl_toa) < frame_params->ofdm_symbol_size / 2)
prs_meas[rxAnt]->dl_toa -= (frame_params->ofdm_symbol_size); prs_meas[rxAnt]->dl_toa -= (frame_params->ofdm_symbol_size);
LOG_I(PHY, "[gNB %d][rsc %d][Rx %d][sfn %d][slot %d] DL PRS ToA ==> %.1f / %d samples, peak channel power %.1f dBm, SNR %+.1f dB, rsrp %+.1f dBm\n", gNB_id, rsc_id, rxAnt, proc->frame_rx, proc->nr_slot_rx, prs_meas[rxAnt]->dl_toa, frame_params->ofdm_symbol_size, ch_pwr_dbm, prs_meas[rxAnt]->snr, prs_meas[rxAnt]->rsrp_dBm); LOG_I(PHY,
"[gNB %d][rsc %d][Rx %d][sfn %d][slot %d] DL PRS ToA ==> %.1f / %d samples, peak channel power %.1f dBm, SNR %+.1f dB, rsrp %+.1f dBm\n",
gNB_id,
rsc_id,
rxAnt,
proc->frame_rx,
proc->nr_slot_rx,
prs_meas[rxAnt]->dl_toa,
frame_params->ofdm_symbol_size,
ch_pwr_dbm,
prs_meas[rxAnt]->snr,
prs_meas[rxAnt]->rsrp_dBm);
#ifdef DEBUG_PRS_CHEST #ifdef DEBUG_PRS_CHEST
sprintf(filename, "%s%i%s", "PRSpilot_", rxAnt, ".m"); sprintf(filename, "%s%i%s", "PRSpilot_", rxAnt, ".m");
@@ -595,13 +607,21 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
T_INT(proc->frame_rx), T_INT(proc->nr_slot_rx), T_INT(proc->frame_rx), T_INT(proc->nr_slot_rx),
T_INT(rxAnt), T_BUFFER(&rxdataF[rxAnt][0], frame_params->samples_per_slot_wCP*sizeof(int32_t))); T_INT(rxAnt), T_BUFFER(&rxdataF[rxAnt][0], frame_params->samples_per_slot_wCP*sizeof(int32_t)));
T(T_UE_PHY_DL_CHANNEL_ESTIMATE_FREQ, T_INT(gNB_id), T_INT(rsc_id), T(T_UE_PHY_DL_CHANNEL_ESTIMATE_FREQ,
T_INT(proc->frame_rx), T_INT(proc->nr_slot_rx), T_INT(gNB_id),
T_INT(rxAnt), T_BUFFER(&chF_interpol[rxAnt][0], NR_PRS_IDFT_OVERSAMP_FACTOR*frame_params->ofdm_symbol_size*sizeof(int32_t))); T_INT(rsc_id),
T_INT(proc->frame_rx),
T_INT(proc->nr_slot_rx),
T_INT(rxAnt),
T_BUFFER(&chF_interpol[rxAnt][0], NR_PRS_IDFT_OVERSAMP_FACTOR * frame_params->ofdm_symbol_size * sizeof(int32_t)));
T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(gNB_id), T_INT(rsc_id), T(T_UE_PHY_DL_CHANNEL_ESTIMATE,
T_INT(proc->frame_rx), T_INT(proc->nr_slot_rx), T_INT(gNB_id),
T_INT(rxAnt), T_BUFFER(&chT_interpol[rxAnt][0], NR_PRS_IDFT_OVERSAMP_FACTOR*frame_params->ofdm_symbol_size*sizeof(int32_t))); T_INT(rsc_id),
T_INT(proc->frame_rx),
T_INT(proc->nr_slot_rx),
T_INT(rxAnt),
T_BUFFER(&chT_interpol[rxAnt][0], NR_PRS_IDFT_OVERSAMP_FACTOR * frame_params->ofdm_symbol_size * sizeof(int32_t)));
} }
return(0); return(0);
+1 -7
View File
@@ -943,13 +943,7 @@ void pbch_pdcch_processing(PHY_VARS_NR_UE *ue,
(j%fp->symbols_per_slot), (j%fp->symbols_per_slot),
rxdataF); rxdataF);
} }
nr_prs_channel_estimation(gNB_id, nr_prs_channel_estimation(gNB_id, rsc_id, i, ue, proc, fp, rxdataF);
rsc_id,
i,
ue,
proc,
fp,
rxdataF);
} }
} // for i } // for i
} // for rsc_id } // for rsc_id
+2 -1
View File
@@ -34,7 +34,8 @@
#include "rrc_proto.h" #include "rrc_proto.h"
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
NR_UE_RRC_INST_t* nr_l3_init_ue(char* uecap, char* rrc_config_path, char* reconfig_file, char* rbconfig_file){ NR_UE_RRC_INST_t* nr_l3_init_ue(char* uecap, char* rrc_config_path, char* reconfig_file, char* rbconfig_file)
{
// LOG_I(RRC, "[MAIN] NR UE MAC initialization...\n"); // LOG_I(RRC, "[MAIN] NR UE MAC initialization...\n");
return openair_rrc_top_init_ue_nr(uecap, rrc_config_path, reconfig_file, rbconfig_file); return openair_rrc_top_init_ue_nr(uecap, rrc_config_path, reconfig_file, rbconfig_file);
-2
View File
@@ -344,7 +344,6 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type,
} }
NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* rrc_config_path, char* reconfig_file, char* rbconfig_file) NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* rrc_config_path, char* reconfig_file, char* rbconfig_file)
{ {
if(NB_NR_UE_INST > 0) { if(NB_NR_UE_INST > 0) {
@@ -418,7 +417,6 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* rrc_config_
return NR_UE_rrc_inst; return NR_UE_rrc_inst;
} }
int8_t nr_ue_process_rlc_bearer_list(NR_CellGroupConfig_t *cell_group_config){ int8_t nr_ue_process_rlc_bearer_list(NR_CellGroupConfig_t *cell_group_config){
return 0; return 0;
-2
View File
@@ -65,8 +65,6 @@ NR_UE_RRC_INST_t* nr_l3_init_ue(char*,char*,char*,char*);
/**\brief Initial the top level RRC structure instance*/ /**\brief Initial the top level RRC structure instance*/
NR_UE_RRC_INST_t *openair_rrc_top_init_ue_nr(char *, char *, char *, char *); NR_UE_RRC_INST_t *openair_rrc_top_init_ue_nr(char *, char *, char *, char *);
/**\brief Decode RRC Connection Reconfiguration, sent from E-UTRA RRC Connection Reconfiguration v1510 carring EN-DC config /**\brief Decode RRC Connection Reconfiguration, sent from E-UTRA RRC Connection Reconfiguration v1510 carring EN-DC config
\param buffer encoded NR-RRC-Connection-Reconfiguration/Secondary-Cell-Group-Config message. \param buffer encoded NR-RRC-Connection-Reconfiguration/Secondary-Cell-Group-Config message.
\param size length of buffer*/ \param size length of buffer*/