Commit 6f9ba77b authored by Bilel's avatar Bilel

Merge branch 'T-tracer-branch' into develop_integration_wk01

Conflicts:
	openair1/SCHED/phy_procedures_lte_ue.c
parents 759f5f75 a1f25f07
......@@ -1938,3 +1938,82 @@ ID = VCD_FUNCTION_RECV_IF5
DESC = VCD function RECV_IF5
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
#################
#### UE LOGS ####
#################
#general logs
ID = UE_MASTER_TICK
DESC = UE master tick - one tick per ms, to be used as "reference clock", mostly for ticktime view
GROUP = ALL:GENERAL:UE
FORMAT = int,eNB_ID : int,frame : int,subframe
#PHY logs
ID = UE_PHY_UL_TICK
DESC = UE uplink tick - one tick per ms at start of uplink processing
GROUP = ALL:PHY:GRAPHIC:UE
FORMAT = int,eNB_ID : int,frame : int,subframe
ID = UE_PHY_DL_TICK
DESC = UE downlink tick - one tick per ms at start of downlink processing
GROUP = ALL:PHY:GRAPHIC:UE
FORMAT = int,eNB_ID : int,frame : int,subframe
ID = UE_PHY_DLSCH_UE_DCI
DESC = UE downlink UE specific DCI as sent by the PHY layer
GROUP = ALL:PHY:GRAPHIC:UE
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,dci_format : int,harq_pid : int,mcs : int,TBS
ID = UE_PHY_DLSCH_UE_ACK
DESC = UE downlink UE ACK as seen by the PHY layer in process_HARQ_feedback
GROUP = ALL:PHY:GRAPHIC:UE
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
ID = UE_PHY_DLSCH_UE_NACK
DESC = UE downlink UE NACK as seen by the PHY layer in process_HARQ_feedback
GROUP = ALL:PHY:GRAPHIC:UE
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
ID = UE_PHY_ULSCH_UE_DCI
DESC = UE uplink UE specific DCI as sent by the PHY layer
GROUP = ALL:PHY:GRAPHIC:UE
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS
ID = UE_PHY_ULSCH_UE_ACK
DESC = UE uplink UE ACK as seen by the PHY layer
GROUP = ALL:PHY:GRAPHIC:UE
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
ID = UE_PHY_ULSCH_UE_NACK
DESC = UE uplink UE NACK as seen by the PHY layer
GROUP = ALL:PHY:GRAPHIC:UE
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
ID = UE_PHY_INPUT_SIGNAL
DESC = UE received signal in the time domain for a duration of 1ms
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,frame : int,subframe : int,antenna : buffer,rxdata
ID = UE_PHY_DL_CHANNEL_ESTIMATE
DESC = UE channel estimation in the time domain
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,antenna : buffer,chest_t
ID = UE_PHY_PDCCH_IQ
DESC = UE PDCCH received IQ data
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,nb_rb : int,NB_RB_DL : int,symbols_per_tti : buffer,rxdataF_comp
ID = UE_PHY_PDCCH_ENERGY
DESC = UE PDSCH 1 energy and threshold
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,pdcch_ch_level00 : int,pdcch_ch_level01 : int,pdcch_ch_level10: int,pdcch_ch_level11
ID = UE_PHY_PDSCH_IQ
DESC = UE PDSCH received IQ data
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,nb_rb : int,N_RB_UL : int,symbols_per_tti : buffer,pusch_comp
ID = UE_PHY_PDSCH_ENERGY
DESC = UE PDSCH 1 energy and threshold
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,pdsch_ch_level00 : int,pdsch_ch_level01 : int,pdsch_ch_level10: int,pdsch_ch_level11
ID = UE_PHY_PUSCH_TX_POWER
DESC = UE PUSCH tx power
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,UE_id : int,frame : int,subframe : int,p0_pusch : int,ampl: int,g_pusch: int,pl: int,nb_rb
ID = UE_PHY_PUCCH_TX_POWER
DESC = UE PDSCH 1 energy and threshold
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,UE_id : int,frame : int,subframe : int,p0_pucch : int,ampl: int,g_pucch: int,pl
ID = UE_PHY_MEAS
DESC = UE PHY measurements
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,rsrp : int,rssi : int,snr: int,rx_power: int,noise_power: int,w_cqi: int,freq_offset
......@@ -5,7 +5,7 @@ CFLAGS=-Wall -g -pthread -DT_TRACER -I.
LIBS=-lX11 -lm -lpng -lXft
all: record replay extract_config textlog enb vcd macpdu2wireshark
all: record replay extract_config textlog enb ue vcd macpdu2wireshark
record: utils.o record.o database.o config.o
$(CC) $(CFLAGS) -o record $^ $(LIBS)
......@@ -26,6 +26,11 @@ enb: utils.o enb.o database.o event.o handler.o config.o \
filter/filter.a
$(CC) $(CFLAGS) -o enb $^ $(LIBS)
ue: utils.o ue.o database.o event.o handler.o config.o \
event_selector.o view/view.a gui/gui.a logger/logger.a \
filter/filter.a
$(CC) $(CFLAGS) -o ue $^ $(LIBS)
vcd: utils.o vcd.o database.o event.o handler.o config.o \
event_selector.o view/view.a gui/gui.a logger/logger.a \
filter/filter.a
......
This diff is collapsed.
......@@ -25,6 +25,7 @@
#include "defs.h"
#include "PHY/defs.h"
#include "filt96_32.h"
#include "T.h"
//#define DEBUG_CH
int lte_dl_channel_estimation(PHY_VARS_UE *ue,
......@@ -738,6 +739,12 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
(int16_t*) ue->common_vars.dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1);
}
#if T_TRACER
T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(eNB_id), T_INT(ue->Mod_id),
T_INT(ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx%1024), T_INT(ue->proc.proc_rxtx[(Ns>>1)&1].subframe_rx),
T_INT(0), T_BUFFER(&ue->common_vars.dl_ch_estimates_time[eNB_offset][0][0], 512 * 4));
#endif
return(0);
}
......@@ -41,6 +41,7 @@
#include "PHY/sse_intrin.h"
#include "assertions.h"
#include "T.h"
//#define DEBUG_DCI_ENCODING 1
//#define DEBUG_DCI_DECODING 1
......@@ -1684,6 +1685,7 @@ int32_t avgP[4];
int32_t rx_pdcch(LTE_UE_COMMON *common_vars,
LTE_UE_PDCCH **pdcch_vars,
LTE_DL_FRAME_PARMS *frame_parms,
uint32_t frame,
uint8_t subframe,
uint8_t eNB_id,
MIMO_mode_t mimo_mode,
......@@ -1754,7 +1756,10 @@ int32_t rx_pdcch(LTE_UE_COMMON *common_vars,
LOG_I(PHY,"subframe %d: pdcch log2_maxh = %d (%d,%d)\n",subframe,log2_maxh,avgP[0],avgs);
#endif
#if T_TRACER
T(T_UE_PHY_PDCCH_ENERGY, T_INT(eNB_id), T_INT(0), T_INT(frame%1024), T_INT(subframe),
T_INT(avgP[0]), T_INT(avgP[1]), T_INT(avgP[2]), T_INT(avgP[3]));
#endif
for (s=0; s<n_pdcch_symbols; s++) {
pdcch_channel_compensation(pdcch_vars[eNB_id]->rxdataF_ext,
pdcch_vars[eNB_id]->dl_ch_estimates_ext,
......@@ -1851,6 +1856,7 @@ int32_t rx_pdcch(LTE_UE_COMMON *common_vars,
/*#ifdef DEBUG_PHY
write_output("llr8_seq.m","llr8",&pdcch_vars[eNB_id]->llr[s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,4);
#endif*/
#ifdef MU_RECEIVER
}
......@@ -1858,6 +1864,12 @@ int32_t rx_pdcch(LTE_UE_COMMON *common_vars,
}
#if T_TRACER
T(T_UE_PHY_PDCCH_IQ, T_INT(frame_parms->N_RB_DL), T_INT(frame_parms->N_RB_DL),
T_INT(n_pdcch_symbols),
T_BUFFER(pdcch_vars[eNB_id]->rxdataF_comp, frame_parms->N_RB_DL*12*n_pdcch_symbols* 4));
#endif
// decode pcfich here
n_pdcch_symbols = rx_pcfich(frame_parms,
subframe,
......
......@@ -5595,6 +5595,16 @@ int generate_ue_dlsch_params_from_dci(int frame,
printf("PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off);
}
#endif
#if T_TRACER
if( (dlsch[0]->rnti != si_rnti) && (dlsch[0]->rnti != ra_rnti) && (dlsch[0]->rnti != p_rnti))
{
T(T_UE_PHY_DLSCH_UE_DCI, T_INT(0), T_INT(frame%1024), T_INT(subframe), T_INT(0),
T_INT(dlsch[0]->rnti), T_INT(dci_format),
T_INT(harq_pid),
T_INT(dlsch0_harq->mcs),
T_INT(dlsch0_harq->TBS));
}
#endif
dlsch[0]->active=1;
......
......@@ -640,6 +640,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
{
LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for subframe %d (pid %d, round %d, TBS %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round,harq_process->TBS);
}
//LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for subframe %d (pid %d, round %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round);
}
......
......@@ -35,7 +35,7 @@
#include "defs.h"
#include "extern.h"
#include "PHY/sse_intrin.h"
#include "T.h"
#ifndef USER_MODE
#define NOCYGWIN_STATIC static
......@@ -74,6 +74,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
PDSCH_t type,
unsigned char eNB_id,
unsigned char eNB_id_i, //if this == ue->n_connected_eNB, we assume MU interference
uint32_t frame,
uint8_t subframe,
unsigned char symbol,
unsigned char first_symbol_flag,
......@@ -297,6 +298,13 @@ int rx_pdsch(PHY_VARS_UE *ue,
// avgs = cmax(avgs,avg[(aarx<<1)+aatx]);
#if T_TRACER
if (type == PDSCH)
{
T(T_UE_PHY_PDSCH_ENERGY, T_INT(eNB_id), T_INT(0), T_INT(frame%1024), T_INT(subframe),
T_INT(avg[0]), T_INT(avg[1]), T_INT(avg[2]), T_INT(avg[3]));
}
#endif
pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2)+1;
// + log2_approx(frame_parms->nb_antenna_ports_eNB-1) //-1 because log2_approx counts the number of bits
......@@ -825,6 +833,15 @@ int rx_pdsch(PHY_VARS_UE *ue,
return(-1);
break;
}
#if T_TRACER
T(T_UE_PHY_PDSCH_IQ, T_INT(eNB_id), T_INT(ue->Mod_id), T_INT(frame%1024),
T_INT(subframe), T_INT(nb_rb),
T_INT(frame_parms->N_RB_UL), T_INT(frame_parms->symbols_per_tti),
T_BUFFER(&pdsch_vars[eNB_id]->rxdataF_comp0[eNB_id][0],
2 * /* ulsch[UE_id]->harq_processes[harq_pid]->nb_rb */ frame_parms->N_RB_UL *12*frame_parms->symbols_per_tti*2));
#endif
return(0);
}
......
......@@ -1414,7 +1414,10 @@ void rx_phich(PHY_VARS_UE *ue,
//LOG_I(PHY,"[HARQ-UL harqId: %d] PHICH NACK ==> subframe_scheduling_flag = %d round: %d\n", harq_pid, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag,ulsch->harq_processes[harq_pid]->round);
}
}
#if T_TRACER
T(T_UE_PHY_ULSCH_UE_NACK, T_INT(eNB_id), T_INT(proc->frame_rx%1024), T_INT(subframe), T_INT(ue->Mod_id), T_INT(ulsch->rnti),
T_INT(harq_pid));
#endif
} else { //ACK
if (ue->ulsch_Msg3_active[eNB_id] == 1) {
......@@ -1449,7 +1452,11 @@ void rx_phich(PHY_VARS_UE *ue,
// inform MAC?
ue->ulsch_Msg3_active[eNB_id] = 0;
//LOG_I(PHY,"[HARQ-UL harqId: %d] PHICH ACK ==> subframe_scheduling_flag = %d round: %d\n", harq_pid, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag, ulsch->harq_processes[harq_pid]->round);
#if T_TRACER
T(T_UE_PHY_ULSCH_UE_ACK, T_INT(eNB_id), T_INT(proc->frame_rx%1024), T_INT(subframe), T_INT(ue->Mod_id), T_INT(ulsch->rnti),
T_INT(harq_pid));
#endif
}
}
......
......@@ -1179,6 +1179,7 @@ int32_t rx_pdsch(PHY_VARS_UE *phy_vars_ue,
PDSCH_t type,
uint8_t eNB_id,
uint8_t eNB_id_i,
uint32_t frame,
uint8_t subframe,
uint8_t symbol,
uint8_t first_symbol_flag,
......@@ -1189,6 +1190,7 @@ int32_t rx_pdsch(PHY_VARS_UE *phy_vars_ue,
int32_t rx_pdcch(LTE_UE_COMMON *lte_ue_common_vars,
LTE_UE_PDCCH **lte_ue_pdcch_vars,
LTE_DL_FRAME_PARMS *frame_parms,
uint32_t frame,
uint8_t subframe,
uint8_t eNB_id,
MIMO_mode_t mimo_mode,
......
......@@ -124,6 +124,7 @@ static inline void* malloc16_clear( size_t size )
#include "PHY/TOOLS/defs.h"
#include "platform_types.h"
#define OPENAIR_LTE
#ifdef OPENAIR_LTE
#include "PHY/LTE_TRANSPORT/defs.h"
......
......@@ -66,6 +66,8 @@ fifo_dump_emos_UE emos_dump_UE;
#include "PHY/CODING/extern.h"
#include "T.h"
#define DLSCH_RB_ALLOC 0x1fbf // skip DC RB (total 23/25 RBs)
#define DLSCH_RB_ALLOC_12 0x0aaa // skip DC RB (total 23/25 RBs)
......@@ -1311,6 +1313,22 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
{
ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK = 0;
}
#if T_TRACER
if(ue->ulsch[eNB_id]->o_ACK[0])
{
LOG_I(PHY,"PUSCH ACK\n");
T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[eNB_id][0]->rnti),
T_INT(ue->dlsch[eNB_id][0]->current_harq_pid));
}
else
{
LOG_I(PHY,"PUSCH NACK\n");
T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[eNB_id][0]->rnti),
T_INT(ue->dlsch[eNB_id][0]->current_harq_pid));
}
#endif
LOG_D(PHY,"[UE %d][PDSCH %x] Frame %d subframe %d Generating ACK (%d,%d) for %d bits on PUSCH\n",
Mod_id,
ue->ulsch[eNB_id]->rnti,
......@@ -1471,6 +1489,10 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
nb_rb);
#else
tx_amp = AMP;
#endif
#if T_TRACER
T(T_UE_PHY_PUSCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
T_INT(tx_amp),T_INT(ue->ulsch[eNB_id]->f_pusch),T_INT(get_PL(Mod_id,0,eNB_id)),T_INT(nb_rb));
#endif
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d, generating PUSCH, Po_PUSCH: %d dBm (max %d dBm), amp %d\n",
Mod_id,harq_pid,frame_tx,subframe_tx,ue->tx_power_dBm[subframe_tx],ue->tx_power_max_dBm, tx_amp);
......@@ -1691,7 +1713,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
#else
tx_amp = AMP;
#endif
#if T_TRACER
T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
T_INT(tx_amp),T_INT(ue->dlsch[eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id)));
#endif
if (SR_payload>0) {
LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d Generating PUCCH 1a/1b payload %d,%d (with SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH, amp %d\n",
Mod_id,
......@@ -1714,6 +1739,21 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
Po_PUCCH,
tx_amp);
}
#if T_TRACER
if(pucch_ack_payload[0])
{
LOG_I(PHY,"PUCCH ACK\n");
T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[eNB_id][0]->rnti),
T_INT(ue->dlsch[eNB_id][0]->current_harq_pid));
}
else
{
LOG_I(PHY,"PUCCH NACK\n");
T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[eNB_id][0]->rnti),
T_INT(ue->dlsch[eNB_id][0]->current_harq_pid));
}
#endif
if (abstraction_flag == 0) {
......@@ -1757,6 +1797,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
1);
#else
tx_amp = AMP;
#endif
#if T_TRACER
T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
T_INT(tx_amp),T_INT(ue->dlsch[eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id)));
#endif
LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d Generating PUCCH 1 (SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d\n",
Mod_id,
......@@ -1821,6 +1865,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
1);
#else
tx_amp = AMP;
#endif
#if T_TRACER
T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
T_INT(tx_amp),T_INT(ue->dlsch[eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id)));
#endif
LOG_D(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2 (CQI), n2_pucch %d, Po_PUCCH %d, isShortenPucch %d, amp %d\n",
Mod_id,
......@@ -1861,7 +1909,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
}
ue->tx_power_dBm[subframe_tx] = Po_PUCCH;
ue->tx_total_RE[subframe_tx] = 12;
#if T_TRACER
T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
T_INT(tx_amp),T_INT(ue->dlsch[eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id)));
#endif
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
tx_amp = get_tx_amp(Po_PUCCH,
ue->tx_power_max_dBm,
......@@ -1913,6 +1964,10 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,VCD_FUNCTION_IN);
#if T_TRACER
T(T_UE_PHY_UL_TICK, T_INT(ue->Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx));
#endif
ue->generate_ul_signal[eNB_id] = 0;
start_meas(&ue->phy_proc_tx);
......@@ -2052,7 +2107,7 @@ void phy_procedures_UE_S_TX(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t abstraction_f
}
}
void ue_measurement_procedures(uint16_t l, PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode)
void ue_measurement_procedures(uint16_t l, PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uint8_t eNB_id,uint8_t slot,uint8_t abstraction_flag,runmode_t mode)
{
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
......@@ -2076,6 +2131,17 @@ void ue_measurement_procedures(uint16_t l, PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,
0,
1);
}
#if T_TRACER
if(slot == 0)
T(T_UE_PHY_MEAS, T_INT(eNB_id), T_INT(ue->Mod_id), T_INT(proc->frame_rx%1024), T_INT(proc->subframe_rx),
T_INT((int)(10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB)),
T_INT((int)ue->measurements.rx_rssi_dBm[0]),
T_INT((int)(ue->measurements.rx_power_avg_dB[0] - ue->measurements.n0_power_avg_dB)),
T_INT((int)ue->measurements.rx_power_avg_dB[0]),
T_INT((int)ue->measurements.n0_power_avg_dB),
T_INT((int)ue->measurements.wideband_cqi_avg[0]),
T_INT((int)ue->common_vars.freq_offset));
#endif
}
if (l==(6-ue->frame_parms.Ncp)) {
......@@ -2492,6 +2558,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
rx_pdcch(&ue->common_vars,
ue->pdcch_vars,
&ue->frame_parms,
proc->frame_rx,
subframe_rx,
eNB_id,
(ue->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
......@@ -2597,7 +2664,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
// dump_dci(&ue->frame_parms, &dci_alloc_rx[i]);
//dump_dci(&ue->frame_parms, &dci_alloc_rx[i]);
if ((ue->UE_mode[eNB_id] > PRACH) &&
(generate_ue_dlsch_params_from_dci(frame_rx,
subframe_rx,
......@@ -2620,6 +2687,12 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
{
ue->dlsch[eNB_id][0]->g_pucch += ue->dlsch[eNB_id][0]->harq_processes[ue->dlsch[eNB_id][0]->current_harq_pid]->delta_PUCCH;
}
/*T(T_UE_PHY_DLSCH_UE_DCI, T_INT(eNB_id), T_INT(frame_rx%1024), T_INT(subframe_rx), T_INT(ue->Mod_id),
T_INT(dci_alloc_rx[i].rnti), T_INT(dci_alloc_rx[i].format),
T_INT(ue->dlsch[eNB_id][0]->current_harq_pid),
T_INT(ue->dlsch[eNB_id][0]->harq_processes[ue->dlsch[eNB_id][0]->current_harq_pid]->mcs),
T_INT(ue->dlsch[eNB_id][0]->harq_processes[ue->dlsch[eNB_id][0]->current_harq_pid]->TBS));*/
ue->dlsch_received[eNB_id]++;
......@@ -2761,6 +2834,20 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
eNB_id,
0)==0)) {
#if T_TRACER
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
uint8_t harq_pid = subframe2harq_pid(frame_parms,
pdcch_alloc2ul_frame(frame_parms,proc->frame_rx,proc->subframe_rx),
pdcch_alloc2ul_subframe(frame_parms,proc->subframe_rx));
T(T_UE_PHY_ULSCH_UE_DCI, T_INT(eNB_id), T_INT(proc->frame_rx%1024), T_INT(proc->subframe_rx), T_INT(ue->Mod_id),
T_INT(dci_alloc_rx[i].rnti), T_INT(harq_pid),
T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->mcs),
T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->round),
T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb),
T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb),
T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS));
#endif
#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[UE %d] Generate UE ULSCH C_RNTI format 0 (subframe %d)\n",ue->Mod_id,subframe_rx);
#endif
......@@ -3013,6 +3100,7 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC
pdsch,
eNB_id,
eNB_id_i,
proc->frame_rx,
subframe_rx, // subframe,
m,
first_symbol_flag,
......@@ -3331,6 +3419,13 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN);
#if T_TRACER
T(T_UE_PHY_DL_TICK, T_INT(ue->Mod_id), T_INT(frame_rx%1024), T_INT(subframe_rx));
#endif
T(T_UE_PHY_INPUT_SIGNAL, T_INT(ue->Mod_id), T_INT(frame_rx%1024), T_INT(subframe_rx), T_INT(0),
T_BUFFER(&ue->common_vars.rxdata[0][subframe_rx*ue->frame_parms.samples_per_tti],
ue->frame_parms.samples_per_tti * 4));
start_meas(&ue->phy_proc_rx);
......@@ -3398,7 +3493,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
stop_meas(&ue->ofdm_demod_stats);
}
ue_measurement_procedures(l-1,ue,proc,eNB_id,abstraction_flag,mode);
ue_measurement_procedures(l-1,ue,proc,eNB_id,0,abstraction_flag,mode);
if ((l==pilot1) ||
((pmch_flag==1)&(l==l2))) {
LOG_D(PHY,"[UE %d] Frame %d: Calling pdcch procedures (eNB %d)\n",ue->Mod_id,frame_rx,eNB_id);
......@@ -3411,7 +3506,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
}
} // for l=1..l2
ue_measurement_procedures(l-1,ue,proc,eNB_id,abstraction_flag,mode);
//ue_measurement_procedures(l-1,ue,proc,eNB_id,abstraction_flag,mode);
// If this is PMCH, call procedures and return
if (pmch_flag == 1) {
......@@ -3502,7 +3597,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
stop_meas(&ue->ofdm_demod_stats);
}
ue_measurement_procedures(l-1,ue,proc,eNB_id,abstraction_flag,mode);
ue_measurement_procedures(l-1,ue,proc,eNB_id,1,abstraction_flag,mode);
} // for l=1..l2
......
......@@ -3199,6 +3199,7 @@ PMI_FEEDBACK:
rx_pdcch(&UE->common_vars,
UE->pdcch_vars,
&UE->frame_parms,
0, // frame
subframe,
0,
(UE->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
......@@ -3405,6 +3406,7 @@ PMI_FEEDBACK:
PDSCH,
eNB_id,
eNB_id_i,
0, // frame
subframe,
m,
(m==UE->pdcch_vars[0]->num_pdcch_symbols)?1:0,
......@@ -3430,6 +3432,7 @@ PMI_FEEDBACK:
PDSCH,
eNB_id,
eNB_id_i,
0, // frame
subframe,
m,
0,
......@@ -3455,6 +3458,7 @@ PMI_FEEDBACK:
PDSCH,
eNB_id,
eNB_id_i,
0, // frame
subframe,
m,
0,
......
......@@ -1091,6 +1091,7 @@ int main(int argc, char **argv)
rx_pdcch(&UE->common_vars,
UE->pdcch_vars,
&UE->frame_parms,
frame,
subframe,
0,
(UE->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
......
......@@ -1490,6 +1490,7 @@ int main(int argc, char **argv)
rx_pdcch(&PHY_vars_UE[UE_idx]->lte_ue_common_vars,
PHY_vars_UE[UE_idx]->lte_ue_pdcch_vars,
&PHY_vars_UE[UE_idx]->lte_frame_parms,
frame,
subframe,
0,
(PHY_vars_UE[UE_idx]->lte_frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
......@@ -1534,6 +1535,7 @@ int main(int argc, char **argv)
PDSCH,
0,
1,
frame,
subframe, // subframe,
l, // symbol
(l==PHY_vars_UE[UE_idx]->lte_ue_pdcch_vars[0]->num_pdcch_symbols)?1:0, // first_symbol_flag
......@@ -1564,6 +1566,7 @@ int main(int argc, char **argv)
PDSCH,
0,
1,
frame,
subframe, // subframe,
l, // symbol
0, // first_symbol_flag
......@@ -1588,6 +1591,7 @@ int main(int argc, char **argv)
PDSCH,
0,
1,
frame,
subframe, // subframe,