Commit 5f0feaac authored by Florian Kaltenberger's avatar Florian Kaltenberger

Merge branch 'nr_pbchsim' into nr_pdsch

parents eba2c60c 0613a01f
......@@ -292,6 +292,8 @@ set(protobuf_generated_dir ${OPENAIR_BIN_DIR})
add_list2_option(RRC_ASN1_VERSION "Rel15" "ASN.1 version of RRC interface" "Rel8" "Rel10" "Rel14" "CBA")
Message("RRC_ASN1_VERSION is ${RRC_ASN1_VERSION}")
if (${RRC_ASN1_VERSION} STREQUAL "Rel8")
make_version(RRC_VERSION 8 6 0)
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-86.asn)
......@@ -321,14 +323,14 @@ endif (${RRC_ASN1_VERSION} STREQUAL "Rel8")
add_definitions(-DRRC_VERSION=${RRC_VERSION})
set (RRC_FULL_DIR ${asn1_generated_dir}/RRC_${RRC_ASN1_VERSION})
message("calling asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR}")
execute_process(COMMAND mkdir -p ${RRC_FULL_DIR}
COMMAND env asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR}
RESULT_VARIABLE ret
OUTPUT_QUIET
ERROR_QUIET)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0)
#execute_process(COMMAND mkdir -p ${RRC_FULL_DIR}
# COMMAND env asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR}
# RESULT_VARIABLE ret
# OUTPUT_QUIET
# ERROR_QUIET)
#if (NOT ${ret} STREQUAL 0)
# message(FATAL_ERROR "${ret}: error")
#endif (NOT ${ret} STREQUAL 0)
file(GLOB rrc_source ${RRC_FULL_DIR}/*.c)
file(GLOB rrc_h ${RRC_FULL_DIR}/*.h)
......@@ -362,15 +364,15 @@ add_definitions(-DNR_RRC_VERSION=${NR_RRC_VERSION})
set (NR_RRC_FULL_DIR ${asn1_generated_dir}/${NR_RRC_ASN1_VERSION})
message("calling ASN1C_PREFIX=NR_ asn1c -pdu=all -fcompound-names -findirect-choice -gen-PER -no-gen-OER -no-gen-example -D ${NR_RRC_FULL_DIR} ${NR_RRC_GRAMMAR}")
execute_process(COMMAND mkdir -p ${NR_RRC_FULL_DIR}
COMMAND env "ASN1C_PREFIX=NR_" asn1c -fcompound-names -findirect-choice -gen-PER -no-gen-OER -no-gen-example -D ${NR_RRC_FULL_DIR} ${NR_RRC_GRAMMAR}
RESULT_VARIABLE ret
OUTPUT_QUIET
ERROR_QUIET)
#execute_process(COMMAND mkdir -p ${NR_RRC_FULL_DIR}
# COMMAND env "ASN1C_PREFIX=NR_" asn1c -fcompound-names -findirect-choice -gen-PER -no-gen-OER -no-gen-example -D ${NR_RRC_FULL_DIR} ${NR_RRC_GRAMMAR}
# RESULT_VARIABLE ret
# OUTPUT_QUIET
# ERROR_QUIET)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0)
#if (NOT ${ret} STREQUAL 0)
# message(FATAL_ERROR "${ret}: error")
#endif (NOT ${ret} STREQUAL 0)
file(GLOB nr_rrc_source ${NR_RRC_FULL_DIR}/*.c)
file(GLOB nr_rrc_h ${NR_RRC_FULL_DIR}/*.h)
......@@ -426,14 +428,14 @@ add_definitions(-DS1AP_VERSION=${S1AP_VERSION})
set(S1AP_ASN_DIR ${S1AP_DIR}/MESSAGES/ASN1/${S1AP_RELEASE})
set(S1AP_C_DIR ${asn1_generated_dir}/S1AP_${S1AP_RELEASE})
message("calling ASN1C_PREFIX=S1AP_ asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES}")
execute_process(COMMAND mkdir -p ${S1AP_C_DIR}
COMMAND env "ASN1C_PREFIX=S1AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES}
RESULT_VARIABLE ret
OUTPUT_QUIET
ERROR_QUIET)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0)
#execute_process(COMMAND mkdir -p ${S1AP_C_DIR}
# COMMAND env "ASN1C_PREFIX=S1AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES}
# RESULT_VARIABLE ret
# OUTPUT_QUIET
# ERROR_QUIET)
#if (NOT ${ret} STREQUAL 0)
# message(FATAL_ERROR "${ret}: error")
#endif (NOT ${ret} STREQUAL 0)
file(GLOB S1AP_source ${S1AP_C_DIR}/*.c)
file(GLOB s1ap_h ${S1AP_C_DIR}/*.h)
......@@ -495,14 +497,14 @@ add_definitions(-DX2AP_VERSION=${X2AP_VERSION})
set(X2AP_ASN_DIR ${X2AP_DIR}/MESSAGES/ASN1/${X2AP_RELEASE})
set(X2AP_C_DIR ${asn1_generated_dir}/X2AP_${X2AP_RELEASE})
message("calling ASN1C_PREFIX=X2AP_ asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}")
execute_process(COMMAND mkdir -p ${X2AP_C_DIR}
COMMAND env "ASN1C_PREFIX=X2AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}
RESULT_VARIABLE ret
OUTPUT_QUIET
ERROR_QUIET)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0)
#execute_process(COMMAND mkdir -p ${X2AP_C_DIR}
# COMMAND env "ASN1C_PREFIX=X2AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}
# RESULT_VARIABLE ret
# OUTPUT_QUIET
# ERROR_QUIET)
#if (NOT ${ret} STREQUAL 0)
# message(FATAL_ERROR "${ret}: error")
#endif (NOT ${ret} STREQUAL 0)
file(GLOB X2AP_source ${X2AP_C_DIR}/*.c)
file(GLOB x2ap_h ${X2AP_C_DIR}/*.h)
......@@ -543,7 +545,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
......@@ -1461,7 +1465,7 @@ set(L2_SRC
${RRC_DIR}/L2_interface_ue.c
)
set(L2_NR_SRC
set(NR_L2_SRC
${NR_RRC_DIR}/rrc_gNB.c
${NR_RRC_DIR}/nr_rrc_common.c
${NR_RRC_DIR}/L2_nr_interface.c
......@@ -1513,14 +1517,6 @@ set(NR_L2_SRC_UE
${NR_UE_RRC_DIR}/L2_interface_ue.c
${NR_UE_RRC_DIR}/main_ue.c
${NR_UE_RRC_DIR}/rrc_UE.c
# ${NR_UE_RRC_DIR}/mac_vars.c
#${RRC_DIR}/rrc_UE.c
)
set(L2_NR_SRC_UE
${NR_UE_RRC_DIR}/L2_interface_ue.c
${NR_UE_RRC_DIR}/main_ue.c
${NR_UE_RRC_DIR}/rrc_UE.c
)
set (MAC_SRC
......@@ -1547,7 +1543,7 @@ set (MAC_SRC
${MAC_DIR}/config_ue.c
)
set (MAC_NR_SRC
set (NR_MAC_SRC
${NR_PHY_INTERFACE_DIR}/NR_IF_Module.c
${NR_MAC_DIR}/main.c
${NR_MAC_DIR}/config.c
......@@ -2530,10 +2526,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 -lm ${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 PHY_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB ${CONFIG_LIBRARIES} -Wl,--end-group m pthread dl ${ATLAS_LIBRARIES})
foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim)
......
......@@ -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
......@@ -687,11 +687,11 @@ function main() {
simlist="dlsim ulsim polartest ldpctest"
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
......
......@@ -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)
......@@ -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 */
......
......@@ -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;
......@@ -335,7 +335,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);
......@@ -378,7 +378,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)
{
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
nfapi_nr_config_request_t *gNB_config = &gNB->gNB_config;
......@@ -407,7 +407,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)
......
......@@ -983,3 +983,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;
//}
}
......@@ -59,9 +59,6 @@ char lte_cqi_snr_dB[15] = { -2,
unsigned char ue_power_offsets[25] = {14,11,9,8,7,6,6,5,4,4,4,3,3,3,2,2,2,1,1,1,1,1,0,0,0};
short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
int qam64_table[8],qam16_table[4],qpsk_table[2];
unsigned char cs_ri_normal[4] = {1,4,7,10};
......
......@@ -22,6 +22,7 @@
#ifndef __MODULATION_COMMON__H__
#define __MODULATION_COMMON__H__
#include "PHY/defs_common.h"
#include "PHY/defs_nr_common.h"
/** @addtogroup _PHY_MODULATION_
* @{
*/
......@@ -48,6 +49,7 @@ void PHY_ofdm_mod(int *input,
void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRAME_PARMS *frame_parms);
void nr_normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,NR_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);
......
......@@ -41,7 +41,7 @@
#include "refsig_defs_ue.h"
#include "PHY/defs_nr_UE.h"
//#include "nr_mod_table.h"
#include "nr_mod_table.h"
#include "log.h"
/*Table 7.4.1.1.2-1/2 from 38.211 */
......
#define NR_MOD_TABLE_SIZE_SHORT 686
#define NR_MOD_TABLE_BPSK_OFFSET 1
#define NR_MOD_TABLE_QPSK_OFFSET 3
#define NR_MOD_TABLE_QAM16_OFFSET 7
#define NR_MOD_TABLE_QAM64_OFFSET 23
#define NR_MOD_TABLE_QAM256_OFFSET 87
short nr_mod_table[MOD_TABLE_SIZE_SHORT] = {0,0,23170,23170,-23170,-23170,23170,23170,23170,-23170,-23170,23170,-23170,-23170,10362,10362,10362,31086,31086,10362,31086,31086,10362,-10362,10362,-31086,31086,-10362,31086,-31086,-10362,10362,-10362,31086,-31086,10362,-31086,31086,-10362,-10362,-10362,-31086,-31086,-10362,-31086,-31086,15169,15169,15169,5057,5057,15169,5057,5057,15169,25281,15169,35393,5057,25281,5057,35393,25281,15169,25281,5057,35393,15169,35393,5057,25281,25281,25281,35393,35393,25281,35393,35393,15169,-15169,15169,-5057,5057,-15169,5057,-5057,15169,-25281,15169,-35393,5057,-25281,5057,-35393,25281,-15169,25281,-5057,35393,-15169,35393,-5057,25281,-25281,25281,-35393,35393,-25281,35393,-35393,-15169,15169,-15169,5057,-5057,15169,-5057,5057,-15169,25281,-15169,35393,-5057,25281,-5057,35393,-25281,15169,-25281,5057,-35393,15169,-35393,5057,-25281,25281,-25281,35393,-35393,25281,-35393,35393,-15169,-15169,-15169,-5057,-5057,-15169,-5057,-5057,-15169,-25281,-15169,-35393,-5057,-25281,-5057,-35393,-25281,-15169,-25281,-5057,-35393,-15169,-35393,-5057,-25281,-25281,-25281,-35393,-35393,-25281,-35393,-35393,12566,12566,12566,17592,17592,12566,17592,17592,12566,7540,12566,2514,17592,7540,17592,2514,7540,12566,7540,17592,2514,12566,2514,17592,7540,7540,7540,2514,2514,7540,2514,2514,12566,27644,12566,22618,17592,27644,17592,22618,12566,32670,12566,37696,17592,32670,17592,37696,7540,27644,7540,22618,2514,27644,2514,22618,7540,32670,7540,37696,2514,32670,2514,37696,27644,12566,27644,17592,22618,12566,22618,17592,27644,7540,27644,2514,22618,7540,22618,2514,32670,12566,32670,17592,37696,12566,37696,17592,32670,7540,32670,2514,37696,7540,37696,2514,27644,27644,27644,22618,22618,27644,22618,22618,27644,32670,27644,37696,22618,32670,22618,37696,32670,27644,32670,22618,37696,27644,37696,22618,32670,32670,32670,37696,37696,32670,37696,37696,12566,-12566,12566,-17592,17592,-12566,17592,-17592,12566,-7540,12566,-2514,17592,-7540,17592,-2514,7540,-12566,7540,-17592,2514,-12566,2514,-17592,7540,-7540,7540,-2514,2514,-7540,2514,-2514,12566,-27644,12566,-22618,17592,-27644,17592,-22618,12566,-32670,12566,-37696,17592,-32670,17592,-37696,7540,-27644,7540,-22618,2514,-27644,2514,-22618,7540,-32670,7540,-37696,2514,-32670,2514,-37696,27644,-12566,27644,-17592,22618,-12566,22618,-17592,27644,-7540,27644,-2514,22618,-7540,22618,-2514,32670,-12566,32670,-17592,37696,-12566,37696,-17592,32670,-7540,32670,-2514,37696,-7540,37696,-2514,27644,-27644,27644,-22618,22618,-27644,22618,-22618,27644,-32670,27644,-37696,22618,-32670,22618,-37696,32670,-27644,32670,-22618,37696,-27644,37696,-22618,32670,-32670,32670,-37696,37696,-32670,37696,-37696,-12566,12566,-12566,17592,-17592,12566,-17592,17592,-12566,7540,-12566,2514,-17592,7540,-17592,2514,-7540,12566,-7540,17592,-2514,12566,-2514,17592,-7540,7540,-7540,2514,-2514,7540,-2514,2514,-12566,27644,-12566,22618,-17592,27644,-17592,22618,-12566,32670,-12566,37696,-17592,32670,-17592,37696,-7540,27644,-7540,22618,-2514,27644,-2514,22618,-7540,32670,-7540,37696,-2514,32670,-2514,37696,-27644,12566,-27644,17592,-22618,12566,-22618,17592,-27644,7540,-27644,2514,-22618,7540,-22618,2514,-32670,12566,-32670,17592,-37696,12566,-37696,17592,-32670,7540,-32670,2514,-37696,7540,-37696,2514,-27644,27644,-27644,22618,-22618,27644,-22618,22618,-27644,32670,-27644,37696,-22618,32670,-22618,37696,-32670,27644,-32670,22618,-37696,27644,-37696,22618,-32670,32670,-32670,37696,-37696,32670,-37696,37696,-12566,-12566,-12566,-17592,-17592,-12566,-17592,-17592,-12566,-7540,-12566,-2514,-17592,-7540,-17592,-2514,-7540,-12566,-7540,-17592,-2514,-12566,-2514,-17592,-7540,-7540,-7540,-2514,-2514,-7540,-2514,-2514,-12566,-27644,-12566,-22618,-17592,-27644,-17592,-22618,-12566,-32670,-12566,-37696,-17592,-32670,-17592,-37696,-7540,-27644,-7540,-22618,-2514,-27644,-2514,-22618,-7540,-32670,-7540,-37696,-2514,-32670,-2514,-37696,-27644,-12566,-27644,-17592,-22618,-12566,-22618,-17592,-27644,-7540,-27644,-2514,-22618,-7540,-22618,-2514,-32670,-12566,-32670,-17592,-37696,-12566,-37696,-17592,-32670,-7540,-32670,-2514,-37696,-7540,-37696,-2514,-27644,-27644,-27644,-22618,-22618,-27644,-22618,-22618,-27644,-32670,-27644,-37696,-22618,-32670,-22618,-37696,-32670,-27644,-32670,-22618,-37696,-27644,-37696,-22618,-32670,-32670,-32670,-37696,-37696,-32670,-37696,-37696};
\ No newline at end of file
short nr_mod_table[NR_MOD_TABLE_SIZE_SHORT] = {0,0,23170,23170,-23170,-23170,23170,23170,23170,-23170,-23170,23170,-23170,-23170,10362,10362,10362,31086,31086,10362,31086,31086,10362,-10362,10362,-31086,31086,-10362,31086,-31086,-10362,10362,-10362,31086,-31086,10362,-31086,31086,-10362,-10362,-10362,-31086,-31086,-10362,-31086,-31086,15169,15169,15169,5057,5057,15169,5057,5057,15169,25281,15169,35393,5057,25281,5057,35393,25281,15169,25281,5057,35393,15169,35393,5057,25281,25281,25281,35393,35393,25281,35393,35393,15169,-15169,15169,-5057,5057,-15169,5057,-5057,15169,-25281,15169,-35393,5057,-25281,5057,-35393,25281,-15169,25281,-5057,35393,-15169,35393,-5057,25281,-25281,25281,-35393,35393,-25281,35393,-35393,-15169,15169,-15169,5057,-5057,15169,-5057,5057,-15169,25281,-15169,35393,-5057,25281,-5057,35393,-25281,15169,-25281,5057,-35393,15169,-35393,5057,-25281,25281,-25281,35393,-35393,25281,-35393,35393,-15169,-15169,-15169,-5057,-5057,-15169,-5057,-5057,-15169,-25281,-15169,-35393,-5057,-25281,-5057,-35393,-25281,-15169,-25281,-5057,-35393,-15169,-35393,-5057,-25281,-25281,-25281,-35393,-35393,-25281,-35393,-35393,12566,12566,12566,17592,17592,12566,17592,17592,12566,7540,12566,2514,17592,7540,17592,2514,7540,12566,7540,17592,2514,12566,2514,17592,7540,7540,7540,2514,2514,7540,2514,2514,12566,27644,12566,22618,17592,27644,17592,22618,12566,32670,12566,37696,17592,32670,17592,37696,7540,27644,7540,22618,2514,27644,2514,22618,7540,32670,7540,37696,2514,32670,2514,37696,27644,12566,27644,17592,22618,12566,22618,17592,27644,7540,27644,2514,22618,7540,22618,2514,32670,12566,32670,17592,37696,12566,37696,17592,32670,7540,32670,2514,37696,7540,37696,2514,27644,27644,27644,22618,22618,27644,22618,22618,27644,32670,27644,37696,22618,32670,22618,37696,32670,27644,32670,22618,37696,27644,37696,22618,32670,32670,32670,37696,37696,32670,37696,37696,12566,-12566,12566,-17592,17592,-12566,17592,-17592,12566,-7540,12566,-2514,17592,-7540,17592,-2514,7540,-12566,7540,-17592,2514,-12566,2514,-17592,7540,-7540,7540,-2514,2514,-7540,2514,-2514,12566,-27644,12566,-22618,17592,-27644,17592,-22618,12566,-32670,12566,-37696,17592,-32670,17592,-37696,7540,-27644,7540,-22618,2514,-27644,2514,-22618,7540,-32670,7540,-37696,2514,-32670,2514,-37696,27644,-12566,27644,-17592,22618,-12566,22618,-17592,27644,-7540,27644,-2514,22618,-7540,22618,-2514,32670,-12566,32670,-17592,37696,-12566,37696,-17592,32670,-7540,32670,-2514,37696,-7540,37696,-2514,27644,-27644,27644,-22618,22618,-27644,22618,-22618,27644,-32670,27644,-37696,22618,-32670,22618,-37696,32670,-27644,32670,-22618,37696,-27644,37696,-22618,32670,-32670,32670,-37696,37696,-32670,37696,-37696,-12566,12566,-12566,17592,-17592,12566,-17592,17592,-12566,7540,-12566,2514,-17592,7540,-17592,2514,-7540,12566,-7540,17592,-2514,12566,-2514,17592,-7540,7540,-7540,2514,-2514,7540,-2514,2514,-12566,27644,-12566,22618,-17592,27644,-17592,22618,-12566,32670,-12566,37696,-17592,32670,-17592,37696,-7540,27644,-7540,22618,-2514,27644,-2514,22618,-7540,32670,-7540,37696,-2514,32670,-2514,37696,-27644,12566,-27644,17592,-22618,12566,-22618,17592,-27644,7540,-27644,2514,-22618,7540,-22618,2514,-32670,12566,-32670,17592,-37696,12566,-37696,17592,-32670,7540,-32670,2514,-37696,7540,-37696,2514,-27644,27644,-27644,22618,-22618,27644,-22618,22618,-27644,32670,-27644,37696,-22618,32670,-22618,37696,-32670,27644,-32670,22618,-37696,27644,-37696,22618,-32670,32670,-32670,37696,-37696,32670,-37696,37696,-12566,-12566,-12566,-17592,-17592,-12566,-17592,-17592,-12566,-7540,-12566,-2514,-17592,-7540,-17592,-2514,-7540,-12566,-7540,-17592,-2514,-12566,-2514,-17592,-7540,-7540,-7540,-2514,-2514,-7540,-2514,-2514,-12566,-27644,-12566,-22618,-17592,-27644,-17592,-22618,-12566,-32670,-12566,-37696,-17592,-32670,-17592,-37696,-7540,-27644,-7540,-22618,-2514,-27644,-2514,-22618,-7540,-32670,-7540,-37696,-2514,-32670,-2514,-37696,-27644,-12566,-27644,-17592,-22618,-12566,-22618,-17592,-27644,-7540,-27644,-2514,-22618,-7540,-22618,-2514,-32670,-12566,-32670,-17592,-37696,-12566,-37696,-17592,-32670,-7540,-32670,-2514,-37696,-7540,-37696,-2514,-27644,-27644,-27644,-22618,-22618,-27644,-22618,-22618,-27644,-32670,-27644,-37696,-22618,-32670,-22618,-37696,-32670,-27644,-32670,-22618,-37696,-27644,-37696,-22618,-32670,-32670,-32670,-37696,-37696,-32670,-37696,-37696};
......@@ -39,7 +39,8 @@
//#define DEBUG_PBCH_ENCODING
//#define DEBUG_PBCH_DMRS
extern short nr_mod_table[NR_MOD_TABLE_SIZE_SHORT];
//extern short nr_mod_table[NR_MOD_TABLE_SIZE_SHORT];
#include "PHY/NR_REFSIG/nr_mod_table.h"
int nr_generate_pbch_dmrs(uint32_t *gold_pbch_dmrs,
int32_t **txdataF,
......
......@@ -22,7 +22,7 @@
#include "PHY/NR_TRANSPORT/nr_transport.h"
//#define NR_PSS_DEBUG
#define NR_PSS_DEBUG
int nr_generate_pss( int16_t *d_pss,
int32_t **txdataF,
......@@ -52,7 +52,7 @@ int nr_generate_pss( int16_t *d_pss,
}
#ifdef NR_PSS_DEBUG
write_output("d_pss.m", "d_pss", (void*)d_pss, NR_PSS_LENGTH, 1, 1);
write_output("d_pss.m", "d_pss", (void*)d_pss, NR_PSS_LENGTH, 1, 0);
#endif
/// Resource mapping
......@@ -75,7 +75,7 @@ int nr_generate_pss( int16_t *d_pss,
}
#ifdef NR_PSS_DEBUG
write_output("pss_0.m", "pss_0", (void*)txdataF[0][2*l*frame_parms->ofdm_symbol_size], frame_parms->ofdm_symbol_size, 1, 1);
write_output("pss_0.m", "pss_0", (void*)&txdataF[0][2*l*frame_parms->ofdm_symbol_size], frame_parms->ofdm_symbol_size, 1, 1);
#endif
return 0;
......
......@@ -1335,6 +1335,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b;
//if (frame_parms->mode1_flag==1) // 10 out of 12 so don't reduce size
if (symbol == 2){
pilots=1;
......
......@@ -197,13 +197,15 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode)
* sync_pos SS/PBCH block
*/
cnt++;
if (cnt >100){
cnt =0;
if (1){
cnt =0;
/* process pss search on received buffer */
sync_pos = pss_synchro_nr(ue, NO_RATE_CHANGE);
sync_pos_slot = (frame_parms->samples_per_tti>>1) - 3*(frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples);
sync_pos = sync_pos_slot+frame_parms->nb_prefix_samples;
if (sync_pos >= frame_parms->nb_prefix_samples)
sync_pos2 = sync_pos - frame_parms->nb_prefix_samples;
else
......
......@@ -35,7 +35,7 @@
#include "PHY/sse_intrin.h"
//#include "SIMULATION/TOOLS/sim.h"
//#define DEBUG_PBCH 1
#define DEBUG_PBCH 1
//#define DEBUG_PBCH_ENCODING
#ifdef OPENAIR2
......@@ -247,6 +247,9 @@ void nr_pbch_channel_compensation(int **rxdataF_ext,
uint8_t output_shift)
{
short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
uint16_t rb,nb_rb=20;
uint8_t aatx,aarx;
#if defined(__x86_64__) || defined(__i386__)
......@@ -554,8 +557,10 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
for (symbol=5; symbol<8; symbol++) {
#ifdef DEBUG_PBCH
//printf("address dataf %p",nr_ue_common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe_rx]].rxdataF);
//write_output("rxdataF0_pbch.m","rxF0pbch",nr_ue_common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe_rx]].rxdataF,frame_parms->ofdm_symbol_size*4,2,1);
write_output("rxdataF0_pbch.m","rxF0pbch",nr_ue_common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe_rx]].rxdataF,frame_parms->ofdm_symbol_size*4,2,1);
#endif
nr_pbch_extract(nr_ue_common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe_rx]].rxdataF,
nr_ue_common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe_rx]].dl_ch_estimates[eNB_id],
......@@ -585,8 +590,10 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
symbol,
log2_maxh); // log2_maxh+I0_shift
//write_output("rxdataF_comp.m","rxFcomp",nr_ue_pbch_vars->rxdataF_comp,180,2,1);
#ifdef DEBUG_PBCH
write_output("rxdataF_comp.m","rxFcomp",nr_ue_pbch_vars->rxdataF_comp,180,2,1);
#endif
/*if (frame_parms->nb_antennas_rx > 1)
pbch_detection_mrc(frame_parms,
nr_ue_pbch_vars->rxdataF_comp,
......
......@@ -57,6 +57,8 @@
*
*********************************************************************/
#define DBG_PSS_NR
void *get_idft(int ofdm_symbol_size)
{
void (*idft)(int16_t *,int16_t *, int);
......@@ -791,18 +793,6 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain
/* Correlation computation is based on a a dot product which is realized thank to SIMS extensions */
for (n=0; n < length; n+=4) {
#ifdef RTAI_ENABLED
// This is necessary since the sync takes a long time and it seems to block all other threads thus screwing up RTAI. If we pause it for a little while during its execution we give RTAI a chance to catch up with its other tasks.
if ((n%frame_parms->samples_per_subframe == 0) && (n>0) && (openair_daq_vars.sync_state==0)) {
#ifdef DEBUG_PHY
msg("[SYNC TIME] pausing for 1000ns, n=%d\n",n);
#endif
rt_sleep(nano2count(1000));
}
#endif
for (int pss_index = 0; pss_index < NUMBER_PSS_SEQUENCE; pss_index++) {
pss_corr_ue[pss_index][n] = 0; /* clean correlation for position n */
......
This diff is collapsed.
......@@ -53,9 +53,12 @@
#define ONE_OVER_SQRT2_Q15 23170
#define ONE_OVER_TWO_Q15 16384
#define NR_MOD_TABLE_SIZE_SHORT 14
#define NR_MOD_TABLE_SIZE_SHORT 686
#define NR_MOD_TABLE_BPSK_OFFSET 1
#define NR_MOD_TABLE_QPSK_OFFSET 3
#define NR_MOD_TABLE_QAM16_OFFSET 7
#define NR_MOD_TABLE_QAM64_OFFSET 23
#define NR_MOD_TABLE_QAM256_OFFSET 87
#define NR_PSS_LENGTH 127
#define NR_SSS_LENGTH 127
......
......@@ -38,6 +38,7 @@ extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX];
extern unsigned int DAQ_MBOX;
extern int number_of_cards;
extern short conjugate[8],conjugate2[8];
#ifndef OCP_FRAMEWORK
//extern PHY_VARS_eNB ***PHY_vars_eNB_g;
......
......@@ -19,8 +19,8 @@
* contact@openairinterface.org
*/
#ifndef __PHY_EXTERN_UE__H__
#define __PHY_EXTERN_UE__H__
#ifndef __PHY_EXTERN_NR_UE__H__
#define __PHY_EXTERN_NR_UE__H__
#include "PHY/defs_nr_UE.h"
//#include "common/ran_context.h"
......
......@@ -36,6 +36,7 @@ extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX];
extern int number_of_cards;
extern short conjugate[8],conjugate2[8];
#ifndef OCP_FRAMEWORK
extern PHY_VARS_UE ***PHY_vars_UE_g;
......
......@@ -61,7 +61,8 @@ unsigned short rev256[256],rev512[512],rev1024[1024],rev4096[4096],rev2048[2048]
char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"};
short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
#include "SIMULATION/ETH_TRANSPORT/vars.h"
......
......@@ -57,6 +57,8 @@ unsigned short rev256[256],rev512[512],rev1024[1024],rev4096[4096],rev2048[2048]
char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"};
short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
#include "SIMULATION/ETH_TRANSPORT/vars.h"
......
......@@ -56,6 +56,8 @@ unsigned short rev256[256],rev512[512],rev1024[1024],rev4096[4096],rev2048[2048]
char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"};
short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
#include "SIMULATION/ETH_TRANSPORT/vars.h"
......
......@@ -42,8 +42,8 @@ void handle_nr_nfapi_bch_pdu(PHY_VARS_gNB *gNB,
uint8_t *sdu)
{
AssertFatal(dl_config_pdu->bch_pdu.bch_pdu_rel15.length == 3, "BCH PDU has length %d != 3\n",
dl_config_pdu->bch_pdu.bch_pdu_rel15.length);
AssertFatal(dl_config_pdu->bch_pdu_rel15.length == 3, "BCH PDU has length %d != 3\n",
dl_config_pdu->bch_pdu_rel15.length);
LOG_I(PHY,"pbch_pdu[0]: %x,pbch_pdu[1]: %x,gNB->pbch_pdu[2]: %x\n",sdu[0],sdu[1],sdu[2]);
gNB->pbch_pdu[0] = sdu[2];
......@@ -108,9 +108,9 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
//LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type);
switch (dl_config_pdu->pdu_type) {
case NFAPI_NR_DL_CONFIG_BCH_PDU_TYPE:
AssertFatal(dl_config_pdu->bch_pdu.bch_pdu_rel15.pdu_index < TX_req->tx_request_body.number_of_pdus,
AssertFatal(dl_config_pdu->bch_pdu_rel15.pdu_index < TX_req->tx_request_body.number_of_pdus,
"bch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n",
dl_config_pdu->bch_pdu.bch_pdu_rel15.pdu_index,
dl_config_pdu->bch_pdu_rel15.pdu_index,
TX_req->tx_request_body.number_of_pdus);
gNB->pbch_configured=1;
do_oai=1;
......@@ -118,7 +118,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
handle_nr_nfapi_bch_pdu(gNB,
proc,
dl_config_pdu,
TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->bch_pdu.bch_pdu_rel15.pdu_index].segments[0].segment_data);
TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->bch_pdu_rel15.pdu_index].segments[0].segment_data);
break;
case NFAPI_NR_DL_CONFIG_DCI_DL_PDU_TYPE:
......
......@@ -37,6 +37,7 @@
lte_subframe_t nr_subframe_select (nfapi_nr_config_request_t *cfg, unsigned char subframe);
void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *fp);
void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, gNB_rxtx_proc_t *proc, int do_meas);
void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int subframe);
void nr_init_feptx_thread(RU_t *ru,pthread_attr_t *attr_feptx);
void nr_feptx_ofdm(RU_t *ru);
void nr_feptx_ofdm_2thread(RU_t *ru);
......
This diff is collapsed.
......@@ -39,9 +39,10 @@ typedef int nfapi_nr_pfcch_commonSearchSpaces_t;
#include "../nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/INIT/init_extern.h"
#include "PHY/phy_extern_nr_ue.h"
#include "PHY/NR_TRANSPORT/nr_transport.h"
#include "PHY/INIT/init_extern.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
#include "PHY/NR_REFSIG/ss_pbch_nr.h"
#include "PHY/NR_REFSIG/pss_nr.h"
......@@ -222,7 +223,7 @@ void set_sequence_sss(PHY_VARS_NR_UE *PHY_vars_UE, int offset, int slot_offset)
}
#else
insert_sss_nr(&tmp, frame_parms);
insert_sss_nr(tmp, frame_parms);
#endif
}
......@@ -393,7 +394,7 @@ int main(int argc, char *argv[])
int size_test_position;
/* this is a pointer to the function in charge of the test */
int (*p_test_synchro_pss_sss)(PHY_VARS_NR_UE *PHY_vars_UE, int position_symbol, int sequence_number, test_t *test) = test_synchro_pss_sss;
int (*p_test_synchro_pss_sss)(PHY_VARS_NR_UE *PHY_vars_UE, int position_symbol, int sequence_number) = test_synchro_pss_sss_nr;
#if 0
int Nid_cell[] = { (3*0+0), (3*71+0), (3*21+2), (3*21+2), (3*55+1), (3*111+2) };
......@@ -413,21 +414,19 @@ int main(int argc, char *argv[])
size_test_position = sizeof