Merge branch 'develop' into Feature-6-fix_test_core_network_with_scenarios
This commit is contained in:
@@ -1,200 +0,0 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
#include "defs.h"
|
||||
|
||||
int mult_cpx_matrix_h(short *x1[2][2],
|
||||
short *x2[2][2],
|
||||
short *y[2][2],
|
||||
unsigned int N,
|
||||
unsigned short output_shift,
|
||||
short hermitian)
|
||||
{
|
||||
|
||||
if (hermitian) {
|
||||
// this computes x1^H*x2 and stores it in y
|
||||
mult_cpx_vector_h(x2[0][0],x1[0][0],y[0][0],N,output_shift,1);
|
||||
mult_cpx_vector_h(x2[0][1],x1[0][1],y[0][0],N,output_shift,1);
|
||||
mult_cpx_vector_h(x2[0][0],x1[1][0],y[1][0],N,output_shift,1);
|
||||
mult_cpx_vector_h(x2[0][1],x1[1][1],y[1][0],N,output_shift,1);
|
||||
mult_cpx_vector_h(x2[1][0],x1[0][0],y[0][1],N,output_shift,1);
|
||||
mult_cpx_vector_h(x2[1][1],x1[0][1],y[0][1],N,output_shift,1);
|
||||
mult_cpx_vector_h(x2[1][0],x1[1][0],y[1][1],N,output_shift,1);
|
||||
mult_cpx_vector_h(x2[1][1],x1[1][1],y[1][1],N,output_shift,1);
|
||||
} else {
|
||||
// this computes x1*x2^H and stores it in y
|
||||
mult_cpx_vector_h(x1[0][0],x2[0][0],y[0][0],N,output_shift,1);
|
||||
mult_cpx_vector_h(x1[0][1],x2[0][1],y[0][0],N,output_shift,1);
|
||||
mult_cpx_vector_h(x1[0][0],x2[1][0],y[0][1],N,output_shift,1);
|
||||
mult_cpx_vector_h(x1[0][1],x2[1][1],y[0][1],N,output_shift,1);
|
||||
mult_cpx_vector_h(x1[1][0],x2[0][0],y[1][0],N,output_shift,1);
|
||||
mult_cpx_vector_h(x1[1][1],x2[0][1],y[1][0],N,output_shift,1);
|
||||
mult_cpx_vector_h(x1[1][0],x2[1][0],y[1][1],N,output_shift,1);
|
||||
mult_cpx_vector_h(x1[1][1],x2[1][1],y[1][1],N,output_shift,1);
|
||||
}
|
||||
}
|
||||
|
||||
int mult_cpx_matrix_vector(int *x1[2][2],
|
||||
int *x2[2],
|
||||
int *y[2],
|
||||
unsigned int N,
|
||||
unsigned short output_shift)
|
||||
{
|
||||
|
||||
Zero_Buffer(y[0],N*8);
|
||||
Zero_Buffer(y[1],N*8);
|
||||
|
||||
// this computes x1*x2 and stores it in y (32 bit)
|
||||
mult_cpx_vector_add32((short*)x2[0],(short*)x1[0][0],(short*)y[0],N);
|
||||
mult_cpx_vector_add32((short*)x2[1],(short*)x1[0][1],(short*)y[0],N);
|
||||
mult_cpx_vector_add32((short*)x2[0],(short*)x1[1][0],(short*)y[1],N);
|
||||
mult_cpx_vector_add32((short*)x2[1],(short*)x1[1][1],(short*)y[1],N);
|
||||
|
||||
// shift and pack
|
||||
shift_and_pack((short*)y[0],N,output_shift);
|
||||
shift_and_pack((short*)y[1],N,output_shift);
|
||||
|
||||
}
|
||||
|
||||
#ifdef MAIN_MM
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
main ()
|
||||
{
|
||||
short x1_00[256] __attribute__((aligned(16)));
|
||||
short x1_10[256] __attribute__((aligned(16)));
|
||||
short x1_01[256] __attribute__((aligned(16)));
|
||||
short x1_11[256] __attribute__((aligned(16)));
|
||||
short x2_0[256] __attribute__((aligned(16)));
|
||||
short x2_1[256] __attribute__((aligned(16)));
|
||||
short y_0[256] __attribute__((aligned(16)));
|
||||
short y_1[256] __attribute__((aligned(16)));
|
||||
|
||||
int *x1[2][2];
|
||||
int *x2[2];
|
||||
int *y[2];
|
||||
int i,m,n;
|
||||
|
||||
x1[0][0] = (int*)x1_00;
|
||||
x1[0][1] = (int*)x1_01;
|
||||
x1[1][0] = (int*)x1_10;
|
||||
x1[1][1] = (int*)x1_11;
|
||||
x2[0] = (int*)x2_0;
|
||||
x2[1] = (int*)x2_1;
|
||||
y[0] = (int*)y_0;
|
||||
y[1] = (int*)y_1;
|
||||
|
||||
for(m=0; m<2; m++) {
|
||||
for(n=0; n<2; n++) {
|
||||
for(i=0; i<256; i+=4) {
|
||||
((short*)x1[m][n])[i] = ((short) rand())/4;
|
||||
((short*)x1[m][n])[i+1] = ((short) rand())/4;
|
||||
((short*)x1[m][n])[i+2] = -((short*)x1[m][n])[i+1];
|
||||
((short*)x1[m][n])[i+3] = ((short*)x1[m][n])[i];
|
||||
}
|
||||
}
|
||||
|
||||
for(i=0; i<256; i+=4) {
|
||||
((short*)x2[m])[i] = ((short) rand())/4;
|
||||
((short*)x2[m])[i+1] = ((short) rand())/4;
|
||||
((short*)x2[m])[i+2] = ((short*)x2[m])[i];
|
||||
((short*)x2[m])[i+3] = ((short*)x2[m])[i+1];
|
||||
}
|
||||
|
||||
Zero_Buffer(y[m],512);
|
||||
}
|
||||
|
||||
/*
|
||||
input[0] = 100;
|
||||
input[1] = 200;
|
||||
input[2] = -200;
|
||||
input[3] = 100;
|
||||
input[4] = 1000;
|
||||
input[5] = 2000;
|
||||
input[6] = -2000;
|
||||
input[7] = 1000;
|
||||
input[8] = 100;
|
||||
input[9] = 200;
|
||||
input[10] = -200;
|
||||
input[11] = 100;
|
||||
input[12] = 1000;
|
||||
input[13] = 2000;
|
||||
input[14] = -2000;
|
||||
input[15] = 1000;
|
||||
|
||||
input2[0] = 2;
|
||||
input2[1] = 1;
|
||||
input2[2] = 2;
|
||||
input2[3] = 1;
|
||||
input2[4] = 20;
|
||||
input2[5] = 10;
|
||||
input2[6] = 20;
|
||||
input2[7] = 10;
|
||||
input2[8] = 2;
|
||||
input2[9] = 1;
|
||||
input2[10] = 2;
|
||||
input2[11] = 1;
|
||||
input2[12] = 2000;
|
||||
input2[13] = 1000;
|
||||
input2[14] = 2000;
|
||||
input2[15] = 1000;
|
||||
|
||||
x1[0][0] = (int*)input;
|
||||
x1[0][1] = (int*)input;
|
||||
x1[1][0] = (int*)input;
|
||||
x1[1][1] = (int*)input;
|
||||
|
||||
x2[0] = (int*)input2;
|
||||
x2[1] = (int*)input2;
|
||||
|
||||
y[0] = (int*)output;
|
||||
y[1] = (int*)output2;
|
||||
*/
|
||||
|
||||
mult_cpx_matrix_vector(x1,x2,y,64,15);
|
||||
|
||||
//mult_cpx_vector_add32(x2[0],x1[0][0],y[0],64);
|
||||
|
||||
for (i=0; i<128; i+=2)
|
||||
printf("i=%d, x1 = [%d+1i*%d %d+1i*%d; %d+1i*%d %d+1i*%d]; x2 = [%d+1i*%d; %d+1i*%d]; y = [%d+1i*%d; %d+1i*%d]; y_m= round(x1*x2./pow2(15)); y-y_m \n",
|
||||
i,
|
||||
((short*)x1[0][0])[2*i], ((short*)x1[0][0])[2*i+2],
|
||||
((short*)x1[0][1])[2*i], ((short*)x1[0][1])[2*i+2],
|
||||
((short*)x1[1][0])[2*i], ((short*)x1[1][0])[2*i+2],
|
||||
((short*)x1[1][1])[2*i], ((short*)x1[1][1])[2*i+2],
|
||||
((short*)x2[0])[2*i], ((short*)x2[0])[2*i+1],
|
||||
((short*)x2[1])[2*i], ((short*)x2[1])[2*i+1],
|
||||
((short*)y[0])[2*i], ((short*)y[0])[2*i+1],
|
||||
((short*)y[1])[2*i], ((short*)y[1])[2*i+1]);
|
||||
|
||||
//((int*)y[0])[i], ((int*)y[0])[i+1],
|
||||
//((int*)y[1])[i], ((int*)y[1])[i+1]);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -50,7 +50,7 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
uint32_t N,
|
||||
int output_shift)
|
||||
{
|
||||
// Multiply elementwise two complex vectors of N elements with repeated formatted output
|
||||
// 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)|
|
||||
// We assume x1 with a dinamic of 15 bit maximum
|
||||
//
|
||||
@@ -90,7 +90,7 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
tmp_im = _mm_shufflelo_epi16(*x1_128,_MM_SHUFFLE(2,3,0,1));
|
||||
tmp_im = _mm_shufflehi_epi16(tmp_im,_MM_SHUFFLE(2,3,0,1));
|
||||
tmp_im = _mm_sign_epi16(tmp_im,*(__m128i*)&conjug[0]);
|
||||
tmp_im = _mm_madd_epi16(tmp_im,*x1_128);
|
||||
tmp_im = _mm_madd_epi16(tmp_im,*x2_128);
|
||||
tmp_re = _mm_srai_epi32(tmp_re,output_shift);
|
||||
tmp_im = _mm_srai_epi32(tmp_im,output_shift);
|
||||
tmpy0 = _mm_unpacklo_epi32(tmp_re,tmp_im);
|
||||
@@ -130,3 +130,4 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,366 +0,0 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
#include "defs.h"
|
||||
|
||||
static __m128i shift __attribute__ ((aligned(16)));
|
||||
|
||||
|
||||
int mult_cpx_vector_h(short *x1,
|
||||
short *x2,
|
||||
short *y,
|
||||
unsigned int N,
|
||||
unsigned short output_shift,
|
||||
short sign)
|
||||
{
|
||||
// Multiply elementwise the complex vector x1 with the complex conjugate of the complex vecotr x2 of N elements and adds it to the vector y.
|
||||
// x1 - input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
// We assume x1 with a dinamic of 15 bit maximum
|
||||
//
|
||||
// x2 - input 2 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
// We assume x2 with a dinamic of 14 bit maximum
|
||||
//
|
||||
// y - output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
//
|
||||
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
//
|
||||
// log2_amp - increase the output amplitude by a factor 2^log2_amp (default is 0)
|
||||
// WARNING: log2_amp>0 can cause overflow!!
|
||||
// sign - +1..add, -1..substract
|
||||
|
||||
unsigned int i; // loop counter
|
||||
|
||||
register __m128i m0,m1,m2;
|
||||
|
||||
short *temps;
|
||||
int *tempd;
|
||||
|
||||
__m128i *x1_128;
|
||||
__m128i *x2_128;
|
||||
__m128i *y_128;
|
||||
__m128i mask;
|
||||
|
||||
__m128i temp;
|
||||
|
||||
shift = _mm_cvtsi32_si128(output_shift);
|
||||
x1_128 = (__m128i *)&x1[0];
|
||||
x2_128 = (__m128i *)&x2[0];
|
||||
y_128 = (__m128i *)&y[0];
|
||||
|
||||
if (sign == -1)
|
||||
mask = (__m128i) _mm_set_epi16 (-1,1,-1,-1,-1,1,-1,-1);
|
||||
else
|
||||
mask = (__m128i) _mm_set_epi16 (1,-1,1,1,1,-1,1,1);
|
||||
|
||||
// we compute 2*4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>3); i++) {
|
||||
|
||||
// printf("i=%d\n",i);
|
||||
|
||||
// unroll 1
|
||||
// temps = (short *)x1_128;
|
||||
// printf("x1 : %d,%d,%d,%d,%d,%d,%d,%d\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]);
|
||||
m1 = x1_128[0];
|
||||
m2 = x2_128[0];
|
||||
|
||||
// temps = (short *)&x2_128[0];
|
||||
// printf("x2 : %x,%x,%x,%x,%x,%x,%x,%x\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]);
|
||||
|
||||
// bring x2 in conjugate form
|
||||
// the first two instructions might be replaced with a single one in SSE3
|
||||
m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_mullo_epi16(m2, mask);
|
||||
|
||||
// temp = m2;
|
||||
// temps = (short *)&temp;
|
||||
// printf("x2 conj : %x,%x,%x,%x,%x,%x,%x,%x\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]);
|
||||
|
||||
m0 = _mm_madd_epi16(m1,m2); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0]
|
||||
|
||||
// temp = m0;
|
||||
|
||||
// tempd = &temp;
|
||||
// printf("m0 : %d,%d,%d,%d\n",tempd[0],tempd[1],tempd[2],tempd[3]);
|
||||
|
||||
m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude
|
||||
|
||||
// temp = m0;
|
||||
|
||||
// tempd = (int *)&temp;
|
||||
// printf("m0 : %d,%d,%d,%d\n",tempd[0],tempd[1],tempd[2],tempd[3]);
|
||||
|
||||
m0 = _mm_packs_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
m0 = _mm_unpacklo_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
|
||||
y_128[0] = _mm_add_epi16(m0,y_128[0]);
|
||||
|
||||
// temps = (short *)&y_128[0];
|
||||
// printf("y0 : %d,%d,%d,%d,%d,%d,%d,%d\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]);
|
||||
|
||||
// unroll 2
|
||||
m1 = x1_128[1];
|
||||
m2 = x2_128[1];
|
||||
|
||||
m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_mullo_epi16(m2, mask);
|
||||
|
||||
m0 = _mm_madd_epi16(m1,m2); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0]
|
||||
|
||||
m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude
|
||||
|
||||
m0 = _mm_packs_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
m0 = _mm_unpacklo_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
|
||||
y_128[1] = _mm_add_epi16(m0,y_128[1]);
|
||||
|
||||
// unroll 3
|
||||
m1 = x1_128[2];
|
||||
m2 = x2_128[2];
|
||||
|
||||
m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_mullo_epi16(m2, mask);
|
||||
|
||||
m0 = _mm_madd_epi16(m1,m2); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0]
|
||||
|
||||
m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude
|
||||
|
||||
m0 = _mm_packs_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
m0 = _mm_unpacklo_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
|
||||
y_128[2] = _mm_add_epi16(m0,y_128[2]);
|
||||
|
||||
|
||||
// unroll 4
|
||||
m1 = x1_128[3];
|
||||
m2 = x2_128[3];
|
||||
|
||||
m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_mullo_epi16(m2, mask);
|
||||
|
||||
m0 = _mm_madd_epi16(m1,m2); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0]
|
||||
|
||||
m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude
|
||||
|
||||
m0 = _mm_packs_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
m0 = _mm_unpacklo_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
|
||||
y_128[3] = _mm_add_epi16(m0,y_128[3]);
|
||||
|
||||
x1_128+=4;
|
||||
x2_128+=4;
|
||||
y_128 +=4;
|
||||
// printf("x1_128 = %p, x2_128 =%p, y_128=%p\n",x1_128,x2_128,y_128);
|
||||
|
||||
}
|
||||
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int mult_cpx_vector_h_add32(short *x1,
|
||||
short *x2,
|
||||
short *y,
|
||||
unsigned int N,
|
||||
short sign)
|
||||
{
|
||||
// Multiply elementwise the complex vector x1 with the complex conjugate of the complex vecotr x2 of N elements and adds it to the vector y.
|
||||
// x1 - input 1 in 16bit format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
// We assume x1 with a dinamic of 15 bit maximum
|
||||
//
|
||||
// x2 - input 2 in 16bit format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
// We assume x2 with a dinamic of 14 bit maximum
|
||||
//
|
||||
// y - output in 32bit format |Re0 Im0|,......,|Re(N-1) Im(N-1)|
|
||||
//
|
||||
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
//
|
||||
// sign - +1..add, -1..substract
|
||||
|
||||
unsigned int i; // loop counter
|
||||
|
||||
register __m128i m0,m1,m2;
|
||||
|
||||
short *temps;
|
||||
int *tempd;
|
||||
|
||||
__m128i *x1_128;
|
||||
__m128i *x2_128;
|
||||
__m128i *y_128;
|
||||
__m128i mask;
|
||||
|
||||
__m128i temp;
|
||||
|
||||
x1_128 = (__m128i *)&x1[0];
|
||||
x2_128 = (__m128i *)&x2[0];
|
||||
y_128 = (__m128i *)&y[0];
|
||||
|
||||
if (sign == -1)
|
||||
mask = (__m128i) _mm_set_epi16 (-1,1,-1,-1,-1,1,-1,-1);
|
||||
else
|
||||
mask = (__m128i) _mm_set_epi16 (1,-1,1,1,1,-1,1,1);
|
||||
|
||||
// we compute 2*4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>3); i++) {
|
||||
|
||||
m1 = x1_128[0];
|
||||
m2 = x2_128[0];
|
||||
|
||||
// bring x2 in conjugate form
|
||||
// the first two instructions might be replaced with a single one in SSE3
|
||||
m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_mullo_epi16(m2, mask);
|
||||
|
||||
m0 = _mm_madd_epi16(m1,m2); // 1- compute x1[0]*x2[0], result is 32bit
|
||||
|
||||
y_128[0] = _mm_add_epi32(m0,y_128[0]);
|
||||
|
||||
// unroll 2
|
||||
m1 = x1_128[1];
|
||||
m2 = x2_128[1];
|
||||
|
||||
m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_mullo_epi16(m2, mask);
|
||||
|
||||
m0 = _mm_madd_epi16(m1,m2);
|
||||
|
||||
y_128[1] = _mm_add_epi32(m0,y_128[1]);
|
||||
|
||||
// unroll 3
|
||||
m1 = x1_128[2];
|
||||
m2 = x2_128[2];
|
||||
|
||||
m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_mullo_epi16(m2, mask);
|
||||
|
||||
m0 = _mm_madd_epi16(m1,m2);
|
||||
|
||||
y_128[2] = _mm_add_epi32(m0,y_128[2]);
|
||||
|
||||
|
||||
// unroll 4
|
||||
m1 = x1_128[3];
|
||||
m2 = x2_128[3];
|
||||
|
||||
m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_mullo_epi16(m2, mask);
|
||||
|
||||
m0 = _mm_madd_epi16(m1,m2);
|
||||
|
||||
y_128[3] = _mm_add_epi32(m0,y_128[3]);
|
||||
|
||||
x1_128+=4;
|
||||
x2_128+=4;
|
||||
y_128 +=4;
|
||||
|
||||
}
|
||||
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
#ifdef MAIN
|
||||
#define L 16
|
||||
|
||||
main ()
|
||||
{
|
||||
|
||||
short input[256] __attribute__((aligned(16)));
|
||||
short input2[256] __attribute__((aligned(16)));
|
||||
short output[256] __attribute__((aligned(16)));
|
||||
|
||||
int i;
|
||||
|
||||
Zero_Buffer(output,256*2);
|
||||
|
||||
for (i=0; i<16; i+=2)
|
||||
printf("output[%d] = %d + %d i\n",i,output[i],output[i+1]);
|
||||
|
||||
input[0] = 100;
|
||||
input[1] = 200;
|
||||
input[2] = 100;
|
||||
input[3] = 200;
|
||||
input[4] = 1234;
|
||||
input[5] = -1234;
|
||||
input[6] = 1234;
|
||||
input[7] = -1234;
|
||||
input[8] = 100;
|
||||
input[9] = 200;
|
||||
input[10] = 100;
|
||||
input[11] = 200;
|
||||
input[12] = 1000;
|
||||
input[13] = 2000;
|
||||
input[14] = 1000;
|
||||
input[15] = 2000;
|
||||
|
||||
input2[0] = 1;
|
||||
input2[1] = 2;
|
||||
input2[2] = 1;
|
||||
input2[3] = 2;
|
||||
input2[4] = 10;
|
||||
input2[5] = 20;
|
||||
input2[6] = 10;
|
||||
input2[7] = 20;
|
||||
input2[8] = 1;
|
||||
input2[9] = 2;
|
||||
input2[10] = 1;
|
||||
input2[11] = 2;
|
||||
input2[12] = 1000;
|
||||
input2[13] = 2000;
|
||||
input2[14] = 1000;
|
||||
input2[15] = 2000;
|
||||
|
||||
|
||||
mult_cpx_vector_h(input2,input2,output,8,0,1);
|
||||
|
||||
for (i=0; i<16; i+=2)
|
||||
printf("output[%d] = %d + %d i\n",i,output[i],output[i+1]);
|
||||
|
||||
Zero_Buffer(output,256*2);
|
||||
mult_cpx_vector_h(input2,input2,output,8,0,-1);
|
||||
|
||||
for (i=0; i<16; i+=2)
|
||||
printf("output[%d] = %d + %d i\n",i,output[i],output[i+1]);
|
||||
|
||||
}
|
||||
|
||||
#endif //MAIN
|
||||
+26
-182
@@ -64,6 +64,8 @@ struct complex32 {
|
||||
int32_t i;
|
||||
};
|
||||
|
||||
//cmult_sv.h
|
||||
|
||||
/*!\fn void multadd_real_vector_complex_scalar(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N)
|
||||
This function performs componentwise multiplication and accumulation of a complex scalar and a real vector.
|
||||
@param x Vector input (Q1.15)
|
||||
@@ -95,192 +97,14 @@ void multadd_complex_vector_real_scalar(int16_t *x,
|
||||
uint8_t zero_flag,
|
||||
uint32_t N);
|
||||
|
||||
|
||||
/*!\fn int32_t mult_cpx_vector(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift)
|
||||
This function performs optimized componentwise multiplication of two Q1.15 vectors in repeated format.
|
||||
|
||||
@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)|
|
||||
@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param N Length of Vector WARNING: N must be a multiple of 8 (4x loop unrolling and two complex multiplies per cycle)
|
||||
@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
|
||||
|
||||
The function implemented is : \f$\mathbf{y} = \mathbf{x_1}\odot\mathbf{x_2}\f$
|
||||
*/
|
||||
int32_t mult_cpx_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift);
|
||||
|
||||
/*!\fn int32_t mult_cpx_vector_norep(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift)
|
||||
This function performs optimized componentwise multiplication of two Q1.15 vectors with normal formatted output.
|
||||
|
||||
@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(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 Length of Vector WARNING: N must be a multiple of 8 (4x loop unrolling and two complex multiplies per cycle)
|
||||
@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
|
||||
|
||||
The function implemented is : \f$\mathbf{y} = \mathbf{x_1}\odot\mathbf{x_2}\f$
|
||||
*/
|
||||
int32_t mult_cpx_vector_norep(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift);
|
||||
|
||||
|
||||
/*!\fn int32_t mult_cpx_vector_norep2(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift)
|
||||
This function performs optimized componentwise multiplication of two Q1.15 vectors with normal formatted output.
|
||||
|
||||
@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(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 Length of Vector WARNING: N must be a multiple of 8 (no unrolling and two complex multiplies per cycle)
|
||||
@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
|
||||
|
||||
The function implemented is : \f$\mathbf{y} = \mathbf{x_1}\odot\mathbf{x_2}\f$
|
||||
*/
|
||||
int32_t mult_cpx_vector_norep2(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift);
|
||||
|
||||
int32_t mult_cpx_vector_norep_conj(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift);
|
||||
|
||||
int32_t mult_cpx_vector_norep_conj2(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift);
|
||||
|
||||
/*!\fn int32_t mult_cpx_vector2(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift)
|
||||
This function performs optimized componentwise multiplication of two Q1.15 vectors.
|
||||
|
||||
@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)|
|
||||
@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param N Length of Vector WARNING: N must be a multiple of 2 (2 complex multiplies per cycle)
|
||||
@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
|
||||
|
||||
The function implemented is : \f$\mathbf{y} = \mathbf{x_1}\odot\mathbf{x_2}\f$
|
||||
*/
|
||||
int32_t mult_cpx_vector2(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift);
|
||||
|
||||
/*!\fn int32_t mult_cpx_vector_add(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift)
|
||||
This function performs optimized componentwise multiplication of two Q1.15 vectors. The output IS ADDED TO y. WARNING: make sure that output_shift is set to the right value, so that the result of the multiplication has the comma at the same place as y.
|
||||
|
||||
@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)|
|
||||
@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param N Length of Vector WARNING: N>=4
|
||||
@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
|
||||
|
||||
The function implemented is : \f$\mathbf{y} += \mathbf{x_1}\odot\mathbf{x_2}\f$
|
||||
*/
|
||||
|
||||
int32_t mult_cpx_vector_add(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift);
|
||||
|
||||
|
||||
int32_t mult_cpx_vector_h_add32(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int16_t sign);
|
||||
|
||||
int32_t mult_cpx_vector_add32(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N);
|
||||
|
||||
int32_t mult_vector32(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int rotate_cpx_vector(int16_t *x,
|
||||
int16_t *alpha,
|
||||
int16_t *y,
|
||||
uint32_t N);
|
||||
|
||||
int32_t mult_vector32_scalar(int16_t *x1,
|
||||
int32_t x2,
|
||||
int16_t *y,
|
||||
uint32_t N);
|
||||
|
||||
int32_t mult_cpx_vector32_conj(int16_t *x,
|
||||
int16_t *y,
|
||||
uint32_t N);
|
||||
|
||||
int32_t mult_cpx_vector32_real(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N);
|
||||
|
||||
int32_t shift_and_pack(int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift);
|
||||
|
||||
/*!\fn int32_t mult_cpx_vector_h(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift,int16_t sign)
|
||||
This function performs optimized componentwise multiplication of the vector x1 with the conjugate of the vector x2. The output IS ADDED TO y. WARNING: make sure that output_shift is set to the right value, so that the result of the multiplication has the comma at the same place as y.
|
||||
|
||||
@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param x2 Input 2 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param N Length of Vector (complex samples) WARNING: N>=4
|
||||
@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
|
||||
@param sign +1..add, -1..substract
|
||||
|
||||
The function implemented is : \f$\mathbf{y} = \mathbf{y} + \mathbf{x_1}\odot\mathbf{x_2}^*\f$
|
||||
*/
|
||||
int32_t mult_cpx_vector_h(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift,
|
||||
int16_t sign);
|
||||
|
||||
/*!\fn int32_t mult_cpx_matrix_h(int16_t *x1[2][2],int16_t *x2[2][2],int16_t *y[2][2],uint32_t N,uint16_t output_shift,int16_t hermitian)
|
||||
This function performs optimized componentwise matrix multiplication of the 2x2 matrices x1 with the 2x2 matrices x2. The output IS ADDED TO y (i.e. make sure y is initilized correctly). WARNING: make sure that output_shift is set to the right value, so that the result of the multiplication has the comma at the same place as y.
|
||||
|
||||
@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param x2 Input 2 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param N Length of Vector (complex samples) WARNING: N>=4
|
||||
@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
|
||||
@param hermitian if !=0 the hermitian transpose is returned (i.e. A^H*B instead of A*B^H)
|
||||
*/
|
||||
int32_t mult_cpx_matrix_h(int16_t *x1[2][2],
|
||||
int16_t *x2[2][2],
|
||||
int16_t *y[2][2],
|
||||
uint32_t N,
|
||||
uint16_t output_shift,
|
||||
int16_t hermitian);
|
||||
uint32_t N,
|
||||
uint16_t output_shift);
|
||||
|
||||
|
||||
/*!\fn int32_t mult_cpx_matrix_vector(int32_t *x1[2][2],int32_t *x2[2],int32_t *y[2],uint32_t N,uint16_t output_shift)
|
||||
This function performs optimized componentwise matrix-vector multiplication of the 2x2 matrices x1 with the 2x1 vectors x2. The output IS ADDED TO y (i.e. make sure y is initilized correctly). WARNING: make sure that output_shift is set to the right value, so that the result of the multiplication has the comma at the same place as y.
|
||||
|
||||
@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)|
|
||||
@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| WARNING: y must be different for x2
|
||||
@param N Length of Vector (complex samples) WARNING: N>=4
|
||||
@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
|
||||
*/
|
||||
int32_t mult_cpx_matrix_vector(int32_t *x1[2][2],
|
||||
int32_t *x2[2],
|
||||
int32_t *y[2],
|
||||
uint32_t N,
|
||||
uint16_t output_shift);
|
||||
|
||||
/*!\fn void init_fft(uint16_t size,uint8_t logsize,uint16_t *rev)
|
||||
\brief Initialize the FFT engine for a given size
|
||||
@@ -289,6 +113,25 @@ int32_t mult_cpx_matrix_vector(int32_t *x1[2][2],
|
||||
@param rev Pointer to bit-reversal permutation array
|
||||
*/
|
||||
|
||||
//cmult_vv.c
|
||||
/*!
|
||||
Multiply elementwise the complex conjugate of x1 with x2.
|
||||
@param x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
We assume x1 with a dinamic of 15 bit maximum
|
||||
@param x2 - input 2 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
We assume x2 with a dinamic of 14 bit maximum
|
||||
@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 output_shift - shift to be applied to generate output
|
||||
*/
|
||||
|
||||
int mult_cpx_conj_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int output_shift);
|
||||
|
||||
// lte_dfts.c
|
||||
void init_fft(uint16_t size,
|
||||
uint8_t logsize,
|
||||
uint16_t *rev);
|
||||
@@ -355,6 +198,7 @@ int32_t rotate_cpx_vector(int16_t *x,
|
||||
uint16_t output_shift);
|
||||
|
||||
|
||||
//cadd_sv.c
|
||||
|
||||
/*!\fn int32_t add_cpx_vector(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N)
|
||||
This function performs componentwise addition of a vector with a complex scalar.
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
#ifndef __TIME_MEAS_DEFS__H__
|
||||
#define __TIME_MEAS_DEFS__H__
|
||||
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
@@ -148,3 +151,4 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts)
|
||||
dst_ts->max=src_ts->max;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2678,18 +2678,18 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
if (ret == (1+phy_vars_ue->dlsch_ue[eNB_id][0]->max_turbo_iterations)) {
|
||||
phy_vars_ue->dlsch_errors[eNB_id]++;
|
||||
|
||||
//#ifdef DEBUG_PHY_PROC
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d DLSCH in error (rv %d,mcs %d,TBS %d)\n",
|
||||
phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
|
||||
harq_pid,frame_rx,subframe_prev,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rvidx,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS);
|
||||
|
||||
// if (abstraction_flag ==0 )
|
||||
dump_dlsch(phy_vars_ue,eNB_id,subframe_prev,harq_pid);
|
||||
mac_xface->macphy_exit("");
|
||||
//#endif
|
||||
/*
|
||||
if (abstraction_flag ==0 )
|
||||
dump_dlsch(phy_vars_ue,eNB_id,subframe_prev,harq_pid);
|
||||
mac_xface->macphy_exit(""); */
|
||||
#endif
|
||||
} else {
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d (slot_rx %d): Received DLSCH (rv %d,mcs %d,TBS %d)\n",
|
||||
phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
|
||||
|
||||
@@ -1019,7 +1019,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
|
||||
enb_properties.properties[enb_properties_index]->prach_zero_correlation[j] =prach_zero_correlation;
|
||||
|
||||
if ((prach_zero_correlation <0) || (prach_zero_correlation > 63))
|
||||
if ((prach_zero_correlation <0) || (prach_zero_correlation > 15))
|
||||
AssertError (0, parse_errors ++,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_zero_correlation choice: 0..15!\n",
|
||||
lib_config_file_name_pP, i, prach_zero_correlation);
|
||||
|
||||
@@ -412,7 +412,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_I,offIold);
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
|
||||
switch (i&3) {
|
||||
@@ -438,7 +438,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_I,offI);
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
|
||||
switch (i&3) {
|
||||
@@ -474,7 +474,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
|
||||
switch (i&3) {
|
||||
@@ -503,7 +503,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_Q,offQold);
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
// project on fs/4
|
||||
for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
|
||||
@@ -530,7 +530,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_Q,offQ);
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
|
||||
switch (i&3) {
|
||||
@@ -568,7 +568,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
|
||||
switch (i&3) {
|
||||
@@ -601,7 +601,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_PHASE,offphaseold);
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
// project on fs/8 (Image of TX signal in +ve frequencies)
|
||||
for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
|
||||
@@ -618,7 +618,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_PHASE,offphase);
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
// project on fs/8 (Image of TX signal in +ve frequencies)
|
||||
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
|
||||
@@ -648,7 +648,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
// project on fs/8 (Image of TX signal in +ve frequencies)
|
||||
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
|
||||
@@ -670,7 +670,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_GAIN,offgainold);
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
// project on fs/8 (Image of TX signal in +ve frequencies)
|
||||
for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
|
||||
@@ -687,7 +687,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_GAIN,offgain);
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
// project on fs/8 (Image of TX signal in +ve frequencies)
|
||||
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
|
||||
@@ -716,7 +716,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
// project on fs/8 (Image of TX signal in +ve frequencies)
|
||||
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
|
||||
@@ -741,7 +741,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_PHASE,offphaseold);
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
// project on -3fs/8 (Image of TX signal in -ve frequencies)
|
||||
for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
|
||||
@@ -758,7 +758,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_PHASE,offphase);
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
// project on -3fs/8 (Image of TX signal in -ve frequencies)
|
||||
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
|
||||
@@ -788,7 +788,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
// project on -3fs/8 (Image of TX signal in -ve frequencies)
|
||||
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
|
||||
@@ -810,7 +810,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_GAIN,offgainold);
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0,0);
|
||||
}
|
||||
// project on -3fs/8 (Image of TX signal in +ve frequencies)
|
||||
for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
|
||||
@@ -827,7 +827,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_GAIN,offgain);
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
// project on 3fs/8 (Image of TX signal in -ve frequencies)
|
||||
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
|
||||
@@ -856,7 +856,7 @@ void calibrate_rf(openair0_device *device) {
|
||||
|
||||
for (i=0;i<10;i++) {
|
||||
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0);
|
||||
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
|
||||
}
|
||||
// project on -3fs/8 (Image of TX signal in -ve frequencies)
|
||||
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
|
||||
@@ -1068,7 +1068,6 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
bladerf_log_set_verbosity(get_brf_log_level(openair0_cfg->log_level));
|
||||
|
||||
printf("BLADERF: Initializing openair0_device\n");
|
||||
device->priv = brf;
|
||||
device->Mod_id = num_devices++;
|
||||
device->type = BLADERF_DEV;
|
||||
device->trx_start_func = trx_brf_start;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,171 @@
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
eNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
eNB_ID = 0xe00;
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
mobile_country_code = "208";
|
||||
|
||||
mobile_network_code = "95";
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
frame_type = "FDD";
|
||||
tdd_config = 3;
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 13;
|
||||
downlink_frequency = 751000000L;
|
||||
uplink_frequency_offset = 31000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 50;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 125;
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
prach_zero_correlation = 1;
|
||||
prach_freq_offset = 2;
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 1;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pdsch_referenceSignalPower = -20;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
pusch_hoppingMode = "interSubFrame";
|
||||
pusch_hoppingOffset = 0;
|
||||
pusch_groupHoppingEnabled = "ENABLE";
|
||||
pusch_groupAssignment = 0;
|
||||
pusch_sequenceHoppingEnabled = "DISABLE";
|
||||
pusch_nDMRS1 = 1;
|
||||
phich_duration = "NORMAL";
|
||||
phich_resource = "ONESIXTH";
|
||||
srs_enable = "DISABLE";
|
||||
/* srs_BandwidthConfig =;
|
||||
srs_SubframeConfig =;
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -90;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -96;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
pucch_deltaF_Format2 = "deltaF0";
|
||||
pucch_deltaF_Format2a = "deltaF0";
|
||||
pucch_deltaF_Format2b = "deltaF0";
|
||||
|
||||
rach_numberOfRA_Preambles = 64;
|
||||
rach_preamblesGroupAConfig = "DISABLE";
|
||||
/*
|
||||
rach_sizeOfRA_PreamblesGroupA = ;
|
||||
rach_messageSizeGroupA = ;
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
*/
|
||||
rach_powerRampingStep = 4;
|
||||
rach_preambleInitialReceivedTargetPower = -108;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 48;
|
||||
rach_maxHARQ_Msg3Tx = 4;
|
||||
|
||||
pcch_default_PagingCycle = 128;
|
||||
pcch_nB = "oneT";
|
||||
bcch_modificationPeriodCoeff = 2;
|
||||
ue_TimersAndConstants_t300 = 1000;
|
||||
ue_TimersAndConstants_t301 = 1000;
|
||||
ue_TimersAndConstants_t310 = 1000;
|
||||
ue_TimersAndConstants_t311 = 10000;
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
srb1_parameters :
|
||||
{
|
||||
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
|
||||
timer_poll_retransmit = 80;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
|
||||
timer_reordering = 35;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
|
||||
timer_status_prohibit = 0;
|
||||
|
||||
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
|
||||
poll_pdu = 4;
|
||||
|
||||
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
|
||||
poll_byte = 99999;
|
||||
|
||||
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
|
||||
max_retx_threshold = 4;
|
||||
}
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.62";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth4";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.242/24";
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth4";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.242/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,171 @@
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
eNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
eNB_ID = 0xe00;
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
mobile_country_code = "208";
|
||||
|
||||
mobile_network_code = "95";
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
frame_type = "FDD";
|
||||
tdd_config = 3;
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 13;
|
||||
downlink_frequency = 751000000L;
|
||||
uplink_frequency_offset = 31000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 25;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 125;
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
prach_zero_correlation = 1;
|
||||
prach_freq_offset = 2;
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 1;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pdsch_referenceSignalPower = -17;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
pusch_hoppingMode = "interSubFrame";
|
||||
pusch_hoppingOffset = 0;
|
||||
pusch_groupHoppingEnabled = "ENABLE";
|
||||
pusch_groupAssignment = 0;
|
||||
pusch_sequenceHoppingEnabled = "DISABLE";
|
||||
pusch_nDMRS1 = 1;
|
||||
phich_duration = "NORMAL";
|
||||
phich_resource = "ONESIXTH";
|
||||
srs_enable = "DISABLE";
|
||||
/* srs_BandwidthConfig =;
|
||||
srs_SubframeConfig =;
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -90;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -96;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
pucch_deltaF_Format2 = "deltaF0";
|
||||
pucch_deltaF_Format2a = "deltaF0";
|
||||
pucch_deltaF_Format2b = "deltaF0";
|
||||
|
||||
rach_numberOfRA_Preambles = 64;
|
||||
rach_preamblesGroupAConfig = "DISABLE";
|
||||
/*
|
||||
rach_sizeOfRA_PreamblesGroupA = ;
|
||||
rach_messageSizeGroupA = ;
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
*/
|
||||
rach_powerRampingStep = 4;
|
||||
rach_preambleInitialReceivedTargetPower = -108;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 48;
|
||||
rach_maxHARQ_Msg3Tx = 4;
|
||||
|
||||
pcch_default_PagingCycle = 128;
|
||||
pcch_nB = "oneT";
|
||||
bcch_modificationPeriodCoeff = 2;
|
||||
ue_TimersAndConstants_t300 = 1000;
|
||||
ue_TimersAndConstants_t301 = 1000;
|
||||
ue_TimersAndConstants_t310 = 1000;
|
||||
ue_TimersAndConstants_t311 = 10000;
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
srb1_parameters :
|
||||
{
|
||||
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
|
||||
timer_poll_retransmit = 80;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
|
||||
timer_reordering = 35;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
|
||||
timer_status_prohibit = 0;
|
||||
|
||||
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
|
||||
poll_pdu = 4;
|
||||
|
||||
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
|
||||
poll_byte = 99999;
|
||||
|
||||
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
|
||||
max_retx_threshold = 4;
|
||||
}
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.62";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth4";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.242/24";
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth4";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.242/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -31,12 +31,12 @@ eNBs =
|
||||
downlink_frequency = 751000000L;
|
||||
uplink_frequency_offset = 31000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 25;
|
||||
N_RB_DL = 50;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 100;
|
||||
rx_gain = 110;
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
@@ -64,7 +64,7 @@ eNBs =
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -86;
|
||||
pusch_p0_Nominal = -90;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -96;
|
||||
msg3_delta_Preamble = 6;
|
||||
@@ -82,7 +82,7 @@ eNBs =
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
*/
|
||||
rach_powerRampingStep = 4;
|
||||
rach_preambleInitialReceivedTargetPower = -108;
|
||||
rach_preambleInitialReceivedTargetPower = -100;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 48;
|
||||
@@ -133,7 +133,7 @@ eNBs =
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.62";
|
||||
mme_ip_address = ( { ipv4 = "172.27.8.52";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
@@ -142,11 +142,11 @@ eNBs =
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth4";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.242/24";
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "172.27.8.51/23";
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth4";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.242/24";
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "172.27.8.51/23";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
@@ -168,4 +168,4 @@ eNBs =
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
}
|
||||
);
|
||||
);
|
||||
@@ -17,7 +17,7 @@ eNBs =
|
||||
|
||||
mobile_country_code = "208";
|
||||
|
||||
mobile_network_code = "93";
|
||||
mobile_network_code = "95";
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
@@ -132,7 +132,7 @@ eNBs =
|
||||
};
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.171";
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.62";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
|
||||
@@ -150,7 +150,7 @@ rrh_gw_config = (
|
||||
rrh_gw_active = "yes";
|
||||
tr_preference = "raw";
|
||||
rf_preference = "usrp_b200";
|
||||
iq_txshift = 5;
|
||||
iq_txshift = 4;
|
||||
tx_sample_advance = 113;
|
||||
tx_scheduling_advance = 9;
|
||||
|
||||
@@ -163,8 +163,6 @@ rrh_gw_config = (
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24";
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth4";
|
||||
|
||||
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
@@ -133,7 +133,7 @@ eNBs =
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.26";
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.170";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
@@ -145,14 +145,14 @@ rrh_gw_config = (
|
||||
local_if_name = "eth0";
|
||||
#remote_address = "169.254.10.158";
|
||||
#local_address = "169.254.8.15";
|
||||
remote_address = "74:d4:35:cc:88:45";
|
||||
local_address = "98:90:96:df:66:07";
|
||||
remote_address = "74:d4:35:cc:88:e3";
|
||||
local_address = "74:d4:35:cc:88:d1";
|
||||
local_port = 50000; #for raw option local port must be the same to remote
|
||||
remote_port = 50000;
|
||||
rrh_gw_active = "yes";
|
||||
tr_preference = "raw";
|
||||
rf_preference = "usrp_b200";
|
||||
iq_txshift = 5;
|
||||
iq_txshift = 4;
|
||||
tx_sample_advance = 70;
|
||||
tx_scheduling_advance = 9;
|
||||
|
||||
@@ -162,12 +162,11 @@ rrh_gw_config = (
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth4";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.240/24";
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth4";
|
||||
|
||||
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.240/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ eNBs =
|
||||
|
||||
mobile_country_code = "208";
|
||||
|
||||
mobile_network_code = "93";
|
||||
mobile_network_code = "95";
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
@@ -28,7 +28,7 @@ eNBs =
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2660000000L;
|
||||
downlink_frequency = 2685000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 25;
|
||||
@@ -133,7 +133,7 @@ eNBs =
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.11";
|
||||
mme_ip_address = ( { ipv4 = "172.27.8.52";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
@@ -143,10 +143,10 @@ eNBs =
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "172.27.8.51/23";
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "172.27.8.51/23";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,185 +0,0 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) EURECOM / Thales Communications & Security
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in the
|
||||
* file called LICENSE.
|
||||
*
|
||||
* Contact Information:
|
||||
* Thales Communications & Security <philippe.agostini@thalesgroup.com>
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Includes
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include "ieee80211p-netlinkapi.h"
|
||||
#include "phy/DOT11/defs.h"
|
||||
#include "PHY/TOOLS/defs.h"
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <rtai_lxrt.h>
|
||||
#include <rtai_sem.h>
|
||||
#include <rtai_msg.h>
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Definitions
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
enum nl80211_band {
|
||||
NL80211_BAND_2GHZ,
|
||||
NL80211_BAND_5GHZ,
|
||||
NL80211_BAND_5_9GHZ,
|
||||
NL80211_BAND_0_8GHZ,
|
||||
};
|
||||
|
||||
enum ieee80211_band {
|
||||
IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ,
|
||||
IEEE80211_BAND_5GHZ = NL80211_BAND_5GHZ,
|
||||
IEEE80211_BAND_5_9GHZ = NL80211_BAND_5_9GHZ,
|
||||
IEEE80211_BAND_0_8GHZ = NL80211_BAND_0_8GHZ,
|
||||
};
|
||||
|
||||
struct ieee80211p_rx_status {
|
||||
short data_len; //frame data length in bytes
|
||||
char rssi; //received power in dBm
|
||||
char rate; //reveived data rate in units of 100 kbps
|
||||
enum ieee80211_band band;
|
||||
char flags; //RX flags
|
||||
}; /* struct ieee80211p_rx_status */
|
||||
|
||||
extern uint32_t *txdata[2],*rxdata[2];
|
||||
//CHANNEL_STATUS_t dot11_state = IDLE;
|
||||
extern int oai_exit;
|
||||
|
||||
extern unsigned int *DAQ_MBOX;
|
||||
|
||||
extern int Ndbps[8];
|
||||
|
||||
extern int32_t rxDATA_F_comp_aggreg2[48*1024];
|
||||
extern int32_t rxDATA_F_comp_aggreg3[48*1024];
|
||||
|
||||
extern uint32_t rxgain[4];
|
||||
extern uint32_t rxg_max[4], rxg_med[4], rxg_byp[4];
|
||||
|
||||
#define FRAME_LENGTH_SAMPLES 76800
|
||||
#define RX_THRES 60
|
||||
|
||||
#define SLOT_DURATION_5MHz 105
|
||||
#define RX_THRES_dB 40
|
||||
|
||||
int tx_sdu_active = 0;
|
||||
int tx_sdu_length = 0;
|
||||
char rxsdu[2000];
|
||||
|
||||
void *tx_thread(void *arg)
|
||||
{
|
||||
|
||||
int fd=*((int*)arg);
|
||||
RT_TASK *task;
|
||||
int ret;
|
||||
int i;
|
||||
char dummy_data[10];
|
||||
|
||||
|
||||
if (fd > 0) {
|
||||
|
||||
ret = netlink_send(fd,NLCMD_INIT,10,&dummy_data[0]);
|
||||
|
||||
printf("tx_thread starting, fd %d\n",fd);
|
||||
|
||||
task = rt_task_init_schmod(nam2num("TASK1"), 0, 0, 0, SCHED_FIFO, 0xF);
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
// rt_make_hard_real_time();
|
||||
|
||||
while (!oai_exit) {
|
||||
|
||||
if (tx_sdu_active == 1)
|
||||
printf("tx_thread: waiting (MBOX %d)\n",((unsigned int*)DAQ_MBOX)[0]);
|
||||
|
||||
while(((volatile int)tx_sdu_active) != 0) {
|
||||
rt_sleep(nano2count(66666));
|
||||
}
|
||||
|
||||
printf("tx_thread: calling netlink\n");
|
||||
ret = netlink_recv(fd,rxsdu);
|
||||
tx_sdu_active = 1;
|
||||
tx_sdu_length = ret;
|
||||
|
||||
/*
|
||||
if (ret > 0) {
|
||||
|
||||
printf("received TX SDU: ");
|
||||
for (i=0;i<ret;i++) {
|
||||
printf("%02hhx ",rxsdu[i]);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
} else {
|
||||
printf("tx_thread: no netlink\n");
|
||||
}
|
||||
|
||||
printf("tx_thread exiting\n");
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Main
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
int dot11_netlink_init() {
|
||||
|
||||
int fd;
|
||||
int ret;
|
||||
int i;
|
||||
char txdata[10];
|
||||
|
||||
fd = netlink_init();
|
||||
|
||||
if (fd < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = netlink_send(fd,NLCMD_INIT,10,&txdata[0]);
|
||||
|
||||
|
||||
|
||||
return(fd);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user