merge develop-nr
This commit is contained in:
@@ -55,42 +55,42 @@ set(INC_UNIT_TESTS
|
||||
|
||||
add_executable(pss_test ${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/pss_test.c ${SRC_UNIT_TESTS} ${INC_UNIT_TESTS})
|
||||
target_link_libraries(pss_test
|
||||
-Wl,--start-group UTIL SCHED_UE_LIB SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
|
||||
-Wl,--start-group UTIL SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
|
||||
pthread m ${ATLAS_LIBRARIES}
|
||||
)
|
||||
|
||||
add_executable(sss_test ${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/sss_test.c ${SRC_UNIT_TESTS} ${INC_UNIT_TESTS})
|
||||
target_link_libraries(sss_test
|
||||
-Wl,--start-group UTIL SCHED_UE_LIB SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
|
||||
-Wl,--start-group UTIL SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
|
||||
pthread m ${ATLAS_LIBRARIES}
|
||||
)
|
||||
|
||||
add_executable(frame_config_test ${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/frame_config_test.c ${SRC_UNIT_TESTS} ${INC_UNIT_TESTS})
|
||||
target_link_libraries(frame_config_test
|
||||
-Wl,--start-group UTIL SCHED_UE_LIB SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
|
||||
-Wl,--start-group UTIL SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
|
||||
pthread m ${ATLAS_LIBRARIES}
|
||||
)
|
||||
|
||||
add_executable(harq_test ${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/harq_test.c ${SRC_UNIT_TESTS} ${INC_UNIT_TESTS})
|
||||
target_link_libraries(harq_test
|
||||
-Wl,--start-group UTIL SCHED_UE_LIB SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
|
||||
-Wl,--start-group UTIL SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
|
||||
pthread m ${ATLAS_LIBRARIES}
|
||||
)
|
||||
|
||||
add_executable(srs_test ${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/srs_test.c ${SRC_UNIT_TESTS} ${INC_UNIT_TESTS})
|
||||
target_link_libraries(srs_test
|
||||
-Wl,--start-group UTIL SCHED_UE_LIB SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
|
||||
-Wl,--start-group UTIL SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
|
||||
pthread m ${ATLAS_LIBRARIES}
|
||||
)
|
||||
|
||||
add_executable(pbch_test ${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/pbch_test.c ${SRC_UNIT_TESTS} ${INC_UNIT_TESTS})
|
||||
target_link_libraries(pbch_test
|
||||
-Wl,--start-group UTIL SCHED_UE_LIB SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
|
||||
-Wl,--start-group UTIL SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
|
||||
pthread m ${ATLAS_LIBRARIES}
|
||||
)
|
||||
|
||||
add_executable(pucch_uci_test ${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/pucch_uci_test.c ${SRC_UNIT_TESTS} ${INC_UNIT_TESTS})
|
||||
target_link_libraries(pucch_uci_test
|
||||
-Wl,--start-group UTIL SCHED_UE_LIB SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
|
||||
-Wl,--start-group UTIL SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
|
||||
pthread m ${ATLAS_LIBRARIES}
|
||||
)
|
||||
|
||||
@@ -28,9 +28,10 @@
|
||||
# - checking output files with reference files.
|
||||
# ./run_test to build/run and check all tests
|
||||
# -b no build
|
||||
# -r no run
|
||||
# -e no execution
|
||||
# -c no check
|
||||
# an alone specific test can be executed ./run_test test_name
|
||||
# -m no run of meld
|
||||
# an alone specific test can be executed ./run_tests test_name
|
||||
#----------------------------------------------------------------------------
|
||||
# CONFIGURATION
|
||||
# files and directories
|
||||
@@ -48,8 +49,9 @@ BROWSER="firefox"
|
||||
|
||||
BUILD_TEST="yes"
|
||||
CHECK_TEST="yes"
|
||||
RUN_TEST="yes"
|
||||
EXECUTE_TEST="yes"
|
||||
SINGLE_TEST="no"
|
||||
RUN_MELD="yes"
|
||||
# for removing files
|
||||
REMOVE="rm -f"
|
||||
COMPARE="cmp"
|
||||
@@ -76,23 +78,28 @@ do
|
||||
echo "No build of unit test"
|
||||
BUILD_TEST="no"
|
||||
;;
|
||||
-r)
|
||||
echo "No run of unit test"
|
||||
RUN_TEST="no"
|
||||
-e)
|
||||
echo "No execution of unit test"
|
||||
EXECUTE_TEST="no"
|
||||
;;
|
||||
-c)
|
||||
echo "No check of unit test"
|
||||
CHECK_TEST="no"
|
||||
;;
|
||||
-m)
|
||||
echo "No run of meld tool"
|
||||
RUN_MELD="no"
|
||||
;;
|
||||
-h)
|
||||
echo "Option of run_test script"
|
||||
echo "-b : No Build of unit tests"
|
||||
echo "-c : No check for unit test"
|
||||
echo "-r : No run of unit tests"
|
||||
echo "-m : No run of meld tool"
|
||||
exit
|
||||
BUILD_TEST="no"
|
||||
CHECK_TEST="no"
|
||||
RUN_TEST="no"
|
||||
EXECUTE_TEST="no"
|
||||
;;
|
||||
*)
|
||||
for file in $tst_files
|
||||
@@ -109,7 +116,7 @@ do
|
||||
echo "Unknown parameter $1"
|
||||
BUILD_TEST="no"
|
||||
CHECK_TEST="no"
|
||||
RUN_TEST="no"
|
||||
EXECUTE_TEST="no"
|
||||
exit
|
||||
fi
|
||||
;;
|
||||
@@ -121,15 +128,12 @@ done
|
||||
|
||||
#--------------------------------------------------------------------------------------------
|
||||
# RUN AND CHECK RESULTS
|
||||
# compare reference log file to results file
|
||||
# diff -s -d -a -q ./testlogs/*.txt ./reflog/*.txt
|
||||
# compare $RESULTS_FILE to $REFERENCE_DIR/$RESULTS_FILE
|
||||
|
||||
numberDisplayFilesDifferencies=0
|
||||
let MAX_NUMBER_DISPLAY_FILES_DIFFERENCES=8
|
||||
num_diff=0
|
||||
|
||||
if [ $RUN_TEST == "yes" ]
|
||||
if [ $EXECUTE_TEST == "yes" ]
|
||||
then
|
||||
mkdir $RESULT_DIR
|
||||
fi
|
||||
@@ -174,7 +178,7 @@ for file in $tst_files
|
||||
make $file
|
||||
fi
|
||||
|
||||
if [ $RUN_TEST == "yes" ]
|
||||
if [ $EXECUTE_TEST == "yes" ]
|
||||
then
|
||||
echo "rm $RESULT_DIR/$RESULT_TEST_FILE"
|
||||
rm $RESULT_DIR/$RESULT_TEST_FILE
|
||||
@@ -195,20 +199,25 @@ for file in $tst_files
|
||||
|
||||
if [ $? == 0 ]
|
||||
then
|
||||
echo "Same file for $file"
|
||||
echo "Test $file is PASS"
|
||||
echo "Same logging file for $file"
|
||||
else
|
||||
echo "Difference for scenario $file"
|
||||
echo "Test $file is FAIL"
|
||||
echo "Difference of logging file for scenario $file"
|
||||
let "num_diff=$num_diff + 1"
|
||||
meld $RESULT_DIR/$RESULT_TEST_FILE $REFERENCE_DIR/$RESULT_TEST_FILE &
|
||||
let "numberDisplayFilesDifferencies=$numberDisplayFilesDifferencies + 1"
|
||||
echo "Meld number "$numberDisplayFilesDifferencies
|
||||
if [ $numberDisplayFilesDifferencies = $MAX_NUMBER_DISPLAY_FILES_DIFFERENCES ]
|
||||
if [ $RUN_MELD == "yes" ]
|
||||
then
|
||||
echo "###### ERROR ###### ERROR ###### ERROR ###### ERROR ###### ERROR ###### ERROR ######"
|
||||
echo "=> ERROR Test aborted because there are already $MAX_NUMBER_DISPLAY_FILES_DIFFERENCES detected files which are different"
|
||||
break
|
||||
meld $RESULT_DIR/$RESULT_TEST_FILE $REFERENCE_DIR/$RESULT_TEST_FILE &
|
||||
let "numberDisplayFilesDifferencies=$numberDisplayFilesDifferencies + 1"
|
||||
echo "Meld number "$numberDisplayFilesDifferencies
|
||||
if [ $numberDisplayFilesDifferencies = $MAX_NUMBER_DISPLAY_FILES_DIFFERENCES ]
|
||||
then
|
||||
echo "###### ERROR ###### ERROR ###### ERROR ###### ERROR ###### ERROR ###### ERROR ######"
|
||||
echo "=> ERROR Test aborted because there are already $MAX_NUMBER_DISPLAY_FILES_DIFFERENCES detected logging files which are different"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "No reference file for test $file"
|
||||
fi
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
|
||||
File: /home/jacques/workspace/oai_openairinterface/openairinterface5g/openair1/SIMULATION/NR_UE_PHY/unit_tests/README.txt
|
||||
|
||||
This directory contains testbenchs for 5G NR physical layers.
|
||||
@@ -33,37 +32,30 @@ Install tools:
|
||||
Build NR UE:
|
||||
- under openairinterface5g/cmake_targets/build --nrUE
|
||||
|
||||
Files
|
||||
=====
|
||||
Specific test files
|
||||
====================
|
||||
|
||||
pss_test.c: test for detection of primary synchronisation signal.
|
||||
|
||||
pss_test.c: test for detection of primary synchronisation signal.
|
||||
sss_test.c: test for detection of secundary synchronisation signal.
|
||||
|
||||
pbch_test.c: test for decoding of packet braodcast channel.
|
||||
|
||||
srs_test.c: test of sounding reference signal.
|
||||
|
||||
frame_config_test.c : test of frame configurations (FDD/TDD).
|
||||
|
||||
harq_test.c : test of HARQ downlink and uplink.
|
||||
|
||||
pucch_uci_test : test of packed Uplink Control Channel Uplink Control Information
|
||||
|
||||
pss_util_test.c: common functions for running synchronisation tests.
|
||||
|
||||
pss_util_test.h: common headers for synchronisation tests.
|
||||
|
||||
input_buffer_test.h: it allows providing samples for pss test.
|
||||
|
||||
How to build & run tests
|
||||
========================
|
||||
|
||||
Before building, oai environment should be set by entering under openairinterface5g "source oaienv".
|
||||
Before building, oai environment should be set by entering under directory openairinterface5g "source oaienv".
|
||||
|
||||
A script allows to build, to run and to check all tests:
|
||||
A script "run_tests.sh" allows to build, to run and to check all tests.
|
||||
To run a complete non regression of unit tests, go under directory NR_UE_PHY/unit_tests/build and execute:
|
||||
./run_tests.sh
|
||||
|
||||
>run_tests
|
||||
This script "run_tests.sh" list all available unit tests.
|
||||
|
||||
build is based on cmake tool.
|
||||
|
||||
@@ -73,7 +65,10 @@ CMakeList.txt lists different build.
|
||||
|
||||
How to build: in directory "oai_openairinterface/openairinterface5g/openair1/SIMULATION/NR_UE_PHY/unit_tests/build/", below commands should be entered:
|
||||
|
||||
First command to do:
|
||||
cmake CMakeList.txt -> it generates makefiles to build all projects.
|
||||
|
||||
Then build of test:
|
||||
make pss_test -> build pss_test: detection of NR (Primary Synchronisation Channel - synchronisation of UE).
|
||||
make sss_test -> build sss_test: detection of NR SSS (Secundary Synchronisation Channel - second step for UE synchronisation).
|
||||
make pbch_test -> build pbch_test: decoding of NR PBCH (Packet Broadcast Channel -> UE read MIB Master Information Block which gives network parameters).
|
||||
@@ -83,6 +78,7 @@ make harq_test -> build harq_test: Hybrid Repeat Request Acknowledgment
|
||||
make pucch_uci_test -> build pucch_uci_test : Packet Uplink Control Channel / Uplink Control information : create UCI payload and select PUCCH formats and its parameters.
|
||||
make clean -> clean all projects.
|
||||
|
||||
And execution of tests:
|
||||
./pss_test -> run NR PSS tests.
|
||||
./sss_test -> run NR SSS tests.
|
||||
./pbch_test -> run NR PBCH tests.
|
||||
@@ -94,8 +90,28 @@ make clean -> clean all projects.
|
||||
There is a script in build/run_test.sh which allows:
|
||||
- building/running/checking all tests
|
||||
|
||||
Checking consists in a comparaison of generated logging file at execution with a reference logging file which is stored under git for each test.
|
||||
What is test result?
|
||||
====================
|
||||
|
||||
Test verdict consists in a comparaison of generated logging file at execution with a reference logging file which is stored under git for each test.
|
||||
By default, tool "meld" is open each time there is a difference between reference file and logging file.
|
||||
It is possible to disable execution of meld with option -m.
|
||||
|
||||
Build/execute only one test:
|
||||
===========================
|
||||
|
||||
The script "run_tests.sh" has different options:
|
||||
"-b : No Build of unit tests"
|
||||
"-c : No check for unit test"
|
||||
"-e : No execution of unit tests"
|
||||
"-m : No run of meld tool"
|
||||
|
||||
./run_tests.sh -> run all unit tests (build, execute and compare for each test)
|
||||
./run_tests.sh -m -> run all unit tests but meld is not used (verdict is based on system command "cmp").
|
||||
./run_tests.sh -b -c -r -m -> list all available unit tests
|
||||
./run_tests.sh pss_test -> run only one test (here it is pss_test).
|
||||
./run_tests.sh -c -e -m pss_test -> build only one test
|
||||
./run_tests.sh -m pss_test -> run only one test but without execution of meld
|
||||
|
||||
Which processing can be tuned?
|
||||
=============================
|
||||
@@ -121,7 +137,6 @@ Status
|
||||
======
|
||||
|
||||
NR synchronisation tests run successfully with default parameters.
|
||||
|
||||
Warning: Tests of PSS NR with decimation (based on FIR or CIC filter) does not run successfully at the moment.
|
||||
|
||||
|
||||
|
||||
@@ -46,6 +46,11 @@ uint32_t (*p_nr_ue_get_SR)(module_id_t module_idP,int CC_id,frame_t frameP,uint8
|
||||
|
||||
/*****************functions****************************************/
|
||||
|
||||
lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,unsigned char subframe)
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
|
||||
frame_t frameP, uint8_t new_Msg3,
|
||||
sub_frame_t subframe){ return(NULL);}
|
||||
@@ -61,7 +66,7 @@ void Msg1_transmitted(module_id_t module_idP, uint8_t CC_id,
|
||||
void Msg3_transmitted(module_id_t module_idP, uint8_t CC_id,
|
||||
frame_t frameP, uint8_t eNB_id){}
|
||||
|
||||
uint32_t ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
uint32_t nr_ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
uint8_t eNB_id, rnti_t rnti, sub_frame_t subframe){
|
||||
|
||||
uint32_t value = 0;
|
||||
@@ -193,3 +198,8 @@ void exit_fun(const char* s)
|
||||
undefined_function(__FUNCTION__);
|
||||
}
|
||||
|
||||
uint32_t ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
uint8_t eNB_id, rnti_t rnti, sub_frame_t subframe){
|
||||
uint32_t value = 0;
|
||||
return(value);
|
||||
}
|
||||
|
||||
@@ -54,26 +54,24 @@ void display_frame_configuration(NR_DL_FRAME_PARMS *frame_parms) {
|
||||
printf("\nTdd configuration tti %d downlink %d uplink %d period %d \n", frame_parms->ttis_per_subframe, frame_parms->p_tdd_UL_DL_Configuration->nrofDownlinkSlots,
|
||||
frame_parms->p_tdd_UL_DL_Configuration->nrofUplinkSlots, frame_parms->p_tdd_UL_DL_Configuration->dl_UL_TransmissionPeriodicity);
|
||||
|
||||
int k = (TDD_CONFIG_NB_FRAMES * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME) - 1; //19;
|
||||
int k = (TDD_CONFIG_NB_FRAMES * NR_NUMBER_OF_SUBFRAMES_PER_FRAME) - 1; //19;
|
||||
int tti = 0;
|
||||
for (int j = 0; j < TDD_CONFIG_NB_FRAMES * frame_parms->ttis_per_subframe * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME; j++) {
|
||||
for (int j = 0; j < TDD_CONFIG_NB_FRAMES * frame_parms->ttis_per_subframe * NR_NUMBER_OF_SUBFRAMES_PER_FRAME; j++) {
|
||||
int frame = 0;
|
||||
if (j != 0) {
|
||||
frame = (frame_parms->ttis_per_subframe * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)/j;
|
||||
tti = (j)%(frame_parms->ttis_per_subframe * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
|
||||
frame = (frame_parms->ttis_per_subframe * NR_NUMBER_OF_SUBFRAMES_PER_FRAME)/j;
|
||||
tti = (j)%(frame_parms->ttis_per_subframe * NR_NUMBER_OF_SUBFRAMES_PER_FRAME);
|
||||
}
|
||||
else {
|
||||
frame = 0;
|
||||
tti = 0;
|
||||
}
|
||||
|
||||
if (slot_select_nr(frame_parms, frame, tti) == NR_TDD_DOWNLINK_SLOT) {
|
||||
//if (frame_parms->tdd_uplink_nr[j] == NR_TDD_DOWNLINK_SLOT) {
|
||||
if (slot_select_nr(frame_parms, frame, tti) & NR_DOWNLINK_SLOT) {
|
||||
printf(" [%3d] D", j);
|
||||
}
|
||||
else {
|
||||
if (slot_select_nr(frame_parms, frame, tti) == NR_TDD_UPLINK_SLOT) {
|
||||
//if (frame_parms->tdd_uplink_nr[j] == NR_TDD_UPLINK_SLOT) {
|
||||
if (slot_select_nr(frame_parms, frame, tti) & NR_UPLINK_SLOT) {
|
||||
printf(" [%3d] U", j);
|
||||
}
|
||||
else {
|
||||
@@ -83,7 +81,7 @@ void display_frame_configuration(NR_DL_FRAME_PARMS *frame_parms) {
|
||||
}
|
||||
if (j == k) {
|
||||
printf("\n");
|
||||
k += (TDD_CONFIG_NB_FRAMES * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); // 20
|
||||
k += (TDD_CONFIG_NB_FRAMES * NR_NUMBER_OF_SUBFRAMES_PER_FRAME); // 20
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
@@ -120,7 +118,7 @@ void set_tti_test(NR_DL_FRAME_PARMS *frame_parms, int ttis_per_subframe)
|
||||
|
||||
int test_frame_configuration(PHY_VARS_NR_UE *PHY_vars_UE)
|
||||
{
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &(PHY_vars_UE->frame_parms);
|
||||
NR_DL_FRAME_PARMS *frame_parms = &(PHY_vars_UE->frame_parms);
|
||||
int v_return = 0;
|
||||
|
||||
#define NO_DOWNLINK_SYMBOL (0)
|
||||
|
||||
@@ -56,7 +56,7 @@ int test_harq_uplink(PHY_VARS_NR_UE *phy_vars_ue)
|
||||
int gNB_id = 0;
|
||||
int harq_pid = 0;
|
||||
int ndi = 1;
|
||||
nr_rnti_type_t rnti_type = C_RNTI_NR;
|
||||
uint8_t rnti_type = _C_RNTI_;
|
||||
int number_steps = 5;
|
||||
|
||||
printf("\nHARQ Uplink \n");
|
||||
@@ -113,7 +113,7 @@ int test_harq_downlink(PHY_VARS_NR_UE *phy_vars_ue)
|
||||
int gNB_id = 0;
|
||||
int harq_pid = 0;
|
||||
int ndi = 1;
|
||||
nr_rnti_type_t rnti_type = C_RNTI_NR;
|
||||
uint8_t rnti_type = _C_RNTI_;
|
||||
int number_steps = 5;
|
||||
int thread_number = 0;
|
||||
int TB_identifier = 0;
|
||||
|
||||
@@ -256,7 +256,7 @@ int init_test(unsigned char N_tx, unsigned char N_rx, unsigned char transmission
|
||||
frame_parms->threequarter_fs = 0;
|
||||
frame_parms->numerology_index = NUMEROLOGY_INDEX_MAX_NR;
|
||||
|
||||
nr_init_frame_parms_ue(config,frame_parms);
|
||||
nr_init_frame_parms_ue(frame_parms);
|
||||
|
||||
PHY_vars_UE->frame_parms.Nid_cell = (3 * N_ID_1_NUMBER) + N_ID_2_NUMBER; /* set to unvalid value */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user