Commit df18f593 authored by Florian Kaltenberger's avatar Florian Kaltenberger

adding first version of the pbchsim. so far only freq domain signal generated.

not all regression tests done (had to touch some header files)
parent 471b5efe
......@@ -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
......@@ -2517,10 +2519,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 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 */
......
......@@ -298,7 +298,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);
......@@ -341,7 +341,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;
......@@ -370,7 +370,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)
......
......@@ -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,
......
......@@ -19,9 +19,10 @@
* contact@openairinterface.org
*/
/*#ifndef __INIT_DEFS_NR__H__
#ifndef __INIT_DEFS_NR__H__
#define __INIT_DEFS_NR__H__
/*
#define _GNU_SOURCE
#include <sched.h>
#include <stdio.h>
......@@ -44,6 +45,7 @@
#include "defs.h"
#include "assertions.h"*/
#include "impl_defs_nr.h"
#include "defs_nr_common.h"
#define MAX_NUM_SUBCARRIER_SPACING 5
......@@ -58,6 +60,7 @@
#define MOD_TABLE_SIZE_SHORT 6
#define MOD_TABLE_BPSK_OFFSET 1
/*
typedef enum {
NR_MU_0=0,
NR_MU_1,
......@@ -93,6 +96,7 @@ typedef struct {
uint32_t samples_per_frame_wCP;
} NR_DL_FRAME_PARMS;
*/
/// Top-level PHY Data Structure for gNB
typedef struct PHY_VARS_gNB_s {
......
......@@ -36,6 +36,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(test_position)/sizeof(int);
printf("***********************************\n");
printf(" %s Test NR synchronisation \n", test.test_current);
printf(" %s Test NR synchroisation \n", test.test_current);
printf("***********************************\n");
for (unsigned int index = 0; index < (sizeof(Nid_cell)/sizeof(int)); index++) {
PHY_vars_eNB->frame_parms.Nid_cell = Nid_cell[index];
Nid2 = GET_NID2(PHY_vars_eNB->frame_parms.Nid_cell);
Nid1 = GET_NID1(PHY_vars_eNB->frame_parms.Nid_cell);
Nid2 = GET_NID2(Nid_cell[index]);
Nid1 = GET_NID1(Nid_cell[index]);
for (int position = 0; position < size_test_position; position++) {
PHY_vars_UE->frame_parms.Nid_cell = (3 * N_ID_1_NUMBER) + N_ID_2_NUMBER; /* set to unvalid value */
decoded_pbch = (*p_test_synchro_pss_sss)(PHY_vars_UE, test_position[position], Nid2, &test); /* return phase index which gives phase error from an array */
decoded_pbch = (*p_test_synchro_pss_sss)(PHY_vars_UE, test_position[position], Nid2); /* return phase index which gives phase error from an array */
test.number_of_tests++;
printf("\n%s ", test.test_current);
......
......@@ -398,7 +398,7 @@ void multipath_tv_channel(channel_desc_t *desc,
double N_RB2sampling_rate(uint16_t N_RB);
double N_RB2channel_bandwidth(uint16_t N_RB);
#include "targets/RT/USER/rfsim.h"
//#include "targets/RT/USER/rfsim.h"
void do_DL_sig(sim_t *sim,
uint16_t subframe,
......
......@@ -94,8 +94,6 @@ unsigned short config_frames[4] = {2,9,11,13};
// current status is that every UE has a DL scope for a SINGLE eNB (gnb_id=0)
// at eNB 0, an UL scope for every UE
short nr_mod_table[NR_MOD_TABLE_SIZE_SHORT] = {0,0,23170,23170,-23170,-23170,23170,23170,23170,-23170,-23170,23170,-23170,-23170};
FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX];
FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
FD_stats_form *form_stats=NULL,*form_stats_l2=NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment