Commit c76b846b authored by nikaeinn's avatar nikaeinn

* fix few bugs in oaisim and UL scheduling

* update the CBA operation (non standard feature)
* update OTG 
* add a set of templates for different combination of packet sizes and inter-departure time
 


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6351 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 699563f2
......@@ -5126,7 +5126,7 @@ uint32_t fill_subband_cqi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t trans_mo
return(cqivect);
}
void fill_CQI(LTE_UE_ULSCH_t *ulsch,PHY_MEASUREMENTS *meas,uint8_t eNB_id,int N_RB_DL,uint16_t rnti, uint8_t trans_mode, double sinr_eff) {
void fill_CQI(LTE_UE_ULSCH_t *ulsch,PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t harq_pid,int N_RB_DL,uint16_t rnti, uint8_t trans_mode, double sinr_eff) {
// msg("[PHY][UE] Filling CQI for eNB %d, meas->wideband_cqi_tot[%d] %d\n",
// eNB_id,eNB_id,meas->wideband_cqi_tot[eNB_id]);
......@@ -5141,7 +5141,7 @@ void fill_CQI(LTE_UE_ULSCH_t *ulsch,PHY_MEASUREMENTS *meas,uint8_t eNB_id,int N_
//LOG_I(PHY,"Filling CQI %f for eNB %d\n",sinr_tmp,eNB_id);
//LOG_I(PHY,"[UE][UCI] Filling CQI format %d for eNB %d N_RB_DL %d\n",uci_format,eNB_id,N_RB_DL);
switch (N_RB_DL) {
......@@ -5175,9 +5175,9 @@ void fill_CQI(LTE_UE_ULSCH_t *ulsch,PHY_MEASUREMENTS *meas,uint8_t eNB_id,int N_
break;
case HLC_subband_cqi_mcs_CBA:
// this is the cba mcs uci for cba transmission
((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->mcs = 2; //fixme
((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->mcs = ulsch->harq_processes[harq_pid]->mcs;
((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->crnti = rnti;
LOG_D(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, 2);
LOG_D(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, ulsch->harq_processes[harq_pid]->mcs);
break;
case ue_selected:
LOG_E(PHY,"fill_CQI ue_selected CQI not supported yet!!!\n");
......@@ -5220,9 +5220,9 @@ void fill_CQI(LTE_UE_ULSCH_t *ulsch,PHY_MEASUREMENTS *meas,uint8_t eNB_id,int N_
break;
case HLC_subband_cqi_mcs_CBA:
// this is the cba mcs uci for cba transmission
((HLC_subband_cqi_mcs_CBA_5MHz *)o)->mcs = 2; //fixme
((HLC_subband_cqi_mcs_CBA_5MHz *)o)->mcs = ulsch->harq_processes[harq_pid]->mcs;
((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti = rnti;
LOG_D(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, 2);
LOG_N(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, ulsch->harq_processes[harq_pid]->mcs);
break;
case ue_selected:
LOG_E(PHY,"fill_CQI ue_selected CQI not supported yet!!!\n");
......@@ -5265,9 +5265,9 @@ void fill_CQI(LTE_UE_ULSCH_t *ulsch,PHY_MEASUREMENTS *meas,uint8_t eNB_id,int N_
break;
case HLC_subband_cqi_mcs_CBA:
// this is the cba mcs uci for cba transmission
((HLC_subband_cqi_mcs_CBA_10MHz *)o)->mcs = 2; //fixme
((HLC_subband_cqi_mcs_CBA_10MHz *)o)->mcs = ulsch->harq_processes[harq_pid]->mcs;
((HLC_subband_cqi_mcs_CBA_10MHz *)o)->crnti = rnti;
LOG_D(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, 2);
LOG_N(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, ulsch->harq_processes[harq_pid]->mcs);
break;
case ue_selected:
LOG_E(PHY,"fill_CQI ue_selected CQI not supported yet!!!\n");
......@@ -5310,9 +5310,9 @@ void fill_CQI(LTE_UE_ULSCH_t *ulsch,PHY_MEASUREMENTS *meas,uint8_t eNB_id,int N_
break;
case HLC_subband_cqi_mcs_CBA:
// this is the cba mcs uci for cba transmission
((HLC_subband_cqi_mcs_CBA_20MHz *)o)->mcs = 2; //fixme
((HLC_subband_cqi_mcs_CBA_20MHz *)o)->mcs = ulsch->harq_processes[harq_pid]->mcs;
((HLC_subband_cqi_mcs_CBA_20MHz *)o)->crnti = rnti;
LOG_D(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, 2);
LOG_N(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, ulsch->harq_processes[harq_pid]->mcs);
break;
case ue_selected:
LOG_E(PHY,"fill_CQI ue_selected CQI not supported yet!!!\n");
......@@ -5526,7 +5526,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
// indicate that this process is to be serviced in subframe n+4
if ((rnti >= cba_rnti) && (rnti < p_rnti))
ulsch->harq_processes[harq_pid]->subframe_cba_scheduling_flag = 1;
ulsch->harq_processes[harq_pid]->subframe_cba_scheduling_flag = 1; //+=1 this indicates the number of dci / cba group: not supported in the data struct
else
ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
......
......@@ -1555,9 +1555,9 @@ uint8_t phich_frame2_pusch_frame(LTE_DL_FRAME_PARMS *frame_parms,frame_t frame,u
void print_CQI(void *o,UCI_format_t uci_format,uint8_t eNB_id,int N_RB_DL);
void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats,uint16_t * crnti, uint8_t * access_mode);
void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats,uint8_t N_RB_DL, uint16_t * crnti, uint8_t * access_mode);
void fill_CQI(LTE_UE_ULSCH_t *ulsch,PHY_MEASUREMENTS *meas,uint8_t eNB_id, int N_RB_DL, rnti_t rnti, uint8_t trans_mode,double sinr_eff);
void fill_CQI(LTE_UE_ULSCH_t *ulsch,PHY_MEASUREMENTS *meas,uint8_t eNB_id, uint8_t harq_pid,int N_RB_DL, rnti_t rnti, uint8_t trans_mode,double sinr_eff);
void reset_cba_uci(void *o);
uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_subbands);
......
......@@ -264,7 +264,7 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *phy_vars_ue,
else
sinr_eff = meas->wideband_cqi_avg[eNB_id];
*/
fill_CQI(ulsch,meas,eNB_id,phy_vars_ue->lte_frame_parms.N_RB_DL,0, transmission_mode,phy_vars_ue->sinr_eff);
fill_CQI(ulsch,meas,eNB_id,0,phy_vars_ue->lte_frame_parms.N_RB_DL,0, transmission_mode,phy_vars_ue->sinr_eff);
if (((phy_vars_ue->frame_tx % 100) == 0) || (phy_vars_ue->frame_tx < 10))
print_CQI(ulsch->o,ulsch->uci_format,eNB_id,phy_vars_ue->lte_frame_parms.N_RB_DL);
......
......@@ -38,7 +38,7 @@ typedef enum {
HLC_subband_cqi_rank1_2A, //HLC_subband_cqi_rank1_2A,
HLC_subband_cqi_rank2_2A, //HLC_subband_cqi_rank2_2A,
HLC_subband_cqi_modes123, //HLC_subband_cqi_modes123
HLC_subband_cqi_mcs_CBA,
HLC_subband_cqi_mcs_CBA, // MCS and RNTI, for contention-based acces
unknown_cqi//
} UCI_format_t;
......@@ -91,11 +91,11 @@ typedef struct __attribute__((packed)) {
#define sizeof_HLC_subband_cqi_modes123_1_5MHz 16
typedef struct __attribute__((packed)) {
uint32_t padding:12;
uint32_t padding:11;
uint32_t crnti:16;
uint32_t mcs:4;
uint32_t mcs:5;
} HLC_subband_cqi_mcs_CBA_1_5MHz;
#define sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz 20
#define sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz 21
// **********************************************5 MHz***************************************************************************
......@@ -147,11 +147,11 @@ typedef struct __attribute__((packed)) {
#define sizeof_HLC_subband_cqi_modes123_5MHz 18
typedef struct __attribute__((packed)) {
uint32_t padding:12;
uint32_t padding:11;
uint32_t crnti:16;
uint32_t mcs:4;
uint32_t mcs:5;
} HLC_subband_cqi_mcs_CBA_5MHz;
#define sizeof_HLC_subband_cqi_mcs_CBA_5MHz 20
#define sizeof_HLC_subband_cqi_mcs_CBA_5MHz 21
// **********************************************10 MHz***************************************************************************
typedef struct __attribute__((packed)) {
......@@ -202,11 +202,11 @@ typedef struct __attribute__((packed)) {
#define sizeof_HLC_subband_cqi_modes123_10MHz 22
typedef struct __attribute__((packed)) {
uint32_t padding:12;
uint32_t padding:11;
uint32_t crnti:16;
uint32_t mcs:4;
uint32_t mcs:5;
} HLC_subband_cqi_mcs_CBA_10MHz;
#define sizeof_HLC_subband_cqi_mcs_CBA_10MHz 20
#define sizeof_HLC_subband_cqi_mcs_CBA_10MHz 21
// **********************************************20 MHz***************************************************************************
typedef struct __attribute__((packed)) {
......@@ -257,11 +257,11 @@ typedef struct __attribute__((packed)) {
#define sizeof_HLC_subband_cqi_modes123_20MHz 30
typedef struct __attribute__((packed)) {
uint32_t padding:12;
uint32_t padding:11;
uint32_t crnti:16;
uint32_t mcs:4;
uint32_t mcs:5;
} HLC_subband_cqi_mcs_CBA_20MHz;
#define sizeof_HLC_subband_cqi_mcs_CBA_20MHz 20
#define sizeof_HLC_subband_cqi_mcs_CBA_20MHz 21
#define MAX_CQI_PAYLOAD (sizeof(HLC_subband_cqi_rank2_2A_20MHz)*8*20)
......
......@@ -44,7 +44,8 @@
#ifdef DEBUG_UCI_TOOLS
#include "PHY/vars.h"
#endif
//#define DEBUG_UCI
//#define DEBUG_UCI 1
uint64_t pmi2hex_2Ar1(uint32_t pmi) {
......@@ -159,13 +160,13 @@ void do_diff_cqi(uint8_t N_RB_DL,
}
}
void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint16_t * crnti, uint8_t * access_mode) {
void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint8_t N_RB_DL, uint16_t * crnti, uint8_t * access_mode) {
//unsigned char rank;
//UCI_format fmt;
uint8_t N_RB_DL = 25;
*access_mode=SCHEDULED_ACCESS;
//uint8_t N_RB_DL = 25;
LOG_D(PHY,"[eNB][UCI] N_RB_DL %d uci format %d\n", N_RB_DL,uci_format);
switch(N_RB_DL) {
case 6:
switch(uci_format){
......@@ -211,18 +212,16 @@ void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint16
case HLC_subband_cqi_mcs_CBA:
if ((*crnti == ((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->crnti) && (*crnti !=0)){
*access_mode=CBA_ACCESS;
LOG_D(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
LOG_N(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->crnti);
} else {
*access_mode=UNKNOWN_ACCESS;
LOG_N(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
LOG_D(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
*crnti, ((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->crnti);
}
break;
case unknown_cqi:
default:
LOG_N(PHY,"[eNB][UCI] received unknown uci \n");
*access_mode=UNKNOWN_ACCESS;
LOG_N(PHY,"[eNB][UCI] received unknown uci (rb %d)\n",N_RB_DL);
break;
}
break;
......@@ -271,27 +270,136 @@ void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint16
case HLC_subband_cqi_mcs_CBA:
if ((*crnti == ((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti) && (*crnti !=0)){
*access_mode=CBA_ACCESS;
LOG_D(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
LOG_N(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
((HLC_subband_cqi_mcs_CBA_5MHz *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti);
} else {
*access_mode=UNKNOWN_ACCESS;
LOG_N(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
LOG_D(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
*crnti, ((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti);
}
break;
case unknown_cqi:
default:
LOG_N(PHY,"[eNB][UCI] received unknown uci \n");
*access_mode=UNKNOWN_ACCESS;
LOG_N(PHY,"[eNB][UCI] received unknown uci (rb %d)\n",N_RB_DL);
break;
}
break;
case 50:
switch(uci_format){
case wideband_cqi_rank1_2A:
stats->DL_cqi[0] = (((wideband_cqi_rank1_2A_10MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_pmi_single = ((wideband_cqi_rank1_2A_10MHz *)o)->pmi;
break;
case wideband_cqi_rank2_2A:
stats->DL_cqi[0] = (((wideband_cqi_rank2_2A_10MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((wideband_cqi_rank2_2A_10MHz *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
stats->DL_pmi_dual = ((wideband_cqi_rank2_2A_10MHz *)o)->pmi;
break;
case HLC_subband_cqi_nopmi:
stats->DL_cqi[0] = (((HLC_subband_cqi_nopmi_10MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],((HLC_subband_cqi_nopmi_10MHz *)o)->diffcqi1);
break;
case HLC_subband_cqi_rank1_2A:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank1_2A_10MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank1_2A_10MHz *)o)->diffcqi1));
stats->DL_pmi_single = ((HLC_subband_cqi_rank1_2A_10MHz *)o)->pmi;
break;
case HLC_subband_cqi_rank2_2A:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank2_2A_10MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((HLC_subband_cqi_rank2_2A_10MHz *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank2_2A_10MHz *)o)->diffcqi1));
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[1],stats->DL_cqi[1],(((HLC_subband_cqi_rank2_2A_10MHz *)o)->diffcqi2));
stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_10MHz *)o)->pmi;
break;
case HLC_subband_cqi_mcs_CBA:
if ((*crnti == ((HLC_subband_cqi_mcs_CBA_10MHz *)o)->crnti) && (*crnti !=0)){
*access_mode=CBA_ACCESS;
LOG_N(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
((HLC_subband_cqi_mcs_CBA_10MHz *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_10MHz *)o)->crnti);
} else {
LOG_D(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
*crnti, ((HLC_subband_cqi_mcs_CBA_10MHz *)o)->crnti);
}
break;
case unknown_cqi:
default:
LOG_N(PHY,"[eNB][UCI] received unknown uci (RB %d)\n",N_RB_DL);
break;
}
break;
case 100:
switch(uci_format){
case wideband_cqi_rank1_2A:
stats->DL_cqi[0] = (((wideband_cqi_rank1_2A_20MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_pmi_single = ((wideband_cqi_rank1_2A_20MHz *)o)->pmi;
break;
case wideband_cqi_rank2_2A:
stats->DL_cqi[0] = (((wideband_cqi_rank2_2A_20MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((wideband_cqi_rank2_2A_20MHz *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
stats->DL_pmi_dual = ((wideband_cqi_rank2_2A_20MHz *)o)->pmi;
break;
case HLC_subband_cqi_nopmi:
stats->DL_cqi[0] = (((HLC_subband_cqi_nopmi_20MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],((HLC_subband_cqi_nopmi_20MHz *)o)->diffcqi1);
break;
case HLC_subband_cqi_rank1_2A:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank1_2A_20MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank1_2A_20MHz *)o)->diffcqi1));
stats->DL_pmi_single = ((HLC_subband_cqi_rank1_2A_20MHz *)o)->pmi;
break;
case HLC_subband_cqi_rank2_2A:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank2_2A_20MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((HLC_subband_cqi_rank2_2A_20MHz *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank2_2A_20MHz *)o)->diffcqi1));
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[1],stats->DL_cqi[1],(((HLC_subband_cqi_rank2_2A_20MHz *)o)->diffcqi2));
stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_20MHz *)o)->pmi;
break;
case HLC_subband_cqi_mcs_CBA:
if ((*crnti == ((HLC_subband_cqi_mcs_CBA_20MHz *)o)->crnti) && (*crnti !=0)){
*access_mode=CBA_ACCESS;
LOG_N(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
((HLC_subband_cqi_mcs_CBA_20MHz *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_20MHz *)o)->crnti);
} else {
LOG_D(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
*crnti, ((HLC_subband_cqi_mcs_CBA_20MHz *)o)->crnti);
}
break;
case unknown_cqi:
default:
LOG_N(PHY,"[eNB][UCI] received unknown uci (RB %d)\n",N_RB_DL);
break;
}
break;
default:
LOG_N(PHY,"[eNB][UCI] unknown RB %d\n",N_RB_DL);
break;
}
......
......@@ -256,7 +256,7 @@ uint32_t ulsch_encoding(uint8_t *a,
sinr_eff = 0;
*/
rnti = phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti;
fill_CQI(ulsch,meas,0,phy_vars_ue->lte_frame_parms.N_RB_DL,rnti, tmode,phy_vars_ue->sinr_eff);
fill_CQI(ulsch,meas,0,harq_pid,phy_vars_ue->lte_frame_parms.N_RB_DL,rnti, tmode,phy_vars_ue->sinr_eff);
LOG_D(PHY,"UE CQI\n");
print_CQI(ulsch->o,ulsch->uci_format,0,phy_vars_ue->lte_frame_parms.N_RB_DL);
......@@ -884,7 +884,7 @@ int ulsch_encoding_emul(uint8_t *ulsch_buffer,
uint8_t harq_pid,
uint8_t control_only_flag) {
LTE_UE_ULSCH_t *ulsch = phy_vars_ue->ulsch_ue[eNB_id];
LTE_UE_ULSCH_t *ulsch = phy_vars_ue->ulsch_ue[eNB_id];
LTE_UE_DLSCH_t **dlsch = phy_vars_ue->dlsch_ue[eNB_id];
PHY_MEASUREMENTS *meas = &phy_vars_ue->PHY_measurements;
uint8_t tmode = phy_vars_ue->transmission_mode[eNB_id];
......@@ -901,7 +901,7 @@ int ulsch_encoding_emul(uint8_t *ulsch_buffer,
sinr_eff = meas->wideband_cqi_avg[eNB_id];
*/
fill_CQI(ulsch,meas,eNB_id,phy_vars_ue->lte_frame_parms.N_RB_DL,rnti,tmode,phy_vars_ue->sinr_eff);
fill_CQI(ulsch,meas,eNB_id,harq_pid,phy_vars_ue->lte_frame_parms.N_RB_DL,rnti,tmode,phy_vars_ue->sinr_eff);
//LOG_D(PHY,"UE CQI\n");
// print_CQI(ulsch->o,ulsch->uci_format,eNB_id);
......
......@@ -323,10 +323,12 @@ typedef struct {
#define NUMBER_OF_HARQ_PID_MAX 8
#if defined(CBMIMO1) || defined(EXMIMO)
#define MAX_FRAME_NUMBER 0x400
#define NUMBER_OF_eNB_MAX 1
#define NUMBER_OF_UE_MAX 2
#define NUMBER_OF_CONNECTED_eNB_MAX 3
#else
#define MAX_FRAME_NUMBER 0xFFFF
#ifdef LARGE_SCALE
#define NUMBER_OF_eNB_MAX 2
#define NUMBER_OF_UE_MAX 120
......
......@@ -50,9 +50,6 @@ enum THREAD_INDEX { OPENAIR_THREAD_INDEX = 0,
#define OPENAIR_THREAD_STACK_SIZE 8192 //4096 //RTL_PTHREAD_STACK_MIN*6
//#define DLC_THREAD_STACK_SIZE 4096 //DLC stack size
enum openair_SCHED_STATUS {
openair_SCHED_STOPPED=1,
openair_SCHED_STARTING,
......
......@@ -376,7 +376,7 @@ uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,
else if (harq_ack[6].send_harq_status == 1)
o_ACK[0] = harq_ack[6].ack;
status = harq_ack[5].send_harq_status + (harq_ack[6].send_harq_status<<1);
printf("Subframe 2, TDD config 3: harq_ack[5] = %d (%d),harq_ack[6] = %d (%d)\n",harq_ack[5].ack,harq_ack[5].send_harq_status,harq_ack[6].ack,harq_ack[6].send_harq_status);
//printf("Subframe 2, TDD config 3: harq_ack[5] = %d (%d),harq_ack[6] = %d (%d)\n",harq_ack[5].ack,harq_ack[5].send_harq_status,harq_ack[6].ack,harq_ack[6].send_harq_status);
}
else if (subframe == 3) { // ACK subframes 7 and 8
if (harq_ack[7].send_harq_status == 1) {
......@@ -388,7 +388,7 @@ uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,
o_ACK[0] = harq_ack[8].ack;
status = harq_ack[7].send_harq_status + (harq_ack[8].send_harq_status<<1);
printf("Subframe 3, TDD config 3: harq_ack[7] = %d,harq_ack[8] = %d\n",harq_ack[7].ack,harq_ack[8].ack);
//printf("Subframe 3, TDD config 3: harq_ack[7] = %d,harq_ack[8] = %d\n",harq_ack[7].ack,harq_ack[8].ack);
//printf("status %d : o_ACK (%d,%d)\n", status,o_ACK[0],o_ACK[1]);
}
else if (subframe == 4) { // ACK subframes 9 and 0
......@@ -401,7 +401,7 @@ uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,
o_ACK[0] = harq_ack[8].ack;
status = harq_ack[9].send_harq_status + (harq_ack[0].send_harq_status<<1);
printf("Subframe 4, TDD config 3: harq_ack[9] = %d,harq_ack[0] = %d\n",harq_ack[9].ack,harq_ack[0].ack);
//printf("Subframe 4, TDD config 3: harq_ack[9] = %d,harq_ack[0] = %d\n",harq_ack[9].ack,harq_ack[0].ack);
}
else {
LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe %d for tdd_config %d\n",
......
......@@ -275,7 +275,7 @@ int get_ue_active_harq_pid(uint8_t Mod_id,uint8_t CC_id,uint16_t rnti,int frame,
ulsch_frame,
ulsch_subframe);
*round = ULSCH_ptr->harq_processes[*harq_pid]->round;
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Checking HARQ, round %d\n",Mod_id,*harq_pid,frame,subframe,*round);
LOG_T(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Checking HARQ, round %d\n",Mod_id,*harq_pid,frame,subframe,*round);
}
return(0);
}
......@@ -2990,7 +2990,11 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
//if (((phy_vars_eNB->proc[sched_subframe].frame_tx%10) == 0) || (phy_vars_eNB->proc[sched_subframe].frame_tx < 50))
print_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,0,phy_vars_eNB->lte_frame_parms.N_RB_DL);
#endif
extract_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,&phy_vars_eNB->eNB_UE_stats[i], &rnti, &access_mode);
extract_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,
&phy_vars_eNB->eNB_UE_stats[i],
phy_vars_eNB->lte_frame_parms.N_RB_DL,
&rnti, &access_mode);
phy_vars_eNB->eNB_UE_stats[i].rank = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_RI[0];
}
......@@ -3622,7 +3626,12 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
//if (((phy_vars_eNB->proc[sched_subframe].frame_tx%10) == 0) || (phy_vars_eNB->proc[sched_subframe].frame_tx < 50))
print_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,0,phy_vars_eNB->lte_frame_parms.N_RB_DL);
#endif
extract_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,&phy_vars_eNB->eNB_UE_stats[i], &rnti, &access_mode);
access_mode = UNKNOWN_ACCESS;
extract_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,
&phy_vars_eNB->eNB_UE_stats[i],
phy_vars_eNB->lte_frame_parms.N_RB_DL,
&rnti, &access_mode);
phy_vars_eNB->eNB_UE_stats[i].rank = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_RI[0];
}
/* LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d resetting the sched_subframeuling_flag, total cba groups %d %d\n",
......@@ -3688,17 +3697,23 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
harq_pid,
NULL);
phy_vars_eNB->cba_last_reception[i%num_active_cba_groups]=1;//(subframe);
phy_vars_eNB->cba_last_reception[i%num_active_cba_groups]+=1;//(subframe);
} else {
LOG_N(PHY,"[eNB %d] Frame %d subframe %d : CBA collision detected for UE%d for group %d, set the SR for this UE \n ",
if (phy_vars_eNB->cba_last_reception[i%num_active_cba_groups] == 1 )
LOG_N(PHY,"[eNB%d] Frame %d subframe %d : first CBA collision detected \n ",
phy_vars_eNB->Mod_id,frame,subframe);
LOG_N(PHY,"[eNB%d] Frame %d subframe %d : CBA collision set SR for UE %d in group %d \n ",
phy_vars_eNB->Mod_id,frame,subframe,
i,i%num_active_cba_groups );
phy_vars_eNB->cba_last_reception[i%num_active_cba_groups],i%num_active_cba_groups );
phy_vars_eNB->cba_last_reception[i%num_active_cba_groups]+=1;
mac_xface->SR_indication(phy_vars_eNB->Mod_id,
phy_vars_eNB->CC_id,
frame,
phy_vars_eNB->dlsch_eNB[i][0]->rnti,subframe);
}
}
} // ULSCH CBA not in error
}
......@@ -3941,9 +3956,10 @@ void phy_procedures_eNB_lte(unsigned char subframe,PHY_VARS_eNB **phy_vars_eNB,u
phy_vars_eNB[CC_id]->proc[subframe].frame_tx++;
phy_vars_eNB[CC_id]->proc[subframe].frame_rx++;
if (phy_vars_eNB[CC_id]->proc[subframe].frame_tx==1024)
if (phy_vars_eNB[CC_id]->proc[subframe].frame_tx==MAX_FRAME_NUMBER) // defined in impl_defs_top.h
phy_vars_eNB[CC_id]->proc[subframe].frame_tx=0;
if (phy_vars_eNB[CC_id]->proc[subframe].frame_rx==1024)
if (phy_vars_eNB[CC_id]->proc[subframe].frame_rx==MAX_FRAME_NUMBER)
phy_vars_eNB[CC_id]->proc[subframe].frame_rx=0;
}
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_LTE,0);
......
......@@ -950,58 +950,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
phy_vars_ue->sr[subframe_tx]=0;
}
} // ULSCH is active
else if ((phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->subframe_cba_scheduling_flag == 1) &&
(phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->status == CBA_ACTIVE)) {
phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
// phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->status= IDLE;
first_rb = phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->first_rb;
nb_rb = phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->nb_rb;
input_buffer_length = phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->TBS/8;
access_mode=CBA_ACCESS;
LOG_I(PHY,"[UE %d] Frame %d, subframe %d: CBA num dci %d \n",
Mod_id,frame_tx,subframe_tx,
phy_vars_ue->ulsch_ue[eNB_id]->num_cba_dci[subframe_tx]);
mac_xface->ue_get_sdu(Mod_id,
CC_id,
frame_tx,
subframe_tx,
eNB_id,
ulsch_input_buffer,
input_buffer_length,
&access_mode);
phy_vars_ue->ulsch_ue[eNB_id]->num_cba_dci[subframe_tx]=0;
if (access_mode > UNKNOWN_ACCESS){
if (abstraction_flag==0) {
if (ulsch_encoding(ulsch_input_buffer,
phy_vars_ue,
harq_pid,
eNB_id,
phy_vars_ue->transmission_mode[eNB_id],0,
0)!=0) { // Nbundled, to be updated!!!!
LOG_E(PHY,"ulsch_coding.c: FATAL ERROR: returning\n");
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT);
stop_meas(&phy_vars_ue->phy_proc_tx);
return;
}
}
#ifdef PHY_ABSTRACTION
else {
ulsch_encoding_emul(ulsch_input_buffer,phy_vars_ue,eNB_id,harq_pid,0);
}
#endif
} else {
phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->status= IDLE;
//reset_cba_uci(phy_vars_ue->ulsch_ue[eNB_id]->o);
LOG_N(PHY,"[UE %d] Frame %d, subframe %d: CBA transmission cancelled or postponed\n",
Mod_id, frame_tx,subframe_tx);
}
}
#ifdef PUCCH
else if (phy_vars_ue->UE_mode[eNB_id] == PUSCH){ // check if we need to use PUCCH 1a/1b
// debug_LOG_D(PHY,"[UE%d] Frame %d, subframe %d: Checking for PUCCH 1a/1b\n",Mod_id,frame_tx,subframe_tx);
......@@ -1174,6 +1123,58 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
}
#endif // PUCCH
#ifdef CBA
if ((phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->subframe_cba_scheduling_flag >= 1) &&
(phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->status == CBA_ACTIVE)) {
phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag=0; //-=1
// phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->status= IDLE;
first_rb = phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->first_rb;
nb_rb = phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->nb_rb;
//cba_mcs=phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->mcs;
input_buffer_length = phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->TBS/8;
access_mode=CBA_ACCESS;
LOG_I(PHY,"[UE %d] Frame %d, subframe %d: CBA num dci %d\n",
Mod_id,frame_tx,subframe_tx,
phy_vars_ue->ulsch_ue[eNB_id]->num_cba_dci[subframe_tx]);
mac_xface->ue_get_sdu(Mod_id,
CC_id,
frame_tx,
subframe_tx,
eNB_id,
ulsch_input_buffer,
input_buffer_length,
&access_mode);
phy_vars_ue->ulsch_ue[eNB_id]->num_cba_dci[subframe_tx]=0;
if (access_mode > UNKNOWN_ACCESS){
if (abstraction_flag==0) {
if (ulsch_encoding(ulsch_input_buffer,
phy_vars_ue,
harq_pid,
eNB_id,
phy_vars_ue->transmission_mode[eNB_id],0,
0)!=0) { // Nbundled, to be updated!!!!
LOG_E(PHY,"ulsch_coding.c: FATAL ERROR: returning\n");
return;
}
}
#ifdef PHY_ABSTRACTION
else {
ulsch_encoding_emul(ulsch_input_buffer,phy_vars_ue,eNB_id,harq_pid,0);
}
#endif
} else {
phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->status= IDLE;
//reset_cba_uci(phy_vars_ue->ulsch_ue[eNB_id]->o);
LOG_N(PHY,"[UE %d] Frame %d, subframe %d: CBA transmission cancelled or postponed\n",
Mod_id, frame_tx,subframe_tx);
}
}
#endif // end CBA
if (abstraction_flag == 0) {
if (generate_ul_signal == 1 ) {
......
......@@ -62,7 +62,7 @@
#ifdef JUMBO_FRAME
# define MAX_IP_PACKET_SIZE 9000
# define MAX_IP_PACKET_SIZE 10000 // 9000
#else
# if defined(OAI_NW_DRIVER_TYPE_ETHERNET)
/* SR: When using ethernet network driver the packet size is 1512 :
......
......@@ -118,7 +118,7 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
#endif
) {
int i,CC_id;
int i,CC_id=0;
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
......@@ -442,22 +442,22 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
UE_mac_inst[Mod_id].cba_rnti[num_active_cba_groups-1] = cba_rnti;
LOG_D(MAC,"[UE %d] configure CBA group %d RNTI %x for eNB %d (total active cba group %d)\n",
Mod_id,Mod_id%num_active_cba_groups, cba_rnti,eNB_index,num_active_cba_groups);
mac_xface->phy_config_cba_rnti(Mod_id,eNB_flagP,eNB_index,cba_rnti,num_active_cba_groups-1, num_active_cba_groups);
mac_xface->phy_config_cba_rnti(Mod_id,CC_id,eNB_flagP,eNB_index,cba_rnti,num_active_cba_groups-1, num_active_cba_groups);
}
}else {
if (cba_rnti) {
LOG_D(MAC,"[eNB %d] configure CBA RNTI for UE %d (total active cba groups %d)\n",
Mod_id, UE_id, num_active_cba_groups);
eNB_mac_inst[Mod_id].num_active_cba_groups=num_active_cba_groups;
eNB_mac_inst[Mod_id].common_channels[CC_id].num_active_cba_groups=num_active_cba_groups;
for (i=0; i < num_active_cba_groups; i ++){
if (eNB_mac_inst[Mod_id].cba_rnti[i] != cba_rnti + i)
eNB_mac_inst[Mod_id].cba_rnti[i] = cba_rnti + i;
if (eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] != cba_rnti + i)
eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] = cba_rnti + i;
//only configure UE ids up to num_active_cba_groups
//we use them as candidates for the transmission of dci format0)