Commit e0f00720 authored by knopp's avatar knopp

oaisim with interfaces for lte-ue/lte-enb threading compiles and runs.

parent b1e633bb
......@@ -59,6 +59,7 @@
#include "sctp_default_values.h"
#include "SystemInformationBlockType2.h"
#include "LAYER2/MAC/extern.h"
#include "PHY/extern.h"
#define ENB_CONFIG_STRING_ACTIVE_ENBS "Active_eNBs"
......@@ -321,8 +322,8 @@ void enb_config_display(void)
for (j=0; j< enb_properties.properties[i]->nb_cc; j++) {
// CC_ID node function/timing
printf( "\n\tnode_function for CC %d: \t%d:\n",j,enb_properties.properties[i]->cc_node_function[j]);
printf( "\tnode_timing for CC %d: \t%d:\n",j,enb_properties.properties[i]->cc_node_timing[j]);
printf( "\n\tnode_function for CC %d: \t%s:\n",j,eNB_functions[enb_properties.properties[i]->cc_node_function[j]]);
printf( "\tnode_timing for CC %d: \t%s:\n",j,eNB_timing[enb_properties.properties[i]->cc_node_timing[j]]);
printf( "\tnode_synch_ref for CC %d: \t%d:\n",j,enb_properties.properties[i]->cc_node_synch_ref[j]);
printf( "\teutra band for CC %d: \t%"PRId16":\n",j,enb_properties.properties[i]->eutra_band[j]);
......
......@@ -44,6 +44,7 @@
#ifndef __OCG_H__
#define __OCG_H__
#include "PHY/defs.h"
#include "PHY/impl_defs_top.h"
#include "platform_types.h"
......@@ -707,8 +708,8 @@ typedef struct {
// phy related params
unsigned int n_frames;
unsigned int n_frames_flag; // if set, then let the emulation goes to infinity
node_function_t node_function[MAX_NUM_CCs];
node_timing_t node_timing[MAX_NUM_CCS];
eNB_func_t node_function[MAX_NUM_CCs];
eNB_timing_t node_timing[MAX_NUM_CCs];
unsigned char frame_type[MAX_NUM_CCs]; //! LTE frame type (TDD=1, FDD=0). \note this should be converted to \ref lte_frame_type_t (header file reorganization needed)
char * frame_type_name[MAX_NUM_CCs];
unsigned char tdd_config[MAX_NUM_CCs];
......
......@@ -248,6 +248,9 @@ typedef struct {
struct openair0_device_t {
/*!brief Module ID of this device */
int Mod_id;
/*!brief Component Carrier ID of this device */
int CC_id;
/*!brief Type of this device */
dev_type_t type;
......
......@@ -24,7 +24,8 @@ eNBs =
component_carriers = (
{
node_function = "eNodeB_3GPP";
node_timing = "SYNCH_TO_OTHER";
node_timing = "synch_to_other";
node_synch_ref = 0;
frame_type = "FDD";
tdd_config = 3;
tdd_config_s = 0;
......@@ -37,8 +38,8 @@ eNBs =
Nid_cell_mbsfn = 0;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 25;
rx_gain = 20;
tx_gain = 25;
rx_gain = 20;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
......
This diff is collapsed.
......@@ -119,8 +119,8 @@ unsigned short config_frames[4] = {2,9,11,13};
// In lte-enb.c
extern int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_cfg, openair0_rf_map rf_map[MAX_NUM_CCs]);
extern void init_eNB(eNB_func_t *, eNB_timing_t *);
extern void stop_eNB(void);
extern void init_eNB(eNB_func_t *, eNB_timing_t *,int);
extern void stop_eNB(int);
extern void kill_eNB_proc(void);
// In lte-ue.c
......@@ -1843,7 +1843,7 @@ int main( int argc, char **argv )
// start the main thread
if (UE_flag == 1) init_UE(1);
else init_eNB(node_function,node_timing);
else init_eNB(node_function,node_timing,1);
// Sleep to allow all threads to setup
sleep(3);
......@@ -1902,7 +1902,7 @@ int main( int argc, char **argv )
// cleanup
if (UE_flag == 1) {
} else {
stop_eNB();
stop_eNB(1);
}
......
This diff is collapsed.
......@@ -179,7 +179,6 @@ extern uint16_t Nid_cell;
extern LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
extern Enb_properties_array_t enb_properties;
//#ifdef XFORMS
......@@ -759,8 +758,9 @@ l2l1_task (void *args_p)
proc->frame_rx = frame;
proc->subframe_rx = sf;
proc->timestamp_rx += PHY_vars_eNB_g[eNB_inst][CC_id]->frame_parms.samples_per_tti;
pthread_mutex_unlock( &proc->mutex_FH );
if (proc->instance_cnt_FH == 0) {
if (cnt_FH == 0) {
if (pthread_cond_signal(&proc->cond_FH) != 0) {
LOG_E(PHY,"ERROR pthread_cond_signal for eNB FH CCid %d\n",proc->CC_id);
exit_fun("ERROR pthread_cond_signal");
......
......@@ -50,11 +50,13 @@ eNB_MAC_INST* get_eNB_mac_inst(module_id_t module_idP);
OAI_Emulation* get_OAI_emulation(void);
void init_channel_vars(LTE_DL_FRAME_PARMS *frame_parms, double ***s_re,double ***s_im,double ***r_re,double ***r_im,double ***r_re0,double ***r_im0);
void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double **s_re,double **s_im,channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_NUM_CCs],
node_desc_t *enb_data[NUMBER_OF_eNB_MAX],node_desc_t *ue_data[NUMBER_OF_UE_MAX],uint16_t next_slot,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms, uint32_t,uint8_t);
void do_UL_sig(channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_NUM_CCs],
node_desc_t *enb_data[NUMBER_OF_eNB_MAX],node_desc_t *ue_data[NUMBER_OF_UE_MAX],
uint16_t subframe,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms,
uint32_t frame,int eNB_id,uint8_t CC_id);
void do_DL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double **s_re,double **s_im,channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs],
node_desc_t *enb_data[NUMBER_OF_eNB_MAX],node_desc_t *ue_data[NUMBER_OF_UE_MAX],uint16_t next_slot,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms,uint8_t UE_id,int CC_id);
void do_DL_sig(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs],
node_desc_t *enb_data[NUMBER_OF_eNB_MAX],node_desc_t *ue_data[NUMBER_OF_UE_MAX],uint16_t subframe,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms,uint8_t UE_id,int CC_id);
void init_ue(node_desc_t *ue_data, UE_Antenna ue_ant);//Abstraction changes
void init_enb(node_desc_t *enb_data, eNB_Antenna enb_ant);//Abstraction changes
......
......@@ -173,6 +173,12 @@ extern time_stats_t ul_chan_stats;
extern int xforms;
extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst);
void stop_eNB(int nb_inst);
void get_simulation_options(int argc, char *argv[])
{
int option;
......@@ -774,11 +780,15 @@ void get_simulation_options(int argc, char *argv[])
conf_config_file_name, oai_emulation.info.nb_enb_local, enb_properties->number);
/* Update some simulation parameters */
oai_emulation.info.frame_type[0] = enb_properties->properties[0]->frame_type[0];
oai_emulation.info.tdd_config[0] = enb_properties->properties[0]->tdd_config[0];
oai_emulation.info.tdd_config_S[0] = enb_properties->properties[0]->tdd_config_s[0];
oai_emulation.info.frame_type[0] = enb_properties->properties[0]->frame_type[0];
oai_emulation.info.tdd_config[0] = enb_properties->properties[0]->tdd_config[0];
oai_emulation.info.tdd_config_S[0] = enb_properties->properties[0]->tdd_config_s[0];
oai_emulation.info.extended_prefix_flag[0] = enb_properties->properties[0]->prefix_type[0];
oai_emulation.info.node_function[0] = enb_properties->properties[0]->cc_node_function[0];
oai_emulation.info.node_timing[0] = enb_properties->properties[0]->cc_node_timing[0];
downlink_frequency[0][0] = enb_properties->properties[0]->downlink_frequency[0];
uplink_frequency_offset[0][0] = enb_properties->properties[0]->uplink_frequency_offset[0];
}
free(conf_config_file_name);
......@@ -939,6 +949,119 @@ void init_seed(uint8_t set_seed)
}
}
int eNB_trx_start(openair0_device *device) {
return(0);
}
void eNB_trx_end(openair0_device *device) {
return;
}
int eNB_trx_stop(openair0_device *device) {
return(0);
}
int UE_trx_start(openair0_device *device) {
return(0);
}
int UE_trx_end(openair0_device *device) {
return(0);
}
int UE_trx_stop(openair0_device *device) {
return(0);
}
int eNB_trx_set_freq(openair0_device *device, openair0_config_t *openair0_cfg, int dummy) {
return(0);
}
int eNB_trx_set_gains(openair0_device *device, openair0_config_t *openair0_cfg) {
return(0);
}
int UE_trx_set_freq(openair0_device *device, openair0_config_t *openair0_cfg, int dummy) {
return(0);
}
int UE_trx_set_gains(openair0_device *device, openair0_config_t *openair0_cfg) {
return(0);
}
int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
return(0);
}
int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
return(0);
}
int eNB_trx_write(openair0_device *device,openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
int eNB_id = device->Mod_id;
int CC_id = device->CC_id;
int UE_id;
int subframe = (timestamp/PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti)%10;
for (UE_id=0;UE_id<=NB_UE_INST;UE_id++) {
do_DL_sig(eNB2UE,
enb_data,
ue_data,
subframe,
0, //abstraction_flag,
&PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms,
UE_id,
CC_id);
}
return(0);
}
int UE_trx_write(openair0_device *device,openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
int UE_id = device->Mod_id;
int CC_id = device->CC_id;
int eNB_id;
int subframe = (timestamp/PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti)%10;
for (eNB_id=0;eNB_id<=NB_eNB_INST;eNB_id++) {
do_UL_sig(UE2eNB,
enb_data,
ue_data,
subframe,
0, // abstraction_flag
&PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms,
0, // frame is only used for abstraction
eNB_id,
CC_id);
}
return(0);
}
void init_devices(void){
module_id_t UE_id, eNB_id;
uint8_t CC_id;
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++) {
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.Mod_id = eNB_id;
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.CC_id = CC_id;
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_start_func = eNB_trx_start;
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_read_func = eNB_trx_read;
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_write_func = eNB_trx_write;
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_end_func = eNB_trx_end;
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_stop_func = eNB_trx_stop;
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_set_freq_func = eNB_trx_set_freq;
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_set_gains_func = eNB_trx_set_gains;
}
for (UE_id=0;UE_id<NB_eNB_INST;UE_id++) {
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.Mod_id = UE_id;
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.CC_id = CC_id;
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_start_func = UE_trx_start;
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_read_func = UE_trx_read;
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_write_func = UE_trx_write;
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_end_func = UE_trx_end;
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_stop_func = UE_trx_stop;
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_set_freq_func = UE_trx_set_freq;
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_set_gains_func = UE_trx_set_gains;
}
}
}
void init_openair1(void)
{
module_id_t UE_id, eNB_id;
......@@ -1029,7 +1152,9 @@ void init_openair1(void)
}
}
init_eNB(eNodeB_3GPP,NB_eNB_INST);
init_devices ();
init_eNB(oai_emulation.info.node_function,oai_emulation.info.node_timing,NB_eNB_INST);
// init_ue_status();
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
......
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