Commit d7db5cdd authored by Xiwen JIANG's avatar Xiwen JIANG

merge ue_spec beamforming and cell_spec beamforming to beam_precoding

parent b1f64b22
...@@ -1235,7 +1235,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1235,7 +1235,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB,
LTE_eNB_PUSCH** const eNB_pusch_vars = phy_vars_eNB->lte_eNB_pusch_vars; LTE_eNB_PUSCH** const eNB_pusch_vars = phy_vars_eNB->lte_eNB_pusch_vars;
LTE_eNB_SRS* const eNB_srs_vars = phy_vars_eNB->lte_eNB_srs_vars; LTE_eNB_SRS* const eNB_srs_vars = phy_vars_eNB->lte_eNB_srs_vars;
LTE_eNB_PRACH* const eNB_prach_vars = &phy_vars_eNB->lte_eNB_prach_vars; LTE_eNB_PRACH* const eNB_prach_vars = &phy_vars_eNB->lte_eNB_prach_vars;
int i, j, eNB_id, UE_id; int i, j, re, eNB_id, UE_id;
phy_vars_eNB->total_dlsch_bitrate = 0; phy_vars_eNB->total_dlsch_bitrate = 0;
phy_vars_eNB->total_transmitted_bits = 0; phy_vars_eNB->total_transmitted_bits = 0;
...@@ -1302,7 +1302,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1302,7 +1302,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB,
#endif #endif
} }
for (i=0; i<2; i++) { // 2 is the total number of cell specific antenna ports /*for (i=0; i<2; i++) { // 2 is the total number of cell specific antenna ports
eNB_common_vars->cell_spec_bf_weights[eNB_id][i] = (int32_t **)malloc16_clear(frame_parms->nb_antennas_tx*sizeof(int32_t*)); eNB_common_vars->cell_spec_bf_weights[eNB_id][i] = (int32_t **)malloc16_clear(frame_parms->nb_antennas_tx*sizeof(int32_t*));
for (j=0; j<frame_parms->nb_antennas_tx; j++) { for (j=0; j<frame_parms->nb_antennas_tx; j++) {
eNB_common_vars->cell_spec_bf_weights[eNB_id][i][j] = (int32_t *)malloc16_clear(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t)); eNB_common_vars->cell_spec_bf_weights[eNB_id][i][j] = (int32_t *)malloc16_clear(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
...@@ -1310,11 +1310,25 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1310,11 +1310,25 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB,
msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->cell_spec_bf_weights[%d][%d][%d] = %p (%d bytes)\n", msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->cell_spec_bf_weights[%d][%d][%d] = %p (%d bytes)\n",
eNB_id,i,j,eNB_common_vars->cell_spec_bf_weights[eNB_id][i][j], eNB_id,i,j,eNB_common_vars->cell_spec_bf_weights[eNB_id][i][j],
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t)); OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
#endif
}
} */
for (i=0; i<15; i++) { // 15 is the total number of antenna ports
eNB_common_vars->beam_weights[eNB_id][i] = (int32_t **)malloc16_clear(frame_parms->nb_antennas_tx*sizeof(int32_t*));
for (j=0; j<frame_parms->nb_antennas_tx; j++) {
eNB_common_vars->beam_weights[eNB_id][i][j] = (int32_t *)malloc16_clear(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
for (re=0; re<OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; re++)
eNB_common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff;
#ifdef DEBUG_PUY
msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->beam_weights[%d][%d][%d] = %p (%d bytes)\n",
eNB_id,i,j,eNB_common_vars->beam_weights[eNB_id][i][j],
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
#endif #endif
} }
} }
for (i=0; i<8; i++) { //antenna port 5 for TM7, antenna port 7-15 for TM8-10 /*for (i=0; i<8; i++) { //antenna port 5 for TM7, antenna port 7-15 for TM8-10
eNB_common_vars->ue_spec_bf_weights[eNB_id][i] = (int32_t **)malloc16_clear(frame_parms->nb_antennas_tx*sizeof(int32_t*)); eNB_common_vars->ue_spec_bf_weights[eNB_id][i] = (int32_t **)malloc16_clear(frame_parms->nb_antennas_tx*sizeof(int32_t*));
for (j=0; j<frame_parms->nb_antennas_tx; j++) { for (j=0; j<frame_parms->nb_antennas_tx; j++) {
eNB_common_vars->ue_spec_bf_weights[eNB_id][i][j] = (int32_t*)malloc16_clear(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t)); eNB_common_vars->ue_spec_bf_weights[eNB_id][i][j] = (int32_t*)malloc16_clear(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
...@@ -1324,7 +1338,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1324,7 +1338,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB,
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t)); OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
#endif #endif
} }
} } */
// RX vars // RX vars
eNB_common_vars->rxdata[eNB_id] = (int32_t**)malloc16(frame_parms->nb_antennas_rx*sizeof(int32_t*) ); eNB_common_vars->rxdata[eNB_id] = (int32_t**)malloc16(frame_parms->nb_antennas_rx*sizeof(int32_t*) );
......
...@@ -1446,7 +1446,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, ...@@ -1446,7 +1446,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
// mapping ue specific beamforming weights from UE specified DLSCH structure to common space // mapping ue specific beamforming weights from UE specified DLSCH structure to common space
for (aa=0;aa<frame_parms->nb_antennas_tx;aa++){ for (aa=0;aa<frame_parms->nb_antennas_tx;aa++){
memcpy(phy_vars_eNB->lte_eNB_common_vars.ue_spec_bf_weights[0][0][aa],dlsch0->ue_spec_bf_weights[0][aa],frame_parms->ofdm_symbol_size*sizeof(int32_t)); memcpy(phy_vars_eNB->lte_eNB_common_vars.beam_weights[0][5][aa],dlsch0->ue_spec_bf_weights[0][aa],frame_parms->ofdm_symbol_size*sizeof(int32_t));
} }
} }
......
...@@ -46,12 +46,10 @@ Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 069 ...@@ -46,12 +46,10 @@ Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 069
#include "defs.h" #include "defs.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
int beam_precoding(int32_t **txdataF,
// ue_spec_beamforming: perform beamforming for data in transmission_mode TM7-TM10
int ue_spec_beamforming(int32_t **txdataF,
int32_t **txdataF_BF, int32_t **txdataF_BF,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
int32_t ***ue_spec_bf_weights, int32_t ***beam_weights,
int slot, int slot,
int symbol) int symbol)
{ {
...@@ -66,149 +64,58 @@ int ue_spec_beamforming(int32_t **txdataF, ...@@ -66,149 +64,58 @@ int ue_spec_beamforming(int32_t **txdataF,
memset(txdataF_BF[aa],0,4*(frame_parms->ofdm_symbol_size)); memset(txdataF_BF[aa],0,4*(frame_parms->ofdm_symbol_size));
for (re=0;re<frame_parms->ofdm_symbol_size;re++) { for (re=0;re<frame_parms->ofdm_symbol_size;re++) {
if (txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re]!=0) { //that means this RE is actually using TM7 for (p=0; p<2; p++) {
if (txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re]!=0) {
for (aa=0;aa<frame_parms->nb_antennas_tx;aa++) { for (aa=0;aa<frame_parms->nb_antennas_tx;aa++) {
((int16_t*)&txdataF_BF[aa][re])[0] = (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0] ((int16_t*)&txdataF_BF[aa][re])[0] = (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
*((int16_t*)&ue_spec_bf_weights[0][aa][re])[0])>>15); ((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1] ((int16_t*)&txdataF_BF[aa][re])[1] = (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
*((int16_t*)&ue_spec_bf_weights[0][aa][re])[1])>>15); ((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[0][aa][re])[0])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] = (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]
*((int16_t*)&ue_spec_bf_weights[0][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]
*((int16_t*)&ue_spec_bf_weights[0][aa][re])[0])>>15);
/* printf("beamforming.c:txdataF[5][%d]=%d+j%d, ue_bf_weights[0][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n",
slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re,
((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0],
((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1],
aa,re,
((int16_t*)&ue_spec_bf_weights[0][aa][re])[0],((int16_t*)&ue_spec_bf_weights[0][aa][re])[1],
aa,re,
((int16_t*)&txdataF_BF[aa][re])[0],
((int16_t*)&txdataF_BF[aa][re])[1]); */
}
}
if (txdataF[7][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re]!=0) { //that means this RE is actually using TM8-10 //printf("beamforming.c:txdata[%d][%d]=%d+j%d, beam_weights[%d][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n",
for (p=0;p<8;p++) { // p,slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re,
if (txdataF[p+7][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re]!=0) { //that means this RE is actually allocated // ((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0],
for (aa=0;aa<frame_parms->nb_antennas_tx;aa++) { // ((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1],
((int16_t*)&txdataF_BF[aa][re])[0] = (int16_t)((((int16_t*)&txdataF[p+7][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0] // p,aa,re,
*((int16_t*)&ue_spec_bf_weights[p][aa][re])[0])>>15); // ((int16_t*)&beam_weights[p][aa][re])[0],((int16_t*)&beam_weights[p][aa][re])[1],
((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[p+7][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1] // aa,re,
*((int16_t*)&ue_spec_bf_weights[p][aa][re])[1])>>15); // ((int16_t*)&txdataF_BF[aa][re])[0],
((int16_t*)&txdataF_BF[aa][re])[1] = (int16_t)((((int16_t*)&txdataF[p+7][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0] // ((int16_t*)&txdataF_BF[aa][re])[1]);
*((int16_t*)&ue_spec_bf_weights[p][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p+7][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]
*((int16_t*)&ue_spec_bf_weights[p][aa][re])[0])>>15);
}
}
} }
} }
} }
} if (txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re]!=0) { //that means this RE is actually using TM7
// cell_spec_beamforming: performed for all common data
int cell_spec_beamforming(int32_t **txdataF,
int32_t **txdataF_BF,
LTE_DL_FRAME_PARMS *frame_parms,
int32_t ***cell_spec_bf_weights,
int slot,
int symbol)
{
uint8_t p,aa;
uint16_t re=0;
int slot_offset_F;
slot_offset_F = slot*(frame_parms->ofdm_symbol_size)*((frame_parms->Ncp==1) ? 6 : 7);
// clear txdata_BF[aa][re] for each call of cell_spec_beamforming
for(aa=0;aa<frame_parms->nb_antennas_tx;aa++)
memset(txdataF_BF[aa],0,4*(frame_parms->ofdm_symbol_size));
for (re=0;re<frame_parms->ofdm_symbol_size;re++) {
for (p=0;p<frame_parms->nb_antenna_ports_eNB;p++) {
if (txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re]!=0) { //that means this RE is actually allocated
for (aa=0;aa<frame_parms->nb_antennas_tx;aa++) { for (aa=0;aa<frame_parms->nb_antennas_tx;aa++) {
((int16_t*)&txdataF_BF[aa][re])[0] = (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[5][aa][re])[0])>>15);
((int16_t*)&txdataF_BF[aa][re])[0] = (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0] ((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[5][aa][re])[1])>>15);
*((int16_t*)&cell_spec_bf_weights[p][aa][re])[0])>>15); ((int16_t*)&txdataF_BF[aa][re])[1] = (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[5][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1] ((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[5][aa][re])[0])>>15);
*((int16_t*)&cell_spec_bf_weights[p][aa][re])[1])>>15); // printf("beamforming.c:txdata[%d][%d]=%d+j%d, beam_weights[%d][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n",
((int16_t*)&txdataF_BF[aa][re])[1] = (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]
*((int16_t*)&cell_spec_bf_weights[p][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]
*((int16_t*)&cell_spec_bf_weights[p][aa][re])[0])>>15);
// printf("beamforming.c:txdata[%d][%d]=%d+j%d, cell_bf_weights[%d][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n",
// p,slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re, // p,slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re,
// ((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0], // ((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0],
// ((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1], // ((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1],
// p,aa,re, // p,aa,re,
// ((int16_t*)&cell_spec_bf_weights[p][aa][re])[0],((int16_t*)&cell_spec_bf_weights[p][aa][re])[1], // ((int16_t*)&beam_weights[p][aa][re])[0],((int16_t*)&beam_weights[p][aa][re])[1],
// aa,re, // aa,re,
// ((int16_t*)&txdataF_BF[aa][re])[0], // ((int16_t*)&txdataF_BF[aa][re])[0],
// ((int16_t*)&txdataF_BF[aa][re])[1]); // ((int16_t*)&txdataF_BF[aa][re])[1]);
}
}
}
}
}
/*
int ue_spec_beamforming(int32_t **txdataF,
int32_t **txdataF_BF,
LTE_DL_FRAME_PARMS *frame_parms,
LTE_eNB_DLSCH_t *dlsch0,
LTE_eNB_DLSCH_t *dlsch1,
int symbol)
{
uint8_t p,aa;
uint16_t re=0;
uint8_t harq_pid = dlsch0->current_harq_pid;
LTE_DL_eNB_HARQ_t *dlsch0_harq = dlsch0->harq_processes[harq_pid];
LTE_DL_eNB_HARQ_t *dlsch1_harq; //= dlsch1->harq_processes[harq_pid];
MIMO_mode_t mimo_mode = dlsch0_harq->mimo_mode;
int first_layer0 = dlsch0_harq->first_layer;
int Nlayers0 = dlsch0_harq->Nlayers;
// Fill these in later for TM8-10
int Nlayers1;
int first_layer1;
if (dlsch1_harq) {
Nlayers1 = dlsch1_harq->Nlayers;
first_layer1 = dlsch1_harq->first_layer;
} }
//temp
if(mimo_mode==TM7){
first_layer0 = 5;
Nlayers0=1;
} }
for (re=0;re<N_RB_DL*12;re++) { if (txdataF[7][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re]!=0) { //that means this RE is actually using TM8-10
//for (p=5,7..14) // this depends on the mimo_mode, but also the used ports for each UE for (p=7;p<15;p++) {
for (p=first_layer0;p<first_layer0+Nlayers0;p++) { if (txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re]!=0) { //that means this RE is actually allocated
if (txdataF[p][re+symbol*N_RB_DL*12]!=0) { //that means this RE is actually allocated for (aa=0;aa<frame_parms->nb_antennas_tx;aa++) {
for (aa=0;aa<frame_aprms->nb_antennas_tx;aa++) { ((int16_t*)&txdataF_BF[aa][re])[0] = (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
txdataF_BF[aa][re] += txdataF[p][re]*dlsch0->uespec_bf_weights[p][aa][re]; ((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
} ((int16_t*)&txdataF_BF[aa][re])[1] = (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
} }
} }
if(dlsch1_harq) {
for (p=first_layer1;p<first_layer1+Nlayers1;p++) {
if (txdataF[p][re+symbol*N_RB_DL*12]!=0) { //that means this RE is actually allocated
for (aa=0;aa<frame_aprms->nb_antennas_tx;aa++) {
txdataF_BF[aa][re] += txdataF[p][re]*dlsch1->uespec_bf_weights[p][aa][re];
}
} }
} }
} }
}
}
} */
...@@ -89,6 +89,8 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA ...@@ -89,6 +89,8 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms); void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
void do_OFDM_mod_l(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms, uint8_t num_pdcch_symbols);
void remove_7_5_kHz(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe); void remove_7_5_kHz(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe);
void apply_7_5_kHz(PHY_VARS_UE *phy_vars_ue,int32_t*txdata,uint8_t subframe); void apply_7_5_kHz(PHY_VARS_UE *phy_vars_ue,int32_t*txdata,uint8_t subframe);
...@@ -99,37 +101,20 @@ void remove_625_Hz(PHY_VARS_eNB *phy_vars_eNB,int16_t *prach); ...@@ -99,37 +101,20 @@ void remove_625_Hz(PHY_VARS_eNB *phy_vars_eNB,int16_t *prach);
void apply_625_Hz(PHY_VARS_UE *phy_vars_ue,int16_t *prach); void apply_625_Hz(PHY_VARS_UE *phy_vars_ue,int16_t *prach);
/** \brief This function performs UE specific beamforming especially for /** \brief This function performs beamforming precoding for common
* transmission mode TM7-10
@param txdataF Table of pointers for frequency-domain TX signals
@param txdataF_BF Table of pointers for frequency-domain TX signals
after beamforming
@param frame_parms Frame descriptor structure
@param ue_spec_bf_weights UE specific beamforming weights applied on
each antenna element and each carrier
@param slot Slot number
@param symbol Symbol index on which to act*/
int ue_spec_beamforming(int32_t **txdataF,
int32_t **txdataF_BF,
LTE_DL_FRAME_PARMS *frame_parms,
int32_t ***ue_spec_bf_weights,
int slot,
int symbol);
/** \brief This function performs cell specific beamforming for common
* data * data
@param txdataF Table of pointers for frequency-domain TX signals @param txdataF Table of pointers for frequency-domain TX signals
@param txdataF_BF Table of pointers for frequency-domain TX signals @param txdataF_BF Table of pointers for frequency-domain TX signals
@param frame_parms Frame descriptor structure @param frame_parms Frame descriptor structure
after beamforming after beamforming
@param cell_spec_bf_weights Common beamforming weights applied on each @param beam_weights Beamforming weights applied on each
antenna element and each carrier antenna element and each carrier
@param slot Slot number @param slot Slot number
@param symbol Symbol index on which to act*/ @param symbol Symbol index on which to act*/
int cell_spec_beamforming(int32_t **txdataF, int beam_precoding(int32_t **txdataF,
int32_t **txdataF_BF, int32_t **txdataF_BF,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
int32_t ***cell_spec_bf_weights, int32_t ***beam_weights,
int slot, int slot,
int symbol); int symbol);
......
...@@ -277,10 +277,11 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t ...@@ -277,10 +277,11 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t
} }
// OFDM modulation for each symbol // OFDM modulation for each symbol
void do_OFDM_mod_l(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms, uint8_t num_pdcch_symbols, unsigned char transmission_mode) void do_OFDM_mod_l(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms, uint8_t num_pdcch_symbols)
{ {
int aa, l, slot_offset, slot_offset_F; int aa, l, slot_offset, slot_offset_F;
int8_t UE_id=0;
mod_sym_t **txdataF = eNB_common_vars->txdataF[eNB_id]; mod_sym_t **txdataF = eNB_common_vars->txdataF[eNB_id];
mod_sym_t **txdataF_BF = eNB_common_vars->txdataF_BF[eNB_id]; mod_sym_t **txdataF_BF = eNB_common_vars->txdataF_BF[eNB_id];
int32_t **txdata = eNB_common_vars->txdata[eNB_id]; int32_t **txdata = eNB_common_vars->txdata[eNB_id];
...@@ -292,13 +293,8 @@ void do_OFDM_mod_l(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_sl ...@@ -292,13 +293,8 @@ void do_OFDM_mod_l(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_sl
for (l=0; l<frame_parms->symbols_per_tti>>1; l++) { for (l=0; l<frame_parms->symbols_per_tti>>1; l++) {
//printf("do_OFDM_mod_l, slot=%d, l=%d, NUMBER_OF_OFDM_CARRIERS=%d,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES=%d\n",next_slot, l,NUMBER_OF_OFDM_CARRIERS,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES); //printf("do_OFDM_mod_l, slot=%d, l=%d, NUMBER_OF_OFDM_CARRIERS=%d,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES=%d\n",next_slot, l,NUMBER_OF_OFDM_CARRIERS,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
if (l<num_pdcch_symbols && next_slot&1 == 0)
cell_spec_beamforming(txdataF,txdataF_BF,frame_parms,eNB_common_vars->cell_spec_bf_weights[eNB_id],next_slot,l); beam_precoding(txdataF,txdataF_BF,frame_parms,eNB_common_vars->beam_weights[eNB_id],next_slot,l);
else
if (transmission_mode<7)
cell_spec_beamforming(txdataF,txdataF_BF,frame_parms,eNB_common_vars->cell_spec_bf_weights[eNB_id],next_slot,l);
else
ue_spec_beamforming(txdataF,txdataF_BF,frame_parms,eNB_common_vars->ue_spec_bf_weights[eNB_id],next_slot,l);
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
...@@ -331,4 +327,3 @@ void do_OFDM_mod_l(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_sl ...@@ -331,4 +327,3 @@ void do_OFDM_mod_l(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_sl
} }
} }
/** @} */
...@@ -638,17 +638,24 @@ typedef struct { ...@@ -638,17 +638,24 @@ typedef struct {
/// - second index: cell specific eNB antenna port index, up to 2 logical antenna ports are supported /// - second index: cell specific eNB antenna port index, up to 2 logical antenna ports are supported
/// - third index: tx antenna [0..nb_antennas_tx[ /// - third index: tx antenna [0..nb_antennas_tx[
/// - fourth index: sample [0..] /// - fourth index: sample [0..]
int32_t **cell_spec_bf_weights[3][2]; // int32_t **cell_spec_bf_weights[3][2];
/// \brief Holds the ue specific beamforming weights /// \brief Holds the ue specific beamforming weights
/// - first index: eNB id [0..2] (hard coded) /// - first index: eNB id [0..2] (hard coded)
/// - second index: ue specific eNB antenna port index, port5->index0, port7-15->index0-7 /// - second index: ue specific eNB antenna port index, port5->index0, port7-15->index0-7
/// - third index: tx antenna [0..nb_antennas_tx[ /// - third index: tx antenna [0..nb_antennas_tx[
/// - fourth index: sample [0..] /// - fourth index: sample [0..]
int32_t **ue_spec_bf_weights[3][8]; // int32_t **ue_spec_bf_weights[3][8];
/// \brief Holds the ue specific beamforming weights
/// - first index: eNB id [0..2] (hard coded)
/// - second index: eNB antenna port index
/// - third index: tx antenna [0..nb_antennas_tx[
/// - fourth index: sample [0..]
int32_t **beam_weights[3][15];
/// \brief Holds the tdd reciprocity calibration coefficients /// \brief Holds the tdd reciprocity calibration coefficients
/// - first index: eNB id [0..2] (hard coded) /// - first index: eNB id [0..2] (hard coded)
/// - second index: tx antenna [0..nb_antennas_tx[ /// - second index: ue specific eNB antenna port index, port5->index0, port7-15->index0-7
/// - third index: frenquency [0..] /// - third index: tx antenna [0..nb_antennas_tx[
/// - forth index: frenquency [0..]
int32_t **tdd_calib_coeffs[3]; int32_t **tdd_calib_coeffs[3];
} LTE_eNB_COMMON; } LTE_eNB_COMMON;
......
...@@ -1779,6 +1779,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e ...@@ -1779,6 +1779,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->active = 0; phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->active = 0;
//mac_xface->macphy_exit("first dlsch transmitted\n"); //mac_xface->macphy_exit("first dlsch transmitted\n");
} }
else if ((phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0])&& else if ((phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0])&&
...@@ -1791,6 +1792,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e ...@@ -1791,6 +1792,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
//LOG_D(PHY,"[eNB %d] DCI: Clearing subframe_tx for subframe %d, UE %d\n",phy_vars_eNB->Mod_id,subframe,UE_id); //LOG_D(PHY,"[eNB %d] DCI: Clearing subframe_tx for subframe %d, UE %d\n",phy_vars_eNB->Mod_id,subframe,UE_id);
#endif #endif
} }
} }
...@@ -1811,30 +1813,31 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e ...@@ -1811,30 +1813,31 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
} }
#ifdef EMOS #ifdef EMOS
phy_procedures_emos_eNB_TX(subframe, phy_vars_eNB); phy_procedures_emos_eNB_TX(subframe, phy_vars_eNB);
#endif #endif
//cell-specific beamforming
#if !(defined(EXMIMO) || defined(OAI_USRP) || defined (CPRIGW)) #if !(defined(EXMIMO) || defined(OAI_USRP) || defined (CPRIGW))
if (abstraction_flag==0) if (abstraction_flag==0)
{ {
start_meas(&phy_vars_eNB->ofdm_mod_stats); start_meas(&phy_vars_eNB->ofdm_mod_stats);
do_OFDM_mod_l(phy_vars_eNB->lte_eNB_common_vars, //do_OFDM_mod (without l) ?
do_OFDM_mod_l(&phy_vars_eNB->lte_eNB_common_vars,
0, 0,
subframe<<1, subframe<<1,
&phy_vars_eNB->lte_frame_parms, &phy_vars_eNB->lte_frame_parms,
num_pdcch_symbols, num_pdcch_symbols);
phy_vars_eNB->transmission_mode[(uint8_t)UE_id]);
do_OFDM_mod_l(phy_vars_eNB->lte_eNB_common_vars, do_OFDM_mod_l(&phy_vars_eNB->lte_eNB_common_vars,
0, 0,
1+(subframe<<1), 1+(subframe<<1),
&phy_vars_eNB->lte_frame_parms, &phy_vars_eNB->lte_frame_parms,
num_pdcch_symbols, num_pdcch_symbols);
phy_vars_eNB->transmission_mode[(uint8_t)UE_id]);
stop_meas(&phy_vars_eNB->ofdm_mod_stats); stop_meas(&phy_vars_eNB->ofdm_mod_stats);
} }
......
...@@ -643,7 +643,7 @@ int main(int argc, char **argv) ...@@ -643,7 +643,7 @@ int main(int argc, char **argv)
frame_parms = &PHY_vars_eNB->lte_frame_parms; frame_parms = &PHY_vars_eNB->lte_frame_parms;
cell_spec_bf_weights = PHY_vars_eNB->lte_eNB_common_vars.cell_spec_bf_weights[0][0]; cell_spec_bf_weights = PHY_vars_eNB->lte_eNB_common_vars.beam_weights[0][0];
for(aa=0;aa<n_tx_phy;aa++) { for(aa=0;aa<n_tx_phy;aa++) {
for(re=0;re<frame_parms->ofdm_symbol_size;re++) { for(re=0;re<frame_parms->ofdm_symbol_size;re++) {
if (n_tx_phy==1 || n_tx_phy==2) if (n_tx_phy==1 || n_tx_phy==2)
...@@ -2813,15 +2813,13 @@ PMI_FEEDBACK: ...@@ -2813,15 +2813,13 @@ PMI_FEEDBACK:
eNB_id, eNB_id,
(subframe*2), (subframe*2),
&PHY_vars_eNB->lte_frame_parms, &PHY_vars_eNB->lte_frame_parms,
num_pdcch_symbols, num_pdcch_symbols);
transmission_mode);
do_OFDM_mod_l(&PHY_vars_eNB->lte_eNB_common_vars, do_OFDM_mod_l(&PHY_vars_eNB->lte_eNB_common_vars,
eNB_id, eNB_id,
(subframe*2)+1, (subframe*2)+1,
&PHY_vars_eNB->lte_frame_parms, &PHY_vars_eNB->lte_frame_parms,
num_pdcch_symbols, num_pdcch_symbols);
transmission_mode);
stop_meas(&PHY_vars_eNB->ofdm_mod_stats); stop_meas(&PHY_vars_eNB->ofdm_mod_stats);
stop_meas(&PHY_vars_eNB->phy_proc_tx); stop_meas(&PHY_vars_eNB->phy_proc_tx);
......
...@@ -154,13 +154,13 @@ eNBs = ...@@ -154,13 +154,13 @@ eNBs =
global_log_verbosity ="medium"; global_log_verbosity ="medium";
hw_log_level ="info"; hw_log_level ="info";
hw_log_verbosity ="medium"; hw_log_verbosity ="medium";
phy_log_level ="warn"; phy_log_level ="debug";
phy_log_verbosity ="medium"; phy_log_verbosity ="medium";
mac_log_level ="warn"; mac_log_level ="debug";
mac_log_verbosity ="medium"; mac_log_verbosity ="medium";
rlc_log_level ="warn"; rlc_log_level ="info";
rlc_log_verbosity ="medium"; rlc_log_verbosity ="medium";
pdcp_log_level ="warn"; pdcp_log_level ="info";
pdcp_log_verbosity ="medium"; pdcp_log_verbosity ="medium";
rrc_log_level ="info"; rrc_log_level ="info";
rrc_log_verbosity ="medium"; rrc_log_verbosity ="medium";
......
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