Patch provided by Gabriel Arrobo.
Mainly comestics and integer type management Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
This commit is contained in:
@@ -926,7 +926,7 @@ void init_gNB(int single_thread_flag,int wait_for_sync) {
|
||||
int CC_id;
|
||||
int inst;
|
||||
PHY_VARS_gNB *gNB;
|
||||
LOG_I(PHY,"[nr-softmodem.c] gNB structure about to allocated RC.nb_nr_L1_inst:%d RC.nb_nr_L1_CC[0]:%d\n",RC.nb_nr_L1_inst,RC.nb_nr_L1_CC[0]);
|
||||
LOG_I(PHY,"[nr-softmodem.c] gNB structure about to be allocated RC.nb_nr_L1_inst:%d RC.nb_nr_L1_CC[0]:%d\n",RC.nb_nr_L1_inst,RC.nb_nr_L1_CC[0]);
|
||||
|
||||
if (RC.gNB == NULL) RC.gNB = (PHY_VARS_gNB ***) malloc(RC.nb_nr_L1_inst*sizeof(PHY_VARS_gNB **));
|
||||
|
||||
|
||||
+10
-10
@@ -992,7 +992,7 @@ void wakeup_gNB_L1s(RU_t *ru) {
|
||||
if (ru->num_gNB==1 && ru->gNB_top!=0 && get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD) {
|
||||
// call gNB function directly
|
||||
char string[20];
|
||||
sprintf(string,"Incoming RU %d",ru->idx);
|
||||
sprintf(string,"Incoming RU %u",ru->idx);
|
||||
LOG_D(PHY,"RU %d Call gNB_top\n",ru->idx);
|
||||
ru->gNB_top(gNB_list[0],ru->proc.frame_rx,ru->proc.tti_rx,string,ru);
|
||||
} else {
|
||||
@@ -1172,7 +1172,7 @@ int setup_RU_buffers(RU_t *ru) {
|
||||
for (i=0; i<ru->nb_rx; i++) {
|
||||
card = i/4;
|
||||
ant = i%4;
|
||||
printf("Mapping RU id %d, rx_ant %d, on card %d, chain %d\n",ru->idx,i,ru->rf_map.card+card, ru->rf_map.chain+ant);
|
||||
printf("Mapping RU id %u, rx_ant %d, on card %d, chain %d\n",ru->idx,i,ru->rf_map.card+card, ru->rf_map.chain+ant);
|
||||
free(ru->common.rxdata[i]);
|
||||
ru->common.rxdata[i] = ru->openair0_cfg.rxbase[ru->rf_map.chain+ant];
|
||||
printf("rxdata[%d] @ %p\n",i,ru->common.rxdata[i]);
|
||||
@@ -1186,7 +1186,7 @@ int setup_RU_buffers(RU_t *ru) {
|
||||
for (i=0; i<ru->nb_tx; i++) {
|
||||
card = i/4;
|
||||
ant = i%4;
|
||||
printf("Mapping RU id %d, tx_ant %d, on card %d, chain %d\n",ru->idx,i,ru->rf_map.card+card, ru->rf_map.chain+ant);
|
||||
printf("Mapping RU id %u, tx_ant %d, on card %d, chain %d\n",ru->idx,i,ru->rf_map.card+card, ru->rf_map.chain+ant);
|
||||
free(ru->common.txdata[i]);
|
||||
ru->common.txdata[i] = ru->openair0_cfg.txbase[ru->rf_map.chain+ant];
|
||||
printf("txdata[%d] @ %p\n",i,ru->common.txdata[i]);
|
||||
@@ -1336,7 +1336,7 @@ static void *ru_thread_tx( void *param ) {
|
||||
for (int j=0; j<gNB->num_RU; j++) {
|
||||
if (ru == gNB->RU_list[j]) {
|
||||
if ((gNB_proc->RU_mask_tx&(1<<j)) > 0)
|
||||
LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information from RU tx %d (num_RU %d,mask %x) has not been served yet!\n",
|
||||
LOG_E(PHY,"gNB %d frame %d, subframe %d : previous information from RU tx %d (num_RU %d,mask %x) has not been served yet!\n",
|
||||
gNB->Mod_id,gNB_proc->frame_rx,gNB_proc->slot_rx,ru->idx,gNB->num_RU,gNB_proc->RU_mask_tx);
|
||||
|
||||
gNB_proc->RU_mask_tx |= (1<<j);
|
||||
@@ -1386,7 +1386,7 @@ static void *ru_thread( void *param ) {
|
||||
// set default return value
|
||||
ru_thread_status = 0;
|
||||
// set default return value
|
||||
sprintf(threadname,"ru_thread %d",ru->idx);
|
||||
sprintf(threadname,"ru_thread %u",ru->idx);
|
||||
|
||||
|
||||
LOG_I(PHY,"Starting RU %d (%s,%s),\n",ru->idx,NB_functions[ru->function],NB_timing[ru->if_timing]);
|
||||
@@ -2009,7 +2009,7 @@ void set_function_spec_param(RU_t *ru) {
|
||||
reset_meas(&ru->compression);
|
||||
reset_meas(&ru->transport);
|
||||
ret = openair0_transport_load(&ru->ifdevice,&ru->openair0_cfg,&ru->eth_params);
|
||||
printf("openair0_transport_init returns %d for ru_id %d\n", ret, ru->idx);
|
||||
printf("openair0_transport_init returns %d for ru_id %u\n", ret, ru->idx);
|
||||
|
||||
if (ret<0) {
|
||||
printf("Exiting, cannot initialize transport protocol\n");
|
||||
@@ -2033,7 +2033,7 @@ void set_function_spec_param(RU_t *ru) {
|
||||
reset_meas(&ru->compression);
|
||||
reset_meas(&ru->transport);
|
||||
ret = openair0_transport_load(&ru->ifdevice,&ru->openair0_cfg,&ru->eth_params);
|
||||
printf("openair0_transport_init returns %d for ru_id %d\n", ret, ru->idx);
|
||||
printf("openair0_transport_init returns %d for ru_id %u\n", ret, ru->idx);
|
||||
|
||||
if (ret<0) {
|
||||
printf("Exiting, cannot initialize transport protocol\n");
|
||||
@@ -2056,7 +2056,7 @@ void set_function_spec_param(RU_t *ru) {
|
||||
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;
|
||||
printf("configuring ru_id %d (start_rf %p)\n", ru->idx, start_rf);
|
||||
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);
|
||||
@@ -2086,7 +2086,7 @@ void set_function_spec_param(RU_t *ru) {
|
||||
ru->ifdevice.eth_params = &ru->eth_params;
|
||||
ru->ifdevice.configure_rru = configure_ru;
|
||||
ret = openair0_transport_load(&ru->ifdevice,&ru->openair0_cfg,&ru->eth_params);
|
||||
printf("openair0_transport_init returns %d for ru_id %d\n", ret, ru->idx);
|
||||
printf("openair0_transport_init returns %d for ru_id %u\n", ret, ru->idx);
|
||||
|
||||
if (ret<0) {
|
||||
printf("Exiting, cannot initialize transport protocol\n");
|
||||
@@ -2112,7 +2112,7 @@ void set_function_spec_param(RU_t *ru) {
|
||||
ru->ifdevice.eth_params = &ru->eth_params;
|
||||
ru->ifdevice.configure_rru = configure_ru;
|
||||
ret = openair0_transport_load(&ru->ifdevice, &ru->openair0_cfg, &ru->eth_params);
|
||||
printf("openair0_transport_init returns %d for ru_id %d\n", ret, ru->idx);
|
||||
printf("openair0_transport_init returns %d for ru_id %u\n", ret, ru->idx);
|
||||
|
||||
if (ret<0) {
|
||||
printf("Exiting, cannot initialize transport protocol\n");
|
||||
|
||||
+16
-16
@@ -116,7 +116,7 @@ static int8_t threequarter_fs=0;
|
||||
uint32_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
//Temp fix for inexisting NR upper layer
|
||||
//Temp fix for inexistent NR upper layer
|
||||
unsigned char NB_gNB_INST = 1;
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
@@ -354,7 +354,7 @@ void *l2l1_task(void *arg) {
|
||||
|
||||
switch (ITTI_MSG_ID(message_p)) {
|
||||
case INITIALIZE_MESSAGE:
|
||||
/* Start eNB thread */
|
||||
/* Start gNB thread */
|
||||
LOG_D(EMU, "L2L1 TASK received %s\n", ITTI_MSG_NAME(message_p));
|
||||
start_gNB = 1;
|
||||
break;
|
||||
@@ -411,7 +411,7 @@ void *l2l1_task(void *arg) {
|
||||
#endif
|
||||
|
||||
int create_gNB_tasks(uint32_t gnb_nb) {
|
||||
LOG_D(GNB_APP, "%s(gnb_nb:%d\n", __FUNCTION__, gnb_nb);
|
||||
LOG_D(GNB_APP, "%s(gnb_nb:%d)\n", __FUNCTION__, gnb_nb);
|
||||
itti_wait_ready(1);
|
||||
|
||||
if (itti_create_task (TASK_L2L1, l2l1_task, NULL) < 0) {
|
||||
@@ -506,7 +506,7 @@ static void get_options(void) {
|
||||
NRRCConfig();
|
||||
NB_gNB_INST = RC.nb_nr_inst;
|
||||
NB_RU = RC.nb_RU;
|
||||
printf("Configuration: nb_rrc_inst %d, nb_nr_L1_inst %d, nb_ru %d\n",NB_gNB_INST,RC.nb_nr_L1_inst,NB_RU);
|
||||
printf("Configuration: nb_rrc_inst %d, nb_nr_L1_inst %d, nb_ru %hhu\n",NB_gNB_INST,RC.nb_nr_L1_inst,NB_RU);
|
||||
}
|
||||
|
||||
if(parallel_config != NULL) set_parallel_conf(parallel_config);
|
||||
@@ -707,7 +707,7 @@ void wait_gNBs(void) {
|
||||
* helper function to terminate a certain ITTI task
|
||||
*/
|
||||
void terminate_task(task_id_t task_id, module_id_t mod_id) {
|
||||
LOG_I(ENB_APP, "sending TERMINATE_MESSAGE to task %s (%d)\n", itti_get_task_name(task_id), task_id);
|
||||
LOG_I(GNB_APP, "sending TERMINATE_MESSAGE to task %s (%d)\n", itti_get_task_name(task_id), task_id);
|
||||
MessageDef *msg;
|
||||
msg = itti_alloc_new_message (ENB_APP, TERMINATE_MESSAGE);
|
||||
itti_send_msg_to_task (task_id, ENB_MODULE_ID_TO_INSTANCE(mod_id), msg);
|
||||
@@ -717,11 +717,11 @@ void terminate_task(task_id_t task_id, module_id_t mod_id) {
|
||||
extern void nr_phy_free_RU(RU_t *);
|
||||
|
||||
int stop_L1L2(module_id_t gnb_id) {
|
||||
LOG_W(ENB_APP, "stopping nr-softmodem\n");
|
||||
LOG_W(GNB_APP, "stopping nr-softmodem\n");
|
||||
oai_exit = 1;
|
||||
|
||||
if (!RC.ru) {
|
||||
LOG_F(ENB_APP, "no RU configured\n");
|
||||
LOG_F(GNB_APP, "no RU configured\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -729,28 +729,28 @@ int stop_L1L2(module_id_t gnb_id) {
|
||||
if (RC.ru[gnb_id]) {
|
||||
if (RC.ru[gnb_id]->rfdevice.trx_stop_func) {
|
||||
RC.ru[gnb_id]->rfdevice.trx_stop_func(&RC.ru[gnb_id]->rfdevice);
|
||||
LOG_I(ENB_APP, "turned off RU rfdevice\n");
|
||||
LOG_I(GNB_APP, "turned off RU rfdevice\n");
|
||||
} else {
|
||||
LOG_W(ENB_APP, "can not turn off rfdevice due to missing trx_stop_func callback, proceding anyway!\n");
|
||||
LOG_W(GNB_APP, "can not turn off rfdevice due to missing trx_stop_func callback, proceeding anyway!\n");
|
||||
}
|
||||
|
||||
if (RC.ru[gnb_id]->ifdevice.trx_stop_func) {
|
||||
RC.ru[gnb_id]->ifdevice.trx_stop_func(&RC.ru[gnb_id]->ifdevice);
|
||||
LOG_I(ENB_APP, "turned off RU ifdevice\n");
|
||||
LOG_I(GNB_APP, "turned off RU ifdevice\n");
|
||||
} else {
|
||||
LOG_W(ENB_APP, "can not turn off ifdevice due to missing trx_stop_func callback, proceding anyway!\n");
|
||||
LOG_W(GNB_APP, "can not turn off ifdevice due to missing trx_stop_func callback, proceeding anyway!\n");
|
||||
}
|
||||
} else {
|
||||
LOG_W(ENB_APP, "no RU found for index %d\n", gnb_id);
|
||||
LOG_W(GNB_APP, "no RU found for index %d\n", gnb_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* these tasks need to pick up new configuration */
|
||||
terminate_task(TASK_RRC_ENB, gnb_id);
|
||||
terminate_task(TASK_L2L1, gnb_id);
|
||||
LOG_I(ENB_APP, "calling kill_gNB_proc() for instance %d\n", gnb_id);
|
||||
LOG_I(GNB_APP, "calling kill_gNB_proc() for instance %d\n", gnb_id);
|
||||
kill_gNB_proc(gnb_id);
|
||||
LOG_I(ENB_APP, "calling kill_NR_RU_proc() for instance %d\n", gnb_id);
|
||||
LOG_I(GNB_APP, "calling kill_NR_RU_proc() for instance %d\n", gnb_id);
|
||||
kill_NR_RU_proc(gnb_id);
|
||||
oai_exit = 0;
|
||||
|
||||
@@ -771,7 +771,7 @@ int restart_L1L2(module_id_t gnb_id) {
|
||||
RU_t *ru = RC.ru[gnb_id];
|
||||
int cc_id;
|
||||
MessageDef *msg_p = NULL;
|
||||
LOG_W(ENB_APP, "restarting nr-softmodem\n");
|
||||
LOG_W(GNB_APP, "restarting nr-softmodem\n");
|
||||
/* block threads */
|
||||
sync_var = -1;
|
||||
|
||||
@@ -784,7 +784,7 @@ int restart_L1L2(module_id_t gnb_id) {
|
||||
/* TODO this should be done for all RUs associated to this gNB */
|
||||
memcpy(&ru->nr_frame_parms, &RC.gNB[gnb_id][0]->frame_parms, sizeof(NR_DL_FRAME_PARMS));
|
||||
set_function_spec_param(RC.ru[gnb_id]);
|
||||
LOG_I(ENB_APP, "attempting to create ITTI tasks\n");
|
||||
LOG_I(GNB_APP, "attempting to create ITTI tasks\n");
|
||||
|
||||
if (itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL) < 0) {
|
||||
LOG_E(RRC, "Create task for RRC eNB failed\n");
|
||||
|
||||
+4
-4
@@ -539,7 +539,7 @@ void trashFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
|
||||
UE->frame_parms.samples_per_subframe,
|
||||
UE->frame_parms.nb_antennas_rx);
|
||||
if (IS_SOFTMODEM_RFSIM ) {
|
||||
usleep(1000); // slow down, as would do actuall rf to let cpu for the synchro thread
|
||||
usleep(1000); // slow down, as would do actual rf to let cpu for the synchro thread
|
||||
}
|
||||
}
|
||||
|
||||
@@ -639,7 +639,7 @@ void *UE_thread(void *arg) {
|
||||
}
|
||||
}
|
||||
|
||||
AssertFatal( !syncRunning, "At this point synchronisation can't be running\n");
|
||||
AssertFatal( !syncRunning, "At this point synchronization can't be running\n");
|
||||
|
||||
if (!UE->is_synchronized) {
|
||||
readFrame(UE, ×tamp);
|
||||
@@ -668,7 +668,7 @@ void *UE_thread(void *arg) {
|
||||
// we have the decoded frame index in the return of the synch process
|
||||
// and we shifted above to the first slot of next frame
|
||||
decoded_frame_rx++;
|
||||
// we do ++ first in the regular processing, so it will be beging of frame;
|
||||
// we do ++ first in the regular processing, so it will be begin of frame;
|
||||
absolute_slot=decoded_frame_rx*nb_slot_frame + nb_slot_frame -1;
|
||||
continue;
|
||||
}
|
||||
@@ -832,7 +832,7 @@ void init_NR_UE(int nb_inst) {
|
||||
mac_inst->initial_bwp_ul.scs = UE->frame_parms.subcarrier_spacing;
|
||||
mac_inst->initial_bwp_ul.N_RB = UE->frame_parms.N_RB_UL;
|
||||
mac_inst->initial_bwp_ul.cyclic_prefix = UE->frame_parms.Ncp;
|
||||
LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]);
|
||||
LOG_I(PHY,"Initializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]);
|
||||
threadCreate(&threads[inst], UE_thread, (void *)UE, "UEthread", -1, OAI_PRIORITY_RT_MAX);
|
||||
|
||||
#ifdef UE_DLSCH_PARALLELISATION
|
||||
|
||||
@@ -82,7 +82,7 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
/* Callbacks, globals and object handlers */
|
||||
|
||||
extern void reset_stats( FL_OBJECT *, long );
|
||||
//extern void initTpool(char *params,tpool_t *pool, bool performanceMeas);
|
||||
//extern void initTpool(char *params, tpool_t *pool, bool performanceMeas);
|
||||
|
||||
/* Forms and Objects */
|
||||
|
||||
@@ -433,19 +433,19 @@ static void get_options(void) {
|
||||
/*if (frame_parms[0]->N_RB_DL !=0) {
|
||||
if ( frame_parms[0]->N_RB_DL < 6 ) {
|
||||
frame_parms[0]->N_RB_DL = 6;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 6\n",frame_parms[0]->N_RB_DL);
|
||||
printf ( "%i: Invalid number of resource blocks, adjusted to 6\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 100 ) {
|
||||
frame_parms[0]->N_RB_DL = 100;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 100\n",frame_parms[0]->N_RB_DL);
|
||||
printf ( "%i: Invalid number of resource blocks, adjusted to 100\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 50 && frame_parms[0]->N_RB_DL < 100 ) {
|
||||
frame_parms[0]->N_RB_DL = 50;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 50\n",frame_parms[0]->N_RB_DL);
|
||||
printf ( "%i: Invalid number of resource blocks, adjusted to 50\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 25 && frame_parms[0]->N_RB_DL < 50 ) {
|
||||
frame_parms[0]->N_RB_DL = 25;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 25\n",frame_parms[0]->N_RB_DL);
|
||||
printf ( "%i: Invalid number of resource blocks, adjusted to 25\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
UE_scan = 0;
|
||||
frame_parms[0]->N_RB_UL=frame_parms[0]->N_RB_DL;
|
||||
@@ -588,7 +588,7 @@ void init_openair0(void) {
|
||||
else //FDD
|
||||
openair0_cfg[card].duplex_mode = duplex_mode_FDD;
|
||||
|
||||
printf("HW: Configuring card %d, nb_antennas_tx/rx %d/%d\n",card,
|
||||
printf("HW: Configuring card %d, nb_antennas_tx/rx %hhu/%hhu\n",card,
|
||||
PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx,
|
||||
PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx);
|
||||
openair0_cfg[card].Mod_id = 0;
|
||||
@@ -714,7 +714,7 @@ int main( int argc, char **argv ) {
|
||||
PHY_vars_UE_g[0] = malloc(sizeof(PHY_VARS_NR_UE *)*MAX_NUM_CCs);
|
||||
|
||||
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
printf("frame_parms %d\n",frame_parms[CC_id]->ofdm_symbol_size);
|
||||
printf("frame_parms %hu\n",frame_parms[CC_id]->ofdm_symbol_size);
|
||||
nr_init_frame_parms_ue(frame_parms[CC_id],numerology,NORMAL,frame_parms[CC_id]->N_RB_DL,(frame_parms[CC_id]->N_RB_DL-20)>>1,0);
|
||||
PHY_vars_UE_g[0][CC_id] = init_nr_ue_vars(frame_parms[CC_id], 0,abstraction_flag);
|
||||
UE[CC_id] = PHY_vars_UE_g[0][CC_id];
|
||||
|
||||
Reference in New Issue
Block a user