Merge remote-tracking branch 'origin/develop_integration_2018_w08' into develop
Summary of changes: - fix dlsim/ulsim - fix centOS compilation - Move the accounting phase of the DL pre-processor in a separate procedure and fix some issues - additional Mac stats and Improvements - minor fix in test setup v2
This commit is contained in:
@@ -1300,7 +1300,6 @@ set(L2_SRC
|
||||
)
|
||||
|
||||
set(L2_SRC_UE
|
||||
${OPENAIR2_DIR}/LAYER2/openair2_proc.c
|
||||
${PDCP_DIR}/pdcp.c
|
||||
${PDCP_DIR}/pdcp_fifo.c
|
||||
${PDCP_DIR}/pdcp_sequence_manager.c
|
||||
@@ -2148,11 +2147,12 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr
|
||||
${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c
|
||||
${XFORMS_SOURCE}
|
||||
${T_SOURCE}
|
||||
${CONFIG_SOURCES}
|
||||
)
|
||||
target_link_libraries (${myExe}
|
||||
|
||||
-Wl,--start-group SIMU UTIL SCHED_LIB PHY LFDS ${ITTI_LIB} LFDS7 -Wl,--end-group
|
||||
pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB}
|
||||
pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl
|
||||
)
|
||||
endforeach(myExe)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class connection:
|
||||
try:
|
||||
(pid, fd) = os.forkpty()
|
||||
except BaseException, e:
|
||||
log("ERROR: forkpty for '" + description + "': " + e)
|
||||
log("ERROR: forkpty for '" + description + "': " + str(e))
|
||||
(pid, fd) = (-1, -1)
|
||||
|
||||
if pid == -1:
|
||||
@@ -26,7 +26,7 @@ class connection:
|
||||
os.execvp('sshpass', ['sshpass', '-p', password,
|
||||
'ssh', user + '@' + host])
|
||||
except BaseException, e:
|
||||
log("ERROR: execvp for '" + description + "': " + e)
|
||||
log("ERROR: execvp for '" + description + "': " + str(e))
|
||||
log("ERROR: execvp failed for '" + description + "'")
|
||||
os._exit(1)
|
||||
|
||||
|
||||
@@ -249,14 +249,14 @@ install_usrp_uhd_driver_from_source(){
|
||||
cd /tmp
|
||||
echo "Downloading UHD driver"
|
||||
rm -rf /tmp/uhd
|
||||
git clone git://github.com/EttusResearch/uhd.git
|
||||
git clone https://github.com/EttusResearch/uhd.git
|
||||
cd uhd
|
||||
git checkout tags/release_003_010_001_001
|
||||
mkdir -p host/build
|
||||
cd host/build
|
||||
$CMAKE ../
|
||||
echo "Compiling UHD"
|
||||
make
|
||||
make -j`nproc`
|
||||
make test
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
@@ -277,10 +277,11 @@ check_install_usrp_uhd_driver(){
|
||||
$SUDO apt-get -y --allow-unauthenticated install libuhd-dev libuhd003 uhd-host
|
||||
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
|
||||
$SUDO $INSTALLER -y install python boost libusb-devel libusbx-devel boost-devel python-mako python-docutils cmake
|
||||
$SUDO pip install requests
|
||||
if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then
|
||||
# until EPEL repo hasn't bumped UHD driver to >=3.10 in EPEL, build driver from source
|
||||
$SUDO $INSTALLER -y remove uhd uhd-devel uhd-firmware
|
||||
install_ursp_uhd_driver_from_source
|
||||
install_usrp_uhd_driver_from_source
|
||||
else
|
||||
$SUDO $INSTALLER -y install uhd uhd-devel uhd-firmware
|
||||
fi
|
||||
@@ -644,7 +645,8 @@ check_install_oai_software() {
|
||||
lapack \
|
||||
lapack-devel \
|
||||
blas \
|
||||
blas-devel
|
||||
blas-devel \
|
||||
libyaml-devel
|
||||
fi
|
||||
|
||||
install_asn1c_from_source
|
||||
|
||||
@@ -109,7 +109,7 @@ crc24a (unsigned char * inptr, int bitlen)
|
||||
resbit = (bitlen % 8);
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
// printf("in %x => crc %x\n",crc,*inptr);
|
||||
// printf("crc24a: in %x => crc %x\n",crc,*inptr);
|
||||
crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)];
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ unsigned int crc24b (unsigned char * inptr, int bitlen)
|
||||
resbit = (bitlen % 8);
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
// printf("crc24b: in %x => crc %x (%x)\n",crc,*inptr,crc24bTable[(*inptr) ^ (crc >> 24)]);
|
||||
crc = (crc << 8) ^ crc24bTable[(*inptr++) ^ (crc >> 24)];
|
||||
}
|
||||
|
||||
|
||||
@@ -463,7 +463,7 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
|
||||
uint8_t Qm,
|
||||
uint8_t Nl,
|
||||
uint8_t r,
|
||||
uint8_t nb_rb)
|
||||
uint8_t nb_rb)
|
||||
// uint8_t m)
|
||||
{
|
||||
|
||||
@@ -513,7 +513,7 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
|
||||
// counter_buffer[rvidx][cnt]=0;
|
||||
if (Ncb>(3*(RTC<<5)))
|
||||
AssertFatal(1==0,"Exiting, RM condition (Ncb %d, RTC %d, Nir/C %d, Nsoft %d, Kw %d)\n",Ncb,RTC,Nir/C,Nsoft,3*(RTC<<5));
|
||||
|
||||
|
||||
AssertFatal(Nl>0,"Nl is 0\n");
|
||||
AssertFatal(Qm>0,"Qm is 0\n");
|
||||
Gp = G/Nl/Qm;
|
||||
@@ -749,6 +749,10 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
|
||||
|
||||
for (; (ind<Ncb)&&(k<E); ind++) {
|
||||
if (dummy_w[ind] != LTE_NULL) {
|
||||
/*
|
||||
if ((w[ind]>0 && soft_input2[k]<0) ||
|
||||
(w[ind]<0 && soft_input2[k]>0))
|
||||
printf("ind %d: w %d => soft_in %d\n",ind,w[ind],soft_input2[k]);*/
|
||||
w[ind] += soft_input2[k++];
|
||||
#ifdef RM_DEBUG
|
||||
printf("RM_RX k%d Ind: %d (%d)\n",k-1,ind,w[ind]);
|
||||
|
||||
+10
-16
@@ -330,19 +330,25 @@ void init_lte_top(LTE_DL_FRAME_PARMS *lte_frame_parms);
|
||||
|
||||
//void copy_lte_parms_to_phy_framing(LTE_DL_FRAME_PARMS *frame_parm, PHY_FRAMING *phy_framing);
|
||||
|
||||
void lte_param_init(unsigned char N_tx_port_eNB,
|
||||
unsigned char N_tx,
|
||||
unsigned char N_rx,
|
||||
void lte_param_init(PHY_VARS_eNB **eNBp,
|
||||
PHY_VARS_UE **UEp,
|
||||
RU_t **rup,
|
||||
unsigned char N_tx_port_eNB,
|
||||
unsigned char N_tx_phy,
|
||||
unsigned char N_rx_ru,
|
||||
unsigned char N_rx_ue,
|
||||
unsigned char transmission_mode,
|
||||
uint8_t extended_prefix_flag,
|
||||
frame_t frame_type,
|
||||
frame_t frame_type,
|
||||
uint16_t Nid_cell,
|
||||
uint8_t tdd_config,
|
||||
uint8_t N_RB_DL,
|
||||
uint8_t pa,
|
||||
uint8_t threequarter_fs,
|
||||
uint8_t osf,
|
||||
uint32_t perfect_ce);
|
||||
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
void phy_config_dedicated_scell_ue(uint8_t Mod_id,
|
||||
uint8_t eNB_index,
|
||||
@@ -367,18 +373,6 @@ void phy_config_request(PHY_Config_t *phy_config);
|
||||
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
|
||||
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
void lte_param_init(unsigned char N_tx_port_eNB,
|
||||
unsigned char N_tx_phy,
|
||||
unsigned char N_rx,
|
||||
unsigned char transmission_mode,
|
||||
uint8_t extended_prefix_flag,
|
||||
frame_t frame_type,
|
||||
uint16_t Nid_cell,
|
||||
uint8_t tdd_config,
|
||||
uint8_t N_RB_DL,
|
||||
uint8_t threequarter_fs,
|
||||
uint8_t osf,
|
||||
uint32_t perfect_ce);
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
|
||||
@@ -882,11 +882,11 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
AssertFatal(fp->N_RB_UL > 5, "fp->N_RB_UL %d < 6\n",fp->N_RB_UL);
|
||||
for (i=0; i<2; i++) {
|
||||
// RK 2 times because of output format of FFT!
|
||||
// FIXME We should get rid of this, consider also phy_free_lte_eNB()
|
||||
pusch_vars[UE_id]->rxdataF_ext[i] = (int32_t*)malloc16_clear( 2*sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
// FIXME We should get rid of this
|
||||
pusch_vars[UE_id]->rxdataF_ext[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->rxdataF_ext2[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->drs_ch_estimates[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->drs_ch_estimates_time[i] = (int32_t*)malloc16_clear( 2*2*sizeof(int32_t)*fp->ofdm_symbol_size );
|
||||
pusch_vars[UE_id]->drs_ch_estimates_time[i] = (int32_t*)malloc16_clear( 2*sizeof(int32_t)*fp->ofdm_symbol_size );
|
||||
pusch_vars[UE_id]->rxdataF_comp[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->ul_ch_mag[i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
|
||||
pusch_vars[UE_id]->ul_ch_magb[i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
|
||||
|
||||
@@ -60,7 +60,7 @@ int phy_init_RU(RU_t *ru) {
|
||||
}
|
||||
} // IF5 or local RF
|
||||
else {
|
||||
LOG_I(PHY,"No rxdata/txdata for RU\n");
|
||||
// LOG_I(PHY,"No rxdata/txdata for RU\n");
|
||||
ru->common.txdata = (int32_t**)NULL;
|
||||
ru->common.rxdata = (int32_t**)NULL;
|
||||
|
||||
@@ -91,8 +91,8 @@ int phy_init_RU(RU_t *ru) {
|
||||
}
|
||||
|
||||
/* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */
|
||||
AssertFatal(ru->nb_rx <= sizeof(ru->prach_rxsigF) / sizeof(ru->prach_rxsigF[0]),
|
||||
"nb_antennas_rx too large");
|
||||
// AssertFatal(ru->nb_rx <= sizeof(ru->prach_rxsigF) / sizeof(ru->prach_rxsigF[0]),
|
||||
// "nb_antennas_rx too large");
|
||||
ru->prach_rxsigF = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*));
|
||||
for (j=0;j<4;j++) ru->prach_rxsigF_br[j] = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*));
|
||||
|
||||
|
||||
@@ -32,16 +32,23 @@
|
||||
|
||||
extern PHY_VARS_eNB *eNB;
|
||||
extern PHY_VARS_UE *UE;
|
||||
extern RU_t *ru;
|
||||
extern void phy_init_RU(RU_t*);
|
||||
|
||||
void lte_param_init(unsigned char N_tx_port_eNB,
|
||||
void lte_param_init(PHY_VARS_eNB **eNBp,
|
||||
PHY_VARS_UE **UEp,
|
||||
RU_t **rup,
|
||||
unsigned char N_tx_port_eNB,
|
||||
unsigned char N_tx_phy,
|
||||
unsigned char N_rx,
|
||||
unsigned char N_rx_ru,
|
||||
unsigned char N_rx_ue,
|
||||
unsigned char transmission_mode,
|
||||
uint8_t extended_prefix_flag,
|
||||
frame_t frame_type,
|
||||
frame_t frame_type,
|
||||
uint16_t Nid_cell,
|
||||
uint8_t tdd_config,
|
||||
uint8_t N_RB_DL,
|
||||
uint8_t pa,
|
||||
uint8_t threequarter_fs,
|
||||
uint8_t osf,
|
||||
uint32_t perfect_ce)
|
||||
@@ -49,13 +56,27 @@ void lte_param_init(unsigned char N_tx_port_eNB,
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
int i;
|
||||
|
||||
PHY_VARS_eNB *eNB;
|
||||
PHY_VARS_UE *UE;
|
||||
RU_t *ru;
|
||||
printf("Start lte_param_init\n");
|
||||
eNB = malloc(sizeof(PHY_VARS_eNB));
|
||||
UE = malloc(sizeof(PHY_VARS_UE));
|
||||
*eNBp = malloc(sizeof(PHY_VARS_eNB));
|
||||
*UEp = malloc(sizeof(PHY_VARS_UE));
|
||||
*rup = malloc(sizeof(RU_t));
|
||||
eNB = *eNBp;
|
||||
UE = *UEp;
|
||||
ru = *rup;
|
||||
printf("eNB %p, UE %p, ru %p\n",eNB,UE,ru);
|
||||
|
||||
|
||||
|
||||
memset((void*)eNB,0,sizeof(PHY_VARS_eNB));
|
||||
memset((void*)UE,0,sizeof(PHY_VARS_UE));
|
||||
memset((void*)ru,0,sizeof(RU_t));
|
||||
|
||||
ru->eNB_list[0] = eNB;
|
||||
eNB->RU_list[0] = ru;
|
||||
ru->num_eNB=1;
|
||||
|
||||
srand(0);
|
||||
randominit(0);
|
||||
@@ -71,7 +92,7 @@ void lte_param_init(unsigned char N_tx_port_eNB,
|
||||
frame_parms->Nid_cell = Nid_cell;
|
||||
frame_parms->nushift = Nid_cell%6;
|
||||
frame_parms->nb_antennas_tx = N_tx_phy;
|
||||
frame_parms->nb_antennas_rx = N_rx;
|
||||
frame_parms->nb_antennas_rx = N_rx_ru;
|
||||
frame_parms->nb_antenna_ports_eNB = N_tx_port_eNB;
|
||||
frame_parms->phich_config_common.phich_resource = oneSixth;
|
||||
frame_parms->phich_config_common.phich_duration = normal;
|
||||
@@ -90,12 +111,18 @@ void lte_param_init(unsigned char N_tx_port_eNB,
|
||||
|
||||
UE->is_secondary_ue = 0;
|
||||
UE->frame_parms = *frame_parms;
|
||||
eNB->frame_parms = *frame_parms;
|
||||
UE->frame_parms.nb_antennas_rx=N_rx_ue;
|
||||
// eNB->frame_parms = *frame_parms;
|
||||
ru->frame_parms = *frame_parms;
|
||||
ru->nb_tx = N_tx_phy;
|
||||
ru->nb_rx = N_rx_ru;
|
||||
ru->if_south = LOCAL_RF;
|
||||
|
||||
eNB->configured=1;
|
||||
|
||||
eNB->transmission_mode[0] = transmission_mode;
|
||||
UE->transmission_mode[0] = transmission_mode;
|
||||
|
||||
init_lte_top(frame_parms);
|
||||
dump_frame_parms(frame_parms);
|
||||
|
||||
UE->measurements.n_adj_cells=0;
|
||||
@@ -105,23 +132,24 @@ void lte_param_init(unsigned char N_tx_port_eNB,
|
||||
for (i=0; i<3; i++)
|
||||
lte_gold(frame_parms,UE->lte_gold_table[i],Nid_cell+i);
|
||||
|
||||
init_lte_ue(UE,1,0);
|
||||
printf("Calling init_lte_ue_signal\n");
|
||||
init_lte_ue_signal(UE,1,0);
|
||||
printf("Calling phy_init_lte_eNB\n");
|
||||
phy_init_lte_eNB(eNB,0,0);
|
||||
|
||||
printf("Calling phy_init_RU (%p)\n",ru);
|
||||
phy_init_RU(ru);
|
||||
generate_pcfich_reg_mapping(&UE->frame_parms);
|
||||
generate_phich_reg_mapping(&UE->frame_parms);
|
||||
|
||||
// DL power control init
|
||||
//if (transmission_mode == 1) {
|
||||
UE->pdsch_config_dedicated->p_a = pa;
|
||||
|
||||
if (transmission_mode == 1 || transmission_mode ==7) {
|
||||
eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
((eNB->frame_parms).pdsch_config_common).p_b = 0;
|
||||
UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
((UE->frame_parms).pdsch_config_common).p_b = 0;
|
||||
} else { // rho_a = rhob
|
||||
eNB->pdsch_config_dedicated->p_a = dBm3; // 4 = 0dB
|
||||
((eNB->frame_parms).pdsch_config_common).p_b = 1;
|
||||
UE->pdsch_config_dedicated->p_a = dBm3; // 4 = 0dB
|
||||
((UE->frame_parms).pdsch_config_common).p_b = 1;
|
||||
}
|
||||
|
||||
@@ -130,6 +158,13 @@ void lte_param_init(unsigned char N_tx_port_eNB,
|
||||
/* the UE code is multi-thread "aware", we need to setup this array */
|
||||
for (i = 0; i < 10; i++) UE->current_thread_id[i] = i % 2;
|
||||
|
||||
if (eNB->frame_parms.frame_type == TDD) {
|
||||
if (eNB->frame_parms.N_RB_DL == 100) ru->N_TA_offset = 624;
|
||||
else if (eNB->frame_parms.N_RB_DL == 50) ru->N_TA_offset = 624/2;
|
||||
else if (eNB->frame_parms.N_RB_DL == 25) ru->N_TA_offset = 624/4;
|
||||
}
|
||||
else ru->N_TA_offset=0;
|
||||
|
||||
printf("Done lte_param_init\n");
|
||||
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ void freq_equalization(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
AssertFatal(symbol<frame_parms->symbols_per_tti,"symbol %d >= %d\n",
|
||||
symbol,frame_parms->symbols_per_tti);
|
||||
AssertFatal(Msc_RS<frame_parms->N_RB_UL*12,"Msc_RS %d >= %d\n",
|
||||
AssertFatal(Msc_RS<=frame_parms->N_RB_UL*12,"Msc_RS %d >= %d\n",
|
||||
Msc_RS,frame_parms->N_RB_UL*12);
|
||||
|
||||
for (re=0; re<(Msc_RS>>2); re++) {
|
||||
|
||||
@@ -100,7 +100,7 @@ int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32)));
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// LOG_I(PHY,"subframe %d, Ns %d, l %d, Msc_RS = %d, Msc_RS_idx = %d, u %d, v %d, cyclic_shift %d\n",subframe,Ns,l,Msc_RS, Msc_RS_idx,u,v,cyclic_shift);
|
||||
LOG_D(PHY,"subframe %d, Ns %d, l %d, Msc_RS = %d, Msc_RS_idx = %d, u %d, v %d, cyclic_shift %d\n",subframe,Ns,l,Msc_RS, Msc_RS_idx,u,v,cyclic_shift);
|
||||
#ifdef DEBUG_CH
|
||||
|
||||
if (Ns==0)
|
||||
|
||||
@@ -35,10 +35,10 @@
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "SCHED/defs.h"
|
||||
#include "SIMULATION/TOOLS/defs.h" // for taus
|
||||
#include "SIMULATION/TOOLS/defs.h" // for taus
|
||||
#include "PHY/sse_intrin.h"
|
||||
|
||||
#include "assertions.h"
|
||||
#include "assertions.h"
|
||||
#include "T.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
@@ -152,7 +152,7 @@ uint16_t extract_crc(uint8_t *dci,uint8_t dci_len)
|
||||
// dci[(dci_len>>3)+1] = 0;
|
||||
// dci[(dci_len>>3)+2] = 0;
|
||||
return((uint16_t)crc16);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ void dci_encoding(uint8_t *a,
|
||||
// encode dci
|
||||
|
||||
#ifdef DEBUG_DCI_ENCODING
|
||||
printf("Doing DCI encoding for %d bits, e %p, rnti %x\n",A,e,rnti);
|
||||
printf("Doing DCI encoding for %d bits, e %p, rnti %x, E %d\n",A,e,rnti,E);
|
||||
#endif
|
||||
|
||||
memset((void *)d,LTE_NULL,96);
|
||||
@@ -215,10 +215,10 @@ uint8_t *generate_dci0(uint8_t *dci,
|
||||
uint16_t coded_bits;
|
||||
uint8_t dci_flip[8];
|
||||
|
||||
AssertFatal((aggregation_level==1) ||
|
||||
(aggregation_level==2) ||
|
||||
(aggregation_level==4) ||
|
||||
(aggregation_level==8)
|
||||
AssertFatal((aggregation_level==1) ||
|
||||
(aggregation_level==2) ||
|
||||
(aggregation_level==4) ||
|
||||
(aggregation_level==8)
|
||||
#ifdef Rel14 // Added for EPDCCH/MPDCCH
|
||||
||
|
||||
(aggregation_level==16) ||
|
||||
@@ -227,22 +227,27 @@ uint8_t *generate_dci0(uint8_t *dci,
|
||||
#endif
|
||||
,
|
||||
"generate_dci FATAL, illegal aggregation_level %d\n",aggregation_level);
|
||||
|
||||
|
||||
|
||||
coded_bits = 72 * aggregation_level;
|
||||
|
||||
/*
|
||||
|
||||
|
||||
#ifdef DEBUG_DCI_ENCODING
|
||||
for (i=0;i<1+((DCI_LENGTH+16)/8);i++)
|
||||
for (int i=0;i<1+((DCI_LENGTH+16)/8);i++)
|
||||
printf("i %d : %x\n",i,dci[i]);
|
||||
#endif
|
||||
*/
|
||||
|
||||
if (DCI_LENGTH<=32) {
|
||||
dci_flip[0] = dci[3];
|
||||
dci_flip[1] = dci[2];
|
||||
dci_flip[2] = dci[1];
|
||||
dci_flip[3] = dci[0];
|
||||
#ifdef DEBUG_DCI_ENCODING
|
||||
printf("DCI => %x,%x,%x,%x\n",
|
||||
dci_flip[0],dci_flip[1],dci_flip[2],dci_flip[3]);
|
||||
|
||||
#endif
|
||||
} else {
|
||||
dci_flip[0] = dci[7];
|
||||
dci_flip[1] = dci[6];
|
||||
@@ -472,7 +477,7 @@ void pdcch_deinterleaving(LTE_DL_FRAME_PARMS *frame_parms,uint16_t *z, uint16_t
|
||||
wptr[1] = wptr2[1];
|
||||
wptr[2] = wptr2[2];
|
||||
wptr[3] = wptr2[3];
|
||||
/*
|
||||
/*
|
||||
printf("pdcch_deinterleaving (%p,%p): quad %d (%d) -> (%d,%d %d,%d %d,%d %d,%d)\n",wptr,wptr2,i,(i+frame_parms->Nid_cell)%Mquad,
|
||||
((char*)wptr2)[0],
|
||||
((char*)wptr2)[1],
|
||||
@@ -511,7 +516,7 @@ void pdcch_deinterleaving(LTE_DL_FRAME_PARMS *frame_parms,uint16_t *z, uint16_t
|
||||
zptr[2] = wptr[2];
|
||||
zptr[3] = wptr[3];
|
||||
|
||||
/*
|
||||
/*
|
||||
printf("deinterleaving ; k %d, index-Nd %d => (%d,%d,%d,%d,%d,%d,%d,%d)\n",k,(index-ND),
|
||||
((int8_t *)wptr)[0],
|
||||
((int8_t *)wptr)[1],
|
||||
@@ -532,7 +537,7 @@ void pdcch_deinterleaving(LTE_DL_FRAME_PARMS *frame_parms,uint16_t *z, uint16_t
|
||||
|
||||
for (i=0; i<Mquad; i++) {
|
||||
zptr = &z[i<<2];
|
||||
/*
|
||||
/*
|
||||
printf("deinterleaving ; quad %d => (%d,%d,%d,%d,%d,%d,%d,%d)\n",i,
|
||||
((int8_t *)zptr)[0],
|
||||
((int8_t *)zptr)[1],
|
||||
@@ -542,7 +547,7 @@ void pdcch_deinterleaving(LTE_DL_FRAME_PARMS *frame_parms,uint16_t *z, uint16_t
|
||||
((int8_t *)zptr)[5],
|
||||
((int8_t *)zptr)[6],
|
||||
((int8_t *)zptr)[7]);
|
||||
*/
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1505,7 +1510,7 @@ void pdcch_channel_compensation(int32_t **rxdataF_ext,
|
||||
dl_ch128_2 = (__m128i *)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
|
||||
#elif defined(__arm__)
|
||||
|
||||
|
||||
#endif
|
||||
for (rb=0; rb<frame_parms->N_RB_DL; rb++) {
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
@@ -1869,12 +1874,6 @@ int32_t rx_pdcch(PHY_VARS_UE *ue,
|
||||
#endif //MU_RECEIVER
|
||||
|
||||
|
||||
#if T_TRACER
|
||||
T(T_UE_PHY_PDCCH_IQ, T_INT(frame_parms->N_RB_DL), T_INT(frame_parms->N_RB_DL),
|
||||
T_INT(n_pdcch_symbols),
|
||||
T_BUFFER(pdcch_vars[eNB_id]->rxdataF_comp, frame_parms->N_RB_DL*12*n_pdcch_symbols* 4));
|
||||
#endif
|
||||
|
||||
// decode pcfich here and find out pdcch ofdm symbol number
|
||||
n_pdcch_symbols = rx_pcfich(frame_parms,
|
||||
subframe,
|
||||
@@ -1885,6 +1884,12 @@ int32_t rx_pdcch(PHY_VARS_UE *ue,
|
||||
if (n_pdcch_symbols>3)
|
||||
n_pdcch_symbols=1;
|
||||
|
||||
#if T_TRACER
|
||||
T(T_UE_PHY_PDCCH_IQ, T_INT(frame_parms->N_RB_DL), T_INT(frame_parms->N_RB_DL),
|
||||
T_INT(n_pdcch_symbols),
|
||||
T_BUFFER(pdcch_vars[eNB_id]->rxdataF_comp, frame_parms->N_RB_DL*12*n_pdcch_symbols* 4));
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DEBUG_DCI_DECODING
|
||||
|
||||
@@ -2106,7 +2111,7 @@ void pdcch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
reset = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// printf("unscrambling %d : e %d, c %d => ",i,llr[i],((s>>(i&0x1f))&1));
|
||||
if (((s>>(i%32))&1)==0)
|
||||
llr[i] = -llr[i];
|
||||
@@ -2271,7 +2276,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;
|
||||
|
||||
@@ -2285,11 +2290,11 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
|
||||
if (dci_alloc[i].L == (uint8_t)L) {
|
||||
|
||||
#ifdef DEBUG_DCI_ENCODING
|
||||
if (dci_alloc[i].rnti==0x02)
|
||||
LOG_I(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x), rnti %x\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L,
|
||||
if (dci_alloc[i].rnti==0x1234)
|
||||
LOG_D(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x), rnti %x\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L,
|
||||
*(unsigned int*)dci_alloc[i].dci_pdu,
|
||||
dci_alloc[i].rnti);
|
||||
//dump_dci(frame_parms,&dci_alloc[i]);
|
||||
dump_dci(frame_parms,&dci_alloc[i]);
|
||||
#endif
|
||||
|
||||
if (dci_alloc[i].firstCCE>=0) {
|
||||
@@ -2340,7 +2345,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
|
||||
|
||||
|
||||
for (i=0; i<Msymb2; i++) {
|
||||
|
||||
|
||||
//((int16_t*)(&(y[0][i])))[0] = (*e_ptr == 1) ? -gain_lin_QPSK : gain_lin_QPSK;
|
||||
//((int16_t*)(&(y[1][i])))[0] = (*e_ptr == 1) ? -gain_lin_QPSK : gain_lin_QPSK;
|
||||
((int16_t*)(&(y[0][i])))[0] = (*e_ptr == 2) ? 0 : (*e_ptr == 1) ? -gain_lin_QPSK : gain_lin_QPSK;
|
||||
@@ -2654,15 +2659,15 @@ uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int sub
|
||||
// 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)));
|
||||
get_mi(&RC.eNB[Mod_id][CC_id]->frame_parms,subframe)));
|
||||
}
|
||||
|
||||
|
||||
int get_nCCE_offset_l1(int *CCE_table,
|
||||
const unsigned char L,
|
||||
const int nCCE,
|
||||
const int common_dci,
|
||||
const unsigned short rnti,
|
||||
const unsigned char L,
|
||||
const int nCCE,
|
||||
const int common_dci,
|
||||
const unsigned short rnti,
|
||||
const unsigned char subframe)
|
||||
{
|
||||
|
||||
@@ -2692,7 +2697,7 @@ int get_nCCE_offset_l1(int *CCE_table,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (search_space_free == 1) {
|
||||
|
||||
// printf("returning %d\n",m*L);
|
||||
@@ -2894,17 +2899,17 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
|
||||
LOG_D(PHY,"[DCI search nPdcch %d - common] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x)\n",
|
||||
pdcch_vars[eNB_id]->num_pdcch_symbols,m,L2,sizeof_bits,CCEind,nCCE,*CCEmap,CCEmap_mask);
|
||||
else
|
||||
LOG_D(PHY,"[DCI search nPdcch %d - ue spec] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x) format %d\n",
|
||||
pdcch_vars[eNB_id]->num_pdcch_symbols,m,L2,sizeof_bits,CCEind,nCCE,*CCEmap,CCEmap_mask,format_c);
|
||||
LOG_D(PHY,"[DCI search nPdcch %d - ue spec %x] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x) format %d\n",
|
||||
pdcch_vars[eNB_id]->num_pdcch_symbols,pdcch_vars[eNB_id]->crnti,m,L2,sizeof_bits,CCEind,nCCE,*CCEmap,CCEmap_mask,format_c);
|
||||
|
||||
dci_decoding(sizeof_bits,
|
||||
L,
|
||||
&pdcch_vars[eNB_id]->e_rx[CCEind*72],
|
||||
&dci_decoded_output[current_thread_id][0]);
|
||||
/*
|
||||
/*
|
||||
for (i=0;i<3+(sizeof_bits>>3);i++)
|
||||
printf("dci_decoded_output[%d] => %x\n",i,dci_decoded_output[i]);
|
||||
*/
|
||||
printf("dci_decoded_output[%d][%d] => %x\n",current_thread_id,i,dci_decoded_output[current_thread_id][i]);
|
||||
*/
|
||||
|
||||
crc = (crc16(&dci_decoded_output[current_thread_id][0],sizeof_bits)>>16) ^ extract_crc(&dci_decoded_output[current_thread_id][0],sizeof_bits);
|
||||
#ifdef DEBUG_DCI_DECODING
|
||||
@@ -3015,7 +3020,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
|
||||
return;
|
||||
} // rnti match
|
||||
} // CCEmap_cand == 0
|
||||
/*
|
||||
/*
|
||||
if ( agregationLevel != 0xFF &&
|
||||
(format_c == format0 && m==0 && si_rnti != SI_RNTI))
|
||||
{
|
||||
@@ -3823,7 +3828,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
||||
} else if (tmode == 3) {
|
||||
|
||||
|
||||
LOG_D(PHY," Now check UE_SPEC format 2A_2A search aggregation 1 dci length: %d[bits] %d[bytes]\n",format2A_size_bits,format2A_size_bytes);
|
||||
// LOG_D(PHY," Now check UE_SPEC format 2A_2A search aggregation 1 dci length: %d[bits] %d[bytes]\n",format2A_size_bits,format2A_size_bytes);
|
||||
// Now check UE_SPEC format 2A_2A search spaces at aggregation 1
|
||||
old_dci_cnt=dci_cnt;
|
||||
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||
@@ -3895,7 +3900,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
||||
return(dci_cnt);
|
||||
|
||||
// Now check UE_SPEC format 2_2A search spaces at aggregation 4
|
||||
LOG_D(PHY," Now check UE_SPEC format 2_2A search spaces at aggregation 4 \n");
|
||||
// LOG_D(PHY," Now check UE_SPEC format 2_2A search spaces at aggregation 4 \n");
|
||||
old_dci_cnt=dci_cnt;
|
||||
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||
subframe,
|
||||
|
||||
@@ -2660,11 +2660,12 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
|
||||
else if(ulsch->harq_processes[harq_pid]->n_DMRS == 7)
|
||||
ulsch->harq_processes[harq_pid]->n_DMRS2 = 9;
|
||||
|
||||
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d, Subframe %d Programming PUSCH with n_DMRS2 %d (cshift %d) ulsch:ndi:%d ulsch_pdu:ndi:%d new_ulsch:%d status:%d\n",
|
||||
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d, Subframe %d Programming PUSCH with n_DMRS2 %d (cshift %d) ulsch:ndi:%d ulsch_pdu:ndi:%d new_ulsch:%d status:%d ulsch_pdu:rvidx:%d\n",
|
||||
eNB->Mod_id,harq_pid,frame,subframe,
|
||||
ulsch->harq_processes[harq_pid]->n_DMRS2,
|
||||
ulsch->harq_processes[harq_pid]->n_DMRS,
|
||||
ulsch->harq_processes[harq_pid]->ndi, ulsch_pdu->ulsch_pdu_rel8.new_data_indication, new_ulsch, ulsch->harq_processes[harq_pid]->status);
|
||||
ulsch->harq_processes[harq_pid]->ndi, ulsch_pdu->ulsch_pdu_rel8.new_data_indication, new_ulsch, ulsch->harq_processes[harq_pid]->status,
|
||||
ulsch_pdu->ulsch_pdu_rel8.redundancy_version);
|
||||
|
||||
ulsch->harq_processes[harq_pid]->rvidx = ulsch_pdu->ulsch_pdu_rel8.redundancy_version;
|
||||
ulsch->harq_processes[harq_pid]->Qm = ulsch_pdu->ulsch_pdu_rel8.modulation_type;
|
||||
@@ -4680,13 +4681,13 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
|
||||
|
||||
if(harq_pid>=8)
|
||||
{
|
||||
LOG_I(PHY,"bad harq id \n");
|
||||
// LOG_I(PHY,"bad harq id \n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
if(dci_format == format1 && ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) )
|
||||
{
|
||||
LOG_I(PHY,"bad dci format \n");
|
||||
// LOG_I(PHY,"bad dci format \n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -4695,13 +4696,13 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
|
||||
{
|
||||
if(pdlsch0_harq->round == 0)
|
||||
{
|
||||
LOG_I(PHY,"bad dci mcs + round \n");
|
||||
// LOG_I(PHY,"bad dci mcs + round \n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
if((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti))
|
||||
{
|
||||
LOG_I(PHY,"bad dci mcs + rnti \n");
|
||||
// LOG_I(PHY,"bad dci mcs + rnti \n");
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
@@ -4767,7 +4768,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
|
||||
|
||||
if(rballoc > RIV_max)
|
||||
{
|
||||
LOG_I(PHY,"bad dci rballoc rballoc %d RIV_max %lld \n",rballoc, RIV_max);
|
||||
// LOG_I(PHY,"bad dci rballoc rballoc %d RIV_max %lld \n",rballoc, RIV_max);
|
||||
// DCI false detection
|
||||
return(0);
|
||||
}
|
||||
@@ -4775,7 +4776,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
|
||||
if(NPRB == 0)
|
||||
{
|
||||
// DCI false detection
|
||||
LOG_I(PHY,"bad NPRB = 0 \n");
|
||||
// LOG_I(PHY,"bad NPRB = 0 \n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -4894,13 +4895,13 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
|
||||
// I- check dci content minimum coherency
|
||||
if(harq_pid>=8)
|
||||
{
|
||||
LOG_I(PHY,"bad harq pid\n");
|
||||
// LOG_I(PHY,"bad harq pid\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
if( (rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti) )
|
||||
{
|
||||
LOG_I(PHY,"bad rnti\n");
|
||||
// LOG_I(PHY,"bad rnti\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -4909,7 +4910,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
|
||||
{
|
||||
if(pdlsch0_harq->round == 0)
|
||||
{
|
||||
LOG_I(PHY,"bad mcs1\n");
|
||||
// LOG_I(PHY,"bad mcs1\n");
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
@@ -4918,7 +4919,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
|
||||
{
|
||||
if(pdlsch1_harq->round == 0)
|
||||
{
|
||||
LOG_I(PHY,"bad mcs2\n");
|
||||
// LOG_I(PHY,"bad mcs2\n");
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
@@ -4927,14 +4928,14 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
|
||||
if((pdlsch0_harq->round == 0) && (rv1 > 0) && (mcs1 != 0))
|
||||
{
|
||||
// DCI false detection
|
||||
LOG_I(PHY,"bad rv1\n");
|
||||
// LOG_I(PHY,"bad rv1\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
if((pdlsch1_harq->round == 0) && (rv2 > 0) && (mcs2 != 0))
|
||||
{
|
||||
// DCI false detection
|
||||
LOG_I(PHY,"bad rv2\n");
|
||||
// LOG_I(PHY,"bad rv2\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -4995,14 +4996,14 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
|
||||
if( (rballoc > RIV_max) && (rah == 1) )
|
||||
{
|
||||
// DCI false detection
|
||||
LOG_I(PHY,"bad rballoc %d RIV_max %lld\n", rballoc, RIV_max);
|
||||
// LOG_I(PHY,"bad rballoc %d RIV_max %lld\n", rballoc, RIV_max);
|
||||
return(0);
|
||||
}
|
||||
|
||||
if(NPRB == 0)
|
||||
{
|
||||
// DCI false detection
|
||||
LOG_I(PHY,"bad NPRB\n");
|
||||
// LOG_I(PHY,"bad NPRB\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -5026,7 +5027,7 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
pdsch_vars->llr_offset[pdcch_vars->num_pdcch_symbols] = 0;
|
||||
|
||||
//LOG_I(PHY,"compute_llr_offset: nb RB %d - Qm %d \n", nb_rb_alloc, dlsch0_harq->Qm);
|
||||
LOG_I(PHY,"compute_llr_offset: nb RB %d - Qm %d \n", nb_rb_alloc, dlsch0_harq->Qm);
|
||||
|
||||
//dlsch0_harq->rb_alloc_even;
|
||||
//dlsch0_harq->rb_alloc_odd;
|
||||
@@ -5056,15 +5057,15 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
if(symbol < (frame_parms->symbols_per_tti-1))
|
||||
pdsch_vars->llr_offset[symbol+1] = pdsch_vars->llr_offset[symbol] + llr_offset;
|
||||
|
||||
// LOG_I(PHY,"Granted Re subframe %d / symbol %d => %d (%d RBs)\n", subframe, symbol_mod, granted_re,dlsch0_harq->nb_rb);
|
||||
// LOG_I(PHY,"Pbch/PSS/SSS Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, pbch_pss_sss_re);
|
||||
// LOG_I(PHY,"CRS Re Per PRB subframe %d / symbol %d => %d \n", subframe, symbol_mod, crs_re);
|
||||
// LOG_I(PHY,"Data Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, data_re);
|
||||
LOG_I(PHY,"Granted Re subframe %d / symbol %d => %d (%d RBs)\n", subframe, symbol_mod, granted_re,dlsch0_harq->nb_rb);
|
||||
LOG_I(PHY,"Pbch/PSS/SSS Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, pbch_pss_sss_re);
|
||||
LOG_I(PHY,"CRS Re Per PRB subframe %d / symbol %d => %d \n", subframe, symbol_mod, crs_re);
|
||||
LOG_I(PHY,"Data Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, data_re);
|
||||
|
||||
|
||||
|
||||
//LOG_I(PHY,"Data Re subframe %d-symbol %d => llr length %d, llr offset %d \n", subframe, symbol,
|
||||
// pdsch_vars->llr_length[symbol], pdsch_vars->llr_offset[symbol]);
|
||||
LOG_I(PHY,"Data Re subframe %d-symbol %d => llr length %d, llr offset %d \n", subframe, symbol,
|
||||
pdsch_vars->llr_length[symbol], pdsch_vars->llr_offset[symbol]);
|
||||
}
|
||||
}
|
||||
void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
|
||||
@@ -5179,7 +5180,7 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
|
||||
//packet was actually decoded in previous transmission (ACK was missed by eNB)
|
||||
//However, the round is not a good check as it might have been decoded in a retransmission prior to this one.
|
||||
{
|
||||
LOG_D(PHY,"skip pdsch decoding and report ack\n");
|
||||
// LOG_D(PHY,"skip pdsch decoding and report ack\n");
|
||||
// skip pdsch decoding and report ack
|
||||
//pdlsch0_harq->status = SCH_IDLE;
|
||||
pdlsch0->active = 0;
|
||||
@@ -5804,7 +5805,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
|
||||
//LOG_I(PHY,"[UE] DLSCH: New Data Indicator CW0 subframe %d (pid %d, round %d)\n",
|
||||
// subframe,harq_pid,dlsch0_harq->round);
|
||||
if ( dlsch0_harq->first_tx==1) {
|
||||
LOG_D(PHY,"Format 2 DCI First TX0: Clearing flag\n");
|
||||
// LOG_D(PHY,"Format 2 DCI First TX0: Clearing flag\n");
|
||||
dlsch0_harq->first_tx = 0;
|
||||
}
|
||||
}
|
||||
@@ -5852,7 +5853,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
|
||||
//LOG_I(PHY,"[UE] DLSCH: New Data Indicator CW1 subframe %d (pid %d, round %d)\n",
|
||||
// subframe,harq_pid,dlsch0_harq->round);
|
||||
if (dlsch1_harq->first_tx==1) {
|
||||
LOG_D(PHY,"Format 2 DCI First TX1: Clearing flag\n");
|
||||
// LOG_D(PHY,"Format 2 DCI First TX1: Clearing flag\n");
|
||||
dlsch1_harq->first_tx = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -579,7 +579,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
|
||||
// if (dlsch->harq_processes[harq_pid]->Ndi == 1) { // this is a new packet
|
||||
if (dlsch->harq_processes[harq_pid]->round == 0) { // this is a new packet
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
printf("encoding thinks this is a new packet \n");
|
||||
printf("encoding thinks this is a new packet for harq_pid %d (%p) \n",harq_pid,dlsch->harq_processes[harq_pid]->b);
|
||||
#endif
|
||||
/*
|
||||
int i;
|
||||
@@ -589,6 +589,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
|
||||
printf("\n");
|
||||
*/
|
||||
// Add 24-bit crc (polynomial A) to payload
|
||||
|
||||
crc = crc24a(a,
|
||||
A)>>8;
|
||||
a[A>>3] = ((uint8_t*)&crc)[2];
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "SCHED/extern.h"
|
||||
#include "SIMULATION/TOOLS/defs.h"
|
||||
//#define DEBUG_DLSCH_DECODING
|
||||
//#define UE_DEBUG_TRACE 1
|
||||
|
||||
extern double cpuf;
|
||||
|
||||
|
||||
@@ -48,13 +48,10 @@ int16_t interf_unaw_shift = 13;
|
||||
|
||||
//#define DEBUG_HARQ
|
||||
|
||||
//#undef LOG_D
|
||||
//#define LOG_D LOG_I
|
||||
|
||||
//#define DEBUG_PHY 1
|
||||
#define DEBUG_PHY 1
|
||||
//#define DEBUG_DLSCH_DEMOD 1
|
||||
|
||||
|
||||
//#define DISABLE_LOG_X
|
||||
|
||||
// [MCS][i_mod (0,1,2) = (2,4,6)]
|
||||
unsigned char offset_mumimo_llr_drange_fix=0;
|
||||
@@ -370,7 +367,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
|
||||
//printf("nb_rb = %d, eNB_id %d\n",nb_rb,eNB_id);
|
||||
if (nb_rb==0) {
|
||||
LOG_D(PHY,"dlsch_demodulation.c: nb_rb=0\n");
|
||||
// LOG_D(PHY,"dlsch_demodulation.c: nb_rb=0\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -845,15 +842,15 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
pllr_symbol_cw1 = (int8_t*)pdsch_vars[eNB_id]->llr[1];
|
||||
pllr_symbol_cw0 += llr_offset_symbol;
|
||||
pllr_symbol_cw1 += llr_offset_symbol;
|
||||
/*
|
||||
LOG_I(PHY,"compute LLRs [AbsSubframe %d.%d-%d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %x @LLR Buff(symb) %x\n",
|
||||
|
||||
LOG_I(PHY,"compute LLRs [AbsSubframe %d.%d-%d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %p @LLR Buff(symb) %p\n",
|
||||
frame, subframe,symbol,
|
||||
nb_rb,dlsch0_harq->Qm,
|
||||
pdsch_vars[eNB_id]->llr_length[symbol],
|
||||
pdsch_vars[eNB_id]->llr_offset[symbol],
|
||||
(int16_t*)pdsch_vars[eNB_id]->llr[0],
|
||||
pllr_symbol_cw0);
|
||||
*/
|
||||
|
||||
switch (dlsch0_harq->Qm) {
|
||||
case 2 :
|
||||
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
|
||||
|
||||
@@ -2125,6 +2125,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
amp_rho_b = (int16_t)(((int32_t)amp*dlsch1->sqrt_rho_b)>>13);
|
||||
}
|
||||
|
||||
|
||||
if (mod_order0 == 4)
|
||||
for (i=0;i<4; i++) {
|
||||
qam16_table_a0[i] = (int16_t)(((int32_t)qam16_table[i]*amp_rho_a)>>15);
|
||||
|
||||
@@ -124,14 +124,18 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SCRAMBLING
|
||||
#ifdef Rel14
|
||||
printf("scrambling: i0 %d rnti %x, q %d, Ns %d, Nid_cell %d, G %d x2 %x\n",dlsch->i0,dlsch->rnti,q,Ns,frame_parms->Nid_cell, G, x2);
|
||||
#else
|
||||
printf("scrambling: rnti %x, q %d, Ns %d, Nid_cell %d, G %d x2 %x\n",dlsch->rnti,q,Ns,frame_parms->Nid_cell, G, x2);
|
||||
#endif
|
||||
#endif
|
||||
s = lte_gold_scram(&x1, &x2, 1);
|
||||
|
||||
for (n=0; n<(1+(G>>5)); n++) {
|
||||
|
||||
#ifdef DEBUG_SCRAMBLING
|
||||
printf("scrambling %d : %d => ",k,e[k]);
|
||||
for (int k=0;k<32;k++) printf("scrambling %d : %d xor %d = %d\n",k+(n<<5),e[k],(s>>k)&1,e[k]^((s>>k)&1));
|
||||
#endif
|
||||
|
||||
|
||||
@@ -171,9 +175,8 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
// This is not faster for some unknown reason
|
||||
// ((__m128i *)e)[0] = _mm_xor_si128(((__m128i *)e)[0],((__m128i *)scrambling_lut)[s&65535]);
|
||||
// ((__m128i *)e)[1] = _mm_xor_si128(((__m128i *)e)[1],((__m128i *)scrambling_lut)[s>>16]);
|
||||
#ifdef DEBUG_SCRAMBLING
|
||||
printf("%d\n",e[k]);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
s = lte_gold_scram(&x1, &x2, 0);
|
||||
@@ -213,7 +216,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
for (i=0; i<(1+(G>>5)); i++) {
|
||||
for (j=0; j<32; j++,k++) {
|
||||
#ifdef DEBUG_SCRAMBLING
|
||||
printf("unscrambling %d : %d => ",k,llr[k]);
|
||||
printf("unscrambling %d : %d xor %d =",k,llr[k],(s>>j)&1);
|
||||
#endif
|
||||
llr[k] = ((2*((s>>j)&1))-1)*llr[k];
|
||||
#ifdef DEBUG_SCRAMBLING
|
||||
|
||||
@@ -94,8 +94,10 @@ int generate_drs_pusch(PHY_VARS_UE *ue,
|
||||
l<frame_parms->symbols_per_tti;
|
||||
l += (7 - frame_parms->Ncp),u=u1,v=v1,cyclic_shift=cyclic_shift1) {
|
||||
|
||||
drs_offset = 0; // printf("drs_modulation: Msc_RS = %d, Msc_RS_idx = %d\n",Msc_RS, Msc_RS_idx);
|
||||
|
||||
drs_offset = 0;
|
||||
#ifdef DEBUG_DRS
|
||||
printf("drs_modulation: Msc_RS = %d, Msc_RS_idx = %d, u=%d,v=%d\n",Msc_RS, Msc_RS_idx,u,v);
|
||||
#endif
|
||||
|
||||
|
||||
re_offset = frame_parms->first_carrier_offset;
|
||||
|
||||
@@ -33,20 +33,20 @@ double ratioPB[2][4]={{ 0.00000, -0.96910, -2.21849, -3.97940}, //in db
|
||||
|
||||
double pa_values[8]={-6.0,-4.77,-3.0,-1.77,0.0,1.0,2.0,3.0}; //reported by higher layers
|
||||
|
||||
double get_pa_dB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated)
|
||||
double get_pa_dB(uint8_t pa)
|
||||
{
|
||||
if (pdsch_config_dedicated)
|
||||
return(pa_values[ pdsch_config_dedicated->p_a]);
|
||||
else
|
||||
return(0.0);
|
||||
AssertFatal(pa<8,"pa %d is not in (0...7)\n",pa);
|
||||
|
||||
return(pa_values[pa]);
|
||||
|
||||
}
|
||||
|
||||
double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
double computeRhoA_eNB(uint8_t pa,
|
||||
LTE_eNB_DLSCH_t *dlsch_eNB, int dl_power_off, uint8_t n_antenna_port){
|
||||
double rho_a_dB;
|
||||
double sqrt_rho_a_lin;
|
||||
|
||||
rho_a_dB = get_pa_dB(pdsch_config_dedicated);
|
||||
rho_a_dB = get_pa_dB(pa);
|
||||
|
||||
if(!dl_power_off) //if dl_power_offset is 0, this is for MU-interference, TM5
|
||||
rho_a_dB-=10*log10(2);
|
||||
@@ -59,14 +59,14 @@ double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
dlsch_eNB->sqrt_rho_a= (short) (sqrt_rho_a_lin*pow(2,13));
|
||||
|
||||
#if DEBUG_PC
|
||||
printf("eNB: p_a=%d, value=%f, sqrt_rho_a=%d\n",pdsch_config_dedicated->p_a,pa_values[ pdsch_config_dedicated->p_a],dlsch_eNB->sqrt_rho_a);
|
||||
printf("eNB: p_a=%d, value=%f, sqrt_rho_a=%d\n",p_a,pa_values[ pdsch_config_dedicated->p_a],dlsch_eNB->sqrt_rho_a);
|
||||
#endif
|
||||
|
||||
return(rho_a_dB);
|
||||
}
|
||||
|
||||
double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
PDSCH_CONFIG_COMMON *pdsch_config_common,
|
||||
double computeRhoB_eNB(uint8_t pa,
|
||||
uint8_t pb,
|
||||
uint8_t n_antenna_port,
|
||||
LTE_eNB_DLSCH_t *dlsch_eNB,
|
||||
int dl_power_off)
|
||||
@@ -75,19 +75,21 @@ double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
double rho_a_dB, rho_b_dB;
|
||||
double sqrt_rho_b_lin;
|
||||
|
||||
rho_a_dB= computeRhoA_eNB(pdsch_config_dedicated,dlsch_eNB,dl_power_off, n_antenna_port);
|
||||
AssertFatal(pa<8,"pa %d is not in (0...7)\n",pa);
|
||||
AssertFatal(pb<4,"pb %d is not in (0...3)\n",pb);
|
||||
rho_a_dB= computeRhoA_eNB(pa,dlsch_eNB,dl_power_off, n_antenna_port);
|
||||
|
||||
if(n_antenna_port>1)
|
||||
rho_b_dB= ratioPB[1][pdsch_config_common->p_b] + rho_a_dB;
|
||||
rho_b_dB= ratioPB[1][pb] + rho_a_dB;
|
||||
else
|
||||
rho_b_dB= ratioPB[0][pdsch_config_common->p_b] + rho_a_dB;
|
||||
rho_b_dB= ratioPB[0][pb] + rho_a_dB;
|
||||
|
||||
sqrt_rho_b_lin= pow(10,(0.05*rho_b_dB));
|
||||
|
||||
dlsch_eNB->sqrt_rho_b= (short) (sqrt_rho_b_lin*pow(2,13));
|
||||
|
||||
#ifdef DEBUG_PC
|
||||
printf("eNB: n_ant=%d, p_b=%d -> rho_b/rho_a=%f -> sqrt_rho_b=%d\n",n_antenna_port,pdsch_config_common->p_b,ratioPB[1][pdsch_config_common->p_b],dlsch_eNB->sqrt_rho_b);
|
||||
printf("eNB: n_ant=%d, p_b=%d -> rho_b/rho_a=%f -> sqrt_rho_b=%d\n",n_antenna_port,pb,ratioPB[1][pb],dlsch_eNB->sqrt_rho_b);
|
||||
#endif
|
||||
return(rho_b_dB);
|
||||
}
|
||||
@@ -102,7 +104,7 @@ double computeRhoA_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
double rho_a_dB;
|
||||
double sqrt_rho_a_lin;
|
||||
|
||||
rho_a_dB = get_pa_dB(pdsch_config_dedicated);
|
||||
rho_a_dB = get_pa_dB(pdsch_config_dedicated->p_a);
|
||||
|
||||
if(!dl_power_off)
|
||||
rho_a_dB-=10*log10(2);
|
||||
|
||||
@@ -1789,7 +1789,7 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *PHY_vars_eNB,
|
||||
uint8_t use_srs);
|
||||
|
||||
|
||||
void dump_ulsch(PHY_VARS_eNB *phy_vars_eNB,int frame, int subframe, uint8_t UE_id);
|
||||
void dump_ulsch(PHY_VARS_eNB *phy_vars_eNB,int frame, int subframe, uint8_t UE_id,int round);
|
||||
|
||||
int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci);
|
||||
|
||||
@@ -2227,15 +2227,15 @@ uint32_t dlsch_decoding_abstraction(double *dlsch_MIPB,
|
||||
uint8_t num_pdcch_symbols);
|
||||
|
||||
// DL power control functions
|
||||
double get_pa_dB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated);
|
||||
double get_pa_dB(uint8_t pa);
|
||||
|
||||
double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
LTE_eNB_DLSCH_t *dlsch_eNB,
|
||||
double computeRhoA_eNB(uint8_t pa,
|
||||
LTE_eNB_DLSCH_t *dlsch_eNB,
|
||||
int dl_power_off,
|
||||
uint8_t n_antenna_port);
|
||||
|
||||
double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
PDSCH_CONFIG_COMMON *pdsch_config_common,
|
||||
double computeRhoB_eNB(uint8_t pa,
|
||||
uint8_t pb,
|
||||
uint8_t n_antenna_port,
|
||||
LTE_eNB_DLSCH_t *dlsch_eNB,
|
||||
int dl_power_off);
|
||||
|
||||
@@ -725,8 +725,8 @@ void ulsch_extract_rbs_single(int32_t **rxdataF,
|
||||
//uint8_t symbol = l+Ns*frame_parms->symbols_per_tti/2;
|
||||
uint8_t symbol = l+((7-frame_parms->Ncp)*(Ns&1)); ///symbol within sub-frame
|
||||
|
||||
AssertFatal((frame_parms->nb_antennas_rx>0) && (frame_parms->nb_antennas_rx<3),
|
||||
"nb_antennas_rx not in (1-2)\n");
|
||||
AssertFatal((frame_parms->nb_antennas_rx>0) && (frame_parms->nb_antennas_rx<5),
|
||||
"nb_antennas_rx not in (1-4)\n");
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
|
||||
@@ -1349,35 +1349,54 @@ void rx_ulsch_emul(PHY_VARS_eNB *eNB,
|
||||
}
|
||||
|
||||
|
||||
void dump_ulsch(PHY_VARS_eNB *eNB,int frame,int subframe,uint8_t UE_id) {
|
||||
void dump_ulsch(PHY_VARS_eNB *eNB,int frame,int subframe,uint8_t UE_id,int round) {
|
||||
|
||||
uint32_t nsymb = (eNB->frame_parms.Ncp == 0) ? 14 : 12;
|
||||
uint8_t harq_pid;
|
||||
char fname[100],vname[100];
|
||||
|
||||
harq_pid = subframe2harq_pid(&eNB->frame_parms,frame,subframe);
|
||||
|
||||
printf("Dumping ULSCH in subframe %d with harq_pid %d, for NB_rb %d, TBS %d, Qm %d, N_symb %d\n",
|
||||
subframe,harq_pid,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,
|
||||
printf("Dumping ULSCH in subframe %d with harq_pid %d, round %d for NB_rb %d, TBS %d, Qm %d, N_symb %d\n",
|
||||
subframe,harq_pid,round,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,
|
||||
eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS,eNB->ulsch[UE_id]->harq_processes[harq_pid]->Qm,
|
||||
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch);
|
||||
write_output("/tmp/ulsch_d.m","ulsch_dseq",&eNB->ulsch[UE_id]->harq_processes[harq_pid]->d[0][96],
|
||||
sprintf(fname,"/tmp/ulsch_r%d_d",round);
|
||||
sprintf(vname,"/tmp/ulsch_r%d_dseq",round);
|
||||
write_output(fname,vname,&eNB->ulsch[UE_id]->harq_processes[harq_pid]->d[0][96],
|
||||
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Kplus*3,1,0);
|
||||
if (eNB->common_vars.rxdata) write_output("/tmp/rxsig0.m","rxs0", &eNB->common_vars.rxdata[0][0],eNB->frame_parms.samples_per_tti*10,1,1);
|
||||
|
||||
if (eNB->frame_parms.nb_antennas_rx>1)
|
||||
if (eNB->common_vars.rxdata) write_output("/tmp/rxsig1.m","rxs1", &eNB->common_vars.rxdata[1][0],eNB->frame_parms.samples_per_tti*10,1,1);
|
||||
if (eNB->common_vars.rxdata) {
|
||||
sprintf(fname,"/tmp/rxsig0_r%d.m",round);
|
||||
sprintf(vname,"rxs0_r%d",round);
|
||||
write_output(fname,vname, &eNB->common_vars.rxdata[0][0],eNB->frame_parms.samples_per_tti*10,1,1);
|
||||
|
||||
if (eNB->frame_parms.nb_antennas_rx>1)
|
||||
if (eNB->common_vars.rxdata) {
|
||||
sprintf(fname,"/tmp/rxsig1_r%d.m",round);
|
||||
sprintf(vname,"rxs1_r%d",round);
|
||||
write_output(fname,vname, &eNB->common_vars.rxdata[1][0],eNB->frame_parms.samples_per_tti*10,1,1);
|
||||
}
|
||||
}
|
||||
|
||||
write_output("/tmp/rxsigF0.m","rxsF0", &eNB->common_vars.rxdataF[0][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
sprintf(fname,"/tmp/rxsigF0_r%d.m",round);
|
||||
sprintf(vname,"rxsF0_r%d",round);
|
||||
write_output(fname,vname, (void*)&eNB->common_vars.rxdataF[0][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
if (eNB->frame_parms.nb_antennas_rx>1)
|
||||
write_output("/tmp/rxsigF1.m","rxsF1", &eNB->common_vars.rxdataF[1][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
if (eNB->frame_parms.nb_antennas_rx>1) {
|
||||
sprintf(fname,"/tmp/rxsigF1_r%d.m",round);
|
||||
sprintf(vname,"rxsF1_r%d",round);
|
||||
write_output(vname,fname, &eNB->common_vars.rxdataF[1][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
}
|
||||
|
||||
write_output("/tmp/rxsigF0_ext.m","rxsF0_ext", &eNB->pusch_vars[UE_id]->rxdataF_ext[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
|
||||
|
||||
if (eNB->frame_parms.nb_antennas_rx>1)
|
||||
write_output("/tmp/rxsigF1_ext.m","rxsF1_ext", &eNB->pusch_vars[UE_id]->rxdataF_ext[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
|
||||
sprintf(fname,"/tmp/rxsigF0_ext_r%d.m",round);
|
||||
sprintf(vname,"rxsF0_ext_r%d",round);
|
||||
write_output(fname,vname, &eNB->pusch_vars[UE_id]->rxdataF_ext[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
|
||||
|
||||
if (eNB->frame_parms.nb_antennas_rx>1) {
|
||||
sprintf(fname,"/tmp/rxsigF1_ext_r%d.m",round);
|
||||
sprintf(vname,"rxsF1_ext_r%d",round);
|
||||
write_output(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_ext[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
|
||||
}
|
||||
/*
|
||||
if (eNB->srs_vars[UE_id].srs_ch_estimates) write_output("/tmp/srs_est0.m","srsest0",eNB->srs_vars[UE_id].srs_ch_estimates[0],eNB->frame_parms.ofdm_symbol_size,1,1);
|
||||
|
||||
@@ -1385,17 +1404,28 @@ void rx_ulsch_emul(PHY_VARS_eNB *eNB,
|
||||
if (eNB->srs_vars[UE_id].srs_ch_estimates) write_output("/tmp/srs_est1.m","srsest1",eNB->srs_vars[UE_id].srs_ch_estimates[1],eNB->frame_parms.ofdm_symbol_size,1,1);
|
||||
*/
|
||||
|
||||
write_output("/tmp/drs_est0.m","drsest0",eNB->pusch_vars[UE_id]->drs_ch_estimates[0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
|
||||
sprintf(fname,"/tmp/drs_est0_r%d.m",round);
|
||||
sprintf(vname,"drsest0_r%d",round);
|
||||
write_output(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
|
||||
|
||||
if (eNB->frame_parms.nb_antennas_rx>1)
|
||||
write_output("/tmp/drs_est1.m","drsest1",eNB->pusch_vars[UE_id]->drs_ch_estimates[1],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
|
||||
if (eNB->frame_parms.nb_antennas_rx>1) {
|
||||
sprintf(fname,"/tmp/drs_est1_r%d.m",round);
|
||||
sprintf(vname,"drsest1_r%d",round);
|
||||
write_output(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[1],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
|
||||
}
|
||||
|
||||
write_output("/tmp/ulsch_rxF_comp0.m","ulsch0_rxF_comp0",&eNB->pusch_vars[UE_id]->rxdataF_comp[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
|
||||
sprintf(fname,"/tmp/ulsch0_rxF_comp0_r%d.m",round);
|
||||
sprintf(vname,"ulsch0_rxF_comp0_r%d",round);
|
||||
write_output(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_comp[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
|
||||
// write_output("ulsch_rxF_comp1.m","ulsch0_rxF_comp1",&eNB->pusch_vars[UE_id]->rxdataF_comp[0][1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
|
||||
write_output("/tmp/ulsch_rxF_llr.m","ulsch_llr",eNB->pusch_vars[UE_id]->llr,
|
||||
sprintf(fname,"/tmp/ulsch_rxF_llr_r%d.m",round);
|
||||
sprintf(vname,"ulsch_llr_r%d",round);
|
||||
write_output(fname,vname,eNB->pusch_vars[UE_id]->llr,
|
||||
eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*eNB->ulsch[UE_id]->harq_processes[harq_pid]->Qm
|
||||
*eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch,1,0);
|
||||
write_output("/tmp/ulsch_ch_mag.m","ulsch_ch_mag",&eNB->pusch_vars[UE_id]->ul_ch_mag[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
|
||||
sprintf(fname,"/tmp/ulsch_ch_mag_r%d.m",round);
|
||||
sprintf(vname,"ulsch_ch_mag_r%d",round);
|
||||
write_output(fname,vname,&eNB->pusch_vars[UE_id]->ul_ch_mag[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
|
||||
// write_output("ulsch_ch_mag1.m","ulsch_ch_mag1",&eNB->pusch_vars[UE_id]->ul_ch_mag[1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
|
||||
//#endif
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ int slot_fep_ul(RU_t *ru,
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
LOG_D(PHY,"slot_fep: done\n");
|
||||
// LOG_D(PHY,"slot_fep: done\n");
|
||||
#endif
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ void remove_7_5_kHz(RU_t *ru,uint8_t slot)
|
||||
}
|
||||
|
||||
|
||||
slot_offset = (uint32_t)slot * frame_parms->samples_per_tti/2-ru->N_TA_offset;
|
||||
slot_offset = ((uint32_t)slot * frame_parms->samples_per_tti/2)-ru->N_TA_offset;
|
||||
slot_offset2 = (uint32_t)(slot&1) * frame_parms->samples_per_tti/2;
|
||||
|
||||
len = frame_parms->samples_per_tti/2;
|
||||
|
||||
@@ -2047,6 +2047,8 @@ const static int16_t tw16c[24] __attribute__((aligned(32))) = { 0,32767,12540,30
|
||||
0,32767,30273,12539,23170,-23170,-12539,-30273
|
||||
};
|
||||
|
||||
#ifdef __AVX2__
|
||||
|
||||
const static int16_t tw16rep[48] __attribute__((aligned(32))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273,32767,0,30272,-12540,23169 ,-23170,12539 ,-30273,
|
||||
32767,0,23169,-23170,0 ,-32767,-23170,-23170,32767,0,23169,-23170,0 ,-32767,-23170,-23170,
|
||||
32767,0,12539,-30273,-23170,-23170,-30273,12539,32767,0,12539,-30273,-23170,-23170,-30273,12539
|
||||
@@ -2067,6 +2069,8 @@ const static int16_t tw16crep[48] __attribute__((aligned(32))) = { 0,32767,12540
|
||||
0,32767,30273,12539,23170,-23170,-12539,-30273,0,32767,30273,12539,23170,-23170,-12539,-30273
|
||||
};
|
||||
|
||||
#endif /* __AVX2__ */
|
||||
|
||||
|
||||
|
||||
static inline void dft16(int16_t *x,int16_t *y) __attribute__((always_inline));
|
||||
|
||||
@@ -200,7 +200,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
chest_t = (int16_t**) phy_vars_enb->srs_vars[UE_id].srs_ch_estimates[eNB_id];
|
||||
chest_f = (int16_t**) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates[eNB_id];
|
||||
pusch_llr = (int16_t*) phy_vars_enb->pusch_vars[UE_id]->llr;
|
||||
pusch_comp = (int16_t*) phy_vars_enb->pusch_vars[UE_id]->rxdataF_comp[eNB_id][0];
|
||||
pusch_comp = (int16_t*) phy_vars_enb->pusch_vars[UE_id]->rxdataF_comp[0];
|
||||
pucch1_comp = (int32_t*) phy_vars_enb->pucch1_stats[UE_id];
|
||||
pucch1_thres = (int32_t*) phy_vars_enb->pucch1_stats_thres[UE_id];
|
||||
pucch1ab_comp = (int32_t*) phy_vars_enb->pucch1ab_stats[UE_id];
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
char* namepointer_chMag ;
|
||||
char fmageren_name2[512];
|
||||
|
||||
@@ -190,12 +190,12 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr
|
||||
eNB->pdsch_config_dedicated[UE_id].p_a = rel8->pa;
|
||||
|
||||
if (dlsch0->active){
|
||||
computeRhoA_eNB(&eNB->pdsch_config_dedicated[UE_id], dlsch0,dlsch0_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB);
|
||||
computeRhoB_eNB(&eNB->pdsch_config_dedicated[UE_id],&(eNB->frame_parms.pdsch_config_common),eNB->frame_parms.nb_antenna_ports_eNB,dlsch0,dlsch0_harq->dl_power_off);
|
||||
computeRhoA_eNB(rel8->pa, dlsch0,dlsch0_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB);
|
||||
computeRhoB_eNB(rel8->pa,eNB->frame_parms.pdsch_config_common.p_b,eNB->frame_parms.nb_antenna_ports_eNB,dlsch0,dlsch0_harq->dl_power_off);
|
||||
}
|
||||
if (dlsch1->active){
|
||||
computeRhoA_eNB(&eNB->pdsch_config_dedicated[UE_id], dlsch1,dlsch1_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB);
|
||||
computeRhoB_eNB(&eNB->pdsch_config_dedicated[UE_id],&(eNB->frame_parms.pdsch_config_common),eNB->frame_parms.nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off);
|
||||
computeRhoA_eNB(rel8->pa, dlsch1,dlsch1_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB);
|
||||
computeRhoB_eNB(rel8->pa,eNB->frame_parms.pdsch_config_common.p_b,eNB->frame_parms.nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off);
|
||||
}
|
||||
|
||||
dlsch0_harq->pdsch_start = eNB->pdcch_vars[subframe & 1].num_pdcch_symbols;
|
||||
@@ -537,7 +537,7 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
|
||||
if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) {
|
||||
AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0,
|
||||
"No existing UE ULSCH for rnti %x\n",rel8->rnti);
|
||||
//LOG_D(PHY,"Applying UL config for UE %d, rnti %x for frame %d, subframe %d\n", UE_id,rel8->rnti,frame,subframe);
|
||||
LOG_D(PHY,"Applying UL config for UE %d, rnti %x for frame %d, subframe %d, modulation %d, rvidx %d\n", UE_id,rel8->rnti,frame,subframe,rel8->modulation_type,rel8->redundancy_version);
|
||||
|
||||
fill_ulsch(eNB,&ul_config_pdu->ulsch_pdu,frame,subframe);
|
||||
|
||||
|
||||
@@ -395,6 +395,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
|
||||
|
||||
|
||||
|
||||
|
||||
void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
eNB_rxtx_proc_t *proc,
|
||||
relaying_type_t r_type,
|
||||
@@ -416,7 +417,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
|
||||
int offset = eNB->CC_id;//proc == &eNB->proc.proc_rxtx[0] ? 0 : 1;
|
||||
|
||||
|
||||
|
||||
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)==SF_UL)) return;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+offset,1);
|
||||
@@ -429,6 +430,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (nfapi_mode == 0 || nfapi_mode == 1) {
|
||||
if (is_pmch_subframe(frame,subframe,fp)) {
|
||||
pmch_procedures(eNB,proc,rn,r_type);
|
||||
@@ -439,6 +441,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// clear existing ulsch dci allocations before applying info from MAC (this is table
|
||||
ul_subframe = pdcch_alloc2ul_subframe(fp,subframe);
|
||||
ul_frame = pdcch_alloc2ul_frame(fp,frame,subframe);
|
||||
@@ -894,7 +897,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
harq_ack[0] = 4; // DTX
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
|
||||
max_metric = 0;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -977,7 +980,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 6; // NACK/DTX
|
||||
|
||||
max_metric = 0;
|
||||
} else {
|
||||
|
||||
max_metric = max(metric[0],max(metric[1],max(metric[2],metric[3])));
|
||||
@@ -1206,7 +1209,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
|
||||
start_meas(&eNB->ulsch_demodulation_stats);
|
||||
|
||||
rx_ulsch(eNB,proc, i);
|
||||
rx_ulsch(eNB,proc, i);
|
||||
|
||||
stop_meas(&eNB->ulsch_demodulation_stats);
|
||||
|
||||
@@ -1259,7 +1262,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n",
|
||||
eNB->Mod_id,harq_pid,
|
||||
frame,subframe, i,
|
||||
ulsch_harq->round-1,
|
||||
ulsch_harq->round,
|
||||
ulsch->Mlimit,
|
||||
ulsch_harq->o_ACK[0],
|
||||
ulsch_harq->o_ACK[1]);
|
||||
|
||||
@@ -81,7 +81,7 @@ extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
#endif
|
||||
|
||||
|
||||
#define DEBUG_UE_TRACE 1
|
||||
#define UE_DEBUG_TRACE 1
|
||||
|
||||
void dump_dlsch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid)
|
||||
{
|
||||
@@ -1266,7 +1266,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
|
||||
}
|
||||
//#endif
|
||||
|
||||
if ((frame_tx%100) == 0)
|
||||
// if ((frame_tx%100) == 0)
|
||||
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: ulsch_start = %d (rxoff %d, HW TA %d, timing advance %d, TA_offset %d\n",
|
||||
ue->Mod_id,frame_tx,subframe_tx,
|
||||
ulsch_start,
|
||||
@@ -1288,16 +1288,25 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
|
||||
nsymb,
|
||||
frame_parms->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
else
|
||||
else {
|
||||
normal_prefix_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size],
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
dummy_tx_buffer,
|
||||
dummy_tx_buffer,
|
||||
#else
|
||||
&ue->common_vars.txdata[aa][ulsch_start],
|
||||
&ue->common_vars.txdata[aa][ulsch_start],
|
||||
#endif
|
||||
nsymb,
|
||||
&ue->frame_parms);
|
||||
nsymb>>1,
|
||||
&ue->frame_parms);
|
||||
|
||||
normal_prefix_mod(&ue->common_vars.txdataF[aa][((subframe_tx*nsymb)+(nsymb>>1))*frame_parms->ofdm_symbol_size],
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
dummy_tx_buffer+(frame_parms->samples_per_tti>>1),
|
||||
#else
|
||||
&ue->common_vars.txdata[aa][ulsch_start+(frame_parms->samples_per_tti>>1)],
|
||||
#endif
|
||||
nsymb>>1,
|
||||
&ue->frame_parms);
|
||||
}
|
||||
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
apply_7_5_kHz(ue,dummy_tx_buffer,0);
|
||||
@@ -1373,7 +1382,7 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
if (ue->mac_enabled==1){
|
||||
// ask L2 for RACH transport
|
||||
if ((mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) && (mode != no_L2_connect) ) {
|
||||
LOG_D(PHY,"Getting PRACH resources\n");
|
||||
//LOG_D(PHY,"Getting PRACH resources\n");
|
||||
|
||||
ue->prach_resources[eNB_id] = ue_get_rach(ue->Mod_id,
|
||||
ue->CC_id,
|
||||
@@ -1590,7 +1599,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
||||
LOG_D(PHY,"Generating PUSCH (Abssubframe: %d.%d): harq-Id: %d, round: %d, MaxReTrans: %d \n",frame_tx,subframe_tx,harq_pid,ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,ue->ulsch[eNB_id]->Mlimit);
|
||||
if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->round >= (ue->ulsch[eNB_id]->Mlimit - 1))
|
||||
{
|
||||
LOG_D(PHY,"PUSCH MAX Retransmission achieved ==> send last pusch\n");
|
||||
// LOG_D(PHY,"PUSCH MAX Retransmission achieved ==> send last pusch\n");
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->round = 0;
|
||||
}
|
||||
@@ -2070,10 +2079,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
(bundling_flag==bundling) ||
|
||||
((frame_parms->frame_type==TDD)&&(frame_parms->tdd_config==1)&&((subframe_tx!=2)||(subframe_tx!=7)))) {
|
||||
format = pucch_format1a;
|
||||
LOG_D(PHY,"[UE] PUCCH 1a\n");
|
||||
// LOG_D(PHY,"[UE] PUCCH 1a\n");
|
||||
} else {
|
||||
format = pucch_format1b;
|
||||
LOG_D(PHY,"[UE] PUCCH 1b\n");
|
||||
// LOG_D(PHY,"[UE] PUCCH 1b\n");
|
||||
}
|
||||
|
||||
// Part - I
|
||||
@@ -3108,7 +3117,7 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs
|
||||
int ret=0;
|
||||
|
||||
if (is_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms)) {
|
||||
LOG_D(PHY,"ue calling pmch subframe ..\n ");
|
||||
// LOG_D(PHY,"ue calling pmch subframe ..\n ");
|
||||
|
||||
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Querying for PMCH demodulation\n",
|
||||
ue->Mod_id,(subframe_rx==9?-1:0)+frame_rx,subframe_rx);
|
||||
|
||||
@@ -52,6 +52,8 @@
|
||||
|
||||
extern uint32_t nfapi_mode;
|
||||
|
||||
extern int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
|
||||
|
||||
void prach_procedures(PHY_VARS_eNB *eNB
|
||||
#ifdef Rel14
|
||||
,
|
||||
|
||||
@@ -539,6 +539,7 @@ void fep_full(RU_t *ru) {
|
||||
|
||||
remove_7_5_kHz(ru,proc->subframe_rx<<1);
|
||||
remove_7_5_kHz(ru,1+(proc->subframe_rx<<1));
|
||||
|
||||
for (l=0; l<fp->symbols_per_tti/2; l++) {
|
||||
slot_fep_ul(ru,
|
||||
l,
|
||||
|
||||
+406
-1228
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,84 @@
|
||||
|
||||
PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
|
||||
frame_t frameP, uint8_t new_Msg3,
|
||||
sub_frame_t subframe){ return(NULL);}
|
||||
|
||||
void ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
sub_frame_t subframe, uint8_t eNB_index,
|
||||
uint8_t * ulsch_buffer, uint16_t buflen,
|
||||
uint8_t * access_mode){}
|
||||
|
||||
void Msg1_transmitted(module_id_t module_idP, uint8_t CC_id,
|
||||
frame_t frameP, uint8_t eNB_id){}
|
||||
|
||||
void Msg3_transmitted(module_id_t module_idP, uint8_t CC_id,
|
||||
frame_t frameP, uint8_t eNB_id){}
|
||||
|
||||
uint32_t ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
uint8_t eNB_id, rnti_t rnti, sub_frame_t subframe){ return(0);}
|
||||
|
||||
void rrc_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index)
|
||||
{}
|
||||
|
||||
UE_L2_STATE_t ue_scheduler(const module_id_t module_idP,
|
||||
const frame_t rxFrameP,
|
||||
const sub_frame_t rxSubframe,
|
||||
const frame_t txFrameP,
|
||||
const sub_frame_t txSubframe,
|
||||
const lte_subframe_t direction,
|
||||
const uint8_t eNB_index, const int CC_id){ return(0);}
|
||||
|
||||
void ue_decode_p(module_id_t module_idP, int CC_id, frame_t frame,
|
||||
uint8_t CH_index, void *pdu, uint16_t len){}
|
||||
|
||||
void ue_decode_si(module_id_t module_idP, int CC_id, frame_t frame,
|
||||
uint8_t CH_index, void *pdu, uint16_t len){}
|
||||
|
||||
void ue_send_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frame,
|
||||
sub_frame_t subframe, uint8_t * sdu, uint16_t sdu_len,
|
||||
uint8_t CH_index){}
|
||||
|
||||
uint16_t
|
||||
ue_process_rar(const module_id_t module_idP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
const rnti_t ra_rnti,
|
||||
uint8_t * const dlsch_buffer,
|
||||
rnti_t * const t_crnti,
|
||||
const uint8_t preamble_index,
|
||||
uint8_t * selected_rar_buffer){ return(0);}
|
||||
|
||||
void ue_send_mch_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
|
||||
uint8_t * sdu, uint16_t sdu_len, uint8_t eNB_index,
|
||||
uint8_t sync_area){}
|
||||
|
||||
int ue_query_mch(uint8_t Mod_id, uint8_t CC_id, uint32_t frame,
|
||||
sub_frame_t subframe, uint8_t eNB_index,
|
||||
uint8_t * sync_area, uint8_t * mcch_active){ return(0);}
|
||||
|
||||
void dl_phy_sync_success(module_id_t module_idP,
|
||||
frame_t frameP,
|
||||
unsigned char eNB_index, uint8_t first_sync){}
|
||||
|
||||
uint32_t from_earfcn(int eutra_bandP, uint32_t dl_earfcn) { return(0);}
|
||||
|
||||
int32_t get_uldl_offset(int eutra_bandP) { return(0);}
|
||||
|
||||
IF_Module_t *IF_Module_init(int Mod_id) { return(NULL);}
|
||||
|
||||
int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP, uint8_t CC_id) { return(0);}
|
||||
|
||||
int8_t get_deltaP_rampup(module_id_t module_idP, uint8_t CC_id) { return(0);}
|
||||
|
||||
void thread_top_init(char *thread_name,
|
||||
int affinity,
|
||||
uint64_t runtime,
|
||||
uint64_t deadline,
|
||||
uint64_t period) {}
|
||||
|
||||
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return(0);}
|
||||
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); }
|
||||
|
||||
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); }
|
||||
|
||||
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); }
|
||||
+259
-138
@@ -47,9 +47,7 @@
|
||||
#include "unitary_defs.h"
|
||||
|
||||
#include "PHY/TOOLS/lte_phy_scope.h"
|
||||
|
||||
PHY_VARS_eNB *eNB;
|
||||
PHY_VARS_UE *UE;
|
||||
#include "dummy_functions.c"
|
||||
|
||||
double cpuf;
|
||||
|
||||
@@ -78,9 +76,112 @@ double t_tx_min = 1000000000; /*!< \brief initial min process time for tx */
|
||||
double t_rx_min = 1000000000; /*!< \brief initial min process time for tx */
|
||||
int n_tx_dropped = 0; /*!< \brief initial max process time for tx */
|
||||
int n_rx_dropped = 0; /*!< \brief initial max process time for rx */
|
||||
int nfapi_mode = 0;
|
||||
|
||||
extern void fep_full(RU_t *ru);
|
||||
extern void ru_fep_full_2thread(RU_t *ru);
|
||||
|
||||
void fill_ulsch_dci(PHY_VARS_eNB *eNB,void *UL_dci,int first_rb,int nb_rb,int mcs,int ndi,int cqi_flag) {
|
||||
nfapi_dl_config_request_t DL_req;
|
||||
nfapi_ul_config_request_t UL_req;
|
||||
nfapi_hi_dci0_request_t HI_DCI0_req;
|
||||
nfapi_ul_config_request_pdu_t ul_config_pdu_list[MAX_NUM_DL_PDU];
|
||||
nfapi_tx_request_pdu_t tx_pdu_list[MAX_NUM_TX_REQUEST_PDU];
|
||||
nfapi_tx_request_t TX_req;
|
||||
Sched_Rsp_t sched_resp;
|
||||
|
||||
void
|
||||
fill_nfapi_ulsch_config_request(nfapi_ul_config_request_pdu_t *ul_config_pdu,
|
||||
uint8_t cqi_req,
|
||||
uint8_t p_eNB,
|
||||
uint8_t cqi_ReportModeAperiodic,
|
||||
uint8_t betaOffset_CQI_Index,
|
||||
uint8_t betaOffset_RI_Index,
|
||||
uint8_t dl_cqi_pmi_size,
|
||||
uint8_t tmode,
|
||||
uint32_t handle,
|
||||
uint16_t rnti,
|
||||
uint8_t resource_block_start,
|
||||
uint8_t number_of_resource_blocks,
|
||||
uint8_t modulation_type,
|
||||
uint8_t cyclic_shift_2_for_drms,
|
||||
uint8_t frequency_hopping_enabled_flag,
|
||||
uint8_t frequency_hopping_bits,
|
||||
uint8_t new_data_indication,
|
||||
uint8_t redundancy_version,
|
||||
uint8_t harq_process_number,
|
||||
uint8_t ul_tx_mode,
|
||||
uint8_t current_tx_nb,
|
||||
uint8_t n_srs,
|
||||
uint16_t size)
|
||||
{
|
||||
memset((void *) ul_config_pdu, 0, sizeof(nfapi_ul_config_request_pdu_t));
|
||||
|
||||
// printf("filling ul_config_pdu: modulation type %d, rvidx %d\n",modulation_type,redundancy_version);
|
||||
|
||||
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE;
|
||||
ul_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_ul_config_ulsch_pdu));
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = handle;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = rnti;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = resource_block_start;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = number_of_resource_blocks;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = modulation_type;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = cyclic_shift_2_for_drms;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = frequency_hopping_enabled_flag;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = frequency_hopping_bits;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = new_data_indication;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = redundancy_version;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = harq_process_number;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = ul_tx_mode;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = current_tx_nb;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = n_srs;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = size;
|
||||
|
||||
if (cqi_req == 1) {
|
||||
// Add CQI portion
|
||||
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE;
|
||||
ul_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_ul_config_ulsch_cqi_ri_pdu));
|
||||
ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL9_TAG;
|
||||
ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.report_type = 1;
|
||||
ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.number_of_cc = 1;
|
||||
LOG_D(MAC, "report_type %d\n",ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.report_type);
|
||||
|
||||
if (p_eNB <= 2
|
||||
&& (tmode == 3 || tmode == 4 || tmode == 8 || tmode == 9 || tmode == 10))
|
||||
ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 1;
|
||||
else if (p_eNB <= 2) ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 0;
|
||||
else if (p_eNB == 4) ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 2;
|
||||
|
||||
for (int ri = 0;
|
||||
ri < (1 << ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size);
|
||||
ri++)
|
||||
ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[ri] = dl_cqi_pmi_size;
|
||||
|
||||
ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.delta_offset_cqi = betaOffset_CQI_Index;
|
||||
ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.delta_offset_ri = betaOffset_RI_Index;
|
||||
}
|
||||
}
|
||||
|
||||
void fill_ulsch_dci(PHY_VARS_eNB *eNB,
|
||||
int frame,
|
||||
int subframe,
|
||||
Sched_Rsp_t *sched_resp,
|
||||
uint16_t rnti,
|
||||
void *UL_dci,
|
||||
int first_rb,
|
||||
int nb_rb,
|
||||
int mcs,
|
||||
int modulation_type,
|
||||
int ndi,
|
||||
int cqi_flag,
|
||||
uint8_t beta_CQI,
|
||||
uint8_t beta_RI,
|
||||
uint8_t cqi_size) {
|
||||
|
||||
nfapi_ul_config_request_body_t *ul_req=&sched_resp->UL_req->ul_config_request_body;
|
||||
int harq_pid = ((frame*10)+subframe)&7;
|
||||
|
||||
// printf("ulsch in frame %d, subframe %d => harq_pid %d, mcs %d, ndi %d\n",frame,subframe,harq_pid,mcs,ndi);
|
||||
|
||||
switch (eNB->frame_parms.N_RB_UL) {
|
||||
case 6:
|
||||
@@ -162,6 +263,36 @@ void fill_ulsch_dci(PHY_VARS_eNB *eNB,void *UL_dci,int first_rb,int nb_rb,int mc
|
||||
break;
|
||||
}
|
||||
|
||||
fill_nfapi_ulsch_config_request(&ul_req->ul_config_pdu_list[0],
|
||||
cqi_flag&1,
|
||||
1, // p_eNB
|
||||
0, // reportmode Aperiodic
|
||||
beta_CQI,
|
||||
beta_RI,
|
||||
cqi_size,
|
||||
//cc,
|
||||
//UE_template->physicalConfigDedicated,
|
||||
1,
|
||||
0,
|
||||
14, // rnti
|
||||
first_rb, // resource_block_start
|
||||
nb_rb, // number_of_resource_blocks
|
||||
modulation_type,
|
||||
0, // cyclic_shift_2_for_drms
|
||||
0, // frequency_hopping_enabled_flag
|
||||
0, // frequency_hopping_bits
|
||||
ndi, // new_data_indication
|
||||
mcs>28?(mcs-28):0, // redundancy_version
|
||||
harq_pid, // harq_process_number
|
||||
0, // ul_tx_mode
|
||||
0, // current_tx_nb
|
||||
0, // n_srs
|
||||
get_TBS_UL(mcs,nb_rb));
|
||||
|
||||
sched_resp->UL_req->header.message_id = NFAPI_UL_CONFIG_REQUEST;
|
||||
ul_req->number_of_pdus=1;
|
||||
ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
|
||||
|
||||
}
|
||||
|
||||
extern void eNB_fep_full(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc);
|
||||
@@ -172,22 +303,26 @@ int main(int argc, char **argv)
|
||||
|
||||
char c;
|
||||
int i,j,aa,u;
|
||||
|
||||
PHY_VARS_eNB *eNB;
|
||||
PHY_VARS_UE *UE;
|
||||
RU_t *ru;
|
||||
int aarx,aatx;
|
||||
double channelx,channely;
|
||||
double sigma2, sigma2_dB=10,SNR,SNR2=0,snr0=-2.0,snr1,SNRmeas,rate,saving_bler=0;
|
||||
double input_snr_step=.2,snr_int=30;
|
||||
double blerr;
|
||||
|
||||
int rvidx[8]={0,2,3,1,0,2,3,1};
|
||||
int **txdata;
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
double s_re0[30720],s_im0[30720],r_re0[30720],r_im0[30720];
|
||||
double s_re1[30720],s_im1[30720],r_re1[30720],r_im1[30720];
|
||||
double r_re2[30720],r_im2[30720];
|
||||
double r_re3[30720],r_im3[30720];
|
||||
double *s_re[2]={s_re0,s_re1};
|
||||
double *s_im[2]={s_im0,s_im1};
|
||||
double *r_re[2]={r_re0,r_re1};
|
||||
double *r_im[2]={r_im0,r_im1};
|
||||
double *r_re[4]={r_re0,r_re1,r_re2,r_re3};
|
||||
double *r_im[4]={r_im0,r_im1,r_im2,r_im3};
|
||||
double forgetting_factor=0.0; //in [0,1] 0 means a new channel every time, 1 means keep the same channel
|
||||
double iqim=0.0;
|
||||
uint8_t extended_prefix_flag=0;
|
||||
@@ -254,8 +389,7 @@ int main(int argc, char **argv)
|
||||
uint8_t N_RB_DL=25,osf=1;
|
||||
|
||||
//uint8_t cyclic_shift = 0;
|
||||
uint8_t cooperation_flag = 0; //0 no cooperation, 1 delay diversity, 2 Alamouti
|
||||
uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2;
|
||||
uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2,cqi_size=11;
|
||||
uint8_t tdd_config=3,frame_type=FDD;
|
||||
|
||||
uint8_t N0=30;
|
||||
@@ -282,10 +416,24 @@ int main(int argc, char **argv)
|
||||
|
||||
opp_enabled=1; // to enable the time meas
|
||||
|
||||
sched_resp.DL_req = &DL_req;
|
||||
sched_resp.UL_req = &UL_req;
|
||||
sched_resp.HI_DCI0_req = &HI_DCI0_req;
|
||||
sched_resp.TX_req = &TX_req;
|
||||
memset((void*)&DL_req,0,sizeof(DL_req));
|
||||
memset((void*)&UL_req,0,sizeof(UL_req));
|
||||
memset((void*)&HI_DCI0_req,0,sizeof(HI_DCI0_req));
|
||||
memset((void*)&TX_req,0,sizeof(TX_req));
|
||||
|
||||
UL_req.ul_config_request_body.ul_config_pdu_list = ul_config_pdu_list;
|
||||
TX_req.tx_request_body.tx_pdu_list = tx_pdu_list;
|
||||
|
||||
cpu_freq_GHz = (double)get_cpu_freq_GHz();
|
||||
cpuf = cpu_freq_GHz;
|
||||
|
||||
printf("Detected cpu_freq %f GHz\n",cpu_freq_GHz);
|
||||
AssertFatal(load_configmodule(argc,argv) != NULL,
|
||||
"cannot load configuration module, exiting\n");
|
||||
|
||||
logInit();
|
||||
/*
|
||||
@@ -565,20 +713,44 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
}
|
||||
RC.nb_L1_inst = 1;
|
||||
RC.nb_RU = 1;
|
||||
|
||||
lte_param_init(1,
|
||||
1,
|
||||
lte_param_init(&eNB,&UE,&ru,
|
||||
1,
|
||||
1,
|
||||
n_rx,
|
||||
1,
|
||||
1,
|
||||
extended_prefix_flag,
|
||||
frame_type,
|
||||
0,
|
||||
tdd_config,
|
||||
N_RB_DL,
|
||||
4,
|
||||
threequarter_fs,
|
||||
osf,
|
||||
0);
|
||||
|
||||
RC.eNB = (PHY_VARS_eNB ***)malloc(sizeof(PHY_VARS_eNB **));
|
||||
RC.eNB[0] = (PHY_VARS_eNB **)malloc(sizeof(PHY_VARS_eNB *));
|
||||
RC.ru = (RU_t **)malloc(sizeof(RC.ru));
|
||||
RC.eNB[0][0] = eNB;
|
||||
RC.ru[0] = ru;
|
||||
for (int k=0;k<eNB->RU_list[0]->nb_rx;k++) eNB->common_vars.rxdataF[k] = eNB->RU_list[0]->common.rxdataF[k];
|
||||
|
||||
memset((void*)&eNB->UL_INFO,0,sizeof(eNB->UL_INFO));
|
||||
|
||||
printf("Setting indication lists\n");
|
||||
eNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list = eNB->rx_pdu_list;
|
||||
eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list = eNB->crc_pdu_list;
|
||||
eNB->UL_INFO.sr_ind.sr_indication_body.sr_pdu_list = eNB->sr_pdu_list;
|
||||
eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list = eNB->harq_pdu_list;
|
||||
eNB->UL_INFO.cqi_ind.cqi_pdu_list = eNB->cqi_pdu_list;
|
||||
eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list;
|
||||
|
||||
printf("lte_param_init done\n");
|
||||
|
||||
// for a call to phy_reset_ue later we need PHY_vars_UE_g allocated and pointing to UE
|
||||
PHY_vars_UE_g = (PHY_VARS_UE***)malloc(sizeof(PHY_VARS_UE**));
|
||||
PHY_vars_UE_g[0] = (PHY_VARS_UE**) malloc(sizeof(PHY_VARS_UE*));
|
||||
@@ -587,7 +759,7 @@ int main(int argc, char **argv)
|
||||
if (nb_rb_set == 0)
|
||||
nb_rb = eNB->frame_parms.N_RB_UL;
|
||||
|
||||
printf("1 . rxdataF_comp[0] %p\n",eNB->pusch_vars[0]->rxdataF_comp[0][0]);
|
||||
printf("1 . rxdataF_comp[0] %p\n",eNB->pusch_vars[0]->rxdataF_comp[0]);
|
||||
printf("Setting mcs = %d\n",mcs);
|
||||
printf("n_frames = %d\n", n_frames);
|
||||
|
||||
@@ -670,7 +842,6 @@ int main(int argc, char **argv)
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].freqDomainPosition = 0;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].cyclicShift = 0;
|
||||
|
||||
eNB->cooperation_flag = cooperation_flag;
|
||||
|
||||
eNB->pusch_config_dedicated[UE_id].betaOffset_ACK_Index = beta_ACK;
|
||||
eNB->pusch_config_dedicated[UE_id].betaOffset_RI_Index = beta_RI;
|
||||
@@ -700,7 +871,7 @@ int main(int argc, char **argv)
|
||||
UE2eNB->max_Doppler = maxDoppler;
|
||||
|
||||
// NN: N_RB_UL has to be defined in ulsim
|
||||
eNB->ulsch[0] = new_eNB_ulsch(max_turbo_iterations,N_RB_DL,0);
|
||||
for (int k=0;k<NUMBER_OF_UE_MAX;k++) eNB->ulsch[k] = new_eNB_ulsch(max_turbo_iterations,N_RB_DL,0);
|
||||
UE->ulsch[0] = new_ue_ulsch(N_RB_DL,0);
|
||||
|
||||
if (parallel_flag == 1) {
|
||||
@@ -751,7 +922,7 @@ int main(int argc, char **argv)
|
||||
|
||||
|
||||
UE->mac_enabled=0;
|
||||
|
||||
|
||||
eNB_rxtx_proc_t *proc_rxtx = &eNB->proc.proc_rxtx[subframe&1];
|
||||
UE_rxtx_proc_t *proc_rxtx_ue = &UE->proc.proc_rxtx[subframe&1];
|
||||
proc_rxtx->frame_rx=1;
|
||||
@@ -761,9 +932,9 @@ int main(int argc, char **argv)
|
||||
proc_rxtx->subframe_tx=pdcch_alloc2ul_subframe(&eNB->frame_parms,subframe);
|
||||
|
||||
proc_rxtx_ue->frame_tx = proc_rxtx->frame_rx;
|
||||
proc_rxtx_ue->frame_rx = proc_rxtx->frame_tx;
|
||||
proc_rxtx_ue->frame_rx = (subframe<4)?(proc_rxtx->frame_tx-1):(proc_rxtx->frame_tx);
|
||||
proc_rxtx_ue->subframe_tx = proc_rxtx->subframe_rx;
|
||||
proc_rxtx_ue->subframe_rx = proc_rxtx->subframe_tx;
|
||||
proc_rxtx_ue->subframe_rx = (proc_rxtx->subframe_tx+6)%10;
|
||||
|
||||
printf("Init UL hopping UE\n");
|
||||
init_ul_hopping(&UE->frame_parms);
|
||||
@@ -915,7 +1086,6 @@ int main(int argc, char **argv)
|
||||
reset_meas(&UE->ulsch_multiplexing_stats);
|
||||
|
||||
reset_meas(&eNB->phy_proc_rx);
|
||||
reset_meas(&eNB->ofdm_demod_stats);
|
||||
reset_meas(&eNB->ulsch_channel_estimation_stats);
|
||||
reset_meas(&eNB->ulsch_freq_offset_estimation_stats);
|
||||
reset_meas(&eNB->rx_dft_stats);
|
||||
@@ -932,7 +1102,7 @@ int main(int argc, char **argv)
|
||||
reset_meas(&eNB->ulsch_tc_intl1_stats);
|
||||
reset_meas(&eNB->ulsch_tc_intl2_stats);
|
||||
|
||||
// initialization
|
||||
// initialization
|
||||
struct list time_vector_tx;
|
||||
initialize(&time_vector_tx);
|
||||
struct list time_vector_tx_ifft;
|
||||
@@ -965,19 +1135,38 @@ int main(int argc, char **argv)
|
||||
round=0;
|
||||
|
||||
while (round < 4) {
|
||||
proc_rxtx->frame_rx=1;
|
||||
proc_rxtx->subframe_rx=subframe;
|
||||
|
||||
proc_rxtx->frame_tx=pdcch_alloc2ul_frame(&eNB->frame_parms,1,subframe);
|
||||
proc_rxtx->subframe_tx=pdcch_alloc2ul_subframe(&eNB->frame_parms,subframe);
|
||||
|
||||
proc_rxtx_ue->frame_tx = proc_rxtx->frame_rx;
|
||||
proc_rxtx_ue->frame_rx = (subframe<4)?(proc_rxtx->frame_tx-1):(proc_rxtx->frame_tx);
|
||||
proc_rxtx_ue->subframe_tx = proc_rxtx->subframe_rx;
|
||||
proc_rxtx_ue->subframe_rx = (proc_rxtx->subframe_tx+6)%10;
|
||||
|
||||
eNB->ulsch[0]->harq_processes[harq_pid]->round=round;
|
||||
UE->ulsch[0]->harq_processes[harq_pid]->round=round;
|
||||
// printf("Trial %d : Round %d (subframe %d, frame %d)\n",trials,round,proc_rxtx_ue->subframe_rx,proc_rxtx_ue->frame_rx);
|
||||
if (n_frames==1) printf("filling ulsch: Trial %d : Round %d (subframe %d, frame %d)\n",trials,round,proc_rxtx_ue->subframe_tx,proc_rxtx_ue->frame_tx);
|
||||
round_trials[round]++;
|
||||
|
||||
UL_req.sfn_sf = (1<<4)+subframe;
|
||||
if (n_frames==1) printf("filling ulsch: eNB prog frame %d, subframe %d (%d,%d)\n",proc_rxtx->frame_rx,subframe,sched_resp.frame,sched_resp.subframe);
|
||||
|
||||
fill_ulsch_dci(eNB,(void*)&UL_alloc_pdu,first_rb,nb_rb,mcs,ndi,cqi_flag);
|
||||
int modulation_type;
|
||||
if (mcs < 11) modulation_type = 2;
|
||||
else if (mcs < 21) modulation_type = 4;
|
||||
else if (mcs < 29) modulation_type = 6;
|
||||
|
||||
fill_ulsch_dci(eNB,proc_rxtx->frame_rx,subframe,&sched_resp,14,(void*)&UL_alloc_pdu,first_rb,nb_rb,(round==0)?mcs:(28+rvidx[round]),modulation_type,ndi,cqi_flag,beta_CQI,beta_RI,cqi_size);
|
||||
|
||||
UE->ulsch_Msg3_active[eNB_id] = 0;
|
||||
UE->ul_power_control_dedicated[eNB_id].accumulationEnabled=1;
|
||||
if (n_frames==1) printf("filling ulsch: ue prog SFN/SF %d/%d\n",proc_rxtx_ue->frame_rx,proc_rxtx_ue->subframe_rx);
|
||||
generate_ue_ulsch_params_from_dci((void *)&UL_alloc_pdu,
|
||||
14,
|
||||
proc_rxtx->subframe_tx,
|
||||
(subframe+6)%10,
|
||||
format0,
|
||||
UE,
|
||||
proc_rxtx_ue,
|
||||
@@ -988,17 +1177,11 @@ int main(int argc, char **argv)
|
||||
0,
|
||||
srs_flag);
|
||||
|
||||
generate_eNB_ulsch_params_from_dci(eNB,proc_rxtx,
|
||||
(void *)&UL_alloc_pdu,
|
||||
14,
|
||||
format0,
|
||||
0,
|
||||
SI_RNTI,
|
||||
0,
|
||||
P_RNTI,
|
||||
CBA_RNTI,
|
||||
srs_flag);
|
||||
eNB->ulsch[0]->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
|
||||
sched_resp.subframe=(subframe+6)%10;
|
||||
sched_resp.frame=(1024+eNB->proc.frame_rx+((subframe<4)?-1:0))&1023;
|
||||
|
||||
schedule_response(&sched_resp);
|
||||
|
||||
|
||||
/////////////////////
|
||||
if (abstx) {
|
||||
@@ -1020,6 +1203,9 @@ int main(int argc, char **argv)
|
||||
|
||||
eNB->proc.frame_rx = 1;
|
||||
eNB->proc.subframe_rx = subframe;
|
||||
ru->proc.frame_rx = 1;
|
||||
ru->proc.subframe_rx = subframe;
|
||||
|
||||
proc_rxtx_ue->frame_tx = proc_rxtx->frame_rx;
|
||||
proc_rxtx_ue->frame_rx = proc_rxtx->frame_tx;
|
||||
proc_rxtx_ue->subframe_tx = proc_rxtx->subframe_rx;
|
||||
@@ -1027,83 +1213,19 @@ int main(int argc, char **argv)
|
||||
|
||||
phy_procedures_UE_TX(UE,proc_rxtx_ue,0,0,normal_txrx,no_relay);
|
||||
|
||||
/*
|
||||
if (srs_flag)
|
||||
generate_srs_tx(UE,0,AMP,subframe);
|
||||
|
||||
generate_drs_pusch(UE,proc_rxtx_ue,0,
|
||||
AMP,subframe,
|
||||
UE->ulsch[0]->harq_processes[harq_pid]->first_rb,
|
||||
UE->ulsch[0]->harq_processes[harq_pid]->nb_rb,
|
||||
0);
|
||||
|
||||
if ((cqi_flag == 1) && (n_frames == 1) ) {
|
||||
printf("CQI information (O %d) %d %d\n",UE->ulsch[0]->O,
|
||||
UE->ulsch[0]->o[0],UE->ulsch[0]->o[1]);
|
||||
print_CQI(UE->ulsch[0]->o,UE->ulsch[0]->uci_format,UE->frame_parms.N_RB_DL,0);
|
||||
}
|
||||
|
||||
UE->ulsch[0]->o_ACK[0] = taus()&1;
|
||||
|
||||
start_meas(&UE->ulsch_encoding_stats);
|
||||
|
||||
if (ulsch_encoding(input_buffer,
|
||||
UE,
|
||||
harq_pid,
|
||||
eNB_id,
|
||||
2, // transmission mode
|
||||
control_only_flag,
|
||||
1// Nbundled
|
||||
)==-1) {
|
||||
printf("ulsim.c Problem with ulsch_encoding\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
stop_meas(&UE->ulsch_encoding_stats);
|
||||
|
||||
start_meas(&UE->ulsch_modulation_stats);
|
||||
ulsch_modulation(UE->common_vars.txdataF,AMP,
|
||||
proc_rxtx_ue->frame_tx,subframe,&UE->frame_parms,
|
||||
UE->ulsch[0]);
|
||||
stop_meas(&UE->ulsch_modulation_stats);
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
for (aa=0; aa<1; aa++) {
|
||||
if (frame_parms->Ncp == EXTENDED)
|
||||
PHY_ofdm_mod(&UE->common_vars.txdataF[aa][subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX], // input
|
||||
&txdata[aa][eNB->frame_parms.samples_per_tti*subframe], // output
|
||||
UE->frame_parms.ofdm_symbol_size,
|
||||
nsymb, // number of symbols
|
||||
UE->frame_parms.nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
else
|
||||
normal_prefix_mod(&UE->common_vars.txdataF[aa][subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],
|
||||
&txdata[aa][eNB->frame_parms.samples_per_tti*subframe],
|
||||
nsymb,
|
||||
frame_parms);
|
||||
|
||||
|
||||
apply_7_5_kHz(UE,UE->common_vars.txdata[aa],subframe<<1);
|
||||
apply_7_5_kHz(UE,UE->common_vars.txdata[aa],1+(subframe<<1));
|
||||
|
||||
*/
|
||||
|
||||
tx_lev = signal_energy(&UE->common_vars.txdata[0][eNB->frame_parms.samples_per_tti*subframe],
|
||||
eNB->frame_parms.samples_per_tti);
|
||||
|
||||
|
||||
|
||||
|
||||
if (n_frames==1) {
|
||||
write_output("txsigF0UL.m","txsF0", &UE->common_vars.txdataF[0][eNB->frame_parms.ofdm_symbol_size*nsymb*subframe],eNB->frame_parms.ofdm_symbol_size*nsymb,1,
|
||||
1);
|
||||
//write_output("txsigF1.m","txsF1", UE->common_vars.txdataF[0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
}
|
||||
|
||||
|
||||
} // input_fd == NULL
|
||||
|
||||
|
||||
tx_lev_dB = (unsigned int) dB_fixed_times10(tx_lev);
|
||||
|
||||
if (n_frames==1) {
|
||||
@@ -1113,11 +1235,11 @@ int main(int argc, char **argv)
|
||||
|
||||
//AWGN
|
||||
//Set target wideband RX noise level to N0
|
||||
sigma2_dB = N0;//10*log10((double)tx_lev) +10*log10(UE->frame_parms.ofdm_symbol_size/(UE->frame_parms.N_RB_DL*12)) - SNR;
|
||||
sigma2_dB = N0;//-10*log10(UE->frame_parms.ofdm_symbol_size/(UE->frame_parms.N_RB_DL*12));//10*log10((double)tx_lev) +10*log10(UE->frame_parms.ofdm_symbol_size/(UE->frame_parms.N_RB_DL*12)) - SNR;
|
||||
sigma2 = pow(10,sigma2_dB/10);
|
||||
|
||||
// compute tx_gain to achieve target SNR (per resource element!)
|
||||
tx_gain = sqrt(pow(10.0,.1*(N0+SNR))*(nb_rb*12/(double)UE->frame_parms.ofdm_symbol_size)/(double)tx_lev);
|
||||
tx_gain = sqrt(pow(10.0,.1*(N0+SNR))/(double)tx_lev);//*(nb_rb*12/(double)UE->frame_parms.ofdm_symbol_size)/(double)tx_lev);
|
||||
|
||||
|
||||
if (n_frames==1)
|
||||
@@ -1128,8 +1250,8 @@ int main(int argc, char **argv)
|
||||
for (i=0; i<OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
|
||||
for (aa=0; aa<eNB->frame_parms.nb_antennas_rx; aa++) {
|
||||
|
||||
((short*) &eNB->common_vars.rxdata[0][aa][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size])[2*i] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||
((short*) &eNB->common_vars.rxdata[0][aa][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size])[2*i+1] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||
((short*) &ru->common.rxdata[aa][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size])[2*i] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||
((short*) &ru->common.rxdata[aa][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size])[2*i+1] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1186,37 +1308,37 @@ int main(int argc, char **argv)
|
||||
|
||||
for (i=0; i<eNB->frame_parms.samples_per_tti; i++) {
|
||||
for (aa=0; aa<eNB->frame_parms.nb_antennas_rx; aa++) {
|
||||
((short*) &eNB->common_vars.rxdata[0][aa][eNB->frame_parms.samples_per_tti*subframe])[2*i] = (short) ((tx_gain*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
|
||||
((short*) &eNB->common_vars.rxdata[0][aa][eNB->frame_parms.samples_per_tti*subframe])[2*i+1] = (short) ((tx_gain*r_im[aa][i]) + (iqim*tx_gain*r_re[aa][i]) + sqrt(
|
||||
((short*) &ru->common.rxdata[aa][eNB->frame_parms.samples_per_tti*subframe])[2*i] = (short) ((tx_gain*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
|
||||
((short*) &ru->common.rxdata[aa][eNB->frame_parms.samples_per_tti*subframe])[2*i+1] = (short) ((tx_gain*r_im[aa][i]) + (iqim*tx_gain*r_re[aa][i]) + sqrt(
|
||||
sigma2/2)*gaussdouble(0.0,1.0));
|
||||
}
|
||||
}
|
||||
|
||||
if (n_frames==1) {
|
||||
if (n_frames<=10) {
|
||||
printf("rx_level Null symbol %f\n",10*log10((double)signal_energy((int*)
|
||||
&eNB->common_vars.rxdata[0][0][(eNB->frame_parms.samples_per_tti<<1) -eNB->frame_parms.ofdm_symbol_size],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2)));
|
||||
printf("rx_level data symbol %f\n",10*log10(signal_energy((int*)&eNB->common_vars.rxdata[0][0][160+(eNB->frame_parms.samples_per_tti*subframe)],
|
||||
&ru->common.rxdata[0][(eNB->frame_parms.samples_per_tti<<1) -eNB->frame_parms.ofdm_symbol_size],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2)));
|
||||
printf("rx_level data symbol %f\n",10*log10(signal_energy((int*)&ru->common.rxdata[0][160+(eNB->frame_parms.samples_per_tti*subframe)],
|
||||
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2)));
|
||||
}
|
||||
|
||||
SNRmeas = 10*log10(((double)signal_energy((int*)&eNB->common_vars.rxdata[0][0][160+(eNB->frame_parms.samples_per_tti*subframe)],
|
||||
SNRmeas = 10*log10(((double)signal_energy((int*)&ru->common.rxdata[0][160+(eNB->frame_parms.samples_per_tti*subframe)],
|
||||
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2))/((double)signal_energy((int*)
|
||||
&eNB->common_vars.rxdata[0][0][(eNB->frame_parms.samples_per_tti<<1) -eNB->frame_parms.ofdm_symbol_size],
|
||||
&ru->common.rxdata[0][(eNB->frame_parms.samples_per_tti<<1) -eNB->frame_parms.ofdm_symbol_size],
|
||||
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2)) - 1)+10*log10(eNB->frame_parms.N_RB_UL/nb_rb);
|
||||
|
||||
if (n_frames==1) {
|
||||
if (n_frames<=10) {
|
||||
printf("SNRmeas %f\n",SNRmeas);
|
||||
|
||||
// write_output("rxsig0UL.m","rxs0", &eNB->common_vars.rxdata[0][0][eNB->frame_parms.samples_per_tti*subframe],eNB->frame_parms.samples_per_tti,1,1);
|
||||
//write_output("rxsig1UL.m","rxs1", &eNB->common_vars.rxdata[0][0][eNB->frame_parms.samples_per_tti*subframe],eNB->frame_parms.samples_per_tti,1,1);
|
||||
write_output("rxsig0UL.m","rxs0", &ru->common.rxdata[0][eNB->frame_parms.samples_per_tti*subframe],eNB->frame_parms.samples_per_tti,1,1);
|
||||
// write_output("rxsig1UL.m","rxs1", &ru->common_vars.rxdata[0][eNB->frame_parms.samples_per_tti*subframe],eNB->frame_parms.samples_per_tti,1,1);
|
||||
}
|
||||
|
||||
|
||||
eNB->fep = (parallel_flag == 1) ? eNB_fep_full_2thread : eNB_fep_full;
|
||||
ru->feprx = (parallel_flag == 1) ? ru_fep_full_2thread : fep_full;
|
||||
eNB->td = (parallel_flag == 1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
|
||||
eNB->do_prach = NULL;
|
||||
|
||||
phy_procedures_eNB_common_RX(eNB,proc_rxtx);
|
||||
|
||||
ru->feprx(ru);
|
||||
phy_procedures_eNB_uespec_RX(eNB,proc_rxtx,no_relay);
|
||||
|
||||
|
||||
@@ -1249,10 +1371,10 @@ int main(int argc, char **argv)
|
||||
|
||||
// printf("ulsch_coding: O[%d] %d\n",i,o_flip[i]);
|
||||
|
||||
|
||||
|
||||
// if (ret <= eNB->ulsch[0]->max_turbo_iterations) {
|
||||
|
||||
if (eNB->ulsch[0]->harq_processes[harq_pid]->round == 0) {
|
||||
|
||||
if (eNB->ulsch[0]->harq_processes[harq_pid]->status == SCH_IDLE) {
|
||||
|
||||
// avg_iter += ret;
|
||||
iter_trials++;
|
||||
@@ -1264,7 +1386,7 @@ int main(int argc, char **argv)
|
||||
print_CQI(eNB->ulsch[0]->harq_processes[harq_pid]->o,
|
||||
eNB->ulsch[0]->harq_processes[harq_pid]->uci_format,0,eNB->frame_parms.N_RB_DL);
|
||||
|
||||
dump_ulsch(eNB,proc_rxtx,0);
|
||||
dump_ulsch(eNB,eNB->proc.frame_rx,subframe,0,round);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@@ -1293,18 +1415,17 @@ int main(int argc, char **argv)
|
||||
eNB->ulsch[0]->harq_processes[harq_pid]->c[s][i]^UE->ulsch[0]->harq_processes[harq_pid]->c[s][i]);
|
||||
}
|
||||
|
||||
dump_ulsch(eNB,proc_rxtx,0);
|
||||
exit(-1);
|
||||
dump_ulsch(eNB,eNB->proc.frame_rx,subframe,0,round);
|
||||
if (round == 4) exit(-1);
|
||||
}
|
||||
|
||||
// printf("round %d errors %d/%d\n",round,errs[round],trials);
|
||||
if (n_frames==1) printf("round %d errors %d/%d\n",round,errs[round],trials);
|
||||
round++;
|
||||
|
||||
if (n_frames==1) {
|
||||
printf("ULSCH in error in round %d\n",round);
|
||||
}
|
||||
} // ulsch error
|
||||
|
||||
|
||||
} // round
|
||||
|
||||
@@ -1324,7 +1445,7 @@ int main(int argc, char **argv)
|
||||
|
||||
|
||||
double t_rx = (double)eNB->phy_proc_rx.p_time/cpu_freq_GHz/1000.0;
|
||||
double t_rx_fft = (double)eNB->ofdm_demod_stats.p_time/cpu_freq_GHz/1000.0;
|
||||
double t_rx_fft = (double)ru->ofdm_demod_stats.p_time/cpu_freq_GHz/1000.0;
|
||||
double t_rx_demod = (double)eNB->ulsch_demodulation_stats.p_time/cpu_freq_GHz/1000.0;
|
||||
double t_rx_dec = (double)eNB->ulsch_decoding_stats.p_time/cpu_freq_GHz/1000.0;
|
||||
|
||||
@@ -1449,12 +1570,12 @@ int main(int argc, char **argv)
|
||||
tx_lev_dB,
|
||||
20*log10(tx_gain),
|
||||
(double)N0,
|
||||
eNB->measurements[0].n0_power_tot_dB,
|
||||
eNB->measurements.n0_power_tot_dB,
|
||||
get_hundred_times_delta_IF(UE,eNB_id,harq_pid) ,
|
||||
dB_fixed(eNB->pusch_vars[0]->ulsch_power[0]),
|
||||
dB_fixed(eNB->pusch_vars[0]->ulsch_power[1]),
|
||||
eNB->measurements->n0_power_dB[0],
|
||||
eNB->measurements->n0_power_dB[1]);
|
||||
eNB->measurements.n0_power_dB[0],
|
||||
eNB->measurements.n0_power_dB[1]);
|
||||
|
||||
effective_rate = ((double)(round_trials[0])/((double)round_trials[0] + round_trials[1] + round_trials[2] + round_trials[3]));
|
||||
|
||||
@@ -1548,10 +1669,10 @@ int main(int argc, char **argv)
|
||||
printf("Total PHY proc rx :%f us (%d trials)\n",(double)eNB->phy_proc_rx.diff/eNB->phy_proc_rx.trials/cpu_freq_GHz/1000.0,eNB->phy_proc_rx.trials);
|
||||
printf("|__ Statistcs std: %fus max: %fus min: %fus median %fus q1 %fus q3 %fus n_dropped: %d packet \n", std_phy_proc_rx, t_rx_max, t_rx_min, rx_median, rx_q1, rx_q3,
|
||||
n_rx_dropped);
|
||||
std_phy_proc_rx_fft = sqrt((double)eNB->ofdm_demod_stats.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
|
||||
2)/eNB->ofdm_demod_stats.trials - pow((double)eNB->ofdm_demod_stats.diff/eNB->ofdm_demod_stats.trials/cpu_freq_GHz/1000,2));
|
||||
printf("OFDM_demod time :%f us (%d trials)\n",(double)eNB->ofdm_demod_stats.diff/eNB->ofdm_demod_stats.trials/cpu_freq_GHz/1000.0,
|
||||
eNB->ofdm_demod_stats.trials);
|
||||
std_phy_proc_rx_fft = sqrt((double)ru->ofdm_demod_stats.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
|
||||
2)/ru->ofdm_demod_stats.trials - pow((double)ru->ofdm_demod_stats.diff/ru->ofdm_demod_stats.trials/cpu_freq_GHz/1000,2));
|
||||
printf("OFDM_demod time :%f us (%d trials)\n",(double)ru->ofdm_demod_stats.diff/ru->ofdm_demod_stats.trials/cpu_freq_GHz/1000.0,
|
||||
ru->ofdm_demod_stats.trials);
|
||||
printf("|__ Statistcs std: %fus median %fus q1 %fus q3 %fus \n", std_phy_proc_rx_fft, rx_fft_median, rx_fft_q1, rx_fft_q3);
|
||||
std_phy_proc_rx_demod = sqrt((double)eNB->ulsch_demodulation_stats.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
|
||||
2)/eNB->ulsch_demodulation_stats.trials - pow((double)eNB->ulsch_demodulation_stats.diff/eNB->ulsch_demodulation_stats.trials/cpu_freq_GHz/1000,2));
|
||||
@@ -1672,7 +1793,7 @@ int main(int argc, char **argv)
|
||||
UE->ulsch_modulation_stats.trials,
|
||||
UE->ulsch_encoding_stats.trials,
|
||||
eNB->phy_proc_rx.trials,
|
||||
eNB->ofdm_demod_stats.trials,
|
||||
ru->ofdm_demod_stats.trials,
|
||||
eNB->ulsch_demodulation_stats.trials,
|
||||
eNB->ulsch_decoding_stats.trials
|
||||
);
|
||||
@@ -1682,7 +1803,7 @@ int main(int argc, char **argv)
|
||||
get_time_meas_us(&UE->ulsch_modulation_stats),
|
||||
get_time_meas_us(&UE->ulsch_encoding_stats),
|
||||
get_time_meas_us(&eNB->phy_proc_rx),
|
||||
get_time_meas_us(&eNB->ofdm_demod_stats),
|
||||
get_time_meas_us(&ru->ofdm_demod_stats),
|
||||
get_time_meas_us(&eNB->ulsch_demodulation_stats),
|
||||
get_time_meas_us(&eNB->ulsch_decoding_stats)
|
||||
);
|
||||
@@ -1733,7 +1854,7 @@ int main(int argc, char **argv)
|
||||
|
||||
|
||||
oai_exit=1;
|
||||
pthread_cond_signal(&eNB->proc.cond_fep);
|
||||
pthread_cond_signal(&ru->proc.cond_fep);
|
||||
|
||||
if (abstx) { // ABSTRACTION
|
||||
fprintf(csv_fdUL,"];");
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_mac.c
|
||||
* \brief FlexRAN agent message handler for MAC layer
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
#include "log.h"
|
||||
|
||||
extern int flexran_get_harq_round(mid_t mod_id, uint8_t cc_id, mid_t ue_id);
|
||||
|
||||
/*Flags showing if a mac agent has already been registered*/
|
||||
unsigned int mac_agent_registered[NUM_MAX_ENB];
|
||||
@@ -54,7 +55,7 @@ struct lfds700_ringbuffer_element *dl_mac_config_array[NUM_MAX_ENB];
|
||||
struct lfds700_ringbuffer_state ringbuffer_state[NUM_MAX_ENB];
|
||||
|
||||
|
||||
int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
const report_config_t *report_config,
|
||||
Protocol__FlexUeStatsReport **ue_report,
|
||||
Protocol__FlexCellStatsReport **cell_report) {
|
||||
@@ -62,13 +63,13 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
|
||||
// Protocol__FlexHeader *header;
|
||||
int i, j, k;
|
||||
// int cc_id = 0;
|
||||
int cc_id = 0;
|
||||
int enb_id = mod_id;
|
||||
|
||||
/* Allocate memory for list of UE reports */
|
||||
if (report_config->nr_ue > 0) {
|
||||
|
||||
|
||||
|
||||
for (i = 0; i < report_config->nr_ue; i++) {
|
||||
|
||||
|
||||
@@ -76,24 +77,24 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
/* Check flag for creation of buffer status report */
|
||||
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_BSR) {
|
||||
//TODO should be automated
|
||||
ue_report[i]->n_bsr = 4;
|
||||
ue_report[i]->n_bsr = 4;
|
||||
uint32_t *elem;
|
||||
elem = (uint32_t *) malloc(sizeof(uint32_t)*ue_report[i]->n_bsr);
|
||||
if (elem == NULL)
|
||||
goto error;
|
||||
for (j = 0; j < ue_report[i]->n_bsr; j++) {
|
||||
// NN: we need to know the cc_id here, consider the first one
|
||||
// NN: we need to know the cc_id here, consider the first one
|
||||
elem[j] = flexran_get_ue_bsr_ul_buffer_info (enb_id, i, j);
|
||||
}
|
||||
|
||||
|
||||
ue_report[i]->bsr = elem;
|
||||
}
|
||||
|
||||
|
||||
/* Check flag for creation of PHR report */
|
||||
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PHR) {
|
||||
ue_report[i]->phr = flexran_get_ue_phr (enb_id, i); // eNB_UE_list->UE_template[UE_PCCID(enb_id,i)][i].phr_info;
|
||||
ue_report[i]->has_phr = 1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Check flag for creation of RLC buffer status report */
|
||||
@@ -134,19 +135,19 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
if (ue_report[i]->n_rlc_report > 0)
|
||||
ue_report[i]->rlc_report = rlc_reports;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Check flag for creation of MAC CE buffer status report */
|
||||
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_MAC_CE_BS) {
|
||||
// TODO: Fill in the actual MAC CE buffer status report
|
||||
ue_report[i]->pending_mac_ces = (flexran_get_MAC_CE_bitmap_TA(enb_id,i,0) | (0 << 1) | (0 << 2) | (0 << 3)) & 15;
|
||||
ue_report[i]->pending_mac_ces = (flexran_get_MAC_CE_bitmap_TA(enb_id,i,0) | (0 << 1) | (0 << 2) | (0 << 3)) & 15;
|
||||
// Use as bitmap. Set one or more of the; /* Use as bitmap. Set one or more of the
|
||||
// PROTOCOL__FLEX_CE_TYPE__FLPCET_ values
|
||||
// found in stats_common.pb-c.h. See
|
||||
// flex_ce_type in FlexRAN specification
|
||||
// flex_ce_type in FlexRAN specification
|
||||
ue_report[i]->has_pending_mac_ces = 1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Check flag for creation of DL CQI report */
|
||||
@@ -167,7 +168,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
Protocol__FlexDlCsi **csi_reports;
|
||||
csi_reports = malloc(sizeof(Protocol__FlexDlCsi *)*dl_report->n_csi_report);
|
||||
if (csi_reports == NULL)
|
||||
goto error;
|
||||
goto error;
|
||||
for (j = 0; j < dl_report->n_csi_report; j++) {
|
||||
|
||||
csi_reports[j] = malloc(sizeof(Protocol__FlexDlCsi));
|
||||
@@ -211,18 +212,18 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
if (csi11 == NULL)
|
||||
goto error;
|
||||
protocol__flex_csi_p11__init(csi11);
|
||||
|
||||
csi11->wb_cqi = malloc(sizeof(csi11->wb_cqi));
|
||||
|
||||
csi11->wb_cqi = malloc(sizeof(csi11->wb_cqi));
|
||||
csi11->n_wb_cqi = 1;
|
||||
csi11->wb_cqi[0] = flexran_get_ue_wcqi (enb_id, i);
|
||||
// According To spec 36.213
|
||||
|
||||
csi11->wb_cqi[0] = flexran_get_ue_wcqi (enb_id, i);
|
||||
// According To spec 36.213
|
||||
|
||||
if (flexran_get_antenna_ports(enb_id, j) == 2 && csi_reports[j]->ri == 1) {
|
||||
// TODO PMI
|
||||
csi11->wb_pmi = flexran_get_ue_wpmi(enb_id, i, 0);
|
||||
csi11->has_wb_pmi = 1;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
else if (flexran_get_antenna_ports(enb_id, j) == 2 && csi_reports[j]->ri == 2){
|
||||
// TODO PMI
|
||||
@@ -239,14 +240,14 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
|
||||
}
|
||||
|
||||
csi11->has_wb_pmi = 0;
|
||||
csi11->has_wb_pmi = 0;
|
||||
|
||||
csi_reports[j]->p11csi = csi11;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_P20CSI){
|
||||
@@ -256,16 +257,16 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
if (csi20 == NULL)
|
||||
goto error;
|
||||
protocol__flex_csi_p20__init(csi20);
|
||||
|
||||
csi20->wb_cqi = flexran_get_ue_wcqi (enb_id, i);
|
||||
|
||||
csi20->wb_cqi = flexran_get_ue_wcqi (enb_id, i);
|
||||
csi20->has_wb_cqi = 1;
|
||||
|
||||
|
||||
|
||||
csi20->bandwidth_part_index = 1 ;//TODO
|
||||
csi20->has_bandwidth_part_index = 1;
|
||||
|
||||
csi20->sb_index = 1 ;//TODO
|
||||
csi20->has_sb_index = 1 ;
|
||||
csi20->has_sb_index = 1 ;
|
||||
|
||||
|
||||
csi_reports[j]->p20csi = csi20;
|
||||
@@ -280,20 +281,20 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
// if (csi21 == NULL)
|
||||
// goto error;
|
||||
// protocol__flex_csi_p21__init(csi21);
|
||||
|
||||
// csi21->wb_cqi = flexran_get_ue_wcqi (enb_id, i);
|
||||
|
||||
|
||||
|
||||
// csi21->wb_cqi = flexran_get_ue_wcqi (enb_id, i);
|
||||
|
||||
|
||||
// csi21->wb_pmi = flexran_get_ue_pmi(enb_id); //TDO inside
|
||||
// csi21->has_wb_pmi = 1;
|
||||
|
||||
// csi21->sb_cqi = 1; // TODO
|
||||
|
||||
// csi21->sb_cqi = 1; // TODO
|
||||
|
||||
// csi21->bandwidth_part_index = 1 ; //TDO inside
|
||||
// csi21->has_bandwidth_part_index = 1 ;
|
||||
// csi21->has_bandwidth_part_index = 1 ;
|
||||
|
||||
// csi21->sb_index = 1 ;//TODO
|
||||
// csi21->has_sb_index = 1 ;
|
||||
// csi21->has_sb_index = 1 ;
|
||||
|
||||
|
||||
// csi_reports[j]->p20csi = csi21;
|
||||
@@ -308,10 +309,10 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
// if (csi12 == NULL)
|
||||
// goto error;
|
||||
// protocol__flex_csi_a12__init(csi12);
|
||||
|
||||
// csi12->wb_cqi = flexran_get_ue_wcqi (enb_id, i);
|
||||
|
||||
// csi12->sb_pmi = 1 ; //TODO inside
|
||||
|
||||
// csi12->wb_cqi = flexran_get_ue_wcqi (enb_id, i);
|
||||
|
||||
// csi12->sb_pmi = 1 ; //TODO inside
|
||||
|
||||
// TODO continou
|
||||
}
|
||||
@@ -323,18 +324,18 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
// if (csi22 == NULL)
|
||||
// goto error;
|
||||
// protocol__flex_csi_a22__init(csi22);
|
||||
|
||||
// csi22->wb_cqi = flexran_get_ue_wcqi (enb_id, i);
|
||||
|
||||
// csi22->sb_cqi = 1 ; //TODO inside
|
||||
|
||||
// csi22->wb_pmi = flexran_get_ue_wcqi (enb_id, i);
|
||||
// csi22->has_wb_pmi = 1;
|
||||
|
||||
// csi22->sb_pmi = 1 ; //TODO inside
|
||||
// csi22->wb_cqi = flexran_get_ue_wcqi (enb_id, i);
|
||||
|
||||
// csi22->sb_cqi = 1 ; //TODO inside
|
||||
|
||||
// csi22->wb_pmi = flexran_get_ue_wcqi (enb_id, i);
|
||||
// csi22->has_wb_pmi = 1;
|
||||
|
||||
// csi22->sb_list = flexran_get_ue_wcqi (enb_id, i);
|
||||
// csi22->sb_pmi = 1 ; //TODO inside
|
||||
// csi22->has_wb_pmi = 1;
|
||||
|
||||
// csi22->sb_list = flexran_get_ue_wcqi (enb_id, i);
|
||||
|
||||
|
||||
}
|
||||
@@ -347,10 +348,10 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
// goto error;
|
||||
// protocol__flex_csi_a20__init(csi20);
|
||||
|
||||
// csi20->wb_cqi = flexran_get_ue_wcqi (enb_id, i);
|
||||
// csi20->wb_cqi = flexran_get_ue_wcqi (enb_id, i);
|
||||
// csi20->has_wb_cqi = 1;
|
||||
|
||||
// csi20>sb_cqi = 1 ; //TODO inside
|
||||
// csi20>sb_cqi = 1 ; //TODO inside
|
||||
// csi20>has_sb_cqi = 1 ;
|
||||
|
||||
// csi20->sb_list = 1; // TODO inside
|
||||
@@ -371,7 +372,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
dl_report->csi_report = csi_reports;
|
||||
//Add the DL CQI report to the stats report
|
||||
ue_report[i]->dl_cqi_report = dl_report;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Check flag for creation of paging buffer status report */
|
||||
@@ -463,7 +464,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
//TODO: Set the servCellIndex for this report
|
||||
ul_report[j]->serv_cell_index = 0;
|
||||
ul_report[j]->has_serv_cell_index = 1;
|
||||
|
||||
|
||||
//Set the list of UL reports of this UE to the full UL report
|
||||
full_ul_report->cqi_meas = ul_report;
|
||||
|
||||
@@ -487,24 +488,119 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
}
|
||||
// Add full UL CQI report to the UE report
|
||||
ue_report[i]->ul_cqi_report = full_ul_report;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_MAC_STATS) {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Protocol__FlexMacStats *macstats;
|
||||
macstats = malloc(sizeof(Protocol__FlexMacStats));
|
||||
if (macstats == NULL)
|
||||
goto error;
|
||||
protocol__flex_mac_stats__init(macstats);
|
||||
|
||||
|
||||
macstats->total_bytes_sdus_dl = flexran_get_total_size_dl_mac_sdus(mod_id, i, cc_id);
|
||||
macstats->has_total_bytes_sdus_dl = 1;
|
||||
|
||||
macstats->total_bytes_sdus_ul = flexran_get_total_size_ul_mac_sdus(mod_id, i, cc_id);
|
||||
macstats->has_total_bytes_sdus_ul = 1;
|
||||
|
||||
macstats->tbs_dl = flexran_get_TBS_dl(mod_id, i, cc_id);
|
||||
macstats->has_tbs_dl = 1;
|
||||
|
||||
macstats->tbs_ul = flexran_get_TBS_ul(mod_id, i, cc_id);
|
||||
macstats->has_tbs_ul = 1;
|
||||
|
||||
macstats->prb_retx_dl = flexran_get_num_prb_retx_dl_per_ue(mod_id, i, cc_id);
|
||||
macstats->has_prb_retx_dl = 1;
|
||||
|
||||
macstats->prb_retx_ul = flexran_get_num_prb_retx_ul_per_ue(mod_id, i, cc_id);
|
||||
macstats->has_prb_retx_ul = 1;
|
||||
|
||||
macstats->prb_dl = flexran_get_num_prb_dl_tx_per_ue(mod_id, i, cc_id);
|
||||
macstats->has_prb_dl = 1;
|
||||
|
||||
macstats->prb_ul = flexran_get_num_prb_ul_rx_per_ue(mod_id, i, cc_id);
|
||||
macstats->has_prb_ul = 1;
|
||||
|
||||
macstats->mcs1_dl = flexran_get_mcs1_dl(mod_id, i, cc_id);
|
||||
macstats->has_mcs1_dl = 1;
|
||||
|
||||
macstats->mcs2_dl = flexran_get_mcs2_dl(mod_id, i, cc_id);
|
||||
macstats->has_mcs2_dl = 1;
|
||||
|
||||
macstats->mcs1_ul = flexran_get_mcs1_ul(mod_id, i, cc_id);
|
||||
macstats->has_mcs1_ul = 1;
|
||||
|
||||
macstats->mcs2_ul = flexran_get_mcs2_ul(mod_id, i, cc_id);
|
||||
macstats->has_mcs2_ul = 1;
|
||||
|
||||
macstats->total_prb_dl = flexran_get_total_prb_dl_tx_per_ue(mod_id, i, cc_id);
|
||||
macstats->has_total_prb_dl = 1;
|
||||
|
||||
macstats->total_prb_ul = flexran_get_total_prb_ul_rx_per_ue(mod_id, i, cc_id);
|
||||
macstats->has_total_prb_ul = 1;
|
||||
|
||||
macstats->total_pdu_dl = flexran_get_total_num_pdu_dl(mod_id, i, cc_id);
|
||||
macstats->has_total_pdu_dl = 1;
|
||||
|
||||
macstats->total_pdu_ul = flexran_get_total_num_pdu_ul(mod_id, i, cc_id);
|
||||
macstats->has_total_pdu_ul = 1;
|
||||
|
||||
macstats->total_tbs_dl = flexran_get_total_TBS_dl(mod_id, i, cc_id);
|
||||
macstats->has_total_tbs_dl = 1;
|
||||
|
||||
macstats->total_tbs_ul = flexran_get_total_TBS_ul(mod_id, i, cc_id);
|
||||
macstats->has_total_tbs_ul = 1;
|
||||
|
||||
macstats->harq_round = flexran_get_harq_round(mod_id, cc_id, i);
|
||||
macstats->has_harq_round = 1;
|
||||
|
||||
Protocol__FlexMacSdusDl ** mac_sdus;
|
||||
mac_sdus = malloc(sizeof(Protocol__FlexMacSdusDl) * flexran_get_num_mac_sdu_tx(mod_id, i, cc_id));
|
||||
if (mac_sdus == NULL)
|
||||
goto error;
|
||||
|
||||
macstats->n_mac_sdus_dl = flexran_get_num_mac_sdu_tx(mod_id, i, cc_id);
|
||||
|
||||
for (j = 0; j < macstats->n_mac_sdus_dl; j++){
|
||||
|
||||
|
||||
mac_sdus[j] = malloc(sizeof(Protocol__FlexMacSdusDl));
|
||||
protocol__flex_mac_sdus_dl__init(mac_sdus[j]);
|
||||
|
||||
mac_sdus[j]->lcid = flexran_get_mac_sdu_lcid_index(mod_id, i, cc_id, j);
|
||||
mac_sdus[j]->has_lcid = 1;
|
||||
|
||||
mac_sdus[j]->sdu_length = flexran_get_mac_sdu_size(mod_id, i, cc_id, mac_sdus[j]->lcid);
|
||||
mac_sdus[j]->has_sdu_length = 1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
macstats->mac_sdus_dl = mac_sdus;
|
||||
|
||||
|
||||
ue_report[i]->mac_stats = macstats;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Allocate memory for list of cell reports */
|
||||
if (report_config->nr_cc > 0) {
|
||||
|
||||
|
||||
|
||||
|
||||
// Fill in the Cell reports
|
||||
for (i = 0; i < report_config->nr_cc; i++) {
|
||||
|
||||
@@ -532,10 +628,10 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
cell_report[i]->noise_inter_report = ni_report;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -740,9 +836,9 @@ int flexran_agent_mac_destroy_sr_info(Protocol__FlexranMessage *msg) {
|
||||
int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
|
||||
Protocol__FlexHeader *header = NULL;
|
||||
int i, j, UE_id;
|
||||
|
||||
|
||||
int available_harq[NUMBER_OF_UE_MAX];
|
||||
|
||||
|
||||
const int xid = *((int *)params);
|
||||
|
||||
|
||||
@@ -764,12 +860,12 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
|
||||
}
|
||||
|
||||
int ahead_of_time = 0;
|
||||
|
||||
|
||||
frame = (frame_t) flexran_get_current_system_frame_num(mod_id);
|
||||
subframe = (sub_frame_t) flexran_get_current_subframe(mod_id);
|
||||
|
||||
subframe = ((subframe + ahead_of_time) % 10);
|
||||
|
||||
|
||||
if (subframe < flexran_get_current_subframe(mod_id)) {
|
||||
frame = (frame + 1) % 1024;
|
||||
}
|
||||
@@ -792,7 +888,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// LOG_I(FLEXRAN_AGENT, "Sending subframe trigger for frame %d and subframe %d\n", flexran_get_current_frame(mod_id), (flexran_get_current_subframe(mod_id) + 1) % 10);
|
||||
|
||||
@@ -825,8 +921,8 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
|
||||
// uint8_t harq_id;
|
||||
//uint8_t harq_status;
|
||||
// flexran_get_harq(mod_id, UE_PCCID(mod_id,i), i, frame, subframe, &harq_id, &harq_status);
|
||||
|
||||
|
||||
|
||||
|
||||
dl_info[i]->harq_process_id = available_harq[UE_id];
|
||||
if (RC.mac && RC.mac[mod_id])
|
||||
RC.mac[mod_id]->UE_list.eNB_UE_stats[UE_PCCID(mod_id,i)][UE_id].harq_pid = 0;
|
||||
@@ -915,7 +1011,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
|
||||
for (i = 0; i < sf_trigger_msg->n_dl_info; i++) {
|
||||
free(sf_trigger_msg->dl_info[i]->harq_status);
|
||||
}
|
||||
free(sf_trigger_msg->dl_info);
|
||||
free(sf_trigger_msg->dl_info);
|
||||
free(sf_trigger_msg->ul_info);
|
||||
free(sf_trigger_msg);
|
||||
}
|
||||
@@ -1089,7 +1185,7 @@ int flexran_agent_mac_destroy_ul_config(Protocol__FlexranMessage *msg) {
|
||||
free(msg->ul_mac_config_msg->header);
|
||||
for (i = 0; i < msg->ul_mac_config_msg->n_ul_ue_data; i++) {
|
||||
// TODO uplink rlc ...
|
||||
// free(msg->ul_mac_config_msg->dl_ue_data[i]->ce_bitmap);
|
||||
// free(msg->ul_mac_config_msg->dl_ue_data[i]->ce_bitmap);
|
||||
// for (j = 0; j < msg->ul_mac_config_msg->ul_ue_data[i]->n_rlc_pdu; j++) {
|
||||
// for (k = 0; k < msg->ul_mac_config_msg->ul_ue_data[i]->rlc_pdu[j]->n_rlc_pdu_tb; k++) {
|
||||
// free(msg->ul_mac_config_msg->dl_ue_data[i]->rlc_pdu[j]->rlc_pdu_tb[k]);
|
||||
@@ -1107,7 +1203,7 @@ int flexran_agent_mac_destroy_ul_config(Protocol__FlexranMessage *msg) {
|
||||
// free(msg->ul_mac_config_msg->ul_ue_data[i]);
|
||||
}
|
||||
free(msg->ul_mac_config_msg->ul_ue_data);
|
||||
|
||||
|
||||
free(msg->ul_mac_config_msg);
|
||||
free(msg);
|
||||
|
||||
@@ -1121,10 +1217,10 @@ int flexran_agent_mac_destroy_ul_config(Protocol__FlexranMessage *msg) {
|
||||
void flexran_agent_get_pending_dl_mac_config(mid_t mod_id, Protocol__FlexranMessage **msg) {
|
||||
|
||||
struct lfds700_misc_prng_state ls;
|
||||
|
||||
|
||||
LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE;
|
||||
lfds700_misc_prng_init(&ls);
|
||||
|
||||
|
||||
if (lfds700_ringbuffer_read(&ringbuffer_state[mod_id], NULL, (void **) msg, &ls) == 0) {
|
||||
*msg = NULL;
|
||||
}
|
||||
@@ -1135,10 +1231,10 @@ int flexran_agent_mac_handle_dl_mac_config(mid_t mod_id, const void *params, Pro
|
||||
struct lfds700_misc_prng_state ls;
|
||||
enum lfds700_misc_flag overwrite_occurred_flag;
|
||||
Protocol__FlexranMessage *overwritten_dl_config;
|
||||
|
||||
|
||||
LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE;
|
||||
lfds700_misc_prng_init(&ls);
|
||||
|
||||
|
||||
lfds700_ringbuffer_write( &ringbuffer_state[mod_id],
|
||||
NULL,
|
||||
(void *) params,
|
||||
@@ -1252,7 +1348,7 @@ int flexran_agent_register_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface) {
|
||||
xface->flexran_agent_send_sf_trigger = flexran_agent_send_sf_trigger;
|
||||
//xface->flexran_agent_send_update_mac_stats = flexran_agent_send_update_mac_stats;
|
||||
xface->flexran_agent_get_pending_dl_mac_config = flexran_agent_get_pending_dl_mac_config;
|
||||
|
||||
|
||||
xface->dl_scheduler_loaded_lib = NULL;
|
||||
xface->ul_scheduler_loaded_lib = NULL;
|
||||
mac_agent_registered[mod_id] = 1;
|
||||
|
||||
@@ -269,3 +269,39 @@ message flex_pdcp_stats {
|
||||
|
||||
optional uint64 sfn=17;
|
||||
}
|
||||
|
||||
//
|
||||
// MAC Stats
|
||||
//
|
||||
|
||||
message flex_mac_stats {
|
||||
|
||||
optional uint32 tbs_dl = 1;
|
||||
optional uint32 tbs_ul = 2;
|
||||
optional uint32 prb_retx_dl = 3;
|
||||
optional uint32 prb_retx_ul = 4;
|
||||
optional uint32 prb_dl = 5;
|
||||
optional uint32 prb_ul = 6;
|
||||
optional uint32 mcs1_dl = 7;
|
||||
optional uint32 mcs2_dl = 8;
|
||||
optional uint32 mcs1_ul = 9;
|
||||
optional uint32 mcs2_ul = 10;
|
||||
optional uint32 total_bytes_sdus_ul = 11;
|
||||
optional uint32 total_bytes_sdus_dl = 12;
|
||||
optional uint32 total_prb_retx_dl = 13;
|
||||
optional uint32 total_prb_retx_ul = 14;
|
||||
optional uint32 total_prb_dl = 15;
|
||||
optional uint32 total_prb_ul = 16;
|
||||
optional uint32 total_pdu_dl = 17;
|
||||
optional uint32 total_pdu_ul = 18;
|
||||
optional uint32 total_tbs_dl = 19;
|
||||
optional uint32 total_tbs_ul = 20;
|
||||
repeated flex_mac_sdus_dl mac_sdus_dl = 21;
|
||||
optional uint32 harq_round = 22;
|
||||
}
|
||||
|
||||
message flex_mac_sdus_dl {
|
||||
|
||||
optional uint32 sdu_length = 1;
|
||||
optional uint32 lcid = 2;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,8 @@ message flex_ue_stats_report {
|
||||
optional flex_paging_buffer_report pbr = 8;
|
||||
optional flex_ul_cqi_report ul_cqi_report = 9;
|
||||
optional flex_rrc_measurements rrc_measurements = 10;
|
||||
optional flex_pdcp_stats pdcp_stats = 11;
|
||||
optional flex_pdcp_stats pdcp_stats = 11;
|
||||
optional flex_mac_stats mac_stats = 12;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -85,9 +86,11 @@ enum flex_ue_stats_type {
|
||||
FLUST_DL_CQI = 16;
|
||||
FLUST_PBS = 32;
|
||||
FLUST_UL_CQI = 64;
|
||||
FLUST_MAC_STATS = 128;
|
||||
|
||||
FLUST_PDCP_STATS = 1024;
|
||||
FLUST_RRC_MEASUREMENTS = 65536;
|
||||
// To be extended with more types of stats
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -175,10 +175,6 @@ typedef enum {
|
||||
|
||||
|
||||
|
||||
static int DEFBANDS[] = {7};
|
||||
static int DEFENBS[] = {0};
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* RU configuration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
|
||||
@@ -132,7 +132,7 @@ int8_t flexran_get_ue_phr(mid_t mod_id, mid_t ue_id)
|
||||
uint8_t flexran_get_ue_wcqi(mid_t mod_id, mid_t ue_id)
|
||||
{
|
||||
if (!phy_is_present(mod_id, 0)) return 0;
|
||||
return RC.eNB[mod_id][0]->UE_stats[ue_id].DL_cqi[0];
|
||||
return RC.mac[mod_id]->UE_list.UE_sched_ctrl[ue_id].dl_cqi[0];
|
||||
}
|
||||
|
||||
rlc_buffer_occupancy_t flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id)
|
||||
@@ -188,12 +188,145 @@ int32_t flexran_get_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id)
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t flexran_get_total_size_dl_mac_sdus(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].total_sdu_bytes;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_total_size_ul_mac_sdus(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->eNB_stats[cc_id].total_ulsch_bytes_rx;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_TBS_dl(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].TBS;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_TBS_ul(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].ulsch_TBS;
|
||||
}
|
||||
|
||||
uint16_t flexran_get_num_prb_retx_dl_per_ue(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].rbs_used_retx;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_num_prb_retx_ul_per_ue(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].rbs_used_retx_rx;
|
||||
}
|
||||
|
||||
uint16_t flexran_get_num_prb_dl_tx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].rbs_used;
|
||||
}
|
||||
|
||||
uint16_t flexran_get_num_prb_ul_rx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].rbs_used_rx;
|
||||
}
|
||||
|
||||
uint8_t flexran_get_ue_wpmi(mid_t mod_id, mid_t ue_id, uint8_t cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.UE_sched_ctrl[ue_id].periodic_wideband_pmi[cc_id];
|
||||
}
|
||||
|
||||
uint8_t flexran_get_mcs1_dl(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].dlsch_mcs1;
|
||||
}
|
||||
|
||||
uint8_t flexran_get_mcs2_dl(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].dlsch_mcs2;
|
||||
}
|
||||
|
||||
uint8_t flexran_get_mcs1_ul(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].ulsch_mcs1;
|
||||
}
|
||||
|
||||
uint8_t flexran_get_mcs2_ul(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].ulsch_mcs2;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_total_prb_dl_tx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].total_rbs_used;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_total_prb_ul_rx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].total_rbs_used_rx;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_total_num_pdu_dl(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].total_num_pdus;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_total_num_pdu_ul(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].total_num_pdus_rx;
|
||||
}
|
||||
|
||||
uint64_t flexran_get_total_TBS_dl(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].total_pdu_bytes;
|
||||
}
|
||||
|
||||
uint64_t flexran_get_total_TBS_ul(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].total_ulsch_TBS;
|
||||
}
|
||||
|
||||
int flexran_get_harq_round(mid_t mod_id, uint8_t cc_id, mid_t ue_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].harq_round;
|
||||
}
|
||||
|
||||
uint32_t flexran_get_num_mac_sdu_tx(mid_t mod_id, mid_t ue_id, int cc_id)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].num_mac_sdu_tx;
|
||||
}
|
||||
|
||||
unsigned char flexran_get_mac_sdu_lcid_index(mid_t mod_id, mid_t ue_id, int cc_id, int index)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].lcid_sdu[index];
|
||||
}
|
||||
|
||||
uint32_t flexran_get_mac_sdu_size(mid_t mod_id, mid_t ue_id, int cc_id, int lcid)
|
||||
{
|
||||
if (!mac_is_present(mod_id)) return 0;
|
||||
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].sdu_length_tx[lcid];
|
||||
}
|
||||
|
||||
|
||||
/* TODO needs to be revised */
|
||||
void flexran_update_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id)
|
||||
{
|
||||
|
||||
@@ -107,6 +107,81 @@ void flexran_update_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id); */
|
||||
/* this function is broken */
|
||||
int flexran_get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
|
||||
|
||||
/*Get number of mac SDU DL*/
|
||||
uint32_t flexran_get_num_mac_sdu_tx(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Return the MAC sdu size got from logical channel lcid */
|
||||
uint32_t flexran_get_mac_sdu_size(mid_t mod_id, mid_t ue_id, int cc_id, int lcid);
|
||||
|
||||
/*Return number of MAC SDUs obtained in MAC layer*/
|
||||
uint32_t flexran_get_num_mac_sdu_tx(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get mac sdu lcid index*/
|
||||
unsigned char flexran_get_mac_sdu_lcid_index(mid_t mod_id, mid_t ue_id, int cc_id, int index);
|
||||
|
||||
/*Get MAC size sdus length dl*/
|
||||
uint32_t flexran_get_size_dl_mac_sdus(mid_t mod_id, int cc_id);
|
||||
|
||||
/*Get MAC size sdus length ul */
|
||||
uint32_t flexran_get_size_ul_mac_sdus(mid_t mod_id, int cc_id);
|
||||
|
||||
/*Get total size DL MAC SDUS*/
|
||||
uint32_t flexran_get_total_size_dl_mac_sdus(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get total size of UL mac SDUS*/
|
||||
uint32_t flexran_get_total_size_ul_mac_sdus(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get total number of PDU DL*/
|
||||
uint32_t flexran_get_total_num_pdu_dl(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get total number of PDU UL*/
|
||||
uint32_t flexran_get_total_num_pdu_ul(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get total PRB dl TODO Should be changed*/
|
||||
uint32_t flexran_get_total_prb_dl_tx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get total PRB ul TODO Should be changed*/
|
||||
uint32_t flexran_get_total_prb_ul_rx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get number of prb for tx per UE DL*/
|
||||
uint16_t flexran_get_num_prb_dl_tx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get number of prb for rx per UE UL*/
|
||||
uint16_t flexran_get_num_prb_ul_rx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get number of prb for retx per UE UL*/
|
||||
uint32_t flexran_get_num_prb_retx_ul_per_ue(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get number of prb for retx per UE*/
|
||||
uint16_t flexran_get_num_prb_retx_dl_per_ue(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*MCS before rate adaptation DL*/
|
||||
uint8_t flexran_get_mcs1_dl(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*MCS after rate adaptation DL*/
|
||||
uint8_t flexran_get_mcs2_dl(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*MCS before rate adaptation UL*/
|
||||
uint8_t flexran_get_mcs1_ul(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*MCS after rate adaptation UL*/
|
||||
uint8_t flexran_get_mcs2_ul(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get downlink TBS*/
|
||||
uint32_t flexran_get_TBS_dl(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get uplink TBS */
|
||||
uint32_t flexran_get_TBS_ul(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get total TBS DL*/
|
||||
uint64_t flexran_get_total_TBS_dl(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get total TBS DL*/
|
||||
uint64_t flexran_get_total_TBS_ul(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/* Get the current HARQ round for UE ue_id */
|
||||
int flexran_get_harq_round(mid_t mod_id, uint8_t cc_id, mid_t ue_id);
|
||||
|
||||
/* Get the number of active component carriers for a specific UE */
|
||||
int flexran_get_active_CC(mid_t mod_id, mid_t ue_id);
|
||||
|
||||
|
||||
@@ -294,7 +294,7 @@ void config_mib(int Mod_idP,
|
||||
#ifdef Rel14
|
||||
,cfg->emtc_config.pbch_repetitions_enable_r13.value
|
||||
#endif
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
void config_sib1(int Mod_idP, int CC_idP, TDD_Config_t * tdd_ConfigP)
|
||||
@@ -435,7 +435,6 @@ config_sib2(int Mod_idP,
|
||||
cfg->srs_config.srs_acknack_srs_simultaneous_transmission.value = radioResourceConfigCommonP->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
|
||||
cfg->srs_config.srs_acknack_srs_simultaneous_transmission.tl.tag = NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
|
||||
if (radioResourceConfigCommonP->soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts) {
|
||||
cfg->srs_config.max_up_pts.value = 1;
|
||||
@@ -992,5 +991,3 @@ rrc_mac_config_req_eNB(module_id_t Mod_idP,
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+48
-35
@@ -157,13 +157,13 @@
|
||||
|
||||
#define U_PLANE_INACTIVITY_VALUE 6000
|
||||
|
||||
/*
|
||||
* eNB part
|
||||
/*
|
||||
* eNB part
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* UE/ENB common part
|
||||
/*
|
||||
* UE/ENB common part
|
||||
*/
|
||||
/*!\brief MAC header of Random Access Response for Random access preamble identifier (RAPID) */
|
||||
typedef struct {
|
||||
@@ -448,20 +448,20 @@ typedef struct {
|
||||
} eNB_DLSCH_INFO;
|
||||
/*! \brief eNB overall statistics */
|
||||
typedef struct {
|
||||
/// num BCCH PDU per CC
|
||||
/// num BCCH PDU per CC
|
||||
uint32_t total_num_bcch_pdu;
|
||||
/// BCCH buffer size
|
||||
/// BCCH buffer size
|
||||
uint32_t bcch_buffer;
|
||||
/// total BCCH buffer size
|
||||
/// total BCCH buffer size
|
||||
uint32_t total_bcch_buffer;
|
||||
/// BCCH MCS
|
||||
uint32_t bcch_mcs;
|
||||
|
||||
/// num CCCH PDU per CC
|
||||
/// num CCCH PDU per CC
|
||||
uint32_t total_num_ccch_pdu;
|
||||
/// BCCH buffer size
|
||||
/// BCCH buffer size
|
||||
uint32_t ccch_buffer;
|
||||
/// total BCCH buffer size
|
||||
/// total BCCH buffer size
|
||||
uint32_t total_ccch_buffer;
|
||||
/// BCCH MCS
|
||||
uint32_t ccch_mcs;
|
||||
@@ -562,6 +562,13 @@ typedef struct {
|
||||
uint32_t num_retransmission;
|
||||
/// instantaneous tx throughput for each TTI
|
||||
// uint32_t tti_throughput[NB_RB_MAX];
|
||||
// Number of received MAC SDU
|
||||
uint32_t num_mac_sdu_tx;
|
||||
// LCID related to SDU
|
||||
unsigned char lcid_sdu[NB_RB_MAX];
|
||||
// Length of SDU Got from LC DL
|
||||
uint32_t sdu_length_tx[NB_RB_MAX];
|
||||
|
||||
|
||||
/// overall
|
||||
//
|
||||
@@ -608,6 +615,8 @@ typedef struct {
|
||||
/// uplink transport block size
|
||||
uint32_t ulsch_TBS;
|
||||
|
||||
uint32_t total_ulsch_TBS;
|
||||
|
||||
/// total rb used for a new uplink transmission
|
||||
uint32_t num_retransmission_rx;
|
||||
/// total rb used for a new uplink transmission
|
||||
@@ -616,9 +625,9 @@ typedef struct {
|
||||
uint32_t rbs_used_retx_rx;
|
||||
/// total rb used for a new uplink transmission
|
||||
uint32_t total_rbs_used_rx;
|
||||
/// normalized rx power
|
||||
/// normalized rx power
|
||||
int32_t normalized_rx_power;
|
||||
/// target rx power
|
||||
/// target rx power
|
||||
int32_t target_rx_power;
|
||||
|
||||
/// num rx pdu
|
||||
@@ -648,6 +657,10 @@ typedef struct {
|
||||
uint32_t total_num_pdus_rx;
|
||||
/// num of error pdus
|
||||
uint32_t total_num_errors_rx;
|
||||
// Number of error PDUS
|
||||
uint32_t num_mac_sdu_rx;
|
||||
// Length of SDU Got from LC UL - Size array can be refined
|
||||
uint32_t sdu_length_rx[NB_RB_MAX];
|
||||
|
||||
} eNB_UE_STATS;
|
||||
/*! \brief eNB template for UE context information */
|
||||
@@ -741,7 +754,7 @@ typedef struct {
|
||||
uint32_t dl_buffer_head_sdu_creation_time[MAX_NUM_LCID];
|
||||
/// maximum creation time of the downlink buffer head across all LCID
|
||||
uint32_t dl_buffer_head_sdu_creation_time_max;
|
||||
/// a flag indicating that the downlink head SDU is segmented
|
||||
/// a flag indicating that the downlink head SDU is segmented
|
||||
uint8_t dl_buffer_head_sdu_is_segmented[MAX_NUM_LCID];
|
||||
/// size of remaining size to send for the downlink head SDU
|
||||
uint32_t dl_buffer_head_sdu_remaining_size_to_send[MAX_NUM_LCID];
|
||||
@@ -936,21 +949,21 @@ typedef struct {
|
||||
/// Dedicated information for UEs
|
||||
struct PhysicalConfigDedicated
|
||||
*physicalConfigDedicated[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
/// DLSCH pdu
|
||||
/// DLSCH pdu
|
||||
DLSCH_PDU DLSCH_pdu[MAX_NUM_CCs][2][NUMBER_OF_UE_MAX];
|
||||
/// DCI template and MAC connection parameters for UEs
|
||||
UE_TEMPLATE UE_template[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
/// DCI template and MAC connection for RA processes
|
||||
int pCC_id[NUMBER_OF_UE_MAX];
|
||||
/// sorted downlink component carrier for the scheduler
|
||||
/// sorted downlink component carrier for the scheduler
|
||||
int ordered_CCids[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
/// number of downlink active component carrier
|
||||
/// number of downlink active component carrier
|
||||
int numactiveCCs[NUMBER_OF_UE_MAX];
|
||||
/// sorted uplink component carrier for the scheduler
|
||||
/// sorted uplink component carrier for the scheduler
|
||||
int ordered_ULCCids[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
/// number of uplink active component carrier
|
||||
/// number of uplink active component carrier
|
||||
int numactiveULCCs[NUMBER_OF_UE_MAX];
|
||||
/// number of downlink active component carrier
|
||||
/// number of downlink active component carrier
|
||||
uint8_t dl_CC_bitmap[NUMBER_OF_UE_MAX];
|
||||
/// eNB to UE statistics
|
||||
eNB_UE_STATS eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
@@ -1076,7 +1089,7 @@ typedef struct eNB_MAC_INST_s {
|
||||
nfapi_ul_config_request_t UL_req[MAX_NUM_CCs];
|
||||
/// NFAPI "Temporary" UL Config Request Structure, holds future UL_config requests
|
||||
nfapi_ul_config_request_t UL_req_tmp[MAX_NUM_CCs][10];
|
||||
/// Preallocated HI_DCI0 pdu list
|
||||
/// Preallocated HI_DCI0 pdu list
|
||||
nfapi_hi_dci0_request_pdu_t
|
||||
hi_dci0_pdu_list[MAX_NUM_CCs][MAX_NUM_HI_DCI0_PDU];
|
||||
/// NFAPI HI/DCI0 Config Request Structure
|
||||
@@ -1099,21 +1112,21 @@ typedef struct eNB_MAC_INST_s {
|
||||
/// eNB stats
|
||||
eNB_STATS eNB_stats[MAX_NUM_CCs];
|
||||
// MAC function execution peformance profiler
|
||||
/// processing time of eNB scheduler
|
||||
/// processing time of eNB scheduler
|
||||
time_stats_t eNB_scheduler;
|
||||
/// processing time of eNB scheduler for SI
|
||||
/// processing time of eNB scheduler for SI
|
||||
time_stats_t schedule_si;
|
||||
/// processing time of eNB scheduler for Random access
|
||||
time_stats_t schedule_ra;
|
||||
/// processing time of eNB ULSCH scheduler
|
||||
/// processing time of eNB ULSCH scheduler
|
||||
time_stats_t schedule_ulsch;
|
||||
/// processing time of eNB DCI generation
|
||||
time_stats_t fill_DLSCH_dci;
|
||||
/// processing time of eNB MAC preprocessor
|
||||
time_stats_t schedule_dlsch_preprocessor;
|
||||
/// processing time of eNB DLSCH scheduler
|
||||
/// processing time of eNB DLSCH scheduler
|
||||
time_stats_t schedule_dlsch; // include rlc_data_req + MAC header + preprocessor
|
||||
/// processing time of eNB MCH scheduler
|
||||
/// processing time of eNB MCH scheduler
|
||||
time_stats_t schedule_mch;
|
||||
/// processing time of eNB ULSCH reception
|
||||
time_stats_t rx_ulsch_sdu; // include rlc_data_ind
|
||||
@@ -1121,8 +1134,8 @@ typedef struct eNB_MAC_INST_s {
|
||||
time_stats_t schedule_pch;
|
||||
} eNB_MAC_INST;
|
||||
|
||||
/*
|
||||
* UE part
|
||||
/*
|
||||
* UE part
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
@@ -1316,24 +1329,24 @@ typedef struct {
|
||||
uint8_t msi_status; // could be an array if there are >1 MCH in one MBSFN area
|
||||
#endif
|
||||
//#ifdef CBA
|
||||
/// CBA RNTI for each group
|
||||
/// CBA RNTI for each group
|
||||
uint16_t cba_rnti[NUM_MAX_CBA_GROUP];
|
||||
/// last SFN for CBA channel access
|
||||
/// last SFN for CBA channel access
|
||||
uint8_t cba_last_access[NUM_MAX_CBA_GROUP];
|
||||
//#endif
|
||||
/// total UE scheduler processing time
|
||||
/// total UE scheduler processing time
|
||||
time_stats_t ue_scheduler; // total
|
||||
/// UE ULSCH tx processing time inlcuding RLC interface (rlc_data_req) and mac header generation
|
||||
/// UE ULSCH tx processing time inlcuding RLC interface (rlc_data_req) and mac header generation
|
||||
time_stats_t tx_ulsch_sdu;
|
||||
/// UE DLSCH rx processing time inlcuding RLC interface (mac_rrc_data_ind or mac_rlc_status_ind+mac_rlc_data_ind) and mac header parser
|
||||
time_stats_t rx_dlsch_sdu;
|
||||
/// UE query for MCH subframe processing time
|
||||
/// UE query for MCH subframe processing time
|
||||
time_stats_t ue_query_mch;
|
||||
/// UE MCH rx processing time
|
||||
/// UE MCH rx processing time
|
||||
time_stats_t rx_mch_sdu;
|
||||
/// UE BCCH rx processing time including RLC interface (mac_rrc_data_ind)
|
||||
/// UE BCCH rx processing time including RLC interface (mac_rrc_data_ind)
|
||||
time_stats_t rx_si;
|
||||
/// UE PCCH rx processing time including RLC interface (mac_rrc_data_ind)
|
||||
/// UE PCCH rx processing time including RLC interface (mac_rrc_data_ind)
|
||||
time_stats_t rx_p;
|
||||
} UE_MAC_INST;
|
||||
/*! \brief ID of the neighboring cells used for HO*/
|
||||
|
||||
@@ -744,7 +744,7 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP,
|
||||
}
|
||||
}
|
||||
/* if (continue_flag != 1 */
|
||||
if ((ue_sched_ctl->pre_nb_available_rbs[CC_id] == 0) || // no RBs allocated
|
||||
if ((ue_sched_ctl->pre_nb_available_rbs[CC_id] == 0) || // no RBs allocated
|
||||
CCE_allocation_infeasible(module_idP, CC_id, 1, subframeP,
|
||||
aggregation, rnti)) {
|
||||
LOG_D(MAC,
|
||||
@@ -929,7 +929,7 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP,
|
||||
dl_req->number_dci++;
|
||||
dl_req->number_pdu++;
|
||||
dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
|
||||
|
||||
|
||||
eNB->DL_req[CC_id].sfn_sf = frameP<<4 | subframeP;
|
||||
eNB->DL_req[CC_id].header.message_id = NFAPI_DL_CONFIG_REQUEST;
|
||||
|
||||
@@ -1036,6 +1036,8 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP,
|
||||
module_idP, CC_id, sdu_lengths[0]);
|
||||
sdu_length_total = sdu_lengths[0];
|
||||
sdu_lcids[0] = DCCH;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].lcid_sdu[0] = DCCH;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].sdu_length_tx[DCCH] = sdu_lengths[0];
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[DCCH] += 1;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[DCCH] += sdu_lengths[0];
|
||||
num_sdus = 1;
|
||||
@@ -1079,6 +1081,8 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP,
|
||||
sdu_lcids[num_sdus] = DCCH1;
|
||||
sdu_length_total += sdu_lengths[num_sdus];
|
||||
header_len_dcch += 2;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].lcid_sdu[num_sdus] = DCCH1;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].sdu_length_tx[DCCH1] = sdu_lengths[num_sdus];
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].
|
||||
num_pdu_tx[DCCH1] += 1;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[DCCH1] += sdu_lengths[num_sdus];
|
||||
@@ -1112,7 +1116,7 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP,
|
||||
TBS - ta_len - header_len_dcch -
|
||||
sdu_length_total - header_len_dtch);
|
||||
|
||||
if (TBS - ta_len - header_len_dcch - sdu_length_total - header_len_dtch > 0) { // NN: > 2 ?
|
||||
if (TBS - ta_len - header_len_dcch - sdu_length_total - header_len_dtch > 0) { // NN: > 2 ?
|
||||
rlc_status = mac_rlc_status_ind(module_idP,
|
||||
rnti,
|
||||
module_idP,
|
||||
@@ -1153,6 +1157,8 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP,
|
||||
UE_list->
|
||||
eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid]
|
||||
+= 1;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].lcid_sdu[num_sdus] = lcid;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].sdu_length_tx[lcid] = sdu_lengths[num_sdus];
|
||||
UE_list->
|
||||
eNB_UE_stats[CC_id][UE_id].num_bytes_tx
|
||||
[lcid] += sdu_lengths[num_sdus];
|
||||
@@ -1174,7 +1180,7 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP,
|
||||
}
|
||||
if (header_len_dtch == 0)
|
||||
header_len_dtch_last = 0;
|
||||
// there is at least one SDU
|
||||
// there is at least one SDU
|
||||
// if (num_sdus > 0 ){
|
||||
if ((sdu_length_total + header_len_dcch +
|
||||
header_len_dtch) > 0) {
|
||||
@@ -1187,7 +1193,7 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP,
|
||||
if (header_len_dtch == 0) {
|
||||
header_len_dcch = (header_len_dcch > 0) ? 1 : 0; //header_len_dcch; // remove length field
|
||||
} else {
|
||||
header_len_dtch_last -= 1; // now use it to find how many bytes has to be removed for the last MAC SDU
|
||||
header_len_dtch_last -= 1; // now use it to find how many bytes has to be removed for the last MAC SDU
|
||||
header_len_dtch = (header_len_dtch > 0) ? header_len_dtch - header_len_dtch_last : header_len_dtch; // remove length field for the last SDU
|
||||
}
|
||||
|
||||
@@ -1355,6 +1361,7 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP,
|
||||
eNB->eNB_stats[CC_id].dlsch_pdus_tx += 1;
|
||||
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used = nb_rb;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_mac_sdu_tx = num_sdus;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used += nb_rb;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1 = eNB_UE_stats->dlsch_mcs1;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs2 = mcs;
|
||||
@@ -1406,10 +1413,10 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP,
|
||||
tpc, tpc_accumulated,
|
||||
normalized_rx_power, target_rx_power);
|
||||
|
||||
} // Po_PUCCH has been updated
|
||||
} // Po_PUCCH has been updated
|
||||
else {
|
||||
tpc = 1; //0
|
||||
} // time to do TPC update
|
||||
} // time to do TPC update
|
||||
else {
|
||||
tpc = 1; //0
|
||||
}
|
||||
@@ -1508,7 +1515,7 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP,
|
||||
UE_list.DLSCH_pdu[CC_id][0][(unsigned char)
|
||||
UE_id].payload
|
||||
[0]);
|
||||
|
||||
|
||||
LOG_D(MAC,
|
||||
"Filled NFAPI configuration for DCI/DLSCH/TXREQ %d, new SDU\n",
|
||||
eNB->pdu_index[CC_id]);
|
||||
@@ -1688,9 +1695,9 @@ update_ul_dci(module_id_t module_idP,
|
||||
int i;
|
||||
|
||||
|
||||
if (cc->tdd_Config != NULL) { // TDD
|
||||
if (cc->tdd_Config != NULL) { // TDD
|
||||
for (i = 0;
|
||||
i <HI_DCI0_req->hi_dci0_request_body.number_of_dci + HI_DCI0_req->hi_dci0_request_body.number_of_dci;
|
||||
i <HI_DCI0_req->hi_dci0_request_body.number_of_dci + HI_DCI0_req->hi_dci0_request_body.number_of_dci;
|
||||
i++) {
|
||||
|
||||
if ((hi_dci0_pdu[i].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) &&
|
||||
|
||||
@@ -1315,6 +1315,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
|
||||
rb_table[rb_table_index]);
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx += rb_table[rb_table_index];
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS = UE_template->TBS_UL[harq_pid];
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_ulsch_TBS += UE_template->TBS_UL[harq_pid];
|
||||
// buffer_occupancy -= TBS;
|
||||
|
||||
T(T_ENB_MAC_UE_UL_SCHEDULE, T_INT(module_idP),
|
||||
|
||||
+608
-599
File diff suppressed because it is too large
Load Diff
@@ -209,11 +209,6 @@ void dlsch_scheduler_pre_processor_reset(int module_idP, int UE_id,
|
||||
uint16_t
|
||||
nb_rbs_required[MAX_NUM_CCs]
|
||||
[NUMBER_OF_UE_MAX],
|
||||
uint16_t
|
||||
nb_rbs_required_remaining
|
||||
[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
|
||||
unsigned char total_ue_count[MAX_NUM_CCs],
|
||||
unsigned char total_rbs_used[MAX_NUM_CCs],
|
||||
unsigned char
|
||||
rballoc_sub[MAX_NUM_CCs]
|
||||
[N_RBG_MAX],
|
||||
|
||||
@@ -769,15 +769,15 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
|
||||
|
||||
void pdcp_fifo_read_input_sdus_from_otg (const protocol_ctxt_t* const ctxt_pP) {
|
||||
|
||||
unsigned char *otg_pkt=NULL;
|
||||
//unsigned char *otg_pkt=NULL;
|
||||
module_id_t dst_id; // dst for otg
|
||||
rb_id_t rb_id;
|
||||
unsigned int pkt_size=0;
|
||||
//rb_id_t rb_id;
|
||||
//unsigned int pkt_size=0;
|
||||
protocol_ctxt_t ctxt;
|
||||
// we need to add conditions to avoid transmitting data when the UE is not RRC connected.
|
||||
if ((otg_enabled==1) && (ctxt_pP->enb_flag == ENB_FLAG_YES)) { // generate DL traffic
|
||||
unsigned int ctime=0;
|
||||
ctime = ctxt_pP->frame * 100;
|
||||
//unsigned int ctime=0;
|
||||
//ctime = ctxt_pP->frame * 100;
|
||||
|
||||
/*if ((mac_get_rrc_status(eNB_index, ctxt_pP->enb_flag, 0 ) > 2) &&
|
||||
(mac_get_rrc_status(eNB_index, ctxt_pP->enb_flag, 1 ) > 2)) { */
|
||||
|
||||
@@ -228,9 +228,7 @@ int dump_eNB_l2_stats(char *buffer, int length)
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt,
|
||||
eNB_id,
|
||||
ENB_FLAG_YES,
|
||||
/* the following is suspicious, let's put back what was there before */
|
||||
/*UE_list->eNB_UE_stats[0][UE_id].crnti,//UE_PCCID(eNB_id,UE_id)][UE_id].crnti, */
|
||||
UE_list->eNB_UE_stats[UE_PCCID(eNB_id,UE_id)][UE_id].crnti,
|
||||
UE_list->eNB_UE_stats[0][UE_id].crnti,//UE_PCCID(eNB_id,UE_id)][UE_id].crnti,
|
||||
eNB->frame,
|
||||
eNB->subframe,
|
||||
eNB_id);
|
||||
|
||||
@@ -241,7 +241,7 @@ int nas_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
|
||||
// End debug information
|
||||
netif_stop_queue(dev);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || RHEL_RELEASE_CODE>=1796
|
||||
netif_trans_update(dev);
|
||||
#else
|
||||
dev->trans_start = jiffies;
|
||||
@@ -306,7 +306,7 @@ void nas_tx_timeout(struct net_device *dev)
|
||||
printk("TX_TIMEOUT: begin\n");
|
||||
// (struct nas_priv *)(dev->priv)->stats.tx_errors++;
|
||||
(priv->stats).tx_errors++;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || RHEL_RELEASE_CODE>=1796
|
||||
netif_trans_update(dev);
|
||||
#else
|
||||
dev->trans_start = jiffies;
|
||||
|
||||
@@ -236,7 +236,7 @@ int ue_ip_hard_start_xmit(struct sk_buff *skb_pP, struct net_device *dev_pP)
|
||||
|
||||
// End debug information
|
||||
netif_stop_queue(dev_pP);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || RHEL_RELEASE_CODE >= 1796
|
||||
netif_trans_update(dev_pP);
|
||||
#else
|
||||
dev_pP->trans_start = jiffies;
|
||||
@@ -312,7 +312,7 @@ void ue_ip_tx_timeout(struct net_device *dev_pP)
|
||||
printk("[UE_IP_DRV][%s] begin\n", __FUNCTION__);
|
||||
// (ue_ip_priv_t *)(dev_pP->priv_p)->stats.tx_errors++;
|
||||
(priv_p->stats).tx_errors++;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || RHEL_RELEASE_CODE >= 1796
|
||||
netif_trans_update(dev_pP);
|
||||
#else
|
||||
dev_pP->trans_start = jiffies;
|
||||
|
||||
@@ -65,26 +65,14 @@ mac_rrc_data_req_ue(
|
||||
)
|
||||
//--------------------------------------------------------------------------
|
||||
{
|
||||
asn_enc_rval_t enc_rval;
|
||||
SRB_INFO *Srb_info;
|
||||
uint8_t Sdu_size = 0;
|
||||
uint8_t sfn = (uint8_t)((frameP>>2)&0xff);
|
||||
|
||||
|
||||
#ifdef DEBUG_RRC
|
||||
int i;
|
||||
LOG_I(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_idP,Srb_id);
|
||||
#endif
|
||||
|
||||
eNB_RRC_INST *rrc;
|
||||
rrc_eNB_carrier_data_t *carrier;
|
||||
BCCH_BCH_Message_t *mib;
|
||||
|
||||
|
||||
LOG_D(RRC,"[UE %d] Frame %d Filling CCCH SRB_ID %d\n",Mod_idP,frameP,Srb_id);
|
||||
LOG_D(RRC,"[UE %d] Frame %d buffer_pP status %d,\n",Mod_idP,frameP, UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size);
|
||||
|
||||
|
||||
if( (UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size > 0) ) {
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
@@ -139,7 +127,6 @@ mac_rrc_data_ind_ue(
|
||||
)
|
||||
//--------------------------------------------------------------------------
|
||||
{
|
||||
SRB_INFO *Srb_info;
|
||||
protocol_ctxt_t ctxt;
|
||||
sdu_size_t sdu_size = 0;
|
||||
|
||||
@@ -214,6 +201,7 @@ mac_rrc_data_ind_ue(
|
||||
itti_send_msg_to_task (TASK_RRC_UE, ctxt.instance, message_p);
|
||||
}
|
||||
#else
|
||||
SRB_INFO *Srb_info;
|
||||
Srb_info = &UE_rrc_inst[module_idP].Srb0[eNB_indexP];
|
||||
memcpy(Srb_info->Rx_buffer.Payload,sduP,sdu_lenP);
|
||||
Srb_info->Rx_buffer.payload_size = sdu_lenP;
|
||||
|
||||
@@ -409,6 +409,17 @@ rrc_data_req(
|
||||
const pdcp_transmission_mode_t modeP
|
||||
);
|
||||
|
||||
uint8_t
|
||||
rrc_data_req_ue(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_sizeP,
|
||||
uint8_t* const buffer_pP,
|
||||
const pdcp_transmission_mode_t modeP
|
||||
);
|
||||
|
||||
void
|
||||
rrc_data_ind(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
|
||||
@@ -241,7 +241,6 @@ openair_rrc_on_ue(
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
unsigned short i;
|
||||
int CC_id;
|
||||
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" UE?:OPENAIR RRC IN....\n",
|
||||
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
|
||||
@@ -4843,9 +4842,6 @@ rrc_rx_tx_ue(
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
//uint8_t UE_id;
|
||||
int32_t current_timestamp_ms, ref_timestamp_ms;
|
||||
struct timeval ts;
|
||||
struct rrc_eNB_ue_context_s *ue_context_p = NULL,*ue_to_be_removed = NULL;
|
||||
|
||||
#ifdef LOCALIZATION
|
||||
double estimated_distance;
|
||||
|
||||
@@ -118,7 +118,6 @@ openair_rrc_on(
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
unsigned short i;
|
||||
int CC_id;
|
||||
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" ENB:OPENAIR RRC IN....\n",
|
||||
@@ -1232,7 +1231,7 @@ rrc_eNB_generate_RRCConnectionReestablishment(
|
||||
void
|
||||
rrc_eNB_process_RRCConnectionReestablishmentComplete(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const rnti_t const reestablish_rnti,
|
||||
const rnti_t reestablish_rnti,
|
||||
rrc_eNB_ue_context_t* ue_context_pP,
|
||||
const uint8_t xid,
|
||||
RRCConnectionReestablishmentComplete_r8_IEs_t * rrcConnectionReestablishmentComplete
|
||||
|
||||
@@ -95,6 +95,10 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include "enb_config.h"
|
||||
//#include "PHY/TOOLS/time_meas.h"
|
||||
|
||||
/* these variables have to be defined before including ENB_APP/enb_paramdef.h */
|
||||
static int DEFBANDS[] = {7};
|
||||
static int DEFENBS[] = {0};
|
||||
|
||||
#include "ENB_APP/enb_paramdef.h"
|
||||
#include "common/config/config_userapi.h"
|
||||
|
||||
@@ -1883,7 +1887,6 @@ void configure_ru(int idx,
|
||||
RRU_config_t *config = (RRU_config_t *)arg;
|
||||
RRU_capabilities_t *capabilities = (RRU_capabilities_t*)arg;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
LOG_I(PHY, "Received capabilities from RRU %d\n",idx);
|
||||
|
||||
@@ -1918,6 +1921,7 @@ void configure_ru(int idx,
|
||||
config->prach_FreqOffset[0],config->prach_ConfigIndex[0]);
|
||||
|
||||
#ifdef Rel14
|
||||
int i;
|
||||
for (i=0;i<4;i++) {
|
||||
config->emtc_prach_CElevel_enable[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i];
|
||||
config->emtc_prach_FreqOffset[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[i];
|
||||
|
||||
@@ -140,6 +140,7 @@ void do_DL_sig(channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM
|
||||
if (!hold_channel) {
|
||||
// calculate the random channel from each RU
|
||||
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
frame_parms = &RC.ru[ru_id]->frame_parms;
|
||||
|
||||
random_channel(RU2UE[ru_id][UE_id][CC_id],abstraction_flag);
|
||||
/*
|
||||
|
||||
@@ -685,8 +685,8 @@ void update_mac(Event_t event)
|
||||
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[event.ue].priority[event.lcid]);
|
||||
}
|
||||
} else if(!strcmp((char *) event.key, "DCI_aggregation_min") && event.value!=NULL && validate_mac(event)) {
|
||||
Mac_config* mac_config;// = malloc(sizeof(Mac_config)*16);
|
||||
mac_config = (Mac_config *) event.value;
|
||||
//Mac_config* mac_config;// = malloc(sizeof(Mac_config)*16);
|
||||
//mac_config = (Mac_config *) event.value;
|
||||
|
||||
LOG_I(EMU,"DCI_aggregation_min update \n");
|
||||
|
||||
@@ -706,8 +706,8 @@ void update_mac(Event_t event)
|
||||
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_template[0][event.ue].DCI_aggregation_min);*/
|
||||
}
|
||||
} else if(!strcmp((char *) event.key, "DLSCH_dci_size_bits") && event.value!=NULL && validate_mac(event)) {
|
||||
Mac_config* mac_config;// = malloc(sizeof(Mac_config)*16);
|
||||
mac_config = (Mac_config *) event.value;
|
||||
//Mac_config* mac_config;// = malloc(sizeof(Mac_config)*16);
|
||||
//mac_config = (Mac_config *) event.value;
|
||||
|
||||
|
||||
LOG_I(EMU,"DLSCH_dci_size_bits update \n");
|
||||
|
||||
+20
-18
@@ -216,7 +216,8 @@ oai_shutdown (void);
|
||||
|
||||
void reset_opp_meas_oaisim (void);
|
||||
|
||||
void wait_eNBs() {
|
||||
void wait_eNBs(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -364,7 +365,7 @@ static void set_cli_start(module_id_t module_idP, uint8_t start)
|
||||
#ifdef OPENAIR2
|
||||
int omv_write(int pfd, node_list* enb_node_list, node_list* ue_node_list, Data_Flow_Unit omv_data)
|
||||
{
|
||||
module_id_t i, j;
|
||||
module_id_t i;
|
||||
omv_data.end = 0;
|
||||
|
||||
//omv_data.total_num_nodes = NB_UE_INST + NB_eNB_INST;
|
||||
@@ -495,7 +496,7 @@ l2l1_task (void *args_p)
|
||||
#undef PRINT_STATS /* this undef is to avoid gcc warnings */
|
||||
#define PRINT_STATS
|
||||
#ifdef PRINT_STATS
|
||||
int len;
|
||||
//int len;
|
||||
FILE *UE_stats[NUMBER_OF_UE_MAX];
|
||||
FILE *UE_stats_th[NUMBER_OF_UE_MAX];
|
||||
FILE *eNB_stats[NUMBER_OF_eNB_MAX];
|
||||
@@ -621,7 +622,6 @@ l2l1_task (void *args_p)
|
||||
}
|
||||
|
||||
#endif
|
||||
module_id_t enb_id;
|
||||
module_id_t UE_id;
|
||||
|
||||
if (abstraction_flag == 1) {
|
||||
@@ -769,11 +769,11 @@ l2l1_task (void *args_p)
|
||||
*/
|
||||
for (ru_id=0;ru_id<NB_RU;ru_id++) {
|
||||
current_ru_rx_timestamp[ru_id][CC_id] += RC.ru[ru_id]->frame_parms.samples_per_tti;
|
||||
LOG_D(EMU,"RU %d/%d: TS %llu\n",ru_id,CC_id,current_ru_rx_timestamp[ru_id][CC_id]);
|
||||
LOG_D(EMU,"RU %d/%d: TS %"PRIi64"\n",ru_id,CC_id,current_ru_rx_timestamp[ru_id][CC_id]);
|
||||
}
|
||||
for (UE_inst = 0; UE_inst<NB_UE_INST;UE_inst++) {
|
||||
current_UE_rx_timestamp[UE_inst][CC_id] += PHY_vars_UE_g[UE_inst][CC_id]->frame_parms.samples_per_tti;
|
||||
LOG_D(EMU,"UE %d/%d: TS %llu\n",UE_id,CC_id,current_UE_rx_timestamp[UE_inst][CC_id]);
|
||||
LOG_D(EMU,"UE %d/%d: TS %"PRIi64"\n",UE_inst,CC_id,current_UE_rx_timestamp[UE_inst][CC_id]);
|
||||
}
|
||||
|
||||
for (eNB_inst = oai_emulation.info.first_enb_local;
|
||||
@@ -818,13 +818,14 @@ l2l1_task (void *args_p)
|
||||
}
|
||||
*/
|
||||
#ifdef OPENAIR2
|
||||
|
||||
/*
|
||||
if (eNB_l2_stats) {
|
||||
len = dump_eNB_l2_stats (stats_buffer, 0);
|
||||
rewind (eNB_l2_stats);
|
||||
fwrite (stats_buffer, 1, len, eNB_l2_stats);
|
||||
fflush(eNB_l2_stats);
|
||||
}
|
||||
*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -1012,8 +1013,8 @@ int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */
|
||||
#endif
|
||||
|
||||
|
||||
void wait_RUs() {
|
||||
|
||||
void wait_RUs(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
// wait for all RUs to be configured over fronthaul
|
||||
@@ -1083,9 +1084,9 @@ static void print_current_directory(void)
|
||||
printf("working directory: %s\n", dir);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
void init_devices(void);
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
|
||||
clock_t t;
|
||||
@@ -1103,7 +1104,6 @@ main (int argc, char **argv)
|
||||
int node_id;
|
||||
int port,Process_Flag=0,wgt,Channel_Flag=0,temp;
|
||||
#endif
|
||||
int i;
|
||||
|
||||
//default parameters
|
||||
oai_emulation.info.n_frames = MAX_FRAME_NUMBER; //1024; //10;
|
||||
@@ -1471,8 +1471,10 @@ print_opp_meas_oaisim (void)
|
||||
&oaisim_stats, &oaisim_stats_f);
|
||||
|
||||
|
||||
print_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc_rx,
|
||||
"[UE][total_phy_proc_rx]", &oaisim_stats, &oaisim_stats_f);
|
||||
print_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc_rx[0],
|
||||
"[UE][total_phy_proc_rx[0]]", &oaisim_stats, &oaisim_stats_f);
|
||||
print_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc_rx[1],
|
||||
"[UE][total_phy_proc_rx[1]]", &oaisim_stats, &oaisim_stats_f);
|
||||
// print_meas (&PHY_vars_UE_g[UE_id][0]->ofdm_demod_stats,
|
||||
// "[UE][ofdm_demod]", &oaisim_stats, &oaisim_stats_f);
|
||||
print_meas (&PHY_vars_UE_g[UE_id][0]->rx_dft_stats, "[UE][rx_dft]",
|
||||
@@ -1843,8 +1845,8 @@ get_OAI_emulation ()
|
||||
|
||||
// dummy function declarations
|
||||
|
||||
void *rrc_enb_task(void *args_p) {
|
||||
|
||||
|
||||
void *rrc_enb_task(void *args_p)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -868,7 +868,7 @@ void check_and_adjust_params(void)
|
||||
{
|
||||
|
||||
int32_t ret;
|
||||
int i,j;
|
||||
//int i,j;
|
||||
|
||||
if (oai_emulation.info.nb_ue_local + oai_emulation.info.nb_rn_local > NUMBER_OF_UE_MAX) {
|
||||
LOG_E(EMU,"Enter fewer than %d UEs/RNs for the moment or change the NUMBER_OF_UE_MAX\n", NUMBER_OF_UE_MAX);
|
||||
@@ -1081,7 +1081,7 @@ int ru_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
|
||||
while (sample_count<nsamps) {
|
||||
while (current_ru_rx_timestamp[ru_id][CC_id]<
|
||||
(nsamps+last_ru_rx_timestamp[ru_id][CC_id])) {
|
||||
LOG_D(EMU,"RU: current TS %llu, last TS %llu, sleeping\n",current_ru_rx_timestamp[ru_id][CC_id],last_ru_rx_timestamp[ru_id][CC_id]);
|
||||
LOG_D(EMU,"RU: current TS %"PRIi64", last TS %"PRIi64", sleeping\n",current_ru_rx_timestamp[ru_id][CC_id],last_ru_rx_timestamp[ru_id][CC_id]);
|
||||
usleep(500);
|
||||
}
|
||||
|
||||
@@ -1136,13 +1136,13 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
|
||||
read_size = sptti;
|
||||
|
||||
while (sample_count<nsamps) {
|
||||
LOG_D(EMU,"UE %d: DL simulation 1: UE_trx_read : current TS now %llu, last TS %llu\n",UE_id,current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
LOG_D(EMU,"UE %d: DL simulation 1: UE_trx_read : current TS now %"PRIi64", last TS %"PRIi64"\n",UE_id,current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
while (current_UE_rx_timestamp[UE_id][CC_id] <
|
||||
(last_UE_rx_timestamp[UE_id][CC_id]+read_size)) {
|
||||
LOG_D(EMU,"UE %d: DL simulation 2: UE_trx_read : current TS %llu, last TS %llu, sleeping\n",UE_id,current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
LOG_D(EMU,"UE %d: DL simulation 2: UE_trx_read : current TS %"PRIi64", last TS %"PRIi64", sleeping\n",UE_id,current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
usleep(500);
|
||||
}
|
||||
LOG_D(EMU,"UE %d: DL simulation 3: UE_trx_read : current TS now %llu, last TS %llu\n",UE_id,current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
LOG_D(EMU,"UE %d: DL simulation 3: UE_trx_read : current TS now %"PRIi64", last TS %"PRIi64"\n",UE_id,current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
|
||||
// if we cross a subframe-boundary
|
||||
subframe = (last_UE_rx_timestamp[UE_id][CC_id]/sptti)%10;
|
||||
@@ -1174,10 +1174,10 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
|
||||
&PHY_vars_UE_g[UE_id][CC_id]->frame_parms,
|
||||
UE_id,
|
||||
CC_id);
|
||||
LOG_D(EMU,"UE %d: DL simulation 6: UE_trx_read @ TS %llu (%llu)=> frame %d, subframe %d\n",
|
||||
UE_id,(unsigned long long)current_UE_rx_timestamp[UE_id][CC_id],
|
||||
(unsigned long long)last_UE_rx_timestamp[UE_id][CC_id],
|
||||
((unsigned long long)last_UE_rx_timestamp[UE_id][CC_id]/(sptti*10))&1023,
|
||||
LOG_D(EMU,"UE %d: DL simulation 6: UE_trx_read @ TS %"PRIi64" (%"PRIi64")=> frame %d, subframe %d\n",
|
||||
UE_id, current_UE_rx_timestamp[UE_id][CC_id],
|
||||
last_UE_rx_timestamp[UE_id][CC_id],
|
||||
(int)((last_UE_rx_timestamp[UE_id][CC_id]/(sptti*10))&1023),
|
||||
subframe);
|
||||
|
||||
last_UE_rx_timestamp[UE_id][CC_id] += read_size;
|
||||
@@ -1367,9 +1367,11 @@ void init_ocm(void)
|
||||
|
||||
/* Added for PHY abstraction */
|
||||
|
||||
char* frame_type = "unknown";
|
||||
/* TODO: frame_type is unused, is it intended? */
|
||||
//char* frame_type = "unknown";
|
||||
LTE_DL_FRAME_PARMS *fp = &RC.ru[0]->frame_parms;
|
||||
|
||||
#if 0
|
||||
switch (fp->frame_type) {
|
||||
case FDD:
|
||||
frame_type = "FDD";
|
||||
@@ -1379,6 +1381,7 @@ void init_ocm(void)
|
||||
frame_type = "TDD";
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (abstraction_flag) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user