Commit f1e380b8 authored by Raymond Knopp's avatar Raymond Knopp

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5774 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 0444e5c3
......@@ -242,7 +242,7 @@ void phy_config_sib2_ue(uint8_t Mod_id,int CC_id,
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_UE_CONFIG_SIB2, VCD_FUNCTION_IN);
LOG_I(PHY,"[UE%d] Frame %d: Applying radioResourceConfigCommon from eNB%d\n",Mod_id,PHY_vars_UE_g[Mod_id][CC_id]->frame,CH_index);
LOG_I(PHY,"[UE%d] Frame %d: Applying radioResourceConfigCommon from eNB%d\n",Mod_id,PHY_vars_UE_g[Mod_id][CC_id]->frame_rx,CH_index);
lte_frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
......@@ -348,7 +348,7 @@ void phy_config_sib13_ue(uint8_t Mod_id,int CC_id,uint8_t CH_index,int mbsfn_Are
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_UE_g[Mod_id][CC_id]->lte_frame_parms;
LOG_I(PHY,"[UE%d] Frame %d: Applying MBSFN_Area_id %d for index %d\n",Mod_id,PHY_vars_UE_g[Mod_id][CC_id]->frame,mbsfn_AreaId_r9,mbsfn_Area_idx);
LOG_I(PHY,"[UE%d] Frame %d: Applying MBSFN_Area_id %d for index %d\n",Mod_id,PHY_vars_UE_g[Mod_id][CC_id]->frame_rx,mbsfn_AreaId_r9,mbsfn_Area_idx);
if (mbsfn_Area_idx == 0) {
lte_frame_parms->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
......@@ -489,7 +489,7 @@ void phy_config_afterHO_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, MobilityCont
// 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,eNB_id);
Mod_id,PHY_vars_UE_g[Mod_id][CC_id]->frame_rx,eNB_id);
lte_frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
lte_frame_parms->prach_config_common.prach_Config_enabled=1;
......@@ -712,7 +712,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t CH_index,
if (physicalConfigDedicated) {
LOG_D(PHY,"[UE %d] Frame %d: Received physicalConfigDedicated from eNB %d\n",Mod_id, phy_vars_ue->frame,CH_index);
LOG_D(PHY,"[UE %d] Frame %d: Received physicalConfigDedicated from eNB %d\n",Mod_id, phy_vars_ue->frame_rx,CH_index);
LOG_D(PHY,"------------------------------------------------------------------------\n");
if (physicalConfigDedicated->pdsch_ConfigDedicated) {
......@@ -797,7 +797,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t CH_index,
#endif
}
else {
LOG_D(PHY,"[PHY][UE %d] Frame %d: Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, phy_vars_ue->frame,CH_index);
LOG_D(PHY,"[PHY][UE %d] Frame %d: Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, phy_vars_ue->frame_rx,CH_index);
return;
}
......
......@@ -53,7 +53,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
ncoef = 32767 - coef;
#ifdef DEBUG_PHY
LOG_D(PHY,"frame %d: rx_offset (before) = %d\n",phy_vars_ue->frame,phy_vars_ue->rx_offset);
LOG_D(PHY,"frame %d: rx_offset (before) = %d\n",phy_vars_ue->frame_rx,phy_vars_ue->rx_offset);
#endif //DEBUG_PHY
......@@ -95,7 +95,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
#ifdef DEBUG_PHY
LOG_D(PHY,"frame %d: rx_offset (after) = %d : max_pos = %d,max_pos_fil = %d (peak %d)\n",
phy_vars_ue->frame,phy_vars_ue->rx_offset,max_pos,max_pos_fil,temp);
phy_vars_ue->frame_rx,phy_vars_ue->rx_offset,max_pos,max_pos_fil,temp);
#endif //DEBUG_PHY
......
......@@ -91,7 +91,7 @@ int16_t get_PL(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index) {
RSoffset = 3;
LOG_D(PHY,"get_PL : Frame %d : rssi %f dBm, eNB power %d dBm/RE\n", phy_vars_ue->frame,
LOG_D(PHY,"get_PL : Frame %d : rssi %f dBm, eNB power %d dBm/RE\n", phy_vars_ue->frame_rx,
(1.0*dB_fixed_times10(phy_vars_ue->PHY_measurements.rssi/RSoffset)-(10.0*phy_vars_ue->rx_total_gain_dB))/10.0,
phy_vars_ue->lte_frame_parms.pdsch_config_common.referenceSignalPower);
......@@ -204,7 +204,7 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
for (l=0,nu=0;l<=(4-phy_vars_ue->lte_frame_parms.Ncp);l+=(4-phy_vars_ue->lte_frame_parms.Ncp),nu=3) {
k = (nu + nushift)%6;
#ifdef DEBUG_MEAS
LOG_D(PHY,"[UE %d] Frame %d slot %d Doing ue_rrc_measurements rsrp/rssi (Nid_cell %d, nushift %d, eNB_offset %d, k %d)\n",phy_vars_ue->Mod_id,phy_vars_ue->frame,slot,Nid_cell,nushift,eNB_offset,k);
LOG_D(PHY,"[UE %d] Frame %d slot %d Doing ue_rrc_measurements rsrp/rssi (Nid_cell %d, nushift %d, eNB_offset %d, k %d)\n",phy_vars_ue->Mod_id,phy_vars_ue->frame_rx,slot,Nid_cell,nushift,eNB_offset,k);
#endif
for (aarx=0;aarx<phy_vars_ue->lte_frame_parms.nb_antennas_rx;aarx++) {
rxF = (int16_t *)&phy_vars_ue->lte_ue_common_vars.rxdataF[aarx][(l*phy_vars_ue->lte_frame_parms.ofdm_symbol_size)];
......@@ -265,16 +265,16 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
phy_vars_ue->PHY_measurements.rsrq[eNB_offset] = 3;
}
if (((phy_vars_ue->frame %10) == 0) && (slot == 0)) {
if (((phy_vars_ue->frame_rx %10) == 0) && (slot == 0)) {
#ifdef DEBUG_MEAS
if (eNB_offset == 0)
LOG_D(PHY,"[UE %d] Frame %d, slot %d RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB, gain %d)\n",phy_vars_ue->Mod_id,
phy_vars_ue->frame,slot,10*log10(phy_vars_ue->PHY_measurements.rssi)-phy_vars_ue->rx_total_gain_dB,
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);
LOG_D(PHY,"[UE %d] Frame %d, slot %d RRC Measurements (idx %d, Cell id %d) => rsrp: %3.1f (%3.1f) dBm, rsrq: %3.1f dB\n",
phy_vars_ue->Mod_id,
phy_vars_ue->frame,slot,eNB_offset,
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,
(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),
(10*log10(phy_vars_ue->PHY_measurements.rx_power_avg[0])/10.0)-phy_vars_ue->rx_total_gain_dB-dB_fixed(phy_vars_ue->lte_frame_parms.N_RB_DL*12),
......
......@@ -1693,12 +1693,12 @@ void pdcch_alamouti(LTE_DL_FRAME_PARMS *frame_parms,
int32_t avgP[4];
int32_t rx_pdcch(LTE_UE_COMMON *lte_ue_common_vars,
LTE_UE_PDCCH **lte_ue_pdcch_vars,
LTE_DL_FRAME_PARMS *frame_parms,
uint8_t subframe,
uint8_t eNB_id,
MIMO_mode_t mimo_mode,
uint8_t is_secondary_ue) {
LTE_UE_PDCCH **lte_ue_pdcch_vars,
LTE_DL_FRAME_PARMS *frame_parms,
uint8_t subframe,
uint8_t eNB_id,
MIMO_mode_t mimo_mode,
uint8_t is_secondary_ue) {
uint8_t log2_maxh,aatx,aarx;
#ifdef MU_RECEIVER
......
......@@ -4032,12 +4032,12 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
harq_pid = 0;
else
harq_pid = subframe2harq_pid(frame_parms,
pdcch_alloc2ul_frame(frame_parms,phy_vars_ue->frame,subframe),
pdcch_alloc2ul_frame(frame_parms,phy_vars_ue->frame_rx,subframe),
pdcch_alloc2ul_subframe(frame_parms,subframe));
if (harq_pid == 255) {
LOG_E(PHY, "frame %d, subframe %d, rnti %x, format %d: illegal harq_pid!\n",
phy_vars_ue->frame, subframe, rnti, dci_format);
phy_vars_ue->frame_rx, subframe, rnti, dci_format);
return(-1);
}
......@@ -4165,7 +4165,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
if (rballoc > RIV_max) {
LOG_E(PHY,"frame %d, subframe %d, rnti %x, format %d: FATAL ERROR: generate_ue_ulsch_params_from_dci, rb_alloc > RIV_max\n",
phy_vars_ue->frame, subframe, rnti, dci_format);
phy_vars_ue->frame_rx, subframe, rnti, dci_format);
return(-1);
}
......@@ -4238,7 +4238,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
ulsch->harq_processes[harq_pid]->n_DMRS2 = 9;
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d, subframe %d : Programming PUSCH with n_DMRS2 %d (cshift %d)\n",
phy_vars_ue->Mod_id,harq_pid,phy_vars_ue->frame,subframe,ulsch->harq_processes[harq_pid]->n_DMRS2,cshift);
phy_vars_ue->Mod_id,harq_pid,phy_vars_ue->frame_rx,subframe,ulsch->harq_processes[harq_pid]->n_DMRS2,cshift);
//reserved for cooperative communication
/*
......@@ -4473,7 +4473,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
}
else {
LOG_E(PHY,"frame %d, subframe %d: FATAL ERROR, generate_ue_ulsch_params_from_dci, Illegal dci_format %d\n",
phy_vars_ue->frame, subframe,dci_format);
phy_vars_ue->frame_rx, subframe,dci_format);
return(-1);
}
......
......@@ -154,7 +154,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
msg("dlsch_demodulation.c: Null lte_frame_parms\n");
return(-1);
}
// printf("rx_dlsch : eNB_id %d, eNB_id_i %d, dual_stream_flag %d\n",eNB_id,eNB_id_i,dual_stream_flag);
// printf("rx_dlsch subframe %d symbol %d: eNB_id %d, eNB_id_i %d, dual_stream_flag %d\n",subframe,symbol,eNB_id,eNB_id_i,dual_stream_flag);
// symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
/*
......
......@@ -70,7 +70,7 @@ int generate_drs_pusch(PHY_VARS_UE *phy_vars_ue,
uint32_t v0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[subframe<<1];
uint32_t v1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)];
int32_t ref_re,ref_im;
uint8_t harq_pid = subframe2harq_pid(frame_parms,phy_vars_ue->frame,subframe);
uint8_t harq_pid = subframe2harq_pid(frame_parms,phy_vars_ue->frame_tx,subframe);
cyclic_shift0 = (frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->n_DMRS2 +
......
......@@ -204,20 +204,20 @@ int pbch_detection(PHY_VARS_UE *phy_vars_ue, runmode_t mode) {
break;
}
phy_vars_ue->frame = (((phy_vars_ue->lte_ue_pbch_vars[0]->decoded_output[2]&3)<<6) + (phy_vars_ue->lte_ue_pbch_vars[0]->decoded_output[1]>>2))<<2;
phy_vars_ue->frame += frame_mod4;
phy_vars_ue->frame_rx = (((phy_vars_ue->lte_ue_pbch_vars[0]->decoded_output[2]&3)<<6) + (phy_vars_ue->lte_ue_pbch_vars[0]->decoded_output[1]>>2))<<2;
phy_vars_ue->frame_rx += frame_mod4;
#ifndef USER_MODE
// one frame delay
phy_vars_ue->frame ++;
phy_vars_ue->frame_rx ++;
#endif
phy_vars_ue->frame_tx = phy_vars_ue->frame_rx;
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"[UE%d] Initial sync: pbch decoded sucessfully mode1_flag %d, tx_ant %d, frame %d, N_RB_DL %d, phich_duration %d, phich_resource %s!\n",
phy_vars_ue->Mod_id,
frame_parms->mode1_flag,
pbch_tx_ant,
phy_vars_ue->frame,
phy_vars_ue->frame_rx,
frame_parms->N_RB_DL,
frame_parms->phich_config_common.phich_duration,
phich_resource); //frame_parms->phich_config_common.phich_resource);
......@@ -458,7 +458,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) {
#ifdef OPENAIR2
LOG_I(PHY,"[PHY][UE%d] Sending synch status to higher layers\n",phy_vars_ue->Mod_id);
//mac_resynch();
mac_xface->dl_phy_sync_success(phy_vars_ue->Mod_id,phy_vars_ue->frame,0,1);//phy_vars_ue->lte_ue_common_vars.eNb_id);
mac_xface->dl_phy_sync_success(phy_vars_ue->Mod_id,phy_vars_ue->frame_rx,0,1);//phy_vars_ue->lte_ue_common_vars.eNb_id);
#endif //OPENAIR2
generate_pcfich_reg_mapping(frame_parms);
......
......@@ -933,7 +933,7 @@ uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue,
sinr,
bler);
if (pbch_phase == (phy_vars_ue->frame % 4)) {
if (pbch_phase == (phy_vars_ue->frame_rx % 4)) {
if (uniformrandom() >= bler) {
memcpy(phy_vars_ue->lte_ue_pbch_vars[eNB_id]->decoded_output,PHY_vars_eNB_g[eNB_id][CC_id]->pbch_pdu,PBCH_PDU_SIZE);
return(PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.nb_antennas_tx_eNB);
......
......@@ -982,7 +982,7 @@ void rx_phich(PHY_VARS_UE *phy_vars_ue,
LTE_UE_PDCCH **lte_ue_pdcch_vars = phy_vars_ue->lte_ue_pdcch_vars;
// uint8_t HI;
uint8_t harq_pid = phich_subframe_to_harq_pid(frame_parms,phy_vars_ue->frame,subframe);
uint8_t harq_pid = phich_subframe_to_harq_pid(frame_parms,phy_vars_ue->frame_rx,subframe);
LTE_UE_ULSCH_t *ulsch = phy_vars_ue->ulsch_ue[eNB_id];
int16_t phich_d[24],*phich_d_ptr,HI16;
// unsigned int i,aa;
......@@ -1000,9 +1000,9 @@ void rx_phich(PHY_VARS_UE *phy_vars_ue,
uint8_t pusch_subframe;
// check if we're expecting a PHICH in this subframe
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH RX\n",phy_vars_ue->Mod_id,harq_pid,phy_vars_ue->frame,subframe);
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH RX\n",phy_vars_ue->Mod_id,harq_pid,phy_vars_ue->frame_rx,subframe);
if (ulsch->harq_processes[harq_pid]->status == ACTIVE) {
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH RX ACTIVE\n",phy_vars_ue->Mod_id,harq_pid,phy_vars_ue->frame,subframe);
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH RX ACTIVE\n",phy_vars_ue->Mod_id,harq_pid,phy_vars_ue->frame_rx,subframe);
Ngroup_PHICH = (frame_parms->phich_config_common.phich_resource*frame_parms->N_RB_DL)/48;
if (((frame_parms->phich_config_common.phich_resource*frame_parms->N_RB_DL)%48) > 0)
Ngroup_PHICH++;
......@@ -1247,14 +1247,14 @@ void rx_phich(PHY_VARS_UE *phy_vars_ue,
if (phy_vars_ue->ulsch_ue_Msg3_active[eNB_id] == 1) {
LOG_I(PHY,"[UE %d][PUSCH %d][RAPROC] Frame %d subframe %d Msg3 PHICH, received NAK (%d) nseq %d, ngroup %d\n",
phy_vars_ue->Mod_id,harq_pid,
phy_vars_ue->frame,
phy_vars_ue->frame_rx,
subframe,
HI16,
nseq_PHICH,
ngroup_PHICH);
get_Msg3_alloc_ret(&phy_vars_ue->lte_frame_parms,
subframe,
phy_vars_ue->frame,
phy_vars_ue->frame_rx,
&phy_vars_ue->ulsch_ue_Msg3_frame[eNB_id],
&phy_vars_ue->ulsch_ue_Msg3_subframe[eNB_id]);
ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
......@@ -1272,7 +1272,7 @@ void rx_phich(PHY_VARS_UE *phy_vars_ue,
//#ifdef DEBUG_PHICH
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received NAK (%d) nseq %d, ngroup %d\n",
phy_vars_ue->Mod_id,harq_pid,
phy_vars_ue->frame,
phy_vars_ue->frame_rx,
subframe,
HI16,
nseq_PHICH,
......@@ -1290,7 +1290,7 @@ void rx_phich(PHY_VARS_UE *phy_vars_ue,
if (phy_vars_ue->ulsch_ue_Msg3_active[eNB_id] == 1) {
LOG_I(PHY,"[UE %d][PUSCH %d][RAPROC] Frame %d subframe %d Msg3 PHICH, received ACK (%d) nseq %d, ngroup %d\n\n",
phy_vars_ue->Mod_id,harq_pid,
phy_vars_ue->frame,
phy_vars_ue->frame_rx,
subframe,
HI16,
nseq_PHICH,ngroup_PHICH);
......@@ -1299,7 +1299,7 @@ void rx_phich(PHY_VARS_UE *phy_vars_ue,
//#ifdef PHICH_DEBUG
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received ACK (%d) nseq %d, ngroup %d\n\n",
phy_vars_ue->Mod_id,harq_pid,
phy_vars_ue->frame,
phy_vars_ue->frame_rx,
subframe, HI16,
nseq_PHICH,ngroup_PHICH);
//#endif
......
......@@ -79,7 +79,7 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
if ((mode == normal_txrx) || (mode == no_L2_connect)) {
len += sprintf(&buffer[len], "[UE_PROC] UE %d, RNTI %x\n",phy_vars_ue->Mod_id, phy_vars_ue->lte_ue_pdcch_vars[0]->crnti);
len += sprintf(&buffer[len], "[UE PROC] Frame count: %d\neNB0 RSSI %d dBm (%d dB, %d dB)\neNB1 RSSI %d dBm (%d dB, %d dB)\neNB2 RSSI %d dBm (%d dB, %d dB)\nN0 %d dBm (%d dB, %d dB)\n",
phy_vars_ue->frame,
phy_vars_ue->frame_rx,
phy_vars_ue->PHY_measurements.rx_rssi_dBm[0],
phy_vars_ue->PHY_measurements.rx_power_dB[0][0],
phy_vars_ue->PHY_measurements.rx_power_dB[0][1],
......@@ -235,7 +235,7 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
}
else {
len += sprintf(&buffer[len], "[UE PROC] Frame count: %d, RSSI %3.2f dB (%d dB, %d dB), N0 %3.2f dB (%d dB, %d dB)\n",
phy_vars_ue->frame,
phy_vars_ue->frame_rx,
10*log10(phy_vars_ue->PHY_measurements.rssi),
phy_vars_ue->PHY_measurements.rx_power_dB[0][0],
phy_vars_ue->PHY_measurements.rx_power_dB[0][1],
......
......@@ -422,7 +422,7 @@ void generate_pucch_emul(PHY_VARS_UE *phy_vars_ue,
UE_transport_info[phy_vars_ue->Mod_id][phy_vars_ue->CC_id].cntl.pucch_payload = pucch_payload[0] + (pucch_payload[1]<<1);
}
else if (format == pucch_format1) {
LOG_D(PHY,"[UE %d] Frame %d subframe %d Generating PUCCH for SR %d\n",phy_vars_ue->Mod_id,phy_vars_ue->frame,subframe,sr);
LOG_D(PHY,"[UE %d] Frame %d subframe %d Generating PUCCH for SR %d\n",phy_vars_ue->Mod_id,phy_vars_ue->frame_tx,subframe,sr);
}
phy_vars_ue->sr[subframe] = sr;
......
......@@ -181,14 +181,14 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *phy_vars_ue,
// int current_dlsch_cqi = phy_vars_ue->current_dlsch_cqi[eNB_id];
uint8_t *rar = (uint8_t *)(rar_pdu+1);
uint8_t harq_pid = subframe2harq_pid(frame_parms,((subframe==0)?1:0) + phy_vars_ue->frame,subframe);
uint8_t harq_pid = subframe2harq_pid(frame_parms,phy_vars_ue->frame_tx,subframe);
uint16_t rballoc;
uint8_t cqireq;
double sinr_eff;
uint16_t *RIV2nb_rb_LUT, *RIV2first_rb_LUT;
uint16_t RIV_max = 0;
LOG_D(PHY,"[eNB][RAPROC] Frame %d: generate_ue_ulsch_params_from_rar: subframe %d (harq_pid %d)\n",phy_vars_ue->frame,subframe,harq_pid);
LOG_D(PHY,"[eNB][RAPROC] Frame %d: generate_ue_ulsch_params_from_rar: subframe %d (harq_pid %d)\n",phy_vars_ue->frame_tx,subframe,harq_pid);
switch (frame_parms->N_RB_DL) {
case 6:
......@@ -267,7 +267,7 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *phy_vars_ue,
// }
// else
// fill_CQI(ulsch->o,ulsch->uci_format,meas,eNB_id,transmission_mode);
if (((phy_vars_ue->frame % 100) == 0) || (phy_vars_ue->frame < 10))
if (((phy_vars_ue->frame_tx % 100) == 0) || (phy_vars_ue->frame_tx < 10))
print_CQI(ulsch->o,ulsch->uci_format,eNB_id);
}
else {
......
......@@ -356,10 +356,16 @@ typedef struct
uint8_t local_flag;
int instance_cnt_tx;
int instance_cnt_rx;
int instance_cnt_synch;
pthread_cond_t cond_tx;
pthread_cond_t cond_rx;
pthread_cond_t cond_synch;
pthread_mutex_t mutex_tx;
pthread_mutex_t mutex_rx;
pthread_mutex_t mutex_synch;
pthread_t thread_rx;
pthread_t thread_tx;
pthread_t thread_synch;
uint32_t tx_total_gain_dB;
uint32_t rx_total_gain_dB; ///this is a function of rx_gain_mode (and the corresponding gain) and the rx_gain of the card
uint32_t rx_gain_max[4];
......@@ -370,7 +376,7 @@ typedef struct
int8_t tx_power_dBm;
int tx_total_RE;
int8_t tx_power_max_dBm;
uint32_t frame;
// uint32_t frame;
uint32_t frame_rx,frame_tx;
uint32_t slot_tx,slot_rx;
uint8_t n_connected_eNB;
......
......@@ -169,7 +169,7 @@ void phy_procedures_eNB_lte(uint8_t subframe,PHY_VARS_eNB **phy_vars_eNB,uint8_t
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
@param *phy_vars_rn pointer to RN variables
*/
void phy_procedures_UE_lte(uint8_t last_slot, uint8_t next_slot,PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn);
void phy_procedures_UE_lte(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn);
#ifdef Rel10
/*!
......@@ -190,14 +190,13 @@ int phy_procedures_RN_UE_RX(unsigned char last_slot, unsigned char next_slot, re
/*!
\brief Scheduling for UE TX procedures in normal subframes.
@param next_slot Index of next slot (0-19)
@param phy_vars_ue Pointer to UE variables on which to act
@param eNB_id Local id of eNB on which to act
@param abstraction_flag Indicator of PHY abstraction
@param mode calib/normal mode
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
void phy_procedures_UE_TX(uint8_t next_slot,PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type);
void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type);
/*!
\brief Scheduling for UE RX procedures in normal subframes.
@param last_slot Index of last slot (0-19)
......@@ -208,17 +207,16 @@ void phy_procedures_UE_TX(uint8_t next_slot,PHY_VARS_UE *phy_vars_ue,uint8_t eNB
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
@param phy_vars_rn pointer to RN variables
*/
int phy_procedures_UE_RX(uint8_t last_slot,PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn);
int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn);
/*!
\brief Scheduling for UE TX procedures in TDD S-subframes.
@param next_slot Index of next slot (0-19)
@param phy_vars_ue Pointer to UE variables on which to act
@param eNB_id Local id of eNB on which to act
@param abstraction_flag Indicator of PHY abstraction
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
void phy_procedures_UE_S_TX(uint8_t next_slot,PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag,relaying_type_t r_type);
void phy_procedures_UE_S_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag,relaying_type_t r_type);
/*!
\brief Scheduling for UE RX procedures in TDD S-subframes.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -90,7 +90,7 @@ int8_t pucch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id
if (pucch_fmt!=pucch_format1) {
LOG_D(PHY,"[UE %d][PDSCH %x] frame %d, subframe %d: Po_PUCCH %d dBm : Po_NOMINAL_PUCCH %d dBm, PL %d dB, g_pucch %d dB\n",
phy_vars_ue->Mod_id,
phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,phy_vars_ue->frame,subframe,
phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,phy_vars_ue->frame_tx,subframe,
Po_PUCCH,
phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,eNB_id),
......@@ -99,7 +99,7 @@ int8_t pucch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id
else {
LOG_D(PHY,"[UE %d][SR %x] frame %d, subframe %d: Po_PUCCH %d dBm : Po_NOMINAL_PUCCH %d dBm, PL %d dB g_pucch %d dB\n",
phy_vars_ue->Mod_id,
phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,phy_vars_ue->frame,subframe,
phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,phy_vars_ue->frame_tx,subframe,
Po_PUCCH,
phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,eNB_id),
......
......@@ -73,7 +73,7 @@ void pusch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id,u
uint8_t harq_pid = subframe2harq_pid(&phy_vars_ue->lte_frame_parms,
((subframe==0)?1:0) + phy_vars_ue->frame,
phy_vars_ue->frame_tx,
subframe);
uint8_t nb_rb = phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->nb_rb;
......@@ -96,7 +96,7 @@ void pusch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id,u
phy_vars_ue->ulsch_ue[eNB_id]->Po_PUSCH += (mac_xface->get_Po_NOMINAL_PUSCH(phy_vars_ue->Mod_id,0) + PL);
LOG_D(PHY,"[UE %d][RAPROC] frame %d, subframe %d: Msg3 Po_PUSCH %d dBm (%d,%d,%d,%d,%d)\n",
phy_vars_ue->Mod_id,((subframe==0)?1:0)+phy_vars_ue->frame,subframe,phy_vars_ue->ulsch_ue[eNB_id]->Po_PUSCH,
phy_vars_ue->Mod_id,phy_vars_ue->frame_tx,subframe,phy_vars_ue->ulsch_ue[eNB_id]->Po_PUSCH,
100*mac_xface->get_Po_NOMINAL_PUSCH(phy_vars_ue->Mod_id,0),
hundred_times_log10_NPRB[nb_rb-1],
100*PL,
......@@ -117,7 +117,7 @@ void pusch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id,u
phy_vars_ue->ulsch_ue[eNB_id]->PHR = 40;
LOG_D(PHY,"[UE %d][PUSCH %d] frame %d, subframe %d: Po_PUSCH %d dBm : Po_NOMINAL_PUSCH %d,log10(NPRB) %f,PHR %d, PL %d, alpha*PL %f,delta_IF %f,f_pusch %d\n",
phy_vars_ue->Mod_id,harq_pid,((subframe==0)?1:0) + phy_vars_ue->frame,subframe,
phy_vars_ue->Mod_id,harq_pid,phy_vars_ue->frame_tx,subframe,
phy_vars_ue->ulsch_ue[eNB_id]->Po_PUSCH,
phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUSCH,
hundred_times_log10_NPRB[nb_rb-1]/100.0,
......
......@@ -1571,7 +1571,7 @@ int main(int argc, char **argv) {
}
for (SNR=snr0;SNR<snr1;SNR+=snr_step) {
PHY_vars_UE->frame=0;
PHY_vars_UE->frame_rx=0;
errs[0]=0;
errs[1]=0;
errs[2]=0;
......@@ -2656,14 +2656,14 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
//len = chbch_stats_read(stats_buffer,NULL,0,4096);
//printf("%s\n\n",stats_buffer);
if (PHY_vars_UE->frame % 10 == 0) {
if (PHY_vars_UE->frame_rx % 10 == 0) {
PHY_vars_UE->bitrate[eNB_id] = (PHY_vars_UE->total_TBS[eNB_id] - PHY_vars_UE->total_TBS_last[eNB_id])*10;
LOG_D(PHY,"[UE %d] Calculating bitrate: total_TBS = %d, total_TBS_last = %d, bitrate = %d kbits/s\n",PHY_vars_UE->Mod_id,PHY_vars_UE->total_TBS[eNB_id],PHY_vars_UE->total_TBS_last[eNB_id],PHY_vars_UE->bitrate[eNB_id]/1000);
PHY_vars_UE->total_TBS_last[eNB_id] = PHY_vars_UE->total_TBS[eNB_id];
}
PHY_vars_UE->frame++;
PHY_vars_UE->frame_rx++;
} //trials
// round_trials[0]: number of code word : goodput the protocol
......
......@@ -728,7 +728,7 @@ int main(int argc, char **argv) {
PHY_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 0;
PHY_vars_UE->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0;
PHY_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0;
PHY_vars_UE->frame=1;
PHY_vars_UE->frame_tx=1;
for (sf=0;sf<10;sf++) {
PHY_vars_eNB->proc[sf].frame_tx=1;
......@@ -742,12 +742,12 @@ int main(int argc, char **argv) {
msg("Init UL hopping eNB\n");
init_ul_hopping(&PHY_vars_eNB->lte_frame_parms);
PHY_vars_eNB->proc[subframe].frame_rx = PHY_vars_UE->frame;
PHY_vars_eNB->proc[subframe].frame_rx = PHY_vars_UE->frame_tx;
if (ul_subframe2pdcch_alloc_subframe(&PHY_vars_eNB->lte_frame_parms,subframe) > subframe) // allocation was in previous frame
PHY_vars_eNB->proc[ul_subframe2pdcch_alloc_subframe(&PHY_vars_eNB->lte_frame_parms,subframe)].frame_tx = (PHY_vars_UE->frame-1)&1023;
PHY_vars_eNB->proc[ul_subframe2pdcch_alloc_subframe(&PHY_vars_eNB->lte_frame_parms,subframe)].frame_tx = (PHY_vars_UE->frame_tx-1)&1023;
// printf("UE frame %d, eNB frame %d (eNB frame_tx %d)\n",PHY_vars_UE->frame,PHY_vars_eNB->proc[subframe].frame_rx,PHY_vars_eNB->proc[ul_subframe2pdcch_alloc_subframe(&PHY_vars_eNB->lte_frame_parms,subframe)].frame_tx);
PHY_vars_UE->frame = (PHY_vars_UE->frame-1)&1023;
PHY_vars_UE->frame_tx = (PHY_vars_UE->frame_tx-1)&1023;
generate_ue_ulsch_params_from_dci((void *)&UL_alloc_pdu,
14,
......@@ -777,7 +777,7 @@ int main(int argc, char **argv) {
PHY_vars_UE->frame = (PHY_vars_UE->frame+1)&1023;
PHY_vars_UE->frame_tx = (PHY_vars_UE->frame_tx+1)&1023;
for (ch_realization=0;ch_realization<n_ch_rlz;ch_realization++){
......@@ -816,7 +816,7 @@ int main(int argc, char **argv) {
//randominit(0);
harq_pid = subframe2harq_pid(&PHY_vars_UE->lte_frame_parms,PHY_vars_UE->frame,subframe);
harq_pid = subframe2harq_pid(&PHY_vars_UE->lte_frame_parms,PHY_vars_UE->frame_tx,subframe);
// printf("UL frame %d/subframe %d, harq_pid %d\n",PHY_vars_UE->frame,subframe,harq_pid);
if (input_fdUL == NULL) {
input_buffer_length = PHY_vars_UE->ulsch_ue[0]->harq_processes[harq_pid]->TBS/8;
......@@ -978,11 +978,11 @@ int main(int argc, char **argv) {
start_meas(&PHY_vars_UE->ulsch_modulation_stats);
#ifdef OFDMA_ULSCH
ulsch_modulation(PHY_vars_UE->lte_ue_common_vars.txdataF,AMP,
PHY_vars_UE->frame,subframe,&PHY_vars_UE->lte_frame_parms,PHY_vars_UE->ulsch_ue[0]);
PHY_vars_UE->frame_tx,subframe,&PHY_vars_UE->lte_frame_parms,PHY_vars_UE->ulsch_ue[0]);
#else
// printf("Generating PUSCH in subframe %d with amp %d, nb_rb %d\n",subframe,AMP,nb_rb);
ulsch_modulation(PHY_vars_UE->lte_ue_common_vars.txdataF,AMP,
PHY_vars_UE->frame,subframe,&PHY_vars_UE->lte_frame_parms,
PHY_vars_UE->frame_tx,subframe,&PHY_vars_UE->lte_frame_parms,
PHY_vars_UE->ulsch_ue[0]);
#endif
stop_meas(&PHY_vars_UE->ulsch_modulation_stats);
......
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