Merge remote-tracking branch 'origin/develop' into NR_MAC_SSB_RO_GlobalEdge
This commit is contained in:
@@ -401,7 +401,7 @@ void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_
|
||||
hULUE(newUDPheader)->O_ACK=eNB->ulsch[UE_id]->harq_processes[harq_pid]->O_ACK;
|
||||
memcpy(hULUE(newUDPheader)->o_ACK, eNB->ulsch[UE_id]->harq_processes[harq_pid]->o_ACK,
|
||||
sizeof(eNB->ulsch[UE_id]->harq_processes[harq_pid]->o_ACK));
|
||||
hULUE(newUDPheader)->ta=lte_est_timing_advance_pusch(eNB, UE_id);
|
||||
hULUE(newUDPheader)->ta=lte_est_timing_advance_pusch(&eNB->frame_parms, eNB->pusch_vars[UE_id]->drs_ch_estimates_time);
|
||||
hULUE(newUDPheader)->segment=segmentID;
|
||||
memcpy(hULUE(newUDPheader)->o, eNB->ulsch[UE_id]->harq_processes[harq_pid]->o,
|
||||
sizeof(eNB->ulsch[UE_id]->harq_processes[harq_pid]->o));
|
||||
@@ -917,7 +917,7 @@ void phy_procedures_eNB_TX_fromsplit(uint8_t *bufferZone, int nbBlocks, PHY_VARS
|
||||
|
||||
if (NFAPI_MODE==NFAPI_MONOLITHIC || NFAPI_MODE==NFAPI_MODE_PNF) {
|
||||
if (is_pmch_subframe(frame,subframe,fp)) {
|
||||
pmch_procedures(eNB,proc);
|
||||
pmch_procedures(eNB,proc,0);
|
||||
} else {
|
||||
// this is not a pmch subframe, so generate PSS/SSS/PBCH
|
||||
common_signal_procedures(eNB,frame, subframe);
|
||||
|
||||
@@ -1123,9 +1123,6 @@ int restart_L1L2(module_id_t enb_id) {
|
||||
sync_var = -1;
|
||||
pthread_mutex_unlock(&sync_mutex);
|
||||
RC.ru_mask |= (1 << ru->idx);
|
||||
/* copy the changed frame parameters to the RU */
|
||||
/* TODO this should be done for all RUs associated to this eNB */
|
||||
memcpy(&ru->frame_parms, &RC.eNB[enb_id][0]->frame_parms, sizeof(LTE_DL_FRAME_PARMS));
|
||||
/* reset the list of connected UEs in the MAC, since in this process with
|
||||
* loose all UEs (have to reconnect) */
|
||||
init_UE_info(&RC.mac[enb_id]->UE_info);
|
||||
@@ -1167,6 +1164,7 @@ int main ( int argc, char **argv ) {
|
||||
T_Config_Init();
|
||||
#endif
|
||||
configure_linux();
|
||||
set_softmodem_sighandler();
|
||||
cpuf=get_cpu_freq_GHz();
|
||||
set_taus_seed (0);
|
||||
|
||||
@@ -1347,7 +1345,7 @@ int main ( int argc, char **argv ) {
|
||||
// end of CI modifications
|
||||
//getchar();
|
||||
if(IS_SOFTMODEM_DOFORMS)
|
||||
load_softscope("enb");
|
||||
load_softscope("enb", NULL);
|
||||
|
||||
itti_wait_tasks_end();
|
||||
oai_exit=1;
|
||||
|
||||
+44
-19
@@ -180,6 +180,17 @@ int attach_rru(RU_t *ru)
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->prach_ConfigIndex[0]);
|
||||
AssertFatal((ru->ifdevice.trx_ctlsend_func(&ru->ifdevice,&rru_config_msg,rru_config_msg.len)!=-1),
|
||||
"RU %d failed send configuration to remote radio\n",ru->idx);
|
||||
|
||||
if ((len = ru->ifdevice.trx_ctlrecv_func(&ru->ifdevice,
|
||||
&rru_config_msg,
|
||||
msg_len))<0) {
|
||||
LOG_I(PHY,"Waiting for RRU %d\n",ru->idx);
|
||||
} else if (rru_config_msg.type == RRU_config_ok) {
|
||||
LOG_I(PHY, "RRU_config_ok received\n");
|
||||
} else {
|
||||
LOG_E(PHY,"Received incorrect message %d from RRU %d\n",rru_config_msg.type,ru->idx);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1442,6 +1453,8 @@ void *ru_thread( void *param ) {
|
||||
|
||||
LOG_I(PHY,"Starting RU %d (%s,%s),\n",ru->idx,NB_functions[ru->function],NB_timing[ru->if_timing]);
|
||||
|
||||
memcpy((void*)&ru->config,(void*)&RC.gNB[0]->gNB_config,sizeof(ru->config));
|
||||
|
||||
if(emulate_rf) {
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
nr_init_frame_parms(&ru->config, fp);
|
||||
@@ -1464,8 +1477,6 @@ void *ru_thread( void *param ) {
|
||||
AssertFatal(ret==0,"Cannot connect to remote radio\n");
|
||||
}
|
||||
|
||||
memcpy((void*)&ru->config,(void*)&RC.gNB[0]->gNB_config,sizeof(ru->config));
|
||||
|
||||
if (ru->if_south == LOCAL_RF) { // configure RF parameters only
|
||||
nr_init_frame_parms(&ru->config, fp);
|
||||
nr_dump_frame_parms(fp);
|
||||
@@ -1571,7 +1582,8 @@ void *ru_thread( void *param ) {
|
||||
if (slot_type == NR_UPLINK_SLOT || slot_type == NR_MIXED_SLOT) {
|
||||
//if (proc->tti_rx==8) {
|
||||
|
||||
if (ru->feprx) ru->feprx(ru,proc->tti_rx);
|
||||
if (ru->feprx) {
|
||||
ru->feprx(ru,proc->tti_rx);
|
||||
//LOG_M("rxdata.m","rxs",ru->common.rxdata[0],1228800,1,1);
|
||||
|
||||
LOG_D(PHY,"RU proc: frame_rx = %d, tti_rx = %d\n", proc->frame_rx, proc->tti_rx);
|
||||
@@ -1614,6 +1626,7 @@ void *ru_thread( void *param ) {
|
||||
}
|
||||
free_nr_ru_prach_entry(ru,prach_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// At this point, all information for subframe has been received on FH interface
|
||||
@@ -2154,26 +2167,29 @@ void set_function_spec_param(RU_t *ru) {
|
||||
ru->fh_north_out = NULL; // no outgoing fronthaul to north
|
||||
ru->nr_start_if = NULL; // no if interface
|
||||
ru->rfdevice.host_type = RAU_HOST;
|
||||
|
||||
// FK this here looks messed up. The following lines should be part of the if (ru->function == gNodeB_3GPP), shouldn't they?
|
||||
|
||||
ru->fh_south_in = rx_rf; // local synchronous RF RX
|
||||
ru->fh_south_out = tx_rf; // local synchronous RF TX
|
||||
ru->start_rf = start_rf; // need to start the local RF interface
|
||||
ru->stop_rf = stop_rf;
|
||||
ru->start_write_thread = start_write_thread; // starting RF TX in different thread
|
||||
printf("configuring ru_id %u (start_rf %p)\n", ru->idx, start_rf);
|
||||
}
|
||||
|
||||
ru->fh_south_in = rx_rf; // local synchronous RF RX
|
||||
ru->fh_south_out = tx_rf; // local synchronous RF TX
|
||||
ru->start_rf = start_rf; // need to start the local RF interface
|
||||
ru->stop_rf = stop_rf;
|
||||
ru->start_write_thread = start_write_thread; // starting RF TX in different thread
|
||||
printf("configuring ru_id %u (start_rf %p)\n", ru->idx, start_rf);
|
||||
/*
|
||||
if (ru->function == gNodeB_3GPP) { // configure RF parameters only for 3GPP eNodeB, we need to get them from RAU otherwise
|
||||
fill_rf_config(ru,rf_config_file);
|
||||
init_frame_parms(&ru->frame_parms,1);
|
||||
nr_phy_init_RU(ru);
|
||||
}
|
||||
printf("configuring ru_id %u (start_rf %p)\n", ru->idx, start_rf);
|
||||
fill_rf_config(ru,rf_config_file);
|
||||
init_frame_parms(&ru->frame_parms,1);
|
||||
nr_phy_init_RU(ru);
|
||||
|
||||
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
|
||||
if (setup_RU_buffers(ru)!=0) {
|
||||
printf("Exiting, cannot initialize RU Buffers\n");
|
||||
exit(-1);
|
||||
}*/
|
||||
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
|
||||
if (setup_RU_buffers(ru)!=0) {
|
||||
printf("Exiting, cannot initialize RU Buffers\n");
|
||||
exit(-1);
|
||||
}
|
||||
*/
|
||||
break;
|
||||
|
||||
case REMOTE_IF5: // the remote unit is IF5 RRU
|
||||
@@ -2226,6 +2242,15 @@ void set_function_spec_param(RU_t *ru) {
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (ru->ifdevice.get_internal_parameter != NULL) {
|
||||
void *t = ru->ifdevice.get_internal_parameter("fh_if4p5_south_in");
|
||||
if (t != NULL)
|
||||
ru->fh_south_in = t;
|
||||
t = ru->ifdevice.get_internal_parameter("fh_if4p5_south_out");
|
||||
if (t != NULL)
|
||||
ru->fh_south_out = t;
|
||||
}
|
||||
|
||||
malloc_IF4p5_buffer(ru);
|
||||
break;
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
|
||||
#include "system.h"
|
||||
#include <openair2/GNB_APP/gnb_app.h>
|
||||
|
||||
#include "PHY/TOOLS/phy_scope_interface.h"
|
||||
#include "PHY/TOOLS/nr_phy_scope.h"
|
||||
#include "stats.h"
|
||||
#include "nr-softmodem.h"
|
||||
@@ -84,9 +84,6 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include "NB_IoT_interface.h"
|
||||
#include "x2ap_eNB.h"
|
||||
|
||||
short nr_mod_table[NR_MOD_TABLE_SIZE_SHORT] = {0,0,16384,16384,-16384,-16384,16384,16384,16384,-16384,-16384,16384,-16384,-16384,7327,7327,7327,21981,21981,7327,21981,21981,7327,-7327,7327,-21981,21981,-7327,21981,-21981,-7327,7327,-7327,21981,-21981,7327,-21981,21981,-7327,-7327,-7327,-21981,-21981,-7327,-21981,-21981,10726,10726,10726,3576,3576,10726,3576,3576,10726,17876,10726,25027,3576,17876,3576,25027,17876,10726,17876,3576,25027,10726,25027,3576,17876,17876,17876,25027,25027,17876,25027,25027,10726,-10726,10726,-3576,3576,-10726,3576,-3576,10726,-17876,10726,-25027,3576,-17876,3576,-25027,17876,-10726,17876,-3576,25027,-10726,25027,-3576,17876,-17876,17876,-25027,25027,-17876,25027,-25027,-10726,10726,-10726,3576,-3576,10726,-3576,3576,-10726,17876,-10726,25027,-3576,17876,-3576,25027,-17876,10726,-17876,3576,-25027,10726,-25027,3576,-17876,17876,-17876,25027,-25027,17876,-25027,25027,-10726,-10726,-10726,-3576,-3576,-10726,-3576,-3576,-10726,-17876,-10726,-25027,-3576,-17876,-3576,-25027,-17876,-10726,-17876,-3576,-25027,-10726,-25027,-3576,-17876,-17876,-17876,-25027,-25027,-17876,-25027,-25027,8886,8886,8886,12439,12439,8886,12439,12439,8886,5332,8886,1778,12439,5332,12439,1778,5332,8886,5332,12439,1778,8886,1778,12439,5332,5332,5332,1778,1778,5332,1778,1778,8886,19547,8886,15993,12439,19547,12439,15993,8886,23101,8886,26655,12439,23101,12439,26655,5332,19547,5332,15993,1778,19547,1778,15993,5332,23101,5332,26655,1778,23101,1778,26655,19547,8886,19547,12439,15993,8886,15993,12439,19547,5332,19547,1778,15993,5332,15993,1778,23101,8886,23101,12439,26655,8886,26655,12439,23101,5332,23101,1778,26655,5332,26655,1778,19547,19547,19547,15993,15993,19547,15993,15993,19547,23101,19547,26655,15993,23101,15993,26655,23101,19547,23101,15993,26655,19547,26655,15993,23101,23101,23101,26655,26655,23101,26655,26655,8886,-8886,8886,-12439,12439,-8886,12439,-12439,8886,-5332,8886,-1778,12439,-5332,12439,-1778,5332,-8886,5332,-12439,1778,-8886,1778,-12439,5332,-5332,5332,-1778,1778,-5332,1778,-1778,8886,-19547,8886,-15993,12439,-19547,12439,-15993,8886,-23101,8886,-26655,12439,-23101,12439,-26655,5332,-19547,5332,-15993,1778,-19547,1778,-15993,5332,-23101,5332,-26655,1778,-23101,1778,-26655,19547,-8886,19547,-12439,15993,-8886,15993,-12439,19547,-5332,19547,-1778,15993,-5332,15993,-1778,23101,-8886,23101,-12439,26655,-8886,26655,-12439,23101,-5332,23101,-1778,26655,-5332,26655,-1778,19547,-19547,19547,-15993,15993,-19547,15993,-15993,19547,-23101,19547,-26655,15993,-23101,15993,-26655,23101,-19547,23101,-15993,26655,-19547,26655,-15993,23101,-23101,23101,-26655,26655,-23101,26655,-26655,-8886,8886,-8886,12439,-12439,8886,-12439,12439,-8886,5332,-8886,1778,-12439,5332,-12439,1778,-5332,8886,-5332,12439,-1778,8886,-1778,12439,-5332,5332,-5332,1778,-1778,5332,-1778,1778,-8886,19547,-8886,15993,-12439,19547,-12439,15993,-8886,23101,-8886,26655,-12439,23101,-12439,26655,-5332,19547,-5332,15993,-1778,19547,-1778,15993,-5332,23101,-5332,26655,-1778,23101,-1778,26655,-19547,8886,-19547,12439,-15993,8886,-15993,12439,-19547,5332,-19547,1778,-15993,5332,-15993,1778,-23101,8886,-23101,12439,-26655,8886,-26655,12439,-23101,5332,-23101,1778,-26655,5332,-26655,1778,-19547,19547,-19547,15993,-15993,19547,-15993,15993,-19547,23101,-19547,26655,-15993,23101,-15993,26655,-23101,19547,-23101,15993,-26655,19547,-26655,15993,-23101,23101,-23101,26655,-26655,23101,-26655,26655,-8886,-8886,-8886,-12439,-12439,-8886,-12439,-12439,-8886,-5332,-8886,-1778,-12439,-5332,-12439,-1778,-5332,-8886,-5332,-12439,-1778,-8886,-1778,-12439,-5332,-5332,-5332,-1778,-1778,-5332,-1778,-1778,-8886,-19547,-8886,-15993,-12439,-19547,-12439,-15993,-8886,-23101,-8886,-26655,-12439,-23101,-12439,-26655,-5332,-19547,-5332,-15993,-1778,-19547,-1778,-15993,-5332,-23101,-5332,-26655,-1778,-23101,-1778,-26655,-19547,-8886,-19547,-12439,-15993,-8886,-15993,-12439,-19547,-5332,-19547,-1778,-15993,-5332,-15993,-1778,-23101,-8886,-23101,-12439,-26655,-8886,-26655,-12439,-23101,-5332,-23101,-1778,-26655,-5332,-26655,-1778,-19547,-19547,-19547,-15993,-15993,-19547,-15993,-15993,-19547,-23101,-19547,-26655,-15993,-23101,-15993,-26655,-23101,-19547,-23101,-15993,-26655,-19547,-26655,-15993,-23101,-23101,-23101,-26655,-26655,-23101,-26655,-26655};
|
||||
|
||||
|
||||
pthread_cond_t nfapi_sync_cond;
|
||||
pthread_mutex_t nfapi_sync_mutex;
|
||||
int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
|
||||
@@ -156,7 +153,6 @@ char channels[128] = "0";
|
||||
|
||||
int rx_input_level_dBm;
|
||||
|
||||
uint32_t do_forms=0;
|
||||
int otg_enabled;
|
||||
|
||||
//int number_of_cards = 1;
|
||||
@@ -454,7 +450,11 @@ static void get_options(void) {
|
||||
|
||||
paramdef_t cmdline_params[] = CMDLINE_PARAMS_DESC_GNB ;
|
||||
|
||||
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
|
||||
get_common_options(SOFTMODEM_GNB_BIT );
|
||||
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
|
||||
CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -723,9 +723,6 @@ int restart_L1L2(module_id_t gnb_id) {
|
||||
|
||||
|
||||
RC.ru_mask |= (1 << ru->idx);
|
||||
/* copy the changed frame parameters to the RU */
|
||||
/* TODO this should be done for all RUs associated to this gNB */
|
||||
memcpy(&ru->nr_frame_parms, &RC.gNB[gnb_id]->frame_parms, sizeof(NR_DL_FRAME_PARMS));
|
||||
set_function_spec_param(RC.ru[gnb_id]);
|
||||
LOG_I(GNB_APP, "attempting to create ITTI tasks\n");
|
||||
// No more rrc thread, as many race conditions are hidden behind
|
||||
@@ -817,7 +814,6 @@ int main( int argc, char **argv )
|
||||
configure_linux();
|
||||
printf("Reading in command-line options\n");
|
||||
get_options ();
|
||||
get_common_options(SOFTMODEM_GNB_BIT );
|
||||
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) {
|
||||
fprintf(stderr,"Getting configuration failed\n");
|
||||
@@ -959,14 +955,14 @@ if(!IS_SOFTMODEM_NOS1)
|
||||
printf("RC.nb_RU:%d\n", RC.nb_RU);
|
||||
// once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration)
|
||||
printf("ALL RUs ready - init gNBs\n");
|
||||
|
||||
if (do_forms==1) {
|
||||
if(IS_SOFTMODEM_DOFORMS) {
|
||||
|
||||
scopeParms_t p;
|
||||
p.argc=&argc;
|
||||
p.argv=argv;
|
||||
p.gNB=RC.gNB[0];
|
||||
p.ru=RC.ru[0];
|
||||
gNBinitScope(&p);
|
||||
load_softscope("nr",&p);
|
||||
}
|
||||
|
||||
if (nfapi_mode != 1 && nfapi_mode != 2) {
|
||||
|
||||
@@ -19,21 +19,12 @@
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define CMDLINE_PARAMS_DESC_GNB { \
|
||||
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \
|
||||
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&wait_for_sync, defintval:0, TYPE_INT, 0}, \
|
||||
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
|
||||
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
|
||||
{"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:DEFAULT_DLF, TYPE_UINT64, 0}, \
|
||||
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \
|
||||
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \
|
||||
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \
|
||||
{"K" , CONFIG_HLP_ITTIL, PARAMFLAG_NOFREE, strptr:&itti_dump_file, defstrval:"/tmp/itti.dump", TYPE_STRING, 0}, \
|
||||
{"m" , CONFIG_HLP_DLMCS, 0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \
|
||||
{"t" , CONFIG_HLP_ULMCS, 0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \
|
||||
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
|
||||
{"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&numerology, defintval:0, TYPE_INT, 0}, \
|
||||
{"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \
|
||||
{"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)¶llel_config, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \
|
||||
{"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \
|
||||
}
|
||||
|
||||
+46
-50
@@ -35,9 +35,7 @@
|
||||
#include "NR_MAC_UE/mac_proto.h"
|
||||
#include "RRC/NR_UE/rrc_proto.h"
|
||||
|
||||
//#ifndef NO_RAT_NR
|
||||
#include "SCHED_NR/phy_frame_config_nr.h"
|
||||
//#endif
|
||||
#include "SCHED_NR_UE/phy_frame_config_nr.h"
|
||||
#include "SCHED_NR_UE/defs.h"
|
||||
|
||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
|
||||
@@ -123,7 +121,7 @@ extern double cpuf;
|
||||
#ifndef NO_RAT_NR
|
||||
#define DURATION_RX_TO_TX (NR_UE_CAPABILITY_SLOT_RX_TO_TX) /* for NR this will certainly depends to such UE capability which is not yet defined */
|
||||
#else
|
||||
#define DURATION_RX_TO_TX (4) /* For LTE, this duration is fixed to 4 and it is linked to LTE standard for both modes FDD/TDD */
|
||||
#define DURATION_RX_TO_TX (6) /* For LTE, this duration is fixed to 4 and it is linked to LTE standard for both modes FDD/TDD */
|
||||
#endif
|
||||
|
||||
#define FRAME_PERIOD 100000000ULL
|
||||
@@ -366,8 +364,6 @@ static void UE_synch(void *arg) {
|
||||
}
|
||||
|
||||
void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
||||
|
||||
|
||||
fapi_nr_config_request_t *cfg = &UE->nrUE_config;
|
||||
int tx_slot_type = nr_ue_slot_select(cfg, proc->frame_tx, proc->nr_tti_tx);
|
||||
uint8_t gNB_id = 0;
|
||||
@@ -475,21 +471,22 @@ void UE_processing(void *arg) {
|
||||
UE_nr_rxtx_proc_t *proc = &rxtxD->proc;
|
||||
PHY_VARS_NR_UE *UE = rxtxD->UE;
|
||||
|
||||
uint8_t gNB_id = 0;
|
||||
|
||||
// params for UL time alignment procedure
|
||||
NR_UL_TIME_ALIGNMENT_t *ul_time_alignment = &UE->ul_time_alignment[gNB_id];
|
||||
uint8_t numerology = UE->frame_parms.numerology_index;
|
||||
uint16_t bwp_ul_NB_RB = UE->frame_parms.N_RB_UL;
|
||||
int slot_tx = proc->nr_tti_tx;
|
||||
int frame_tx = proc->frame_tx;
|
||||
processSlotRX(UE, proc);
|
||||
processSlotTX(UE, proc);
|
||||
|
||||
/* UL time alignment
|
||||
// If the current tx frame and slot match the TA configuration in ul_time_alignment
|
||||
// then timing advance is processed and set to be applied in the next UL transmission */
|
||||
if (UE->mac_enabled == 1) {
|
||||
uint8_t gNB_id = 0;
|
||||
NR_UL_TIME_ALIGNMENT_t *ul_time_alignment = &UE->ul_time_alignment[gNB_id];
|
||||
int slot_tx = proc->nr_tti_tx;
|
||||
int frame_tx = proc->frame_tx;
|
||||
|
||||
if (frame_tx == ul_time_alignment->ta_frame && slot_tx == ul_time_alignment->ta_slot) {
|
||||
uint8_t numerology = UE->frame_parms.numerology_index;
|
||||
uint16_t bwp_ul_NB_RB = UE->frame_parms.N_RB_UL;
|
||||
|
||||
LOG_D(PHY,"Applying timing advance -- frame %d -- slot %d\n", frame_tx, slot_tx);
|
||||
|
||||
//if (nfapi_mode!=3){
|
||||
@@ -499,9 +496,6 @@ void UE_processing(void *arg) {
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
processSlotRX(UE, proc);
|
||||
processSlotTX(UE, proc);
|
||||
}
|
||||
|
||||
void dummyWrite(PHY_VARS_NR_UE *UE,openair0_timestamp timestamp, int writeBlockSize) {
|
||||
@@ -577,12 +571,6 @@ void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
|
||||
|
||||
int computeSamplesShift(PHY_VARS_NR_UE *UE) {
|
||||
|
||||
if (IS_SOFTMODEM_RFSIM) {
|
||||
LOG_D(PHY,"SET rx_offset %d \n",UE->rx_offset);
|
||||
//UE->rx_offset_diff=0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// compute TO compensation that should be applied for this frame
|
||||
if ( UE->rx_offset < UE->frame_parms.samples_per_frame/2 &&
|
||||
UE->rx_offset > 0 ) {
|
||||
@@ -632,6 +620,7 @@ void *UE_thread(void *arg) {
|
||||
notifiedFIFO_t freeBlocks;
|
||||
initNotifiedFIFO_nothreadSafe(&freeBlocks);
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
int timing_advance = UE->timing_advance;
|
||||
|
||||
for (int i=0; i<RX_NB_TH+1; i++) // RX_NB_TH working + 1 we are making to be pushed
|
||||
pushNotifiedFIFO_nothreadSafe(&freeBlocks,
|
||||
@@ -736,21 +725,26 @@ void *UE_thread(void *arg) {
|
||||
|
||||
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
|
||||
txp[i] = (void *)&UE->common_vars.txdata[i][UE->frame_parms.get_samples_slot_timestamp(
|
||||
((curMsg->proc.nr_tti_rx + DURATION_RX_TO_TX)%nb_slot_frame),&UE->frame_parms,0)];
|
||||
((slot_nr + DURATION_RX_TO_TX - RX_NB_TH)%nb_slot_frame),&UE->frame_parms,0)];
|
||||
|
||||
int readBlockSize, writeBlockSize;
|
||||
|
||||
if (slot_nr<(nb_slot_frame - 1)) {
|
||||
readBlockSize=get_readBlockSize(slot_nr, &UE->frame_parms);
|
||||
writeBlockSize=UE->frame_parms.get_samples_per_slot(curMsg->proc.nr_tti_tx,&UE->frame_parms);
|
||||
writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - RX_NB_TH) % nb_slot_frame, &UE->frame_parms);
|
||||
} else {
|
||||
UE->rx_offset_diff = computeSamplesShift(UE);
|
||||
readBlockSize=get_readBlockSize(slot_nr, &UE->frame_parms) -
|
||||
UE->rx_offset_diff;
|
||||
writeBlockSize=UE->frame_parms.get_samples_per_slot(curMsg->proc.nr_tti_tx,&UE->frame_parms) -
|
||||
writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - RX_NB_TH) % nb_slot_frame, &UE->frame_parms)-
|
||||
UE->rx_offset_diff;
|
||||
}
|
||||
|
||||
if (UE->timing_advance != timing_advance) {
|
||||
writeBlockSize -= UE->timing_advance - timing_advance;
|
||||
timing_advance = UE->timing_advance;
|
||||
}
|
||||
|
||||
AssertFatal(readBlockSize ==
|
||||
UE->rfdevice.trx_read_func(&UE->rfdevice,
|
||||
×tamp,
|
||||
@@ -758,29 +752,19 @@ void *UE_thread(void *arg) {
|
||||
readBlockSize,
|
||||
UE->frame_parms.nb_antennas_rx),"");
|
||||
|
||||
AssertFatal( writeBlockSize ==
|
||||
UE->rfdevice.trx_write_func(&UE->rfdevice,
|
||||
timestamp+
|
||||
UE->frame_parms.get_samples_slot_timestamp(slot_nr,
|
||||
&UE->frame_parms,DURATION_RX_TO_TX) - firstSymSamp -
|
||||
openair0_cfg[0].tx_sample_advance,
|
||||
txp,
|
||||
writeBlockSize,
|
||||
UE->frame_parms.nb_antennas_tx,
|
||||
1),"");
|
||||
|
||||
if( slot_nr==(nb_slot_frame-1)) {
|
||||
// read in first symbol of next frame and adjust for timing drift
|
||||
int first_symbols=UE->frame_parms.ofdm_symbol_size+UE->frame_parms.nb_prefix_samples0; // first symbol of every frames
|
||||
|
||||
if ( first_symbols > 0 )
|
||||
if ( first_symbols > 0 ) {
|
||||
openair0_timestamp ignore_timestamp;
|
||||
AssertFatal(first_symbols ==
|
||||
UE->rfdevice.trx_read_func(&UE->rfdevice,
|
||||
×tamp,
|
||||
&ignore_timestamp,
|
||||
(void **)UE->common_vars.rxdata,
|
||||
first_symbols,
|
||||
UE->frame_parms.nb_antennas_rx),"");
|
||||
else
|
||||
} else
|
||||
LOG_E(PHY,"can't compensate: diff =%d\n", first_symbols);
|
||||
}
|
||||
|
||||
@@ -791,18 +775,15 @@ void *UE_thread(void *arg) {
|
||||
notifiedFIFO_elt_t *res;
|
||||
|
||||
while (nbSlotProcessing >= RX_NB_TH) {
|
||||
if ( (res=tryPullTpool(&nf, Tpool)) != NULL ) {
|
||||
nbSlotProcessing--;
|
||||
processingData_t *tmp=(processingData_t *)res->msgData;
|
||||
res=pullTpool(&nf, Tpool);
|
||||
nbSlotProcessing--;
|
||||
processingData_t *tmp=(processingData_t *)res->msgData;
|
||||
|
||||
if (tmp->proc.decoded_frame_rx != -1)
|
||||
decoded_frame_rx=(((mac->mib->systemFrameNumber.buf[0] >> mac->mib->systemFrameNumber.bits_unused)<<4) | tmp->proc.decoded_frame_rx);
|
||||
//decoded_frame_rx=tmp->proc.decoded_frame_rx;
|
||||
if (tmp->proc.decoded_frame_rx != -1)
|
||||
decoded_frame_rx=(((mac->mib->systemFrameNumber.buf[0] >> mac->mib->systemFrameNumber.bits_unused)<<4) | tmp->proc.decoded_frame_rx);
|
||||
//decoded_frame_rx=tmp->proc.decoded_frame_rx;
|
||||
|
||||
pushNotifiedFIFO_nothreadSafe(&freeBlocks,res);
|
||||
}
|
||||
|
||||
usleep(200);
|
||||
pushNotifiedFIFO_nothreadSafe(&freeBlocks,res);
|
||||
}
|
||||
|
||||
if ( (decoded_frame_rx != curMsg->proc.frame_rx) &&
|
||||
@@ -811,6 +792,20 @@ void *UE_thread(void *arg) {
|
||||
LOG_E(PHY,"Decoded frame index (%d) is not compatible with current context (%d), UE should go back to synch mode\n",
|
||||
decoded_frame_rx, curMsg->proc.frame_rx );
|
||||
|
||||
AssertFatal( writeBlockSize ==
|
||||
UE->rfdevice.trx_write_func(&UE->rfdevice,
|
||||
timestamp+
|
||||
UE->frame_parms.get_samples_slot_timestamp(slot_nr,
|
||||
&UE->frame_parms,DURATION_RX_TO_TX - RX_NB_TH) - firstSymSamp -
|
||||
openair0_cfg[0].tx_sample_advance - UE->N_TA_offset - UE->timing_advance,
|
||||
txp,
|
||||
writeBlockSize,
|
||||
UE->frame_parms.nb_antennas_tx,
|
||||
1),"");
|
||||
|
||||
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
|
||||
memset(txp[i], 0, writeBlockSize);
|
||||
|
||||
nbSlotProcessing++;
|
||||
msgToPush->key=slot_nr;
|
||||
pushTpool(Tpool, msgToPush);
|
||||
@@ -829,6 +824,7 @@ void *UE_thread(void *arg) {
|
||||
|
||||
pushNotifiedFIFO_nothreadSafe(&freeBlocks,res);
|
||||
}
|
||||
|
||||
} // while !oai_exit
|
||||
|
||||
return NULL;
|
||||
|
||||
@@ -38,13 +38,12 @@
|
||||
#include "../../ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
|
||||
|
||||
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
|
||||
#include "openair1/PHY/MODULATION/nr_modulation.h"
|
||||
#include "PHY/phy_vars_nr_ue.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_vars.h"
|
||||
#include "SCHED/sched_common_vars.h"
|
||||
#include "PHY/MODULATION/modulation_vars.h"
|
||||
//#include "../../SIMU/USER/init_lte.h"
|
||||
#include "PHY/NR_REFSIG/nr_mod_table.h"
|
||||
|
||||
#include "LAYER2/MAC/mac_vars.h"
|
||||
#include "RRC/LTE/rrc_vars.h"
|
||||
@@ -76,12 +75,12 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include <openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h>
|
||||
#include <openair1/SCHED_NR_UE/fapi_nr_ue_l1.h>
|
||||
|
||||
/* Callbacks, globals and object handlers */
|
||||
|
||||
//#include "stats.h"
|
||||
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
|
||||
#include "PHY/TOOLS/phy_scope_interface.h"
|
||||
#include "PHY/TOOLS/nr_phy_scope.h"
|
||||
// at eNB 0, an UL scope for every UE
|
||||
//FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
|
||||
#include <executables/nr-uesoftmodem.h>
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "executables/thread-common.h"
|
||||
@@ -151,14 +150,11 @@ char ref[128] = "internal";
|
||||
char channels[128] = "0";
|
||||
|
||||
|
||||
static char *parallel_config = NULL;
|
||||
static char *worker_config = NULL;
|
||||
|
||||
int rx_input_level_dBm;
|
||||
|
||||
//static int online_log_messages=0;
|
||||
|
||||
uint32_t do_forms=0;
|
||||
|
||||
int otg_enabled;
|
||||
//int number_of_cards = 1;
|
||||
|
||||
@@ -588,7 +584,7 @@ void init_pdcp(void) {
|
||||
LOG_I(RLC, "Problem at RLC initiation \n");
|
||||
}
|
||||
pdcp_layer_init();
|
||||
nr_ip_over_LTE_DRB_preconfiguration();*/
|
||||
nr_DRB_preconfiguration();*/
|
||||
pdcp_module_init(pdcp_initmask);
|
||||
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
|
||||
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
|
||||
@@ -689,11 +685,14 @@ int main( int argc, char **argv ) {
|
||||
|
||||
fapi_nr_config_request_t *nrUE_config = &UE[CC_id]->nrUE_config;
|
||||
nr_init_frame_parms_ue(frame_parms[CC_id],nrUE_config,NORMAL);
|
||||
|
||||
|
||||
// Overwrite DL frequency (for FR2 testing)
|
||||
if (downlink_frequency[0][0]!=0)
|
||||
if (downlink_frequency[0][0]!=0) {
|
||||
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
|
||||
frame_parms[CC_id]->ul_CarrierFreq = downlink_frequency[0][0];
|
||||
}
|
||||
|
||||
init_symbol_rotation(frame_parms[CC_id],frame_parms[CC_id]->dl_CarrierFreq);
|
||||
init_nr_ue_vars(UE[CC_id],frame_parms[CC_id],0,abstraction_flag);
|
||||
|
||||
UE[CC_id]->mac_enabled = 1;
|
||||
@@ -761,20 +760,16 @@ int main( int argc, char **argv ) {
|
||||
memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*NUMBER_OF_UE_MAX*MAX_NUM_CCs);
|
||||
configure_linux();
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
if (do_forms)
|
||||
nrUEinitScope(PHY_vars_UE_g[0][0]);
|
||||
|
||||
if(IS_SOFTMODEM_DOFORMS) {
|
||||
load_softscope("nr",PHY_vars_UE_g[0][0]);
|
||||
}
|
||||
number_of_cards = 1;
|
||||
|
||||
for(int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.card=0;
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.chain=CC_id+chain_offset;
|
||||
#if defined(OAI_USRP) || defined(OAI_ADRV9371_ZC706)
|
||||
PHY_vars_UE_g[0][CC_id]->hw_timing_advance = timing_advance;
|
||||
PHY_vars_UE_g[0][CC_id]->timing_advance = timing_advance;
|
||||
#else
|
||||
PHY_vars_UE_g[0][CC_id]->hw_timing_advance = 160;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
init_NR_UE_threads(1);
|
||||
|
||||
@@ -61,19 +61,11 @@
|
||||
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
|
||||
{"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
|
||||
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
|
||||
{"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:0,TYPE_UINT64, 0}, \
|
||||
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \
|
||||
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:&do_forms, defintval:0, TYPE_INT, 0}, \
|
||||
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, iptr:&threequarter_fs, defintval:0, TYPE_INT, 0}, \
|
||||
{"m" , CONFIG_HLP_DLMCS, 0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \
|
||||
{"t" , CONFIG_HLP_ULMCS, 0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \
|
||||
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
|
||||
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"numerology" , CONFIG_HLP_NUMEROLOGY, 0, iptr:&numerology, defintval:0, TYPE_INT, 0}, \
|
||||
{"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \
|
||||
{"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)¶llel_config, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \
|
||||
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&UE_no_timing_correction, defintval:0, TYPE_INT, 0}, \
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <openair1/PHY/defs_eNB.h>
|
||||
#include <common/utils/telnetsrv/telnetsrv_proccmd.h>
|
||||
|
||||
#define CU_PORT "7878"
|
||||
#define DU_PORT "8787"
|
||||
@@ -279,7 +280,7 @@ int init_rf(RU_t *ru);
|
||||
void rx_rf(RU_t *ru, L1_rxtx_proc_t *proc);
|
||||
void tx_rf(RU_t *ru, L1_rxtx_proc_t *proc);
|
||||
void common_signal_procedures (PHY_VARS_eNB *eNB,int frame, int subframe);
|
||||
void pmch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc);
|
||||
void pmch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, int fembms_flag);
|
||||
bool dlsch_procedures(PHY_VARS_eNB *eNB,
|
||||
L1_rxtx_proc_t *proc,
|
||||
int harq_pid,
|
||||
@@ -325,5 +326,6 @@ void fep_full(RU_t *ru, int subframe);
|
||||
void feptx_prec(RU_t *ru,int frame,int subframe);
|
||||
void feptx_ofdm(RU_t *ru, int frame, int subframe);
|
||||
void oai_subframe_ind(uint16_t sfn, uint16_t sf);
|
||||
void softmodem_printresources(int sig, telnet_printfunc_t pf);
|
||||
extern uint16_t sf_ahead;
|
||||
#endif
|
||||
|
||||
+3
-3
@@ -21,8 +21,8 @@
|
||||
|
||||
/* Header file generated by fdesign on Thu Aug 28 12:13:51 2014 */
|
||||
|
||||
#ifndef FD_stats_form_h_
|
||||
#define FD_stats_form_h_
|
||||
#ifndef _EXECUTABLES_STATS_H_
|
||||
#define _EXECUTABLES_STATS_H_
|
||||
|
||||
#include <forms.h>
|
||||
|
||||
@@ -43,4 +43,4 @@ typedef struct {
|
||||
|
||||
extern FD_stats_form *create_form_stats_form( void );
|
||||
|
||||
#endif /* FD_stats_form_h_ */
|
||||
#endif /* _EXECUTABLES_STATS_H_ */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef _THREADS_T_H_
|
||||
#define _THREADS_T_H_
|
||||
#ifndef _EXECUTABLES_THREADS_T_H_
|
||||
#define _EXECUTABLES_THREADS_T_H_
|
||||
|
||||
typedef struct threads_s {
|
||||
int main;
|
||||
@@ -18,4 +18,4 @@ typedef struct threads_s {
|
||||
//int dlsch_td1_three;
|
||||
} threads_t;
|
||||
|
||||
#endif /* _THREADS_T_H_ */
|
||||
#endif /* _EXECUTABLES_THREADS_T_H_ */
|
||||
|
||||
Reference in New Issue
Block a user