Commit 34899cd4 authored by Thomas Schlichter's avatar Thomas Schlichter

fix compilation of phy simulators introduced from the usage of get_band()

parent 91487166
...@@ -31,8 +31,7 @@ ...@@ -31,8 +31,7 @@
#include "TDD-Config.h" #include "TDD-Config.h"
#include "MBSFN-SubframeConfigList.h"*/ #include "MBSFN-SubframeConfigList.h"*/
#include "openair1/PHY/defs_RU.h" #include "openair1/PHY/defs_RU.h"
#include "LAYER2/MAC/mac_extern.h" #include "LAYER2/NR_MAC_gNB/mac_proto.h"
#include "LAYER2/MAC/mac_proto.h"
#include "assertions.h" #include "assertions.h"
#include <math.h> #include <math.h>
......
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
PHY_VARS_gNB *gNB; PHY_VARS_gNB *gNB;
PHY_VARS_NR_UE *UE; PHY_VARS_NR_UE *UE;
RAN_CONTEXT_t RC; RAN_CONTEXT_t RC;
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
double cpuf; double cpuf;
int nfapi_mode = 0; int nfapi_mode = 0;
......
...@@ -60,6 +60,8 @@ ...@@ -60,6 +60,8 @@
PHY_VARS_gNB *gNB; PHY_VARS_gNB *gNB;
PHY_VARS_NR_UE *UE; PHY_VARS_NR_UE *UE;
RAN_CONTEXT_t RC; RAN_CONTEXT_t RC;
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
double cpuf; double cpuf;
int nfapi_mode=0; int nfapi_mode=0;
......
...@@ -52,6 +52,8 @@ ...@@ -52,6 +52,8 @@
PHY_VARS_gNB *gNB; PHY_VARS_gNB *gNB;
PHY_VARS_NR_UE *UE; PHY_VARS_NR_UE *UE;
RAN_CONTEXT_t RC; RAN_CONTEXT_t RC;
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
double cpuf; double cpuf;
int nfapi_mode=0; int nfapi_mode=0;
......
...@@ -50,6 +50,8 @@ PHY_VARS_gNB *gNB; ...@@ -50,6 +50,8 @@ PHY_VARS_gNB *gNB;
PHY_VARS_NR_UE *UE; PHY_VARS_NR_UE *UE;
RAN_CONTEXT_t RC; RAN_CONTEXT_t RC;
openair0_config_t openair0_cfg[MAX_CARDS]; openair0_config_t openair0_cfg[MAX_CARDS];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
double cpuf; double cpuf;
int nfapi_mode=0; int nfapi_mode=0;
......
...@@ -52,6 +52,8 @@ ...@@ -52,6 +52,8 @@
PHY_VARS_gNB *gNB; PHY_VARS_gNB *gNB;
PHY_VARS_NR_UE *UE; PHY_VARS_NR_UE *UE;
RAN_CONTEXT_t RC; RAN_CONTEXT_t RC;
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
double cpuf; double cpuf;
int nfapi_mode = 0; int nfapi_mode = 0;
...@@ -64,7 +66,7 @@ int main(int argc, char **argv) ...@@ -64,7 +66,7 @@ int main(int argc, char **argv)
{ {
char c; char c;
int i,sf; 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; double snr_step = 0.1;
uint8_t snr1set = 0; uint8_t snr1set = 0;
FILE *output_fd = NULL; FILE *output_fd = NULL;
...@@ -83,7 +85,7 @@ int main(int argc, char **argv) ...@@ -83,7 +85,7 @@ int main(int argc, char **argv)
//unsigned char pbch_phase = 0; //unsigned char pbch_phase = 0;
int frame = 0, subframe = 0; int frame = 0, subframe = 0;
NR_DL_FRAME_PARMS *frame_parms; NR_DL_FRAME_PARMS *frame_parms;
//double sigma; double sigma;
unsigned char qbits = 8; unsigned char qbits = 8;
int ret; int ret;
int loglvl = OAILOG_WARNING; int loglvl = OAILOG_WARNING;
...@@ -491,11 +493,15 @@ int main(int argc, char **argv) ...@@ -491,11 +493,15 @@ int main(int argc, char **argv)
//if (i<16) printf("modulated_input[%d] = %d\n",i,modulated_input[i]); //if (i<16) printf("modulated_input[%d] = %d\n",i,modulated_input[i]);
//SNR_lin = pow(10, SNR / 10.0); #if 1
//sigma = 1.0 / sqrt(2 * SNR_lin); 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(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); #endif
//channel_output_fixed[i] = (char)quantize8bit(sigma/4.0,(2.0*modulated_input[i]) - 1.0 + sigma*gaussdouble(0.0,1.0));
//printf("channel_output_fixed[%d]: %d\n",i,channel_output_fixed[i]); //printf("channel_output_fixed[%d]: %d\n",i,channel_output_fixed[i]);
//Uncoded BER //Uncoded BER
......
...@@ -60,6 +60,8 @@ ...@@ -60,6 +60,8 @@
PHY_VARS_gNB *gNB; PHY_VARS_gNB *gNB;
PHY_VARS_NR_UE *UE; PHY_VARS_NR_UE *UE;
RAN_CONTEXT_t RC; RAN_CONTEXT_t RC;
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
double cpuf; double cpuf;
int nfapi_mode = 0; int nfapi_mode = 0;
......
...@@ -119,7 +119,7 @@ void dl_phy_sync_success(module_id_t module_idP, ...@@ -119,7 +119,7 @@ void dl_phy_sync_success(module_id_t module_idP,
frame_t frameP, frame_t frameP,
unsigned char eNB_index, uint8_t first_sync){} 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);} int32_t get_uldl_offset(int nr_bandP) { return(0);}
......
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