Commit 57599edf authored by Florian Kaltenberger's avatar Florian Kaltenberger

reduced the max number of antenna ports to 6 to save memory (we are not using...

reduced the max number of antenna ports to 6 to save memory (we are not using antenna port >5 anyway)
mult_cpx_conj_vector can now also do multiply add
beam_precoding now uses mult_cpx_conj_vector
parent cea1cfcd
...@@ -1307,7 +1307,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, ...@@ -1307,7 +1307,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
common_vars->txdataF_BF[eNB_id] = (int32_t **)malloc16(fp->nb_antennas_tx*sizeof(int32_t*)); common_vars->txdataF_BF[eNB_id] = (int32_t **)malloc16(fp->nb_antennas_tx*sizeof(int32_t*));
common_vars->tdd_calib_coeffs[eNB_id] = (int32_t **)malloc16(fp->nb_antennas_tx*sizeof(int32_t*)); common_vars->tdd_calib_coeffs[eNB_id] = (int32_t **)malloc16(fp->nb_antennas_tx*sizeof(int32_t*));
for (i=0; i<14; i++) { for (i=0; i<NB_ANTENNA_PORTS_ENB; i++) {
common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) ); common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] lte_common_vars->txdataF[%d][%d] = %p (%d bytes)\n", msg("[openair][LTE_PHY][INIT] lte_common_vars->txdataF[%d][%d] = %p (%d bytes)\n",
...@@ -1335,7 +1335,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, ...@@ -1335,7 +1335,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
#endif #endif
} }
for (i=0; i<14; i++) { // 14 is the total number of antenna ports for (i=0; i<NB_ANTENNA_PORTS_ENB; i++) {
common_vars->beam_weights[eNB_id][i] = (int32_t **)malloc16_clear(fp->nb_antennas_tx*sizeof(int32_t*)); common_vars->beam_weights[eNB_id][i] = (int32_t **)malloc16_clear(fp->nb_antennas_tx*sizeof(int32_t*));
for (j=0; j<fp->nb_antennas_tx; j++) { for (j=0; j<fp->nb_antennas_tx; j++) {
common_vars->beam_weights[eNB_id][i][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t)); common_vars->beam_weights[eNB_id][i][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
......
...@@ -723,7 +723,8 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -723,7 +723,8 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
(int16_t*) srs_vars->srs, (int16_t*) srs_vars->srs,
(int16_t*) srs_vars->srs_ch_estimates[eNB_id][aa], (int16_t*) srs_vars->srs_ch_estimates[eNB_id][aa],
frame_parms->ofdm_symbol_size, frame_parms->ofdm_symbol_size,
15); 15,
0);
//msg("SRS channel estimation cmult out\n"); //msg("SRS channel estimation cmult out\n");
#ifdef USER_MODE #ifdef USER_MODE
......
...@@ -65,8 +65,10 @@ int beam_precoding(int32_t **txdataF, ...@@ -65,8 +65,10 @@ int beam_precoding(int32_t **txdataF,
for (p=0; p<14; p++) { for (p=0; p<14; p++) {
if (p==0 || p==1 || p==5) { if (p==0 || p==1 || p==5) {
mult_cpx_conj_vector((int16_t*)beam_weights[p][aa], (int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size], (int16_t*)txdataF_BF[aa], frame_parms->ofdm_symbol_size, 15, 1);
//multadd_cpx_vector((int16_t*)txdataF[p],(int16_t*)beam_weights[p][aa], (int16_t*)txdataF_BF[aa], 0, frame_parms->ofdm_symbol_size, 15); //multadd_cpx_vector((int16_t*)txdataF[p],(int16_t*)beam_weights[p][aa], (int16_t*)txdataF_BF[aa], 0, frame_parms->ofdm_symbol_size, 15);
/*
for (re=0;re<frame_parms->ofdm_symbol_size;re++) { for (re=0;re<frame_parms->ofdm_symbol_size;re++) {
if (txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re]!=0) { if (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[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][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*)&beam_weights[p][aa][re])[0])>>15);
...@@ -74,7 +76,6 @@ int beam_precoding(int32_t **txdataF, ...@@ -74,7 +76,6 @@ int beam_precoding(int32_t **txdataF,
((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])[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); ((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);
/*
printf("beamforming.c:txdataF[%d][%d]=%d+j%d, beam_weights[%d][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n", printf("beamforming.c:txdataF[%d][%d]=%d+j%d, beam_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],
...@@ -84,9 +85,9 @@ int beam_precoding(int32_t **txdataF, ...@@ -84,9 +85,9 @@ int beam_precoding(int32_t **txdataF,
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]);
*/
} }
} }
*/
} }
} }
......
...@@ -42,7 +42,8 @@ int mult_cpx_conj_vector(int16_t *x1, ...@@ -42,7 +42,8 @@ int mult_cpx_conj_vector(int16_t *x1,
int16_t *x2, int16_t *x2,
int16_t *y, int16_t *y,
uint32_t N, uint32_t N,
int output_shift) int output_shift,
int madd)
{ {
// Multiply elementwise the complex conjugate of x1 with x2. // Multiply elementwise the complex conjugate of x1 with x2.
// x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)| // x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
...@@ -56,6 +57,8 @@ int mult_cpx_conj_vector(int16_t *x1, ...@@ -56,6 +57,8 @@ int mult_cpx_conj_vector(int16_t *x1,
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4; // N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
// //
// output_shift - shift to be applied to generate output // output_shift - shift to be applied to generate output
//
// madd - add the output to y
uint32_t i; // loop counter uint32_t i; // loop counter
...@@ -89,7 +92,11 @@ int mult_cpx_conj_vector(int16_t *x1, ...@@ -89,7 +92,11 @@ int mult_cpx_conj_vector(int16_t *x1,
tmp_im = _mm_srai_epi32(tmp_im,output_shift); tmp_im = _mm_srai_epi32(tmp_im,output_shift);
tmpy0 = _mm_unpacklo_epi32(tmp_re,tmp_im); tmpy0 = _mm_unpacklo_epi32(tmp_re,tmp_im);
tmpy1 = _mm_unpackhi_epi32(tmp_re,tmp_im); tmpy1 = _mm_unpackhi_epi32(tmp_re,tmp_im);
if (madd==0)
*y_128 = _mm_packs_epi32(tmpy0,tmpy1); *y_128 = _mm_packs_epi32(tmpy0,tmpy1);
else
*y_128 += _mm_packs_epi32(tmpy0,tmpy1);
#elif defined(__arm__) #elif defined(__arm__)
tmp_re = vmull_s16(((simdshort_q15_t *)x1_128)[0], ((simdshort_q15_t*)x2_128)[0]); tmp_re = vmull_s16(((simdshort_q15_t *)x1_128)[0], ((simdshort_q15_t*)x2_128)[0]);
...@@ -111,7 +118,10 @@ int mult_cpx_conj_vector(int16_t *x1, ...@@ -111,7 +118,10 @@ int mult_cpx_conj_vector(int16_t *x1,
tmp_re = vqshlq_s32(tmp_re,shift); tmp_re = vqshlq_s32(tmp_re,shift);
tmp_im = vqshlq_s32(tmp_im,shift); tmp_im = vqshlq_s32(tmp_im,shift);
tmpy = vzip_s16(vmovn_s32(tmp_re),vmovn_s32(tmp_im)); tmpy = vzip_s16(vmovn_s32(tmp_re),vmovn_s32(tmp_im));
if (madd==0)
*y_128 = vcombine_s16(tmpy.val[0],tmpy.val[1]); *y_128 = vcombine_s16(tmpy.val[0],tmpy.val[1]);
else
*y_128 += vcombine_s16(tmpy.val[0],tmpy.val[1]);
#endif #endif
x1_128++; x1_128++;
x2_128++; x2_128++;
......
...@@ -116,13 +116,15 @@ int rotate_cpx_vector(int16_t *x, ...@@ -116,13 +116,15 @@ int rotate_cpx_vector(int16_t *x,
@param y - output in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)| @param y - output in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
@param N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4; @param N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
@param output_shift - shift to be applied to generate output @param output_shift - shift to be applied to generate output
@param madd - if not zero result is added to output
*/ */
int mult_cpx_conj_vector(int16_t *x1, int mult_cpx_conj_vector(int16_t *x1,
int16_t *x2, int16_t *x2,
int16_t *y, int16_t *y,
uint32_t N, uint32_t N,
int output_shift); int output_shift,
int madd);
/*! /*!
Element-wise multiplication and accumulation of two complex vectors x1 and x2. Element-wise multiplication and accumulation of two complex vectors x1 and x2.
......
...@@ -546,7 +546,7 @@ typedef struct { ...@@ -546,7 +546,7 @@ typedef struct {
uint8_t nb_antennas_tx; uint8_t nb_antennas_tx;
/// Number of Receive antennas in node /// Number of Receive antennas in node
uint8_t nb_antennas_rx; uint8_t nb_antennas_rx;
/// Number of Logical transmit antenna ports in eNodeB /// Number of common transmit antenna ports in eNodeB (1 or 2)
uint8_t nb_antenna_ports_eNB; uint8_t nb_antenna_ports_eNB;
/// PRACH_CONFIG /// PRACH_CONFIG
PRACH_CONFIG_COMMON prach_config_common; PRACH_CONFIG_COMMON prach_config_common;
......
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
#define DMA_BLKS_PER_SLOT (SLOT_LENGTH_BYTES/2048) // Number of DMA blocks per slot #define DMA_BLKS_PER_SLOT (SLOT_LENGTH_BYTES/2048) // Number of DMA blocks per slot
#define SLOT_TIME_NS (SLOT_LENGTH_SAMPLES*(1e3)/7.68) // slot time in ns #define SLOT_TIME_NS (SLOT_LENGTH_SAMPLES*(1e3)/7.68) // slot time in ns
#define NB_ANTENNA_PORTS_ENB 14 // total number of eNB antenna ports #define NB_ANTENNA_PORTS_ENB 6 // total number of eNB antenna ports
#ifdef EXMIMO #ifdef EXMIMO
#define TARGET_RX_POWER 55 // Target digital power for the AGC #define TARGET_RX_POWER 55 // Target digital power for the AGC
......
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