Commit 28a4f533 authored by frtabu's avatar frtabu

Fix basic simu problem, due to remaining #if OAI_USRP... macros in UE

parent fad83e47
......@@ -31,25 +31,23 @@
*/
#include "PHY/LTE_TRANSPORT/proto.h"
#include "targets/RT/USER/lte-softmodem.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SCHED/extern.h"
#ifdef OPENAIR2
#include "openair2/LAYER2/MAC/proto.h"
#include "openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "openair2/LAYER2/MAC/proto.h"
#include "openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#endif
extern int mac_get_rrc_status(uint8_t Mod_id,uint8_t eNB_flag,uint8_t index);
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#include "common_lib.h"
extern openair0_config_t openair0_cfg[];
#endif
int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length, runmode_t mode, int input_level_dBm)
{
int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char *buffer, int length, runmode_t mode, int input_level_dBm) {
uint8_t eNB=0;
uint32_t RRC_status;
int len=length;
......@@ -60,13 +58,12 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
if ((mode == normal_txrx) || (mode == no_L2_connect)) {
len += sprintf(&buffer[len], "[UE_PROC] UE %d, RNTI %x\n",ue->Mod_id, ue->pdcch_vars[0][0]->crnti);
len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE (NF %.1f dB)\n",
10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB,
10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB,
10*log10(ue->measurements.rsrq[0]),
ue->measurements.n0_power_tot_dBm,
(double)ue->measurements.n0_power_tot_dBm+132.24);
len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE (NF %.1f dB)\n",
10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB,
10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB,
10*log10(ue->measurements.rsrq[0]),
ue->measurements.n0_power_tot_dBm,
(double)ue->measurements.n0_power_tot_dBm+132.24);
/*
len += sprintf(&buffer[len],
"[UE PROC] Frame count: %d\neNB0 RSSI %d dBm/RE (%d dB, %d dB)\neNB1 RSSI %d dBm/RE (%d dB, %d dB)neNB2 RSSI %d dBm/RE (%d dB, %d dB)\nN0 %d dBm/RE, %f dBm/%dPRB (%d dB, %d dB)\n",
......@@ -86,31 +83,28 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.n0_power_dB[0],
ue->measurements.n0_power_dB[1]);
*/
#ifdef EXMIMO
len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB (LNA %d, vga %d dB)\n",ue->rx_total_gain_dB, openair0_cfg[0].rxg_mode[0],(int)openair0_cfg[0].rx_gain[0]);
#endif
#if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB\n",ue->rx_total_gain_dB);
#endif
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
len += sprintf(&buffer[len], "[UE_PROC] Frequency offset %d Hz, estimated carrier frequency %f Hz\n",ue->common_vars.freq_offset,openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset);
#endif
len += sprintf(&buffer[len], "[UE PROC] UE mode = %s (%d)\n",mode_string[ue->UE_mode[0]],ue->UE_mode[0]);
len += sprintf(&buffer[len], "[UE PROC] timing_advance = %d\n",ue->timing_advance);
if (ue->UE_mode[0]==PUSCH) {
len += sprintf(&buffer[len], "[UE PROC] Po_PUSCH = %d dBm (PL %d dB, Po_NOMINAL_PUSCH %d dBm, PHR %d dB)\n",
ue->ulsch[0]->Po_PUSCH,
get_PL(ue->Mod_id,ue->CC_id,0),
ue->frame_parms.ul_power_control_config_common.p0_NominalPUSCH,
ue->ulsch[0]->PHR);
len += sprintf(&buffer[len], "[UE PROC] Po_PUCCH = %d dBm (Po_NOMINAL_PUCCH %d dBm, g_pucch %d dB)\n",
get_PL(ue->Mod_id,ue->CC_id,0)+
ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH+
ue->dlsch[0][0][0]->g_pucch,
ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
ue->dlsch[0][0][0]->g_pucch);
len += sprintf(&buffer[len], "[UE PROC] Po_PUSCH = %d dBm (PL %d dB, Po_NOMINAL_PUSCH %d dBm, PHR %d dB)\n",
ue->ulsch[0]->Po_PUSCH,
get_PL(ue->Mod_id,ue->CC_id,0),
ue->frame_parms.ul_power_control_config_common.p0_NominalPUSCH,
ue->ulsch[0]->PHR);
len += sprintf(&buffer[len], "[UE PROC] Po_PUCCH = %d dBm (Po_NOMINAL_PUCCH %d dBm, g_pucch %d dB)\n",
get_PL(ue->Mod_id,ue->CC_id,0)+
ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH+
ue->dlsch[0][0][0]->g_pucch,
ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
ue->dlsch[0][0][0]->g_pucch);
}
//for (eNB=0;eNB<NUMBER_OF_eNB_MAX;eNB++) {
for (eNB=0; eNB<1; eNB++) {
len += sprintf(&buffer[len], "[UE PROC] RX spatial power eNB%d: [%d %d; %d %d] dB\n",
......@@ -119,7 +113,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.rx_spatial_power_dB[eNB][0][1],
ue->measurements.rx_spatial_power_dB[eNB][1][0],
ue->measurements.rx_spatial_power_dB[eNB][1][1]);
len += sprintf(&buffer[len], "[UE PROC] RX total power eNB%d: %d dB, avg: %d dB\n",eNB,ue->measurements.rx_power_tot_dB[eNB],ue->measurements.rx_power_avg_dB[eNB]);
len += sprintf(&buffer[len], "[UE PROC] RX total power lin: %d, avg: %d, RX total noise lin: %d, avg: %d\n",ue->measurements.rx_power_tot[eNB],
ue->measurements.rx_power_avg[eNB], ue->measurements.n0_power_tot, ue->measurements.n0_power_avg);
......@@ -127,351 +120,324 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
len += sprintf(&buffer[len], "[UE PROC] Wideband CQI eNB %d: %d dB, avg: %d dB\n",eNB,ue->measurements.wideband_cqi_tot[eNB],ue->measurements.wideband_cqi_avg[eNB]);
switch (ue->frame_parms.N_RB_DL) {
case 6:
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d] dB\n",
eNB,
ue->measurements.subband_cqi_dB[eNB][0][0],
ue->measurements.subband_cqi_dB[eNB][0][1],
ue->measurements.subband_cqi_dB[eNB][0][2],
ue->measurements.subband_cqi_dB[eNB][0][3],
ue->measurements.subband_cqi_dB[eNB][0][4],
ue->measurements.subband_cqi_dB[eNB][0][5]);
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d] dB\n",
eNB,
ue->measurements.subband_cqi_dB[eNB][1][0],
ue->measurements.subband_cqi_dB[eNB][1][1],
ue->measurements.subband_cqi_dB[eNB][1][2],
ue->measurements.subband_cqi_dB[eNB][1][3],
ue->measurements.subband_cqi_dB[eNB][1][4],
ue->measurements.subband_cqi_dB[eNB][1][5]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
ue->measurements.subband_pmi_re[eNB][0][0],
ue->measurements.subband_pmi_im[eNB][0][0],
ue->measurements.subband_pmi_re[eNB][1][0],
ue->measurements.subband_pmi_im[eNB][1][0],
ue->measurements.subband_pmi_re[eNB][2][0],
ue->measurements.subband_pmi_im[eNB][2][0],
ue->measurements.subband_pmi_re[eNB][3][0],
ue->measurements.subband_pmi_im[eNB][3][0],
ue->measurements.subband_pmi_re[eNB][4][0],
ue->measurements.subband_pmi_im[eNB][4][0],
ue->measurements.subband_pmi_re[eNB][5][0],
ue->measurements.subband_pmi_im[eNB][5][0]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
ue->measurements.subband_pmi_re[eNB][0][1],
ue->measurements.subband_pmi_im[eNB][0][1],
ue->measurements.subband_pmi_re[eNB][1][1],
ue->measurements.subband_pmi_im[eNB][1][1],
ue->measurements.subband_pmi_re[eNB][2][1],
ue->measurements.subband_pmi_im[eNB][2][1],
ue->measurements.subband_pmi_re[eNB][3][1],
ue->measurements.subband_pmi_im[eNB][3][1],
ue->measurements.subband_pmi_re[eNB][4][1],
ue->measurements.subband_pmi_im[eNB][4][1],
ue->measurements.subband_pmi_re[eNB][5][1],
ue->measurements.subband_pmi_im[eNB][5][1]);
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d]\n",
eNB,
ue->measurements.selected_rx_antennas[eNB][0],
ue->measurements.selected_rx_antennas[eNB][1],
ue->measurements.selected_rx_antennas[eNB][2],
ue->measurements.selected_rx_antennas[eNB][3],
ue->measurements.selected_rx_antennas[eNB][4],
ue->measurements.selected_rx_antennas[eNB][5]);
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,6)));
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB,
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,6)),
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,6)));
break;
case 25:
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d] dB\n",
eNB,
ue->measurements.subband_cqi_dB[eNB][0][0],
ue->measurements.subband_cqi_dB[eNB][0][1],
ue->measurements.subband_cqi_dB[eNB][0][2],
ue->measurements.subband_cqi_dB[eNB][0][3],
ue->measurements.subband_cqi_dB[eNB][0][4],
ue->measurements.subband_cqi_dB[eNB][0][5],
ue->measurements.subband_cqi_dB[eNB][0][6]);
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d] dB\n",
eNB,
ue->measurements.subband_cqi_dB[eNB][1][0],
ue->measurements.subband_cqi_dB[eNB][1][1],
ue->measurements.subband_cqi_dB[eNB][1][2],
ue->measurements.subband_cqi_dB[eNB][1][3],
ue->measurements.subband_cqi_dB[eNB][1][4],
ue->measurements.subband_cqi_dB[eNB][1][5],
ue->measurements.subband_cqi_dB[eNB][1][6]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
ue->measurements.subband_pmi_re[eNB][0][0],
ue->measurements.subband_pmi_im[eNB][0][0],
ue->measurements.subband_pmi_re[eNB][1][0],
ue->measurements.subband_pmi_im[eNB][1][0],
ue->measurements.subband_pmi_re[eNB][2][0],
ue->measurements.subband_pmi_im[eNB][2][0],
ue->measurements.subband_pmi_re[eNB][3][0],
ue->measurements.subband_pmi_im[eNB][3][0],
ue->measurements.subband_pmi_re[eNB][4][0],
ue->measurements.subband_pmi_im[eNB][4][0],
ue->measurements.subband_pmi_re[eNB][5][0],
ue->measurements.subband_pmi_im[eNB][5][0],
ue->measurements.subband_pmi_re[eNB][6][0],
ue->measurements.subband_pmi_im[eNB][6][0]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
ue->measurements.subband_pmi_re[eNB][0][1],
ue->measurements.subband_pmi_im[eNB][0][1],
ue->measurements.subband_pmi_re[eNB][1][1],
ue->measurements.subband_pmi_im[eNB][1][1],
ue->measurements.subband_pmi_re[eNB][2][1],
ue->measurements.subband_pmi_im[eNB][2][1],
ue->measurements.subband_pmi_re[eNB][3][1],
ue->measurements.subband_pmi_im[eNB][3][1],
ue->measurements.subband_pmi_re[eNB][4][1],
ue->measurements.subband_pmi_im[eNB][4][1],
ue->measurements.subband_pmi_re[eNB][5][1],
ue->measurements.subband_pmi_im[eNB][5][1],
ue->measurements.subband_pmi_re[eNB][6][1],
ue->measurements.subband_pmi_im[eNB][6][1]);
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d]\n",
eNB,
ue->measurements.selected_rx_antennas[eNB][0],
ue->measurements.selected_rx_antennas[eNB][1],
ue->measurements.selected_rx_antennas[eNB][2],
ue->measurements.selected_rx_antennas[eNB][3],
ue->measurements.selected_rx_antennas[eNB][4],
ue->measurements.selected_rx_antennas[eNB][5],
ue->measurements.selected_rx_antennas[eNB][6]);
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,7)));
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB,
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,7)),
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,7)));
break;
case 50:
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d] dB\n",
eNB,
ue->measurements.subband_cqi_dB[eNB][0][0],
ue->measurements.subband_cqi_dB[eNB][0][1],
ue->measurements.subband_cqi_dB[eNB][0][2],
ue->measurements.subband_cqi_dB[eNB][0][3],
ue->measurements.subband_cqi_dB[eNB][0][4],
ue->measurements.subband_cqi_dB[eNB][0][5],
ue->measurements.subband_cqi_dB[eNB][0][6],
ue->measurements.subband_cqi_dB[eNB][0][7],
ue->measurements.subband_cqi_dB[eNB][0][8]);
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d] dB\n",
eNB,
ue->measurements.subband_cqi_dB[eNB][1][0],
ue->measurements.subband_cqi_dB[eNB][1][1],
ue->measurements.subband_cqi_dB[eNB][1][2],
ue->measurements.subband_cqi_dB[eNB][1][3],
ue->measurements.subband_cqi_dB[eNB][1][4],
ue->measurements.subband_cqi_dB[eNB][1][5],
ue->measurements.subband_cqi_dB[eNB][1][6],
ue->measurements.subband_cqi_dB[eNB][1][7],
ue->measurements.subband_cqi_dB[eNB][1][8]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
ue->measurements.subband_pmi_re[eNB][0][0],
ue->measurements.subband_pmi_im[eNB][0][0],
ue->measurements.subband_pmi_re[eNB][1][0],
ue->measurements.subband_pmi_im[eNB][1][0],
ue->measurements.subband_pmi_re[eNB][2][0],
ue->measurements.subband_pmi_im[eNB][2][0],
ue->measurements.subband_pmi_re[eNB][3][0],
ue->measurements.subband_pmi_im[eNB][3][0],
ue->measurements.subband_pmi_re[eNB][4][0],
ue->measurements.subband_pmi_im[eNB][4][0],
ue->measurements.subband_pmi_re[eNB][5][0],
ue->measurements.subband_pmi_im[eNB][5][0],
ue->measurements.subband_pmi_re[eNB][6][0],
ue->measurements.subband_pmi_im[eNB][6][0],
ue->measurements.subband_pmi_re[eNB][7][0],
ue->measurements.subband_pmi_im[eNB][7][0],
ue->measurements.subband_pmi_re[eNB][8][0],
ue->measurements.subband_pmi_im[eNB][8][0]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
ue->measurements.subband_pmi_re[eNB][0][1],
ue->measurements.subband_pmi_im[eNB][0][1],
ue->measurements.subband_pmi_re[eNB][1][1],
ue->measurements.subband_pmi_im[eNB][1][1],
ue->measurements.subband_pmi_re[eNB][2][1],
ue->measurements.subband_pmi_im[eNB][2][1],
ue->measurements.subband_pmi_re[eNB][3][1],
ue->measurements.subband_pmi_im[eNB][3][1],
ue->measurements.subband_pmi_re[eNB][4][1],
ue->measurements.subband_pmi_im[eNB][4][1],
ue->measurements.subband_pmi_re[eNB][5][1],
ue->measurements.subband_pmi_im[eNB][5][1],
ue->measurements.subband_pmi_re[eNB][6][1],
ue->measurements.subband_pmi_im[eNB][6][1],
ue->measurements.subband_pmi_re[eNB][7][1],
ue->measurements.subband_pmi_im[eNB][7][1],
ue->measurements.subband_pmi_re[eNB][8][1],
ue->measurements.subband_pmi_im[eNB][8][1]);
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d]\n",
eNB,
ue->measurements.selected_rx_antennas[eNB][0],
ue->measurements.selected_rx_antennas[eNB][1],
ue->measurements.selected_rx_antennas[eNB][2],
ue->measurements.selected_rx_antennas[eNB][3],
ue->measurements.selected_rx_antennas[eNB][4],
ue->measurements.selected_rx_antennas[eNB][5],
ue->measurements.selected_rx_antennas[eNB][6],
ue->measurements.selected_rx_antennas[eNB][7],
ue->measurements.selected_rx_antennas[eNB][8]);
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,9)));
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB,
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,9)),
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,9)));
break;
case 100:
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n",
eNB,
ue->measurements.subband_cqi_dB[eNB][0][0],
ue->measurements.subband_cqi_dB[eNB][0][1],
ue->measurements.subband_cqi_dB[eNB][0][2],
ue->measurements.subband_cqi_dB[eNB][0][3],
ue->measurements.subband_cqi_dB[eNB][0][4],
ue->measurements.subband_cqi_dB[eNB][0][5],
ue->measurements.subband_cqi_dB[eNB][0][6],
ue->measurements.subband_cqi_dB[eNB][0][7],
ue->measurements.subband_cqi_dB[eNB][0][8],
ue->measurements.subband_cqi_dB[eNB][0][9],
ue->measurements.subband_cqi_dB[eNB][0][10],
ue->measurements.subband_cqi_dB[eNB][0][11],
ue->measurements.subband_cqi_dB[eNB][0][12]);
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n",
eNB,
ue->measurements.subband_cqi_dB[eNB][1][0],
ue->measurements.subband_cqi_dB[eNB][1][1],
ue->measurements.subband_cqi_dB[eNB][1][2],
ue->measurements.subband_cqi_dB[eNB][1][3],
ue->measurements.subband_cqi_dB[eNB][1][4],
ue->measurements.subband_cqi_dB[eNB][1][5],
ue->measurements.subband_cqi_dB[eNB][1][6],
ue->measurements.subband_cqi_dB[eNB][1][7],
ue->measurements.subband_cqi_dB[eNB][1][8],
ue->measurements.subband_cqi_dB[eNB][1][9],
ue->measurements.subband_cqi_dB[eNB][1][10],
ue->measurements.subband_cqi_dB[eNB][1][11],
ue->measurements.subband_cqi_dB[eNB][1][12]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
ue->measurements.subband_pmi_re[eNB][0][0],
ue->measurements.subband_pmi_im[eNB][0][0],
ue->measurements.subband_pmi_re[eNB][1][0],
ue->measurements.subband_pmi_im[eNB][1][0],
ue->measurements.subband_pmi_re[eNB][2][0],
ue->measurements.subband_pmi_im[eNB][2][0],
ue->measurements.subband_pmi_re[eNB][3][0],
ue->measurements.subband_pmi_im[eNB][3][0],
ue->measurements.subband_pmi_re[eNB][4][0],
ue->measurements.subband_pmi_im[eNB][4][0],
ue->measurements.subband_pmi_re[eNB][5][0],
ue->measurements.subband_pmi_im[eNB][5][0],
ue->measurements.subband_pmi_re[eNB][6][0],
ue->measurements.subband_pmi_im[eNB][6][0],
ue->measurements.subband_pmi_re[eNB][7][0],
ue->measurements.subband_pmi_im[eNB][7][0],
ue->measurements.subband_pmi_re[eNB][8][0],
ue->measurements.subband_pmi_im[eNB][8][0],
ue->measurements.subband_pmi_re[eNB][9][0],
ue->measurements.subband_pmi_im[eNB][9][0],
ue->measurements.subband_pmi_re[eNB][10][0],
ue->measurements.subband_pmi_im[eNB][10][0],
ue->measurements.subband_pmi_re[eNB][11][0],
ue->measurements.subband_pmi_im[eNB][11][0],
ue->measurements.subband_pmi_re[eNB][12][0],
ue->measurements.subband_pmi_im[eNB][12][0]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
ue->measurements.subband_pmi_re[eNB][0][1],
ue->measurements.subband_pmi_im[eNB][0][1],
ue->measurements.subband_pmi_re[eNB][1][1],
ue->measurements.subband_pmi_im[eNB][1][1],
ue->measurements.subband_pmi_re[eNB][2][1],
ue->measurements.subband_pmi_im[eNB][2][1],
ue->measurements.subband_pmi_re[eNB][3][1],
ue->measurements.subband_pmi_im[eNB][3][1],
ue->measurements.subband_pmi_re[eNB][4][1],
ue->measurements.subband_pmi_im[eNB][4][1],
ue->measurements.subband_pmi_re[eNB][5][1],
ue->measurements.subband_pmi_im[eNB][5][1],
ue->measurements.subband_pmi_re[eNB][6][1],
ue->measurements.subband_pmi_im[eNB][6][1],
ue->measurements.subband_pmi_re[eNB][7][1],
ue->measurements.subband_pmi_im[eNB][7][1],
ue->measurements.subband_pmi_re[eNB][8][1],
ue->measurements.subband_pmi_im[eNB][8][1],
ue->measurements.subband_pmi_re[eNB][9][1],
ue->measurements.subband_pmi_im[eNB][9][1],
ue->measurements.subband_pmi_re[eNB][10][1],
ue->measurements.subband_pmi_im[eNB][10][1],
ue->measurements.subband_pmi_re[eNB][11][1],
ue->measurements.subband_pmi_im[eNB][11][1],
ue->measurements.subband_pmi_re[eNB][12][1],
ue->measurements.subband_pmi_im[eNB][12][1]);
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d %d %d %d %d]\n",
eNB,
ue->measurements.selected_rx_antennas[eNB][0],
ue->measurements.selected_rx_antennas[eNB][1],
ue->measurements.selected_rx_antennas[eNB][2],
ue->measurements.selected_rx_antennas[eNB][3],
ue->measurements.selected_rx_antennas[eNB][4],
ue->measurements.selected_rx_antennas[eNB][5],
ue->measurements.selected_rx_antennas[eNB][6],
ue->measurements.selected_rx_antennas[eNB][7],
ue->measurements.selected_rx_antennas[eNB][8],
ue->measurements.selected_rx_antennas[eNB][9],
ue->measurements.selected_rx_antennas[eNB][10],
ue->measurements.selected_rx_antennas[eNB][11],
ue->measurements.selected_rx_antennas[eNB][12]);
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,13)));
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB,
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,13)),
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,13)));
break;
case 6:
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d] dB\n",
eNB,
ue->measurements.subband_cqi_dB[eNB][0][0],
ue->measurements.subband_cqi_dB[eNB][0][1],
ue->measurements.subband_cqi_dB[eNB][0][2],
ue->measurements.subband_cqi_dB[eNB][0][3],
ue->measurements.subband_cqi_dB[eNB][0][4],
ue->measurements.subband_cqi_dB[eNB][0][5]);
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d] dB\n",
eNB,
ue->measurements.subband_cqi_dB[eNB][1][0],
ue->measurements.subband_cqi_dB[eNB][1][1],
ue->measurements.subband_cqi_dB[eNB][1][2],
ue->measurements.subband_cqi_dB[eNB][1][3],
ue->measurements.subband_cqi_dB[eNB][1][4],
ue->measurements.subband_cqi_dB[eNB][1][5]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
ue->measurements.subband_pmi_re[eNB][0][0],
ue->measurements.subband_pmi_im[eNB][0][0],
ue->measurements.subband_pmi_re[eNB][1][0],
ue->measurements.subband_pmi_im[eNB][1][0],
ue->measurements.subband_pmi_re[eNB][2][0],
ue->measurements.subband_pmi_im[eNB][2][0],
ue->measurements.subband_pmi_re[eNB][3][0],
ue->measurements.subband_pmi_im[eNB][3][0],
ue->measurements.subband_pmi_re[eNB][4][0],
ue->measurements.subband_pmi_im[eNB][4][0],
ue->measurements.subband_pmi_re[eNB][5][0],
ue->measurements.subband_pmi_im[eNB][5][0]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
ue->measurements.subband_pmi_re[eNB][0][1],
ue->measurements.subband_pmi_im[eNB][0][1],
ue->measurements.subband_pmi_re[eNB][1][1],
ue->measurements.subband_pmi_im[eNB][1][1],
ue->measurements.subband_pmi_re[eNB][2][1],
ue->measurements.subband_pmi_im[eNB][2][1],
ue->measurements.subband_pmi_re[eNB][3][1],
ue->measurements.subband_pmi_im[eNB][3][1],
ue->measurements.subband_pmi_re[eNB][4][1],
ue->measurements.subband_pmi_im[eNB][4][1],
ue->measurements.subband_pmi_re[eNB][5][1],
ue->measurements.subband_pmi_im[eNB][5][1]);
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d]\n",
eNB,
ue->measurements.selected_rx_antennas[eNB][0],
ue->measurements.selected_rx_antennas[eNB][1],
ue->measurements.selected_rx_antennas[eNB][2],
ue->measurements.selected_rx_antennas[eNB][3],
ue->measurements.selected_rx_antennas[eNB][4],
ue->measurements.selected_rx_antennas[eNB][5]);
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,6)));
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB,
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,6)),
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,6)));
break;
case 25:
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d] dB\n",
eNB,
ue->measurements.subband_cqi_dB[eNB][0][0],
ue->measurements.subband_cqi_dB[eNB][0][1],
ue->measurements.subband_cqi_dB[eNB][0][2],
ue->measurements.subband_cqi_dB[eNB][0][3],
ue->measurements.subband_cqi_dB[eNB][0][4],
ue->measurements.subband_cqi_dB[eNB][0][5],
ue->measurements.subband_cqi_dB[eNB][0][6]);
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d] dB\n",
eNB,
ue->measurements.subband_cqi_dB[eNB][1][0],
ue->measurements.subband_cqi_dB[eNB][1][1],
ue->measurements.subband_cqi_dB[eNB][1][2],
ue->measurements.subband_cqi_dB[eNB][1][3],
ue->measurements.subband_cqi_dB[eNB][1][4],
ue->measurements.subband_cqi_dB[eNB][1][5],
ue->measurements.subband_cqi_dB[eNB][1][6]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
ue->measurements.subband_pmi_re[eNB][0][0],
ue->measurements.subband_pmi_im[eNB][0][0],
ue->measurements.subband_pmi_re[eNB][1][0],
ue->measurements.subband_pmi_im[eNB][1][0],
ue->measurements.subband_pmi_re[eNB][2][0],
ue->measurements.subband_pmi_im[eNB][2][0],
ue->measurements.subband_pmi_re[eNB][3][0],
ue->measurements.subband_pmi_im[eNB][3][0],
ue->measurements.subband_pmi_re[eNB][4][0],
ue->measurements.subband_pmi_im[eNB][4][0],
ue->measurements.subband_pmi_re[eNB][5][0],
ue->measurements.subband_pmi_im[eNB][5][0],
ue->measurements.subband_pmi_re[eNB][6][0],
ue->measurements.subband_pmi_im[eNB][6][0]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
ue->measurements.subband_pmi_re[eNB][0][1],
ue->measurements.subband_pmi_im[eNB][0][1],
ue->measurements.subband_pmi_re[eNB][1][1],
ue->measurements.subband_pmi_im[eNB][1][1],
ue->measurements.subband_pmi_re[eNB][2][1],
ue->measurements.subband_pmi_im[eNB][2][1],
ue->measurements.subband_pmi_re[eNB][3][1],
ue->measurements.subband_pmi_im[eNB][3][1],
ue->measurements.subband_pmi_re[eNB][4][1],
ue->measurements.subband_pmi_im[eNB][4][1],
ue->measurements.subband_pmi_re[eNB][5][1],
ue->measurements.subband_pmi_im[eNB][5][1],
ue->measurements.subband_pmi_re[eNB][6][1],
ue->measurements.subband_pmi_im[eNB][6][1]);
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d]\n",
eNB,
ue->measurements.selected_rx_antennas[eNB][0],
ue->measurements.selected_rx_antennas[eNB][1],
ue->measurements.selected_rx_antennas[eNB][2],
ue->measurements.selected_rx_antennas[eNB][3],
ue->measurements.selected_rx_antennas[eNB][4],
ue->measurements.selected_rx_antennas[eNB][5],
ue->measurements.selected_rx_antennas[eNB][6]);
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,7)));
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB,
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,7)),
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,7)));
break;
case 50:
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d] dB\n",
eNB,
ue->measurements.subband_cqi_dB[eNB][0][0],
ue->measurements.subband_cqi_dB[eNB][0][1],
ue->measurements.subband_cqi_dB[eNB][0][2],
ue->measurements.subband_cqi_dB[eNB][0][3],
ue->measurements.subband_cqi_dB[eNB][0][4],
ue->measurements.subband_cqi_dB[eNB][0][5],
ue->measurements.subband_cqi_dB[eNB][0][6],
ue->measurements.subband_cqi_dB[eNB][0][7],
ue->measurements.subband_cqi_dB[eNB][0][8]);
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d] dB\n",
eNB,
ue->measurements.subband_cqi_dB[eNB][1][0],
ue->measurements.subband_cqi_dB[eNB][1][1],
ue->measurements.subband_cqi_dB[eNB][1][2],
ue->measurements.subband_cqi_dB[eNB][1][3],
ue->measurements.subband_cqi_dB[eNB][1][4],
ue->measurements.subband_cqi_dB[eNB][1][5],
ue->measurements.subband_cqi_dB[eNB][1][6],
ue->measurements.subband_cqi_dB[eNB][1][7],
ue->measurements.subband_cqi_dB[eNB][1][8]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
ue->measurements.subband_pmi_re[eNB][0][0],
ue->measurements.subband_pmi_im[eNB][0][0],
ue->measurements.subband_pmi_re[eNB][1][0],
ue->measurements.subband_pmi_im[eNB][1][0],
ue->measurements.subband_pmi_re[eNB][2][0],
ue->measurements.subband_pmi_im[eNB][2][0],
ue->measurements.subband_pmi_re[eNB][3][0],
ue->measurements.subband_pmi_im[eNB][3][0],
ue->measurements.subband_pmi_re[eNB][4][0],
ue->measurements.subband_pmi_im[eNB][4][0],
ue->measurements.subband_pmi_re[eNB][5][0],
ue->measurements.subband_pmi_im[eNB][5][0],
ue->measurements.subband_pmi_re[eNB][6][0],
ue->measurements.subband_pmi_im[eNB][6][0],
ue->measurements.subband_pmi_re[eNB][7][0],
ue->measurements.subband_pmi_im[eNB][7][0],
ue->measurements.subband_pmi_re[eNB][8][0],
ue->measurements.subband_pmi_im[eNB][8][0]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
ue->measurements.subband_pmi_re[eNB][0][1],
ue->measurements.subband_pmi_im[eNB][0][1],
ue->measurements.subband_pmi_re[eNB][1][1],
ue->measurements.subband_pmi_im[eNB][1][1],
ue->measurements.subband_pmi_re[eNB][2][1],
ue->measurements.subband_pmi_im[eNB][2][1],
ue->measurements.subband_pmi_re[eNB][3][1],
ue->measurements.subband_pmi_im[eNB][3][1],
ue->measurements.subband_pmi_re[eNB][4][1],
ue->measurements.subband_pmi_im[eNB][4][1],
ue->measurements.subband_pmi_re[eNB][5][1],
ue->measurements.subband_pmi_im[eNB][5][1],
ue->measurements.subband_pmi_re[eNB][6][1],
ue->measurements.subband_pmi_im[eNB][6][1],
ue->measurements.subband_pmi_re[eNB][7][1],
ue->measurements.subband_pmi_im[eNB][7][1],
ue->measurements.subband_pmi_re[eNB][8][1],
ue->measurements.subband_pmi_im[eNB][8][1]);
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d]\n",
eNB,
ue->measurements.selected_rx_antennas[eNB][0],
ue->measurements.selected_rx_antennas[eNB][1],
ue->measurements.selected_rx_antennas[eNB][2],
ue->measurements.selected_rx_antennas[eNB][3],
ue->measurements.selected_rx_antennas[eNB][4],
ue->measurements.selected_rx_antennas[eNB][5],
ue->measurements.selected_rx_antennas[eNB][6],
ue->measurements.selected_rx_antennas[eNB][7],
ue->measurements.selected_rx_antennas[eNB][8]);
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,9)));
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB,
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,9)),
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,9)));
break;
case 100:
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n",
eNB,
ue->measurements.subband_cqi_dB[eNB][0][0],
ue->measurements.subband_cqi_dB[eNB][0][1],
ue->measurements.subband_cqi_dB[eNB][0][2],
ue->measurements.subband_cqi_dB[eNB][0][3],
ue->measurements.subband_cqi_dB[eNB][0][4],
ue->measurements.subband_cqi_dB[eNB][0][5],
ue->measurements.subband_cqi_dB[eNB][0][6],
ue->measurements.subband_cqi_dB[eNB][0][7],
ue->measurements.subband_cqi_dB[eNB][0][8],
ue->measurements.subband_cqi_dB[eNB][0][9],
ue->measurements.subband_cqi_dB[eNB][0][10],
ue->measurements.subband_cqi_dB[eNB][0][11],
ue->measurements.subband_cqi_dB[eNB][0][12]);
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n",
eNB,
ue->measurements.subband_cqi_dB[eNB][1][0],
ue->measurements.subband_cqi_dB[eNB][1][1],
ue->measurements.subband_cqi_dB[eNB][1][2],
ue->measurements.subband_cqi_dB[eNB][1][3],
ue->measurements.subband_cqi_dB[eNB][1][4],
ue->measurements.subband_cqi_dB[eNB][1][5],
ue->measurements.subband_cqi_dB[eNB][1][6],
ue->measurements.subband_cqi_dB[eNB][1][7],
ue->measurements.subband_cqi_dB[eNB][1][8],
ue->measurements.subband_cqi_dB[eNB][1][9],
ue->measurements.subband_cqi_dB[eNB][1][10],
ue->measurements.subband_cqi_dB[eNB][1][11],
ue->measurements.subband_cqi_dB[eNB][1][12]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
ue->measurements.subband_pmi_re[eNB][0][0],
ue->measurements.subband_pmi_im[eNB][0][0],
ue->measurements.subband_pmi_re[eNB][1][0],
ue->measurements.subband_pmi_im[eNB][1][0],
ue->measurements.subband_pmi_re[eNB][2][0],
ue->measurements.subband_pmi_im[eNB][2][0],
ue->measurements.subband_pmi_re[eNB][3][0],
ue->measurements.subband_pmi_im[eNB][3][0],
ue->measurements.subband_pmi_re[eNB][4][0],
ue->measurements.subband_pmi_im[eNB][4][0],
ue->measurements.subband_pmi_re[eNB][5][0],
ue->measurements.subband_pmi_im[eNB][5][0],
ue->measurements.subband_pmi_re[eNB][6][0],
ue->measurements.subband_pmi_im[eNB][6][0],
ue->measurements.subband_pmi_re[eNB][7][0],
ue->measurements.subband_pmi_im[eNB][7][0],
ue->measurements.subband_pmi_re[eNB][8][0],
ue->measurements.subband_pmi_im[eNB][8][0],
ue->measurements.subband_pmi_re[eNB][9][0],
ue->measurements.subband_pmi_im[eNB][9][0],
ue->measurements.subband_pmi_re[eNB][10][0],
ue->measurements.subband_pmi_im[eNB][10][0],
ue->measurements.subband_pmi_re[eNB][11][0],
ue->measurements.subband_pmi_im[eNB][11][0],
ue->measurements.subband_pmi_re[eNB][12][0],
ue->measurements.subband_pmi_im[eNB][12][0]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
ue->measurements.subband_pmi_re[eNB][0][1],
ue->measurements.subband_pmi_im[eNB][0][1],
ue->measurements.subband_pmi_re[eNB][1][1],
ue->measurements.subband_pmi_im[eNB][1][1],
ue->measurements.subband_pmi_re[eNB][2][1],
ue->measurements.subband_pmi_im[eNB][2][1],
ue->measurements.subband_pmi_re[eNB][3][1],
ue->measurements.subband_pmi_im[eNB][3][1],
ue->measurements.subband_pmi_re[eNB][4][1],
ue->measurements.subband_pmi_im[eNB][4][1],
ue->measurements.subband_pmi_re[eNB][5][1],
ue->measurements.subband_pmi_im[eNB][5][1],
ue->measurements.subband_pmi_re[eNB][6][1],
ue->measurements.subband_pmi_im[eNB][6][1],
ue->measurements.subband_pmi_re[eNB][7][1],
ue->measurements.subband_pmi_im[eNB][7][1],
ue->measurements.subband_pmi_re[eNB][8][1],
ue->measurements.subband_pmi_im[eNB][8][1],
ue->measurements.subband_pmi_re[eNB][9][1],
ue->measurements.subband_pmi_im[eNB][9][1],
ue->measurements.subband_pmi_re[eNB][10][1],
ue->measurements.subband_pmi_im[eNB][10][1],
ue->measurements.subband_pmi_re[eNB][11][1],
ue->measurements.subband_pmi_im[eNB][11][1],
ue->measurements.subband_pmi_re[eNB][12][1],
ue->measurements.subband_pmi_im[eNB][12][1]);
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d %d %d %d %d]\n",
eNB,
ue->measurements.selected_rx_antennas[eNB][0],
ue->measurements.selected_rx_antennas[eNB][1],
ue->measurements.selected_rx_antennas[eNB][2],
ue->measurements.selected_rx_antennas[eNB][3],
ue->measurements.selected_rx_antennas[eNB][4],
ue->measurements.selected_rx_antennas[eNB][5],
ue->measurements.selected_rx_antennas[eNB][6],
ue->measurements.selected_rx_antennas[eNB][7],
ue->measurements.selected_rx_antennas[eNB][8],
ue->measurements.selected_rx_antennas[eNB][9],
ue->measurements.selected_rx_antennas[eNB][10],
ue->measurements.selected_rx_antennas[eNB][11],
ue->measurements.selected_rx_antennas[eNB][12]);
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,13)));
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB,
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,13)),
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,13)));
break;
}
#ifdef OPENAIR2
RRC_status = mac_UE_get_rrc_status(ue->Mod_id, 0);
len += sprintf(&buffer[len],"[UE PROC] RRC status = %d\n",RRC_status);
#endif
len += sprintf(&buffer[len], "[UE PROC] Transmission Mode %d \n",ue->transmission_mode[eNB]);
len += sprintf(&buffer[len], "[UE PROC] PBCH err conseq %d, PBCH error total %d, PBCH FER %d\n",
ue->pbch_vars[eNB]->pdu_errors_conseq,
......@@ -481,27 +447,31 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
if (ue->transmission_mode[eNB] == 6)
len += sprintf(&buffer[len], "[UE PROC] Mode 6 Wideband CQI eNB %d : %d dB\n",eNB,ue->measurements.precoded_cqi_dB[eNB][0]);
for (harq_pid=0;harq_pid<8;harq_pid++) {
len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 0 harq_pid %d, mcs %d:",eNB,harq_pid,ue->dlsch[0][0][0]->harq_processes[harq_pid]->mcs);
for (round=0;round<8;round++)
len+=sprintf(&buffer[len],"%d/%d ",
ue->dlsch[0][0][0]->harq_processes[harq_pid]->errors[round],
ue->dlsch[0][0][0]->harq_processes[harq_pid]->trials[round]);
len+=sprintf(&buffer[len],"\n");
for (harq_pid=0; harq_pid<8; harq_pid++) {
len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 0 harq_pid %d, mcs %d:",eNB,harq_pid,ue->dlsch[0][0][0]->harq_processes[harq_pid]->mcs);
for (round=0; round<8; round++)
len+=sprintf(&buffer[len],"%d/%d ",
ue->dlsch[0][0][0]->harq_processes[harq_pid]->errors[round],
ue->dlsch[0][0][0]->harq_processes[harq_pid]->trials[round]);
len+=sprintf(&buffer[len],"\n");
}
if (ue->dlsch[0][0] && ue->dlsch[0][0][0] && ue->dlsch[0][0][1]) {
len += sprintf(&buffer[len], "[UE PROC] Saved PMI for DLSCH eNB %d : %jx (%p)\n",eNB,pmi2hex_2Ar1(ue->dlsch[0][0][0]->pmi_alloc),ue->dlsch[0][0][0]);
len += sprintf(&buffer[len], "[UE PROC] eNB %d: dl_power_off = %d\n",eNB,ue->dlsch[0][0][0]->harq_processes[0]->dl_power_off);
for (harq_pid=0;harq_pid<8;harq_pid++) {
len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 1 harq_pid %d, mcs %d:",eNB,harq_pid,ue->dlsch[0][0][1]->harq_processes[0]->mcs);
for (round=0;round<8;round++)
len+=sprintf(&buffer[len],"%d/%d ",
ue->dlsch[0][0][1]->harq_processes[harq_pid]->errors[round],
ue->dlsch[0][0][1]->harq_processes[harq_pid]->trials[round]);
len+=sprintf(&buffer[len],"\n");
}
for (harq_pid=0; harq_pid<8; harq_pid++) {
len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 1 harq_pid %d, mcs %d:",eNB,harq_pid,ue->dlsch[0][0][1]->harq_processes[0]->mcs);
for (round=0; round<8; round++)
len+=sprintf(&buffer[len],"%d/%d ",
ue->dlsch[0][0][1]->harq_processes[harq_pid]->errors[round],
ue->dlsch[0][0][1]->harq_processes[harq_pid]->trials[round]);
len+=sprintf(&buffer[len],"\n");
}
}
len += sprintf(&buffer[len], "[UE PROC] DLSCH Total %d, Error %d, FER %d\n",ue->dlsch_received[0],ue->dlsch_errors[0],ue->dlsch_fer[0]);
......@@ -522,9 +492,7 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
len += sprintf(&buffer[len], "[UE PROC] DLSCH Bitrate %dkbps\n",(ue->bitrate[0]/1000));
len += sprintf(&buffer[len], "[UE PROC] Total Received Bits %dkbits\n",(ue->total_received_bits[0]/1000));
len += sprintf(&buffer[len], "[UE PROC] IA receiver %d\n",ue->use_ia_receiver);
}
} else {
len += sprintf(&buffer[len], "[UE PROC] Frame count: %d, RSSI %3.2f dB (%d dB, %d dB), N0 %3.2f dB (%d dB, %d dB)\n",
proc->frame_rx,
......@@ -546,7 +514,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
}
len += sprintf(&buffer[len],"EOF\n");
return len;
} // is_clusterhead
......@@ -582,121 +549,121 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length)
eNB->measurements.n0_power_dB[1]);
len += sprintf(&buffer[len],"PRB I0 (%X.%X.%X.%X): ",
eNB->rb_mask_ul[0],
eNB->rb_mask_ul[1],eNB->rb_mask_ul[2],eNB->rb_mask_ul[3]);
eNB->rb_mask_ul[0],
eNB->rb_mask_ul[1],eNB->rb_mask_ul[2],eNB->rb_mask_ul[3]);
for (i=0; i<eNB->frame_parms.N_RB_UL; i++) {
len += sprintf(&buffer[len],"%4d ",
eNB->measurements.n0_subband_power_tot_dBm[i]);
if ((i>0) && ((i%25) == 0))
len += sprintf(&buffer[len],"\n");
if ((i>0) && ((i%25) == 0))
len += sprintf(&buffer[len],"\n");
}
len += sprintf(&buffer[len],"\n");
len += sprintf(&buffer[len],"\nPERFORMANCE PARAMETERS\n");
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
if (eNB &&
(eNB->dlsch!=NULL) &&
(eNB->dlsch[(uint8_t)UE_id]!=NULL) &&
(eNB->dlsch[(uint8_t)UE_id][0]->rnti>0)&&
(eNB->UE_stats[UE_id].mode == PUSCH)) {
(eNB->dlsch!=NULL) &&
(eNB->dlsch[(uint8_t)UE_id]!=NULL) &&
(eNB->dlsch[(uint8_t)UE_id][0]->rnti>0)&&
(eNB->UE_stats[UE_id].mode == PUSCH)) {
eNB->total_dlsch_bitrate = eNB->UE_stats[UE_id].dlsch_bitrate + eNB->total_dlsch_bitrate;
eNB->total_transmitted_bits = eNB->UE_stats[UE_id].total_TBS + eNB->total_transmitted_bits;
//eNB->total_system_throughput = eNB->UE_stats[UE_id].total_transmitted_bits + eNB->total_system_throughput;
for (i=0; i<8; i++)
success = success + (eNB->UE_stats[UE_id].dlsch_trials[i][0] - eNB->UE_stats[UE_id].dlsch_l2_errors[i]);
len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(eNB->total_transmitted_bits/1000),proc->frame_tx+1);
len += sprintf(&buffer[len],"Total DLSCH throughput %d kbps ",(eNB->total_dlsch_bitrate/1000));
len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,proc->frame_tx+1);
//len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->FULL_MUMIMO_transmissions,eNB->check_for_total_transmissions);
//len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_MUMIMO_transmissions,eNB->check_for_total_transmissions);
//len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_SUMIMO_transmissions,eNB->check_for_total_transmissions);
len += sprintf(&buffer[len],"UE %d (%x) Power: (%d,%d) dB, Po_PUSCH: (%d,%d) dBm, Po_PUCCH (%d/%d) dBm, Po_PUCCH1 (%d,%d) dBm, PUCCH1 Thres %d dBm \n",
UE_id,
eNB->UE_stats[UE_id].crnti,
dB_fixed(eNB->pusch_vars[UE_id]->ulsch_power[0]),
dB_fixed(eNB->pusch_vars[UE_id]->ulsch_power[1]),
eNB->UE_stats[UE_id].UL_rssi[0],
eNB->UE_stats[UE_id].UL_rssi[1],
dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB,
eNB->frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH1_below/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB,
dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH1_above/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB,
PUCCH1_THRES+eNB->measurements.n0_power_tot_dBm-dB_fixed(eNB->frame_parms.N_RB_UL));
len+= sprintf(&buffer[len],"DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d, ",
eNB->dlsch[(uint8_t)UE_id][0]->harq_processes[0]->mcs,
eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->mcs,
eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->nb_rb,
eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->delta_TF);
len += sprintf(&buffer[len],"Wideband CQI: (%d,%d) dB\n",
eNB->measurements.wideband_cqi_dB[UE_id][0],
eNB->measurements.wideband_cqi_dB[UE_id][1]);
len += sprintf(&buffer[len],"DL TM %d, DL_cqi %d, DL_pmi_single %jx ",
eNB->transmission_mode[UE_id],
eNB->UE_stats[UE_id].DL_cqi[0],
pmi2hex_2Ar1(eNB->UE_stats[UE_id].DL_pmi_single));
len += sprintf(&buffer[len],"Timing advance %d samples (%d 16Ts), update %d ",
eNB->UE_stats[UE_id].UE_timing_offset,
eNB->UE_stats[UE_id].UE_timing_offset>>2,
eNB->UE_stats[UE_id].timing_advance_update);
len += sprintf(&buffer[len],"Mode = %s(%d) ",
mode_string[eNB->UE_stats[UE_id].mode],
eNB->UE_stats[UE_id].mode);
UE_id_mac = find_UE_id(eNB->Mod_id,eNB->dlsch[(uint8_t)UE_id][0]->rnti);
if (UE_id_mac != -1) {
RRC_status = mac_eNB_get_rrc_status(eNB->Mod_id,eNB->dlsch[(uint8_t)UE_id][0]->rnti);
len += sprintf(&buffer[len],"UE_id_mac = %d, RRC status = %d\n",UE_id_mac,RRC_status);
} else
len += sprintf(&buffer[len],"UE_id_mac = -1\n");
for (i=0; i<8; i++)
success = success + (eNB->UE_stats[UE_id].dlsch_trials[i][0] - eNB->UE_stats[UE_id].dlsch_l2_errors[i]);
len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(eNB->total_transmitted_bits/1000),proc->frame_tx+1);
len += sprintf(&buffer[len],"Total DLSCH throughput %d kbps ",(eNB->total_dlsch_bitrate/1000));
len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,proc->frame_tx+1);
//len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->FULL_MUMIMO_transmissions,eNB->check_for_total_transmissions);
//len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_MUMIMO_transmissions,eNB->check_for_total_transmissions);
//len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_SUMIMO_transmissions,eNB->check_for_total_transmissions);
len += sprintf(&buffer[len],"UE %d (%x) Power: (%d,%d) dB, Po_PUSCH: (%d,%d) dBm, Po_PUCCH (%d/%d) dBm, Po_PUCCH1 (%d,%d) dBm, PUCCH1 Thres %d dBm \n",
UE_id,
eNB->UE_stats[UE_id].crnti,
dB_fixed(eNB->pusch_vars[UE_id]->ulsch_power[0]),
dB_fixed(eNB->pusch_vars[UE_id]->ulsch_power[1]),
eNB->UE_stats[UE_id].UL_rssi[0],
eNB->UE_stats[UE_id].UL_rssi[1],
dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB,
eNB->frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH1_below/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB,
dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH1_above/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB,
PUCCH1_THRES+eNB->measurements.n0_power_tot_dBm-dB_fixed(eNB->frame_parms.N_RB_UL));
len+= sprintf(&buffer[len],"DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d, ",
eNB->dlsch[(uint8_t)UE_id][0]->harq_processes[0]->mcs,
eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->mcs,
eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->nb_rb,
eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->delta_TF);
len += sprintf(&buffer[len],"Wideband CQI: (%d,%d) dB\n",
eNB->measurements.wideband_cqi_dB[UE_id][0],
eNB->measurements.wideband_cqi_dB[UE_id][1]);
len += sprintf(&buffer[len],"DL TM %d, DL_cqi %d, DL_pmi_single %jx ",
eNB->transmission_mode[UE_id],
eNB->UE_stats[UE_id].DL_cqi[0],
pmi2hex_2Ar1(eNB->UE_stats[UE_id].DL_pmi_single));
len += sprintf(&buffer[len],"Timing advance %d samples (%d 16Ts), update %d ",
eNB->UE_stats[UE_id].UE_timing_offset,
eNB->UE_stats[UE_id].UE_timing_offset>>2,
eNB->UE_stats[UE_id].timing_advance_update);
len += sprintf(&buffer[len],"Mode = %s(%d) ",
mode_string[eNB->UE_stats[UE_id].mode],
eNB->UE_stats[UE_id].mode);
UE_id_mac = find_UE_id(eNB->Mod_id,eNB->dlsch[(uint8_t)UE_id][0]->rnti);
if (UE_id_mac != -1) {
RRC_status = mac_eNB_get_rrc_status(eNB->Mod_id,eNB->dlsch[(uint8_t)UE_id][0]->rnti);
len += sprintf(&buffer[len],"UE_id_mac = %d, RRC status = %d\n",UE_id_mac,RRC_status);
} else
len += sprintf(&buffer[len],"UE_id_mac = -1\n");
len += sprintf(&buffer[len],"SR received/total: %d/%d (diff %d)\n",
eNB->UE_stats[UE_id].sr_received,
eNB->UE_stats[UE_id].sr_total,
eNB->UE_stats[UE_id].sr_total-eNB->UE_stats[UE_id].sr_received);
len += sprintf(&buffer[len],"DL Subband CQI: ");
int nb_sb;
switch (eNB->frame_parms.N_RB_DL) {
case 6:
nb_sb=0;
break;
case 15:
nb_sb = 4;
case 25:
nb_sb = 7;
break;
case 50:
nb_sb = 9;
break;
case 75:
nb_sb = 10;
break;
case 100:
nb_sb = 13;
break;
default:
nb_sb=0;
break;
}
for (i=0; i<nb_sb; i++)
len += sprintf(&buffer[len],"%2d ",
eNB->UE_stats[UE_id].DL_subband_cqi[0][i]);
len += sprintf(&buffer[len],"\n");
len += sprintf(&buffer[len],"DL Subband CQI: ");
int nb_sb;
switch (eNB->frame_parms.N_RB_DL) {
case 6:
nb_sb=0;
break;
case 15:
nb_sb = 4;
case 25:
nb_sb = 7;
break;
case 50:
nb_sb = 9;
break;
case 75:
nb_sb = 10;
break;
case 100:
nb_sb = 13;
break;
default:
nb_sb=0;
break;
}
for (i=0; i<nb_sb; i++)
len += sprintf(&buffer[len],"%2d ",
eNB->UE_stats[UE_id].DL_subband_cqi[0][i]);
len += sprintf(&buffer[len],"\n");
ulsch_errors = 0;
......@@ -722,9 +689,9 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length)
eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][2],
eNB->UE_stats[UE_id].ulsch_round_errors[i][3],
eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][3]);
if ((i&1) == 1)
len += sprintf(&buffer[len],"\n");
if ((i&1) == 1)
len += sprintf(&buffer[len],"\n");
ulsch_errors+=eNB->UE_stats[UE_id].ulsch_errors[i];
for (j=0; j<4; j++) {
......@@ -767,8 +734,8 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length)
eNB->UE_stats[UE_id].dlsch_ACK[i][3],
eNB->UE_stats[UE_id].dlsch_NAK[i][3],
eNB->UE_stats[UE_id].dlsch_trials[i][3]);
if ((i&1) == 1)
len += sprintf(&buffer[len],"\n");
if ((i&1) == 1)
len += sprintf(&buffer[len],"\n");
dlsch_errors+=eNB->UE_stats[UE_id].dlsch_l2_errors[i];
......@@ -790,15 +757,15 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length)
len += sprintf(&buffer[len],"DLSCH total bits from MAC: %dkbit ",(eNB->UE_stats[UE_id].total_TBS_MAC)/1000);
len += sprintf(&buffer[len],"DLSCH total bits ack'ed: %dkbit ",(eNB->UE_stats[UE_id].total_TBS)/1000);
len += sprintf(&buffer[len],"DLSCH Average throughput (100 frames): %dkbps\n",(eNB->UE_stats[UE_id].dlsch_bitrate/1000));
// len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",eNB->transmission_mode[UE_id]);
// len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",eNB->transmission_mode[UE_id]);
}
}
len += sprintf(&buffer[len],"\n");
}
len += sprintf(&buffer[len],"EOF\n");
return len;
}
*/
......@@ -31,6 +31,7 @@
*/
#include "PHY/types.h"
#include "PHY/defs_UE.h"
#include "targets/RT/USER/lte-softmodem.h"
#include "PHY/phy_extern_ue.h"
#include "SCHED_UE/sched_UE.h"
#include "transport_proto_ue.h"
......@@ -49,10 +50,8 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
uint8_t l,pbch_decoded,frame_mod4,pbch_tx_ant,dummy;
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
char phich_resource[6];
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"[UE%d] Initial sync: starting PBCH detection (rx_offset %d)\n",ue->Mod_id,
LOG_D(PHY,"[UE%d] Initial sync: starting PBCH detection (rx_offset %d)\n",ue->Mod_id,
ue->rx_offset);
#endif
for (l=0; l<frame_parms->symbols_per_tti/2; l++) {
slot_fep(ue,
......@@ -95,8 +94,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
0);
}
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"[UE %d] RX RSSI %d dBm, digital (%d, %d) dB, linear (%d, %d), avg rx power %d dB (%d lin), RX gain %d dB\n",
LOG_D(PHY,"[UE %d] RX RSSI %d dBm, digital (%d, %d) dB, linear (%d, %d), avg rx power %d dB (%d lin), RX gain %d dB\n",
ue->Mod_id,
ue->measurements.rx_rssi_dBm[0] - ((ue->frame_parms.nb_antennas_rx==2) ? 3 : 0),
ue->measurements.rx_power_dB[0][0],
......@@ -106,7 +104,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
ue->measurements.rx_power_avg_dB[0],
ue->measurements.rx_power_avg[0],
ue->rx_total_gain_dB);
LOG_I(PHY,"[UE %d] N0 %d dBm digital (%d, %d) dB, linear (%d, %d), avg noise power %d dB (%d lin)\n",
LOG_D(PHY,"[UE %d] N0 %d dBm digital (%d, %d) dB, linear (%d, %d), avg noise power %d dB (%d lin)\n",
ue->Mod_id,
ue->measurements.n0_power_tot_dBm,
ue->measurements.n0_power_dB[0],
......@@ -115,7 +113,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
ue->measurements.n0_power[1],
ue->measurements.n0_power_avg_dB,
ue->measurements.n0_power_avg);
#endif
pbch_decoded = 0;
for (frame_mod4=0; frame_mod4<4; frame_mod4++) {
......@@ -225,8 +222,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx;
}
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"[UE%d] Initial sync: pbch decoded sucessfully p %d, tx_ant %d, frame %d, N_RB_DL %d, phich_duration %d, phich_resource %s!\n",
LOG_D(PHY,"[UE%d] Initial sync: pbch decoded sucessfully p %d, tx_ant %d, frame %d, N_RB_DL %d, phich_duration %d, phich_resource %s!\n",
ue->Mod_id,
frame_parms->nb_antenna_ports_eNB,
pbch_tx_ant,
......@@ -234,7 +230,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
frame_parms->N_RB_DL,
frame_parms->phich_config_common.phich_duration,
phich_resource); //frame_parms->phich_config_common.phich_resource);
#endif
return(0);
} else {
return(-1);
......@@ -254,10 +249,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
int ret=-1;
int aarx,rx_power=0;
/*#ifdef OAI_USRP
__m128i *rxdata128;
#endif*/
// LOG_I(PHY,"**************************************************************\n");
// First try FDD normal prefix
frame_parms->Ncp=NORMAL;
frame_parms->frame_type=FDD;
......@@ -277,9 +268,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
else
sync_pos2 = sync_pos + FRAME_LENGTH_COMPLEX_SAMPLES - frame_parms->nb_prefix_samples;
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id);
#endif
LOG_D(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id);
// SSS detection
// PSS is hypothesized in last symbol of first slot in Frame
sync_pos_slot = (frame_parms->samples_per_tti>>1) - frame_parms->ofdm_symbol_size - frame_parms->nb_prefix_samples;
......@@ -291,9 +280,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
if (((sync_pos2 - sync_pos_slot) >=0 ) &&
((sync_pos2 - sync_pos_slot) < ((FRAME_LENGTH_COMPLEX_SAMPLES-frame_parms->samples_per_tti/2)))) {
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"Calling sss detection (FDD normal CP)\n");
#endif
LOG_D(PHY,"Calling sss detection (FDD normal CP)\n");
rx_sss(ue,&metric_fdd_ncp,&flip_fdd_ncp,&phase_fdd_ncp);
frame_parms->nushift = frame_parms->Nid_cell%6;
......@@ -304,14 +291,10 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell);
ret = pbch_detection(ue,mode);
// LOG_M("rxdata2.m","rxd2",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"FDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
LOG_D(PHY,"FDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
frame_parms->Nid_cell,metric_fdd_ncp,phase_fdd_ncp,flip_fdd_ncp,ret);
#endif
} else {
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"FDD Normal prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot);
#endif
LOG_D(PHY,"FDD Normal prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot);
}
if (ret==-1) {
......@@ -347,14 +330,10 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell);
ret = pbch_detection(ue,mode);
// LOG_M("rxdata3.m","rxd3",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"FDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
LOG_D(PHY,"FDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
frame_parms->Nid_cell,metric_fdd_ecp,phase_fdd_ecp,flip_fdd_ecp,ret);
#endif
} else {
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"FDD Extended prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot);
#endif
LOG_D(PHY,"FDD Extended prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot);
}
if (ret==-1) {
......@@ -390,10 +369,8 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell);
ret = pbch_detection(ue,mode);
// LOG_M("rxdata4.m","rxd4",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"TDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
LOG_D(PHY,"TDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
frame_parms->Nid_cell,metric_tdd_ncp,phase_tdd_ncp,flip_tdd_ncp,ret);
#endif
if (ret==-1) {
// Now TDD extended prefix
......@@ -426,10 +403,8 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell);
ret = pbch_detection(ue,mode);
// LOG_M("rxdata5.m","rxd5",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"TDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
LOG_D(PHY,"TDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
frame_parms->Nid_cell,metric_tdd_ecp,phase_tdd_ecp,flip_tdd_ecp,ret);
#endif
}
}
}
......@@ -481,18 +456,16 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset,
ue->common_vars.freq_offset);
} else {
#ifdef DEBUG_INITIAL_SYNC
LOG_I(PHY,"[UE%d] Initial sync : PBCH not ok\n",ue->Mod_id);
LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id);
LOG_D(PHY,"[UE%d] Initial sync : PBCH not ok\n",ue->Mod_id);
LOG_D(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id);
/* LOG_I(PHY,"[UE%d] Initial sync: (metric fdd_ncp %d (%d), metric fdd_ecp %d (%d), metric_tdd_ncp %d (%d), metric_tdd_ecp %d (%d))\n",
ue->Mod_id,
metric_fdd_ncp,Nid_cell_fdd_ncp,
metric_fdd_ecp,Nid_cell_fdd_ecp,
metric_tdd_ncp,Nid_cell_tdd_ncp,
metric_tdd_ecp,Nid_cell_tdd_ecp);*/
LOG_I(PHY,"[UE%d] Initial sync : Estimated Nid_cell %d, Frame_type %d\n",ue->Mod_id,
LOG_D(PHY,"[UE%d] Initial sync : Estimated Nid_cell %d, Frame_type %d\n",ue->Mod_id,
frame_parms->Nid_cell,frame_parms->frame_type);
#endif
ue->UE_mode[0] = NOT_SYNCHED;
ue->pbch_vars[0]->pdu_errors_last=ue->pbch_vars[0]->pdu_errors;
ue->pbch_vars[0]->pdu_errors++;
......@@ -517,27 +490,15 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
// we might add a low-pass filter here later
ue->measurements.rx_power_avg[0] = rx_power/frame_parms->nb_antennas_rx;
ue->measurements.rx_power_avg_dB[0] = dB_fixed(ue->measurements.rx_power_avg[0]);
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] );
#endif
#ifndef OAI_USRP
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0);
#endif
#endif
#endif
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM )
phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0);
} else {
#ifndef OAI_USRP
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0);
#endif
#endif
#endif
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM )
phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0);
}
// exit_fun("debug exit");
return ret;
}
......@@ -31,6 +31,7 @@
*/
#include "PHY/sse_intrin.h"
#include "PHY/defs_UE.h"
#include "targets/RT/USER/lte-softmodem.h"
#include "PHY/phy_extern_ue.h"
//#include "prach.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
......@@ -43,9 +44,7 @@
//#define PRACH_DEBUG 1
int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint16_t Nf )
{
int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint16_t Nf ) {
lte_frame_type_t frame_type = ue->frame_parms.frame_type;
//uint8_t tdd_config = ue->frame_parms.tdd_config;
uint16_t rootSequenceIndex = ue->frame_parms.prach_config_common.rootSequenceIndex;
......@@ -67,7 +66,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
uint16_t preamble_offset,preamble_shift;
uint16_t preamble_index0,n_shift_ra,n_shift_ra_bar;
uint16_t d_start,numshift;
uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type);
//uint8_t Nsp=2;
//uint8_t f_ra,t1_ra;
......@@ -82,50 +80,46 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
int i, prach_len;
uint16_t first_nonzero_root_idx=0;
#if defined(EXMIMO) || defined(OAI_USRP)
prach_start = (ue->rx_offset+subframe*ue->frame_parms.samples_per_tti-ue->hw_timing_advance-ue->N_TA_offset);
if ( !(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) {
prach_start = (ue->rx_offset+subframe*ue->frame_parms.samples_per_tti-ue->hw_timing_advance-ue->N_TA_offset);
#ifdef PRACH_DEBUG
LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id,
prach_start,
ue->rx_offset,
ue->hw_timing_advance,
ue->N_TA_offset);
prach_start,
ue->rx_offset,
ue->hw_timing_advance,
ue->N_TA_offset);
#endif
if (prach_start<0)
prach_start+=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
if (prach_start>=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
prach_start-=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
#else //normal case (simulation)
prach_start = subframe*ue->frame_parms.samples_per_tti-ue->N_TA_offset;
LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id,
prach_start,
ue->rx_offset,
ue->hw_timing_advance,
ue->N_TA_offset);
#endif
if (prach_start<0)
prach_start+=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
if (prach_start>=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
prach_start-=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
} else { //normal case (simulation)
prach_start = subframe*ue->frame_parms.samples_per_tti-ue->N_TA_offset;
LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id,
prach_start,
ue->rx_offset,
ue->hw_timing_advance,
ue->N_TA_offset);
}
// First compute physical root sequence
if (restricted_set == 0) {
AssertFatal(Ncs_config <= 15,
"[PHY] FATAL, Illegal Ncs_config for unrestricted format %"PRIu8"\n", Ncs_config );
"[PHY] FATAL, Illegal Ncs_config for unrestricted format %"PRIu8"\n", Ncs_config );
NCS = NCS_unrestricted[Ncs_config];
} else {
AssertFatal(Ncs_config <= 14,
"[PHY] FATAL, Illegal Ncs_config for restricted format %"PRIu8"\n", Ncs_config );
"[PHY] FATAL, Illegal Ncs_config for restricted format %"PRIu8"\n", Ncs_config );
NCS = NCS_restricted[Ncs_config];
}
n_ra_prb = get_prach_prb_offset(&(ue->frame_parms),
ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset,
tdd_mapindex, Nf);
ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset,
tdd_mapindex, Nf);
prach_root_sequence_map = (prach_fmt<4) ? prach_root_sequence_map0_3 : prach_root_sequence_map4;
/*
// this code is not part of get_prach_prb_offset
if (frame_type == TDD) { // TDD
......@@ -157,7 +151,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
}
}
*/
// This is the relative offset (for unrestricted case) in the root sequence table (5.7.2-4 from 36.211) for the given preamble index
preamble_offset = ((NCS==0)? preamble_index : (preamble_index/(N_ZC/NCS)));
......@@ -166,11 +159,9 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
preamble_shift = (NCS==0)? 0 : (preamble_index % (N_ZC/NCS));
preamble_shift *= NCS;
} else { // This is the high-speed case
#ifdef PRACH_DEBUG
LOG_I(PHY,"[UE %d] High-speed mode, NCS_config %d\n",ue->Mod_id,Ncs_config);
#endif
not_found = 1;
preamble_index0 = preamble_index;
// set preamble_offset to initial rootSequenceIndex and look if we need more root sequences for this
......@@ -190,7 +181,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
}
u = prach_root_sequence_map[index];
uint16_t n_group_ra = 0;
if ( (du[u]<(N_ZC/3)) && (du[u]>=NCS) ) {
......@@ -217,7 +207,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
if (preamble_index0 < numshift) {
not_found = 0;
preamble_shift = (d_start * (preamble_index0/n_shift_ra)) + ((preamble_index0%n_shift_ra)*NCS);
} else { // skip to next rootSequenceIndex and recompute parameters
preamble_offset++;
preamble_index0 -= numshift;
......@@ -234,10 +223,8 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
preamble_offset,preamble_shift);
#endif
// nsymb = (frame_parms->Ncp==0) ? 14:12;
// subframe_offset = (unsigned int)frame_parms->ofdm_symbol_size*subframe*nsymb;
k = (12*n_ra_prb) - 6*ue->frame_parms.N_RB_UL;
if (k<0)
......@@ -245,9 +232,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
k*=12;
k+=13;
Xu = (int16_t*)ue->X_u[preamble_offset-first_nonzero_root_idx];
Xu = (int16_t *)ue->X_u[preamble_offset-first_nonzero_root_idx];
/*
k+=(12*ue->frame_parms.first_carrier_offset);
if (k>(12*ue->frame_parms.ofdm_symbol_size))
......@@ -256,36 +241,36 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
k*=2;
switch (ue->frame_parms.N_RB_UL) {
case 6:
memset((void*)prachF,0,4*1536);
break;
case 15:
memset((void*)prachF,0,4*3072);
break;
case 25:
memset((void*)prachF,0,4*6144);
break;
case 50:
memset((void*)prachF,0,4*12288);
break;
case 75:
memset((void*)prachF,0,4*18432);
break;
case 100:
if (ue->frame_parms.threequarter_fs == 0)
memset((void*)prachF,0,4*24576);
else
memset((void*)prachF,0,4*18432);
break;
case 6:
memset((void *)prachF,0,4*1536);
break;
case 15:
memset((void *)prachF,0,4*3072);
break;
case 25:
memset((void *)prachF,0,4*6144);
break;
case 50:
memset((void *)prachF,0,4*12288);
break;
case 75:
memset((void *)prachF,0,4*18432);
break;
case 100:
if (ue->frame_parms.threequarter_fs == 0)
memset((void *)prachF,0,4*24576);
else
memset((void *)prachF,0,4*18432);
break;
}
for (offset=0,offset2=0; offset<N_ZC; offset++,offset2+=preamble_shift) {
if (offset2 >= N_ZC)
offset2 -= N_ZC;
......@@ -299,49 +284,49 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
}
switch (prach_fmt) {
case 0:
Ncp = 3168;
break;
case 1:
case 3:
Ncp = 21024;
break;
case 2:
Ncp = 6240;
break;
case 4:
Ncp = 448;
break;
default:
Ncp = 3168;
break;
case 0:
Ncp = 3168;
break;
case 1:
case 3:
Ncp = 21024;
break;
case 2:
Ncp = 6240;
break;
case 4:
Ncp = 448;
break;
default:
Ncp = 3168;
break;
}
switch (ue->frame_parms.N_RB_UL) {
case 6:
Ncp>>=4;
prach+=4; // makes prach2 aligned to 128-bit
break;
case 15:
Ncp>>=3;
break;
case 25:
Ncp>>=2;
break;
case 50:
Ncp>>=1;
break;
case 75:
Ncp=(Ncp*3)>>2;
break;
case 6:
Ncp>>=4;
prach+=4; // makes prach2 aligned to 128-bit
break;
case 15:
Ncp>>=3;
break;
case 25:
Ncp>>=2;
break;
case 50:
Ncp>>=1;
break;
case 75:
Ncp=(Ncp*3)>>2;
break;
}
if (ue->frame_parms.threequarter_fs == 1)
......@@ -351,186 +336,184 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
// do IDFT
switch (ue->frame_parms.N_RB_UL) {
case 6:
if (prach_fmt == 4) {
idft256(prachF,prach2,1);
memmove( prach, prach+512, Ncp<<2 );
prach_len = 256+Ncp;
} else {
idft1536(prachF,prach2,1);
memmove( prach, prach+3072, Ncp<<2 );
prach_len = 1536+Ncp;
if (prach_fmt>1) {
memmove( prach2+3072, prach2, 6144 );
prach_len = 2*1536+Ncp;
}
}
break;
case 15:
if (prach_fmt == 4) {
idft512(prachF,prach2,1);
//TODO: account for repeated format in dft output
memmove( prach, prach+1024, Ncp<<2 );
prach_len = 512+Ncp;
} else {
idft3072(prachF,prach2,1);
memmove( prach, prach+6144, Ncp<<2 );
prach_len = 3072+Ncp;
if (prach_fmt>1) {
memmove( prach2+6144, prach2, 12288 );
prach_len = 2*3072+Ncp;
case 6:
if (prach_fmt == 4) {
idft256(prachF,prach2,1);
memmove( prach, prach+512, Ncp<<2 );
prach_len = 256+Ncp;
} else {
idft1536(prachF,prach2,1);
memmove( prach, prach+3072, Ncp<<2 );
prach_len = 1536+Ncp;
if (prach_fmt>1) {
memmove( prach2+3072, prach2, 6144 );
prach_len = 2*1536+Ncp;
}
}
}
break;
break;
case 25:
default:
if (prach_fmt == 4) {
idft1024(prachF,prach2,1);
memmove( prach, prach+2048, Ncp<<2 );
prach_len = 1024+Ncp;
} else {
idft6144(prachF,prach2,1);
/*for (i=0;i<6144*2;i++)
prach2[i]<<=1;*/
memmove( prach, prach+12288, Ncp<<2 );
prach_len = 6144+Ncp;
if (prach_fmt>1) {
memmove( prach2+12288, prach2, 24576 );
prach_len = 2*6144+Ncp;
case 15:
if (prach_fmt == 4) {
idft512(prachF,prach2,1);
//TODO: account for repeated format in dft output
memmove( prach, prach+1024, Ncp<<2 );
prach_len = 512+Ncp;
} else {
idft3072(prachF,prach2,1);
memmove( prach, prach+6144, Ncp<<2 );
prach_len = 3072+Ncp;
if (prach_fmt>1) {
memmove( prach2+6144, prach2, 12288 );
prach_len = 2*3072+Ncp;
}
}
}
break;
case 50:
if (prach_fmt == 4) {
idft2048(prachF,prach2,1);
memmove( prach, prach+4096, Ncp<<2 );
prach_len = 2048+Ncp;
} else {
idft12288(prachF,prach2,1);
memmove( prach, prach+24576, Ncp<<2 );
prach_len = 12288+Ncp;
break;
if (prach_fmt>1) {
memmove( prach2+24576, prach2, 49152 );
prach_len = 2*12288+Ncp;
case 25:
default:
if (prach_fmt == 4) {
idft1024(prachF,prach2,1);
memmove( prach, prach+2048, Ncp<<2 );
prach_len = 1024+Ncp;
} else {
idft6144(prachF,prach2,1);
/*for (i=0;i<6144*2;i++)
prach2[i]<<=1;*/
memmove( prach, prach+12288, Ncp<<2 );
prach_len = 6144+Ncp;
if (prach_fmt>1) {
memmove( prach2+12288, prach2, 24576 );
prach_len = 2*6144+Ncp;
}
}
}
break;
case 75:
if (prach_fmt == 4) {
idft3072(prachF,prach2,1);
//TODO: account for repeated format in dft output
memmove( prach, prach+6144, Ncp<<2 );
prach_len = 3072+Ncp;
} else {
idft18432(prachF,prach2,1);
memmove( prach, prach+36864, Ncp<<2 );
prach_len = 18432+Ncp;
break;
if (prach_fmt>1) {
memmove( prach2+36834, prach2, 73728 );
prach_len = 2*18432+Ncp;
case 50:
if (prach_fmt == 4) {
idft2048(prachF,prach2,1);
memmove( prach, prach+4096, Ncp<<2 );
prach_len = 2048+Ncp;
} else {
idft12288(prachF,prach2,1);
memmove( prach, prach+24576, Ncp<<2 );
prach_len = 12288+Ncp;
if (prach_fmt>1) {
memmove( prach2+24576, prach2, 49152 );
prach_len = 2*12288+Ncp;
}
}
}
break;
break;
case 100:
if (ue->frame_parms.threequarter_fs == 0) {
case 75:
if (prach_fmt == 4) {
idft4096(prachF,prach2,1);
memmove( prach, prach+8192, Ncp<<2 );
prach_len = 4096+Ncp;
idft3072(prachF,prach2,1);
//TODO: account for repeated format in dft output
memmove( prach, prach+6144, Ncp<<2 );
prach_len = 3072+Ncp;
} else {
idft24576(prachF,prach2,1);
memmove( prach, prach+49152, Ncp<<2 );
prach_len = 24576+Ncp;
if (prach_fmt>1) {
memmove( prach2+49152, prach2, 98304 );
prach_len = 2* 24576+Ncp;
}
idft18432(prachF,prach2,1);
memmove( prach, prach+36864, Ncp<<2 );
prach_len = 18432+Ncp;
if (prach_fmt>1) {
memmove( prach2+36834, prach2, 73728 );
prach_len = 2*18432+Ncp;
}
}
}
else {
if (prach_fmt == 4) {
idft3072(prachF,prach2,1);
//TODO: account for repeated format in dft output
memmove( prach, prach+6144, Ncp<<2 );
prach_len = 3072+Ncp;
break;
case 100:
if (ue->frame_parms.threequarter_fs == 0) {
if (prach_fmt == 4) {
idft4096(prachF,prach2,1);
memmove( prach, prach+8192, Ncp<<2 );
prach_len = 4096+Ncp;
} else {
idft24576(prachF,prach2,1);
memmove( prach, prach+49152, Ncp<<2 );
prach_len = 24576+Ncp;
if (prach_fmt>1) {
memmove( prach2+49152, prach2, 98304 );
prach_len = 2* 24576+Ncp;
}
}
} else {
idft18432(prachF,prach2,1);
memmove( prach, prach+36864, Ncp<<2 );
prach_len = 18432+Ncp;
printf("Generated prach for 100 PRB, 3/4 sampling\n");
if (prach_fmt>1) {
memmove( prach2+36834, prach2, 73728 );
prach_len = 2*18432+Ncp;
}
}
}
if (prach_fmt == 4) {
idft3072(prachF,prach2,1);
//TODO: account for repeated format in dft output
memmove( prach, prach+6144, Ncp<<2 );
prach_len = 3072+Ncp;
} else {
idft18432(prachF,prach2,1);
memmove( prach, prach+36864, Ncp<<2 );
prach_len = 18432+Ncp;
printf("Generated prach for 100 PRB, 3/4 sampling\n");
if (prach_fmt>1) {
memmove( prach2+36834, prach2, 73728 );
prach_len = 2*18432+Ncp;
}
}
}
break;
break;
}
//LOG_I(PHY,"prach_len=%d\n",prach_len);
AssertFatal(prach_fmt<4,
"prach_fmt4 not fully implemented" );
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
int j;
int overflow = prach_start + prach_len - LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*ue->frame_parms.samples_per_tti;
LOG_I( PHY, "prach_start=%d, overflow=%d\n", prach_start, overflow );
for (i=prach_start,j=0; i<min(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,prach_start+prach_len); i++,j++) {
((int16_t*)ue->common_vars.txdata[0])[2*i] = prach[2*j];
((int16_t*)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1];
}
for (i=0; i<overflow; i++,j++) {
((int16_t*)ue->common_vars.txdata[0])[2*i] = prach[2*j];
((int16_t*)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1];
}
"prach_fmt4 not fully implemented" );
if (!(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) {
int j;
int overflow = prach_start + prach_len - LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*ue->frame_parms.samples_per_tti;
LOG_I( PHY, "prach_start=%d, overflow=%d\n", prach_start, overflow );
for (i=prach_start,j=0; i<min(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,prach_start+prach_len); i++,j++) {
((int16_t *)ue->common_vars.txdata[0])[2*i] = prach[2*j];
((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1];
}
for (i=0; i<overflow; i++,j++) {
((int16_t *)ue->common_vars.txdata[0])[2*i] = prach[2*j];
((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1];
}
#if defined(EXMIMO)
// handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on
for (k=prach_start - (ue->frame_parms.samples_per_tti>>1) ; k<prach_start ; k++) {
if (k<0)
ue->common_vars.txdata[0][k+ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
else if (k>(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
ue->common_vars.txdata[0][k-ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
else
ue->common_vars.txdata[0][k] &= 0xFFFEFFFE;
}
// handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on
for (k=prach_start - (ue->frame_parms.samples_per_tti>>1) ; k<prach_start ; k++) {
if (k<0)
ue->common_vars.txdata[0][k+ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
else if (k>(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
ue->common_vars.txdata[0][k-ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
else
ue->common_vars.txdata[0][k] &= 0xFFFEFFFE;
}
#endif
#else
for (i=0; i<prach_len; i++) {
((int16_t*)(&ue->common_vars.txdata[0][prach_start]))[2*i] = prach[2*i];
((int16_t*)(&ue->common_vars.txdata[0][prach_start]))[2*i+1] = prach[2*i+1];
} else { // simulators
for (i=0; i<prach_len; i++) {
((int16_t *)(&ue->common_vars.txdata[0][prach_start]))[2*i] = prach[2*i];
((int16_t *)(&ue->common_vars.txdata[0][prach_start]))[2*i+1] = prach[2*i+1];
}
}
#endif
#if defined(PRACH_WRITE_OUTPUT_DEBUG)
LOG_M("prach_txF0.m","prachtxF0",prachF,prach_len-Ncp,1,1);
LOG_M("prach_tx0.m","prachtx0",prach+(Ncp<<1),prach_len-Ncp,1,1);
LOG_M("txsig.m","txs",(int16_t*)(&ue->common_vars.txdata[0][0]),2*ue->frame_parms.samples_per_tti,1,1);
LOG_M("txsig.m","txs",(int16_t *)(&ue->common_vars.txdata[0][0]),2*ue->frame_parms.samples_per_tti,1,1);
exit(-1);
#endif
return signal_energy( (int*)prach, 256 );
return signal_energy( (int *)prach, 256 );
}
......@@ -76,9 +76,8 @@ extern double cpuf;
void Msg1_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id);
void Msg3_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id);
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
#endif
extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
void get_dumpparam(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, uint8_t nb_rb,
uint32_t *alloc_even, uint8_t subframe,uint32_t Qm, uint32_t Nl, uint32_t tm,
......@@ -160,47 +159,7 @@ void dump_dlsch_SI(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s
}
}
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
//unsigned int gain_table[31] = {100,112,126,141,158,178,200,224,251,282,316,359,398,447,501,562,631,708,794,891,1000,1122,1258,1412,1585,1778,1995,2239,2512,2818,3162};
/*
unsigned int get_tx_amp_prach(int power_dBm, int power_max_dBm, int N_RB_UL)
{
int gain_dB = power_dBm - power_max_dBm;
int amp_x_100;
switch (N_RB_UL) {
case 6:
amp_x_100 = AMP; // PRACH is 6 PRBS so no scale
break;
case 15:
amp_x_100 = 158*AMP; // 158 = 100*sqrt(15/6)
break;
case 25:
amp_x_100 = 204*AMP; // 204 = 100*sqrt(25/6)
break;
case 50:
amp_x_100 = 286*AMP; // 286 = 100*sqrt(50/6)
break;
case 75:
amp_x_100 = 354*AMP; // 354 = 100*sqrt(75/6)
break;
case 100:
amp_x_100 = 408*AMP; // 408 = 100*sqrt(100/6)
break;
default:
LOG_E(PHY,"Unknown PRB size %d\n",N_RB_UL);
mac_xface->macphy_exit("");
break;
}
if (gain_dB < -30) {
return(amp_x_100/3162);
} else if (gain_dB>0)
return(amp_x_100);
else
return(amp_x_100/gain_table[-gain_dB]); // 245 corresponds to the factor sqrt(25/6)
}
*/
unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb) {
int gain_dB;
......@@ -216,7 +175,6 @@ unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb
return((int)(AMP*sqrt(gain_lin*N_RB_UL/(double)nb_rb)));
}
#endif
void dump_dlsch_ra(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe) {
if (LOG_DUMPFLAG(DEBUG_UE_PHYPROC)) {
......@@ -1130,10 +1088,8 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
int subframe_tx = proc->subframe_tx;
int ulsch_start;
int overflow=0;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
int k,l;
int dummy_tx_buffer[frame_parms->samples_per_tti] __attribute__((aligned(16)));
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_COMMON,VCD_FUNCTION_IN);
if ( LOG_DEBUGFLAG(UE_TIMING)) {
......@@ -1141,23 +1097,21 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
}
nsymb = (frame_parms->Ncp == 0) ? 14 : 12;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)//this is the EXPRESS MIMO case
ulsch_start = (ue->rx_offset+subframe_tx*frame_parms->samples_per_tti-
ue->hw_timing_advance-
ue->timing_advance-
ue->N_TA_offset+5);
//LOG_E(PHY,"ul-signal [subframe: %d, ulsch_start %d]\n",subframe_tx, ulsch_start);
if(ulsch_start < 0)
ulsch_start = ulsch_start + (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti);
if (!(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) {
ulsch_start = (ue->rx_offset+subframe_tx*frame_parms->samples_per_tti-
ue->hw_timing_advance-
ue->timing_advance-
ue->N_TA_offset+5);
if (ulsch_start > (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti))
ulsch_start = ulsch_start % (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti);
if(ulsch_start < 0)
ulsch_start = ulsch_start + (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti);
//LOG_E(PHY,"ul-signal [subframe: %d, ulsch_start %d]\n",subframe_tx, ulsch_start);
#else //this is the normal case
ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-ue->N_TA_offset; //-ue->timing_advance;
#endif //else EXMIMO
if (ulsch_start > (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti))
ulsch_start = ulsch_start % (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti);
} else { //this is the simulators case
ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-ue->N_TA_offset; //-ue->timing_advance;
}
if (empty_subframe) {
overflow = ulsch_start - 9*frame_parms->samples_per_tti;
......@@ -1175,70 +1129,63 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
}
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
if (frame_parms->Ncp == 1)
int *Buff = (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ? &ue->common_vars.txdata[aa][ulsch_start] :dummy_tx_buffer;
if (frame_parms->Ncp == 1) {
PHY_ofdm_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size],
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
dummy_tx_buffer,
#else
&ue->common_vars.txdata[aa][ulsch_start],
#endif
Buff,
frame_parms->ofdm_symbol_size,
nsymb,
frame_parms->nb_prefix_samples,
CYCLIC_PREFIX);
else {
} else {
normal_prefix_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size],
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
dummy_tx_buffer,
#else
&ue->common_vars.txdata[aa][ulsch_start],
#endif
Buff,
nsymb>>1,
&ue->frame_parms);
Buff += (frame_parms->samples_per_tti>>1);
normal_prefix_mod(&ue->common_vars.txdataF[aa][((subframe_tx*nsymb)+(nsymb>>1))*frame_parms->ofdm_symbol_size],
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
dummy_tx_buffer+(frame_parms->samples_per_tti>>1),
#else
&ue->common_vars.txdata[aa][ulsch_start+(frame_parms->samples_per_tti>>1)],
#endif
Buff,
nsymb>>1,
&ue->frame_parms);
}
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
apply_7_5_kHz(ue,dummy_tx_buffer,0);
apply_7_5_kHz(ue,dummy_tx_buffer,1);
#else
apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],0);
apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],1);
#endif
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
overflow = ulsch_start - 9*frame_parms->samples_per_tti;
for (k=ulsch_start,l=0; k<cmin(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti); k++,l++) {
((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l];
((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1];
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],0);
apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],1);
} else {
apply_7_5_kHz(ue,dummy_tx_buffer,0);
apply_7_5_kHz(ue,dummy_tx_buffer,1);
}
for (k=0; k<overflow; k++,l++) {
((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l];
((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1];
}
if (!(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) {
overflow = ulsch_start - 9*frame_parms->samples_per_tti;
for (k=ulsch_start,l=0; k<cmin(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti); k++,l++) {
((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l];
((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1];
}
for (k=0; k<overflow; k++,l++) {
((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l];
((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1];
}
#if defined(EXMIMO)
// handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on
for (k=ulsch_start - (frame_parms->samples_per_tti>>1) ; k<ulsch_start ; k++) {
if (k<0)
ue->common_vars.txdata[aa][k+frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
else if (k>(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
ue->common_vars.txdata[aa][k-frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
else
ue->common_vars.txdata[aa][k] &= 0xFFFEFFFE;
}
// handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on
for (k=ulsch_start - (frame_parms->samples_per_tti>>1) ; k<ulsch_start ; k++) {
if (k<0)
ue->common_vars.txdata[aa][k+frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
else if (k>(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
ue->common_vars.txdata[aa][k-frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
else
ue->common_vars.txdata[aa][k] &= 0xFFFEFFFE;
}
#endif
#endif
}
/*
only for debug
LOG_I(PHY,"ul-signal [subframe: %d, ulsch_start %d, TA: %d, rxOffset: %d, timing_advance: %d, hw_timing_advance: %d]\n",subframe_tx, ulsch_start, ue->N_TA_offset, ue->rx_offset, ue->timing_advance, ue->hw_timing_advance);
......@@ -1310,14 +1257,15 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->prach_resources[eNB_id]->ra_TDD_map_index,
ue->prach_resources[eNB_id]->ra_RNTI);
ue->tx_total_RE[subframe_tx] = 96;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
ue->prach_vars[eNB_id]->amp = get_tx_amp(ue->tx_power_dBm[subframe_tx],
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
6);
#else
ue->prach_vars[eNB_id]->amp = AMP;
#endif
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
ue->prach_vars[eNB_id]->amp = get_tx_amp(ue->tx_power_dBm[subframe_tx],
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
6);
} else {
ue->prach_vars[eNB_id]->amp = AMP;
}
if ((mode == calib_prach_tx) && (((proc->frame_tx&0xfffe)%100)==0))
LOG_D(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : PRACH TX power %d dBm, amp %d\n",
......@@ -1333,12 +1281,12 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_OUT);
// stop_meas(&ue->tx_prach);
LOG_I(PHY,"[UE %d][RAPROC] PRACH PL %d dB, power %d dBm (max %d dBm), digital power %d dB (amp %d)\n",
ue->Mod_id,
get_PL(ue->Mod_id,ue->CC_id,eNB_id),
ue->tx_power_dBm[subframe_tx],
ue->Mod_id,
get_PL(ue->Mod_id,ue->CC_id,eNB_id),
ue->tx_power_dBm[subframe_tx],
ue->tx_power_max_dBm,
dB_fixed(prach_power),
ue->prach_vars[eNB_id]->amp);
dB_fixed(prach_power),
ue->prach_vars[eNB_id]->amp);
if (ue->mac_enabled==1) {
Msg1_transmitted(ue->Mod_id,
......@@ -1680,14 +1628,16 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
}
ue->tx_total_RE[subframe_tx] = nb_rb*12;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx],
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
nb_rb);
#else
tx_amp = AMP;
#endif
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
tx_amp = AMP;
} else {
tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx],
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
nb_rb);
}
T(T_UE_PHY_PUSCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
T_INT(tx_amp),T_INT(ue->ulsch[eNB_id]->f_pusch),T_INT(get_PL(Mod_id,0,eNB_id)),T_INT(nb_rb));
......@@ -1751,20 +1701,19 @@ void ue_srs_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8
Po_SRS = ue->tx_power_max_dBm;
}
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
if (ue->mac_enabled==1) {
tx_amp = get_tx_amp(Po_SRS,
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
nb_rb_srs);
} else {
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
tx_amp = AMP;
} else {
if (ue->mac_enabled==1) {
tx_amp = get_tx_amp(Po_SRS,
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
nb_rb_srs);
} else {
tx_amp = AMP;
}
}
#else
tx_amp = AMP;
#endif
LOG_D(PHY,"SRS PROC; TX_MAX_POWER %d, Po_SRS %d, NB_RB_UL %d, NB_RB_SRS %d TX_AMPL %d\n",ue->tx_power_max_dBm,
Po_SRS,
ue->frame_parms.N_RB_UL,
......@@ -1903,7 +1852,6 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
uint8_t isShortenPucch = (pSoundingrs_ul_config_dedicated->srsCellSubframe && frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission);
bundling_flag = ue->pucch_config_dedicated[eNB_id].tdd_AckNackFeedbackMode;
// Part - I
// Collect feedback that should be transmitted at this subframe
// - SR
......@@ -1990,14 +1938,16 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->tx_power_dBm[subframe_tx] = Po_PUCCH;
ue->tx_total_RE[subframe_tx] = 12;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
tx_amp = get_tx_amp(Po_PUCCH,
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
1);
#else
tx_amp = AMP;
#endif
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
tx_amp = AMP;
} else {
tx_amp = get_tx_amp(Po_PUCCH,
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
1);
}
T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id)));
......@@ -2069,14 +2019,16 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->tx_power_dBm[subframe_tx] = Po_PUCCH;
ue->tx_total_RE[subframe_tx] = 12;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
tx_amp = get_tx_amp(Po_PUCCH,
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
1);
#else
tx_amp = AMP;
#endif
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
tx_amp = AMP;
} else {
tx_amp = get_tx_amp(Po_PUCCH,
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
1);
}
T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id)));
......@@ -2171,7 +2123,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
}
if (subframe_select(&ue->frame_parms,proc->subframe_tx) == SF_UL ||
ue->frame_parms.frame_type == FDD) {
ue->frame_parms.frame_type == FDD) {
if (ue->UE_mode[eNB_id] > PRACH ) {
// check cell srs subframe and ue srs subframe. This has an impact on pusch encoding
isSubframeSRS = is_srs_occasion_common(&ue->frame_parms,proc->frame_tx,proc->subframe_tx);
......@@ -2313,13 +2265,10 @@ void ue_measurement_procedures(
if (( (slot%2) == 0) && (l==(4-frame_parms->Ncp))) {
// AGC
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_IN);
#ifndef OAI_USRP
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
phy_adjust_gain (ue,dB_fixed(ue->measurements.rssi),0);
#endif
#endif
#endif
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM )
phy_adjust_gain (ue,dB_fixed(ue->measurements.rssi),0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_OUT);
eNB_id = 0;
......@@ -2752,6 +2701,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb),
T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb),
T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS));
if (LOG_DEBUGFLAG(DEBUG_UE_PHYPROC)) {
LOG_USEDINLOG_VAR(int8_t,harq_pid) = subframe2harq_pid(&ue->frame_parms,
pdcch_alloc2ul_frame(&ue->frame_parms,proc->frame_rx,proc->subframe_rx),
......@@ -4205,72 +4155,72 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr
}
if (LOG_DEBUGFLAG(UE_TIMING)) {
stop_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]]);
LOG_I(PHY, "[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
}
stop_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]]);
LOG_I(PHY, "[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
}
// duplicate harq structure
uint8_t current_harq_pid = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid;
LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_processes[current_harq_pid];
harq_status_t *current_harq_ack = &ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_ack[subframe_rx];
// For Debug parallelisation
//if (current_harq_ack->ack == 0) {
//printf("[slot0 dl processing][End of Channel Decoding] AbsSubframe %d.%d Decode Fail for HarqId%d Round%d\n",frame_rx,subframe_rx,current_harq_pid,current_harq_processes->round);
//}
for(uint8_t rx_th_idx=1; rx_th_idx<RX_NB_TH; rx_th_idx++) {
LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[ue->current_thread_id[(subframe_rx+rx_th_idx)%10]][eNB_id][0]->harq_processes[current_harq_pid];
harq_status_t *harq_ack_dest = &ue->dlsch[ue->current_thread_id[(subframe_rx+rx_th_idx)%10]][eNB_id][0]->harq_ack[subframe_rx];
copy_harq_proc_struct(harq_processes_dest, current_harq_processes);
copy_ack_struct(harq_ack_dest, current_harq_ack);
}
/*
LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid];
LTE_DL_UE_HARQ_t *harq_processes_dest1 = ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid];
harq_status_t *current_harq_ack = &ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx];
harq_status_t *harq_ack_dest = &ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx];
harq_status_t *harq_ack_dest1 = &ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx];
// duplicate harq structure
uint8_t current_harq_pid = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid;
LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_processes[current_harq_pid];
harq_status_t *current_harq_ack = &ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_ack[subframe_rx];
// For Debug parallelisation
//if (current_harq_ack->ack == 0) {
//printf("[slot0 dl processing][End of Channel Decoding] AbsSubframe %d.%d Decode Fail for HarqId%d Round%d\n",frame_rx,subframe_rx,current_harq_pid,current_harq_processes->round);
//}
for(uint8_t rx_th_idx=1; rx_th_idx<RX_NB_TH; rx_th_idx++) {
LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[ue->current_thread_id[(subframe_rx+rx_th_idx)%10]][eNB_id][0]->harq_processes[current_harq_pid];
harq_status_t *harq_ack_dest = &ue->dlsch[ue->current_thread_id[(subframe_rx+rx_th_idx)%10]][eNB_id][0]->harq_ack[subframe_rx];
copy_harq_proc_struct(harq_processes_dest, current_harq_processes);
copy_ack_struct(harq_ack_dest, current_harq_ack);
}
/*
LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid];
LTE_DL_UE_HARQ_t *harq_processes_dest1 = ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid];
harq_status_t *current_harq_ack = &ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx];
harq_status_t *harq_ack_dest = &ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx];
harq_status_t *harq_ack_dest1 = &ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx];
copy_harq_proc_struct(harq_processes_dest, current_harq_processes);
copy_ack_struct(harq_ack_dest, current_harq_ack);
copy_harq_proc_struct(harq_processes_dest1, current_harq_processes);
copy_ack_struct(harq_ack_dest1, current_harq_ack);
*/
if (subframe_rx==9) {
if (frame_rx % 10 == 0) {
if ((ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]) != 0)
ue->dlsch_fer[eNB_id] = (100*(ue->dlsch_errors[eNB_id] - ue->dlsch_errors_last[eNB_id]))/(ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]);
ue->dlsch_errors_last[eNB_id] = ue->dlsch_errors[eNB_id];
ue->dlsch_received_last[eNB_id] = ue->dlsch_received[eNB_id];
}
copy_harq_proc_struct(harq_processes_dest1, current_harq_processes);
copy_ack_struct(harq_ack_dest1, current_harq_ack);
*/
if (subframe_rx==9) {
if (frame_rx % 10 == 0) {
if ((ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]) != 0)
ue->dlsch_fer[eNB_id] = (100*(ue->dlsch_errors[eNB_id] - ue->dlsch_errors_last[eNB_id]))/(ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]);
ue->bitrate[eNB_id] = (ue->total_TBS[eNB_id] - ue->total_TBS_last[eNB_id])*100;
ue->total_TBS_last[eNB_id] = ue->total_TBS[eNB_id];
LOG_D(PHY,"[UE %d] Calculating bitrate Frame %d: total_TBS = %d, total_TBS_last = %d, bitrate %f kbits\n",
ue->Mod_id,frame_rx,ue->total_TBS[eNB_id],
ue->total_TBS_last[eNB_id],(float) ue->bitrate[eNB_id]/1000.0);
ue->dlsch_errors_last[eNB_id] = ue->dlsch_errors[eNB_id];
ue->dlsch_received_last[eNB_id] = ue->dlsch_received[eNB_id];
}
ue->bitrate[eNB_id] = (ue->total_TBS[eNB_id] - ue->total_TBS_last[eNB_id])*100;
ue->total_TBS_last[eNB_id] = ue->total_TBS[eNB_id];
LOG_D(PHY,"[UE %d] Calculating bitrate Frame %d: total_TBS = %d, total_TBS_last = %d, bitrate %f kbits\n",
ue->Mod_id,frame_rx,ue->total_TBS[eNB_id],
ue->total_TBS_last[eNB_id],(float) ue->bitrate[eNB_id]/1000.0);
#if UE_AUTOTEST_TRACE
if ((frame_rx % 100 == 0)) {
LOG_I(PHY,"[UE %d] AUTOTEST Metric : UE_DLSCH_BITRATE = %5.2f kbps (frame = %d) \n", ue->Mod_id, (float) ue->bitrate[eNB_id]/1000.0, frame_rx);
}
if ((frame_rx % 100 == 0)) {
LOG_I(PHY,"[UE %d] AUTOTEST Metric : UE_DLSCH_BITRATE = %5.2f kbps (frame = %d) \n", ue->Mod_id, (float) ue->bitrate[eNB_id]/1000.0, frame_rx);
}
#endif
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT);
if (LOG_DEBUGFLAG(UE_TIMING)) {
stop_meas(&ue->phy_proc_rx[ue->current_thread_id[subframe_rx]]);
LOG_I(PHY, "------FULL RX PROC [AbsSFN %d.%d]: %5.2f ------\n",frame_rx,subframe_rx,ue->phy_proc_rx[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
}
if (LOG_DEBUGFLAG(UE_TIMING)) {
stop_meas(&ue->phy_proc_rx[ue->current_thread_id[subframe_rx]]);
LOG_I(PHY, "------FULL RX PROC [AbsSFN %d.%d]: %5.2f ------\n",frame_rx,subframe_rx,ue->phy_proc_rx[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
}
LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx);
return (0);
LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx);
return (0);
}
#endif /*UE_SLOT_PARALLELISATION */
......
......@@ -1741,7 +1741,7 @@ void *UE_thread(void *arg) {
}
}
//usleep(3000);
// usleep(3000);
if(sub_frame == 0) {
//UE->proc.proc_rxtx[0].frame_rx++;
//UE->proc.proc_rxtx[1].frame_rx++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment