Commit a002609d authored by Raymond Knopp's avatar Raymond Knopp

changes in physcope to show 3 RSRP instead of DL throughgput. changes in...

changes in physcope to show 3 RSRP instead of DL throughgput. changes in RRC/LITE/rrc_eNB.c, configuration for adjacent cell ids during handover. Basic User-command interface for oaisim.
parent 9a541e0d
......@@ -81,7 +81,7 @@ set ( USE_MME "R10" )
set ( USER_MODE True )
set ( XER_PRINT False )
set ( XFORMS False )
set(XFORMS False )
set(XFORMS True )
set(RRC_ASN1_VERSION "Rel10")
set(ENABLE_VCD_FIFO False )
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)
......@@ -528,8 +528,10 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility
// uint8_t prach_fmt;
// int u;
LOG_I(PHY,"[UE%d] Frame %d: Handover triggered: Applying radioResourceConfigCommon from eNB %d\n",
Mod_id,PHY_vars_UE_g[Mod_id][CC_id]->frame_rx,eNB_id);
LOG_I(PHY,"[UE%d] Frame %d: Handover triggered: Applying radioResourceConfigCommon from eNB %d, new RNTI %x, new Nid_cell %d\n",
Mod_id,PHY_vars_UE_g[Mod_id][CC_id]->frame_rx,eNB_id,
mobilityControlInfo->newUE_Identity.buf[0]|(mobilityControlInfo->newUE_Identity.buf[1]<<8),
mobilityControlInfo->targetPhysCellId);
lte_frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
lte_frame_parms->prach_config_common.prach_Config_enabled=1;
......
......@@ -376,7 +376,7 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
// if (slot == 0) {
if (eNB_offset == 0)
LOG_I(PHY,"[UE %d] Frame %d, slot %d RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB, gain %d), N0 %d dBm\n",phy_vars_ue->Mod_id,
LOG_I(PHY,"[UE %d] Frame %d, slot %d RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB, gain %d), N0 %d dBm/RE\n",phy_vars_ue->Mod_id,
phy_vars_ue->frame_rx,slot,10*log10(phy_vars_ue->PHY_measurements.rssi)-phy_vars_ue->rx_total_gain_dB,
10*log10(phy_vars_ue->PHY_measurements.rssi),
phy_vars_ue->rx_total_gain_dB,
......@@ -386,9 +386,9 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
phy_vars_ue->Mod_id,
phy_vars_ue->frame_rx,slot,eNB_offset,
(eNB_offset>0) ? phy_vars_ue->PHY_measurements.adj_cell_id[eNB_offset-1] : phy_vars_ue->lte_frame_parms.Nid_cell,
10*log10(phy_vars_ue->PHY_measurements.rsrp[eNB_offset])-phy_vars_ue->rx_total_gain_dB,
10*log10(1+phy_vars_ue->PHY_measurements.rsrp[eNB_offset])-phy_vars_ue->rx_total_gain_dB,
phy_vars_ue->PHY_measurements.rsrp[eNB_offset],
(10*log10(phy_vars_ue->PHY_measurements.rsrq[eNB_offset])));
(10*log10(1+phy_vars_ue->PHY_measurements.rsrq[eNB_offset])));
//LOG_D(PHY,"RSRP_total_dB: %3.2f \n",(dB_fixed_times10(phy_vars_ue->PHY_measurements.rsrp[eNB_offset])/10.0)-phy_vars_ue->rx_total_gain_dB-dB_fixed(phy_vars_ue->lte_frame_parms.N_RB_DL*12));
//LOG_D(PHY,"RSRP_dB: %3.2f \n",(dB_fixed_times10(phy_vars_ue->PHY_measurements.rsrp[eNB_offset])/10.0));
......
......@@ -38,9 +38,15 @@ FL_COLOR rx_antenna_colors[4] = {FL_RED,FL_BLUE,FL_GREEN,FL_YELLOW};
float tput_time_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
/*
float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_ue_max[NUMBER_OF_UE_MAX] = {0};
*/
float rsrp_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float rsrp0_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float rsrp1_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float rsrp2_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
static void ia_receiver_on_off( FL_OBJECT *button, long arg)
{
......@@ -450,11 +456,18 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
fl_set_object_lcolor( fdui->pdsch_comp, FL_WHITE ); // Label color
fl_set_xyplot_symbolsize( fdui->pdsch_comp,2);
/*
// Throughput on PDSCH
fdui->pdsch_tput = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 720, 500, 100, "PDSCH Throughput [frame]/[kbit/s]" );
fl_set_object_boxtype( fdui->pdsch_tput, FL_EMBOSSED_BOX );
fl_set_object_color( fdui->pdsch_tput, FL_BLACK, FL_WHITE );
fl_set_object_lcolor( fdui->pdsch_tput, FL_WHITE ); // Label color
*/
// RSRP
fdui->rsrp = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 720, 500, 100, "RSRP [frame]/[kbit/s]" );
fl_set_object_boxtype( fdui->rsrp, FL_EMBOSSED_BOX );
fl_set_object_color( fdui->rsrp, FL_BLACK, FL_WHITE );
fl_set_object_lcolor( fdui->rsrp, FL_WHITE ); // Label color
// Generic UE Button
fdui->button_0 = fl_add_button( FL_PUSH_BUTTON, 540, 720, 240, 40, "" );
......@@ -502,9 +515,14 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx];
int frame = phy_vars_ue->frame_rx;
uint32_t total_dlsch_bitrate = phy_vars_ue->bitrate[eNB_id];
double rsrp0 = 10*log10(1+phy_vars_ue->PHY_measurements.rsrp[0])-phy_vars_ue->rx_total_gain_dB;
double rsrp1 = 10*log10(1+phy_vars_ue->PHY_measurements.rsrp[1])-phy_vars_ue->rx_total_gain_dB;
double rsrp2 = 10*log10(1+phy_vars_ue->PHY_measurements.rsrp[2])-phy_vars_ue->rx_total_gain_dB;
int coded_bits_per_codeword = 0;
int mcs = 0;
unsigned char harq_pid = 0;
if (phy_vars_ue->dlsch_ue[eNB_id][0]!=NULL) {
......@@ -733,7 +751,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
fl_set_xyplot_data(form->pdsch_comp,I,Q,ind,"","","");
}
/*
// PDSCH Throughput
memmove( tput_time_ue[UE_id], &tput_time_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
memmove( tput_ue[UE_id], &tput_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
......@@ -748,6 +766,24 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
fl_set_xyplot_data(form->pdsch_tput,tput_time_ue[UE_id],tput_ue[UE_id],TPUT_WINDOW_LENGTH,"","","");
fl_set_xyplot_ybounds(form->pdsch_tput,0,tput_ue_max[UE_id]);
*/
// RSRP
memmove( rsrp_time_ue[UE_id], &rsrp_time_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
memmove( rsrp0_ue[UE_id], &rsrp0_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
memmove( rsrp1_ue[UE_id], &rsrp1_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
memmove( rsrp2_ue[UE_id], &rsrp2_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
rsrp_time_ue[UE_id][TPUT_WINDOW_LENGTH-1] = (float) frame;
rsrp0_ue[UE_id][TPUT_WINDOW_LENGTH-1] = (float)rsrp0;
rsrp1_ue[UE_id][TPUT_WINDOW_LENGTH-1] = (float)rsrp1;
rsrp2_ue[UE_id][TPUT_WINDOW_LENGTH-1] = (float)rsrp2;
fl_set_xyplot_data(form->rsrp,rsrp_time_ue[UE_id],rsrp0_ue[UE_id],TPUT_WINDOW_LENGTH,"","","");
fl_add_xyplot_overlay(form->rsrp,1,rsrp_time_ue[UE_id],rsrp1_ue[UE_id],TPUT_WINDOW_LENGTH,FL_BLUE);
fl_add_xyplot_overlay(form->rsrp,2,rsrp_time_ue[UE_id],rsrp2_ue[UE_id],TPUT_WINDOW_LENGTH,FL_GREEN);
fl_set_xyplot_ybounds(form->rsrp,-130,-60);
fl_check_forms();
......
......@@ -64,7 +64,8 @@ typedef struct {
FL_OBJECT * pdcch_llr;
FL_OBJECT * pdsch_comp;
FL_OBJECT * pdsch_llr;
FL_OBJECT * pdsch_tput;
// FL_OBJECT * pdsch_tput;
FL_OBJECT * rsrp;
FL_OBJECT * button_0;
} FD_lte_phy_scope_ue;
......
......@@ -2664,7 +2664,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
for (i = 0; i < 6; i++) {
CellToAdd = (CellsToAddMod_t *) CALLOC(1, sizeof(*CellToAdd));
CellToAdd->cellIndex = i + 1;
CellToAdd->physCellId = get_adjacent_cell_id(ctxt_pP->module_id, i);
CellToAdd->physCellId = get_adjacent_cell_id(ue_context_pP->ue_context.handover_info->modid_t, i);
CellToAdd->cellIndividualOffset = Q_OffsetRange_dB0;
ASN_SEQUENCE_ADD(&CellsToAddModList->list, CellToAdd);
......@@ -2834,7 +2834,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
ctxt_pP->module_id,
ctxt_pP->frame,
mobilityInfo->targetPhysCellId,
ctxt_pP->module_id,
get_adjacent_cell_mod_id(mobilityInfo->targetPhysCellId),
ue_context_pP->ue_context.rnti);
mobilityInfo->additionalSpectrumEmission = CALLOC(1, sizeof(*mobilityInfo->additionalSpectrumEmission));
......
......@@ -161,7 +161,7 @@ extern uint8_t target_ul_mcs;
extern uint8_t abstraction_flag;
extern uint8_t ethernet_flag;
extern uint16_t Nid_cell;
extern uint8_t use_user_control_interface;
extern LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
#ifdef XFORMS
......@@ -211,6 +211,7 @@ help (void)
printf ("-g Set multicast group ID (0,1,2,3) - valid if M is set\n");
printf ("-G Enable background traffic \n");
printf ("-H Enable handover operation (default disabled) \n");
printf ("-i Run with user control interface");
printf ("-I Enable CLI interface (to connect use telnet localhost 1352)\n");
printf ("-k Set the Ricean factor (linear)\n");
printf ("-K [log_file] Enable ITTI logging into log_file\n");
......@@ -447,6 +448,7 @@ l2l1_task (void *args_p)
char fname[64], vname[64];
int sf;
protocol_ctxt_t ctxt;
int ret;
#ifdef XFORMS
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
// at eNB 0, an UL scope for every UE
......@@ -1126,8 +1128,14 @@ l2l1_task (void *args_p)
*/
} // if Channel_Flag==0
if (slot % 2 == 1)
if (slot % 2 == 1) {
stop_meas (&oaisim_stats_f);
if (use_user_control_interface && (frame > 5))
if ( (ret = user_control_interface(10*frame + (slot>>1)))==-1) {
frame=oai_emulation.info.n_frames; // exit main loop
break;
}
}
} //end of slot
if ((frame >= 10) && (frame <= 11) && (abstraction_flag == 0)
......@@ -1205,7 +1213,7 @@ l2l1_task (void *args_p)
#endif
}
//end of frame
stop_meas (&oaisim_stats);
......
......@@ -46,6 +46,7 @@
#include <time.h>
#include <mcheck.h>
#include <sys/timerfd.h>
#include <string.h>
#include "assertions.h"
#include "oaisim_functions.h"
......@@ -118,6 +119,8 @@ uint8_t beta_ACK = 0;
uint8_t beta_RI = 0;
uint8_t beta_CQI = 2;
uint8_t target_ul_mcs = 16;
uint8_t use_user_control_interface = 0;
LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
int map1,map2;
double **ShaF = NULL;
......@@ -207,9 +210,11 @@ void get_simulation_options(int argc, char *argv[])
LONG_OPTION_CBA_BACKOFF_TIMER,
LONG_OPTION_HYS,
LONG_OPTION_HYS,
LONG_OPTION_TTT_MS,
LONG_OPTION_TTT_MS,
LONG_OPTION_USER_CONTROL_INTERFACE
};
static struct option long_options[] = {
......@@ -244,7 +249,7 @@ void get_simulation_options(int argc, char *argv[])
{"hys", required_argument, 0, LONG_OPTION_HYS},
{"ttt_ms", required_argument, 0, LONG_OPTION_TTT_MS},
{"user-control-interface",no_argument,0,LONG_OPTION_USER_CONTROL_INTERFACE},
{NULL, 0, NULL, 0}
};
......@@ -430,6 +435,10 @@ void get_simulation_options(int argc, char *argv[])
break;
#endif
case LONG_OPTION_USER_CONTROL_INTERFACE:
use_user_control_interface=1;
break;
case 'a':
abstraction_flag = 1;
......@@ -1571,8 +1580,95 @@ void init_time()
sleep_time_us = SLEEP_STEP_US;
td_avg = TARGET_SF_TIME_NS;
}
void oai_emu_ho_init(Handover_info* ho_info){
void oai_emu_ho_init(Handover_info* ho_info){
ho_info->hys=-1;
ho_info->ttt_ms=-1;
}
int user_control_interface(int sfn) {
static int wait_sfn = 1<<31;
int wait_sfn_new=0,not_done=1;
char string[100],cp[100],*token;
PHY_VARS_UE *UE;
int UEid,ret;
while (not_done) {
if (sfn < wait_sfn) {
not_done=0;
return(0);
}
else {
printf("oaisim (%d)> ",sfn);
ret=fgets(string, sizeof(string), stdin);
}
token = strtok (string, " \n");
if (token && (strcmp(token,"run")==0)) {
token = strtok(NULL," \n");
if (token) {
wait_sfn_new = atoi(token);
}
else
wait_sfn_new = sfn+1;
if (wait_sfn_new <= sfn)
printf("Illegal sfn %d\n",wait_sfn_new);
else {
wait_sfn = wait_sfn_new;
not_done=0;
return(0);
}
}
else if (token && (strcmp(token,"quit")==0)) {
not_done=0;
return(-1);
}
else if (token && (strcmp(token,"step")==0)) {
wait_sfn_new = sfn+1;
not_done=0;
return(0);
}
else if (token && (strcmp(token,"dump")==0)) {
token = strtok(NULL," \n");
if (token && (strcmp(token,"UEPHY")==0)) {
token = strtok(NULL," \n");
if (token)
UEid=atoi(token);
else
UEid=0;
UE = PHY_vars_UE_g[UEid][0]; // fix to CCid 0
printf("UE %d Frame %3d Subframe %2d\n----------------------\n",UEid,sfn/10,sfn%10);
printf("N_id_Cell %d\t",UE->lte_frame_parms.Nid_cell);
printf("N_RB_DL %d\t",UE->lte_frame_parms.N_RB_DL);
printf("RX Gain %d\t",UE->rx_total_gain_dB);
printf("N0 %d dBm/RE\t",UE->PHY_measurements.n0_power_tot_dBm);
printf("RSSI %f dBm/RE\t",10*log10(UE->PHY_measurements.rssi)-UE->rx_total_gain_dB);
printf("\n");
printf("RSRP 0 (%d) %f dBm/RE\t",UE->lte_frame_parms.Nid_cell,10*log10(1+UE->PHY_measurements.rsrp[0])-UE->rx_total_gain_dB);
printf("RSRP 1 (%d) %f dBm/RE\t",UE->PHY_measurements.adj_cell_id[0],10*log10(1+UE->PHY_measurements.rsrp[1])-UE->rx_total_gain_dB);
printf("RSRP 2 (%d) %f dBm/RE\t",UE->PHY_measurements.adj_cell_id[1],10*log10(1+UE->PHY_measurements.rsrp[2])-UE->rx_total_gain_dB);
printf("\n");
printf("RSRP 3 (%d) %f dBm/RE\t",UE->PHY_measurements.adj_cell_id[2],10*log10(1+UE->PHY_measurements.rsrp[3])-UE->rx_total_gain_dB);
printf("RSRP 4 (%d) %f dBm/RE\t",UE->PHY_measurements.adj_cell_id[3],10*log10(1+UE->PHY_measurements.rsrp[4])-UE->rx_total_gain_dB);
printf("RSRP 5 (%d) %f dBm/RE\t",UE->PHY_measurements.adj_cell_id[4],10*log10(1+UE->PHY_measurements.rsrp[5])-UE->rx_total_gain_dB);
printf("\n");
}
else {
printf("Frame %3d Subframe %2d\n-----------------",sfn/10,sfn%10);
}
}
else {
printf("Commands \n\n");
printf("run sfn\t\t\t run until subframe number\n");
printf("step\t\t\t run one subframe\n");
printf("dump [UEPHY] index\t dump UE information\n");
printf("quit\t\t\t quit oaisim\n");
}
}
return(0);
}
......@@ -77,4 +77,6 @@ int init_slot_isr(void);
void wait_for_slot_isr(void);
int user_control_interface(int);
#endif /* OAISIM_FUNCTIONS_H_ */
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