Merge branch 'develop-uedirectorysplit' into nr_initialsync
This commit is contained in:
@@ -123,7 +123,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,18 +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:
|
||||
|
||||
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_sample_advance = 15; //to be checked
|
||||
openair0_cfg[0].tx_bw = 80e6;
|
||||
openair0_cfg[0].rx_bw = 80e6;
|
||||
break;
|
||||
case 92160000:
|
||||
openair0_cfg[0].tx_sample_advance = 15; //to be checked
|
||||
case 92160000:
|
||||
openair0_cfg[0].tx_sample_advance = 15; //to be checked
|
||||
openair0_cfg[0].tx_bw = 80e6;
|
||||
openair0_cfg[0].rx_bw = 80e6;
|
||||
break;
|
||||
break;
|
||||
|
||||
case 61440000:
|
||||
// from usrp_time_offset
|
||||
//openair0_cfg[0].samples_per_packet = 2048;
|
||||
@@ -1035,11 +1042,13 @@ extern "C" {
|
||||
openair0_cfg[0].tx_bw = 40e6;
|
||||
openair0_cfg[0].rx_bw = 40e6;
|
||||
break;
|
||||
case 46080000:
|
||||
|
||||
case 46080000:
|
||||
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;
|
||||
@@ -1047,7 +1056,7 @@ extern "C" {
|
||||
openair0_cfg[0].tx_bw = 20e6;
|
||||
openair0_cfg[0].rx_bw = 20e6;
|
||||
break;
|
||||
case 23040000:
|
||||
case 23040000:
|
||||
openair0_cfg[0].tx_sample_advance = 15;
|
||||
openair0_cfg[0].tx_bw = 20e6;
|
||||
openair0_cfg[0].rx_bw = 20e6;
|
||||
|
||||
@@ -36,10 +36,12 @@
|
||||
# include "lteRALue.h"
|
||||
# include "lteRALenb.h"
|
||||
# endif
|
||||
# include "RRC/LITE/defs.h"
|
||||
# include "RRC/LTE/rrc_defs.h"
|
||||
# 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) {
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
# include "lteRALue.h"
|
||||
# include "lteRALenb.h"
|
||||
# endif
|
||||
# include "RRC/LITE/defs.h"
|
||||
# include "RRC/LTE/rrc_defs.h"
|
||||
# endif
|
||||
# include "enb_app.h"
|
||||
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
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 = "92";
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
node_function = "eNodeB_3GPP";
|
||||
node_timing = "synch_to_ext_device";
|
||||
node_synch_ref = 0;
|
||||
frame_type = "TDD";
|
||||
tdd_config = 3;
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 38;
|
||||
downlink_frequency = 2600000000L;
|
||||
uplink_frequency_offset = 0;
|
||||
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 = 32;
|
||||
rx_gain = 116;
|
||||
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 = -16;
|
||||
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 = -90;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -108;
|
||||
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 = "eth0";
|
||||
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.111/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="debug";
|
||||
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 ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,175 @@
|
||||
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 = "92";
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
node_function = "eNodeB_3GPP";
|
||||
node_timing = "synch_to_ext_device";
|
||||
node_synch_ref = 0;
|
||||
frame_type = "TDD";
|
||||
tdd_config = 3;
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 38;
|
||||
downlink_frequency = 2600000000L;
|
||||
uplink_frequency_offset = 0;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 25;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 32;
|
||||
rx_gain = 116;
|
||||
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 = -16;
|
||||
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 = -90;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -108;
|
||||
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 = "eth0";
|
||||
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.111/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="debug";
|
||||
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 ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
|
||||
}
|
||||
);
|
||||
@@ -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
|
||||
|
||||
+300
-83
@@ -44,7 +44,12 @@
|
||||
|
||||
#include "PHY/types.h"
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
|
||||
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
|
||||
@@ -55,22 +60,14 @@
|
||||
#include "PHY/LTE_TRANSPORT/if4_tools.h"
|
||||
#include "PHY/LTE_TRANSPORT/if5_tools.h"
|
||||
|
||||
#include "PHY/extern.h"
|
||||
#include "SCHED/extern.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
|
||||
#include "../../SIMU/USER/init_lte.h"
|
||||
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#include "LAYER2/MAC/proto.h"
|
||||
#include "RRC/LITE/extern.h"
|
||||
#include "PHY_INTERFACE/extern.h"
|
||||
#include "PHY_INTERFACE/defs.h"
|
||||
#ifdef SMBV
|
||||
#include "PHY/TOOLS/smbv.h"
|
||||
unsigned short config_frames[4] = {2,9,11,13};
|
||||
#endif
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface.h"
|
||||
#include "UTIL/LOG/log_extern.h"
|
||||
#include "UTIL/OTG/otg_tx.h"
|
||||
#include "UTIL/OTG/otg_externs.h"
|
||||
@@ -78,7 +75,7 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "enb_config.h"
|
||||
//#include "PHY/TOOLS/time_meas.h"
|
||||
|
||||
|
||||
#ifndef OPENAIR2
|
||||
#include "UTIL/OTG/otg_extern.h"
|
||||
@@ -148,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);
|
||||
@@ -218,7 +217,16 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
|
||||
|
||||
// UE-specific RX processing for subframe n
|
||||
if (nfapi_mode == 0 || nfapi_mode == 1) {
|
||||
phy_procedures_eNB_uespec_RX(eNB, proc, no_relay );
|
||||
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);
|
||||
@@ -231,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, no_relay, NULL, 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 );
|
||||
|
||||
@@ -293,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, 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.
|
||||
@@ -302,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, 1);
|
||||
wakeup_txfh(proc,eNB->proc.ru_proc);
|
||||
}
|
||||
|
||||
} // while !oai_exit
|
||||
|
||||
@@ -367,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;
|
||||
@@ -378,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;
|
||||
|
||||
@@ -426,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
|
||||
@@ -452,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);
|
||||
}
|
||||
@@ -605,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) {
|
||||
|
||||
@@ -647,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) {
|
||||
|
||||
@@ -671,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) {
|
||||
|
||||
@@ -682,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
|
||||
@@ -699,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;
|
||||
@@ -724,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
|
||||
@@ -747,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);
|
||||
|
||||
@@ -767,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);
|
||||
|
||||
|
||||
}
|
||||
@@ -792,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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -805,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 );
|
||||
@@ -842,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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1094,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");
|
||||
|
||||
+284
-113
@@ -60,7 +60,7 @@
|
||||
|
||||
#include "PHY/types.h"
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/defs_common.h"
|
||||
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
|
||||
|
||||
@@ -70,22 +70,19 @@
|
||||
#include "PHY/LTE_TRANSPORT/if4_tools.h"
|
||||
#include "PHY/LTE_TRANSPORT/if5_tools.h"
|
||||
|
||||
#include "PHY/extern.h"
|
||||
#include "SCHED/extern.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
|
||||
#include "../../SIMU/USER/init_lte.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface.h"
|
||||
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#include "LAYER2/MAC/proto.h"
|
||||
#include "RRC/LITE/extern.h"
|
||||
#include "PHY_INTERFACE/extern.h"
|
||||
|
||||
#ifdef SMBV
|
||||
#include "PHY/TOOLS/smbv.h"
|
||||
unsigned short config_frames[4] = {2,9,11,13};
|
||||
#endif
|
||||
#include "UTIL/LOG/log_extern.h"
|
||||
#include "UTIL/OTG/otg_tx.h"
|
||||
#include "UTIL/OTG/otg_externs.h"
|
||||
@@ -117,7 +114,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*);
|
||||
@@ -679,6 +680,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;
|
||||
@@ -686,7 +715,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];
|
||||
@@ -694,12 +723,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 );
|
||||
|
||||
@@ -715,7 +750,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;
|
||||
}
|
||||
@@ -725,9 +760,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,
|
||||
@@ -739,8 +774,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) {
|
||||
@@ -815,6 +848,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 );
|
||||
@@ -855,7 +890,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
|
||||
|
||||
@@ -881,7 +916,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) {
|
||||
@@ -907,6 +942,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
|
||||
@@ -954,7 +990,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);
|
||||
@@ -1009,7 +1046,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) {
|
||||
|
||||
@@ -1139,13 +1177,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 {
|
||||
|
||||
@@ -1154,7 +1193,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);
|
||||
@@ -1185,7 +1224,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");
|
||||
}
|
||||
@@ -1231,20 +1270,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;
|
||||
@@ -1363,7 +1421,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);
|
||||
@@ -1377,6 +1435,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;
|
||||
@@ -1387,35 +1498,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);
|
||||
|
||||
LOG_I(PHY,"Starting RU %d (%s,%s),\n",ru->idx,NB_functions[ru->function],NB_timing[ru->if_timing]);
|
||||
|
||||
//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));
|
||||
|
||||
// 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);
|
||||
@@ -1424,38 +1554,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) {
|
||||
@@ -1505,20 +1643,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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1641,7 +1780,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;
|
||||
@@ -1656,14 +1795,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;
|
||||
|
||||
@@ -1671,15 +1815,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);
|
||||
@@ -1694,15 +1844,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 );
|
||||
@@ -1714,7 +1871,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 );
|
||||
@@ -1725,7 +1885,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);
|
||||
}
|
||||
@@ -1740,38 +1900,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);
|
||||
@@ -1791,7 +1959,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;
|
||||
@@ -1822,15 +1990,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);
|
||||
@@ -2061,8 +2232,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;
|
||||
@@ -2083,8 +2254,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
|
||||
@@ -2112,9 +2283,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
|
||||
@@ -2245,7 +2416,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);
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
#include "PHY/types.h"
|
||||
|
||||
//#include "PHY/defs.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "common/config/config_userapi.h"
|
||||
#include "common/utils/load_module_shlib.h"
|
||||
@@ -59,17 +59,14 @@
|
||||
|
||||
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
|
||||
#include "PHY/vars.h"
|
||||
#include "SCHED/vars.h"
|
||||
#include "LAYER2/MAC/vars.h"
|
||||
#include "PHY/phy_vars.h"
|
||||
#include "SCHED/sched_common_vars.h"
|
||||
#include "LAYER2/MAC/mac_vars.h"
|
||||
|
||||
#include "../../SIMU/USER/init_lte.h"
|
||||
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
#include "LAYER2/MAC/vars.h"
|
||||
#include "LAYER2/MAC/proto.h"
|
||||
#include "RRC/LITE/vars.h"
|
||||
#include "PHY_INTERFACE/vars.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "RRC/LTE/rrc_vars.h"
|
||||
#include "PHY_INTERFACE/phy_interface_vars.h"
|
||||
|
||||
#ifdef SMBV
|
||||
#include "PHY/TOOLS/smbv.h"
|
||||
@@ -93,6 +90,8 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include "create_tasks.h"
|
||||
#endif
|
||||
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#ifdef XFORMS
|
||||
@@ -143,7 +142,8 @@ static int8_t threequarter_fs=0;
|
||||
uint32_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
|
||||
// This is a dummy declaration (dlsch_demodulation.c is no longer compiled for eNodeB)
|
||||
int16_t dlsch_demod_shift = 0;
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
static char *itti_dump_file = NULL;
|
||||
@@ -217,6 +217,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;
|
||||
|
||||
|
||||
|
||||
@@ -632,6 +636,7 @@ void init_openair0(void) {
|
||||
|
||||
int card;
|
||||
int i;
|
||||
|
||||
|
||||
for (card=0; card<MAX_CARDS; card++) {
|
||||
|
||||
@@ -639,6 +644,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;
|
||||
@@ -650,6 +657,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;
|
||||
@@ -904,7 +927,6 @@ int main( int argc, char **argv )
|
||||
int ret;
|
||||
#endif
|
||||
|
||||
start_background_system();
|
||||
if ( load_configmodule(argc,argv) == NULL) {
|
||||
exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
|
||||
}
|
||||
@@ -1072,7 +1094,7 @@ int main( int argc, char **argv )
|
||||
|
||||
// init UE_PF_PO and mutex lock
|
||||
pthread_mutex_init(&ue_pf_po_mutex, NULL);
|
||||
memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*NUMBER_OF_UE_MAX*MAX_NUM_CCs);
|
||||
memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*MAX_MOBILES_PER_ENB*MAX_NUM_CCs);
|
||||
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
|
||||
@@ -1209,9 +1231,6 @@ int main( int argc, char **argv )
|
||||
sync_var=0;
|
||||
pthread_cond_broadcast(&sync_cond);
|
||||
pthread_mutex_unlock(&sync_mutex);
|
||||
printf("About to call end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
|
||||
end_configmodule();
|
||||
printf("Called end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
|
||||
|
||||
// wait for end of program
|
||||
printf("TYPE <CTRL-C> TO TERMINATE\n");
|
||||
@@ -1271,6 +1290,9 @@ int main( int argc, char **argv )
|
||||
}
|
||||
free_lte_top();
|
||||
|
||||
printf("About to call end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
|
||||
end_configmodule();
|
||||
printf("Called end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
|
||||
|
||||
pthread_cond_destroy(&sync_cond);
|
||||
pthread_mutex_destroy(&sync_mutex);
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
#include "assertions.h"
|
||||
#include "msc.h"
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
|
||||
#include "flexran_agent.h"
|
||||
@@ -85,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"
|
||||
|
||||
/***************************************************************************************************************************************/
|
||||
@@ -140,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"
|
||||
@@ -262,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,
|
||||
|
||||
@@ -33,19 +33,16 @@
|
||||
|
||||
#include "rt_wrapper.h"
|
||||
|
||||
#ifdef OPENAIR2
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
#include "RRC/LITE/extern.h"
|
||||
#endif
|
||||
#include "PHY_INTERFACE/extern.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface_extern.h"
|
||||
|
||||
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
|
||||
#include "PHY/extern.h"
|
||||
#include "SCHED/extern.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#include "LAYER2/MAC/proto.h"
|
||||
#include "PHY/phy_extern_ue.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
|
||||
#include "UTIL/LOG/log_extern.h"
|
||||
#include "UTIL/OTG/otg_tx.h"
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
#include "PHY/types.h"
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "common/config/config_userapi.h"
|
||||
#include "common/utils/load_module_shlib.h"
|
||||
@@ -59,22 +59,18 @@
|
||||
|
||||
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
|
||||
#include "PHY/vars.h"
|
||||
#include "SCHED/vars.h"
|
||||
#include "LAYER2/MAC/vars.h"
|
||||
|
||||
#include "PHY/phy_vars_ue.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_vars.h"
|
||||
#include "SCHED/sched_common_vars.h"
|
||||
#include "PHY/MODULATION/modulation_vars.h"
|
||||
#include "../../SIMU/USER/init_lte.h"
|
||||
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
#include "LAYER2/MAC/vars.h"
|
||||
#include "LAYER2/MAC/proto.h"
|
||||
#include "RRC/LITE/vars.h"
|
||||
#include "PHY_INTERFACE/vars.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_vars.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "RRC/LTE/rrc_vars.h"
|
||||
#include "PHY_INTERFACE/phy_interface_vars.h"
|
||||
|
||||
#ifdef SMBV
|
||||
#include "PHY/TOOLS/smbv.h"
|
||||
unsigned short config_frames[4] = {2,9,11,13};
|
||||
#endif
|
||||
#include "UTIL/LOG/log_extern.h"
|
||||
#include "UTIL/OTG/otg_tx.h"
|
||||
#include "UTIL/OTG/otg_externs.h"
|
||||
@@ -101,6 +97,8 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#endif
|
||||
#include "lte-softmodem.h"
|
||||
|
||||
RAN_CONTEXT_t RC;
|
||||
|
||||
/* temporary compilation wokaround (UE/eNB split */
|
||||
uint16_t sf_ahead;
|
||||
#ifdef XFORMS
|
||||
@@ -213,7 +211,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;
|
||||
@@ -383,7 +384,7 @@ static void *scope_thread(void *arg) {
|
||||
#endif
|
||||
|
||||
while (!oai_exit) {
|
||||
dump_ue_stats (PHY_vars_UE_g[0][0], &PHY_vars_UE_g[0][0]->proc.proc_rxtx[0],stats_buffer, 0, mode,rx_input_level_dBm);
|
||||
// dump_ue_stats (PHY_vars_UE_g[0][0], &PHY_vars_UE_g[0][0]->proc.proc_rxtx[0],stats_buffer, 0, mode,rx_input_level_dBm);
|
||||
//fl_set_object_label(form_stats->stats_text, stats_buffer);
|
||||
fl_clear_browser(form_stats->stats_text);
|
||||
fl_add_browser_line(form_stats->stats_text, stats_buffer);
|
||||
|
||||
@@ -43,8 +43,9 @@
|
||||
#include <getopt.h>
|
||||
#include <sys/sysinfo.h>
|
||||
#include "rt_wrapper.h"
|
||||
#include <errno.h>
|
||||
|
||||
#include "openair1/PHY/defs.h"
|
||||
#include "openair1/PHY/defs_common.h"
|
||||
|
||||
static int latency_target_fd = -1;
|
||||
static int32_t latency_target_value = 0;
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,32 +26,24 @@
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "SIMULATION/TOOLS/defs.h"
|
||||
#include "SIMULATION/RF/defs.h"
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include "SIMULATION/RF/rf.h"
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/phy_extern_ue.h"
|
||||
|
||||
#ifdef OPENAIR2
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "UTIL/LOG/log_if.h"
|
||||
#include "UTIL/LOG/log_extern.h"
|
||||
#include "RRC/LITE/extern.h"
|
||||
#include "PHY_INTERFACE/extern.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface_extern.h"
|
||||
#include "UTIL/OCG/OCG.h"
|
||||
#include "UTIL/OPT/opt.h" // to test OPT
|
||||
#endif
|
||||
|
||||
#include "UTIL/FIFO/types.h"
|
||||
|
||||
#ifdef IFFT_FPGA
|
||||
#include "PHY/LTE_REFSIG/mod_table.h"
|
||||
#endif
|
||||
|
||||
#include "SCHED/defs.h"
|
||||
#include "SCHED/extern.h"
|
||||
|
||||
#ifdef XFORMS
|
||||
#include "forms.h"
|
||||
#include "phy_procedures_sim_form.h"
|
||||
@@ -60,7 +52,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 +228,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 +370,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 +385,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;
|
||||
|
||||
|
||||
@@ -29,12 +29,12 @@
|
||||
|
||||
#include "init_lte.h"
|
||||
|
||||
#include "PHY/extern.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "UTIL/LOG/log_if.h"
|
||||
#include "PHY_INTERFACE/extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface.h"
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
|
||||
PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t eNB_id,
|
||||
@@ -32,10 +32,6 @@ PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t UE_id,
|
||||
uint8_t abstraction_flag);
|
||||
|
||||
PHY_VARS_RN* init_lte_RN(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t RN_id,
|
||||
uint8_t eMBMS_active_state);
|
||||
|
||||
void init_lte_vars(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs],
|
||||
uint8_t frame_type,
|
||||
uint8_t tdd_config,
|
||||
|
||||
+63
-70
@@ -41,24 +41,23 @@
|
||||
#include <execinfo.h>
|
||||
|
||||
#include "event_handler.h"
|
||||
#include "SIMULATION/RF/defs.h"
|
||||
#include "SIMULATION/RF/rf.h"
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/LTE_TRANSPORT/proto.h"
|
||||
#include "PHY/vars.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
|
||||
#include "PHY/phy_vars.h"
|
||||
#include "PHY/phy_vars_ue.h"
|
||||
#include "SCHED/sched_common_vars.h"
|
||||
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
|
||||
//#ifdef OPENAIR2
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
#include "LAYER2/MAC/proto.h"
|
||||
#include "LAYER2/MAC/vars.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "LAYER2/MAC/mac_vars.h"
|
||||
#include "pdcp.h"
|
||||
#include "RRC/LITE/vars.h"
|
||||
#include "RRC/LTE/rrc_vars.h"
|
||||
#include "RRC/NAS/nas_config.h"
|
||||
|
||||
#include "SCHED/defs.h"
|
||||
#include "SCHED/vars.h"
|
||||
#include "system.h"
|
||||
|
||||
|
||||
@@ -101,6 +100,7 @@ char smbv_ip[16];
|
||||
#if defined(ENABLE_ITTI)
|
||||
# include "intertask_interface.h"
|
||||
# include "create_tasks.h"
|
||||
# include "intertask_interface_init.h"
|
||||
#endif
|
||||
|
||||
#include "T.h"
|
||||
@@ -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 },
|
||||
@@ -622,12 +627,8 @@ l2l1_task (void *args_p)
|
||||
}
|
||||
|
||||
#endif
|
||||
module_id_t UE_id;
|
||||
|
||||
|
||||
if (abstraction_flag == 1) {
|
||||
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++)
|
||||
dl_phy_sync_success (UE_id, 0, 0,1); //UE_id%NB_eNB_INST);
|
||||
}
|
||||
|
||||
start_meas (&oaisim_stats);
|
||||
|
||||
@@ -696,8 +697,8 @@ l2l1_task (void *args_p)
|
||||
//oai_emulation.info.time_ms += 1;
|
||||
oai_emulation.info.time_s += 0.01; // emu time in s, each frame lasts for 10 ms // JNote: TODO check the coherency of the time and frame (I corrected it to 10 (instead of 0.01)
|
||||
|
||||
update_omg (frame); // frequency is defined in the omg_global params configurable by the user
|
||||
update_omg_ocm ();
|
||||
//update_omg (frame); // frequency is defined in the omg_global params configurable by the user
|
||||
//update_omg_ocm ();
|
||||
|
||||
#ifdef OPENAIR2
|
||||
|
||||
@@ -737,19 +738,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);
|
||||
}
|
||||
|
||||
|
||||
@@ -794,15 +792,6 @@ l2l1_task (void *args_p)
|
||||
PHY_vars_eNB_g[eNB_inst][0]->frame_parms.Nid_cell);
|
||||
|
||||
*/
|
||||
#ifdef OPENAIR2
|
||||
//Application: traffic gen
|
||||
update_otg_eNB (eNB_inst, oai_emulation.info.time_ms);
|
||||
|
||||
//IP/OTG to PDCP and PDCP to IP operation
|
||||
// pdcp_run (frame, 1, 0, eNB_inst); //PHY_vars_eNB_g[eNB_id]->Mod_id
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRINT_STATS
|
||||
|
||||
if((sf==9) && frame%10==0)
|
||||
@@ -816,18 +805,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
|
||||
@@ -874,7 +861,7 @@ l2l1_task (void *args_p)
|
||||
|
||||
|
||||
}
|
||||
update_ocm ();
|
||||
//update_ocm ();
|
||||
/*
|
||||
if ((frame >= 10) && (frame <= 11) && (abstraction_flag == 0)
|
||||
#ifdef PROC
|
||||
@@ -1070,6 +1057,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1109,6 +1097,7 @@ int main (int argc, char **argv)
|
||||
oai_emulation.info.n_frames = MAX_FRAME_NUMBER; //1024; //10;
|
||||
oai_emulation.info.n_frames_flag = 0; //fixme
|
||||
snr_dB = 30;
|
||||
NB_UE_INST = 1;
|
||||
|
||||
//Default values if not changed by the user in get_simulation_options();
|
||||
pdcp_period = 1;
|
||||
@@ -1125,7 +1114,7 @@ int main (int argc, char **argv)
|
||||
// start thread for log gen
|
||||
log_thread_init ();
|
||||
|
||||
init_oai_emulation (); // to initialize everything !!!
|
||||
//init_oai_emulation (); // to initialize everything !!!
|
||||
|
||||
// get command-line options
|
||||
get_simulation_options (argc, argv); //Command-line options
|
||||
@@ -1162,7 +1151,37 @@ int main (int argc, char **argv)
|
||||
|
||||
#endif
|
||||
// configure oaisim with OCG
|
||||
oaisim_config (); // config OMG and OCG, OPT, OTG, OLG
|
||||
//oaisim_config (); // config OMG and OCG, OPT, OTG, OLG
|
||||
logInit();
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, oai_emulation.info.itti_dump_file);
|
||||
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
|
||||
#endif
|
||||
|
||||
set_glog(LOG_INFO, 0x15);
|
||||
|
||||
|
||||
//set_log(OCG, LOG_DEBUG, 1);
|
||||
//set_log(EMU, LOG_INFO, 20);
|
||||
set_log(MAC, LOG_DEBUG, 1);
|
||||
set_log(RLC, LOG_TRACE, 1);
|
||||
//set_log(PHY, LOG_DEBUG, 1);
|
||||
set_log(PDCP, LOG_TRACE, 1);
|
||||
set_log(RRC, LOG_DEBUG, 1);
|
||||
//set_log(OCM, LOG_INFO, 20);
|
||||
//set_log(OTG, LOG_INFO, 1);
|
||||
set_comp_log(OCG, LOG_ERR, 0x15,1);
|
||||
set_comp_log(EMU, LOG_DEBUG, 0x15,20);
|
||||
set_comp_log(MAC, LOG_TRACE, 0x15,1);
|
||||
set_comp_log(RLC, LOG_TRACE, 0x15,1);
|
||||
set_comp_log(PHY, LOG_TRACE, 0x15, 1);
|
||||
set_comp_log(PDCP, LOG_DEBUG, 0x15,1);
|
||||
set_comp_log(RRC, LOG_DEBUG, 0x15,1);
|
||||
set_comp_log(OCM, LOG_DEBUG, 0x15,20);
|
||||
set_comp_log(OTG, LOG_DEBUG, 0x15,1);
|
||||
set_comp_log(OMG, LOG_NOTICE, 0x15,1);
|
||||
set_comp_log(OPT, LOG_ERR, 0x15,1);
|
||||
|
||||
if (ue_connection_test == 1) {
|
||||
snr_direction = -snr_step;
|
||||
@@ -1174,15 +1193,11 @@ int main (int argc, char **argv)
|
||||
pthread_mutex_init(&sync_mutex, NULL);
|
||||
pthread_mutex_init(&subframe_mutex, NULL);
|
||||
|
||||
#ifdef OPENAIR2
|
||||
init_omv ();
|
||||
#endif
|
||||
//Before this call, NB_UE_INST and NB_eNB_INST are not set correctly
|
||||
check_and_adjust_params ();
|
||||
|
||||
set_seed = oai_emulation.emulation_config.seed.value;
|
||||
|
||||
init_otg_pdcp_buffer ();
|
||||
|
||||
init_seed (set_seed);
|
||||
|
||||
@@ -1197,7 +1212,7 @@ int main (int argc, char **argv)
|
||||
|
||||
|
||||
|
||||
if (create_tasks_ue(oai_emulation.info.nb_ue_local) < 0)
|
||||
if (create_tasks_ue(NB_UE_INST) < 0)
|
||||
exit(-1); // need a softer mode
|
||||
|
||||
|
||||
@@ -1210,6 +1225,7 @@ int main (int argc, char **argv)
|
||||
|
||||
|
||||
init_ocm ();
|
||||
|
||||
printf("Sending sync to all threads\n");
|
||||
|
||||
|
||||
@@ -1218,12 +1234,6 @@ int main (int argc, char **argv)
|
||||
pthread_cond_broadcast(&sync_cond);
|
||||
pthread_mutex_unlock(&sync_mutex);
|
||||
|
||||
#ifdef SMBV
|
||||
// Rohde&Schwarz SMBV100A vector signal generator
|
||||
smbv_init_config(smbv_fname, smbv_nframes);
|
||||
smbv_write_config_from_frame_parms(smbv_fname, &PHY_vars_eNB_g[0][0]->frame_parms);
|
||||
#endif
|
||||
|
||||
/* #if defined (FLEXRAN_AGENT_SB_IF)
|
||||
flexran_agent_start();
|
||||
#endif */
|
||||
@@ -1732,11 +1742,6 @@ oai_shutdown (void)
|
||||
|
||||
#endif
|
||||
|
||||
//Perform KPI measurements
|
||||
if (oai_emulation.info.otg_enabled == 1){
|
||||
LOG_N(EMU,"calling OTG kpi gen .... \n");
|
||||
kpi_gen ();
|
||||
}
|
||||
if (oai_emulation.info.opp_enabled == 1)
|
||||
print_opp_meas_oaisim ();
|
||||
|
||||
@@ -1792,15 +1797,6 @@ oai_shutdown (void)
|
||||
} //End of PHY abstraction changes
|
||||
|
||||
|
||||
// stop OMG
|
||||
stop_mobility_generator (omg_param_list); //omg_param_list.mobility_type
|
||||
#ifdef OPENAIR2
|
||||
|
||||
if (oai_emulation.info.omv_enabled == 1)
|
||||
omv_end (pfd[1], omv_data);
|
||||
|
||||
#endif
|
||||
|
||||
if ((oai_emulation.info.ocm_enabled == 1) && (ethernet_flag == 0)
|
||||
&& (ShaF != NULL)) {
|
||||
destroyMat (ShaF, map1, map2);
|
||||
@@ -1810,9 +1806,6 @@ oai_shutdown (void)
|
||||
if (opt_enabled == 1)
|
||||
terminate_opt ();
|
||||
|
||||
if (oai_emulation.info.cli_enabled)
|
||||
cli_server_cleanup ();
|
||||
|
||||
for (int i = 0; i < NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX; i++)
|
||||
if (oai_emulation.info.oai_ifup[i] == 1) {
|
||||
char interfaceName[8];
|
||||
|
||||
@@ -26,15 +26,16 @@
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "SIMULATION/TOOLS/defs.h"
|
||||
#include "SIMULATION/RF/defs.h"
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include "SIMULATION/RF/rf.h"
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "oaisim_config.h"
|
||||
#include "init_lte.h"
|
||||
|
||||
#ifdef OPENAIR2
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "UTIL/OMV/structures.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -49,10 +49,8 @@ The current sturcture of oaisim is shown by the figure.
|
||||
#include "UTIL/OPT/opt.h" // to test OPT
|
||||
#include "UTIL/OMG/omg.h"
|
||||
#include "UTIL/CLI/cli_if.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "SIMULATION/ETH_TRANSPORT/defs.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
|
||||
/** @defgroup _init_oai Initial oaisim
|
||||
* @ingroup _fn
|
||||
|
||||
@@ -43,29 +43,22 @@
|
||||
#include "assertions.h"
|
||||
#include "oaisim_functions.h"
|
||||
|
||||
#include "PHY/extern.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#ifdef OPENAIR2
|
||||
#include "LAYER2/MAC/proto.h"
|
||||
#endif
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/phy_extern_ue.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "LAYER2/PDCP_v10.1.0/pdcp.h"
|
||||
#include "LAYER2/PDCP_v10.1.0/pdcp_primitives.h"
|
||||
#include "RRC/LITE/extern.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
|
||||
#include "PHY_INTERFACE/extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface_extern.h"
|
||||
//#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
|
||||
#include "SCHED/extern.h"
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
#include "UTIL/OCG/OCG_extern.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "UTIL/OTG/otg_config.h"
|
||||
#include "UTIL/OTG/otg_tx.h"
|
||||
#if ENABLE_RAL
|
||||
#include "lteRALenb.h"
|
||||
#include "lteRALue.h"
|
||||
#endif
|
||||
|
||||
#include "cor_SF_sim.h"
|
||||
#include "enb_config.h"
|
||||
|
||||
@@ -83,11 +76,6 @@
|
||||
#include "ENB_APP/enb_paramdef.h"
|
||||
#include "common/config/config_userapi.h"
|
||||
|
||||
#ifdef SMBV
|
||||
extern uint8_t config_smbv;
|
||||
extern char smbv_ip[16];
|
||||
#endif
|
||||
|
||||
//constant for OAISIM soft realtime calibration
|
||||
#define SF_DEVIATION_OFFSET_NS 100000 //= 0.1ms : should be as a number of UE
|
||||
#define SLEEP_STEP_US 100 // = 0.01ms could be adaptive, should be as a number of UE
|
||||
@@ -137,34 +125,14 @@ int sleep_time_us = 0;
|
||||
|
||||
int phy_test = 0;
|
||||
|
||||
#ifdef OPENAIR2
|
||||
// omv related info
|
||||
//pid_t omv_pid;
|
||||
char full_name[200];
|
||||
extern int pfd[2]; // fd for omv : fixme: this could be a local var
|
||||
char fdstr[10];
|
||||
char frames[10];
|
||||
char num_enb[10];
|
||||
char num_ue[10];
|
||||
//area_x, area_y and area_z for omv
|
||||
char x_area[20];
|
||||
char y_area[20];
|
||||
char z_area[20];
|
||||
char nb_antenna[20];
|
||||
char frame_type[10];
|
||||
char tdd_config[10];
|
||||
#endif
|
||||
|
||||
Packet_OTG_List_t *otg_pdcp_buffer = NULL;
|
||||
|
||||
extern node_desc_t *enb_data[NUMBER_OF_RU_MAX];
|
||||
extern node_desc_t *ue_data[NUMBER_OF_UE_MAX];
|
||||
extern channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs];
|
||||
extern channel_desc_t *UE2RU[NUMBER_OF_UE_MAX][NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
extern node_desc_t *ue_data[MAX_MOBILES_PER_ENB];
|
||||
extern channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][MAX_MOBILES_PER_ENB][MAX_NUM_CCs];
|
||||
extern channel_desc_t *UE2RU[MAX_MOBILES_PER_ENB][NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
|
||||
extern mapping small_scale_names[];
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
extern pdcp_mbms_t pdcp_mbms_array_ue[NUMBER_OF_UE_MAX][maxServiceCount][maxSessionPerPMCH];
|
||||
extern pdcp_mbms_t pdcp_mbms_array_ue[MAX_MOBILES_PER_ENB][maxServiceCount][maxSessionPerPMCH];
|
||||
extern pdcp_mbms_t pdcp_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH];
|
||||
#endif
|
||||
|
||||
@@ -701,7 +669,7 @@ void get_simulation_options(int argc, char *argv[])
|
||||
break;
|
||||
|
||||
case 'u':
|
||||
oai_emulation.info.nb_ue_local = atoi (optarg);
|
||||
NB_UE_INST = atoi (optarg);
|
||||
break;
|
||||
|
||||
case 'U':
|
||||
@@ -870,13 +838,13 @@ void check_and_adjust_params(void)
|
||||
int32_t ret;
|
||||
//int i,j;
|
||||
|
||||
if (oai_emulation.info.nb_ue_local + oai_emulation.info.nb_rn_local > NUMBER_OF_UE_MAX) {
|
||||
LOG_E(EMU,"Enter fewer than %d UEs/RNs for the moment or change the NUMBER_OF_UE_MAX\n", NUMBER_OF_UE_MAX);
|
||||
if (oai_emulation.info.nb_ue_local + oai_emulation.info.nb_rn_local > MAX_MOBILES_PER_ENB) {
|
||||
LOG_E(EMU,"Enter fewer than %d UEs/RNs for the moment or change the MAX_MOBILES_PER_ENB\n", MAX_MOBILES_PER_ENB);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (oai_emulation.info.nb_enb_local + oai_emulation.info.nb_rn_local > NUMBER_OF_eNB_MAX) {
|
||||
LOG_E(EMU,"Enter fewer than %d eNBs/RNs for the moment or change the NUMBER_OF_UE_MAX\n", NUMBER_OF_eNB_MAX);
|
||||
LOG_E(EMU,"Enter fewer than %d eNBs/RNs for the moment or change the MAX_MOBILES_PER_ENB\n", NUMBER_OF_eNB_MAX);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -931,80 +899,15 @@ void check_and_adjust_params(void)
|
||||
} // ethernet flag
|
||||
*/
|
||||
//
|
||||
NB_UE_INST = oai_emulation.info.nb_ue_local + oai_emulation.info.nb_ue_remote;
|
||||
NB_eNB_INST = oai_emulation.info.nb_enb_local + oai_emulation.info.nb_enb_remote;
|
||||
NB_RN_INST = oai_emulation.info.nb_rn_local + oai_emulation.info.nb_rn_remote;
|
||||
NB_RU = oai_emulation.info.nb_ru_local + oai_emulation.info.nb_ru_remote;
|
||||
|
||||
NB_RU = RC.nb_RU;
|
||||
|
||||
#if defined(PDCP_USE_NETLINK_QUEUES) && defined(OPENAIR2)
|
||||
pdcp_netlink_init();
|
||||
#endif
|
||||
|
||||
if (NB_RN_INST > 0 ) {
|
||||
LOG_N(EMU,"Total number of RN %d (local %d, remote %d) mobility (the same as eNB) %s \n", NB_RN_INST,oai_emulation.info.nb_rn_local,oai_emulation.info.nb_rn_remote,
|
||||
oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option);
|
||||
|
||||
LOG_N(EMU,"Adjust the number of eNB inst (%d->%d) and UE inst (%d->%d)\n ",
|
||||
NB_eNB_INST, NB_eNB_INST+NB_RN_INST,
|
||||
NB_UE_INST, NB_UE_INST+NB_RN_INST);
|
||||
NB_eNB_INST+=NB_RN_INST;
|
||||
NB_UE_INST+=NB_RN_INST;
|
||||
}
|
||||
|
||||
LOG_I(EMU,"Total number of UE %d (first local %d , num local %d, remote %d, relay %d) mobility %s \n",
|
||||
NB_UE_INST,oai_emulation.info.first_ue_local, oai_emulation.info.nb_ue_local,oai_emulation.info.nb_ue_remote,
|
||||
NB_RN_INST,
|
||||
oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option);
|
||||
|
||||
LOG_I(EMU,"Total number of eNB %d (local %d, remote %d, relay %d) mobility %s \n",
|
||||
NB_eNB_INST,oai_emulation.info.nb_enb_local,oai_emulation.info.nb_enb_remote,
|
||||
NB_RN_INST,
|
||||
oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option);
|
||||
|
||||
}
|
||||
|
||||
#ifdef OPENAIR2
|
||||
void init_omv(void)
|
||||
{
|
||||
if (oai_emulation.info.omv_enabled == 1) {
|
||||
|
||||
if(pipe(pfd) == -1)
|
||||
perror("pipe error \n");
|
||||
|
||||
snprintf( full_name, sizeof(full_name), "%s/UTIL/OMV/OMV",getenv("OPENAIR2_DIR") );
|
||||
LOG_I(EMU,"Stating the OMV path %s pfd[0] %d pfd[1] %d \n", full_name, pfd[0],pfd[1]);
|
||||
|
||||
switch(fork()) {
|
||||
case -1 :
|
||||
perror("fork failed \n");
|
||||
break;
|
||||
|
||||
case 0 : // child is going to be the omv, it is the reader
|
||||
if(close(pfd[1]) == -1 ) // we close the write desc.
|
||||
perror("close on write\n" );
|
||||
|
||||
sprintf(fdstr, "%d", pfd[0] );
|
||||
sprintf(num_enb, "%d", NB_eNB_INST);
|
||||
sprintf(num_ue, "%d", NB_UE_INST);
|
||||
sprintf(x_area, "%f", oai_emulation.topology_config.area.x_m );
|
||||
sprintf(y_area, "%f", oai_emulation.topology_config.area.y_m );
|
||||
sprintf(z_area, "%f", 200.0 );
|
||||
sprintf(frames, "%d", oai_emulation.info.n_frames);
|
||||
sprintf(nb_antenna, "%d", 4);
|
||||
sprintf(frame_type, "%s", (oai_emulation.info.frame_type[0] == 0) ? "FDD" : "TDD");
|
||||
sprintf(tdd_config, "%d", oai_emulation.info.tdd_config[0]);
|
||||
// execl is used to launch the visualisor
|
||||
execl(full_name,"OMV", fdstr, frames, num_enb, num_ue, x_area, y_area, z_area, nb_antenna, frame_type, tdd_config,NULL );
|
||||
perror( "error in execl the OMV" );
|
||||
}
|
||||
|
||||
//parent
|
||||
if(close( pfd[0] ) == -1 ) // we close the write desc.
|
||||
perror("close on read\n" );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void init_seed(uint8_t set_seed)
|
||||
{
|
||||
|
||||
@@ -1020,9 +923,9 @@ void init_seed(uint8_t set_seed)
|
||||
}
|
||||
|
||||
openair0_timestamp current_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
openair0_timestamp current_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
|
||||
openair0_timestamp current_UE_rx_timestamp[MAX_MOBILES_PER_ENB][MAX_NUM_CCs];
|
||||
openair0_timestamp last_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
openair0_timestamp last_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
|
||||
openair0_timestamp last_UE_rx_timestamp[MAX_MOBILES_PER_ENB][MAX_NUM_CCs];
|
||||
|
||||
int ru_trx_start(openair0_device *device) {
|
||||
return(0);
|
||||
@@ -1087,20 +990,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 +1256,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;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1371,63 +1272,16 @@ void init_ocm(void)
|
||||
//char* frame_type = "unknown";
|
||||
LTE_DL_FRAME_PARMS *fp = &RC.ru[0]->frame_parms;
|
||||
|
||||
#if 0
|
||||
switch (fp->frame_type) {
|
||||
case FDD:
|
||||
frame_type = "FDD";
|
||||
break;
|
||||
|
||||
case TDD:
|
||||
frame_type = "TDD";
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (abstraction_flag) {
|
||||
|
||||
get_beta_map();
|
||||
get_MIESM_param();
|
||||
|
||||
//load_pbch_desc();
|
||||
}
|
||||
|
||||
|
||||
for (ru_id = 0; ru_id < RC.nb_RU; ru_id++) {
|
||||
enb_data[ru_id] = (node_desc_t *)malloc(sizeof(node_desc_t));
|
||||
init_enb(enb_data[ru_id],oai_emulation.environment_system_config.antenna.eNB_antenna);
|
||||
}
|
||||
|
||||
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
|
||||
ue_data[UE_id] = (node_desc_t *)malloc(sizeof(node_desc_t));
|
||||
init_ue(ue_data[UE_id],oai_emulation.environment_system_config.antenna.UE_antenna);
|
||||
}
|
||||
|
||||
if ((oai_emulation.info.ocm_enabled == 1)&& (ethernet_flag == 0 ) &&
|
||||
(oai_emulation.environment_system_config.fading.shadowing.decorrelation_distance_m>0) &&
|
||||
(oai_emulation.environment_system_config.fading.shadowing.variance_dB>0)) {
|
||||
|
||||
// init SF map here!!!
|
||||
map1 =(int)oai_emulation.topology_config.area.x_m;
|
||||
map2 =(int)oai_emulation.topology_config.area.y_m;
|
||||
ShaF = init_SF(map1,map2,oai_emulation.environment_system_config.fading.shadowing.decorrelation_distance_m,oai_emulation.environment_system_config.fading.shadowing.variance_dB);
|
||||
|
||||
// size of area to generate shadow fading map
|
||||
LOG_D(EMU,"Simulation area x=%f, y=%f\n",
|
||||
oai_emulation.topology_config.area.x_m,
|
||||
oai_emulation.topology_config.area.y_m);
|
||||
}
|
||||
|
||||
if (abstraction_flag == 0)
|
||||
init_channel_vars (fp, &s_re, &s_im, &r_re, &r_im, &r_re0, &r_im0);
|
||||
init_channel_vars (fp, &s_re, &s_im, &r_re, &r_im, &r_re0, &r_im0);
|
||||
|
||||
// initialize channel descriptors
|
||||
LOG_I(PHY,"Initializing channel descriptors (nb_RU %d, nb_UE %d)\n",RC.nb_RU,NB_UE_INST);
|
||||
for (ru_id = 0; ru_id < RC.nb_RU; ru_id++) {
|
||||
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
LOG_I(OCM,"Initializing channel (%s, %d) from RU %d to UE %d\n", oai_emulation.environment_system_config.fading.small_scale.selected_option,
|
||||
map_str_to_int(small_scale_names,oai_emulation.environment_system_config.fading.small_scale.selected_option), ru_id, UE_id);
|
||||
|
||||
|
||||
LOG_I(PHY,"Initializing channel descriptors (RU %d, UE %d) for N_RB_DL %d\n",ru_id,UE_id,
|
||||
RC.ru[ru_id]->frame_parms.N_RB_DL);
|
||||
RU2UE[ru_id][UE_id][CC_id] =
|
||||
new_channel_desc_scm(RC.ru[ru_id]->nb_tx,
|
||||
PHY_vars_UE_g[UE_id][CC_id]->frame_parms.nb_antennas_rx,
|
||||
@@ -1456,22 +1310,29 @@ void init_ocm(void)
|
||||
|
||||
// to make channel reciprocal uncomment following line instead of previous. However this only works for SISO at the moment. For MIMO the channel would need to be transposed.
|
||||
//UE2RU[UE_id][ru_id] = RU2UE[ru_id][UE_id];
|
||||
|
||||
AssertFatal(RU2UE[ru_id][UE_id][CC_id]!=NULL,"RU2UE[%d][%d][%d] is null\n",ru_id,UE_id,CC_id);
|
||||
AssertFatal(UE2RU[UE_id][ru_id][CC_id]!=NULL,"UE2RU[%d][%d][%d] is null\n",UE_id,ru_id,CC_id);
|
||||
//pathloss: -132.24 dBm/15kHz RE + target SNR - eNB TX power per RE
|
||||
if (ru_id == (UE_id % RC.nb_RU)) {
|
||||
RU2UE[ru_id][UE_id][CC_id]->path_loss_dB = -132.24 + snr_dB - RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
UE2RU[UE_id][ru_id][CC_id]->path_loss_dB = -132.24 + snr_dB - RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
} else {
|
||||
RU2UE[ru_id][UE_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
UE2RU[UE_id][ru_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
}
|
||||
|
||||
LOG_D(OCM,"Path loss from eNB %d to UE %d (CCid %d)=> %f dB (eNB TX %d, SNR %f)\n",ru_id,UE_id,CC_id,
|
||||
RU2UE[ru_id][UE_id][CC_id]->path_loss_dB,
|
||||
RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower,snr_dB);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void init_otg_pdcp_buffer(void)
|
||||
{
|
||||
module_id_t i;
|
||||
otg_pdcp_buffer = malloc((NB_UE_INST + NB_eNB_INST) * sizeof(Packet_OTG_List_t));
|
||||
|
||||
for (i = 0; i < NB_UE_INST + NB_eNB_INST; i++) {
|
||||
pkt_list_init(&(otg_pdcp_buffer[i]));
|
||||
//LOG_I(EMU,"HEAD of otg_pdcp_buffer[%d] is %p\n", i, pkt_list_get_head(&(otg_pdcp_buffer[i])));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
void update_omg (frame_t frameP)
|
||||
{
|
||||
module_id_t UE_id, eNB_id;
|
||||
@@ -1517,7 +1378,7 @@ void update_ocm()
|
||||
|
||||
|
||||
|
||||
/* check if the openair channel model is activated used for PHY abstraction : path loss*/
|
||||
// check if the openair channel model is activated used for PHY abstraction : path loss
|
||||
if ((oai_emulation.info.ocm_enabled == 1)&& (ethernet_flag == 0 )) {
|
||||
|
||||
for (ru_id = 0; ru_id < RC.nb_RU; ru_id++)
|
||||
@@ -1529,15 +1390,12 @@ 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);
|
||||
*/
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
for (ru_id = 0; ru_id < RC.nb_RU; ru_id++) {
|
||||
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
|
||||
@@ -1552,10 +1410,10 @@ void update_ocm()
|
||||
//dx = enb_data[ru_id]->x - ue_data[UE_id]->x;
|
||||
//dy = enb_data[ru_id]->y - ue_data[UE_id]->y;
|
||||
//distance = sqrt(dx * dx + dy * dy);
|
||||
/*LOG_D(LOCALIZE, " OCM distance between eNB %d at (%f,%f) and UE %d at (%f,%f) is %f \n",
|
||||
ru_id, enb_data[ru_id]->x,enb_data[ru_id]->y,
|
||||
UE_id, ue_data[UE_id]->x,ue_data[UE_id]->y,
|
||||
distance);*/
|
||||
///LOG_D(LOCALIZE, " OCM distance between eNB %d at (%f,%f) and UE %d at (%f,%f) is %f \n",
|
||||
// ru_id, enb_data[ru_id]->x,enb_data[ru_id]->y,
|
||||
// UE_id, ue_data[UE_id]->x,ue_data[UE_id]->y,
|
||||
// distance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1587,6 +1445,7 @@ void update_ocm()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef OPENAIR2
|
||||
void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
|
||||
{
|
||||
@@ -1594,13 +1453,12 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
|
||||
#if defined(USER_MODE) && defined(OAI_EMU)
|
||||
|
||||
//int rrc_state=0;
|
||||
/*
|
||||
if (oai_emulation.info.otg_enabled ==1 ) {
|
||||
|
||||
int dst_id, app_id;
|
||||
Packet_otg_elt_t *otg_pkt;
|
||||
|
||||
for (dst_id = 0; dst_id < NUMBER_OF_UE_MAX; dst_id++) {
|
||||
for (dst_id = 0; dst_id < MAX_MOBILES_PER_ENB; dst_id++) {
|
||||
for_times += 1;
|
||||
|
||||
// generate traffic if the ue is rrc reconfigured state
|
||||
@@ -1665,9 +1523,9 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
|
||||
otg_pkt=NULL;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// old version
|
||||
/* // MBSM multicast traffic
|
||||
// MBSM multicast traffic
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
if (frame >= 46) {// only generate when UE can receive MTCH (need to control this value)
|
||||
for (service_id = 0; service_id < 2 ; service_id++) { //maxServiceCount
|
||||
@@ -1690,15 +1548,15 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
|
||||
}
|
||||
} // end multicast traffic
|
||||
#endif
|
||||
*/
|
||||
/*
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // end multicast traffic
|
||||
*/
|
||||
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -1708,7 +1566,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
|
||||
if (otg_enabled==1) {
|
||||
ctime = frame * 100;
|
||||
|
||||
for (dst_id = 0; dst_id < NUMBER_OF_UE_MAX; dst_id++) {
|
||||
for (dst_id = 0; dst_id < MAX_MOBILES_PER_ENB; dst_id++) {
|
||||
if (mac_get_rrc_status(eNB_index, eNB_flag, dst_id ) > 2) {
|
||||
otg_pkt = malloc (sizeof(Packet_otg_elt_t));
|
||||
(otg_pkt->otg_pkt).sdu_buffer = packet_gen(module_instP, dst_id, ctime, &pkt_size);
|
||||
@@ -1737,6 +1595,7 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
|
||||
int init_slot_isr(void)
|
||||
{
|
||||
|
||||
@@ -27,27 +27,26 @@
|
||||
#include <time.h>
|
||||
#include <cblas.h>
|
||||
|
||||
#include "SIMULATION/TOOLS/defs.h"
|
||||
#include "SIMULATION/RF/defs.h"
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include "SIMULATION/RF/rf.h"
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "oaisim_config.h"
|
||||
|
||||
#ifdef OPENAIR2
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "UTIL/LOG/log_if.h"
|
||||
#include "UTIL/LOG/log_extern.h"
|
||||
#include "RRC/LITE/extern.h"
|
||||
#include "PHY_INTERFACE/extern.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface_extern.h"
|
||||
#include "UTIL/OCG/OCG.h"
|
||||
#include "UTIL/OMG/omg.h"
|
||||
#include "UTIL/OPT/opt.h" // to test OPT
|
||||
#endif
|
||||
|
||||
#include "SCHED/defs.h"
|
||||
#include "SCHED/extern.h"
|
||||
|
||||
#include "oaisim.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user