Commit a89620bd authored by gauthier's avatar gauthier

Merge branch 'develop' into Feature-6-fix_test_core_network_with_scenarios

parents 0c017f69 9ccc1999
/*******************************************************************************
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);
}
/*******************************************************************************
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
......@@ -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);
uint32_t N,
uint16_t output_shift);
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);
/*!\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;
......
[reference_clocks]
sxr_ref_clk_mhz=30.72
sxt_ref_clk_mhz=30.72
[lms7002_registers_b]
0x03A0=0x0000
0x054E=0x0000
0x02D0=0x0000
0x0386=0x0000
0x054F=0x0000
0x0389=0x0000
0x040F=0x0000
0x04E3=0x0000
0x0385=0x0000
0x0315=0x0000
0x0384=0x0000
0x0382=0x0000
0x0288=0x0000
0x0381=0x0000
0x0366=0x0000
0x0365=0x0000
0x0364=0x0000
0x0325=0x0000
0x035E=0x0000
0x035D=0x0000
0x0442=0x0000
0x0452=0x0000
0x0299=0x0000
0x0359=0x0000
0x029D=0x0000
0x04A3=0x0000
0x040E=0x0000
0x0316=0x0000
0x030D=0x0000
0x0356=0x0000
0x0348=0x0000
0x0498=0x0000
0x0490=0x0000
0x02CD=0x0000
0x050D=0x0000
0x0353=0x0000
0x0351=0x0000
0x048F=0x0000
0x0445=0x0000
0x0350=0x0000
0x03A6=0x0000
0x0293=0x0000
0x034E=0x0000
0x035C=0x0000
0x034D=0x0000
0x034B=0x0000
0x011A=0x2E02
0x0455=0x0000
0x034A=0x0000
0x035B=0x0000
0x0505=0x0000
0x0345=0x0000
0x035F=0x0000
0x0597=0x0000
0x0586=0x0000
0x0484=0x0000
0x02C8=0x0000
0x035A=0x0000
0x0561=0x0000
0x0344=0x0000
0x0343=0x0000
0x0342=0x0000
0x0380=0x0000
0x0327=0x0000
0x025E=0x0000
0x04DA=0x0000
0x04C2=0x0000
0x028C=0x0000
0x0352=0x0000
0x059C=0x0000
0x04DD=0x0000
0x028A=0x0000
0x0289=0x0000
0x031A=0x0000
0x0363=0x0000
0x0396=0x0000
0x0284=0x0000
0x010C=0x88FD
0x044C=0x0000
0x0355=0x0000
0x025C=0x0000
0x0515=0x0000
0x0361=0x0000
0x0205=0x0000
0x025B=0x0000
0x04C5=0x0000
0x04E2=0x0000
0x025A=0x0000
0x0256=0x0000
0x0240=0x0020
0x0367=0x0000
0x05A3=0x0000
0x0502=0x0000
0x0258=0x0000
0x0255=0x0000
0x040C=0x0000
0x028B=0x0000
0x0253=0x0000
0x024E=0x0000
0x0346=0x0000
0x0280=0x0000
0x0285=0x0000
0x024A=0x0000
0x0261=0x0000
0x0249=0x0000
0x04CD=0x0000
0x040A=0x0000
0x0556=0x0000
0x0243=0x0000
0x051D=0x0000
0x0494=0x0000
0x024C=0x0000
0x02DC=0x0000
0x038F=0x0000
0x0241=0x0000
0x0488=0x0000
0x0251=0x0000
0x020B=0x4000
0x0108=0x9442
0x04A0=0x0000
0x0116=0x8180
0x02CC=0x0000
0x039A=0x0000
0x0112=0xC0E6
0x0307=0x0000
0x038C=0x0000
0x0282=0x0000
0x0321=0x0000
0x0507=0x0000
0x0483=0x0000
0x0201=0x07FF
0x02E1=0x0000
0x0517=0x0000
0x0481=0x0000
0x02D5=0x0000
0x0259=0x0000
0x0527=0x0000
0x02DD=0x0000
0x0209=0x0000
0x0297=0x0000
0x0400=0x0081
0x0104=0x0088
0x0103=0x0A12
0x0347=0x0000
0x02D8=0x0000
0x0457=0x0000
0x0306=0x0000
0x02D1=0x0000
0x04C8=0x0000
0x0546=0x0000
0x0440=0x0020
0x045E=0x0000
0x031D=0x0000
0x039C=0x0000
0x02D2=0x0000
0x010E=0x2040
0x02A0=0x0000
0x0544=0x0000
0x029C=0x0000
0x055A=0x0000
0x0295=0x0000
0x02CF=0x0000
0x04D1=0x0000
0x0291=0x0000
0x02DF=0x0000
0x0290=0x0000
0x020A=0x0080
0x0102=0x3180
0x0120=0xB9FF
0x0388=0x0000
0x0318=0x0000
0x02A7=0x0000
0x0200=0x0081
0x0594=0x0000
0x02C5=0x0000
0x028D=0x0000
0x02A1=0x0000
0x0362=0x0000
0x038A=0x0000
0x0395=0x0000
0x058D=0x0000
0x02D7=0x0000
0x0305=0x0000
0x0393=0x0000
0x0398=0x0000
0x0408=0x0000
0x039B=0x0000
0x049E=0x0000
0x02DB=0x0000
0x0357=0x0000
0x02C2=0x0000
0x0514=0x0000
0x051C=0x0000
0x03A2=0x0000
0x03A4=0x0000
0x03A3=0x0000
0x0493=0x0000
0x0454=0x0000
0x0448=0x0000
0x0397=0x0000
0x02E3=0x0000
0x049C=0x0000
0x040D=0x0000
0x0281=0x0000
0x048C=0x0000
0x049A=0x0000
0x0119=0x18CB
0x010F=0x3042
0x02A6=0x0000
0x0257=0x0000
0x04D6=0x0000
0x04A6=0x0000
0x0324=0x0000
0x038E=0x0000
0x02E7=0x0000
0x034F=0x0000
0x04E0=0x0000
0x0123=0x267B
0x0497=0x0000
0x0459=0x0000
0x0394=0x0000
0x04A5=0x0000
0x04D9=0x0000
0x0304=0x0000
0x04D5=0x0000
0x0508=0x0000
0x0443=0x0000
0x0301=0x0000
0x0548=0x0000
0x04D2=0x0000
0x0592=0x0000
0x0591=0x0000
0x04C7=0x0000
0x049D=0x0000
0x029A=0x0000
0x051F=0x0000
0x0309=0x0000
0x0585=0x0000
0x03A5=0x0000
0x02D3=0x0000
0x0451=0x0000
0x0390=0x0000
0x0562=0x0000
0x02C4=0x0000
0x029E=0x0000
0x031E=0x0000
0x04C0=0x0000
0x04DC=0x0000
0x04DE=0x0000
0x058B=0x0000
0x04DB=0x0000
0x04D0=0x0000
0x0492=0x0000
0x04A1=0x0000
0x054B=0x0000
0x02C7=0x0000
0x05A0=0x0000
0x044B=0x0000
0x0100=0x3409
0x04CA=0x0000
0x0446=0x0000
0x02E4=0x0000
0x04E4=0x0000
0x04C3=0x0000
0x0496=0x0000
0x04CF=0x0000
0x025F=0x0000
0x04D4=0x0000
0x0504=0x0000
0x04CE=0x0000
0x02DE=0x0000
0x0399=0x0000
0x050C=0x0000
0x02A5=0x0000
0x04CC=0x0000
0x03A1=0x0000
0x04E1=0x0000
0x02A2=0x0000
0x040B=0x7FFF
0x0283=0x0000
0x048E=0x0000
0x0580=0x0000
0x0409=0x0000
0x039F=0x0000
0x0248=0x0000
0x048B=0x0000
0x0358=0x0000
0x0589=0x0000
0x038D=0x0000
0x0487=0x0000
0x0510=0x0000
0x0302=0x0000
0x0486=0x0000
0x045F=0x0000
0x0480=0x0000
0x0567=0x0000
0x02DA=0x0000
0x045A=0x0000
0x0254=0x0000
0x0405=0x0000
0x0387=0x0000
0x0458=0x0000
0x0314=0x0000
0x0360=0x0000
0x0559=0x0000
0x0456=0x0000
0x0453=0x0000
0x02E2=0x0000
0x044D=0x0000
0x0441=0x0000
0x02C3=0x0000
0x04C1=0x0000
0x04D3=0x0000
0x0444=0x0000
0x0207=0x0000
0x04C6=0x0000
0x0296=0x0000
0x0555=0x0000
0x0349=0x0000
0x0109=0x61C1
0x04A2=0x0000
0x0447=0x0000
0x0460=0x0000
0x048D=0x0000
0x059A=0x0000
0x0407=0x0000
0x02C0=0x0000
0x0499=0x0000
0x0543=0x0000
0x04C9=0x0000
0x02CA=0x0000
0x0404=0x0000
0x0560=0x0000
0x02C1=0x0000
0x04D8=0x0000
0x0403=0x0000
0x0491=0x0000
0x029B=0x0000
0x04C4=0x0000
0x010D=0x009E
0x0402=0x07FF
0x055E=0x0000
0x03A7=0x0000
0x0520=0x0000
0x0392=0x0000
0x030B=0x0000
0x0588=0x0000
0x0308=0x0000
0x048A=0x0000
0x044A=0x0000
0x04A4=0x0000
0x0300=0x0000
0x0587=0x0000
0x044E=0x0000
0x055B=0x0000
0x02E5=0x0000
0x0114=0x008D
0x0323=0x0000
0x0320=0x0000
0x0503=0x0000
0x0513=0x0000
0x0319=0x0000
0x0260=0x0000
0x0549=0x0000
0x0552=0x0000
0x0509=0x0000
0x0521=0x0000
0x0286=0x0000
0x04D7=0x0000
0x059E=0x0000
0x058F=0x0000
0x0557=0x0000
0x0322=0x0000
0x059B=0x0000
0x049F=0x0000
0x0522=0x0000
0x0545=0x0000
0x0551=0x0000
0x0312=0x0000
0x055D=0x0000
0x0298=0x0000
0x055F=0x0000
0x011D=0x9555
0x039E=0x0000
0x0547=0x0000
0x0598=0x0000
0x0449=0x0000
0x0564=0x0000
0x0242=0x0000
0x0525=0x0000
0x0523=0x0000
0x0565=0x0000
0x0124=0x0000
0x0563=0x0000
0x024D=0x0000
0x05A5=0x0000
0x0566=0x0000
0x030A=0x0000
0x029F=0x0000
0x054C=0x0000
0x0582=0x0000
0x0599=0x0000
0x0511=0x0000
0x0506=0x0000
0x0595=0x0000
0x0584=0x0000
0x058C=0x0000
0x05A6=0x0000
0x051E=0x0000
0x050F=0x0000
0x0590=0x0000
0x0596=0x0000
0x05A7=0x0000
0x058A=0x0000
0x059D=0x0000
0x0485=0x0000
0x0581=0x0000
0x045D=0x0000
0x0245=0x0000
0x0310=0x0000
0x058E=0x0000
0x05A2=0x0000
0x054D=0x0000
0x020C=0x7FFF
0x031F=0x0000
0x0292=0x0000
0x059F=0x0000
0x0583=0x0000
0x0317=0x0000
0x0244=0x0000
0x0554=0x0000
0x0593=0x0000
0x05A4=0x0000
0x02A3=0x0000
0x0553=0x0000
0x0542=0x0000
0x0519=0x0000
0x024F=0x0000
0x0524=0x0000
0x0518=0x0000
0x0354=0x0000
0x0526=0x0000
0x031B=0x0000
0x050E=0x0000
0x0516=0x0000
0x02CB=0x0000
0x0250=0x0000
0x031C=0x0000
0x028F=0x0000
0x051A=0x0000
0x055C=0x0000
0x050A=0x0000
0x050B=0x0000
0x04E7=0x0000
0x04E6=0x0000
0x04E5=0x0000
0x0512=0x0000
0x0206=0x0000
0x0550=0x0000
0x030E=0x0000
0x0203=0x0000
0x0482=0x0000
0x0541=0x0000
0x0122=0x033F
0x0110=0x0BF4
0x0204=0x0000
0x0252=0x0000
0x011E=0x05DC
0x049B=0x0000
0x0294=0x0000
0x011C=0xAD41
0x02D6=0x0000
0x0311=0x0000
0x0117=0x280C
0x02A4=0x0000
0x0540=0x0000
0x02E0=0x0000
0x0118=0x018C
0x0489=0x0000
0x04A7=0x0000
0x0101=0x7800
0x0558=0x0000
0x02C6=0x0000
0x05A1=0x0000
0x02C9=0x0000
0x039D=0x0000
0x0500=0x0000
0x0450=0x0000
0x011F=0x3680
0x030C=0x0000
0x04DF=0x0000
0x0106=0x3182
0x028E=0x0000
0x0326=0x0000
0x0113=0x03C3
0x04CB=0x0000
0x0391=0x0000
0x0105=0x0007
0x02D9=0x0000
0x02CE=0x0000
0x044F=0x0000
0x038B=0x0000
0x02D4=0x0000
0x0107=0x318C
0x0495=0x0000
0x0246=0x0000
0x0303=0x0000
0x02E6=0x0000
0x045B=0x0000
0x0340=0x0000
0x0208=0x0070
0x0111=0x0083
0x0247=0x0000
0x024B=0x0000
0x045C=0x0000
0x0383=0x0000
0x0202=0x07FF
0x054A=0x0000
0x0401=0x07FF
0x0341=0x0000
0x0287=0x0000
0x034C=0x0000
0x0501=0x0000
0x030F=0x0000
0x025D=0x0000
0x0406=0x0000
0x0313=0x0000
0x010A=0x104C
0x0461=0x0000
0x051B=0x0000
0x0121=0x356A
0x0115=0x0009
[lms7002_registers_a]
0x0107=0x318C
0x02D4=0x0000
0x0082=0x8001
0x0209=0x0000
0x02CA=0x0000
0x04C9=0x0000
0x0120=0xB9FF
0x0388=0x0000
0x029D=0x0000
0x04A3=0x0000
0x0208=0x0170
0x0340=0x0000
0x0094=0x0000
0x0244=0x0000
0x0317=0x0000
0x00A9=0x8000
0x0115=0x0009
0x039A=0x0000
0x0112=0x3171
0x048C=0x0000
0x0023=0x5550
0x0587=0x1D10
0x04C0=0x0000
0x031E=0x0000
0x0205=0x0000
0x0361=0x0000
0x051F=0xAB08
0x029A=0x0000
0x0396=0x0000
0x0284=0x0000
0x02CE=0x0000
0x02D9=0x0000
0x038B=0x0000
0x044F=0x0000
0x0367=0x0000
0x0240=0x0028
0x05A3=0x0000
0x0105=0x0007
0x009B=0x6565
0x0400=0x0101
0x02DB=0x0000
0x0357=0x0000
0x0104=0x0088
0x0103=0x0A12
0x0457=0x0000
0x0347=0x0000
0x02D8=0x0000
0x010C=0x8865
0x0086=0x4101
0x0202=0x0794
0x0383=0x0000
0x020B=0x4000
0x0108=0xFC26
0x0098=0x0000
0x0117=0x100C
0x0027=0x05E4
0x00A7=0x6565
0x024A=0x0000
0x0029=0x0101
0x00AD=0x03FF
0x0540=0x5009
0x02A4=0x0000
0x02DE=0x0000
0x002E=0x0000
0x0261=0x0000
0x00AB=0x0040
0x0564=0x0000
0x00A8=0x0000
0x0517=0xC89D
0x0481=0x0000
0x02C1=0x0000
0x0301=0x0000
0x00A5=0x6565
0x0515=0x2E45
0x025C=0x0000
0x009F=0x658C
0x0519=0x4049
0x054B=0xF7A3
0x02C7=0x0000
0x038C=0x0000
0x0307=0x0000
0x0282=0x0000
0x0289=0x0000
0x011C=0xAD41
0x0562=0xF524
0x0025=0x0101
0x02CC=0x0000
0x0116=0x8180
0x0597=0xFDFB
0x035F=0x0000
0x002F=0x3840
0x0589=0xEA5F
0x00A2=0x6565
0x0099=0x6565
0x0310=0x0000
0x040C=0x40F8
0x028B=0x0000
0x0253=0x0000
0x00AC=0x2000
0x002D=0xFFFF
0x00A6=0x0001
0x054D=0xF7A3
0x002C=0x0000
0x0249=0x0000
0x04CD=0x0000
0x0401=0x07FF
0x00A4=0x6565
0x054A=0x8184
0x038F=0x0000
0x008C=0x267B
0x0241=0x0000
0x0356=0x0000
0x00A1=0x6565
0x0260=0x0000
0x0453=0x0000
0x008A=0x0491
0x048F=0x0000
0x0445=0x0000
0x0350=0x0000
0x00AA=0x0000
0x034C=0x0000
0x0501=0xFDFB
0x0490=0x0000
0x02CD=0x0000
0x050D=0x0F45
0x0353=0x0000
0x0024=0x50D8
0x04E5=0x0000
0x0512=0x196B
0x0247=0x0000
0x045C=0x0000
0x024B=0x0000
0x0395=0x0000
0x011F=0x3680
0x039D=0x0000
0x0500=0xF61D
0x02C9=0x0000
0x05A1=0x0000
0x02A6=0x0000
0x0119=0x18DF
0x010F=0x3042
0x04CB=0x0000
0x0391=0x0000
0x0113=0x03C3
0x0326=0x0000
0x028E=0x0000
0x0106=0x3182
0x0524=0x3347
0x009D=0x6565
0x0294=0x0000
0x0026=0x0101
0x0110=0x0BFF
0x0122=0x033F
0x0381=0x0000
0x009C=0x658C
0x05A0=0x0000
0x0482=0x0000
0x030E=0x0000
0x0203=0x2F99
0x0095=0x0000
0x0111=0x0099
0x0256=0x0000
0x0089=0x0048
0x0085=0x0001
0x0088=0x04F0
0x0459=0x0000
0x0394=0x0000
0x010E=0x0285
0x02A0=0x0000
0x002B=0x4032
0x039C=0x0000
0x02D2=0x0000
0x0581=0xC89D
0x045D=0x0000
0x0245=0x0000
0x002A=0x0086
0x0118=0x018C
0x02E0=0x0000
0x0489=0x0000
0x04A7=0x0000
0x039E=0x0000
0x011D=0x2AAA
0x02E1=0x0000
0x0259=0x0000
0x02D5=0x0000
0x051D=0x4F91
0x0243=0x0000
0x0556=0xA2B5
0x040A=0x1000
0x05A2=0x0000
0x020C=0x8000
0x020A=0x0080
0x0102=0x3180
0x034F=0x0000
0x0303=0x0000
0x0306=0x0000
0x0255=0x0000
0x0300=0x0000
0x044E=0x0000
0x0309=0x0000
0x0585=0xDAA2
0x0527=0xACB9
0x044A=0x0000
0x04A4=0x0000
0x048A=0x0000
0x0392=0x0000
0x030B=0x0000
0x05A7=0x0000
0x0252=0x0000
0x0204=0xC016
0x0308=0x0000
0x0588=0xE6C7
0x0321=0x0000
0x0507=0xFCFE
0x0312=0x0000
0x050B=0xF5EF
0x0360=0x0000
0x0021=0x0E9F
0x04C2=0x0000
0x030D=0x0000
0x040E=0x0003
0x0316=0x0000
0x031F=0x0000
0x030C=0x0000
0x04DF=0x0000
0x0318=0x0000
0x0250=0x0000
0x02CB=0x0000
0x045E=0x0000
0x0440=0x0024
0x031D=0x0000
0x058D=0xF5EF
0x02D7=0x0000
0x0380=0x0000
0x0342=0x0000
0x0343=0x0000
0x0566=0x0906
0x0345=0x0000
0x049C=0x0000
0x02E3=0x0000
0x0397=0x0000
0x035B=0x0000
0x0505=0x00D8
0x028D=0x0000
0x02A1=0x0000
0x028F=0x0000
0x031C=0x0000
0x031A=0x0000
0x0363=0x0000
0x0596=0x0A94
0x0354=0x0000
0x0518=0xEFF2
0x035C=0x0000
0x034D=0x0000
0x0344=0x0000
0x0561=0xAB08
0x0096=0x0000
0x010D=0x01DC
0x04C4=0x0000
0x0351=0x0000
0x0311=0x0000
0x02D6=0x0000
0x02D1=0x0000
0x0546=0x8D44
0x04C8=0x0000
0x048B=0x0000
0x0358=0x0000
0x0522=0xDB10
0x049F=0x0000
0x034A=0x0000
0x0455=0x0000
0x0359=0x0000
0x03A4=0x0000
0x03A3=0x0000
0x0341=0x0000
0x0287=0x0000
0x04DA=0x0000
0x025E=0x0000
0x0580=0xEFF2
0x0409=0x0000
0x059A=0x0000
0x048D=0x0000
0x0514=0xE7E2
0x039B=0x0000
0x0101=0x7800
0x0558=0x5009
0x02C6=0x0000
0x051B=0xB77F
0x0313=0x0000
0x010A=0x104C
0x0461=0x0000
0x0406=0x0000
0x030F=0x0000
0x025D=0x0000
0x034B=0x0000
0x011A=0x2E14
0x029F=0x0000
0x030A=0x0000
0x034E=0x0000
0x0293=0x0000
0x03A6=0x0000
0x0560=0x174B
0x0404=0x0000
0x00A0=0x6565
0x0547=0xD7B7
0x0454=0x0000
0x0448=0x0000
0x0327=0x0000
0x0305=0x0000
0x0393=0x0000
0x0510=0xE6C7
0x0302=0x0000
0x0486=0x0000
0x045F=0x0000
0x0365=0x0000
0x048E=0x0000
0x0022=0x07FF
0x0283=0x0000
0x044B=0x0000
0x045A=0x0000
0x02DA=0x0000
0x04E4=0x0000
0x02E4=0x0000
0x03A5=0x0000
0x040B=0x000F
0x0366=0x0000
0x0443=0x0000
0x0508=0xEF99
0x00A3=0x6565
0x02E2=0x0000
0x044D=0x0000
0x0314=0x0000
0x0458=0x0000
0x0493=0x0000
0x0346=0x0000
0x024E=0x0000
0x055E=0xDB10
0x0402=0x07D9
0x0384=0x0000
0x02E6=0x0000
0x045B=0x0000
0x0480=0x0000
0x0567=0x4049
0x04CA=0x0000
0x0446=0x0000
0x0447=0x0000
0x0460=0x0000
0x0559=0xACB9
0x0456=0x0000
0x0441=0x0000
0x0444=0x0000
0x0390=0x0000
0x0451=0x0000
0x049E=0x0000
0x0324=0x0000
0x02E7=0x0000
0x038E=0x0000
0x0403=0x0013
0x04D8=0x0000
0x029B=0x0000
0x0491=0x0000
0x03A1=0x0000
0x04E1=0x0000
0x02A2=0x0000
0x051C=0x0000
0x03A2=0x0000
0x0407=0x0000
0x0258=0x0000
0x0502=0x0A94
0x038A=0x0000
0x0362=0x0000
0x028C=0x0000
0x0352=0x0000
0x0385=0x0000
0x0315=0x0000
0x040D=0x0000
0x039F=0x0000
0x0248=0x0000
0x0405=0x0000
0x0254=0x0000
0x0398=0x0000
0x0408=0x0000
0x0487=0x0000
0x038D=0x0000
0x035E=0x0000
0x03A7=0x0000
0x0520=0x174B
0x0449=0x0000
0x02C8=0x0000
0x035A=0x0000
0x0387=0x0000
0x0386=0x0000
0x0452=0x0000
0x0299=0x0000
0x0084=0x0400
0x0498=0x0000
0x0348=0x0000
0x02D0=0x0000
0x054E=0x8184
0x03A0=0x0000
0x009A=0x658C
0x055D=0xA6B5
0x0298=0x0000
0x0364=0x0000
0x0081=0x0000
0x0325=0x0000
0x040F=0x43E4
0x04E3=0x0000
0x050E=0x17DC
0x0516=0x150F
0x0389=0x0000
0x054F=0x18C9
0x0304=0x0000
0x04D5=0x0000
0x059B=0x0000
0x0322=0x0000
0x0442=0x0000
0x035D=0x0000
0x0492=0x0000
0x04A1=0x0000
0x0382=0x0000
0x0288=0x0000
0x0296=0x0000
0x0555=0xBD96
0x0349=0x0000
0x0484=0x0000
0x0586=0x196B
0x0281=0x0000
0x0200=0x0301
0x0594=0xF40D
0x02C5=0x0000
0x0319=0x0000
0x0121=0x3652
0x025B=0x0000
0x0290=0x0000
0x02DF=0x0000
0x0291=0x0000
0x029C=0x0000
0x008B=0x2756
0x02A3=0x0000
0x05A4=0x0000
0x02A7=0x0000
0x0483=0x0000
0x0201=0x07FF
0x02C2=0x0000
0x02C4=0x0000
0x0207=0x0000
0x04C6=0x0000
0x0093=0x0000
0x02D3=0x0000
0x0494=0x0000
0x04CF=0x0000
0x025F=0x0000
0x0251=0x0000
0x0488=0x0000
0x0496=0x0000
0x04C3=0x0000
0x0100=0xB409
0x04CC=0x0000
0x02A5=0x0000
0x0257=0x0000
0x04D6=0x0000
0x04A6=0x0000
0x049A=0x0000
0x049B=0x0000
0x0097=0x0000
0x011E=0x061D
0x0285=0x0000
0x0280=0x0000
0x0020=0xFFFD
0x02DD=0x0000
0x0297=0x0000
0x044C=0x0000
0x0355=0x0000
0x04A0=0x0000
0x02CF=0x0000
0x04D1=0x0000
0x0526=0xBE2A
0x0092=0x0001
0x031B=0x0000
0x0541=0x4C24
0x0543=0xBD96
0x02C0=0x0000
0x0499=0x0000
0x0513=0xDAA2
0x0549=0x18C9
0x0552=0x8D44
0x0521=0x5852
0x0509=0x0605
0x0286=0x0000
0x024F=0x0000
0x04E0=0x0000
0x0545=0x364E
0x0551=0xD7B7
0x055F=0x5852
0x009E=0x658C
0x0598=0xF61D
0x0123=0x067B
0x0497=0x0000
0x04A5=0x0000
0x0565=0xB77F
0x0124=0x0000
0x0592=0x0DF1
0x0591=0xFCFE
0x0548=0x79FA
0x04D2=0x0000
0x0599=0x0000
0x0511=0x1D10
0x0506=0x0DF1
0x0595=0x00BC
0x0584=0xE7E2
0x0242=0x0000
0x025A=0x0000
0x04E2=0x0000
0x04C5=0x0000
0x058C=0xEA50
0x0450=0x0000
0x058A=0x17DC
0x059D=0x0000
0x0485=0x0000
0x058E=0x1316
0x0550=0x79FA
0x0554=0x6901
0x0593=0x00D8
0x0553=0x364E
0x0542=0xA2B5
0x0563=0x4F91
0x024D=0x0000
0x055A=0xBE2A
0x0295=0x0000
0x028A=0x0000
0x059C=0x0000
0x04DD=0x0000
0x054C=0x7FFF
0x0582=0x150F
0x0109=0x8CC1
0x04A2=0x0000
0x0292=0x0000
0x0583=0x2E45
0x059F=0x0000
0x0525=0x57AC
0x0523=0xA6B5
0x0206=0x0000
0x051A=0x0906
0x055C=0x3347
0x05A6=0x0000
0x050F=0xEA5F
0x051E=0xF524
0x050A=0x1316
0x04C7=0x0000
0x049D=0x0000
0x050C=0xEA50
0x0087=0x0000
0x0399=0x0000
0x0495=0x0000
0x0246=0x0000
0x0503=0x00BC
0x0320=0x0000
0x0323=0x0000
0x055B=0x57AC
0x0114=0x0110
0x02E5=0x0000
0x04E7=0x0000
0x04D0=0x0000
0x04E6=0x0000
0x00AE=0x0000
0x0544=0x6901
0x04DE=0x0000
0x058B=0x0F45
0x0028=0x0101
0x029E=0x0000
0x04DC=0x0000
0x04D9=0x0000
0x058F=0x0605
0x0557=0x4C24
0x04DB=0x0000
0x04D7=0x0000
0x059E=0x0000
0x024C=0x0000
0x02DC=0x0000
0x04D4=0x0000
0x0504=0xF40D
0x02C3=0x0000
0x04C1=0x0000
0x04D3=0x0000
0x0590=0xEF99
0x04CE=0x0000
0x05A5=0x0000
[file_info]
version=1
type=lms7002m_minimal_config
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";
};
}
);
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";
};
}
);
);
\ No newline at end of file
......@@ -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
};
......
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2011 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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 St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fsr/openairinterface
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
*******************************************************************************/
<<<<<<< .mine
/*! \file dot11.c
* \brief main program to control HW and scheduling for openairITS dot11 MODEM
* \author R. Knopp, F. Kaltenberger
* \date 2012
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
* \note
* \warning
*/
=======
/*! \file dot11.c
* \brief main program to control HW and scheduling for openairITS dot11 MODEM
* \author R. Knopp, F. Kaltenberger
* \date 2012
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
* \note
* \warning
*/
>>>>>>> .r3153
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sched.h>
#include <signal.h>
#include <execinfo.h>
#include <getopt.h>
#include <rtai_lxrt.h>
#include <rtai_sem.h>
#include <rtai_msg.h>
#include "PHY/types.h"
#include "PHY/defs.h"
#include "ARCH/COMMON/defs.h"
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_pci.h"
#include "SIMULATION/LTE_PHY/openair_hw.h"
#include "ARCH/CBMIMO1/DEVICE_DRIVER/vars.h"
#include "SCHED/defs.h"
#include "SCHED/vars.h"
<<<<<<< .mine
#include "phy/DOT11/defs.h"
#include "phy/DOT11/commonvars.h"
#include <malloc.h>
=======
#include "phy/DOT11/defs.h"
#include "phy/DOT11/commonvars.h"
#include "PHY/TOOLS/defs.h"
>>>>>>> .r3153
<<<<<<< .mine
=======
#include <malloc.h>
>>>>>>> .r3153
<<<<<<< .mine
#include "UTIL/LOG/log.h"
=======
>>>>>>> .r3153
<<<<<<< .mine
#define FRAME_LENGTH_SAMPLES_MAX 100000
uint16_t rev64[64];
int generate_test_tx=0;
=======
#include "UTIL/LOG/log.h"
#include "ieee80211p-netlinkapi.h"
#define FRAME_LENGTH_SAMPLES_MAX 100000
uint16_t rev64[64];
int generate_test_tx=0;
>>>>>>> .r3153
#define FRAME_PERIOD 100000000ULL
#define DAQ_PERIOD 66666ULL
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
enum nl80211_band {
NL80211_BAND_2GHZ,
NL80211_BAND_5GHZ,
NL80211_BAND_5_9GHZ,
NL80211_BAND_0_8GHZ,
};
<<<<<<< .mine
=======
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 */
>>>>>>> .r3153
//static CND *cond;
static int thread1;
static int thread2;
static int sync_thread;
static int instance_cnt=-1; //0 means worker is busy, -1 means its free
int instance_cnt_ptr_kern,*instance_cnt_ptr_user;
int pci_interface_ptr_kern;
extern unsigned int bigphys_top;
extern unsigned int mem_base;
int openair_fd = 0;
int oai_exit = 0;
//PCI_interface_t *pci_interface[3];
unsigned int *DAQ_MBOX;
unsigned int time_offset[4] = {0,0,0,0};
int fs4_test=0;
char UE_flag=0;
struct timing_info_t {
unsigned int frame, hw_slot, last_slot, next_slot;
RTIME time0, time1, time2;
unsigned int mbox0, mbox1, mbox2, mbox_target;
} timing_info[20];
extern s16* sync_corr_ue0;
extern s16 prach_ifft[4][1024*2];
typedef enum {normal_txrx=0,rx_calib_ue=1,rx_calib_ue_med=2,rx_calib_ue_byp=3} runmode_t;
runmode_t mode;
int rx_input_level_dBm;
int otg_enabled = 0;
TX_RX_VARS dummy_tx_rx_vars;
unsigned int bigphys_top;
unsigned int mem_base;
<<<<<<< .mine
uint32_t *txdata[2],*rxdata[2];
uint8_t *data_ind = NULL;
extern int dot11_netlink_init();
extern void *rx_thread(void *);
extern void *tx_thread(void *);
void dot11_init()
{
set_taus_seed(0);
// Basic initializations
init_fft(64,6,rev64);
init_interleavers();
ccodedot11_init();
ccodedot11_init_inv();
phy_generate_viterbi_tables();
init_crc32();
}
=======
uint32_t *txdata[2],*rxdata[2];
>>>>>>> .r3153
<<<<<<< .mine
void generate_test_tx_signal()
{
=======
uint8_t *data_ind = NULL;
>>>>>>> .r3153
<<<<<<< .mine
TX_VECTOR_t tx_vector;
int i;
if (data_ind == NULL) {
data_ind = (uint8_t*)malloc(4095+2+1);
data_ind[0] = 0;
data_ind[1] = 0;
}
tx_vector.rate=1;
tx_vector.sdu_length=512;
tx_vector.service=0;
for (i=0; i<tx_vector.sdu_length; i++)
data_ind[i+2] = taus(); // randomize packet
data_ind[tx_vector.sdu_length+2+4]=0; // Tail byte
printf("Generating signal at %p\n",txdata[0]);
phy_tx_start(&tx_vector,txdata[0],0,data_ind);
}
void signal_handler(int sig)
{
void *array[10];
size_t size;
=======
CHANNEL_STATUS_t dot11_state = IDLE;
extern int Ndbps[8];
>>>>>>> .r3153
extern int32_t rxDATA_F_comp_aggreg3[48*1024];
extern int32_t rxDATA_F_comp_aggreg2[48*1024];
#define FRAME_LENGTH_SAMPLES 76800
#define RX_THRES 60
#define SLOT_DURATION_5MHz 105
#define RX_THRES_dB 300
u32 rxgain[4]= {30,30,30,30};
unsigned int rxg_max[4]= {133,133,133,133}, rxg_med[4]= {127,127,127,127}, rxg_byp[4]= {120,120,120,120};
extern int tx_sdu_active;
extern int tx_sdu_length;
extern char rxsdu[2000];
int n;
static void *rx_thread(void *arg) {
int fd = *((int*)arg);
int rx_offset;
RX_VECTOR_t *rxv;
uint8_t *data_ind_rx;
int i;
struct ieee80211p_rx_status *rs;
int ret,frame;
RT_TASK *task;
int16_t rx_energy;
int initial_sample_offset = 0,off=0;
int dlen,dlen_symb;
int mbox_off = 0,old_mbox,mbox_diff;
int rt_skip_cond;
int pos_crc=0,neg_crc=0;
int sdu_received;
int sample_threshold;
int log2_maxh;
struct sched_param mysched;
int skip=0;
int txlen;
/* mysched.sched_priority = 99;
sched_setscheduler( 0, SCHED_FIFO, &mysched);
*/
char dummy_data[16];
if (fd>0) {
printf("rx_thread starting, fd %d\n",fd);
data_ind_rx = (uint8_t*)malloc(4095+2+1+12);
task = rt_task_init_schmod(nam2num("TASK0"), 0, 0, 0, SCHED_FIFO, 0xF);
mlockall(MCL_CURRENT | MCL_FUTURE);
// rt_make_hard_real_time();
// printf("Started rx_thread ... MBOX %d\n",((unsigned int *)DAQ_MBOX)[0]);
// wait until MBOX gets around to zero
i=0;
while (((volatile unsigned int *)DAQ_MBOX)[0] != 0) {
rt_sleep(nano2count(10000));
if (i>1000) {
printf("HW not counting,exiting rx_thread\n");
return(0);
}
}
// printf("Got first MBOX = 0\n");
// wait for first 120us
while (((unsigned int *)DAQ_MBOX)[0] < 2)
rt_sleep(nano2count(2*66666));
old_mbox = ((unsigned int *)DAQ_MBOX)[0];
// printf("MBOX = %d\n",((unsigned int *)DAQ_MBOX)[0]);
i = 0;
frame = 0;
// oai_exit=1;
rt_skip_cond=0;
while (!oai_exit) {
// printf("While in ... mbox %d\n",((unsigned int *)DAQ_MBOX)[0]);
rx_energy = dB_fixed_times10(signal_energy((int32_t*)(rxdata[0]+(initial_sample_offset&(~0x1))),
SLOT_DURATION_5MHz - (SLOT_DURATION_5MHz&1)));
sdu_received = 0;
if (rx_energy>RX_THRES_dB) {
if (initial_sample_offset < SLOT_DURATION_5MHz)
off = initial_sample_offset + FRAME_LENGTH_SAMPLES - SLOT_DURATION_5MHz;
else
off = initial_sample_offset - SLOT_DURATION_5MHz;
if (((dot11_state = initial_sync(&rxv,
&rx_offset,
&log2_maxh,
rxdata[0],
FRAME_LENGTH_SAMPLES,
off,
1)) == BUSY)) {
//if ((frame % 100) == 0)
// printf("Channel is busy, rxv %p, offset %d\n",(void*)rxv,rx_offset);
if (rxv) {
rx_energy = dB_fixed_times10(signal_energy((int32_t*)(rxdata[0]+rx_offset),
80));
// if ((frame%100) == 0)
printf("Frame %d: Rate %d, SDU_LENGTH %d,rx_offset %d,log2_maxh %d, rxp %f dBm (dig %f,rxgain %d)\n",
frame,rxv->rate,rxv->sdu_length,rx_offset,log2_maxh,(rx_energy/10.0)-rxg_max[0]+30-rxgain[0],
rx_energy/10.0,rxg_max[0]-30+rxgain[0]);
if ((rxv->sdu_length > 1500) || (rxv->rate > 3) )
printf("ERROR: Frame %d: Rate %d, SDU_LENGTH %d,rx_offset %d,log2_maxh %d, rxp %f dBm (dig %f,rxgain %d)\n",
frame,rxv->rate,rxv->sdu_length,rx_offset,log2_maxh,(rx_energy/10.0)-rxg_max[0]+30-rxgain[0],
rx_energy/10.0,rxg_max[0]-30+rxgain[0]);
else {
memset((void*)&data_ind_rx[10],0,rxv->sdu_length+4+2+1+16);
<<<<<<< .mine
=======
if (data_detection(rxv,&data_ind_rx[10],
(uint32_t*)rxdata[0],
76800,rx_offset,log2_maxh,NULL)) {
pos_crc++;
printf("Received SDU with positive CRC\n");
if (fd) {
rs = (struct ieee80211p_rx_status *)&data_ind_rx[0];
rs->data_len = rxv->sdu_length;
rs->rssi = (char)((rx_energy/10.0)-rxg_max[0]+30-rxgain[0]);
rs->rate = 60;
rs->band = IEEE80211_BAND_0_8GHZ;
rs->flags = 0;
ret = netlink_send(fd,NLCMD_DATA,128,&data_ind_rx[0]);
}
} else {
neg_crc++;
printf("Received SDU with negative CRC\n");
oai_exit=1;
write_output("rxDATA_F_comp_aggreg3.m","rxDAT_F_comp_aggreg3", rxDATA_F_comp_aggreg3,48*200,1,1);
write_output("rxsig_sdu.m","rxsig_sdu",&rxdata[0][rx_offset],80*40,1,1);
// write_output("rxDATA_F_comp_aggreg2.m","rxDAT_F_comp_aggreg2", rxDATA_F_comp_aggreg2,48*200,1,1);
}
sdu_received = 1;
// oai_exit = 1;
dlen = 32+16+6+(rxv->sdu_length<<3); // data length is 32-bits CRC + sdu + 16 service + 6 tail
dlen_symb = dlen/Ndbps[rxv->rate];
if ((dlen%Ndbps[rxv->rate])>0)
dlen_symb++;
// printf("after dd: initial_sample_offset %d =>",initial_sample_offset);
initial_sample_offset = rx_offset + (80*dlen_symb);
// printf("%d\n",initial_sample_offset);
}
} else {
printf("BUSY, no synch (off %d) Frame %d (%llu us): rxp %f dBm (dig %f,rxgain %d)\n",
off,frame,rt_get_time_ns()/1000,(rx_energy/10.0)-rxg_max[0]+30-rxgain[0],
rx_energy/10.0,rxg_max[0]-30+rxgain[0]);
}
} else {
/* printf("Frame %d (%llu us): rxp %d dBm (dig %d,rxgain %d)\n",
frame,rt_get_time_ns()/1000,rx_energy-rxg_max[0]+30-rxgain[0],
rx_energy,rxg_max[0]-30+rxgain[0]);
*/
}
} else {
if (((frame%100) == 0) && (initial_sample_offset < 2*SLOT_DURATION_5MHz)) {
printf("Frame %d (%llu us): rxp %f dBm (dig %f,rxgain %d)\n",
frame,rt_get_time_ns()/1000,(rx_energy/10.0)-rxg_max[0]+30-rxgain[0],
rx_energy/10.0,rxg_max[0]-30+rxgain[0]);
}
if ((frame > 100) &&
(tx_sdu_active == 1) &&
(initial_sample_offset < 60000)) {
printf("Frame %d: Generating SDU of length %d (%p), initial_sample_offset %d, MBOX <<9 %d\n",frame,tx_sdu_length,rxsdu,initial_sample_offset,DAQ_MBOX[0]<<9); /*
for (n=0;n<tx_sdu_length;n++)
printf("%2hhx.",rxsdu[n]);
printf("\n");
*/
initial_sample_offset += (8*512);
if (initial_sample_offset > FRAME_LENGTH_SAMPLES)
initial_sample_offset -= FRAME_LENGTH_SAMPLES;
txlen= generate_tx_signal(initial_sample_offset);
// wait until TX is finished
printf("TX: txlen %d, initial_sample_offset %d\n",txlen,initial_sample_offset);
//oai_exit=1;
rt_sleep(nano2count((66666*8)+((txlen*66666)>>9)));
skip = initial_sample_offset+txlen-FRAME_LENGTH_SAMPLES;
if (skip < 0)
skip = 0;
printf("TX: erasing signal, MBOX %d (%d)\n",DAQ_MBOX[0],DAQ_MBOX[0]<<9);
// erase TX signal
for (i=0; i<(txlen-skip); i++)
txdata[0][initial_sample_offset+i] = 0x00010001;
for (i=0; i<skip; i++)
txdata[0][i] = 0x00010001;
initial_sample_offset += txlen;
if (initial_sample_offset > FRAME_LENGTH_SAMPLES) {
initial_sample_offset -= FRAME_LENGTH_SAMPLES;
frame++;
mbox_off = 0;
}
tx_sdu_active = 0;
old_mbox = DAQ_MBOX[0];
}
//rt_sleep(nano2count(10000));
// printf("back from sleep 10000 ... mbox %d\n",((unsigned int *)DAQ_MBOX)[0]);
}
initial_sample_offset+=SLOT_DURATION_5MHz;
if (initial_sample_offset>FRAME_LENGTH_SAMPLES) {
initial_sample_offset-=FRAME_LENGTH_SAMPLES;
mbox_off = 0;
frame++;
// if ((frame%100) == 0)
//printf("**** New frame %d\n",frame);
if (frame == 100000)
oai_exit = 1;
}
// sleep until HW has filled enough samples
mbox_diff = ((unsigned int*)DAQ_MBOX)[0]-old_mbox;
// if ((frame%100) == 0)
// printf("frame %d, old_mbox %d, mbox %d (initial_sample_offset %d : mbox<<9 %d)\n",frame,old_mbox,((unsigned int*)DAQ_MBOX)[0],initial_sample_offset,((unsigned int*)DAQ_MBOX)[0]<<9);
if ((mbox_diff>10) && (sdu_received == 0)) {
mbox_off = 0;
initial_sample_offset = ((unsigned int*)DAQ_MBOX)[0]<<9;
// printf("initial_sample_offset adjusted %d\n",initial_sample_offset);
rt_skip_cond++;
// printf("old_mbox %d, mbox %d (initial_sample_offset %d : mbox<<9 %d)\n",
// old_mbox,((unsigned int*)DAQ_MBOX)[0],initial_sample_offset,((unsigned int*)DAQ_MBOX)[0]<<9);
old_mbox = ((unsigned int *)DAQ_MBOX)[0];
} else {
if (old_mbox > ((unsigned int *)DAQ_MBOX)[0])
mbox_off = 150;
old_mbox = ((unsigned int *)DAQ_MBOX)[0];
}
/*
printf("off: %d (%d,%d), mbox_off %d => rx_energy %d\n",initial_sample_offset,
((unsigned int *)DAQ_MBOX)[0],
(initial_sample_offset>>9),mbox_off,
rx_energy);
*/
sample_threshold = initial_sample_offset+1024;
if (sample_threshold > FRAME_LENGTH_SAMPLES)
sample_threshold -= FRAME_LENGTH_SAMPLES;
while (old_mbox+mbox_off <= (sample_threshold>>9)) {
// if ((frame % 100) == 0)
// printf("sleeping (mbox %d, mbox_off %d, initial_sample_offset>>9 %d\n",
// old_mbox,mbox_off,(initial_sample_offset>>9));
rt_sleep(nano2count(66666));
if (old_mbox > ((unsigned int *)DAQ_MBOX)[0])
mbox_off = 150;
old_mbox = ((unsigned int *)DAQ_MBOX)[0];
}
// printf("While out ... mbox %d\n",((unsigned int *)DAQ_MBOX)[0]);
}
printf("rt_skip_cond %d, frames %d, pos_crc %d, neg_crc %d\n",
rt_skip_cond,frame,pos_crc,neg_crc);
printf("Dumping IS stats\n");
print_is_stats();
print_dd_stats();
write_output("rxsig0.m","rxs", rxdata[0],76800,1,1);
write_output("txsig0.m","txs", txdata[0],76800,1,1);
write_output("rxDATA_F_comp_aggreg3.m","rxDAT_F_comp_aggreg3", rxDATA_F_comp_aggreg3,48*200,1,1);
write_output("rxDATA_F_comp_aggreg2.m","rxDAT_F_comp_aggreg2", rxDATA_F_comp_aggreg2,48*200,1,1);
printf("[DOT11][PHY] Leaving rx_thread\n");
free(data_ind_rx);
} else {
printf("[DOT11][PHY] No netlink, exiting\n");
}
return(0);
}
//extern int dot11_netlink_init();
//extern int dot11_rx_thread_init();
//extern void *rx_thread(void *);
extern void *tx_thread(void *);
void dot11_init() {
set_taus_seed(0);
// Basic initializations
init_fft(64,6,rev64);
init_interleavers();
ccodedot11_init();
ccodedot11_init_inv();
phy_generate_viterbi_tables();
init_crc32();
}
int generate_tx_signal(int tx_offset) {
TX_VECTOR_t tx_vector;
int i;
printf("Generating Signal @ %d (MBOX << 9 = %d)\n",
tx_offset,DAQ_MBOX[0]<<9);
if (data_ind == NULL) {
data_ind = (uint8_t*)malloc(4095+2+1);
data_ind[0] = 0;
data_ind[1] = 0;
}
tx_vector.rate=1;
tx_vector.sdu_length=tx_sdu_length;
tx_vector.service=0;
for (i=0; i<tx_vector.sdu_length; i++)
data_ind[i+2] = rxsdu[i];
data_ind[tx_vector.sdu_length+2+4]=0; // Tail byte
>>>>>>> .r3153
// printf("Generating signal at %p\n",txdata[0]);
return(phy_tx_start(&tx_vector,txdata[0],tx_offset,FRAME_LENGTH_SAMPLES,data_ind));
}
void signal_handler(int sig) {
void *array[10];
size_t size;
oai_exit=1;
// get void*'s for all entries on the stack
size = backtrace(array, 10);
// print out all the frames to stderr
fprintf(stderr, "Error: signal %d:\n", sig);
backtrace_symbols_fd(array, size, 2);
exit(-1);
}
void exit_fun(const char* s) {
void *array[10];
size_t size;
int fd;
printf("Exiting: %s\n",s);
oai_exit=1;
rt_sleep(nano2count(FRAME_PERIOD));
// cleanup
stop_rt_timer();
fd = 0;
ioctl(openair_fd,openair_STOP,&fd);
munmap((void*)mem_base, BIGPHYS_NUMPAGES*4096);
exit (-1);
}
int dummy_tx_buffer[3840*4] __attribute__((aligned(16)));
/* This is the main dot11 thread. */
static void *dot11_thread(void *arg) {
RT_TASK *task;
int slot=0,hw_slot,last_slot, next_slot,frame=0;
unsigned int msg1;
unsigned int aa,slot_offset, slot_offset_F;
int diff;
int delay_cnt;
RTIME time_in;
int mbox_target=0,mbox_current=0;
int i;
task = rt_task_init_schmod(nam2num("TASK0"), 0, 0, 0, SCHED_FIFO, 0xF);
mlockall(MCL_CURRENT | MCL_FUTURE);
#ifdef HARD_RT
<<<<<<< .mine
rt_printk("Started dot11 thread (id %p)\n",task);
rt_make_hard_real_time();
#else
printf("Started dot11 thread (id %p)\n",task);
#endif
=======
rt_printk("Started dot11 thread (id %p)\n",task);
>>>>>>> .r3153
<<<<<<< .mine
while (!oai_exit) {
// rt_printk("eNB: slot %d\n",slot);
=======
>>>>>>> .r3153
<<<<<<< .mine
=======
rt_make_hard_real_time();
#else
>>>>>>> .r3153
printf("Started dot11 thread (id %p)\n",task);
<<<<<<< .mine
if (frame>5) {
if ((frame%100)==0)
#ifdef HARD_RT
rt_printk("slot %d, hw_slot %d, next_slot %d (before): DAQ_MBOX %d\n", slot, hw_slot,next_slot,DAQ_MBOX[0]);
#else
printf("frame %d slot %d, hw_slot %d, next_slot %d (before): DAQ_MBOX %d\n", frame,slot, hw_slot,next_slot,DAQ_MBOX[0]);
#endif
if (fs4_test==0) {
if ((next_slot == 0) && (generate_test_tx==1) && ((frame%100)==0)) {
printf("Generating tx_signal in frame %d ...",frame);
generate_test_tx_signal();
printf("done\n");
} else { // Check for normal TX packet
/*for (i=0;i<3840;i++) {
((uint32_t *)txdata[0] + (3840*next_slot))[i] = 0x00010001;
}*/
}
}
}
=======
while (!oai_exit) {
// rt_printk("eNB: slot %d\n",slot);
hw_slot = (((((unsigned int *)DAQ_MBOX)[0]+1)%150)<<1)/15;
//this is the mbox counter where we should be
mbox_target = ((((slot+1)%20)*15+1)>>1)%150;
//this is the mbox counter where we are
mbox_current = ((unsigned int *)DAQ_MBOX)[0];
//this is the time we need to sleep in order to synchronize with the hw (in multiples of DAQ_PERIOD)
if ((mbox_current>=135) && (mbox_target<15)) //handle the frame wrap-arround
diff = 150-mbox_current+mbox_target;
else if ((mbox_current<15) && (mbox_target>=135))
diff = -150+mbox_target-mbox_current;
else
diff = mbox_target - mbox_current;
if (diff < (-5)) {
printf("[dot11_thread] Frame %d: missed slot, proceeding with next one (slot %d, hw_slot %d, diff %d)\n",frame, slot, hw_slot, diff);
>>>>>>> .r3153
slot++;
if (slot==20)
<<<<<<< .mine
slot=0;
//slot++;
if ((slot%20)==0)
frame++;
=======
slot=0;
continue;
>>>>>>> .r3153
}
if (diff>8)
printf("[dot11_thread] eNB Frame %d: skipped slot, waiting for hw to catch up (slot %d, hw_slot %d, mbox_current %d, mbox_target %d, diff %d)\n",frame, slot, hw_slot, mbox_current, mbox_target, diff);
delay_cnt = 0;
while ((diff>0) && (!oai_exit)) {
time_in = rt_get_time_ns();
//rt_printk("eNB Frame %d delaycnt %d : hw_slot %d (%d), slot %d, (slot+1)*15=%d, diff %d, time %llu\n",frame,delay_cnt,hw_slot,((unsigned int *)DAQ_MBOX)[0],slot,(((slot+1)*15)>>1),diff,time_in);
//rt_printk("Frame %d: slot %d, sleeping for %llu\n", frame, slot, diff*DAQ_PERIOD);
rt_sleep(nano2count(diff*DAQ_PERIOD));
hw_slot = (((((unsigned int *)DAQ_MBOX)[0]+1)%150)<<1)/15;
//rt_printk("eNB Frame %d : hw_slot %d, time %llu\n",frame,hw_slot,rt_get_time_ns());
delay_cnt++;
if (delay_cnt == 10) {
oai_exit = 1;
printf("[dot11_thread]eNB Frame %d: HW stopped ... \n",frame);
}
mbox_current = ((unsigned int *)DAQ_MBOX)[0];
if ((mbox_current>=135) && (mbox_target<15)) //handle the frame wrap-arround
diff = 150-mbox_current+mbox_target;
else
diff = mbox_target - mbox_current;
}
last_slot = (slot)%LTE_SLOTS_PER_FRAME;
if (last_slot <0)
last_slot+=20;
next_slot = (slot+3)%LTE_SLOTS_PER_FRAME;
<<<<<<< .mine
=======
if (frame>5) {
if ((frame%100)==0)
#ifdef HARD_RT
rt_printk("slot %d, hw_slot %d, next_slot %d (before): DAQ_MBOX %d\n", slot, hw_slot,next_slot,DAQ_MBOX[0]);
#else
printf("frame %d slot %d, hw_slot %d, next_slot %d (before): DAQ_MBOX %d\n", frame,slot, hw_slot,next_slot,DAQ_MBOX[0]);
#endif
if (fs4_test==0) {
if ((next_slot == 0) && (generate_test_tx==1) && ((frame%100)==0)) {
printf("Generating tx_signal in frame %d ...",frame);
//generate_test_tx_signal();
printf("done\n");
} else { // Check for normal TX packet
/*for (i=0;i<3840;i++) {
((uint32_t *)txdata[0] + (3840*next_slot))[i] = 0x00010001;
}*/
}
}
}
slot++;
if (slot==20)
slot=0;
//slot++;
if ((slot%20)==0)
frame++;
}
rt_printk("fun0: finished, ran %d times.\n",slot);
#ifdef HARD_RT
rt_make_soft_real_time();
#endif
// clean task
rt_task_delete(task);
rt_printk("Task deleted. returning\n");
return 0;
}
>>>>>>> .r3153
int main(int argc, char **argv) {
RT_TASK *task;
int i,j,aa;
LTE_DL_FRAME_PARMS *frame_parms;
u32 carrier_freq[4]= {1907600000,1907600000,1907600000,1907600000};
u32 rf_mode_max[4] = {55231,55231,55231,55231};
u32 rf_mode_med[4] = {39375,39375,39375,39375};
u32 rf_mode_byp[4] = {22991,22991,22991,22991};
u32 rf_local[4] = {8255000,8255000,8255000,8255000}; // UE zepto
//{8254617, 8254617, 8254617, 8254617}; //eNB khalifa
//{8255067,8254810,8257340,8257340}; // eNB PETRONAS
u32 rf_vcocal[4] = {2340,2340,2340,2340};
u32 rf_rxdc[4] = {32896,32896,32896,32896};
<<<<<<< .mine
u32 rxgain[4]= {20,20,20,20};
=======
>>>>>>> .r3153
<<<<<<< .mine
=======
>>>>>>> .r3153
u8 eNB_id=0,UE_id=0;
u16 Nid_cell = 0;
u8 cooperation_flag=0, transmission_mode=1, abstraction_flag=0;
u8 beta_ACK=0,beta_RI=0,beta_CQI=2;
int c;
char do_forms=0;
unsigned int fd,dot11_netlink_fd;
unsigned int tcxo = 114;
int amp;
char rxg_fname[100];
char rflo_fname[100];
FILE *rxg_fd=NULL;
FILE *rflo_fd=NULL;
<<<<<<< .mine
=======
>>>>>>> .r3153
const struct option long_options[] = {
{"calib-rx", required_argument, NULL, 256},
{"calib-rx-med", required_argument, NULL, 257},
{"calib-rx-byp", required_argument, NULL, 258},
{NULL, 0, NULL, 0}
};
mode = normal_txrx;
while ((c = getopt_long (argc, argv, "C:ST:dF:t",long_options,NULL)) != -1) {
switch (c) {
case 'd':
do_forms=1;
break;
case 't':
generate_test_tx = 1;
break;
case 'C':
carrier_freq[0] = atoi(optarg);
carrier_freq[1] = atoi(optarg);
carrier_freq[2] = atoi(optarg);
carrier_freq[3] = atoi(optarg);
break;
case 'S':
fs4_test=1;
break;
case 'T':
tcxo=atoi(optarg);
break;
case 'F':
sprintf(rxg_fname,"%srxg.lime",optarg);
rxg_fd = fopen(rxg_fname,"r");
if (rxg_fd) {
printf("Loading RX Gain parameters from %s\n",rxg_fname);
fscanf(rxg_fd,"%d %d %d %d",&rxg_max[0],&rxg_max[1],&rxg_max[2],&rxg_max[3]);
fscanf(rxg_fd,"%d %d %d %d",&rxg_med[0],&rxg_med[1],&rxg_med[2],&rxg_med[3]);
fscanf(rxg_fd,"%d %d %d %d",&rxg_byp[0],&rxg_byp[1],&rxg_byp[2],&rxg_byp[3]);
} else
printf("%s not found, running with defaults\n",rxg_fname);
sprintf(rflo_fname,"%srflo.lime",optarg);
rflo_fd = fopen(rflo_fname,"r");
if (rflo_fd) {
printf("Loading RF LO parameters from %s\n",rflo_fname);
fscanf(rflo_fd,"%d %d %d %d",&rf_local[0],&rf_local[1],&rf_local[2],&rf_local[3]);
} else
printf("%s not found, running with defaults\n",rflo_fname);
break;
case 256:
mode = rx_calib_ue;
rx_input_level_dBm = atoi(optarg);
printf("Running with UE calibration on (LNA max), input level %d dBm\n",rx_input_level_dBm);
break;
case 257:
mode = rx_calib_ue_med;
rx_input_level_dBm = atoi(optarg);
printf("Running with UE calibration on (LNA med), input level %d dBm\n",rx_input_level_dBm);
break;
case 258:
mode = rx_calib_ue_byp;
rx_input_level_dBm = atoi(optarg);
printf("Running with UE calibration on (LNA byp), input level %d dBm\n",rx_input_level_dBm);
break;
default:
break;
}
}
// to make a graceful exit when ctrl-c is pressed
signal(SIGSEGV, signal_handler);
// init the parameters
frame_parms = (LTE_DL_FRAME_PARMS*) malloc(sizeof(LTE_DL_FRAME_PARMS));
frame_parms->N_RB_DL = 25;
frame_parms->N_RB_UL = 25;
frame_parms->Ncp = 0;
frame_parms->Ncp_UL = 0;
frame_parms->Nid_cell = Nid_cell;
frame_parms->nushift = 0;
frame_parms->nb_antennas_tx = 1;
frame_parms->nb_antennas_rx = 1;
frame_parms->mode1_flag = 1; //default == SISO
frame_parms->frame_type = 1;
if (fs4_test==1)
frame_parms->tdd_config = 255;
else
frame_parms->tdd_config = 3;
frame_parms->tdd_config_S = 0;
frame_parms->phich_config_common.phich_resource = oneSixth;
frame_parms->phich_config_common.phich_duration = normal;
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = 0;//n_DMRS1 set to 0
frame_parms->node_id = NODE;
// for Express MIMO
for (i=0; i<4; i++) {
frame_parms->carrier_freq[i] = carrier_freq[i];
frame_parms->carrier_freqtx[i] = carrier_freq[i];
<<<<<<< .mine
frame_parms->rxgain[i] = rxgain[i];
=======
frame_parms->rxgain[i] = rxgain[i];
frame_parms->rflocal[i] = rf_local[i];
frame_parms->rfvcolocal[i] = rf_vcocal[i];
frame_parms->rxdc[i] = rf_rxdc[i];
frame_parms->rfmode[i] = rf_mode_max[i];
>>>>>>> .r3153
}
printf("Freq %d,%d,%d,%d, Gain %d,%d,%d,%d, RFmode %d, RXDC %d, RF_local %d, rf_vcocal %d\n",
frame_parms->carrier_freq[0],frame_parms->carrier_freq[1],frame_parms->carrier_freq[2],frame_parms->carrier_freq[3],
frame_parms->rxgain[0],frame_parms->rxgain[1],frame_parms->rxgain[2],frame_parms->rxgain[3],
frame_parms->rfmode[0],frame_parms->rflocal[0],
frame_parms->rxdc[0],frame_parms->rfvcolocal[0]);
frame_parms->nb_prefix_samples0 = 40;
frame_parms->nb_prefix_samples = 36;
frame_parms->symbols_per_tti = 14;
frame_parms->ofdm_symbol_size = 512;
frame_parms->log2_symbol_size = 9;
frame_parms->samples_per_tti = 7680;
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 150;
openair_fd = setup_oai_hw(frame_parms);
printf("Setting up buffers for Antenna port 0\n");
setup_dot11_buffers(&(rxdata[0]),&(txdata[0]),0);
printf("Setting up buffers for Antenna port 1\n");
setup_dot11_buffers(&(rxdata[1]),&(txdata[1]),1);
<<<<<<< .mine
printf("Initializing dot11 DSP functions\n");
dot11_init();
dot11_netlink_fd = dot11_netlink_init();
=======
>>>>>>> .r3153
<<<<<<< .mine
for (j=0; j<76800; j+=4)
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
amp = 0x8000;
// ((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+1] = 0;
//((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+3] = amp-1;
//((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+5] = 0;
//((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+7] = amp;
//((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j] = amp-1;
//((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+2] = 0;
//((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+4] = amp;
//((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+6] = 0;
}
sleep(1);
printf("Calling openair_GET_PCI_INTERFACE %x\n",openair_GET_PCI_INTERFACE);
ioctl(openair_fd,openair_GET_PCI_INTERFACE,&pci_interface_ptr_kern);
if (pci_interface_ptr_kern == 0) {
printf("null pci_interface_ptr, exiting\n");
exit(-1);
}
=======
for (j=0; j<76800; j+=4)
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
amp = 0x8000;
// ((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+1] = 0;
//((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+3] = amp-1;
//((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+5] = 0;
//((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+7] = amp;
//((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j] = amp-1;
//((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+2] = 0;
//((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+4] = amp;
//((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+6] = 0;
}
sleep(1);
printf("Calling openair_GET_PCI_INTERFACE %x\n",openair_GET_PCI_INTERFACE);
ioctl(openair_fd,openair_GET_PCI_INTERFACE,&pci_interface_ptr_kern);
if (pci_interface_ptr_kern == 0) {
printf("null pci_interface_ptr, exiting\n");
exit(-1);
}
exmimo_pci_interface = (exmimo_pci_interface_t*) (pci_interface_ptr_kern-bigphys_top+mem_base);
printf("pci_interface_ptr_kern = %p, exmimo_pci_interface = %p\n", (void*) pci_interface_ptr_kern, exmimo_pci_interface);
DAQ_MBOX = (unsigned int *)(0xc0000000+exmimo_pci_interface->rf.mbox-bigphys_top+mem_base);
printf("Initializing dot11 DSP functions\n");
dot11_init();
dot11_netlink_fd = netlink_init();
>>>>>>> .r3153
exmimo_pci_interface = (exmimo_pci_interface_t*) (pci_interface_ptr_kern-bigphys_top+mem_base);
printf("pci_interface_ptr_kern = %p, exmimo_pci_interface = %p\n", (void*) pci_interface_ptr_kern, exmimo_pci_interface);
DAQ_MBOX = (unsigned int *)(0xc0000000+exmimo_pci_interface->rf.mbox-bigphys_top+mem_base);
<<<<<<< .mine
=======
printf("dot11_netlink_fd %d\n",dot11_netlink_fd);
>>>>>>> .r3153
// make main thread LXRT soft realtime
printf("Starting LXRT ...");
task = rt_task_init_schmod(nam2num("MYTASK"), 9, 0, 0, SCHED_FIFO, 0xF);
mlockall(MCL_CURRENT | MCL_FUTURE);
// start realtime timer and scheduler
//rt_set_oneshot_mode();
rt_set_periodic_mode();
start_rt_timer(0);
<<<<<<< .mine
printf(" done\n");
=======
printf(" done\n");
>>>>>>> .r3153
<<<<<<< .mine
//now = rt_get_time() + 10*PERIOD;
//rt_task_make_periodic(task, now, PERIOD);
// initialize the instance cnt before starting the thread
// instance_cnt_ptr_user = &instance_cnt;
// signal the driver to set up for user-space operation
// this will initialize the semaphore and the task pointers in the kernel
// further we receive back the pointer to the shared instance counter which is used to signal if the thread is busy or not. This pointer needs to be mapped to user space.
/*
ioctl(openair_fd,openair_START_LXRT,&instance_cnt_ptr_kern);
instance_cnt_ptr_user = (int*) (instance_cnt_ptr_kern -bigphys_top+mem_base);
*instance_cnt_ptr_user = -1;
printf("instance_cnt_ptr_kern %p, instance_cnt_ptr_user %p, *instance_cnt_ptr_user %d\n", (void*) instance_cnt_ptr_kern, (void*) instance_cnt_ptr_user,*instance_cnt_ptr_user);
*/
=======
>>>>>>> .r3153
<<<<<<< .mine
rt_sleep(nano2count(FRAME_PERIOD));
=======
>>>>>>> .r3153
// this starts the DMA transfers
<<<<<<< .mine
=======
ioctl(openair_fd,openair_START_TX_SIG,NULL);
//ioctl(openair_fd,openair_GET_BUFFER,NULL);
>>>>>>> .r3153
<<<<<<< .mine
ioctl(openair_fd,openair_START_TX_SIG,NULL);
=======
>>>>>>> .r3153
rt_sleep(nano2count(10*FRAME_PERIOD));
<<<<<<< .mine
thread1 = rt_thread_create(dot11_thread, NULL, 100000000);
=======
//thread1 = rt_thread_create(dot11_thread, NULL, 100000000);
>>>>>>> .r3153
<<<<<<< .mine
printf("thread created\n");
=======
thread1 = rt_thread_create(rx_thread, &dot11_netlink_fd, 10000000);
>>>>>>> .r3153
thread2 = rt_thread_create(tx_thread, &dot11_netlink_fd, 10000000);
// wait for end of program
printf("TYPE <ENTER> TO TERMINATE main thread\n");
getchar();
// stop threads
rt_sleep(nano2count(FRAME_PERIOD));
stop_rt_timer();
fd = 0;
ioctl(openair_fd,openair_STOP,&fd);
munmap((void*)mem_base, BIGPHYS_NUMPAGES*4096);
return 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);
}
*/
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