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 @@ ...@@ -31,25 +31,23 @@
*/ */
#include "PHY/LTE_TRANSPORT/proto.h" #include "PHY/LTE_TRANSPORT/proto.h"
#include "targets/RT/USER/lte-softmodem.h"
#include "PHY/defs.h" #include "PHY/defs.h"
#include "PHY/extern.h" #include "PHY/extern.h"
#include "SCHED/extern.h" #include "SCHED/extern.h"
#ifdef OPENAIR2 #ifdef OPENAIR2
#include "openair2/LAYER2/MAC/proto.h" #include "openair2/LAYER2/MAC/proto.h"
#include "openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #include "openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#endif #endif
extern int mac_get_rrc_status(uint8_t Mod_id,uint8_t eNB_flag,uint8_t index); 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" #include "common_lib.h"
extern openair0_config_t openair0_cfg[]; 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; uint8_t eNB=0;
uint32_t RRC_status; uint32_t RRC_status;
int len=length; int len=length;
...@@ -66,7 +64,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -66,7 +64,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
10*log10(ue->measurements.rsrq[0]), 10*log10(ue->measurements.rsrq[0]),
ue->measurements.n0_power_tot_dBm, ue->measurements.n0_power_tot_dBm,
(double)ue->measurements.n0_power_tot_dBm+132.24); (double)ue->measurements.n0_power_tot_dBm+132.24);
/* /*
len += sprintf(&buffer[len], 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", "[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,18 +83,14 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -86,18 +83,14 @@ 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[0],
ue->measurements.n0_power_dB[1]); ue->measurements.n0_power_dB[1]);
*/ */
#ifdef EXMIMO #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]); 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 #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); 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); 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] 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); len += sprintf(&buffer[len], "[UE PROC] timing_advance = %d\n",ue->timing_advance);
if (ue->UE_mode[0]==PUSCH) { 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", 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, ue->ulsch[0]->Po_PUSCH,
...@@ -111,6 +104,7 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -111,6 +104,7 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
ue->dlsch[0][0][0]->g_pucch); ue->dlsch[0][0][0]->g_pucch);
} }
//for (eNB=0;eNB<NUMBER_OF_eNB_MAX;eNB++) { //for (eNB=0;eNB<NUMBER_OF_eNB_MAX;eNB++) {
for (eNB=0; eNB<1; eNB++) { for (eNB=0; eNB<1; eNB++) {
len += sprintf(&buffer[len], "[UE PROC] RX spatial power eNB%d: [%d %d; %d %d] dB\n", 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 ...@@ -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][0][1],
ue->measurements.rx_spatial_power_dB[eNB][1][0], ue->measurements.rx_spatial_power_dB[eNB][1][0],
ue->measurements.rx_spatial_power_dB[eNB][1][1]); 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 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], 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); ue->measurements.rx_power_avg[eNB], ue->measurements.n0_power_tot, ue->measurements.n0_power_avg);
...@@ -136,8 +129,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -136,8 +129,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.subband_cqi_dB[eNB][0][3], ue->measurements.subband_cqi_dB[eNB][0][3],
ue->measurements.subband_cqi_dB[eNB][0][4], ue->measurements.subband_cqi_dB[eNB][0][4],
ue->measurements.subband_cqi_dB[eNB][0][5]); 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", len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d] dB\n",
eNB, eNB,
ue->measurements.subband_cqi_dB[eNB][1][0], ue->measurements.subband_cqi_dB[eNB][1][0],
...@@ -146,8 +137,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -146,8 +137,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.subband_cqi_dB[eNB][1][3], ue->measurements.subband_cqi_dB[eNB][1][3],
ue->measurements.subband_cqi_dB[eNB][1][4], ue->measurements.subband_cqi_dB[eNB][1][4],
ue->measurements.subband_cqi_dB[eNB][1][5]); 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", 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, eNB,
ue->measurements.subband_pmi_re[eNB][0][0], ue->measurements.subband_pmi_re[eNB][0][0],
...@@ -162,7 +151,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -162,7 +151,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.subband_pmi_im[eNB][4][0], ue->measurements.subband_pmi_im[eNB][4][0],
ue->measurements.subband_pmi_re[eNB][5][0], ue->measurements.subband_pmi_re[eNB][5][0],
ue->measurements.subband_pmi_im[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", 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, eNB,
ue->measurements.subband_pmi_re[eNB][0][1], ue->measurements.subband_pmi_re[eNB][0][1],
...@@ -177,7 +165,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -177,7 +165,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.subband_pmi_im[eNB][4][1], ue->measurements.subband_pmi_im[eNB][4][1],
ue->measurements.subband_pmi_re[eNB][5][1], ue->measurements.subband_pmi_re[eNB][5][1],
ue->measurements.subband_pmi_im[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", len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d]\n",
eNB, eNB,
ue->measurements.selected_rx_antennas[eNB][0], ue->measurements.selected_rx_antennas[eNB][0],
...@@ -186,7 +173,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -186,7 +173,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.selected_rx_antennas[eNB][3], ue->measurements.selected_rx_antennas[eNB][3],
ue->measurements.selected_rx_antennas[eNB][4], ue->measurements.selected_rx_antennas[eNB][4],
ue->measurements.selected_rx_antennas[eNB][5]); 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 (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, 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,0,6)),
...@@ -203,7 +189,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -203,7 +189,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.subband_cqi_dB[eNB][0][4], ue->measurements.subband_cqi_dB[eNB][0][4],
ue->measurements.subband_cqi_dB[eNB][0][5], ue->measurements.subband_cqi_dB[eNB][0][5],
ue->measurements.subband_cqi_dB[eNB][0][6]); 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", len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d] dB\n",
eNB, eNB,
ue->measurements.subband_cqi_dB[eNB][1][0], ue->measurements.subband_cqi_dB[eNB][1][0],
...@@ -213,8 +198,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -213,8 +198,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.subband_cqi_dB[eNB][1][4], ue->measurements.subband_cqi_dB[eNB][1][4],
ue->measurements.subband_cqi_dB[eNB][1][5], ue->measurements.subband_cqi_dB[eNB][1][5],
ue->measurements.subband_cqi_dB[eNB][1][6]); 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", 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, eNB,
ue->measurements.subband_pmi_re[eNB][0][0], ue->measurements.subband_pmi_re[eNB][0][0],
...@@ -231,7 +214,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -231,7 +214,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.subband_pmi_im[eNB][5][0], ue->measurements.subband_pmi_im[eNB][5][0],
ue->measurements.subband_pmi_re[eNB][6][0], ue->measurements.subband_pmi_re[eNB][6][0],
ue->measurements.subband_pmi_im[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", 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, eNB,
ue->measurements.subband_pmi_re[eNB][0][1], ue->measurements.subband_pmi_re[eNB][0][1],
...@@ -248,7 +230,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -248,7 +230,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.subband_pmi_im[eNB][5][1], ue->measurements.subband_pmi_im[eNB][5][1],
ue->measurements.subband_pmi_re[eNB][6][1], ue->measurements.subband_pmi_re[eNB][6][1],
ue->measurements.subband_pmi_im[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", len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d]\n",
eNB, eNB,
ue->measurements.selected_rx_antennas[eNB][0], ue->measurements.selected_rx_antennas[eNB][0],
...@@ -258,7 +239,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -258,7 +239,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.selected_rx_antennas[eNB][4], ue->measurements.selected_rx_antennas[eNB][4],
ue->measurements.selected_rx_antennas[eNB][5], ue->measurements.selected_rx_antennas[eNB][5],
ue->measurements.selected_rx_antennas[eNB][6]); 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 (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, 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,0,7)),
...@@ -277,7 +257,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -277,7 +257,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.subband_cqi_dB[eNB][0][6], ue->measurements.subband_cqi_dB[eNB][0][6],
ue->measurements.subband_cqi_dB[eNB][0][7], ue->measurements.subband_cqi_dB[eNB][0][7],
ue->measurements.subband_cqi_dB[eNB][0][8]); 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", len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d] dB\n",
eNB, eNB,
ue->measurements.subband_cqi_dB[eNB][1][0], ue->measurements.subband_cqi_dB[eNB][1][0],
...@@ -289,8 +268,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -289,8 +268,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.subband_cqi_dB[eNB][1][6], ue->measurements.subband_cqi_dB[eNB][1][6],
ue->measurements.subband_cqi_dB[eNB][1][7], ue->measurements.subband_cqi_dB[eNB][1][7],
ue->measurements.subband_cqi_dB[eNB][1][8]); 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", 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, eNB,
ue->measurements.subband_pmi_re[eNB][0][0], ue->measurements.subband_pmi_re[eNB][0][0],
...@@ -311,7 +288,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -311,7 +288,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.subband_pmi_im[eNB][7][0], ue->measurements.subband_pmi_im[eNB][7][0],
ue->measurements.subband_pmi_re[eNB][8][0], ue->measurements.subband_pmi_re[eNB][8][0],
ue->measurements.subband_pmi_im[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", 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, eNB,
ue->measurements.subband_pmi_re[eNB][0][1], ue->measurements.subband_pmi_re[eNB][0][1],
...@@ -332,7 +308,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -332,7 +308,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.subband_pmi_im[eNB][7][1], ue->measurements.subband_pmi_im[eNB][7][1],
ue->measurements.subband_pmi_re[eNB][8][1], ue->measurements.subband_pmi_re[eNB][8][1],
ue->measurements.subband_pmi_im[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", len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d]\n",
eNB, eNB,
ue->measurements.selected_rx_antennas[eNB][0], ue->measurements.selected_rx_antennas[eNB][0],
...@@ -344,7 +319,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -344,7 +319,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.selected_rx_antennas[eNB][6], ue->measurements.selected_rx_antennas[eNB][6],
ue->measurements.selected_rx_antennas[eNB][7], ue->measurements.selected_rx_antennas[eNB][7],
ue->measurements.selected_rx_antennas[eNB][8]); 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 (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, 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,0,9)),
...@@ -367,7 +341,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -367,7 +341,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.subband_cqi_dB[eNB][0][10], ue->measurements.subband_cqi_dB[eNB][0][10],
ue->measurements.subband_cqi_dB[eNB][0][11], ue->measurements.subband_cqi_dB[eNB][0][11],
ue->measurements.subband_cqi_dB[eNB][0][12]); 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", 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, eNB,
ue->measurements.subband_cqi_dB[eNB][1][0], ue->measurements.subband_cqi_dB[eNB][1][0],
...@@ -383,8 +356,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -383,8 +356,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.subband_cqi_dB[eNB][1][10], ue->measurements.subband_cqi_dB[eNB][1][10],
ue->measurements.subband_cqi_dB[eNB][1][11], ue->measurements.subband_cqi_dB[eNB][1][11],
ue->measurements.subband_cqi_dB[eNB][1][12]); 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", 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, eNB,
ue->measurements.subband_pmi_re[eNB][0][0], ue->measurements.subband_pmi_re[eNB][0][0],
...@@ -413,7 +384,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -413,7 +384,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.subband_pmi_im[eNB][11][0], ue->measurements.subband_pmi_im[eNB][11][0],
ue->measurements.subband_pmi_re[eNB][12][0], ue->measurements.subband_pmi_re[eNB][12][0],
ue->measurements.subband_pmi_im[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", 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, eNB,
ue->measurements.subband_pmi_re[eNB][0][1], ue->measurements.subband_pmi_re[eNB][0][1],
...@@ -442,7 +412,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -442,7 +412,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.subband_pmi_im[eNB][11][1], ue->measurements.subband_pmi_im[eNB][11][1],
ue->measurements.subband_pmi_re[eNB][12][1], ue->measurements.subband_pmi_re[eNB][12][1],
ue->measurements.subband_pmi_im[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", 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, eNB,
ue->measurements.selected_rx_antennas[eNB][0], ue->measurements.selected_rx_antennas[eNB][0],
...@@ -458,7 +427,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -458,7 +427,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
ue->measurements.selected_rx_antennas[eNB][10], ue->measurements.selected_rx_antennas[eNB][10],
ue->measurements.selected_rx_antennas[eNB][11], ue->measurements.selected_rx_antennas[eNB][11],
ue->measurements.selected_rx_antennas[eNB][12]); 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 (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, 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,0,13)),
...@@ -470,8 +438,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -470,8 +438,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
RRC_status = mac_UE_get_rrc_status(ue->Mod_id, 0); RRC_status = mac_UE_get_rrc_status(ue->Mod_id, 0);
len += sprintf(&buffer[len],"[UE PROC] RRC status = %d\n",RRC_status); len += sprintf(&buffer[len],"[UE PROC] RRC status = %d\n",RRC_status);
#endif #endif
len += sprintf(&buffer[len], "[UE PROC] Transmission Mode %d \n",ue->transmission_mode[eNB]); 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", 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, ue->pbch_vars[eNB]->pdu_errors_conseq,
...@@ -481,25 +447,29 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -481,25 +447,29 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
if (ue->transmission_mode[eNB] == 6) 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]); 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++) { 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); 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++)
for (round=0; round<8; round++)
len+=sprintf(&buffer[len],"%d/%d ", 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]->errors[round],
ue->dlsch[0][0][0]->harq_processes[harq_pid]->trials[round]); ue->dlsch[0][0][0]->harq_processes[harq_pid]->trials[round]);
len+=sprintf(&buffer[len],"\n"); len+=sprintf(&buffer[len],"\n");
} }
if (ue->dlsch[0][0] && ue->dlsch[0][0][0] && ue->dlsch[0][0][1]) { 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] 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); 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++) { 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); 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++)
for (round=0; round<8; round++)
len+=sprintf(&buffer[len],"%d/%d ", 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]->errors[round],
ue->dlsch[0][0][1]->harq_processes[harq_pid]->trials[round]); ue->dlsch[0][0][1]->harq_processes[harq_pid]->trials[round]);
len+=sprintf(&buffer[len],"\n"); len+=sprintf(&buffer[len],"\n");
} }
} }
...@@ -522,9 +492,7 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -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] 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] 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); len += sprintf(&buffer[len], "[UE PROC] IA receiver %d\n",ue->use_ia_receiver);
} }
} else { } 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", 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, proc->frame_rx,
...@@ -546,7 +514,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ...@@ -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"); len += sprintf(&buffer[len],"EOF\n");
return len; return len;
} // is_clusterhead } // is_clusterhead
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
*/ */
#include "PHY/types.h" #include "PHY/types.h"
#include "PHY/defs_UE.h" #include "PHY/defs_UE.h"
#include "targets/RT/USER/lte-softmodem.h"
#include "PHY/phy_extern_ue.h" #include "PHY/phy_extern_ue.h"
#include "SCHED_UE/sched_UE.h" #include "SCHED_UE/sched_UE.h"
#include "transport_proto_ue.h" #include "transport_proto_ue.h"
...@@ -49,10 +50,8 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -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; uint8_t l,pbch_decoded,frame_mod4,pbch_tx_ant,dummy;
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
char phich_resource[6]; char phich_resource[6];
#ifdef DEBUG_INITIAL_SYNCH LOG_D(PHY,"[UE%d] Initial sync: starting PBCH detection (rx_offset %d)\n",ue->Mod_id,
LOG_I(PHY,"[UE%d] Initial sync: starting PBCH detection (rx_offset %d)\n",ue->Mod_id,
ue->rx_offset); ue->rx_offset);
#endif
for (l=0; l<frame_parms->symbols_per_tti/2; l++) { for (l=0; l<frame_parms->symbols_per_tti/2; l++) {
slot_fep(ue, slot_fep(ue,
...@@ -95,8 +94,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -95,8 +94,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
0); 0);
} }
#ifdef DEBUG_INITIAL_SYNCH 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",
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",
ue->Mod_id, ue->Mod_id,
ue->measurements.rx_rssi_dBm[0] - ((ue->frame_parms.nb_antennas_rx==2) ? 3 : 0), ue->measurements.rx_rssi_dBm[0] - ((ue->frame_parms.nb_antennas_rx==2) ? 3 : 0),
ue->measurements.rx_power_dB[0][0], ue->measurements.rx_power_dB[0][0],
...@@ -106,7 +104,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -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_dB[0],
ue->measurements.rx_power_avg[0], ue->measurements.rx_power_avg[0],
ue->rx_total_gain_dB); 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->Mod_id,
ue->measurements.n0_power_tot_dBm, ue->measurements.n0_power_tot_dBm,
ue->measurements.n0_power_dB[0], ue->measurements.n0_power_dB[0],
...@@ -115,7 +113,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -115,7 +113,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
ue->measurements.n0_power[1], ue->measurements.n0_power[1],
ue->measurements.n0_power_avg_dB, ue->measurements.n0_power_avg_dB,
ue->measurements.n0_power_avg); ue->measurements.n0_power_avg);
#endif
pbch_decoded = 0; pbch_decoded = 0;
for (frame_mod4=0; frame_mod4<4; frame_mod4++) { for (frame_mod4=0; frame_mod4<4; frame_mod4++) {
...@@ -225,8 +222,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -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; ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx;
} }
#ifdef DEBUG_INITIAL_SYNCH 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",
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",
ue->Mod_id, ue->Mod_id,
frame_parms->nb_antenna_ports_eNB, frame_parms->nb_antenna_ports_eNB,
pbch_tx_ant, pbch_tx_ant,
...@@ -234,7 +230,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -234,7 +230,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
frame_parms->N_RB_DL, frame_parms->N_RB_DL,
frame_parms->phich_config_common.phich_duration, frame_parms->phich_config_common.phich_duration,
phich_resource); //frame_parms->phich_config_common.phich_resource); phich_resource); //frame_parms->phich_config_common.phich_resource);
#endif
return(0); return(0);
} else { } else {
return(-1); return(-1);
...@@ -254,10 +249,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -254,10 +249,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
int ret=-1; int ret=-1;
int aarx,rx_power=0; int aarx,rx_power=0;
/*#ifdef OAI_USRP
__m128i *rxdata128;
#endif*/
// LOG_I(PHY,"**************************************************************\n");
// First try FDD normal prefix // First try FDD normal prefix
frame_parms->Ncp=NORMAL; frame_parms->Ncp=NORMAL;
frame_parms->frame_type=FDD; frame_parms->frame_type=FDD;
...@@ -277,9 +268,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -277,9 +268,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
else else
sync_pos2 = sync_pos + FRAME_LENGTH_COMPLEX_SAMPLES - frame_parms->nb_prefix_samples; sync_pos2 = sync_pos + FRAME_LENGTH_COMPLEX_SAMPLES - frame_parms->nb_prefix_samples;
#ifdef DEBUG_INITIAL_SYNCH 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 : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id);
#endif
// SSS detection // SSS detection
// PSS is hypothesized in last symbol of first slot in Frame // 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; 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) { ...@@ -291,9 +280,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
if (((sync_pos2 - sync_pos_slot) >=0 ) && if (((sync_pos2 - sync_pos_slot) >=0 ) &&
((sync_pos2 - sync_pos_slot) < ((FRAME_LENGTH_COMPLEX_SAMPLES-frame_parms->samples_per_tti/2)))) { ((sync_pos2 - sync_pos_slot) < ((FRAME_LENGTH_COMPLEX_SAMPLES-frame_parms->samples_per_tti/2)))) {
#ifdef DEBUG_INITIAL_SYNCH LOG_D(PHY,"Calling sss detection (FDD normal CP)\n");
LOG_I(PHY,"Calling sss detection (FDD normal CP)\n");
#endif
rx_sss(ue,&metric_fdd_ncp,&flip_fdd_ncp,&phase_fdd_ncp); rx_sss(ue,&metric_fdd_ncp,&flip_fdd_ncp,&phase_fdd_ncp);
frame_parms->nushift = frame_parms->Nid_cell%6; frame_parms->nushift = frame_parms->Nid_cell%6;
...@@ -304,14 +291,10 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -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); lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell);
ret = pbch_detection(ue,mode); ret = pbch_detection(ue,mode);
// LOG_M("rxdata2.m","rxd2",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); // LOG_M("rxdata2.m","rxd2",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
#ifdef DEBUG_INITIAL_SYNCH LOG_D(PHY,"FDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
LOG_I(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); frame_parms->Nid_cell,metric_fdd_ncp,phase_fdd_ncp,flip_fdd_ncp,ret);
#endif
} else { } else {
#ifdef DEBUG_INITIAL_SYNCH LOG_D(PHY,"FDD Normal prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot);
LOG_I(PHY,"FDD Normal prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot);
#endif
} }
if (ret==-1) { if (ret==-1) {
...@@ -347,14 +330,10 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -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); lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell);
ret = pbch_detection(ue,mode); ret = pbch_detection(ue,mode);
// LOG_M("rxdata3.m","rxd3",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); // LOG_M("rxdata3.m","rxd3",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
#ifdef DEBUG_INITIAL_SYNCH LOG_D(PHY,"FDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
LOG_I(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); frame_parms->Nid_cell,metric_fdd_ecp,phase_fdd_ecp,flip_fdd_ecp,ret);
#endif
} else { } else {
#ifdef DEBUG_INITIAL_SYNCH LOG_D(PHY,"FDD Extended prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot);
LOG_I(PHY,"FDD Extended prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot);
#endif
} }
if (ret==-1) { if (ret==-1) {
...@@ -390,10 +369,8 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -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); lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell);
ret = pbch_detection(ue,mode); ret = pbch_detection(ue,mode);
// LOG_M("rxdata4.m","rxd4",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); // LOG_M("rxdata4.m","rxd4",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
#ifdef DEBUG_INITIAL_SYNCH LOG_D(PHY,"TDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
LOG_I(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); frame_parms->Nid_cell,metric_tdd_ncp,phase_tdd_ncp,flip_tdd_ncp,ret);
#endif
if (ret==-1) { if (ret==-1) {
// Now TDD extended prefix // Now TDD extended prefix
...@@ -426,10 +403,8 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -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); lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell);
ret = pbch_detection(ue,mode); ret = pbch_detection(ue,mode);
// LOG_M("rxdata5.m","rxd5",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); // LOG_M("rxdata5.m","rxd5",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
#ifdef DEBUG_INITIAL_SYNCH LOG_D(PHY,"TDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
LOG_I(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); 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) { ...@@ -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, openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset,
ue->common_vars.freq_offset); ue->common_vars.freq_offset);
} else { } else {
#ifdef DEBUG_INITIAL_SYNC LOG_D(PHY,"[UE%d] Initial sync : PBCH not ok\n",ue->Mod_id);
LOG_I(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 : 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", /* 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, ue->Mod_id,
metric_fdd_ncp,Nid_cell_fdd_ncp, metric_fdd_ncp,Nid_cell_fdd_ncp,
metric_fdd_ecp,Nid_cell_fdd_ecp, metric_fdd_ecp,Nid_cell_fdd_ecp,
metric_tdd_ncp,Nid_cell_tdd_ncp, metric_tdd_ncp,Nid_cell_tdd_ncp,
metric_tdd_ecp,Nid_cell_tdd_ecp);*/ 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); frame_parms->Nid_cell,frame_parms->frame_type);
#endif
ue->UE_mode[0] = NOT_SYNCHED; 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_last=ue->pbch_vars[0]->pdu_errors;
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) { ...@@ -517,27 +490,15 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
// we might add a low-pass filter here later // 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[0] = rx_power/frame_parms->nb_antennas_rx;
ue->measurements.rx_power_avg_dB[0] = dB_fixed(ue->measurements.rx_power_avg[0]); 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] ); 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 if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM )
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0); phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0);
#endif
#endif
#endif
} else { } else {
#ifndef OAI_USRP if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM )
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0);
#endif
#endif
#endif
} }
// exit_fun("debug exit");
return ret; return ret;
} }
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
*/ */
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
#include "PHY/defs_UE.h" #include "PHY/defs_UE.h"
#include "targets/RT/USER/lte-softmodem.h"
#include "PHY/phy_extern_ue.h" #include "PHY/phy_extern_ue.h"
//#include "prach.h" //#include "prach.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h" #include "PHY/LTE_TRANSPORT/if4_tools.h"
...@@ -43,9 +44,7 @@ ...@@ -43,9 +44,7 @@
//#define PRACH_DEBUG 1 //#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; lte_frame_type_t frame_type = ue->frame_parms.frame_type;
//uint8_t tdd_config = ue->frame_parms.tdd_config; //uint8_t tdd_config = ue->frame_parms.tdd_config;
uint16_t rootSequenceIndex = ue->frame_parms.prach_config_common.rootSequenceIndex; 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 ...@@ -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_offset,preamble_shift;
uint16_t preamble_index0,n_shift_ra,n_shift_ra_bar; uint16_t preamble_index0,n_shift_ra,n_shift_ra_bar;
uint16_t d_start,numshift; uint16_t d_start,numshift;
uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type); uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type);
//uint8_t Nsp=2; //uint8_t Nsp=2;
//uint8_t f_ra,t1_ra; //uint8_t f_ra,t1_ra;
...@@ -82,7 +80,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -82,7 +80,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
int i, prach_len; int i, prach_len;
uint16_t first_nonzero_root_idx=0; uint16_t first_nonzero_root_idx=0;
#if defined(EXMIMO) || defined(OAI_USRP) 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); prach_start = (ue->rx_offset+subframe*ue->frame_parms.samples_per_tti-ue->hw_timing_advance-ue->N_TA_offset);
#ifdef PRACH_DEBUG #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, LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id,
...@@ -97,17 +95,14 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -97,17 +95,14 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
if (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); prach_start-=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
} else { //normal case (simulation)
#else //normal case (simulation)
prach_start = subframe*ue->frame_parms.samples_per_tti-ue->N_TA_offset; 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, 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, prach_start,
ue->rx_offset, ue->rx_offset,
ue->hw_timing_advance, ue->hw_timing_advance,
ue->N_TA_offset); ue->N_TA_offset);
}
#endif
// First compute physical root sequence // First compute physical root sequence
if (restricted_set == 0) { if (restricted_set == 0) {
...@@ -125,7 +120,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -125,7 +120,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset, ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset,
tdd_mapindex, Nf); tdd_mapindex, Nf);
prach_root_sequence_map = (prach_fmt<4) ? prach_root_sequence_map0_3 : prach_root_sequence_map4; 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 // this code is not part of get_prach_prb_offset
if (frame_type == TDD) { // TDD 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 ...@@ -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 // 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))); 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 ...@@ -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==0)? 0 : (preamble_index % (N_ZC/NCS));
preamble_shift *= NCS; preamble_shift *= NCS;
} else { // This is the high-speed case } else { // This is the high-speed case
#ifdef PRACH_DEBUG #ifdef PRACH_DEBUG
LOG_I(PHY,"[UE %d] High-speed mode, NCS_config %d\n",ue->Mod_id,Ncs_config); LOG_I(PHY,"[UE %d] High-speed mode, NCS_config %d\n",ue->Mod_id,Ncs_config);
#endif #endif
not_found = 1; not_found = 1;
preamble_index0 = preamble_index; preamble_index0 = preamble_index;
// set preamble_offset to initial rootSequenceIndex and look if we need more root sequences for this // 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 ...@@ -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]; u = prach_root_sequence_map[index];
uint16_t n_group_ra = 0; uint16_t n_group_ra = 0;
if ( (du[u]<(N_ZC/3)) && (du[u]>=NCS) ) { 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 ...@@ -217,7 +207,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
if (preamble_index0 < numshift) { if (preamble_index0 < numshift) {
not_found = 0; not_found = 0;
preamble_shift = (d_start * (preamble_index0/n_shift_ra)) + ((preamble_index0%n_shift_ra)*NCS); preamble_shift = (d_start * (preamble_index0/n_shift_ra)) + ((preamble_index0%n_shift_ra)*NCS);
} else { // skip to next rootSequenceIndex and recompute parameters } else { // skip to next rootSequenceIndex and recompute parameters
preamble_offset++; preamble_offset++;
preamble_index0 -= numshift; preamble_index0 -= numshift;
...@@ -234,10 +223,8 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -234,10 +223,8 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
preamble_offset,preamble_shift); preamble_offset,preamble_shift);
#endif #endif
// nsymb = (frame_parms->Ncp==0) ? 14:12; // nsymb = (frame_parms->Ncp==0) ? 14:12;
// subframe_offset = (unsigned int)frame_parms->ofdm_symbol_size*subframe*nsymb; // subframe_offset = (unsigned int)frame_parms->ofdm_symbol_size*subframe*nsymb;
k = (12*n_ra_prb) - 6*ue->frame_parms.N_RB_UL; k = (12*n_ra_prb) - 6*ue->frame_parms.N_RB_UL;
if (k<0) if (k<0)
...@@ -245,9 +232,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -245,9 +232,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
k*=12; k*=12;
k+=13; 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); k+=(12*ue->frame_parms.first_carrier_offset);
if (k>(12*ue->frame_parms.ofdm_symbol_size)) if (k>(12*ue->frame_parms.ofdm_symbol_size))
...@@ -257,35 +242,35 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -257,35 +242,35 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
switch (ue->frame_parms.N_RB_UL) { switch (ue->frame_parms.N_RB_UL) {
case 6: case 6:
memset((void*)prachF,0,4*1536); memset((void *)prachF,0,4*1536);
break; break;
case 15: case 15:
memset((void*)prachF,0,4*3072); memset((void *)prachF,0,4*3072);
break; break;
case 25: case 25:
memset((void*)prachF,0,4*6144); memset((void *)prachF,0,4*6144);
break; break;
case 50: case 50:
memset((void*)prachF,0,4*12288); memset((void *)prachF,0,4*12288);
break; break;
case 75: case 75:
memset((void*)prachF,0,4*18432); memset((void *)prachF,0,4*18432);
break; break;
case 100: case 100:
if (ue->frame_parms.threequarter_fs == 0) if (ue->frame_parms.threequarter_fs == 0)
memset((void*)prachF,0,4*24576); memset((void *)prachF,0,4*24576);
else else
memset((void*)prachF,0,4*18432); memset((void *)prachF,0,4*18432);
break; break;
} }
for (offset=0,offset2=0; offset<N_ZC; offset++,offset2+=preamble_shift) { for (offset=0,offset2=0; offset<N_ZC; offset++,offset2+=preamble_shift) {
if (offset2 >= N_ZC) if (offset2 >= N_ZC)
offset2 -= N_ZC; offset2 -= N_ZC;
...@@ -462,8 +447,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -462,8 +447,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
prach_len = 2* 24576+Ncp; prach_len = 2* 24576+Ncp;
} }
} }
} } else {
else {
if (prach_fmt == 4) { if (prach_fmt == 4) {
idft3072(prachF,prach2,1); idft3072(prachF,prach2,1);
//TODO: account for repeated format in dft output //TODO: account for repeated format in dft output
...@@ -474,6 +458,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -474,6 +458,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
memmove( prach, prach+36864, Ncp<<2 ); memmove( prach, prach+36864, Ncp<<2 );
prach_len = 18432+Ncp; prach_len = 18432+Ncp;
printf("Generated prach for 100 PRB, 3/4 sampling\n"); printf("Generated prach for 100 PRB, 3/4 sampling\n");
if (prach_fmt>1) { if (prach_fmt>1) {
memmove( prach2+36834, prach2, 73728 ); memmove( prach2+36834, prach2, 73728 );
prach_len = 2*18432+Ncp; prach_len = 2*18432+Ncp;
...@@ -485,24 +470,26 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -485,24 +470,26 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
} }
//LOG_I(PHY,"prach_len=%d\n",prach_len); //LOG_I(PHY,"prach_len=%d\n",prach_len);
AssertFatal(prach_fmt<4, AssertFatal(prach_fmt<4,
"prach_fmt4 not fully implemented" ); "prach_fmt4 not fully implemented" );
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
if (!(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) {
int j; int j;
int overflow = prach_start + prach_len - LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*ue->frame_parms.samples_per_tti; 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 ); 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++) { 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] = prach[2*j];
((int16_t*)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1]; ((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1];
} }
for (i=0; i<overflow; i++,j++) { 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] = prach[2*j];
((int16_t*)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1]; ((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1];
} }
#if defined(EXMIMO) #if defined(EXMIMO)
// handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on // 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++) { for (k=prach_start - (ue->frame_parms.samples_per_tti>>1) ; k<prach_start ; k++) {
if (k<0) if (k<0)
...@@ -512,25 +499,21 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -512,25 +499,21 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
else else
ue->common_vars.txdata[0][k] &= 0xFFFEFFFE; ue->common_vars.txdata[0][k] &= 0xFFFEFFFE;
} }
#endif
#else
#endif
} else { // simulators
for (i=0; i<prach_len; i++) { 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] = prach[2*i];
((int16_t*)(&ue->common_vars.txdata[0][prach_start]))[2*i+1] = prach[2*i+1]; ((int16_t *)(&ue->common_vars.txdata[0][prach_start]))[2*i+1] = prach[2*i+1];
}
} }
#endif
#if defined(PRACH_WRITE_OUTPUT_DEBUG) #if defined(PRACH_WRITE_OUTPUT_DEBUG)
LOG_M("prach_txF0.m","prachtxF0",prachF,prach_len-Ncp,1,1); 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("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); exit(-1);
#endif #endif
return signal_energy( (int *)prach, 256 );
return signal_energy( (int*)prach, 256 );
} }
...@@ -76,9 +76,8 @@ extern double cpuf; ...@@ -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 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); 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];
extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
#endif
void get_dumpparam(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, uint8_t nb_rb, 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, 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 ...@@ -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) { unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb) {
int gain_dB; 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 ...@@ -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))); 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) { 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)) { 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 ...@@ -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 subframe_tx = proc->subframe_tx;
int ulsch_start; int ulsch_start;
int overflow=0; int overflow=0;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
int k,l; int k,l;
int dummy_tx_buffer[frame_parms->samples_per_tti] __attribute__((aligned(16))); 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); 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)) { 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 ...@@ -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; 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
if (!(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) {
ulsch_start = (ue->rx_offset+subframe_tx*frame_parms->samples_per_tti- ulsch_start = (ue->rx_offset+subframe_tx*frame_parms->samples_per_tti-
ue->hw_timing_advance- ue->hw_timing_advance-
ue->timing_advance- ue->timing_advance-
ue->N_TA_offset+5); ue->N_TA_offset+5);
//LOG_E(PHY,"ul-signal [subframe: %d, ulsch_start %d]\n",subframe_tx, ulsch_start);
if(ulsch_start < 0) if(ulsch_start < 0)
ulsch_start = 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 > (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti)) 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); ulsch_start = ulsch_start % (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti);
} else { //this is the simulators case
//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; ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-ue->N_TA_offset; //-ue->timing_advance;
#endif //else EXMIMO }
if (empty_subframe) { if (empty_subframe) {
overflow = ulsch_start - 9*frame_parms->samples_per_tti; overflow = ulsch_start - 9*frame_parms->samples_per_tti;
...@@ -1175,44 +1129,36 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt ...@@ -1175,44 +1129,36 @@ 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++) { 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], 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) Buff,
dummy_tx_buffer,
#else
&ue->common_vars.txdata[aa][ulsch_start],
#endif
frame_parms->ofdm_symbol_size, frame_parms->ofdm_symbol_size,
nsymb, nsymb,
frame_parms->nb_prefix_samples, frame_parms->nb_prefix_samples,
CYCLIC_PREFIX); CYCLIC_PREFIX);
else { } else {
normal_prefix_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size], 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) Buff,
dummy_tx_buffer,
#else
&ue->common_vars.txdata[aa][ulsch_start],
#endif
nsymb>>1, nsymb>>1,
&ue->frame_parms); &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], 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) Buff,
dummy_tx_buffer+(frame_parms->samples_per_tti>>1),
#else
&ue->common_vars.txdata[aa][ulsch_start+(frame_parms->samples_per_tti>>1)],
#endif
nsymb>>1, nsymb>>1,
&ue->frame_parms); &ue->frame_parms);
} }
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
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],0);
apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],1); apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],1);
#endif } else {
#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);
}
if (!(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) {
overflow = ulsch_start - 9*frame_parms->samples_per_tti; 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++) { 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++) {
...@@ -1238,7 +1184,8 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt ...@@ -1238,7 +1184,8 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
} }
#endif #endif
#endif }
/* /*
only for debug 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); 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 ...@@ -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_TDD_map_index,
ue->prach_resources[eNB_id]->ra_RNTI); ue->prach_resources[eNB_id]->ra_RNTI);
ue->tx_total_RE[subframe_tx] = 96; ue->tx_total_RE[subframe_tx] = 96;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
ue->prach_vars[eNB_id]->amp = get_tx_amp(ue->tx_power_dBm[subframe_tx], ue->prach_vars[eNB_id]->amp = get_tx_amp(ue->tx_power_dBm[subframe_tx],
ue->tx_power_max_dBm, ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL, ue->frame_parms.N_RB_UL,
6); 6);
#else } else {
ue->prach_vars[eNB_id]->amp = AMP; ue->prach_vars[eNB_id]->amp = AMP;
#endif }
if ((mode == calib_prach_tx) && (((proc->frame_tx&0xfffe)%100)==0)) 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", LOG_D(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : PRACH TX power %d dBm, amp %d\n",
...@@ -1680,14 +1628,16 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB ...@@ -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; ue->tx_total_RE[subframe_tx] = nb_rb*12;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
tx_amp = AMP;
} else {
tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx], tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx],
ue->tx_power_max_dBm, ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL, ue->frame_parms.N_RB_UL,
nb_rb); nb_rb);
#else }
tx_amp = AMP;
#endif
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(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)); 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,8 +1701,9 @@ void ue_srs_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8 ...@@ -1751,8 +1701,9 @@ 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; Po_SRS = ue->tx_power_max_dBm;
} }
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
tx_amp = AMP;
} else {
if (ue->mac_enabled==1) { if (ue->mac_enabled==1) {
tx_amp = get_tx_amp(Po_SRS, tx_amp = get_tx_amp(Po_SRS,
ue->tx_power_max_dBm, ue->tx_power_max_dBm,
...@@ -1761,10 +1712,8 @@ void ue_srs_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8 ...@@ -1761,10 +1712,8 @@ void ue_srs_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8
} else { } else {
tx_amp = AMP; 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, 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, Po_SRS,
ue->frame_parms.N_RB_UL, 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 ...@@ -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); 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; bundling_flag = ue->pucch_config_dedicated[eNB_id].tdd_AckNackFeedbackMode;
// Part - I // Part - I
// Collect feedback that should be transmitted at this subframe // Collect feedback that should be transmitted at this subframe
// - SR // - SR
...@@ -1990,14 +1938,16 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -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_power_dBm[subframe_tx] = Po_PUCCH;
ue->tx_total_RE[subframe_tx] = 12; ue->tx_total_RE[subframe_tx] = 12;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
tx_amp = AMP;
} else {
tx_amp = get_tx_amp(Po_PUCCH, tx_amp = get_tx_amp(Po_PUCCH,
ue->tx_power_max_dBm, ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL, ue->frame_parms.N_RB_UL,
1); 1);
#else }
tx_amp = AMP;
#endif
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(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))); 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 ...@@ -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_power_dBm[subframe_tx] = Po_PUCCH;
ue->tx_total_RE[subframe_tx] = 12; ue->tx_total_RE[subframe_tx] = 12;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
tx_amp = AMP;
} else {
tx_amp = get_tx_amp(Po_PUCCH, tx_amp = get_tx_amp(Po_PUCCH,
ue->tx_power_max_dBm, ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL, ue->frame_parms.N_RB_UL,
1); 1);
#else }
tx_amp = AMP;
#endif
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(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))); 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)));
...@@ -2313,13 +2265,10 @@ void ue_measurement_procedures( ...@@ -2313,13 +2265,10 @@ void ue_measurement_procedures(
if (( (slot%2) == 0) && (l==(4-frame_parms->Ncp))) { if (( (slot%2) == 0) && (l==(4-frame_parms->Ncp))) {
// AGC // AGC
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_IN);
#ifndef OAI_USRP
#ifndef OAI_BLADERF if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM )
#ifndef OAI_LMSSDR
phy_adjust_gain (ue,dB_fixed(ue->measurements.rssi),0); phy_adjust_gain (ue,dB_fixed(ue->measurements.rssi),0);
#endif
#endif
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_OUT);
eNB_id = 0; 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 ...@@ -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]->first_rb),
T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb), T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb),
T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS)); T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS));
if (LOG_DEBUGFLAG(DEBUG_UE_PHYPROC)) { if (LOG_DEBUGFLAG(DEBUG_UE_PHYPROC)) {
LOG_USEDINLOG_VAR(int8_t,harq_pid) = subframe2harq_pid(&ue->frame_parms, LOG_USEDINLOG_VAR(int8_t,harq_pid) = subframe2harq_pid(&ue->frame_parms,
pdcch_alloc2ul_frame(&ue->frame_parms,proc->frame_rx,proc->subframe_rx), pdcch_alloc2ul_frame(&ue->frame_parms,proc->frame_rx,proc->subframe_rx),
...@@ -4207,39 +4157,39 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr ...@@ -4207,39 +4157,39 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr
if (LOG_DEBUGFLAG(UE_TIMING)) { if (LOG_DEBUGFLAG(UE_TIMING)) {
stop_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]]); 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)); 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 // duplicate harq structure
uint8_t current_harq_pid = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid; 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]; 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]; harq_status_t *current_harq_ack = &ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_ack[subframe_rx];
// For Debug parallelisation // For Debug parallelisation
//if (current_harq_ack->ack == 0) { //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); //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++) { 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]; 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]; 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_harq_proc_struct(harq_processes_dest, current_harq_processes);
copy_ack_struct(harq_ack_dest, current_harq_ack); 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_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]; 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 *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_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]; 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_harq_proc_struct(harq_processes_dest, current_harq_processes);
copy_ack_struct(harq_ack_dest, current_harq_ack); copy_ack_struct(harq_ack_dest, current_harq_ack);
copy_harq_proc_struct(harq_processes_dest1, current_harq_processes); copy_harq_proc_struct(harq_processes_dest1, current_harq_processes);
copy_ack_struct(harq_ack_dest1, current_harq_ack); copy_ack_struct(harq_ack_dest1, current_harq_ack);
*/ */
if (subframe_rx==9) { if (subframe_rx==9) {
if (frame_rx % 10 == 0) { if (frame_rx % 10 == 0) {
if ((ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]) != 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_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]);
...@@ -4260,17 +4210,17 @@ if (subframe_rx==9) { ...@@ -4260,17 +4210,17 @@ if (subframe_rx==9) {
} }
#endif #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)) { if (LOG_DEBUGFLAG(UE_TIMING)) {
stop_meas(&ue->phy_proc_rx[ue->current_thread_id[subframe_rx]]); 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_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); LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx);
return (0); return (0);
} }
#endif /*UE_SLOT_PARALLELISATION */ #endif /*UE_SLOT_PARALLELISATION */
......
...@@ -1741,7 +1741,7 @@ void *UE_thread(void *arg) { ...@@ -1741,7 +1741,7 @@ void *UE_thread(void *arg) {
} }
} }
//usleep(3000); // usleep(3000);
if(sub_frame == 0) { if(sub_frame == 0) {
//UE->proc.proc_rxtx[0].frame_rx++; //UE->proc.proc_rxtx[0].frame_rx++;
//UE->proc.proc_rxtx[1].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