Commit 8b1416b8 authored by knopp's avatar knopp

debugging of new directory structure, file renaming, and eNB/UE splitting. dlsim/ulsim functional.

parent ef719e79
This diff is collapsed.
......@@ -37,7 +37,7 @@
#include <errno.h>
#include <sys/ioctl.h>
#include <dlfcn.h>
#include "openair1/PHY/defs.h"
#include "openair1/PHY/defs_common.h"
#define LOAD_MODULE_SHLIB_MAIN
#include "common/config/config_userapi.h"
......
......@@ -29,7 +29,7 @@
#endif
#include <stdint.h>
#include <stdio.h>
#include "PHY/CODING/defs.h"
#include "PHY/CODING/coding_defs.h"
#include "extern_3GPPinterleaver.h"
//#define DEBUG_TURBO_ENCODER 1
......
......@@ -26,10 +26,10 @@
date: 09.2012
*/
#ifndef TC_MAIN
#include "defs.h"
#include "coding_defs.h"
#include "extern_3GPPinterleaver.h"
#else
#include "vars.h"
#include "coding_vars.h"
#include <stdint.h>
#endif
#include <stdio.h>
......
......@@ -27,8 +27,8 @@
*/
#include "PHY/defs.h"
#include "PHY/CODING/defs.h"
#include "PHY/defs_common.h"
#include "PHY/CODING/coding_defs.h"
#include "PHY/CODING/lte_interleaver_inline.h"
#include "PHY/sse_intrin.h"
......
......@@ -42,8 +42,8 @@
#ifndef TEST_DEBUG
#include "PHY/defs.h"
#include "PHY/CODING/defs.h"
#include "PHY/defs_common.h"
#include "PHY/CODING/coding_defs.h"
#include "PHY/CODING/lte_interleaver_inline.h"
#include "extern_3GPPinterleaver.h"
#else
......
......@@ -41,8 +41,8 @@
#include "PHY/sse_intrin.h"
#ifndef TEST_DEBUG
#include "PHY/defs.h"
#include "PHY/CODING/defs.h"
#include "PHY/defs_common.h"
#include "PHY/CODING/coding_defs.h"
#include "PHY/CODING/lte_interleaver_inline.h"
#include "extern_3GPPinterleaver.h"
#else
......
......@@ -39,8 +39,8 @@
#include "PHY/sse_intrin.h"
#ifndef TEST_DEBUG
#include "PHY/defs.h"
#include "PHY/CODING/defs.h"
#include "PHY/defs_common.h"
#include "PHY/CODING/coding_defs.h"
#include "PHY/CODING/lte_interleaver_inline.h"
#include "extern_3GPPinterleaver.h"
#else
......
......@@ -24,7 +24,7 @@
author: raymond.knopp@eurecom.fr, based on similar code for 3GPP convolutional code (UMTS) by P. Humblet (2000)
date: 10.2004
*/
#include "defs.h"
#include "coding_defs.h"
unsigned short gdot11[] = { 0133, 0171 }; // {A,B}
......
......@@ -24,7 +24,7 @@
author: raymond.knopp@eurecom.fr
date: 21.10.2009
*/
#include "defs.h"
#include "coding_defs.h"
//#define DEBUG_CCODE 1
......
......@@ -33,8 +33,8 @@
#include <sys/types.h>
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/defs_common.h"
#include "PHY/phy_extern.h"
#include "common/utils/load_module_shlib.h"
#include "common/utils/telnetsrv/telnetsrv.h"
......
......@@ -31,7 +31,7 @@
*/
#include "defs.h"
#include "coding_defs.h"
/*ref 36-212 v8.6.0 , pp 8-9 */
......
......@@ -28,7 +28,8 @@
#include <stdio.h>
#include <stdlib.h>
#endif
#include "PHY/defs.h"
#include "PHY/defs_common.h"
#include "PHY/LTE_TRANSPORT/transport_common.h"
#include "assertions.h"
//#define cmin(a,b) ((a)<(b) ? (a) : (b))
......
......@@ -24,8 +24,9 @@
author: raymond.knopp@eurecom.fr
date: 21.10.2009
*/
#include "PHY/defs.h"
#include "SCHED/extern.h"
#include "PHY/defs_common.h"
#include "PHY/LTE_TRANSPORT/transport_common.h"
#include "PHY/CODING/coding_defs.h"
//#define DEBUG_SEGMENTATION
......
......@@ -29,8 +29,8 @@
*/
#ifndef TEST_DEBUG
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/defs_common.h"
#include "PHY/phy_extern.h"
#else
#include <stdio.h>
#include <stdlib.h>
......
......@@ -20,9 +20,9 @@
*/
/*!\brief Initilization and reconfiguration routines for LTE PHY */
#include "defs.h"
#include "PHY/extern.h"
#include "PHY/CODING/extern.h"
#include "phy_init.h"
#include "PHY/phy_extern.h"
#include "PHY/CODING/coding_extern.h"
void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms)
{
......
......@@ -19,14 +19,15 @@
* contact@openairinterface.org
*/
#include "defs.h"
#include "SCHED/defs.h"
#include "PHY/extern.h"
#include "SIMULATION/TOOLS/defs.h"
#include "phy_init.h"
#include "SCHED/sched_eNB.h"
#include "PHY/phy_extern.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
#include "SIMULATION/TOOLS/sim.h"
#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
#include "TDD-Config.h"
#include "LAYER2/MAC/extern.h"
#include "MBSFN-SubframeConfigList.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "assertions.h"
......@@ -721,23 +722,6 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
void phy_config_cba_rnti (module_id_t Mod_id,int CC_id,eNB_flag_t eNB_flag, uint8_t index, rnti_t cba_rnti, uint8_t cba_group_id, uint8_t num_active_cba_groups)
{
// uint8_t i;
if (eNB_flag == 0 ) {
//LOG_D(PHY,"[UE %d] configure cba group %d with rnti %x, num active cba grp %d\n", index, index, cba_rnti, num_active_cba_groups);
PHY_vars_UE_g[Mod_id][CC_id]->ulsch[index]->num_active_cba_groups=num_active_cba_groups;
PHY_vars_UE_g[Mod_id][CC_id]->ulsch[index]->cba_rnti[cba_group_id]=cba_rnti;
} else {
//for (i=index; i < NUMBER_OF_UE_MAX; i+=num_active_cba_groups){
// LOG_D(PHY,"[eNB %d] configure cba group %d with rnti %x for UE %d, num active cba grp %d\n",Mod_id, i%num_active_cba_groups, cba_rnti, i, num_active_cba_groups);
RC.eNB[Mod_id][CC_id]->ulsch[index]->num_active_cba_groups=num_active_cba_groups;
RC.eNB[Mod_id][CC_id]->ulsch[index]->cba_rnti[cba_group_id] = cba_rnti;
//}
}
}
int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
unsigned char is_secondary_eNB,
unsigned char abstraction_flag)
......
......@@ -19,14 +19,13 @@
* contact@openairinterface.org
*/
#include "defs.h"
#include "SCHED/defs.h"
#include "PHY/extern.h"
#include "SIMULATION/TOOLS/defs.h"
#include "phy_init.h"
#include "SCHED/sched_eNB.h"
#include "PHY/phy_extern.h"
#include "SIMULATION/TOOLS/sim.h"
#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
#include "TDD-Config.h"
#include "LAYER2/MAC/extern.h"
#include "MBSFN-SubframeConfigList.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "assertions.h"
......
......@@ -19,19 +19,19 @@
* contact@openairinterface.org
*/
#include "defs.h"
#include "SCHED/defs.h"
#include "PHY/extern.h"
#include "SIMULATION/TOOLS/defs.h"
#include "phy_init.h"
#include "SCHED_UE/sched_UE.h"
#include "PHY/phy_extern_ue.h"
#include "SIMULATION/TOOLS/sim.h"
#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
#include "TDD-Config.h"
#include "LAYER2/MAC/extern.h"
#include "MBSFN-SubframeConfigList.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "assertions.h"
#include <math.h>
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
uint8_t dmrs1_tab_ue[8] = {0,2,3,4,6,8,9,10};
......@@ -651,7 +651,7 @@ int init_lte_ue_signal(PHY_VARS_UE *ue,
int th_id;
LOG_D(PHY,"Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,fp->nb_antennas_tx,fp->nb_antennas_rx);
LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_eNB_INST);
......
......@@ -25,10 +25,11 @@
#include <execinfo.h>
#include <signal.h>
#include "SIMULATION/TOOLS/defs.h"
#include "SIMULATION/TOOLS/sim.h"
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
#include "PHY/phy_extern.h"
extern PHY_VARS_eNB *eNB;
extern PHY_VARS_UE *UE;
......
......@@ -19,7 +19,7 @@
* contact@openairinterface.org
*/
#include "defs.h"
#include "phy_init.h"
#include "log.h"
uint16_t dl_S_table_normal[10]={3,9,10,11,12,3,9,10,11,6};
......
......@@ -22,8 +22,8 @@
#ifndef __INIT_DEFS__H__
#define __INIT_DEFS__H__
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
#include "SystemInformationBlockType2.h"
//#include "RadioResourceConfigCommonSIB.h"
......
......@@ -20,8 +20,8 @@
*/
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/defs_UE.h"
#include "PHY/phy_extern_ue.h"
void
phy_adjust_gain (PHY_VARS_UE *ue, uint32_t rx_power_fil_dB, uint8_t eNB_id)
......
......@@ -19,8 +19,8 @@
* contact@openairinterface.org
*/
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "PHY/sse_intrin.h"
// This is 512/(1:256) in __m128i format
......
......@@ -20,10 +20,11 @@
*/
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/defs_UE.h"
#include "PHY/phy_extern_ue.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "lte_estimation_defs.h"
#define DEBUG_PHY
......@@ -136,126 +137,3 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
}
int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
LTE_eNB_SRS *lte_eNB_srs,
unsigned int *eNB_id,
unsigned char clear,
unsigned char number_of_cards,
short coef)
{
static int max_pos_fil2 = 0;
int temp, i, aa, max_pos = 0,ind;
int max_val=0;
short Re,Im,ncoef;
#ifdef DEBUG_PHY
char fname[100],vname[100];
#endif
ncoef = 32768 - coef;
for (ind=0; ind<number_of_cards; ind++) {
if (ind==0)
max_val=0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
// do ifft of channel estimate
switch(frame_parms->N_RB_DL) {
case 6:
dft128((int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
1);
break;
case 25:
dft512((int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
1);
break;
case 50:
dft1024((int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
1);
break;
case 100:
dft2048((int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
1);
break;
}
#ifdef DEBUG_PHY
sprintf(fname,"srs_ch_estimates_time_%d%d.m",ind,aa);
sprintf(vname,"srs_time_%d%d",ind,aa);
write_output(fname,vname,lte_eNB_srs->srs_ch_estimates_time[aa],frame_parms->ofdm_symbol_size*2,2,1);
#endif
}
// we only use channel estimates from tx antenna 0 here
// remember we fixed the SRS to use only every second subcarriers
for (i = 0; i < frame_parms->ofdm_symbol_size/2; i++) {
temp = 0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
Re = ((int16_t*)lte_eNB_srs->srs_ch_estimates_time[aa])[(i<<1)];
Im = ((int16_t*)lte_eNB_srs->srs_ch_estimates_time[aa])[1+(i<<1)];
temp += (Re*Re/2) + (Im*Im/2);
}
if (temp > max_val) {
max_pos = i;
max_val = temp;
*eNB_id = ind;
}
}
}
// filter position to reduce jitter
if (clear == 1)
max_pos_fil2 = max_pos;
else
max_pos_fil2 = ((max_pos_fil2 * coef) + (max_pos * ncoef)) >> 15;
return(max_pos_fil2);
}
int lte_est_timing_advance_pusch(PHY_VARS_eNB* eNB,uint8_t UE_id)
{
int temp, i, aa, max_pos=0, max_val=0;
short Re,Im;
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
LTE_eNB_PUSCH *eNB_pusch_vars = eNB->pusch_vars[UE_id];
int32_t **ul_ch_estimates_time= eNB_pusch_vars->drs_ch_estimates_time;
uint8_t cyclic_shift = 0;
int sync_pos = (frame_parms->ofdm_symbol_size-cyclic_shift*frame_parms->ofdm_symbol_size/12)%(frame_parms->ofdm_symbol_size);
AssertFatal(frame_parms->ofdm_symbol_size > 127,"frame_parms->ofdm_symbol_size %d<128\n",frame_parms->ofdm_symbol_size);
AssertFatal(frame_parms->nb_antennas_rx >0 && frame_parms->nb_antennas_rx<3,"frame_parms->nb_antennas_rx %d not in [0,1]\n",
frame_parms->nb_antennas_rx);
for (i = 0; i < frame_parms->ofdm_symbol_size; i++) {
temp = 0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
Re = ((int16_t*)ul_ch_estimates_time[aa])[(i<<1)];
Im = ((int16_t*)ul_ch_estimates_time[aa])[1+(i<<1)];
temp += (Re*Re/2) + (Im*Im/2);
}
if (temp > max_val) {
max_pos = i;
max_val = temp;
}
}
if (max_pos>frame_parms->ofdm_symbol_size/2)
max_pos = max_pos-frame_parms->ofdm_symbol_size;
//#ifdef DEBUG_PHY
LOG_D(PHY,"frame %d: max_pos = %d, sync_pos=%d\n",eNB->proc.frame_rx,max_pos,sync_pos);
//#endif //DEBUG_PHY
return max_pos - sync_pos;
}
......@@ -20,8 +20,7 @@
*/
#include <string.h>
#include "defs.h"
#include "PHY/defs.h"
#include "PHY/defs_UE.h"
#include "filt16_32.h"
//#define DEBUG_BF_CH
......
......@@ -20,9 +20,7 @@
*/
#include <string.h>
#include "defs.h"
#include "SCHED/defs.h"
#include "PHY/defs.h"
#include "PHY/defs_UE.h"
#include "filt96_32.h"
#include "T.h"
//#define DEBUG_CH
......
......@@ -20,8 +20,7 @@
*/
#include <string.h>
#include "defs.h"
#include "PHY/defs.h"
#include "PHY/defs_UE.h"
//#define DEBUG_CH
int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue,
......
......@@ -19,8 +19,8 @@
* contact@openairinterface.org
*/
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "PHY/sse_intrin.h"
......
......@@ -25,7 +25,7 @@
date: 19.11.2009
*/
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
//#define DEBUG_PHY
#if defined(__x86_64__) || defined(__i386__)
......
......@@ -22,7 +22,9 @@
#ifndef __LTE_ESTIMATION_DEFS__H__
#define __LTE_ESTIMATION_DEFS__H__
#include "PHY/defs.h"
#include "PHY/defs_UE.h"
#include "PHY/defs_eNB.h"
/** @addtogroup _PHY_PARAMETER_ESTIMATION_BLOCKS_
* @{
*/
......
......@@ -26,19 +26,15 @@
*/
//#include <string.h>
#include "defs.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SCHED/extern.h"
#include "PHY/defs_UE.h"
#include "PHY/phy_extern_ue.h"
#include <math.h>
#ifdef OPENAIR2
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/extern.h"
#include "RRC/LITE/extern.h"
#include "PHY_INTERFACE/extern.h"
#endif
//#define DEBUG_PHY
#include "LAYER2/MAC/mac.h"
#include "RRC/LTE/rrc_extern.h"
#include "PHY_INTERFACE/phy_interface.h"
int* sync_corr_ue0 = NULL;
int* sync_corr_ue1 = NULL;
......@@ -487,8 +483,6 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
}
//#define DEBUG_PHY
int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
LTE_DL_FRAME_PARMS *frame_parms,
uint32_t length,
......@@ -578,3 +572,6 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
}
......@@ -36,8 +36,8 @@
*/
//#include "defs.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/defs_UE.h"
#include "PHY/phy_extern_ue.h"
#if defined(__x86_64__) || defined(__i386__)
#include "pss6144.h"
......
......@@ -19,13 +19,14 @@
* contact@openairinterface.org
*/
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "PHY/sse_intrin.h"
//#define DEBUG_CH
#include "UTIL/LOG/log.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
#include "T.h"
#include "lte_estimation_defs.h"
// round(exp(sqrt(-1)*(pi/2)*[0:1:N-1]/N)*pow2(15))
static int16_t ru_90[2*128] = {32767, 0,32766, 402,32758, 804,32746, 1206,32729, 1608,32706, 2009,32679, 2411,32647, 2811,32610, 3212,32568, 3612,32522, 4011,32470, 4410,32413, 4808,32352, 5205,32286, 5602,32214, 5998,32138, 6393,32058, 6787,31972, 7180,31881, 7571,31786, 7962,31686, 8351,31581, 8740,31471, 9127,31357, 9512,31238, 9896,31114, 10279,30986, 10660,30853, 11039,30715, 11417,30572, 11793,30425, 12167,30274, 12540,30118, 12910,29957, 13279,29792, 13646,29622, 14010,29448, 14373,29269, 14733,29086, 15091,28899, 15447,28707, 15800,28511, 16151,28311, 16500,28106, 16846,27897, 17190,27684, 17531,27467, 17869,27246, 18205,27020, 18538,26791, 18868,26557, 19195,26320, 19520,26078, 19841,25833, 20160,25583, 20475,25330, 20788,25073, 21097,24812, 21403,24548, 21706,24279, 22006,24008, 22302,23732, 22595,23453, 22884,23170, 23170,22884, 23453,22595, 23732,22302, 24008,22006, 24279,21706, 24548,21403, 24812,21097, 25073,20788, 25330,20475, 25583,20160, 25833,19841, 26078,19520, 26320,19195, 26557,18868, 26791,18538, 27020,18205, 27246,17869, 27467,17531, 27684,17190, 27897,16846, 28106,16500, 28311,16151, 28511,15800, 28707,15447, 28899,15091, 29086,14733, 29269,14373, 29448,14010, 29622,13646, 29792,13279, 29957,12910, 30118,12540, 30274,12167, 30425,11793, 30572,11417, 30715,11039, 30853,10660, 30986,10279, 31114,9896, 31238,9512, 31357,9127, 31471,8740, 31581,8351, 31686,7962, 31786,7571, 31881,7180, 31972,6787, 32058,6393, 32138,5998, 32214,5602, 32286,5205, 32352,4808, 32413,4410, 32470,4011, 32522,3612, 32568,3212, 32610,2811, 32647,2411, 32679,2009, 32706,1608, 32729,1206, 32746,804, 32758,402, 32766};
......
......@@ -22,8 +22,9 @@
#include <stdio.h>
#include <stdlib.h>
#include "defs.h"
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
#include "PHY/impl_defs_top.h"
//extern unsigned int lte_gold_table[3][20][2][14];
//#define DEBUG_DL_CELL_SPEC
......
......@@ -24,8 +24,10 @@
#include <stdio.h>
#include <stdlib.h>
#include "defs.h"
#include "PHY/defs.h"
#include "lte_refsig.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
#include "PHY/impl_defs_top.h"
//extern unsigned int lte_gold_table[10][3][42];
//#define DEBUG_DL_MBSFN
......
......@@ -33,9 +33,11 @@
#include <stdio.h>
#include <stdlib.h>
#include "defs.h"
#include "PHY/defs.h"
#include "lte_refsig.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
#include "log.h"
#include "PHY/impl_defs_top.h"