Commit 55af824c authored by Wolfgang A. Mozart's avatar Wolfgang A. Mozart

some extra logging

parent 840d37ed
...@@ -742,7 +742,7 @@ l2l1_task (void *args_p) ...@@ -742,7 +742,7 @@ l2l1_task (void *args_p)
int subframe_ru_mask_local = subframe_ru_mask; int subframe_ru_mask_local = subframe_ru_mask;
int subframe_UE_mask_local = subframe_UE_mask; int subframe_UE_mask_local = subframe_UE_mask;
pthread_mutex_unlock(&subframe_mutex); pthread_mutex_unlock(&subframe_mutex);
LOG_D(EMU,"Frame %d, Subframe %d: Checking masks %x,%x\n",frame,sf,subframe_ru_mask_local,subframe_UE_mask_local); LOG_D(EMU,"Frame %d, Subframe %d, NB_RU %d, NB_UE %d: Checking masks %x,%x\n",frame,sf,NB_RU,NB_UE_INST,subframe_ru_mask_local,subframe_UE_mask_local);
if ((subframe_ru_mask_local == ((1<<NB_RU)-1)) && if ((subframe_ru_mask_local == ((1<<NB_RU)-1)) &&
(subframe_UE_mask_local == ((1<<NB_UE_INST)-1))) (subframe_UE_mask_local == ((1<<NB_UE_INST)-1)))
all_done=1; all_done=1;
...@@ -835,200 +835,6 @@ l2l1_task (void *args_p) ...@@ -835,200 +835,6 @@ l2l1_task (void *args_p)
#endif #endif
/*
clear_UE_transport_info (oai_emulation.info.nb_ue_local);
clear_UE_transport_info (oai_emulation.info.nb_ue_local);
for (UE_inst = oai_emulation.info.first_ue_local;
(UE_inst < (oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local));
UE_inst++) {
if (oai_emulation.info.cli_start_ue[UE_inst] != 0) {
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
#else
if (frame >= (UE_inst * 20)) // activate UE only after 20*UE_id frames so that different UEs turn on separately
#endif
{
LOG_D(EMU,
"PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n",
UE_inst, frame % MAX_FRAME_NUMBER, slot, next_slot >> 1,
last_slot >> 1);
if (PHY_vars_UE_g[UE_inst][0]->UE_mode[0]
!= NOT_SYNCHED) {
if (frame > 0) {
PHY_vars_UE_g[UE_inst][0]->frame_rx = frame % MAX_FRAME_NUMBER;
PHY_vars_UE_g[UE_inst][0]->slot_rx = last_slot;
PHY_vars_UE_g[UE_inst][0]->slot_tx = next_slot;
if (next_slot > 1)
PHY_vars_UE_g[UE_inst][0]->frame_tx = frame % MAX_FRAME_NUMBER;
else
PHY_vars_UE_g[UE_inst][0]->frame_tx = (frame + 1) % MAX_FRAME_NUMBER;
#ifdef OPENAIR2
//Application
update_otg_UE (UE_inst, oai_emulation.info.time_ms);
//Access layer
// PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE_inst, ENB_FLAG_NO, NOT_A_RNTI, frame, next_slot>>1, 0);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE_inst, 0, ENB_FLAG_NO, NOT_A_RNTI, frame % MAX_FRAME_NUMBER, next_slot);
pdcp_run (&ctxt);
#endif
for (CC_id = 0; CC_id < MAX_NUM_CCs;
CC_id++) {
phy_procedures_UE_lte (
PHY_vars_UE_g[UE_inst][CC_id],
0, abstraction_flag,
normal_txrx, no_relay,
NULL);
}
ue_data[UE_inst]->tx_power_dBm =
PHY_vars_UE_g[UE_inst][0]->tx_power_dBm;
}
} else {
if (abstraction_flag == 1) {
LOG_E(EMU,
"sync not supported in abstraction mode (UE%d,mode%d)\n",
UE_inst,
PHY_vars_UE_g[UE_inst][0]->UE_mode[0]);
exit (-1);
}
if ((frame > 0)
&& (last_slot
== (LTE_SLOTS_PER_FRAME
- 2))) {
initial_sync (PHY_vars_UE_g[UE_inst][0],
normal_txrx);
}
}
#ifdef PRINT_STATS
if(last_slot==2 && frame%10==0) {
if (UE_stats_th[UE_inst]) {
fprintf(UE_stats_th[UE_inst],"%d %d\n",frame%MAX_FRAME_NUMBER, PHY_vars_UE_g[UE_inst][0]->bitrate[0]/1000);
}
}
if (UE_stats[UE_inst]) {
len = dump_ue_stats (PHY_vars_UE_g[UE_inst][0], stats_buffer, 0, normal_txrx, 0);
rewind (UE_stats[UE_inst]);
fwrite (stats_buffer, 1, len, UE_stats[UE_inst]);
fflush(UE_stats[UE_inst]);
}
#endif
}
}
}
#if defined(Rel10) || defined(Rel14)
for (RN_id=oai_emulation.info.first_rn_local;
RN_id<oai_emulation.info.first_rn_local+oai_emulation.info.nb_rn_local;
RN_id++) {
// UE id and eNB id of the RN
UE_inst= oai_emulation.info.first_ue_local+oai_emulation.info.nb_ue_local + RN_id;// NB_UE_INST + RN_id
eNB_inst= oai_emulation.info.first_enb_local+oai_emulation.info.nb_enb_local + RN_id;// NB_eNB_INST + RN_id
// currently only works in FDD
if (oai_emulation.info.eMBMS_active_state == 4) {
r_type = multicast_relay;
//LOG_I(EMU,"Activating the multicast relaying\n");
} else {
LOG_E(EMU,"Not supported eMBMS option when relaying is enabled %d\n", r_type);
exit(-1);
}
PHY_vars_RN_g[RN_id]->frame = frame % MAX_FRAME_NUMBER;
if ( oai_emulation.info.frame_type == 0) {
// RN == UE
if (frame>0) {
if (PHY_vars_UE_g[UE_inst][0]->UE_mode[0] != NOT_SYNCHED) {
LOG_D(EMU,"[RN %d] PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n",
RN_id, UE_inst, frame, slot, next_slot >> 1,last_slot>>1);
PHY_vars_UE_g[UE_inst][0]->frame_rx = frame % MAX_FRAME_NUMBER;
PHY_vars_UE_g[UE_inst][0]->slot_rx = last_slot;
PHY_vars_UE_g[UE_inst][0]->slot_tx = next_slot;
if (next_slot>1) PHY_vars_UE_g[UE_inst][0]->frame_tx = frame % MAX_FRAME_NUMBER;
else PHY_vars_UE_g[UE_inst][0]->frame_tx = (frame+1) % MAX_FRAME_NUMBER;
phy_procedures_UE_lte (PHY_vars_UE_g[UE_inst][0], 0, abstraction_flag,normal_txrx,
r_type, PHY_vars_RN_g[RN_id]);
} else if (last_slot == (LTE_SLOTS_PER_FRAME-2)) {
initial_sync(PHY_vars_UE_g[UE_inst][0],normal_txrx);
}
}
emu_transport (frame % MAX_FRAME_NUMBER, sf<<1, ((sf+4)%10)<<1, subframe_select(&PHY_vars_eNB_g[0][0]->frame_parms,sf),
oai_emulation.info.frame_type[0], ethernet_flag);
start_meas (&dl_chan_stats);
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++)
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
//#warning figure out what to do with UE frame_parms during initial_sync
do_DL_sig (r_re0,
r_im0,
r_re,
r_im,
s_re,
s_im,
eNB2UE,
enb_data,
ue_data,
PHY_vars_eNB_g[0][CC_id]->proc.proc_rxtx[sf&1].subframe_tx<<1,
abstraction_flag,
&PHY_vars_eNB_g[0][CC_id]->frame_parms,
UE_inst, CC_id);
do_DL_sig (r_re0,
r_im0,
r_re,
r_im,n
s_re,
s_im,
eNB2UE,
enb_data,
ue_data,
(PHY_vars_eNB_g[0][CC_id]->proc.proc_rxtx[sf&1].subframe_tx<<1)+1,
abstraction_flag,
&PHY_vars_eNB_g[0][CC_id]->frame_parms,
UE_inst, CC_id);
}
stop_meas (&dl_chan_stats);
start_meas (&ul_chan_stats);
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
//#warning figure out what to do with UE frame_parms during initial_sync
do_UL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, UE2eNB,
enb_data, ue_data,
PHY_vars_UE_g[0][CC_id]->proc.proc_rxtx[sf&1].subframe_tx<<1,
abstraction_flag,
&PHY_vars_eNB_g[0][CC_id]->frame_parms,
frame % MAX_FRAME_NUMBER, CC_id);
do_UL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, UE2eNB,
enb_data, ue_data,
(PHY_vars_UE_g[0][CC_id]->proc.proc_rxtx[sf&1].subframe_tx<<1)+1,
abstraction_flag,
&PHY_vars_eNB_g[0][CC_id]->frame_parms,
frame % MAX_FRAME_NUMBER, CC_id);
}
stop_meas (&ul_chan_stats);
*/
if ((sf == 0) && ((frame % MAX_FRAME_NUMBER) == 0) && (abstraction_flag == 0) if ((sf == 0) && ((frame % MAX_FRAME_NUMBER) == 0) && (abstraction_flag == 0)
&& (oai_emulation.info.n_frames == 1)) { && (oai_emulation.info.n_frames == 1)) {
......
...@@ -1106,7 +1106,9 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void ** ...@@ -1106,7 +1106,9 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
*ptimestamp = last_UE_rx_timestamp[UE_id][CC_id]; *ptimestamp = last_UE_rx_timestamp[UE_id][CC_id];
LOG_D(EMU,"DL simulation 0: UE_trx_read nsamps %d TS %llu (%llu, offset %d) antenna %d\n",nsamps, LOG_D(EMU,"UE %d DL simulation 0: UE_trx_read nsamps %d TS %llu (%llu, offset %d) antenna %d\n",
UE_id,
nsamps,
(unsigned long long)current_UE_rx_timestamp[UE_id][CC_id], (unsigned long long)current_UE_rx_timestamp[UE_id][CC_id],
(unsigned long long)last_UE_rx_timestamp[UE_id][CC_id], (unsigned long long)last_UE_rx_timestamp[UE_id][CC_id],
(int)(last_UE_rx_timestamp[UE_id][CC_id]%sptti), (int)(last_UE_rx_timestamp[UE_id][CC_id]%sptti),
...@@ -1119,13 +1121,13 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void ** ...@@ -1119,13 +1121,13 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
read_size = sptti; read_size = sptti;
while (sample_count<nsamps) { while (sample_count<nsamps) {
LOG_D(EMU,"DL simulation 1: UE_trx_read : current TS now %llu, last TS %llu\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]); LOG_D(EMU,"UE %d: DL simulation 1: UE_trx_read : current TS now %llu, last TS %llu\n",UE_id,current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
while (current_UE_rx_timestamp[UE_id][CC_id] < while (current_UE_rx_timestamp[UE_id][CC_id] <
(last_UE_rx_timestamp[UE_id][CC_id]+read_size)) { (last_UE_rx_timestamp[UE_id][CC_id]+read_size)) {
LOG_D(EMU,"DL simulation 2: UE_trx_read : current TS %llu, last TS %llu, sleeping\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]); LOG_D(EMU,"UE %d: DL simulation 2: UE_trx_read : current TS %llu, last TS %llu, sleeping\n",UE_id,current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
usleep(500); usleep(500);
} }
LOG_D(EMU,"DL simulation 3: UE_trx_read : current TS now %llu, last TS %llu\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]); LOG_D(EMU,"UE %d: DL simulation 3: UE_trx_read : current TS now %llu, last TS %llu\n",UE_id,current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
// if we cross a subframe-boundary // if we cross a subframe-boundary
subframe = (last_UE_rx_timestamp[UE_id][CC_id]/sptti)%10; subframe = (last_UE_rx_timestamp[UE_id][CC_id]/sptti)%10;
...@@ -1138,13 +1140,13 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void ** ...@@ -1138,13 +1140,13 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
LOG_D(PHY,"DL simulation 4: UE_trx_read generating DL subframe %d (Ts %llu, current TS %llu,nsamps %d)\n", LOG_D(PHY,"UE %d: DL simulation 4: UE_trx_read generating DL subframe %d (Ts %llu, current TS %llu,nsamps %d)\n",
subframe,(unsigned long long)*ptimestamp, UE_id,subframe,(unsigned long long)*ptimestamp,
(unsigned long long)current_UE_rx_timestamp[UE_id][CC_id], (unsigned long long)current_UE_rx_timestamp[UE_id][CC_id],
nsamps); nsamps);
LOG_D(EMU,"DL simulation 5: Doing DL simulation for %d samples starting in subframe %d at offset %d\n", LOG_D(EMU,"UE %d: DL simulation 5: Doing DL simulation for %d samples starting in subframe %d at offset %d\n",
nsamps,subframe, UE_id,nsamps,subframe,
(int)(last_UE_rx_timestamp[UE_id][CC_id]%sptti)); (int)(last_UE_rx_timestamp[UE_id][CC_id]%sptti));
do_DL_sig(RU2UE, do_DL_sig(RU2UE,
...@@ -1157,8 +1159,8 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void ** ...@@ -1157,8 +1159,8 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
&PHY_vars_UE_g[UE_id][CC_id]->frame_parms, &PHY_vars_UE_g[UE_id][CC_id]->frame_parms,
UE_id, UE_id,
CC_id); CC_id);
LOG_D(EMU,"DL simulation 6: UE_trx_read @ TS %llu (%llu)=> frame %d, subframe %d\n", LOG_D(EMU,"UE %d: DL simulation 6: UE_trx_read @ TS %llu (%llu)=> frame %d, subframe %d\n",
(unsigned long long)current_UE_rx_timestamp[UE_id][CC_id], UE_id,(unsigned long long)current_UE_rx_timestamp[UE_id][CC_id],
(unsigned long long)last_UE_rx_timestamp[UE_id][CC_id], (unsigned long long)last_UE_rx_timestamp[UE_id][CC_id],
((unsigned long long)last_UE_rx_timestamp[UE_id][CC_id]/(sptti*10))&1023, ((unsigned long long)last_UE_rx_timestamp[UE_id][CC_id]/(sptti*10))&1023,
subframe); subframe);
......
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