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,
LOG_T(PHY,"\n current harq pid is %d ue id %d \n", harq_pid, ue_id);
#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
dlsch_ue->harq_processes[harq_pid]->status = SCH_IDLE;
dlsch_ue->harq_processes[harq_pid]->round = 0;
......
......@@ -356,7 +356,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
frame_parms,
dlsch_ue,
symbol,
nb_rb);
nb_rb);
/* compute new log2_maxh for effective channel */
if (first_symbol_flag==1) {
......
......@@ -62,6 +62,8 @@ extern int flag_LA;
extern double sinr_bler_map[MCS_COUNT][2][20];
extern double sinr_bler_map_up[MCS_COUNT][2][16];
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
//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) {
forgetting_factor,
rx_sample_offset,
0);
if(abstx==1){
if(abstx==1 && num_rounds>1){
for(n=1;n<4;n++)
eNB2UE[n] = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
......@@ -1655,7 +1655,7 @@ int main(int argc, char **argv) {
multipath_channel(eNB2UE[0],s_re,s_im,r_re,r_im,
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);
if(abstx==1)
if(abstx==1 && num_rounds>1)
if(round==0 && hold_channel==0){
random_channel(eNB2UE[1]);
random_channel(eNB2UE[2]);
......@@ -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);
for (u=0;u<2*NB_RB;u++){
......@@ -2422,7 +2422,7 @@ int main(int argc, char **argv) {
}
} //ABStraction
if(num_rounds==1){
if(num_rounds==1){
bler= (double)errs[0]/(round_trials[0]);
if (bler<1)
{snr_step = input_snr_step; saving_bler = 0;}
......
......@@ -58,12 +58,6 @@
//#include "LAYER2/MAC/pre_processor.c"
#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 DEBUG_eNB_SCHEDULER 1
//#define DEBUG_HEADER_PARSING 1
......@@ -3473,90 +3467,10 @@ void schedule_ue_spec(unsigned char Mod_id,
//eNB_UE_stats->dlsch_mcs1 = openair_daq_vars.target_ue_dl_mcs;
// int flag_LA=0;
//printf("CQI %d\n",eNB_UE_stats->DL_cqi[0]);
if (flag_LA==0){
switch(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)
eNB_UE_stats->dlsch_mcs1 = cqi_to_mcs[eNB_UE_stats->DL_cqi[0]];
if(eNB_UE_stats->dlsch_mcs1>22)
eNB_UE_stats->dlsch_mcs1=22;
......
......@@ -6,11 +6,11 @@
<PATHLOSS_EXPONENT>3.67</PATHLOSS_EXPONENT>
<PATHLOSS_0_dB>-128</PATHLOSS_0_dB><!--pathloss at 1km -->
</FREE_SPACE_MODEL_PARAMETERS>
<SMALL_SCALE>Rayleigh8</SMALL_SCALE>
<SMALL_SCALE>Rayleigh1</SMALL_SCALE>
</FADING>
<SYSTEM_BANDWIDTH_MB>7.68</SYSTEM_BANDWIDTH_MB>
<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>
<eNB_ANTENNA>
<RX_NOISE_LEVEL_dB>0</RX_NOISE_LEVEL_dB>
......
......@@ -110,7 +110,7 @@ void get_simulation_options(int argc, char *argv[]) {
{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) {
case 0:
if (! strcmp(long_options[option_index].name, "pdcp_period")) {
......@@ -567,14 +567,13 @@ void init_ocm() {
s32 UE_id, eNB_id;
/* Added for PHY abstraction */
if (abstraction_flag) {
if (0) { //the values of beta and awgn tables are hard coded in PHY/vars.h
get_beta_map();
#ifdef PHY_ABSTRACTION_UL
get_beta_map_up();
#endif
get_MIESM_param();
}
}
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
enb_data[eNB_id] = (node_desc_t *)malloc(sizeof(node_desc_t));
......
function plot_results(tm)
data_abs = dlmread(sprintf('eNB_stats_abs_th_tx%d.txt',tm));
data = dlmread(sprintf('eNB_stats_th_tx%d.txt',tm));
data_abs = dlmread(sprintf('UE_stats_abs_th0_tx%d.txt',tm));
data = dlmread(sprintf('UE_stats_th0_tx%d.txt',tm));
figure
plot(data(:,1),data(:,2))
hold on
......@@ -54,4 +54,4 @@ hold off
%ylabel('Throughput [kbps]')
%legend('Full PHY','PHY ABSTRACTION')
%hold off
%end
\ No newline at end of file
%end
......@@ -495,16 +495,17 @@ void calculate_sinr(channel_desc_t* eNB2UE, node_desc_t *enb_data, node_desc_t *
void get_beta_map() {
char *file_path = NULL;
//int table_len = 0;
int t;
int t,u;
int mcs = 0;
char *sinr_bler;
char buffer[1000];
FILE *fp;
double perf_array[13];
file_path = (char*) malloc(512);
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");
if (fp == NULL) {
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() {
}
}
// else {
fgets(buffer, 1000, fp);
fgets(buffer, 1000, fp);
table_length[mcs]=0;
while (!feof(fp)) {
sinr_bler = strtok(buffer, ",");
sinr_bler_map[mcs][0][table_length[mcs]] = atof(sinr_bler);
sinr_bler = strtok(NULL,",");
sinr_bler_map[mcs][1][table_length[mcs]] = atof(sinr_bler);
table_length[mcs]++;
fgets(buffer, 1000, fp);
u=0;
sinr_bler = strtok(buffer, ";");
while(sinr_bler != NULL){
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]++;
}
fgets(buffer, 1000, 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++)
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);
}
......
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