Commit 0317d672 authored by Laurent THOMAS's avatar Laurent THOMAS

sanitize, calibration tool kickoff

parent de5e64c7
...@@ -2797,6 +2797,7 @@ add_library(rfsimulator MODULE ...@@ -2797,6 +2797,7 @@ add_library(rfsimulator MODULE
${OPENAIR_TARGETS}/ARCH/rfsimulator/simulator.c ${OPENAIR_TARGETS}/ARCH/rfsimulator/simulator.c
${OPENAIR_TARGETS}/ARCH/rfsimulator/apply_channelmod.c ${OPENAIR_TARGETS}/ARCH/rfsimulator/apply_channelmod.c
${OPENAIR_TARGETS}/ARCH/rfsimulator/new_channel_sim.c ${OPENAIR_TARGETS}/ARCH/rfsimulator/new_channel_sim.c
${OPENAIR1_DIR}/PHY/TOOLS/signal_energy.c
) )
target_link_libraries(rfsimulator SIMU_COMMON ${ATLAS_LIBRARIES}) target_link_libraries(rfsimulator SIMU_COMMON ${ATLAS_LIBRARIES})
...@@ -3181,6 +3182,17 @@ target_link_libraries (dlsim_tm4 ...@@ -3181,6 +3182,17 @@ target_link_libraries (dlsim_tm4
pthread m rt ${CONFIG_LIB} ${ATLAS_LIBRARIES} ${T_LIB} pthread m rt ${CONFIG_LIB} ${ATLAS_LIBRARIES} ${T_LIB}
) )
add_executable(rftest
${OPENAIR_DIR}/openair1/PHY/TOOLS/calibration_test.c
${OPENAIR_DIR}/openair1/PHY/TOOLS/calibration_scope.c
${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR_DIR}/executables/softmodem-common.c
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
target_link_libraries(rftest minimal_lib PHY_NR_COMMON pthread dl m forms ${T_LIB} )
add_executable(polartest add_executable(polartest
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/polartest.c ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/polartest.c
${OPENAIR_DIR}/common/utils/backtrace.c ${OPENAIR_DIR}/common/utils/backtrace.c
......
...@@ -101,7 +101,6 @@ function main() ...@@ -101,7 +101,6 @@ function main()
local -i run_gdb=0 local -i run_gdb=0
local -i show_stdout=0 local -i show_stdout=0
local exe_arguments="" local exe_arguments=""
local itti_dump_file=""
until [ -z "$1" ] until [ -z "$1" ]
do do
...@@ -154,18 +153,6 @@ function main() ...@@ -154,18 +153,6 @@ function main()
exe_arguments="$exe_arguments --rf-config-file=$rf_config_file" exe_arguments="$exe_arguments --rf-config-file=$rf_config_file"
fi fi
;; ;;
-K | --itti-dump-file)
itti_dump_file=$2
# can omit file name if last arg on the line
if [ "x$itti_dump_file" = "x" ]; then
itti_dump_file="/tmp/enb_s1_usrp_itti.log"
shift 1;
else
shift 2;
fi
echo "setting ITTI dump file to: $itti_dump_file"
exe_arguments="$exe_arguments -K $itti_dump_file"
;;
-m | --mscgen) -m | --mscgen)
g_msc_dir=$2 g_msc_dir=$2
# can omit file name if last arg on the line # can omit file name if last arg on the line
......
...@@ -199,15 +199,26 @@ void start_background_system(void) { ...@@ -199,15 +199,26 @@ void start_background_system(void) {
void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name, int affinity, int priority){ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name, int affinity, int priority){
pthread_attr_t attr; pthread_attr_t attr;
pthread_attr_init(&attr); int ret;
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); AssertFatal(0==(ret=pthread_attr_init(&attr)),"ret: %d, errno: %d\n",ret, errno);
pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); AssertFatal(0==(ret=pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED)),"ret: %d, errno: %d\n",ret, errno);
pthread_attr_setschedpolicy(&attr, SCHED_FIFO); AssertFatal(0==(ret=pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED)),"ret: %d, errno: %d\n",ret, errno);
AssertFatal(0==(ret=pthread_attr_setschedpolicy(&attr, SCHED_OAI)),"ret: %d, errno: %d\n",ret, errno);
if(priority<sched_get_priority_min(SCHED_OAI) || priority>sched_get_priority_max(SCHED_FIFO)) {
LOG_E(TMR,"Prio not possible: %d, min is %d, max: %d, forced in the range\n",
priority,
sched_get_priority_min(SCHED_OAI),
sched_get_priority_max(SCHED_OAI));
if(priority<sched_get_priority_min(SCHED_OAI))
priority=sched_get_priority_min(SCHED_OAI);
if(priority>sched_get_priority_max(SCHED_OAI))
priority=sched_get_priority_max(SCHED_OAI);
}
AssertFatal(priority<=sched_get_priority_max(SCHED_OAI),"");
struct sched_param sparam={0}; struct sched_param sparam={0};
sparam.sched_priority = priority; sparam.sched_priority = priority;
pthread_attr_setschedparam(&attr, &sparam); AssertFatal(0==(ret=pthread_attr_setschedparam(&attr, &sparam)),"ret: %d, errno: %d\n",ret, errno);
AssertFatal(0==(ret=pthread_create(t, &attr, func, param)),"ret: %d, errno: %d\n",ret, errno);
pthread_create(t, &attr, func, param);
pthread_setname_np(*t, name); pthread_setname_np(*t, name);
if (affinity != -1 ) { if (affinity != -1 ) {
...@@ -216,7 +227,6 @@ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name, ...@@ -216,7 +227,6 @@ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name,
CPU_SET(affinity, &cpuset); CPU_SET(affinity, &cpuset);
AssertFatal( pthread_setaffinity_np(*t, sizeof(cpu_set_t), &cpuset) == 0, "Error setting processor affinity"); AssertFatal( pthread_setaffinity_np(*t, sizeof(cpu_set_t), &cpuset) == 0, "Error setting processor affinity");
} }
pthread_attr_destroy(&attr); pthread_attr_destroy(&attr);
} }
......
...@@ -46,9 +46,11 @@ void set_latency_target(void); ...@@ -46,9 +46,11 @@ void set_latency_target(void);
void configure_linux(void); void configure_linux(void);
void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name, int affinity, int priority); void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name, int affinity, int priority);
#define OAI_PRIORITY_RT_LOW sched_get_priority_min(SCHED_FIFO)
#define OAI_PRIORITY_RT sched_get_priority_min(SCHED_FIFO+10) #define SCHED_OAI SCHED_RR
#define OAI_PRIORITY_RT_MAX sched_get_priority_min(SCHED_FIFO+20) #define OAI_PRIORITY_RT_LOW sched_get_priority_min(SCHED_OAI)
#define OAI_PRIORITY_RT sched_get_priority_min(SCHED_OAI)+1
#define OAI_PRIORITY_RT_MAX sched_get_priority_min(SCHED_OAI)+2
void thread_top_init(char *thread_name, void thread_top_init(char *thread_name,
int affinity, int affinity,
......
...@@ -114,7 +114,6 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; ...@@ -114,7 +114,6 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
//Temp fix for inexistent NR upper layer //Temp fix for inexistent NR upper layer
unsigned char NB_gNB_INST = 1; unsigned char NB_gNB_INST = 1;
static char *itti_dump_file = NULL;
int UE_scan = 1; int UE_scan = 1;
int UE_scan_carrier = 0; int UE_scan_carrier = 0;
......
...@@ -18,13 +18,9 @@ ...@@ -18,13 +18,9 @@
/* optname helpstr paramflags XXXptr defXXXval type numelt */ /* optname helpstr paramflags XXXptr defXXXval type numelt */
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define CMDLINE_PARAMS_DESC_GNB { \ #define CMDLINE_PARAMS_DESC_GNB { \
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \ {"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \ {"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \ {"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \
{"K" , CONFIG_HLP_ITTIL, PARAMFLAG_NOFREE, strptr:&itti_dump_file, defstrval:"/tmp/itti.dump", TYPE_STRING, 0}, \
{"m" , CONFIG_HLP_DLMCS, 0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \
{"t" , CONFIG_HLP_ULMCS, 0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \
{"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \ {"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \
{"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \ {"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \
} }
......
...@@ -61,8 +61,6 @@ uint32_t do_forms=0; ...@@ -61,8 +61,6 @@ uint32_t do_forms=0;
unsigned int mmapped_dma=0; unsigned int mmapped_dma=0;
int8_t threequarter_fs=0; int8_t threequarter_fs=0;
uint32_t target_dl_mcs = 28; //maximum allowed mcs
uint32_t target_ul_mcs = 20;
int chain_offset=0; int chain_offset=0;
uint16_t sl_ahead=6; uint16_t sl_ahead=6;
uint16_t sf_ahead=6; uint16_t sf_ahead=6;
...@@ -122,7 +120,6 @@ int restart_L1L2(module_id_t gnb_id) { ...@@ -122,7 +120,6 @@ int restart_L1L2(module_id_t gnb_id) {
} }
static int wait_for_sync = 0; static int wait_for_sync = 0;
static char *itti_dump_file = NULL;
static double snr_dB=20; static double snr_dB=20;
static int DEFBANDS[] = {7}; static int DEFBANDS[] = {7};
static int DEFENBS[] = {0}; static int DEFENBS[] = {0};
......
This diff is collapsed.
#ifndef CALIB_SCOPE_H
#define CALIB_SCOPE_H
void CalibrationInitScope(void ** samplesRx,openair0_device *rfdevice);
#endif
This diff is collapsed.
...@@ -324,12 +324,12 @@ typedef enum { ...@@ -324,12 +324,12 @@ typedef enum {
/* optname helpstr paramflags XXXptr defXXXval type numelt */ /* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------------------------------------------------------------------------*/
#define GNBNETPARAMS_DESC { \ #define GNBNETPARAMS_DESC { \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_NG_AMF, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ {GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_NG_AMF, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_NG_AMF, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ {GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_NG_AMF, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_NGU, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ {GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_NGU, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_NGU, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ {GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_NGU, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_NGU, NULL, 0, uptr:NULL, defintval:2152L, TYPE_UINT, 0}, \ {GNB_CONFIG_STRING_GNB_PORT_FOR_NGU, NULL, 0, uptr:NULL, defintval:2152L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_X2C, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ {GNB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_X2C, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_ENB_PORT_FOR_X2C, NULL, 0, uptr:NULL, defintval:0L, TYPE_UINT, 0} \ {GNB_CONFIG_STRING_ENB_PORT_FOR_X2C, NULL, 0, uptr:NULL, defintval:0L, TYPE_UINT, 0} \
} }
......
...@@ -87,8 +87,6 @@ pthread_mutex_t nfapi_sync_mutex; ...@@ -87,8 +87,6 @@ pthread_mutex_t nfapi_sync_mutex;
int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
uint8_t nfapi_mode = 0; // Default to monolithic mode uint8_t nfapi_mode = 0; // Default to monolithic mode
uint32_t target_dl_mcs = 28;
uint32_t target_ul_mcs = 20;
uint32_t timing_advance = 0; uint32_t timing_advance = 0;
uint64_t num_missed_slots=0; uint64_t num_missed_slots=0;
...@@ -120,7 +118,6 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; ...@@ -120,7 +118,6 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
//Temp fix for inexistent NR upper layer //Temp fix for inexistent NR upper layer
unsigned char NB_gNB_INST = 1; unsigned char NB_gNB_INST = 1;
static char *itti_dump_file = NULL;
int UE_scan = 1; int UE_scan = 1;
int UE_scan_carrier = 0; int UE_scan_carrier = 0;
......
...@@ -667,7 +667,6 @@ typedef struct { ...@@ -667,7 +667,6 @@ typedef struct {
unsigned char omv_enabled; // openair mobility visulizer unsigned char omv_enabled; // openair mobility visulizer
unsigned char opp_enabled; // openair performance profiler unsigned char opp_enabled; // openair performance profiler
unsigned char oeh_enabled; // openair event handler, with CLI this could provide a remote event management unsigned char oeh_enabled; // openair event handler, with CLI this could provide a remote event management
char *itti_dump_file;
unsigned char vcd_enabled; unsigned char vcd_enabled;
char *vcd_file; char *vcd_file;
unsigned char eMBMS_active_state; unsigned char eMBMS_active_state;
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#ifndef COMMON_LIB_H #ifndef COMMON_LIB_H
#define COMMON_LIB_H #define COMMON_LIB_H
#include <stdint.h> #include <stdint.h>
#include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <openair1/PHY/TOOLS/tools_defs.h> #include <openair1/PHY/TOOLS/tools_defs.h>
#include "record_player.h" #include "record_player.h"
......
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