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 @@ ...@@ -37,7 +37,7 @@
#include <errno.h> #include <errno.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <dlfcn.h> #include <dlfcn.h>
#include "openair1/PHY/defs.h" #include "openair1/PHY/defs_common.h"
#define LOAD_MODULE_SHLIB_MAIN #define LOAD_MODULE_SHLIB_MAIN
#include "common/config/config_userapi.h" #include "common/config/config_userapi.h"
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#endif #endif
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include "PHY/CODING/defs.h" #include "PHY/CODING/coding_defs.h"
#include "extern_3GPPinterleaver.h" #include "extern_3GPPinterleaver.h"
//#define DEBUG_TURBO_ENCODER 1 //#define DEBUG_TURBO_ENCODER 1
......
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
date: 09.2012 date: 09.2012
*/ */
#ifndef TC_MAIN #ifndef TC_MAIN
#include "defs.h" #include "coding_defs.h"
#include "extern_3GPPinterleaver.h" #include "extern_3GPPinterleaver.h"
#else #else
#include "vars.h" #include "coding_vars.h"
#include <stdint.h> #include <stdint.h>
#endif #endif
#include <stdio.h> #include <stdio.h>
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
*/ */
#include "PHY/defs.h" #include "PHY/defs_common.h"
#include "PHY/CODING/defs.h" #include "PHY/CODING/coding_defs.h"
#include "PHY/CODING/lte_interleaver_inline.h" #include "PHY/CODING/lte_interleaver_inline.h"
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
......
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
#ifndef TEST_DEBUG #ifndef TEST_DEBUG
#include "PHY/defs.h" #include "PHY/defs_common.h"
#include "PHY/CODING/defs.h" #include "PHY/CODING/coding_defs.h"
#include "PHY/CODING/lte_interleaver_inline.h" #include "PHY/CODING/lte_interleaver_inline.h"
#include "extern_3GPPinterleaver.h" #include "extern_3GPPinterleaver.h"
#else #else
......
...@@ -41,8 +41,8 @@ ...@@ -41,8 +41,8 @@
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
#ifndef TEST_DEBUG #ifndef TEST_DEBUG
#include "PHY/defs.h" #include "PHY/defs_common.h"
#include "PHY/CODING/defs.h" #include "PHY/CODING/coding_defs.h"
#include "PHY/CODING/lte_interleaver_inline.h" #include "PHY/CODING/lte_interleaver_inline.h"
#include "extern_3GPPinterleaver.h" #include "extern_3GPPinterleaver.h"
#else #else
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
#ifndef TEST_DEBUG #ifndef TEST_DEBUG
#include "PHY/defs.h" #include "PHY/defs_common.h"
#include "PHY/CODING/defs.h" #include "PHY/CODING/coding_defs.h"
#include "PHY/CODING/lte_interleaver_inline.h" #include "PHY/CODING/lte_interleaver_inline.h"
#include "extern_3GPPinterleaver.h" #include "extern_3GPPinterleaver.h"
#else #else
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
author: raymond.knopp@eurecom.fr, based on similar code for 3GPP convolutional code (UMTS) by P. Humblet (2000) author: raymond.knopp@eurecom.fr, based on similar code for 3GPP convolutional code (UMTS) by P. Humblet (2000)
date: 10.2004 date: 10.2004
*/ */
#include "defs.h" #include "coding_defs.h"
unsigned short gdot11[] = { 0133, 0171 }; // {A,B} unsigned short gdot11[] = { 0133, 0171 }; // {A,B}
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
author: raymond.knopp@eurecom.fr author: raymond.knopp@eurecom.fr
date: 21.10.2009 date: 21.10.2009
*/ */
#include "defs.h" #include "coding_defs.h"
//#define DEBUG_CCODE 1 //#define DEBUG_CCODE 1
......
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
#include <sys/types.h> #include <sys/types.h>
#include "PHY/defs.h" #include "PHY/defs_common.h"
#include "PHY/extern.h" #include "PHY/phy_extern.h"
#include "common/utils/load_module_shlib.h" #include "common/utils/load_module_shlib.h"
#include "common/utils/telnetsrv/telnetsrv.h" #include "common/utils/telnetsrv/telnetsrv.h"
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
*/ */
#include "defs.h" #include "coding_defs.h"
/*ref 36-212 v8.6.0 , pp 8-9 */ /*ref 36-212 v8.6.0 , pp 8-9 */
......
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#endif #endif
#include "PHY/defs.h" #include "PHY/defs_common.h"
#include "PHY/LTE_TRANSPORT/transport_common.h"
#include "assertions.h" #include "assertions.h"
//#define cmin(a,b) ((a)<(b) ? (a) : (b)) //#define cmin(a,b) ((a)<(b) ? (a) : (b))
......
...@@ -24,8 +24,9 @@ ...@@ -24,8 +24,9 @@
author: raymond.knopp@eurecom.fr author: raymond.knopp@eurecom.fr
date: 21.10.2009 date: 21.10.2009
*/ */
#include "PHY/defs.h" #include "PHY/defs_common.h"
#include "SCHED/extern.h" #include "PHY/LTE_TRANSPORT/transport_common.h"
#include "PHY/CODING/coding_defs.h"
//#define DEBUG_SEGMENTATION //#define DEBUG_SEGMENTATION
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
*/ */
#ifndef TEST_DEBUG #ifndef TEST_DEBUG
#include "PHY/defs.h" #include "PHY/defs_common.h"
#include "PHY/extern.h" #include "PHY/phy_extern.h"
#else #else
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
*/ */
/*!\brief Initilization and reconfiguration routines for LTE PHY */ /*!\brief Initilization and reconfiguration routines for LTE PHY */
#include "defs.h" #include "phy_init.h"
#include "PHY/extern.h" #include "PHY/phy_extern.h"
#include "PHY/CODING/extern.h" #include "PHY/CODING/coding_extern.h"
void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms) void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms)
{ {
......
...@@ -19,14 +19,15 @@ ...@@ -19,14 +19,15 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#include "defs.h" #include "phy_init.h"
#include "SCHED/defs.h" #include "SCHED/sched_eNB.h"
#include "PHY/extern.h" #include "PHY/phy_extern.h"
#include "SIMULATION/TOOLS/defs.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 "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h" #include "RadioResourceConfigDedicated.h"
#include "TDD-Config.h" #include "TDD-Config.h"
#include "LAYER2/MAC/extern.h"
#include "MBSFN-SubframeConfigList.h" #include "MBSFN-SubframeConfigList.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
#include "assertions.h" #include "assertions.h"
...@@ -721,23 +722,6 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id, ...@@ -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, int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
unsigned char is_secondary_eNB, unsigned char is_secondary_eNB,
unsigned char abstraction_flag) unsigned char abstraction_flag)
......
...@@ -19,14 +19,13 @@ ...@@ -19,14 +19,13 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#include "defs.h" #include "phy_init.h"
#include "SCHED/defs.h" #include "SCHED/sched_eNB.h"
#include "PHY/extern.h" #include "PHY/phy_extern.h"
#include "SIMULATION/TOOLS/defs.h" #include "SIMULATION/TOOLS/sim.h"
#include "RadioResourceConfigCommonSIB.h" #include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h" #include "RadioResourceConfigDedicated.h"
#include "TDD-Config.h" #include "TDD-Config.h"
#include "LAYER2/MAC/extern.h"
#include "MBSFN-SubframeConfigList.h" #include "MBSFN-SubframeConfigList.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
#include "assertions.h" #include "assertions.h"
......
...@@ -19,19 +19,19 @@ ...@@ -19,19 +19,19 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#include "defs.h" #include "phy_init.h"
#include "SCHED/defs.h" #include "SCHED_UE/sched_UE.h"
#include "PHY/extern.h" #include "PHY/phy_extern_ue.h"
#include "SIMULATION/TOOLS/defs.h" #include "SIMULATION/TOOLS/sim.h"
#include "RadioResourceConfigCommonSIB.h" #include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h" #include "RadioResourceConfigDedicated.h"
#include "TDD-Config.h" #include "TDD-Config.h"
#include "LAYER2/MAC/extern.h"
#include "MBSFN-SubframeConfigList.h" #include "MBSFN-SubframeConfigList.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
#include "assertions.h" #include "assertions.h"
#include <math.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}; 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, ...@@ -651,7 +651,7 @@ int init_lte_ue_signal(PHY_VARS_UE *ue,
int th_id; 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,"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 @@ ...@@ -25,10 +25,11 @@
#include <execinfo.h> #include <execinfo.h>
#include <signal.h> #include <signal.h>
#include "SIMULATION/TOOLS/defs.h" #include "SIMULATION/TOOLS/sim.h"
#include "PHY/types.h" #include "PHY/types.h"
#include "PHY/defs.h" #include "PHY/defs_eNB.h"
#include "PHY/extern.h" #include "PHY/defs_UE.h"
#include "PHY/phy_extern.h"
extern PHY_VARS_eNB *eNB; extern PHY_VARS_eNB *eNB;
extern PHY_VARS_UE *UE; extern PHY_VARS_UE *UE;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#include "defs.h" #include "phy_init.h"
#include "log.h" #include "log.h"
uint16_t dl_S_table_normal[10]={3,9,10,11,12,3,9,10,11,6}; uint16_t dl_S_table_normal[10]={3,9,10,11,12,3,9,10,11,6};
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
#ifndef __INIT_DEFS__H__ #ifndef __INIT_DEFS__H__
#define __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 "SystemInformationBlockType2.h"
//#include "RadioResourceConfigCommonSIB.h" //#include "RadioResourceConfigCommonSIB.h"
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
*/ */
#include "PHY/types.h" #include "PHY/types.h"
#include "PHY/defs.h" #include "PHY/defs_UE.h"
#include "PHY/extern.h" #include "PHY/phy_extern_ue.h"
void void
phy_adjust_gain (PHY_VARS_UE *ue, uint32_t rx_power_fil_dB, uint8_t eNB_id) phy_adjust_gain (PHY_VARS_UE *ue, uint32_t rx_power_fil_dB, uint8_t eNB_id)
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#include "PHY/defs.h" #include "PHY/defs_eNB.h"
#include "PHY/extern.h" #include "PHY/phy_extern.h"
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
// This is 512/(1:256) in __m128i format // This is 512/(1:256) in __m128i format
......
...@@ -20,10 +20,11 @@ ...@@ -20,10 +20,11 @@
*/ */
#include "PHY/types.h" #include "PHY/types.h"
#include "PHY/defs.h" #include "PHY/defs_UE.h"
#include "PHY/extern.h" #include "PHY/phy_extern_ue.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
#include "lte_estimation_defs.h"
#define DEBUG_PHY #define DEBUG_PHY
...@@ -136,126 +137,3 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -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 @@ ...@@ -20,8 +20,7 @@
*/ */
#include <string.h> #include <string.h>
#include "defs.h" #include "PHY/defs_UE.h"
#include "PHY/defs.h"
#include "filt16_32.h" #include "filt16_32.h"
//#define DEBUG_BF_CH //#define DEBUG_BF_CH
......
...@@ -20,9 +20,7 @@ ...@@ -20,9 +20,7 @@
*/ */
#include <string.h> #include <string.h>
#include "defs.h" #include "PHY/defs_UE.h"
#include "SCHED/defs.h"
#include "PHY/defs.h"
#include "filt96_32.h" #include "filt96_32.h"
#include "T.h" #include "T.h"
//#define DEBUG_CH //#define DEBUG_CH
......
...@@ -20,8 +20,7 @@ ...@@ -20,8 +20,7 @@
*/ */
#include <string.h> #include <string.h>
#include "defs.h" #include "PHY/defs_UE.h"
#include "PHY/defs.h"
//#define DEBUG_CH //#define DEBUG_CH
int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue, int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue,
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#include "PHY/defs.h" #include "PHY/defs_eNB.h"
#include "PHY/extern.h" #include "PHY/phy_extern.h"
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
......