Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangjie
OpenXG-RAN
Commits
8dd9cf3c
Commit
8dd9cf3c
authored
Jun 04, 2018
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
creation of simulation data structure. some cleanup and testing with multiple UEs
parent
c3c6284b
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
205 additions
and
365 deletions
+205
-365
cmake_targets/build_oai
cmake_targets/build_oai
+2
-138
openair1/SIMULATION/TOOLS/channel_sim.c
openair1/SIMULATION/TOOLS/channel_sim.c
+54
-68
openair1/SIMULATION/TOOLS/sim.h
openair1/SIMULATION/TOOLS/sim.h
+30
-3
openair2/LAYER2/MAC/rar_tools_ue.c
openair2/LAYER2/MAC/rar_tools_ue.c
+1
-1
targets/RT/USER/lte-softmodem.h
targets/RT/USER/lte-softmodem.h
+3
-1
targets/RT/USER/lte-ue.c
targets/RT/USER/lte-ue.c
+2
-10
targets/RT/USER/lte-uesoftmodem.c
targets/RT/USER/lte-uesoftmodem.c
+6
-2
targets/RT/USER/rfsim.c
targets/RT/USER/rfsim.c
+98
-141
targets/RT/USER/rfsim.h
targets/RT/USER/rfsim.h
+9
-1
No files found.
cmake_targets/build_oai
View file @
8dd9cf3c
...
...
@@ -111,8 +111,6 @@ Options
-t | --transport protocol
ETHERNET , None
Adds this trasport protocol support in compilation
--oaisim
Makes the oaisim simulator. Hardware will be defaulted to
\"
None
\"
.
--phy_simulators
Makes the unitary tests Layer 1 simulators
--core_simulators
...
...
@@ -124,12 +122,12 @@ Options
-V | --vcd
Adds a debgging facility to the binary files: GUI with major internal synchronization events
-x | --xforms
Adds a software oscilloscope feature to the produced binaries.
If oaisim, then enable PRINT_STATS.
Adds a software oscilloscope feature to the produced binaries.
--install-system-files
Install OpenArInterface required files in Linux system
(will ask root password)
--noS1
Compiles
oaisim or
lte-softmodem without S1 interface, using direct link to IP instead
Compiles lte-softmodem without S1 interface, using direct link to IP instead
--verbose-compile
Shows detailed compilation instructions in makefile
--cflags_processor
...
...
@@ -164,11 +162,8 @@ Options
Generates a basic [1 UE + 1 eNB + no channel] simulator.
See targets/ARCH/tcp_bridge/README.tcp_bridge_oai for documentation.
Usage (first build):
oaisim (eNB + UE): ./build_oai -I --oaisim -x --install-system-files
Eurecom EXMIMO + COTS UE : ./build_oai -I --eNB -x --install-system-files
NI/ETTUS B201 + COTS UE : ./build_oai -I --eNB -x --install-system-files -w USRP
Usage (Regular):
oaisim : ./build_oai --oaisim -x
Eurecom EXMIMO + OAI ENB : ./build_oai --eNB -x
NI/ETTUS B201 + OAI ENB : ./build_oai --eNB -x -w USRP"
}
...
...
@@ -250,10 +245,6 @@ function main() {
echo_info
"Setting transport protocol to:
$TP
"
fi
shift
2
;;
--oaisim
)
oaisim
=
1
echo_info
"Will compile oaisim and drivers nasmesh, ..."
shift
;;
--phy_simulators
)
SIMUS_PHY
=
1
echo_info
"Will compile dlsim, ulsim, ..."
...
...
@@ -490,16 +481,6 @@ function main() {
check_install_additional_tools
fi
if
[
"
$oaisim
"
=
"1"
]
;
then
#to be discussed
# there is no RF device transport protocol
HW
=
"None"
TP
=
"ETHERNET"
if
[
"
$XFORMS
"
==
"True"
]
;
then
PRINT_STATS
=
"True"
fi
fi
echo_info
"3. building the compilation directives ..."
...
...
@@ -689,123 +670,6 @@ function main() {
cp
$OPENAIR_DIR
/cmake_targets/tools/init_exmimo2
$dbin
fi
# oaisim compilation
###############
if
[
"
$oaisim
"
=
"1"
]
;
then
dconf
=
$OPENAIR_DIR
/targets/bin
if
[
"
$NOS1
"
=
"1"
]
;
then
oaisim_build_dir
=
oaisim_noS1_build_oai
oaisim_exec
=
oaisim_nos1
else
oaisim_build_dir
=
oaisim_build_oai
oaisim_exec
=
oaisim
fi
echo_info
"Compiling
$oaisim_exec
(
$oaisim_build_dir
)"
cmake_file
=
$DIR
/
$oaisim_build_dir
/CMakeLists.txt
cp
$DIR
/
$oaisim_build_dir
/CMakeLists.template
$cmake_file
echo
"set ( CMAKE_BUILD_TYPE
$CMAKE_BUILD_TYPE
)"
>>
$cmake_file
echo
"set ( CFLAGS_PROCESSOR_USER
\"
$CFLAGS_PROCESSOR_USER
\"
)"
>>
$cmake_file
echo
"set ( XFORMS
$XFORMS
)"
>>
$cmake_file
echo
"set ( PRINT_STATS
$PRINT_STATS
)"
>>
$cmake_file
echo
"set ( RRC_ASN1_VERSION
\"
${
REL
}
\"
)"
>>
$cmake_file
echo
"set ( ENABLE_VCD_FIFO
$VCD_TIMING
)"
>>
$cmake_file
echo
"set ( T_TRACER
$T_TRACER
)"
>>
$cmake_file
echo
"set ( UE_NAS_USE_TUN
$UE_NAS_USE_TUN
)"
>>
$cmake_file
echo
'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)'
>>
$cmake_file
[
"
$CLEAN
"
=
"1"
]
&&
rm
-rf
$DIR
/
$oaisim_build_dir
/build
mkdir
-p
$DIR
/
$oaisim_build_dir
/build
cd
$DIR
/
$oaisim_build_dir
/build
eval
$CMAKE_CMD
compilations
\
$oaisim_build_dir
$oaisim_exec
\
$oaisim_exec
$dbin
/
$oaisim_exec
.
$REL
compilations
\
$oaisim_build_dir
$config_libconfig_shlib
\
lib
$config_libconfig_shlib
.so
$dbin
/lib
$config_libconfig_shlib
.so
compilations
\
$oaisim_build_dir
coding
\
libcoding.so
$dbin
/libcoding.so
if
[
"
$NOS1
"
!=
"1"
]
;
then
[
"
$CLEAN
"
=
"1"
]
&&
rm
-rf
$DIR
/at_commands/build
echo_info
"Compiling at_nas_ue"
mkdir
-p
$DIR
/at_commands/build
cd
$DIR
/at_commands/build
eval
$CMAKE_CMD
compilations
\
at_commands at_nas_ue
\
at_nas_ue
$dbin
/at_nas_ue
# ue_ip driver compilation
echo_info
"Compiling UE specific part (ue_ip driver and usim tools)"
compilations
\
oaisim_build_oai ue_ip
\
CMakeFiles/ue_ip/ue_ip.ko
$dbin
/ue_ip.ko
[
"
$CLEAN
"
=
"1"
]
&&
rm
-rf
$DIR
/nas_sim_tools/build
mkdir
-p
$DIR
/nas_sim_tools/build
cd
$DIR
/nas_sim_tools/build
eval
$CMAKE_CMD
compilations
\
nas_sim_tools usim
\
usim
$dbin
/usim
compilations
\
nas_sim_tools nvram
\
nvram
$dbin
/nvram
compilations
\
nas_sim_tools conf2uedata
\
conf2uedata
$dbin
/conf2uedata
# generate USIM data
if
[
-f
$dbin
/conf2uedata
]
;
then
install_nas_tools
$conf_nvram_path
$gen_nvram_path
else
echo_warning
"not generated UE NAS files: binaries not found"
fi
else
compilations
\
$oaisim_build_dir
rb_tool
\
rb_tool
$dbin
/rb_tool
# nasmesh driver compilation
compilations
\
$oaisim_build_dir
nasmesh
\
CMakeFiles/nasmesh/nasmesh.ko
$dbin
/nasmesh.ko
#oai_nw_drv
#compilations \
# $oaisim_build_dir oai_nw_drv \
# CMakeFiles/oai_nw_drv/oai_nw_drv.ko $dbin/oai_nw_drv.ko
fi
if
[
"
$TP
"
==
"ETHERNET"
]
;
then
compilations
\
$oaisim_build_dir
oai_eth_transpro
\
liboai_eth_transpro.so
$dbin
/liboai_eth_transpro.so.
$REL
ln
-sf
liboai_eth_transpro.so liboai_transpro.so
ln
-sf
$dbin
/liboai_eth_transpro.so.
$REL
$dbin
/liboai_transpro.so
echo_info
"liboai_transpro.so is linked with ETHERNET library"
fi
cmake_file
=
$DIR
/oaisim_mme_build_oai/CMakeLists.txt
cp
$DIR
/oaisim_mme_build_oai/CMakeLists.template
$cmake_file
echo
"set ( CMAKE_BUILD_TYPE
$CMAKE_BUILD_TYPE
)"
>>
$cmake_file
echo
"set ( XFORMS
$XFORMS
)"
>>
$cmake_file
echo
"set ( RRC_ASN1_VERSION
\"
${
REL
}
\"
)"
>>
$cmake_file
echo
"set ( ENABLE_VCD_FIFO
$VCD_TIMING
)"
>>
$cmake_file
echo
"set ( T_TRACER
$T_TRACER
)"
>>
$cmake_file
echo
'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)'
>>
$cmake_file
#[ "$CLEAN" = "1" ] && rm -rf $DIR/oaisim_mme_build_oai/build
#mkdir -p $DIR/oaisim_mme_build_oai/build
#cd $DIR/oaisim_mme_build_oai/build
#eval $CMAKE_CMD
#compilations \
# oaisim_mme_build_oai oaisim_mme \
# oaisim_mme $dbin/oaisim_mme.$REL
fi
# Telnet server compilation
#####################
...
...
openair1/SIMULATION/TOOLS/channel_sim.c
View file @
8dd9cf3c
This diff is collapsed.
Click to expand it.
openair1/SIMULATION/TOOLS/sim.h
View file @
8dd9cf3c
...
...
@@ -22,7 +22,7 @@
#ifndef __SIMULATION_TOOLS_DEFS_H__
#define __SIMULATION_TOOLS_DEFS_H__
#include "PHY/defs_common.h"
#include <pthread.h>
/** @defgroup _numerical_ Useful Numerical Functions
*@{
The present clause specifies several numerical functions for testing of digital communication systems.
...
...
@@ -181,6 +181,31 @@ typedef enum {
EPA_high
,
}
SCM_t
;
#include "platform_constants.h"
typedef
struct
{
channel_desc_t
*
RU2UE
[
NUMBER_OF_RU_MAX
][
NUMBER_OF_UE_MAX
][
MAX_NUM_CCs
];
channel_desc_t
*
UE2RU
[
NUMBER_OF_UE_MAX
][
NUMBER_OF_RU_MAX
][
MAX_NUM_CCs
];
double
r_re_DL
[
NUMBER_OF_UE_MAX
][
2
][
30720
];
double
r_im_DL
[
NUMBER_OF_UE_MAX
][
2
][
30720
];
double
r_re_UL
[
NUMBER_OF_eNB_MAX
][
2
][
30720
];
double
r_im_UL
[
NUMBER_OF_eNB_MAX
][
2
][
30720
];
int
RU_output_mask
[
NUMBER_OF_UE_MAX
];
int
UE_output_mask
[
NUMBER_OF_RU_MAX
];
pthread_mutex_t
RU_output_mutex
[
NUMBER_OF_UE_MAX
];
pthread_mutex_t
UE_output_mutex
[
NUMBER_OF_RU_MAX
];
pthread_mutex_t
subframe_mutex
;
int
subframe_ru_mask
;
int
subframe_UE_mask
;
openair0_timestamp
current_ru_rx_timestamp
[
NUMBER_OF_RU_MAX
][
MAX_NUM_CCs
];
openair0_timestamp
current_UE_rx_timestamp
[
MAX_MOBILES_PER_ENB
][
MAX_NUM_CCs
];
openair0_timestamp
last_ru_rx_timestamp
[
NUMBER_OF_RU_MAX
][
MAX_NUM_CCs
];
openair0_timestamp
last_UE_rx_timestamp
[
MAX_MOBILES_PER_ENB
][
MAX_NUM_CCs
];
double
ru_amp
[
NUMBER_OF_RU_MAX
];
pthread_t
rfsim_thread
;
}
sim_t
;
/**
\brief This routine initializes a new channel descriptor
\param nb_tx Number of TX antennas
...
...
@@ -373,7 +398,9 @@ void multipath_tv_channel(channel_desc_t *desc,
double
N_RB2sampling_rate
(
uint16_t
N_RB
);
double
N_RB2channel_bandwidth
(
uint16_t
N_RB
);
void
do_DL_sig
(
channel_desc_t
*
RU2UE
[
NUMBER_OF_RU_MAX
][
NUMBER_OF_UE_MAX
][
MAX_NUM_CCs
],
#include "targets/RT/USER/rfsim.h"
void
do_DL_sig
(
sim_t
*
sim
,
uint16_t
subframe
,
uint32_t
offset
,
uint32_t
length
,
...
...
@@ -381,7 +408,7 @@ void do_DL_sig(channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM
uint8_t
UE_id
,
int
CC_id
);
void
do_UL_sig
(
channel_desc_t
*
UE2RU
[
NUMBER_OF_UE_MAX
][
NUMBER_OF_RU_MAX
][
MAX_NUM_CCs
]
,
void
do_UL_sig
(
sim_t
*
sim
,
uint16_t
subframe
,
uint8_t
abstraction_flag
,
LTE_DL_FRAME_PARMS
*
frame_parms
,
uint32_t
frame
,
int
ru_id
,
uint8_t
CC_id
);
...
...
openair2/LAYER2/MAC/rar_tools_ue.c
View file @
8dd9cf3c
...
...
@@ -93,7 +93,7 @@ uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const fra
}
LOG_I
(
MAC
,
"[
eNB
%d][RAPROC] Frame %d Received RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for preamble %d/%d
\n
"
,
"[
UE
%d][RAPROC] Frame %d Received RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for preamble %d/%d
\n
"
,
module_idP
,
frameP
,
*
(
uint8_t
*
)
rarh
,
rar
[
0
],
rar
[
1
],
rar
[
2
],
rar
[
3
],
rar
[
4
],
rar
[
5
],
rarh
->
RAPID
,
preamble_index
);
#ifdef DEBUG_RAR
...
...
targets/RT/USER/lte-softmodem.h
View file @
8dd9cf3c
...
...
@@ -53,6 +53,7 @@
#define CONFIG_HLP_CALPRACH "UE run normal prach with maximum power, but don't continue random-access\n"
#define CONFIG_HLP_NOL2CN "bypass L2 and upper layers\n"
#define CONFIG_HLP_SIML1 "activate RF simulator instead of HW\n"
#define CONFIG_HLP_NUMUE "number of UE instances\n"
#define CONFIG_HLP_UERXG "set UE RX gain\n"
#define CONFIG_HLP_UERXGOFF "external UE amplifier offset\n"
#define CONFIG_HLP_UETXG "set UE TX gain\n"
...
...
@@ -134,6 +135,7 @@
/*--------------------------------------------------------------------------------------------------------------------------------------------------*/
#define CMDLINE_UEPARAMS_DESC { \
{"siml1", CONFIG_HLP_SIML1, PARAMFLAG_BOOL, iptr:&simL1flag, defintval:0, TYPE_INT, 0}, \
{"U", CONFIG_HLP_NUMUE, 0, u8ptr:&NB_UE_INST, defuintval:1, TYPE_UINT, 0}, \
{"ue-rxgain", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:130, TYPE_DOUBLE, 0}, \
{"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, dblptr:&rx_gain_off, defdblval:0, TYPE_DOUBLE, 0}, \
{"ue-txgain", CONFIG_HLP_UETXG, 0, dblptr:&(tx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \
...
...
@@ -290,7 +292,7 @@ extern void kill_te_thread(PHY_VARS_eNB *);
extern
void
RCConfig_sim
(
void
);
extern
void
init_ocm
(
double
,
double
);
extern
void
init_ue_devices
(
void
);
extern
void
init_ue_devices
(
PHY_VARS_UE
*
);
PHY_VARS_UE
*
init_ue_vars
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
uint8_t
UE_id
,
...
...
targets/RT/USER/lte-ue.c
View file @
8dd9cf3c
...
...
@@ -254,7 +254,7 @@ void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correcti
for
(
inst
=
0
;
inst
<
nb_inst
;
inst
++
)
{
if
(
PHY_vars_UE_g
[
inst
]
==
NULL
)
PHY_vars_UE_g
[
inst
]
=
(
PHY_VARS_UE
**
)
calloc
(
1
+
MAX_NUM_CCs
,
sizeof
(
PHY_VARS_UE
*
));
LOG_I
(
PHY
,
"Allocating UE context %d
\n
"
,
inst
);
if
(
simL1flag
==
0
)
PHY_vars_UE_g
[
inst
][
0
]
=
init_ue_vars
(
NULL
,
inst
,
0
);
else
{
...
...
@@ -307,7 +307,7 @@ void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correcti
UE
->
frame_parms
.
nb_antennas_tx
=
nb_tx
;
UE
->
frame_parms
.
nb_antennas_rx
=
nb_rx
;
if
(
simL1flag
==
1
)
init_ue_devices
();
if
(
simL1flag
==
1
)
init_ue_devices
(
UE
);
LOG_I
(
PHY
,
"Intializing UE Threads for instance %d (%p,%p)...
\n
"
,
inst
,
PHY_vars_UE_g
[
inst
],
PHY_vars_UE_g
[
inst
][
0
]);
init_UE_threads
(
inst
);
...
...
@@ -327,14 +327,6 @@ void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correcti
}
printf
(
"UE threads created by %ld
\n
"
,
gettid
());
#if 0
#if defined(ENABLE_USE_MME)
extern volatile int start_UE;
while (start_UE == 0) {
sleep(1);
}
#endif
#endif
}
// Panos: Initiating all UEs within a single set of threads for PHY_STUB. Future extensions -> multiple
...
...
targets/RT/USER/lte-uesoftmodem.c
View file @
8dd9cf3c
...
...
@@ -817,7 +817,11 @@ int main( int argc, char **argv )
get_options
();
printf
(
"Running with %d UE instances
\n
"
,
NB_UE_INST
);
if
(
NB_UE_INST
>
1
&&
simL1flag
!=
1
)
{
printf
(
"Running with more than 1 UE instance and simL1 is not active, this will result in undefined behaviour for now, exiting.
\n
"
);
abort
();
}
printf
(
"NFAPI_MODE value: %d
\n
"
,
nfapi_mode
);
...
...
@@ -970,7 +974,7 @@ int main( int argc, char **argv )
init_UE_stub_single_thread
(
NB_UE_INST
,
eMBMS_active
,
uecap_xer_in
,
emul_iface
);
}
else
{
init_UE
(
1
,
eMBMS_active
,
uecap_xer_in
,
0
,
phy_test
,
UE_scan
,
UE_scan_carrier
,
mode
,(
int
)
rx_gain
[
0
][
0
],
tx_max_power
[
0
],
init_UE
(
NB_UE_INST
,
eMBMS_active
,
uecap_xer_in
,
0
,
phy_test
,
UE_scan
,
UE_scan_carrier
,
mode
,(
int
)
rx_gain
[
0
][
0
],
tx_max_power
[
0
],
frame_parms
[
0
]
->
nb_antennas_rx
,
frame_parms
[
0
]
->
nb_antennas_tx
);
}
...
...
targets/RT/USER/rfsim.c
View file @
8dd9cf3c
This diff is collapsed.
Click to expand it.
targets/RT/USER/rfsim.h
View file @
8dd9cf3c
...
...
@@ -18,11 +18,19 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef __SIM__H__
#define __SIM__H__
#include "lte-softmodem.h"
#include "openair1/SIMULATION/TOOLS/sim.h"
#include "platform_constants.h"
#include "common/ran_context.h"
#include "PHY/defs_UE.h"
#include "PHY/defs_eNB.h"
void
init_ocm
(
double
snr_dB
,
double
sinr_dB
);
void
update_ocm
(
double
snr_dB
,
double
sinr_dB
);
void
init_channel_vars
(
void
);
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment