Commit 3740f3d7 authored by laurent's avatar laurent

remove constructor key word

parent 0e6804f2
/* /*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. except in compliance with the License.
* You may obtain a copy of the License at You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698 http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and See the License for the specific language governing permissions and
* limitations under the License. limitations under the License.
*------------------------------------------------------------------------------- -------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance: For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org contact@openairinterface.org
*/ */
/*!\brief Initilization and reconfiguration routines for LTE PHY */ /*!\brief Initilization and reconfiguration routines for LTE PHY */
#include "phy_init.h" #include "phy_init.h"
...@@ -27,12 +27,9 @@ ...@@ -27,12 +27,9 @@
#include "PHY/LTE_REFSIG/lte_refsig.h" #include "PHY/LTE_REFSIG/lte_refsig.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h" #include "PHY/LTE_TRANSPORT/transport_common_proto.h"
void generate_64qam_table(void) void generate_64qam_table(void) {
{
int a,b,c,index; int a,b,c,index;
for (a=-1; a<=1; a+=2) for (a=-1; a<=1; a+=2)
for (b=-1; b<=1; b+=2) for (b=-1; b<=1; b+=2)
for (c=-1; c<=1; c+=2) { for (c=-1; c<=1; c+=2) {
...@@ -41,9 +38,7 @@ void generate_64qam_table(void) ...@@ -41,9 +38,7 @@ void generate_64qam_table(void)
} }
} }
void generate_16qam_table(void) void generate_16qam_table(void) {
{
int a,b,index; int a,b,index;
for (a=-1; a<=1; a+=2) for (a=-1; a<=1; a+=2)
...@@ -53,9 +48,7 @@ void generate_16qam_table(void) ...@@ -53,9 +48,7 @@ void generate_16qam_table(void)
} }
} }
void generate_qpsk_table(void) void generate_qpsk_table(void) {
{
int a,index; int a,index;
for (a=-1; a<=1; a+=2) { for (a=-1; a<=1; a+=2) {
...@@ -64,43 +57,32 @@ void generate_qpsk_table(void) ...@@ -64,43 +57,32 @@ void generate_qpsk_table(void)
} }
} }
void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms) void init_7_5KHz(void);
{ void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms) {
ccodelte_init(); ccodelte_init();
ccodelte_init_inv(); ccodelte_init_inv();
init_dfts(); init_dfts();
phy_generate_viterbi_tables_lte(); phy_generate_viterbi_tables_lte();
load_codinglib(); load_codinglib();
lte_sync_time_init(frame_parms); lte_sync_time_init(frame_parms);
generate_ul_ref_sigs(); generate_ul_ref_sigs();
generate_ul_ref_sigs_rx(); generate_ul_ref_sigs_rx();
generate_64qam_table(); generate_64qam_table();
generate_16qam_table(); generate_16qam_table();
generate_qpsk_table(); generate_qpsk_table();
generate_RIV_tables(); generate_RIV_tables();
init_unscrambling_lut(); init_unscrambling_lut();
init_scrambling_lut(); init_scrambling_lut();
//set_taus_seed(1328); //set_taus_seed(1328);
init_7_5KHz();
} }
void free_lte_top(void) void free_lte_top(void) {
{
free_codinglib(); free_codinglib();
lte_sync_time_free(); lte_sync_time_free();
/* free_ul_ref_sigs() is called in phy_free_lte_eNB() */ /* free_ul_ref_sigs() is called in phy_free_lte_eNB() */
} }
/* /*
* @}*/ @}*/
...@@ -8,22 +8,24 @@ ...@@ -8,22 +8,24 @@
#include <map> #include <map>
#include <PHY/MODULATION/modulation_extern.h> #include <PHY/MODULATION/modulation_extern.h>
using namespace std; using namespace std;
extern "C" {
void gen_sig(int RB, int len, double ratio, int16_t *table_n, int16_t *table_e ) { void gen_sig(int RB, int len, double ratio, int16_t *table_n, int16_t *table_e ) {
double samplerate = 30.72e6*ratio; double samplerate = 30.72e6*ratio;
double ofdm_size = 2048*ratio; double ofdm_size = 2048*ratio;
double PI = std::acos(-1); double PI = std::acos(-1);
std::complex<int> tt; std::complex<int> tt;
complex<double> t[len]; complex<double> t[len];
int index=0; int index=0;
double cp0 = 160*ratio; double cp0 = 160*ratio;
double cp = 144*ratio; double cp = 144*ratio;
for (int i=-cp0; i<ofdm_size; i++) for (int i=-cp0; i<ofdm_size; i++)
t[index++] = polar( 32767.0, -2*PI*i*7.5e3/samplerate); t[index++] = polar( 32767.0, -2*PI*i*7.5e3/samplerate);
for(int x=0 ; x <6 ; x++) for(int x=0 ; x <6 ; x++)
for (int i=-cp; i<ofdm_size; i++) for (int i=-cp; i<ofdm_size; i++)
t[index++] = polar( 32767.0, -2*PI*i*7.5e3/samplerate); t[index++] = polar( 32767.0, -2*PI*i*7.5e3/samplerate);
for (int i=0; i < len ; i++) { for (int i=0; i < len ; i++) {
table_n[i*2] = floor(real(t[i])); table_n[i*2] = floor(real(t[i]));
table_n[i*2+1] = floor(imag(t[i])); table_n[i*2+1] = floor(imag(t[i]));
...@@ -31,48 +33,52 @@ void gen_sig(int RB, int len, double ratio, int16_t *table_n, int16_t *table_e ) ...@@ -31,48 +33,52 @@ void gen_sig(int RB, int len, double ratio, int16_t *table_n, int16_t *table_e )
index=0; index=0;
double cpe = 512*ratio; double cpe = 512*ratio;
for(int x=0 ; x <6 ; x++) for(int x=0 ; x <6 ; x++)
for (int i=-cpe; i<ofdm_size; i++) for (int i=-cpe; i<ofdm_size; i++)
t[index++] = polar( 32767.0, -2*PI*i*7.5e3/samplerate); t[index++] = polar( 32767.0, -2*PI*i*7.5e3/samplerate);
for (int i=0; i < len ; i++) { for (int i=0; i < len ; i++) {
table_e[i*2] = floor(real(t[i])); table_e[i*2] = floor(real(t[i]));
table_e[i*2+1] = floor(imag(t[i])); table_e[i*2+1] = floor(imag(t[i]));
} }
} }
int16_t *s6n_kHz_7_5; int16_t *s6n_kHz_7_5;
int16_t *s6e_kHz_7_5; int16_t *s6e_kHz_7_5;
int16_t *s15n_kHz_7_5; int16_t *s15n_kHz_7_5;
int16_t *s15e_kHz_7_5; int16_t *s15e_kHz_7_5;
int16_t *s25n_kHz_7_5; int16_t *s25n_kHz_7_5;
int16_t *s25e_kHz_7_5; int16_t *s25e_kHz_7_5;
int16_t *s50n_kHz_7_5; int16_t *s50n_kHz_7_5;
int16_t *s50e_kHz_7_5; int16_t *s50e_kHz_7_5;
int16_t *s75n_kHz_7_5; int16_t *s75n_kHz_7_5;
int16_t *s75e_kHz_7_5; int16_t *s75e_kHz_7_5;
int16_t *s100n_kHz_7_5; int16_t *s100n_kHz_7_5;
int16_t *s100e_kHz_7_5; int16_t *s100e_kHz_7_5;
int16_t ** tables[12]={&s6n_kHz_7_5,&s6e_kHz_7_5, int16_t **tables[12]= {&s6n_kHz_7_5,&s6e_kHz_7_5,
&s15n_kHz_7_5,&s15e_kHz_7_5, &s15n_kHz_7_5,&s15e_kHz_7_5,
&s25n_kHz_7_5,&s25e_kHz_7_5, &s25n_kHz_7_5,&s25e_kHz_7_5,
&s50n_kHz_7_5,&s50e_kHz_7_5, &s50n_kHz_7_5,&s50e_kHz_7_5,
&s75n_kHz_7_5,&s75e_kHz_7_5, &s75n_kHz_7_5,&s75e_kHz_7_5,
&s100n_kHz_7_5,&s100e_kHz_7_5,}; &s100n_kHz_7_5,&s100e_kHz_7_5,
int tables_size_bytes[12]; };
int tables_size_bytes[12];
#define MyAssert(x) { if(!(x)) { printf("Error in table intialization: %s:%d\n",__FILE__,__LINE__); exit(1);}} #define MyAssert(x) { if(!(x)) { printf("Error in table intialization: %s:%d\n",__FILE__,__LINE__); exit(1);}}
__attribute__((constructor)) static void init_7_5KHz(void) { void init_7_5KHz(void) {
const map<int,double> tables_7_5KHz={{6,1.0/16},{15,1.0/8},{25,1.0/4},{50,1.0/2},{75,3.0/4},{100,1.0}}; const map<int,double> tables_7_5KHz= {{6,1.0/16},{15,1.0/8},{25,1.0/4},{50,1.0/2},{75,3.0/4},{100,1.0}};
int tables_idx=0; int tables_idx=0;
for (auto it=tables_7_5KHz.begin(); it!=tables_7_5KHz.end(); ++it) { for (auto it=tables_7_5KHz.begin(); it!=tables_7_5KHz.end(); ++it) {
int len=15360*it->second; int len=15360*it->second;
tables_size_bytes[tables_idx]=sizeof(int16_t)*2*len; tables_size_bytes[tables_idx]=sizeof(int16_t)*2*len;
tables_size_bytes[tables_idx+1]=sizeof(int16_t)*2*len; tables_size_bytes[tables_idx+1]=sizeof(int16_t)*2*len;
MyAssert(0==posix_memalign((void**)tables[tables_idx], MyAssert(0==posix_memalign((void **)tables[tables_idx],
16,tables_size_bytes[tables_idx])); 16,tables_size_bytes[tables_idx]));
MyAssert(0==posix_memalign((void**)tables[tables_idx+1], MyAssert(0==posix_memalign((void **)tables[tables_idx+1],
16,tables_size_bytes[tables_idx+1])); 16,tables_size_bytes[tables_idx+1]));
gen_sig(it->first, len, it->second, *tables[tables_idx], *tables[tables_idx+1]); gen_sig(it->first, len, it->second, *tables[tables_idx], *tables[tables_idx+1]);
tables_idx+=2; tables_idx+=2;
} }
}
} }
/* /*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. except in compliance with the License.
* You may obtain a copy of the License at You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698 http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
; * distributed under the License is distributed on an "AS IS" BASIS, ; * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and See the License for the specific language governing permissions and
* limitations under the License. limitations under the License.
*------------------------------------------------------------------------------- -------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance: For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org contact@openairinterface.org
*/ */
#ifdef __cplusplus
extern "C" {
#endif
extern int16_t *s6n_kHz_7_5; extern int16_t *s6n_kHz_7_5;
extern int16_t *s6e_kHz_7_5; extern int16_t *s6e_kHz_7_5;
...@@ -36,3 +39,6 @@ extern int16_t *s100e_kHz_7_5; ...@@ -36,3 +39,6 @@ extern int16_t *s100e_kHz_7_5;
extern short conjugate75[8]; extern short conjugate75[8];
extern short conjugate75_2[8]; extern short conjugate75_2[8];
extern short negate[8]; extern short negate[8];
#ifdef __cplusplus
}
#endif
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