Commit 2d68cc0f authored by latif's avatar latif

changes for link adaptation and abstraction

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4150 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent c5196908
This diff is collapsed.
...@@ -693,7 +693,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -693,7 +693,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
LOG_T(PHY,"\n current harq pid is %d ue id %d \n", harq_pid, ue_id); LOG_T(PHY,"\n current harq pid is %d ue id %d \n", harq_pid, ue_id);
#endif #endif
if (dlsch_abstraction_EESM(phy_vars_ue->sinr_dB, phy_vars_ue->transmission_mode[eNB_id], dlsch_eNB->rb_alloc, dlsch_eNB->harq_processes[harq_pid]->mcs,PHY_vars_eNB_g[eNB_id]->mu_mimo_mode[ue_id].dl_pow_off) == 1) { if (dlsch_abstraction_MIESM(phy_vars_ue->sinr_dB, phy_vars_ue->transmission_mode[eNB_id], dlsch_eNB->rb_alloc, dlsch_eNB->harq_processes[harq_pid]->mcs,PHY_vars_eNB_g[eNB_id]->mu_mimo_mode[ue_id].dl_pow_off) == 1) {
// reset HARQ // reset HARQ
dlsch_ue->harq_processes[harq_pid]->status = SCH_IDLE; dlsch_ue->harq_processes[harq_pid]->status = SCH_IDLE;
dlsch_ue->harq_processes[harq_pid]->round = 0; dlsch_ue->harq_processes[harq_pid]->round = 0;
......
...@@ -62,6 +62,8 @@ extern int flag_LA; ...@@ -62,6 +62,8 @@ extern int flag_LA;
extern double sinr_bler_map[MCS_COUNT][2][20]; extern double sinr_bler_map[MCS_COUNT][2][20];
extern double sinr_bler_map_up[MCS_COUNT][2][16]; extern double sinr_bler_map_up[MCS_COUNT][2][16];
extern int table_length[MCS_COUNT]; extern int table_length[MCS_COUNT];
extern double sinr_to_cqi[4][16];
extern int cqi_to_mcs[16];
//for MU-MIMO abstraction using MIESM //for MU-MIMO abstraction using MIESM
//this 2D arrarays contains SINR, MI and RBIR in rows 1, 2, and 3 respectively //this 2D arrarays contains SINR, MI and RBIR in rows 1, 2, and 3 respectively
......
This diff is collapsed.
...@@ -773,7 +773,7 @@ int main(int argc, char **argv) { ...@@ -773,7 +773,7 @@ int main(int argc, char **argv) {
forgetting_factor, forgetting_factor,
rx_sample_offset, rx_sample_offset,
0); 0);
if(abstx==1){ if(abstx==1 && num_rounds>1){
for(n=1;n<4;n++) for(n=1;n<4;n++)
eNB2UE[n] = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx, eNB2UE[n] = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
PHY_vars_UE->lte_frame_parms.nb_antennas_rx, PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
...@@ -1655,7 +1655,7 @@ int main(int argc, char **argv) { ...@@ -1655,7 +1655,7 @@ int main(int argc, char **argv) {
multipath_channel(eNB2UE[0],s_re,s_im,r_re,r_im, multipath_channel(eNB2UE[0],s_re,s_im,r_re,r_im,
2*frame_parms->samples_per_tti,hold_channel); 2*frame_parms->samples_per_tti,hold_channel);
// printf("amc: ****************** eNB2UE[%d]->n_rx = %d,dd %d\n",round,eNB2UE[round]->nb_rx,eNB2UE[round]->channel_offset); // printf("amc: ****************** eNB2UE[%d]->n_rx = %d,dd %d\n",round,eNB2UE[round]->nb_rx,eNB2UE[round]->channel_offset);
if(abstx==1) if(abstx==1 && num_rounds>1)
if(round==0 && hold_channel==0){ if(round==0 && hold_channel==0){
random_channel(eNB2UE[1]); random_channel(eNB2UE[1]);
random_channel(eNB2UE[2]); random_channel(eNB2UE[2]);
...@@ -1682,7 +1682,7 @@ int main(int argc, char **argv) { ...@@ -1682,7 +1682,7 @@ int main(int argc, char **argv) {
} }
} }
if(num_rounds>2){ if(num_rounds>1){
freq_channel(eNB2UE[1], NB_RB,2*NB_RB + 1); freq_channel(eNB2UE[1], NB_RB,2*NB_RB + 1);
for (u=0;u<2*NB_RB;u++){ for (u=0;u<2*NB_RB;u++){
......
...@@ -58,12 +58,6 @@ ...@@ -58,12 +58,6 @@
//#include "LAYER2/MAC/pre_processor.c" //#include "LAYER2/MAC/pre_processor.c"
#include "pdcp.h" #include "pdcp.h"
double snr_mcs[28]={-4.1130, -3.3830, -2.8420, -2.0480, -1.3230, -0.6120, 0.1080, 0.977, 1.7230, 2.7550, 3.1960, 3.8080, 4.6870, 5.6840, 6.6550, 7.7570, 8.3730, 9.3040, 9.5990, 10.9020, 11.7220, 12.5950, 13.4390, 14.8790, 15.8800, 16.4800, 17.8690, 18.7690};
int cqi_mcs[3][16] = {{0, 0, 0, 2, 4, 6, 8, 11, 13, 15, 18, 20, 22, 25, 27, 27},{0, 0, 0, 2, 4, 6, 8, 11, 13, 15, 18, 20, 22, 25, 27, 27},{0, 0, 0, 2, 4, 6, 8, 11, 13, 15, 18, 19, 22, 24, 26, 27}};
double cqi_snr[16] = {-8, -7, -6.08, -5.252, -3.956, -2.604, -1.107, 0.87, 2.599, 4.79, 6.716, 8, 10.593, 13.286, 15.745, 18.5};
double snr_tm6=0;
#define ENABLE_MAC_PAYLOAD_DEBUG #define ENABLE_MAC_PAYLOAD_DEBUG
#define DEBUG_eNB_SCHEDULER 1 #define DEBUG_eNB_SCHEDULER 1
//#define DEBUG_HEADER_PARSING 1 //#define DEBUG_HEADER_PARSING 1
...@@ -3473,88 +3467,8 @@ void schedule_ue_spec(unsigned char Mod_id, ...@@ -3473,88 +3467,8 @@ void schedule_ue_spec(unsigned char Mod_id,
//eNB_UE_stats->dlsch_mcs1 = openair_daq_vars.target_ue_dl_mcs; //eNB_UE_stats->dlsch_mcs1 = openair_daq_vars.target_ue_dl_mcs;
// int flag_LA=0; // int flag_LA=0;
//printf("CQI %d\n",eNB_UE_stats->DL_cqi[0]); //printf("CQI %d\n",eNB_UE_stats->DL_cqi[0]);
if (flag_LA==0){
switch(eNB_UE_stats->DL_cqi[0]) { eNB_UE_stats->dlsch_mcs1 = cqi_to_mcs[eNB_UE_stats->DL_cqi[0]];
case 0:
eNB_UE_stats->dlsch_mcs1 = 0;
break;
case 1:
eNB_UE_stats->dlsch_mcs1 = 0;
break;
case 2:
eNB_UE_stats->dlsch_mcs1 = 0;
break;
case 3:
eNB_UE_stats->dlsch_mcs1 = 2;
break;
case 4:
eNB_UE_stats->dlsch_mcs1 = 4;
break;
case 5:
eNB_UE_stats->dlsch_mcs1 = 6;
break;
case 6:
eNB_UE_stats->dlsch_mcs1 = 8;
break;
case 7:
eNB_UE_stats->dlsch_mcs1 = 11;
break;
case 8:
eNB_UE_stats->dlsch_mcs1 = 13;
break;
case 9:
eNB_UE_stats->dlsch_mcs1 = 16;
break;
case 10:
eNB_UE_stats->dlsch_mcs1 = 18;
break;
case 11:
eNB_UE_stats->dlsch_mcs1 = 20;
break;
case 12:
eNB_UE_stats->dlsch_mcs1 = 22;
break;
case 13:
eNB_UE_stats->dlsch_mcs1 = 22;//25
break;
case 14:
eNB_UE_stats->dlsch_mcs1 = 22;//27
break;
case 15:
eNB_UE_stats->dlsch_mcs1 = 22;//28
break;
default:
LOG_E(MAC,"Invalid CQI");
exit(-1);
}
}
else {
// begin CQI to MCS mapping
if(mac_xface->get_transmission_mode(Mod_id,rnti)==1)
eNB_UE_stats->dlsch_mcs1 = cqi_mcs[0][eNB_UE_stats->DL_cqi[0]];
else
if(mac_xface->get_transmission_mode(Mod_id,rnti)==2)
eNB_UE_stats->dlsch_mcs1 = cqi_mcs[1][eNB_UE_stats->DL_cqi[0]];
else
if(mac_xface->get_transmission_mode(Mod_id,rnti)==6 || mac_xface->get_transmission_mode(Mod_id,rnti)==5)
eNB_UE_stats->dlsch_mcs1 = cqi_mcs[2][eNB_UE_stats->DL_cqi[0]];
// end CQI Mapping
// if MUMIMO is enabled with two UEs then adjust the CQI and MCS mapping
if(mac_xface->get_transmission_mode(Mod_id,rnti)==5 && dl_pow_off[UE_id]==0){
snr_tm6 = cqi_snr[eNB_UE_stats->DL_cqi[0]];
if (snr_tm6<snr_mcs[0])
eNB_UE_stats->dlsch_mcs1 = 0;
else
if(snr_tm6>snr_mcs[27])
eNB_UE_stats->dlsch_mcs1 = 27;
else
for (i=0;i<27;i++){
if(snr_tm6 > snr_mcs[i] && snr_tm6 < snr_mcs[i+1])
eNB_UE_stats->dlsch_mcs1 = i;
}
}
}
if(eNB_UE_stats->dlsch_mcs1>22) if(eNB_UE_stats->dlsch_mcs1>22)
eNB_UE_stats->dlsch_mcs1=22; eNB_UE_stats->dlsch_mcs1=22;
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
<PATHLOSS_EXPONENT>3.67</PATHLOSS_EXPONENT> <PATHLOSS_EXPONENT>3.67</PATHLOSS_EXPONENT>
<PATHLOSS_0_dB>-128</PATHLOSS_0_dB><!--pathloss at 1km --> <PATHLOSS_0_dB>-128</PATHLOSS_0_dB><!--pathloss at 1km -->
</FREE_SPACE_MODEL_PARAMETERS> </FREE_SPACE_MODEL_PARAMETERS>
<SMALL_SCALE>Rayleigh8</SMALL_SCALE> <SMALL_SCALE>Rayleigh1</SMALL_SCALE>
</FADING> </FADING>
<SYSTEM_BANDWIDTH_MB>7.68</SYSTEM_BANDWIDTH_MB> <SYSTEM_BANDWIDTH_MB>7.68</SYSTEM_BANDWIDTH_MB>
<SYSTEM_FREQUENCY_GHz>1.9</SYSTEM_FREQUENCY_GHz> <SYSTEM_FREQUENCY_GHz>1.9</SYSTEM_FREQUENCY_GHz>
<TRANSMISSION_MODE>2</TRANSMISSION_MODE> <!-- validavalue: 1, 2, 5, 6 --> <TRANSMISSION_MODE>6</TRANSMISSION_MODE> <!-- validavalue: 1, 2, 5, 6 -->
<ANTENNA> <ANTENNA>
<eNB_ANTENNA> <eNB_ANTENNA>
<RX_NOISE_LEVEL_dB>0</RX_NOISE_LEVEL_dB> <RX_NOISE_LEVEL_dB>0</RX_NOISE_LEVEL_dB>
......
...@@ -110,7 +110,7 @@ void get_simulation_options(int argc, char *argv[]) { ...@@ -110,7 +110,7 @@ void get_simulation_options(int argc, char *argv[]) {
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
while ((c = getopt_long (argc, argv, "aA:b:B:c:C:D:d:eE:f:FGg:hi:j:IJ:k:l:m:M:n:N:oO:p:P:rR:s:S:Q:t:T:u:U:vVx:y:w:W:X:z:Z:", long_options, &option_index)) != -1) { while ((c = getopt_long (argc, argv, "aA:b:B:c:C:D:d:eE:f:FGg:hi:IJ:k:L:l:m:M:n:N:oO:p:P:rR:s:S:t:T:u:U:vVx:y:w:W:X:z:Z:", long_options, &option_index)) != -1) {
switch (c) { switch (c) {
case 0: case 0:
if (! strcmp(long_options[option_index].name, "pdcp_period")) { if (! strcmp(long_options[option_index].name, "pdcp_period")) {
...@@ -567,14 +567,13 @@ void init_ocm() { ...@@ -567,14 +567,13 @@ void init_ocm() {
s32 UE_id, eNB_id; s32 UE_id, eNB_id;
/* Added for PHY abstraction */ /* Added for PHY abstraction */
if (abstraction_flag) { if (abstraction_flag) {
if (0) { //the values of beta and awgn tables are hard coded in PHY/vars.h
get_beta_map(); get_beta_map();
#ifdef PHY_ABSTRACTION_UL #ifdef PHY_ABSTRACTION_UL
get_beta_map_up(); get_beta_map_up();
#endif #endif
get_MIESM_param(); get_MIESM_param();
} }
}
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) { for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
enb_data[eNB_id] = (node_desc_t *)malloc(sizeof(node_desc_t)); enb_data[eNB_id] = (node_desc_t *)malloc(sizeof(node_desc_t));
......
function plot_results(tm) function plot_results(tm)
data_abs = dlmread(sprintf('eNB_stats_abs_th_tx%d.txt',tm)); data_abs = dlmread(sprintf('UE_stats_abs_th0_tx%d.txt',tm));
data = dlmread(sprintf('eNB_stats_th_tx%d.txt',tm)); data = dlmread(sprintf('UE_stats_th0_tx%d.txt',tm));
figure figure
plot(data(:,1),data(:,2)) plot(data(:,1),data(:,2))
hold on hold on
......
...@@ -495,16 +495,17 @@ void calculate_sinr(channel_desc_t* eNB2UE, node_desc_t *enb_data, node_desc_t * ...@@ -495,16 +495,17 @@ void calculate_sinr(channel_desc_t* eNB2UE, node_desc_t *enb_data, node_desc_t *
void get_beta_map() { void get_beta_map() {
char *file_path = NULL; char *file_path = NULL;
//int table_len = 0; //int table_len = 0;
int t; int t,u;
int mcs = 0; int mcs = 0;
char *sinr_bler; char *sinr_bler;
char buffer[1000]; char buffer[1000];
FILE *fp; FILE *fp;
double perf_array[13];
file_path = (char*) malloc(512); file_path = (char*) malloc(512);
for (mcs = 0; mcs < MCS_COUNT; mcs++) { for (mcs = 0; mcs < MCS_COUNT; mcs++) {
sprintf(file_path,"%s/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/awgn_abst/awgn_snr_bler_mcs%d.csv",getenv("OPENAIR1_DIR"),mcs); sprintf(file_path,"%s/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/Perf_Curves_Abs/awgn_bler_tx1_mcs%d.csv",getenv("OPENAIR1_DIR"),mcs);
fp = fopen(file_path,"r"); fp = fopen(file_path,"r");
if (fp == NULL) { if (fp == NULL) {
LOG_W(OCM,"ERROR: Unable to open the file %s, try an alternative path\n", file_path); LOG_W(OCM,"ERROR: Unable to open the file %s, try an alternative path\n", file_path);
...@@ -518,21 +519,32 @@ void get_beta_map() { ...@@ -518,21 +519,32 @@ void get_beta_map() {
} }
} }
// else { // else {
fgets(buffer, 1000, fp);
fgets(buffer, 1000, fp); fgets(buffer, 1000, fp);
table_length[mcs]=0; table_length[mcs]=0;
while (!feof(fp)) { while (!feof(fp)) {
sinr_bler = strtok(buffer, ","); u=0;
sinr_bler_map[mcs][0][table_length[mcs]] = atof(sinr_bler); sinr_bler = strtok(buffer, ";");
sinr_bler = strtok(NULL,","); while(sinr_bler != NULL){
sinr_bler_map[mcs][1][table_length[mcs]] = atof(sinr_bler); perf_array[u]=atof(sinr_bler);
u++;
sinr_bler = strtok(NULL,";");
}
if((perf_array[4]/perf_array[5]) < 1){
sinr_bler_map[mcs][0][table_length[mcs]] = perf_array[0];
sinr_bler_map[mcs][1][table_length[mcs]] = (perf_array[4]/perf_array[5]);
table_length[mcs]++; table_length[mcs]++;
}
fgets(buffer, 1000, fp); fgets(buffer, 1000, fp);
} }
fclose(fp); fclose(fp);
// } // }
LOG_D(OCM,"Print the table for mcs %d\n",mcs); // LOG_D(OCM,"Print the table for mcs %d\n",mcs);
printf("Print the table for mcs %d\n",mcs);
for (t = 0; t<table_length[mcs]; t++) for (t = 0; t<table_length[mcs]; t++)
LOG_D(OCM,"%lf %lf \n ",sinr_bler_map[mcs][0][t],sinr_bler_map[mcs][1][t]); // LOG_D(OCM,"%lf %lf \n ",sinr_bler_map[mcs][0][t],sinr_bler_map[mcs][1][t]);
printf("%lf %lf \n ",sinr_bler_map[mcs][0][t],sinr_bler_map[mcs][1][t]);
} }
free(file_path); free(file_path);
} }
......
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