Commit 9c84ab93 authored by Fang-WANG's avatar Fang-WANG

add OXGRF support

oxgrf ok

update build script for oxgrf

del logs
parent 27e998ce
......@@ -786,7 +786,7 @@ add_library(F1AP ${F1AP_C_FILES} )
add_list1_option(NB_ANTENNAS_RX "4" "Number of antennas in reception" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4")
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU")
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU" "OAI_OXGRF")
add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET")
#NOKIA config enhancement
......@@ -825,6 +825,13 @@ set(HWLIB_BLADERF_SOURCE
add_library(oai_bladerfdevif MODULE ${HWLIB_BLADERF_SOURCE} )
target_link_libraries(oai_bladerfdevif bladeRF)
include_directories("${OPENAIR_TARGETS}/ARCH/OXGRF/USERSPACE/LIB/")
set(HWLIB_OXGRF_SOURCE
${OPENAIR_TARGETS}/ARCH/OXGRF/USERSPACE/LIB/oxgrf_lib.c
)
add_library(oai_oxgrfdevif MODULE ${HWLIB_OXGRF_SOURCE} )
target_link_libraries(oai_oxgrfdevif oxgrf_ss)
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/")
set(HWLIB_LMSSDR_SOURCE
......@@ -3041,7 +3048,7 @@ target_link_libraries (ocp-gnb ${LIBXML2_LIBRARIES} )
target_link_libraries (ocp-gnb pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (ocp-gnb ${LIB_LMS_LIBRARIES})
target_link_libraries (ocp-gnb ${T_LIB})
add_dependencies(ocp-gnb ldpc_orig ldpc_optim ldpc_optim8seg ldpc params_libconfig rfsimulator oai_usrpdevif rfsimulator nrscope)
add_dependencies(ocp-gnb ldpc_orig ldpc_optim ldpc_optim8seg ldpc params_libconfig rfsimulator oai_usrpdevif oai_oxgrfdevif rfsimulator nrscope)
# nr-uesoftmodem is UE implementation
......@@ -3387,7 +3394,7 @@ if (${T_TRACER})
nr_ulschsim ldpctest polartest smallblocktest cu_test du_test
#all "add_library" definitions
ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP
params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer
params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer oai_oxgrfdevif
oai_eth_transpro oai_mobipass tcp_bridge tcp_bridge_oai
coding FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE MSC UTIL OMG_SUMO
SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL
......
......@@ -112,7 +112,7 @@ Options
--UE-gen-nvram [output path]
Specify gen_nvram_path (default \"$gen_nvram_path\")
-w | --hardware
EXMIMO, USRP, BLADERF, LMSSDR, IRIS, ADRV9371_ZC706, SIMU, AW2SORI, None (Default)
EXMIMO, USRP, BLADERF, LMSSDR, IRIS, OXGRF, ADRV9371_ZC706, SIMU, NAW2SORI, one (Default)
Adds this RF board support (in external packages installation and in compilation)
-t | --transport
Selects the transport protocol type, options: None, Ethernet, benetel4g, benetel5g
......@@ -290,7 +290,7 @@ function main() {
"EXMIMO")
HW="EXMIMO"
;;
"USRP" | "BLADERF" | "LMSSDR" | "IRIS" | "ADRV9371_ZC706" | "SIMU" | "AW2SORI")
"USRP" | "BLADERF" | "LMSSDR" | "IRIS" | "ADRV9371_ZC706" | "SIMU" | "OXGRF" | "AW2SORI")
HW="OAI_"$2
;;
"None")
......@@ -849,8 +849,7 @@ function main() {
####################################################
# Build RF device and transport protocol libraries #
####################################################
if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$RU" = "1" -o "$nrUE" = "1" -o "$HWLAT" = "1" ] ; then
if [ "$HW" != "None" ] ; then
# build RF device libraries
if [ "$HW" != "None" ] ; then
rm -f liboai_device.so
......@@ -883,6 +882,20 @@ function main() {
ln -sf liboai_bladerfdevif.so liboai_device.so
ln -sf $dbin/liboai_bladerfdevif.so.$REL $dbin/liboai_device.so
echo_info "liboai_device.so is linked to BLADERF device library"
elif [ "$HW" == "OAI_OXGRF" ] ; then
if [ ! -f "/usr/local/include/oxgrf_api_ss.h" ] ; then
sudo cp $THIS_SCRIPT_PATH/../targets/ARCH/OXGRF/USERSPACE/LIB/oxgrf_api_ss.h /usr/local/include/oxgrf_api_ss.h
sudo cp $THIS_SCRIPT_PATH/../targets/ARCH/OXGRF/USERSPACE/LIB/liboxgrf_ss.so /usr/local/lib/liboxgrf_ss.so
sudo chmod +x /usr/local/lib/liboxgrf_ss.so
sudo ldconfig /usr/local/lib
fi
compilations \
$build_dir oai_oxgrfdevif \
liboai_oxgrfdevif.so $dbin/liboai_oxgrfdevif.so.$REL
echo_info "before link"
ln -sf liboai_oxgrfdevif.so liboai_device.so
ln -sf $dbin/liboai_oxgrfdevif.so.$REL $dbin/liboai_device.so
echo_info "liboai_device.so is linked to OXGRF device library"
elif [ "$HW" == "OAI_LMSSDR" ] ; then
# if [ -f "/usr/include/libbladeRF.h" ] ; then
compilations \
......
......@@ -442,33 +442,6 @@ install_usrp_uhd_driver() {
fi
}
install_bladerf_driver_from_source(){
bladerf_install_log=$OPENAIR_DIR/cmake_targets/log/bladerf_install_log.txt
echo_info "\nInstalling BladeRF driver from sources. The log file for BladeRF driver installation is here: $bladerf_install_log "
(
cd /tmp
echo "Downloading BladeRF driver"
rm -rf /tmp/bladeRF
git clone https://github.com/Nuand/bladeRF.git
cd bladeRF
git checkout tags/2016.06
mkdir -p build
cd build
$CMAKE ../
echo "Compiling BladeRF driver"
make
$SUDO make install
$SUDO ldconfig
echo "Downloading FPGA and firmware images"
cd /tmp/bladeRF
wget --tries=3 --retry-connrefused https://www.nuand.com/fx3/bladeRF_fw_latest.img
wget --tries=3 --retry-connrefused https://www.nuand.com/fpga/hostedx40-latest.rbf
sudo mkdir -p /usr/share/Nuand/bladeRF
sudo mv bladeRF_fw_latest.img /usr/share/Nuand/bladeRF/bladeRF_fw.img
sudo mv hostedx40-latest.rbf /usr/share/Nuand/bladeRF/hostedx40.rbf
) >& $bladerf_install_log
}
check_install_bladerf_driver(){
if [[ "$OS_DISTRO" == "ubuntu" ]]; then
if [ "$(get_distribution_release)" == "ubuntu14.04" ] ; then
......@@ -862,7 +835,8 @@ check_install_oai_software() {
install_asn1c_from_source $1
$SUDO rm -fr /opt/ssh
$SUDO git clone https://gist.github.com/2190472.git /opt/ssh
#$SUDO git clone https://gist.github.com/2190472.git /opt/ssh
$SUDO git clone https://gitlab.eurecom.fr/oai/ssh.git /opt/ssh
}
install_asn1c_from_source(){
......
......@@ -100,6 +100,8 @@
#define CONFIG_HLP_USRP_ARGS "set the arguments to identify USRP (same syntax as in UHD)\n"
#define CONFIG_HLP_OXGRF_ARGS "set the arguments to identify OXGRF\n"
#define CONFIG_HLP_FLOG "Enable online log \n"
#define CONFIG_HLP_LOGL "Set the global log level, valid options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))\n"
#define CONFIG_HLP_LOGV "Set the global log verbosity \n"
......
......@@ -117,6 +117,7 @@ int vcdflag = 0;
double rx_gain_off = 0.0;
char *usrp_args = NULL;
char *oxgrf_args = NULL;
char *rrc_config_path = NULL;
char *uecap_file = NULL;
int dumpframe = 0;
......@@ -367,6 +368,7 @@ void init_openair0(void) {
openair0_cfg[card].configFilename = get_softmodem_params()->rf_config_file;
if (usrp_args) openair0_cfg[card].sdr_addrs = usrp_args;
else if (oxgrf_args) openair0_cfg[card].sdr_addrs = oxgrf_args;
}
}
......
......@@ -29,6 +29,7 @@
/*------------------------------------------------------------------------------------------------------------------------------------------*/
#define CMDLINE_NRUEPARAMS_DESC { \
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200", TYPE_STRING, 0}, \
{"oxgrf-args", CONFIG_HLP_OXGRF_ARGS, 0, strptr:(char **)&oxgrf_args, defstrval:"dev=pciex:0", TYPE_STRING, 0}, \
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
{"dlsch-parallel", CONFIG_HLP_DLSCH_PARA, 0, iptr:(int32_t *)&nrUE_params.nr_dlsch_parallel, defintval:0, TYPE_UINT8, 0}, \
{"offset-divisor", CONFIG_HLP_OFFSET_DIV, 0, uptr:(uint32_t *)&nrUE_params.ofdm_offset_divisor, defuintval:UINT_MAX, TYPE_UINT32, 0}, \
......
......@@ -430,7 +430,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
phich_string[fp->phich_config_common.phich_resource],
fp->nb_antenna_ports_gNB);*/
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) || defined(OAI_OXGRF)
LOG_I(PHY, "[UE %d] Measured Carrier Frequency %.0f Hz (offset %d Hz)\n",
ue->Mod_id,
openair0_cfg[0].rx_freq[0]+ue->common_vars.freq_offset,
......@@ -480,10 +480,12 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
#ifndef OAI_ADRV9371_ZC706
#ifndef OAI_OXGRF
//phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0);
#endif
#endif
#endif
#endif
#endif
}
......@@ -493,10 +495,12 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
#ifndef OAI_ADRV9371_ZC706
#ifndef OAI_OXGRF
//phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0);
#endif
#endif
#endif
#endif
#endif
}
......
......@@ -42,6 +42,7 @@
* @defgroup _GENERIC_PHY_RF_INTERFACE_ Generic PHY - RF Interface
* @defgroup _USRP_PHY_RF_INTERFACE_ PHY - USRP RF Interface
* @defgroup _BLADERF_PHY_RF_INTERFACE_ PHY - BLADERF RF Interface
* @defgroup _OXGRF_PHY_RF_INTERFACE_ PHY - OXGRF RF Interface
* @defgroup _LMSSDR_PHY_RF_INTERFACE_ PHY - LMSSDR RF Interface
* @}
*
......
......@@ -76,7 +76,9 @@ fifo_dump_emos_UE emos_dump_UE;
char nr_mode_string[NUM_UE_MODE][20] = {"NOT SYNCHED","PRACH","RAR","RA_WAIT_CR", "PUSCH", "RESYNCH"};
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)
const uint8_t nr_rv_round_map_ue[4] = {0, 2, 1, 3};
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) || defined(OAI_OXGRF)
extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
#endif
......@@ -1778,8 +1780,8 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
ue->prach_vars[gNB_id]->amp = AMP;
/* #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)
tx_amp = get_tx_amp_prach(ue->tx_power_dBm[nr_slot_tx], ue->tx_power_max_dBm, ue->frame_parms.N_RB_UL);
/* #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) || defined(OAI_OXGRF)
tx_amp = get_tx_amp_prach(ue->tx_power_dBm[nr_tti_tx], ue->tx_power_max_dBm, ue->frame_parms.N_RB_UL);
if (tx_amp != -1)
ue->prach_vars[gNB_id]->amp = tx_amp;
#else
......
......@@ -94,6 +94,8 @@ typedef enum {
USRP_N300_DEV,
/*!\brief device is BLADE RF*/
BLADERF_DEV,
/*!\brief device is OXGRF pcie*/
OXGRF_DEV,
/*!\brief device is LMSSDR (SoDeRa)*/
LMSSDR_DEV,
/*!\brief device is Iris */
......@@ -107,7 +109,7 @@ typedef enum {
RFSIMULATOR,
MAX_RF_DEV_TYPE
} dev_type_t;
#define DEVTYPE_NAMES {"","EXMIMO","USRP B200","USRP X300","USRP N300","BLADERF","LMSSDR","IRIS","No HW","ADRV9371_ZC706","UEDv2", "RFSIMULATOR"}
#define DEVTYPE_NAMES {"","EXMIMO","USRP B200","USRP X300","USRP N300","BLADERF","OXGRF", "LMSSDR","IRIS","No HW","ADRV9371_ZC706","UEDv2", "RFSIMULATOR"}
/*!\brief transport protocol types
*/
typedef enum {
......@@ -208,7 +210,7 @@ typedef struct {
//! timing_source
clock_source_t time_source;
//! Manual SDR IP address
//#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
//#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_OXGRF)
char *sdr_addrs;
//! Auto calibration flag
int autocal[4];
......
This diff is collapsed.
This diff is collapsed.
/** oxgrf_lib.h
*
* Author: openxg
*/
#include "oxgrf_api_ss.h"
#include "common_lib.h"
/** @addtogroup _OXGRF_PHY_RF_INTERFACE_
* @{
*/
/*! \brief OXGRF specific data structure */
typedef struct {
//! opaque OXGRF device struct. An empty ("") or NULL device identifier will result in the first encountered device being opened (using the first discovered backend)
OXGRF_DESCRIPTOR *dev;
int16_t *rx_buffer;
int16_t *tx_buffer;
//! Sample rate
unsigned int sample_rate;
int rx_num_channels;
int tx_num_channels;
// --------------------------------
// Debug and output control
// --------------------------------
//! Number of underflows
int num_underflows;
//! Number of overflows
int num_overflows;
//! number of RX errors
int num_rx_errors;
//! Number of TX errors
int num_tx_errors;
//! timestamp of current TX
uint64_t tx_current_ts;
//! timestamp of current RX
uint64_t rx_current_ts;
//! number of TX samples
uint64_t tx_nsamps;
//! number of RX samples
uint64_t rx_nsamps;
//! number of TX count
uint64_t tx_count;
//! number of RX count
uint64_t rx_count;
//! timestamp of RX packet
openair0_timestamp rx_timestamp;
} oxgrf_state_t;
/*! \brief get current timestamp
*\param device the hardware to use
*/
openair0_timestamp trx_get_timestamp(openair0_device *device);
#define REMOVE_SUBSTRING_WITHCOMAS(S, TOREMOVE) \
remove_substring(S, TOREMOVE ","); \
remove_substring(S, TOREMOVE ", "); \
remove_substring(S, "," TOREMOVE); \
remove_substring(S, ", " TOREMOVE); \
remove_substring(S, TOREMOVE)
static inline void remove_substring(char* s, const char* toremove)
{
while ((s = strstr(s, toremove))) {
memmove(s, s + strlen(toremove), 1 + strlen(s + strlen(toremove)));
}
}
static inline void copy_subdev_string(char* dst, char* src)
{
int n = 0;
int len = (int)strlen(src);
/* Copy until end of string or comma */
while (n < len && src[n] != '\0' && src[n] != ',') {
dst[n] = src[n];
n++;
}
dst[n] = '\0';
}
/*@}*/
#ifndef OPENAIRINTERFACE5G_LIMITS_H_
#define OPENAIRINTERFACE5G_LIMITS_H_
#if 1 /*defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)*/
#if 1 /*defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) || defined(OAI_OXGRF)*/
# define NUMBER_OF_eNB_MAX 1
# define NUMBER_OF_gNB_MAX 1
# define NUMBER_OF_RU_MAX 2
......
......@@ -78,6 +78,7 @@
#define CONFIG_HLP_PRB "Set the PRB, valid values: 6, 25, 50, 100 \n"
#define CONFIG_HLP_DLSHIFT "dynamic shift for LLR compuation for TM3/4 (default 0)\n"
#define CONFIG_HLP_USRP_ARGS "set the arguments to identify USRP (same syntax as in UHD)\n"
#define CONFIG_HLP_OXGRF_ARGS "set the arguments to identify OXGRF\n"
#define CONFIG_HLP_DMAMAP "sets flag for improved EXMIMO UE performance\n"
#define CONFIG_HLP_TDD "Set hardware to TDD mode (default: FDD). Used only with -U (otherwise set in config file).\n"
#define CONFIG_HLP_TADV "Set timing_advance\n"
......@@ -110,6 +111,7 @@
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0}, \
{"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200",TYPE_STRING, 0}, \
{"oxgrf-args", CONFIG_HLP_OXGRF_ARGS, 0, strptr:(char **)&oxgrf_args, defstrval:"dev=pciex:0",TYPE_STRING, 0}, \
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
{"A", CONFIG_HLP_TADV, 0, iptr:&(timingadv), defintval:0, TYPE_INT, 0}, \
......
......@@ -165,6 +165,8 @@ int transmission_mode=1;
char *usrp_args=NULL;
char *usrp_clksrc=NULL;
char *oxgrf_args=NULL;
THREAD_STRUCT thread_struct;
/* struct for ethernet specific parameters given in eNB conf file */
eth_params_t *eth_params;
......@@ -482,6 +484,7 @@ void init_openair0(LTE_DL_FRAME_PARMS *frame_parms,int rxgain) {
}
if (usrp_args) openair0_cfg[card].sdr_addrs = usrp_args;
else if (oxgrf_args) openair0_cfg[card].sdr_addrs = oxgrf_args;
}
}
......
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