Merge remote-tracking branch 'origin/develop' into develop-uedirectorysplit
Conflicts: openair1/PHY/INIT/lte_init.c openair1/PHY/LTE_TRANSPORT/dci_tools.c openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h openair1/PHY/defs_eNB.h openair1/SCHED_UE/phy_procedures_lte_ue.c openair2/LAYER2/MAC/mac.h targets/RT/USER/lte-enb.c targets/RT/USER/lte-softmodem.h
This commit is contained in:
@@ -117,7 +117,7 @@ int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cf
|
||||
rc=load_lib(device, openair0_cfg, NULL,RAU_LOCAL_RADIO_HEAD );
|
||||
|
||||
if ( rc >= 0) {
|
||||
if ( set_device(device) < 0) {
|
||||
if ( set_device(device) < 0) {
|
||||
fprintf(stderr, "%s %d:Unsupported radio head\n",__FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -982,15 +982,20 @@ extern "C" {
|
||||
// workaround for an api problem, master clock has to be set with the constructor not via set_master_clock_rate
|
||||
args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock);
|
||||
|
||||
// args += ",num_send_frames=256,num_recv_frames=256, send_frame_size=4096, recv_frame_size=4096";
|
||||
|
||||
// args += ",num_send_frames=256,num_recv_frames=256, send_frame_size=4096, recv_frame_size=4096";
|
||||
uhd::device_addrs_t device_adds = uhd::device::find(args);
|
||||
|
||||
if(device_adds.size() == 0) {
|
||||
std::cerr<<"No USRP Device Found. " << std::endl;
|
||||
free(s);
|
||||
return -1;
|
||||
args += ",addr=192.168.30.2";
|
||||
|
||||
uhd::device_addrs_t device_adds = uhd::device::find(args);
|
||||
|
||||
if(device_adds.size() == 0) {
|
||||
|
||||
std::cerr<<"No USRP Device Found. " << std::endl;
|
||||
free(s);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
LOG_I(PHY,"Found USRP X300\n");
|
||||
s->usrp = uhd::usrp::multi_usrp::make(args);
|
||||
@@ -1016,6 +1021,20 @@ extern "C" {
|
||||
LOG_I(PHY,"%s() sample_rate:%u\n", __FUNCTION__, (int)openair0_cfg[0].sample_rate);
|
||||
|
||||
switch ((int)openair0_cfg[0].sample_rate) {
|
||||
case 122880000:
|
||||
// from usrp_time_offset
|
||||
//openair0_cfg[0].samples_per_packet = 2048;
|
||||
openair0_cfg[0].tx_sample_advance = 15; //to be checked
|
||||
openair0_cfg[0].tx_bw = 80e6;
|
||||
openair0_cfg[0].rx_bw = 80e6;
|
||||
break;
|
||||
case 61440000:
|
||||
// from usrp_time_offset
|
||||
//openair0_cfg[0].samples_per_packet = 2048;
|
||||
openair0_cfg[0].tx_sample_advance = 15;
|
||||
openair0_cfg[0].tx_bw = 40e6;
|
||||
openair0_cfg[0].rx_bw = 40e6;
|
||||
break;
|
||||
case 30720000:
|
||||
// from usrp_time_offset
|
||||
//openair0_cfg[0].samples_per_packet = 2048;
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
# endif
|
||||
# include "enb_app.h"
|
||||
|
||||
extern int emulate_rf;
|
||||
|
||||
int create_tasks(uint32_t enb_nb)
|
||||
{
|
||||
LOG_D(ENB_APP, "%s(enb_nb:%d\n", __FUNCTION__, enb_nb);
|
||||
@@ -69,10 +71,11 @@ int create_tasks(uint32_t enb_nb)
|
||||
LOG_E(S1AP, "Create task for S1AP failed\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (itti_create_task (TASK_UDP, udp_eNB_task, NULL) < 0) {
|
||||
LOG_E(UDP_, "Create task for UDP failed\n");
|
||||
return -1;
|
||||
if(!emulate_rf){
|
||||
if (itti_create_task (TASK_UDP, udp_eNB_task, NULL) < 0) {
|
||||
LOG_E(UDP_, "Create task for UDP failed\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (itti_create_task (TASK_GTPV1_U, >pv1u_eNB_task, NULL) < 0) {
|
||||
|
||||
@@ -0,0 +1,209 @@
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
eNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
eNB_ID = 0xe00;
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
mobile_country_code = "208";
|
||||
|
||||
mobile_network_code = "93";
|
||||
|
||||
tr_s_preference = "local_mac"
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
node_function = "eNodeB_3GPP";
|
||||
node_timing = "synch_to_ext_device";
|
||||
node_synch_ref = 0;
|
||||
frame_type = "FDD";
|
||||
tdd_config = 3;
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2685000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 100;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 125;
|
||||
pbch_repetition = "FALSE";
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
prach_zero_correlation = 1;
|
||||
prach_freq_offset = 2;
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 1;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pdsch_referenceSignalPower = -27;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
pusch_hoppingMode = "interSubFrame";
|
||||
pusch_hoppingOffset = 0;
|
||||
pusch_groupHoppingEnabled = "ENABLE";
|
||||
pusch_groupAssignment = 0;
|
||||
pusch_sequenceHoppingEnabled = "DISABLE";
|
||||
pusch_nDMRS1 = 1;
|
||||
phich_duration = "NORMAL";
|
||||
phich_resource = "ONESIXTH";
|
||||
srs_enable = "DISABLE";
|
||||
/* srs_BandwidthConfig =;
|
||||
srs_SubframeConfig =;
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
pucch_deltaF_Format2 = "deltaF0";
|
||||
pucch_deltaF_Format2a = "deltaF0";
|
||||
pucch_deltaF_Format2b = "deltaF0";
|
||||
|
||||
rach_numberOfRA_Preambles = 64;
|
||||
rach_preamblesGroupAConfig = "DISABLE";
|
||||
/*
|
||||
rach_sizeOfRA_PreamblesGroupA = ;
|
||||
rach_messageSizeGroupA = ;
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
*/
|
||||
rach_powerRampingStep = 4;
|
||||
rach_preambleInitialReceivedTargetPower = -108;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 48;
|
||||
rach_maxHARQ_Msg3Tx = 4;
|
||||
|
||||
pcch_default_PagingCycle = 128;
|
||||
pcch_nB = "oneT";
|
||||
bcch_modificationPeriodCoeff = 2;
|
||||
ue_TimersAndConstants_t300 = 1000;
|
||||
ue_TimersAndConstants_t301 = 1000;
|
||||
ue_TimersAndConstants_t310 = 1000;
|
||||
ue_TimersAndConstants_t311 = 10000;
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
ue_TransmissionMode = 1;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
srb1_parameters :
|
||||
{
|
||||
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
|
||||
timer_poll_retransmit = 80;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
|
||||
timer_reordering = 35;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
|
||||
timer_status_prohibit = 0;
|
||||
|
||||
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
|
||||
poll_pdu = 4;
|
||||
|
||||
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
|
||||
poll_byte = 99999;
|
||||
|
||||
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
|
||||
max_retx_threshold = 4;
|
||||
}
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.26";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth6";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24";
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth6";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
}
|
||||
);
|
||||
|
||||
L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
}
|
||||
);
|
||||
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 1
|
||||
nb_rx = 1
|
||||
att_tx = 0
|
||||
att_rx = 0;
|
||||
bands = [7];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 116;
|
||||
eNB_instances = [0];
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="medium";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
|
||||
@@ -151,9 +151,9 @@ eNBs =
|
||||
{
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.19/24";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24";
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.19/24";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
}
|
||||
@@ -164,6 +164,7 @@ MACRLCs = (
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
phy_test_mode = 1;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -73,8 +73,7 @@ eNBs =
|
||||
srs_SubframeConfig =;
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_p0_Nominal = -104;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
|
||||
@@ -11,7 +11,7 @@ RUs = (
|
||||
tr_preference = "udp_if4p5";
|
||||
nb_tx = 1;
|
||||
nb_rx = 1;
|
||||
max_pdschReferenceSignalPower = -29;
|
||||
max_pdschReferenceSignalPower = -15;
|
||||
max_rxgain = 120;
|
||||
bands = [7,13];
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
[*]
|
||||
[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI
|
||||
[*] Tue Jul 25 20:26:12 2017
|
||||
[*] Thu Feb 22 14:46:40 2018
|
||||
[*]
|
||||
[dumpfile] "/tmp/openair_dump_eNB.vcd"
|
||||
[dumpfile_mtime] "Tue Jul 25 20:11:55 2017"
|
||||
[dumpfile_size] 19201475
|
||||
[savefile] "/home/papillon/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw"
|
||||
[timestart] 29023604000
|
||||
[size] 1236 578
|
||||
[pos] 309 0
|
||||
*-20.793451 29026062100 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
|
||||
[dumpfile_mtime] "Thu Feb 22 14:44:26 2018"
|
||||
[dumpfile_size] 3482761
|
||||
[savefile] "/homes/wangts/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw"
|
||||
[timestart] 4525000000
|
||||
[size] 1920 1018
|
||||
[pos] 0 22
|
||||
*-21.506693 4530514310 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
|
||||
[sst_width] 386
|
||||
[signals_width] 262
|
||||
[signals_width] 344
|
||||
[sst_expanded] 1
|
||||
[sst_vpaned_height] 146
|
||||
[sst_vpaned_height] 303
|
||||
@28
|
||||
functions.trx_read
|
||||
functions.trx_write
|
||||
@@ -25,12 +25,42 @@ functions.eNB_thread_rxtx0
|
||||
@24
|
||||
variables.frame_number_RX0_RU[63:0]
|
||||
variables.subframe_number_RX0_RU[63:0]
|
||||
@25
|
||||
variables.frame_number_TX0_RU[63:0]
|
||||
@24
|
||||
variables.subframe_number_TX0_RU[63:0]
|
||||
@28
|
||||
functions.mac_schedule_dlsch
|
||||
functions.macxface_eNB_dlsch_ulsch_scheduler
|
||||
functions.macxface_ue_scheduler
|
||||
functions.phy_eNB_ofdm_mod_l
|
||||
@24
|
||||
variables.frame_number_RX0_eNB[63:0]
|
||||
@25
|
||||
variables.subframe_number_RX0_eNB[63:0]
|
||||
@24
|
||||
variables.frame_number_TX0_eNB[63:0]
|
||||
variables.subframe_number_TX0_eNB[63:0]
|
||||
variables.frame_number_RX1_eNB[63:0]
|
||||
variables.subframe_number_RX1_eNB[63:0]
|
||||
variables.frame_number_TX1_eNB[63:0]
|
||||
variables.subframe_number_TX1_eNB[63:0]
|
||||
@28
|
||||
functions.phy_eNB_dlsch_modulation
|
||||
functions.phy_eNB_dlsch_encoding
|
||||
functions.phy_eNB_dlsch_scrambling
|
||||
functions.phy_eNB_beam_precoding
|
||||
functions.phy_enb_pdcch_tx
|
||||
functions.phy_enb_prach_rx
|
||||
functions.phy_procedures_ru_feprx0
|
||||
functions.phy_procedures_eNb_rx_uespec0
|
||||
functions.phy_procedures_eNb_rx_uespec1
|
||||
functions.phy_enb_sfgen
|
||||
functions.phy_procedures_eNb_tx0
|
||||
functions.phy_procedures_eNb_tx1
|
||||
functions.phy_procedures_ru_feprx1
|
||||
functions.phy_procedures_ru_feptx_ofdm0
|
||||
functions.phy_procedures_ru_feptx_ofdm1
|
||||
functions.phy_procedures_ru_feptx_prec0
|
||||
functions.phy_procedures_ru_feptx_prec1
|
||||
functions.eNB_thread_rxtx1
|
||||
functions.phy_enb_sfgen
|
||||
functions.phy_enb_prach_rx
|
||||
|
||||
+286
-66
@@ -145,11 +145,13 @@ void exit_fun(const char* s);
|
||||
void init_eNB(int,int);
|
||||
void stop_eNB(int nb_inst);
|
||||
|
||||
|
||||
int wakeup_tx(PHY_VARS_eNB *eNB,RU_proc_t *ru_proc);
|
||||
int wakeup_txfh(eNB_rxtx_proc_t *proc,RU_proc_t *ru_proc);
|
||||
void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
|
||||
#ifdef Rel14
|
||||
void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
|
||||
#endif
|
||||
extern int codingw;
|
||||
|
||||
extern uint8_t nfapi_mode;
|
||||
extern void oai_subframe_ind(uint16_t sfn, uint16_t sf);
|
||||
@@ -217,6 +219,15 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
|
||||
if (nfapi_mode == 0 || nfapi_mode == 1) {
|
||||
phy_procedures_eNB_uespec_RX(eNB, proc);
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 1 );
|
||||
|
||||
if(get_nprocs() >= 8){
|
||||
if(wait_on_condition(&proc[1].mutex_rxtx,&proc[1].cond_rxtx,&proc[1].pipe_ready,"wakeup_tx")<0) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: TX1 not ready\n",proc[1].frame_rx,proc[1].subframe_rx);
|
||||
return(-1);
|
||||
}
|
||||
if (release_thread(&proc[1].mutex_rxtx,&proc[1].pipe_ready,"wakeup_tx")<0) return(-1);
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
|
||||
@@ -228,17 +239,12 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
|
||||
eNB->if_inst->UL_indication(&eNB->UL_INFO);
|
||||
|
||||
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
|
||||
|
||||
// *****************************************
|
||||
// TX processing for subframe n+sf_ahead
|
||||
// run PHY TX procedures the one after the other for all CCs to avoid race conditions
|
||||
// (may be relaxed in the future for performance reasons)
|
||||
// *****************************************
|
||||
//if (wait_CCs(proc)<0) return(-1);
|
||||
|
||||
if (oai_exit) return(-1);
|
||||
|
||||
phy_procedures_eNB_TX(eNB, proc, 1);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 0 );
|
||||
if(oai_exit) return(-1);
|
||||
if(get_nprocs() <= 4){
|
||||
phy_procedures_eNB_TX(eNB, proc, 1);
|
||||
}
|
||||
|
||||
stop_meas( &softmodem_stats_rxtx_sf );
|
||||
|
||||
@@ -290,6 +296,50 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
|
||||
}
|
||||
|
||||
|
||||
static void* tx_thread(void* param) {
|
||||
|
||||
eNB_proc_t *eNB_proc = (eNB_proc_t*)param;
|
||||
eNB_rxtx_proc_t *proc = &eNB_proc->proc_rxtx[1];
|
||||
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
|
||||
|
||||
char thread_name[100];
|
||||
sprintf(thread_name,"TXnp4_%d\n",&eNB->proc.proc_rxtx[0] == proc ? 0 : 1);
|
||||
thread_top_init(thread_name,1,470000,500000,500000);
|
||||
|
||||
//wait_sync("tx_thread");
|
||||
|
||||
while (!oai_exit) {
|
||||
|
||||
|
||||
if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break;
|
||||
if (oai_exit) break;
|
||||
// *****************************************
|
||||
// TX processing for subframe n+4
|
||||
// run PHY TX procedures the one after the other for all CCs to avoid race conditions
|
||||
// (may be relaxed in the future for performance reasons)
|
||||
// *****************************************
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX1_ENB,proc->subframe_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX1_ENB,proc->subframe_rx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_ENB,proc->frame_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX1_ENB,proc->frame_rx);
|
||||
|
||||
phy_procedures_eNB_TX(eNB, proc, no_relay, NULL, 1);
|
||||
if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break;
|
||||
|
||||
pthread_mutex_lock( &proc->mutex_rxtx );
|
||||
proc->pipe_ready++;
|
||||
// the thread can now be woken up
|
||||
if (pthread_cond_signal(&proc->cond_rxtx) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
}
|
||||
pthread_mutex_unlock( &proc->mutex_rxtx );
|
||||
wakeup_txfh(proc,eNB_proc->ru_proc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief The RX UE-specific and TX thread of eNB.
|
||||
* \param param is a \ref eNB_proc_t structure which contains the info what to process.
|
||||
@@ -299,36 +349,66 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
|
||||
static void* eNB_thread_rxtx( void* param ) {
|
||||
|
||||
static int eNB_thread_rxtx_status;
|
||||
|
||||
eNB_rxtx_proc_t *proc = (eNB_rxtx_proc_t*)param;
|
||||
eNB_proc_t *eNB_proc = (eNB_proc_t*)param;
|
||||
eNB_rxtx_proc_t *proc = &eNB_proc->proc_rxtx[0];
|
||||
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
|
||||
//RU_proc_t *ru_proc = NULL;
|
||||
|
||||
char thread_name[100];
|
||||
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO(&cpuset);
|
||||
|
||||
// set default return value
|
||||
eNB_thread_rxtx_status = 0;
|
||||
|
||||
|
||||
sprintf(thread_name,"RXn_TXnp4_%d",&eNB->proc.proc_rxtx[0] == proc ? 0 : 1);
|
||||
thread_top_init(thread_name,1,850000L,1000000L,2000000L);
|
||||
sprintf(thread_name,"RXn_TXnp4_%d\n",&eNB->proc.proc_rxtx[0] == proc ? 0 : 1);
|
||||
thread_top_init(thread_name,1,470000,500000,500000);
|
||||
pthread_setname_np( pthread_self(),"rxtx processing");
|
||||
LOG_I(PHY,"thread rxtx created id=%ld\n", syscall(__NR_gettid));
|
||||
|
||||
|
||||
|
||||
while (!oai_exit) {
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
|
||||
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx));
|
||||
|
||||
if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_CPUID_ENB_THREAD_RXTX,sched_getcpu());
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 );
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_ENB,proc->subframe_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_ENB,proc->subframe_rx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_ENB,proc->frame_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_ENB,proc->frame_rx);
|
||||
|
||||
|
||||
if (oai_exit) break;
|
||||
|
||||
if (eNB->CC_id==0)
|
||||
{
|
||||
if (rxtx(eNB,proc,thread_name) < 0) break;
|
||||
|
||||
}
|
||||
|
||||
if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break;
|
||||
pthread_mutex_lock( &proc->mutex_rxtx );
|
||||
proc->pipe_ready++;
|
||||
// the thread can now be woken up
|
||||
if (pthread_cond_signal(&proc->cond_rxtx) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
}
|
||||
pthread_mutex_unlock( &proc->mutex_rxtx );
|
||||
if(get_nprocs() >= 8) wakeup_tx(eNB,eNB->proc.ru_proc);
|
||||
else
|
||||
{
|
||||
phy_procedures_eNB_TX(eNB, proc, no_relay, NULL, 1);
|
||||
wakeup_txfh(proc,eNB->proc.ru_proc);
|
||||
}
|
||||
|
||||
} // while !oai_exit
|
||||
|
||||
@@ -364,10 +444,12 @@ static void wait_system_ready (char *message, volatile int *start_flag) {
|
||||
|
||||
|
||||
|
||||
void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string)
|
||||
void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t *ru)
|
||||
{
|
||||
eNB_proc_t *proc = &eNB->proc;
|
||||
eNB_rxtx_proc_t *proc_rxtx = &proc->proc_rxtx[0];
|
||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||
RU_proc_t *ru_proc=&ru->proc;
|
||||
|
||||
proc->frame_rx = frame_rx;
|
||||
proc->subframe_rx = subframe_rx;
|
||||
@@ -375,23 +457,113 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string)
|
||||
if (!oai_exit) {
|
||||
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx));
|
||||
|
||||
proc_rxtx->subframe_rx = proc->subframe_rx;
|
||||
proc_rxtx->frame_rx = proc->frame_rx;
|
||||
proc_rxtx->subframe_tx = (proc->subframe_rx+sf_ahead)%10;
|
||||
proc_rxtx->frame_tx = (proc->subframe_rx>(9-sf_ahead)) ? (1+proc->frame_rx)&1023 : proc->frame_rx;
|
||||
proc->frame_tx = proc_rxtx->frame_tx;
|
||||
proc_rxtx->timestamp_tx = proc->timestamp_tx;
|
||||
proc_rxtx->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti);
|
||||
proc_rxtx->frame_rx = ru_proc->frame_rx;
|
||||
proc_rxtx->subframe_rx = ru_proc->subframe_rx;
|
||||
proc_rxtx->frame_tx = (proc_rxtx->subframe_rx > (9-sf_ahead)) ? (proc_rxtx->frame_rx+1)&1023 : proc_rxtx->frame_rx;
|
||||
proc_rxtx->subframe_tx = (proc_rxtx->subframe_rx + sf_ahead)%10;
|
||||
|
||||
if (rxtx(eNB,proc_rxtx,string) < 0) LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id);
|
||||
ru_proc->timestamp_tx = proc_rxtx->timestamp_tx;
|
||||
ru_proc->subframe_tx = proc_rxtx->subframe_tx;
|
||||
ru_proc->frame_tx = proc_rxtx->frame_tx;
|
||||
}
|
||||
}
|
||||
|
||||
int wakeup_txfh(eNB_rxtx_proc_t *proc,RU_proc_t *ru_proc) {
|
||||
|
||||
struct timespec wait;
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
|
||||
|
||||
if(wait_on_condition(&ru_proc->mutex_eNBs,&ru_proc->cond_eNBs,&ru_proc->ru_tx_ready,"wakeup_txfh")<0) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", ru_proc->frame_tx, ru_proc->subframe_tx);
|
||||
return(-1);
|
||||
}
|
||||
if (release_thread(&ru_proc->mutex_eNBs,&ru_proc->ru_tx_ready,"wakeup_txfh")<0) return(-1);
|
||||
|
||||
if (ru_proc->instance_cnt_eNBs == 0) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->subframe_tx, proc->frame_rx, proc->subframe_rx);
|
||||
return(-1);
|
||||
}
|
||||
if (pthread_mutex_timedlock(&ru_proc->mutex_eNBs,&wait) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", ru_proc->subframe_rx&1,ru_proc->instance_cnt_eNBs );
|
||||
exit_fun( "error locking mutex_eNB" );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
++ru_proc->instance_cnt_eNBs;
|
||||
ru_proc->timestamp_tx = proc->timestamp_tx;
|
||||
ru_proc->subframe_tx = proc->subframe_tx;
|
||||
ru_proc->frame_tx = proc->frame_tx;
|
||||
|
||||
// the thread can now be woken up
|
||||
if (pthread_cond_signal(&ru_proc->cond_eNBs) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock( &ru_proc->mutex_eNBs );
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
int wakeup_tx(PHY_VARS_eNB *eNB,RU_proc_t *ru_proc) {
|
||||
|
||||
eNB_proc_t *proc=&eNB->proc;
|
||||
|
||||
eNB_rxtx_proc_t *proc_rxtx1=&proc->proc_rxtx[1];//*proc_rxtx=&proc->proc_rxtx[proc->frame_rx&1];
|
||||
eNB_rxtx_proc_t *proc_rxtx0=&proc->proc_rxtx[0];
|
||||
|
||||
|
||||
struct timespec wait;
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
|
||||
|
||||
|
||||
if (proc_rxtx1->instance_cnt_rxtx == 0) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: TX1 thread busy, dropping\n",proc_rxtx1->frame_rx,proc_rxtx1->subframe_rx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (pthread_mutex_timedlock(&proc_rxtx1->mutex_rxtx,&wait) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", proc_rxtx1->subframe_rx&1,proc_rxtx1->instance_cnt_rxtx );
|
||||
exit_fun( "error locking mutex_tx" );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
++proc_rxtx1->instance_cnt_rxtx;
|
||||
|
||||
|
||||
proc_rxtx1->subframe_rx = proc_rxtx0->subframe_rx;
|
||||
proc_rxtx1->frame_rx = proc_rxtx0->frame_rx;
|
||||
proc_rxtx1->subframe_tx = proc_rxtx0->subframe_tx;
|
||||
proc_rxtx1->frame_tx = proc_rxtx0->frame_tx;
|
||||
proc_rxtx1->timestamp_tx = proc_rxtx0->timestamp_tx;
|
||||
|
||||
// the thread can now be woken up
|
||||
if (pthread_cond_signal(&proc_rxtx1->cond_rxtx) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock( &proc_rxtx1->mutex_rxtx );
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
|
||||
eNB_proc_t *proc=&eNB->proc;
|
||||
RU_proc_t *ru_proc=&ru->proc;
|
||||
|
||||
eNB_rxtx_proc_t *proc_rxtx=&proc->proc_rxtx[proc->frame_rx&1];
|
||||
eNB_rxtx_proc_t *proc_rxtx0=&proc->proc_rxtx[0];//*proc_rxtx=&proc->proc_rxtx[proc->frame_rx&1];
|
||||
//eNB_rxtx_proc_t *proc_rxtx1=&proc->proc_rxtx[1];
|
||||
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
|
||||
@@ -423,25 +595,28 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
|
||||
/* accept some delay in processing - up to 5ms */
|
||||
for (i = 0; i < 10 && proc_rxtx->instance_cnt_rxtx == 0; i++) {
|
||||
LOG_W( PHY,"[eNB] Frame %d Subframe %d, eNB RXn-TXnp4 thread busy!! (cnt_rxtx %i)\n", proc_rxtx->frame_tx, proc_rxtx->subframe_tx, proc_rxtx->instance_cnt_rxtx);
|
||||
usleep(500);
|
||||
|
||||
if(wait_on_condition(&proc_rxtx0->mutex_rxtx,&proc_rxtx0->cond_rxtx,&proc_rxtx0->pipe_ready,"wakeup_rxtx")<0) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: RXTX0 not ready\n",proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx);
|
||||
return(-1);
|
||||
}
|
||||
if (proc_rxtx->instance_cnt_rxtx == 0) {
|
||||
exit_fun( "TX thread busy" );
|
||||
if (release_thread(&proc_rxtx0->mutex_rxtx,&proc_rxtx0->pipe_ready,"wakeup_rxtx")<0) return(-1);
|
||||
|
||||
if (proc_rxtx0->instance_cnt_rxtx == 0) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: RXTX0 thread busy, dropping\n",proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// wake up TX for subframe n+sf_ahead
|
||||
// lock the TX mutex and make sure the thread is ready
|
||||
if (pthread_mutex_timedlock(&proc_rxtx->mutex_rxtx,&wait) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)\n", proc_rxtx->subframe_rx&1,proc_rxtx->instance_cnt_rxtx );
|
||||
if (pthread_mutex_timedlock(&proc_rxtx0->mutex_rxtx,&wait) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)\n", proc_rxtx0->subframe_rx&1,proc_rxtx0->instance_cnt_rxtx );
|
||||
exit_fun( "error locking mutex_rxtx" );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
++proc_rxtx->instance_cnt_rxtx;
|
||||
|
||||
++proc_rxtx0->instance_cnt_rxtx;
|
||||
|
||||
// We have just received and processed the common part of a subframe, say n.
|
||||
// TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired
|
||||
@@ -449,20 +624,20 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
// The last (TS_rx mod samples_per_frame) was n*samples_per_tti,
|
||||
// we want to generate subframe (n+sf_ahead), so TS_tx = TX_rx+sf_ahead*samples_per_tti,
|
||||
// and proc->subframe_tx = proc->subframe_rx+sf_ahead
|
||||
proc_rxtx->timestamp_tx = proc->timestamp_rx + (sf_ahead*fp->samples_per_tti);
|
||||
proc_rxtx->frame_rx = proc->frame_rx;
|
||||
proc_rxtx->subframe_rx = proc->subframe_rx;
|
||||
proc_rxtx->frame_tx = (proc_rxtx->subframe_rx > (9-sf_ahead)) ? (proc_rxtx->frame_rx+1)&1023 : proc_rxtx->frame_rx;
|
||||
proc_rxtx->subframe_tx = (proc_rxtx->subframe_rx + sf_ahead)%10;
|
||||
proc_rxtx0->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti);
|
||||
proc_rxtx0->frame_rx = ru_proc->frame_rx;
|
||||
proc_rxtx0->subframe_rx = ru_proc->subframe_rx;
|
||||
proc_rxtx0->frame_tx = (proc_rxtx0->subframe_rx > (9-sf_ahead)) ? (proc_rxtx0->frame_rx+1)&1023 : proc_rxtx0->frame_rx;
|
||||
proc_rxtx0->subframe_tx = (proc_rxtx0->subframe_rx + sf_ahead)%10;
|
||||
|
||||
// the thread can now be woken up
|
||||
if (pthread_cond_signal(&proc_rxtx->cond_rxtx) != 0) {
|
||||
if (pthread_cond_signal(&proc_rxtx0->cond_rxtx) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB RXn-TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock( &proc_rxtx->mutex_rxtx );
|
||||
pthread_mutex_unlock( &proc_rxtx0->mutex_rxtx );
|
||||
|
||||
return(0);
|
||||
}
|
||||
@@ -602,8 +777,9 @@ static void* eNB_thread_prach( void* param ) {
|
||||
// set default return value
|
||||
eNB_thread_prach_status = 0;
|
||||
|
||||
thread_top_init("eNB_thread_prach",1,500000L,1000000L,20000000L);
|
||||
thread_top_init("eNB_thread_prach",1,500000,1000000,20000000);
|
||||
|
||||
//wait_sync("eNB_thread_prach");
|
||||
|
||||
while (!oai_exit) {
|
||||
|
||||
@@ -644,7 +820,7 @@ static void* eNB_thread_prach_br( void* param ) {
|
||||
// set default return value
|
||||
eNB_thread_prach_status = 0;
|
||||
|
||||
thread_top_init("eNB_thread_prach_br",1,500000L,1000000L,20000000L);
|
||||
thread_top_init("eNB_thread_prach_br",1,500000,1000000,20000000);
|
||||
|
||||
while (!oai_exit) {
|
||||
|
||||
@@ -668,8 +844,40 @@ static void* eNB_thread_prach_br( void* param ) {
|
||||
#endif
|
||||
|
||||
|
||||
extern void init_td_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
extern void init_te_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
|
||||
extern void init_td_thread(PHY_VARS_eNB *);
|
||||
extern void init_te_thread(PHY_VARS_eNB *);
|
||||
extern void kill_td_thread(PHY_VARS_eNB *);
|
||||
extern void kill_te_thread(PHY_VARS_eNB *);
|
||||
//////////////////////////////////////need to modified////////////////*****
|
||||
|
||||
static void* process_stats_thread(void* param) {
|
||||
|
||||
PHY_VARS_eNB *eNB = (PHY_VARS_eNB*)param;
|
||||
|
||||
wait_sync("process_stats_thread");
|
||||
|
||||
while (!oai_exit) {
|
||||
sleep(1);
|
||||
if (opp_enabled == 1) {
|
||||
if (eNB->td) print_meas(&eNB->ulsch_decoding_stats,"ulsch_decoding",NULL,NULL);
|
||||
if (eNB->te)
|
||||
{
|
||||
print_meas(&eNB->dlsch_turbo_encoding_preperation_stats,"dlsch_coding_crc",NULL,NULL);
|
||||
print_meas(&eNB->dlsch_turbo_encoding_segmentation_stats,"dlsch_segmentation",NULL,NULL);
|
||||
print_meas(&eNB->dlsch_encoding_stats,"dlsch_encoding",NULL,NULL);
|
||||
print_meas(&eNB->dlsch_turbo_encoding_signal_stats,"coding_signal",NULL,NULL);
|
||||
print_meas(&eNB->dlsch_turbo_encoding_main_stats,"coding_main",NULL,NULL);
|
||||
print_meas(&eNB->dlsch_turbo_encoding_waiting_stats,"coding_wait",NULL,NULL);
|
||||
print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats0,"coding_worker_0",NULL,NULL);
|
||||
print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats1,"coding_worker_1",NULL,NULL);
|
||||
}
|
||||
print_meas(&eNB->dlsch_modulation_stats,"dlsch_modulation",NULL,NULL);
|
||||
}
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
||||
void init_eNB_proc(int inst) {
|
||||
|
||||
@@ -679,7 +887,6 @@ void init_eNB_proc(int inst) {
|
||||
eNB_proc_t *proc;
|
||||
eNB_rxtx_proc_t *proc_rxtx;
|
||||
pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_prach=NULL;
|
||||
//*attr_td=NULL,*attr_te=NULL;
|
||||
#ifdef Rel14
|
||||
pthread_attr_t *attr_prach_br=NULL;
|
||||
#endif
|
||||
@@ -696,8 +903,11 @@ void init_eNB_proc(int inst) {
|
||||
proc_rxtx = proc->proc_rxtx;
|
||||
proc_rxtx[0].instance_cnt_rxtx = -1;
|
||||
proc_rxtx[1].instance_cnt_rxtx = -1;
|
||||
proc_rxtx[0].pipe_ready = 0;
|
||||
proc_rxtx[1].pipe_ready = 0;
|
||||
proc->instance_cnt_prach = -1;
|
||||
proc->instance_cnt_asynch_rxtx = -1;
|
||||
proc->instance_cnt_synch = -1;
|
||||
proc->CC_id = CC_id;
|
||||
|
||||
proc->first_rx=1;
|
||||
@@ -721,8 +931,6 @@ void init_eNB_proc(int inst) {
|
||||
|
||||
pthread_attr_init( &proc->attr_prach);
|
||||
pthread_attr_init( &proc->attr_asynch_rxtx);
|
||||
// pthread_attr_init( &proc->attr_td);
|
||||
// pthread_attr_init( &proc->attr_te);
|
||||
pthread_attr_init( &proc_rxtx[0].attr_rxtx);
|
||||
pthread_attr_init( &proc_rxtx[1].attr_rxtx);
|
||||
#ifdef Rel14
|
||||
@@ -744,6 +952,15 @@ void init_eNB_proc(int inst) {
|
||||
// attr_td = &proc->attr_td;
|
||||
// attr_te = &proc->attr_te;
|
||||
#endif
|
||||
//////////////////////////////////////need to modified////////////////*****
|
||||
if(get_nprocs() > 2 && codingw)
|
||||
{
|
||||
init_te_thread(eNB);
|
||||
init_td_thread(eNB);
|
||||
}
|
||||
//////////////////////////////////////need to modified////////////////*****
|
||||
pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, proc );
|
||||
pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, tx_thread, proc);
|
||||
|
||||
LOG_I(PHY,"eNB->single_thread_flag:%d\n", eNB->single_thread_flag);
|
||||
|
||||
@@ -764,6 +981,9 @@ void init_eNB_proc(int inst) {
|
||||
}
|
||||
|
||||
AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach);
|
||||
|
||||
|
||||
if (opp_enabled == 1) pthread_create(&proc->process_stats_thread,NULL,process_stats_thread,(void*)eNB);
|
||||
|
||||
|
||||
}
|
||||
@@ -789,6 +1009,8 @@ void init_eNB_proc(int inst) {
|
||||
pthread_mutex_init(&sync_phy_proc.mutex_phy_proc_tx, NULL);
|
||||
pthread_cond_init(&sync_phy_proc.cond_phy_proc_tx, NULL);
|
||||
sync_phy_proc.phy_proc_CC_id = 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -802,21 +1024,22 @@ void kill_eNB_proc(int inst) {
|
||||
PHY_VARS_eNB *eNB;
|
||||
eNB_proc_t *proc;
|
||||
eNB_rxtx_proc_t *proc_rxtx;
|
||||
int i;
|
||||
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
eNB=RC.eNB[inst][CC_id];
|
||||
|
||||
proc = &eNB->proc;
|
||||
proc_rxtx = &proc->proc_rxtx[0];
|
||||
|
||||
kill_td_thread(eNB);
|
||||
kill_te_thread(eNB);
|
||||
LOG_I(PHY, "Killing TX CC_id %d inst %d\n", CC_id, inst );
|
||||
|
||||
if (eNB->single_thread_flag==0) {
|
||||
pthread_mutex_lock(&proc_rxtx[0].mutex_rxtx);
|
||||
proc_rxtx[0].instance_cnt_rxtx = 0;
|
||||
pthread_mutex_unlock(&proc_rxtx[0].mutex_rxtx);
|
||||
pthread_mutex_lock(&proc_rxtx[1].mutex_rxtx);
|
||||
proc_rxtx[1].instance_cnt_rxtx = 0;
|
||||
pthread_mutex_unlock(&proc_rxtx[1].mutex_rxtx);
|
||||
for (i=0; i<2; i++) {
|
||||
pthread_mutex_lock(&proc_rxtx[i].mutex_rxtx);
|
||||
proc_rxtx[i].instance_cnt_rxtx = 0;
|
||||
proc_rxtx[i].pipe_ready = 0;
|
||||
pthread_cond_signal(&proc_rxtx[i].cond_rxtx);
|
||||
pthread_mutex_unlock(&proc_rxtx[i].mutex_rxtx);
|
||||
}
|
||||
proc->instance_cnt_prach = 0;
|
||||
pthread_cond_signal( &proc->cond_prach );
|
||||
@@ -839,15 +1062,12 @@ void kill_eNB_proc(int inst) {
|
||||
#endif
|
||||
LOG_I(PHY, "Destroying UL_INFO mutex\n");
|
||||
pthread_mutex_destroy(&eNB->UL_INFO_mutex);
|
||||
int i;
|
||||
if (eNB->single_thread_flag==0) {
|
||||
for (i=0;i<2;i++) {
|
||||
LOG_I(PHY, "Joining rxtx[%d] mutex/cond\n",i);
|
||||
pthread_join( proc_rxtx[i].pthread_rxtx, (void**)&status );
|
||||
LOG_I(PHY, "Destroying rxtx[%d] mutex/cond\n",i);
|
||||
pthread_mutex_destroy( &proc_rxtx[i].mutex_rxtx );
|
||||
pthread_cond_destroy( &proc_rxtx[i].cond_rxtx );
|
||||
}
|
||||
for (i=0;i<2;i++) {
|
||||
LOG_I(PHY, "Joining rxtx[%d] mutex/cond\n",i);
|
||||
pthread_join( proc_rxtx[i].pthread_rxtx, (void**)&status );
|
||||
LOG_I(PHY, "Destroying rxtx[%d] mutex/cond\n",i);
|
||||
pthread_mutex_destroy( &proc_rxtx[i].mutex_rxtx );
|
||||
pthread_cond_destroy( &proc_rxtx[i].cond_rxtx );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1091,8 +1311,8 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
|
||||
#endif
|
||||
|
||||
|
||||
eNB->td = ulsch_decoding_data;//(single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
|
||||
eNB->te = dlsch_encoding;//(single_thread_flag==1) ? dlsch_encoding_2threads : dlsch_encoding;
|
||||
eNB->td = ulsch_decoding_data_all;//(get_nprocs()<=4) ? ulsch_decoding_data : ulsch_decoding_data_2thread;
|
||||
eNB->te = dlsch_encoding_all;//(get_nprocs()<=4) ? dlsch_encoding : dlsch_encoding_2threads;
|
||||
|
||||
|
||||
LOG_I(PHY,"Registering with MAC interface module\n");
|
||||
|
||||
+273
-99
@@ -111,7 +111,11 @@ static int DEFENBS[] = {0};
|
||||
|
||||
#include "T.h"
|
||||
|
||||
|
||||
extern volatile int oai_exit;
|
||||
extern int emulate_rf;
|
||||
extern int numerology;
|
||||
extern int fepw;
|
||||
|
||||
|
||||
extern void phy_init_RU(RU_t*);
|
||||
@@ -673,6 +677,34 @@ void fh_if4p5_north_out(RU_t *ru) {
|
||||
|
||||
}
|
||||
|
||||
static void* emulatedRF_thread(void* param) {
|
||||
RU_proc_t *proc = (RU_proc_t *) param;
|
||||
int microsec = 500; // length of time to sleep, in miliseconds
|
||||
struct timespec req = {0};
|
||||
req.tv_sec = 0;
|
||||
req.tv_nsec = (numerology>0)? ((microsec * 1000L)/numerology):(microsec * 1000L)*2;
|
||||
cpu_set_t cpuset;
|
||||
CPU_SET(1,&cpuset);
|
||||
pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
||||
|
||||
int policy;
|
||||
struct sched_param sparam;
|
||||
memset(&sparam, 0, sizeof(sparam));
|
||||
sparam.sched_priority = sched_get_priority_max(SCHED_FIFO);
|
||||
policy = SCHED_FIFO ;
|
||||
pthread_setschedparam(pthread_self(), policy, &sparam);
|
||||
|
||||
wait_sync("emulatedRF_thread");
|
||||
while(!oai_exit){
|
||||
nanosleep(&req, (struct timespec *)NULL);
|
||||
pthread_mutex_lock(&proc->mutex_emulateRF);
|
||||
++proc->instance_cnt_emulateRF;
|
||||
pthread_mutex_unlock(&proc->mutex_emulateRF);
|
||||
pthread_cond_signal(&proc->cond_emulateRF);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rx_rf(RU_t *ru,int *frame,int *subframe) {
|
||||
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
@@ -680,7 +712,7 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
|
||||
void *rxp[ru->nb_rx];
|
||||
unsigned int rxs;
|
||||
int i;
|
||||
openair0_timestamp ts,old_ts;
|
||||
openair0_timestamp ts=0,old_ts=0;
|
||||
|
||||
for (i=0; i<ru->nb_rx; i++)
|
||||
rxp[i] = (void*)&ru->common.rxdata[i][*subframe*fp->samples_per_tti];
|
||||
@@ -688,12 +720,18 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
|
||||
|
||||
old_ts = proc->timestamp_rx;
|
||||
|
||||
rxs = ru->rfdevice.trx_read_func(&ru->rfdevice,
|
||||
if(emulate_rf){
|
||||
wait_on_condition(&proc->mutex_emulateRF,&proc->cond_emulateRF,&proc->instance_cnt_emulateRF,"emulatedRF_thread");
|
||||
release_thread(&proc->mutex_emulateRF,&proc->instance_cnt_emulateRF,"emulatedRF_thread");
|
||||
rxs = fp->samples_per_tti;
|
||||
}
|
||||
else{
|
||||
rxs = ru->rfdevice.trx_read_func(&ru->rfdevice,
|
||||
&ts,
|
||||
rxp,
|
||||
fp->samples_per_tti,
|
||||
ru->nb_rx);
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
|
||||
|
||||
@@ -709,7 +747,7 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
|
||||
}
|
||||
else {
|
||||
if (proc->timestamp_rx - old_ts != fp->samples_per_tti) {
|
||||
LOG_I(PHY,"rx_rf: rfdevice timing drift of %"PRId64" samples (ts_off %"PRId64")\n",proc->timestamp_rx - old_ts - fp->samples_per_tti,ru->ts_offset);
|
||||
//LOG_I(PHY,"rx_rf: rfdevice timing drift of %"PRId64" samples (ts_off %"PRId64")\n",proc->timestamp_rx - old_ts - fp->samples_per_tti,ru->ts_offset);
|
||||
ru->ts_offset += (proc->timestamp_rx - old_ts - fp->samples_per_tti);
|
||||
proc->timestamp_rx = ts-ru->ts_offset;
|
||||
}
|
||||
@@ -719,9 +757,9 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
|
||||
proc->subframe_rx = (proc->timestamp_rx / fp->samples_per_tti)%10;
|
||||
// synchronize first reception to frame 0 subframe 0
|
||||
|
||||
proc->timestamp_tx = proc->timestamp_rx+(sf_ahead*fp->samples_per_tti);
|
||||
proc->subframe_tx = (proc->subframe_rx+sf_ahead)%10;
|
||||
proc->frame_tx = (proc->subframe_rx>(9-sf_ahead)) ? (proc->frame_rx+1)&1023 : proc->frame_rx;
|
||||
//proc->timestamp_tx = proc->timestamp_rx+(sf_ahead*fp->samples_per_tti);
|
||||
//proc->subframe_tx = (proc->subframe_rx+sf_ahead)%10;
|
||||
//proc->frame_tx = (proc->subframe_rx>(9-sf_ahead)) ? (proc->frame_rx+1)&1023 : proc->frame_rx;
|
||||
|
||||
LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, subframe %d\n",
|
||||
ru->idx,
|
||||
@@ -733,8 +771,6 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
|
||||
if (ru == RC.ru[0]) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU, proc->frame_rx );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU, proc->subframe_rx );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, proc->frame_tx );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU, proc->subframe_tx );
|
||||
}
|
||||
|
||||
if (proc->first_rx == 0) {
|
||||
@@ -809,6 +845,8 @@ void tx_rf(RU_t *ru) {
|
||||
for (i=0; i<ru->nb_tx; i++)
|
||||
txp[i] = (void*)&ru->common.txdata[i][(proc->subframe_tx*fp->samples_per_tti)-sf_extension];
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, proc->frame_tx );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU, proc->subframe_tx );
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (proc->timestamp_tx-ru->openair0_cfg.tx_sample_advance)&0xffffffff );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
|
||||
@@ -849,7 +887,7 @@ static void* ru_thread_asynch_rxtx( void* param ) {
|
||||
|
||||
int subframe=0, frame=0;
|
||||
|
||||
thread_top_init("ru_thread_asynch_rxtx",1,870000L,1000000L,1000000L);
|
||||
thread_top_init("ru_thread_asynch_rxtx",1,870000,1000000,1000000);
|
||||
|
||||
// wait for top-level synchronization and do one acquisition to get timestamp for setting frame/subframe
|
||||
|
||||
@@ -875,7 +913,7 @@ static void* ru_thread_asynch_rxtx( void* param ) {
|
||||
subframe++;
|
||||
}
|
||||
LOG_D(PHY,"ru_thread_asynch_rxtx: Waiting on incoming fronthaul\n");
|
||||
// asynchronous receive from south (Mobipass)
|
||||
// asynchronous receive from south (Mobipass)
|
||||
if (ru->fh_south_asynch_in) ru->fh_south_asynch_in(ru,&frame,&subframe);
|
||||
// asynchronous receive from north (RRU IF4/IF5)
|
||||
else if (ru->fh_north_asynch_in) {
|
||||
@@ -901,6 +939,7 @@ void wakeup_slaves(RU_proc_t *proc) {
|
||||
wait.tv_nsec=5000000L;
|
||||
|
||||
for (i=0;i<proc->num_slaves;i++) {
|
||||
//printf("////////////////////calling for slave thrads\n");////////////////////////********
|
||||
RU_proc_t *slave_proc = proc->slave_proc[i];
|
||||
// wake up slave FH thread
|
||||
// lock the FH mutex and make sure the thread is ready
|
||||
@@ -948,7 +987,8 @@ static void* ru_thread_prach( void* param ) {
|
||||
// set default return value
|
||||
ru_thread_prach_status = 0;
|
||||
|
||||
thread_top_init("ru_thread_prach",1,500000L,1000000L,20000000L);
|
||||
thread_top_init("ru_thread_prach",1,500000,1000000,20000000);
|
||||
//wait_sync("ru_thread_prach");
|
||||
|
||||
while (RC.ru_mask>0) {
|
||||
usleep(1e6);
|
||||
@@ -1003,7 +1043,8 @@ static void* ru_thread_prach_br( void* param ) {
|
||||
// set default return value
|
||||
ru_thread_prach_status = 0;
|
||||
|
||||
thread_top_init("ru_thread_prach_br",1,500000L,1000000L,20000000L);
|
||||
thread_top_init("ru_thread_prach_br",1,500000,1000000,20000000);
|
||||
//wait_sync("ru_thread_prach_br");
|
||||
|
||||
while (!oai_exit) {
|
||||
|
||||
@@ -1133,13 +1174,14 @@ void wakeup_eNBs(RU_t *ru) {
|
||||
|
||||
LOG_D(PHY,"wakeup_eNBs (num %d) for RU %d ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru->eNB_top);
|
||||
|
||||
if (ru->num_eNB==1 && ru->eNB_top!=0) {
|
||||
// call eNB function directly
|
||||
|
||||
if (ru->num_eNB==1 && ru->eNB_top!=0 && get_nprocs() <= 4) {
|
||||
// call eNB function directly
|
||||
|
||||
char string[20];
|
||||
sprintf(string,"Incoming RU %d",ru->idx);
|
||||
LOG_D(PHY,"RU %d Call eNB_top\n",ru->idx);
|
||||
ru->eNB_top(eNB_list[0],ru->proc.frame_rx,ru->proc.subframe_rx,string);
|
||||
ru->eNB_top(eNB_list[0],ru->proc.frame_rx,ru->proc.subframe_rx,string,ru);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1148,7 +1190,7 @@ void wakeup_eNBs(RU_t *ru) {
|
||||
for (i=0;i<ru->num_eNB;i++)
|
||||
{
|
||||
LOG_D(PHY,"ru->wakeup_rxtx:%p\n", ru->wakeup_rxtx);
|
||||
|
||||
eNB_list[i]->proc.ru_proc = &ru->proc;
|
||||
if (ru->wakeup_rxtx!=0 && ru->wakeup_rxtx(eNB_list[i],ru) < 0)
|
||||
{
|
||||
LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.subframe_rx);
|
||||
@@ -1179,7 +1221,7 @@ static inline int wakeup_prach_ru(RU_t *ru) {
|
||||
ru->eNB_list[0]->proc.frame_prach = ru->proc.frame_rx;
|
||||
ru->eNB_list[0]->proc.subframe_prach = ru->proc.subframe_rx;
|
||||
}
|
||||
LOG_I(PHY,"RU %d: waking up PRACH thread\n",ru->idx);
|
||||
LOG_D(PHY,"RU %d: waking up PRACH thread\n",ru->idx);
|
||||
// the thread can now be woken up
|
||||
AssertFatal(pthread_cond_signal(&ru->proc.cond_prach) == 0, "ERROR pthread_cond_signal for RU prach thread\n");
|
||||
}
|
||||
@@ -1225,20 +1267,39 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||
openair0_config_t *cfg = &ru->openair0_cfg;
|
||||
//printf("////////////////numerology in config = %d\n",numerology);
|
||||
|
||||
if(fp->N_RB_DL == 100) {
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=23.04e6;
|
||||
cfg->samples_per_frame = 230400;
|
||||
cfg->tx_bw = 10e6;
|
||||
cfg->rx_bw = 10e6;
|
||||
}
|
||||
else {
|
||||
cfg->sample_rate=30.72e6;
|
||||
if(numerology == 0){
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=23.04e6;
|
||||
cfg->samples_per_frame = 230400;
|
||||
cfg->tx_bw = 10e6;
|
||||
cfg->rx_bw = 10e6;
|
||||
}
|
||||
else {
|
||||
cfg->sample_rate=30.72e6;
|
||||
cfg->samples_per_frame = 307200;
|
||||
cfg->tx_bw = 10e6;
|
||||
cfg->rx_bw = 10e6;
|
||||
}
|
||||
}else if(numerology == 1){
|
||||
cfg->sample_rate=61.44e6;
|
||||
cfg->samples_per_frame = 307200;
|
||||
cfg->tx_bw = 20e6;
|
||||
cfg->rx_bw = 20e6;
|
||||
}else if(numerology == 2){
|
||||
cfg->sample_rate=122.88e6;
|
||||
cfg->samples_per_frame = 307200;
|
||||
cfg->tx_bw = 40e6;
|
||||
cfg->rx_bw = 40e6;
|
||||
}else{
|
||||
printf("Wrong input for numerology %d\n setting to 20MHz normal CP configuration",numerology);
|
||||
cfg->sample_rate=30.72e6;
|
||||
cfg->samples_per_frame = 307200;
|
||||
cfg->tx_bw = 10e6;
|
||||
cfg->rx_bw = 10e6;
|
||||
}
|
||||
}
|
||||
} else if(fp->N_RB_DL == 50) {
|
||||
cfg->sample_rate=15.36e6;
|
||||
cfg->samples_per_frame = 153600;
|
||||
@@ -1357,7 +1418,7 @@ static void* ru_stats_thread(void* param) {
|
||||
|
||||
while (!oai_exit) {
|
||||
sleep(1);
|
||||
if (opp_enabled == 1) {
|
||||
if (opp_enabled == 1 && fepw) {
|
||||
if (ru->feprx) print_meas(&ru->ofdm_demod_stats,"feprx",NULL,NULL);
|
||||
if (ru->feptx_ofdm) print_meas(&ru->ofdm_mod_stats,"feptx_ofdm",NULL,NULL);
|
||||
if (ru->fh_north_asynch_in) print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL);
|
||||
@@ -1371,6 +1432,59 @@ static void* ru_stats_thread(void* param) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
static void* ru_thread_tx( void* param ) {
|
||||
RU_t *ru = (RU_t*)param;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO(&cpuset);
|
||||
|
||||
|
||||
thread_top_init("ru_thread_tx",1,400000,500000,500000);
|
||||
|
||||
//CPU_SET(5, &cpuset);
|
||||
//pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
||||
//wait_sync("ru_thread_tx");
|
||||
|
||||
wait_on_condition(&proc->mutex_FH1,&proc->cond_FH1,&proc->instance_cnt_FH1,"ru_thread_tx");
|
||||
|
||||
printf( "ru_thread_tx ready\n");
|
||||
while (!oai_exit) {
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_CPUID_RU_THREAD_TX,sched_getcpu());
|
||||
if (oai_exit) break;
|
||||
|
||||
|
||||
LOG_D(PHY,"ru_thread_tx: Waiting for TX processing\n");
|
||||
// wait until eNBs are finished subframe RX n and TX n+4
|
||||
wait_on_condition(&proc->mutex_eNBs,&proc->cond_eNBs,&proc->instance_cnt_eNBs,"ru_thread_tx");
|
||||
if (oai_exit) break;
|
||||
|
||||
// do TX front-end processing if needed (precoding and/or IDFTs)
|
||||
if (ru->feptx_prec) ru->feptx_prec(ru);
|
||||
|
||||
// do OFDM if needed
|
||||
if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru);
|
||||
if(!emulate_rf){
|
||||
// do outgoing fronthaul (south) if needed
|
||||
if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru);
|
||||
|
||||
if (ru->fh_north_out) ru->fh_north_out(ru);
|
||||
}
|
||||
release_thread(&proc->mutex_eNBs,&proc->instance_cnt_eNBs,"ru_thread_tx");
|
||||
|
||||
pthread_mutex_lock( &proc->mutex_eNBs );
|
||||
proc->ru_tx_ready++;
|
||||
// the thread can now be woken up
|
||||
if (pthread_cond_signal(&proc->cond_eNBs) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
}
|
||||
pthread_mutex_unlock( &proc->mutex_eNBs );
|
||||
}
|
||||
release_thread(&proc->mutex_FH1,&proc->instance_cnt_FH1,"ru_thread_tx");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void* ru_thread( void* param ) {
|
||||
|
||||
static int ru_thread_status;
|
||||
@@ -1381,35 +1495,54 @@ static void* ru_thread( void* param ) {
|
||||
int ret;
|
||||
int subframe =9;
|
||||
int frame =1023;
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO(&cpuset);
|
||||
|
||||
|
||||
// set default return value
|
||||
ru_thread_status = 0;
|
||||
|
||||
|
||||
// set default return value
|
||||
thread_top_init("ru_thread",0,870000,1000000,1000000);
|
||||
thread_top_init("ru_thread",1,400000,500000,500000);
|
||||
|
||||
//CPU_SET(1, &cpuset);
|
||||
//pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
||||
pthread_setname_np( pthread_self(),"ru thread");
|
||||
LOG_I(PHY,"thread ru created id=%ld\n", syscall(__NR_gettid));
|
||||
|
||||
LOG_I(PHY,"Starting RU %d (%s,%s),\n",ru->idx,eNB_functions[ru->function],eNB_timing[ru->if_timing]);
|
||||
|
||||
|
||||
// Start IF device if any
|
||||
if (ru->start_if) {
|
||||
LOG_I(PHY,"Starting IF interface for RU %d\n",ru->idx);
|
||||
AssertFatal(ru->start_if(ru,NULL) == 0, "Could not start the IF device\n");
|
||||
if (ru->if_south == LOCAL_RF) ret = connect_rau(ru);
|
||||
else ret = attach_rru(ru);
|
||||
AssertFatal(ret==0,"Cannot connect to radio\n");
|
||||
if(emulate_rf){
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
init_frame_parms(&ru->frame_parms,1);
|
||||
phy_init_RU(ru);
|
||||
if (setup_RU_buffers(ru)!=0) {
|
||||
printf("Exiting, cannot initialize RU Buffers\n");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
if (ru->if_south == LOCAL_RF) { // configure RF parameters only
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
init_frame_parms(&ru->frame_parms,1);
|
||||
phy_init_RU(ru);
|
||||
|
||||
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
|
||||
}
|
||||
if (setup_RU_buffers(ru)!=0) {
|
||||
printf("Exiting, cannot initialize RU Buffers\n");
|
||||
exit(-1);
|
||||
else{
|
||||
// Start IF device if any
|
||||
if (ru->start_if) {
|
||||
LOG_I(PHY,"Starting IF interface for RU %d\n",ru->idx);
|
||||
AssertFatal(ru->start_if(ru,NULL) == 0, "Could not start the IF device\n");
|
||||
if (ru->if_south == LOCAL_RF) ret = connect_rau(ru);
|
||||
else ret = attach_rru(ru);
|
||||
AssertFatal(ret==0,"Cannot connect to radio\n");
|
||||
}
|
||||
if (ru->if_south == LOCAL_RF) { // configure RF parameters only
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
init_frame_parms(&ru->frame_parms,1);
|
||||
phy_init_RU(ru);
|
||||
|
||||
|
||||
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
|
||||
}
|
||||
if (setup_RU_buffers(ru)!=0) {
|
||||
printf("Exiting, cannot initialize RU Buffers\n");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
LOG_I(PHY, "Signaling main thread that RU %d is ready\n",ru->idx);
|
||||
@@ -1418,38 +1551,46 @@ static void* ru_thread( void* param ) {
|
||||
pthread_cond_signal(&RC.ru_cond);
|
||||
pthread_mutex_unlock(&RC.ru_mutex);
|
||||
|
||||
wait_sync("ru_thread");
|
||||
|
||||
pthread_mutex_lock(&proc->mutex_FH1);
|
||||
proc->instance_cnt_FH1 = 0;
|
||||
pthread_mutex_unlock(&proc->mutex_FH1);
|
||||
pthread_cond_signal(&proc->cond_FH1);
|
||||
|
||||
wait_sync("ru_thread");
|
||||
|
||||
|
||||
// Start RF device if any
|
||||
if (ru->start_rf) {
|
||||
if (ru->start_rf(ru) != 0)
|
||||
LOG_E(HW,"Could not start the RF device\n");
|
||||
else LOG_I(PHY,"RU %d rf device ready\n",ru->idx);
|
||||
if(!emulate_rf){
|
||||
// Start RF device if any
|
||||
if (ru->start_rf) {
|
||||
if (ru->start_rf(ru) != 0)
|
||||
LOG_E(HW,"Could not start the RF device\n");
|
||||
else LOG_I(PHY,"RU %d rf device ready\n",ru->idx);
|
||||
}
|
||||
else LOG_I(PHY,"RU %d no rf device\n",ru->idx);
|
||||
|
||||
// if an asnych_rxtx thread exists
|
||||
// wakeup the thread because the devices are ready at this point
|
||||
|
||||
if ((ru->fh_south_asynch_in)||(ru->fh_north_asynch_in)) {
|
||||
pthread_mutex_lock(&proc->mutex_asynch_rxtx);
|
||||
proc->instance_cnt_asynch_rxtx=0;
|
||||
pthread_mutex_unlock(&proc->mutex_asynch_rxtx);
|
||||
pthread_cond_signal(&proc->cond_asynch_rxtx);
|
||||
}
|
||||
else LOG_I(PHY,"RU %d no asynch_south interface\n",ru->idx);
|
||||
|
||||
// if this is a slave RRU, try to synchronize on the DL frequency
|
||||
if ((ru->is_slave) && (ru->if_south == LOCAL_RF)) do_ru_synch(ru);
|
||||
}
|
||||
else LOG_I(PHY,"RU %d no rf device\n",ru->idx);
|
||||
|
||||
|
||||
// if an asnych_rxtx thread exists
|
||||
// wakeup the thread because the devices are ready at this point
|
||||
|
||||
if ((ru->fh_south_asynch_in)||(ru->fh_north_asynch_in)) {
|
||||
pthread_mutex_lock(&proc->mutex_asynch_rxtx);
|
||||
proc->instance_cnt_asynch_rxtx=0;
|
||||
pthread_mutex_unlock(&proc->mutex_asynch_rxtx);
|
||||
pthread_cond_signal(&proc->cond_asynch_rxtx);
|
||||
}
|
||||
else LOG_I(PHY,"RU %d no asynch_south interface\n",ru->idx);
|
||||
|
||||
// if this is a slave RRU, try to synchronize on the DL frequency
|
||||
if ((ru->is_slave) && (ru->if_south == LOCAL_RF)) do_ru_synch(ru);
|
||||
|
||||
|
||||
// This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices
|
||||
while (!oai_exit) {
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_CPUID_RU_THREAD,sched_getcpu());
|
||||
|
||||
// these are local subframe/frame counters to check that we are in synch with the fronthaul timing.
|
||||
// They are set on the first rx/tx in the underly FH routines.
|
||||
if (subframe==9) {
|
||||
@@ -1499,20 +1640,21 @@ static void* ru_thread( void* param ) {
|
||||
|
||||
// wakeup all eNB processes waiting for this RU
|
||||
if (ru->num_eNB>0) wakeup_eNBs(ru);
|
||||
|
||||
if(get_nprocs() <= 4){
|
||||
// do TX front-end processing if needed (precoding and/or IDFTs)
|
||||
if (ru->feptx_prec) ru->feptx_prec(ru);
|
||||
|
||||
// do OFDM if needed
|
||||
if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru);
|
||||
if(!emulate_rf){
|
||||
// do outgoing fronthaul (south) if needed
|
||||
if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru);
|
||||
|
||||
if (ru->fh_north_out) ru->fh_north_out(ru);
|
||||
}
|
||||
}
|
||||
|
||||
// wait until eNBs are finished subframe RX n and TX n+sf_ahead
|
||||
wait_on_condition(&proc->mutex_eNBs,&proc->cond_eNBs,&proc->instance_cnt_eNBs,"ru_thread");
|
||||
|
||||
|
||||
// do TX front-end processing if needed (precoding and/or IDFTs)
|
||||
if (ru->feptx_prec) ru->feptx_prec(ru);
|
||||
|
||||
// do OFDM if needed
|
||||
if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru);
|
||||
// do outgoing fronthaul (south) if needed
|
||||
if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru);
|
||||
|
||||
if (ru->fh_north_out) ru->fh_north_out(ru);
|
||||
}
|
||||
|
||||
|
||||
@@ -1635,7 +1777,7 @@ void init_RU_proc(RU_t *ru) {
|
||||
|
||||
int i=0;
|
||||
RU_proc_t *proc;
|
||||
pthread_attr_t *attr_FH=NULL,*attr_prach=NULL,*attr_asynch=NULL,*attr_synch=NULL;
|
||||
pthread_attr_t *attr_FH=NULL,*attr_FH1=NULL,*attr_prach=NULL,*attr_asynch=NULL,*attr_synch=NULL,*attr_emulateRF=NULL;
|
||||
//pthread_attr_t *attr_fep=NULL;
|
||||
#ifdef Rel14
|
||||
pthread_attr_t *attr_prach_br=NULL;
|
||||
@@ -1650,14 +1792,19 @@ void init_RU_proc(RU_t *ru) {
|
||||
|
||||
proc->ru = ru;
|
||||
proc->instance_cnt_prach = -1;
|
||||
proc->instance_cnt_synch = -1; ;
|
||||
proc->instance_cnt_synch = -1;
|
||||
proc->instance_cnt_FH = -1;
|
||||
proc->instance_cnt_FH1 = -1;
|
||||
proc->instance_cnt_emulateRF = -1;
|
||||
proc->instance_cnt_asynch_rxtx = -1;
|
||||
proc->instance_cnt_eNBs = -1;
|
||||
proc->first_rx = 1;
|
||||
proc->first_tx = 1;
|
||||
proc->frame_offset = 0;
|
||||
proc->num_slaves = 0;
|
||||
proc->frame_tx_unwrap = 0;
|
||||
proc->ru_rx_ready = 0;
|
||||
proc->ru_tx_ready = 0;
|
||||
|
||||
for (i=0;i<10;i++) proc->symbol_mask[i]=0;
|
||||
|
||||
@@ -1665,15 +1812,21 @@ void init_RU_proc(RU_t *ru) {
|
||||
pthread_mutex_init( &proc->mutex_asynch_rxtx, NULL);
|
||||
pthread_mutex_init( &proc->mutex_synch,NULL);
|
||||
pthread_mutex_init( &proc->mutex_FH,NULL);
|
||||
pthread_mutex_init( &proc->mutex_FH1,NULL);
|
||||
pthread_mutex_init( &proc->mutex_emulateRF,NULL);
|
||||
pthread_mutex_init( &proc->mutex_eNBs, NULL);
|
||||
|
||||
pthread_cond_init( &proc->cond_prach, NULL);
|
||||
pthread_cond_init( &proc->cond_FH, NULL);
|
||||
pthread_cond_init( &proc->cond_FH1, NULL);
|
||||
pthread_cond_init( &proc->cond_emulateRF, NULL);
|
||||
pthread_cond_init( &proc->cond_asynch_rxtx, NULL);
|
||||
pthread_cond_init( &proc->cond_synch,NULL);
|
||||
pthread_cond_init( &proc->cond_eNBs, NULL);
|
||||
|
||||
pthread_attr_init( &proc->attr_FH);
|
||||
pthread_attr_init( &proc->attr_FH1);
|
||||
pthread_attr_init( &proc->attr_emulateRF);
|
||||
pthread_attr_init( &proc->attr_prach);
|
||||
pthread_attr_init( &proc->attr_synch);
|
||||
pthread_attr_init( &proc->attr_asynch_rxtx);
|
||||
@@ -1688,15 +1841,22 @@ void init_RU_proc(RU_t *ru) {
|
||||
|
||||
#ifndef DEADLINE_SCHEDULER
|
||||
attr_FH = &proc->attr_FH;
|
||||
attr_FH1 = &proc->attr_FH1;
|
||||
attr_prach = &proc->attr_prach;
|
||||
attr_synch = &proc->attr_synch;
|
||||
attr_asynch = &proc->attr_asynch_rxtx;
|
||||
attr_emulateRF = &proc->attr_emulateRF;
|
||||
#ifdef Rel14
|
||||
attr_prach_br = &proc->attr_prach_br;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
pthread_create( &proc->pthread_FH, attr_FH, ru_thread, (void*)ru );
|
||||
if(emulate_rf)
|
||||
pthread_create( &proc->pthread_emulateRF, attr_emulateRF, emulatedRF_thread, (void*)proc );
|
||||
|
||||
if (get_nprocs() > 4)
|
||||
pthread_create( &proc->pthread_FH1, attr_FH1, ru_thread_tx, (void*)ru );
|
||||
|
||||
if (ru->function == NGFI_RRU_IF4p5) {
|
||||
pthread_create( &proc->pthread_prach, attr_prach, ru_thread_prach, (void*)ru );
|
||||
@@ -1708,7 +1868,10 @@ void init_RU_proc(RU_t *ru) {
|
||||
|
||||
if ((ru->if_timing == synch_to_other) ||
|
||||
(ru->function == NGFI_RRU_IF5) ||
|
||||
(ru->function == NGFI_RRU_IF4p5)) pthread_create( &proc->pthread_asynch_rxtx, attr_asynch, ru_thread_asynch_rxtx, (void*)ru );
|
||||
(ru->function == NGFI_RRU_IF4p5))
|
||||
{
|
||||
pthread_create( &proc->pthread_asynch_rxtx, attr_asynch, ru_thread_asynch_rxtx, (void*)ru );
|
||||
}
|
||||
|
||||
snprintf( name, sizeof(name), "ru_thread_FH %d", ru->idx );
|
||||
pthread_setname_np( proc->pthread_FH, name );
|
||||
@@ -1719,7 +1882,7 @@ void init_RU_proc(RU_t *ru) {
|
||||
pthread_create( &proc->pthread_prach, attr_prach, ru_thread_prach, (void*)ru );
|
||||
}
|
||||
|
||||
if (get_nprocs()>=2) {
|
||||
if (get_nprocs()> 2 && fepw) {
|
||||
if (ru->feprx) init_fep_thread(ru,NULL);
|
||||
if (ru->feptx_ofdm) init_feptx_thread(ru,NULL);
|
||||
}
|
||||
@@ -1734,38 +1897,46 @@ void kill_RU_proc(int inst)
|
||||
|
||||
pthread_mutex_lock(&proc->mutex_FH);
|
||||
proc->instance_cnt_FH = 0;
|
||||
pthread_mutex_unlock(&proc->mutex_FH);
|
||||
pthread_cond_signal(&proc->cond_FH);
|
||||
pthread_mutex_unlock(&proc->mutex_FH);
|
||||
|
||||
pthread_mutex_lock(&proc->mutex_FH1);
|
||||
proc->instance_cnt_FH1 = 0;
|
||||
pthread_cond_signal(&proc->cond_FH1);
|
||||
pthread_mutex_unlock(&proc->mutex_FH1);
|
||||
|
||||
pthread_mutex_lock(&proc->mutex_prach);
|
||||
proc->instance_cnt_prach = 0;
|
||||
pthread_mutex_unlock(&proc->mutex_prach);
|
||||
pthread_cond_signal(&proc->cond_prach);
|
||||
pthread_mutex_unlock(&proc->mutex_prach);
|
||||
|
||||
#ifdef Rel14
|
||||
pthread_mutex_lock(&proc->mutex_prach_br);
|
||||
proc->instance_cnt_prach_br = 0;
|
||||
pthread_mutex_unlock(&proc->mutex_prach_br);
|
||||
pthread_cond_signal(&proc->cond_prach_br);
|
||||
pthread_mutex_unlock(&proc->mutex_prach_br);
|
||||
#endif
|
||||
|
||||
pthread_mutex_lock(&proc->mutex_synch);
|
||||
proc->instance_cnt_synch = 0;
|
||||
pthread_mutex_unlock(&proc->mutex_synch);
|
||||
pthread_cond_signal(&proc->cond_synch);
|
||||
pthread_mutex_unlock(&proc->mutex_synch);
|
||||
|
||||
pthread_mutex_lock(&proc->mutex_eNBs);
|
||||
proc->ru_tx_ready = 0;
|
||||
proc->instance_cnt_eNBs = 0;
|
||||
pthread_mutex_unlock(&proc->mutex_eNBs);
|
||||
pthread_cond_signal(&proc->cond_eNBs);
|
||||
pthread_mutex_unlock(&proc->mutex_eNBs);
|
||||
|
||||
pthread_mutex_lock(&proc->mutex_asynch_rxtx);
|
||||
proc->instance_cnt_asynch_rxtx = 0;
|
||||
pthread_mutex_unlock(&proc->mutex_asynch_rxtx);
|
||||
pthread_cond_signal(&proc->cond_asynch_rxtx);
|
||||
pthread_mutex_unlock(&proc->mutex_asynch_rxtx);
|
||||
|
||||
LOG_D(PHY, "Joining pthread_FH\n");
|
||||
pthread_join(proc->pthread_FH, NULL);
|
||||
LOG_D(PHY, "Joining pthread_FHTX\n");
|
||||
pthread_join(proc->pthread_FH1, NULL);
|
||||
if (ru->function == NGFI_RRU_IF4p5) {
|
||||
LOG_D(PHY, "Joining pthread_prach\n");
|
||||
pthread_join(proc->pthread_prach, NULL);
|
||||
@@ -1785,7 +1956,7 @@ void kill_RU_proc(int inst)
|
||||
pthread_join(proc->pthread_asynch_rxtx, NULL);
|
||||
}
|
||||
}
|
||||
if (get_nprocs() >= 2) {
|
||||
if (get_nprocs() > 2 && fepw) {
|
||||
if (ru->feprx) {
|
||||
pthread_mutex_lock(&proc->mutex_fep);
|
||||
proc->instance_cnt_fep = 0;
|
||||
@@ -1816,15 +1987,18 @@ void kill_RU_proc(int inst)
|
||||
pthread_mutex_destroy(&proc->mutex_asynch_rxtx);
|
||||
pthread_mutex_destroy(&proc->mutex_synch);
|
||||
pthread_mutex_destroy(&proc->mutex_FH);
|
||||
pthread_mutex_destroy(&proc->mutex_FH1);
|
||||
pthread_mutex_destroy(&proc->mutex_eNBs);
|
||||
|
||||
pthread_cond_destroy(&proc->cond_prach);
|
||||
pthread_cond_destroy(&proc->cond_FH);
|
||||
pthread_cond_destroy(&proc->cond_FH1);
|
||||
pthread_cond_destroy(&proc->cond_asynch_rxtx);
|
||||
pthread_cond_destroy(&proc->cond_synch);
|
||||
pthread_cond_destroy(&proc->cond_eNBs);
|
||||
|
||||
pthread_attr_destroy(&proc->attr_FH);
|
||||
pthread_attr_destroy(&proc->attr_FH1);
|
||||
pthread_attr_destroy(&proc->attr_prach);
|
||||
pthread_attr_destroy(&proc->attr_synch);
|
||||
pthread_attr_destroy(&proc->attr_asynch_rxtx);
|
||||
@@ -2055,8 +2229,8 @@ void set_function_spec_param(RU_t *ru)
|
||||
ru->fh_north_out = fh_if4p5_north_out; // send_IF4p5 on reception
|
||||
ru->fh_south_out = tx_rf; // send output to RF
|
||||
ru->fh_north_asynch_in = fh_if4p5_north_asynch_in; // TX packets come asynchronously
|
||||
ru->feprx = (get_nprocs()<=2) ? fep_full :ru_fep_full_2thread; // RX DFTs
|
||||
ru->feptx_ofdm = (get_nprocs()<=2) ? feptx_ofdm : feptx_ofdm_2thread; // this is fep with idft only (no precoding in RRU)
|
||||
ru->feprx = (get_nprocs()<=2 || !fepw) ? fep_full :ru_fep_full_2thread; // RX DFTs
|
||||
ru->feptx_ofdm = (get_nprocs()<=2 || !fepw) ? feptx_ofdm : feptx_ofdm_2thread; // this is fep with idft only (no precoding in RRU)
|
||||
ru->feptx_prec = NULL;
|
||||
ru->start_if = start_if; // need to start the if interface for if4p5
|
||||
ru->ifdevice.host_type = RRU_HOST;
|
||||
@@ -2077,8 +2251,8 @@ void set_function_spec_param(RU_t *ru)
|
||||
}
|
||||
else if (ru->function == eNodeB_3GPP) {
|
||||
ru->do_prach = 0; // no prach processing in RU
|
||||
ru->feprx = (get_nprocs()<=2) ? fep_full : ru_fep_full_2thread; // RX DFTs
|
||||
ru->feptx_ofdm = (get_nprocs()<=2) ? feptx_ofdm : feptx_ofdm_2thread; // this is fep with idft and precoding
|
||||
ru->feprx = (get_nprocs()<=2 || !fepw) ? fep_full : ru_fep_full_2thread; // RX DFTs
|
||||
ru->feptx_ofdm = (get_nprocs()<=2 || !fepw) ? feptx_ofdm : feptx_ofdm_2thread; // this is fep with idft and precoding
|
||||
ru->feptx_prec = feptx_prec; // this is fep with idft and precoding
|
||||
ru->fh_north_in = NULL; // no incoming fronthaul from north
|
||||
ru->fh_north_out = NULL; // no outgoing fronthaul to north
|
||||
@@ -2106,9 +2280,9 @@ void set_function_spec_param(RU_t *ru)
|
||||
|
||||
case REMOTE_IF5: // the remote unit is IF5 RRU
|
||||
ru->do_prach = 0;
|
||||
ru->feprx = (get_nprocs()<=2) ? fep_full : fep_full; // this is frequency-shift + DFTs
|
||||
ru->feprx = (get_nprocs()<=2 || !fepw) ? fep_full : fep_full; // this is frequency-shift + DFTs
|
||||
ru->feptx_prec = feptx_prec; // need to do transmit Precoding + IDFTs
|
||||
ru->feptx_ofdm = (get_nprocs()<=2) ? feptx_ofdm : feptx_ofdm_2thread; // need to do transmit Precoding + IDFTs
|
||||
ru->feptx_ofdm = (get_nprocs()<=2 || !fepw) ? feptx_ofdm : feptx_ofdm_2thread; // need to do transmit Precoding + IDFTs
|
||||
if (ru->if_timing == synch_to_other) {
|
||||
ru->fh_south_in = fh_slave_south_in; // synchronize to master
|
||||
ru->fh_south_out = fh_if5_mobipass_south_out; // use send_IF5 for mobipass
|
||||
@@ -2239,7 +2413,7 @@ void init_RU(char *rf_config_file) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],eNB_timing[ru->if_timing],ru->function);
|
||||
LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],eNB_timing[ru->if_timing],ru->function);
|
||||
|
||||
set_function_spec_param(ru);
|
||||
LOG_I(PHY,"Starting ru_thread %d\n",ru_id);
|
||||
|
||||
@@ -214,6 +214,10 @@ extern PHY_VARS_UE* init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
extern void init_eNB_afterRU(void);
|
||||
|
||||
int transmission_mode=1;
|
||||
int emulate_rf = 0;
|
||||
int numerology = 0;
|
||||
int codingw = 0;
|
||||
int fepw = 0;
|
||||
|
||||
|
||||
|
||||
@@ -629,6 +633,7 @@ void init_openair0(void) {
|
||||
|
||||
int card;
|
||||
int i;
|
||||
|
||||
|
||||
for (card=0; card<MAX_CARDS; card++) {
|
||||
|
||||
@@ -636,6 +641,8 @@ void init_openair0(void) {
|
||||
openair0_cfg[card].configFilename = NULL;
|
||||
|
||||
if(frame_parms[0]->N_RB_DL == 100) {
|
||||
if(numerology == 0)
|
||||
{
|
||||
if (frame_parms[0]->threequarter_fs) {
|
||||
openair0_cfg[card].sample_rate=23.04e6;
|
||||
openair0_cfg[card].samples_per_frame = 230400;
|
||||
@@ -647,6 +654,22 @@ void init_openair0(void) {
|
||||
openair0_cfg[card].tx_bw = 10e6;
|
||||
openair0_cfg[card].rx_bw = 10e6;
|
||||
}
|
||||
}else if(numerology == 1)
|
||||
{
|
||||
openair0_cfg[card].sample_rate=61.44e6;
|
||||
openair0_cfg[card].samples_per_frame = 307200;
|
||||
openair0_cfg[card].tx_bw = 20e6;
|
||||
openair0_cfg[card].rx_bw = 20e6;
|
||||
}else if(numerology == 2)
|
||||
{
|
||||
openair0_cfg[card].sample_rate=122.88e6;
|
||||
openair0_cfg[card].samples_per_frame = 307200;
|
||||
openair0_cfg[card].tx_bw = 20e6;
|
||||
openair0_cfg[card].rx_bw = 20e6;
|
||||
}else
|
||||
{
|
||||
printf("Un supported numerology\n");
|
||||
}
|
||||
} else if(frame_parms[0]->N_RB_DL == 50) {
|
||||
openair0_cfg[card].sample_rate=15.36e6;
|
||||
openair0_cfg[card].samples_per_frame = 153600;
|
||||
|
||||
@@ -86,6 +86,12 @@
|
||||
#define CONFIG_HLP_TPORT "tracer port\n"
|
||||
#define CONFIG_HLP_NOTWAIT "don't wait for tracer, start immediately\n"
|
||||
#define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n"
|
||||
|
||||
#define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n"
|
||||
#define CONFIG_HLP_CODINGW "coding worker thread enable(disable by defult)\n"
|
||||
#define CONFIG_HLP_FEPW "FEP worker thread enabled(disable by defult)\n"
|
||||
#define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n"
|
||||
|
||||
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
|
||||
|
||||
/***************************************************************************************************************************************/
|
||||
@@ -141,35 +147,40 @@
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define CMDLINE_PARAMS_DESC { \
|
||||
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&rf_config_file, defstrval:NULL, TYPE_STRING, sizeof(rf_config_file)}, \
|
||||
{"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \
|
||||
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \
|
||||
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \
|
||||
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \
|
||||
{"external-clock", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, uptr:&clock_source, defintval:0, TYPE_INT, 0}, \
|
||||
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&wait_for_sync, defintval:0, TYPE_INT, 0}, \
|
||||
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
|
||||
{"threadIQ", NULL, 0, iptr:&(threads.iq), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadOneSubframe", NULL, 0, iptr:&(threads.one), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadTwoSubframe", NULL, 0, iptr:&(threads.two), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadThreeSubframe", NULL, 0, iptr:&(threads.three), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadSlot1ProcOne", NULL, 0, iptr:&(threads.slot1_proc_one), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadSlot1ProcTwo", NULL, 0, iptr:&(threads.slot1_proc_two), defintval:1, TYPE_INT, 0}, \
|
||||
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
|
||||
{"C" , CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:DEFAULT_DLF, TYPE_UINT, 0}, \
|
||||
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \
|
||||
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \
|
||||
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \
|
||||
{"K" , CONFIG_HLP_ITTIL, PARAMFLAG_NOFREE, strptr:&itti_dump_file, defstrval:"/tmp/itti.dump", TYPE_STRING, 0}, \
|
||||
{"m" , CONFIG_HLP_DLMCS, 0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \
|
||||
{"t" , CONFIG_HLP_ULMCS, 0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \
|
||||
{"W" , CONFIG_HLP_L2MONW, 0, strptr:(char **)&in_ip, defstrval:"127.0.0.1", TYPE_STRING, sizeof(in_ip)}, \
|
||||
{"P" , CONFIG_HLP_L2MONP, 0, strptr:(char **)&in_path, defstrval:"/tmp/oai_opt.pcap", TYPE_STRING, sizeof(in_path)}, \
|
||||
{"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&ouput_vcd, defintval:0, TYPE_INT, 0}, \
|
||||
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
|
||||
{"S" , CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \
|
||||
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT,PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0} \
|
||||
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&rf_config_file, defstrval:NULL, TYPE_STRING, sizeof(rf_config_file)}, \
|
||||
{"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \
|
||||
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \
|
||||
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \
|
||||
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \
|
||||
{"external-clock", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, uptr:&clock_source, defintval:0, TYPE_INT, 0}, \
|
||||
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&wait_for_sync, defintval:0, TYPE_INT, 0}, \
|
||||
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
|
||||
{"threadIQ", NULL, 0, iptr:&(threads.iq), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadOneSubframe", NULL, 0, iptr:&(threads.one), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadTwoSubframe", NULL, 0, iptr:&(threads.two), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadThreeSubframe", NULL, 0, iptr:&(threads.three), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadSlot1ProcOne", NULL, 0, iptr:&(threads.slot1_proc_one), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadSlot1ProcTwo", NULL, 0, iptr:&(threads.slot1_proc_two), defintval:1, TYPE_INT, 0}, \
|
||||
{"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
|
||||
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
|
||||
{"C" , CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:2680000000, TYPE_UINT, 0}, \
|
||||
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \
|
||||
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \
|
||||
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \
|
||||
{"K" , CONFIG_HLP_ITTIL, PARAMFLAG_NOFREE, strptr:&itti_dump_file, defstrval:"/tmp/itti.dump", TYPE_STRING, 0}, \
|
||||
{"m" , CONFIG_HLP_DLMCS, 0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \
|
||||
{"t" , CONFIG_HLP_ULMCS, 0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \
|
||||
{"W" , CONFIG_HLP_L2MONW, 0, strptr:(char **)&in_ip, defstrval:"127.0.0.1", TYPE_STRING, sizeof(in_ip)}, \
|
||||
{"P" , CONFIG_HLP_L2MONP, 0, strptr:(char **)&in_path, defstrval:"/tmp/oai_opt.pcap", TYPE_STRING, sizeof(in_path)}, \
|
||||
{"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&ouput_vcd, defintval:0, TYPE_INT, 0}, \
|
||||
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
|
||||
{"S" , CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \
|
||||
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&numerology, defintval:0, TYPE_INT, 0}, \
|
||||
{"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \
|
||||
{"codingw" , CONFIG_HLP_CODINGW, PARAMFLAG_BOOL, iptr:&codingw, defintval:0, TYPE_INT, 0}, \
|
||||
{"fepw" , CONFIG_HLP_FEPW, PARAMFLAG_BOOL, iptr:&fepw, defintval:0, TYPE_INT, 0}, \
|
||||
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0} \
|
||||
}
|
||||
|
||||
#define CONFIG_HLP_FLOG "Enable online log \n"
|
||||
@@ -263,8 +274,10 @@ extern void reset_opp_meas(void);
|
||||
extern void print_opp_meas(void);
|
||||
|
||||
extern void init_fep_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
extern void init_td_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
extern void init_te_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
extern void init_td_thread(PHY_VARS_eNB *);
|
||||
extern void init_te_thread(PHY_VARS_eNB *);
|
||||
extern void kill_td_thread(PHY_VARS_eNB *);
|
||||
extern void kill_te_thread(PHY_VARS_eNB *);
|
||||
|
||||
PHY_VARS_UE* init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t UE_id,
|
||||
|
||||
@@ -213,7 +213,10 @@ extern PHY_VARS_UE* init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
int transmission_mode=1;
|
||||
|
||||
|
||||
int emulate_rf = 0;
|
||||
int numerology = 0;
|
||||
int codingw = 0;
|
||||
int fepw = 0;
|
||||
|
||||
/* struct for ethernet specific parameters given in eNB conf file */
|
||||
eth_params_t *eth_params;
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <getopt.h>
|
||||
#include <sys/sysinfo.h>
|
||||
#include "rt_wrapper.h"
|
||||
#include <errno.h>
|
||||
|
||||
#include "openair1/PHY/defs_common.h"
|
||||
|
||||
@@ -283,6 +284,7 @@ void thread_top_init(char *thread_name,
|
||||
|
||||
if (sched_setattr(0, &attr, flags) < 0 ) {
|
||||
perror("[SCHED] eNB tx thread: sched_setattr failed\n");
|
||||
fprintf(stderr,"sched_setattr Error = %s",strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,11 @@
|
||||
#include "oaisim.h"
|
||||
|
||||
#define RF
|
||||
//#define DEBUG_SIM
|
||||
#define DEBUG_SIM
|
||||
/*
|
||||
#undef LOG_D
|
||||
#define LOG_D(A,B,C...) printf(B,C)
|
||||
*/
|
||||
|
||||
int number_rb_ul;
|
||||
int first_rbUL ;
|
||||
@@ -232,7 +236,6 @@ void do_DL_sig(channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM
|
||||
pthread_mutex_lock(&RU_output_mutex[UE_id]);
|
||||
|
||||
if (RU_output_mask[UE_id] == 0) { // This is the first eNodeB for this UE, clear the buffer
|
||||
|
||||
for (aa=0; aa<nb_antennas_rx; aa++) {
|
||||
memset((void*)r_re_DL[UE_id][aa],0,(RC.ru[0]->frame_parms.samples_per_tti)*sizeof(double));
|
||||
memset((void*)r_im_DL[UE_id][aa],0,(RC.ru[0]->frame_parms.samples_per_tti)*sizeof(double));
|
||||
@@ -375,7 +378,8 @@ void do_DL_sig(channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM
|
||||
UE_id,ru_id,
|
||||
10*log10(rx_pwr),subframe);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
pthread_mutex_lock(&RU_output_mutex[UE_id]);
|
||||
for (i=0; i<frame_parms->samples_per_tti; i++) {
|
||||
for (aa=0; aa<nb_antennas_rx; aa++) {
|
||||
@@ -389,14 +393,14 @@ void do_DL_sig(channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM
|
||||
|
||||
|
||||
|
||||
double *r_re_p[2] = {r_re_DL[ru_id][0],r_re_DL[ru_id][1]};
|
||||
double *r_im_p[2] = {r_im_DL[ru_id][0],r_im_DL[ru_id][1]};
|
||||
double *r_re_p[2] = {r_re_DL[UE_id][0],r_re_DL[UE_id][1]};
|
||||
double *r_im_p[2] = {r_im_DL[UE_id][0],r_im_DL[UE_id][1]};
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp(r_re_p,r_im_p,nb_antennas_rx,length<length_meas?length:length_meas,0)/(12.0*frame_parms->N_RB_DL);
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : ADC in %f dBm/RE for subframe %d\n",UE_id,10*log10(rx_pwr),subframe);
|
||||
#endif
|
||||
|
||||
|
||||
rxdata = PHY_vars_UE_g[UE_id][CC_id]->common_vars.rxdata;
|
||||
sf_offset = (subframe*frame_parms->samples_per_tti)+offset;
|
||||
|
||||
|
||||
+11
-10
@@ -195,6 +195,11 @@ time_stats_t oaisim_stats_f;
|
||||
time_stats_t dl_chan_stats;
|
||||
time_stats_t ul_chan_stats;
|
||||
|
||||
int emulate_rf = 0;
|
||||
int numerology = 0;
|
||||
int codingw = 0;
|
||||
int fepw = 0;
|
||||
|
||||
// this should reflect the channel models in openair1/SIMULATION/TOOLS/defs.h
|
||||
mapping small_scale_names[] = {
|
||||
{ "custom", custom }, { "SCM_A", SCM_A },
|
||||
@@ -737,19 +742,16 @@ l2l1_task (void *args_p)
|
||||
|
||||
CC_id=0;
|
||||
int all_done=0;
|
||||
|
||||
while (all_done==0) {
|
||||
|
||||
pthread_mutex_lock(&subframe_mutex);
|
||||
int subframe_ru_mask_local = subframe_ru_mask;
|
||||
int subframe_UE_mask_local = subframe_UE_mask;
|
||||
int subframe_ru_mask_local = (subframe_select(&RC.ru[0]->frame_parms,(sf+4)%10)!=SF_UL) ? subframe_ru_mask : ((1<<NB_RU)-1);
|
||||
int subframe_UE_mask_local = (RC.ru[0]->frame_parms.frame_type == FDD || subframe_select(&RC.ru[0]->frame_parms,(sf+4)%10)!=SF_DL) ? subframe_UE_mask : ((1<<NB_UE_INST)-1);
|
||||
pthread_mutex_unlock(&subframe_mutex);
|
||||
LOG_D(EMU,"Frame %d, Subframe %d, NB_RU %d, NB_UE %d: Checking masks %x,%x\n",frame,sf,NB_RU,NB_UE_INST,subframe_ru_mask_local,subframe_UE_mask_local);
|
||||
if ((subframe_ru_mask_local == ((1<<NB_RU)-1)) &&
|
||||
(subframe_UE_mask_local == ((1<<NB_UE_INST)-1)))
|
||||
all_done=1;
|
||||
else
|
||||
usleep(1500);
|
||||
(subframe_UE_mask_local == ((1<<NB_UE_INST)-1))) all_done=1;
|
||||
else usleep(1500);
|
||||
}
|
||||
|
||||
|
||||
@@ -816,18 +818,16 @@ l2l1_task (void *args_p)
|
||||
fwrite (stats_buffer, 1, len, eNB_stats[eNB_inst]);
|
||||
fflush(eNB_stats[eNB_inst]);
|
||||
}
|
||||
*/
|
||||
#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
|
||||
}
|
||||
}// eNB_inst loop
|
||||
@@ -1070,6 +1070,7 @@ void set_UE_defaults(int nb_ue) {
|
||||
PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[i][0]->agregationLevel = 0xFF;
|
||||
}
|
||||
PHY_vars_UE_g[UE_id][CC_id]->current_dlsch_cqi[0] = 10;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_power_max_dBm = 23;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1087,20 +1087,21 @@ int ru_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
|
||||
|
||||
|
||||
subframe = (last_ru_rx_timestamp[ru_id][CC_id]/RC.ru[ru_id]->frame_parms.samples_per_tti)%10;
|
||||
LOG_D(EMU,"RU_trx_read generating UL subframe %d (Ts %llu, current TS %llu)\n",
|
||||
subframe,(unsigned long long)*ptimestamp,
|
||||
(unsigned long long)current_ru_rx_timestamp[ru_id][CC_id]);
|
||||
|
||||
do_UL_sig(UE2RU,
|
||||
enb_data,
|
||||
ue_data,
|
||||
subframe,
|
||||
0, // abstraction_flag
|
||||
&RC.ru[ru_id]->frame_parms,
|
||||
0, // frame is only used for abstraction
|
||||
ru_id,
|
||||
CC_id);
|
||||
|
||||
if (subframe_select(&RC.ru[ru_id]->frame_parms,subframe) != SF_DL || RC.ru[ru_id]->frame_parms.frame_type == FDD) {
|
||||
LOG_D(EMU,"RU_trx_read generating UL subframe %d (Ts %llu, current TS %llu)\n",
|
||||
subframe,(unsigned long long)*ptimestamp,
|
||||
(unsigned long long)current_ru_rx_timestamp[ru_id][CC_id]);
|
||||
|
||||
do_UL_sig(UE2RU,
|
||||
enb_data,
|
||||
ue_data,
|
||||
subframe,
|
||||
0, // abstraction_flag
|
||||
&RC.ru[ru_id]->frame_parms,
|
||||
0, // frame is only used for abstraction
|
||||
ru_id,
|
||||
CC_id);
|
||||
}
|
||||
last_ru_rx_timestamp[ru_id][CC_id] += RC.ru[ru_id]->frame_parms.samples_per_tti;
|
||||
sample_count += RC.ru[ru_id]->frame_parms.samples_per_tti;
|
||||
}
|
||||
@@ -1352,9 +1353,6 @@ void init_devices(void){
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_set_freq_func = UE_trx_set_freq;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_set_gains_func = UE_trx_set_gains;
|
||||
last_UE_rx_timestamp[UE_id][CC_id] = 0;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1529,11 +1527,11 @@ void update_ocm()
|
||||
//LOG_D(OMG," extracting position of eNb...\n");
|
||||
//display_node_list(enb_node_list);
|
||||
// display_node_list(ue_node_list);
|
||||
extract_position(enb_node_list, enb_data, RC.nb_RU);
|
||||
//extract_position(enb_node_list, enb_data, RC.nb_RU);
|
||||
//extract_position_fixed_enb(enb_data, NB_eNB_INST,frame);
|
||||
//LOG_D(OMG," extracting position of UE...\n");
|
||||
// if (oai_emulation.info.omg_model_ue == TRACE)
|
||||
extract_position(ue_node_list, ue_data, NB_UE_INST);
|
||||
//extract_position(ue_node_list, ue_data, NB_UE_INST);
|
||||
|
||||
/* if (frame % 50 == 0)
|
||||
LOG_N(OCM,"Path loss for TTI %d : \n", frame);
|
||||
|
||||
Reference in New Issue
Block a user