Commit 551f32cc authored by knopp's avatar knopp

more splitting eNB/UE files/directories

parent dad93fe2
This diff is collapsed.
......@@ -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)
......@@ -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;
......
......@@ -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.
......
......@@ -30,6 +30,9 @@
* \warning
*/
#ifndef __DCI__h__
#define __DCI__h__
#include <stdint.h>
/// DCI Format Type 0 (5 MHz,TDD0, 27 bits)
......@@ -3014,3 +3017,5 @@ struct DCI_INFO_EXTRACTED {
uint64_t ap_si_nl_id:3;
};
typedef struct DCI_INFO_EXTRACTED DCI_INFO_EXTRACTED_t;
#endif
......@@ -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
......@@ -96,32 +96,6 @@ 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},
......@@ -215,98 +189,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);
}
/*
* 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/defs.h"
#include "PHY/extern.h"
#include "assertions.h"
const unsigned int Ttab[4] = {32,64,128,256};
// This function implements the initialization of paging parameters for UE (See Section 7, 36.304)
// It must be called after setting IMSImod1024 during UE startup and after receiving SIB2
int init_ue_paging_info(PHY_VARS_UE *ue, long defaultPagingCycle, long nB) {
LTE_DL_FRAME_PARMS *fp = &ue->frame_parms;
unsigned int T = Ttab[defaultPagingCycle];
unsigned int N = (nB<=2) ? T : (T>>(nB-2));
unsigned int Ns = (nB<2) ? (1<<(2-nB)) : 1;
unsigned int UE_ID = ue->IMSImod1024;
unsigned int i_s = (UE_ID/N)%Ns;
ue->PF = (T/N) * (UE_ID % N);
// This implements Section 7.2 from 36.304
if (Ns==1)
ue->PO = (fp->frame_type==FDD) ? 9 : 0;
else if (Ns==2)
ue->PO = (fp->frame_type==FDD) ? (4+(5*i_s)) : (5*i_s);
else if (Ns==4)
ue->PO = (fp->frame_type==FDD) ? (4*(i_s&1)+(5*(i_s>>1))) : ((i_s&1)+(5*(i_s>>1)));
else
AssertFatal(1==0,"init_ue_paging_info: Ns is %d\n",Ns);
return(0);
}
......@@ -30,13 +30,13 @@
* \warning
*/
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
#include "PHY/extern.h"
#include "SCHED/defs.h"
#include "defs.h"
#include "SCHED/sched_eNB.h"
#include "transport_eNB.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/mac_extern.h"
#include "LAYER2/MAC/mac.h"
#include "T.h"
......
/*
* 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/uespec_pilots.c
* \brief Top-level routines for generating DL ue-specific reference signals V12.5 2015-03
* \author X.JIANG
* \date 2011
* \version 0.1
* \company Eurecom
* \email: xiwen.jiangeurecom.fr
* \note
* \warning
*/
//#include "defs.h"
#include "PHY/defs.h"
void generate_ue_spec_pilots(PHY_VARS_eNB *phy_vars_eNB,
uint8_t UE_id,
int32_t **txdataF,
int16_t amp,
uint16_t Ntti,
uint8_t beamforming_mode)
{
/*LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
uint32_t tti,tti_offset,slot_offset,Nsymb,samples_per_symbol;
uint8_t second_pilot,aa;
// printf("Doing TX pilots Nsymb %d, second_pilot %d\n",Nsymb,second_pilot);
switch(beamforming_mode){
case 7:
for (tti=0; tti<Ntti; tti++) {
tti_offset = tti*frame_parms->ofdm_symbol_size*Nsymb;
samples_per_symbol = frame_parms->ofdm_symbol_size;
slot_offset = (tti*2)%20;
// printf("tti %d : offset %d (slot %d)\n",tti,tti_offset,slot_offset);
//Generate UE specific Pilots
printf("generate_dl_ue_spec:tti_offset=%d\n",tti_offset);
if(frame_parms->Ncp==0) {
for(aa=0;aa<frame_parms->nb_antennas_tx;aa++){
//antenna port 5 symbol 0 slot 0
lte_dl_ue_spec(phy_vars_eNB,
UE_id,
&txdataF[aa][tti_offset+3*samples_per_symbol],
amp,
slot_offset,
1,
5,
0);
//antenna port 5 symbol 1 slot 0
lte_dl_ue_spec(phy_vars_eNB,
UE_id,
&txdataF[aa][tti_offset+6*samples_per_symbol],
amp,
slot_offset,
1,
5,
0);
//antenna port 5 symbol 0 slot 1
lte_dl_ue_spec(phy_vars_eNB,
UE_id,
&txdataF[aa][tti_offset+9*samples_per_symbol],
amp,
slot_offset+1,
0,
5,
0);
//antenna port 5 symbol 1 slot 1
lte_dl_ue_spec(phy_vars_eNB,
UE_id,
&txdataF[aa][tti_offset+12*samples_per_symbol],
amp,
slot_offset+1,
1,
5,
0);
}
} else{
msg("generate_ue_soec_pilots:Extented Cyclic Prefix for TM7 is not supported yet.\n");
}
}
break;
case 8:
case 9:
case 10:
default:
msg("[generate_ue_spec_pilots(in uespec_pilots.c)]ERROR:beamforming mode %d is not supported\n",beamforming_mode);
}*/
}
/*int generate_ue_spec_pilots_slot(PHY_VARS_eNB *phy_vars_eNB,
int32_t **txdataF,
int16_t amp,
uint16_t slot,
int first_pilot_only)
{
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
uint32_t slot_offset,Nsymb,samples_per_symbol;
uint8_t second_pilot;
if (slot<0 || slot>= 20) {
msg("generate_pilots_slot: slot not in range (%d)\n",slot);
return(-1);
}
Nsymb = (frame_parms->Ncp==0)?7:6;
second_pilot = (frame_parms->Ncp==0)?4:3;
slot_offset = slot*frame_parms->ofdm_symbol_size*Nsymb;
samples_per_symbol = frame_parms->ofdm_symbol_size;
// printf("tti %d : offset %d (slot %d)\n",tti,tti_offset,slot_offset);
//Generate Pilots
//antenna 0 symbol 0 slot 0
lte_dl_cell_spec(phy_vars_eNB,
&txdataF[0][slot_offset],
amp,
slot,
0,
0);
if (first_pilot_only==0) {
//antenna 0 symbol 3 slot 0
lte_dl_cell_spec(phy_vars_eNB,
&txdataF[0][slot_offset+(second_pilot*samples_per_symbol)],
amp,
slot,
1,
0);
}
if (frame_parms->nb_antennas_tx > 1) {
if (frame_parms->mode1_flag) {
// antenna 1 symbol 0 slot 0
lte_dl_cell_spec(phy_vars_eNB,
&txdataF[1][slot_offset],
amp,
slot,
0,
0);
if (first_pilot_only==0) {
// antenna 1 symbol 3 slot 0
lte_dl_cell_spec(phy_vars_eNB,
&txdataF[1][slot_offset+(second_pilot*samples_per_symbol)],
amp,
slot,
1,
0);
}
} else {
// antenna 1 symbol 0 slot 0
lte_dl_cell_spec(phy_vars_eNB,
&txdataF[1][slot_offset],
amp,
slot,
0,
1);
if (first_pilot_only == 0) {
// antenna 1 symbol 3 slot 0
lte_dl_cell_spec(phy_vars_eNB,
&txdataF[1][slot_offset+(second_pilot*samples_per_symbol)],
amp,
slot,
1,
1);
}
}
}
return(0);
}*/
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.
/*
* 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/transport_commont.h
* \brief data structures for PDSCH/DLSCH/PUSCH/ULSCH physical and transport channel descriptors (TX/RX) common to both eNB/UE
* \author R. Knopp
* \date 2011
* \version 0.1
* \company Eurecom
* \email: raymond.knopp@eurecom.fr, florian.kaltenberger@eurecom.fr, oscar.tonelli@yahoo.it
* \note
* \warning
*/
#ifndef __TRANSPORT_COMMON__H__
#define __TRANSPORT_COMMON__H__
#include "PHY/defs_common.h"
#include "PHY/impl_defs_lte.h"
#include "dci.h"
#include "mdci.h"
//#include "uci.h"
#ifndef STANDALONE_COMPILE
#include "UTIL/LISTS/list.h"
#endif
#define MOD_TABLE_QPSK_OFFSET 1
#define MOD_TABLE_16QAM_OFFSET 5
#define MOD_TABLE_64QAM_OFFSET 21
#define MOD_TABLE_PSS_OFFSET 85
// structures below implement 36-211 and 36-212
/** @addtogroup _PHY_TRANSPORT_
* @{
*/
#define NSOFT 1827072
#define LTE_NULL 2
// maximum of 3 segments before each coding block if data length exceeds 6144 bits.
#define MAX_NUM_DLSCH_SEGMENTS 16
#define MAX_NUM_ULSCH_SEGMENTS MAX_NUM_DLSCH_SEGMENTS
#define MAX_DLSCH_PAYLOAD_BYTES (MAX_NUM_DLSCH_SEGMENTS*768)
#define MAX_ULSCH_PAYLOAD_BYTES (MAX_NUM_ULSCH_SEGMENTS*768)
#define MAX_NUM_CHANNEL_BITS (14*1200*6) // 14 symbols, 1200 REs, 12 bits/RE
#define MAX_NUM_RE (14*1200)
#if !defined(SI_RNTI)
#define SI_RNTI (rnti_t)0xffff
#endif
#if !defined(M_RNTI)
#define M_RNTI (rnti_t)0xfffd
#endif
#if !defined(P_RNTI)
#define P_RNTI (rnti_t)0xfffe
#endif
#if !defined(CBA_RNTI)
#define CBA_RNTI (rnti_t)0xfff4
#endif
#if !defined(C_RNTI)
#define C_RNTI (rnti_t)0x1234
#endif
// These are the codebook indexes according to Table 6.3.4.2.3-1 of 36.211
//1 layer
#define PMI_2A_11 0
#define PMI_2A_1m1 1
#define PMI_2A_1j 2
#define PMI_2A_1mj 3
//2 layers
#define PMI_2A_R1_10 0
#define PMI_2A_R1_11 1
#define PMI_2A_R1_1j 2
typedef enum { SEARCH_EXIST=0,
SEARCH_EXIST_OR_FREE} find_type_t;
typedef enum {
SCH_IDLE=0,
ACTIVE,
CBA_ACTIVE,
DISABLED
} SCH_status_t;
#ifdef Rel14
typedef enum {
CEmodeA = 0,
CEmodeB = 1
} CEmode_t;
#endif
#define PUSCH_x 2
#define PUSCH_y 3
typedef enum {
pucch_format1=0,
pucch_format1a,
pucch_format1b,
pucch_format1b_csA2,
pucch_format1b_csA3,
pucch_format1b_csA4,
pucch_format2,
pucch_format2a,
pucch_format2b,
pucch_format3 // PUCCH format3
} PUCCH_FMT_t;
typedef enum {
SR,
HARQ,
CQI,
HARQ_SR,
HARQ_CQI,
SR_CQI,
HARQ_SR_CQI
} UCI_type_t;
#ifdef Rel14
typedef enum {
NOCE,
CEMODEA,
CEMODEB
} UE_type_t;
#endif
typedef enum {
SI_PDSCH=0,
RA_PDSCH,
P_PDSCH,
PDSCH,
PDSCH1,
PMCH
} PDSCH_t;