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
canghaiwuhen
OpenXG-RAN
Commits
a60c4f03
Commit
a60c4f03
authored
Dec 01, 2016
by
Xiwen JIANG
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using thread pool to parallize the precoding and ifft for each phy antenna in dlsim
parent
a2420288
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
155 additions
and
40 deletions
+155
-40
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+2
-2
openair1/PHY/INIT/lte_init.c
openair1/PHY/INIT/lte_init.c
+6
-2
openair1/PHY/MODULATION/beamforming.c
openair1/PHY/MODULATION/beamforming.c
+5
-5
openair1/PHY/MODULATION/defs.h
openair1/PHY/MODULATION/defs.h
+9
-1
openair1/PHY/MODULATION/ofdm_mod.c
openair1/PHY/MODULATION/ofdm_mod.c
+75
-10
openair1/PHY/defs.h
openair1/PHY/defs.h
+2
-0
openair1/SIMULATION/LTE_PHY/dlsim.c
openair1/SIMULATION/LTE_PHY/dlsim.c
+42
-10
targets/RT/USER/lte-enb.c
targets/RT/USER/lte-enb.c
+14
-10
No files found.
cmake_targets/CMakeLists.txt
View file @
a60c4f03
...
@@ -1025,6 +1025,7 @@ set(PHY_SRC
...
@@ -1025,6 +1025,7 @@ set(PHY_SRC
${
OPENAIR1_DIR
}
/PHY/TOOLS/sqrt.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/sqrt.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/time_meas.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/time_meas.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/lut.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/lut.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/thread_pool.c
)
)
if
(
${
SMBV
}
)
if
(
${
SMBV
}
)
set
(
PHY_SRC
"
${
PHY_SRC
}
${
OPENAIR1_DIR
}
/PHY/TOOLS/smbv.c"
)
set
(
PHY_SRC
"
${
PHY_SRC
}
${
OPENAIR1_DIR
}
/PHY/TOOLS/smbv.c"
)
...
@@ -1840,7 +1841,7 @@ target_link_libraries (oaisim_nos1 ${T_LIB})
...
@@ -1840,7 +1841,7 @@ target_link_libraries (oaisim_nos1 ${T_LIB})
# Unitary tests for each piece of L1: example, mbmssim is MBMS L1 simulator
# Unitary tests for each piece of L1: example, mbmssim is MBMS L1 simulator
#####################################
#####################################
foreach
(
myExe dlsim
dlsim_tm7
ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim
)
foreach
(
myExe dlsim ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim
)
add_executable
(
${
myExe
}
add_executable
(
${
myExe
}
${
OPENAIR_BIN_DIR
}
/messages_xml.h
${
OPENAIR_BIN_DIR
}
/messages_xml.h
${
OPENAIR1_DIR
}
/SIMULATION/LTE_PHY/
${
myExe
}
.c
${
OPENAIR1_DIR
}
/SIMULATION/LTE_PHY/
${
myExe
}
.c
...
@@ -1921,7 +1922,6 @@ if (${T_TRACER})
...
@@ -1921,7 +1922,6 @@ if (${T_TRACER})
add_dependencies
(
oaisim generate_T
)
add_dependencies
(
oaisim generate_T
)
add_dependencies
(
oaisim_nos1 generate_T
)
add_dependencies
(
oaisim_nos1 generate_T
)
add_dependencies
(
dlsim generate_T
)
add_dependencies
(
dlsim generate_T
)
add_dependencies
(
dlsim_tm7 generate_T
)
add_dependencies
(
ulsim generate_T
)
add_dependencies
(
ulsim generate_T
)
add_dependencies
(
pbchsim generate_T
)
add_dependencies
(
pbchsim generate_T
)
add_dependencies
(
scansim generate_T
)
add_dependencies
(
scansim generate_T
)
...
...
openair1/PHY/INIT/lte_init.c
View file @
a60c4f03
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
#include "defs.h"
#include "defs.h"
#include "SCHED/defs.h"
#include "SCHED/defs.h"
#include "PHY/extern.h"
#include "PHY/extern.h"
#include "PHY/TOOLS/thread_pool.h"
#include "PHY/MODULATION/defs.h"
#include "SIMULATION/TOOLS/defs.h"
#include "SIMULATION/TOOLS/defs.h"
#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
#include "RadioResourceConfigDedicated.h"
...
@@ -1308,8 +1310,10 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
...
@@ -1308,8 +1310,10 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
eNB
->
sinr_dB
=
(
double
*
)
malloc16_clear
(
fp
->
N_RB_DL
*
12
*
sizeof
(
double
)
);
eNB
->
sinr_dB
=
(
double
*
)
malloc16_clear
(
fp
->
N_RB_DL
*
12
*
sizeof
(
double
)
);
}
}
}
//eNB_id
}
//eNB_id
/* Create thread pool */
eNB
->
pool
=
new_thread_pool
(
do_OFDM_mod_thread
,
eNB
);
sleep
(
1
);
if
(
abstraction_flag
==
0
)
{
if
(
abstraction_flag
==
0
)
{
if
(
eNB
->
node_function
!=
NGFI_RRU_IF4p5
)
{
if
(
eNB
->
node_function
!=
NGFI_RRU_IF4p5
)
{
...
...
openair1/PHY/MODULATION/beamforming.c
View file @
a60c4f03
...
@@ -64,16 +64,16 @@ int beam_precoding(int32_t **txdataF,
...
@@ -64,16 +64,16 @@ int beam_precoding(int32_t **txdataF,
memset
(
txdataF_BF
[
aa
],
0
,
sizeof
(
int32_t
)
*
(
frame_parms
->
ofdm_symbol_size
));
memset
(
txdataF_BF
[
aa
],
0
,
sizeof
(
int32_t
)
*
(
frame_parms
->
ofdm_symbol_size
));
for
(
p
=
0
;
p
<
14
;
p
++
)
{
for
(
p
=
0
;
p
<
14
;
p
++
)
{
//if (p==0 || p==1 || p==
5 || p>
7)
//if (p==0 || p==1 || p==
4 || p==5 || p>=
7)
// mult_cpx_conj_vector((int16_t*)txdataF[p], (int16_t*)beam_weights[p][aa], (int16_t*)txdataF_BF[aa]
, frame_parms->ofdm_symbol_size, 15);
//multadd_cpx_vector((int16_t*)txdataF[p],(int16_t*)beam_weights[p][aa], (int16_t*)txdataF_BF[aa], 0
, frame_parms->ofdm_symbol_size, 15);
for
(
re
=
0
;
re
<
frame_parms
->
ofdm_symbol_size
;
re
++
)
{
for
(
re
=
0
;
re
<
frame_parms
->
ofdm_symbol_size
;
re
++
)
{
if
((
p
==
0
||
p
==
1
||
p
==
5
||
p
>=
7
)
&&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
]
!=
0
)
{
if
((
p
==
0
||
p
==
1
||
p
==
4
||
p
==
5
||
p
>=
7
)
&&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
]
!=
0
)
{
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
0
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
0
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
0
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
0
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
0
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
0
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
0
]
-=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
1
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
1
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
0
]
-=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
1
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
1
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
1
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
0
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
1
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
1
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
0
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
1
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
1
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
1
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
0
])
>>
15
);
((
int16_t
*
)
&
txdataF_BF
[
aa
][
re
])[
1
]
+=
(
int16_t
)((((
int16_t
*
)
&
txdataF
[
p
][
slot_offset_F
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
re
])[
1
]
*
((
int16_t
*
)
&
beam_weights
[
p
][
aa
][
re
])[
0
])
>>
15
);
/*
/*
printf("beamforming.c:txdataF[%d][%d]=%d+j%d, beam_weights[%d][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n",
printf("beamforming.c:txdataF[%d][%d]=%d+j%d, beam_weights[%d][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n",
p,slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re,
p,slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re,
((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0],
((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0],
...
@@ -83,7 +83,7 @@ int beam_precoding(int32_t **txdataF,
...
@@ -83,7 +83,7 @@ int beam_precoding(int32_t **txdataF,
aa,re,
aa,re,
((int16_t*)&txdataF_BF[aa][re])[0],
((int16_t*)&txdataF_BF[aa][re])[0],
((int16_t*)&txdataF_BF[aa][re])[1]);
((int16_t*)&txdataF_BF[aa][re])[1]);
*/
*/
}
}
}
}
}
}
...
...
openair1/PHY/MODULATION/defs.h
View file @
a60c4f03
...
@@ -46,6 +46,14 @@ void PHY_ofdm_mod(int *input,
...
@@ -46,6 +46,14 @@ void PHY_ofdm_mod(int *input,
Extension_t
etype
Extension_t
etype
);
);
/**
\brief This function is a thread performing beamforming precoding and
ifft for each physical antenna
@param eNB The eNB context
*/
void
*
do_OFDM_mod_thread
(
PHY_VARS_eNB
*
eNB
);
#ifdef OPENAIR_LTE
#ifdef OPENAIR_LTE
/*!
/*!
...
@@ -82,7 +90,7 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
...
@@ -82,7 +90,7 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
void
do_OFDM_mod
(
int32_t
**
txdataF
,
int32_t
**
txdata
,
uint32_t
frame
,
uint16_t
next_slot
,
LTE_DL_FRAME_PARMS
*
frame_parms
);
void
do_OFDM_mod
(
int32_t
**
txdataF
,
int32_t
**
txdata
,
uint32_t
frame
,
uint16_t
next_slot
,
LTE_DL_FRAME_PARMS
*
frame_parms
);
void
do_OFDM_mod_symbol
(
LTE_eNB_COMMON
*
eNB_common_vars
,
int
eNB_id
,
uint16_t
next_slot
,
LTE_DL_FRAME_PARMS
*
frame_parms
);
void
do_OFDM_mod_symbol
(
LTE_eNB_COMMON
*
eNB_common_vars
,
int
eNB_id
,
uint16_t
next_slot
,
LTE_DL_FRAME_PARMS
*
frame_parms
,
int
antenna
);
void
remove_7_5_kHz
(
PHY_VARS_eNB
*
phy_vars_eNB
,
uint8_t
subframe
);
void
remove_7_5_kHz
(
PHY_VARS_eNB
*
phy_vars_eNB
,
uint8_t
subframe
);
...
...
openair1/PHY/MODULATION/ofdm_mod.c
View file @
a60c4f03
...
@@ -29,9 +29,11 @@ This section deals with basic functions for OFDM Modulation.
...
@@ -29,9 +29,11 @@ This section deals with basic functions for OFDM Modulation.
*/
*/
#include <sys/syscall.h>
#include "PHY/defs.h"
#include "PHY/defs.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "PHY/TOOLS/thread_pool.h"
//static short temp2[2048*4] __attribute__((aligned(16)));
//static short temp2[2048*4] __attribute__((aligned(16)));
...
@@ -285,7 +287,7 @@ void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t ne
...
@@ -285,7 +287,7 @@ void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t ne
}
}
// OFDM modulation for each symbol
// OFDM modulation for each symbol
void
do_OFDM_mod_symbol
(
LTE_eNB_COMMON
*
eNB_common_vars
,
int
eNB_id
,
uint16_t
next_slot
,
LTE_DL_FRAME_PARMS
*
frame_parms
)
void
do_OFDM_mod_symbol
(
LTE_eNB_COMMON
*
eNB_common_vars
,
int
eNB_id
,
uint16_t
next_slot
,
LTE_DL_FRAME_PARMS
*
frame_parms
,
int
antenna
)
{
{
int
aa
,
l
,
slot_offset
;
int
aa
,
l
,
slot_offset
;
...
@@ -293,19 +295,80 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
...
@@ -293,19 +295,80 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
int32_t
**
txdataF_BF
=
eNB_common_vars
->
txdataF_BF
[
eNB_id
];
int32_t
**
txdataF_BF
=
eNB_common_vars
->
txdataF_BF
[
eNB_id
];
int32_t
**
txdata
=
eNB_common_vars
->
txdata
[
eNB_id
];
int32_t
**
txdata
=
eNB_common_vars
->
txdata
[
eNB_id
];
aa
=
antenna
;
slot_offset
=
(
next_slot
)
*
(
frame_parms
->
samples_per_tti
>>
1
);
slot_offset
=
(
next_slot
)
*
(
frame_parms
->
samples_per_tti
>>
1
);
//printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc());
//printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc());
for
(
l
=
0
;
l
<
frame_parms
->
symbols_per_tti
>>
1
;
l
++
)
{
for
(
l
=
0
;
l
<
frame_parms
->
symbols_per_tti
>>
1
;
l
++
)
{
//printf("do_OFDM_mod_l, slot=%d, l=%d, NUMBER_OF_OFDM_CARRIERS=%d,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES=%d\n",next_slot, l,NUMBER_OF_OFDM_CARRIERS,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING
,
1
);
beam_precoding
(
txdataF
,
txdataF_BF
,
frame_parms
,
eNB_common_vars
->
beam_weights
[
eNB_id
],
next_slot
,
l
,
aa
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING
,
0
);
//PMCH case not implemented...
if
(
frame_parms
->
Ncp
==
1
)
PHY_ofdm_mod
(
txdataF_BF
[
aa
],
// input
&
txdata
[
aa
][
slot_offset
+
l
*
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES
],
// output
frame_parms
->
ofdm_symbol_size
,
1
,
// number of symbols
frame_parms
->
nb_prefix_samples
,
// number of prefix samples
CYCLIC_PREFIX
);
else
{
if
(
l
==
0
)
{
PHY_ofdm_mod
(
txdataF_BF
[
aa
],
// input
&
txdata
[
aa
][
slot_offset
],
// output
frame_parms
->
ofdm_symbol_size
,
1
,
// number of symbols
frame_parms
->
nb_prefix_samples0
,
// number of prefix samples
CYCLIC_PREFIX
);
}
else
{
PHY_ofdm_mod
(
txdataF_BF
[
aa
],
// input
&
txdata
[
aa
][
slot_offset
+
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0
+
(
l
-
1
)
*
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES
],
// output
frame_parms
->
ofdm_symbol_size
,
1
,
// number of symbols
frame_parms
->
nb_prefix_samples
,
// number of prefix samples
CYCLIC_PREFIX
);
/* printf("txdata[%d][%d]=%d\n",aa,slot_offset+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(l-1)*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,txdata[aa][slot_offset+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(l-1)*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES]);
* */
}
}
}
}
// OFDM modulation thread
void
*
do_OFDM_mod_thread
(
PHY_VARS_eNB
*
eNB
)
{
thread_pool
*
pool
=
eNB
->
pool
;
int
eNB_id
=
0
;
LTE_DL_FRAME_PARMS
*
frame_parms
=
&
eNB
->
frame_parms
;
int32_t
**
txdataF
=
eNB
->
common_vars
.
txdataF
[
eNB_id
];
int32_t
**
txdataF_BF
=
eNB
->
common_vars
.
txdataF_BF
[
eNB_id
];
int32_t
**
txdata
=
eNB
->
common_vars
.
txdata
[
eNB_id
];
int
aa
,
l
,
slot_offset
;
//printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc());
while
(
1
)
{
aa
=
thread_pool_wait
(
pool
);
slot_offset
=
(
pool
->
next_slot
)
*
(
frame_parms
->
samples_per_tti
>>
1
);
for
(
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_tx
;
aa
++
)
{
printf
(
"OFDM mod thread %ld starts processing antenna %d slot %d
\n
"
,
syscall
(
SYS_gettid
),
aa
,
pool
->
next_slot
);
for
(
l
=
0
;
l
<
frame_parms
->
symbols_per_tti
>>
1
;
l
++
)
{
//printf("do_OFDM_mod_l, slot=%d, l=%d, NUMBER_OF_OFDM_CARRIERS=%d,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES=%d\n",next_slot, l,NUMBER_OF_OFDM_CARRIERS,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING,1);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING
,
1
);
beam_precoding
(
txdataF
,
txdataF_BF
,
frame_parms
,
eNB
->
common_vars
.
beam_weights
[
eNB_id
],
pool
->
next_slot
,
l
,
aa
);
beam_precoding
(
txdataF
,
txdataF_BF
,
frame_parms
,
eNB_common_vars
->
beam_weights
[
eNB_id
],
next_slot
,
l
,
aa
);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING,0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING
,
0
);
//PMCH case not implemented...
//PMCH case not implemented...
if
(
frame_parms
->
Ncp
==
1
)
if
(
frame_parms
->
Ncp
==
1
)
PHY_ofdm_mod
(
txdataF_BF
[
aa
],
// input
PHY_ofdm_mod
(
txdataF_BF
[
aa
],
// input
...
@@ -331,11 +394,13 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
...
@@ -331,11 +394,13 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
frame_parms
->
nb_prefix_samples
,
// number of prefix samples
frame_parms
->
nb_prefix_samples
,
// number of prefix samples
CYCLIC_PREFIX
);
CYCLIC_PREFIX
);
/* printf("txdata[%d][%d]=%d\n",aa,slot_offset+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(l-1)*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,txdata[aa][slot_offset+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(l-1)*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES]);
* */
}
}
}
}
}
}
}
printf
(
"OFDM mod thread %ld finished processing antenna %d slot %d
\n
"
,
syscall
(
SYS_gettid
),
aa
,
pool
->
next_slot
);
/* signal end of computation to thread pool */
thread_pool_done
(
pool
);
}
}
}
openair1/PHY/defs.h
View file @
a60c4f03
...
@@ -122,6 +122,7 @@ static inline void* malloc16_clear( size_t size )
...
@@ -122,6 +122,7 @@ static inline void* malloc16_clear( size_t size )
#include "PHY/TOOLS/time_meas.h"
#include "PHY/TOOLS/time_meas.h"
#include "PHY/CODING/defs.h"
#include "PHY/CODING/defs.h"
#include "PHY/TOOLS/defs.h"
#include "PHY/TOOLS/defs.h"
#include "PHY/TOOLS/thread_pool.h"
#include "platform_types.h"
#include "platform_types.h"
#ifdef OPENAIR_LTE
#ifdef OPENAIR_LTE
...
@@ -411,6 +412,7 @@ typedef struct PHY_VARS_eNB_s {
...
@@ -411,6 +412,7 @@ typedef struct PHY_VARS_eNB_s {
eNB_func_t
node_function
;
eNB_func_t
node_function
;
eNB_timing_t
node_timing
;
eNB_timing_t
node_timing
;
int
single_thread_flag
;
int
single_thread_flag
;
thread_pool
*
pool
;
openair0_rf_map
rf_map
;
openair0_rf_map
rf_map
;
int
abstraction_flag
;
int
abstraction_flag
;
void
(
*
do_prach
)(
struct
PHY_VARS_eNB_s
*
eNB
);
void
(
*
do_prach
)(
struct
PHY_VARS_eNB_s
*
eNB
);
...
...
openair1/SIMULATION/LTE_PHY/dlsim.c
View file @
a60c4f03
...
@@ -53,6 +53,7 @@
...
@@ -53,6 +53,7 @@
#include "PHY/TOOLS/lte_phy_scope.h"
#include "PHY/TOOLS/lte_phy_scope.h"
#include "PHY/TOOLS/thread_pool.h"
PHY_VARS_eNB
*
eNB
;
PHY_VARS_eNB
*
eNB
;
PHY_VARS_UE
*
UE
;
PHY_VARS_UE
*
UE
;
...
@@ -1331,6 +1332,8 @@ int main(int argc, char **argv)
...
@@ -1331,6 +1332,8 @@ int main(int argc, char **argv)
//int len;
//int len;
uint8_t
num_rounds
=
4
;
//,fix_rounds=0;
uint8_t
num_rounds
=
4
;
//,fix_rounds=0;
int
thread_pool_active
=
0
;
int
u
;
int
u
;
int
n
=
0
;
int
n
=
0
;
int
abstx
=
0
;
int
abstx
=
0
;
...
@@ -1419,7 +1422,7 @@ int main(int argc, char **argv)
...
@@ -1419,7 +1422,7 @@ int main(int argc, char **argv)
// num_layers = 1;
// num_layers = 1;
perfect_ce
=
0
;
perfect_ce
=
0
;
while
((
c
=
getopt
(
argc
,
argv
,
"ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:q:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:Pl:WXY"
))
!=
-
1
)
{
while
((
c
=
getopt
(
argc
,
argv
,
"ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:q:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:Pl:WXY
U
"
))
!=
-
1
)
{
switch
(
c
)
{
switch
(
c
)
{
case
'a'
:
case
'a'
:
awgn_flag
=
1
;
awgn_flag
=
1
;
...
@@ -1486,6 +1489,7 @@ int main(int argc, char **argv)
...
@@ -1486,6 +1489,7 @@ int main(int argc, char **argv)
case
'W'
:
case
'W'
:
two_thread_flag
=
1
;
two_thread_flag
=
1
;
break
;
break
;
case
'l'
:
case
'l'
:
offset_mumimo_llr_drange_fix
=
atoi
(
optarg
);
offset_mumimo_llr_drange_fix
=
atoi
(
optarg
);
break
;
break
;
...
@@ -1627,6 +1631,10 @@ int main(int argc, char **argv)
...
@@ -1627,6 +1631,10 @@ int main(int argc, char **argv)
break
;
break
;
case
'U'
:
thread_pool_active
=
1
;
break
;
case
'v'
:
case
'v'
:
i_mod
=
atoi
(
optarg
);
i_mod
=
atoi
(
optarg
);
...
@@ -1745,6 +1753,7 @@ int main(int argc, char **argv)
...
@@ -1745,6 +1753,7 @@ int main(int argc, char **argv)
printf
(
"-O Set the percenatge of effective rate to testbench the modem performance (typically 30 and 70, range 1-100)
\n
"
);
printf
(
"-O Set the percenatge of effective rate to testbench the modem performance (typically 30 and 70, range 1-100)
\n
"
);
printf
(
"-I Input filename for TrCH data (binary)
\n
"
);
printf
(
"-I Input filename for TrCH data (binary)
\n
"
);
printf
(
"-u Enables the Interference Aware Receiver for TM5 (default is normal receiver)
\n
"
);
printf
(
"-u Enables the Interference Aware Receiver for TM5 (default is normal receiver)
\n
"
);
printf
(
"-U Enable thread pool for beam precoding and OFDM modulation
\n
"
);
exit
(
1
);
exit
(
1
);
break
;
break
;
}
}
...
@@ -2406,15 +2415,37 @@ int main(int argc, char **argv)
...
@@ -2406,15 +2415,37 @@ int main(int argc, char **argv)
&eNB->frame_parms);
&eNB->frame_parms);
*/
*/
do_OFDM_mod_symbol
(
&
eNB
->
common_vars
,
if
(
thread_pool_active
==
0
)
{
eNB_id
,
for
(
aa
=
0
;
aa
<
eNB
->
frame_parms
.
nb_antennas_tx
;
aa
++
)
{
(
subframe
*
2
),
do_OFDM_mod_symbol
(
&
eNB
->
common_vars
,
&
eNB
->
frame_parms
);
eNB_id
,
(
subframe
*
2
),
&
eNB
->
frame_parms
,
aa
);
do_OFDM_mod_symbol
(
&
eNB
->
common_vars
,
eNB_id
,
(
subframe
*
2
)
+
1
,
&
eNB
->
frame_parms
,
aa
);
}
}
else
{
eNB
->
pool
->
next_slot
=
2
*
subframe
;
//printf("dlsim:slot=%d\n", eNB->pool->next_slot);
while
(
eNB
->
pool
->
next_slot
<
subframe
*
2
+
2
)
{
/* start all threads */
thread_pool_start
(
eNB
->
pool
);
do_OFDM_mod_symbol
(
&
eNB
->
common_vars
,
///* wait all threads finishes */
eNB_id
,
thread_pool_join
(
eNB
->
pool
);
(
subframe
*
2
)
+
1
,
//usleep(1000*1000);
&
eNB
->
frame_parms
);
/* set next_slot */
eNB
->
pool
->
next_slot
++
;
//pool->next_slot %= 20;
}
}
stop_meas
(
&
eNB
->
ofdm_mod_stats
);
stop_meas
(
&
eNB
->
ofdm_mod_stats
);
...
@@ -2453,8 +2484,9 @@ int main(int argc, char **argv)
...
@@ -2453,8 +2484,9 @@ int main(int argc, char **argv)
write_output
(
"txsigF0.m"
,
"txsF0"
,
&
eNB
->
common_vars
.
txdataF
[
eNB_id
][
0
][
subframe
*
nsymb
*
eNB
->
frame_parms
.
ofdm_symbol_size
],
nsymb
*
eNB
->
frame_parms
.
ofdm_symbol_size
,
1
,
1
);
write_output
(
"txsigF0.m"
,
"txsF0"
,
&
eNB
->
common_vars
.
txdataF
[
eNB_id
][
0
][
subframe
*
nsymb
*
eNB
->
frame_parms
.
ofdm_symbol_size
],
nsymb
*
eNB
->
frame_parms
.
ofdm_symbol_size
,
1
,
1
);
}
else
if
(
transmission_mode
==
7
)
{
}
else
if
(
transmission_mode
==
7
)
{
write_output
(
"txsigF0.m"
,
"txsF0"
,
&
eNB
->
common_vars
.
txdataF
[
eNB_id
][
5
][
subframe
*
nsymb
*
eNB
->
frame_parms
.
ofdm_symbol_size
],
nsymb
*
eNB
->
frame_parms
.
ofdm_symbol_size
,
1
,
1
);
write_output
(
"txsigF0.m"
,
"txsF0"
,
&
eNB
->
common_vars
.
txdataF
[
eNB_id
][
5
][
subframe
*
nsymb
*
eNB
->
frame_parms
.
ofdm_symbol_size
],
nsymb
*
eNB
->
frame_parms
.
ofdm_symbol_size
,
1
,
1
);
write_output
(
"txsigF0_BF.m"
,
"txsF0_BF"
,
&
eNB
->
common_vars
.
txdataF_BF
[
eNB_id
][
0
][
0
],
eNB
->
frame_parms
.
ofdm_symbol_size
,
1
,
1
);
}
}
write_output
(
"txsigF0_BF.m"
,
"txsF0_BF"
,
&
eNB
->
common_vars
.
txdataF_BF
[
eNB_id
][
0
][
0
],
eNB
->
frame_parms
.
ofdm_symbol_size
,
1
,
1
);
}
}
}
}
...
...
targets/RT/USER/lte-enb.c
View file @
a60c4f03
...
@@ -295,17 +295,21 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
...
@@ -295,17 +295,21 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_OFDM_MODULATION
,
1
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_OFDM_MODULATION
,
1
);
do_OFDM_mod_symbol
(
&
phy_vars_eNB
->
common_vars
,
for
(
aa
=
0
;
aa
<
phy_vars_eNB
->
frame_parms
.
nb_antennas_tx
;
aa
++
)
{
0
,
subframe
<<
1
,
&
phy_vars_eNB
->
frame_parms
);
// if S-subframe generate first slot only
if
(
subframe_select
(
&
phy_vars_eNB
->
frame_parms
,
subframe
)
==
SF_DL
)
{
do_OFDM_mod_symbol
(
&
phy_vars_eNB
->
common_vars
,
do_OFDM_mod_symbol
(
&
phy_vars_eNB
->
common_vars
,
0
,
0
,
1
+
(
subframe
<<
1
),
subframe
<<
1
,
&
phy_vars_eNB
->
frame_parms
);
&
phy_vars_eNB
->
frame_parms
,
aa
);
// if S-subframe generate first slot only
if
(
subframe_select
(
&
phy_vars_eNB
->
frame_parms
,
subframe
)
==
SF_DL
)
{
do_OFDM_mod_symbol
(
&
phy_vars_eNB
->
common_vars
,
0
,
1
+
(
subframe
<<
1
),
&
phy_vars_eNB
->
frame_parms
,
aa
);
}
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_OFDM_MODULATION
,
0
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_OFDM_MODULATION
,
0
);
...
...
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