Commit 38b1efdd authored by Bilel's avatar Bilel

Merge branch 'bugfix-26' into 'develop1B'

merge oai/develop to oai1B/debelop1B



See merge request !10
parents 92383b82 34b75f39
The source code of openairinterface5g is distributed under OAI Public License V1.0.
For more details of the license, refer to LICENSE file in the same directory.
However, the source code also contains third party software that is acknowledged here for reference.
Credits for LFDS user space source code located in folder openair2/UTILS/LFDS/liblfds6.1.1/
http://liblfds.org/.
Extract from http://liblfds.org/pages/downloads_and_license.html:
......
OpenAirInterface is under OpenAirInterface Software Alliance license.
├── http://www.openairinterface.org/?page_id=101
├── http://www.openairinterface.org/?page_id=698
The OpenAirInterface (OAI) software is composed of the following parts:
openairinterface5g
├── cmake_targets: build utilities to compile (simulation, emulation and real-time platforms), and generated build files
├── common : some common OAI utilities, other tools can be found at openair2/UTILS
├── LICENSE
├── maketags : script to generate emacs tags
├── openair1 : 3GPP LTE Rel-10 PHY layer + PHY RF simulation and a subset of Rel 12 Features.
├── openair2 :3GPP LTE Rel-10 RLC/MAC/PDCP/RRC/X2AP implementation.
├── LAYER2/RLC/ with the following subdirectories: UM_v9.3.0, TM_v9.3.0, and AM_v9.3.0.
├── LAYER2/PDCP/PDCP_v10.1.0.
├── RRC/LITE
├── PHY_INTERFACE
├── X2AP
├── ENB_APP
├── openair3: 3GPP LTE Rel10 for S1AP, NAS GTPV1-U for both ENB and UE.
├── GTPV1-U
├── NAS
├── S1AP
├── SCTP
├── SECU
├── UDP
└── targets: top level wrapper for unitary simulation for PHY channels, system-level emulation (eNB-UE with and without S1), and realtime eNB and UE and RRH GW.
RELEASE NOTES:
v0.1 -> Last stable commit on develop branch before enhancement-10-harmony
v0.2 -> Merge of enhancement-10-harmony to include NGFI RRH + New Interface for RF/BBU
v0.3 -> Last stable commit on develop branch before the merge of feature-131-new-license. This is the last commit with GPL License
v0.4 -> Merge of feature-131-new-license. It closes issue#131 and changes the license to OAI Public License V1.0
v0.5 -> Merge of enhancement-10-harmony-lts. It includes fixes for Ubuntu 16.04 support
OpenAirInterface is under OpenAirInterface Software Alliance license.
├── http://www.openairinterface.org/?page_id=101
├── http://www.openairinterface.org/?page_id=698
It is distributed under OAI Public License V1.0.
The license information is distributed under LICENSE file in the same directory.
Please see NOTICE.txt for third party software that is included in the sources.
The OpenAirInterface (OAI) software is composed of the following parts:
openairinterface5g
├── cmake_targets: build utilities to compile (simulation, emulation and real-time platforms), and generated build files
├── common : some common OAI utilities, other tools can be found at openair2/UTILS
├── LICENSE
├── maketags : script to generate emacs tags
├── openair1 : 3GPP LTE Rel-10 PHY layer + PHY RF simulation and a subset of Rel 12 Features.
├── openair2 :3GPP LTE Rel-10 RLC/MAC/PDCP/RRC/X2AP implementation.
├── LAYER2/RLC/ with the following subdirectories: UM_v9.3.0, TM_v9.3.0, and AM_v9.3.0.
├── LAYER2/PDCP/PDCP_v10.1.0.
├── RRC/LITE
├── PHY_INTERFACE
├── X2AP
├── ENB_APP
├── openair3: 3GPP LTE Rel10 for S1AP, NAS GTPV1-U for both ENB and UE.
├── GTPV1-U
├── NAS
├── S1AP
├── SCTP
├── SECU
├── UDP
└── targets: top level wrapper for unitary simulation for PHY channels, system-level emulation (eNB-UE with and without S1), and realtime eNB and UE and RRH GW.
RELEASE NOTES:
v0.1 -> Last stable commit on develop branch before enhancement-10-harmony
v0.2 -> Merge of enhancement-10-harmony to include NGFI RRH + New Interface for RF/BBU
v0.3 -> Last stable commit on develop branch before the merge of feature-131-new-license. This is the last commit with GPL License
v0.4 -> Merge of feature-131-new-license. It closes issue#131 and changes the license to OAI Public License V1.0
v0.5 -> Merge of enhancement-10-harmony-lts. It includes fixes for Ubuntu 16.04 support
v0.5.1 -> Merge of bugfix-137-uplink-fixes. It includes stablity fixes for eNB
#! /usr/bin/python
#******************************************************************************
#
# \file autotest_analyser.py
#
# \par Informations
# - \b Project : UED Autotest Framework
# - \b Software :
#
# \date 16 september 2016
#
# \version 0.1
#
# \brief helper to test lib_autotest_analyser.py
#
# \author Benoit ROBERT (benoit.robert@syrtem.com)
#
# \par Statement of Ownership
# COPYRIGHT (c) 2016 BY SYRTEM S.A.R.L
# This software is furnished under license and may be used and copied
# only in accordance with the terms of such license and with the inclusion
# of the above COPYRIGHT notice. This SOFTWARE or any other copies thereof
# may not be provided or otherwise made available to any other person.
# No title to and ownership of the SOFTWARE is hereby transferred.
#
# The information in this SOFTWARE is subject to change without notice
# and should not be constructed as a commitment by SYRTEM.
# SYRTEM assumes no responsibility for the use or reliability of its
# SOFTWARE on equipment or platform not explicitly validated by SYRTEM.
#
# *******************************************************************************
import os
import getopt
import sys
from subprocess import call
#test_cases = ('030001', '030901', '031001', '031601', '031701', '031801', '031901', '032001', '032101', '032201', '032301', '032501', '032601', '032801')
test_cases = ('030030' , '030030' )
nb_run = 3
def error_opt(msg):
print("Option error: " + msg)
def main(args):
try:
analyser = __import__("lib_autotest_analyser")
except ImportError as err:
print('Import error: ' + str(err))
exit(0)
log_path = 'log_save_2016-08-14/log/'
metric = {}
metric['id'] = 'UE_DLSCH_BITRATE'
metric['description'] = 'UE downlink physical throughput'
metric['regex'] = '(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)'
metric['unit_of_meas'] = 'kbps'
metric['min_limit'] = 14668.8
#report_path = log_path+'/report/'
#os.system(' mkdir -p ' + report_path)
#analyser.create_report_html(report_path)
#return(0)
for test_case in test_cases:
# print test_case
if test_case == '030001':
metric['min_limit'] = 500.0
if test_case == '030901':
metric['min_limit'] = 640.0
if test_case == '031001':
metric['min_limit'] = 3200.0
if test_case == '031601':
metric['min_limit'] = 5920.0
if test_case == '031701':
metric['min_limit'] = 6000.0
if test_case == '031801':
metric['min_limit'] = 6200.0
if test_case == '031901':
metric['min_limit'] = 7000.0
if test_case == '032001':
metric['min_limit'] = 7800.0
if test_case == '032101':
metric['min_limit'] = 8000.0
if test_case == '032201':
metric['min_limit'] = 9000.0
if test_case == '032301':
metric['min_limit'] = 10000.0
if test_case == '032501':
metric['min_limit'] = 11000.0
if test_case == '032601':
metric['min_limit'] = 12000.0
if test_case == '032801':
metric['min_limit'] = 12500.0
if test_case == '035201':
metric['min_limit'] = 14668.8
if test_case == '036001':
metric['min_limit'] = 25363.2
for i in range(0, nb_run):
fname = 'log//'+test_case+'/run_'+str(i)+'/UE_exec_'+str(i)+'_.log'
args = {'metric' : metric,
'file' : fname }
cell_synch_status = analyser.check_cell_synchro(fname)
if cell_synch_status == 'CELL_SYNCH':
print '!!!!!!!!!!!!!! Cell synchronized !!!!!!!!!!!'
metric_checks_flag = 0
else :
print '!!!!!!!!!!!!!! Cell NOT NOT synchronized !!!!!!!!!!!'
# metric_extracted = analyser.do_extract_metrics(args)
# print "min = "+ str( metric_extracted['metric_min'] )
# print "min_index = "+ str( metric_extracted['metric_min_index'] )
# print "max = "+ str( metric_extracted['metric_max'] )
# print "max_index = "+ str( metric_extracted['metric_max_index'] )
# print "mean = "+ str( metric_extracted['metric_mean'] )
# print "median = "+ str( metric_extracted['metric_median'] )
# verdict = analyser.do_check_verdict(metric, metric_extracted)
# print verdict
# fname= 'report/2016-9-8_toto/'+test_case+'/UE_metric_UE_DLSCH_BITRATE_'+str(i)+'_.png'
# fname= 'report/UE_metric_UE_DLSCH_BITRATE_'+test_case+'_'+str(i)+'.png'
# print fname
# analyser.do_img_metrics(metric, metric_extracted, fname)
# fname = 'log//'+test_case+'/run_'+str(i)+'/UE_traffic_'+str(i)+'_.log'
# args = {'file' : fname }
# traffic_metrics = analyser.do_extract_traffic_metrics(args)
# fname= 'report/iperf_'+test_case+'_'+str(i)+'.png'
# print fname
# analyser.do_img_traffic(traffic_metrics, fname)
if __name__ == "__main__":
main(sys.argv)
This diff is collapsed.
......@@ -223,13 +223,15 @@ check_install_additional_tools (){
android-tools-adb \
wvdial \
python-numpy \
sshpass \
nscd \
bc \
ntp
sshpass \
nscd \
bc \
ntp \
python-scipy \
python-matplotlib
$SUDO pip install paramiko
$SUDO pip install pyroute2
$SUDO pip install pyroute2 colorama
$SUDO rm -fr /opt/ssh
$SUDO GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/ssh.git /opt/ssh
......
......@@ -61,6 +61,10 @@ ID = ENB_PHY_PUCCH_1_ENERGY
DESC = eNodeB PUCCH 1 energy and threshold
GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,energy : int,threshold
ID = ENB_PHY_PHICH
DESC = eNodeB PHICH
GROUP = ALL:PHY:ENB
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,NGROUP : int,NSF : int,ngroup : int,nseq : int,ACK : int,first_rb : int,n_DMRS
#MAC logs
ID = ENB_MAC_UE_DL_SDU
......
......@@ -1058,7 +1058,7 @@ unsigned char phy_threegpplte_turbo_decoder_scalar(llr_t *y,
break;
}
if ((crc == oldcrc) && (crc!=0)) {
if (crc == oldcrc) {
return(iteration_cnt);
}
......
......@@ -1375,7 +1375,7 @@ unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y,
fprintf(fdavx2b,"oldcrc %x, crc %x, oldcrc_cw2 %x, crc_cw2 %x\n",oldcrc,crc,oldcrc_cw2,crc_cw2);
#endif
if ((crc == oldcrc) && (crc!=0) && (crc_cw2 == oldcrc_cw2) && (crc_cw2!=0)) {
if (crc == oldcrc && crc_cw2 == oldcrc_cw2) {
return(iteration_cnt);
}
}
......
......@@ -2556,7 +2556,7 @@ unsigned char phy_threegpplte_turbo_decoder(short *y,
stop_meas(intl2_stats);
if ((crc == oldcrc) && (crc!=0)) {
if (crc == oldcrc) {
return(iteration_cnt);
}
}
......
......@@ -1612,7 +1612,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
fprintf(fdsse4,"oldcrc %x, crc %x\n",oldcrc,crc);
#endif
if ((crc == oldcrc) && (crc!=0)) {
if (crc == oldcrc) {
return(iteration_cnt);
}
}
......
......@@ -1625,7 +1625,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
if (intl2_stats) stop_meas(intl2_stats);
if ((crc == oldcrc) && (crc!=0)) {
if (crc == oldcrc) {
return(iteration_cnt);
}
}
......
......@@ -7240,7 +7240,17 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
if (cqi_req == 1) {
ulsch->harq_processes[harq_pid]->O_RI = 1; //we only support 2 antenna ports, so this is always 1 according to 3GPP 36.213 Table
/* 36.213 7.2.1 (release 10) says:
* "RI is only reported for transmission modes 3 and 4,
* as well as transmission modes 8 and 9 with PMI/RI reporting"
* This is for aperiodic reporting.
* TODO: deal with TM 8&9 correctly when they are implemented.
* TODO: deal with periodic reporting if we implement it.
*/
if (transmission_mode == 3 || transmission_mode == 4)
ulsch->harq_processes[harq_pid]->O_RI = 1; //we only support 2 antenna ports, so this is always 1 according to 3GPP 36.213 Table
else
ulsch->harq_processes[harq_pid]->O_RI = 0;
switch(transmission_mode) {
// The aperiodic CQI reporting mode is fixed for every transmission mode instead of being configured by higher layer signaling
......
......@@ -362,12 +362,18 @@ typedef struct {
uint8_t TPC;
/// First Allocated RB
uint16_t first_rb;
/// First Allocated RB - previous scheduling
/// This is needed for PHICH generation which
/// is done after a new scheduling
uint16_t previous_first_rb;
/// Current Number of RBs
uint16_t nb_rb;
/// Transport block size
uint32_t TBS;
/// The payload + CRC size in bits
uint32_t B;
/// Number of soft channel bits
uint32_t G;
/// CQI CRC status
uint8_t cqi_crc_status;
/// Pointer to CQI data
......@@ -444,6 +450,10 @@ typedef struct {
uint8_t Nsymb_initial;
/// n_DMRS for cyclic shift of DMRS (36.213 Table 9.1.2-2)
uint8_t n_DMRS;
/// n_DMRS for cyclic shift of DMRS (36.213 Table 9.1.2-2) - previous scheduling
/// This is needed for PHICH generation which
/// is done after a new scheduling
uint8_t previous_n_DMRS;
/// n_DMRS 2 for cyclic shift of DMRS (36.211 Table 5.5.1.1.-1)
uint8_t n_DMRS2;
/// Flag to indicate that this ULSCH is for calibration information sent from UE (i.e. no MAC SDU to pass up)
......
......@@ -1453,8 +1453,12 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
LOG_D(PHY,"[eNB][PUSCH %d/%x] Frame %d subframe %d (pusch_subframe %d,pusch_frame %d) phich active %d\n",
harq_pid,ulsch[UE_id]->rnti,proc->frame_tx,subframe,pusch_subframe,pusch_frame,ulsch[UE_id]->harq_processes[harq_pid]->phich_active);
ngroup_PHICH = (ulsch[UE_id]->harq_processes[harq_pid]->first_rb +
ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS)%Ngroup_PHICH;
/* the HARQ process may have been reused by a new scheduling, so we use
* previous values of first_rb and n_DMRS to compute ngroup_PHICH and nseq_PHICH
*/
ngroup_PHICH = (ulsch[UE_id]->harq_processes[harq_pid]->previous_first_rb +
ulsch[UE_id]->harq_processes[harq_pid]->previous_n_DMRS)%Ngroup_PHICH;
if ((frame_parms->tdd_config == 0) && (frame_parms->frame_type == TDD) ) {
......@@ -1462,20 +1466,28 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
ngroup_PHICH += Ngroup_PHICH;
}
nseq_PHICH = ((ulsch[UE_id]->harq_processes[harq_pid]->first_rb/Ngroup_PHICH) +
ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS)%(2*NSF_PHICH);
nseq_PHICH = ((ulsch[UE_id]->harq_processes[harq_pid]->previous_first_rb/Ngroup_PHICH) +
ulsch[UE_id]->harq_processes[harq_pid]->previous_n_DMRS)%(2*NSF_PHICH);
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d dci_alloc %d)\n",
eNB->Mod_id,harq_pid,proc->frame_tx,
subframe,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,
ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK,
ulsch[UE_id]->harq_processes[harq_pid]->first_rb,
ulsch[UE_id]->harq_processes[harq_pid]->previous_first_rb,
ulsch[UE_id]->harq_processes[harq_pid]->dci_alloc);
T(T_ENB_PHY_PHICH, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(subframe),
T_INT(UE_id), T_INT(ulsch[UE_id]->rnti), T_INT(harq_pid),
T_INT(Ngroup_PHICH), T_INT(NSF_PHICH),
T_INT(ngroup_PHICH), T_INT(nseq_PHICH),
T_INT(ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK),
T_INT(ulsch[UE_id]->harq_processes[harq_pid]->previous_first_rb),
T_INT(ulsch[UE_id]->harq_processes[harq_pid]->previous_n_DMRS));
if (ulsch[UE_id]->Msg3_active == 1) {
LOG_D(PHY,"[eNB %d][PUSCH %d][RAPROC] Frame %d, subframe %d: Generating Msg3 PHICH for UE %d, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d\n",
eNB->Mod_id,harq_pid,proc->frame_tx,subframe,
UE_id,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK,
ulsch[UE_id]->harq_processes[harq_pid]->first_rb);
ulsch[UE_id]->harq_processes[harq_pid]->previous_first_rb);
}
if (eNB->abstraction_flag == 0) {
......
......@@ -228,7 +228,7 @@ int ulsch_decoding_data_2thread0(td_params* tdp) {
LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id];
LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid];
int Q_m = get_Qm_ul(ulsch_harq->mcs);
int G = ulsch_harq->nb_rb * (12 * Q_m) * ulsch_harq->Nsymb_pusch;
int G = ulsch_harq->G;
uint32_t E;
uint32_t Gp,GpmodC,Nl=1;
uint32_t C = ulsch_harq->C;
......@@ -450,7 +450,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id];
LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid];
int Q_m = get_Qm_ul(ulsch_harq->mcs);
int G = ulsch_harq->nb_rb * (12 * Q_m) * ulsch_harq->Nsymb_pusch;
int G = ulsch_harq->G;
unsigned int E;
int Cby2;
......@@ -658,7 +658,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id];
LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid];
int Q_m = get_Qm_ul(ulsch_harq->mcs);
int G = ulsch_harq->nb_rb * (12 * Q_m) * ulsch_harq->Nsymb_pusch;
int G = ulsch_harq->G;
unsigned int E;
uint8_t (*tc)(int16_t *y,
......@@ -1036,6 +1036,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
#endif
G = G - Q_RI - Q_CQI;
ulsch_harq->G = G;
if ((int)G < 0) {
LOG_E(PHY,"FATAL: ulsch_decoding.c G < 0 (%d) : Q_RI %d, Q_CQI %d\n",G,Q_RI,Q_CQI);
......
......@@ -1206,6 +1206,38 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
eNB->dlsch[i][0]->subframe_tx[subframe] = 0;
}
/* save old HARQ information needed for PHICH generation */
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
if (eNB->ulsch[i]) {
/* Store first_rb and n_DMRS for correct PHICH generation below.
* For PHICH generation we need "old" values of last scheduling
* for this HARQ process. 'generate_eNB_dlsch_params' below will
* overwrite first_rb and n_DMRS and 'generate_phich_top', done
* after 'generate_eNB_dlsch_params', would use the "new" values
* instead of the "old" ones.
*
* This has been tested for FDD only, may be wrong for TDD.
*
* TODO: maybe we should restructure the code to be sure it
* is done correctly. The main concern is if the code
* changes and first_rb and n_DMRS are modified before
* we reach here, then the PHICH processing will be wrong,
* using wrong first_rb and n_DMRS values to compute
* ngroup_PHICH and nseq_PHICH.
*
* TODO: check if that works with TDD.
*/
if ((subframe_select(fp,ul_subframe)==SF_UL) ||
(fp->frame_type == FDD)) {
harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe);
eNB->ulsch[i]->harq_processes[harq_pid]->previous_first_rb =
eNB->ulsch[i]->harq_processes[harq_pid]->first_rb;
eNB->ulsch[i]->harq_processes[harq_pid]->previous_n_DMRS =
eNB->ulsch[i]->harq_processes[harq_pid]->n_DMRS;
}
}
}
num_pdcch_symbols = DCI_pdu->num_pdcch_symbols;
LOG_D(PHY,"num_pdcch_symbols %"PRIu8",(dci common %"PRIu8", dci uespec %"PRIu8"\n",num_pdcch_symbols,
......
......@@ -828,9 +828,6 @@ void schedule_ulsch_rnti(module_id_t module_idP,
UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power=target_rx_power;
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1=UE_template->pre_assigned_mcs_ul;
mcs = UE_template->pre_assigned_mcs_ul;//cmin (UE_template->pre_assigned_mcs_ul, openair_daq_vars.target_ue_ul_mcs); // adjust, based on user-defined MCS
if ((cqi_req==1) && (mcs>19)) {
mcs=19;
}
if (UE_template->pre_allocated_rb_table_index_ul >=0) {
rb_table_index=UE_template->pre_allocated_rb_table_index_ul;
} else {
......
No preview for this file type
No preview for this file type
......@@ -38,6 +38,7 @@ eNBs =
Nid_cell_mbsfn = 0;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
nb_antenna_ports = 1;
tx_gain = 90;
rx_gain = 125;
prach_root = 0;
......@@ -100,6 +101,7 @@ eNBs =
ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1;
ue_TransmissionMode = 1;
}
);
......
......@@ -38,6 +38,7 @@ eNBs =
Nid_cell_mbsfn = 0;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
nb_antenna_ports = 1;
tx_gain = 90;
rx_gain = 125;
prach_root = 0;
......@@ -100,6 +101,7 @@ eNBs =
ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1;
ue_TransmissionMode = 1;
}
);
......
......@@ -1305,7 +1305,7 @@ extern void init_te_thread(PHY_VARS_eNB *, pthread_attr_t *);
void init_eNB_proc(int inst) {
int i;
int i=0;
int CC_id;
PHY_VARS_eNB *eNB;
eNB_proc_t *proc;
......
......@@ -1807,11 +1807,19 @@ int main( int argc, char **argv )
// start the main thread
if (UE_flag == 1) init_UE(1);
if (UE_flag == 1) {
init_UE(1);
number_of_cards = 1;
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
PHY_vars_UE_g[0][CC_id]->rf_map.card=0;
PHY_vars_UE_g[0][CC_id]->rf_map.chain=CC_id+chain_offset;
}
}
else {
init_eNB(node_function,node_timing,1,eth_params,single_thread_flag);
// Sleep to allow all threads to setup
// Sleep to allow all threads to setup
number_of_cards = 1;
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
......
......@@ -220,7 +220,7 @@ static void *UE_thread_synch(void *arg)
int current_band = 0;
int current_offset = 0;
sync_mode_t sync_mode = pbch;
int card;
int CC_id = UE->CC_id;
int ind;
int found;
int freq_offset=0;
......@@ -312,9 +312,8 @@ static void *UE_thread_synch(void *arg)
printf( "Scanning band %d, dl_min %"PRIu32", ul_min %"PRIu32"\n", current_band, eutra_bands[ind].dl_min,eutra_bands[ind].ul_min);
if ((eutra_bands[ind].dl_min <= downlink_frequency[0][0]) && (eutra_bands[ind].dl_max >= downlink_frequency[0][0])) {
for (card=0; card<MAX_NUM_CCs; card++)
for (i=0; i<4; i++)
uplink_frequency_offset[card][i] = eutra_bands[ind].ul_min - eutra_bands[ind].dl_min;
for (i=0; i<4; i++)
uplink_frequency_offset[CC_id][i] = eutra_bands[ind].ul_min - eutra_bands[ind].dl_min;
found = 1;
break;
......@@ -333,16 +332,16 @@ static void *UE_thread_synch(void *arg)
LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %"PRIu32", UL %"PRIu32" (oai_exit %d)\n", downlink_frequency[0][0], downlink_frequency[0][0]+uplink_frequency_offset[0][0],oai_exit );
LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %"PRIu32", UL %"PRIu32" (oai_exit %d, rx_num_channels %d)\n", downlink_frequency[0][0], downlink_frequency[0][0]+uplink_frequency_offset[0][0],oai_exit, openair0_cfg[0].rx_num_channels);
for (i=0;i<openair0_cfg[0].rx_num_channels;i++) {
openair0_cfg[0].rx_freq[i] = downlink_frequency[0][i];
openair0_cfg[0].tx_freq[i] = downlink_frequency[0][i]+uplink_frequency_offset[0][i];
openair0_cfg[0].autocal[i] = 1;
if (uplink_frequency_offset[0][i] != 0) //
openair0_cfg[0].duplex_mode = duplex_mode_FDD;
for (i=0;i<openair0_cfg[UE->rf_map.card].rx_num_channels;i++) {
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i] = downlink_frequency[CC_id][i];
openair0_cfg[UE->rf_map.card].tx_freq[UE->rf_map.chain+i] = downlink_frequency[CC_id][i]+uplink_frequency_offset[CC_id][i];
openair0_cfg[UE->rf_map.card].autocal[UE->rf_map.chain+i] = 1;
if (uplink_frequency_offset[CC_id][i] != 0) //
openair0_cfg[UE->rf_map.card].duplex_mode = duplex_mode_FDD;
else //FDD
openair0_cfg[0].duplex_mode = duplex_mode_TDD;
openair0_cfg[UE->rf_map.card].duplex_mode = duplex_mode_TDD;
}
sync_mode = pbch;
......@@ -350,18 +349,14 @@ static void *UE_thread_synch(void *arg)
} else if (UE->UE_scan == 1) {
current_band=0;
for (card=0; card<MAX_CARDS; card++) {
for (i=0; i<openair0_cfg[card].rx_num_channels; i++) {
downlink_frequency[card][i] = bands_to_scan.band_info[0].dl_min;
uplink_frequency_offset[card][i] = bands_to_scan.band_info[0].ul_min-bands_to_scan.band_info[0].dl_min;
openair0_cfg[card].rx_freq[i] = downlink_frequency[card][i];
openair0_cfg[card].tx_freq[i] = downlink_frequency[card][i]+uplink_frequency_offset[card][i];
openair0_cfg[card].rx_gain[i] = UE->rx_total_gain_dB;
printf( "UE synch: setting RX gain (%d,%d) to %f\n", card, i, openair0_cfg[card].rx_gain[i] );
}
for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) {
downlink_frequency[UE->rf_map.card][UE->rf_map.chain+i] = bands_to_scan.band_info[CC_id].dl_min;
uplink_frequency_offset[UE->rf_map.card][UE->rf_map.chain+i] = bands_to_scan.band_info[CC_id].ul_min-bands_to_scan.band_info[CC_id].dl_min;
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i] = downlink_frequency[CC_id][i];
openair0_cfg[UE->rf_map.card].tx_freq[UE->rf_map.chain+i] = downlink_frequency[CC_id][i]+uplink_frequency_offset[CC_id][i];
openair0_cfg[UE->rf_map.card].rx_gain[UE->rf_map.chain+i] = UE->rx_total_gain_dB;
}
}
......@@ -417,28 +412,19 @@ static void *UE_thread_synch(void *arg)
oai_exit=1;
}
for (card=0; card<MAX_CARDS; card++) {
for (i=0; i<openair0_cfg[card].rx_num_channels; i++) {
downlink_frequency[card][i] = bands_to_scan.band_info[current_band].dl_min+current_offset;
uplink_frequency_offset[card][i] = bands_to_scan.band_info[current_band].ul_min-bands_to_scan.band_info[0].dl_min + current_offset;
openair0_cfg[card].rx_freq[i] = downlink_frequency[card][i];
openair0_cfg[card].tx_freq[i] = downlink_frequency[card][i]+uplink_frequency_offset[card][i];
openair0_cfg[card].rx_gain[i] = UE->rx_total_gain_dB;
printf("UE synch: setting RX gain (%d,%d) to %f\n",card,i,openair0_cfg[card].rx_gain[i]);
}
}
if (UE->UE_scan_carrier) {
for (i=0;i<openair0_cfg[0].rx_num_channels;i++)
openair0_cfg[0].autocal[i] = 1;
for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) {
downlink_frequency[UE->rf_map.card][UE->rf_map.chain+i] = bands_to_scan.band_info[current_band].dl_min+current_offset;
uplink_frequency_offset[UE->rf_map.card][UE->rf_map.chain+i] = bands_to_scan.band_info[current_band].ul_min-bands_to_scan.band_info[0].dl_min + current_offset;
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i] = downlink_frequency[CC_id][i];
openair0_cfg[UE->rf_map.card].tx_freq[UE->rf_map.chain+i] = downlink_frequency[CC_id][i]+uplink_frequency_offset[CC_id][i];
openair0_cfg[UE->rf_map.card].rx_gain[UE->rf_map.chain+i] = UE->rx_total_gain_dB;
if (UE->UE_scan_carrier) {
openair0_cfg[UE->rf_map.card].autocal[UE->rf_map.chain+i] = 1;
}
}
break;
case pbch:
......@@ -452,42 +438,42 @@ static void *UE_thread_synch(void *arg)
UE->UE_scan_carrier = 0;
// rerun with new cell parameters and frequency-offset
for (i=0;i<openair0_cfg[0].rx_num_channels;i++) {
openair0_cfg[0].rx_gain[i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET;
openair0_cfg[0].rx_freq[i] -= UE->common_vars.freq_offset;
openair0_cfg[0].tx_freq[i] = openair0_cfg[0].rx_freq[i]+uplink_frequency_offset[0][i];
downlink_frequency[0][i] = openair0_cfg[0].rx_freq[i];
for (i=0;i<openair0_cfg[UE->rf_map.card].rx_num_channels;i++) {
openair0_cfg[UE->rf_map.card].rx_gain[UE->rf_map.chain+i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET;
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i] -= UE->common_vars.freq_offset;
openair0_cfg[UE->rf_map.card].tx_freq[UE->rf_map.chain+i] = openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i]+uplink_frequency_offset[CC_id][i];
downlink_frequency[CC_id][i] = openair0_cfg[CC_id].rx_freq[i];
freq_offset=0;
}
// reconfigure for potentially different bandwidth
switch(UE->frame_parms.N_RB_DL) {
case 6:
openair0_cfg[0].sample_rate =1.92e6;
openair0_cfg[0].rx_bw =.96e6;
openair0_cfg[0].tx_bw =.96e6;
openair0_cfg[UE->rf_map.card].sample_rate =1.92e6;
openair0_cfg[UE->rf_map.card].rx_bw =.96e6;
openair0_cfg[UE->rf_map.card].tx_bw =.96e6;
// openair0_cfg[0].rx_gain[0] -= 12;
break;
case 25:
openair0_cfg[0].sample_rate =7.68e6;
openair0_cfg[0].rx_bw =2.5e6;
openair0_cfg[0].tx_bw =2.5e6;
openair0_cfg[UE->rf_map.card].sample_rate =7.68e6;
openair0_cfg[UE->rf_map.card].rx_bw =2.5e6;
openair0_cfg[UE->rf_map.card].tx_bw =2.5e6;
// openair0_cfg[0].rx_gain[0] -= 6;
break;
case 50:
openair0_cfg[0].sample_rate =15.36e6;
openair0_cfg[0].rx_bw =5.0e6;
openair0_cfg[0].tx_bw =5.0e6;
openair0_cfg[UE->rf_map.card].sample_rate =15.36e6;
openair0_cfg[UE->rf_map.card].rx_bw =5.0e6;
openair0_cfg[UE->rf_map.card].tx_bw =5.0e6;
// openair0_cfg[0].rx_gain[0] -= 3;
break;
case 100:
openair0_cfg[0].sample_rate=30.72e6;
openair0_cfg[0].rx_bw=10.0e6;
openair0_cfg[0].tx_bw=10.0e6;
openair0_cfg[UE->rf_map.card].sample_rate=30.72e6;
openair0_cfg[UE->rf_map.card].rx_bw=10.0e6;
openair0_cfg[UE->rf_map.card].tx_bw=10.0e6;
// openair0_cfg[0].rx_gain[0] -= 0;
break;
}
UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0);
//UE->rfdevice.trx_set_gains_func(&openair0,&openair0_cfg[0]);
UE->rfdevice.trx_stop_func(&UE->rfdevice);
......@@ -559,25 +545,19 @@ static void *UE_thread_synch(void *arg)
downlink_frequency[0][0]+freq_offset,
downlink_frequency[0][0]+uplink_frequency_offset[0][0]+freq_offset );
for (card=0; card<MAX_CARDS; card++) {
for (i=0; i<openair0_cfg[card].rx_num_channels; i++) {
openair0_cfg[card].rx_freq[i] = downlink_frequency[card][i]+freq_offset;
openair0_cfg[card].tx_freq[i] = downlink_frequency[card][i]+uplink_frequency_offset[card][i]+freq_offset;
openair0_cfg[card].rx_gain[i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET;
UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0);
}
}
if (UE->UE_scan_carrier==1) {
for (i=0;i<openair0_cfg[0].rx_num_channels;i++) {
// openair0_cfg[0].autocal[i] = 1;
for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) {
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i] = downlink_frequency[CC_id][i]+freq_offset;
openair0_cfg[UE->rf_map.card].tx_freq[UE->rf_map.chain+i] = downlink_frequency[CC_id][i]+uplink_frequency_offset[CC_id][i]+freq_offset;
openair0_cfg[UE->rf_map.card].rx_gain[UE->rf_map.chain+i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET;
if (UE->UE_scan_carrier==1) {
openair0_cfg[UE->rf_map.card].autocal[UE->rf_map.chain+i] = 1;
}
}
UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0);
}// initial_sync=0
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment