Commit 2f2fde58 authored by nikaeinn's avatar nikaeinn

* Compile Rel10 with component carrier

* Add VCD timing for PDCP, RLC, and MAC
* Update MAC-PHY interface
* update eNB MAC DLSCH scheduler and preprocessor with component carrier
* Add test case for dlsim performance
  


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5708 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 6b615410
......@@ -10,6 +10,9 @@
#include "TDD-Config.h"
#include "MBSFN-SubframeConfigList.h"
#include "MobilityControlInfo.h"
#ifdef Rel10
#include "SCellToAddMod-r10.h"
#endif
#else
/**
......@@ -269,6 +272,18 @@ void phy_init_lte_top(LTE_DL_FRAME_PARMS *lte_frame_parms);
//void copy_lte_parms_to_phy_framing(LTE_DL_FRAME_PARMS *frame_parm, PHY_FRAMING *phy_framing);
#ifdef Rel10
void phy_config_dedicated_scell_ue(uint8_t Mod_id,
uint8_t eNB_index,
SCellToAddMod_r10_t *sCellToAddMod_r10,
int CC_id);
void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
uint16_t rnti,
SCellToAddMod_r10_t *sCellToAddMod_r10,
int CC_id);
#endif
#endif
......
......@@ -590,18 +590,24 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
}
#ifdef Rel10
void phy_config_dedicated_scell_ue(uint8_t Mod_id,
uint8_t eNB_index,
SCellToAddMod_r10_t *sCellToAddMod_r10,
int CC_id) {
}
void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
uint16_t rnti,
SCellToAddMod_r10_t *sCellToAddMod_r10,
int CC_id) {
PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[Mod_id][CC_id];
u8 UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][0]);
uint8_t UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][0]);
struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10;
//struct RadioResourceConfigCommonSCell_r10 *physicalConfigCommonSCell_r10 = sCellToAddMod_r10->radioResourceConfigCommonSCell_r10;
PhysCellId_t physCellId_r10 = sCellToAddMod_r10->cellIdentification_r10->physCellId_r10;
ARFCN_ValueEUTRA_t dl_CarrierFreq_r10 = sCellToAddMod_r10->cellIdentification_r10->dl_CarrierFreq_r10;
u32 carrier_freq_local;
uint32_t carrier_freq_local;
#ifdef EXMIMO
#ifdef DRIVER2013
......@@ -611,7 +617,8 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
if ((dl_CarrierFreq_r10>=36000) && (dl_CarrierFreq_r10<=36199)) {
carrier_freq_local = 1900000000 + (dl_CarrierFreq_r10-36000)*100000; //band 33 from 3GPP 36.101 v 10.9 Table 5.7.3-1
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %d) for UE %d\n",Mod_id,phy_vars_eNB->frame,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
#warning "fixme: update the phy frame counter "
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %d) for UE %d\n",Mod_id,/*phy_vars_eNB->frame*/0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
#ifdef EXMIMO
#ifdef DRIVER2013
carrier_freq[CC_id] = carrier_freq_local;
......@@ -628,7 +635,7 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
else if ((dl_CarrierFreq_r10>=6150) && (dl_CarrierFreq_r10<=6449)) {
carrier_freq_local = 832000000 + (dl_CarrierFreq_r10-6150)*100000; //band 20 from 3GPP 36.101 v 10.9 Table 5.7.3-1
// this is actually for the UL only, but we use it for DL too, since there is no TDD mode for this band
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %d) for UE %d\n",Mod_id,phy_vars_eNB->frame,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %d) for UE %d\n",Mod_id,/*phy_vars_eNB->frame*/0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
#ifdef EXMIMO
#ifdef DRIVER2013
carrier_freq[CC_id] = carrier_freq_local;
......@@ -643,15 +650,16 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
#endif
}
else {
LOG_E(PHY,"[eNB %d] Frame %d: ARFCN %d of SCell %d for UE %d not supported\n",Mod_id,phy_vars_eNB->frame,dl_CarrierFreq_r10,CC_id,UE_id);
LOG_E(PHY,"[eNB %d] Frame %d: ARFCN %d of SCell %d for UE %d not supported\n",Mod_id,/*phy_vars_eNB->frame*/0,dl_CarrierFreq_r10,CC_id,UE_id);
}
if (physicalConfigDedicatedSCell_r10) {
phy_vars_eNB->physicalConfigDedicatedSCell_r10[UE_id] = physicalConfigDedicatedSCell_r10;
LOG_I(PHY,"[eNB %d] Frame %d: Configured phyConfigDedicatedSCell with CC_id %d for UE %d\n",Mod_id,phy_vars_eNB->frame,CC_id,UE_id);
#warning " phy_vars_eNB->physicalConfigDedicatedSCell_r10 does not exist in phy_vars_eNB"
// phy_vars_eNB->physicalConfigDedicatedSCell_r10[UE_id] = physicalConfigDedicatedSCell_r10;
LOG_I(PHY,"[eNB %d] Frame %d: Configured phyConfigDedicatedSCell with CC_id %d for UE %d\n",Mod_id,/*phy_vars_eNB->frame*/0,CC_id,UE_id);
}
else {
LOG_E(PHY,"[eNB %d] Frame %d: Received NULL radioResourceConfigDedicated (CC_id %d, UE %d)\n",Mod_id, phy_vars_eNB->frame,CC_id,UE_id);
LOG_E(PHY,"[eNB %d] Frame %d: Received NULL radioResourceConfigDedicated (CC_id %d, UE %d)\n",Mod_id, /*phy_vars_eNB->frame*/0,CC_id,UE_id);
return;
}
......
......@@ -46,7 +46,8 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) {
frame_parms->log2_symbol_size = 11;
frame_parms->samples_per_tti = 30720;
frame_parms->first_carrier_offset = 2048-600;
frame_parms->N_RBGS = 25;
frame_parms->N_RBGS = 4;
frame_parms->N_RBG = 25;
break;
case 50:
if (osf>1) {
......@@ -59,7 +60,8 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) {
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 300;
frame_parms->nb_prefix_samples>>=(1-log2_osf);
frame_parms->nb_prefix_samples0>>=(1-log2_osf);
frame_parms->N_RBGS = 17;
frame_parms->N_RBGS = 3;
frame_parms->N_RBG = 17;
break;
case 25:
if (osf>2) {
......@@ -73,7 +75,8 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) {
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 150;
frame_parms->nb_prefix_samples>>=(2-log2_osf);
frame_parms->nb_prefix_samples0>>=(2-log2_osf);
frame_parms->N_RBGS = 13;
frame_parms->N_RBGS = 2;
frame_parms->N_RBG = 13;
break;
case 15:
frame_parms->ofdm_symbol_size = 256*osf;
......@@ -82,7 +85,8 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) {
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 90;
frame_parms->nb_prefix_samples>>=(3-log2_osf);
frame_parms->nb_prefix_samples0>>=(3-log2_osf);
frame_parms->N_RBGS = 8;
frame_parms->N_RBGS = 2;
frame_parms->N_RBG = 8;
break;
case 6:
frame_parms->ofdm_symbol_size = 128*osf;
......@@ -91,7 +95,8 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) {
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 36;
frame_parms->nb_prefix_samples>>=(4-log2_osf);
frame_parms->nb_prefix_samples0>>=(4-log2_osf);
frame_parms->N_RBGS = 6;
frame_parms->N_RBGS = 1;
frame_parms->N_RBG = 6;
break;
default:
......
......@@ -21,7 +21,7 @@ __m128i zeroPMI;
#define k1 ((long long int) 1000)
#define k2 ((long long int) (1024-k1))
#define DEBUG_MEAS
//#define DEBUG_MEAS
#ifdef USER_MODE
void print_shorts(char *s,__m128i *x) {
......@@ -243,7 +243,7 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
}
// 2 RE per PRB
phy_vars_ue->PHY_measurements.rsrp[eNB_offset]/=(24*phy_vars_ue->lte_frame_parms.N_RB_DL);
phy_vars_ue->PHY_measurements.rsrp[eNB_offset]*=rx_power_correction;
......@@ -267,9 +267,9 @@ 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 == 1)) {
if (((phy_vars_ue->frame %10) == 0) && (slot == 1)) {
#ifdef DEBUG_MEAS
//if (eNB_offset == 0)
if (eNB_offset == 0)
LOG_D(PHY,"[UE %d] Frame %d, slot %d RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB)\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,
10*log10(phy_vars_ue->PHY_measurements.rssi));
......@@ -286,7 +286,7 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
//LOG_D(PHY,"gain_loss_dB: %d \n",phy_vars_ue->rx_total_gain_dB);
//LOG_D(PHY,"gain_fixed_dB: %d \n",dB_fixed(phy_vars_ue->lte_frame_parms.N_RB_DL*12));
#endif
//}
}
}
}
......
......@@ -525,13 +525,13 @@ uint32_t get_rballoc(uint8_t vrb_type,uint16_t rb_alloc_dci) {
}
uint8_t get_transmission_mode(uint16_t Mod_id, uint16_t rnti) {
uint8_t get_transmission_mode(uint16_t Mod_id, uint8_t CC_id, uint16_t rnti) {
unsigned char UE_id;
// find the UE_index corresponding to rnti
UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][0]);
UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][CC_id]);
return(PHY_vars_eNB_g[Mod_id][0]->transmission_mode[UE_id]);
return(PHY_vars_eNB_g[Mod_id][CC_id]->transmission_mode[UE_id]);
}
int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
......
......@@ -29,11 +29,11 @@
/*! \file PHY/LTE_TRANSPORT/print_stats.c
* \brief PHY statstic logging function
* \author R. Knopp, F. Kaltenberger
* \author R. Knopp, F. Kaltenberger, navid nikaein
* \date 2011
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr, navid.nikaein@eurecom.fr
* \note
* \warning
*/
......@@ -347,7 +347,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) {
phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][0],
phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][1]);
len += sprintf(&buffer[len],"[eNB PROC] Subband CQI: ");
len += sprintf(&buffer[len],"[eNB PROC] Subband CQI: ");
for (i=0;i<25;i++)
len += sprintf(&buffer[len],"%2d ",
phy_vars_eNB->PHY_measurements_eNB[eNB].subband_cqi_tot_dB[UE_id][i]);
......@@ -357,6 +357,12 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) {
phy_vars_eNB->eNB_UE_stats[UE_id].DL_cqi[0],
pmi2hex_2Ar1(phy_vars_eNB->eNB_UE_stats[UE_id].DL_pmi_single));
len += sprintf(&buffer[len],"[eNB PROC] DL Subband CQI: ");
for (i=0;i<13;i++)
len += sprintf(&buffer[len],"%2d ",
phy_vars_eNB->eNB_UE_stats[UE_id].DL_subband_cqi[0][i]);
len += sprintf(&buffer[len],"\n");
len += sprintf(&buffer[len],"[eNB PROC] Timing advance %d samples (%d 16Ts), update %d\n",
phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset,
phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset>>2,
......
......@@ -1222,7 +1222,7 @@ uint32_t get_rballoc(uint8_t vrb_type,uint16_t rb_alloc_dci);
/* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type
@returns Transmission mode (1-7)
*/
uint8_t get_transmission_mode(uint16_t Mod_id, uint16_t rnti);
uint8_t get_transmission_mode(uint16_t Mod_id, uint8_t CC_id, uint16_t rnti);
/* \brief
@param ra_header Header of resource allocation (0,1) (See sections 7.1.6.1/7.1.6.2 of 36.213 Rel8.6)
......
......@@ -509,6 +509,8 @@ int8_t dB_fixed(uint32_t x);
int8_t dB_fixed2(uint32_t x,uint32_t y);
int16_t dB_fixed_times10(uint32_t x);
int32_t phy_phase_compensation_top (uint32_t pilot_type, uint32_t initial_pilot,
uint32_t last_pilot, int32_t ignore_prefix);
......
......@@ -419,7 +419,9 @@ typedef struct {
uint8_t N_RB_DL;
/// Number of resource blocks (RB) in UL
uint8_t N_RB_UL;
/// Number of Resource Block Groups for P=2
/// total Number of Resource Block Groups: this is ceil(N_PRB/P)
uint8_t N_RBG;
/// Total Number of Resource Block Groups SubSets: this is P
uint8_t N_RBGS;
/// Cell ID
uint16_t Nid_cell;
......
......@@ -89,7 +89,8 @@ double sinr_to_cqi[4][16]={ {-2.5051, -2.5051, -1.7451, -0.3655, 1.0812, 2.4012,
{-1, -1.0000, -0.4198, -0.0140, 1.0362, 2.3520, 3.5793, 6.1136, 8.4836, 9.0858, 12.4723, 13.9128, 16.2054, 17.7392, 17.7392, 17.7392},
{ -4.1057, -4.1057, -3.3768, -2.2916, -1.1392, 0.1236, 1.2849, 3.1933, 5.9298, 6.4052, 9.6245, 10.9414, 13.5166, 14.9545, 14.9545, 14.9545} };
int cqi_to_mcs[16]={0, 0, 1, 3, 5, 7, 9, 13, 15, 16, 20, 23, 25, 27, 27, 27};
//int cqi_to_mcs[16]={0, 0, 1, 3, 5, 7, 9, 13, 15, 16, 20, 23, 25, 27, 27, 27};
int cqi_to_mcs[16]={0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 28};
//for SNR to MI conversion 7 th order Polynomial coeff
double q_qam16[8]={3.21151853033897e-10,5.55435952230651e-09,-2.30760065362117e-07,-6.25587743817859e-06,4.62251036452795e-06,0.00224150813158937,0.0393723140344367,0.245486379182639};
......
......@@ -493,7 +493,12 @@ void pusch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id,u
int8_t get_PHR(uint8_t Mod_id, uint8_t eNB_index);
LTE_eNB_UE_stats* get_eNB_UE_stats(uint8_t Mod_id, int CC_id,uint16_t rnti);
LTE_eNB_UE_stats* get_eNB_UE_stats(uint8_t Mod_id, uint8_t CC_id,uint16_t rnti);
LTE_DL_FRAME_PARMS *get_lte_frame_parms(module_id_t Mod_id, uint8_t CC_id);
MU_MIMO_mode* get_mu_mimo_mode (module_id_t Mod_id, uint8_t CC_id);
int get_ue_active_harq_pid(uint8_t Mod_id,uint8_t CC_id,uint16_t rnti,uint8_t subframe,uint8_t *harq_pid,uint8_t *round,uint8_t ul_flag);
void ulsch_decoding_procedures(unsigned char last_slot, unsigned int i, PHY_VARS_eNB *phy_vars_eNB, unsigned char abstraction_flag);
......
......@@ -544,7 +544,7 @@ unsigned int is_phich_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsigned char sub
}
LTE_eNB_UE_stats* get_eNB_UE_stats(uint8_t Mod_id, int CC_id,uint16_t rnti) {
LTE_eNB_UE_stats* get_eNB_UE_stats(uint8_t Mod_id, uint8_t CC_id,uint16_t rnti) {
int8_t UE_id;
if ((PHY_vars_eNB_g == NULL) || (PHY_vars_eNB_g[Mod_id] == NULL) || (PHY_vars_eNB_g[Mod_id][CC_id]==NULL)) {
LOG_E(PHY,"get_eNB_UE_stats: No phy_vars_eNB found (or not allocated) for Mod_id %d,CC_id %d\n",Mod_id,CC_id);
......@@ -580,3 +580,13 @@ int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB) {
return(-1);
}
LTE_DL_FRAME_PARMS* get_lte_frame_parms(module_id_t Mod_id, uint8_t CC_id){
return(&PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms);
}
MU_MIMO_mode *get_mu_mimo_mode (module_id_t Mod_id, uint8_t CC_id){
return(&PHY_vars_eNB_g[Mod_id][CC_id]->mu_mimo_mode);
}
......@@ -1890,14 +1890,16 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,uint8_t last_slot, PHY_VARS_UE *phy_v
}
#ifdef PHY_ABSTRACTION
else {
for (i=0;i<NB_eNB_INST;i++)
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++){
if (PHY_vars_eNB_g[i][CC_id]->lte_frame_parms.Nid_cell == phy_vars_ue->lte_frame_parms.Nid_cell)
for (i=0;i<NB_eNB_INST;i++) {
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++)
if (PHY_vars_eNB_g[i][CC_id]->lte_frame_parms.Nid_cell == phy_vars_ue->lte_frame_parms.Nid_cell)
break;
if (CC_id < MAX_NUM_CCs)
break;
}
if (i==NB_eNB_INST) {
LOG_E(PHY,"[UE %d] phy_procedures_lte_ue.c: FATAL : Could not find attached eNB for DCI emulation (Nid_cell %d)!!!!\n",phy_vars_ue->Mod_id,phy_vars_ue->lte_frame_parms.Nid_cell);
mac_xface->macphy_exit("");
mac_xface->macphy_exit("Could not find attached eNB for DCI emulation");
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PDCCH_PROCEDURES, VCD_FUNCTION_OUT);
return(-1);
}
......@@ -3076,7 +3078,13 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,uint8_t last_slot, PHY_VARS_UE *phy_v
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Querying for PMCH demodulation(%d)\n",
phy_vars_ue->Mod_id,((last_slot>>1)==9?-1:0)+phy_vars_ue->frame,last_slot>>1,last_slot);
#ifdef Rel10
pmch_mcs = mac_xface->ue_query_mch(phy_vars_ue->Mod_id,((last_slot>>1)==9?-1:0)+phy_vars_ue->frame,last_slot>>1,eNB_id,&sync_area,&mcch_active);
pmch_mcs = mac_xface->ue_query_mch(phy_vars_ue->Mod_id,
phy_vars_ue->CC_id,
((last_slot>>1)==9?-1:0)+phy_vars_ue->frame,
last_slot>>1,
eNB_id,
&sync_area,
&mcch_active);
if (phy_vars_rn)
phy_vars_rn->mch_avtive[last_slot>>1]=0;
#else
......@@ -3166,6 +3174,7 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,uint8_t last_slot, PHY_VARS_UE *phy_v
#ifdef Rel10
if ((r_type == no_relay) || (mcch_active == 1)) {
mac_xface->ue_send_mch_sdu(phy_vars_ue->Mod_id,
phy_vars_ue->CC_id,
((last_slot>>1)==9?-1:0)+phy_vars_ue->frame,
phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->b,
phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->TBS>>3,
......
......@@ -666,7 +666,7 @@ int main(int argc, char **argv) {
hostname[1023] = '\0';
gethostname(hostname, 1023);
printf("Hostname: %s\n", hostname);
sprintf(time_meas_fname,"%s/TEST/OAI/PERF_%s/time_meas_prb%d_mcs%d_anttx%d_antrx%d_pdcch%d_channel%s_tx%d.csv",
sprintf(time_meas_fname,"%s/SIMU/USER/pre-ci-logs-%s/time_meas_prb%d_mcs%d_anttx%d_antrx%d_pdcch%d_channel%s_tx%d.csv",
getenv("OPENAIR_TARGETS"),hostname,
N_RB_DL,mcs,n_tx,n_rx,num_pdcch_symbols,channel_model_input,transmission_mode);
time_meas_fd = fopen(time_meas_fname,"w");
......
......@@ -521,7 +521,7 @@ int main(int argc, char **argv) {
hostname[1023] = '\0';
gethostname(hostname, 1023);
printf("Hostname: %s\n", hostname);
sprintf(time_meas_fname,"%s/TEST/OAI/PERF_%s/time_meas_prb%d_mcs%d_antrx%d_channel%s_tx%d.csv",
sprintf(time_meas_fname,"%s//SIMU/USER/pre-ci-logs-%s/time_meas_prb%d_mcs%d_antrx%d_channel%s_tx%d.csv",
getenv("OPENAIR_TARGETS"),hostname,
N_RB_DL,mcs,n_rx,channel_model_input,transmission_mode);
time_meas_fd = fopen(time_meas_fname,"w");
......
......@@ -244,10 +244,11 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
#ifdef Rel10
if (sCellToAddMod_r10 != NULL) {
if (eNB_flag==1){
if (eNB_flagP==1){
mac_xface->phy_config_dedicated_scell_eNB(Mod_id,UE_RNTI(Mod_id,UE_id),sCellToAddMod_r10,1);
}
else {
#warning "phy_config_dedicated_scell_ue is empty"
mac_xface->phy_config_dedicated_scell_ue(Mod_id,eNB_index,sCellToAddMod_r10,1);
UE_mac_inst[Mod_id].physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10; // using SCell index 0
}
......@@ -420,7 +421,7 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
// MBMS session info list in each MCH
eNB_mac_inst[Mod_id].common_channels[0].mbms_SessionList[i] = &pmch_InfoList->list.array[i]->mbms_SessionInfoList_r9;
LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n",i, eNB_mac_inst[Mod_id].mbms_SessionList[i]->list.count);
LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n",i, eNB_mac_inst[Mod_id].common_channels[0].mbms_SessionList[i]->list.count);
}
}
else { // UE
......
......@@ -128,7 +128,11 @@
// The power headroom reporting range is from -23 ...+40 dB and beyond, with step 1
#define PHR_MAPPING_OFFSET 23 // if ( x>= -23 ) val = floor (x + 23)
#define N_RBGS_MAX 25
#define N_RBG_MAX 25 // for 20MHz channel BW
#define MIN_CQI_VALUE 0
#define MAX_CQI_VALUE 15
#define LCGID0 0
#define LCGID1 1
......@@ -529,6 +533,8 @@ typedef struct{
uint32_t dl_buffer_head_sdu_creation_time[MAX_NUM_LCID];
uint32_t dl_buffer_head_sdu_creation_time_max;
uint8_t dl_buffer_head_sdu_is_segmented[MAX_NUM_LCID];
uint32_t dl_buffer_head_sdu_remaining_size_to_send[MAX_NUM_LCID];
......@@ -702,7 +708,7 @@ typedef struct{
/// active flag for Other lcid
// uint8_t lcid_active[NB_RB_MAX];
// eNB stats
eNB_STATS eNB_stats;
eNB_STATS eNB_stats[MAX_NUM_CCs];
// MAC function execution peformance profiler
time_stats_t eNB_scheduler;
time_stats_t schedule_si;
......
......@@ -82,7 +82,6 @@
void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP) {//, int calibration_flag) {
start_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
unsigned int nprb[MAX_NUM_CCs];
unsigned int nCCE[MAX_NUM_CCs];
int mbsfn_status[MAX_NUM_CCs];
......@@ -101,9 +100,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler\n",module_idP, frameP, subframeP);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,1);
start_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_IN);
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
DCI_pdu[CC_id] = &eNB_mac_inst[module_idP].common_channels[CC_id].DCI_pdu;
......@@ -170,7 +168,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
eNB_mac_inst[module_idP].common_channels[CC_id].bcch_active = 0;
#ifdef Rel10
eNB_mac_inst[module_idP].common_channels.mcch_active =0;
eNB_mac_inst[module_idP].common_channels[CC_id].mcch_active =0;
#endif
eNB_mac_inst[module_idP].frame = frameP;
......@@ -181,22 +179,19 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
#ifdef EXMIMO
pdcp_run(frameP, 1, 0, module_idP);
#endif
#ifdef CELLULAR
rrc_rx_tx(module_idP, frameP, 0, 0);
#else
// check HO
rrc_rx_tx(module_idP,
frameP,
1,
module_idP);
#endif
frameP,
1,
module_idP);
#ifdef Rel10
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
if (eNB_mac_inst[module_idP].common_channels.MBMS_flag >0) {
start_meas(&eNB_mac_inst[module_idP].common_channels.schedule_mch);
mbsfn_status = schedule_MBMS(module_idP,CC_id,frameP,subframeP);
stop_meas(&eNB_mac_inst[module_idP][CC-id].schedule_mch);
if (eNB_mac_inst[module_idP].common_channels[CC_id].MBMS_flag >0) {
start_meas(&eNB_mac_inst[module_idP].schedule_mch);
mbsfn_status[CC_id] = schedule_MBMS(module_idP,CC_id,frameP,subframeP);
stop_meas(&eNB_mac_inst[module_idP].schedule_mch);
}
}
#endif
......@@ -473,9 +468,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
DCI_pdu[CC_id]->nCCE = nCCE[CC_id];
LOG_D(MAC,"frameP %d, subframeP %d nCCE %d\n",frameP,subframeP,nCCE[0]);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,0);
stop_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT);
}
......
......@@ -67,6 +67,7 @@
# include "intertask_interface.h"
#endif
extern inline unsigned int taus(void);
void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,unsigned char Msg3_subframe,unsigned int *nprb,unsigned int *nCCE) {
......
This diff is collapsed.
This diff is collapsed.
......@@ -532,6 +532,30 @@ uint32_t allocate_prbs(int UE_id,unsigned char nb_rb, uint32_t *rballoc) {
return(rballoc_dci);
}
int get_min_rb_unit(module_id_t module_id, uint8_t CC_id){
int min_rb_unit=0;
LTE_DL_FRAME_PARMS* frame_parms = mac_xface->get_lte_frame_parms(module_id,CC_id);
switch (frame_parms->N_RB_DL) {
case 6: // 1.4 MHz
min_rb_unit=1;
break;
case 25: // 5HMz
min_rb_unit=2;
break;
case 50: // 10HMz
min_rb_unit=3;
break;
case 100: // 20HMz
min_rb_unit=4;
break;
default:
min_rb_unit=2;
LOG_W(MAC,"[eNB %d] N_DL_RB %d unknown for CC_id %d, setting min_rb_unit to 2\n", module_id, CC_id);
break;
}
return min_rb_unit;
}
uint32_t allocate_prbs_sub(int nb_rb, uint8_t *rballoc) {
......@@ -539,23 +563,23 @@ uint32_t allocate_prbs_sub(int nb_rb, uint8_t *rballoc) {
uint32_t rballoc_dci=0;
//uint8_t number_of_subbands=13;
LOG_T(MAC,"*****Check1RBALLOC****: %d%d%d%d (nb_rb %d,N_RBGS %d)\n",
rballoc[3],rballoc[2],rballoc[1],rballoc[0],nb_rb,mac_xface->lte_frame_parms->N_RBGS);
while((nb_rb >0) && (check < mac_xface->lte_frame_parms->N_RBGS)){
LOG_T(MAC,"*****Check1RBALLOC****: %d%d%d%d (nb_rb %d,N_RBG %d)\n",
rballoc[3],rballoc[2],rballoc[1],rballoc[0],nb_rb,mac_xface->lte_frame_parms->N_RBG);
while((nb_rb >0) && (check < mac_xface->lte_frame_parms->N_RBG)){
//printf("rballoc[%d] %d\n",check,rballoc[check]);
if(rballoc[check] == 1){
rballoc_dci |= (1<<((mac_xface->lte_frame_parms->N_RBGS-1)-check));
rballoc_dci |= (1<<((mac_xface->lte_frame_parms->N_RBG-1)-check));
switch (mac_xface->lte_frame_parms->N_RB_DL) {
case 6:
nb_rb--;
case 25:
if ((check == mac_xface->lte_frame_parms->N_RBGS-1))
if ((check == mac_xface->lte_frame_parms->N_RBG-1))
nb_rb--;
else
nb_rb-=2;
break;
case 50:
if ((check == mac_xface->lte_frame_parms->N_RBGS-1))
if ((check == mac_xface->lte_frame_parms->N_RBG-1))
nb_rb-=2;
else
nb_rb-=3;
......@@ -576,21 +600,32 @@ uint32_t allocate_prbs_sub(int nb_rb, uint8_t *rballoc) {
}
int get_nb_subband(void){
int nb_sb=0;
switch (mac_xface->lte_frame_parms->N_RB_DL) {
case 6:
nb_sb=0;
break;
case 15:
nb_sb = 4; // sb_size =4
case 25:
nb_sb = 7; // sb_size =4, 1 sb with 1PRB, 6 with 2 RBG, each has 2 PRBs
break;
case 50: // sb_size =6
nb_sb = 9;
break;
case 75: // sb_size =8
nb_sb = 10;
break;
case 100: // sb_size =8 , 1 sb with 1 RBG + 12 sb with 2RBG, each RBG has 4 PRBs
nb_sb = 13;
break;
default:
nb_sb=0;
break;
}
return nb_sb;
void update_ul_dci(module_id_t module_idP,int CC_id,rnti_t rnti,uint8_t dai) {
DCI_PDU *DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_id].DCI_pdu;
int i;
DCI0_5MHz_TDD_1_6_t *ULSCH_dci = NULL;;
if (mac_xface->lte_frame_parms->frame_type == TDD) {
for (i=0;i<DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci;i++) {
ULSCH_dci = (DCI0_5MHz_TDD_1_6_t *)DCI_pdu->dci_alloc[i].dci_pdu;
if ((DCI_pdu->dci_alloc[i].format == format0) && (DCI_pdu->dci_alloc[i].rnti == rnti))
ULSCH_dci->dai = (dai-1)&3;
}
}
// printf("Update UL DCI: DAI %d\n",dai);
}
......@@ -582,7 +582,7 @@ void schedule_ulsch_rnti(module_id_t module_idP,
(UE_template->bsr_info[LCGID1] == 0) &&
(UE_template->bsr_info[LCGID2] == 0) &&
(UE_template->bsr_info[LCGID3] == 0))?
BSR_TABLE[10] : // This is when we've received SR and buffers are fully served
BSR_TABLE[11] : // This is when we've received SR and buffers are fully served
BSR_TABLE[UE_template->bsr_info[LCGID0]]+
BSR_TABLE[UE_template->bsr_info[LCGID1]]+
BSR_TABLE[UE_template->bsr_info[LCGID2]]+
......
......@@ -86,6 +86,8 @@ extern EMULATION_VARS *Emul_vars;
#endif //PHY_EMUL
extern int cqi_to_mcs[16];
extern uint32_t RRC_CONNECTION_FLAG;
......
......@@ -487,8 +487,14 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, uint8_t cba_group_
mac_xface->phy_config_dedicated_eNB = phy_config_dedicated_eNB;
mac_xface->phy_config_dedicated_ue = phy_config_dedicated_ue;
mac_xface->get_lte_frame_parms = get_lte_frame_parms;
mac_xface->get_mu_mimo_mode = get_mu_mimo_mode;
#ifdef Rel10
mac_xface->get_mch_sdu = get_mch_sdu;
mac_xface->phy_config_dedicated_scell_eNB= phy_config_dedicated_scell_eNB;
mac_xface->phy_config_dedicated_scell_ue= phy_config_dedicated_scell_ue;
#endif
mac_xface->get_PHR = get_PHR;
......
This diff is collapsed.
......@@ -68,14 +68,14 @@ void schedule_SI(module_id_t module_idP,frame_t frameP,unsigned int *nprb,unsign
@param frame Frame index
@param subframe Subframe number on which to act
*/
int schedule_MBMS(module_id_t module_idP,frame_t frameP, sub_frame_t subframe);
int schedule_MBMS(module_id_t module_idP,uint8_t CC_id, frame_t frameP, sub_frame_t subframe);
/** \brief check the mapping between sf allocation and sync area, Currently only supports 1:1 mapping
@param Mod_id Instance ID of eNB
@param mbsfn_sync_area index of mbsfn sync area
@param[out] index of sf pattern
*/
int8_t get_mbsfn_sf_alloction (module_id_t module_idP, uint8_t mbsfn_sync_area);
int8_t get_mbsfn_sf_alloction (module_id_t module_idP, uint8_t CC_id, uint8_t mbsfn_sync_area);
/** \brief check the mapping between sf allocation and sync area, Currently only supports 1:1 mapping
@param Mod_id Instance ID of eNB
......@@ -170,6 +170,16 @@ void mac_top_cleanup(void);
void mac_UE_out_of_sync_ind(module_id_t module_idP,frame_t frameP, uint16_t eNB_index);
void dlsch_scheduler_pre_processor_reset (int UE_id,
uint8_t CC_id,
int N_RBG,
uint8_t dl_pow_off[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
uint16_t pre_nb_available_rbs[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
uint16_t nb_rbs_required_remaining[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
unsigned char rballoc_sub_UE[MAX_NUM_CCs][NUMBER_OF_UE_MAX][N_RBG_MAX],
unsigned char rballoc_sub[MAX_NUM_CCs][13],