Commit 303d6771 authored by Guy De Souza's avatar Guy De Souza

Merge branch 'develop-uedirectorysplit' into nr_initialsync

parents 996a3013 e4c44dd0
This diff is collapsed.
......@@ -69,6 +69,8 @@ DISABLE_LOG_X="False"
USRP_REC_PLAY="False"
BUILD_ECLIPSE=0
NR="False"
UE_NAS_USE_TUN="False"
trap handle_ctrl_c INT
function print_help() {
......@@ -164,6 +166,8 @@ Options
Build eclipse project files. Paths are auto corrected by fixprj.sh
--usrp-recplay
Build for I/Q record-playback modes
--ue-nas-use-tun
Use TUN devices for the UEs instead of ue_ip.ko
Usage (first build):
oaisim (eNB + UE): ./build_oai -I --oaisim -x --install-system-files
Eurecom EXMIMO + COTS UE : ./build_oai -I --eNB -x --install-system-files
......@@ -376,6 +380,10 @@ function main() {
USRP_REC_PLAY="True"
echo_info "Enabling USRP record playback mode"
shift 1;;
--ue-nas-use-tun)
UE_NAS_USE_TUN="True"
echo_info "Enabling UE NAS TUN device usage instead of ue_ip.ko"
shift 1;;
-h | --help)
print_help
exit 1;;
......@@ -674,12 +682,17 @@ function main() {
if [ "$SIMUS_PHY" = "1" ] ; then
# lte unitary simulators compilation
echo_info "Compiling unitary tests simulators"
simlist="dlsim_tm4 dlsim ulsim pucchsim prachsim pdcchsim pbchsim mbmssim"
# TODO: fix: dlsim_tm4 pucchsim prachsim pdcchsim pbchsim mbmssim
#simlist="dlsim_tm4 dlsim ulsim pucchsim prachsim pdcchsim pbchsim mbmssim"
simlist="dlsim ulsim"
for f in $simlist ; do
compilations \
lte-simulators $f \
$f $dbin/$f.$REL
done
compilations \
lte-simulators coding \
libcoding.so $dbin/libcoding.so
fi
# Core simulators
......@@ -739,6 +752,7 @@ function main() {
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
echo "set ( UE_NAS_USE_TUN $UE_NAS_USE_TUN )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
[ "$CLEAN" = "1" ] && rm -rf $DIR/$oaisim_build_dir/build
mkdir -p $DIR/$oaisim_build_dir/build
......@@ -747,6 +761,12 @@ function main() {
compilations \
$oaisim_build_dir $oaisim_exec \
$oaisim_exec $dbin/$oaisim_exec.$REL
compilations \
$oaisim_build_dir $config_libconfig_shlib \
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
compilations \
$oaisim_build_dir coding \
libcoding.so $dbin/libcoding.so
if [ "$NOS1" != "1" ] ; then
......
......@@ -8,5 +8,5 @@ set(DEBUG_PHY False)
set(MU_RECIEVER False)
set(NAS_UE False)
set(MESSAGE_CHART_GENERATOR False)
set(RRC_ASN1_VERSION "Rel14")
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)
......@@ -210,7 +210,7 @@ install_protobuf_from_source(){
#cd protobuf-2.6.1/
rm -rf /tmp/protobuf-cpp-3.3.0.tar.gz* /tmp/protobuf-3.3.0
wget https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $USER --group $USER --no-same-owner
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $USER --group $(groups | cut -d" " -f1) --no-same-owner
cd protobuf-3.3.0/
./configure
echo "Compiling protobuf"
......
......@@ -130,6 +130,7 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
{
case TYPE_STRING:
printf("call config_lookup_string for '%s' %p\n", cfgpath, &(libconfig_privdata.cfg)); fflush(stdout);
if ( config_lookup_string(&(libconfig_privdata.cfg),cfgpath, (const char **)&str)) {
if ( cfgoptions[i].numelt > 0 && str != NULL && strlen(str) >= cfgoptions[i].numelt ) {
fprintf(stderr,"[LIBCONFIG] %s: %s exceeds maximum length of %i bytes, value truncated\n",
......
......@@ -35,11 +35,11 @@
#include <pthread.h>
#include "COMMON/platform_constants.h"
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
#include "PHY/types.h"
#include "PHY/impl_defs_top.h"
#include "PHY/impl_defs_lte.h"
#include "RRC/LITE/defs.h"
#include "RRC/LTE/rrc_defs.h"
#include "flexran_agent_defs.h"
#include "gtpv1u.h"
......@@ -49,7 +49,7 @@
#include "gtpv1u_eNB_defs.h"
#include "PHY/defs_L1_NB_IoT.h"
#include "RRC/LITE/defs_NB_IoT.h"
#include "RRC/LTE/defs_NB_IoT.h"
typedef struct {
/// RAN context config file name
char *config_file_name;
......
......@@ -32,7 +32,7 @@ typedef struct {
#define VCD_NUM_FUNCTIONS 187
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_VARIABLES 128
#define VCD_NUM_VARIABLES 131
/* first VCD function (to be kept up to date! see in T_messages.txt) */
#define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP)
......
......@@ -1442,6 +1442,18 @@ ID = VCD_VARIABLE_UE0_TRX_WRITE_NS_MISSING
DESC = VCD variable UE0_TRX_WRITE_NS_MISSING
GROUP = ALL:VCD:UE:VCD_VARIABLE
FORMAT = ulong,value
ID = VCD_VARIABLE_CPUID_ENB_THREAD_RXTX
DESC = VCD variable CPUID_ENB_THREAD_RXTX
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
ID = VCD_VARIABLE_CPUID_RU_THREAD
DESC = VCD variable CPUID_RU_THREAD
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
ID = VCD_VARIABLE_CPUID_RU_THREAD_TX
DESC = VCD variable CPUID_RU_THREAD_TX
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
#functions
......
......@@ -72,6 +72,9 @@ const int itti_debug = (ITTI_DEBUG_ISSUES | ITTI_DEBUG_MP_STATISTICS);
/* Global message size */
#define MESSAGE_SIZE(mESSAGEiD) (sizeof(MessageHeader) + itti_desc.messages_info[mESSAGEiD].size)
extern int emulate_rf;
typedef enum task_state_s {
TASK_STATE_NOT_CONFIGURED, TASK_STATE_STARTING, TASK_STATE_READY, TASK_STATE_ENDED, TASK_STATE_MAX,
} task_state_t;
......@@ -325,8 +328,11 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me
/* Increment the global message number */
message_number = itti_increment_message_number ();
#if 0
/* itti dump is disabled */
itti_dump_queue_message (origin_task_id, message_number, message, itti_desc.messages_info[message_id].name,
sizeof(MessageHeader) + message->ittiMsgHeader.ittiMsgSize);
#endif
if (destination_task_id != TASK_UNKNOWN) {
......@@ -339,14 +345,16 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me
destination_task_id,
itti_get_task_name(destination_task_id));
} else {
/* We cannot send a message if the task is not running */
AssertFatal (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_READY,
"Task %s Cannot send message %s (%d) to thread %d, it is not in ready state (%d)!\n",
itti_get_task_name(origin_task_id),
itti_desc.messages_info[message_id].name,
message_id,
destination_thread_id,
itti_desc.threads[destination_thread_id].task_state);
if(!emulate_rf){
/* We cannot send a message if the task is not running */
AssertFatal (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_READY,
"Task %s Cannot send message %s (%d) to thread %d, it is not in ready state (%d)!\n",
itti_get_task_name(origin_task_id),
itti_desc.messages_info[message_id].name,
message_id,
destination_thread_id,
itti_desc.threads[destination_thread_id].task_state);
}
/* Allocate new list element */
new = (message_list_t *) itti_malloc (origin_task_id, destination_task_id, sizeof(struct message_list_s));
......@@ -421,8 +429,11 @@ int itti_try_send_msg_to_task(task_id_t destination_task_id, instance_t instance
/* Increment the global message number */
message_number = itti_increment_message_number ();
#if 0
/* itti dump is disabled */
itti_dump_queue_message (origin_task_id, message_number, message, itti_desc.messages_info[message_id].name,
sizeof(MessageHeader) + message->ittiMsgHeader.ittiMsgSize);
#endif
if (destination_task_id != TASK_UNKNOWN) {
......@@ -716,8 +727,11 @@ void itti_mark_task_ready(task_id_t task_id)
AssertFatal (thread_id < itti_desc.thread_max, "Thread id (%d) is out of range (%d)!\n", thread_id, itti_desc.thread_max);
#if 0
/* itti dump is disabled */
/* Register the thread in itti dump */
itti_dump_thread_use_ring_buffer();
#endif
/* Mark the thread as using LFDS queue */
lfds611_queue_use(itti_desc.tasks[task_id].message_queue);
......@@ -848,7 +862,10 @@ int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_i
itti_desc.wait_tasks = 0;
itti_desc.created_tasks = 0;
itti_desc.ready_tasks = 0;
#if 0
/* itti dump is disabled */
itti_dump_init (messages_definition_xml, dump_file_name);
#endif
CHECK_INIT_RETURN(timer_init ());
......@@ -915,7 +932,10 @@ void itti_wait_tasks_end(void)
exit (0);
}
#if 0
/* itti dump is disabled */
itti_dump_exit();
#endif
}
void itti_send_terminate_message(task_id_t task_id)
......
......@@ -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"
......
......@@ -47,7 +47,10 @@ extern RAN_CONTEXT_t RC;
#include "fapi_stub.h"
//#include "fapi_l1.h"
#include "UTIL/LOG/log.h"
#include "openair2/LAYER2/MAC/proto.h"
#include "openair2/LAYER2/MAC/mac_proto.h"
#include "PHY/INIT/phy_init.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#define NUM_P5_PHY 2
......
......@@ -37,7 +37,8 @@
#include "vendor_ext.h"
#include "nfapi_vnf.h"
#include "PHY/defs_eNB.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
......@@ -201,8 +202,8 @@ void oai_create_enb(void) {
eNB->CC_id = bodge_counter;
eNB->abstraction_flag = 0;
eNB->single_thread_flag = 0;//single_thread_flag;
eNB->td = ulsch_decoding_data;//(single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
eNB->te = dlsch_encoding;//(single_thread_flag==1) ? dlsch_encoding_2threads : dlsch_encoding;
eNB->td = ulsch_decoding_data_all;//(single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
eNB->te = dlsch_encoding_all;//(single_thread_flag==1) ? dlsch_encoding_2threads : dlsch_encoding;
RC.nb_CC[bodge_counter] = 1;
......
......@@ -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,9 @@
#ifndef TEST_DEBUG
#include "PHY/defs.h"
#include "PHY/CODING/defs.h"
#include "PHY/impl_defs_top.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,9 @@
#include "PHY/sse_intrin.h"
#ifndef TEST_DEBUG
#include "PHY/defs.h"
#include "PHY/CODING/defs.h"
#include "PHY/impl_defs_top.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
......
......@@ -29,7 +29,7 @@
#include <stdint.h>
#include "PHY/defs.h"
#include "PHY/defs_common.h"
#define CRC24_A 0
#define CRC24_B 1
......@@ -75,20 +75,7 @@ int32_t lte_segmentation(uint8_t *input_buffer,
uint32_t *Kminus,
uint32_t *F);
/** \fn int16_t estimate_ue_tx_power(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs)
\brief this functions calculates the delta MCS in dB based on the lte_segmentation function
\param tbs transport block size
\param nb_rb number of required rb
\param control_only a flag for the type of data
\param ncp cyclic prefix
\param use_srs a flag indicating the use of srs in the current SF
\returns ue_tx_power estimated ue tx power = delat_ mcs + bw_factor
*/
int16_t estimate_ue_tx_power(uint32_t tbs,
uint32_t nb_rb,
uint8_t control_only,
lte_prefix_type_t ncp,
uint8_t use_srs);
/** \fn uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
\brief This is the subblock interleaving algorithm from 36-212 (Release 8, 8.6 2009-03), pages 15-16.
......
......@@ -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,8 +28,8 @@
#include <stdio.h>
#include <stdlib.h>
#endif
#include "PHY/defs.h"
#include "assertions.h"
#include "PHY/defs_eNB.h"
#include "PHY/LTE_TRANSPORT/transport_common.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_eNB.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,50 @@
*/
/*!\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"
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
void generate_64qam_table(void)
{
int a,b,c,index;
for (a=-1; a<=1; a+=2)
for (b=-1; b<=1; b+=2)
for (c=-1; c<=1; c+=2) {
index = (1+a)*2 + (1+b) + (1+c)/2;
qam64_table[index] = -a*(QAM64_n1 + b*(QAM64_n2 + (c*QAM64_n3))); // 0 1 2
}
}
void generate_16qam_table(void)
{
int a,b,index;
for (a=-1; a<=1; a+=2)
for (b=-1; b<=1; b+=2) {
index = (1+a) + (1+b)/2;
qam16_table[index] = -a*(QAM16_n1 + (b*QAM16_n2));
}
}
void generate_qpsk_table(void)
{
int a,index;
for (a=-1; a<=1; a+=2) {
index = (1+a)/2;
qpsk_table[index] = -a*QPSK;
}
}
void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms)
{
......
File moved
......@@ -19,14 +19,17 @@
* contact@openairinterface.org
*/
#include "defs.h"
#include "SCHED/defs.h"
#include "PHY/extern.h"
#include "SIMULATION/TOOLS/defs.h"
#include "PHY/defs_eNB.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 "PHY/LTE_REFSIG/lte_refsig.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 +724,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,20 @@
* 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"
#include "PHY/LTE_REFSIG/lte_refsig.h"
uint8_t dmrs1_tab_ue[8] = {0,2,3,4,6,8,9,10};
......@@ -651,7 +652,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,14 @@
#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"
#include "phy_init.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.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,118 +20,49 @@
*/
#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 "openair2/LAYER2/MAC/mac_proto.h"
#define DEBUG_PHY
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)
// Adjust location synchronization point to account for drift
// The adjustment is performed once per frame based on the
// last channel estimate of the receiver
void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
PHY_VARS_UE *ue,
unsigned char eNB_id,
uint8_t subframe,
unsigned char clear,
short coef)
{
static int max_pos_fil2 = 0;
int temp, i, aa, max_pos = 0,ind;
int max_val=0;
static int max_pos_fil = 0;
static int count_max_pos_ok = 0;
static int first_time = 1;
int temp = 0, i, aa, max_val = 0, max_pos = 0;
int diff;
short Re,Im,ncoef;
#ifdef DEBUG_PHY
char fname[100],vname[100];
#endif
ncoef = 32768 - coef;
for (ind=0; ind<number_of_cards; ind++) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_IN);
if (ind==0)
max_val=0;
ncoef = 32767 - coef;
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
}
LOG_D(PHY,"AbsSubframe %d.%d: rx_offset (before) = %d\n",ue->proc.proc_rxtx[0].frame_rx%1024,subframe,ue->rx_offset);
#endif //DEBUG_PHY
// 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++) {
// we only use channel estimates from tx antenna 0 here
for (i = 0; i < frame_parms->nb_prefix_samples; 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)];
Re = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id][aa])[(i<<2)];
Im = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id][aa])[1+(i<<2)];
temp += (Re*Re/2) + (Im*Im/2);
}
......@@ -141,12 +72,66 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* eNB,uint8_t UE_id)
}
}
if (max_pos>frame_parms->ofdm_symbol_size/2)
max_pos = max_pos-frame_parms->ofdm_symbol_size;
// filter position to reduce jitter
if (clear == 1)
max_pos_fil = max_pos;
else
max_pos_fil = ((max_pos_fil * coef) + (max_pos * ncoef)) >> 15;
// do not filter to have proactive timing adjustment
max_pos_fil = max_pos;
if(subframe == 6)
{
diff = max_pos_fil - (frame_parms->nb_prefix_samples>>3);
if ( abs(diff) < SYNCH_HYST )
ue->rx_offset = 0;
else
ue->rx_offset = diff;
if(abs(diff)<5)
count_max_pos_ok ++;
else
count_max_pos_ok = 0;
if(count_max_pos_ok > 10 && first_time == 1)
{
first_time = 0;
ue->time_sync_cell = 1;
if (ue->mac_enabled==1) {
LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",ue->Mod_id);
//mac_resynch();
dl_phy_sync_success(ue->Mod_id,ue->proc.proc_rxtx[0].frame_rx,0,1);//ue->common_vars.eNb_id);
ue->UE_mode[0] = PRACH;
}
else {
ue->UE_mode[0] = PUSCH;
}
}
if ( ue->rx_offset < 0 )
ue->rx_offset += FRAME_LENGTH_COMPLEX_SAMPLES;
if ( ue->rx_offset >= FRAME_LENGTH_COMPLEX_SAMPLES )
ue->rx_offset -= FRAME_LENGTH_COMPLEX_SAMPLES;
//#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;
#ifdef DEBUG_PHY
LOG_D(PHY,"AbsSubframe %d.%d: ThreadId %d diff =%i rx_offset (final) = %i : clear %d,max_pos = %d,max_pos_fil = %d (peak %d) max_val %d target_pos %d \n",
ue->proc.proc_rxtx[ue->current_thread_id[subframe]].frame_rx,
subframe,
ue->current_thread_id[subframe],
diff,
ue->rx_offset,
clear,
max_pos,
max_pos_fil,
temp,max_val,
(frame_parms->nb_prefix_samples>>3));
#endif //DEBUG_PHY
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_OUT);
}
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* 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
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "PHY/types.h"
#include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#define DEBUG_PHY
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,10 @@
*/
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/defs_UE.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/impl_defs_top.h"
#include "openair2/LAYER2/MAC/mac_proto.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
......
......@@ -20,8 +20,10 @@
*/
#include <string.h>
#include "defs.h"
#include "PHY/defs.h"
#include "PHY/defs_UE.h"
#include "lte_estimation.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "filt16_32.h"
//#define DEBUG_BF_CH
......
......@@ -20,12 +20,13 @@
*/
#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
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "SCHED_UE/sched_UE.h"
int lte_dl_channel_estimation(PHY_VARS_UE *ue,
uint8_t eNB_id,
......
......@@ -20,8 +20,9 @@
*/
#include <string.h>
#include "defs.h"
#include "PHY/defs.h"
#include "PHY/defs_UE.h"
#include "lte_estimation.h"
#include "PHY/LTE_REFSIG/lte_refsig.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.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"
//extern unsigned int lte_gold_table[3][20][2][14];
//#define DEBUG_DL_CELL_SPEC
......
......@@ -19,7 +19,7 @@
* contact@openairinterface.org
*/
#include "defs.h"
#include "lte_refsig.h"
/* c(n) = x1(n+Nc) + x2(n+Nc) mod 2
......
......@@ -42,7 +42,7 @@
//unsigned int lte_gold_table[10][3][42]; // need 165 bytes for sequence
//slot index x pilot within slot x sequence*/
#include "defs.h"
#include "lte_refsig.h"
void lte_gold_mbsfn(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_mbsfn_table[10][3][42],uint16_t Nid_mbsfn)
{
......
......@@ -23,7 +23,8 @@
/* Author R. Knopp / EURECOM / OpenAirInterface.org */
#ifndef __LTE_REFSIG_DEFS__H__
#define __LTE_REFSIG_DEFS__H__
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
/** @ingroup _PHY_REF_SIG
* @{
......
......@@ -24,7 +24,8 @@
#include <stdlib.h>
#include <math.h>
#endif
#include "defs.h"
#include "lte_refsig.h"
#include "PHY/defs_eNB.h"
uint16_t dftsizes[33] = {12,24,36,48,60,72,96,108,120,144,180,192,216,240,288,300,324,360,384,432,480,540,576,600,648,720,864,900,960,972,1080,1152,1200};
......
......@@ -32,16 +32,19 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SCHED/defs.h"
#include "SIMULATION/TOOLS/defs.h" // for taus
#include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "SCHED/sched_eNB.h"
#include "SIMULATION/TOOLS/sim.h" // for taus
#include "PHY/sse_intrin.h"
#include "transport_proto.h"
#include "transport_common_proto.h"
#include "assertions.h"
#include "T.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "PHY/LTE_TRANSPORT/transport_extern.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
//#define DEBUG_DCI_ENCODING 1
//#define DEBUG_DCI_DECODING 1
......@@ -52,65 +55,7 @@
//extern uint16_t phich_reg[MAX_NUM_PHICH_GROUPS][3];
//extern uint16_t pcfich_reg[4];
uint32_t check_phich_reg(LTE_DL_FRAME_PARMS *frame_parms,uint32_t kprime,uint8_t lprime,uint8_t mi)
{
uint16_t i;
uint16_t Ngroup_PHICH = (frame_parms->phich_config_common.phich_resource*frame_parms->N_RB_DL)/48;
uint16_t mprime;
uint16_t *pcfich_reg = frame_parms->pcfich_reg;
if ((lprime>0) && (frame_parms->Ncp==0) )
return(0);
// printf("check_phich_reg : mi %d\n",mi);
// compute REG based on symbol
if ((lprime == 0)||
((lprime==1)&&(frame_parms->nb_antenna_ports_eNB == 4)))
mprime = kprime/6;
else
mprime = kprime>>2;
// check if PCFICH uses mprime
if ((lprime==0) &&
((mprime == pcfich_reg[0]) ||
(mprime == pcfich_reg[1]) ||
(mprime == pcfich_reg[2]) ||
(mprime == pcfich_reg[3]))) {
#ifdef DEBUG_DCI_ENCODING
printf("[PHY] REG %d allocated to PCFICH\n",mprime);
#endif
return(1);
}
// handle Special subframe case for TDD !!!
// printf("Checking phich_reg %d\n",mprime);
if (mi > 0) {
if (((frame_parms->phich_config_common.phich_resource*frame_parms->N_RB_DL)%48) > 0)
Ngroup_PHICH++;
if (frame_parms->Ncp == 1) {
Ngroup_PHICH<<=1;
}
for (i=0; i<Ngroup_PHICH; i++) {
if ((mprime == frame_parms->phich_reg[i][0]) ||
(mprime == frame_parms->phich_reg[i][1]) ||
(mprime == frame_parms->phich_reg[i][2])) {
#ifdef DEBUG_DCI_ENCODING
printf("[PHY] REG %d (lprime %d) allocated to PHICH\n",mprime,lprime);
#endif
return(1);
}
}
}
return(0);
}
static uint8_t d[3*(MAX_DCI_SIZE_BITS + 16) + 96];
static uint8_t w[3*3*(MAX_DCI_SIZE_BITS+16)];
......@@ -226,15 +171,10 @@ uint8_t *generate_dci0(uint8_t *dci,
uint32_t Y;
#define CCEBITS 72
#define CCEPERSYMBOL 33 // This is for 1200 RE
#define CCEPERSYMBOL0 22 // This is for 1200 RE
#define DCI_BITS_MAX ((2*CCEPERSYMBOL+CCEPERSYMBOL0)*CCEBITS)
#define Msymb (DCI_BITS_MAX/2)
//#define Mquad (Msymb/4)
static uint32_t bitrev_cc_dci[32] = {1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31,0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30};
static int32_t wtemp[2][Msymb];
void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,int32_t **z, int32_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi)
{
......@@ -247,6 +187,8 @@ void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,int32_t **z, int32_t **w
#ifdef RM_DEBUG
int32_t nulled=0;
#endif
uint32_t Msymb=(DCI_BITS_MAX/2);
int32_t wtemp[2][Msymb];
// printf("[PHY] PDCCH Interleaving Mquad %d (Nsymb %d)\n",Mquad,n_symbols_pdcch);
if ((Mquad&0x1f) > 0)
......@@ -347,8 +289,9 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
uint32_t gain_lin_QPSK,kprime,kprime_mod12,mprime,nsymb,symbol_offset,tti_offset;
int16_t re_offset;
uint8_t mi = get_mi(frame_parms,subframe);
static uint8_t e[DCI_BITS_MAX];
static int32_t yseq0[Msymb],yseq1[Msymb],wbar0[Msymb],wbar1[Msymb];
uint8_t e[DCI_BITS_MAX];
uint32_t Msymb=(DCI_BITS_MAX/2);
int32_t yseq0[Msymb],yseq1[Msymb],wbar0[Msymb],wbar1[Msymb];
int32_t *y[2];
int32_t *wbar[2];
......@@ -412,7 +355,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
/* clear all bits, the above code may generate too much false detections
* (not sure about this, to be checked somehow)
*/
// memset(e, 0, DCI_BITS_MAX);
//memset(e, 0, DCI_BITS_MAX);
e_ptr = e;
......@@ -434,6 +377,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
#endif
if (dci_alloc[i].firstCCE>=0) {
//printf("generate DCI .%d rnti %d length %d\n", subframe, dci_alloc[i].rnti, dci_alloc[i].dci_length);
e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
e+(72*dci_alloc[i].firstCCE),
dci_alloc[i].dci_length,
......@@ -676,58 +620,3 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
}
uint16_t get_nCCE(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uint8_t mi)
{
return(get_nquad(num_pdcch_symbols,frame_parms,mi)/9);
}
uint16_t get_nquad(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uint8_t mi)
{
uint16_t Nreg=0;
uint8_t Ngroup_PHICH = (frame_parms->phich_config_common.phich_resource*frame_parms->N_RB_DL)/48;
if (((frame_parms->phich_config_common.phich_resource*frame_parms->N_RB_DL)%48) > 0)
Ngroup_PHICH++;
if (frame_parms->Ncp == 1) {
Ngroup_PHICH<<=1;
}
Ngroup_PHICH*=mi;
if ((num_pdcch_symbols>0) && (num_pdcch_symbols<4))
switch (frame_parms->N_RB_DL) {
case 6:
Nreg=12+(num_pdcch_symbols-1)*18;
break;
case 25:
Nreg=50+(num_pdcch_symbols-1)*75;
break;
case 50:
Nreg=100+(num_pdcch_symbols-1)*150;
break;
case 100:
Nreg=200+(num_pdcch_symbols-1)*300;
break;
default:
return(0);
}
// printf("Nreg %d (%d)\n",Nreg,Nreg - 4 - (3*Ngroup_PHICH));
return(Nreg - 4 - (3*Ngroup_PHICH));
}
uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe)
{
// check for eNB only !
return(get_nCCE(num_pdcch_symbols,
&RC.eNB[Mod_id][CC_id]->frame_parms,
get_mi(&RC.eNB[Mod_id][CC_id]->frame_parms,subframe)));
}
......@@ -30,8 +30,18 @@
* \warning
*/
#ifndef __DCI__h__
#define __DCI__h__
#include <stdint.h>
#define CCEBITS 72
#define CCEPERSYMBOL 33 // This is for 1200 RE
#define CCEPERSYMBOL0 22 // This is for 1200 RE
#define DCI_BITS_MAX ((2*CCEPERSYMBOL+CCEPERSYMBOL0)*CCEBITS)
//#define Mquad (Msymb/4)
/// DCI Format Type 0 (5 MHz,TDD0, 27 bits)
struct DCI0_5MHz_TDD0 {
/// type = 0 => DCI Format 0, type = 1 => DCI Format 1A
......@@ -3014,3 +3024,5 @@ struct DCI_INFO_EXTRACTED {
uint64_t ap_si_nl_id:3;
};
typedef struct DCI_INFO_EXTRACTED DCI_INFO_EXTRACTED_t;
#endif
This diff is collapsed.
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* 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
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file PHY/LTE_TRANSPORT/dci_tools_common_extern.h
* \brief PHY Support routines (eNB/UE) for filling PDSCH/PUSCH/DLSCH/ULSCH data structures based on DCI PDUs generated by eNB MAC scheduler.
* \author R. Knopp
* \date 2011
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr
* \note
* \warning
*/
#include <stdint.h>
extern uint32_t localRIV2alloc_LUT6[32];
extern uint32_t distRIV2alloc_even_LUT6[32];
extern uint32_t distRIV2alloc_odd_LUT6[32];
extern uint16_t RIV2nb_rb_LUT6[32];
extern uint16_t RIV2first_rb_LUT6[32];
extern uint16_t RIV_max6;
extern uint32_t localRIV2alloc_LUT25[512];
extern uint32_t distRIV2alloc_even_LUT25[512];
extern uint32_t distRIV2alloc_odd_LUT25[512];
extern uint16_t RIV2nb_rb_LUT25[512];
extern uint16_t RIV2first_rb_LUT25[512];
extern uint16_t RIV_max25;
extern uint32_t localRIV2alloc_LUT50_0[1600];
extern uint32_t localRIV2alloc_LUT50_1[1600];
extern uint32_t distRIV2alloc_gap0_even_LUT50_0[1600];
extern uint32_t distRIV2alloc_gap0_odd_LUT50_0[1600];
extern uint32_t distRIV2alloc_gap0_even_LUT50_1[1600];
extern uint32_t distRIV2alloc_gap0_odd_LUT50_1[1600];
extern uint32_t distRIV2alloc_gap1_even_LUT50_0[1600];
extern uint32_t distRIV2alloc_gap1_odd_LUT50_0[1600];
extern uint32_t distRIV2alloc_gap1_even_LUT50_1[1600];
extern uint32_t distRIV2alloc_gap1_odd_LUT50_1[1600];
extern uint16_t RIV2nb_rb_LUT50[1600];
extern uint16_t RIV2first_rb_LUT50[1600];
extern uint16_t RIV_max50;
extern uint32_t localRIV2alloc_LUT100_0[6000];
extern uint32_t localRIV2alloc_LUT100_1[6000];
extern uint32_t localRIV2alloc_LUT100_2[6000];
extern uint32_t localRIV2alloc_LUT100_3[6000];
extern uint32_t distRIV2alloc_gap0_even_LUT100_0[6000];
extern uint32_t distRIV2alloc_gap0_odd_LUT100_0[6000];
extern uint32_t distRIV2alloc_gap0_even_LUT100_1[6000];
extern uint32_t distRIV2alloc_gap0_odd_LUT100_1[6000];
extern uint32_t distRIV2alloc_gap0_even_LUT100_2[6000];
extern uint32_t distRIV2alloc_gap0_odd_LUT100_2[6000];
extern uint32_t distRIV2alloc_gap0_even_LUT100_3[6000];
extern uint32_t distRIV2alloc_gap0_odd_LUT100_3[6000];
extern uint32_t distRIV2alloc_gap1_even_LUT100_0[6000];
extern uint32_t distRIV2alloc_gap1_odd_LUT100_0[6000];
extern uint32_t distRIV2alloc_gap1_even_LUT100_1[6000];
extern uint32_t distRIV2alloc_gap1_odd_LUT100_1[6000];
extern uint32_t distRIV2alloc_gap1_even_LUT100_2[6000];
extern uint32_t distRIV2alloc_gap1_odd_LUT100_2[6000];
extern uint32_t distRIV2alloc_gap1_even_LUT100_3[6000];
extern uint32_t distRIV2alloc_gap1_odd_LUT100_3[6000];
extern uint16_t RIV2nb_rb_LUT100[6000];
extern uint16_t RIV2first_rb_LUT100[6000];
extern uint16_t RIV_max100;
extern int8_t *delta_PUCCH_lut;
extern int8_t delta_PUSCH_acc[4];
extern int8_t delta_PUSCH_abs[4];
This diff is collapsed.
......@@ -32,12 +32,12 @@
//#define DEBUG_SCRAMBLING 1
#include "PHY/defs.h"
#include "PHY/CODING/extern.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
#include "PHY/CODING/coding_extern.h"
#include "PHY/CODING/lte_interleaver_inline.h"
#include "defs.h"
#include "extern.h"
#include "PHY/extern.h"
#include "transport_eNB.h"
#include "PHY/phy_extern.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
static inline unsigned int lte_gold_scram(unsigned int *x1, unsigned int *x2, unsigned char reset) __attribute__((always_inline));
......@@ -187,6 +187,20 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
}
void init_scrambling_lut(void) {
uint32_t s;
int i=0,j;
for (s=0;s<=65535;s++) {
for (j=0;j<16;j++) {
scrambling_lut[i++] = (uint8_t)((s>>j)&1);
}
}
}
void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
int mbsfn_flag,
LTE_UE_DLSCH_t *dlsch,
......@@ -228,7 +242,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
}
}
void init_unscrambling_lut() {
void init_unscrambling_lut(void) {
uint32_t s;
int i=0,j;
......@@ -239,15 +253,3 @@ void init_unscrambling_lut() {
}
}
}
void init_scrambling_lut() {
uint32_t s;
int i=0,j;
for (s=0;s<=65535;s++) {
for (j=0;j<16;j++) {
scrambling_lut[i++] = (uint8_t)((s>>j)&1);
}
}
}
......@@ -32,15 +32,17 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SCHED/defs.h"
#include "SIMULATION/TOOLS/defs.h" // for taus
#include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "SCHED/sched_eNB.h"
#include "SIMULATION/TOOLS/sim.h" // for taus
#include "PHY/sse_intrin.h"
#include "transport_proto.h"
#include "transport_common_proto.h"
#include "assertions.h"
#include "T.h"
#include "UTIL/LOG/log.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
//#define DEBUG_DCI_ENCODING 1
//#define DEBUG_DCI_DECODING 1
......
......@@ -29,7 +29,8 @@
* \note
* \warning
*/
#include "PHY/defs.h"
#include "PHY/defs_common.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
//#define DEBUG_GROUPHOP 1
......
......@@ -30,10 +30,10 @@
* \warning
*/
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
#include "PHY/TOOLS/alaw_lut.h"
#include "PHY/extern.h"
#include "SCHED/defs.h"
#include "PHY/phy_extern.h"
#include "SCHED/sched_eNB.h"
//#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
......
......@@ -32,7 +32,7 @@
#ifndef __IF4_TOOLS_H__
#define __IF4_TOOLS_H__
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
/// Macro for IF4 packet type
#define IF4p5_PACKET_TYPE 0x080A
......
......@@ -30,7 +30,7 @@
* \warning
*/
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
#include "PHY/TOOLS/alaw_lut.h"
#include "time_utils.h"
......
......@@ -34,7 +34,7 @@
#define __IF5_TOOLS_H__
#include <stdint.h>
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
#define IF5_RRH_GW_DL 0x0022
#define IF5_RRH_GW_UL 0x0023
......
......@@ -30,9 +30,9 @@
* \warning
*/
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/LTE_TRANSPORT/proto.h"
#include "PHY/defs_common.h"
#include "PHY/phy_extern.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
unsigned char get_Qm(unsigned char I_MCS)
{
......
......@@ -30,6 +30,9 @@
* \warning
*/
#ifndef __M_DCI__H__
#define __M_DCI__H__
#include <stdint.h>
......@@ -467,3 +470,4 @@ struct DCI6_2_di_20MHz {
typedef struct DCI6_2_di_20MHz DCI6_2_di_20MHz_t;
#define sizeof_DCI6_2_20MHz_t 13
#endif
......@@ -29,13 +29,14 @@
* \note
* \warning
*/
#include "PHY/defs.h"
#include "PHY/CODING/extern.h"
#include "PHY/defs_eNB.h"
#include "PHY/CODING/coding_extern.h"
#include "PHY/CODING/lte_interleaver_inline.h"
#include "defs.h"
#include "extern.h"
#include "PHY/extern.h"
#include "transport_eNB.h"
#include "transport_proto.h"
#include "PHY/phy_extern.h"
#include "PHY/sse_intrin.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
//#define DEBUG_PBCH 1
//#define DEBUG_PBCH_ENCODING
......@@ -138,6 +139,31 @@ int allocate_pbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
return(0);
}
void pbch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t *pbch_e,
uint32_t length)
{
int i;
uint8_t reset;
uint32_t x1, x2, s=0;
reset = 1;
// x1 is set in lte_gold_generic
x2 = frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.6.1
// msg("pbch_scrambling: Nid_cell = %d\n",x2);
for (i=0; i<length; i++) {
if ((i&0x1f)==0) {
s = lte_gold_generic(&x1, &x2, reset);
// printf("lte_gold[%d]=%x\n",i,s);
reset = 0;
}
pbch_e[i] = (pbch_e[i]&1) ^ ((s>>(i&0x1f))&1);
}
}
//uint8_t pbch_d[96+(3*(16+PBCH_A))], pbch_w[3*3*(16+PBCH_A)],pbch_e[1920]; //one bit per byte
int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
int32_t **txdataF,
......@@ -393,28 +419,5 @@ int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
return(0);
}
void pbch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t *pbch_e,
uint32_t length)
{
int i;
uint8_t reset;
uint32_t x1, x2, s=0;
reset = 1;
// x1 is set in lte_gold_generic
x2 = frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.6.1
// msg("pbch_scrambling: Nid_cell = %d\n",x2);
for (i=0; i<length; i++) {
if ((i&0x1f)==0) {
s = lte_gold_generic(&x1, &x2, reset);
// printf("lte_gold[%d]=%x\n",i,s);
reset = 0;
}
pbch_e[i] = (pbch_e[i]&1) ^ ((s>>(i&0x1f))&1);
}
}
......@@ -29,48 +29,13 @@
* \note
* \warning
*/
#include "PHY/defs.h"
#include "PHY/impl_defs_top.h"
#include "PHY/defs_eNB.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
//#define DEBUG_PCFICH
extern uint8_t pcfich_b[4][32];
void generate_pcfich_reg_mapping(LTE_DL_FRAME_PARMS *frame_parms)
{
uint16_t kbar = 6 * (frame_parms->Nid_cell %(2*frame_parms->N_RB_DL));
uint16_t first_reg;
uint16_t *pcfich_reg = frame_parms->pcfich_reg;
pcfich_reg[0] = kbar/6;
first_reg = pcfich_reg[0];
frame_parms->pcfich_first_reg_idx=0;
pcfich_reg[1] = ((kbar + (frame_parms->N_RB_DL>>1)*6)%(frame_parms->N_RB_DL*12))/6;
if (pcfich_reg[1] < pcfich_reg[0]) {
frame_parms->pcfich_first_reg_idx = 1;
first_reg = pcfich_reg[1];
}
pcfich_reg[2] = ((kbar + (frame_parms->N_RB_DL)*6)%(frame_parms->N_RB_DL*12))/6;
if (pcfich_reg[2] < first_reg) {
frame_parms->pcfich_first_reg_idx = 2;
first_reg = pcfich_reg[2];
}
pcfich_reg[3] = ((kbar + ((3*frame_parms->N_RB_DL)>>1)*6)%(frame_parms->N_RB_DL*12))/6;
if (pcfich_reg[3] < first_reg) {
frame_parms->pcfich_first_reg_idx = 3;
first_reg = pcfich_reg[3];
}
//#ifdef DEBUG_PCFICH
printf("pcfich_reg : %d,%d,%d,%d\n",pcfich_reg[0],pcfich_reg[1],pcfich_reg[2],pcfich_reg[3]);
//#endif
}
void pcfich_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t subframe,
......@@ -96,37 +61,7 @@ void pcfich_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
}
}
void pcfich_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t subframe,
int16_t *d)
{
uint32_t i;
uint8_t reset;
uint32_t x1, x2, s=0;
reset = 1;
// x1 is set in lte_gold_generic
x2 = ((((2*frame_parms->Nid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1
for (i=0; i<32; i++) {
if ((i&0x1f)==0) {
s = lte_gold_generic(&x1, &x2, reset);
//printf("lte_gold[%d]=%x\n",i,s);
reset = 0;
}
if (((s>>(i&0x1f))&1) == 1)
d[i]=-d[i];
}
}
uint8_t pcfich_b[4][32]= {{0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1},
{1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0},
{1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
};
void generate_pcfich(uint8_t num_pdcch_symbols,
int16_t amp,
......@@ -215,98 +150,3 @@ void generate_pcfich(uint8_t num_pdcch_symbols,
}
uint8_t rx_pcfich(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t subframe,
LTE_UE_PDCCH *lte_ue_pdcch_vars,
MIMO_mode_t mimo_mode)
{
uint8_t pcfich_quad;
uint8_t i,j;
uint16_t reg_offset;
int32_t **rxdataF_comp = lte_ue_pdcch_vars->rxdataF_comp;
int16_t pcfich_d[32],*pcfich_d_ptr;
int32_t metric,old_metric=-16384;
uint8_t num_pdcch_symbols=3;
uint16_t *pcfich_reg = frame_parms->pcfich_reg;
// demapping
// loop over 4 quadruplets and lookup REGs
// m=0;
pcfich_d_ptr = pcfich_d;
for (pcfich_quad=0; pcfich_quad<4; pcfich_quad++) {
reg_offset = (pcfich_reg[pcfich_quad]*4);
for (i=0; i<4; i++) {
pcfich_d_ptr[0] = ((int16_t*)&rxdataF_comp[0][reg_offset+i])[0]; // RE component
pcfich_d_ptr[1] = ((int16_t*)&rxdataF_comp[0][reg_offset+i])[1]; // IM component
#ifdef DEBUG_PCFICH
printf("rx_pcfich: quad %d, i %d, offset %d => (%d,%d) => pcfich_d_ptr[0] %d \n",pcfich_quad,i,reg_offset+i,
((int16_t*)&rxdataF_comp[0][reg_offset+i])[0],
((int16_t*)&rxdataF_comp[0][reg_offset+i])[1],
pcfich_d_ptr[0]);
#endif
pcfich_d_ptr+=2;
}
/*
}
else { // ALAMOUTI
for (i=0;i<4;i+=2) {
pcfich_d_ptr[0] = 0;
pcfich_d_ptr[1] = 0;
pcfich_d_ptr[2] = 0;
pcfich_d_ptr[3] = 0;
for (j=0;j<frame_parms->nb_antennas_rx;j++) {
pcfich_d_ptr[0] += (((int16_t*)&rxdataF_comp[j][reg_offset+i])[0]+
((int16_t*)&rxdataF_comp[j+2][reg_offset+i+1])[0]); // RE component
pcfich_d_ptr[1] += (((int16_t*)&rxdataF_comp[j][reg_offset+i])[1] -
((int16_t*)&rxdataF_comp[j+2][reg_offset+i+1])[1]);// IM component
pcfich_d_ptr[2] += (((int16_t*)&rxdataF_comp[j][reg_offset+i+1])[0]-
((int16_t*)&rxdataF_comp[j+2][reg_offset+i])[0]); // RE component
pcfich_d_ptr[3] += (((int16_t*)&rxdataF_comp[j][reg_offset+i+1])[1] +
((int16_t*)&rxdataF_comp[j+2][reg_offset+i])[1]);// IM component
}
pcfich_d_ptr+=4;
}
*/
}
// pcfhich unscrambling
pcfich_unscrambling(frame_parms,subframe,pcfich_d);
// pcfich detection
for (i=0; i<3; i++) {
metric = 0;
for (j=0; j<32; j++) {
// printf("pcfich_b[%d][%d] %d => pcfich_d[%d] %d\n",i,j,pcfich_b[i][j],j,pcfich_d[j]);
metric += (int32_t)(((pcfich_b[i][j]==0) ? (pcfich_d[j]) : (-pcfich_d[j])));
}
#ifdef DEBUG_PCFICH
printf("metric %d : %d\n",i,metric);
#endif
if (metric > old_metric) {
num_pdcch_symbols = 1+i;
old_metric = metric;
}
}
#ifdef DEBUG_PCFICH
printf("[PHY] PCFICH detected for %d PDCCH symbols\n",num_pdcch_symbols);
#endif
return(num_pdcch_symbols);
}
This diff is collapsed.
This diff is collapsed.
......@@ -29,8 +29,8 @@
* \note
* \warning
*/
//#include "defs.h"
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
void generate_pilots(PHY_VARS_eNB *eNB,
int32_t **txdataF,
......
......@@ -29,9 +29,9 @@
* \note
* \warning
*/
//#include "defs.h"
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
int generate_mbsfn_pilot(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -19,7 +19,8 @@
* contact@openairinterface.org
*/
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
#include "PHY/impl_defs_lte.h"
//#define DEBUG_PC 0
......@@ -94,7 +95,6 @@ double computeRhoB_eNB(uint8_t pa,
return(rho_b_dB);
}
double computeRhoA_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
LTE_UE_DLSCH_t *dlsch_ue,
unsigned char dl_power_off,
......@@ -150,3 +150,4 @@ double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
#endif
return(rho_b_dB);
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File moved
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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