Commit f6821718 authored by Sravan Chintareddy's avatar Sravan Chintareddy

initial fr2 commit

parent 69aef468
......@@ -705,7 +705,7 @@ function main() {
$build_dir updatefw \
updatefw $dbin/updatefw
echo_info "Compiling oarf tools. The logfile for compilation is here: $dlog/oarf.txt"
make -C $OPENAIR_DIR/cmake_targets/$build_dir/build oarf > $dlog/oarf.txt 2>&1
make -j4 -C $OPENAIR_DIR/cmake_targets/$build_dir/build oarf > $dlog/oarf.txt 2>&1
cp $OPENAIR_DIR/cmake_targets/$build_dir/build/*.oct $dbin
if [ -s $dbin/oarf_config_exmimo.oct ] ; then
echo_success "oarf tools compiled"
......
cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE )
set ( CFLAGS_PROCESSOR_USER "" )
set ( UE_EXPANSION False )
set ( PRE_SCD_THREAD False )
set ( UESIM_EXPANSION False )
set ( RRC_ASN1_VERSION "Rel15")
set ( NR_RRC_ASN1_VERSION "NR_Rel15")
set ( ENABLE_VCD_FIFO False )
set ( RF_BOARD "None")
set ( TRANSP_PRO "None")
set ( PACKAGE_NAME "nr-softmodem")
set ( DEADLINE_SCHEDULER "False" )
set ( CPU_AFFINITY "False" )
set ( T_TRACER True )
set ( UE_AUTOTEST_TRACE False )
set ( UE_DEBUG_TRACE False )
set ( UE_TIMING_TRACE False )
set ( USRP_REC_PLAY False )
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)
......@@ -74,7 +74,7 @@ int processoption(paramdef_t *cfgoptions, char *value) {
if ( value == NULL) {
if( (cfgoptions->paramflags &PARAMFLAG_BOOL) == 0 ) { /* not a boolean, argument required */
CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname);
fprintf(stderr, "[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname);
} else { /* boolean value option without argument, set value to true*/
tmpval = defbool;
}
......@@ -91,7 +91,7 @@ int processoption(paramdef_t *cfgoptions, char *value) {
sprintf( (char *)(cfgoptions->strptr), "%s",tmpval);
}
printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval);
fprintf(stderr, "[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval);
optisset=1;
break;
......@@ -208,6 +208,10 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
char cfgpath[CONFIG_MAXOPTLENGTH];
j = 0;
i = 0;
if (prefix == NULL)
fprintf(stderr,"-###-\nNULL\n-###-\n");
else
fprintf(stderr,"-###-\n%s\n-###-\n",prefix);
while (c > 0 ) {
char *oneargv = strdup(config_get_if()->argv[i]); /* we use strtok_r which modifies its string paramater, and we don't want argv to be modified */
......@@ -291,6 +295,6 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
c--;
} /* fin du while */
printf_cmdl("[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "(root)":prefix),j);
fprintf(stderr, "[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "(root)":prefix),j);
return j;
} /* parse_cmdline*/
/usr/share/automake-1.15/COPYING
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
/usr/share/automake-1.15/compile
\ No newline at end of file
/usr/share/automake-1.15/config.guess
\ No newline at end of file
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
#undef CRAY_STACKSEG_END
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
#undef HAVE_ALLOCA_H
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <libintl.h> header file. */
#undef HAVE_LIBINTL_H
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#undef HAVE_MALLOC
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
and to 0 otherwise. */
#undef HAVE_REALLOC
/* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT
/* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strstr' function. */
#undef HAVE_STRSTR
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at runtime.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* SVN Revision */
#undef SVN_REVISION
/* Version number of package */
#undef VERSION
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT32_T
/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT64_T
/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT8_T
/* Define to the type of a signed integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
#undef int16_t
/* Define to the type of a signed integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
#undef int32_t
/* Define to the type of a signed integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */
#undef int64_t
/* Define to the type of a signed integer type of width exactly 8 bits if such
a type exists and the standard includes do not define it. */
#undef int8_t
/* Define to rpl_malloc if the replacement function should be used. */
#undef malloc
/* Define to rpl_realloc if the replacement function should be used. */
#undef realloc
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
/* Define to `int' if <sys/types.h> does not define. */
#undef ssize_t
/* Define to the type of an unsigned integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
#undef uint16_t
/* Define to the type of an unsigned integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
#undef uint32_t
/* Define to the type of an unsigned integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */
#undef uint64_t
/* Define to the type of an unsigned integer type of width exactly 8 bits if
such a type exists and the standard includes do not define it. */
#undef uint8_t
/usr/share/automake-1.15/config.sub
\ No newline at end of file
/usr/share/automake-1.15/depcomp
\ No newline at end of file
/usr/share/automake-1.15/install-sh
\ No newline at end of file
/usr/share/automake-1.15/missing
\ No newline at end of file
......@@ -284,8 +284,8 @@ extern "C" {
void *(*start_routine)(void *),
void *args_p)
{
task_list_t *t=&tasks[task_id];
threadCreate (&t->thread, start_routine, args_p, (char*)itti_get_task_name(task_id),-1,OAI_PRIORITY_RT);
task_list_t *t=&tasks[task_id]; //--------src572
threadCreate (&t->thread, start_routine, args_p, (char*)itti_get_task_name(task_id),-1,OAI_PRIORITY_RT); //-- this creates a pthread
LOG_I(TMR,"Created Posix thread %s\n", itti_get_task_name(task_id) );
return 0;
}
......@@ -309,6 +309,8 @@ extern "C" {
{
AssertFatal(TASK_MAX<UINT16_MAX, "Max itti tasks");
fprintf(stderr, "%s\n","itti_init() in openairinterface5g/common/utils/ocp_itti/intertask_interface.cpp line 313 \n" ); // ---src572
for(int i=0; i<task_max; ++i) {
LOG_I(TMR,"Starting itti queue: %s as task %d\n", tasks_info[i].name, i);
pthread_mutex_init(&tasks[i].queue_cond_lock, NULL);
......@@ -318,7 +320,11 @@ extern "C" {
itti_subscribe_event_fd((task_id_t)i, tasks[i].sem_fd);
if (tasks[i].admin.threadFunc != NULL)
itti_create_task((task_id_t)i, tasks[i].admin.threadFunc, NULL);
{
itti_create_task((task_id_t)i, tasks[i].admin.threadFunc, NULL);
fprintf(stderr, "%s\n","itti_init() line 325 checking if threads get created\n" ); // ---src572
}
}
return 0;
......
......@@ -308,7 +308,7 @@ typedef struct {
TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_MAX, TASK_PRIORITY_MED, 200, NULL, NULL)
#define TASK_DEF(TaskID, pRIO, qUEUEsIZE, FuNc, ThreadFunc) { pRIO, qUEUEsIZE, #TaskID, FuNc, ThreadFunc },
#define TASK_DEF(TaskID, pRIO, qUEUEsIZE, FuNc, ThreadFunc) { pRIO, qUEUEsIZE, #TaskID, FuNc, ThreadFunc },
/* Map task id to printable name. */
static const task_info_t tasks_info[] = {
......
......@@ -149,7 +149,8 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
#define TICK_TO_US(ts) (ts.trials==0?0:ts.diff/ts.trials)
static inline int rxtx(PHY_VARS_gNB *gNB,int frame_rx, int slot_rx, int frame_tx, int slot_tx, char *thread_name) {
static inline int rxtx(PHY_VARS_gNB *gNB,int frame_rx, int slot_rx, int frame_tx, int slot_tx, char *thread_name)
{
start_meas(&softmodem_stats_rxtx_sf);
// *******************************************************************
......@@ -212,6 +213,7 @@ static inline int rxtx(PHY_VARS_gNB *gNB,int frame_rx, int slot_rx, int frame_tx
//if (wait_CCs(proc)<0) return(-1);
if (oai_exit) return(-1);
// fprintf(stderr, "%s\n","\n $$$$$$$\n in line 218 ----src572 rxtx() in executables/nr-gnb.c\n $$$$$$$$\n" );
if(get_thread_parallel_conf() != PARALLEL_RU_L1_TRX_SPLIT) {
phy_procedures_gNB_TX(gNB, frame_tx,slot_tx, 1);
......@@ -269,8 +271,13 @@ static void *gNB_L1_thread_tx(void *param) {
char thread_name[100];
sprintf(thread_name,"gNB_L1_thread_tx\n");
// fprintf(stderr, "%s\n", "\n $$$$$$ \n ----src572---- in gNB_L1_thread_tx() in executables/nr_gnb.c\n $$$$$$$$\n");
while (!oai_exit)
{
// fprintf(stderr, "%s\n", "\n $$$$$$ \n ----src572---- in gNB_L1_thread_tx() in executables/nr_gnb.c\n $$$$$$$$\n");
while (!oai_exit) {
if (wait_on_condition(&L1_proc_tx->mutex,&L1_proc_tx->cond,&L1_proc_tx->instance_cnt,thread_name)<0) break;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1, 1 );
......@@ -287,6 +294,7 @@ static void *gNB_L1_thread_tx(void *param) {
uint64_t timestamp_tx = L1_proc_tx->timestamp_tx;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_TX1_GNB,slot_tx);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_GNB,frame_tx);
// fprintf(stderr, "%s\n", "in gNB_L1_thread_tx() line 291 in executables/nr-gnb.c");
phy_procedures_gNB_TX(gNB, frame_tx,slot_tx, 1);
pthread_mutex_lock( &L1_proc_tx->mutex );
L1_proc_tx->instance_cnt = -1;
......@@ -323,9 +331,11 @@ static void *gNB_L1_thread( void *param ) {
gNB_thread_rxtx_status = 0;
sprintf(thread_name,"gNB_L1_thread");
// fprintf(stderr, "%s\n", "\n $$$$$$ \n ----src572---- in gNB_L1_thread() in executables/nr_gnb.c\n $$$$$$$$\n");
while (!oai_exit) {
// fprintf(stderr, "%s\n", "\n $$$$$$ \n ----src572---- in gNB_L1_thread() in executables/nr_gnb.c\n $$$$$$$$\n");
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX0, 0 );
if (wait_on_condition(&L1_proc->mutex,&L1_proc->cond,&L1_proc->instance_cnt,thread_name)<0) break;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX0, 1 );
......@@ -387,11 +397,13 @@ void gNB_top(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, char *string, struct
gNB_L1_proc_t *proc = &gNB->proc;
gNB_L1_rxtx_proc_t *L1_proc = &proc->L1_proc;
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
RU_proc_t *ru_proc=&ru->proc;
RU_proc_t *ru_proc = &ru->proc;
proc->frame_rx = frame_rx;
proc->slot_rx = slot_rx;
// fprintf(stderr, "%s\n","\n$$$$$$ ----src572 ----- in gNB_top() line 403 in executables/nr-gnb.c\n $$$$$$\n" );
if (!oai_exit) {
if (!oai_exit)
{
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->slot_rx));
L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sl_ahead*fp->samples_per_slot);
L1_proc->frame_rx = ru_proc->frame_rx;
......@@ -537,7 +549,7 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) {
}
else { // all RUs have provided their information so continue on and wakeup gNB processing
proc->RU_mask = 0;
AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_RU))==0,"muex_unlock returns %d\n",ret);
AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_RU))==0,"mutex_unlock returns %d\n",ret);
}
......@@ -862,13 +874,16 @@ void init_eNB_afterRU(void) {
PHY_VARS_gNB *gNB;
LOG_I(PHY,"%s() RC.nb_nr_inst:%d\n", __FUNCTION__, RC.nb_nr_inst);
for (inst=0; inst<RC.nb_nr_inst; inst++) {
for (inst=0; inst<RC.nb_nr_inst; inst++)
{
LOG_I(PHY,"RC.nb_nr_CC[inst]:%d\n", RC.nb_nr_CC[inst]);
for (CC_id=0; CC_id<RC.nb_nr_CC[inst]; CC_id++) {
for (CC_id=0; CC_id<RC.nb_nr_CC[inst]; CC_id++)
{
LOG_I(PHY,"RC.nb_nr_CC[inst:%d][CC_id:%d]:%p\n", inst, CC_id, RC.gNB[inst][CC_id]);
gNB = RC.gNB[inst][CC_id];
gNB = RC.gNB[inst][CC_id];
phy_init_nr_gNB(gNB,0,0);
fprintf(stderr, "%s\n","in init_eNB_afterRU line 878 in executables/nr-gnb.c" );
// map antennas and PRACH signals to gNB RX
if (0) AssertFatal(gNB->num_RU>0,"Number of RU attached to gNB %d is zero\n",gNB->Mod_id);
......
This diff is collapsed.
......@@ -124,8 +124,8 @@ extern pthread_mutex_t sync_mutex;
extern int sync_var;
extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
extern uint64_t downlink_frequency[MAX_NUM_CCs][4]; //------src572 changed from 32 to 64
extern int64_t uplink_frequency_offset[MAX_NUM_CCs][4]; // -----src572 changed from 32 to 64
extern int rx_input_level_dBm;
extern uint8_t exit_missed_slots;
......
......@@ -113,8 +113,8 @@ int single_thread_flag=1;
static int8_t threequarter_fs=0;
uint32_t downlink_frequency[MAX_NUM_CCs][4];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
uint64_t downlink_frequency[MAX_NUM_CCs][4]; // ----src572 changed from 32 to 64
int64_t uplink_frequency_offset[MAX_NUM_CCs][4]; // ---src572 changed from 32 to 64
//Temp fix for inexisting NR upper layer
unsigned char NB_gNB_INST = 1;
......@@ -143,12 +143,12 @@ double rx_gain[MAX_NUM_CCs][4] = {{110,0,0,0},{20,0,0,0}};
double rx_gain_off = 0.0;
double sample_rate=30.72e6;
double bw = 10.0e6;
double sample_rate=122.88e6;//30.72e6; -----src572
double bw = 100e6;//10.0e6; -----src572
static int tx_max_power[MAX_NUM_CCs]; /* = {0,0}*/;
char rf_config_file[1024]="/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat";
char rf_config_file[1024];//"/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat";
int chain_offset=0;
int phy_test = 0;
......@@ -378,7 +378,7 @@ void *l2l1_task(void *arg) {
itti_set_task_real_time(TASK_L2L1);
itti_mark_task_ready(TASK_L2L1);
/* Wait for the initialize message */
printf("Wait for the ITTI initialize message\n");
printf("Wait for the ITTI initialize message l2l1_task\n"); //-----src572
do {
if (message_p != NULL) {
......@@ -504,7 +504,8 @@ int create_gNB_tasks(uint32_t gnb_nb) {
}
static void get_options(void) {
static void get_options(void)
{
int tddflag, nonbiotflag;
uint32_t online_log_messages;
uint32_t glog_level, glog_verbosity;
......@@ -539,10 +540,10 @@ static void get_options(void) {
load_module_shlib("telnetsrv",NULL,0,NULL);
}
#if T_TRACER
paramdef_t cmdline_ttraceparams[] =CMDLINE_TTRACEPARAMS_DESC ;
config_process_cmdline( cmdline_ttraceparams,sizeof(cmdline_ttraceparams)/sizeof(paramdef_t),NULL);
#endif
#if T_TRACER
paramdef_t cmdline_ttraceparams[] =CMDLINE_TTRACEPARAMS_DESC ;
config_process_cmdline( cmdline_ttraceparams,sizeof(cmdline_ttraceparams)/sizeof(paramdef_t),NULL);
#endif
if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) ) {
memset((void *)&RC,0,sizeof(RC));
......@@ -556,29 +557,30 @@ static void get_options(void) {
if(parallel_config != NULL) set_parallel_conf(parallel_config);
if(worker_config != NULL) set_worker_conf(worker_config);
}
}
#if T_TRACER
int T_nowait = 0; /* by default we wait for the tracer */
int T_port = 2021; /* default port to listen to to wait for the tracer */
int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */
#endif
#endif
void set_default_frame_parms(nfapi_nr_config_request_t *config[MAX_NUM_CCs],
NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs])
{
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
frame_parms[CC_id] = (NR_DL_FRAME_PARMS *) malloc(sizeof(NR_DL_FRAME_PARMS));
config[CC_id] = (nfapi_nr_config_request_t *) malloc(sizeof(nfapi_nr_config_request_t));
config[CC_id]->subframe_config.numerology_index_mu.value =1;
config[CC_id]->subframe_config.duplex_mode.value = 1; //FDD
config[CC_id]->subframe_config.numerology_index_mu.value = 3;//3;//1;
config[CC_id]->subframe_config.duplex_mode.value = 1;//TDD;//1; //FDD
config[CC_id]->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL
config[CC_id]->rf_config.dl_carrier_bandwidth.value = 106;
config[CC_id]->rf_config.ul_carrier_bandwidth.value = 106;
config[CC_id]->rf_config.dl_carrier_bandwidth.value = 66;
config[CC_id]->rf_config.ul_carrier_bandwidth.value = 66;
config[CC_id]->sch_config.physical_cell_id.value = 0;
//fprintf(stderr,"%s","default frame parms in openairinterface5g/executables/nr-softmodem.c\n");
///dl frequency to be filled in
/* //Set some default values that may be overwritten while reading options
frame_parms[CC_id]->frame_type = FDD;
......@@ -904,6 +906,9 @@ int main( int argc, char **argv )
}
openair0_cfg[0].threequarter_fs = threequarter_fs;
printf("openair0_cfg[0].configFilename is %s",openair0_cfg[0].configFilename);
#if T_TRACER
T_Config_Init();
......@@ -917,6 +922,7 @@ int main( int argc, char **argv )
}
cpuf=get_cpu_freq_GHz();
// fprintf(stderr, "%s\n"," In main--nr-softmodem.c line 925 " ); //---src572
#if defined(ENABLE_ITTI)
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
// initialize mscgen log after ITTI
......@@ -950,7 +956,7 @@ int main( int argc, char **argv )
AssertFatal(create_gNB_tasks(1) == 0,"cannot create ITTI tasks\n");
} else {
printf("No ITTI, Initializing L1\n");
RCconfig_L1();
RCconfig_L1(); //---- this one is still in enb_app enb_config.c no function in gNB. This one is not called now
}
#endif
......
......@@ -6,7 +6,10 @@
#include "flexran_agent.h"
#include "PHY/defs_gNB.h"
#define DEFAULT_DLF 2680000000
//#define DEFAULT_DLF 2680000000
#define DEFAULT_DLF 28100000000
/***************************************************************************************************************************************/
......
......@@ -172,7 +172,7 @@ static void UE_synch(void *arg) {
if (UE->UE_scan == 0) {
get_band(downlink_frequency[CC_id][0], &UE->frame_parms.eutra_band, &uplink_frequency_offset[CC_id][0], &UE->frame_parms.frame_type);
LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %"PRIu32", UL %"PRIu32" (oai_exit %d, rx_num_channels %d)\n",
LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %"PRIu64", UL %"PRIu64" (oai_exit %d, rx_num_channels %d)\n",
downlink_frequency[0][0], downlink_frequency[0][0]+uplink_frequency_offset[0][0],
oai_exit, openair0_cfg[0].rx_num_channels);
......@@ -183,9 +183,16 @@ static void UE_synch(void *arg) {
openair0_cfg[UE->rf_map.card].autocal[UE->rf_map.chain+i] = 1;
if (uplink_frequency_offset[CC_id][i] != 0) //
{
openair0_cfg[UE->rf_map.card].duplex_mode = duplex_mode_FDD;
// fprintf(stderr, "\n\n$$$$$$$$ In UE_synch %s $$$$$$ \n\n", "duplex_mode_FDD"); //----src572
}
else //FDD
openair0_cfg[UE->rf_map.card].duplex_mode = duplex_mode_TDD;
{
openair0_cfg[UE->rf_map.card].duplex_mode = duplex_mode_TDD;
// fprintf(stderr, "\n\n$$$$$$$$ In UE_synch %s $$$$$$ \n\n", "duplex_mode_TDD"); //----src572
}
}
sync_mode = pbch;
......@@ -239,8 +246,10 @@ static void UE_synch(void *arg) {
*/
case pbch:
LOG_I(PHY, "[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode);
if (nr_initial_sync( &syncD->proc, UE, UE->mode,2) == 0) {
fprintf(stderr, "Line 249\n\n\nggggggggg\n");
if (nr_initial_sync( &syncD->proc, UE, UE->mode,2) == 0) ////----src572 why 2 frames?
{
// fprintf(stderr, "\n\n###########%s ######\n\n","Entering if condition of nr_initial sync" );
freq_offset = UE->common_vars.freq_offset; // frequency offset computed with pss in initial sync
hw_slot_offset = (UE->rx_offset<<1) / UE->frame_parms.samples_per_slot;
LOG_I(PHY,"Got synch: hw_slot_offset %d, carrier off %d Hz, rxgain %d (DL %u, UL %u), UE_scan_carrier %d\n",
......@@ -252,7 +261,8 @@ static void UE_synch(void *arg) {
UE->UE_scan_carrier );
// rerun with new cell parameters and frequency-offset
for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) {
for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++)
{
openair0_cfg[UE->rf_map.card].rx_gain[UE->rf_map.chain+i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET;
if (freq_offset >= 0)
......@@ -294,6 +304,13 @@ static void UE_synch(void *arg) {
openair0_cfg[UE->rf_map.card].tx_bw=10.0e6;
// openair0_cfg[0].rx_gain[0] -= 0;
break;
case 66: // --src572 added this. How was this working for 106PRB for band 78????
// fprintf(stderr, "\n\n $$$$$$$$$$$$$$$$$ Added case for PRB 66 in nr-ue.c %s\n","$$$$$$$$\n\n" );
openair0_cfg[UE->rf_map.card].sample_rate=122.88e6;
openair0_cfg[UE->rf_map.card].rx_bw=100.0e6;
openair0_cfg[UE->rf_map.card].tx_bw=100.0e6;
// openair0_cfg[0].rx_gain[0] -= 0;
break;
}
if (UE->mode != loop_through_memory) {
......@@ -313,14 +330,18 @@ static void UE_synch(void *arg) {
} else {
UE->is_synchronized = 1;
}
} else {
}
else
{
// initial sync failed
// calculate new offset and try again
if (UE->UE_scan_carrier == 1) {
if (freq_offset >= 0)
freq_offset += 100;
fprintf(stderr, "\n\n ########### %s ###### \n\n","Entering else condition of nr_initial sync" );
if (UE->UE_scan_carrier == 1) {
if (freq_offset >= 0)
freq_offset += 100;
freq_offset *= -1;
freq_offset *= -1;
LOG_I(PHY, "[initial_sync] trying carrier off %d Hz, rxgain %d (DL %u, UL %u)\n",
freq_offset,
UE->rx_total_gain_dB,
......@@ -342,20 +363,25 @@ static void UE_synch(void *arg) {
break;
case si:
default:
break;
case si:
default:
break;
}
}
}
void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
//src5555
//:q!#define UE_SLOT_PARALLELISATION
//srccc
void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc)
{
nr_dcireq_t dcireq;
nr_scheduled_response_t scheduled_response;
// Process Rx data for one sub-frame
if (slot_select_nr(&UE->frame_parms, proc->frame_tx, proc->nr_tti_tx) & NR_DOWNLINK_SLOT) {
if (slot_select_nr(&UE->frame_parms, proc->frame_tx, proc->nr_tti_tx) & NR_DOWNLINK_SLOT)
{
//TODO: all of this has to be moved to the MAC!!!
dcireq.module_id = UE->Mod_id;
dcireq.gNB_index = 0;
......@@ -373,15 +399,15 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
scheduled_response.slot = proc->nr_tti_rx;
nr_ue_scheduled_response(&scheduled_response);
#ifdef UE_SLOT_PARALLELISATION
#ifdef UE_SLOT_PARALLELISATION
phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL );
#else
#else
uint64_t a=rdtsc();
phy_procedures_nrUE_RX( UE, proc, 0, 1, UE->mode);
LOG_D(PHY,"phy_procedures_nrUE_RX: slot:%d, time %lu\n", proc->nr_tti_rx, (rdtsc()-a)/3500);
//printf(">>> nr_ue_pdcch_procedures ended\n");
#endif
}
fprintf(stderr, "[$$!!$$!!$$!!$$!!] >>> nr_ue_pdcch_procedures ended\n");
#endif
}
// no UL for now
......@@ -414,27 +440,27 @@ typedef struct processingData_s {
PHY_VARS_NR_UE *UE;
} processingData_t;
void UE_processing(void *arg) {
void UE_processing(void *arg)
{
processingData_t *rxtxD=(processingData_t *) arg;
UE_nr_rxtx_proc_t *proc = &rxtxD->proc;
PHY_VARS_NR_UE *UE = rxtxD->UE;
processSlotRX(UE, proc);
//printf(">>> mac ended\n");
fprintf(stderr, ">>> mac ended\n");
// Prepare the future Tx data
#if 0
#ifndef NO_RAT_NR
#if 0
#ifndef NO_RAT_NR
if (slot_select_nr(&UE->frame_parms, proc->frame_tx, proc->nr_tti_tx) & NR_UPLINK_SLOT)
#else
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) ||
if (slot_select_nr(&UE->frame_parms, proc->frame_tx, proc->nr_tti_tx) & NR_UPLINK_SLOT)
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) ||
(UE->frame_parms.frame_type == FDD) )
#endif
#endif
if (UE->mode != loop_through_memory)
phy_procedures_nrUE_TX(UE,proc,0,0,UE->mode,no_relay);
//phy_procedures_UE_TX(UE,proc,0,0,UE->mode,no_relay);
#endif
#if 0
#endif
#if 0
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_S) &&
(UE->frame_parms.frame_type == TDD))
......@@ -442,10 +468,11 @@ void UE_processing(void *arg) {
//phy_procedures_UE_S_TX(UE,0,0,no_relay);
updateTimes(current, &t3, 10000, timing_proc_name);
#endif
#endif
}
void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp)
{
void *rxp[NB_ANTENNAS_RX];
void *dummy_tx[UE->frame_parms.nb_antennas_tx];
......@@ -495,7 +522,8 @@ void trashFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
free(dummy_rx[i]);
}
void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp)
{
LOG_I(PHY,"Resynchronizing RX by %d samples (mode = %d)\n",UE->rx_offset,UE->mode);
void *dummy_tx[UE->frame_parms.nb_antennas_tx];
......@@ -503,7 +531,8 @@ void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
dummy_tx[i]=malloc16_clear(UE->frame_parms.samples_per_subframe*4);
for ( int size=UE->rx_offset ; size > 0 ; size -= UE->frame_parms.samples_per_subframe ) {
for ( int size=UE->rx_offset ; size > 0 ; size -= UE->frame_parms.samples_per_subframe )
{
int unitTransfer=size>UE->frame_parms.samples_per_subframe ? UE->frame_parms.samples_per_subframe : size ;
AssertFatal(unitTransfer ==
UE->rfdevice.trx_read_func(&UE->rfdevice,
......@@ -548,10 +577,14 @@ void *UE_thread(void *arg) {
openair0_timestamp timestamp;
void *rxp[NB_ANTENNAS_RX], *txp[NB_ANTENNAS_TX];
int start_rx_stream = 0;
const uint16_t table_sf_slot[20] = {0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9};
//const uint16_t table_sf_slot[20] = {0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9};
const uint16_t table_sf_slot[80] = {0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,
24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39}; ////----src572
AssertFatal(0== openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]), "");
UE->rfdevice.host_type = RAU_HOST;
AssertFatal(UE->rfdevice.trx_start_func(&UE->rfdevice) == 0, "Could not start the device\n");
AssertFatal(UE->rfdevice.trx_start_func(&UE->rfdevice) == 0, "Could not start the device%d\n");
fprintf(stderr, "SRC572!!!!!!!! - %d\n", UE->rfdevice.trx_start_func(&UE->rfdevice));
notifiedFIFO_t nf;
initNotifiedFIFO(&nf);
int nbSlotProcessing=0;
......@@ -588,7 +621,7 @@ void *UE_thread(void *arg) {
if (!UE->is_synchronized) {
readFrame(UE, &timestamp);
notifiedFIFO_elt_t *Msg=newNotifiedFIFO_elt(sizeof(syncData_t),0,&nf,UE_synch);
notifiedFIFO_elt_t *Msg=newNotifiedFIFO_elt(sizeof(syncData_t),0,&nf,UE_synch); // src572 - Synchronization Begin here.
syncData_t *syncMsg=(syncData_t *)NotifiedFifoData(Msg);
syncMsg->UE=UE;
memset(&syncMsg->proc, 0, sizeof(syncMsg->proc));
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -94,6 +94,8 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
gNB->total_system_throughput = 0;
gNB->check_for_MUMIMO_transmissions=0;
fprintf(stderr, "%s\n","in phy_init_nr_gNB() line 97 in openair1/PHY/INIT/nr_init.c" );
while(gNB->configured == 0) usleep(10000);
init_dfts();
......@@ -112,7 +114,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
);*/
LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_gNB][MOD %02"PRIu8"][]\n", gNB->Mod_id);
crcTableInit();
init_dfts();
init_dfts(); // why two times?
// PBCH DMRS gold sequences generation
nr_init_pbch_dmrs(gNB);
//PDCCH DMRS init
......@@ -156,8 +158,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
/// Transport init necessary for NR synchro
init_nr_transport(gNB);
gNB->first_run_I0_measurements =
1; ///This flag used to be static. With multiple gNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
gNB->first_run_I0_measurements = 1; ///This flag used to be static. With multiple gNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
common_vars->rxdata = (int32_t **)malloc16(15*sizeof(int32_t*));
common_vars->txdataF = (int32_t **)malloc16(15*sizeof(int32_t*));
common_vars->rxdataF = (int32_t **)malloc16(15*sizeof(int32_t*));
......@@ -364,12 +365,14 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
int Nid_cell,
uint64_t position_in_burst)
{
LOG_I(PHY,"entered nr_phy_config_request_sim in openairinterface5g/openair1/PHY/INIT/nr_init.c\n");
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
nfapi_nr_config_request_t *gNB_config = &gNB->gNB_config;
//overwrite for new NR parameters
gNB_config->nfapi_config.rf_bands.rf_band[0] = 78;
gNB_config->nfapi_config.nrarfcn.value = 620000;
gNB_config->subframe_config.numerology_index_mu.value = mu;
gNB_config->nfapi_config.rf_bands.rf_band[0] = 257; // why hardcodeds to 78? --src572
gNB_config->nfapi_config.nrarfcn.value = 620000; /// what is this vale?? ---src572
gNB_config->subframe_config.numerology_index_mu.value = 3;//mu;
gNB_config->subframe_config.duplex_mode.value = TDD;
gNB_config->rf_config.dl_carrier_bandwidth.value = N_RB_DL;
gNB_config->rf_config.ul_carrier_bandwidth.value = N_RB_UL;
......@@ -381,9 +384,9 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
gNB_config->sch_config.ssb_scg_position_in_burst.value = position_in_burst;
gNB_config->subframe_config.dl_cyclic_prefix_type.value = (fp->Ncp == NORMAL) ? NFAPI_CP_NORMAL : NFAPI_CP_EXTENDED;
gNB->mac_enabled = 1;
fp->dl_CarrierFreq = 3500000000;//from_nrarfcn(gNB_config->nfapi_config.rf_bands.rf_band[0],gNB_config->nfapi_config.nrarfcn.value);
fp->ul_CarrierFreq = 3500000000;//fp->dl_CarrierFreq - (get_uldl_offset(gNB_config->nfapi_config.rf_bands.rf_band[0])*100000);
gNB->mac_enabled = 1; //// -changed src572
fp->dl_CarrierFreq = 28100000000;//3500000000;//from_nrarfcn(gNB_config->nfapi_config.rf_bands.rf_band[0],gNB_config->nfapi_config.nrarfcn.value);
fp->ul_CarrierFreq = 28100000000;//fp->dl_CarrierFreq - (get_uldl_offset(gNB_config->nfapi_config.rf_bands.rf_band[0])*100000);
fp->threequarter_fs= 0;
nr_init_frame_parms(gNB_config, fp);
gNB->configured = 1;
......@@ -408,6 +411,9 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config)
gNB_config->sch_config.physical_cell_id.value = phy_config->cfg->sch_config.physical_cell_id.value;
gNB_config->sch_config.ssb_scg_position_in_burst.value= phy_config->cfg->sch_config.ssb_scg_position_in_burst.value;
gNB_config->sch_config.ssb_periodicity.value = phy_config->cfg->sch_config.ssb_periodicity.value;
LOG_I(PHY,"entered nr_phy_config_request in openairinterface5g/openair1/PHY/INIT/nr_init.c\n");
// fprintf(stderr, "\n\n $$$$$$$$$$$$$$$$$$$$$$$$$$ %d the vale of mu and %d band in same file as above is \n $$$$$$$$$$$$$$$$$$$$$$$$$$\n\n", gNB_config->subframe_config.numerology_index_mu.value,phy_config->cfg->nfapi_config.rf_bands.rf_band[0]);
if (phy_config->cfg->subframe_config.duplex_mode.value == 0) {
gNB_config->subframe_config.duplex_mode.value = TDD;
......@@ -431,7 +437,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config)
nr_init_frame_parms(gNB_config, fp);
if (RC.gNB[Mod_id][CC_id]->configured == 1) {
LOG_E(PHY,"Already gNB already configured, do nothing\n");
LOG_E(PHY,"Already gNB configured, do nothing\n");
return;
}
......@@ -445,6 +451,7 @@ void init_nr_transport(PHY_VARS_gNB *gNB) {
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
nfapi_nr_config_request_t *cfg = &gNB->gNB_config;
LOG_I(PHY, "Initialise nr transport\n");
fprintf(stderr, "%s\n", "in init_nr_transport() line 455 in openair1/PHY/INIT/nr_init.c");
for (i=0; i<NUMBER_OF_NR_DLSCH_MAX; i++) {
......
......@@ -108,7 +108,7 @@ int nr_phy_init_RU(RU_t *ru) {
for (i=0; i<RC.nb_nr_L1_inst; i++) {
for (p=0;p<15;p++) {
if (p == 0|| p==5) {
if (p == 0|| p==5) { // --src572 should this be nrbeam_weights
ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
for (j=0; j<ru->nb_tx; j++) {
ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
......
......@@ -689,7 +689,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
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(fp,NR_MU_1,NORMAL,fp->N_RB_DL,n_ssb_crb,k_ssb);
nr_init_frame_parms_ue(fp,NR_MU_3,NORMAL,fp->N_RB_DL,n_ssb_crb,k_ssb); //////----src572
phy_init_nr_top(ue);
// many memory allocation sizes are hard coded
......@@ -972,7 +972,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
ue->decode_MIB = 1;
ue->decode_SIB = 1;
ue->ssb_periodicity = 5; // initialization of ssb periodicity to 5ms according to TS38.213 section 4.1
ue->ssb_periodicity = 20;//5; // initialization of ssb periodicity to 5ms according to TS38.213 section 4.1 ----src572
init_prach_tables(839);
......@@ -1047,17 +1047,17 @@ void set_default_frame_parms_single(nfapi_nr_config_request_t *config,
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.duplex_mode.value = 0;//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.dl_carrier_bandwidth.value = 100;
config->rf_config.ul_carrier_bandwidth.value = 100;
config->sch_config.physical_cell_id.value = 0;
frame_parms->frame_type = FDD;
frame_parms->frame_type = TDD;//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->N_RB_DL = 66;//100;
frame_parms->N_RB_UL = 66;//100;
frame_parms->Ncp = NORMAL;
//frame_parms[CC_id]->Ncp_UL = NORMAL;
frame_parms->Nid_cell = 0;
......@@ -1089,7 +1089,7 @@ void set_default_frame_parms_single(nfapi_nr_config_request_t *config,
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->numerology_index = 3;
frame_parms->ttis_per_subframe = 1;
frame_parms->slots_per_tti = 2;
......
This diff is collapsed.
......@@ -53,13 +53,13 @@
#include "common/utils/LOG/vcd_signal_dumper.h"
int beam_precoding(int32_t **txdataF,
int32_t **txdataF_BF,
int subframe,
int32_t **txdataF_BF,
int subframe,
LTE_DL_FRAME_PARMS *frame_parms,
int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15],
int symbol,
int aa,
int p,
int aa,
int p,
int l1_id)
{
int rb_offset_neg0 = frame_parms->ofdm_symbol_size - (6*frame_parms->N_RB_DL);
......
......@@ -43,7 +43,8 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
{
/////// Check this .. this assumes the slot size as 7 symbols and does longer CP every 7 symbols
// fprintf(stderr, "\n $$$$#### in function normal_prefix_mod nsymb = %d,frame_parms->nb_prefix_samples0 =%d ,frame_parms->nb_prefix_samples $$$#### \n", nsymb,frame_parms->nb_prefix_samples0,frame_parms->nb_prefix_samples); ///---src572
PHY_ofdm_mod(txdataF, // input
txdata, // output
frame_parms->ofdm_symbol_size,
......@@ -63,6 +64,8 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
void nr_normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,NR_DL_FRAME_PARMS *frame_parms)
{
// fprintf(stderr, "\n $$$$#### in function nr_normal_prefix_mod nsymb = %d,frame_parms->nb_prefix_samples0 =%d ,frame_parms->nb_prefix_samples $$$#### \n", nsymb,frame_parms->nb_prefix_samples0,frame_parms->nb_prefix_samples); ///---src572
PHY_ofdm_mod(txdataF, // input
txdata, // output
frame_parms->ofdm_symbol_size,
......@@ -131,109 +134,110 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
break;
}
#ifdef DEBUG_OFDM_MOD
printf("[PHY] OFDM mod (size %d,prefix %d) Symbols %d, input %p, output %p\n",
fftsize,nb_prefix_samples,nb_symbols,input,output);
#endif
#ifdef DEBUG_OFDM_MOD //---src572
printf("[PHY] OFDM mod (size %d,prefix %d) Symbols %d, input %p, output %p\n",
fftsize,nb_prefix_samples,nb_symbols,input,output);
#endif
// fprintf(stderr,"[PHY] OFDM mod (size %d,prefix %d) Symbols %d, input %p, output %p\n",
// fftsize,nb_prefix_samples,nb_symbols,input,output); ///src572
for (i=0; i<nb_symbols; i++) {
#ifdef DEBUG_OFDM_MOD
printf("[PHY] symbol %d/%d offset %d (%p,%p -> %p)\n",i,nb_symbols,i*fftsize+(i*nb_prefix_samples),input,&input[i*fftsize],&output[(i*fftsize) + ((i)*nb_prefix_samples)]);
#endif
#ifndef __AVX2__
// handle 128-bit alignment for 128-bit SIMD (SSE4,NEON,AltiVEC)
idft((int16_t *)&input[i*fftsize],
(fftsize==128) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)],
1);
#else
// on AVX2 need 256-bit alignment
idft((int16_t *)&input[i*fftsize],
(int16_t *)temp,
1);
for (i=0; i<nb_symbols; i++)
{
#ifdef DEBUG_OFDM_MOD
printf("[PHY] symbol %d/%d offset %d (%p,%p -> %p)\n",i,nb_symbols,i*fftsize+(i*nb_prefix_samples),input,&input[i*fftsize],&output[(i*fftsize) + ((i)*nb_prefix_samples)]);
#endif
#endif
#ifndef __AVX2__
// handle 128-bit alignment for 128-bit SIMD (SSE4,NEON,AltiVEC)
idft((int16_t *)&input[i*fftsize],
(fftsize==128) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)],
1);
#else
// on AVX2 need 256-bit alignment
idft((int16_t *)&input[i*fftsize],
(int16_t *)temp,
1);
// Copy to frame buffer with Cyclic Extension
// Note: will have to adjust for synchronization offset!
#endif
switch (etype) {
case CYCLIC_PREFIX:
output_ptr = &output[(i*fftsize) + ((1+i)*nb_prefix_samples)];
temp_ptr = (int *)temp;
// Copy to frame buffer with Cyclic Extension
// Note: will have to adjust for synchronization offset!
// msg("Doing cyclic prefix method\n");
#ifndef __AVX2__
if (fftsize==128)
#endif
switch (etype)
{
/*for (j=0; j<fftsize ; j++) {
output_ptr[j] = temp_ptr[j];
}*/
memcpy((void*)output_ptr,(void*)temp_ptr,fftsize<<2);
}
case CYCLIC_PREFIX:
output_ptr = &output[(i*fftsize) + ((1+i)*nb_prefix_samples)];
temp_ptr = (int *)temp;
j=fftsize;
for (k=-1; k>=-nb_prefix_samples; k--) {
output_ptr[k] = output_ptr[--j];
}
// msg("Doing cyclic prefix method\n");
break;
#ifndef __AVX2__
if (fftsize==128)
#endif
{
/*for (j=0; j<fftsize ; j++) {
output_ptr[j] = temp_ptr[j];
}*/
memcpy((void*)output_ptr,(void*)temp_ptr,fftsize<<2);
}
case CYCLIC_SUFFIX:
j=fftsize;
for (k=-1; k>=-nb_prefix_samples; k--)
{
output_ptr[k] = output_ptr[--j];
}
output_ptr = &output[(i*fftsize)+ (i*nb_prefix_samples)];
break;
temp_ptr = (int *)temp;
case CYCLIC_SUFFIX:
// msg("Doing cyclic suffix method\n");
output_ptr = &output[(i*fftsize)+ (i*nb_prefix_samples)];
for (j=0; j<fftsize ; j++) {
output_ptr[j] = temp_ptr[2*j];
}
temp_ptr = (int *)temp;
// msg("Doing cyclic suffix method\n");
for (j=0; j<nb_prefix_samples; j++)
output_ptr[fftsize+j] = output_ptr[j];
for (j=0; j<fftsize ; j++) {
output_ptr[j] = temp_ptr[2*j];
}
break;
case ZEROS:
for (j=0; j<nb_prefix_samples; j++)
output_ptr[fftsize+j] = output_ptr[j];
break;
break;
case NONE:
case ZEROS:
// msg("NO EXTENSION!\n");
output_ptr = &output[fftsize];
break;
temp_ptr = (int *)temp;
case NONE:
for (j=0; j<fftsize ; j++) {
output_ptr[j] = temp_ptr[2*j];
// msg("NO EXTENSION!\n");
output_ptr = &output[fftsize];
temp_ptr = (int *)temp;
}
for (j=0; j<fftsize ; j++) {
output_ptr[j] = temp_ptr[2*j];
break;
default:
break;
}
}
break;
default:
break;
}
}
}
......
......@@ -46,14 +46,19 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
unsigned char aa;
unsigned int nb_prefix_samples;
unsigned int nb_prefix_samples0;
if (ue->is_synchronized) {
nb_prefix_samples = (no_prefix ? 0 : frame_parms->nb_prefix_samples);
nb_prefix_samples0 = (no_prefix ? 0 : frame_parms->nb_prefix_samples0);
}
else {
// fprintf(stderr, "value of Ns in function call nr_slot_fep %d\n", Ns); //----src572
// if (ue->is_synchronized) {
// nb_prefix_samples = (no_prefix ? 0 : frame_parms->nb_prefix_samples);
// nb_prefix_samples0 = (no_prefix ? 0 : frame_parms->nb_prefix_samples0);
// }
// else {
// nb_prefix_samples = (no_prefix ? 0 : frame_parms->nb_prefix_samples);
// nb_prefix_samples0 = (no_prefix ? 0 : frame_parms->nb_prefix_samples);
// }
nb_prefix_samples = (no_prefix ? 0 : frame_parms->nb_prefix_samples);
nb_prefix_samples0 = (no_prefix ? 0 : frame_parms->nb_prefix_samples);
}
nb_prefix_samples0 = (no_prefix ? 0 : frame_parms->nb_prefix_samples0); //--src572
//unsigned int subframe_offset;//,subframe_offset_F;
unsigned int slot_offset;
//int i;
......@@ -117,8 +122,8 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
return(-1);
}*/
if (Ns<0 || Ns>=20) {
printf("slot_fep: Ns must be between 0 and 19\n");
if (Ns<0 || Ns>=80) {
fprintf(stderr,"slot_fep: Ns must be between 0 and 79\n");
return(-1);
}
......@@ -131,7 +136,7 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
#ifdef DEBUG_FEP
// if (ue->frame <100)
/*LOG_I(PHY,*/printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, sample_offset %d,rx_offset %d, frame_length_samples %d\n", ue->proc.proc_rxtx[(Ns)&1].frame_rx,Ns, symbol,
/*LOG_I(PHY,*/fprintf(stderr,"\n###### slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, sample_offset %d,rx_offset %d, frame_length_samples %d #######\n", ue->proc.proc_rxtx[(Ns)&1].frame_rx,Ns, symbol,
nb_prefix_samples,nb_prefix_samples0,slot_offset,sample_offset,rx_offset,frame_length_samples);
#endif
......@@ -192,7 +197,7 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
#ifdef DEBUG_FEP
// if (ue->frame <100)
printf("slot_fep: frame %d: symbol %d rx_offset %d\n", ue->proc.proc_rxtx[(Ns)&1].frame_rx, symbol,rx_offset);
fprintf(stderr,"\n $$$$$$ slot_fep: frame %d: symbol %d rx_offset %d $$$$$\n", ue->proc.proc_rxtx[(Ns)&1].frame_rx, symbol,rx_offset);
#endif
}
......@@ -261,7 +266,7 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms,
slot_offset = Ns * frame_parms->samples_per_slot;
if(symbol == 0)
if(symbol == 0) ///// check this calculation
rxdata_offset = slot_offset + nb_prefix_samples0 - SOFFSET;
else
rxdata_offset = slot_offset + nb_prefix_samples0 + (symbol * (frame_parms->ofdm_symbol_size + nb_prefix_samples)) - SOFFSET;
......
......@@ -103,7 +103,7 @@ int slot_fep_ul(RU_t *ru,
#endif
for (aa=0; aa<ru->nb_rx; aa++) {
rx_offset = slot_offset +nb_prefix_samples0;
rx_offset = slot_offset + nb_prefix_samples0;
if (l==0) {
#ifdef DEBUG_FEP
LOG_D(PHY,"slot_fep: symbol 0 %d dB\n",
......
......@@ -30,17 +30,17 @@
* \warning
*/
//#define NR_PBCH_DMRS_LENGTH_DWORD 5
//#define NR_PBCH_DMRS_LENGTH 144
//#define DEBUG_PDCCH
#define NR_PBCH_DMRS_LENGTH_DWORD 5
#define NR_PBCH_DMRS_LENGTH 144
#define DEBUG_PDCCH
#include "refsig_defs_ue.h"
#include "PHY/defs_nr_UE.h"
/*Table 7.4.1.1.2-1/2 from 38.211 */
int wf1[8][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,1}};
int wf1[8][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1}}; //////-----src572 Table_is_wrong changed it /*Table 7.4.1.1.2-1/2 from 38.211 */
int wt1[8][2] = {{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1}};
int wf2[12][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,1},{1,1},{1,-1},{1,1},{1,1}};
int wf2[12][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1}};
int wt2[12][2] = {{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1},{1,-1},{1,-1}};
......@@ -65,7 +65,7 @@ int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
array_of_w *wf;
array_of_w *wt;
config_type = 0; //to be updated by higher layer
config_type = 0; //to be updated by higher layer ///-----src572
wf = (config_type==0) ? wf1 : wf2;
wt = (config_type==0) ? wt1 : wt2;
......
......@@ -95,6 +95,7 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t *dlsch,
start_meas(dlsch_encoding_stats);
nr_dlsch_encoding(harq->pdu, frame, slot, dlsch, frame_parms);
stop_meas(dlsch_encoding_stats);
// fprintf(stderr, "%s\n","\n $$$$$ -----src572 ---- in nr_generate_pdsch() in openair1/PHY/NR_TRANSPORT/nr_dlsch.c\n $$$$$$$$$$\n" );
#ifdef DEBUG_DLSCH
printf("PDSCH encoding:\nPayload:\n");
for (int i=0; i<harq->B>>7; i++) {
......
......@@ -278,7 +278,9 @@ int nr_dlsch_encoding(unsigned char *a,int frame,
unsigned int G;
unsigned int crc=1;
uint8_t harq_pid = dlsch->harq_ids[frame&2][slot];
AssertFatal(harq_pid<8 && harq_pid>=0,"illegal harq_pid %d\b",harq_pid);
//AssertFatal(harq_pid<255 && harq_pid>=0,"illegal harq_pid %d\b",harq_pid);
// fprintf(stderr, "%s\n","commented the above line in line 282 in nr_dlsch_encoding() in openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c" );
nfapi_nr_dl_config_dlsch_pdu_rel15_t rel15 = dlsch->harq_processes[harq_pid]->dlsch_pdu.dlsch_pdu_rel15;
uint16_t nb_rb = rel15.n_prb;
uint8_t nb_symb_sch = rel15.nb_symbols;
......
......@@ -182,9 +182,12 @@ uint32_t nr_get_E(uint32_t G, uint8_t C, uint8_t Qm, uint8_t Nl, uint8_t r) {
uint32_t E;
uint8_t Cprime = C; //assume CBGTI not present
// fprintf(stderr, "%s\n","commented the below lines in openair1/PHY/NR_TRANSPORT/nr_tbs_tools.c line 185" ); //// ---src572
AssertFatal(Nl>0,"Nl is 0\n");
AssertFatal(Qm>0,"Qm is 0\n");
// Nl=1;
// Qm=2;
if (r <= Cprime - ((G/(Nl*Qm))%Cprime) - 1)
E = Nl*Qm*(G/(Nl*Qm*Cprime));
else
......
......@@ -26,9 +26,10 @@
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
#include "filt16a_32.h"
//#define DEBUG_PDSCH
//#define DEBUG_PDCCH
#define DEBUG_PDSCH
#define DEBUG_PDCCH
#define DEBUG_CH
//SRC572
int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
uint8_t eNB_offset,
......@@ -275,14 +276,18 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
}
// generate pilot
//SRC segfault
nr_pbch_dmrs_rx(dmrss,ue->nr_gold_pbch[n_hf][ssb_index], &pilot[0]);
printf("TARAM TARAM TARAM\n");
int re_offset = ssb_offset;
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
pil = (int16_t *)&pilot[0];
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset];
printf("TURUM TURUM TURUM: ");
printf("%d %d %d %d\n", pil, aarx, symbol_offset+k+re_offset, ch_offset);
memset(dl_ch,0,4*(ue->frame_parms.ofdm_symbol_size));
if (ue->high_speed_flag==0) // multiply previous channel estimate by ch_est_alpha
......
......@@ -118,6 +118,8 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini
uint8_t N_L = (frame_parms->Lmax == 4)? 4:8;
uint8_t N_hf = (frame_parms->Lmax == 4)? 2:1;
fprintf(stderr, "\n $$$$$$######## The value of Lmax should be 64 for FR2 and value is %d $$$$$##### \n", frame_parms->Lmax);
// loops over possible pbch dmrs cases to retrive best estimated i_ssb (and n_hf for Lmax=4) for multiple ssb detection
for (int hf = 0; hf < N_hf; hf++) {
for (int l = 0; l < N_L ; l++) {
......@@ -161,12 +163,12 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini
ret = nr_rx_pbch(ue,
proc,
ue->pbch_vars[0],
frame_parms,
0,
temp_ptr->i_ssb,
SISO,
ue->high_speed_flag);
ue->pbch_vars[0],
frame_parms,
0,
temp_ptr->i_ssb,
SISO,
ue->high_speed_flag);
temp_ptr=temp_ptr->next_ssb;
}
......@@ -203,6 +205,7 @@ char prefix_string[2][9] = {"NORMAL","EXTENDED"};
int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode, int n_frames)
{
fprintf(stderr, "\n\n\n %s \n\n\n\n\n","nr_initial_sync");
int32_t sync_pos, sync_pos_frame; // k_ssb, N_ssb_crb, sync_pos2,
int32_t metric_tdd_ncp=0;
......@@ -220,7 +223,8 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode,
fp->Ncp=NORMAL;
fp->frame_type=TDD;
// FK: added N_RB_DL paramter here as this function shares code with the gNB where it is needed. We should rewrite this function for the UE.
nr_init_frame_parms_ue(fp,NR_MU_1,NORMAL,fp->N_RB_DL,n_ssb_crb,0);
//nr_init_frame_parms_ue(fp,NR_MU_1,NORMAL,fp->N_RB_DL,n_ssb_crb,0);
nr_init_frame_parms_ue(fp,NR_MU_3,NORMAL,fp->N_RB_DL,n_ssb_crb,0); /// ---- src572 change here for mu=3
LOG_D(PHY,"nr_initial sync ue RB_DL %d\n", fp->N_RB_DL);
......@@ -254,17 +258,17 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode,
else
ue->ssb_offset = sync_pos + (fp->samples_per_subframe * 10) - fp->nb_prefix_samples;
#ifdef DEBUG_INITIAL_SYNCH
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n", ue->Mod_id, sync_pos,ue->common_vars.eNb_id);
LOG_I(PHY,"sync_pos %d ssb_offset %d \n",sync_pos,ue->ssb_offset);
#endif
#endif
// digital compensation of FFO for SSB symbols
if (ue->UE_fo_compensation){
double s_time = 1/(1.0e3*fp->samples_per_subframe); // sampling time
double off_angle = -2*M_PI*s_time*(ue->common_vars.freq_offset); // offset rotation angle compensation per sample
double s_time = 1/(1.0e3*fp->samples_per_subframe); // sampling time
double off_angle = -2*M_PI*s_time*(ue->common_vars.freq_offset); // offset rotation angle compensation per sample
int start = ue->ssb_offset; // start for offset correction is at ssb_offset (pss time position)
int start = ue->ssb_offset; // start for offset correction is at ssb_offset (pss time position)
int end = start + 4*(fp->ofdm_symbol_size + fp->nb_prefix_samples); // loop over samples in 4 symbols (ssb size), including prefix
for(int n=start; n<end; n++){
......@@ -290,15 +294,13 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode,
/* rxdataF stores SS/PBCH from beginning of buffers in the same symbol order as in time domain */
for(int i=0; i<4;i++)
nr_slot_fep(ue,
i,
0,
ue->ssb_offset,
0);
{
nr_slot_fep(ue,i,0,ue->ssb_offset,0);
}
#ifdef DEBUG_INITIAL_SYNCH
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"Calling sss detection (normal CP)\n");
#endif
#endif
rx_sss_nr(ue,&metric_tdd_ncp,&phase_tdd_ncp);
......@@ -332,16 +334,16 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode,
*/
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"TDD Normal prefix: CellId %d metric %d, phase %d, pbch %d\n",
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"TDD Normal prefix: CellId %d metric %d, phase %d, pbch %d\n",
fp->Nid_cell,metric_tdd_ncp,phase_tdd_ncp,ret);
#endif
#endif
}
else {
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"TDD Normal prefix: SSS error condition: sync_pos %d\n", sync_pos);
#endif
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"TDD Normal prefix: SSS error condition: sync_pos %d\n", sync_pos);
#endif
}
if (ret == 0) break;
}
......@@ -365,11 +367,11 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode,
if (ret==0) { // PBCH found so indicate sync to higher layers and configure frame parameters
//#ifdef DEBUG_INITIAL_SYNCH
#if DISABLE_LOG_X
#if DISABLE_LOG_X
printf("[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset);
#else
LOG_I(PHY, "[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset);
#endif
#else
LOG_I(PHY, "[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset);
#endif
//#endif
ue->is_synchronized_on_frame = is; // to notify on which of the two frames sync was successful
......@@ -383,7 +385,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode,
ue->common_vars.freq_offset );
#endif
// send sync status to higher layers later when timing offset converge to target timing
// send sync status to higher layers later when timing offset converge to target timing
ue->pbch_vars[0]->pdu_errors_conseq=0;
......@@ -397,7 +399,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode,
10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB,
(10*log10(ue->measurements.rsrq[0])));
/* LOG_I(PHY, "[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n",
/* LOG_I(PHY, "[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n",
ue->Mod_id,
ue->proc.proc_rxtx[0].frame_rx,
duplex_string[fp->frame_type],
......@@ -408,19 +410,19 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode,
phich_string[fp->phich_config_common.phich_resource],
fp->nb_antenna_ports_eNB);*/
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)
LOG_I(PHY, "[UE %d] Measured Carrier Frequency %.0f Hz (offset %d Hz)\n",
ue->Mod_id,
openair0_cfg[0].rx_freq[0]+ue->common_vars.freq_offset,
ue->common_vars.freq_offset);
#endif
} else {
#ifdef DEBUG_INITIAL_SYNC
#endif
} else {
#ifdef DEBUG_INITIAL_SYNC
LOG_I(PHY,"[UE%d] Initial sync : PBCH not ok\n",ue->Mod_id);
LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id);
LOG_I(PHY,"[UE%d] Initial sync : Estimated Nid_cell %d, Frame_type %d\n",ue->Mod_id,
frame_parms->Nid_cell,frame_parms->frame_type);
#endif
#endif
ue->UE_mode[0] = NOT_SYNCHED;
ue->pbch_vars[0]->pdu_errors_last=ue->pbch_vars[0]->pdu_errors;
......@@ -448,7 +450,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode,
// we might add a low-pass filter here later
ue->measurements.rx_power_avg[0] = rx_power/fp->nb_antennas_rx;
ue->measurements.rx_power_avg_dB[0] = dB_fixed(ue->measurements.rx_power_avg[0]);
ue->measurements.rx_power_avg_dB[0] = dB_fixed(ue->measurements.rx_power_avg[0]); //----src572 always returns 0
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] );
......
......@@ -709,7 +709,7 @@ int pss_synchro_nr(PHY_VARS_NR_UE *PHY_vars_UE, int is, int rate_change)
synchro_position = pss_search_time_nr(rxdata,
frame_parms,
fo_flag,
fo_flag,
is,
(int *)&PHY_vars_UE->common_vars.eNb_id,
(int *)&PHY_vars_UE->common_vars.freq_offset);
......@@ -823,10 +823,10 @@ static inline double angle64(int64_t x)
int pss_search_time_nr(int **rxdata, ///rx data in time domain
NR_DL_FRAME_PARMS *frame_parms,
int fo_flag,
int fo_flag,
int is,
int *eNB_id,
int *f_off)
int *f_off)
{
unsigned int n, ar, peak_position, pss_source;
int64_t peak_value;
......
......@@ -74,7 +74,8 @@ enum transmission_access_mode {
CANCELED_ACCESS,
UNKNOWN_ACCESS,
SCHEDULED_ACCESS,
CBA_ACCESS};
CBA_ACCESS
};
typedef enum {
eNodeB_3GPP=0, // classical eNodeB function
......@@ -544,7 +545,7 @@ typedef struct RU_t_s{
/// beamforming weight vectors per eNB
int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15];
/// beamforming weight vectors per gNB
int32_t **nrbeam_weights[NUMBER_OF_gNB_MAX+1][16];
int32_t **nrbeam_weights[NUMBER_OF_gNB_MAX+1][16]; // ----- src572 where is this used?
/// received frequency-domain signal for PRACH (IF4p5 RRU)
int16_t **prach_rxsigF;
/// received frequency-domain signal for PRACH BR (IF4p5 RRU)
......
......@@ -97,7 +97,8 @@
#define NR_MAX_NB_RBG 18
#define NR_MAX_NB_LAYERS 8 // SU-MIMO (3GPP TS 38.211 V15.4.0 section 7.3.1.3)
#define NR_MAX_NB_CODEWORDS 2
#define NR_MAX_NB_HARQ_PROCESSES 16
#define NR_MAX_NB_HARQ_PROCESSES 255 // src572;;Changed from 16 to 255
#define NR_MAX_PDSCH_ENCODED_LENGTH NR_MAX_NB_RB*NR_SYMBOLS_PER_SLOT*NR_NB_SC_PER_RB*8*NR_MAX_NB_LAYERS // 8 is the maximum modulation order (it was 950984 before !!)
#define NR_MAX_PUSCH_ENCODED_LENGTH NR_MAX_PDSCH_ENCODED_LENGTH
#define NR_MAX_PDSCH_TBS 3824
......@@ -228,11 +229,13 @@ typedef struct NR_DL_FRAME_PARMS {
/// Total Number of Resource Block Groups SubSets: this is P
uint8_t N_RBGS;
/// EUTRA Band
uint8_t eutra_band;
uint16_t eutra_band;
//// NR BAND
uint16_t nr_band;
/// DL carrier frequency
uint32_t dl_CarrierFreq;
uint64_t dl_CarrierFreq; //----- src572
/// UL carrier frequency
uint32_t ul_CarrierFreq;
uint64_t ul_CarrierFreq; // ------ src572
/// TX attenuation
uint32_t att_tx;
/// RX attenuation
......
......@@ -76,6 +76,8 @@ void feptx0(RU_t *ru,
int slot_sizeF = (fp->ofdm_symbol_size) * ((fp->Ncp==1) ? 6 : 7);
int subframe = ru->proc.tti_tx;
fprintf(stderr, "\n $$$### The value of fp->Ncp = %d (fp->Ncp==1) ? 6 : 7) * ofdm_symbol_size= %d , and slot_sizeF = %d in function feptx0 $$$### \n", fp->Ncp,fp->ofdm_symbol_size,slot_sizeF); //---src572
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+slot , 1 );
slot_offset = slot*(fp->samples_per_tti>>1); //slot_offset = subframe*fp->samples_per_tti + (slot*(fp->samples_per_tti>>1));
......@@ -112,6 +114,7 @@ void feptx0(RU_t *ru,
fp->N_RB_DL,
aa);
}
fprintf(stderr, "\n $$### The value of num_symb in function %s = %d and below it calls normal_prefix_mod ### $$\n", feptx0,num_symb); /// ----src572
normal_prefix_mod(&ru->common.txdataF_BF[aa][(slot&1)*slot_sizeF],
(int*)&ru->common.txdata[aa][slot_offset],
num_symb,
......@@ -173,11 +176,15 @@ static void *feptx_thread(void *param)
while (!oai_exit) {
if (wait_on_condition(&proc->mutex_feptx,&proc->cond_feptx,&proc->instance_cnt_feptx,"feptx thread")<0) break;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+1 , 1 );
if (oai_exit) break;
//stop_meas(&ru->ofdm_mod_wakeup_stats);
fprintf(stderr, "\n $$$$#### in feptx_thread calling function %s $$$#### \n", "feptx0(ru,proc->slot_feptx)"); //---src572
feptx0(ru,proc->slot_feptx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+1 , 0 );
......@@ -270,6 +277,7 @@ void feptx_ofdm(RU_t *ru,
int16_t *txdata;
// int CC_id = ru->proc.CC_id;
// fprintf(stderr, "\n $$$### The value of fp->Ncp = %d (fp->Ncp==1) ? 6 : 7) * ofdm_symbol_size= %d , and slot_sizeF = %d in function feptx_ofdm $$$### \n", fp->Ncp,fp->ofdm_symbol_size,slot_sizeF); //---src572
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+ru->idx , 1 );
slot_offset_F = 0;
......@@ -460,44 +468,44 @@ void feptx_prec(RU_t *ru,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+ru->idx , 0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+ru->idx , 0);
}
else {
else // if (ru->num_eNB == 1)
{
AssertFatal(1==0,"Handling of multi-L1 case not ready yet\n");
for (i=0;i<ru->num_eNB;i++) {
for (i=0;i<ru->num_eNB;i++)
{
eNB = eNB_list[i];
fp = &eNB->frame_parms;
for (l=0;l<fp->symbols_per_tti;l++) {
for (aa=0;aa<ru->nb_tx;aa++) {
beam_precoding(eNB->common_vars.txdataF,
ru->common.txdataF_BF,
subframe,
fp,
ru->beam_weights,
subframe<<1,
for (l=0;l<fp->symbols_per_tti;l++)
{
for (aa=0;aa<ru->nb_tx;aa++)
{
beam_precoding(eNB->common_vars.txdataF,ru->common.txdataF_BF,subframe,fp,ru->beam_weights,subframe<<1,
l,
aa,
eNB->Mod_id);
}
}
}
}
}
}
} // feptx_prec
void fep0(RU_t *ru,
int slot)
void fep0(RU_t *ru,int slot)
{
RU_proc_t *proc = &ru->proc;
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
//printf("fep0: slot %d\n",slot);
// fprintf(stderr, "\n $$$$#### in fep0 function calling %s $$$#### \n", "remove_7_5_kHz function"); //---src572
remove_7_5_kHz(ru,(slot&1)+(proc->tti_rx<<1));
for (int l=0; l<fp->symbols_per_tti/2; l++) {
slot_fep_ul(ru,
l,
(slot&1),
0);
slot_fep_ul(ru,l,(slot&1),0);
// fprintf(stderr, "\n $$$$#### in fep0 function calling %s $$$#### \n", "slot_fep_ul function"); //---src572
}
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+slot, 0);
}
......@@ -512,8 +520,9 @@ static void *fep_thread(void *param)
if (wait_on_condition(&proc->mutex_fep,&proc->cond_fep,&proc->instance_cnt_fep,"fep thread")<0) break;
if (oai_exit) break;
//stop_meas(&ru->ofdm_demod_wakeup_stats);
// stop_meas(&ru->ofdm_demod_wakeup_stats);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1, 1 );
// fprintf(stderr, "\n $$$$#### in fep_thread calling %s $$$#### \n", "fep0"); //---src572
fep0(ru,0);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1, 0 );
if (release_thread(&proc->mutex_fep,&proc->instance_cnt_fep,"fep thread")<0) break;
......@@ -532,8 +541,7 @@ static void *fep_thread(void *param)
}
void init_feptx_thread(RU_t *ru,
pthread_attr_t *attr_feptx)
void init_feptx_thread(RU_t *ru,pthread_attr_t *attr_feptx)
{
RU_proc_t *proc = &ru->proc;
......@@ -543,20 +551,23 @@ void init_feptx_thread(RU_t *ru,
pthread_cond_init( &proc->cond_feptx, NULL);
threadCreate(&proc->pthread_feptx, feptx_thread, (void*)ru, "feptx", -1, OAI_PRIORITY_RT);
// fprintf(stderr, "\n $$$$$#### created %s #####$$$\n","feptx_thread" ); //--src572
}
void init_fep_thread(RU_t *ru,
pthread_attr_t *attr_fep)
void init_fep_thread(RU_t *ru, pthread_attr_t *attr_fep)
{
RU_proc_t *proc = &ru->proc;
proc->instance_cnt_fep = -1;
proc->instance_cnt_fep = -1;
pthread_mutex_init( &proc->mutex_fep, NULL);
pthread_cond_init( &proc->cond_fep, NULL);
threadCreate(&proc->pthread_fep, fep_thread, (void*)ru, "fep", -1, OAI_PRIORITY_RT);
// fprintf(stderr, "\n $$$$$#### created %s #####$$$\n","fep_thread" ); //--src572
}
......
......@@ -56,13 +56,17 @@ extern openair0_config_t openair0_cfg[MAX_CARDS];
extern int oai_exit;
void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols) {
void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols)
{
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
int mu=3; ////// src572 just used to see if it works
unsigned int aa,slot_offset,slot_offsetF;
int slot = tti_tx;
// fprintf(stderr, "\n $$$### In function nr_feptx0 fp->ofdm_symbol_size = %d , num_symbols = %d,fp->nb_prefix_samples = %d ,(fp->Ncp == 1) = %d, slot = %d $$$###\n", fp->ofdm_symbol_size,num_symbols,fp->nb_prefix_samples,fp->Ncp,slot); //----src572
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(first_symbol!=0?1:0) , 1 );
......@@ -73,39 +77,44 @@ void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols) {
LOG_D(PHY,"SFN/SF:RU:TX:%d/%d Generating slot %d (first_symbol %d num_symbols %d)\n",ru->proc.frame_tx, ru->proc.tti_tx,slot,first_symbol,num_symbols);
for (aa=0; aa<ru->nb_tx; aa++) {
if (fp->Ncp == 1) {
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF],
(int*)&ru->common.txdata[aa][slot_offset],
fp->ofdm_symbol_size,
num_symbols,
fp->nb_prefix_samples,
CYCLIC_PREFIX);
for (aa=0; aa<ru->nb_tx; aa++)
{
if (fp->Ncp == 1)
{
// fprintf(stderr, "\n $$$### Entering if(fp->Ncp == 1) %d ###$$$ \n", fp->Ncp ); ///----src572
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF], (int*)&ru->common.txdata[aa][slot_offset],
fp->ofdm_symbol_size,
num_symbols,
fp->nb_prefix_samples,
CYCLIC_PREFIX);
}
else {
if (first_symbol==0) {
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF],
(int*)&ru->common.txdata[aa][slot_offset],
fp->ofdm_symbol_size,
1,
fp->nb_prefix_samples0,
CYCLIC_PREFIX);
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF+fp->ofdm_symbol_size],
(int*)&ru->common.txdata[aa][slot_offset+fp->nb_prefix_samples0+fp->ofdm_symbol_size],
fp->ofdm_symbol_size,
num_symbols-1,
fp->nb_prefix_samples,
CYCLIC_PREFIX);
else
{
//if (first_symbol==0)
if ((slot== 0) || slot ==((1<<mu)*10/2)) //// -src572
{
// fprintf(stderr,"\n $$$### Entering if((slot== 0 || slot == (1<<mu)*10/2)) %d ###$$$ \n", slot); ///----src572
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF],(int*)&ru->common.txdata[aa][slot_offset],
fp->ofdm_symbol_size,
1,
fp->nb_prefix_samples0,
CYCLIC_PREFIX);
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF+fp->ofdm_symbol_size],(int*)&ru->common.txdata[aa][slot_offset+fp->nb_prefix_samples0+fp->ofdm_symbol_size],
fp->ofdm_symbol_size,
num_symbols-1,
fp->nb_prefix_samples,
CYCLIC_PREFIX);
}
else {
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF],
(int*)&ru->common.txdata[aa][slot_offset],
else
{
// fprintf(stderr,"\n $$$### Entering else in slot %d ###$$$ \n",slot); ////----src572
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF],(int*)&ru->common.txdata[aa][slot_offset],
fp->ofdm_symbol_size,
num_symbols,
fp->nb_prefix_samples,
CYCLIC_PREFIX);
}
}
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(first_symbol!=0?1:0), 0);
}
......@@ -121,6 +130,9 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) {
wait.tv_sec=0;
wait.tv_nsec=5000000L;
// fprintf(stderr, "\n $$$### In nr_feptx_ofdm_2thread \n" ); //----src572
start_meas(&ru->ofdm_mod_stats);
if (nr_slot_select(cfg,slot) == SF_UL) return;
......@@ -186,7 +198,11 @@ static void *nr_feptx_thread(void *param) {
int slot=proc->slot_feptx;
if (release_thread(&proc->mutex_feptx,&proc->instance_cnt_feptx,"NR feptx thread")<0) break;
nr_feptx0(ru,slot,ru->nr_frame_parms->symbols_per_slot>>1,ru->nr_frame_parms->symbols_per_slot>>1);
// fprintf(stderr, "\n $$$$$#### In thread nr_feptx_thread calling %s #####$$$\n","nr_feptx0" ); //--src572
// fprintf(stderr, " \n $$$### slot =%d ,ru->nr_frame_parms->symbols_per_slot>>1 = %d ,ru->nr_frame_parms->symbols_per_slot>>1 = %d ) $$$### ", ru,slot,ru->nr_frame_parms->symbols_per_slot>>1,ru->nr_frame_parms->symbols_per_slot>>1); ////---src572
nr_feptx0(ru,slot,ru->nr_frame_parms->symbols_per_slot>>1,ru->nr_frame_parms->symbols_per_slot>>1); //---src572 why same parameter ntwo times????
if (pthread_cond_signal(&proc->cond_feptx) != 0) {
LOG_E(PHY,"[gNB] ERROR pthread_cond_signal for NR feptx thread exit\n");
......@@ -208,6 +224,8 @@ void nr_init_feptx_thread(RU_t *ru) {
threadCreate(&proc->pthread_feptx, nr_feptx_thread, (void*)ru, "feptx", -1, OAI_PRIORITY_RT);
// fprintf(stderr, "\n $$$$$#### created %s #####$$$\n","nr_feptx_thread" ); //--src572
}
......@@ -224,6 +242,9 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) {
int slot = tti_tx;
int *txdata = &ru->common.txdata[aa][slot*fp->samples_per_slot];
// fprintf(stderr, "\n $$$### In function nr_feptx_ofdm $$$####\n $$$$### The value of fp->Ncp = %d (cfg->subframe_config.dl_cyclic_prefix_type.value == 1) ? 12 : 14) * ofdm_symbol_size= %d , and slot_sizeF = %d in function nr_feptx_ofdm $$$### \n", cfg->subframe_config.dl_cyclic_prefix_type.value,fp->ofdm_symbol_size,slot_sizeF); //---src572
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
start_meas(&ru->ofdm_mod_stats);
......@@ -233,9 +254,11 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) {
(void*)ru->gNB_list[0]->common_vars.txdataF[aa], fp->samples_per_slot_wCP*sizeof(int32_t));
if ((nr_slot_select(cfg,slot)==SF_DL)||
((nr_slot_select(cfg,slot)==SF_S))) {
((nr_slot_select(cfg,slot)==SF_S)))
{
// LOG_D(HW,"Frame %d: Generating slot %d\n",frame,next_slot);
// fprintf(stderr, "\n $$$### Calling nr_feptx0 fp->symbols_per_slot = %d, slot = %d $$$#### \n", fp->symbols_per_slot,slot); ////----src572
nr_feptx0(ru,slot,0,fp->symbols_per_slot);
}
......
......@@ -86,59 +86,90 @@ void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PAR
LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier,cfg->sch_config.n_ssb_crb.value,cfg->sch_config.ssb_subcarrier_offset.value);
}
void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) {
void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot)
{
NR_DL_FRAME_PARMS *fp=&gNB->frame_parms;
nfapi_nr_config_request_t *cfg = &gNB->gNB_config;
int **txdataF = gNB->common_vars.txdataF;
uint8_t *pbch_pdu=&gNB->pbch_pdu[0];
uint8_t ssb_index, n_hf;
int ssb_start_symbol, rel_slot;
// fprintf(stderr, "\n%s\n","$$$$ in nr_common_signal_procedures() $$$$$ " ); // ---src572----
n_hf = cfg->sch_config.half_frame_index.value;
// if SSB periodicity is 5ms, they are transmitted in both half frames
if ( cfg->sch_config.ssb_periodicity.value == 5) {
if ( cfg->sch_config.ssb_periodicity.value == 5)
{
if (slot<10)
n_hf=0;
else
n_hf=1;
rel_slot = (n_hf)? (slot-40) : slot;
}
if ( cfg->sch_config.ssb_periodicity.value == 20) //---- we have 80 slots for mu=3 per frame, for half frame we have 40
{
if (slot<40)
n_hf=0;
else
n_hf=1;
rel_slot = (n_hf)? (slot-40) : slot;
}
// to set a effective slot number between 0 to 9 in the half frame where the SSB is supposed to be
rel_slot = (n_hf)? (slot-10) : slot;
// to set a effective slot number between 0 to 39 in the half frame where the SSB is supposed to be
rel_slot = (n_hf)? (slot-40) : slot;
LOG_D(PHY,"common_signal_procedures: frame %d, slot %d\n",frame,slot);
if(rel_slot<10 && rel_slot>=0) {
for (int i=0; i<2; i++) { // max two SSB per frame
// fprintf(stderr, "\n $$$#### The value of Lmax is %d \t $$$##### \n",fp->Lmax);
//if(rel_slot<10 && rel_slot>=0)
if(rel_slot<40 && rel_slot>=0) // ----src572
{
//for (int i=0; i<2; i++) //----src572
for (int i=0; i<32; i++) ////src572
{ // max two SSB per frame or slot? ////----src572 why only 2?
ssb_index = i + 2*rel_slot; // computing the ssb_index
if ((fp->L_ssb >> ssb_index) & 0x01) { // generating the ssb only if the bit of L_ssb at current ssb index is 1
ssb_index = i + 2*rel_slot; // computing the ssb_index
if ((fp->L_ssb >> ssb_index) & 0x01)
{ // generating the ssb only if the bit of L_ssb at current ssb index is 1
int ssb_start_symbol_abs = nr_get_ssb_start_symbol(fp, ssb_index, n_hf); // computing the starting symbol for current ssb
ssb_start_symbol = ssb_start_symbol_abs % 14; // start symbol wrt slot
int ssb_start_symbol_abs = nr_get_ssb_start_symbol(fp, ssb_index, n_hf); // computing the starting symbol for current ssb
ssb_start_symbol = ssb_start_symbol_abs % 14; // start symbol wrt slot
nr_set_ssb_first_subcarrier(cfg, fp); // setting the first subcarrier
nr_set_ssb_first_subcarrier(cfg, fp); // setting the first subcarrier
LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol);
nr_generate_pss(gNB->d_pss, txdataF[0], AMP, ssb_start_symbol, cfg, fp);
nr_generate_sss(gNB->d_sss, txdataF[0], AMP, ssb_start_symbol, cfg, fp);
if (fp->Lmax == 4)
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index],txdataF[0], AMP, ssb_start_symbol, cfg, fp);
else
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[0][ssb_index],txdataF[0], AMP, ssb_start_symbol, cfg, fp);
nr_generate_pbch(&gNB->pbch,
pbch_pdu,
gNB->nr_pbch_interleaver,
txdataF[0],
AMP,
ssb_start_symbol,
n_hf,fp->Lmax,ssb_index,
frame, cfg, fp);
}
}
LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol);
nr_generate_pss(gNB->d_pss, txdataF[0], AMP, ssb_start_symbol, cfg, fp);
nr_generate_sss(gNB->d_sss, txdataF[0], AMP, ssb_start_symbol, cfg, fp);
if (fp->Lmax == 4)
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index],txdataF[0], AMP, ssb_start_symbol, cfg, fp);
else
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[0][ssb_index],txdataF[0], AMP, ssb_start_symbol, cfg, fp);
nr_generate_pbch(&gNB->pbch,
pbch_pdu,
gNB->nr_pbch_interleaver,
txdataF[0],
AMP,
ssb_start_symbol,
n_hf,fp->Lmax,ssb_index,
frame, cfg, fp);
}
}
}
}
......@@ -152,11 +183,15 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
int offset = gNB->CC_id;
uint8_t ssb_frame_periodicity; // every how many frames SSB are generated
// fprintf(stderr, "%s\n","\n$$$$$$$$$$\n -----src572-- in phy_procedures_gNB_TX() in openair1/SCHED_NR/Phy_procedures_nr_gNB.c\n $$$$$$$$\n" );
if (cfg->sch_config.ssb_periodicity.value < 20)
ssb_frame_periodicity = 1;
else
ssb_frame_periodicity = (cfg->sch_config.ssb_periodicity.value)/10 ; // 10ms is the frame length
// fprintf(stderr, "\r\n $$$$$$ ssb_frame_periodicity is %d $$$$$$$$ \n", ssb_frame_periodicity);
if ((cfg->subframe_config.duplex_mode.value == TDD) && (nr_slot_select(cfg,slot)==SF_UL)) return;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+offset,1);
......@@ -177,31 +212,40 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
num_dci = gNB->pdcch_vars.num_dci;
num_pdsch_rnti = gNB->pdcch_vars.num_pdsch_rnti;
// fprintf(stderr, "%s\n", "\n in phy_procedures_gNB_TX() line 205 after nr_common_signal_procedures in openair1/SCHED_NR/phy_procedures_nr_gNB.c \n" );
if (num_dci) {
if (num_dci)
{
LOG_D(PHY, "[gNB %d] Frame %d slot %d \
Calling nr_generate_dci_top (number of DCI %d)\n", gNB->Mod_id, frame, slot, num_dci);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,1);
if (nfapi_mode == 0 || nfapi_mode == 1) {
if (nfapi_mode == 0 || nfapi_mode == 1)
{
nr_generate_dci_top(gNB->pdcch_vars,
gNB->nr_gold_pdcch_dmrs[slot],
gNB->nr_gold_pdcch_dmrs[slot], //---has to be changed here
gNB->common_vars.txdataF[0],
AMP, *fp, *cfg);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0);
if (num_pdsch_rnti) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,1);
// fprintf(stderr, "%s\n","in phy_procedures_gNB_TX() line 219 after nr_generate_dci_top in openair1/SCHED_NR/phy_procedures_nr_gNB.c" );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0);
if (num_pdsch_rnti)
{
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,1);
LOG_D(PHY, "PDSCH generation started (%d)\n", num_pdsch_rnti);
// fprintf(stderr, "%s\n","in phy_procedures_gNB_TX() line 226 in openair1/SCHED_NR/phy_procedures_nr_gNB.c" ); //---src572
nr_generate_pdsch(gNB->dlsch[0][0],
&gNB->pdcch_vars.dci_alloc[0],
gNB->nr_gold_pdsch_dmrs[slot],
gNB->nr_gold_pdsch_dmrs[slot], //// I think this function should be chnaged to generate bpsk maybe
gNB->common_vars.txdataF,
AMP, frame, slot, fp, cfg,
&gNB->dlsch_encoding_stats,
&gNB->dlsch_scrambling_stats,
&gNB->dlsch_modulation_stats);
// fprintf(stderr,"In phy_procedures_gNB_TX line 235 value is %d in openair1/SCHED_NR/phy_procedures_nr_gNB.c\n",*gNB->dlsch[0][0]);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,0);
}
}
}
......
......@@ -4130,8 +4130,10 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
NR_DL_UE_HARQ_t *dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
uint16_t nb_symb_sch = dlsch0_harq->nb_symbols;
uint8_t nb_symb_pdcch = pdcch_vars->coreset[0].duration;
uint8_t ssb_periodicity = 10;// ue->ssb_periodicity; // initialized to 5ms in nr_init_ue for scenarios where UE is not configured (otherwise acquired by cell configuration from gNB or LTE)
uint8_t ssb_periodicity = 20;// ue->ssb_periodicity; // initialized to 5ms in nr_init_ue for scenarios where UE is not configured (otherwise acquired by cell configuration from gNB or LTE)
// SRC572 was here
uint8_t dci_cnt = 0;
fapi_nr_pbch_config_t *pbch_config = &ue->nrUE_config.pbch_config;
LOG_D(PHY," ****** start RX-Chain for Frame.Slot %d.%d ****** \n", frame_rx%1024, nr_tti_rx);
......@@ -4166,7 +4168,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
start_meas(&ue->ofdm_demod_stats);
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN);
nr_slot_fep(ue,
fprintf(stderr, "line: 4169\r\n");
nr_slot_fep(ue,
l,
nr_tti_rx,
0,
......@@ -4184,13 +4187,13 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
stop_meas(&ue->ofdm_demod_stats);
#endif
//printf("phy procedure pdcch start measurement l =%d\n",l);
fprintf(stderr, "phy procedure pdcch start measurement l =%d\n",l);
//nr_ue_measurement_procedures(l,ue,proc,eNB_id,(nr_tti_rx),mode);
}
dci_cnt = nr_ue_pdcch_procedures(eNB_id, ue, proc);
fprintf(stderr, "OK\n");
if (dci_cnt > 0) {
LOG_I(PHY,"[UE %d] Frame %d, nr_tti_rx %d: found %d DCIs\n",ue->Mod_id,frame_rx,nr_tti_rx,dci_cnt);
......@@ -4218,7 +4221,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
nb_symb_sch = dlsch0_harq->nb_symbols;
for (uint16_t m=nb_symb_pdcch;m<=(nb_symb_sch+nb_symb_pdcch-1) ; m++){
nr_slot_fep(ue,
fprintf(stderr, "Line: 4222\r\n");
nr_slot_fep(ue,
m, //to be updated from higher layer
nr_tti_rx,
0,
......@@ -4307,7 +4311,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
LOG_D(PHY," ------ PBCH ChannelComp/LLR: frame.slot %d.%d ------ \n", frame_rx%1024, nr_tti_rx);
for (int i=1; i<4; i++) {
fprintf(stderr, "Line: 4311\r\n");
nr_slot_fep(ue,
(ue->symbol_offset+i)%(ue->frame_parms.symbols_per_slot),
nr_tti_rx,
......
......@@ -79,7 +79,7 @@ extern double cpuf;
void Msg1_transmitted(module_id_t module_idP, uint8_t CC_id, frame_t frameP, uint8_t eNB_id);
void Msg3_transmitted(module_id_t module_idP, uint8_t CC_id, frame_t frameP, uint8_t eNB_id);
extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
extern uint64_t downlink_frequency[MAX_NUM_CCs][4]; // -----changed from 32 to 64
void get_dumpparam(PHY_VARS_UE *ue,
UE_rxtx_proc_t *proc,
......
......@@ -676,7 +676,8 @@ int main(int argc, char **argv)
if (UE->is_synchronized == 0) {
UE_nr_rxtx_proc_t proc = {0};
ret = nr_initial_sync(&proc, UE, normal_txrx, 1);
fprintf(stderr, "LINE 679$#$$#\n\n\n\n");
ret = nr_initial_sync(&proc, UE, normal_txrx, 1);
printf("nr_initial_sync1 returns %d\n", ret);
if (ret < 0)
......
......@@ -99,7 +99,7 @@ int main(int argc, char **argv)
SCM_t channel_model=AWGN;//Rayleigh1_anticorr;
int N_RB_DL=273,mu=1;
int N_RB_DL=66,u=3; //---check these
//unsigned char frame_type = 0;
unsigned char pbch_phase = 0;
......@@ -361,28 +361,59 @@ int main(int argc, char **argv)
double fs,bw,scs,eps;
switch (mu) {
case 1:
scs = 30000;
if (N_RB_DL == 217) {
fs = 122.88e6;
bw = 80e6;
}
else if (N_RB_DL == 245) {
fs = 122.88e6;
bw = 90e6;
}
else if (N_RB_DL == 273) {
fs = 122.88e6;
bw = 100e6;
}
else if (N_RB_DL == 106) {
fs = 61.44e6;
bw = 40e6;
}
else AssertFatal(1==0,"Unsupported numerology for mu %d, N_RB %d\n",mu, N_RB_DL);
break;
switch (mu)
{
case 1:
scs = 30000;
if (N_RB_DL == 217)
{
fs = 122.88e6;
bw = 80e6;
}
else if (N_RB_DL == 245)
{
fs = 122.88e6;
bw = 90e6;
}
else if (N_RB_DL == 273)
{
fs = 122.88e6;
bw = 100e6;
}
else if (N_RB_DL == 106)
{
fs = 61.44e6;
bw = 40e6;
}
else AssertFatal(1==0,"Unsupported numerology for mu %d, N_RB %d\n",mu, N_RB_DL);
break;
case 3:
scs=120000;
if (N_RB_DL == 32)
{
fs = 61.44e6;
bw = 50e6;
}
else if (N_RB_DL == 66)
{
fs = 122.88e6;
bw = 1006;
}
else if (N_RB_DL == 132)
{
fs = 245.76e6;
bw = 200e6;
}
else if (N_RB_DL == 264)
{
fs = 491.52e6;
bw = 400e6;
}
else AssertFatal(1==0,"Unsupported numerology for mu %d, N_RB %d\n",mu, N_RB_DL);
break;
}
// cfo with respect to sub-carrier spacing
......@@ -402,8 +433,8 @@ int main(int argc, char **argv)
gNB2UE = new_channel_desc_scm(n_tx,
n_rx,
channel_model,
fs,
bw,
fs,
bw,
0,
0,
0);
......@@ -577,6 +608,7 @@ int main(int argc, char **argv)
if (UE->is_synchronized == 0) {
UE_nr_rxtx_proc_t proc={0};
fprintf(stderr, "My Line is 585 Bitch\n\n\n\\####\n")
ret = nr_initial_sync(&proc, UE, normal_txrx,1);
printf("nr_initial_sync1 returns %d\n",ret);
if (ret<0) n_errors++;
......@@ -601,12 +633,12 @@ int main(int argc, char **argv)
ret = nr_rx_pbch(UE,
&proc,
UE->pbch_vars[0],
frame_parms,
0,
ssb_index%8,
SISO,
UE->high_speed_flag);
UE->pbch_vars[0],
frame_parms,
0,
ssb_index%8,
SISO,
UE->high_speed_flag);
if (ret==0) {
//UE->rx_ind.rx_indication_body->mib_pdu.ssb_index; //not yet detected automatically
......
......@@ -65,12 +65,12 @@ static void configure_nr_rrc(uint32_t gnb_id)
{
MessageDef *msg_p = NULL;
// int CC_id;
LOG_I(GNB_APP,"+++++++++++++++3208912903290312\n");
msg_p = itti_alloc_new_message (TASK_GNB_APP, NRRRC_CONFIGURATION_REQ);
if (RC.nrrrc[gnb_id]) {
RCconfig_NRRRC(msg_p,gnb_id, RC.nrrrc[gnb_id]);
// my_RCconfig_NRRRC(msg_p,gnb_id, RC.nrrrc[gnb_id]);
LOG_I(GNB_APP,"Sending configuration message to NR_RRC task\n");
itti_send_msg_to_task (TASK_RRC_GNB, GNB_MODULE_ID_TO_INSTANCE(gnb_id), msg_p);
......@@ -119,7 +119,8 @@ static uint32_t gNB_app_register(uint32_t gnb_id_start, uint32_t gnb_id_end)//,
/*------------------------------------------------------------------------------*/
void *gNB_app_task(void *args_p)
void *gNB_app_task(void *args_p) //----
{
#if defined(ENABLE_ITTI)
uint32_t gnb_nb = RC.nb_nr_inst;
......@@ -138,7 +139,7 @@ void *gNB_app_task(void *args_p)
/* for no gcc warnings */
(void)instance;
itti_mark_task_ready (TASK_GNB_APP);
itti_mark_task_ready (TASK_GNB_APP); ///---- its void nothing being done -----src572
LOG_I(PHY, "%s() Task ready initialise structures\n", __FUNCTION__);
......
......@@ -266,7 +266,8 @@ void RCconfig_nr_flexran()
}
}
void RCconfig_NR_L1(void) {
void RCconfig_NR_L1(void)
{
int i,j;
paramdef_t L1_Params[] = L1PARAMS_DESC;
paramlist_def_t L1_ParamList = {CONFIG_STRING_L1_LIST,NULL,0};
......@@ -281,7 +282,8 @@ void RCconfig_NR_L1(void) {
config_getlist( &L1_ParamList,L1_Params,sizeof(L1_Params)/sizeof(paramdef_t), NULL);
if (L1_ParamList.numelt > 0) {
if (L1_ParamList.numelt > 0)
{
for (j = 0; j < RC.nb_nr_L1_inst; j++) {
RC.nb_nr_L1_CC[j] = *(L1_ParamList.paramarray[j][L1_CC_IDX].uptr);
......@@ -427,6 +429,11 @@ void RCconfig_nr_macrlc() {
}
}
//
/*void my_RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc)
{
}*/
void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
......@@ -623,7 +630,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
int32_t RateMatchPatternLTE_CRS_radioframeAllocationOffset = 0;
char* RateMatchPatternLTE_CRS_subframeAllocation_choice = NULL;
//LOG_I(NR_RRC,"[0]-----------------------------------------------------------------\n\n%d\n\n", nr_band);
/*int32_t srb1_timer_poll_retransmit = 0;
int32_t srb1_timer_reordering = 0;
int32_t srb1_timer_status_prohibit = 0;
......@@ -703,6 +710,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
// search if in active list
//LOG_I(NR_RRC,"[1]-----------------------------------------------------------------\n\n%d\n\n", nr_band);
for (k=0; k <num_gnbs ; k++) {
if (strcmp(GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[k], *(GNBParamList.paramarray[i][GNB_GNB_NAME_IDX].strptr) )== 0) {
......@@ -745,6 +753,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
(NRRRC_CONFIGURATION_REQ (msg_p).mnc_digit_length[l] == 3),"BAD MNC DIGIT LENGTH %d",
NRRRC_CONFIGURATION_REQ (msg_p).mnc_digit_length[l]);
}
//LOG_I(NR_RRC,"[2]-----------------------------------------------------------------\n\n%d\n\n", nr_band);
// Parse optional physical parameters
sprintf(gnbpath,"%s.[%i]",GNB_CONFIG_STRING_GNB_LIST,k),
......@@ -759,7 +768,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
for (j = 0; j < CCsParamList.numelt ;j++) {
sprintf(ccspath,"%s.%s.[%i]",gnbpath,GNB_CONFIG_STRING_COMPONENT_CARRIERS,j);
config_get( CCsParams,sizeof(CCsParams)/sizeof(paramdef_t),ccspath);
config_get(CCsParams,sizeof(CCsParams)/sizeof(paramdef_t),ccspath);
//LOG_I(NR_RRC,"[3]-----------------------------------------------------------------\n\n%d\n\n", nr_band);
nb_cc++;
......@@ -784,6 +794,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for DL_prefix_type choice: NORMAL or EXTENDED !\n",
RC.config_file_name, i, DL_prefix_type);
}
//LOG_I(NR_RRC,"[4]-----------------------------------------------------------------\n\n%d\n\n", nr_band);
if (!UL_prefix_type){
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d define %s: NORMAL,EXTENDED!\n",
......@@ -795,9 +806,12 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
}else {
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for UL_prefix_type choice: NORMAL or EXTENDED !\n",
RC.config_file_name, i, UL_prefix_type);
}
}
//LOG_I(NR_RRC,"[5]-----------------------------------------------------------------\n\n%d\n\n", nr_band);
//nr_band = 257;
NRRRC_CONFIGURATION_REQ (msg_p).nr_band[j] = nr_band;
NRRRC_CONFIGURATION_REQ (msg_p).downlink_frequency[j] = (uint64_t) downlink_frequency;
NRRRC_CONFIGURATION_REQ (msg_p).uplink_frequency_offset[j] = (unsigned int) uplink_frequency_offset;
NRRRC_CONFIGURATION_REQ (msg_p).Nid_cell[j]= Nid_cell;
......@@ -913,6 +927,9 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
}
NRRRC_CONFIGURATION_REQ (msg_p).SIB1_ssb_PeriodicityServingCell[j] = SIB1_ssb_PeriodicityServingCell;
// ---src572 shouldn't this be a logical or (||) instead of and (&&)
// fprintf(stderr, "\n$$$$$$$$$$$$\nThe value of SIB1_ssb_PeriodicityServingCell is %d \n$$$$$$$$$$$$$$\n", SIB1_ssb_PeriodicityServingCell);
if ((SIB1_ssb_PeriodicityServingCell !=5) &&
(SIB1_ssb_PeriodicityServingCell !=10) &&
(SIB1_ssb_PeriodicityServingCell !=20) &&
......@@ -1137,17 +1154,17 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
uint64_t t_freq;
if(nr_band == 41 || (nr_band > 76 && nr_band < 80))
t_freq = 2400000000;
if(nr_band == 41 || (nr_band > 76 && nr_band < 300))
t_freq = 2400000000;
else
t_freq = 3000000000;
t_freq = 3000000000;
if (downlink_frequency<t_freq && (ServingCellConfigCommon_ssb_PositionsInBurst_PR > 15))
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unvalid value \"%ld\" for ssb_PositionsInBurst at DL frequency %ld !\n",
if (downlink_frequency<t_freq && (ServingCellConfigCommon_ssb_PositionsInBurst_PR > 15))
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unvalid value \"%ld\" for ssb_PositionsInBurst at DL frequency %ld !\n",
RC.config_file_name, i, ServingCellConfigCommon_ssb_PositionsInBurst_PR, downlink_frequency);
else {
if(downlink_frequency<6000000000 && (ServingCellConfigCommon_ssb_PositionsInBurst_PR > 255))
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unvalid value \"%ld\" for ssb_PositionsInBurst at DL frequency %ld !\n",
if(downlink_frequency<6000000000 && (ServingCellConfigCommon_ssb_PositionsInBurst_PR > 255))
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unvalid value \"%ld\" for ssb_PositionsInBurst at DL frequency %ld !\n",
RC.config_file_name, i, ServingCellConfigCommon_ssb_PositionsInBurst_PR, downlink_frequency);
else
NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = ServingCellConfigCommon_ssb_PositionsInBurst_PR;
......
......@@ -89,7 +89,7 @@ void config_common(int Mod_idP,
{
nfapi_nr_config_request_t *cfg = &RC.nrmac[Mod_idP]->config[CC_idP];
int mu = 1;
int mu = 3; //----src572 why is it hard coded?
cfg->sch_config.physical_cell_id.value = cellid;
cfg->sch_config.ssb_scg_position_in_burst.value = ssb_pattern;
......@@ -105,8 +105,9 @@ void config_common(int Mod_idP,
cfg->nfapi_config.rf_bands.rf_band[0] = nr_bandP;
cfg->nfapi_config.rf_bands.tl.tag = NFAPI_PHY_RF_BANDS_TAG;
cfg->num_tlv++;
cfg->nfapi_config.nrarfcn.value = to_nrarfcn(nr_bandP,dl_CarrierFreqP,dl_BandwidthP*180000*(1+mu));
// fprintf(stderr, "in config_common() in openair2/LAYER2/NR_MAC_gNB/config.c value of BW in RB = %d\n", dl_BandwidthP);
cfg->nfapi_config.nrarfcn.value = to_nrarfcn(nr_bandP,dl_CarrierFreqP,dl_BandwidthP*180000*(1<<mu)); //-----src572 what is this 180k*4 //15k*12=1RB=180k
//cfg->nfapi_config.nrarfcn.value = to_nrarfcn(nr_bandP,dl_CarrierFreqP,dl_BandwidthP*120000*12); ///--- PRB*12*scs
cfg->nfapi_config.nrarfcn.tl.tag = NFAPI_NR_NFAPI_NRARFCN_TAG;
cfg->num_tlv++;
......@@ -134,18 +135,20 @@ void config_common(int Mod_idP,
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
int CC_idP,
int cellid,
int cellid,
int p_gNB,
int nr_bandP,
uint64_t ssb_pattern,
uint64_t ssb_pattern,
uint16_t ssb_enum_periodicity,
uint64_t dl_CarrierFreqP,
int dl_BandwidthP,
NR_BCCH_BCH_Message_t *mib,
NR_ServingCellConfigCommon_t *servingcellconfigcommon)
{
uint16_t ssb_periodicity=0;
uint16_t ssb_periodicity; // -------src572 changed from 0 to 1 to make ssb_periodicity to 10
// fprintf(stderr, "value of ssb_enum_periodicity = %d \n", ssb_enum_periodicity);
//ssb_enum_periodicity =2;
switch (ssb_enum_periodicity) {
case 0:
ssb_periodicity = 5;
......@@ -165,6 +168,8 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
case 5:
ssb_periodicity = 160;
break;
default :
fprintf(stderr, "%s\n","Not a correct value of ssb_periodicity in rrc_mac_config_req_gNB()" ); //----src572
}
if( mib != NULL ){
......@@ -174,11 +179,11 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
mib->message.choice.mib->subCarrierSpacingCommon,
mib->message.choice.mib->ssb_SubcarrierOffset,
mib->message.choice.mib->dmrs_TypeA_Position,
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
mib->message.choice.mib->pdcch_ConfigSIB1.controlResourceSetZero * 16 + mib->message.choice.mib->pdcch_ConfigSIB1.searchSpaceZero,
#else
#else
mib->message.choice.mib->pdcch_ConfigSIB1,
#endif
#endif
mib->message.choice.mib->cellBarred,
mib->message.choice.mib->intraFreqReselection
);
......@@ -188,9 +193,9 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
if( servingcellconfigcommon != NULL ){
config_common(Mod_idP,
CC_idP,
cellid,
cellid,
nr_bandP,
ssb_pattern,
ssb_pattern,
ssb_periodicity,
dl_CarrierFreqP,
dl_BandwidthP
......
......@@ -110,7 +110,8 @@ int to_absslot(nfapi_nr_config_request_t *cfg,int frame,int slot);
int get_symbolsperslot(nfapi_nr_config_request_t *cfg);
void get_band(uint32_t downlink_frequency, uint8_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type);
void get_band(uint64_t downlink_frequency, uint16_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type); //// ---src572
/// current band changed to 16 bits
uint64_t from_nrarfcn(int nr_bandP, uint32_t dl_nrarfcn);
......
......@@ -56,7 +56,7 @@ nr_bandentry_t nr_bandtable[] = {
{74, 1427000, 1470000, 1475000, 1518000, 20, 295000},
{75, 000, 000, 1432000, 1517000, 20, 286400},
{76, 000, 000, 1427000, 1432000, 20, 285400},
{77, 3300000, 4200000, 3300000, 4200000, 1, 620000},
//{77, 3300000, 4200000, 3300000, 4200000, 1, 620000},
{78, 3300000, 3800000, 3300000, 3800000, 1, 620000},
{79, 4400000, 5000000, 4400000, 5000000, 2, 693334},
{80, 1710000, 1785000, 000, 000, 20, 342000},
......@@ -64,40 +64,45 @@ nr_bandentry_t nr_bandtable[] = {
{82, 832000, 862000, 000, 000, 20, 166400},
{83, 703000, 748000, 000, 000, 20, 140600},
{84, 1920000, 1980000, 000, 000, 20, 384000},
{86, 1710000, 1785000, 000, 000, 20, 342000}
{86, 1710000, 1785000, 000, 000, 20, 342000},
{257, 26500000, 29500000,26500000,29500000, 1, 2054167} ///// Added this line ---- src572
};
#define NR_BANDTABLE_SIZE (sizeof(nr_bandtable)/sizeof(nr_bandentry_t))
void get_band(uint32_t downlink_frequency,
uint8_t *current_band,
void get_band(uint64_t downlink_frequency, ///// -----src572
uint16_t *current_band, ///// ----src572 changed from 8 to 16 bit to hold 257 band
int32_t *current_offset,
lte_frame_type_t *current_type)
{
int ind;
int64_t dl_freq_khz = downlink_frequency/1000;
fprintf(stderr, "The value of dl_freq_khz in get_band() is %llu size of nr_bandtable = %d \n",(long long unsigned int)dl_freq_khz,sizeof(nr_bandtable) / sizeof(nr_bandtable[0]));
for ( ind=0;
ind < sizeof(nr_bandtable) / sizeof(nr_bandtable[0]);
ind++) {
ind++)
{
*current_band = nr_bandtable[ind].band;
LOG_I(PHY, "Scanning band %d, dl_min %"PRIu64", ul_min %"PRIu64"\n", ind, nr_bandtable[ind].dl_min,nr_bandtable[ind].ul_min);
if ( nr_bandtable[ind].dl_min <= dl_freq_khz && nr_bandtable[ind].dl_max >= dl_freq_khz ) {
*current_offset = (nr_bandtable[ind].ul_min - nr_bandtable[ind].dl_min)*1000;
if (*current_offset == 0)
*current_type = TDD;
else
*current_type = FDD;
LOG_I( PHY, "DL frequency %"PRIu32": band %d, frame_type %d, UL frequency %"PRIu32"\n",
downlink_frequency, *current_band, *current_type, downlink_frequency+*current_offset);
LOG_I(PHY, "Scanning band %d,current_band %d, dl_min %"PRIu64", ul_max %"PRIu64"\n",*current_band, nr_bandtable[ind].band, nr_bandtable[ind].dl_min,nr_bandtable[ind].dl_max);
if ( nr_bandtable[ind].dl_min <= dl_freq_khz && nr_bandtable[ind].dl_max >= dl_freq_khz )
{
fprintf(stderr, "entering loop to find band() is %d \n", *current_band );
*current_offset = (nr_bandtable[ind].ul_min - nr_bandtable[ind].dl_min)*1000;
if (*current_offset == 0)
*current_type = TDD;
else
*current_type = FDD;
LOG_I( PHY, "DL frequency %"PRIu64": band %d, frame_type %d,TDD %d UL frequency %"PRIu64"\n",
downlink_frequency, *current_band, *current_type, TDD, downlink_frequency+*current_offset);
break;
}
}
AssertFatal(ind != (sizeof(nr_bandtable) / sizeof(nr_bandtable[0])),
"Can't find EUTRA band for frequency %d\n", downlink_frequency);
"Can't find EUTRA band for frequency %u\n", downlink_frequency);
}
......@@ -110,9 +115,9 @@ uint32_t to_nrarfcn(int nr_bandP,
int i;
LOG_I(MAC,"Searching for nr band %d DL Carrier frequency %llu bw %u\n",nr_bandP,(long long unsigned int)dl_CarrierFreq,bw);
AssertFatal(nr_bandP < 86, "nr_band %d > 86\n", nr_bandP);
for (i = 0; i < 30 && nr_bandtable[i].band != nr_bandP; i++);
LOG_I(MAC,"Searching for nr band %d DL Carrier frequency %llu bw %d\n",nr_bandP,(long long unsigned int)dl_CarrierFreq,bw);
//AssertFatal(nr_bandP < 86, "nr_band %d > 86\n", nr_bandP);
for (i = 0; i < 33 && nr_bandtable[i].band != nr_bandP; i++); //the loop was till 30. why?
AssertFatal(dl_CarrierFreq_by_1k >= nr_bandtable[i].dl_min,
"Band %d, bw %u : DL carrier frequency %llu kHz < %llu\n",
......@@ -144,8 +149,8 @@ uint64_t from_nrarfcn(int nr_bandP,
if (nr_bandP < 77 || nr_bandP > 79) deltaFglobal = 5;
else deltaFglobal = 15;
AssertFatal(nr_bandP < 87, "nr_band %d > 86\n", nr_bandP);
for (i = 0; i < 31 && nr_bandtable[i].band != nr_bandP; i++);
//AssertFatal(nr_bandP < 87, "nr_band %d > 86\n", nr_bandP);
for (i = 0; i < 33 && nr_bandtable[i].band != nr_bandP; i++);
AssertFatal(dl_nrarfcn>=nr_bandtable[i].N_OFFs_DL,"dl_nrarfcn %u < N_OFFs_DL %llu\n",dl_nrarfcn, (long long unsigned int)nr_bandtable[i].N_OFFs_DL);
return 1000*(nr_bandtable[i].dl_min + (dl_nrarfcn - nr_bandtable[i].N_OFFs_DL) * deltaFglobal);
......
......@@ -88,10 +88,7 @@ time_stats_t ip_pdcp_stats_tmp;
static void *pdcp_netlink_thread_fct(void *arg);
//-----------------------------------------------------------------------------
int
pdcp_netlink_init(
void
)
int pdcp_netlink_init (void)
//-----------------------------------------------------------------------------
{
int i;
......@@ -101,7 +98,7 @@ pdcp_netlink_init(
reset_meas(&ip_pdcp_stats_tmp);
nb_inst_enb = 1;
nb_inst_ue = 1;
fprintf(stderr, "%s\n", "In pdcp_netlink_init() in openairinterface/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c LIne 101\n");
if (LINK_ENB_PDCP_TO_GTPV1U) {
nb_inst_enb = 0;
LOG_I(PDCP, "[NETLINK] Creating 0 queues for eNB Netlink -> PDCP communication\n");
......
......@@ -112,7 +112,7 @@ mui_t rrc_gNB_mui = 0;
void openair_nr_rrc_on(const protocol_ctxt_t* const ctxt_pP){
LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_FMT" gNB:OPENAIR NR RRC IN....\n",PROTOCOL_NR_RRC_CTXT_ARGS(ctxt_pP));
LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_FMT" gNB:OPENAIR NR RRC ON....\n",PROTOCOL_NR_RRC_CTXT_ARGS(ctxt_pP));
for (int CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
rrc_config_nr_buffer (&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SI, BCCH, 1);
......@@ -254,14 +254,17 @@ static void init_NR_SI(const protocol_ctxt_t* const ctxt_pP,
);
LOG_I(NR_RRC,"Done init_NR_SI\n");
LOG_I(NR_RRC,"Value of nr_band in openairinterface5g/openair2/RRC/NR/rrc_gNB.c is %d \n",configuration->nr_band[CC_id]);
fprintf(stderr, "$$$$$$$$\nvalue of SSB_Periodicity = %d\n$$$$$$$$\n",configuration->ServingCellConfigCommon_ssb_periodicityServingCell[CC_id]);
rrc_mac_config_req_gNB(ctxt_pP->module_id,
CC_id,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].physCellId,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].physCellId,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_gNB,
configuration->nr_band[CC_id],
configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id],
configuration->ServingCellConfigCommon_ssb_periodicityServingCell[CC_id],
configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id],
configuration->ServingCellConfigCommon_ssb_periodicityServingCell[CC_id],
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq,
configuration->N_RB_DL[CC_id],
(NR_BCCH_BCH_Message_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].mib,
......@@ -270,7 +273,8 @@ static void init_NR_SI(const protocol_ctxt_t* const ctxt_pP,
}
char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigurationReq* configuration){
char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigurationReq* configuration)
{
protocol_ctxt_t ctxt;
int CC_id;
......@@ -447,6 +451,8 @@ void* rrc_gnb_task(void* args_p){
*/
/* Messages from gNB app */
case NRRRC_CONFIGURATION_REQ:
//LOG_I(NR_RRC, "---------------------------------------------------------------------------------------------------------------------\n");
LOG_I(NR_RRC, " %d\n", NRRRC_CONFIGURATION_REQ(msg_p).nr_band[0]);
LOG_I(NR_RRC, "[gNB %d] Received %s : %p\n", instance, msg_name_p,&NRRRC_CONFIGURATION_REQ(msg_p));
openair_rrc_gNB_configuration(GNB_INSTANCE_TO_MODULE_ID(instance), &NRRRC_CONFIGURATION_REQ(msg_p));
break;
......
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
\ No newline at end of file
......@@ -309,7 +309,7 @@ struct openair0_device_t {
/*! \brief Called to start the transceiver. Return 0 if OK, < 0 if error
@param device pointer to the device structure specific to the RF hardware target
*/
int (*trx_start_func)(openair0_device *device);
int (*trx_start_func )(openair0_device *device);
/*! \brief Called to configure the device
@param device pointer to the device structure specific to the RF hardware target
......
......@@ -30,7 +30,7 @@
#include <openair1/SIMULATION/TOOLS/sim.h>
#define PORT 4043 //TCP port for this simulator
#define CirSize 3072000 // 100ms is enough
#define CirSize 30720000*4 // 100ms is enough // *4 since sampleperframe 1228800 *100
#define sampleToByte(a,b) ((a)*(b)*sizeof(sample_t))
#define byteToSample(a,b) ((a)/(sizeof(sample_t)*(b)))
......@@ -114,6 +114,9 @@ void rxAddInput( struct complex16 *input_sig,
const int dd = abs(channelDesc->channel_offset);
const int nbTx = channelDesc->nb_tx;
// fprintf(stderr, "\n %s \n","$$$### entered rxAddInput() in simulator.c ###$$$" ); //// src572
for (int i=0; i<((int)nbSamples-dd); i++) {
struct complex16 *out_ptr=after_channel_sig+dd+i;
struct complex rx_tmp= {0};
......@@ -165,6 +168,9 @@ void allocCirBuf(rfsimulator_state_t *bridge, int sock) {
ev.events = EPOLLIN | EPOLLRDHUP;
ev.data.fd = sock;
AssertFatal(epoll_ctl(bridge->epollfd, EPOLL_CTL_ADD, sock, &ev) != -1, "");
// fprintf(stderr, "\n %s \n","$$$### entered allocCirBuf() in simulator.c ###$$$" ); //// src572
// create channel simulation model for this mode reception
// snr_dB is pure global, coming from configuration paramter "-s"
// Fixme: referenceSignalPower should come from the right place
......@@ -239,7 +245,7 @@ void fullwrite(int fd, void *_buf, ssize_t count, rfsimulator_state_t *t) {
if (write(t->saveIQfile, _buf, count) != count )
LOG_E(HW,"write in save iq file failed (%s)\n",strerror(errno));
}
// fprintf(stderr, "\n %s \n","$$$### entered fullwrite( in simulator.c ###$$$" ); //// src572
AssertFatal(fd>=0 && _buf && count >0 && t,
"Bug: %d/%p/%zd/%p", fd, _buf, count, t);
char *buf = _buf;
......@@ -287,6 +293,8 @@ sin_addr:
ev.events = EPOLLIN;
ev.data.fd = t->listen_sock;
AssertFatal(epoll_ctl(t->epollfd, EPOLL_CTL_ADD, t->listen_sock, &ev) != -1, "");
// fprintf(stderr, "\n %s \n","$$$### entered server_start() in simulator.c ###$$$" ); //// src572
return 0;
}
......@@ -306,6 +314,8 @@ sin_addr:
addr.sin_addr.s_addr = inet_addr(t->ip);
bool connected=false;
// fprintf(stderr, "\n %s \n","$$$### entered rfsimulator_write( in simulator.c ###$$$" ); //// src572
while(!connected) {
LOG_I(HW,"rfsimulator: trying to connect to %s:%d\n", t->ip, PORT);
......@@ -326,6 +336,8 @@ sin_addr:
int rfsimulator_write(openair0_device *device, openair0_timestamp timestamp, void **samplesVoid, int nsamps, int nbAnt, int flags) {
rfsimulator_state_t *t = device->priv;
LOG_D(HW,"sending %d samples at time: %ld\n", nsamps, timestamp);
// fprintf(stderr, "\n %s \n","$$$### entered rfsimulator_write( in simulator.c ###$$$" ); //// src572
for (int i=0; i<FD_SETSIZE; i++) {
......@@ -361,7 +373,8 @@ int rfsimulator_write(openair0_device *device, openair0_timestamp timestamp, voi
return nsamps;
}
static bool flushInput(rfsimulator_state_t *t, int timeout) {
static bool flushInput(rfsimulator_state_t *t, int timeout)
{
// Process all incoming events on sockets
// store the data in lists
struct epoll_event events[FD_SETSIZE]= {0};
......@@ -374,6 +387,8 @@ static bool flushInput(rfsimulator_state_t *t, int timeout) {
AssertFatal(false,"error in epoll_wait\n");
}
// fprintf(stderr, "\n %s \n","$$$### entered flushInput in simulator.c ###$$$" ); //// src572
for (int nbEv = 0; nbEv < nfds; ++nbEv) {
int fd=events[nbEv].data.fd;
......@@ -477,11 +492,14 @@ int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, vo
pthread_mutex_lock(&Sockmutex);
rfsimulator_state_t *t = device->priv;
//fprintf(stderr, "%s\n","rfsimulator_read() in targets/ARCH/rfsimulator/simulator.c" );
LOG_D(HW, "Enter rfsimulator_read, expect %d samples, will release at TS: %ld\n", nsamps, t->nextTimestamp+nsamps);
// deliver data from received data
// check if a UE is connected
int first_sock;
// fprintf(stderr, "%s\n", "\n$$$$$$$ Entering into rfsimulator_read() in targets/ARCH/rfsimulator/simulator.c $$$$$$$\n"); //----src572
for (first_sock=0; first_sock<FD_SETSIZE; first_sock++)
if (t->buf[first_sock].circularBuf != NULL )
break;
......@@ -494,11 +512,13 @@ int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, vo
t->nextTimestamp+=nsamps;
LOG_W(HW,"Generated void samples for Rx: %ld\n", t->nextTimestamp);
//fprintf(stderr, "%s\n","rfsimulator_read() in targets/ARCH/rfsimulator/simulator.c" );
*ptimestamp = t->nextTimestamp-nsamps;
pthread_mutex_unlock(&Sockmutex);
return nsamps;
}
} else {
} else
{
bool have_to_wait;
......@@ -606,6 +626,8 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
// (for phy layer, replace "hw" by "phy")
rfsimulator_state_t *rfsimulator = (rfsimulator_state_t *)calloc(sizeof(rfsimulator_state_t),1);
fprintf(stderr, "\n$$$$$##### device_init in rfsimulator $$$$$#####\n");
if ((rfsimulator->ip=getenv("RFSIMULATOR")) == NULL ) {
LOG_E(HW,helpTxt);
exit(1);
......@@ -645,7 +667,9 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
device->trx_read_func = rfsimulator_read;
device->uhd_set_thread_priority = NULL;
/* let's pretend to be a b2x0 */
device->type = USRP_B200_DEV;
// device->type = USRP_B200_DEV; ///// can we use this for 100MHz ,will this create any problems for simulation ---src572
// SRC 572
device->type = USRP_X300_DEV;
device->openair0_cfg=&openair0_cfg[0];
device->priv = rfsimulator;
......
......@@ -14,28 +14,28 @@
// now , if we use --mu option in UE, compiling error will occur.
// This problem will be fixed in the future.
# ifndef UESIM_EXPANSION
# define NUMBER_OF_UE_MAX 16
# define NUMBER_OF_NR_UE_MAX 16
# define NUMBER_OF_UE_MAX 2
# define NUMBER_OF_NR_UE_MAX 2
# define NUMBER_OF_UCI_VARS_MAX 56
# define NUMBER_OF_CONNECTED_eNB_MAX 3
# define NUMBER_OF_CONNECTED_gNB_MAX 3
# define NUMBER_OF_CONNECTED_eNB_MAX 1
# define NUMBER_OF_CONNECTED_gNB_MAX 1
# else
# define NUMBER_OF_UE_MAX 256
# define NUMBER_OF_NR_UE_MAX 16
# define NUMBER_OF_NR_UE_MAX 2
# define NUMBER_OF_UCI_VARS_MAX 256
# define NUMBER_OF_CONNECTED_eNB_MAX 1
# define NUMBER_OF_CONNECTED_gNB_MAX 3
# define NUMBER_OF_CONNECTED_gNB_MAX 1
# endif
# else
# define NUMBER_OF_UE_MAX 256
# define NUMBER_OF_NR_UE_MAX 256
# define NUMBER_OF_NR_UE_MAX 2
# define NUMBER_OF_UCI_VARS_MAX 256
# define NUMBER_OF_CONNECTED_eNB_MAX 1
# define NUMBER_OF_CONNECTED_gNB_MAX 1
# endif
# else
# define NUMBER_OF_UE_MAX 1
# define NUMBER_OF_NR_UE_MAX 1
# define NUMBER_OF_NR_UE_MAX 2
# define NUMBER_OF_UCI_VARS_MAX 56
# define NUMBER_OF_CONNECTED_eNB_MAX 1
# define NUMBER_OF_CONNECTED_gNB_MAX 1
......
......@@ -52,7 +52,7 @@ gNBs =
DL_offsetToCarrier = 15;
DL_SCS_SubcarrierSpacing = "kHz30";
DL_SCS_SpecificCarrier_k0 = 0;
DL_carrierBandwidth = 15;
DL_carrierBandwidth = 15; // why 15? 106 prb with 30kHz spacing? ==>40MHz system
DL_locationAndBandwidth = 15;
DL_BWP_SubcarrierSpacing = "kHz30";
DL_BWP_prefix_type = "NORMAL";
......
......@@ -52,7 +52,7 @@ gNBs =
DL_offsetToCarrier = 15;
DL_SCS_SubcarrierSpacing = "kHz30";
DL_SCS_SpecificCarrier_k0 = 0;
DL_carrierBandwidth = 15;
DL_carrierBandwidth = 15; // why is this 15?. 30k*217*12 => 80Mhz system
DL_locationAndBandwidth = 15;
DL_BWP_SubcarrierSpacing = "kHz30";
DL_BWP_prefix_type = "NORMAL";
......
......@@ -433,7 +433,7 @@ int main(void)
openair0_cfg[0].configFilename = malloc(strlen(openair_dir) + strlen(ini_file) + 2);
sprintf(openair0_cfg[0].configFilename, "%s/%s", openair_dir, ini_file);
}
// printf("openair0_cfg[0].configFilename:%s\n", openair0_cfg[0].configFilename);
printf("openair0_cfg[0].configFilename:%s\n", openair0_cfg[0].configFilename);
ret = openair0_device_load( &rf_device, &openair0_cfg[0] );
if (ret != 0){
......
......@@ -331,8 +331,8 @@ extern pthread_mutex_t sync_mutex;
extern int sync_var;
extern double snr_dB;
extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
extern uint64_t downlink_frequency[MAX_NUM_CCs][4]; // ---src572 changed from 32 to 64
extern int64_t uplink_frequency_offset[MAX_NUM_CCs][4]; //-----src572 should be signed as offset is negative
extern int rx_input_level_dBm;
extern uint8_t exit_missed_slots;
......
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