develop-nr current as of 16.7.19
This commit is contained in:
@@ -53,17 +53,20 @@ int num_devices=0;
|
||||
* \param device RF frontend parameters set by application
|
||||
* \returns 0 on success
|
||||
*/
|
||||
int trx_brf_init(openair0_device *device) {
|
||||
int trx_brf_init(openair0_device *device)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*! \brief get current timestamp
|
||||
*\param device the hardware to use
|
||||
*\param module the bladeRf module
|
||||
*\returns timestamp of BladeRF
|
||||
*/
|
||||
|
||||
openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module module) {
|
||||
openair0_timestamp trx_get_timestamp(openair0_device *device,
|
||||
bladerf_module module)
|
||||
{
|
||||
int status;
|
||||
struct bladerf_metadata meta;
|
||||
brf_state_t *brf = (brf_state_t*)device->priv;
|
||||
@@ -77,11 +80,13 @@ openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module mod
|
||||
return meta.timestamp;
|
||||
}
|
||||
|
||||
|
||||
/*! \brief Start BladeRF
|
||||
* \param device the hardware to use
|
||||
* \returns 0 on success
|
||||
*/
|
||||
int trx_brf_start(openair0_device *device) {
|
||||
int trx_brf_start(openair0_device *device)
|
||||
{
|
||||
brf_state_t *brf = (brf_state_t*)device->priv;
|
||||
int status;
|
||||
|
||||
@@ -119,6 +124,7 @@ int trx_brf_start(openair0_device *device) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*! \brief Called to send samples to the BladeRF RF target
|
||||
\param device pointer to the device structure specific to the RF hardware target
|
||||
\param timestamp The timestamp at whicch the first sample MUST be sent
|
||||
@@ -128,8 +134,13 @@ int trx_brf_start(openair0_device *device) {
|
||||
\param flags Ignored for the moment
|
||||
\returns 0 on success
|
||||
*/
|
||||
static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp, void **buff, int nsamps, int cc, int flags) {
|
||||
|
||||
static int trx_brf_write(openair0_device *device,
|
||||
openair0_timestamp ptimestamp,
|
||||
void **buff,
|
||||
int nsamps,
|
||||
int cc,
|
||||
int flags)
|
||||
{
|
||||
int status;
|
||||
brf_state_t *brf = (brf_state_t*)device->priv;
|
||||
/* BRF has only 1 rx/tx chaine : is it correct? */
|
||||
@@ -169,6 +180,7 @@ static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp,
|
||||
return nsamps; //brf->meta_tx.actual_count;
|
||||
}
|
||||
|
||||
|
||||
/*! \brief Receive samples from hardware.
|
||||
* Read \ref nsamps samples from each channel to buffers. buff[0] is the array for
|
||||
* the first channel. *ptimestamp is the time at which the first sample
|
||||
@@ -180,8 +192,12 @@ static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp,
|
||||
* \param cc Index of component carrier
|
||||
* \returns number of samples read
|
||||
*/
|
||||
static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
|
||||
|
||||
static int trx_brf_read(openair0_device *device,
|
||||
openair0_timestamp *ptimestamp,
|
||||
void **buff,
|
||||
int nsamps,
|
||||
int cc)
|
||||
{
|
||||
int status=0;
|
||||
brf_state_t *brf = (brf_state_t*)device->priv;
|
||||
|
||||
@@ -222,10 +238,12 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp,
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*! \brief Terminate operation of the BladeRF transceiver -- free all associated resources
|
||||
* \param device the hardware to use
|
||||
*/
|
||||
void trx_brf_end(openair0_device *device) {
|
||||
void trx_brf_end(openair0_device *device)
|
||||
{
|
||||
int status;
|
||||
brf_state_t *brf = (brf_state_t*)device->priv;
|
||||
// Disable RX module, shutting down our underlying RX stream
|
||||
@@ -239,44 +257,47 @@ void trx_brf_end(openair0_device *device) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
/*! \brief print the BladeRF statistics
|
||||
* \param device the hardware to use
|
||||
* \returns 0 on success
|
||||
*/
|
||||
int trx_brf_get_stats(openair0_device* device) {
|
||||
|
||||
int trx_brf_get_stats(openair0_device* device)
|
||||
{
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*! \brief Reset the BladeRF statistics
|
||||
* \param device the hardware to use
|
||||
* \returns 0 on success
|
||||
*/
|
||||
int trx_brf_reset_stats(openair0_device* device) {
|
||||
|
||||
int trx_brf_reset_stats(openair0_device* device)
|
||||
{
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*! \brief Stop BladeRF
|
||||
* \param card the hardware to use
|
||||
* \returns 0 in success
|
||||
*/
|
||||
int trx_brf_stop(openair0_device* device) {
|
||||
|
||||
int trx_brf_stop(openair0_device* device)
|
||||
{
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*! \brief Set frequencies (TX/RX)
|
||||
* \param device the hardware to use
|
||||
* \param openair0_cfg1 openair0 Config structure (ignored. It is there to comply with RF common API)
|
||||
* \param exmimo_dump_config (ignored)
|
||||
* \returns 0 in success
|
||||
*/
|
||||
int trx_brf_set_freq(openair0_device* device, openair0_config_t *openair0_cfg1,int exmimo_dump_config) {
|
||||
|
||||
int trx_brf_set_freq(openair0_device* device,
|
||||
openair0_config_t *openair0_cfg1,
|
||||
int exmimo_dump_config)
|
||||
{
|
||||
int status;
|
||||
brf_state_t *brf = (brf_state_t *)device->priv;
|
||||
openair0_config_t *openair0_cfg = (openair0_config_t *)device->openair0_cfg;
|
||||
@@ -298,19 +319,19 @@ int trx_brf_set_freq(openair0_device* device, openair0_config_t *openair0_cfg1,i
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*! \brief Set Gains (TX/RX)
|
||||
* \param device the hardware to use
|
||||
* \param openair0_cfg openair0 Config structure
|
||||
* \returns 0 in success
|
||||
*/
|
||||
int trx_brf_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) {
|
||||
|
||||
int trx_brf_set_gains(openair0_device* device,
|
||||
openair0_config_t *openair0_cfg)
|
||||
{
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define RXDCLENGTH 16384
|
||||
int16_t cos_fsover8[8] = {2047, 1447, 0, -1448, -2047, -1448, 0, 1447};
|
||||
int16_t cos_3fsover8[8] = {2047, -1448, 0, 1447, -2047, 1447, 0, -1448};
|
||||
@@ -323,12 +344,14 @@ rx_gain_calib_table_t calib_table_fx4[] = {
|
||||
{-1,0}
|
||||
};
|
||||
|
||||
|
||||
/*! \brief set RX gain offset from calibration table
|
||||
* \param openair0_cfg RF frontend parameters set by application
|
||||
* \param chain_index RF chain ID
|
||||
*/
|
||||
void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) {
|
||||
|
||||
void set_rx_gain_offset(openair0_config_t *openair0_cfg,
|
||||
int chain_index)
|
||||
{
|
||||
int i=0;
|
||||
// loop through calibration table to find best adjustment factor for RX frequency
|
||||
double min_diff = 6e9,diff;
|
||||
@@ -348,11 +371,12 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*! \brief Calibrate LMSSDR RF
|
||||
* \param device the hardware to use
|
||||
*/
|
||||
void calibrate_rf(openair0_device *device) {
|
||||
|
||||
void calibrate_rf(openair0_device *device)
|
||||
{
|
||||
/* TODO: this function does not seem to work. Disabled until fixed. */
|
||||
return;
|
||||
|
||||
@@ -925,12 +949,15 @@ void calibrate_rf(openair0_device *device) {
|
||||
// LOG_M("blade_rf_test.m","rxs",calib_buff,RXDCLENGTH,1,1);
|
||||
}
|
||||
|
||||
|
||||
/*! \brief Initialize Openair BLADERF target. It returns 0 if OK
|
||||
* \param device the hardware to use
|
||||
* \param openair0_cfg RF frontend parameters set by application
|
||||
* \returns 0 on success
|
||||
*/
|
||||
int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
int device_init(openair0_device *device,
|
||||
openair0_config_t *openair0_cfg)
|
||||
{
|
||||
int status;
|
||||
brf_state_t *brf = (brf_state_t*)malloc(sizeof(brf_state_t));
|
||||
memset(brf, 0, sizeof(brf_state_t));
|
||||
@@ -1120,6 +1147,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
device->trx_set_gains_func = trx_brf_set_gains;
|
||||
device->openair0_cfg = openair0_cfg;
|
||||
device->priv = (void *)brf;
|
||||
device->uhd_set_thread_priority = NULL;
|
||||
|
||||
calibrate_rf(device);
|
||||
|
||||
@@ -1137,11 +1165,13 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*! \brief bladeRF error report
|
||||
* \param status
|
||||
* \returns 0 on success
|
||||
*/
|
||||
int brf_error(int status) {
|
||||
int brf_error(int status)
|
||||
{
|
||||
fprintf(stderr, "[BRF] brf_error: %s\n", bladerf_strerror(status));
|
||||
exit(-1);
|
||||
return status; // or status error code
|
||||
@@ -1152,8 +1182,8 @@ int brf_error(int status) {
|
||||
* \param serial name of serial port on which to open BladeRF device
|
||||
* \returns bladerf device structure
|
||||
*/
|
||||
struct bladerf * open_bladerf_from_serial(const char *serial) {
|
||||
|
||||
struct bladerf * open_bladerf_from_serial(const char *serial)
|
||||
{
|
||||
int status;
|
||||
struct bladerf *dev;
|
||||
struct bladerf_devinfo info;
|
||||
@@ -1179,12 +1209,13 @@ struct bladerf * open_bladerf_from_serial(const char *serial) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*! \brief Get BladeRF log level
|
||||
* \param log_level log level
|
||||
* \returns log level of BLADERF device
|
||||
*/
|
||||
int get_brf_log_level(int log_level) {
|
||||
|
||||
int get_brf_log_level(int log_level)
|
||||
{
|
||||
int level=BLADERF_LOG_LEVEL_INFO;
|
||||
return BLADERF_LOG_LEVEL_INFO;
|
||||
switch(log_level) {
|
||||
|
||||
@@ -112,9 +112,9 @@ typedef int(*devfunc_t)(openair0_device *, openair0_config_t *, eth_params_t *);
|
||||
|
||||
/* look for the interface library and load it */
|
||||
int load_lib(openair0_device *device,
|
||||
openair0_config_t *openair0_cfg,
|
||||
eth_params_t *cfg,
|
||||
uint8_t flag)
|
||||
openair0_config_t *openair0_cfg,
|
||||
eth_params_t *cfg,
|
||||
uint8_t flag)
|
||||
{
|
||||
loader_shlibfunc_t shlib_fdesc[1];
|
||||
int ret=0;
|
||||
@@ -129,9 +129,8 @@ int load_lib(openair0_device *device,
|
||||
if (getenv("RFSIMULATOR") != NULL)
|
||||
libname="rfsimulator";
|
||||
else
|
||||
libname=OAI_RF_LIBNAME;
|
||||
shlib_fdesc[0].fname="device_init";
|
||||
//shlib_fdesc[1].fname="uhd_set_thread_priority";
|
||||
libname=OAI_RF_LIBNAME;
|
||||
shlib_fdesc[0].fname="device_init";
|
||||
} else {
|
||||
libname=OAI_TP_LIBNAME;
|
||||
shlib_fdesc[0].fname="transport_init";
|
||||
@@ -142,32 +141,10 @@ int load_lib(openair0_device *device,
|
||||
LOG_E(HW,"Library %s couldn't be loaded\n",libname);
|
||||
} else {
|
||||
ret=((devfunc_t)shlib_fdesc[0].fptr)(device,openair0_cfg,cfg);
|
||||
//uhd_set_thread_priority_fun = (set_prio_func_t)shlib_fdesc[1].fptr;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
void uhd_set_thread_prio(void) {
|
||||
|
||||
loader_shlibfunc_t shlib_fdesc[1];
|
||||
int ret = 0;
|
||||
|
||||
char *libname;
|
||||
if (getenv("RFSIMULATOR") != NULL)
|
||||
libname="rfsimulator";
|
||||
else
|
||||
libname=OAI_RF_LIBNAME;
|
||||
//shlib_fdesc[0].fname="uhd_set_thread_priority";
|
||||
ret=load_module_shlib(libname,shlib_fdesc,1,NULL);
|
||||
if (ret < 0) {
|
||||
LOG_E(HW,"Library %s couldn't be loaded\n",libname);
|
||||
} else {
|
||||
//(set_prio_func_t)shlib_fdesc[0].fptr();
|
||||
}
|
||||
//return ret;
|
||||
}
|
||||
*/
|
||||
|
||||
int openair0_device_load(openair0_device *device,
|
||||
openair0_config_t *openair0_cfg)
|
||||
@@ -185,6 +162,7 @@ int openair0_device_load(openair0_device *device,
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
int openair0_transport_load(openair0_device *device,
|
||||
openair0_config_t *openair0_cfg,
|
||||
eth_params_t *eth_params)
|
||||
|
||||
@@ -406,6 +406,10 @@ struct openair0_device_t {
|
||||
* \param arg pointer to capabilities or configuration
|
||||
*/
|
||||
void (*configure_rru)(int idx, void *arg);
|
||||
|
||||
/*! \brief set UHD thread priority
|
||||
*/
|
||||
void (*uhd_set_thread_priority)(void);
|
||||
};
|
||||
|
||||
/* type of device init function, implemented in shared lib */
|
||||
@@ -491,9 +495,7 @@ int openair0_set_rx_frequencies(openair0_device *device, openair0_config_t *open
|
||||
#define gettid() syscall(__NR_gettid)
|
||||
/*@}*/
|
||||
|
||||
void uhd_set_thread_prio(void);
|
||||
typedef void(*set_prio_func_t)(void);
|
||||
//set_prio_func_t uhd_set_thread_priority_fun;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -53,8 +53,8 @@ struct sockaddr_in dest_addr[MAX_INST];
|
||||
int dest_addr_len[MAX_INST];
|
||||
|
||||
|
||||
int trx_eth_start(openair0_device *device) {
|
||||
|
||||
int trx_eth_start(openair0_device *device)
|
||||
{
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
|
||||
/* initialize socket */
|
||||
@@ -153,8 +153,8 @@ int trx_eth_start(openair0_device *device) {
|
||||
}
|
||||
|
||||
|
||||
void trx_eth_end(openair0_device *device) {
|
||||
|
||||
void trx_eth_end(openair0_device *device)
|
||||
{
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
/* destroys socket only for the processes that call the eth_end fuction-- shutdown() for beaking the pipe */
|
||||
if ( close(eth->sockfdd) <0 ) {
|
||||
@@ -166,29 +166,42 @@ void trx_eth_end(openair0_device *device) {
|
||||
}
|
||||
|
||||
|
||||
int trx_eth_stop(openair0_device *device) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
int trx_eth_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
int trx_eth_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
int trx_eth_get_stats(openair0_device* device) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
int trx_eth_reset_stats(openair0_device* device) {
|
||||
int trx_eth_stop(openair0_device *device)
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int ethernet_tune(openair0_device *device, unsigned int option, int value) {
|
||||
int trx_eth_set_freq(openair0_device* device,
|
||||
openair0_config_t *openair0_cfg,
|
||||
int exmimo_dump_config)
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int trx_eth_set_gains(openair0_device* device, openair0_config_t *openair0_cfg)
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int trx_eth_get_stats(openair0_device* device)
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int trx_eth_reset_stats(openair0_device* device)
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int ethernet_tune(openair0_device *device,
|
||||
unsigned int option,
|
||||
int value)
|
||||
{
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
struct timeval timeout;
|
||||
struct ifreq ifr;
|
||||
@@ -363,8 +376,10 @@ int ethernet_tune(openair0_device *device, unsigned int option, int value) {
|
||||
}
|
||||
|
||||
|
||||
int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params ) {
|
||||
|
||||
int transport_init(openair0_device *device,
|
||||
openair0_config_t *openair0_cfg,
|
||||
eth_params_t * eth_params )
|
||||
{
|
||||
eth_state_t *eth = (eth_state_t*)malloc(sizeof(eth_state_t));
|
||||
memset(eth, 0, sizeof(eth_state_t));
|
||||
|
||||
@@ -402,6 +417,7 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth
|
||||
device->trx_stop_func = trx_eth_stop;
|
||||
device->trx_set_freq_func = trx_eth_set_freq;
|
||||
device->trx_set_gains_func = trx_eth_set_gains;
|
||||
device->uhd_set_thread_priority = NULL;
|
||||
|
||||
if (eth->flags == ETH_RAW_MODE) {
|
||||
device->trx_write_func = trx_eth_write_raw;
|
||||
@@ -470,8 +486,11 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth
|
||||
/**************************************************************************************************************************
|
||||
* DEBUGING-RELATED FUNCTIONS *
|
||||
**************************************************************************************************************************/
|
||||
void dump_packet(char *title, unsigned char* pkt, int bytes, unsigned int tx_rx_flag) {
|
||||
|
||||
void dump_packet(char *title,
|
||||
unsigned char* pkt,
|
||||
int bytes,
|
||||
unsigned int tx_rx_flag)
|
||||
{
|
||||
static int numSend = 1;
|
||||
static int numRecv = 1;
|
||||
int num, k;
|
||||
@@ -484,8 +503,10 @@ void dump_packet(char *title, unsigned char* pkt, int bytes, unsigned int tx_rx_
|
||||
printf("%s-%s (%06d): %s 0x%04X\n", title,(tx_rx_flag)? "TX":"RX", num, tmp, cksum);
|
||||
}
|
||||
|
||||
unsigned short calc_csum (unsigned short *buf, int nwords) {
|
||||
|
||||
unsigned short calc_csum (unsigned short *buf,
|
||||
int nwords)
|
||||
{
|
||||
unsigned long sum;
|
||||
for (sum = 0; nwords > 0; nwords--)
|
||||
sum += *buf++;
|
||||
@@ -494,8 +515,9 @@ unsigned short calc_csum (unsigned short *buf, int nwords) {
|
||||
return ~sum;
|
||||
}
|
||||
|
||||
void dump_dev(openair0_device *device) {
|
||||
|
||||
void dump_dev(openair0_device *device)
|
||||
{
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
|
||||
printf("Ethernet device interface %i configuration:\n" ,device->openair0_cfg->Mod_id);
|
||||
@@ -511,21 +533,28 @@ void dump_dev(openair0_device *device) {
|
||||
|
||||
}
|
||||
|
||||
void inline dump_txcounters(openair0_device *device) {
|
||||
|
||||
void inline dump_txcounters(openair0_device *device)
|
||||
{
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
printf(" Ethernet device interface %i, tx counters:\n" ,device->openair0_cfg->Mod_id);
|
||||
printf(" Sent packets: %llu send errors: %i\n", (long long unsigned int)eth->tx_count, eth->num_tx_errors);
|
||||
}
|
||||
|
||||
void inline dump_rxcounters(openair0_device *device) {
|
||||
|
||||
void inline dump_rxcounters(openair0_device *device)
|
||||
{
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
printf(" Ethernet device interface %i rx counters:\n" ,device->openair0_cfg->Mod_id);
|
||||
printf(" Received packets: %llu missed packets errors: %i\n", (long long unsigned int)eth->rx_count, eth->num_underflows);
|
||||
}
|
||||
|
||||
void inline dump_buff(openair0_device *device, char *buff,unsigned int tx_rx_flag, int nsamps) {
|
||||
|
||||
void inline dump_buff(openair0_device *device,
|
||||
char *buff,
|
||||
unsigned int tx_rx_flag,
|
||||
int nsamps)
|
||||
{
|
||||
char *strptr;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
/*need to add ts number of iqs in printf need to fix dump iqs call */
|
||||
@@ -544,7 +573,10 @@ void inline dump_buff(openair0_device *device, char *buff,unsigned int tx_rx_fla
|
||||
|
||||
}
|
||||
|
||||
void dump_iqs(char * buff, int iq_cnt) {
|
||||
|
||||
void dump_iqs(char * buff,
|
||||
int iq_cnt)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<iq_cnt; i++) {
|
||||
printf("s%02i: Q=%+ij I=%+i%s",i,
|
||||
|
||||
@@ -405,6 +405,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg){
|
||||
device->trx_stop_func = trx_lms_stop;
|
||||
device->trx_set_freq_func = trx_lms_set_freq;
|
||||
device->trx_set_gains_func = trx_lms_set_gains;
|
||||
device->uhd_set_thread_priority = NULL;
|
||||
|
||||
device->openair0_cfg = openair0_cfg;
|
||||
|
||||
|
||||
@@ -706,6 +706,7 @@ int openair0_dev_init_sodera(openair0_device* device, openair0_config_t *openair
|
||||
device->trx_stop_func = trx_sodera_stop;
|
||||
device->trx_set_freq_func = trx_sodera_set_freq;
|
||||
device->trx_set_gains_func = trx_sodera_set_gains;
|
||||
device->uhd_set_thread_priority = NULL;
|
||||
|
||||
s->sample_rate = openair0_cfg[0].sample_rate;
|
||||
s->channelscount = openair0_cfg[0].rx_num_channels;
|
||||
|
||||
@@ -600,7 +600,15 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
|
||||
for (int j=0; j<nsamps2; j++) {
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
#ifdef __AVX2__
|
||||
((__m256i *)buff[i])[j] = _mm256_srai_epi16(buff_tmp[i][j],4);
|
||||
// FK: in some cases the buffer might not be 32 byte aligned, so we cannot use avx2
|
||||
|
||||
if ((((uintptr_t) buff[i])&0x1F)==0) {
|
||||
((__m256i *)buff[i])[j] = _mm256_srai_epi16(buff_tmp[i][j],4);
|
||||
}
|
||||
else {
|
||||
((__m128i *)buff[i])[2*j] = _mm_srai_epi16(((__m128i*)buff_tmp[i])[j],4);
|
||||
((__m128i *)buff[i])[2*j+1] = _mm_srai_epi16(((__m128i*)buff_tmp[i])[2*j+1],4);
|
||||
}
|
||||
#else
|
||||
((__m128i *)buff[i])[j] = _mm_srai_epi16(buff_tmp[i][j],4);
|
||||
#endif
|
||||
@@ -852,6 +860,10 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index,int bw_
|
||||
|
||||
if (bw_gain_adjust==1) {
|
||||
switch ((int)openair0_cfg[0].sample_rate) {
|
||||
|
||||
case 46080000:
|
||||
break;
|
||||
|
||||
case 30720000:
|
||||
break;
|
||||
|
||||
@@ -877,7 +889,7 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index,int bw_
|
||||
|
||||
default:
|
||||
LOG_E(PHY,"unknown sampling rate %d\n",(int)openair0_cfg[0].sample_rate);
|
||||
exit(-1);
|
||||
//exit(-1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -914,6 +926,12 @@ int trx_usrp_reset_stats(openair0_device *device) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
/*! \brief Set uhd priority
|
||||
*/
|
||||
static void uhd_set_thread_priority(void) {
|
||||
uhd::set_thread_priority_safe(1.0);
|
||||
}
|
||||
|
||||
#if defined(USRP_REC_PLAY)
|
||||
extern "C" {
|
||||
/*! \brief Initializer for USRP record/playback config
|
||||
@@ -1047,6 +1065,7 @@ extern "C" {
|
||||
device->trx_set_freq_func = trx_usrp_set_freq;
|
||||
device->trx_set_gains_func = trx_usrp_set_gains;
|
||||
device->openair0_cfg = openair0_cfg;
|
||||
device->uhd_set_thread_priority = uhd_set_thread_priority;
|
||||
std::cerr << "USRP device initialized in subframes replay mode for " << u_sf_loops << " loops. Use mmap="
|
||||
<< use_mmap << std::endl;
|
||||
} else {
|
||||
@@ -1162,6 +1181,13 @@ extern "C" {
|
||||
openair0_cfg[0].rx_bw = 40e6;
|
||||
break;
|
||||
|
||||
case 46080000:
|
||||
//openair0_cfg[0].samples_per_packet = 1024;
|
||||
openair0_cfg[0].tx_sample_advance = 115;
|
||||
openair0_cfg[0].tx_bw = 40e6;
|
||||
openair0_cfg[0].rx_bw = 40e6;
|
||||
break;
|
||||
|
||||
case 30720000:
|
||||
// from usrp_time_offset
|
||||
//openair0_cfg[0].samples_per_packet = 2048;
|
||||
@@ -1214,7 +1240,15 @@ extern "C" {
|
||||
}
|
||||
|
||||
switch ((int)openair0_cfg[0].sample_rate) {
|
||||
case 30720000:
|
||||
case 46080000:
|
||||
s->usrp->set_master_clock_rate(46.08e6);
|
||||
//openair0_cfg[0].samples_per_packet = 1024;
|
||||
openair0_cfg[0].tx_sample_advance = 115;
|
||||
openair0_cfg[0].tx_bw = 40e6;
|
||||
openair0_cfg[0].rx_bw = 40e6;
|
||||
break;
|
||||
|
||||
case 30720000:
|
||||
s->usrp->set_master_clock_rate(30.72e6);
|
||||
//openair0_cfg[0].samples_per_packet = 1024;
|
||||
openair0_cfg[0].tx_sample_advance = 115;
|
||||
@@ -1366,6 +1400,7 @@ extern "C" {
|
||||
device->trx_set_freq_func = trx_usrp_set_freq;
|
||||
device->trx_set_gains_func = trx_usrp_set_gains;
|
||||
device->openair0_cfg = openair0_cfg;
|
||||
device->uhd_set_thread_priority = uhd_set_thread_priority;
|
||||
s->sample_rate = openair0_cfg[0].sample_rate;
|
||||
|
||||
// TODO:
|
||||
@@ -1468,9 +1503,6 @@ extern "C" {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void uhd_set_thread_priority(void) {
|
||||
uhd::set_thread_priority_safe(1.0);
|
||||
}
|
||||
|
||||
}
|
||||
/*@}*/
|
||||
|
||||
@@ -646,6 +646,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
device->trx_set_gains_func = rfsimulator_set_gains;
|
||||
device->trx_write_func = rfsimulator_write;
|
||||
device->trx_read_func = rfsimulator_read;
|
||||
device->uhd_set_thread_priority = NULL;
|
||||
/* let's pretend to be a b2x0 */
|
||||
device->type = USRP_B200_DEV;
|
||||
device->openair0_cfg=&openair0_cfg[0];
|
||||
|
||||
@@ -267,6 +267,7 @@ int device_init(openair0_device* device, openair0_config_t *openair0_cfg)
|
||||
device->trx_set_gains_func = tcp_bridge_set_gains;
|
||||
device->trx_write_func = tcp_bridge_write;
|
||||
device->trx_read_func = tcp_bridge_read;
|
||||
device->uhd_set_thread_priority = NULL;
|
||||
|
||||
device->priv = tcp_bridge;
|
||||
|
||||
|
||||
@@ -413,6 +413,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
device->trx_set_freq_func = tcp_bridge_set_freq;
|
||||
device->trx_set_gains_func = tcp_bridge_set_gains;
|
||||
device->trx_write_func = tcp_bridge_write;
|
||||
device->uhd_set_thread_priority = NULL;
|
||||
|
||||
if (tcp_bridge->is_enb) {
|
||||
device->trx_read_func = tcp_bridge_read;
|
||||
|
||||
@@ -0,0 +1,298 @@
|
||||
Active_gNBs = ( "gNB-Eurecom-5GNRBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
gNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_ID = 0xe00;
|
||||
|
||||
cell_type = "CELL_MACRO_GNB";
|
||||
|
||||
gNB_name = "gNB-Eurecom-5GNRBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
|
||||
plmn_list = ({mcc = 208; mnc = 93; mnc_length = 2;});
|
||||
|
||||
tr_s_preference = "local_mac"
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
node_function = "3GPP_gNODEB";
|
||||
node_timing = "synch_to_ext_device";
|
||||
node_synch_ref = 0;
|
||||
frame_type = "TDD";
|
||||
DL_prefix_type = "NORMAL";
|
||||
UL_prefix_type = "NORMAL";
|
||||
eutra_band = 78;
|
||||
downlink_frequency = 3510000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 106;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 125;
|
||||
MIB_subCarrierSpacingCommon = 30;
|
||||
MIB_ssb_SubcarrierOffset = 0;
|
||||
MIB_dmrs_TypeA_Position = 2;
|
||||
pdcch_ConfigSIB1 = 0;
|
||||
SIB1_frequencyOffsetSSB = "khz5";
|
||||
SIB1_ssb_PeriodicityServingCell = 5;
|
||||
SIB1_ss_PBCH_BlockPower = -60;
|
||||
absoluteFrequencySSB = 0;
|
||||
DL_FreqBandIndicatorNR = 15;
|
||||
DL_absoluteFrequencyPointA = 15;
|
||||
DL_offsetToCarrier = 15;
|
||||
DL_SCS_SubcarrierSpacing = "kHz30";
|
||||
DL_SCS_SpecificCarrier_k0 = 0;
|
||||
DL_carrierBandwidth = 15;
|
||||
DL_locationAndBandwidth = 15;
|
||||
DL_BWP_SubcarrierSpacing = "kHz30";
|
||||
DL_BWP_prefix_type = "NORMAL";
|
||||
UL_FreqBandIndicatorNR = 15;
|
||||
UL_absoluteFrequencyPointA = 13;
|
||||
UL_additionalSpectrumEmission = 3;
|
||||
UL_p_Max = -1;
|
||||
UL_frequencyShift7p5khz = "TRUE";
|
||||
UL_offsetToCarrier = 10;
|
||||
UL_SCS_SubcarrierSpacing = "kHz30";
|
||||
UL_SCS_SpecificCarrier_k0 = 0;
|
||||
UL_carrierBandwidth = 15;
|
||||
UL_locationAndBandwidth = 15;
|
||||
UL_BWP_SubcarrierSpacing = "kHz30";
|
||||
UL_BWP_prefix_type = "NORMAL";
|
||||
UL_timeAlignmentTimerCommon = "infinity";
|
||||
ServingCellConfigCommon_n_TimingAdvanceOffset = "n0"
|
||||
ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x01;
|
||||
ServingCellConfigCommon_ssb_periodicityServingCell = 10;
|
||||
ServingCellConfigCommon_dmrs_TypeA_Position = 2;
|
||||
NIA_SubcarrierSpacing = "kHz15";
|
||||
ServingCellConfigCommon_ss_PBCH_BlockPower = -60;
|
||||
referenceSubcarrierSpacing = "kHz15";
|
||||
dl_UL_TransmissionPeriodicity = "ms0p5";
|
||||
nrofDownlinkSlots = 10;
|
||||
nrofDownlinkSymbols = 10;
|
||||
nrofUplinkSlots = 10;
|
||||
nrofUplinkSymbols = 10;
|
||||
rach_totalNumberOfRA_Preambles = 63;
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice = "oneEighth";
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth = 4;
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth = 8;
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf = 16;
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one = 24;
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two = 32;
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four = 8;
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight = 4;
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen = 2;
|
||||
rach_groupBconfigured = "ENABLE";
|
||||
rach_ra_Msg3SizeGroupA = 56;
|
||||
rach_messagePowerOffsetGroupB = "dB0";
|
||||
rach_numberOfRA_PreamblesGroupA = 32;
|
||||
rach_ra_ContentionResolutionTimer = 8;
|
||||
rsrp_ThresholdSSB = 64;
|
||||
rsrp_ThresholdSSB_SUL = 64;
|
||||
prach_RootSequenceIndex_choice = "l839";
|
||||
prach_RootSequenceIndex_l839 = 0;
|
||||
prach_RootSequenceIndex_l139 = 0;
|
||||
prach_msg1_SubcarrierSpacing = "kHz30";
|
||||
restrictedSetConfig = "unrestrictedSet";
|
||||
msg3_transformPrecoding = "ENABLE";
|
||||
prach_ConfigurationIndex = 10;
|
||||
prach_msg1_FDM = "one";
|
||||
prach_msg1_FrequencyStart = 10;
|
||||
zeroCorrelationZoneConfig = 10;
|
||||
preambleReceivedTargetPower = -150;
|
||||
preambleTransMax = 6;
|
||||
powerRampingStep = "dB0";
|
||||
ra_ResponseWindow = 8;
|
||||
groupHoppingEnabledTransformPrecoding = "ENABLE";
|
||||
msg3_DeltaPreamble = 0;
|
||||
p0_NominalWithGrant = 0;
|
||||
PUSCH_TimeDomainResourceAllocation_k2 = 0;
|
||||
PUSCH_TimeDomainResourceAllocation_mappingType = "typeA";
|
||||
PUSCH_TimeDomainResourceAllocation_startSymbolAndLength = 0;
|
||||
pucch_ResourceCommon = 0;
|
||||
pucch_GroupHopping = "neither";
|
||||
hoppingId = 0;
|
||||
p0_nominal = -30;
|
||||
PDSCH_TimeDomainResourceAllocation_k0 = 2;
|
||||
PDSCH_TimeDomainResourceAllocation_mappingType = "typeA";
|
||||
PDSCH_TimeDomainResourceAllocation_startSymbolAndLength = 0;
|
||||
rateMatchPatternId = 0;
|
||||
RateMatchPattern_patternType = "bitmaps";
|
||||
symbolsInResourceBlock = "oneSlot";
|
||||
periodicityAndPattern = 2;
|
||||
RateMatchPattern_controlResourceSet = 5;
|
||||
RateMatchPattern_subcarrierSpacing = "kHz30";
|
||||
RateMatchPattern_mode = "dynamic";
|
||||
controlResourceSetZero = 0;
|
||||
searchSpaceZero = 0;
|
||||
searchSpaceSIB1 = 10;
|
||||
searchSpaceOtherSystemInformation = 10;
|
||||
pagingSearchSpace = 10;
|
||||
ra_SearchSpace = 10;
|
||||
PDCCH_common_controlResourceSetId = 5;
|
||||
PDCCH_common_ControlResourceSet_duration = 2;
|
||||
PDCCH_cce_REG_MappingType = "nonInterleaved";
|
||||
PDCCH_reg_BundleSize = 3;
|
||||
PDCCH_interleaverSize = 3;
|
||||
PDCCH_shiftIndex = 10;
|
||||
PDCCH_precoderGranularity = "sameAsREG-bundle";
|
||||
PDCCH_TCI_StateId = 32;
|
||||
tci_PresentInDCI = "ENABLE";
|
||||
PDCCH_DMRS_ScramblingID = 0;
|
||||
SearchSpaceId = 10;
|
||||
commonSearchSpaces_controlResourceSetId = 5;
|
||||
SearchSpace_monitoringSlotPeriodicityAndOffset_choice = "sl1";
|
||||
SearchSpace_monitoringSlotPeriodicityAndOffset_value = 0;
|
||||
SearchSpace_duration = 2;
|
||||
SearchSpace_nrofCandidates_aggregationLevel1 = 0;
|
||||
SearchSpace_nrofCandidates_aggregationLevel2 = 0;
|
||||
SearchSpace_nrofCandidates_aggregationLevel4 = 0;
|
||||
SearchSpace_nrofCandidates_aggregationLevel8 = 0;
|
||||
SearchSpace_nrofCandidates_aggregationLevel16 = 0;
|
||||
SearchSpace_searchSpaceType = "common";
|
||||
Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1 = 1;
|
||||
Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2 = 1;
|
||||
Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4 = 1;
|
||||
Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8 = 1;
|
||||
Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16 = 1;
|
||||
Common_dci_Format2_3_monitoringPeriodicity = 1;
|
||||
Common_dci_Format2_3_nrofPDCCH_Candidates = 1;
|
||||
ue_Specific__dci_Formats = "formats0-0-And-1-0";
|
||||
RateMatchPatternLTE_CRS_carrierFreqDL = 6;
|
||||
RateMatchPatternLTE_CRS_carrierBandwidthDL = 6;
|
||||
RateMatchPatternLTE_CRS_nrofCRS_Ports = 1;
|
||||
RateMatchPatternLTE_CRS_v_Shift = 0;
|
||||
RateMatchPatternLTE_CRS_radioframeAllocationPeriod = 1;
|
||||
RateMatchPatternLTE_CRS_radioframeAllocationOffset = 0;
|
||||
RateMatchPatternLTE_CRS_subframeAllocation_choice = "oneFrame";
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
srb1_parameters :
|
||||
{
|
||||
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
|
||||
timer_poll_retransmit = 80;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
|
||||
timer_reordering = 35;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
|
||||
timer_status_prohibit = 0;
|
||||
|
||||
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
|
||||
poll_pdu = 4;
|
||||
|
||||
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
|
||||
poll_byte = 99999;
|
||||
|
||||
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
|
||||
max_retx_threshold = 4;
|
||||
}
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.26";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
GNB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
GNB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24";
|
||||
GNB_INTERFACE_NAME_FOR_S1U = "eth0";
|
||||
GNB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
}
|
||||
);
|
||||
|
||||
L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
}
|
||||
);
|
||||
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 1
|
||||
nb_rx = 1
|
||||
att_tx = 0
|
||||
att_rx = 0;
|
||||
bands = [7];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 114;
|
||||
eNB_instances = [0];
|
||||
sdr_addrs = "type=b200";
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_SINGLE_THREAD";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_DISABLE";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_CONTROLLER :
|
||||
{
|
||||
FLEXRAN_ENABLED = "no";
|
||||
FLEXRAN_INTERFACE_NAME = "lo";
|
||||
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
|
||||
FLEXRAN_PORT = 2210;
|
||||
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
|
||||
FLEXRAN_AWAIT_RECONF = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
|
||||
@@ -262,7 +262,7 @@ RUs = (
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_SINGLE_THREAD";
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_DISABLE";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user