From 34899cd40469e04ad4665748e699175232d257e2 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 9 Aug 2019 15:16:18 +0200 Subject: [PATCH] fix compilation of phy simulators introduced from the usage of get_band() --- openair1/PHY/INIT/nr_init.c | 3 +-- openair1/SIMULATION/NR_PHY/dlschsim.c | 2 ++ openair1/SIMULATION/NR_PHY/dlsim.c | 2 ++ openair1/SIMULATION/NR_PHY/pbchsim.c | 2 ++ openair1/SIMULATION/NR_PHY/pucchsim.c | 2 ++ openair1/SIMULATION/NR_PHY/ulschsim.c | 18 ++++++++++++------ openair1/SIMULATION/NR_PHY/ulsim.c | 2 ++ .../NR_UE_PHY/unit_tests/src/dummy_functions.c | 2 +- 8 files changed, 24 insertions(+), 9 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 6b04da3e15..e0f73c2b61 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -31,8 +31,7 @@ #include "TDD-Config.h" #include "MBSFN-SubframeConfigList.h"*/ #include "openair1/PHY/defs_RU.h" -#include "LAYER2/MAC/mac_extern.h" -#include "LAYER2/MAC/mac_proto.h" +#include "LAYER2/NR_MAC_gNB/mac_proto.h" #include "assertions.h" #include diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 09ef2ff3f3..114e438753 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -51,6 +51,8 @@ PHY_VARS_gNB *gNB; PHY_VARS_NR_UE *UE; RAN_CONTEXT_t RC; +int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; + double cpuf; int nfapi_mode = 0; diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 4f515946d6..cdb87171f6 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -60,6 +60,8 @@ PHY_VARS_gNB *gNB; PHY_VARS_NR_UE *UE; RAN_CONTEXT_t RC; +int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; + double cpuf; int nfapi_mode=0; diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 22abbbcbc2..4b8aefc789 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -52,6 +52,8 @@ PHY_VARS_gNB *gNB; PHY_VARS_NR_UE *UE; RAN_CONTEXT_t RC; +int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; + double cpuf; int nfapi_mode=0; diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 9e03a06a82..ed0bee9227 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -50,6 +50,8 @@ PHY_VARS_gNB *gNB; PHY_VARS_NR_UE *UE; RAN_CONTEXT_t RC; openair0_config_t openair0_cfg[MAX_CARDS]; +int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; + double cpuf; int nfapi_mode=0; diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index b3f769fef0..2acf6ca903 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -52,6 +52,8 @@ PHY_VARS_gNB *gNB; PHY_VARS_NR_UE *UE; RAN_CONTEXT_t RC; +int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; + double cpuf; int nfapi_mode = 0; @@ -64,7 +66,7 @@ int main(int argc, char **argv) { char c; int i,sf; - double SNR, snr0 = -2.0, snr1 = 2.0; //, SNR_lin; + double SNR, snr0 = -2.0, snr1 = 2.0, SNR_lin; double snr_step = 0.1; uint8_t snr1set = 0; FILE *output_fd = NULL; @@ -83,7 +85,7 @@ int main(int argc, char **argv) //unsigned char pbch_phase = 0; int frame = 0, subframe = 0; NR_DL_FRAME_PARMS *frame_parms; - //double sigma; + double sigma; unsigned char qbits = 8; int ret; int loglvl = OAILOG_WARNING; @@ -491,11 +493,15 @@ int main(int argc, char **argv) //if (i<16) printf("modulated_input[%d] = %d\n",i,modulated_input[i]); - //SNR_lin = pow(10, SNR / 10.0); - //sigma = 1.0 / sqrt(2 * SNR_lin); +#if 1 + SNR_lin = pow(10, SNR / 10.0); + sigma = 1.0 / sqrt(2 * SNR_lin); + channel_output_fixed[i] = (short) quantize(sigma / 4.0 / 4.0, + modulated_input[i] + sigma * gaussdouble(0.0, 1.0), + qbits); +#else channel_output_fixed[i] = (short) quantize(0.01, modulated_input[i], qbits); - //channel_output_fixed[i] = (short) quantize(sigma / 4.0 / 4.0, modulated_input[i] + sigma * gaussdouble(0.0, 1.0), qbits); - //channel_output_fixed[i] = (char)quantize8bit(sigma/4.0,(2.0*modulated_input[i]) - 1.0 + sigma*gaussdouble(0.0,1.0)); +#endif //printf("channel_output_fixed[%d]: %d\n",i,channel_output_fixed[i]); //Uncoded BER diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 1281675599..bb74368dfe 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -60,6 +60,8 @@ PHY_VARS_gNB *gNB; PHY_VARS_NR_UE *UE; RAN_CONTEXT_t RC; +int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; + double cpuf; int nfapi_mode = 0; diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/dummy_functions.c b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/dummy_functions.c index fa243d1eb0..a93f0d48f3 100644 --- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/dummy_functions.c +++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/dummy_functions.c @@ -119,7 +119,7 @@ void dl_phy_sync_success(module_id_t module_idP, frame_t frameP, unsigned char eNB_index, uint8_t first_sync){} -uint32_t from_nrarfcn(int nr_bandP, uint32_t dl_nrarfcn) { return(0);} +uint64_t from_nrarfcn(int nr_bandP, uint32_t dl_nrarfcn) { return(0);} int32_t get_uldl_offset(int nr_bandP) { return(0);}