Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
nems
openairinterface5G
Commits
d9c721fb
Commit
d9c721fb
authored
Oct 29, 2018
by
Florian Kaltenberger
Browse files
Merge branch 'nr_pbchsim' into 'develop-nr'
Nr pbchsim See merge request
oai/openairinterface5g!431
parents
d85d0af2
915113ab
Changes
51
Hide whitespace changes
Inline
Side-by-side
ci-scripts/buildOnVM.sh
View file @
d9c721fb
...
...
@@ -148,7 +148,7 @@ case $key in
VM_NAME
=
ci-phy-sim
ARCHIVES_LOC
=
phy_sim
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
5
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--phy_simulators"
shift
;;
...
...
@@ -216,7 +216,7 @@ case $key in
VM_NAME
=
ci-phy-sim
ARCHIVES_LOC
=
phy_sim
LOG_PATTERN
=
.Rel15.txt
NB_PATTERN_FILES
=
5
NB_PATTERN_FILES
=
6
BUILD_OPTIONS
=
"--phy_simulators"
;;
cppcheck
)
...
...
ci-scripts/reportBuildLocally.sh
View file @
d9c721fb
...
...
@@ -529,13 +529,17 @@ summary_table_header "OAI Build Physical simulators option"
summary_table_row
"DL Simulator - Release 15"
./archives/phy_sim/dlsim.Rel15.txt
"Built target dlsim"
./phy_sim_row1.html
summary_table_row
"UL Simulator - Release 15"
./archives/phy_sim/ulsim.Rel15.txt
"Built target ulsim"
./phy_sim_row2.html
summary_table_row
"Coding - Release 15"
./archives/phy_sim/coding.Rel15.txt
"Built target coding"
./phy_sim_row3.html
if
[
-f
./archives/phy_sim/
./archives/phy_sim/ldpctest.Rel15.txt
]
if
[
-f
./archives/phy_sim/ldpctest.Rel15.txt
]
then
summary_table_row
"LDPC Test - Release 15"
./archives/phy_sim/ldpctest.Rel15.txt
"Built target
coding
"
./phy_sim_row4.html
summary_table_row
"LDPC Test - Release 15"
./archives/phy_sim/ldpctest.Rel15.txt
"Built target
ldpctest
"
./phy_sim_row4.html
fi
if
[
-f
./archives/phy_sim/
./archives/phy_sim/polartest.Rel15.txt
]
if
[
-f
./archives/phy_sim/polartest.Rel15.txt
]
then
summary_table_row
"Polar Test - Release 15"
./archives/phy_sim/polartest.Rel15.txt
"Built target coding"
./phy_sim_row5.html
summary_table_row
"Polar Test - Release 15"
./archives/phy_sim/polartest.Rel15.txt
"Built target polartest"
./phy_sim_row5.html
fi
if
[
-f
./archives/phy_sim/nr_pbchsim.Rel15.txt
]
then
summary_table_row
"PBCH Test - Release 15"
./archives/phy_sim/nr_pbchsim.Rel15.txt
"Built target nr_pbchsim"
./phy_sim_row6.html
fi
summary_table_footer
...
...
cmake_targets/CMakeLists.txt
View file @
d9c721fb
...
...
@@ -543,7 +543,9 @@ set (CONFIG_SOURCES
)
set
(
CONFIG_LIBCONFIG_SOURCES
${
CONFIG_ROOTDIR
}
/libconfig/config_libconfig.c
)
)
add_library
(
CONFIG_LIB
${
CONFIG_SOURCES
}
)
set
(
CONFIG_LIBRARIES CONFIG_LIB
)
add_library
(
params_libconfig MODULE
${
CONFIG_LIBCONFIG_SOURCES
}
)
target_link_libraries
(
params_libconfig config
)
# shared library loader
...
...
@@ -1294,7 +1296,7 @@ set(PHY_SRC_UE
${
OPENAIR1_DIR
}
/PHY/NR_REFSIG/nr_gold.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/file_output.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/cadd_vv.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/lte_dfts.c
#
${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/log2_approx.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/cmult_sv.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/cmult_vv.c
...
...
@@ -1330,9 +1332,10 @@ set(PHY_SRC_UE
${
OPENAIR1_DIR
}
/PHY/NR_REFSIG/nr_dmrs_rx.c
${
OPENAIR1_DIR
}
/PHY/NR_REFSIG/nr_gold_ue.c
${
OPENAIR1_DIR
}
/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
${
OPENAIR1_DIR
}
/PHY/LTE_ESTIMATION/lte_ue_measurements.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/file_output.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/cadd_vv.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/lte_dfts.c
#
${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/log2_approx.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/cmult_sv.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/cmult_vv.c
...
...
@@ -2441,7 +2444,7 @@ add_executable(nr-uesoftmodem
target_link_libraries
(
nr-uesoftmodem
-Wl,--start-group
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB PHY_COMMON
PHY_UE
PHY_NR_UE PHY_RU LFDS NR_L2_UE
#NR_LTE_UE_REUSE_LIB
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB PHY_COMMON PHY_NR_UE PHY_RU LFDS NR_L2_UE
#NR_LTE_UE_REUSE_LIB
${
MSC_LIB
}
${
RAL_LIB
}
${
NAS_UE_LIB
}
${
ITTI_LIB
}
${
FLPT_MSG_LIB
}
${
ASYNC_IF_LIB
}
LFDS7
${
ATLAS_LIBRARIES
}
-Wl,--end-group z dl
)
...
...
@@ -2527,10 +2530,14 @@ target_link_libraries (dlsim_tm4
)
add_executable
(
polartest
${
OPENAIR1_DIR
}
/PHY/CODING/TESTBENCH/polartest.c
)
target_link_libraries
(
polartest
m
SIMU PHY PHY_NR PHY_COMMON
-l
m
${
ATLAS_LIBRARIES
}
)
target_link_libraries
(
polartest SIMU PHY PHY_NR PHY_COMMON m
${
ATLAS_LIBRARIES
}
)
add_executable
(
ldpctest
${
OPENAIR1_DIR
}
/PHY/CODING/TESTBENCH/ldpctest.c
)
target_link_libraries
(
ldpctest m SIMU PHY PHY_NR
${
ATLAS_LIBRARIES
}
)
target_link_libraries
(
ldpctest SIMU PHY PHY_NR m
${
ATLAS_LIBRARIES
}
)
add_executable
(
nr_pbchsim
${
OPENAIR1_DIR
}
/SIMULATION/NR_PHY/pbchsim.c
)
target_link_libraries
(
nr_pbchsim -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB -Wl,--end-group m pthread
${
ATLAS_LIBRARIES
}
dl
)
foreach
(
myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim
)
...
...
cmake_targets/autotests/test_case_list.xml
View file @
d9c721fb
...
...
@@ -1041,7 +1041,25 @@
<search_expr_true>BLER= 0.000000</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
<nruns>3</nruns>
</testCase>
<testCase id="015104">
<class>execution</class>
<desc>nr_pbchsim test cases.</desc>
<pre_compile_prog></pre_compile_prog>
<compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
<compile_prog_args> --phy_simulators -c </compile_prog_args>
<pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
<pre_exec_args></pre_exec_args>
<main_exec> $OPENAIR_DIR/targets/bin/nr_pbchsim.Rel15</main_exec>
<main_exec_args>-s-11 -S-10 -n1000
-s-11 -S-10 -n10 -I</main_exec_args>
<tags>nr_pbchsim.test1</tags>
<search_expr_true>n_errors \(negative CRC\) = 0</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
<nruns>3</nruns>
</testCase>
<testCase id="015110">
<class>execution</class>
...
...
cmake_targets/build_oai
View file @
d9c721fb
...
...
@@ -671,7 +671,7 @@ function main() {
fi
if
[
"
$SIMUS_PHY
"
=
"1"
-o
"
$SIMUS_CORE
"
=
"1"
]
;
then
cd
$OPENAIR_DIR
/cmake_targets/
lte-
simulators
cd
$OPENAIR_DIR
/cmake_targets/
phy_
simulators
[
"
$CLEAN
"
=
"1"
]
&&
rm
-rf
build
mkdir
-p
build
cd
build
...
...
@@ -684,14 +684,14 @@ function main() {
echo_info
"Compiling unitary tests simulators"
# TODO: fix: dlsim_tm4 pucchsim prachsim pdcchsim pbchsim mbmssim
#simlist="dlsim_tm4 dlsim ulsim pucchsim prachsim pdcchsim pbchsim mbmssim"
simlist
=
"dlsim ulsim polartest ldpctest"
simlist
=
"dlsim ulsim polartest ldpctest
nr_pbchsim
"
for
f
in
$simlist
;
do
compilations
\
lte-
simulators
$f
\
phy_
simulators
$f
\
$f
$dbin
/
$f
.
$REL
done
compilations
\
lte-
simulators coding
\
phy_
simulators coding
\
libcoding.so
$dbin
/libcoding.so
fi
...
...
@@ -703,7 +703,7 @@ function main() {
simlist
=
"secu_knas_encrypt_eia1 secu_kenb aes128_ctr_encrypt aes128_ctr_decrypt secu_knas_encrypt_eea2 secu_knas secu_knas_encrypt_eea1 kdf aes128_cmac_encrypt secu_knas_encrypt_eia2"
for
f
in
$simlist
;
do
compilations
\
lte-
simulators test_
$f
\
phy_
simulators test_
$f
\
test_
$f
$dbin
/test_
$f
.
$REL
done
fi
...
...
cmake_targets/
lte-
simulators/CMakeLists.txt
→
cmake_targets/
phy_
simulators/CMakeLists.txt
View file @
d9c721fb
...
...
@@ -9,4 +9,5 @@ set(MU_RECIEVER False)
set
(
NAS_UE False
)
set
(
MESSAGE_CHART_GENERATOR False
)
set
(
RRC_ASN1_VERSION
"Rel14"
)
set
(
T_TRACER False
)
include
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/../CMakeLists.txt
)
common/utils/LOG/log.h
View file @
d9c721fb
...
...
@@ -345,10 +345,10 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
/* define variable only used in LOG macro's */
# define LOG_VAR(A,B) A B
# else
/* T_TRACER: remove all debugging and tracing messages, except errors */
# define LOG_I(c, x...)
/* */
# define LOG_W(c, x...)
/* */
# define LOG_E(c, x...)
/* */
# define LOG_D(c, x...)
/* */
# define LOG_I(c, x...)
do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ; } while(0)
/* */
# define LOG_W(c, x...)
do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ; } while(0)
/* */
# define LOG_E(c, x...)
do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ; } while(0)
/* */
# define LOG_D(c, x...)
do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ; } while(0)
/* */
# define LOG_T(c, x...)
/* */
# define LOG_F(c, x...)
/* */
# define nfapi_log(FILE, FNC, LN, COMP, LVL, FMT...)
...
...
@@ -356,7 +356,7 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
# define LOG_DEBUG_END }
# define LOG_M_BEGIN(D) if (0) {
# define LOG_M_END }
# define LOG_M(file, vector, data, len, dec, format)
# define LOG_M(file, vector, data, len, dec, format)
do { write_file_matlab(file, vector, data, len, dec, format);} while(0)
# define LOG_VAR(A,B)
# endif
/* T_TRACER */
/* avoid warnings for variables only used in LOG macro's but set outside debug section */
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
View file @
d9c721fb
...
...
@@ -1069,9 +1069,17 @@ int8_t polar_decoder_int16(int16_t *input,
nr_polar_deinterleaver
(
polarParams
->
nr_polar_CPrime
,
polarParams
->
nr_polar_B
,
polarParams
->
interleaving_pattern
,
polarParams
->
K
);
//Remove the CRC (â)
for
(
int
j
=
0
;
j
<
polarParams
->
payloadBits
;
j
++
)
polarParams
->
nr_polar_A
[
j
]
=
polarParams
->
nr_polar_B
[
j
];
nr_byte2bit_uint8_32_t
(
polarParams
->
nr_polar_A
,
polarParams
->
payloadBits
,
out
);
//for (int j = 0; j < polarParams->payloadBits; j++) polarParams->nr_polar_A[j]=polarParams->nr_polar_B[j];
// Check the CRC
for
(
int
j
=
0
;
j
<
polarParams
->
crcParityBits
;
j
++
)
{
int
crcbit
=
0
;
for
(
int
i
=
0
;
i
<
polarParams
->
payloadBits
;
i
++
)
crcbit
=
crcbit
^
(
polarParams
->
crc_generator_matrix
[
i
][
j
]
&
polarParams
->
nr_polar_B
[
i
]);
if
(
crcbit
!=
polarParams
->
nr_polar_B
[
polarParams
->
payloadBits
+
j
])
return
(
-
1
);
}
// pack into ceil(payloadBits/32) 32 bit words, lowest index in MSB
// nr_byte2bit_uint8_32_t(polarParams->nr_polar_A, polarParams->payloadBits, out);
nr_byte2bit_uint8_32_t
(
polarParams
->
nr_polar_B
,
polarParams
->
payloadBits
,
out
);
return
(
0
);
}
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c
View file @
d9c721fb
...
...
@@ -443,7 +443,7 @@ void applyGtoright(t_nrPolar_params *pp,decoder_node_t *node) {
}
else
#endif
{
// equvalent scalar code to above, activated only on non x86/ARM architectures
{
// equvalent scalar code to above, activated only on non x86/ARM architectures
or Nv=1,2
for
(
int
i
=
0
;
i
<
node
->
Nv
/
2
;
i
++
)
{
alpha_r
[
i
]
=
alpha_v
[
i
+
(
node
->
Nv
/
2
)]
-
(
betal
[
i
]
*
alpha_v
[
i
]);
}
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
View file @
d9c721fb
...
...
@@ -361,11 +361,13 @@ static inline void nr_polar_interleaver(uint8_t *input,
}
static
inline
void
nr_polar_deinterleaver
(
uint8_t
*
input
,
uint8_t
*
output
,
uint16_t
*
pattern
,
uint16_t
size
)
uint8_t
*
output
,
uint16_t
*
pattern
,
uint16_t
size
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
output
[
pattern
[
i
]]
=
input
[
i
];
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
output
[
pattern
[
i
]]
=
input
[
i
];
}
}
#endif
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
View file @
d9c721fb
...
...
@@ -54,7 +54,7 @@ void polar_encoder(uint32_t *in,
polarParams
->
nr_polar_crc
,
polarParams
->
payloadBits
,
polarParams
->
crcParityBits
);
for
(
uint8_t
i
=
0
;
i
<
polarParams
->
crcParityBits
;
i
++
)
for
(
uint8_t
i
=
0
;
i
<
polarParams
->
crcParityBits
;
i
++
)
polarParams
->
nr_polar_crc
[
i
]
=
(
polarParams
->
nr_polar_crc
[
i
]
%
2
);
//Attach CRC to the Transport Block. (a to b)
...
...
openair1/PHY/CODING/nr_polar_init.c
View file @
d9c721fb
...
...
@@ -185,9 +185,9 @@ void nr_polar_print_polarParams(t_nrPolar_paramsPtr polarParams)
}
t_nrPolar_paramsPtr
nr_polar_params
(
t_nrPolar_paramsPtr
polarParams
,
int8_t
messageType
,
uint16_t
messageLength
,
uint8_t
aggregation_level
)
int8_t
messageType
,
uint16_t
messageLength
,
uint8_t
aggregation_level
)
{
t_nrPolar_paramsPtr
currentPtr
=
NULL
;
...
...
openair1/PHY/INIT/nr_init.c
View file @
d9c721fb
...
...
@@ -92,7 +92,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
int
i
,
UE_id
;
LOG_I
(
PHY
,
"[gNB %d] %s() About to wait for gNB to be configured"
,
gNB
->
Mod_id
,
__FUNCTION__
);
LOG_I
(
PHY
,
"[gNB %d] %s() About to wait for gNB to be configured
\n
"
,
gNB
->
Mod_id
,
__FUNCTION__
);
gNB
->
total_dlsch_bitrate
=
0
;
gNB
->
total_transmitted_bits
=
0
;
...
...
@@ -100,6 +100,8 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
gNB
->
check_for_MUMIMO_transmissions
=
0
;
while
(
gNB
->
configured
==
0
)
usleep
(
10000
);
init_dfts
();
/*
LOG_I(PHY,"[gNB %"PRIu8"] Initializing DL_FRAME_PARMS : N_RB_DL %"PRIu8", PHICH Resource %d, PHICH Duration %d nb_antennas_tx:%u nb_antennas_rx:%u PRACH[rootSequenceIndex:%u prach_Config_enabled:%u configIndex:%u highSpeed:%u zeroCorrelationZoneConfig:%u freqOffset:%u]\n",
gNB->Mod_id,
...
...
@@ -324,7 +326,7 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
free_and_zero
(
srs_vars
[
UE_id
].
srs_ch_estimates_time
);
}
//UE_id
free_ul_ref_sigs
();
//
free_ul_ref_sigs();
for
(
UE_id
=
0
;
UE_id
<
NUMBER_OF_UE_MAX
;
UE_id
++
)
free_and_zero
(
srs_vars
[
UE_id
].
srs
);
...
...
@@ -367,7 +369,7 @@ void install_schedule_handlers(IF_Module_t *if_inst)
/// this function is a temporary addition for NR configuration
/*
void nr_phy_config_request(PHY_VARS_gNB *gNB)
void
nr_phy_config_request
_sim
(
PHY_VARS_gNB
*
gNB
,
int
N_RB_DL
,
int
N_RB_UL
,
int
mu
)
{
NR_DL_FRAME_PARMS
*
fp
=
&
gNB
->
frame_parms
;
nfapi_nr_config_request_t
*
gNB_config
=
&
gNB
->
gNB_config
;
...
...
@@ -375,14 +377,14 @@ void install_schedule_handlers(IF_Module_t *if_inst)
//overwrite for new NR parameters
gNB_config
->
nfapi_config
.
rf_bands
.
rf_band
[
0
]
=
22
;
gNB_config
->
nfapi_config
.
earfcn
.
value
=
6600
;
gNB_config->subframe_config.numerology_index_mu.value =
1
;
gNB_config->subframe_config.duplex_mode.value =
F
DD;
gNB_config
->
subframe_config
.
numerology_index_mu
.
value
=
mu
;
gNB_config
->
subframe_config
.
duplex_mode
.
value
=
T
DD
;
gNB_config
->
rf_config
.
tx_antenna_ports
.
value
=
1
;
gNB_config->rf_config.dl_carrier_bandwidth.value =
106
;
gNB_config->rf_config.ul_carrier_bandwidth.value =
106
;
gNB_config
->
rf_config
.
dl_carrier_bandwidth
.
value
=
N_RB_DL
;
gNB_config
->
rf_config
.
ul_carrier_bandwidth
.
value
=
N_RB_UL
;
gNB_config
->
sch_config
.
half_frame_index
.
value
=
0
;
gNB_config
->
sch_config
.
ssb_subcarrier_offset
.
value
=
0
;
gNB_config->sch_config.n_ssb_crb.value =
86
;
gNB_config
->
sch_config
.
n_ssb_crb
.
value
=
(
N_RB_DL
-
20
)
>>
1
;
gNB_config
->
sch_config
.
ssb_subcarrier_offset
.
value
=
0
;
...
...
@@ -396,7 +398,7 @@ void install_schedule_handlers(IF_Module_t *if_inst)
gNB
->
configured
=
1
;
LOG_I
(
PHY
,
"gNB configured
\n
"
);
}
*/
}
void
nr_phy_config_request
(
NR_PHY_Config_t
*
phy_config
)
...
...
openair1/PHY/INIT/nr_init_ue.c
View file @
d9c721fb
...
...
@@ -655,15 +655,16 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
int
i
,
j
,
k
,
l
;
int
eNB_id
;
int
th_id
;
int
n_ssb_crb
=
(
fp
->
N_RB_DL
-
20
)
>>
1
;
abstraction_flag
=
0
;
fp
->
nb_antennas_tx
=
1
;
fp
->
nb_antennas_rx
=
1
;
printf
(
"Initializing UE vars (abstraction %"
PRIu8
") for eNB TXant %"
PRIu8
", UE RXant %"
PRIu8
"
\n
"
,
abstraction_flag
,
fp
->
nb_antennas_tx
,
fp
->
nb_antennas_rx
);
//LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_eNB_INST);
nr_init_frame_parms_ue
(
&
ue
->
frame_parms
);
nr_init_frame_parms_ue
(
&
ue
->
frame_parms
,
NR_MU_1
,
NORMAL
,
n_ssb_crb
,
0
);
phy_init_nr_top
(
ue
);
// many memory allocation sizes are hard coded
...
...
@@ -699,7 +700,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
for
(
i
=
0
;
i
<
fp
->
nb_antennas_tx
;
i
++
)
{
common_vars
->
txdata
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
samples_per_subframe
*
10
*
sizeof
(
int32_t
)
);
common_vars
->
txdataF
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
ofdm_symbol_size
*
fp
->
symbols_per_
tti
*
10
*
sizeof
(
int32_t
)
);
common_vars
->
txdataF
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
ofdm_symbol_size
*
fp
->
symbols_per_
slot
*
10
*
sizeof
(
int32_t
)
);
}
// init RX buffers
...
...
@@ -728,7 +729,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
for
(
j
=
0
;
j
<
4
;
j
++
)
{
int
idx
=
(
j
<<
1
)
+
i
;
for
(
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
common_vars
->
common_vars_rx_data_per_thread
[
th_id
].
dl_ch_estimates
[
eNB_id
][
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
fp
->
symbols_per_
tti
*
(
fp
->
ofdm_symbol_size
+
LTE_CE_FILTER_LENGTH
)
);
common_vars
->
common_vars_rx_data_per_thread
[
th_id
].
dl_ch_estimates
[
eNB_id
][
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
fp
->
symbols_per_
slot
*
(
fp
->
ofdm_symbol_size
+
LTE_CE_FILTER_LENGTH
)
);
common_vars
->
common_vars_rx_data_per_thread
[
th_id
].
dl_ch_estimates_time
[
eNB_id
][
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
fp
->
ofdm_symbol_size
*
2
);
}
}
...
...
@@ -850,7 +851,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
pbch_vars
[
eNB_id
]
->
rxdataF_ext
=
(
int32_t
**
)
malloc16
(
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
pbch_vars
[
eNB_id
]
->
rxdataF_comp
=
(
int32_t
**
)
malloc16_clear
(
8
*
sizeof
(
int32_t
*
)
);
pbch_vars
[
eNB_id
]
->
dl_ch_estimates_ext
=
(
int32_t
**
)
malloc16_clear
(
8
*
sizeof
(
int32_t
*
)
);
pbch_vars
[
eNB_id
]
->
llr
=
(
int
8
_t
*
)
malloc16_clear
(
1920
);
//
pbch_vars
[
eNB_id
]
->
llr
=
(
int
16
_t
*
)
malloc16_clear
(
1920
);
//
prach_vars
[
eNB_id
]
->
prachF
=
(
int16_t
*
)
malloc16_clear
(
sizeof
(
int
)
*
(
7
*
2
*
sizeof
(
int
)
*
(
fp
->
ofdm_symbol_size
*
12
))
);
prach_vars
[
eNB_id
]
->
prach
=
(
int16_t
*
)
malloc16_clear
(
sizeof
(
int
)
*
(
7
*
2
*
sizeof
(
int
)
*
(
fp
->
ofdm_symbol_size
*
12
))
);
...
...
@@ -941,43 +942,25 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag) {
void
phy_init_nr_top
(
PHY_VARS_NR_UE
*
ue
)
{
NR_DL_FRAME_PARMS
*
frame_parms
=
&
ue
->
frame_parms
;
NR_UE_DLSCH_t
*
dlsch0
=
ue
->
dlsch
[
0
][
0
][
0
];
dlsch0
=
(
NR_UE_DLSCH_t
*
)
malloc16
(
sizeof
(
NR_UE_DLSCH_t
));
NR_DL_FRAME_PARMS
*
frame_parms
=
&
ue
->
frame_parms
;
NR_UE_DLSCH_t
*
dlsch0
=
ue
->
dlsch
[
0
][
0
][
0
];
dlsch0
=
(
NR_UE_DLSCH_t
*
)
malloc16
(
sizeof
(
NR_UE_DLSCH_t
));
crcTableInit
();
init_dfts
();
ccodedot11_init
();
ccodedot11_init_inv
();
ccodelte_init
();
ccodelte_init_inv
();
//treillis_table_init();
phy_generate_viterbi_tables
();
phy_generate_viterbi_tables_lte
();
//init_td8();
//init_td16();
#ifdef __AVX2__
//init_td16avx2();
#endif
init_context_synchro_nr
(
frame_parms
);
generate_ul_reference_signal_sequences
(
SHRT_MAX
);
// Polar encoder init for PBCH
//nr_polar_init(&frame_parms->pbch_polar_params, 1);
/*t_nrPolar_paramsPtr nrPolar_params = NULL, currentPtr = NULL;
nr_polar_init(&ue->nrPolar_params,
NR_POLAR_PBCH_MESSAGE_TYPE,
NR_POLAR_PBCH_PAYLOAD_BITS,
NR_POLAR_PBCH_AGGREGATION_LEVEL);*/
ue
->
nrPolar_params
=
NULL
;
nr_polar_init
(
&
ue
->
nrPolar_params
,
NR_POLAR_PBCH_MESSAGE_TYPE
,
NR_POLAR_PBCH_PAYLOAD_BITS
,
NR_POLAR_PBCH_AGGREGATION_LEVEL
);
//lte_sync_time_init(frame_parms);
//generate_ul_ref_sigs();
...
...
@@ -993,3 +976,64 @@ void phy_init_nr_top(PHY_VARS_NR_UE *ue)
//set_taus_seed(1328);
}
void
set_default_frame_parms_single
(
nfapi_nr_config_request_t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
)
{
//int CC_id;
//for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
/* Set some default values that may be overwritten while reading options */
frame_parms
=
(
NR_DL_FRAME_PARMS
*
)
malloc
(
sizeof
(
NR_DL_FRAME_PARMS
));
config
=
(
nfapi_nr_config_request_t
*
)
malloc
(
sizeof
(
nfapi_nr_config_request_t
));
config
->
subframe_config
.
numerology_index_mu
.
value
=
1
;
config
->
subframe_config
.
duplex_mode
.
value
=
1
;
//FDD
config
->
subframe_config
.
dl_cyclic_prefix_type
.
value
=
0
;
//NORMAL
config
->
rf_config
.
dl_carrier_bandwidth
.
value
=
106
;
config
->
rf_config
.
ul_carrier_bandwidth
.
value
=
106
;
config
->
rf_config
.
tx_antenna_ports
.
value
=
1
;
config
->
rf_config
.
rx_antenna_ports
.
value
=
1
;
config
->
sch_config
.
physical_cell_id
.
value
=
0
;
frame_parms
->
frame_type
=
FDD
;
frame_parms
->
tdd_config
=
3
;
//frame_parms[CC_id]->tdd_config_S = 0;
frame_parms
->
N_RB_DL
=
100
;
frame_parms
->
N_RB_UL
=
100
;
frame_parms
->
Ncp
=
NORMAL
;
//frame_parms[CC_id]->Ncp_UL = NORMAL;
frame_parms
->
Nid_cell
=
0
;
//frame_parms[CC_id]->num_MBSFN_config = 0;
frame_parms
->
nb_antenna_ports_eNB
=
1
;
frame_parms
->
nb_antennas_tx
=
1
;
frame_parms
->
nb_antennas_rx
=
1
;
//frame_parms[CC_id]->nushift = 0;
///frame_parms[CC_id]->phich_config_common.phich_resource = oneSixth;
//frame_parms[CC_id]->phich_config_common.phich_duration = normal;
// UL RS Config
/*frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = 1;//n_DMRS1 set to 0
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 1;
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 0;
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0;
frame_parms[CC_id]->pusch_config_common.n_SB = 1;
frame_parms[CC_id]->pusch_config_common.hoppingMode = 0;
frame_parms[CC_id]->pusch_config_common.pusch_HoppingOffset = 0;
frame_parms[CC_id]->pusch_config_common.enable64QAM = 0;
frame_parms[CC_id]->prach_config_common.rootSequenceIndex=22;
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=1;
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.highSpeedFlag=0;
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;*/
// NR: Init to legacy LTE 20Mhz params
frame_parms
->
numerology_index
=
0
;
frame_parms
->
ttis_per_subframe
=
1
;
frame_parms
->
slots_per_tti
=
2
;
//}
}
openair1/PHY/INIT/nr_parms.c
View file @
d9c721fb
...
...
@@ -26,18 +26,20 @@
uint32_t
nr_subcarrier_spacing
[
MAX_NUM_SUBCARRIER_SPACING
]
=
{
15e3
,
30e3
,
60e3
,
120e3
,
240e3
};
uint16_t
nr_slots_per_subframe
[
MAX_NUM_SUBCARRIER_SPACING
]
=
{
1
,
2
,
4
,
16
,
32
};
int
nr_init_frame_parms
(
nfapi_nr_config_request_t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
)
int
nr_init_frame_parms0
(
NR_DL_FRAME_PARMS
*
fp
,
int
mu
,
int
Ncp
)
{
int
N_RB
=
config
->
rf_config
.
dl_carrier_bandwidth
.
value
;
int
Ncp
=
config
->
subframe_config
.
dl_cyclic_prefix_type
.
value
;
int
mu
=
config
->
subframe_config
.
numerology_index_mu
.
value
;
#if DISABLE_LOG_X
printf
(
"Initializing frame parms for mu %d, N_RB %d, Ncp %d
\n
"
,
mu
,
N_RB
,
Ncp
);
printf
(
"Initializing frame parms for mu %d, N_RB %d, Ncp %d
\n
"
,
mu
,
fp
->
N_RB
_DL
,
Ncp
);
#else
LOG_I
(
PHY
,
"Initializing frame parms for mu %d, N_RB %d, Ncp %d
\n
"
,
mu
,
N_RB
,
Ncp
);
LOG_I
(
PHY
,
"Initializing frame parms for mu %d, N_RB %d, Ncp %d
\n
"
,
mu
,
fp
->
N_RB
_DL
,
Ncp
);
#endif
if
(
Ncp
==
NFAPI_CP_EXTENDED
)
...
...
@@ -46,15 +48,15 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config,
switch
(
mu
)
{
case
NR_MU_0
:
//15kHz scs
f
rame_parms
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_0
];
f
rame_parms
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_0
];
f
p
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_0
];
f
p
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_0
];
break
;
case
NR_MU_1
:
//30kHz scs
f
rame_parms
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_1
];
f
rame_parms
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_1
];
f
p
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_1
];
f
p
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_1
];
switch
(
N_RB
){
switch
(
fp
->
N_RB
_DL
){
case
11
:
case
24
:
case
38
:
...
...
@@ -63,17 +65,17 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config,
case
65
:
case
106
:
//40 MHz
if
(
f
rame_parms
->
threequarter_fs
)
{
f
rame_parms
->
ofdm_symbol_size
=
1536
;
f
rame_parms
->
first_carrier_offset
=
900
;
//1536 - 636
f
rame_parms
->
nb_prefix_samples0
=
132
;
f
rame_parms
->
nb_prefix_samples
=
108
;
if
(
f
p
->
threequarter_fs
)
{
f
p
->
ofdm_symbol_size
=
1536
;
f
p
->
first_carrier_offset
=
900
;
//1536 - 636
f
p
->
nb_prefix_samples0
=
132
;
f
p
->
nb_prefix_samples
=
108
;
}
else
{
f
rame_parms
->
ofdm_symbol_size
=
2048
;
f
rame_parms
->
first_carrier_offset
=
1412
;
//2048 - 636
f
rame_parms
->
nb_prefix_samples0
=
176
;
f
rame_parms
->
nb_prefix_samples
=
144
;
f
p
->
ofdm_symbol_size
=
2048
;
f
p
->
first_carrier_offset
=
1412
;
//2048 - 636
f
p
->
nb_prefix_samples0
=
176
;
f
p
->
nb_prefix_samples
=
144
;
}
break
;
...
...
@@ -82,32 +84,44 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config,
case
189
:
case
217
:
//80 MHz
if
(
frame_parms
->
threequarter_fs
)
{
frame_parms
->
ofdm_symbol_size
=
3072
;
frame_parms
->
first_carrier_offset
=
1770
;
//3072 - 1302
frame_parms
->
nb_prefix_samples0
=
264
;
frame_parms
->
nb_prefix_samples
=
216
;
}
else
{
frame_parms
->
ofdm_symbol_size
=
4096
;
frame_parms
->
first_carrier_offset
=
2794
;
//4096 - 1302
frame_parms
->
nb_prefix_samples0
=
352
;
frame_parms
->
nb_prefix_samples
=
288
;
if
(
fp
->
threequarter_fs
)
{
fp
->
ofdm_symbol_size
=
3072
;
fp
->
first_carrier_offset
=
1770
;
//3072 - 1302
fp
->
nb_prefix_samples0
=
264
;
fp
->
nb_prefix_samples
=
216
;
}
else
{
fp
->
ofdm_symbol_size
=
4096
;
fp
->
first_carrier_offset
=
2794
;
//4096 - 1302
fp
->
nb_prefix_samples0
=
352
;
fp
->
nb_prefix_samples
=
288
;
}
break
;
case
245
:
AssertFatal
(
fp
->
threequarter_fs
==
0
,
"3/4 sampling impossible for N_RB %d and MU %d
\n
"
,
fp
->
N_RB_DL
,
mu
);
fp
->
ofdm_symbol_size
=
4096
;
fp
->
first_carrier_offset
=
2626
;
//4096 - 1478
fp
->
nb_prefix_samples0
=
352
;
fp
->
nb_prefix_samples
=
288
;
break
;
case
273
: