Commit eacd88ea authored by oba's avatar oba Committed by rajeshwari.p

Standalone DU simulator integrated to demonstrate the xRAN lib working with...

Standalone DU simulator integrated to demonstrate the xRAN lib working with OAI. Same IQ samples of sample app are loaded from file and copied in xRAN buffer. Tested with sample app RU
parent 1dbffbde
This diff is collapsed.
......@@ -31,10 +31,104 @@ extern "C"
{
#endif
int start_oran();
void* define_oran_pointer();
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int setup_oran( void *xranlib_ );
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int open_oran_callback( void *xranlib_ );
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int open_oran( void *xranlib_ );
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int initialize_oran( void *xranlib_ );
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int start_oran( void *xranlib_ );
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int register_physide_callbacks(void *xranlib_);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int load_iq_from_file(void *xranlib_);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int xran_fh_tx_send_buffer(void *xranlib_);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif
int compute_xran_statistics(void *xranlib_);
#ifdef __cplusplus
}
#endif
#endif /* _ORAN_ISOLATE_H_ */
......@@ -24,9 +24,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if 0
void init_buffers(shared_buffers *s)
{
int subframe;
memset(s, 0, sizeof(*s));
......@@ -45,8 +46,9 @@ void init_buffers(shared_buffers *s)
s->dl_busy[1] = 0x3fff;
s->dl_busy[2] = 0x3fff;
s->dl_busy[3] = 0x3fff;
}
/*
void lock_buffers(shared_buffers *s, int subframe)
{
if (pthread_mutex_lock(&s->m[subframe]) != 0) {
......@@ -78,4 +80,96 @@ void signal_buffers(shared_buffers *s, int subframe)
exit(1);
}
}
*/
#endif
void init_buffers(shared_buffers *s)
{
int subframe;
memset(s, 0, sizeof(*s));
for (subframe = 0; subframe < 10; subframe++) {
if (pthread_mutex_init(&s->m_dl[subframe], NULL) != 0 ||
pthread_cond_init(&s->c_dl[subframe], NULL) != 0 ||
pthread_mutex_init(&s->m_ul[subframe], NULL) != 0 ||
pthread_cond_init(&s->c_ul[subframe], NULL) != 0) {
printf("%s: error initializing mutex/cond\n", __FUNCTION__);
exit(1);
}
}
/* in FDD the eNB's first transmitted DL subframe is 4 but the device
* * needs to have subframes 1, 2 and 3 ready. Let's pretend there are ready.
* */
s->dl_busy[0][1] = 0x3fff;
s->dl_busy[0][2] = 0x3fff;
s->dl_busy[0][3] = 0x3fff;
s->dl_busy[1][1] = 0x3fff;
s->dl_busy[1][2] = 0x3fff;
s->dl_busy[1][3] = 0x3fff;
}
void lock_dl_buffer(shared_buffers *s, int subframe)
{
if (pthread_mutex_lock(&s->m_dl[subframe]) != 0) {
printf("%s: fatal: lock fails\n", __FUNCTION__);
exit(1);
}
}
void unlock_dl_buffer(shared_buffers *s, int subframe)
{
if (pthread_mutex_unlock(&s->m_dl[subframe]) != 0) {
printf("%s: fatal: unlock fails\n", __FUNCTION__);
exit(1);
}
}
void wait_dl_buffer(shared_buffers *s, int subframe)
{
if (pthread_cond_wait(&s->c_dl[subframe], &s->m_dl[subframe]) != 0) {
printf("%s: fatal: cond_wait fails\n", __FUNCTION__);
exit(1);
}
}
void signal_dl_buffer(shared_buffers *s, int subframe)
{
if (pthread_cond_broadcast(&s->c_dl[subframe]) != 0) {
printf("%s: fatal: cond_broadcast fails\n", __FUNCTION__);
exit(1);
}
}
void lock_ul_buffer(shared_buffers *s, int subframe)
{
if (pthread_mutex_lock(&s->m_ul[subframe]) != 0) {
printf("%s: fatal: lock fails\n", __FUNCTION__);
exit(1);
}
}
void unlock_ul_buffer(shared_buffers *s, int subframe)
{
if (pthread_mutex_unlock(&s->m_ul[subframe]) != 0) {
printf("%s: fatal: unlock fails\n", __FUNCTION__);
exit(1);
}
}
void wait_ul_buffer(shared_buffers *s, int subframe)
{
if (pthread_cond_wait(&s->c_ul[subframe], &s->m_ul[subframe]) != 0) {
printf("%s: fatal: cond_wait fails\n", __FUNCTION__);
exit(1);
}
}
void signal_ul_buffer(shared_buffers *s, int subframe)
{
if (pthread_cond_broadcast(&s->c_ul[subframe]) != 0) {
printf("%s: fatal: cond_broadcast fails\n", __FUNCTION__);
exit(1);
}
}
......@@ -25,6 +25,7 @@
#include <pthread.h>
#include <stdint.h>
#if 0
typedef struct {
unsigned char dl[10][14*1200*4];
unsigned char ul[10][14*1200*4];
......@@ -48,4 +49,76 @@ void unlock_buffers(shared_buffers *s, int subframe);
void wait_buffers(shared_buffers *s, int subframe);
void signal_buffers(shared_buffers *s, int subframe);
typedef struct {
/* [2] is for two antennas */
unsigned char dl[2][10][14*1200*4];
unsigned char ul[2][10][14*1200*4];
uint16_t dl_busy[2][10];
uint16_t ul_busy[2][10];
pthread_mutex_t m_ul[10];
pthread_cond_t c_ul[10];
pthread_mutex_t m_dl[10];
pthread_cond_t c_dl[10];
unsigned char prach[10][849*4];
unsigned char prach_busy[10];
/* statistics/error counting */
int ul_overflow;
int dl_underflow;
} shared_buffers;
void init_buffers(shared_buffers *s);
void lock_dl_buffer(shared_buffers *s, int subframe);
void unlock_dl_buffer(shared_buffers *s, int subframe);
void wait_dl_buffer(shared_buffers *s, int subframe);
void signal_dl_buffer(shared_buffers *s, int subframe);
void lock_ul_buffer(shared_buffers *s, int subframe);
void unlock_ul_buffer(shared_buffers *s, int subframe);
void wait_ul_buffer(shared_buffers *s, int subframe);
void signal_ul_buffer(shared_buffers *s, int subframe);
#endif
typedef struct {
/* [2] is for two antennas */
unsigned char dl[2][10][14*1200*4];
unsigned char ul[2][10][14*1200*4];
uint16_t dl_busy[2][10];
uint16_t ul_busy[2][10];
pthread_mutex_t m_ul[10];
pthread_cond_t c_ul[10];
pthread_mutex_t m_dl[10];
pthread_cond_t c_dl[10];
unsigned char prach[10][849*4];
unsigned char prach_busy[10];
/* statistics/error counting */
int ul_overflow;
int dl_underflow;
} shared_buffers;
void init_buffers(shared_buffers *s);
void lock_dl_buffer(shared_buffers *s, int subframe);
void unlock_dl_buffer(shared_buffers *s, int subframe);
void wait_dl_buffer(shared_buffers *s, int subframe);
void signal_dl_buffer(shared_buffers *s, int subframe);
void lock_ul_buffer(shared_buffers *s, int subframe);
void unlock_ul_buffer(shared_buffers *s, int subframe);
void wait_ul_buffer(shared_buffers *s, int subframe);
void signal_ul_buffer(shared_buffers *s, int subframe);
#endif /* _SHARED_BUFFERS_H_ */
This diff is collapsed.
......@@ -176,7 +176,7 @@ eNBs =
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.18.99";
mme_ip_address = ( { ipv4 = "192.168.12.31";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
......@@ -194,10 +194,10 @@ eNBs =
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.18.196";
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.18.196";
ENB_INTERFACE_NAME_FOR_S1_MME = "enp0s20f0u2";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.22";
ENB_INTERFACE_NAME_FOR_S1U = "enp0s20f0u2";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.22";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
ENB_IPV4_ADDRESS_FOR_X2C = "127.0.0.1";
ENB_PORT_FOR_X2C = 36422; # Spec 36422
......
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