Merge branch 'eurecom-nfapi-nr-arch-mod' into episys/merge_nsa_w_develop
This commit is contained in:
@@ -6,10 +6,8 @@ eNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
eNB_ID = 0xe00;
|
||||
|
||||
eNB_ID = 0xe01;
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
@@ -128,24 +126,25 @@ eNBs =
|
||||
rxPool_commTxResourceUC-ReqAllowed = "TRUE";
|
||||
*/
|
||||
// Parameters for SIB19
|
||||
discRxPool_cp_Len = "normal"
|
||||
discRxPool_discPeriod = "rf32"
|
||||
discRxPool_numRetx = 1;
|
||||
discRxPool_numRepetition = 2;
|
||||
discRxPool_ResourceConfig_prb_Num = 5;
|
||||
discRxPool_ResourceConfig_prb_Start = 3;
|
||||
discRxPool_ResourceConfig_prb_End = 21;
|
||||
discRxPool_ResourceConfig_offsetIndicator_present = "prSmall";
|
||||
discRxPool_ResourceConfig_offsetIndicator_choice = 0;
|
||||
discRxPool_ResourceConfig_subframeBitmap_present = "prBs40";
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff";
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_size= 5;
|
||||
discRxPool_cp_Len = "normal"
|
||||
discRxPool_discPeriod = "rf32"
|
||||
discRxPool_numRetx = 1;
|
||||
discRxPool_numRepetition = 2;
|
||||
discRxPool_ResourceConfig_prb_Num = 5;
|
||||
discRxPool_ResourceConfig_prb_Start = 3;
|
||||
discRxPool_ResourceConfig_prb_End = 21;
|
||||
discRxPool_ResourceConfig_offsetIndicator_present = "prSmall";
|
||||
discRxPool_ResourceConfig_offsetIndicator_choice = 0;
|
||||
discRxPool_ResourceConfig_subframeBitmap_present = "prBs40";
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff";
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
|
||||
|
||||
//SSB central frequency of NR secondary cell group (for ENDC NSA)
|
||||
nr_scg_ssb_freq = 641272;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
srb1_parameters :
|
||||
{
|
||||
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
|
||||
@@ -175,6 +174,7 @@ eNBs =
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
enable_measurement_reports = "no";
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
@@ -185,10 +185,8 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
enable_measurement_reports = "no";
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
|
||||
@@ -5,110 +5,106 @@ Asn1_verbosity = "none";
|
||||
eNBs =
|
||||
(
|
||||
{
|
||||
# real_time choice in {hard, rt-preempt, no}
|
||||
real_time = "no";
|
||||
////////// Identification parameters:
|
||||
eNB_ID = 0xe01;
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
plmn_list = (
|
||||
{ mcc = 222; mnc = 01; mnc_length = 2; }
|
||||
);
|
||||
tracking_area_code = 1;
|
||||
plmn_list = ( { mcc = 222; mnc = 01; mnc_length = 2; } );
|
||||
|
||||
tr_s_preference = "local_mac"
|
||||
|
||||
// In seconds
|
||||
rrc_inactivity_threshold = 0;
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
node_function = "eNodeB_3GPP";
|
||||
node_timing = "synch_to_ext_device";
|
||||
node_synch_ref = 0;
|
||||
nb_antenna_ports = 1;
|
||||
ue_TransmissionMode = 1;
|
||||
frame_type = "FDD";
|
||||
tdd_config = 3;
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2680000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 25;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
prach_root = 0;
|
||||
tx_gain = 90;
|
||||
rx_gain = 115;
|
||||
pbch_repetition = "FALSE";
|
||||
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
prach_zero_correlation = 1;
|
||||
prach_freq_offset = 2;
|
||||
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -29;
|
||||
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";
|
||||
node_function = "3GPP_eNODEB";
|
||||
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 = 2680000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
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 = 90;
|
||||
rx_gain = 115;
|
||||
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 = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower= -29;
|
||||
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 =;
|
||||
srs_BandwidthConfig =;
|
||||
srs_SubframeConfig =;
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;
|
||||
*/
|
||||
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -96;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
pucch_deltaF_Format2 = "deltaF0";
|
||||
pucch_deltaF_Format2a = "deltaF0";
|
||||
pucch_deltaF_Format2b = "deltaF0";
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -96;
|
||||
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_numberOfRA_Preambles = 64;
|
||||
rach_preamblesGroupAConfig = "DISABLE";
|
||||
/*
|
||||
rach_sizeOfRA_PreamblesGroupA = ;
|
||||
rach_messageSizeGroupA = ;
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
|
||||
//Parameters for SIB18
|
||||
rxPool_sc_CP_Len = "normal";
|
||||
@@ -120,25 +116,25 @@ eNBs =
|
||||
rxPool_ResourceConfig_offsetIndicator_present = "prSmall";
|
||||
rxPool_ResourceConfig_offsetIndicator_choice = 0;
|
||||
rxPool_ResourceConfig_subframeBitmap_present = "prBs40";
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000";
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000";
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
|
||||
/*
|
||||
rxPool_dataHoppingConfig_hoppingParameter = 0;
|
||||
rxPool_dataHoppingConfig_numSubbands = "ns1";
|
||||
rxPool_dataHoppingConfig_rbOffset = 0;
|
||||
rxPool_commTxResourceUC-ReqAllowed = "TRUE";
|
||||
rxPool_dataHoppingConfig_hoppingParameter = 0;
|
||||
rxPool_dataHoppingConfig_numSubbands = "ns1";
|
||||
rxPool_dataHoppingConfig_rbOffset = 0;
|
||||
rxPool_commTxResourceUC-ReqAllowed = "TRUE";
|
||||
*/
|
||||
// Parameters for SIB19
|
||||
discRxPool_cp_Len = "normal"
|
||||
discRxPool_discPeriod = "rf32"
|
||||
discRxPool_numRetx = 1;
|
||||
discRxPool_numRetx = 1;
|
||||
discRxPool_numRepetition = 2;
|
||||
discRxPool_ResourceConfig_prb_Num = 5;
|
||||
discRxPool_ResourceConfig_prb_Num = 5;
|
||||
discRxPool_ResourceConfig_prb_Start = 3;
|
||||
discRxPool_ResourceConfig_prb_End = 21;
|
||||
discRxPool_ResourceConfig_offsetIndicator_present = "prSmall";
|
||||
discRxPool_ResourceConfig_offsetIndicator_choice = 0;
|
||||
discRxPool_ResourceConfig_offsetIndicator_choice = 0;
|
||||
discRxPool_ResourceConfig_subframeBitmap_present = "prBs40";
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff";
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
|
||||
@@ -190,7 +186,7 @@ eNBs =
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "yes";
|
||||
enable_x2 = "yes";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
@@ -198,39 +194,19 @@ eNBs =
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth1";
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR";
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth1";
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
|
||||
ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR";
|
||||
ENB_PORT_FOR_X2C = 36422; # Spec 36422
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="high";
|
||||
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 ="debug";
|
||||
rlc_log_verbosity ="high";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="high";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
MACRLCs =
|
||||
(
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
@@ -238,37 +214,52 @@ MACRLCs = (
|
||||
phy_test_mode = 0;
|
||||
puSch10xSnr = 160;
|
||||
puCch10xSnr = 160;
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
L1s = (
|
||||
L1s =
|
||||
(
|
||||
{
|
||||
num_cc = 1;
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 1
|
||||
nb_rx = 1
|
||||
att_tx = 3
|
||||
att_rx = 0;
|
||||
bands = [7];
|
||||
RUs =
|
||||
(
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 1
|
||||
nb_rx = 1
|
||||
att_tx = 3
|
||||
att_rx = 0;
|
||||
bands = [7];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 115;
|
||||
eNB_instances = [0];
|
||||
# clock_src = "external";
|
||||
eNB_instances = [0];
|
||||
# clock_src = "external";
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
THREAD_STRUCT =
|
||||
(
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_CONTROLLER :
|
||||
{
|
||||
FLEXRAN_ENABLED = "no";
|
||||
FLEXRAN_INTERFACE_NAME = "eth0";
|
||||
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
|
||||
FLEXRAN_PORT = 2210;
|
||||
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
|
||||
FLEXRAN_AWAIT_RECONF = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
@@ -286,4 +277,5 @@ log_config :
|
||||
pdcp_log_verbosity ="high";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ gNBs =
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_ID = 0xe00;
|
||||
|
||||
cell_type = "CELL_MACRO_GNB";
|
||||
gNB_name = "gNB-Eurecom-5GNRBox";
|
||||
|
||||
@@ -185,102 +184,101 @@ gNBs =
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
# mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
# ipv6 = "192:168:30::17";
|
||||
# port = 36412 ;
|
||||
# active = "yes";
|
||||
# preference = "ipv4";
|
||||
# }
|
||||
# );
|
||||
|
||||
///X2
|
||||
enable_x2 = "yes";
|
||||
enable_x2 = "yes";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
target_enb_x2_ip_address = (
|
||||
{ ipv4 = "CI_FR1_CTL_ENB_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
target_enb_x2_ip_address = ( { ipv4 = "CI_FR1_CTL_ENB_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
GNB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
GNB_IPV4_ADDRESS_FOR_S1_MME = "CI_GNB_IP_ADDR";
|
||||
GNB_INTERFACE_NAME_FOR_S1U = "eth0";
|
||||
GNB_IPV4_ADDRESS_FOR_S1U = "CI_GNB_IP_ADDR";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
GNB_IPV4_ADDRESS_FOR_X2C = "CI_GNB_IP_ADDR";
|
||||
GNB_PORT_FOR_X2C = 36422; # Spec 36422
|
||||
GNB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
GNB_IPV4_ADDRESS_FOR_S1_MME = "CI_GNB_IP_ADDR";
|
||||
GNB_INTERFACE_NAME_FOR_S1U = "eth0";
|
||||
GNB_IPV4_ADDRESS_FOR_S1U = "CI_GNB_IP_ADDR";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
GNB_IPV4_ADDRESS_FOR_X2C = "CI_GNB_IP_ADDR";
|
||||
GNB_PORT_FOR_X2C = 36422; # Spec 36422
|
||||
};
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
pusch_TargetSNRx10 = 200;
|
||||
pucch_TargetSNRx10 = 200;
|
||||
}
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
pusch_TargetSNRx10 = 200;
|
||||
pucch_TargetSNRx10 = 200;
|
||||
}
|
||||
);
|
||||
|
||||
L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
pusch_proc_threads = 6;
|
||||
}
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
pusch_proc_threads = 6;
|
||||
}
|
||||
);
|
||||
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 1
|
||||
nb_rx = 1
|
||||
att_tx = 3
|
||||
att_rx = 0;
|
||||
bands = [7];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 111;
|
||||
eNB_instances = [0];
|
||||
# clock_src = "external";
|
||||
}
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 1
|
||||
nb_rx = 1
|
||||
att_tx = 3
|
||||
att_rx = 0;
|
||||
bands = [7];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 111;
|
||||
eNB_instances = [0];
|
||||
# clock_src = "external";
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
//parallel_config = "PARALLEL_SINGLE_THREAD";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
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 ="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";
|
||||
};
|
||||
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 ="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";
|
||||
};
|
||||
|
||||
uicc: {
|
||||
opc = "testopc";
|
||||
opc = "testopc";
|
||||
};
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
uicc0 = {
|
||||
imsi = "@FULL_IMSI@";
|
||||
key = "@FULL_KEY@";
|
||||
opc= "@OPC@";
|
||||
dnn= "@DNN@";
|
||||
nssai_sst=@NSSAI_SST@;
|
||||
nssai_sd=@NSSAI_SD@;
|
||||
}
|
||||
+4
-1
@@ -182,9 +182,12 @@ class HTMLManagement():
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' </table>\n')
|
||||
|
||||
if (ADBIPAddress != 'none'):
|
||||
if (ADBIPAddress != 'none') and (ADBIPAddress != 'modules'):
|
||||
self.htmlFile.write(' <h2><span class="glyphicon glyphicon-phone"></span> <span class="glyphicon glyphicon-menu-right"></span> ' + str(self.htmlNb_Smartphones) + ' UE(s) is(are) connected to ADB bench server</h2>\n')
|
||||
self.htmlFile.write(' <h2><span class="glyphicon glyphicon-phone"></span> <span class="glyphicon glyphicon-menu-right"></span> ' + str(self.htmlNb_CATM_Modules) + ' CAT-M UE(s) is(are) connected to bench server</h2>\n')
|
||||
elif (ADBIPAddress == 'modules'):
|
||||
self.htmlUEConnected = 1
|
||||
self.htmlFile.write(' <h2><span class="glyphicon glyphicon-phone"></span> <span class="glyphicon glyphicon-menu-right"></span> 1 commercial module is connected to CI bench</h2>\n')
|
||||
else:
|
||||
self.htmlUEConnected = 1
|
||||
self.htmlFile.write(' <h2><span class="glyphicon glyphicon-phone"></span> <span class="glyphicon glyphicon-menu-right"></span> 1 OAI UE(s) is(are) connected to CI bench</h2>\n')
|
||||
|
||||
+7
-4
@@ -573,7 +573,7 @@ elif re.match('^InitiateHtml$', mode, re.IGNORECASE):
|
||||
if foundCount != HTML.nbTestXMLfiles:
|
||||
HTML.nbTestXMLfiles=foundCount
|
||||
|
||||
if (CiTestObj.ADBIPAddress != 'none'):
|
||||
if (CiTestObj.ADBIPAddress != 'none') and (CiTestObj.ADBIPAddress != 'modules'):
|
||||
terminate_ue_flag = False
|
||||
CiTestObj.GetAllUEDevices(terminate_ue_flag)
|
||||
CiTestObj.GetAllCatMDevices(terminate_ue_flag)
|
||||
@@ -677,10 +677,12 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
|
||||
|
||||
signal.signal(signal.SIGUSR1, receive_signal)
|
||||
|
||||
if (CiTestObj.ADBIPAddress != 'none'):
|
||||
if (CiTestObj.ADBIPAddress != 'none') and (CiTestObj.ADBIPAddress != 'modules'):
|
||||
terminate_ue_flag = False
|
||||
CiTestObj.GetAllUEDevices(terminate_ue_flag)
|
||||
CiTestObj.GetAllCatMDevices(terminate_ue_flag)
|
||||
elif (CiTestObj.ADBIPAddress == 'modules'):
|
||||
CiTestObj.UEDevices.append('COTS-Module')
|
||||
else:
|
||||
CiTestObj.UEDevices.append('OAI-UE')
|
||||
HTML.SethtmlUEConnected(len(CiTestObj.UEDevices) + len(CiTestObj.CatMDevices))
|
||||
@@ -714,7 +716,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
|
||||
CiTestObj.ShowTestID()
|
||||
GetParametersFromXML(action)
|
||||
if action == 'Initialize_UE' or action == 'Attach_UE' or action == 'Detach_UE' or action == 'Ping' or action == 'Iperf' or action == 'Reboot_UE' or action == 'DataDisable_UE' or action == 'DataEnable_UE' or action == 'CheckStatusUE':
|
||||
if (CiTestObj.ADBIPAddress != 'none'):
|
||||
if (CiTestObj.ADBIPAddress != 'none') and (CiTestObj.ADBIPAddress != 'modules'):
|
||||
#in these cases, having no devices is critical, GetAllUEDevices function has to manage it as a critical error, reason why terminate_ue_flag is set to True
|
||||
terminate_ue_flag = True
|
||||
# Now we stop properly the test-suite --> clean reporting
|
||||
@@ -799,7 +801,8 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
|
||||
CiTestObj.Perform_X2_Handover(HTML,RAN,EPC)
|
||||
elif action == 'Build_PhySim':
|
||||
HTML=ldpc.Build_PhySim(HTML,CONST)
|
||||
if ldpc.exitStatus==1:sys.exit()
|
||||
if ldpc.exitStatus==1:
|
||||
RAN.prematureExit = False
|
||||
elif action == 'Run_PhySim':
|
||||
HTML=ldpc.Run_PhySim(HTML,CONST,id)
|
||||
elif action == 'Build_Image':
|
||||
|
||||
@@ -0,0 +1,501 @@
|
||||
<table style="border-collapse: collapse; border: none;">
|
||||
<tr style="border-collapse: collapse; border: none;">
|
||||
<td style="border-collapse: collapse; border: none;">
|
||||
<a href="http://www.openairinterface.org/">
|
||||
<img src="../../../doc/images/oai_final_logo.png" alt="" border=3 height=50 width=150>
|
||||
</img>
|
||||
</a>
|
||||
</td>
|
||||
<td style="border-collapse: collapse; border: none; vertical-align: center;">
|
||||
<b><font size = "5">OAI Full Stack RF simulation with containers</font></b>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
This page is only valid for an `Ubuntu18` host.
|
||||
|
||||
**TABLE OF CONTENTS**
|
||||
|
||||
1. [Retrieving the images on Docker-Hub](#1-retrieving-the-images-on-docker-hub)
|
||||
2. [Deploy containers](#2-deploy-containers)
|
||||
1. [Deploy and Configure Cassandra Database](#21-deploy-and-configure-cassandra-database)
|
||||
2. [Deploy OAI CN4G containers](#22-deploy-oai-cn4g-containers)
|
||||
3. [Deploy OAI eNB in RF simulator mode](#23-deploy-oai-enb-in-rf-simulator-mode)
|
||||
4. [Deploy OAI LTE UE in RF simulator mode](#24-deploy-oai-lte-ue-in-rf-simulator-mode)
|
||||
3. [Check traffic](#3-check-traffic)
|
||||
4. [Un-deployment](#4-un-deployment)
|
||||
5. [Explanation on the configuration](#5-explanation-on-the-configuration)
|
||||
1. [UE IMSI and Keys](#51-ue-imsi-and-keys)
|
||||
2. [PLMN and TAI](#52-plmn-and-tai)
|
||||
3. [Access to Internet](#53-access-to-internet)
|
||||
|
||||
# 1. Retrieving the images on Docker-Hub #
|
||||
|
||||
Currently the images are hosted under the user account `rdefosseoai`.
|
||||
|
||||
This may change in the future.
|
||||
|
||||
Once again you may need to log on [docker-hub](https://hub.docker.com/) if your organization has reached pulling limit as `anonymous`.
|
||||
|
||||
```bash
|
||||
$ docker login
|
||||
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
|
||||
Username:
|
||||
Password:
|
||||
```
|
||||
|
||||
Now pull images.
|
||||
|
||||
```bash
|
||||
$ docker pull cassandra:2.1
|
||||
$ docker pull rdefosseoai/oai-hss:latest
|
||||
$ docker pull rdefosseoai/oai-mme:latest
|
||||
$ docker pull rdefosseoai/oai-spgwc:latest
|
||||
$ docker pull rdefosseoai/oai-spgwu-tiny:latest
|
||||
|
||||
$ docker pull rdefosseoai/oai-enb:develop
|
||||
$ docker pull rdefosseoai/oai-lte-ue:develop
|
||||
```
|
||||
|
||||
And **re-tag** them for tutorials' docker-compose file to work.
|
||||
|
||||
```bash
|
||||
$ docker image tag rdefosseoai/oai-spgwc:latest oai-spgwc:latest
|
||||
$ docker image tag rdefosseoai/oai-hss:latest oai-hss:latest
|
||||
$ docker image tag rdefosseoai/oai-spgwu-tiny:latest oai-spgwu-tiny:latest
|
||||
$ docker image tag rdefosseoai/oai-mme:latest oai-mme:latest
|
||||
|
||||
$ docker image tag rdefosseoai/oai-enb:develop oai-enb:develop
|
||||
$ docker image tag rdefosseoai/oai-lte-ue:develop oai-lte-ue:develop
|
||||
```
|
||||
|
||||
```bash
|
||||
$ docker logout
|
||||
```
|
||||
|
||||
How to build the Traffic-Generator image is explained [here](https://github.com/OPENAIRINTERFACE/openair-epc-fed/blob/master/docs/GENERATE_TRAFFIC.md#1-build-a-traffic-generator-image).
|
||||
|
||||
# 2. Deploy containers #
|
||||
|
||||
**CAUTION: this SHALL be done in multiple steps.**
|
||||
|
||||
**Just `docker-compose up -d` WILL NOT WORK!**
|
||||
|
||||
## 2.1. Deploy and Configure Cassandra Database ##
|
||||
|
||||
It is very crutial that the Cassandra DB is fully configured before you do anything else!
|
||||
|
||||
```bash
|
||||
$ docker-compose up -d db_init
|
||||
Creating network "rfsim4g-oai-private-net" with the default driver
|
||||
Creating network "rfsim4g-oai-public-net" with the default driver
|
||||
Creating rfsim4g-cassandra ... done
|
||||
Creating rfsim4g-db-init ... done
|
||||
|
||||
$ docker logs rfsim4g-db-init --follow
|
||||
Connection error: ('Unable to connect to any servers', {'192.168.68.2': error(111, "Tried connecting to [('192.168.68.2', 9042)]. Last error: Connection refused")})
|
||||
...
|
||||
Connection error: ('Unable to connect to any servers', {'192.168.68.2': error(111, "Tried connecting to [('192.168.68.2', 9042)]. Last error: Connection refused")})
|
||||
OK
|
||||
```
|
||||
|
||||
**You SHALL wait until you HAVE the `OK` message in the logs!**
|
||||
|
||||
```bash
|
||||
$ docker rm rfsim4g-db-init
|
||||
```
|
||||
|
||||
At this point, you can prepare a capture on the newly-created public docker bridge:
|
||||
|
||||
```bash
|
||||
$ ifconfig rfsim4g-public
|
||||
inet 192.168.61.1 netmask 255.255.255.192 broadcast 192.168.61.63
|
||||
ether 02:42:8f:dd:ba:5a txqueuelen 0 (Ethernet)
|
||||
RX packets 0 bytes 0 (0.0 B)
|
||||
RX errors 0 dropped 0 overruns 0 frame 0
|
||||
TX packets 0 bytes 0 (0.0 B)
|
||||
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
||||
$ sudo tshark -i rfsim4g-public -f 'port 3868 or port 2123 or port 36412 or port 36422 or port 46520 or port 8805' -w /tmp/my-oai-control-plane.pcap
|
||||
```
|
||||
|
||||
**BE CAREFUL: please use that filter or you will also capture the data-plane with IQ samples between `eNB` and `LTE-UE`.**
|
||||
|
||||
**and your capture WILL become huge (10s of Gbytes).**
|
||||
|
||||
## 2.2. Deploy OAI CN4G containers ##
|
||||
|
||||
```bash
|
||||
$ docker-compose up -d oai_mme oai_spgwu trf_gen
|
||||
rfsim4g-cassandra is up-to-date
|
||||
Creating rfsim4g-trf-gen ... done
|
||||
Creating rfsim4g-oai-hss ... done
|
||||
Creating rfsim4g-oai-mme ... done
|
||||
Creating rfsim4g-oai-spgwc ... done
|
||||
Creating rfsim4g-oai-spgwu-tiny ... done
|
||||
```
|
||||
|
||||
You shall wait until all containers are `healthy`. About 10 seconds!
|
||||
|
||||
```bash
|
||||
$ docker-compose ps -a
|
||||
Name Command State Ports
|
||||
-------------------------------------------------------------------------------------------------------------------------
|
||||
rfsim4g-cassandra docker-entrypoint.sh cassa ... Up (healthy) 7000/tcp, 7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp
|
||||
rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp
|
||||
rfsim4g-oai-mme /openair-mme/bin/entrypoin ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp
|
||||
rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp
|
||||
rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp
|
||||
rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy)
|
||||
```
|
||||
|
||||
## 2.3. Deploy OAI eNB in RF simulator mode ##
|
||||
|
||||
```bash
|
||||
$ docker-compose up -d enb
|
||||
Creating rfsim4g-oai-enb ... done
|
||||
```
|
||||
|
||||
Again wait for the healthy state:
|
||||
|
||||
```bash
|
||||
$ docker-compose ps -a
|
||||
Name Command State Ports
|
||||
-------------------------------------------------------------------------------------------------------------------------
|
||||
rfsim4g-cassandra docker-entrypoint.sh cassa ... Up (healthy) 7000/tcp, 7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp
|
||||
rfsim4g-oai-enb /opt/oai-enb/bin/entrypoin ... Up (healthy) 2152/udp, 36412/udp, 36422/udp
|
||||
rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp
|
||||
rfsim4g-oai-mme /openair-mme/bin/entrypoin ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp
|
||||
rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp
|
||||
rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp
|
||||
rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy)
|
||||
```
|
||||
|
||||
Check if the eNB connected to MME:
|
||||
|
||||
```bash
|
||||
$ docker logs rfsim4g-oai-mme
|
||||
...
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0039 ======================================= STATISTICS ============================================
|
||||
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0042 | Current Status| Added since last display| Removed since last display |
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0048 Connected eNBs | 0 | 0 | 0 |
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0054 Attached UEs | 0 | 0 | 0 |
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0060 Connected UEs | 0 | 0 | 0 |
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0066 Default Bearers| 0 | 0 | 0 |
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0072 S1-U Bearers | 0 | 0 | 0 |
|
||||
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0075 ======================================= STATISTICS ============================================
|
||||
|
||||
DEBUG SCTP rc/sctp/sctp_primitives_server.c:0469 Client association changed: 0
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0101 ----------------------
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0102 SCTP Status:
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0103 assoc id .....: 675
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0104 state ........: 4
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0105 instrms ......: 2
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0106 outstrms .....: 2
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0108 fragmentation : 1452
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0109 pending data .: 0
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0110 unack data ...: 0
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0111 rwnd .........: 106496
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0112 peer info :
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0114 state ....: 2
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0116 cwnd .....: 4380
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0118 srtt .....: 0
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0120 rto ......: 3000
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0122 mtu ......: 1500
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0123 ----------------------
|
||||
DEBUG SCTP rc/sctp/sctp_primitives_server.c:0479 New connection
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0205 ----------------------
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0206 Local addresses:
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0217 - [192.168.61.3]
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0234 ----------------------
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0151 ----------------------
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0152 Peer addresses:
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0163 - [192.168.61.20]
|
||||
DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0178 ----------------------
|
||||
DEBUG SCTP rc/sctp/sctp_primitives_server.c:0554 SCTP RETURNING!!
|
||||
DEBUG SCTP rc/sctp/sctp_primitives_server.c:0547 [675][44] Msg of length 51 received from port 36412, on stream 0, PPID 18
|
||||
DEBUG SCTP rc/sctp/sctp_primitives_server.c:0554 SCTP RETURNING!!
|
||||
DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:2826 Create eNB context for assoc_id: 675
|
||||
DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:0361 S1-Setup-Request macroENB_ID.size 3 (should be 20)
|
||||
DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:0321 New s1 setup request incoming from macro eNB id: 00e01
|
||||
DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:0423 Adding eNB to the list of served eNBs
|
||||
DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:0438 Adding eNB id 3585 to the list of served eNBs
|
||||
DEBUG SCTP rc/sctp/sctp_primitives_server.c:0283 [44][675] Sending buffer 0x7f9394009f90 of 27 bytes on stream 0 with ppid 18
|
||||
DEBUG SCTP rc/sctp/sctp_primitives_server.c:0296 Successfully sent 27 bytes on stream 0
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0039 ======================================= STATISTICS ============================================
|
||||
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0042 | Current Status| Added since last display| Removed since last display |
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0048 Connected eNBs | 1 | 1 | 0 |
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0054 Attached UEs | 0 | 0 | 0 |
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0060 Connected UEs | 0 | 0 | 0 |
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0066 Default Bearers| 0 | 0 | 0 |
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0072 S1-U Bearers | 0 | 0 | 0 |
|
||||
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0075 ======================================= STATISTICS ============================================
|
||||
...
|
||||
```
|
||||
|
||||
## 2.4. Deploy OAI LTE UE in RF simulator mode ##
|
||||
|
||||
```bash
|
||||
$ docker-compose up -d oai_ue0
|
||||
Creating rfsim4g-oai-lte-ue0 ... done
|
||||
```
|
||||
|
||||
Again a bit of patience:
|
||||
|
||||
```bash
|
||||
$ docker-compose ps -a
|
||||
Name Command State Ports
|
||||
-------------------------------------------------------------------------------------------------------------------------
|
||||
rfsim4g-cassandra docker-entrypoint.sh cassa ... Up (healthy) 7000/tcp, 7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp
|
||||
rfsim4g-oai-enb /opt/oai-enb/bin/entrypoin ... Up (healthy) 2152/udp, 36412/udp, 36422/udp
|
||||
rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp
|
||||
rfsim4g-oai-lte-ue0 /opt/oai-lte-ue/bin/entryp ... Up (healthy) 10000/tcp
|
||||
rfsim4g-oai-mme /openair-mme/bin/entrypoin ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp
|
||||
rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp
|
||||
rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp
|
||||
rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy)
|
||||
Creating rfsim4g-oai-enb ... done
|
||||
```
|
||||
|
||||
Making sure the OAI UE is connected:
|
||||
|
||||
```bash
|
||||
$ docker logs rfsim4g-oai-enb
|
||||
...
|
||||
[RRC] RRCConnectionReconfiguration Encoded 1098 bits (138 bytes)
|
||||
[RRC] [eNB 0] Frame 0, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes 138, UE id 617b)
|
||||
[RRC] sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB
|
||||
[PDCP] [FRAME 00000][eNB][MOD 00][RNTI 617b][SRB 02] Action ADD LCID 2 (SRB id 2) configured with SN size 5 bits and RLC AM
|
||||
[PDCP] [FRAME 00000][eNB][MOD 00][RNTI 617b][DRB 01] Action ADD LCID 3 (DRB id 1) configured with SN size 12 bits and RLC AM
|
||||
[SCTP] Successfully sent 46 bytes on stream 1 for assoc_id 676
|
||||
[RRC] [FRAME 00000][eNB][MOD 00][RNTI 617b] UE State = RRC_RECONFIGURED (default DRB, xid 0)
|
||||
[PDCP] [FRAME 00000][eNB][MOD 00][RNTI 617b][SRB 02] Action MODIFY LCID 2 RB id 2 reconfigured with SN size 5 and RLC AM
|
||||
[PDCP] [FRAME 00000][eNB][MOD 00][RNTI 617b][DRB 01] Action MODIFY LCID 3 RB id 1 reconfigured with SN size 1 and RLC AM
|
||||
[RRC] [eNB 0] Frame 0 CC 0 : SRB2 is now active
|
||||
[RRC] [eNB 0] Frame 0 : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete from UE rnti 617b, reconfiguring DRB 1/LCID 3
|
||||
[RRC] [eNB 0] Frame 0 : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete, reconfiguring DRB 1/LCID 3
|
||||
[MAC] UE 0 RNTI 617b adding LC 3 idx 2 to scheduling control (total 3)
|
||||
[MAC] Added physicalConfigDedicated 0x7f98e0004950 for 0.0
|
||||
[S1AP] initial_ctxt_resp_p: e_rab ID 5, enb_addr 192.168.61.20, SIZE 4
|
||||
[SCTP] Successfully sent 40 bytes on stream 1 for assoc_id 676
|
||||
[SCTP] Successfully sent 61 bytes on stream 1 for assoc_id 676
|
||||
...
|
||||
```
|
||||
|
||||
On the MME:
|
||||
|
||||
```bash
|
||||
$ docker logs rfsim4g-oai-mme
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0039 ======================================= STATISTICS ============================================
|
||||
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0042 | Current Status| Added since last display| Removed since last display |
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0048 Connected eNBs | 1 | 0 | 0 |
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0054 Attached UEs | 1 | 0 | 0 |
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0060 Connected UEs | 1 | 0 | 0 |
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0066 Default Bearers| 0 | 0 | 0 |
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0072 S1-U Bearers | 0 | 0 | 0 |
|
||||
|
||||
DEBUG MME-AP src/mme_app/mme_app_statistics.c:0075 ======================================= STATISTICS ============================================
|
||||
```
|
||||
|
||||
On the LTE UE:
|
||||
|
||||
```bash
|
||||
$ docker exec rfsim4g-oai-lte-ue0 /bin/bash -c "ifconfig"
|
||||
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
|
||||
inet 192.168.61.30 netmask 255.255.255.192 broadcast 192.168.61.63
|
||||
ether 02:42:c0:a8:3d:1e txqueuelen 0 (Ethernet)
|
||||
RX packets 1109931 bytes 8078031934 (8.0 GB)
|
||||
RX errors 0 dropped 0 overruns 0 frame 0
|
||||
TX packets 1232068 bytes 7798928848 (7.7 GB)
|
||||
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
||||
|
||||
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
|
||||
inet 127.0.0.1 netmask 255.0.0.0
|
||||
loop txqueuelen 1000 (Local Loopback)
|
||||
RX packets 0 bytes 0 (0.0 B)
|
||||
RX errors 0 dropped 0 overruns 0 frame 0
|
||||
TX packets 0 bytes 0 (0.0 B)
|
||||
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
||||
|
||||
oaitun_ue1: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
|
||||
inet 12.0.0.2 netmask 255.0.0.0 destination 12.0.0.2
|
||||
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)
|
||||
RX packets 0 bytes 0 (0.0 B)
|
||||
RX errors 0 dropped 0 overruns 0 frame 0
|
||||
TX packets 0 bytes 0 (0.0 B)
|
||||
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
||||
|
||||
oaitun_uem1: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
|
||||
inet 10.0.2.2 netmask 255.255.255.0 destination 10.0.2.2
|
||||
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)
|
||||
RX packets 0 bytes 0 (0.0 B)
|
||||
RX errors 0 dropped 0 overruns 0 frame 0
|
||||
TX packets 0 bytes 0 (0.0 B)
|
||||
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
||||
```
|
||||
|
||||
The tunnel `oaitun_ue1` SHALL be mounted and with an IP address in the `12.0.0.xxx` range.
|
||||
|
||||
# 3. Check traffic #
|
||||
|
||||
```bash
|
||||
$ docker exec rfsim4g-oai-lte-ue0 /bin/bash -c "ping -c 2 www.lemonde.fr"
|
||||
PING s2.shared.global.fastly.net (151.101.122.217) 56(84) bytes of data.
|
||||
64 bytes from 151.101.122.217 (151.101.122.217): icmp_seq=1 ttl=54 time=12.9 ms
|
||||
64 bytes from 151.101.122.217 (151.101.122.217): icmp_seq=2 ttl=54 time=12.9 ms
|
||||
|
||||
--- s2.shared.global.fastly.net ping statistics ---
|
||||
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
|
||||
rtt min/avg/max/mdev = 12.940/12.965/12.990/0.025 ms
|
||||
|
||||
$ docker exec rfsim4g-oai-lte-ue0 /bin/bash -c "ping -I oaitun_ue1 -c 2 www.lemonde.fr"
|
||||
PING s2.shared.global.fastly.net (151.101.122.217) from 12.0.0.2 oaitun_ue1: 56(84) bytes of data.
|
||||
64 bytes from 151.101.122.217 (151.101.122.217): icmp_seq=1 ttl=53 time=23.6 ms
|
||||
64 bytes from 151.101.122.217 (151.101.122.217): icmp_seq=2 ttl=53 time=29.5 ms
|
||||
|
||||
--- s2.shared.global.fastly.net ping statistics ---
|
||||
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
|
||||
rtt min/avg/max/mdev = 23.659/26.626/29.593/2.967 ms
|
||||
```
|
||||
|
||||
The 1st ping command is NOT using the OAI stack. My network infrastructure has a response of `13 ms` to reach this website.
|
||||
|
||||
The 2nd ping command is using the OAI stack. So the stack takes `26.6 - 12.9 = 13.7 ms`.
|
||||
|
||||
# 4. Un-deployment #
|
||||
|
||||
```bash
|
||||
$ docker-compose down
|
||||
Stopping rfsim4g-oai-lte-ue0 ... done
|
||||
Stopping rfsim4g-oai-enb ... done
|
||||
Stopping rfsim4g-oai-spgwu-tiny ... done
|
||||
Stopping rfsim4g-oai-spgwc ... done
|
||||
Stopping rfsim4g-oai-mme ... done
|
||||
Stopping rfsim4g-oai-hss ... done
|
||||
Stopping rfsim4g-trf-gen ... done
|
||||
Stopping rfsim4g-cassandra ... done
|
||||
Removing rfsim4g-oai-lte-ue0 ... done
|
||||
Removing rfsim4g-oai-enb ... done
|
||||
Removing rfsim4g-oai-spgwu-tiny ... done
|
||||
Removing rfsim4g-oai-spgwc ... done
|
||||
Removing rfsim4g-oai-mme ... done
|
||||
Removing rfsim4g-oai-hss ... done
|
||||
Removing rfsim4g-trf-gen ... done
|
||||
Removing rfsim4g-cassandra ... done
|
||||
Removing network rfsim4g-oai-private-net
|
||||
Removing network rfsim4g-oai-public-net
|
||||
```
|
||||
|
||||
# 5. Explanation on the configuration #
|
||||
|
||||
With a single `docker-compose.yml` file, it is easier to explain how I made the full connection.
|
||||
|
||||
Try to modify as little as possible. And if you don't understand a field/value, you'd better NOT modify it.
|
||||
|
||||
## 5.1. UE IMSI and Keys ##
|
||||
|
||||
in HSS config:
|
||||
|
||||
```yaml
|
||||
OP_KEY: 1006020f0a478bf6b699f15c062e42b3
|
||||
LTE_K: fec86ba6eb707ed08905757b1bb44b8f
|
||||
APN1: oai.ipv4
|
||||
APN2: internet
|
||||
FIRST_IMSI: 208960100000001
|
||||
NB_USERS: 10
|
||||
```
|
||||
|
||||
in UE config:
|
||||
|
||||
```yaml
|
||||
MCC: '208'
|
||||
MNC: '96'
|
||||
SHORT_IMSI: '0100000001'
|
||||
LTE_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'
|
||||
OPC: 'c42449363bbad02b66d16bc975d77cc1'
|
||||
MSISDN: '001011234561010'
|
||||
HPLMN: 20896
|
||||
```
|
||||
|
||||
As you can see: `LTE_K` and `LTE_KEY` are the same value. And `OP_KEY` and `OPC` can be deduced from each other. Look in HSS logs.
|
||||
|
||||
```bash
|
||||
$ docker logs rfsim4g-oai-hss
|
||||
...
|
||||
Compute opc:
|
||||
K: FEC86BA6EB707ED08905757B1BB44B8F <== `LTE_K`
|
||||
In: 1006020F0A478BF6B699F15C062E42B3 <== `OP_KEY`
|
||||
Rinj: D4224B3931FD5BDDD0489A9573F93E72
|
||||
Out: C42449363BBAD02B66D16BC975D77CC1 <== `OPC`
|
||||
...
|
||||
```
|
||||
|
||||
In HSS, I've provisioned 10 users starting at `208960100000001` (`FIRST_IMSI` and `NB_USERS`).
|
||||
|
||||
My 1st UE IMSI is an aggregation of `MCC`, `MNC`, `SHORT_IMSI`.
|
||||
|
||||
## 5.2. PLMN and TAI ##
|
||||
|
||||
in MME config:
|
||||
|
||||
```yaml
|
||||
REALM: openairinterface.org
|
||||
..
|
||||
MCC: '208'
|
||||
MNC: '96'
|
||||
MME_GID: 32768
|
||||
MME_CODE: 3
|
||||
TAC_0: 1
|
||||
TAC_1: 2
|
||||
TAC_2: 3
|
||||
MME_FQDN: mme.openairinterface.org
|
||||
```
|
||||
|
||||
in SPGW-C/-U configs:
|
||||
|
||||
```yaml
|
||||
MCC: '208'
|
||||
MNC: '96'
|
||||
MNC03: '096'
|
||||
TAC: 1
|
||||
GW_ID: 1
|
||||
REALM: openairinterface.org
|
||||
```
|
||||
|
||||
in eNB config:
|
||||
|
||||
```yaml
|
||||
MCC: '208'
|
||||
MNC: '96'
|
||||
MNC_LENGTH: 2
|
||||
TAC: 1
|
||||
```
|
||||
|
||||
The values SHALL match, and `TAC` shall match `TAC_0` from MME.
|
||||
|
||||
## 5.3. Access to Internet ##
|
||||
|
||||
In my traffic test, I was able to ping outside of my local network.
|
||||
|
||||
in SPGW-C config:
|
||||
|
||||
```yaml
|
||||
DEFAULT_DNS_IPV4_ADDRESS: 192.168.18.129
|
||||
DEFAULT_DNS_SEC_IPV4_ADDRESS: 8.8.4.4
|
||||
PUSH_PROTOCOL_OPTION: 'true'
|
||||
```
|
||||
|
||||
in SPGW-U config:
|
||||
|
||||
```yaml
|
||||
NETWORK_UE_NAT_OPTION: 'yes'
|
||||
```
|
||||
|
||||
Please put your own DNS server IP adress.
|
||||
|
||||
And you may have to play with `PUSH_PROTOCOL_OPTION` and `NETWORK_UE_NAT_OPTION` depending on your network.
|
||||
|
||||
@@ -32,7 +32,7 @@ services:
|
||||
entrypoint: /bin/bash -c "cqlsh --file /home/oai_db.cql 192.168.68.2 && echo 'OK'"
|
||||
|
||||
oai_hss:
|
||||
image: oai-hss:develop-2021-06-14
|
||||
image: oai-hss:latest
|
||||
container_name: rfsim4g-oai-hss
|
||||
privileged: true
|
||||
depends_on: [cassandra]
|
||||
@@ -59,7 +59,7 @@ services:
|
||||
retries: 5
|
||||
|
||||
oai_mme:
|
||||
image: oai-mme:production
|
||||
image: oai-mme:latest
|
||||
container_name: rfsim4g-oai-mme
|
||||
privileged: true
|
||||
depends_on: [oai_hss]
|
||||
@@ -116,7 +116,7 @@ services:
|
||||
retries: 5
|
||||
|
||||
oai_spgwc:
|
||||
image: oai-spgwc:develop-2021-06-14
|
||||
image: oai-spgwc:latest
|
||||
privileged: true
|
||||
depends_on: [oai_mme]
|
||||
container_name: rfsim4g-oai-spgwc
|
||||
@@ -148,7 +148,7 @@ services:
|
||||
retries: 5
|
||||
|
||||
oai_spgwu:
|
||||
image: oai-spgwu-tiny:develop-2021-06-14
|
||||
image: oai-spgwu-tiny:latest
|
||||
privileged: true
|
||||
container_name: rfsim4g-oai-spgwu-tiny
|
||||
depends_on: [oai_spgwc]
|
||||
@@ -177,19 +177,6 @@ services:
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
flexran_rtc:
|
||||
image: flexran-rtc:production
|
||||
privileged: true
|
||||
container_name: rfsim4g-flexran-rtc
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.61.10
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep rt_controller"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
trf_gen:
|
||||
image: trf-gen:production
|
||||
privileged: true
|
||||
@@ -235,6 +222,11 @@ services:
|
||||
FLEXRAN_INTERFACE_NAME: eth0
|
||||
FLEXRAN_IPV4_ADDRESS: 192.168.61.10
|
||||
USE_ADDITIONAL_OPTIONS: --rfsim
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep lte-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
oai_ue0:
|
||||
image: oai-lte-ue:develop
|
||||
@@ -257,6 +249,11 @@ services:
|
||||
MSISDN: '001011234561010'
|
||||
HPLMN: 20896
|
||||
USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep lte-uesoftmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
networks:
|
||||
private_net:
|
||||
@@ -264,9 +261,12 @@ networks:
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 192.168.68.0/26
|
||||
driver_opts:
|
||||
com.docker.network.bridge.name: "rfsim4g-private"
|
||||
public_net:
|
||||
name: rfsim4g-oai-public-net
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 192.168.61.0/26
|
||||
|
||||
driver_opts:
|
||||
com.docker.network.bridge.name: "rfsim4g-public"
|
||||
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
STATUS=0
|
||||
AMF_PORT_FOR_NGAP=38412
|
||||
AMF_PORT_FOR_N11_HTTP=80
|
||||
AMF_IP_NGAP_INTERFACE=$(ifconfig $AMF_INTERFACE_NAME_FOR_NGAP | grep inet | awk {'print $2'})
|
||||
AMF_IP_N11_INTERFACE=$(ifconfig $AMF_INTERFACE_NAME_FOR_N11 | grep inet | awk {'print $2'})
|
||||
N2_PORT_STATUS=$(netstat -Snpl | grep -o "$AMF_IP_NGAP_INTERFACE:$AMF_PORT_FOR_NGAP")
|
||||
N11_PORT_STATUS=$(netstat -tnpl | grep -o "$AMF_IP_N11_INTERFACE:$AMF_PORT_FOR_N11_HTTP")
|
||||
#Check if entrypoint properly configured the conf file and no parameter is unset (optional)
|
||||
NB_UNREPLACED_AT=`cat /openair-amf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
|
||||
|
||||
if [ $NB_UNREPLACED_AT -ne 0 ]; then
|
||||
STATUS=1
|
||||
echo "Healthcheck error: configuration file is not configured properly"
|
||||
fi
|
||||
|
||||
if [[ -z $N2_PORT_STATUS ]]; then
|
||||
STATUS=1
|
||||
echo "Healthcheck error: N2 SCTP port $AMF_PORT_FOR_NGAP is not listening"
|
||||
fi
|
||||
|
||||
if [[ -z $N11_PORT_STATUS ]]; then
|
||||
STATUS=1
|
||||
echo "Healthcheck error: N11/SBI TCP/HTTP port $AMF_PORT_FOR_N11_HTTP is not listening"
|
||||
fi
|
||||
|
||||
#host="${MYSQL_SERVER}"
|
||||
#user="${MYSQL_USER:-root}"
|
||||
#export MYSQL_PWD="${MYSQL_PASS}"
|
||||
|
||||
#args=(
|
||||
# -h"$host"
|
||||
# -u"$user"
|
||||
# --silent
|
||||
#)
|
||||
|
||||
#if ! command -v mysql &> /dev/null; then
|
||||
# echo "Installing mysql command"
|
||||
# apt update
|
||||
# apt-get -y install mysql-client
|
||||
#else
|
||||
# if select="$(echo 'SELECT 1' | mysql "${args[@]}")" && [ "$select" = '1' ]; then
|
||||
# database_check=$(mysql -h$host -u$user -D oai_db --silent -e "SELECT * FROM users;")
|
||||
# if [[ -z $database_check ]]; then
|
||||
# echo "Healthcheck error: oai_db not populated"
|
||||
# STATUS=1
|
||||
# fi
|
||||
# STATUS=0
|
||||
# else
|
||||
# echo "Healthcheck error: Mysql port inactive"
|
||||
# STATUS=1
|
||||
# fi
|
||||
#fi
|
||||
|
||||
exit $STATUS
|
||||
@@ -0,0 +1,293 @@
|
||||
version: '3.8'
|
||||
services:
|
||||
oai-nrf:
|
||||
container_name: "rfsim5g-oai-nrf"
|
||||
image: oai-nrf:latest
|
||||
environment:
|
||||
- NRF_INTERFACE_NAME_FOR_SBI=eth0
|
||||
- NRF_INTERFACE_PORT_FOR_SBI=80
|
||||
- NRF_INTERFACE_HTTP2_PORT_FOR_SBI=9090
|
||||
- NRF_API_VERSION=v1
|
||||
- INSTANCE=0
|
||||
- PID_DIRECTORY=/var/run
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.130
|
||||
volumes:
|
||||
- ./nrf-healthcheck.sh:/openair-nrf/bin/nrf-healthcheck.sh
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/openair-nrf/bin/nrf-healthcheck.sh"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:5.7
|
||||
volumes:
|
||||
- ./oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
|
||||
- ./mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- MYSQL_DATABASE=oai_db
|
||||
- MYSQL_USER=test
|
||||
- MYSQL_PASSWORD=test
|
||||
- MYSQL_ROOT_PASSWORD=linux
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.131
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oai-amf:latest
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
- INSTANCE=0
|
||||
- PID_DIRECTORY=/var/run
|
||||
- MCC=208
|
||||
- MNC=99
|
||||
- REGION_ID=128
|
||||
- AMF_SET_ID=1
|
||||
- SERVED_GUAMI_MCC_0=208
|
||||
- SERVED_GUAMI_MNC_0=99
|
||||
- SERVED_GUAMI_REGION_ID_0=128
|
||||
- SERVED_GUAMI_AMF_SET_ID_0=1
|
||||
- SERVED_GUAMI_MCC_1=460
|
||||
- SERVED_GUAMI_MNC_1=11
|
||||
- SERVED_GUAMI_REGION_ID_1=10
|
||||
- SERVED_GUAMI_AMF_SET_ID_1=1
|
||||
- PLMN_SUPPORT_MCC=208
|
||||
- PLMN_SUPPORT_MNC=99
|
||||
- PLMN_SUPPORT_TAC=0x0001
|
||||
- SST_0=1
|
||||
- SD_0=1
|
||||
- SST_1=1
|
||||
- SD_1=12
|
||||
- AMF_INTERFACE_NAME_FOR_NGAP=eth0
|
||||
- AMF_INTERFACE_NAME_FOR_N11=eth0
|
||||
- SMF_INSTANCE_ID_0=1
|
||||
- SMF_FQDN_0=oai-smf
|
||||
- SMF_IPV4_ADDR_0=0.0.0.0
|
||||
- SMF_HTTP_VERSION_0=v1
|
||||
- SELECTED_0=true
|
||||
- SMF_INSTANCE_ID_1=2
|
||||
- SMF_FQDN_1=oai-smf
|
||||
- SMF_IPV4_ADDR_1=0.0.0.0
|
||||
- SMF_HTTP_VERSION_1=v1
|
||||
- SELECTED_1=false
|
||||
- MYSQL_SERVER=192.168.71.131
|
||||
- MYSQL_USER=root
|
||||
- MYSQL_PASS=linux
|
||||
- MYSQL_DB=oai_db
|
||||
- OPERATOR_KEY=c42449363bbad02b66d16bc975d77cc1
|
||||
- NRF_IPV4_ADDRESS=192.168.71.130
|
||||
- NRF_PORT=80
|
||||
- NF_REGISTRATION=yes
|
||||
- SMF_SELECTION=yes
|
||||
- USE_FQDN_DNS=yes
|
||||
- NRF_API_VERSION=v1
|
||||
- NRF_FQDN=oai-nrf
|
||||
- AUSF_IPV4_ADDRESS=127.0.0.1
|
||||
- AUSF_PORT=80
|
||||
- AUSF_API_VERSION=v1
|
||||
depends_on:
|
||||
- oai-nrf
|
||||
volumes:
|
||||
- ./amf-healthcheck.sh:/openair-amf/bin/amf-healthcheck.sh
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/openair-amf/bin/amf-healthcheck.sh"
|
||||
interval: 10s
|
||||
timeout: 15s
|
||||
retries: 5
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.132
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oai-smf:latest
|
||||
entrypoint: /bin/bash -c "/openair-smf/bin/oai_smf -c /openair-smf/bin/oai-smf.conf -o"
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- INSTANCE=0
|
||||
- PID_DIRECTORY=/var/run
|
||||
- SMF_INTERFACE_NAME_FOR_N4=eth0
|
||||
- SMF_INTERFACE_NAME_FOR_SBI=eth0
|
||||
- SMF_INTERFACE_PORT_FOR_SBI=80
|
||||
- SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090
|
||||
- SMF_API_VERSION=v1
|
||||
- DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129
|
||||
- DEFAULT_DNS_SEC_IPV4_ADDRESS=4.4.4.4
|
||||
- AMF_IPV4_ADDRESS=0.0.0.0
|
||||
- AMF_PORT=80
|
||||
- AMF_API_VERSION=v1
|
||||
- AMF_FQDN=oai-amf
|
||||
- UDM_IPV4_ADDRESS=127.0.0.1
|
||||
- UDM_PORT=80
|
||||
- UDM_API_VERSION=v1
|
||||
- UDM_FQDN=localhost
|
||||
- UPF_IPV4_ADDRESS=192.168.71.134
|
||||
- UPF_FQDN_0=oai-spgwu
|
||||
- NRF_IPV4_ADDRESS=192.168.71.130
|
||||
- NRF_PORT=80
|
||||
- NRF_API_VERSION=v1
|
||||
- NRF_FQDN=oai-nrf
|
||||
- REGISTER_NRF=yes
|
||||
- DISCOVER_UPF=yes
|
||||
- USE_FQDN_DNS=yes
|
||||
depends_on:
|
||||
- oai-nrf
|
||||
volumes:
|
||||
- ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh
|
||||
- ./oai-smf.conf:/openair-smf/bin/oai-smf.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.133
|
||||
oai-spgwu:
|
||||
container_name: "rfsim5g-oai-spgwu"
|
||||
image: oai-spgwu-tiny:latest
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- PID_DIRECTORY=/var/run
|
||||
- SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP=eth0
|
||||
- SGW_INTERFACE_NAME_FOR_SX=eth0
|
||||
- PGW_INTERFACE_NAME_FOR_SGI=eth0
|
||||
- NETWORK_UE_NAT_OPTION=yes
|
||||
- NETWORK_UE_IP=12.1.1.0/24
|
||||
- SPGWC0_IP_ADDRESS=192.168.71.133
|
||||
- BYPASS_UL_PFCP_RULES=no
|
||||
- MCC=208
|
||||
- MNC=99
|
||||
- MNC03=099
|
||||
- TAC=1
|
||||
- GTP_EXTENSION_HEADER_PRESENT=yes
|
||||
- GW_ID=1
|
||||
- REALM=openairinterface.org
|
||||
- ENABLE_5G_FEATURES=yes
|
||||
- REGISTER_NRF=yes
|
||||
- USE_FQDN_NRF=yes
|
||||
- UPF_FQDN_5G=oai-spgwu
|
||||
- NRF_IPV4_ADDRESS=192.168.71.130
|
||||
- NRF_PORT=80
|
||||
- NRF_API_VERSION=v1
|
||||
- NRF_FQDN=oai-nrf
|
||||
- NSSAI_SST_0=1
|
||||
- NSSAI_SD_0=1
|
||||
- DNN_0=oai
|
||||
depends_on:
|
||||
- oai-nrf
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- SYS_ADMIN
|
||||
cap_drop:
|
||||
- ALL
|
||||
privileged: true
|
||||
volumes:
|
||||
- ./spgwu-healthcheck.sh:/openair-spgwu-tiny/bin/spgwu-healthcheck.sh
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/openair-spgwu-tiny/bin/spgwu-healthcheck.sh"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.134
|
||||
traffic_net:
|
||||
ipv4_address: 192.168.72.134
|
||||
oai-ext-dn:
|
||||
image: ubuntu:bionic
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
entrypoint: /bin/bash -c \
|
||||
"apt update; apt install -y iptables iproute2 iperf iputils-ping;"\
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
"ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
|
||||
depends_on:
|
||||
- oai-spgwu
|
||||
networks:
|
||||
traffic_net:
|
||||
ipv4_address: 192.168.72.135
|
||||
healthcheck:
|
||||
test: /bin/bash -c "ping -c 2 192.168.72.134"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
oai-gnb:
|
||||
image: oai-gnb:int-w32
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-gnb
|
||||
environment:
|
||||
RFSIMULATOR: server
|
||||
USE_SA_TDD_MONO: 'yes'
|
||||
GNB_NAME: gnb-rfsim
|
||||
TAC: 1
|
||||
MCC: '208'
|
||||
MNC: '99'
|
||||
MNC_LENGTH: 2
|
||||
NSSAI_SST: 1
|
||||
NSSAI_SD0: 1
|
||||
NSSAI_SD1: 112233
|
||||
AMF_IP_ADDRESS: 192.168.71.132
|
||||
GNB_NGA_IF_NAME: eth0
|
||||
GNB_NGA_IP_ADDRESS: 192.168.71.136
|
||||
GNB_NGU_IF_NAME: eth0
|
||||
GNB_NGU_IP_ADDRESS: 192.168.71.136
|
||||
USE_ADDITIONAL_OPTIONS: --sa -E --rfsim
|
||||
depends_on:
|
||||
- oai-ext-dn
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.136
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
oai-nr-ue:
|
||||
image: oai-nr-ue:int-w32
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-nr-ue
|
||||
environment:
|
||||
RFSIMULATOR: 192.168.71.136
|
||||
FULL_IMSI: '208990100001100'
|
||||
FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'
|
||||
OPC: 'C42449363BBAD02B66D16BC975D77CC1'
|
||||
DNN: oai
|
||||
NSSAI_SST: 1
|
||||
NSSAI_SD: 1
|
||||
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.137
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
networks:
|
||||
public_net:
|
||||
driver: bridge
|
||||
name: rfsim5g-oai-public-net
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 192.168.71.128/26
|
||||
driver_opts:
|
||||
com.docker.network.bridge.name: "rfsim5g-public"
|
||||
traffic_net:
|
||||
driver: bridge
|
||||
name: rfsim5g-oai-traffic_net-net
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 192.168.72.128/26
|
||||
driver_opts:
|
||||
com.docker.network.bridge.name: "rfsim5g-traffic"
|
||||
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
if [ "$MYSQL_ROOT_PASSWORD" ] && [ -z "$MYSQL_USER" ] && [ -z "$MYSQL_PASSWORD" ]; then
|
||||
echo >&2 'Healthcheck error: cannot determine root password (and MYSQL_USER and MYSQL_PASSWORD were not set)'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
host="$(hostname --ip-address || echo '127.0.0.1')"
|
||||
user="${MYSQL_USER:-root}"
|
||||
export MYSQL_PWD="${MYSQL_PASSWORD:-$MYSQL_ROOT_PASSWORD}"
|
||||
|
||||
args=(
|
||||
# force mysql to not use the local "mysqld.sock" (test "external" connectivity)
|
||||
-h"$host"
|
||||
-u"$user"
|
||||
--silent
|
||||
)
|
||||
|
||||
STATUS=0
|
||||
if command -v mysqladmin &> /dev/null; then
|
||||
if mysqladmin "${args[@]}" ping > /dev/null; then
|
||||
database_check=$(mysql -u$user -D oai_db --silent -e "SELECT * FROM users;")
|
||||
if [[ -z $database_check ]]; then
|
||||
echo "Healthcheck error: oai_db not populated"
|
||||
STATUS=1
|
||||
fi
|
||||
STATUS=0
|
||||
else
|
||||
echo "Healthcheck error: Mysql port inactive"
|
||||
STATUS=1
|
||||
fi
|
||||
else
|
||||
if select="$(echo 'SELECT 1' | mysql "${args[@]}")" && [ "$select" = '1' ]; then
|
||||
database_check=$(mysql -u$user -D oai_db --silent -e "SELECT * FROM users;")
|
||||
if [[ -z $database_check ]]; then
|
||||
echo "Healthcheck error: oai_db not populated"
|
||||
STATUS=1
|
||||
fi
|
||||
STATUS=0
|
||||
else
|
||||
echo "Healthcheck error: Mysql port inactive"
|
||||
STATUS=1
|
||||
fi
|
||||
fi
|
||||
exit $STATUS
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
STATUS=0
|
||||
NRF_IP_SBI_INTERFACE=$(ifconfig $NRF_INTERFACE_NAME_FOR_SBI | grep inet | awk {'print $2'})
|
||||
NRF_SBI_PORT_STATUS=$(netstat -tnpl | grep -o "$NRF_IP_SBI_INTERFACE:$NRF_INTERFACE_PORT_FOR_SBI")
|
||||
#Check if entrypoint properly configured the conf file and no parameter is unset(optional)
|
||||
NB_UNREPLACED_AT=`cat /openair-nrf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
|
||||
|
||||
if [ $NB_UNREPLACED_AT -ne 0 ]; then
|
||||
STATUS=1
|
||||
echo "Healthcheck error: UNHEALTHY configuration file is not configured properly"
|
||||
fi
|
||||
|
||||
if [[ -z $NRF_SBI_PORT_STATUS ]]; then
|
||||
STATUS=1
|
||||
echo "Healthcheck error: UNHEALTHY SBI TCP/HTTP port $NRF_INTERFACE_PORT_FOR_SBI is not listening."
|
||||
fi
|
||||
|
||||
exit $STATUS
|
||||
@@ -0,0 +1,133 @@
|
||||
################################################################################
|
||||
# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The OpenAirInterface Software Alliance licenses this file to You under
|
||||
# the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.openairinterface.org/?page_id=698
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#-------------------------------------------------------------------------------
|
||||
# For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
# contact@openairinterface.org
|
||||
################################################################################
|
||||
|
||||
SMF =
|
||||
{
|
||||
FQDN = "oai-smf-svc";
|
||||
INSTANCE = 0; # 0 is the default
|
||||
PID_DIRECTORY = "/var/run"; # /var/run is the default
|
||||
|
||||
INTERFACES :
|
||||
{
|
||||
N4 :
|
||||
{
|
||||
# SMF binded interface for N4 communication (UPF)
|
||||
INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE
|
||||
IPV4_ADDRESS = "read";
|
||||
};
|
||||
|
||||
SBI :
|
||||
{
|
||||
# SMF binded interface for SBI interface (e.g., communication with AMF, UDM)
|
||||
INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE
|
||||
IPV4_ADDRESS = "read";
|
||||
PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80)
|
||||
HTTP2_PORT = 9090; # YOUR NETWORK CONFIG HERE
|
||||
API_VERSION = "v1"; # YOUR SMF API VERSION CONFIG HERE
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
# Pool of UE assigned IP addresses
|
||||
# Do not make IP pools overlap
|
||||
# first IPv4 address X.Y.Z.1 is reserved for GTP network device on UPF
|
||||
IP_ADDRESS_POOL :
|
||||
{
|
||||
IPV4_LIST = (
|
||||
{RANGE = "12.1.1.2 - 12.1.1.128";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE.
|
||||
{RANGE = "12.1.1.129 - 12.1.1.224";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE.
|
||||
{RANGE = "10.10.10.2 - 10.10.10.253";} # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE.
|
||||
|
||||
);
|
||||
IPV6_LIST = (
|
||||
{PREFIX = "2001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE.
|
||||
{PREFIX = "3001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE.
|
||||
{PREFIX = "4001:1:2::/64";} # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE.
|
||||
);
|
||||
};
|
||||
|
||||
DNN_LIST = (
|
||||
# IPV4_POOL, IPV6_POOL are index in IPV4_LIST, IPV6_LIST, PDU_SESSION_TYPE choice in {IPv4, IPv6, IPv4v6}
|
||||
{DNN_NI = "default"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 2; IPV6_POOL = -1},
|
||||
{DNN_NI = "carrier.com"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 1; IPV6_POOL = -1},
|
||||
{DNN_NI = "oai"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 0; IPV6_POOL = -1}
|
||||
);
|
||||
|
||||
# DNS address communicated to UEs
|
||||
DEFAULT_DNS_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE
|
||||
DEFAULT_DNS_SEC_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE
|
||||
DEFAULT_DNS_IPV6_ADDRESS = "2001:4860:4860::8888"; # YOUR DNS CONFIG HERE
|
||||
DEFAULT_DNS_SEC_IPV6_ADDRESS = "2001:4860:4860::8844"; # YOUR DNS CONFIG HERE
|
||||
|
||||
SUPPORT_FEATURES:
|
||||
{
|
||||
# STRING, {"yes", "no"},
|
||||
REGISTER_NRF = "yes"; # Set to yes if SMF resgisters to an NRF
|
||||
DISCOVER_UPF = "yes"; # Set to yes to enable UPF discovery and selection
|
||||
FORCE_PUSH_PROTOCOL_CONFIGURATION_OPTIONS = "no"; # Non standard feature, normally should be set to "no",
|
||||
# but you may need to set to yes for UE that do not explicitly request a PDN address through NAS signalling
|
||||
USE_LOCAL_SUBSCRIPTION_INFO = "yes"; # Set to yes if SMF uses local subscription information instead of from an UDM
|
||||
USE_FQDN_DNS = "yes"; # Set to yes if AMF/UDM/NRF/UPF will relying on a DNS to resolve FQDN
|
||||
}
|
||||
|
||||
AMF :
|
||||
{
|
||||
IPV4_ADDRESS = "0.0.0.0"; # YOUR AMF CONFIG HERE
|
||||
PORT = 80; # YOUR AMF CONFIG HERE (default: 80)
|
||||
API_VERSION = "v1"; # YOUR AMF API VERSION FOR SBI CONFIG HERE
|
||||
FQDN = "oai-amf" # YOUR AMF FQDN CONFIG HERE
|
||||
};
|
||||
|
||||
UDM :
|
||||
{
|
||||
IPV4_ADDRESS = "127.0.0.1"; # YOUR UDM CONFIG HERE
|
||||
PORT = 80; # YOUR UDM CONFIG HERE (default: 80)
|
||||
API_VERSION = "v1"; # YOUR UDM API VERSION FOR SBI CONFIG HERE
|
||||
FQDN = "localhost" # YOUR UDM FQDN CONFIG HERE
|
||||
};
|
||||
|
||||
NRF :
|
||||
{
|
||||
IPV4_ADDRESS = "192.168.71.130"; # YOUR NRF CONFIG HERE
|
||||
PORT = 80; # YOUR NRF CONFIG HERE (default: 80)
|
||||
API_VERSION = "v1"; # YOUR NRF API VERSION FOR SBI CONFIG HERE
|
||||
FQDN = "oai-nrf" # YOUR NRF FQDN CONFIG HERE
|
||||
};
|
||||
|
||||
UPF_LIST = (
|
||||
{IPV4_ADDRESS = "192.168.71.134" ; FQDN = "oai-spgwu"} # YOUR UPF CONFIG HERE
|
||||
);
|
||||
|
||||
LOCAL_CONFIGURATION :
|
||||
{
|
||||
SESSION_MANAGEMENT_SUBSCRIPTION_LIST = (
|
||||
{ NSSAI_SST = 222, NSSAI_SD = "123", DNN = "default", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1,
|
||||
QOS_PROFILE_5QI = 7, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT",
|
||||
QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"},
|
||||
{ NSSAI_SST = 1; NSSAI_SD = "1", DNN = "oai", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1,
|
||||
QOS_PROFILE_5QI = 6, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT",
|
||||
QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"}
|
||||
);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
+217
File diff suppressed because one or more lines are too long
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
STATUS=0
|
||||
SMF_IP_SBI_INTERFACE=$(ifconfig $SMF_INTERFACE_NAME_FOR_SBI | grep inet | awk {'print $2'})
|
||||
SMF_SBI_PORT_STATUS=$(netstat -tnpl | grep -o "$SMF_IP_SBI_INTERFACE:$SMF_INTERFACE_PORT_FOR_SBI")
|
||||
|
||||
#Check if entrypoint properly configured the conf file and no parameter is unset(optional)
|
||||
#NB_UNREPLACED_AT=`cat /openair-smf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
|
||||
|
||||
#if [ $NB_UNREPLACED_AT -ne 0 ]; then
|
||||
# STATUS=-1
|
||||
# echo "Healthcheck error: UNHEALTHY configuration file is not configured properly"
|
||||
#fi
|
||||
#
|
||||
if [[ -z $SMF_SBI_PORT_STATUS ]]; then
|
||||
STATUS=-1
|
||||
echo "Healthcheck error: UNHEALTHY SBI TCP/HTTP port $SMF_INTERFACE_PORT_FOR_SBI is not listening."
|
||||
fi
|
||||
|
||||
exit $STATUS
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
STATUS=0
|
||||
SGW_PORT_FOR_S1U_S12_S4_UP=2152
|
||||
SGW_PORT_FOR_SX=8805
|
||||
SGW_IP_S1U_INTERFACE=$(ifconfig $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP | grep inet | awk {'print $2'})
|
||||
SGW_IP_SX_INTERFACE=$(ifconfig $SGW_INTERFACE_NAME_FOR_SX | grep inet | awk {'print $2'})
|
||||
S1U_S12_S4_UP_PORT_STATUS=$(netstat -unpl | grep -o "$SGW_IP_S1U_INTERFACE:$SGW_PORT_FOR_S1U_S12_S4_UP")
|
||||
SX_PORT_STATUS=$(netstat -unpl | grep -o "$SGW_IP_SX_INTERFACE:$SGW_PORT_FOR_SX")
|
||||
#Check if entrypoint properly configured the conf file and no parameter is unset (optional)
|
||||
NB_UNREPLACED_AT=`cat /openair-spgwu/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
|
||||
if [ $NB_UNREPLACED_AT -ne 0 ]; then
|
||||
STATUS=1
|
||||
echo "Healthcheck error: UNHEALTHY configuration file is not configured properly"
|
||||
fi
|
||||
|
||||
if [[ -z $S1U_S12_S4_UP_PORT_STATUS ]]; then
|
||||
STATUS=1
|
||||
echo "Healthcheck error: UNHEALTHY S1U port $SGW_PORT_FOR_S1U_S12_S4_UP is not listening."
|
||||
fi
|
||||
|
||||
if [[ -z $SX_PORT_STATUS ]]; then
|
||||
STATUS=1
|
||||
echo "Healthcheck error: UNHEALTHY SX port $SGW_PORT_FOR_SX is not listening."
|
||||
fi
|
||||
|
||||
exit $STATUS
|
||||
+239
-277
@@ -124,13 +124,13 @@ if(EXISTS "/usr/include/atlas/cblas.h" OR EXISTS "/usr/include/cblas.h")
|
||||
|
||||
# for ubuntu 17.10, directories are different
|
||||
elseif(EXISTS "/usr/include/x86_64-linux-gnu/cblas.h")
|
||||
|
||||
|
||||
include_directories("/usr/include/x86_64-linux-gnu")
|
||||
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
|
||||
list(APPEND ATLAS_LIBRARIES cblas)
|
||||
list(APPEND ATLAS_LIBRARIES atlas)
|
||||
list(APPEND ATLAS_LIBRARIES lapack)
|
||||
|
||||
|
||||
else()
|
||||
message("No Blas/Atlas libs found, some targets will fail")
|
||||
endif()
|
||||
@@ -155,8 +155,6 @@ set (OPENAIR_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
|
||||
|
||||
project (OpenAirInterface)
|
||||
|
||||
|
||||
|
||||
##############################################
|
||||
# Base CUDA setting
|
||||
##############################################
|
||||
@@ -257,6 +255,7 @@ macro(add_list_string_option name val helpstr)
|
||||
endif()
|
||||
endmacro(add_list_string_option)
|
||||
|
||||
# this function should produce the same value as the macro MAKE_VERSION defined in the C code (file types.h)
|
||||
function(make_version VERSION_VALUE)
|
||||
math(EXPR RESULT "0")
|
||||
foreach (ARG ${ARGN})
|
||||
@@ -309,49 +308,38 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86")
|
||||
endif()
|
||||
|
||||
#
|
||||
set(CMAKE_C_FLAGS
|
||||
"${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} -pipe -std=gnu99 -Wall -Werror -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -fPIC")
|
||||
# add autotools definitions that were maybe used!
|
||||
if (CUDA_FOUND)
|
||||
set(MKVER "'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'")
|
||||
set(CUDA_CMAKE_C_FLAGS
|
||||
"${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D CUDA_FLAG"
|
||||
)
|
||||
set(CUDA_CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -Wno-packed-bitfield-compat -fPIC -Wall -Werror -fno-strict-aliasing -rdynamic -std=c++11 -D CUDA_FLAG"
|
||||
)
|
||||
add_definitions("-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP")
|
||||
|
||||
set(CMAKE_C_FLAGS
|
||||
"${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D${MKVER} -D CUDA_FLAG"
|
||||
)
|
||||
set(CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -Wno-packed-bitfield-compat -fPIC -Wall -Werror -fno-strict-aliasing -rdynamic -std=c++11 -D${MKVER} -D CUDA_FLAG"
|
||||
)
|
||||
else (CUDA_FOUND)
|
||||
set(MKVER "'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'")
|
||||
set(CMAKE_C_FLAGS
|
||||
"${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D${MKVER}"
|
||||
)
|
||||
set(CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -Wno-packed-bitfield-compat -fPIC -Wall -Werror -fno-strict-aliasing -rdynamic -std=c++11 -D${MKVER}"
|
||||
)
|
||||
endif ()
|
||||
set(commonOpts "-pipe -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic")
|
||||
|
||||
set(CMAKE_C_FLAGS
|
||||
"${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=gnu99 -funroll-loops")
|
||||
set(CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=c++11")
|
||||
|
||||
# cuda compiler bug (limitation) on complex macro definition
|
||||
if (CUDA_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCUDA_FLAG")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCUDA_FLAG")
|
||||
endif()
|
||||
|
||||
if (SANITIZE_ADDRESS)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-common")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-common")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-common")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-common")
|
||||
endif ()
|
||||
|
||||
add_definitions("-DASN_DISABLE_OER_SUPPORT")
|
||||
|
||||
#########################
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CURRENT_BINARY_DIR}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ggdb3 -Wl,-rpath -Wl,${CMAKE_CURRENT_BINARY_DIR}")
|
||||
#########################
|
||||
# set a flag for changes in the source code
|
||||
# these changes are related to hardcoded path to include .h files
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -Og -DMALLOC_CHECK_=3")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g3 -DMALLOC_CHECK_=3 -O2 -fno-delete-null-pointer-checks")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3")
|
||||
set(debugOpt "-ggdb3 -DMALLOC_CHECK_=3 -fno-delete-null-pointer-checks")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${debugOpt} -O0")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${debugOpt} -O2")
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O3")
|
||||
|
||||
# Enable assert() for RelWithDebInfo builds
|
||||
string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||
@@ -389,7 +377,6 @@ if(GIT_FOUND)
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
# Below is a hard-coded info
|
||||
set (FIRMWARE_VERSION "No svn information")
|
||||
add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"")
|
||||
@@ -410,14 +397,12 @@ add_boolean_option(PDCP_MSG_PRINT False "print PDCP messages to /tmp/pdcp.l
|
||||
add_boolean_option(DEBUG_PDCP_PAYLOAD False "print PDCP PDU to stdout") # if true, make sure that global and PDCP log levels are trace
|
||||
add_boolean_option(DEBUG_MAC_INTERFACE False "print MAC-RLC PDU exchange to stdout") # if true, make sure that global and PDCP log levels are trace
|
||||
add_boolean_option(TRACE_RLC_PAYLOAD False "print RLC PDU to stdout") # if true, make sure that global and PDCP log levels are trace
|
||||
add_boolean_option(TEST_OMG False "???")
|
||||
add_boolean_option(DEBUG_OMG False "???")
|
||||
add_boolean_option(PRINT_STATS False "This adds the possibility to see the status")
|
||||
add_boolean_option(T_TRACER True "Activate the T tracer, a debugging/monitoring framework" )
|
||||
add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs")
|
||||
add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace")
|
||||
add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace")
|
||||
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
|
||||
add_boolean_option(DEBUG_CONSOLE False "disables stdout/stderr buffering")
|
||||
|
||||
set (OCP_ITTI ${OPENAIR_DIR}/common/utils/ocp_itti)
|
||||
add_library(ITTI
|
||||
@@ -425,8 +410,6 @@ add_library(ITTI
|
||||
${OPENAIR_DIR}/common/utils/backtrace.c
|
||||
)
|
||||
add_dependencies(ITTI rrc_flag)
|
||||
set(ITTI_LIB ITTI)
|
||||
|
||||
|
||||
##################################################
|
||||
# ASN.1 grammar C code generation & dependencies #
|
||||
@@ -841,11 +824,11 @@ if (${RU} STREQUAL 0)
|
||||
COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "F1AP_" "-findirect-choice -fno-include-deps" ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}
|
||||
RESULT_VARIABLE ret
|
||||
)
|
||||
|
||||
|
||||
if (NOT ${ret} STREQUAL 0)
|
||||
message(FATAL_ERROR "asn1c: error")
|
||||
endif (NOT ${ret} STREQUAL 0)
|
||||
|
||||
|
||||
add_custom_target (
|
||||
f1_flag ALL
|
||||
COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "F1AP_" "-findirect-choice -fno-include-deps" ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}
|
||||
@@ -856,15 +839,13 @@ if (${RU} STREQUAL 0)
|
||||
${F1AP_ASN_GENERATED_C_FILES}
|
||||
)
|
||||
add_dependencies (F1AP_LIB f1_flag)
|
||||
|
||||
include_directories ("${F1AP_ASN_GENERATED_C_DIR}")
|
||||
include_directories ("${F1AP_DIR}")
|
||||
|
||||
file(GLOB F1AP_C_FILES ${F1AP_DIR}/*.c)
|
||||
add_library(F1AP
|
||||
${F1AP_C_FILES}
|
||||
)
|
||||
|
||||
|
||||
include_directories ("${F1AP_ASN_GENERATED_C_DIR}")
|
||||
include_directories ("${F1AP_DIR}")
|
||||
|
||||
file(GLOB F1AP_C_FILES ${F1AP_DIR}/*.c)
|
||||
add_library(F1AP ${F1AP_C_FILES} )
|
||||
|
||||
endif (${RU} STREQUAL 0)
|
||||
|
||||
# Hardware dependant options
|
||||
@@ -877,22 +858,22 @@ add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF
|
||||
add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET")
|
||||
#NOKIA config enhancement
|
||||
set (CONFIG_ROOTDIR
|
||||
${OPENAIR_DIR}/common/config
|
||||
)
|
||||
${OPENAIR_DIR}/common/config
|
||||
)
|
||||
set (CONFIG_SOURCES
|
||||
${CONFIG_ROOTDIR}/config_load_configmodule.c
|
||||
${CONFIG_ROOTDIR}/config_userapi.c
|
||||
${CONFIG_ROOTDIR}/config_cmdline.c
|
||||
)
|
||||
${CONFIG_ROOTDIR}/config_load_configmodule.c
|
||||
${CONFIG_ROOTDIR}/config_userapi.c
|
||||
${CONFIG_ROOTDIR}/config_cmdline.c
|
||||
)
|
||||
set (CONFIG_LIBCONFIG_SOURCES
|
||||
${CONFIG_ROOTDIR}/libconfig/config_libconfig.c
|
||||
)
|
||||
${CONFIG_ROOTDIR}/libconfig/config_libconfig.c
|
||||
)
|
||||
add_library(CONFIG_LIB ${CONFIG_SOURCES})
|
||||
add_library(params_libconfig MODULE ${CONFIG_LIBCONFIG_SOURCES} )
|
||||
target_link_libraries(params_libconfig config)
|
||||
# shared library loader
|
||||
set (SHLIB_LOADER_SOURCES
|
||||
${OPENAIR_DIR}/common/utils/load_module_shlib.c
|
||||
${OPENAIR_DIR}/common/utils/load_module_shlib.c
|
||||
)
|
||||
# include RF devices / transport protocols library modules
|
||||
######################################################################
|
||||
@@ -931,8 +912,8 @@ add_library(oai_eth_transpro MODULE ${TPLIB_ETHERNET_SOURCE} )
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/")
|
||||
set(option_HWIRISLIB_lib "-l SoapySDR")
|
||||
set(HWLIB_IRIS_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp
|
||||
)
|
||||
${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp
|
||||
)
|
||||
add_library(oai_irisdevif MODULE ${HWLIB_IRIS_SOURCE})
|
||||
target_include_directories(oai_irisdevif PRIVATE /usr/local/lib/SoapySDR/modules0.7/)
|
||||
target_link_libraries(oai_irisdevif SoapySDR)
|
||||
@@ -1039,7 +1020,6 @@ add_boolean_option(ENABLE_VCD False "always true now, time measure
|
||||
add_boolean_option(ENABLE_VCD_FIFO False "time measurements of proc calls and var displays sent to FIFO (one more thread)")
|
||||
add_boolean_option(LINUX False "used in weird memcpy() in pdcp.c ???")
|
||||
add_boolean_option(LINUX_LIST False "used only in lists.c: either use OAI implementation of lists or Linux one (should be True, but it is False")
|
||||
add_boolean_option(OPENAIR_LTE True "Seems legacy: keep it to true")
|
||||
|
||||
##########################
|
||||
# PHY options
|
||||
@@ -1048,10 +1028,7 @@ add_boolean_option(DRIVER2013 True "only relevant for EXMIMO")
|
||||
add_boolean_option(EXMIMO_IOT True "????")
|
||||
add_boolean_option(LOCALIZATION False "???")
|
||||
add_integer_option(MAX_NUM_CCs 1 "????")
|
||||
add_boolean_option(MU_RECEIVER False "????")
|
||||
add_boolean_option(PHYSIM False "for L1 simulators (dlsim, ulsim, ...)")
|
||||
add_boolean_option(PHY_CONTEXT True "not clear: must remain False for dlsim")
|
||||
add_boolean_option(PHY_EMUL False "not clear: must remain False for dlsim")
|
||||
add_boolean_option(SMBV False "Rohde&Schwarz SMBV100A vector signal generator")
|
||||
add_boolean_option(DEBUG_PHY False "Enable PHY layer debugging options")
|
||||
add_boolean_option(DEBUG_PHY_PROC False "Enable debugging of PHY layer procedures")
|
||||
@@ -1393,42 +1370,42 @@ target_link_libraries (msc LFDS)
|
||||
include_directories(${OPENAIR_DIR}/common/utils/msc)
|
||||
|
||||
set(UTIL_SRC
|
||||
# ${OPENAIR2_DIR}/UTIL/CLI/cli.c
|
||||
# ${OPENAIR2_DIR}/UTIL/CLI/cli_cmd.c
|
||||
# ${OPENAIR2_DIR}/UTIL/CLI/cli_server.c
|
||||
# ${OPENAIR2_DIR}/UTIL/CLI/cli.c
|
||||
# ${OPENAIR2_DIR}/UTIL/CLI/cli_cmd.c
|
||||
# ${OPENAIR2_DIR}/UTIL/CLI/cli_server.c
|
||||
${OPENAIR2_DIR}/UTIL/FIFO/pad_list.c
|
||||
${OPENAIR2_DIR}/UTIL/LISTS/list.c
|
||||
${OPENAIR2_DIR}/UTIL/LISTS/list2.c
|
||||
${OPENAIR_DIR}/common/utils/LOG/log.c
|
||||
${OPENAIR_DIR}/common/utils/LOG/vcd_signal_dumper.c
|
||||
${OPENAIR2_DIR}/UTIL/MATH/oml.c
|
||||
# ${OPENAIR2_DIR}/UTIL/MEM/mem_block.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OCG/OCG.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OCG/OCG_create_dir.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OCG/OCG_detect_file.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OCG/OCG_generate_report.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OCG/OCG_parse_filename.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OCG/OCG_parse_XML.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OCG/OCG_save_XML.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/common.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/grid.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/job.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/mobility_parser.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/omg.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/omg_hashtable.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/rwalk.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/rwp.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/static.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/steadystaterwp.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/trace.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/trace_hashtable.c
|
||||
# ${OPENAIR2_DIR}/UTIL/MEM/mem_block.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OCG/OCG.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OCG/OCG_create_dir.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OCG/OCG_detect_file.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OCG/OCG_generate_report.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OCG/OCG_parse_filename.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OCG/OCG_parse_XML.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OCG/OCG_save_XML.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/common.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/grid.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/job.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/mobility_parser.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/omg.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/omg_hashtable.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/rwalk.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/rwp.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/static.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/steadystaterwp.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/trace.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OMG/trace_hashtable.c
|
||||
${OPENAIR2_DIR}/UTIL/OPT/probe.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OTG/otg_tx.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OTG/otg.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OTG/otg_kpi.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OTG/otg_models.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OTG/otg_form.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OTG/otg_rx.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OTG/otg_tx.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OTG/otg.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OTG/otg_kpi.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OTG/otg_models.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OTG/otg_form.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OTG/otg_rx.c
|
||||
)
|
||||
add_library(UTIL ${UTIL_SRC})
|
||||
add_dependencies(UTIL rrc_flag)
|
||||
@@ -1510,7 +1487,6 @@ set(SCHED_SRC_NR_UE
|
||||
${OPENAIR1_DIR}/SCHED_NR_UE/phy_frame_config_nr_ue.c
|
||||
${OPENAIR1_DIR}/SCHED_NR_UE/harq_nr.c
|
||||
${OPENAIR1_DIR}/SCHED_NR_UE/pucch_uci_ue_nr.c
|
||||
${OPENAIR1_DIR}/SCHED_NR_UE/pucch_power_control_ue_nr.c
|
||||
)
|
||||
add_library(SCHED_NR_UE_LIB ${SCHED_SRC_NR_UE})
|
||||
|
||||
@@ -1519,7 +1495,7 @@ add_library(SCHED_NR_UE_LIB ${SCHED_SRC_NR_UE})
|
||||
#################################
|
||||
set(NFAPI_COMMON_SRC
|
||||
${NFAPI_DIR}/common/src/debug.c
|
||||
)
|
||||
)
|
||||
add_library(NFAPI_COMMON_LIB ${NFAPI_COMMON_SRC})
|
||||
|
||||
include_directories(${NFAPI_DIR}/common/public_inc)
|
||||
@@ -2178,7 +2154,6 @@ set (MISC_NFAPI_LTE
|
||||
${OPENAIR1_DIR}/SCHED/nfapi_lte_dummy.c
|
||||
)
|
||||
|
||||
|
||||
add_library(MISC_NFAPI_LTE_LIB
|
||||
${MISC_NFAPI_LTE}
|
||||
)
|
||||
@@ -2187,7 +2162,6 @@ set (MISC_NFAPI_NR
|
||||
${OPENAIR1_DIR}/SCHED/nfapi_nr_dummy.c
|
||||
)
|
||||
|
||||
|
||||
add_library(MISC_NFAPI_NR_LIB
|
||||
${MISC_NFAPI_NR}
|
||||
)
|
||||
@@ -2270,8 +2244,8 @@ set(GTPV1U_DIR ${OPENAIR3_DIR}/GTPV1-U)
|
||||
add_library (GTPV1U_OCP
|
||||
${NR_RRC_DIR}/rrc_gNB_GTPV1U.c
|
||||
${RRC_DIR}/rrc_eNB_GTPV1U.c
|
||||
${OPENAIR3_DIR}/ocp-gtpu/gtp_itf.cpp
|
||||
)
|
||||
${OPENAIR3_DIR}/ocp-gtpu/gtp_itf.cpp
|
||||
)
|
||||
target_compile_definitions(GTPV1U_OCP PUBLIC NEW_GTPU)
|
||||
add_dependencies(GTPV1U_OCP rrc_flag)
|
||||
include_directories(${OPENAIR3_DIR}/ocp-gtp)
|
||||
@@ -2287,7 +2261,7 @@ set (NR_GTPV1U_SRC
|
||||
${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uMsg.c
|
||||
${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1u.c
|
||||
${GTPV1U_DIR}/gtpv1u_teid_pool.c
|
||||
)
|
||||
)
|
||||
add_library(NR_GTPV1U ${NR_GTPV1U_SRC})
|
||||
add_dependencies(NR_GTPV1U rrc_flag)
|
||||
|
||||
@@ -2309,7 +2283,6 @@ add_dependencies(SCTP_CLIENT rrc_flag)
|
||||
add_library(UDP ${OPENAIR3_DIR}/UDP/udp_eNB_task.c)
|
||||
add_dependencies(UDP rrc_flag)
|
||||
|
||||
|
||||
set(NAS_SRC ${OPENAIR3_DIR}/NAS/)
|
||||
set(libnas_api_OBJS
|
||||
${NAS_SRC}COMMON/API/NETWORK/as_message.c
|
||||
@@ -2468,171 +2441,171 @@ set (libnas_utils_OBJS
|
||||
${NAS_SRC}COMMON/UTIL/OctetString.c
|
||||
)
|
||||
|
||||
set(libnas_ue_api_OBJS
|
||||
${NAS_SRC}UE/API/USER/at_command.c
|
||||
${NAS_SRC}UE/API/USER/at_error.c
|
||||
${NAS_SRC}UE/API/USER/at_response.c
|
||||
${NAS_SRC}UE/API/USER/user_api.c
|
||||
${NAS_SRC}UE/API/USER/user_indication.c
|
||||
${NAS_SRC}UE/API/USIM/aka_functions.c
|
||||
${NAS_SRC}UE/API/USIM/usim_api.c
|
||||
set(libnas_ue_api_OBJS
|
||||
${NAS_SRC}UE/API/USER/at_command.c
|
||||
${NAS_SRC}UE/API/USER/at_error.c
|
||||
${NAS_SRC}UE/API/USER/at_response.c
|
||||
${NAS_SRC}UE/API/USER/user_api.c
|
||||
${NAS_SRC}UE/API/USER/user_indication.c
|
||||
${NAS_SRC}UE/API/USIM/aka_functions.c
|
||||
${NAS_SRC}UE/API/USIM/usim_api.c
|
||||
)
|
||||
set(libnas_ue_emm_OBJS
|
||||
${NAS_SRC}UE/EMM/Attach.c
|
||||
${NAS_SRC}UE/EMM/Authentication.c
|
||||
${NAS_SRC}UE/EMM/Detach.c
|
||||
${NAS_SRC}UE/EMM/emm_main.c
|
||||
${NAS_SRC}UE/EMM/EmmStatusHdl.c
|
||||
${NAS_SRC}UE/EMM/Identification.c
|
||||
${NAS_SRC}UE/EMM/IdleMode.c
|
||||
${NAS_SRC}UE/EMM/LowerLayer.c
|
||||
${NAS_SRC}UE/EMM/SecurityModeControl.c
|
||||
${NAS_SRC}UE/EMM/ServiceRequestHdl.c
|
||||
${NAS_SRC}UE/EMM/TrackingAreaUpdate.c
|
||||
set(libnas_ue_emm_OBJS
|
||||
${NAS_SRC}UE/EMM/Attach.c
|
||||
${NAS_SRC}UE/EMM/Authentication.c
|
||||
${NAS_SRC}UE/EMM/Detach.c
|
||||
${NAS_SRC}UE/EMM/emm_main.c
|
||||
${NAS_SRC}UE/EMM/EmmStatusHdl.c
|
||||
${NAS_SRC}UE/EMM/Identification.c
|
||||
${NAS_SRC}UE/EMM/IdleMode.c
|
||||
${NAS_SRC}UE/EMM/LowerLayer.c
|
||||
${NAS_SRC}UE/EMM/SecurityModeControl.c
|
||||
${NAS_SRC}UE/EMM/ServiceRequestHdl.c
|
||||
${NAS_SRC}UE/EMM/TrackingAreaUpdate.c
|
||||
)
|
||||
set(libnas_ue_emm_sap_OBJS
|
||||
${NAS_SRC}UE/EMM/SAP/emm_as.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregisteredAttachNeeded.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregisteredAttemptingToAttach.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregistered.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregisteredInitiated.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregisteredLimitedService.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregisteredNoCellAvailable.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregisteredNoImsi.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregisteredNormalService.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregisteredPlmnSearch.c
|
||||
${NAS_SRC}UE/EMM/SAP/emm_esm.c
|
||||
${NAS_SRC}UE/EMM/SAP/emm_fsm.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmNull.c
|
||||
${NAS_SRC}UE/EMM/SAP/emm_recv.c
|
||||
${NAS_SRC}UE/EMM/SAP/emm_reg.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegisteredAttemptingToUpdate.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegistered.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegisteredImsiDetachInitiated.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegisteredInitiated.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegisteredLimitedService.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegisteredNoCellAvailable.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegisteredNormalService.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegisteredPlmnSearch.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegisteredUpdateNeeded.c
|
||||
${NAS_SRC}UE/EMM/SAP/emm_sap.c
|
||||
${NAS_SRC}UE/EMM/SAP/emm_send.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmServiceRequestInitiated.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmTrackingAreaUpdatingInitiated.c
|
||||
set(libnas_ue_emm_sap_OBJS
|
||||
${NAS_SRC}UE/EMM/SAP/emm_as.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregisteredAttachNeeded.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregisteredAttemptingToAttach.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregistered.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregisteredInitiated.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregisteredLimitedService.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregisteredNoCellAvailable.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregisteredNoImsi.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregisteredNormalService.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmDeregisteredPlmnSearch.c
|
||||
${NAS_SRC}UE/EMM/SAP/emm_esm.c
|
||||
${NAS_SRC}UE/EMM/SAP/emm_fsm.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmNull.c
|
||||
${NAS_SRC}UE/EMM/SAP/emm_recv.c
|
||||
${NAS_SRC}UE/EMM/SAP/emm_reg.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegisteredAttemptingToUpdate.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegistered.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegisteredImsiDetachInitiated.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegisteredInitiated.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegisteredLimitedService.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegisteredNoCellAvailable.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegisteredNormalService.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegisteredPlmnSearch.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmRegisteredUpdateNeeded.c
|
||||
${NAS_SRC}UE/EMM/SAP/emm_sap.c
|
||||
${NAS_SRC}UE/EMM/SAP/emm_send.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmServiceRequestInitiated.c
|
||||
${NAS_SRC}UE/EMM/SAP/EmmTrackingAreaUpdatingInitiated.c
|
||||
)
|
||||
set (libnas_ue_esm_OBJS
|
||||
${NAS_SRC}UE/ESM/DedicatedEpsBearerContextActivation.c
|
||||
${NAS_SRC}UE/ESM/DefaultEpsBearerContextActivation.c
|
||||
${NAS_SRC}UE/ESM/EpsBearerContextDeactivation.c
|
||||
${NAS_SRC}UE/ESM/esm_ebr.c
|
||||
${NAS_SRC}UE/ESM/esm_ebr_context.c
|
||||
${NAS_SRC}UE/ESM/esm_ip.c
|
||||
${NAS_SRC}UE/ESM/esm_main.c
|
||||
${NAS_SRC}UE/ESM/esm_pt.c
|
||||
${NAS_SRC}UE/ESM/EsmStatusHdl.c
|
||||
${NAS_SRC}UE/ESM/PdnConnectivity.c
|
||||
${NAS_SRC}UE/ESM/PdnDisconnect.c
|
||||
set (libnas_ue_esm_OBJS
|
||||
${NAS_SRC}UE/ESM/DedicatedEpsBearerContextActivation.c
|
||||
${NAS_SRC}UE/ESM/DefaultEpsBearerContextActivation.c
|
||||
${NAS_SRC}UE/ESM/EpsBearerContextDeactivation.c
|
||||
${NAS_SRC}UE/ESM/esm_ebr.c
|
||||
${NAS_SRC}UE/ESM/esm_ebr_context.c
|
||||
${NAS_SRC}UE/ESM/esm_ip.c
|
||||
${NAS_SRC}UE/ESM/esm_main.c
|
||||
${NAS_SRC}UE/ESM/esm_pt.c
|
||||
${NAS_SRC}UE/ESM/EsmStatusHdl.c
|
||||
${NAS_SRC}UE/ESM/PdnConnectivity.c
|
||||
${NAS_SRC}UE/ESM/PdnDisconnect.c
|
||||
)
|
||||
set(libnas_ue_esm_sap_OBJS
|
||||
${NAS_SRC}UE/ESM/SAP/esm_recv.c
|
||||
${NAS_SRC}UE/ESM/SAP/esm_send.c
|
||||
${NAS_SRC}UE/ESM/SAP/esm_sap.c
|
||||
set(libnas_ue_esm_sap_OBJS
|
||||
${NAS_SRC}UE/ESM/SAP/esm_recv.c
|
||||
${NAS_SRC}UE/ESM/SAP/esm_send.c
|
||||
${NAS_SRC}UE/ESM/SAP/esm_sap.c
|
||||
)
|
||||
|
||||
set(libnrnas_emm_msg_OBJS
|
||||
${NAS_SRC}COMMON/EMM/MSG/RegistrationRequest.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/RegistrationAccept.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/FGSIdentityResponse.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/FGSAuthenticationResponse.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/FGSNASSecurityModeComplete.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/RegistrationComplete.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/FGSUplinkNasTransport.c
|
||||
${NAS_SRC}COMMON/ESM/MSG/PduSessionEstablishRequest.c
|
||||
set(libnrnas_emm_msg_OBJS
|
||||
${NAS_SRC}COMMON/EMM/MSG/RegistrationRequest.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/RegistrationAccept.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/FGSIdentityResponse.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/FGSAuthenticationResponse.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/FGSNASSecurityModeComplete.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/RegistrationComplete.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/FGSUplinkNasTransport.c
|
||||
${NAS_SRC}COMMON/ESM/MSG/PduSessionEstablishRequest.c
|
||||
)
|
||||
|
||||
set(libnrnas_ies_OBJS
|
||||
${NAS_SRC}COMMON/IES/ExtendedProtocolDiscriminator.c
|
||||
${NAS_SRC}COMMON/IES/FGSMobileIdentity.c
|
||||
${NAS_SRC}COMMON/IES/FGSRegistrationType.c
|
||||
${NAS_SRC}COMMON/IES/SpareHalfOctet.c
|
||||
${NAS_SRC}COMMON/IES/FGSRegistrationResult.c
|
||||
${NAS_SRC}COMMON/IES/FGMMCapability.c
|
||||
${NAS_SRC}COMMON/IES/NrUESecurityCapability.c
|
||||
${NAS_SRC}COMMON/IES/FGCNasMessageContainer.c
|
||||
${NAS_SRC}COMMON/IES/SORTransparentContainer.c
|
||||
set(libnrnas_ies_OBJS
|
||||
${NAS_SRC}COMMON/IES/ExtendedProtocolDiscriminator.c
|
||||
${NAS_SRC}COMMON/IES/FGSMobileIdentity.c
|
||||
${NAS_SRC}COMMON/IES/FGSRegistrationType.c
|
||||
${NAS_SRC}COMMON/IES/SpareHalfOctet.c
|
||||
${NAS_SRC}COMMON/IES/FGSRegistrationResult.c
|
||||
${NAS_SRC}COMMON/IES/FGMMCapability.c
|
||||
${NAS_SRC}COMMON/IES/NrUESecurityCapability.c
|
||||
${NAS_SRC}COMMON/IES/FGCNasMessageContainer.c
|
||||
${NAS_SRC}COMMON/IES/SORTransparentContainer.c
|
||||
)
|
||||
|
||||
add_library(LIB_NAS_SIMUE
|
||||
${NAS_SRC}UE/nas_itti_messaging.c
|
||||
${NAS_SRC}UE/nas_network.c
|
||||
${NAS_SRC}UE/nas_parser.c
|
||||
${NAS_SRC}UE/nas_proc.c
|
||||
${NAS_SRC}UE/nas_user.c
|
||||
${NAS_SRC}NR_UE/nr_nas_msg_sim.c
|
||||
${libnas_api_OBJS}
|
||||
${libnas_ue_api_OBJS}
|
||||
${libnas_emm_msg_OBJS}
|
||||
${libnas_esm_msg_OBJS}
|
||||
${libnas_ies_OBJS}
|
||||
${libnas_utils_OBJS}
|
||||
${libnas_ue_emm_OBJS}
|
||||
${libnas_ue_emm_sap_OBJS}
|
||||
${libnas_ue_esm_OBJS}
|
||||
${libnas_ue_esm_sap_OBJS}
|
||||
${libnrnas_emm_msg_OBJS}
|
||||
${libnrnas_ies_OBJS}
|
||||
add_library(LIB_NAS_SIMUE
|
||||
${NAS_SRC}UE/nas_itti_messaging.c
|
||||
${NAS_SRC}UE/nas_network.c
|
||||
${NAS_SRC}UE/nas_parser.c
|
||||
${NAS_SRC}UE/nas_proc.c
|
||||
${NAS_SRC}UE/nas_user.c
|
||||
${NAS_SRC}NR_UE/nr_nas_msg_sim.c
|
||||
${libnas_api_OBJS}
|
||||
${libnas_ue_api_OBJS}
|
||||
${libnas_emm_msg_OBJS}
|
||||
${libnas_esm_msg_OBJS}
|
||||
${libnas_ies_OBJS}
|
||||
${libnas_utils_OBJS}
|
||||
${libnas_ue_emm_OBJS}
|
||||
${libnas_ue_emm_sap_OBJS}
|
||||
${libnas_ue_esm_OBJS}
|
||||
${libnas_ue_esm_sap_OBJS}
|
||||
${libnrnas_emm_msg_OBJS}
|
||||
${libnrnas_ies_OBJS}
|
||||
)
|
||||
add_dependencies(LIB_NAS_SIMUE rrc_flag)
|
||||
set(NAS_SIM_LIB LIB_NAS_SIMUE)
|
||||
add_dependencies(LIB_NAS_SIMUE rrc_flag)
|
||||
set(NAS_SIM_LIB LIB_NAS_SIMUE)
|
||||
|
||||
add_library(LIB_NAS_UE
|
||||
${NAS_SRC}UE/nas_itti_messaging.c
|
||||
${NAS_SRC}UE/nas_network.c
|
||||
${NAS_SRC}UE/nas_parser.c
|
||||
${NAS_SRC}UE/nas_proc.c
|
||||
${NAS_SRC}UE/nas_user.c
|
||||
${libnas_api_OBJS}
|
||||
${libnas_ue_api_OBJS}
|
||||
${libnas_emm_msg_OBJS}
|
||||
${libnas_esm_msg_OBJS}
|
||||
${libnas_ies_OBJS}
|
||||
${libnas_utils_OBJS}
|
||||
${libnas_ue_emm_OBJS}
|
||||
${libnas_ue_emm_sap_OBJS}
|
||||
${libnas_ue_esm_OBJS}
|
||||
${libnas_ue_esm_sap_OBJS}
|
||||
add_library(LIB_NAS_UE
|
||||
${NAS_SRC}UE/nas_itti_messaging.c
|
||||
${NAS_SRC}UE/nas_network.c
|
||||
${NAS_SRC}UE/nas_parser.c
|
||||
${NAS_SRC}UE/nas_proc.c
|
||||
${NAS_SRC}UE/nas_user.c
|
||||
${libnas_api_OBJS}
|
||||
${libnas_ue_api_OBJS}
|
||||
${libnas_emm_msg_OBJS}
|
||||
${libnas_esm_msg_OBJS}
|
||||
${libnas_ies_OBJS}
|
||||
${libnas_utils_OBJS}
|
||||
${libnas_ue_emm_OBJS}
|
||||
${libnas_ue_emm_sap_OBJS}
|
||||
${libnas_ue_esm_OBJS}
|
||||
${libnas_ue_esm_sap_OBJS}
|
||||
)
|
||||
add_dependencies(LIB_NAS_UE rrc_flag)
|
||||
set(NAS_UE_LIB LIB_NAS_UE)
|
||||
add_dependencies(LIB_NAS_UE rrc_flag)
|
||||
set(NAS_UE_LIB LIB_NAS_UE)
|
||||
|
||||
|
||||
include_directories(${NAS_SRC}NR_UE)
|
||||
include_directories(${NAS_SRC}UE)
|
||||
include_directories(${NAS_SRC}UE/API/USER)
|
||||
include_directories(${NAS_SRC}UE/API/USIM)
|
||||
include_directories(${NAS_SRC}UE/EMM)
|
||||
include_directories(${NAS_SRC}UE/EMM/SAP)
|
||||
include_directories(${NAS_SRC}UE/ESM)
|
||||
include_directories(${NAS_SRC}UE/ESM/SAP)
|
||||
include_directories(${NAS_SRC}NR_UE)
|
||||
include_directories(${NAS_SRC}UE)
|
||||
include_directories(${NAS_SRC}UE/API/USER)
|
||||
include_directories(${NAS_SRC}UE/API/USIM)
|
||||
include_directories(${NAS_SRC}UE/EMM)
|
||||
include_directories(${NAS_SRC}UE/EMM/SAP)
|
||||
include_directories(${NAS_SRC}UE/ESM)
|
||||
include_directories(${NAS_SRC}UE/ESM/SAP)
|
||||
|
||||
# nbiot
|
||||
add_definitions("-DNUMBER_OF_UE_MAX_NB_IoT=16")
|
||||
set (NBIOT_SOURCES
|
||||
${OPENAIR2_DIR}/ENB_APP/NB_IoT_config.c
|
||||
)
|
||||
${OPENAIR2_DIR}/ENB_APP/NB_IoT_config.c
|
||||
)
|
||||
add_library(NB_IoT MODULE ${NBIOT_SOURCES} )
|
||||
|
||||
# shared library loader
|
||||
set (SHLIB_LOADER_SOURCES
|
||||
${OPENAIR_DIR}/common/utils/load_module_shlib.c
|
||||
)
|
||||
${OPENAIR_DIR}/common/utils/load_module_shlib.c
|
||||
)
|
||||
|
||||
add_library(LIB_5GNAS_GNB
|
||||
${NAS_SRC}/COMMON/nr_common.c
|
||||
${NAS_SRC}/gNB/network_process_nas.c
|
||||
${NAS_SRC}/NR_UE/ue_process_nas.c
|
||||
${OPENAIR3_DIR}//UICC/usim_interface.c
|
||||
)
|
||||
${NAS_SRC}/COMMON/nr_common.c
|
||||
${NAS_SRC}/gNB/network_process_nas.c
|
||||
${NAS_SRC}/NR_UE/ue_process_nas.c
|
||||
${OPENAIR3_DIR}//UICC/usim_interface.c
|
||||
)
|
||||
target_link_libraries(LIB_5GNAS_GNB SECU_CN ${CRYPTO_LIBRARIES})
|
||||
|
||||
# Make lfds as a own source code (even if it is a outside library)
|
||||
@@ -2866,10 +2839,9 @@ add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag oai_iqplayer)
|
||||
|
||||
target_link_libraries (lte-softmodem
|
||||
-Wl,--start-group
|
||||
|
||||
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
|
||||
PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB LFDS7
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
|
||||
@@ -2912,7 +2884,7 @@ target_link_libraries (ocp-enb
|
||||
|
||||
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
|
||||
PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
|
||||
-Wl,--end-group z dl)
|
||||
target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${LIB_LMS_LIBRARIES} ${T_LIB})
|
||||
|
||||
@@ -2927,7 +2899,7 @@ add_executable(cu_test
|
||||
)
|
||||
target_link_libraries(cu_test
|
||||
${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FSPT_MSG_LIB} ${PROTOBUF_LIB}
|
||||
${PROTO_AGENT_LIB} pthread UTIL ${T_LIB} dl ${ITTI_LIB}
|
||||
${PROTO_AGENT_LIB} pthread UTIL ${T_LIB} dl ITTI
|
||||
)
|
||||
|
||||
add_executable(du_test
|
||||
@@ -2941,7 +2913,7 @@ add_executable(du_test
|
||||
)
|
||||
target_link_libraries(du_test
|
||||
${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FSPT_MSG_LIB} ${PROTOBUF_LIB}
|
||||
${PROTO_AGENT_LIB} pthread UTIL ${T_LIB} dl ${ITTI_LIB}
|
||||
${PROTO_AGENT_LIB} pthread UTIL ${T_LIB} dl ITTI
|
||||
)
|
||||
|
||||
add_executable(oairu
|
||||
@@ -3009,7 +2981,7 @@ target_link_libraries (lte-uesoftmodem
|
||||
|
||||
NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
|
||||
PHY_UE PHY_RU LFDS L2_UE L2_LTE LFDS7 SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES}
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES}
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES})
|
||||
@@ -3054,7 +3026,7 @@ target_compile_definitions(nr-softmodem PUBLIC NEW_GTPU)
|
||||
target_link_libraries (nr-softmodem
|
||||
-Wl,--start-group
|
||||
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA
|
||||
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
|
||||
ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
|
||||
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB}
|
||||
-Wl,--end-group z dl)
|
||||
@@ -3093,7 +3065,7 @@ add_executable(ocp-gnb
|
||||
target_link_libraries (ocp-gnb
|
||||
-Wl,--start-group
|
||||
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA
|
||||
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
|
||||
ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
|
||||
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SIMU_COMMON
|
||||
-Wl,--end-group z dl)
|
||||
@@ -3139,9 +3111,9 @@ target_link_libraries (nr-uesoftmodem
|
||||
RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB
|
||||
PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU LFDS NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB
|
||||
NFAPI_USER_LIB MISC_NFAPI_NR_LIB S1AP_LIB S1AP_ENB
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
|
||||
NFAPI_USER_LIB S1AP_LIB S1AP_ENB
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB}
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB}
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES})
|
||||
@@ -3167,7 +3139,7 @@ add_executable(dlsim_tm4
|
||||
${T_SOURCE}
|
||||
)
|
||||
target_link_libraries (dlsim_tm4
|
||||
-Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB PHY LFDS ${ITTI_LIB} -Wl,--end-group
|
||||
-Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB PHY LFDS ITTI -Wl,--end-group
|
||||
pthread m rt ${CONFIG_LIB} ${ATLAS_LIBRARIES} ${T_LIB}
|
||||
)
|
||||
|
||||
@@ -3210,14 +3182,6 @@ target_link_libraries(smallblocktest
|
||||
m pthread ${ATLAS_LIBRARIES} dl
|
||||
)
|
||||
|
||||
|
||||
# temp_C_flag = CMAKE_C_FLAGS
|
||||
#set(CMAKE_C_FLAGS " ")
|
||||
set (TEMP_C_FLAG ${CMAKE_C_FLAGS})
|
||||
set (CMAKE_C_FLAGS ${CUDA_CMAKE_C_FLAGS})
|
||||
|
||||
set (TEMP_CXX_FLAG ${CMAKE_CXX_FLAGS})
|
||||
set (CMAKE_CXX_FLAGS ${CUDA_CMAKE_CXX_FLAGS})
|
||||
if (CUDA_FOUND)
|
||||
###################################################
|
||||
# For CUDA library
|
||||
@@ -3248,8 +3212,6 @@ else (CUDA_FOUND)
|
||||
)
|
||||
|
||||
endif ()
|
||||
set (CMAKE_C_FLAGS ${TEMP_C_FLAG})
|
||||
set (CMAKE_CXX_FLAGS ${TEMP_CXX_FLAG})
|
||||
|
||||
|
||||
# add_executable(ldpctest
|
||||
@@ -3277,7 +3239,7 @@ add_executable(nr_dlschsim
|
||||
)
|
||||
target_link_libraries(nr_dlschsim
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI dl
|
||||
)
|
||||
|
||||
add_executable(nr_pbchsim
|
||||
@@ -3292,7 +3254,7 @@ add_executable(nr_pbchsim
|
||||
)
|
||||
target_link_libraries(nr_pbchsim
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI dl
|
||||
)
|
||||
|
||||
#PUCCH ---> Prashanth
|
||||
@@ -3309,7 +3271,7 @@ add_executable(nr_pucchsim
|
||||
)
|
||||
target_link_libraries(nr_pucchsim
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI dl
|
||||
)
|
||||
|
||||
add_executable(nr_dlsim
|
||||
@@ -3328,7 +3290,7 @@ add_executable(nr_dlsim
|
||||
)
|
||||
target_link_libraries(nr_dlsim
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN NGAP_GNB -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} ${OPENSSL_LIBRARIES} dl
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl
|
||||
)
|
||||
target_compile_definitions(nr_dlsim PUBLIC -DPHYSICAL_SIMULATOR)
|
||||
|
||||
@@ -3347,7 +3309,7 @@ add_executable(nr_prachsim
|
||||
${SHLIB_LOADER_SOURCES})
|
||||
target_link_libraries(nr_prachsim
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN NGAP_GNB -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} ${OPENSSL_LIBRARIES} dl)
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl)
|
||||
|
||||
add_executable(nr_ulschsim
|
||||
${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulschsim.c
|
||||
@@ -3361,7 +3323,7 @@ add_executable(nr_ulschsim
|
||||
)
|
||||
target_link_libraries(nr_ulschsim
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI dl
|
||||
)
|
||||
|
||||
add_executable(nr_ulsim
|
||||
@@ -3380,7 +3342,7 @@ add_executable(nr_ulsim
|
||||
)
|
||||
target_link_libraries(nr_ulsim
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN NGAP_GNB -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} ${OPENSSL_LIBRARIES} dl
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl
|
||||
)
|
||||
target_compile_definitions(nr_ulsim PUBLIC -DPHYSICAL_SIMULATOR)
|
||||
|
||||
@@ -3402,7 +3364,7 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr
|
||||
${NFAPI_USER_DIR}/nfapi.c
|
||||
)
|
||||
target_link_libraries (${myExe}
|
||||
-Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_NR_COMMON PHY PHY_UE PHY_RU LFDS ${ITTI_LIB} LFDS7 -Wl,--end-group
|
||||
-Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_NR_COMMON PHY PHY_UE PHY_RU LFDS ITTI LFDS7 -Wl,--end-group
|
||||
pthread m rt ${CONFIG_LIB} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl
|
||||
)
|
||||
|
||||
@@ -3417,7 +3379,7 @@ add_executable(test_epc_generate_scenario
|
||||
${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h
|
||||
)
|
||||
target_link_libraries (test_epc_generate_scenario
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP NR_GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP NR_GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ITTI ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
|
||||
)
|
||||
|
||||
add_executable(test_epc_play_scenario
|
||||
@@ -3436,7 +3398,7 @@ add_executable(test_epc_play_scenario
|
||||
)
|
||||
target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
|
||||
target_link_libraries (test_epc_play_scenario
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP NR_GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP NR_GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
|
||||
)
|
||||
|
||||
|
||||
@@ -3538,7 +3500,7 @@ endfunction(make_driver name dir src)
|
||||
# nashmesh module
|
||||
################
|
||||
list(APPEND nasmesh_src device.c common.c ioctl.c classifier.c tool.c mesh.c)
|
||||
set(module_cc_opt "${module_cc_opt} -DNAS_NETLINK -DPDCP_USE_NETLINK -D${MKVER}")
|
||||
set(module_cc_opt "${module_cc_opt} -DNAS_NETLINK -DPDCP_USE_NETLINK")
|
||||
# legacy Makefile was using NAS_NETLINK flag, but other drivers the hereafter flag
|
||||
# so, this cmake use OAI_NW_DRIVER_USE_NETLINK everywhere
|
||||
if (OAI_NW_DRIVER_USE_NETLINK)
|
||||
@@ -3592,7 +3554,7 @@ target_compile_definitions(nr-ittisim PUBLIC NEW_GTPU)
|
||||
target_link_libraries (nr-ittisim
|
||||
-Wl,--start-group
|
||||
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA
|
||||
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB
|
||||
ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB
|
||||
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB}
|
||||
PHY_NR_UE SCHED_NR_UE_LIB NR_L2_UE
|
||||
|
||||
@@ -83,9 +83,14 @@ char *config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) {
|
||||
}
|
||||
|
||||
if (*ptr == NULL) {
|
||||
*ptr = malloc(length>40?length:40);
|
||||
// LTS: dummy fix, waiting Francois full fix in 4G branch
|
||||
// the issue is we don't know at this point the size we will get
|
||||
// for parmeters on the command line,
|
||||
// The length sould probably managed, in a later version
|
||||
// 100 is a very large value for a string parameter of today OAI
|
||||
if (length<100)
|
||||
length=100;
|
||||
*ptr = malloc(length);
|
||||
|
||||
if ( *ptr != NULL) {
|
||||
memset(*ptr,0,length);
|
||||
|
||||
@@ -196,6 +196,26 @@ uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int get_dmrs_port(int nl, uint16_t dmrs_ports) {
|
||||
|
||||
if (dmrs_ports == 0) return 0; // dci 1_0
|
||||
int p = -1;
|
||||
int found = -1;
|
||||
for (int i=0; i<12; i++) { // loop over dmrs ports
|
||||
if((dmrs_ports>>i)&0x01) { // check if current bit is 1
|
||||
found++;
|
||||
if (found == nl) { // found antenna port number corresponding to current layer
|
||||
p = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
AssertFatal(p>-1,"No dmrs port corresponding to layer %d found\n",nl);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
int get_subband_size(int NPRB,int size) {
|
||||
// implements table 5.2.1.4-2 from 36.214
|
||||
//
|
||||
|
||||
@@ -62,7 +62,7 @@ uint8_t nr_get_Qm(uint8_t Imcs, uint8_t table_idx);
|
||||
uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx);
|
||||
int get_subband_size(int NPRB,int size);
|
||||
void SLIV2SL(int SLIV,int *S,int *L);
|
||||
|
||||
int get_dmrs_port(int nl, uint16_t dmrs_ports);
|
||||
|
||||
#define CEILIDIV(a,b) ((a+b-1)/b)
|
||||
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
# global
|
||||
|
||||
xnf is pnf or vnf
|
||||
|
||||
The xnf starting functions are configure_nfapi_xnf()
|
||||
|
||||
The OAI code that read the configuration parameters call these functions that will create autonomous thread for xnf control part
|
||||
|
||||
These control threads create a SCTP socket by Linux API call (no use of OpenAir internal architecture with SCTP itti thread).
|
||||
|
||||
The main() function of softmodem has to create and start the other threads+loop on event for appropriate work: RF Rx in pnf, NGAP, GTP-U, X2, RLC, PDCP for vnf
|
||||
|
||||
NFAPI has it's own code directly on Linux+Posix, it doesn't reuse any piece of the OpenAir framework: SCTP thread, thread creation and management, ...
|
||||
|
||||
## signaling (P5) xnf main loop
|
||||
|
||||
nfapi_vnf_start() create the SCTP socket, then do event waiting in a infinite loop while(vnf->terminate == 0). It accepts the pnf connections, then process the messages on reception
|
||||
|
||||
nfapi_pnf_start() initiate connection to vnf until it has a link. Then it enter a similar infinite loop in pnf_message_pump()
|
||||
|
||||
After some checks, when a message is obtained, it calls pnf_handle_p5_message() or vnf_handle_p4_p5_message() that have a switch on each p5 message types: the enum nfapi_message_id_e
|
||||
|
||||
Each message type has it's own processing function in the switch, like
|
||||
```
|
||||
case NFAPI_START_RESPONSE:
|
||||
vnf_handle_start_response(pRecvMsg, recvMsgLen, config, p5_idx);
|
||||
break;
|
||||
```
|
||||
|
||||
These loops are autonomous in their thread waiting incoming message.
|
||||
|
||||
## P7 xnf main loop
|
||||
|
||||
When the p5 interface receives appropriate message, it starts the p7 interface by launching a thread (see the calls to pthread_create() in nfapi/oai_integration/nfapi_xnf.c)
|
||||
|
||||
The p7 main loops starting is a bit simpler, thanks to UDP non connected protocol. The xnf_dispatch_p7_message() do p7 fragments re-assembly, then
|
||||
calls xnf_dispatch_p7_message() that have the big switch on message type (as in p5 above description)
|
||||
|
||||
So, we have the logic for UL reception in vnf, and DL reception in pnf
|
||||
|
||||
## P7 UL transmission by PNF
|
||||
|
||||
RF samples are received, and decoding is done by the PNF using control data transmitted by the VNF to the PNF through downlink p7 messages (UL_TTI_req and UL_DCI_req).
|
||||
|
||||
After decoding, results are accumulated into the xNB->UL_INFO structure at the PNF.
|
||||
|
||||
The data in the UL_INFO struct is transmitted through a socket in the form of 'uplink indication functions' from the PNF to the VNF. Each uplink indication message is transmitted from their respective handle functions in NR_UL_indication(). For example,
|
||||
|
||||
```
|
||||
|
||||
void handle_nr_rach(NR_UL_IND_t *UL_info) {
|
||||
if(NFAPI_MODE == NFAPI_MODE_PNF) {
|
||||
if (UL_info->rach_ind.number_of_pdus>0) {
|
||||
oai_nfapi_nr_rach_indication(&UL_info->rach_ind); //This function calls the routines required for packing + transmission through socket
|
||||
UL_info->rach_ind.number_of_pdus = 0;
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## P7 UL reception at VNF
|
||||
|
||||
Through the infinite loop [while(vnf_p7->terminate == 0)] running in nfapi_nr_vnf_p7_start(), the VNF receives and unpacks the uplink indication message received on its socket. Based on the unpacked messages, UL_INFO struct on the VNF side gets populated.
|
||||
|
||||
```
|
||||
|
||||
// have a p7 message
|
||||
if(FD_ISSET(vnf_p7->socket, &rfds))
|
||||
{
|
||||
vnf_nr_p7_read_dispatch_message(vnf_p7);
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
vnf_nr_dispatch_p7_message() is the function that contains the switch on various message headers so that the appropriate unpack function is called.
|
||||
|
||||
## P7 DL Transmission by VNF
|
||||
|
||||
DL messages are scheduled at the VNF, through NR_UL_indication(). NR_UL_indication() is called when the SFN/slot in the UL_info structure changes (this acts as a trigger for next slot processing, instead of running a separate clock at the VNF). The SFN/slot at the VNF in UL_info is updated using the slot_indication uplink p7 message, which is sent at the beginning of every slot by the PNF. The slot_indication message contains SFN/slot of the TX_thread, so that the scheduler operates slot_ahead slots ahead of the RX thread. This ensures that UL_tti_req is received before RX slot processing at the PNF.
|
||||
|
||||
The function NR_schedule_response calls oai_nfapi_[DL P7 msg]_req(), which contains the routines for packing + transmission of scheduled messages through the socket to the PNF. For example, to send the 'TX_data_req' p7 message
|
||||
|
||||
```
|
||||
|
||||
if (Sched_INFO->TX_req->Number_of_PDUs > 0)
|
||||
{
|
||||
oai_nfapi_tx_data_req(Sched_INFO->TX_req);
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
```mermaid
|
||||
|
||||
graph TD
|
||||
pselect[VNF socket pselect] -- timed out : end of slot --> call_sched[Call Scheduler NR_UL_indication] -- oai_nfapi_***_req sends the DL p7 msg--> slot_inc[Increment sfn/slot];
|
||||
pselect[VNF socket pselect] -- UL p7 xyz msg recvd --> msg_recvd[Read message vnf_nr_p7_read_dispatch_message] --> header_unpack[Unpack Header] -- switch cases on header --> unpack_msg[Handle Message vnf_handle_nr_xyz] --> fill_ul_info[Fill UL info struct with fn pointer vnf_p7->_public.nr_rx_xyz];
|
||||
fill_ul_info -- update pselect_timeout: next_slot_start - time_xyz_msg_recvd-->pselect;
|
||||
slot_inc -- next slot --> pselect
|
||||
|
||||
```
|
||||
Note that since DL P7 message reception and TX/RX processing are done on separate threads, there is the issue of the L1 processing threads trying to do their job before the required P7 message is received. In the case of RX processing, since the scheduler operates slot_ahead slots ahead of the RX thread, the required messages conveniently arrive earlier than they are required. However, in the case of TX processing, this cannot be ensured if the scheduler is exactly in sync with the TX thread.
|
||||
|
||||
Therefore, we operate the VNF vnf_slot_ahead (which is currently 2) slots ahead of the PNF. This is to ensure that the DL fapi structures for a particular TX slot are all received before TX processing for that slot.
|
||||
|
||||
## P7 DL Reception at PNF
|
||||
|
||||
Through the infinite loop [while(pnf_p7->terminate == 0)] running in pnf_nr_p7_message_pump(), the PNF receives and unpacks the downlink P7 message received on its socket. Based on the unpacked message, the appropriate message structures are filled in the PNF, and these are used further down the pipeline for processing.
|
||||
|
||||
While receiving the DL P7 message, we check whether the message was received within a timing window from which it was sent. The duration of the window can be set by the user (set as a parameter for xnf in the p5 messages). Note that the DL information must be received by the PNF within a timing window at least lesser than the duration of slot_ahead variable (timing_window <= slot_ahead * slot_duration).
|
||||
|
||||
```mermaid
|
||||
|
||||
graph TB
|
||||
pselect[PNF socket pselect] -- timed out : end of slot --> slot_inc[Increment sfn/slot];
|
||||
pselect[PNF socket pselect] -- DL p7 xyz msg recvd --> msg_recvd[Read message pnf_nr_nfapi_p7_read_dispatch_message] --> header_unpack[Unpack Header] -- switch cases on header --> unpack_msg[Unpack Message pnf_handle_nr_xyz] --> fill_pnf_p7[Fill pnf_p7 global structure pnf_handle_nr_xyz] --Data from pnf_p7 struct copied to fapi structures using pnf_phy_***_req. Called every slot from handle_nr_slot_ind-->pselect;
|
||||
|
||||
slot_inc -- next slot --> pselect
|
||||
```
|
||||
Once the messages are received, they are filled into slot buffers, and are stored until the processing of the slot that they were meant for.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Procedure to run nFAPI in 5G NR
|
||||
|
||||
## Conributed by 5G Testbed IISc
|
||||
## Contributed by 5G Testbed IISc
|
||||
|
||||
### Developers: Mahesh K,Gokul S,Aniq U R, Sai Shruthi N, Sudhakar B
|
||||
### Developers: Gokul S, Mahesh A, Aniq U R
|
||||
|
||||
## Procedure to Build gNB and UE
|
||||
|
||||
@@ -34,11 +34,21 @@ sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfap
|
||||
sudo RFSIMULATOR=127.0.0.1 ./nr-uesoftmodem --rfsim --phy-test --rrc_config_path . -d
|
||||
|
||||
```
|
||||
## Procedure to run NR nFAPI using Hardware
|
||||
## Procedure to run NR nFAPI using Hardware (tested with USRP x310)
|
||||
|
||||
To be updated.
|
||||
### VNF command
|
||||
```
|
||||
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf --nfapi 2 --noS1 --phy-test
|
||||
|
||||
```
|
||||
### PNF command
|
||||
```
|
||||
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf --nfapi 1 --phy-test
|
||||
|
||||
```
|
||||
### UE command
|
||||
```
|
||||
sudo ./nr-uesoftmodem --usrp-args "addr=*USRP_ADDRESS*,clock_source=external,time_source=external" --phy-test --rrc_config_path ../../../ci-scripts/rrc-files
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
* If running for the first time on local branch, run in the following order - VNF then PNF. This is so that necessary files are generated for the UE to run. Stop this run (it's ok if it stops on its own due to an error). From every subsequent run follow the next bullet.
|
||||
* In order to achieve synchronization between the VNF and PNF, and receive P7 messages within the timing window, the order in which we should run the modules on different terminals is UE->VNF->PNF.
|
||||
* Currently downlink transmission from gNB to UE is partially functional and we are working on improving this. Uplink P7 messages are disabled and we will work on uplink integration after completing downlink.
|
||||
@@ -48,6 +48,7 @@ RUN yum update -y && \
|
||||
yum install -y --enablerepo="ubi-8-codeready-builder" \
|
||||
lksctp-tools \
|
||||
nettle \
|
||||
procps-ng \
|
||||
atlas \
|
||||
net-tools \
|
||||
iputils \
|
||||
|
||||
@@ -51,6 +51,7 @@ RUN apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
software-properties-common \
|
||||
procps \
|
||||
libsctp1 \
|
||||
libnettle6 \
|
||||
libblas3 \
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
FROM localhost/ran-build:latest AS gnb-build
|
||||
FROM ran-build:latest AS gnb-build
|
||||
|
||||
RUN rm -Rf /oai-ran
|
||||
WORKDIR /oai-ran
|
||||
@@ -37,11 +37,9 @@ RUN /bin/sh oaienv && \
|
||||
mkdir -p log && \
|
||||
./build_oai --gNB --ninja -w USRP --verbose-ci
|
||||
|
||||
#debug
|
||||
#RUN ldconfig -v
|
||||
#RUN ldd /oai-ran/targets/bin/nr-softmodem.Rel15
|
||||
#RUN ls -lst /oai-ran/targets/bin
|
||||
#RUN ls -lst /oai-ran/cmake_targets/ran_build/build/*.so
|
||||
RUN yum install -y python3-pip && \
|
||||
pip3 install --ignore-installed pyyaml && \
|
||||
python3 ./docker/scripts/generateTemplate.py ./docker/scripts/gnb_parameters.yaml
|
||||
|
||||
#start from scratch for target executable
|
||||
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-gnb
|
||||
@@ -49,6 +47,7 @@ FROM registry.access.redhat.com/ubi8/ubi:latest as oai-gnb
|
||||
RUN yum repolist --disablerepo=* && \
|
||||
yum update -y && \
|
||||
yum install -y --enablerepo="ubi-8-codeready-builder" \
|
||||
procps-ng \
|
||||
libXpm \
|
||||
libX11 \
|
||||
atlas \
|
||||
@@ -62,6 +61,7 @@ RUN yum repolist --disablerepo=* && \
|
||||
|
||||
WORKDIR /opt/oai-gnb/bin
|
||||
COPY --from=gnb-build /oai-ran/targets/bin/nr-softmodem.Rel15 .
|
||||
COPY --from=gnb-build /oai-ran/docker/scripts/gnb_entrypoint.sh entrypoint.sh
|
||||
|
||||
WORKDIR /usr/local/lib/
|
||||
COPY --from=gnb-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
|
||||
@@ -99,23 +99,10 @@ COPY --from=gnb-build /lib64/libboost_timer.so.1.66.0 /lib64
|
||||
COPY --from=gnb-build /usr/local/lib64/libuhd.so.4.0.0 /usr/local/lib64
|
||||
|
||||
RUN ldconfig
|
||||
#debug
|
||||
#RUN ldd /opt/oai-gnb/bin/nr-softmodem.Rel15
|
||||
#RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15
|
||||
#RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15
|
||||
#RUN ldd /usr/local/lib/librfsimulator.so.Rel15
|
||||
#RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15
|
||||
#RUN ldd /usr/local/lib/libcoding.so
|
||||
#RUN ldd /usr/local/lib/libparams_libconfig.so
|
||||
#RUN ldd /usr/local/lib/libdfts.so
|
||||
#RUN ldd /usr/local/lib/libldpc.so
|
||||
#RUN ldd /usr/local/lib/libldpc_optim.so
|
||||
#RUN ldd /usr/local/lib/libldpc_optim8seg.so
|
||||
#RUN ldd /usr/local/lib/libldpc_orig.so
|
||||
|
||||
# Copy the relevant configuration files for gNB
|
||||
WORKDIR /opt/oai-gnb/etc
|
||||
COPY --from=gnb-build /oai-ran/ci-scripts/conf_files/gnb.* .
|
||||
COPY --from=gnb-build /oai-ran/docker/etc .
|
||||
|
||||
WORKDIR /opt/oai-gnb
|
||||
#EXPOSE 2152/udp # S1U, GTP/UDP
|
||||
@@ -125,6 +112,5 @@ WORKDIR /opt/oai-gnb
|
||||
#EXPOSE 50000/udp # IF5 / ORI (control)
|
||||
#EXPOSE 50001/udp # IF5 / ECPRI (data)
|
||||
|
||||
#CMD ["/opt/oai-gnb/bin/nr-softmodem", "-O", "/opt/oai-gnb/etc/gnb.conf"]
|
||||
#ENTRYPOINT ["/opt/oai-gnb/bin/entrypoint.sh"]
|
||||
CMD ["sleep", "infinity"]
|
||||
ENTRYPOINT ["/opt/oai-gnb/bin/entrypoint.sh"]
|
||||
CMD ["/opt/oai-gnb/bin/nr-softmodem.Rel15", "-O", "/opt/oai-gnb/etc/gnb.conf"]
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
FROM ran-build:latest AS gnb-build
|
||||
FROM ran-build:latest AS gnb-build
|
||||
|
||||
RUN rm -Rf /oai-ran
|
||||
WORKDIR /oai-ran
|
||||
@@ -37,23 +37,22 @@ RUN /bin/sh oaienv && \
|
||||
mkdir -p log && \
|
||||
./build_oai --gNB --ninja -w USRP --verbose-ci
|
||||
|
||||
#debug
|
||||
RUN ldconfig -v
|
||||
RUN ldd /oai-ran/targets/bin/nr-softmodem.Rel15
|
||||
RUN ls -lst /oai-ran/targets/bin
|
||||
RUN ls -lst /oai-ran/cmake_targets/ran_build/build/*.so
|
||||
RUN apt-get install -y python3-pip && \
|
||||
pip3 install --ignore-installed pyyaml && \
|
||||
python3 ./docker/scripts/generateTemplate.py ./docker/scripts/gnb_parameters.yaml
|
||||
|
||||
#start from scratch for target executable
|
||||
FROM ubuntu:bionic as oai-gnb
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
RUN apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
software-properties-common \
|
||||
procps \
|
||||
libsctp1 \
|
||||
tzdata \
|
||||
libnettle6 \
|
||||
libblas3 \
|
||||
libatlas3-base \
|
||||
@@ -76,6 +75,7 @@ RUN apt-get update && \
|
||||
|
||||
WORKDIR /opt/oai-gnb/bin
|
||||
COPY --from=gnb-build /oai-ran/targets/bin/nr-softmodem.Rel15 .
|
||||
COPY --from=gnb-build /oai-ran/docker/scripts/gnb_entrypoint.sh entrypoint.sh
|
||||
|
||||
WORKDIR /usr/local/lib/
|
||||
COPY --from=gnb-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
|
||||
@@ -96,23 +96,10 @@ RUN /bin/bash -c "ln -s /usr/local/lib/librfsimulator.so.Rel15 /usr/local/lib/li
|
||||
COPY --from=gnb-build /usr/local/lib/libprotobuf-c.so.1 .
|
||||
|
||||
RUN ldconfig
|
||||
#debug
|
||||
#RUN ldd /opt/oai-gnb/bin/nr-softmodem.Rel15
|
||||
#RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15
|
||||
#RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15
|
||||
#RUN ldd /usr/local/lib/librfsimulator.so.Rel15
|
||||
#RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15
|
||||
#RUN ldd /usr/local/lib/libcoding.so
|
||||
#RUN ldd /usr/local/lib/libparams_libconfig.so
|
||||
#RUN ldd /usr/local/lib/libdfts.so
|
||||
#RUN ldd /usr/local/lib/libldpc.so
|
||||
#RUN ldd /usr/local/lib/libldpc_optim.so
|
||||
#RUN ldd /usr/local/lib/libldpc_optim8seg.so
|
||||
#RUN ldd /usr/local/lib/libldpc_orig.so
|
||||
|
||||
# Copy the relevant configuration files for gNB
|
||||
WORKDIR /opt/oai-gnb/etc
|
||||
COPY --from=gnb-build /oai-ran/ci-scripts/conf_files/gnb.* ./
|
||||
COPY --from=gnb-build /oai-ran/docker/etc .
|
||||
|
||||
WORKDIR /opt/oai-gnb
|
||||
#EXPOSE 2152/udp # S1U, GTP/UDP
|
||||
@@ -122,6 +109,5 @@ WORKDIR /opt/oai-gnb
|
||||
#EXPOSE 50000/udp # IF5 / ORI (control)
|
||||
#EXPOSE 50001/udp # IF5 / ECPRI (data)
|
||||
|
||||
#CMD ["/opt/oai-gnb/bin/nr-softmodem", "-O", "/opt/oai-gnb/etc/gnb.conf"]
|
||||
#ENTRYPOINT ["/opt/oai-gnb/bin/entrypoint.sh"]
|
||||
CMD ["sleep", "infinity"]
|
||||
ENTRYPOINT ["/opt/oai-gnb/bin/entrypoint.sh"]
|
||||
CMD ["/opt/oai-gnb/bin/nr-softmodem.Rel15", "-O", "/opt/oai-gnb/etc/gnb.conf"]
|
||||
|
||||
@@ -48,6 +48,7 @@ ENV TZ=Europe/Paris
|
||||
RUN yum update -y && \
|
||||
yum install -y --enablerepo="ubi-8-codeready-builder" \
|
||||
tzdata \
|
||||
procps-ng \
|
||||
atlas \
|
||||
net-tools \
|
||||
iputils \
|
||||
|
||||
@@ -50,6 +50,7 @@ RUN apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
tzdata \
|
||||
procps \
|
||||
software-properties-common \
|
||||
libblas3 \
|
||||
libatlas3-base \
|
||||
|
||||
@@ -48,6 +48,7 @@ FROM registry.access.redhat.com/ubi8/ubi:latest as oai-lte-ue
|
||||
RUN yum update -y && \
|
||||
yum install -y --enablerepo="ubi-8-codeready-builder" \
|
||||
lksctp-tools \
|
||||
procps-ng \
|
||||
nettle \
|
||||
atlas \
|
||||
iproute \
|
||||
|
||||
@@ -52,6 +52,7 @@ RUN apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
software-properties-common \
|
||||
procps \
|
||||
libsctp1 \
|
||||
libnettle6 \
|
||||
liblapacke \
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
FROM localhost/ran-build:latest AS nr-ue-build
|
||||
FROM ran-build:latest AS nr-ue-build
|
||||
|
||||
RUN rm -Rf /oai-ran
|
||||
WORKDIR /oai-ran
|
||||
@@ -37,18 +37,15 @@ RUN /bin/sh oaienv && \
|
||||
mkdir -p log && \
|
||||
./build_oai --nrUE --ninja -w USRP --verbose-ci
|
||||
|
||||
# debug
|
||||
#RUN ldconfig -v
|
||||
#RUN ldd /oai-ran/targets/bin/nr-uesoftmodem.Rel15
|
||||
#RUN ls -lst /oai-ran/targets/bin
|
||||
#RUN ls -lst /oai-ran/cmake_targets/ran_build/build/*.so
|
||||
|
||||
#start from scratch for target executable
|
||||
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-nr-ue
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
RUN yum update -y && \
|
||||
yum install -y --enablerepo="ubi-8-codeready-builder" \
|
||||
lksctp-tools \
|
||||
procps-ng \
|
||||
tzdata \
|
||||
nettle \
|
||||
net-tools \
|
||||
iputils \
|
||||
@@ -61,6 +58,10 @@ RUN yum update -y && \
|
||||
|
||||
WORKDIR /opt/oai-nr-ue/bin
|
||||
COPY --from=nr-ue-build /oai-ran/targets/bin/nr-uesoftmodem.Rel15 .
|
||||
COPY --from=nr-ue-build /oai-ran/docker/scripts/nr_ue_entrypoint.sh entrypoint.sh
|
||||
|
||||
WORKDIR /opt/oai-nr-ue/etc
|
||||
COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/nr-ue-sim.conf .
|
||||
|
||||
WORKDIR /usr/local/lib/
|
||||
COPY --from=nr-ue-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
|
||||
@@ -98,24 +99,11 @@ COPY --from=nr-ue-build /lib64/libboost_timer.so.1.66.0 /lib64
|
||||
COPY --from=nr-ue-build /usr/local/lib64/libuhd.so.4.0.0 /usr/local/lib64
|
||||
|
||||
RUN ldconfig
|
||||
#RUN ldd /opt/oai-nr-ue/bin/nr-uesoftmodem.Rel15
|
||||
#RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15
|
||||
#RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15
|
||||
#RUN ldd /usr/local/lib/librfsimulator.so.Rel15
|
||||
#RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15
|
||||
#RUN ldd /usr/local/lib/libcoding.so
|
||||
#RUN ldd /usr/local/lib/libparams_libconfig.so
|
||||
#RUN ldd /usr/local/lib/libdfts.so
|
||||
#RUN ldd /usr/local/lib/libldpc.so
|
||||
#RUN ldd /usr/local/lib/libldpc_optim.so
|
||||
#RUN ldd /usr/local/lib/libldpc_optim8seg.so
|
||||
#RUN ldd /usr/local/lib/libldpc_orig.so
|
||||
|
||||
# Copy the relevant configuration files for eNB
|
||||
WORKDIR /opt/oai-nr-ue/etc
|
||||
COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/ue.* .
|
||||
|
||||
WORKDIR /opt/oai-nr-ue
|
||||
#CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/enb.conf"]
|
||||
#ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"]
|
||||
CMD ["sleep", "infinity"]
|
||||
CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem.Rel15", "-O", "/opt/oai-nr-ue/etc/nr-ue-sim.conf"]
|
||||
ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"]
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
FROM ran-build:latest AS nr-ue-build
|
||||
FROM ran-build:latest AS nr-ue-build
|
||||
|
||||
RUN rm -Rf /oai-ran
|
||||
WORKDIR /oai-ran
|
||||
@@ -37,23 +37,18 @@ RUN /bin/sh oaienv && \
|
||||
mkdir -p log && \
|
||||
./build_oai --nrUE --ninja -w USRP --verbose-ci
|
||||
|
||||
# debug
|
||||
#RUN ldconfig -v
|
||||
#RUN ldd /oai-ran/targets/bin/nr-uesoftmodem.Rel15
|
||||
#RUN ls -lst /oai-ran/targets/bin
|
||||
#RUN ls -lst /oai-ran/cmake_targets/ran_build/build/*.so
|
||||
|
||||
#start from scratch for target executable
|
||||
FROM ubuntu:bionic as oai-nr-ue
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
RUN apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
software-properties-common \
|
||||
libsctp1 \
|
||||
procps \
|
||||
tzdata \
|
||||
libnettle6 \
|
||||
liblapacke \
|
||||
libatlas3-base \
|
||||
@@ -62,6 +57,7 @@ RUN apt-get update && \
|
||||
net-tools \
|
||||
iputils-ping \
|
||||
iproute2 \
|
||||
iperf \
|
||||
libyaml-0-2 && \
|
||||
# Install UHD driver from ettus ppa
|
||||
# At time of writing, it is 3.14
|
||||
@@ -76,6 +72,10 @@ RUN apt-get update && \
|
||||
|
||||
WORKDIR /opt/oai-nr-ue/bin
|
||||
COPY --from=nr-ue-build /oai-ran/targets/bin/nr-uesoftmodem.Rel15 .
|
||||
COPY --from=nr-ue-build /oai-ran/docker/scripts/nr_ue_entrypoint.sh entrypoint.sh
|
||||
|
||||
WORKDIR /opt/oai-nr-ue/etc
|
||||
COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/nr-ue-sim.conf .
|
||||
|
||||
WORKDIR /usr/local/lib/
|
||||
COPY --from=nr-ue-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
|
||||
@@ -96,25 +96,7 @@ RUN /bin/bash -c "ln -s /usr/local/lib/librfsimulator.so.Rel15 /usr/local/lib/li
|
||||
COPY --from=nr-ue-build /usr/local/lib/libprotobuf-c.so.1 .
|
||||
|
||||
RUN ldconfig
|
||||
#debug
|
||||
#RUN ldd /opt/oai-nr-ue/bin/nr-uesoftmodem.Rel15
|
||||
#RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15
|
||||
#RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15
|
||||
#RUN ldd /usr/local/lib/librfsimulator.so.Rel15
|
||||
#RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15
|
||||
#RUN ldd /usr/local/lib/libcoding.so
|
||||
#RUN ldd /usr/local/lib/libparams_libconfig.so
|
||||
#RUN ldd /usr/local/lib/libdfts.so
|
||||
#RUN ldd /usr/local/lib/libldpc.so
|
||||
#RUN ldd /usr/local/lib/libldpc_optim.so
|
||||
#RUN ldd /usr/local/lib/libldpc_optim8seg.so
|
||||
#RUN ldd /usr/local/lib/libldpc_orig.so
|
||||
|
||||
# Copy the relevant configuration files for eNB
|
||||
WORKDIR /opt/oai-nr-ue/etc
|
||||
COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/ue.* .
|
||||
|
||||
WORKDIR /opt/oai-nr-ue
|
||||
#CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/enb.conf"]
|
||||
#ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"]
|
||||
CMD ["sleep", "infinity"]
|
||||
CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem.Rel15", "-O", "/opt/oai-nr-ue/etc/nr-ue-sim.conf"]
|
||||
ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"]
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
FROM localhost/ran-build:develop AS phy-sim-build
|
||||
FROM ran-build:develop AS phy-sim-build
|
||||
|
||||
RUN rm -Rf /oai-ran
|
||||
WORKDIR /oai-ran
|
||||
|
||||
@@ -44,8 +44,11 @@ RUN rm -f /etc/rhsm-host && \
|
||||
file \
|
||||
psmisc \
|
||||
git \
|
||||
# python3-pip and pyyaml are used for conf template generation
|
||||
python3-pip
|
||||
#unzip is needed for protobuf
|
||||
unzip && \
|
||||
pip3 install --ignore-installed pyyaml && \
|
||||
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
|
||||
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
|
||||
|
||||
|
||||
@@ -42,7 +42,10 @@ RUN apt-get update && \
|
||||
git \
|
||||
xxd \
|
||||
#unzip is needed for protobuf
|
||||
unzip
|
||||
unzip \
|
||||
# python3-pip for conf template generation
|
||||
python3-pip && \
|
||||
pip3 install --ignore-installed pyyaml
|
||||
|
||||
# In some network environments, GIT proxy is required
|
||||
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
|
||||
@@ -56,4 +59,3 @@ RUN /bin/sh oaienv && \
|
||||
cd cmake_targets && \
|
||||
mkdir -p log && \
|
||||
./build_oai -I -w USRP
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ set -euo pipefail
|
||||
|
||||
PREFIX=/opt/oai-enb
|
||||
RRC_INACTIVITY_THRESHOLD=${RRC_INACTIVITY_THRESHOLD:-0}
|
||||
ENABLE_MEASUREMENT_REPORTS=${ENABLE_MEASUREMENT_REPORTS:-no}
|
||||
ENABLE_X2=${ENABLE_X2:-no}
|
||||
|
||||
# Based another env var, pick one template to use
|
||||
if [[ -v USE_FDD_CU ]]; then ln -s $PREFIX/etc/cu.fdd.conf $PREFIX/etc/enb.conf; fi
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
- key: bands
|
||||
env: "@UTRA_BAND_ID@"
|
||||
|
||||
- filePrefix: enb.band7.tm1.25PRB.usrpb210
|
||||
- filePrefix: enb.band7.tm1.fr1.25PRB.usrpb210.conf
|
||||
outputfilename: "enb.fdd.conf"
|
||||
config:
|
||||
- key: Active_eNBs
|
||||
@@ -147,6 +147,10 @@
|
||||
env: "@NID_CELL@"
|
||||
- key: N_RB_DL
|
||||
env: "@NB_PRB@"
|
||||
- key: enable_measurement_reports
|
||||
env: "@ENABLE_MEASUREMENT_REPORTS@"
|
||||
- key: enable_x2
|
||||
env: "@ENABLE_X2@"
|
||||
- key: ipv4
|
||||
env: "@MME_S1C_IP_ADDRESS@"
|
||||
- key: ENB_INTERFACE_NAME_FOR_S1_MME
|
||||
|
||||
@@ -48,18 +48,20 @@ def main():
|
||||
"du.band7.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"rru.fdd": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"rru.tdd": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"enb.band7.tm1.25PRB.usrpb210": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"enb.band7.tm1.fr1.25PRB.usrpb210.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"enb.band40.tm1.25PRB.FairScheduler.usrpb210": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"rcc.band7.tm1.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"rcc.band7.tm1.if4p5.lo.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"rcc.band40.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"gnb.band78.tm1.fr1.106PRB.usrpb210.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"gnb.band78.sa.fr1.106PRB.usrpn310.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"ue.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"ue_sim_ci": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}'
|
||||
}
|
||||
print('inputfile = ' + inputfile)
|
||||
if filePrefix in prefix_outputfile:
|
||||
outputfile1 = prefix_outputfile[filePrefix]
|
||||
|
||||
|
||||
directory = f'{data[0]["paths"]["dest_dir"]}'
|
||||
if not os.path.exists(directory):
|
||||
os.makedirs(directory, exist_ok=True)
|
||||
@@ -71,11 +73,21 @@ def main():
|
||||
if re.search(r'EHPLMN_LIST', line):
|
||||
outputfile.write(line)
|
||||
continue
|
||||
if re.search(r'sd = 0x1;', line):
|
||||
templine = re.sub(r'sd = 0x1;', 'sd = 0x@NSSAI_SD0@;', line)
|
||||
outputfile.write(templine)
|
||||
continue
|
||||
if re.search(r'sd = 0x112233;', line):
|
||||
templine = re.sub(r'sd = 0x112233;', 'sd = 0x@NSSAI_SD1@;', line)
|
||||
outputfile.write(templine)
|
||||
continue
|
||||
for key in config["config"]:
|
||||
if line.find(key["key"]) >= 0:
|
||||
count += 1
|
||||
if re.search(r'preference', line):
|
||||
templine = line
|
||||
elif re.search(r'mnc_length', line) and key["key"] == "mnc":
|
||||
continue
|
||||
elif re.search(r'plmn_list', line):
|
||||
templine = re.sub(r'[0-9]+', '""', line)
|
||||
templine = re.sub(r'\"\"', key["env"]["mcc"], templine, 1)
|
||||
|
||||
Executable
+63
@@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
PREFIX=/opt/oai-gnb
|
||||
ENABLE_X2=${ENABLE_X2:-yes}
|
||||
|
||||
# Based another env var, pick one template to use
|
||||
if [[ -v USE_NSA_TDD_MONO ]]; then ln -s $PREFIX/etc/gnb.nsa.tdd.conf $PREFIX/etc/gnb.conf; fi
|
||||
if [[ -v USE_SA_TDD_MONO ]]; then ln -s $PREFIX/etc/gnb.sa.tdd.conf $PREFIX/etc/gnb.conf; fi
|
||||
|
||||
# Only this template will be manipulated
|
||||
CONFIG_FILES=`ls $PREFIX/etc/gnb.conf || true`
|
||||
|
||||
for c in ${CONFIG_FILES}; do
|
||||
# grep variable names (format: ${VAR}) from template to be rendered
|
||||
VARS=$(grep -oP '@[a-zA-Z0-9_]+@' ${c} | sort | uniq | xargs)
|
||||
|
||||
# create sed expressions for substituting each occurrence of ${VAR}
|
||||
# with the value of the environment variable "VAR"
|
||||
EXPRESSIONS=""
|
||||
for v in ${VARS}; do
|
||||
NEW_VAR=`echo $v | sed -e "s#@##g"`
|
||||
if [[ "${!NEW_VAR}x" == "x" ]]; then
|
||||
echo "Error: Environment variable '${NEW_VAR}' is not set." \
|
||||
"Config file '$(basename $c)' requires all of $VARS."
|
||||
exit 1
|
||||
fi
|
||||
EXPRESSIONS="${EXPRESSIONS};s|${v}|${!NEW_VAR}|g"
|
||||
done
|
||||
EXPRESSIONS="${EXPRESSIONS#';'}"
|
||||
|
||||
# render template and inline replace config file
|
||||
sed -i "${EXPRESSIONS}" ${c}
|
||||
done
|
||||
|
||||
# Load the USRP binaries
|
||||
if [[ -v USE_B2XX ]]; then
|
||||
/usr/lib/uhd/utils/uhd_images_downloader.py -t b2xx
|
||||
elif [[ -v USE_X3XX ]]; then
|
||||
/usr/lib/uhd/utils/uhd_images_downloader.py -t x3xx
|
||||
elif [[ -v USE_N3XX ]]; then
|
||||
/usr/lib/uhd/utils/uhd_images_downloader.py -t n3xx
|
||||
fi
|
||||
|
||||
echo "=================================="
|
||||
echo "== Starting gNB soft modem"
|
||||
if [[ -v USE_ADDITIONAL_OPTIONS ]]; then
|
||||
echo "Additional option(s): ${USE_ADDITIONAL_OPTIONS}"
|
||||
new_args=()
|
||||
while [[ $# -gt 0 ]]; do
|
||||
new_args+=("$1")
|
||||
shift
|
||||
done
|
||||
for word in ${USE_ADDITIONAL_OPTIONS}; do
|
||||
new_args+=("$word")
|
||||
done
|
||||
echo "${new_args[@]}"
|
||||
exec "${new_args[@]}"
|
||||
else
|
||||
echo "$@"
|
||||
exec "$@"
|
||||
fi
|
||||
@@ -0,0 +1,92 @@
|
||||
#/*
|
||||
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
# * contributor license agreements. See the NOTICE file distributed with
|
||||
# * this work for additional information regarding copyright ownership.
|
||||
# * The OpenAirInterface Software Alliance licenses this file to You under
|
||||
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
# * http://www.openairinterface.org/?page_id=698
|
||||
# *
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# * See the License for the specific language governing permissions and
|
||||
# * limitations under the License.
|
||||
# *-------------------------------------------------------------------------------
|
||||
# * For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
# * contact@openairinterface.org
|
||||
# */
|
||||
|
||||
---
|
||||
- paths:
|
||||
source_dir: "ci-scripts/conf_files/"
|
||||
dest_dir: docker/etc
|
||||
|
||||
- configurations:
|
||||
- filePrefix: gnb.band78.tm1.fr1.106PRB.usrpb210.conf
|
||||
outputfilename: "gnb.nsa.tdd.conf"
|
||||
config:
|
||||
- key: Active_gNBs
|
||||
env: "@GNB_NAME@"
|
||||
- key: gNB_name
|
||||
env: "@GNB_NAME@"
|
||||
- key: plmn_list
|
||||
env:
|
||||
mcc: "@MCC@"
|
||||
mnc: "@MNC@"
|
||||
mnc_length: "@MNC_LENGTH@"
|
||||
- key: tracking_area_code
|
||||
env: "@TAC@"
|
||||
- key: enable_x2
|
||||
env: "@ENABLE_X2@"
|
||||
- key: ipv4
|
||||
env: "@ENB_X2_IP_ADDRESS@"
|
||||
- key: GNB_INTERFACE_NAME_FOR_S1_MME
|
||||
env: "@GNB_S1C_IF_NAME@"
|
||||
- key: GNB_IPV4_ADDRESS_FOR_S1_MME
|
||||
env: "@GNB_S1C_IP_ADDRESS@"
|
||||
- key: GNB_INTERFACE_NAME_FOR_S1U
|
||||
env: "@GNB_S1U_IF_NAME@"
|
||||
- key: GNB_IPV4_ADDRESS_FOR_S1U
|
||||
env: "@GNB_S1U_IP_ADDRESS@"
|
||||
- key: GNB_IPV4_ADDRESS_FOR_X2C
|
||||
env: "@GNB_X2_IP_ADDRESS@"
|
||||
- key: rrc_inactivity_threshold
|
||||
env: "@RRC_INACTIVITY_THRESHOLD@"
|
||||
- key: FLEXRAN_ENABLED
|
||||
env: "@FLEXRAN_ENABLED@"
|
||||
- key: FLEXRAN_INTERFACE_NAME
|
||||
env: "@FLEXRAN_INTERFACE_NAME@"
|
||||
- key: FLEXRAN_IPV4_ADDRESS
|
||||
env: "@FLEXRAN_IPV4_ADDRESS@"
|
||||
|
||||
- filePrefix: gnb.band78.sa.fr1.106PRB.usrpn310.conf
|
||||
outputfilename: "gnb.sa.tdd.conf"
|
||||
config:
|
||||
- key: Active_gNBs
|
||||
env: "@GNB_NAME@"
|
||||
- key: gNB_name
|
||||
env: "@GNB_NAME@"
|
||||
- key: mcc
|
||||
env: "@MCC@"
|
||||
- key: mnc
|
||||
env: "@MNC@"
|
||||
- key: mnc_length
|
||||
env: "@MNC_LENGTH@"
|
||||
- key: tracking_area_code
|
||||
env: "@TAC@"
|
||||
- key: sst
|
||||
env: "@NSSAI_SST@"
|
||||
- key: ipv4
|
||||
env: "@AMF_IP_ADDRESS@"
|
||||
- key: GNB_INTERFACE_NAME_FOR_NG_AMF
|
||||
env: "@GNB_NGA_IF_NAME@"
|
||||
- key: GNB_IPV4_ADDRESS_FOR_NG_AMF
|
||||
env: "@GNB_NGA_IP_ADDRESS@"
|
||||
- key: GNB_INTERFACE_NAME_FOR_NGU
|
||||
env: "@GNB_NGU_IF_NAME@"
|
||||
- key: GNB_IPV4_ADDRESS_FOR_NGU
|
||||
env: "@GNB_NGU_IP_ADDRESS@"
|
||||
|
||||
Executable
+63
@@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
PREFIX=/opt/oai-nr-ue
|
||||
|
||||
# Based another env var, pick one template to use
|
||||
#if [[ -v USE_NFAPI ]]; then ln -s $PREFIX/etc/ue.nfapi.conf $PREFIX/etc/ue.conf; fi
|
||||
|
||||
# Only this template will be manipulated and the USIM one!
|
||||
CONFIG_FILES=`ls $PREFIX/etc/ue.conf $PREFIX/etc/nr-ue-sim.conf || true`
|
||||
|
||||
for c in ${CONFIG_FILES}; do
|
||||
# grep variable names (format: ${VAR}) from template to be rendered
|
||||
VARS=$(grep -oP '@[a-zA-Z0-9_]+@' ${c} | sort | uniq | xargs)
|
||||
|
||||
# create sed expressions for substituting each occurrence of ${VAR}
|
||||
# with the value of the environment variable "VAR"
|
||||
EXPRESSIONS=""
|
||||
for v in ${VARS}; do
|
||||
NEW_VAR=`echo $v | sed -e "s#@##g"`
|
||||
if [[ "${!NEW_VAR}x" == "x" ]]; then
|
||||
echo "Error: Environment variable '${NEW_VAR}' is not set." \
|
||||
"Config file '$(basename $c)' requires all of $VARS."
|
||||
exit 1
|
||||
fi
|
||||
EXPRESSIONS="${EXPRESSIONS};s|${v}|${!NEW_VAR}|g"
|
||||
done
|
||||
EXPRESSIONS="${EXPRESSIONS#';'}"
|
||||
|
||||
# render template and inline replace config file
|
||||
sed -i "${EXPRESSIONS}" ${c}
|
||||
done
|
||||
|
||||
# Load the USRP binaries
|
||||
if [[ -v USE_B2XX ]]; then
|
||||
/usr/lib/uhd/utils/uhd_images_downloader.py -t b2xx
|
||||
elif [[ -v USE_X3XX ]]; then
|
||||
/usr/lib/uhd/utils/uhd_images_downloader.py -t x3xx
|
||||
elif [[ -v USE_N3XX ]]; then
|
||||
/usr/lib/uhd/utils/uhd_images_downloader.py -t n3xx
|
||||
fi
|
||||
|
||||
# in case we have conf file, append
|
||||
new_args=()
|
||||
while [[ $# -gt 0 ]]; do
|
||||
new_args+=("$1")
|
||||
shift
|
||||
done
|
||||
|
||||
echo "=================================="
|
||||
echo "== Starting NR UE soft modem"
|
||||
if [[ -v USE_ADDITIONAL_OPTIONS ]]; then
|
||||
echo "Additional option(s): ${USE_ADDITIONAL_OPTIONS}"
|
||||
for word in ${USE_ADDITIONAL_OPTIONS}; do
|
||||
new_args+=("$word")
|
||||
done
|
||||
echo "${new_args[@]}"
|
||||
exec "${new_args[@]}"
|
||||
else
|
||||
echo "${new_args[@]}"
|
||||
exec "${new_args[@]}"
|
||||
fi
|
||||
@@ -146,15 +146,12 @@ void rx_func(void *param) {
|
||||
start_meas(&softmodem_stats_rxtx_sf);
|
||||
|
||||
// *******************************************************************
|
||||
// NFAPI not yet supported for NR - this code has to be revised
|
||||
|
||||
if (NFAPI_MODE == NFAPI_MODE_PNF) {
|
||||
// I am a PNF and I need to let nFAPI know that we have a (sub)frame tick
|
||||
//add_subframe(&frame, &subframe, 4);
|
||||
//oai_subframe_ind(proc->frame_tx, proc->subframe_tx);
|
||||
//LOG_D(PHY, "oai_subframe_ind(frame:%u, subframe:%d) - NOT CALLED ********\n", frame, subframe);
|
||||
//LOG_D(PHY, "oai_nfapi_slot_ind(frame:%u, slot:%d) ********\n", frame_rx, slot_rx);
|
||||
start_meas(&nfapi_meas);
|
||||
// oai_subframe_ind(frame_rx, slot_rx);
|
||||
oai_slot_ind(frame_rx, slot_rx);
|
||||
handle_nr_slot_ind(frame_rx, slot_rx);
|
||||
stop_meas(&nfapi_meas);
|
||||
|
||||
/*if (gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus||
|
||||
@@ -476,6 +473,8 @@ void init_eNB_afterRU(void) {
|
||||
PHY_VARS_gNB *gNB;
|
||||
LOG_I(PHY,"%s() RC.nb_nr_inst:%d\n", __FUNCTION__, RC.nb_nr_inst);
|
||||
|
||||
if(NFAPI_MODE == NFAPI_MODE_PNF)
|
||||
RC.nb_nr_inst = 1;
|
||||
for (inst=0; inst<RC.nb_nr_inst; inst++) {
|
||||
LOG_I(PHY,"RC.nb_nr_CC[inst:%d]:%p\n", inst, RC.gNB[inst]);
|
||||
gNB = RC.gNB[inst];
|
||||
|
||||
+237
-249
@@ -115,8 +115,7 @@ extern int numerology;
|
||||
|
||||
extern void wait_gNBs(void);
|
||||
|
||||
int attach_rru(RU_t *ru)
|
||||
{
|
||||
int attach_rru(RU_t *ru) {
|
||||
ssize_t msg_len,len;
|
||||
RRU_CONFIG_msg_t rru_config_msg;
|
||||
int received_capabilities=0;
|
||||
@@ -184,8 +183,7 @@ int attach_rru(RU_t *ru)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int connect_rau(RU_t *ru)
|
||||
{
|
||||
int connect_rau(RU_t *ru) {
|
||||
RRU_CONFIG_msg_t rru_config_msg;
|
||||
ssize_t msg_len;
|
||||
int tick_received = 0;
|
||||
@@ -282,22 +280,20 @@ int connect_rau(RU_t *ru)
|
||||
/* Southbound Fronthaul functions, RCC/RAU */
|
||||
|
||||
// southbound IF5 fronthaul for 16-bit OAI format
|
||||
void fh_if5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp)
|
||||
{
|
||||
void fh_if5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp) {
|
||||
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
|
||||
|
||||
send_IF5(ru, timestamp, slot, &ru->seqno, IF5_RRH_GW_DL);
|
||||
}
|
||||
|
||||
// southbound IF4p5 fronthaul
|
||||
void fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp)
|
||||
{
|
||||
void fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp) {
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
||||
|
||||
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
|
||||
|
||||
LOG_D(PHY,"Sending IF4p5 for frame %d subframe %d\n",ru->proc.frame_tx,ru->proc.tti_tx);
|
||||
|
||||
|
||||
if ((nr_slot_select(cfg,ru->proc.frame_tx,ru->proc.tti_tx)&NR_DOWNLINK_SLOT) > 0)
|
||||
send_IF4p5(ru,frame, slot, IF4p5_PDLFFT);
|
||||
}
|
||||
@@ -308,8 +304,7 @@ void fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp)
|
||||
// Synchronous if5 from south
|
||||
void fh_if5_south_in(RU_t *ru,
|
||||
int *frame,
|
||||
int *tti)
|
||||
{
|
||||
int *tti) {
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
recv_IF5(ru, &proc->timestamp_rx, *tti, IF5_RRH_GW_UL);
|
||||
@@ -339,8 +334,7 @@ void fh_if5_south_in(RU_t *ru,
|
||||
// Synchronous if4p5 from south
|
||||
void fh_if4p5_south_in(RU_t *ru,
|
||||
int *frame,
|
||||
int *slot)
|
||||
{
|
||||
int *slot) {
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
int f,sl;
|
||||
@@ -637,7 +631,6 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
||||
ru->nb_rx);
|
||||
}
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
|
||||
proc->timestamp_rx = ts-ru->ts_offset;
|
||||
|
||||
@@ -650,6 +643,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
||||
proc->timestamp_rx = 0;
|
||||
} else {
|
||||
samples_per_slot_prev = fp->get_samples_per_slot((*slot-1)%fp->slots_per_frame,fp);
|
||||
|
||||
if (proc->timestamp_rx - old_ts != samples_per_slot_prev) {
|
||||
LOG_D(PHY,"rx_rf: rfdevice timing drift of %"PRId64" samples (ts_off %"PRId64")\n",proc->timestamp_rx - old_ts - samples_per_slot_prev,ru->ts_offset);
|
||||
ru->ts_offset += (proc->timestamp_rx - old_ts - samples_per_slot_prev);
|
||||
@@ -679,7 +673,8 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
||||
}
|
||||
|
||||
if (proc->frame_rx != *frame) {
|
||||
LOG_E(PHY,"Received Timestamp (%llu) doesn't correspond to the time we think it is (proc->frame_rx %d frame %d, proc->tti_rx %d, slot %d)\n",(long long unsigned int)proc->timestamp_rx,proc->frame_rx,*frame,proc->tti_rx,*slot);
|
||||
LOG_E(PHY,"Received Timestamp (%llu) doesn't correspond to the time we think it is (proc->frame_rx %d frame %d, proc->tti_rx %d, slot %d)\n",(long long unsigned int)proc->timestamp_rx,proc->frame_rx,
|
||||
*frame,proc->tti_rx,*slot);
|
||||
exit_fun("Exiting");
|
||||
}
|
||||
} else {
|
||||
@@ -707,7 +702,6 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
int i,txsymb;
|
||||
T(T_ENB_PHY_OUTPUT_SIGNAL, T_INT(0), T_INT(0), T_INT(frame), T_INT(slot),
|
||||
T_INT(0), T_BUFFER(&ru->common.txdata[0][fp->get_samples_slot_timestamp(slot,fp,0)], fp->samples_per_subframe * 4));
|
||||
|
||||
int slot_type = nr_slot_select(cfg,frame,slot%fp->slots_per_frame);
|
||||
int prevslot_type = nr_slot_select(cfg,frame,(slot+(fp->slots_per_frame-1))%fp->slots_per_frame);
|
||||
int nextslot_type = nr_slot_select(cfg,frame,(slot+1)%fp->slots_per_frame);
|
||||
@@ -717,20 +711,23 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
|
||||
//nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame);
|
||||
if (slot_type == NR_DOWNLINK_SLOT || slot_type == NR_MIXED_SLOT || IS_SOFTMODEM_RFSIM) {
|
||||
|
||||
if (cfg->cell_config.frame_duplex_type.value == TDD){
|
||||
if (cfg->cell_config.frame_duplex_type.value == TDD) {
|
||||
if(slot_type == NR_MIXED_SLOT) {
|
||||
txsymb = 0;
|
||||
|
||||
for(int symbol_count = 0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
if (cfg->tdd_table.max_tdd_periodicity_list[slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value == 0)
|
||||
txsymb++;
|
||||
}
|
||||
|
||||
AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb);
|
||||
|
||||
if(slot%(fp->slots_per_subframe/2))
|
||||
siglen = txsymb * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
|
||||
else
|
||||
siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
|
||||
//+ ru->end_of_burst_delay;
|
||||
|
||||
//+ ru->end_of_burst_delay;
|
||||
flags = 3; // end of burst
|
||||
}
|
||||
|
||||
@@ -746,11 +743,13 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
// bit 11 enables the gpio programming
|
||||
// currently we switch beams every 10 slots (should = 1 TDD period in FR2) and we take the beam index of the first symbol of the first slot of this period
|
||||
int beam=0;
|
||||
|
||||
if (slot%10==0) {
|
||||
if ( ru->common.beam_id && (ru->common.beam_id[0][slot*fp->symbols_per_slot] < 8)) {
|
||||
beam = ru->common.beam_id[0][slot*fp->symbols_per_slot] | 8;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if (slot==0 || slot==40) beam=0|8;
|
||||
if (slot==10 || slot==50) beam=1|8;
|
||||
@@ -758,30 +757,29 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
if (slot==30 || slot==70) beam=3|8;
|
||||
*/
|
||||
flags |= beam<<8;
|
||||
|
||||
LOG_D(HW,"slot %d, beam %d\n",slot,ru->common.beam_id[0][slot*fp->symbols_per_slot]);
|
||||
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_WRITE_FLAGS, flags );
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_WRITE_FLAGS, flags );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, frame );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_TX0_RU, slot );
|
||||
|
||||
for (i=0; i<ru->nb_tx; i++)
|
||||
txp[i] = (void *)&ru->common.txdata[i][fp->get_samples_slot_timestamp(slot,fp,0)-sf_extension];
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp-ru->openair0_cfg.tx_sample_advance)&0xffffffff );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
|
||||
// prepare tx buffer pointers
|
||||
txs = ru->rfdevice.trx_write_func(&ru->rfdevice,
|
||||
timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension,
|
||||
txp,
|
||||
siglen+sf_extension,
|
||||
ru->nb_tx,
|
||||
flags);
|
||||
LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, slot %di, returned %d\n",ru->idx,
|
||||
(long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot, txs);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
|
||||
//AssertFatal(txs == 0,"trx write function error %d\n", txs);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp-ru->openair0_cfg.tx_sample_advance)&0xffffffff );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
|
||||
// prepare tx buffer pointers
|
||||
txs = ru->rfdevice.trx_write_func(&ru->rfdevice,
|
||||
timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension,
|
||||
txp,
|
||||
siglen+sf_extension,
|
||||
ru->nb_tx,
|
||||
flags);
|
||||
LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, slot %di, returned %d\n",ru->idx,
|
||||
(long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot, txs);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
|
||||
//AssertFatal(txs == 0,"trx write function error %d\n", txs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -796,78 +794,83 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
|
||||
|
||||
if (mu == NR_MU_0) {
|
||||
switch(N_RB) {
|
||||
case 270:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=92.16e6;
|
||||
cfg->samples_per_frame = 921600;
|
||||
cfg->tx_bw = 50e6;
|
||||
cfg->rx_bw = 50e6;
|
||||
} else {
|
||||
cfg->sample_rate=61.44e6;
|
||||
cfg->samples_per_frame = 614400;
|
||||
cfg->tx_bw = 50e6;
|
||||
cfg->rx_bw = 50e6;
|
||||
}
|
||||
case 216:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=46.08e6;
|
||||
cfg->samples_per_frame = 460800;
|
||||
cfg->tx_bw = 40e6;
|
||||
cfg->rx_bw = 40e6;
|
||||
}
|
||||
else {
|
||||
cfg->sample_rate=61.44e6;
|
||||
cfg->samples_per_frame = 614400;
|
||||
cfg->tx_bw = 40e6;
|
||||
cfg->rx_bw = 40e6;
|
||||
}
|
||||
break;
|
||||
case 106:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=23.04e6;
|
||||
cfg->samples_per_frame = 230400;
|
||||
cfg->tx_bw = 20e6;
|
||||
cfg->rx_bw = 20e6;
|
||||
}
|
||||
else {
|
||||
cfg->sample_rate=30.72e6;
|
||||
cfg->samples_per_frame = 307200;
|
||||
cfg->tx_bw = 20e6;
|
||||
cfg->rx_bw = 20e6;
|
||||
}
|
||||
break;
|
||||
case 52:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=11.52e6;
|
||||
cfg->samples_per_frame = 115200;
|
||||
cfg->tx_bw = 10e6;
|
||||
cfg->rx_bw = 10e6;
|
||||
}
|
||||
else {
|
||||
cfg->sample_rate=15.36e6;
|
||||
cfg->samples_per_frame = 153600;
|
||||
cfg->tx_bw = 10e6;
|
||||
cfg->rx_bw = 10e6;
|
||||
}
|
||||
case 25:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=5.76e6;
|
||||
cfg->samples_per_frame = 57600;
|
||||
cfg->tx_bw = 5e6;
|
||||
cfg->rx_bw = 5e6;
|
||||
}
|
||||
else {
|
||||
cfg->sample_rate=7.68e6;
|
||||
cfg->samples_per_frame = 76800;
|
||||
cfg->tx_bw = 5e6;
|
||||
cfg->rx_bw = 5e6;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(0==1,"N_RB %d not yet supported for numerology %d\n",N_RB,mu);
|
||||
case 270:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=92.16e6;
|
||||
cfg->samples_per_frame = 921600;
|
||||
cfg->tx_bw = 50e6;
|
||||
cfg->rx_bw = 50e6;
|
||||
} else {
|
||||
cfg->sample_rate=61.44e6;
|
||||
cfg->samples_per_frame = 614400;
|
||||
cfg->tx_bw = 50e6;
|
||||
cfg->rx_bw = 50e6;
|
||||
}
|
||||
|
||||
case 216:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=46.08e6;
|
||||
cfg->samples_per_frame = 460800;
|
||||
cfg->tx_bw = 40e6;
|
||||
cfg->rx_bw = 40e6;
|
||||
} else {
|
||||
cfg->sample_rate=61.44e6;
|
||||
cfg->samples_per_frame = 614400;
|
||||
cfg->tx_bw = 40e6;
|
||||
cfg->rx_bw = 40e6;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 106:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=23.04e6;
|
||||
cfg->samples_per_frame = 230400;
|
||||
cfg->tx_bw = 20e6;
|
||||
cfg->rx_bw = 20e6;
|
||||
} else {
|
||||
cfg->sample_rate=30.72e6;
|
||||
cfg->samples_per_frame = 307200;
|
||||
cfg->tx_bw = 20e6;
|
||||
cfg->rx_bw = 20e6;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 52:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=11.52e6;
|
||||
cfg->samples_per_frame = 115200;
|
||||
cfg->tx_bw = 10e6;
|
||||
cfg->rx_bw = 10e6;
|
||||
} else {
|
||||
cfg->sample_rate=15.36e6;
|
||||
cfg->samples_per_frame = 153600;
|
||||
cfg->tx_bw = 10e6;
|
||||
cfg->rx_bw = 10e6;
|
||||
}
|
||||
|
||||
case 25:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=5.76e6;
|
||||
cfg->samples_per_frame = 57600;
|
||||
cfg->tx_bw = 5e6;
|
||||
cfg->rx_bw = 5e6;
|
||||
} else {
|
||||
cfg->sample_rate=7.68e6;
|
||||
cfg->samples_per_frame = 76800;
|
||||
cfg->tx_bw = 5e6;
|
||||
cfg->rx_bw = 5e6;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(0==1,"N_RB %d not yet supported for numerology %d\n",N_RB,mu);
|
||||
}
|
||||
} else if (mu == NR_MU_1) {
|
||||
switch(N_RB) {
|
||||
|
||||
case 273:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=184.32e6;
|
||||
@@ -953,34 +956,38 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
|
||||
}
|
||||
} else if (mu == NR_MU_3) {
|
||||
switch(N_RB) {
|
||||
case 66:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=184.32e6;
|
||||
cfg->samples_per_frame = 1843200;
|
||||
cfg->tx_bw = 100e6;
|
||||
cfg->rx_bw = 100e6;
|
||||
} else {
|
||||
cfg->sample_rate = 122.88e6;
|
||||
cfg->samples_per_frame = 1228800;
|
||||
cfg->tx_bw = 100e6;
|
||||
cfg->rx_bw = 100e6;
|
||||
}
|
||||
break;
|
||||
case 32:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=92.16e6;
|
||||
cfg->samples_per_frame = 921600;
|
||||
cfg->tx_bw = 50e6;
|
||||
cfg->rx_bw = 50e6;
|
||||
} else {
|
||||
cfg->sample_rate=61.44e6;
|
||||
cfg->samples_per_frame = 614400;
|
||||
cfg->tx_bw = 50e6;
|
||||
cfg->rx_bw = 50e6;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(0==1,"N_RB %d not yet supported for numerology %d\n",N_RB,mu);
|
||||
case 66:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=184.32e6;
|
||||
cfg->samples_per_frame = 1843200;
|
||||
cfg->tx_bw = 100e6;
|
||||
cfg->rx_bw = 100e6;
|
||||
} else {
|
||||
cfg->sample_rate = 122.88e6;
|
||||
cfg->samples_per_frame = 1228800;
|
||||
cfg->tx_bw = 100e6;
|
||||
cfg->rx_bw = 100e6;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 32:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=92.16e6;
|
||||
cfg->samples_per_frame = 921600;
|
||||
cfg->tx_bw = 50e6;
|
||||
cfg->rx_bw = 50e6;
|
||||
} else {
|
||||
cfg->sample_rate=61.44e6;
|
||||
cfg->samples_per_frame = 614400;
|
||||
cfg->tx_bw = 50e6;
|
||||
cfg->rx_bw = 50e6;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(0==1,"N_RB %d not yet supported for numerology %d\n",N_RB,mu);
|
||||
}
|
||||
} else {
|
||||
AssertFatal(0 == 1,"Numerology %d not supported for the moment\n",mu);
|
||||
@@ -1000,7 +1007,7 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
|
||||
if (ru->if_frequency == 0) {
|
||||
cfg->tx_freq[i] = (double)fp->dl_CarrierFreq;
|
||||
cfg->rx_freq[i] = (double)fp->ul_CarrierFreq;
|
||||
} else if (ru->if_freq_offset){
|
||||
} else if (ru->if_freq_offset) {
|
||||
cfg->tx_freq[i] = (double)(ru->if_frequency);
|
||||
cfg->rx_freq[i] = (double)(ru->if_frequency + ru->if_freq_offset);
|
||||
LOG_I(PHY, "Setting IF TX frequency to %lu Hz with IF RX frequency offset %d Hz\n", ru->if_frequency, ru->if_freq_offset);
|
||||
@@ -1008,14 +1015,15 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
|
||||
cfg->tx_freq[i] = (double)ru->if_frequency;
|
||||
cfg->rx_freq[i] = (double)(ru->if_frequency+fp->ul_CarrierFreq-fp->dl_CarrierFreq);
|
||||
}
|
||||
|
||||
cfg->tx_gain[i] = ru->att_tx;
|
||||
cfg->rx_gain[i] = ru->max_rxgain-ru->att_rx;
|
||||
cfg->configFilename = rf_config_file;
|
||||
LOG_I(PHY, "Channel %d: setting tx_gain offset %f, rx_gain offset %f, tx_freq %lu Hz, rx_freq %lu Hz\n",
|
||||
i, cfg->tx_gain[i],
|
||||
cfg->rx_gain[i],
|
||||
(unsigned long)cfg->tx_freq[i],
|
||||
(unsigned long)cfg->rx_freq[i]);
|
||||
i, cfg->tx_gain[i],
|
||||
cfg->rx_gain[i],
|
||||
(unsigned long)cfg->tx_freq[i],
|
||||
(unsigned long)cfg->rx_freq[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1043,40 +1051,42 @@ int setup_RU_buffers(RU_t *ru) {
|
||||
|
||||
if (config->cell_config.frame_duplex_type.value == TDD) {
|
||||
int N_TA_offset = config->carrier_config.uplink_frequency.value < 6000000 ? 400 : 431; // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2
|
||||
|
||||
double factor=1;
|
||||
|
||||
switch (mu) {
|
||||
case 0: //15 kHz scs
|
||||
AssertFatal(N_TA_offset == 400, "scs_common 15kHz only for FR1\n");
|
||||
factor = fp->samples_per_subframe / 30720.0;
|
||||
break;
|
||||
|
||||
case 1: //30 kHz sc
|
||||
AssertFatal(N_TA_offset == 400, "scs_common 30kHz only for FR1\n");
|
||||
factor = fp->samples_per_subframe / 30720.0;
|
||||
break;
|
||||
|
||||
case 2: //60 kHz scs
|
||||
AssertFatal(1==0, "scs_common should not be 60 kHz\n");
|
||||
break;
|
||||
|
||||
case 3: //120 kHz scs
|
||||
AssertFatal(N_TA_offset == 431, "scs_common 120kHz only for FR2\n");
|
||||
factor = fp->samples_per_subframe / 61440.0;
|
||||
break;
|
||||
|
||||
case 4: //240 kHz scs
|
||||
AssertFatal(N_TA_offset == 431, "scs_common 240kHz only for FR2\n");
|
||||
factor = fp->samples_per_subframe / 61440.0;
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0, "Invalid scs_common!\n");
|
||||
}
|
||||
|
||||
ru->N_TA_offset = (int)(N_TA_offset * factor);
|
||||
|
||||
LOG_I(PHY,"RU %d Setting N_TA_offset to %d samples (factor %f, UL Freq %d, N_RB %d, mu %d)\n",ru->idx,ru->N_TA_offset,factor,
|
||||
config->carrier_config.uplink_frequency.value, N_RB, mu);
|
||||
}
|
||||
else ru->N_TA_offset = 0;
|
||||
config->carrier_config.uplink_frequency.value, N_RB, mu);
|
||||
} else ru->N_TA_offset = 0;
|
||||
|
||||
|
||||
if (ru->openair0_cfg.mmapped_dma == 1) {
|
||||
// replace RX signal buffers with mmaped HW versions
|
||||
for (i=0; i<ru->nb_rx; i++) {
|
||||
@@ -1121,7 +1131,6 @@ void *ru_stats_thread(void *param) {
|
||||
sleep(1);
|
||||
|
||||
if (opp_enabled == 1) {
|
||||
|
||||
if (ru->feprx) print_meas(&ru->ofdm_demod_stats,"feprx",NULL,NULL);
|
||||
|
||||
if (ru->feptx_ofdm) {
|
||||
@@ -1134,6 +1143,7 @@ void *ru_stats_thread(void *param) {
|
||||
if (ru->fh_north_asynch_in) print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL);
|
||||
|
||||
print_meas(&ru->tx_fhaul,"tx_fhaul",NULL,NULL);
|
||||
|
||||
if (ru->fh_north_out) {
|
||||
print_meas(&ru->compression,"compression",NULL,NULL);
|
||||
print_meas(&ru->transport,"transport",NULL,NULL);
|
||||
@@ -1145,7 +1155,6 @@ void *ru_stats_thread(void *param) {
|
||||
}
|
||||
|
||||
void ru_tx_func(void *param) {
|
||||
|
||||
processingData_RU_t *info = (processingData_RU_t *) param;
|
||||
RU_t *ru = info->ru;
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
@@ -1168,14 +1177,11 @@ void ru_tx_func(void *param) {
|
||||
} else {
|
||||
if(frame_tx == print_frame) {
|
||||
for (int i=0; i<ru->nb_tx; i++) {
|
||||
|
||||
if(slot_tx == 0) {
|
||||
sprintf(filename,"gNBdataF_frame%d_sl%d.m", print_frame, slot_tx);
|
||||
LOG_M(filename,"txdataF_frame",&ru->gNB_list[0]->common_vars.txdataF[i][0],fp->samples_per_frame_wCP, 1, 1);
|
||||
|
||||
sprintf(filename,"tx%ddataF_frame%d_sl%d.m", i, print_frame, slot_tx);
|
||||
LOG_M(filename,"txdataF_frame",&ru->common.txdataF[i][0],fp->samples_per_frame_wCP, 1, 1);
|
||||
|
||||
sprintf(filename,"tx%ddataF_BF_frame%d_sl%d.m", i, print_frame, slot_tx);
|
||||
LOG_M(filename,"txdataF_BF_frame",&ru->common.txdataF_BF[i][0],fp->samples_per_subframe_wCP, 1, 1);
|
||||
}
|
||||
@@ -1212,16 +1218,13 @@ void *ru_thread( void *param ) {
|
||||
int frame = 1023;
|
||||
char threadname[40];
|
||||
int aa;
|
||||
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
||||
// set default return value
|
||||
ru_thread_status = 0;
|
||||
// set default return value
|
||||
sprintf(threadname,"ru_thread %u",ru->idx);
|
||||
|
||||
|
||||
LOG_I(PHY,"Starting RU %d (%s,%s),\n",ru->idx,NB_functions[ru->function],NB_timing[ru->if_timing]);
|
||||
|
||||
memcpy((void*)&ru->config,(void*)&RC.gNB[0]->gNB_config,sizeof(ru->config));
|
||||
memcpy((void *)&ru->config,(void *)&RC.gNB[0]->gNB_config,sizeof(ru->config));
|
||||
|
||||
if(emulate_rf) {
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
@@ -1267,12 +1270,11 @@ void *ru_thread( void *param ) {
|
||||
pthread_cond_signal(&RC.ru_cond);
|
||||
pthread_mutex_unlock(&RC.ru_mutex);
|
||||
wait_sync("ru_thread");
|
||||
|
||||
notifiedFIFO_elt_t *msg = newNotifiedFIFO_elt(sizeof(processingData_L1_t),0,gNB->resp_L1,rx_func);
|
||||
notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1_t),0,gNB->resp_L1_tx,tx_func);
|
||||
notifiedFIFO_elt_t *msgRUTx = newNotifiedFIFO_elt(sizeof(processingData_L1_t),0,gNB->resp_RU_tx,ru_tx_func);
|
||||
processingData_L1_t *syncMsg;
|
||||
notifiedFIFO_elt_t *res;
|
||||
notifiedFIFO_elt_t *res;
|
||||
pushNotifiedFIFO(gNB->resp_L1,msg); // to unblock the process in the beginning
|
||||
pushNotifiedFIFO(gNB->resp_L1_tx,msgL1Tx); // to unblock the process in the beginning
|
||||
pushNotifiedFIFO(gNB->resp_RU_tx,msgRUTx); // to unblock the process in the beginning
|
||||
@@ -1286,12 +1288,11 @@ void *ru_thread( void *param ) {
|
||||
} else LOG_I(PHY,"RU %d no rf device\n",ru->idx);
|
||||
|
||||
// start trx write thread
|
||||
if(usrp_tx_thread == 1){
|
||||
if (ru->start_write_thread){
|
||||
if(ru->start_write_thread(ru) != 0){
|
||||
if(usrp_tx_thread == 1) {
|
||||
if (ru->start_write_thread) {
|
||||
if(ru->start_write_thread(ru) != 0) {
|
||||
LOG_E(HW,"Could not start tx write thread\n");
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
LOG_I(PHY,"tx write thread ready\n");
|
||||
}
|
||||
}
|
||||
@@ -1338,82 +1339,75 @@ void *ru_thread( void *param ) {
|
||||
|
||||
// synchronization on input FH interface, acquire signals/data and block
|
||||
LOG_D(PHY,"[RU_thread] read data: frame_rx = %d, tti_rx = %d\n", frame, slot);
|
||||
|
||||
if (ru->fh_south_in) ru->fh_south_in(ru,&frame,&slot);
|
||||
else AssertFatal(1==0, "No fronthaul interface at south port");
|
||||
|
||||
proc->timestamp_tx = proc->timestamp_rx + (sf_ahead*fp->samples_per_subframe);
|
||||
proc->frame_tx = (proc->tti_rx > (fp->slots_per_frame-1-(fp->slots_per_subframe*sf_ahead))) ? (proc->frame_rx+1)&1023 : proc->frame_rx;
|
||||
proc->tti_tx = (proc->tti_rx + (fp->slots_per_subframe*sf_ahead))%fp->slots_per_frame;
|
||||
|
||||
LOG_D(PHY,"AFTER fh_south_in - SFN/SL:%d%d RU->proc[RX:%d.%d TX:%d.%d] RC.gNB[0]:[RX:%d%d TX(SFN):%d]\n",
|
||||
frame,slot,
|
||||
proc->frame_rx,proc->tti_rx,
|
||||
proc->frame_tx,proc->tti_tx,
|
||||
RC.gNB[0]->proc.frame_rx,RC.gNB[0]->proc.slot_rx,
|
||||
RC.gNB[0]->proc.frame_tx);
|
||||
RC.gNB[0]->proc.frame_tx);
|
||||
|
||||
if (ru->idx!=0) proc->frame_tx = (proc->frame_tx+proc->frame_offset)&1023;
|
||||
|
||||
// do RX front-end processing (frequency-shift, dft) if needed
|
||||
int slot_type = nr_slot_select(cfg,proc->frame_rx,proc->tti_rx);
|
||||
|
||||
//int slot_type = nr_slot_select(cfg,proc->frame_rx,proc->tti_rx);
|
||||
//if (NFAPI_MODE == NFAPI_MODE_PNF)
|
||||
int slot_type;
|
||||
if (slot ==7)
|
||||
slot_type = NR_MIXED_SLOT;
|
||||
if (slot == 8)
|
||||
slot_type = NR_UPLINK_SLOT;
|
||||
if (slot_type == NR_UPLINK_SLOT || slot_type == NR_MIXED_SLOT) {
|
||||
|
||||
if (ru->feprx) {
|
||||
ru->feprx(ru,proc->tti_rx);
|
||||
//LOG_M("rxdata.m","rxs",ru->common.rxdata[0],1228800,1,1);
|
||||
ru->feprx(ru,proc->tti_rx);
|
||||
//LOG_M("rxdata.m","rxs",ru->common.rxdata[0],1228800,1,1);
|
||||
LOG_D(PHY,"RU proc: frame_rx = %d, tti_rx = %d\n", proc->frame_rx, proc->tti_rx);
|
||||
LOG_D(PHY,"Copying rxdataF from RU to gNB\n");
|
||||
|
||||
LOG_D(PHY,"RU proc: frame_rx = %d, tti_rx = %d\n", proc->frame_rx, proc->tti_rx);
|
||||
LOG_D(PHY,"Copying rxdataF from RU to gNB\n");
|
||||
|
||||
for (aa=0;aa<ru->nb_rx;aa++)
|
||||
memcpy((void*)RC.gNB[0]->common_vars.rxdataF[aa],
|
||||
(void*)ru->common.rxdataF[aa], fp->symbols_per_slot*fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
if (IS_SOFTMODEM_DOSCOPE && RC.gNB[0]->scopeData)
|
||||
((scopeData_t*)RC.gNB[0]->scopeData)->slotFunc(ru->common.rxdataF[0],proc->tti_rx, RC.gNB[0]->scopeData);
|
||||
// Do PRACH RU processing
|
||||
for (aa=0; aa<ru->nb_rx; aa++)
|
||||
memcpy((void *)RC.gNB[0]->common_vars.rxdataF[aa],
|
||||
(void *)ru->common.rxdataF[aa], fp->symbols_per_slot*fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
|
||||
int prach_id=find_nr_prach_ru(ru,proc->frame_rx,proc->tti_rx,SEARCH_EXIST);
|
||||
uint8_t prachStartSymbol,N_dur;
|
||||
if (prach_id>=0) {
|
||||
if (IS_SOFTMODEM_DOSCOPE && RC.gNB[0]->scopeData)
|
||||
((scopeData_t *)RC.gNB[0]->scopeData)->slotFunc(ru->common.rxdataF[0],proc->tti_rx, RC.gNB[0]->scopeData);
|
||||
|
||||
T(T_GNB_PHY_PRACH_INPUT_SIGNAL, T_INT(proc->frame_rx), T_INT(proc->tti_rx), T_INT(0),
|
||||
T_BUFFER(&ru->common.rxdata[0][fp->get_samples_slot_timestamp(proc->tti_rx-1,fp,0)]/*-ru->N_TA_offset*/, fp->get_samples_per_slot(proc->tti_rx,fp)*4*2));
|
||||
// Do PRACH RU processing
|
||||
int prach_id=find_nr_prach_ru(ru,proc->frame_rx,proc->tti_rx,SEARCH_EXIST);
|
||||
uint8_t prachStartSymbol,N_dur;
|
||||
|
||||
N_dur = get_nr_prach_duration(ru->prach_list[prach_id].fmt);
|
||||
/*
|
||||
get_nr_prach_info_from_index(ru->config.prach_config.prach_ConfigurationIndex.value,
|
||||
proc->frame_rx,proc->tti_rx,
|
||||
ru->config.carrier_config.dl_frequency.value,
|
||||
fp->numerology_index,
|
||||
fp->frame_type,
|
||||
&format,
|
||||
&start_symbol,
|
||||
&N_t_slot,
|
||||
&N_dur,
|
||||
&RA_sfn_index,
|
||||
&N_RA_slot,
|
||||
&config_period);
|
||||
*/
|
||||
for (int prach_oc = 0; prach_oc<ru->prach_list[prach_id].num_prach_ocas; prach_oc++) {
|
||||
prachStartSymbol = ru->prach_list[prach_id].prachStartSymbol+prach_oc*N_dur;
|
||||
//comment FK: the standard 38.211 section 5.3.2 has one extra term +14*N_RA_slot. This is because there prachStartSymbol is given wrt to start of the 15kHz slot or 60kHz slot. Here we work slot based, so this function is anyway only called in slots where there is PRACH. Its up to the MAC to schedule another PRACH PDU in the case there are there N_RA_slot \in {0,1}.
|
||||
if (prach_id>=0) {
|
||||
T(T_GNB_PHY_PRACH_INPUT_SIGNAL, T_INT(proc->frame_rx), T_INT(proc->tti_rx), T_INT(0),
|
||||
T_BUFFER(&ru->common.rxdata[0][fp->get_samples_slot_timestamp(proc->tti_rx-1,fp,0)]/*-ru->N_TA_offset*/, fp->get_samples_per_slot(proc->tti_rx,fp)*4*2));
|
||||
N_dur = get_nr_prach_duration(ru->prach_list[prach_id].fmt);
|
||||
|
||||
rx_nr_prach_ru(ru,
|
||||
ru->prach_list[prach_id].fmt, //could also use format
|
||||
ru->prach_list[prach_id].numRA,
|
||||
prachStartSymbol,
|
||||
prach_oc,
|
||||
proc->frame_rx,proc->tti_rx);
|
||||
}
|
||||
free_nr_ru_prach_entry(ru,prach_id);
|
||||
}
|
||||
/*
|
||||
get_nr_prach_info_from_index(ru->config.prach_config.prach_ConfigurationIndex.value,
|
||||
proc->frame_rx,proc->tti_rx,
|
||||
ru->config.carrier_config.dl_frequency.value,
|
||||
fp->numerology_index,
|
||||
fp->frame_type,
|
||||
&format,
|
||||
&start_symbol,
|
||||
&N_t_slot,
|
||||
&N_dur,
|
||||
&RA_sfn_index,
|
||||
&N_RA_slot,
|
||||
&config_period);
|
||||
*/
|
||||
for (int prach_oc = 0; prach_oc<ru->prach_list[prach_id].num_prach_ocas; prach_oc++) {
|
||||
prachStartSymbol = ru->prach_list[prach_id].prachStartSymbol+prach_oc*N_dur;
|
||||
//comment FK: the standard 38.211 section 5.3.2 has one extra term +14*N_RA_slot. This is because there prachStartSymbol is given wrt to start of the 15kHz slot or 60kHz slot. Here we work slot based, so this function is anyway only called in slots where there is PRACH. Its up to the MAC to schedule another PRACH PDU in the case there are there N_RA_slot \in {0,1}.
|
||||
rx_nr_prach_ru(ru,
|
||||
ru->prach_list[prach_id].fmt, //could also use format
|
||||
ru->prach_list[prach_id].numRA,
|
||||
prachStartSymbol,
|
||||
prach_oc,
|
||||
proc->frame_rx,proc->tti_rx);
|
||||
}
|
||||
|
||||
free_nr_ru_prach_entry(ru,prach_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1428,7 +1422,6 @@ void *ru_thread( void *param ) {
|
||||
syncMsg->timestamp_tx = proc->timestamp_tx;
|
||||
res->key = proc->tti_rx;
|
||||
pushTpool(gNB->threadPool, res);
|
||||
|
||||
}
|
||||
|
||||
printf( "Exiting ru_thread \n");
|
||||
@@ -1442,7 +1435,6 @@ void *ru_thread( void *param ) {
|
||||
delNotifiedFIFO_elt(msg);
|
||||
delNotifiedFIFO_elt(msgL1Tx);
|
||||
delNotifiedFIFO_elt(msgRUTx);
|
||||
|
||||
ru_thread_status = 0;
|
||||
return &ru_thread_status;
|
||||
}
|
||||
@@ -1533,8 +1525,7 @@ void kill_NR_RU_proc(int inst) {
|
||||
}
|
||||
}
|
||||
|
||||
int check_capabilities(RU_t *ru,RRU_capabilities_t *cap)
|
||||
{
|
||||
int check_capabilities(RU_t *ru,RRU_capabilities_t *cap) {
|
||||
FH_fmt_options_t fmt = cap->FH_fmt;
|
||||
int i;
|
||||
int found_band=0;
|
||||
@@ -1590,8 +1581,7 @@ char rru_formats[3][20] = {"OAI_IF5","MBP_IF5","OAI_IF4p5"};
|
||||
char ru_if_formats[4][20] = {"LOCAL_RF","REMOTE_OAI_IF5","REMOTE_MBP_IF5","REMOTE_OAI_IF4p5"};
|
||||
|
||||
void configure_ru(int idx,
|
||||
void *arg)
|
||||
{
|
||||
void *arg) {
|
||||
RU_t *ru = RC.ru[idx];
|
||||
RRU_config_t *config = (RRU_config_t *)arg;
|
||||
RRU_capabilities_t *capabilities = (RRU_capabilities_t *)arg;
|
||||
@@ -1764,26 +1754,25 @@ void set_function_spec_param(RU_t *ru) {
|
||||
ru->fh_north_out = NULL; // no outgoing fronthaul to north
|
||||
ru->nr_start_if = NULL; // no if interface
|
||||
ru->rfdevice.host_type = RAU_HOST;
|
||||
|
||||
ru->fh_south_in = rx_rf; // local synchronous RF RX
|
||||
ru->fh_south_out = tx_rf; // local synchronous RF TX
|
||||
ru->start_rf = start_rf; // need to start the local RF interface
|
||||
ru->stop_rf = stop_rf;
|
||||
ru->start_write_thread = start_write_thread; // starting RF TX in different thread
|
||||
printf("configuring ru_id %u (start_rf %p)\n", ru->idx, start_rf);
|
||||
ru->fh_south_in = rx_rf; // local synchronous RF RX
|
||||
ru->fh_south_out = tx_rf; // local synchronous RF TX
|
||||
ru->start_rf = start_rf; // need to start the local RF interface
|
||||
ru->stop_rf = stop_rf;
|
||||
ru->start_write_thread = start_write_thread; // starting RF TX in different thread
|
||||
printf("configuring ru_id %u (start_rf %p)\n", ru->idx, start_rf);
|
||||
}
|
||||
|
||||
/*
|
||||
printf("configuring ru_id %u (start_rf %p)\n", ru->idx, start_rf);
|
||||
fill_rf_config(ru,rf_config_file);
|
||||
init_frame_parms(&ru->frame_parms,1);
|
||||
nr_phy_init_RU(ru);
|
||||
printf("configuring ru_id %u (start_rf %p)\n", ru->idx, start_rf);
|
||||
fill_rf_config(ru,rf_config_file);
|
||||
init_frame_parms(&ru->frame_parms,1);
|
||||
nr_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);
|
||||
}
|
||||
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
|
||||
if (setup_RU_buffers(ru)!=0) {
|
||||
printf("Exiting, cannot initialize RU Buffers\n");
|
||||
exit(-1);
|
||||
}
|
||||
*/
|
||||
break;
|
||||
|
||||
@@ -1839,9 +1828,12 @@ void set_function_spec_param(RU_t *ru) {
|
||||
|
||||
if (ru->ifdevice.get_internal_parameter != NULL) {
|
||||
void *t = ru->ifdevice.get_internal_parameter("fh_if4p5_south_in");
|
||||
|
||||
if (t != NULL)
|
||||
ru->fh_south_in = t;
|
||||
|
||||
t = ru->ifdevice.get_internal_parameter("fh_if4p5_south_out");
|
||||
|
||||
if (t != NULL)
|
||||
ru->fh_south_out = t;
|
||||
}
|
||||
@@ -1855,8 +1847,7 @@ void set_function_spec_param(RU_t *ru) {
|
||||
} // switch on interface type
|
||||
}
|
||||
|
||||
void init_NR_RU(char *rf_config_file)
|
||||
{
|
||||
void init_NR_RU(char *rf_config_file) {
|
||||
int ru_id;
|
||||
RU_t *ru;
|
||||
PHY_VARS_gNB *gNB_RC;
|
||||
@@ -1871,7 +1862,6 @@ void init_NR_RU(char *rf_config_file)
|
||||
printf("configuring RU from file\n");
|
||||
NRRCconfig_RU();
|
||||
LOG_I(PHY,"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",RC.nb_nr_L1_inst,RC.nb_RU,get_nprocs());
|
||||
|
||||
LOG_D(PHY,"Process RUs RC.nb_RU:%d\n",RC.nb_RU);
|
||||
|
||||
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
@@ -1933,8 +1923,7 @@ void init_NR_RU(char *rf_config_file)
|
||||
}
|
||||
|
||||
|
||||
void stop_RU(int nb_ru)
|
||||
{
|
||||
void stop_RU(int nb_ru) {
|
||||
for (int inst = 0; inst < nb_ru; inst++) {
|
||||
LOG_I(PHY, "Stopping RU %d processing threads\n", inst);
|
||||
kill_NR_RU_proc(inst);
|
||||
@@ -1944,8 +1933,7 @@ void stop_RU(int nb_ru)
|
||||
|
||||
/* --------------------------------------------------------*/
|
||||
/* from here function to use configuration module */
|
||||
static void NRRCconfig_RU(void)
|
||||
{
|
||||
static void NRRCconfig_RU(void) {
|
||||
int i = 0, j = 0;
|
||||
paramdef_t RUParams[] = RUPARAMS_DESC;
|
||||
paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0};
|
||||
@@ -1989,8 +1977,7 @@ static void NRRCconfig_RU(void)
|
||||
} else {
|
||||
LOG_E(PHY, "Erroneous RU clock source in the provided configuration file: '%s'\n", *(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr));
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
LOG_I(PHY,"Setting clock source to internal\n");
|
||||
RC.ru[j]->openair0_cfg.clock_source = internal;
|
||||
}
|
||||
@@ -2008,10 +1995,9 @@ static void NRRCconfig_RU(void)
|
||||
} else {
|
||||
LOG_E(PHY, "Erroneous RU time source in the provided configuration file: '%s'\n", *(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr));
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
LOG_I(PHY,"Setting time source to internal\n");
|
||||
RC.ru[j]->openair0_cfg.time_source = internal;
|
||||
RC.ru[j]->openair0_cfg.time_source = internal;
|
||||
}
|
||||
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) {
|
||||
@@ -2096,8 +2082,10 @@ static void NRRCconfig_RU(void)
|
||||
|
||||
if (config_isparamset(RUParamList.paramarray[j], RU_BF_WEIGHTS_LIST_IDX)) {
|
||||
RC.ru[j]->nb_bfw = RUParamList.paramarray[j][RU_BF_WEIGHTS_LIST_IDX].numelt;
|
||||
|
||||
for (i=0; i<RC.ru[j]->num_gNB; i++) {
|
||||
RC.ru[j]->bw_list[i] = (int32_t *)malloc16_clear((RC.ru[j]->nb_bfw)*sizeof(int32_t));
|
||||
|
||||
for (int b=0; b<RC.ru[j]->nb_bfw; b++) RC.ru[j]->bw_list[i][b] = RUParamList.paramarray[j][RU_BF_WEIGHTS_LIST_IDX].iptr[b];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +155,4 @@ extern int emulate_rf;
|
||||
extern int numerology;
|
||||
extern int usrp_tx_thread;
|
||||
|
||||
extern volatile int start_eNB;
|
||||
extern volatile int start_UE;
|
||||
|
||||
#endif
|
||||
|
||||
+40
-72
@@ -53,6 +53,7 @@
|
||||
#include "PHY_INTERFACE/phy_interface_vars.h"
|
||||
#include "gnb_config.h"
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include <targets/RT/USER/lte-softmodem.h>
|
||||
|
||||
#ifdef SMBV
|
||||
#include "PHY/TOOLS/smbv.h"
|
||||
@@ -170,15 +171,15 @@ int split73=0;
|
||||
void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_t *data, int dataLen, int r_offset) {
|
||||
AssertFatal(false, "Must not be called in this context\n");
|
||||
}
|
||||
void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask, uint16_t rnti, int32_t stat) {
|
||||
AssertFatal(false, "Must not be called in this context\n");
|
||||
void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask,
|
||||
uint16_t rnti, int32_t stat) {
|
||||
AssertFatal(false, "Must not be called in this context\n");
|
||||
}
|
||||
|
||||
|
||||
extern void reset_opp_meas(void);
|
||||
extern void print_opp_meas(void);
|
||||
|
||||
extern void init_eNB_afterRU(void);
|
||||
extern void *udp_eNB_task(void *args_p);
|
||||
|
||||
int transmission_mode=1;
|
||||
@@ -307,44 +308,40 @@ int create_gNB_tasks(uint32_t gnb_nb) {
|
||||
LOG_D(GNB_APP, "%s(gnb_nb:%d)\n", __FUNCTION__, gnb_nb);
|
||||
itti_wait_ready(1);
|
||||
|
||||
|
||||
if (gnb_nb > 0) {
|
||||
/* Last task to create, others task must be ready before its start */
|
||||
/*if (itti_create_task (TASK_GNB_APP, gNB_app_task, NULL) < 0) {
|
||||
LOG_E(GNB_APP, "Create task for gNB APP failed\n");
|
||||
return -1;
|
||||
}*/
|
||||
if(itti_create_task(TASK_SCTP, sctp_eNB_task, NULL) < 0){
|
||||
if(itti_create_task(TASK_SCTP, sctp_eNB_task, NULL) < 0) {
|
||||
LOG_E(SCTP, "Create task for SCTP failed\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (is_x2ap_enabled()) {
|
||||
if(itti_create_task(TASK_X2AP, x2ap_task, NULL) < 0){
|
||||
LOG_E(X2AP, "Create task for X2AP failed\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(itti_create_task(TASK_X2AP, x2ap_task, NULL) < 0) {
|
||||
LOG_E(X2AP, "Create task for X2AP failed\n");
|
||||
}
|
||||
} else {
|
||||
LOG_I(X2AP, "X2AP is disabled.\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
paramdef_t NETParams[] = GNBNETPARAMS_DESC;
|
||||
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
|
||||
sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
|
||||
config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix);
|
||||
config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix);
|
||||
|
||||
for(int i = GNB_INTERFACE_NAME_FOR_NG_AMF_IDX; i <= GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX; i++){
|
||||
if( NETParams[i].strptr == NULL){
|
||||
for(int i = GNB_INTERFACE_NAME_FOR_NG_AMF_IDX; i <= GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX; i++) {
|
||||
if( NETParams[i].strptr == NULL) {
|
||||
LOG_E(NGAP, "No configuration in the file.\n");
|
||||
NGAP_CONF_MODE = 0;
|
||||
}
|
||||
else {
|
||||
NGAP_CONF_MODE = 0;
|
||||
} else {
|
||||
LOG_D(NGAP, "Configuration in the file: %s.\n",*NETParams[i].strptr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (AMF_MODE_ENABLED) {
|
||||
if (gnb_nb > 0) {
|
||||
/*
|
||||
@@ -353,17 +350,16 @@ int create_gNB_tasks(uint32_t gnb_nb) {
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
if(NGAP_CONF_MODE){
|
||||
if(NGAP_CONF_MODE) {
|
||||
if (itti_create_task (TASK_NGAP, ngap_gNB_task, NULL) < 0) {
|
||||
LOG_E(NGAP, "Create task for NGAP failed\n");
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
LOG_E(NGAP, "Ngap task not created\n");
|
||||
LOG_E(NGAP, "Ngap task not created\n");
|
||||
}
|
||||
|
||||
|
||||
if(!emulate_rf){
|
||||
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;
|
||||
@@ -384,12 +380,14 @@ int create_gNB_tasks(uint32_t gnb_nb) {
|
||||
}
|
||||
|
||||
LOG_I(NR_RRC,"Creating NR RRC gNB Task\n");
|
||||
|
||||
if (itti_create_task (TASK_RRC_GNB, rrc_gnb_task, NULL) < 0) {
|
||||
LOG_E(NR_RRC, "Create task for NR RRC gNB failed\n");
|
||||
return -1;
|
||||
}
|
||||
//Use check on x2ap to consider the NSA scenario and check on AMF_MODE_ENABLED for the SA scenario
|
||||
if(is_x2ap_enabled() || AMF_MODE_ENABLED){
|
||||
|
||||
//Use check on x2ap to consider the NSA scenario and check on AMF_MODE_ENABLED for the SA scenario
|
||||
if(is_x2ap_enabled() || AMF_MODE_ENABLED) {
|
||||
if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) {
|
||||
LOG_E(GTPU, "Create task for GTPV1U failed\n");
|
||||
return -1;
|
||||
@@ -402,18 +400,12 @@ int create_gNB_tasks(uint32_t gnb_nb) {
|
||||
|
||||
|
||||
static void get_options(void) {
|
||||
|
||||
|
||||
paramdef_t cmdline_params[] = CMDLINE_PARAMS_DESC_GNB ;
|
||||
|
||||
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
|
||||
get_common_options(SOFTMODEM_GNB_BIT );
|
||||
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
|
||||
CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP);
|
||||
|
||||
|
||||
|
||||
|
||||
if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) ) {
|
||||
memset((void *)&RC,0,sizeof(RC));
|
||||
/* Read RC configuration file */
|
||||
@@ -426,13 +418,11 @@ static void get_options(void) {
|
||||
if(parallel_config != NULL) set_parallel_conf(parallel_config);
|
||||
|
||||
if(worker_config != NULL) set_worker_conf(worker_config);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void set_default_frame_parms(nfapi_nr_config_request_scf_t *config[MAX_NUM_CCs],
|
||||
NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs])
|
||||
{
|
||||
NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
|
||||
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
frame_parms[CC_id] = (NR_DL_FRAME_PARMS *) malloc(sizeof(NR_DL_FRAME_PARMS));
|
||||
config[CC_id] = (nfapi_nr_config_request_scf_t *) malloc(sizeof(nfapi_nr_config_request_scf_t));
|
||||
@@ -507,10 +497,9 @@ void wait_gNBs(void) {
|
||||
waiting=0;
|
||||
|
||||
for (i=0; i<RC.nb_nr_L1_inst; i++) {
|
||||
|
||||
if (RC.gNB[i]->configured==0) {
|
||||
waiting=1;
|
||||
break;
|
||||
waiting=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -567,14 +556,8 @@ int stop_L1L2(module_id_t gnb_id) {
|
||||
LOG_I(GNB_APP, "calling kill_NR_RU_proc() for instance %d\n", gnb_id);
|
||||
kill_NR_RU_proc(gnb_id);
|
||||
oai_exit = 0;
|
||||
|
||||
//free_transport(RC.gNB[gnb_id]);
|
||||
if (RC.gNB[gnb_id]) {
|
||||
phy_free_nr_gNB(RC.gNB[gnb_id]);
|
||||
RC.gNB[gnb_id] = NULL;
|
||||
}
|
||||
|
||||
|
||||
//free_transport(RC.gNB[gnb_id]);
|
||||
phy_free_nr_gNB(RC.gNB[gnb_id]);
|
||||
nr_phy_free_RU(RC.ru[gnb_id]);
|
||||
free_lte_top();
|
||||
return 0;
|
||||
@@ -589,17 +572,13 @@ int restart_L1L2(module_id_t gnb_id) {
|
||||
LOG_W(GNB_APP, "restarting nr-softmodem\n");
|
||||
/* block threads */
|
||||
sync_var = -1;
|
||||
|
||||
RC.gNB[gnb_id]->configured = 0;
|
||||
|
||||
|
||||
RC.ru_mask |= (1 << ru->idx);
|
||||
set_function_spec_param(RC.ru[gnb_id]);
|
||||
LOG_I(GNB_APP, "attempting to create ITTI tasks\n");
|
||||
// No more rrc thread, as many race conditions are hidden behind
|
||||
rrc_enb_init();
|
||||
itti_mark_task_ready(TASK_RRC_ENB);
|
||||
|
||||
/* pass a reconfiguration request which will configure everything down to
|
||||
* RC.eNB[i][j]->frame_parms, too */
|
||||
msg_p = itti_alloc_new_message(TASK_ENB_APP, 0, RRC_CONFIGURATION_REQ);
|
||||
@@ -636,7 +615,8 @@ void init_pdcp(void) {
|
||||
if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) {
|
||||
// pdcp_layer_init();
|
||||
uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
|
||||
(PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
|
||||
(PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
|
||||
|
||||
if (IS_SOFTMODEM_NOS1) {
|
||||
printf("IS_SOFTMODEM_NOS1 option enabled \n");
|
||||
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT;
|
||||
@@ -659,16 +639,15 @@ void init_pdcp(void) {
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
int main( int argc, char **argv ) {
|
||||
int ru_id, CC_id = 0;
|
||||
|
||||
start_background_system();
|
||||
|
||||
///static configuration for NR at the moment
|
||||
if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == NULL) {
|
||||
exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
|
||||
}
|
||||
|
||||
set_softmodem_sighandler();
|
||||
#ifdef DEBUG_CONSOLE
|
||||
setvbuf(stdout, NULL, _IONBF, 0);
|
||||
@@ -714,13 +693,10 @@ int main( int argc, char **argv )
|
||||
itti_init(TASK_MAX, tasks_info);
|
||||
// initialize mscgen log after ITTI
|
||||
MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX);
|
||||
|
||||
|
||||
init_opt();
|
||||
|
||||
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
if(IS_SOFTMODEM_NOS1)
|
||||
if(!IS_SOFTMODEM_NOS1)
|
||||
netlink_init();
|
||||
#if defined(PDCP_USE_NETLINK_QUEUES)
|
||||
pdcp_netlink_init();
|
||||
@@ -738,11 +714,8 @@ if(IS_SOFTMODEM_NOS1)
|
||||
if (RC.nb_nr_L1_inst > 0)
|
||||
RCconfig_NR_L1();
|
||||
|
||||
if (RC.nb_nr_inst > 0) {
|
||||
// don't create if node doesn't connect to RRC/S1/GTP
|
||||
AssertFatal(create_gNB_tasks(1) == 0,"cannot create ITTI tasks\n");
|
||||
}
|
||||
|
||||
// don't create if node doesn't connect to RRC/S1/GTP
|
||||
AssertFatal(create_gNB_tasks(1) == 0,"cannot create ITTI tasks\n");
|
||||
/* Start the agent. If it is turned off in the configuration, it won't start */
|
||||
/*
|
||||
RCconfig_nr_flexran();
|
||||
@@ -750,15 +723,13 @@ if(IS_SOFTMODEM_NOS1)
|
||||
for (i = 0; i < RC.nb_nr_L1_inst; i++) {
|
||||
flexran_agent_start(i);
|
||||
}
|
||||
*/
|
||||
|
||||
*/
|
||||
// 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);
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
pthread_cond_init(&sync_cond,NULL);
|
||||
pthread_mutex_init(&sync_mutex, NULL);
|
||||
|
||||
usleep(1000);
|
||||
|
||||
if (NFAPI_MODE) {
|
||||
@@ -829,6 +800,7 @@ if(IS_SOFTMODEM_NOS1)
|
||||
printf("RC.nb_RU:%d\n", RC.nb_RU);
|
||||
// once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration)
|
||||
printf("ALL RUs ready - init gNBs\n");
|
||||
|
||||
if(IS_SOFTMODEM_DOSCOPE) {
|
||||
sleep(1);
|
||||
scopeParms_t p;
|
||||
@@ -854,6 +826,7 @@ if(IS_SOFTMODEM_NOS1)
|
||||
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__);
|
||||
@@ -865,7 +838,6 @@ if(IS_SOFTMODEM_NOS1)
|
||||
printf("Returned from ITTI signal handler\n");
|
||||
oai_exit=1;
|
||||
printf("oai_exit=%d\n",oai_exit);
|
||||
|
||||
// stop threads
|
||||
/*#ifdef XFORMS
|
||||
|
||||
@@ -899,11 +871,8 @@ if(IS_SOFTMODEM_NOS1)
|
||||
/* release memory used by the RU/gNB threads (incomplete), after all
|
||||
* threads have been stopped (they partially use the same memory) */
|
||||
for (int inst = 0; inst < NB_gNB_INST; inst++) {
|
||||
//free_transport(RC.gNB[inst]);
|
||||
if (RC.gNB[inst]) {
|
||||
phy_free_nr_gNB(RC.gNB[inst]);
|
||||
RC.gNB[inst] = NULL;
|
||||
}
|
||||
//free_transport(RC.gNB[inst]);
|
||||
phy_free_nr_gNB(RC.gNB[inst]);
|
||||
}
|
||||
|
||||
for (int inst = 0; inst < NB_RU; inst++) {
|
||||
@@ -927,7 +896,6 @@ if(IS_SOFTMODEM_NOS1)
|
||||
RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice);
|
||||
}
|
||||
|
||||
|
||||
logClean();
|
||||
printf("Bye.\n");
|
||||
return 0;
|
||||
|
||||
+9
-6
@@ -458,7 +458,6 @@ static void UE_synch(void *arg) {
|
||||
LOG_I(PHY, "[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode);
|
||||
|
||||
uint64_t dl_carrier, ul_carrier;
|
||||
double rx_gain_off = 0;
|
||||
nr_get_carrier_frequencies(&UE->frame_parms, &dl_carrier, &ul_carrier);
|
||||
|
||||
if (nr_initial_sync(&syncD->proc, UE, 2) == 0) {
|
||||
@@ -468,7 +467,7 @@ static void UE_synch(void *arg) {
|
||||
|
||||
// rerun with new cell parameters and frequency-offset
|
||||
// todo: the freq_offset computed on DL shall be scaled before being applied to UL
|
||||
nr_rf_card_config(&openair0_cfg[UE->rf_map.card], rx_gain_off, ul_carrier, dl_carrier, freq_offset);
|
||||
nr_rf_card_config_freq(&openair0_cfg[UE->rf_map.card], ul_carrier, dl_carrier, freq_offset);
|
||||
|
||||
LOG_I(PHY,"Got synch: hw_slot_offset %d, carrier off %d Hz, rxgain %f (DL %f Hz, UL %f Hz)\n",
|
||||
hw_slot_offset,
|
||||
@@ -502,7 +501,7 @@ static void UE_synch(void *arg) {
|
||||
|
||||
freq_offset *= -1;
|
||||
|
||||
nr_rf_card_config(&openair0_cfg[UE->rf_map.card], rx_gain_off, ul_carrier, dl_carrier, freq_offset);
|
||||
nr_rf_card_config_freq(&openair0_cfg[UE->rf_map.card], ul_carrier, dl_carrier, freq_offset);
|
||||
|
||||
LOG_I(PHY, "Initial sync failed: trying carrier off %d Hz\n", freq_offset);
|
||||
|
||||
@@ -545,11 +544,12 @@ void processSlotTX(void *arg) {
|
||||
ul_indication.frame_tx = proc->frame_tx;
|
||||
ul_indication.slot_tx = proc->nr_slot_tx;
|
||||
ul_indication.thread_id = proc->thread_id;
|
||||
ul_indication.ue_sched_mode = rxtxD->ue_sched_mode;
|
||||
|
||||
UE->if_inst->ul_indication(&ul_indication);
|
||||
}
|
||||
|
||||
if (UE->mode != loop_through_memory) {
|
||||
if ((UE->mode != loop_through_memory) && (rxtxD->ue_sched_mode != NOT_PUSCH)) {
|
||||
phy_procedures_nrUE_TX(UE,proc,0);
|
||||
}
|
||||
}
|
||||
@@ -596,6 +596,9 @@ void processSlotRX(void *arg) {
|
||||
nr_pdcp_tick(proc->frame_rx, proc->nr_slot_rx / UE->frame_parms.slots_per_subframe);
|
||||
}
|
||||
}
|
||||
// calling UL_indication to schedule things other than PUSCH (eg, PUCCH)
|
||||
rxtxD->ue_sched_mode = NOT_PUSCH;
|
||||
processSlotTX(rxtxD);
|
||||
|
||||
// Wait for PUSCH processing to finish
|
||||
notifiedFIFO_elt_t *res;
|
||||
@@ -603,6 +606,7 @@ void processSlotRX(void *arg) {
|
||||
delNotifiedFIFO_elt(res);
|
||||
|
||||
} else {
|
||||
rxtxD->ue_sched_mode = SCHED_ALL;
|
||||
processSlotTX(rxtxD);
|
||||
}
|
||||
|
||||
@@ -611,8 +615,7 @@ void processSlotRX(void *arg) {
|
||||
if (get_softmodem_params()->usim_test==0) {
|
||||
pucch_procedures_ue_nr(UE,
|
||||
gNB_id,
|
||||
proc,
|
||||
FALSE);
|
||||
proc);
|
||||
}
|
||||
|
||||
LOG_D(PHY, "Sending Uplink data \n");
|
||||
|
||||
@@ -105,8 +105,6 @@ int config_sync_var=-1;
|
||||
|
||||
|
||||
RAN_CONTEXT_t RC;
|
||||
volatile int start_eNB = 0;
|
||||
volatile int start_UE = 0;
|
||||
volatile int oai_exit = 0;
|
||||
|
||||
|
||||
@@ -382,7 +380,8 @@ void init_openair0(void) {
|
||||
|
||||
nr_get_carrier_frequencies(frame_parms, &dl_carrier, &ul_carrier);
|
||||
|
||||
nr_rf_card_config(&openair0_cfg[card], rx_gain_off, ul_carrier, dl_carrier, freq_off);
|
||||
nr_rf_card_config_freq(&openair0_cfg[card], ul_carrier, dl_carrier, freq_off);
|
||||
nr_rf_card_config_gain(&openair0_cfg[card], rx_gain_off);
|
||||
|
||||
openair0_cfg[card].configFilename = get_softmodem_params()->rf_config_file;
|
||||
|
||||
|
||||
@@ -37,8 +37,6 @@
|
||||
#include "nfapi_pnf.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "openair2/PHY_INTERFACE/phy_stub_UE.h"
|
||||
//#include "openair1/PHY/vars.h"
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
@@ -50,7 +48,7 @@ extern RAN_CONTEXT_t RC;
|
||||
|
||||
#include <vendor_ext.h>
|
||||
#include "fapi_stub.h"
|
||||
//#include "fapi_l1.h"
|
||||
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
@@ -59,7 +57,10 @@ extern RAN_CONTEXT_t RC;
|
||||
#include "openair1/SCHED_NR/fapi_nr_l1.h"
|
||||
#include "openair1/PHY/NR_TRANSPORT/nr_dlsch.h"
|
||||
#include "openair1/PHY/defs_gNB.h"
|
||||
|
||||
#include <openair1/SCHED/fapi_l1.h>
|
||||
#include <openair1/PHY/NR_TRANSPORT/nr_transport_proto.h>
|
||||
#include <targets/RT/USER/lte-softmodem.h>
|
||||
#include "nfapi/open-nFAPI/pnf/inc/pnf_p7.h"
|
||||
|
||||
#define NUM_P5_PHY 2
|
||||
|
||||
@@ -67,6 +68,7 @@ extern RAN_CONTEXT_t RC;
|
||||
|
||||
extern void phy_init_RU(RU_t *);
|
||||
extern int config_sync_var;
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
extern pthread_cond_t nfapi_sync_cond;
|
||||
extern pthread_mutex_t nfapi_sync_mutex;
|
||||
@@ -74,45 +76,6 @@ extern int nfapi_sync_var;
|
||||
|
||||
extern int sync_var;
|
||||
|
||||
extern void init_eNB_afterRU(void);
|
||||
extern void init_UE_stub(int nb_inst,int,int);
|
||||
extern void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB, int frame, int subframe, L1_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu);
|
||||
extern void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, nfapi_ul_config_request_pdu_t *ul_config_pdu, uint16_t frame,uint8_t subframe,uint8_t srs_present);
|
||||
extern void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame, int subframe, L1_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu, uint8_t codeword_index, uint8_t *sdu);
|
||||
extern void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame, int subframe, L1_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu);
|
||||
extern void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame, int subframe, L1_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu);
|
||||
extern void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu, uint8_t *sdu);
|
||||
extern void handle_nfapi_nr_ul_dci_pdu(PHY_VARS_gNB *gNB,
|
||||
int frame, int slot,
|
||||
nfapi_nr_ul_dci_request_pdus_t *ul_dci_request_pdu);
|
||||
extern void handle_nfapi_nr_pdcch_pdu(PHY_VARS_gNB *gNB,
|
||||
int frame, int slot,
|
||||
nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu);
|
||||
extern void handle_nr_nfapi_pdsch_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
|
||||
nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
|
||||
uint8_t *sdu);
|
||||
extern void handle_nr_nfapi_ssb_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
|
||||
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu);
|
||||
extern void nr_fill_ulsch(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int slot,
|
||||
nfapi_nr_pusch_pdu_t *ulsch_pdu);
|
||||
extern void nr_fill_pucch(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int slot,
|
||||
nfapi_nr_pucch_pdu_t *pucch_pdu);
|
||||
extern void nr_fill_prach(PHY_VARS_gNB *gNB,
|
||||
int SFN,
|
||||
int Slot,
|
||||
nfapi_nr_prach_pdu_t *prach_pdu);
|
||||
extern void nr_fill_prach_ru(RU_t *ru,
|
||||
int SFN,
|
||||
int Slot,
|
||||
nfapi_nr_prach_pdu_t *prach_pdu);
|
||||
|
||||
|
||||
|
||||
|
||||
nfapi_tx_request_pdu_t *tx_request_pdu[1023][10][10]; // [frame][subframe][max_num_pdus]
|
||||
uint8_t nr_tx_pdus[32][16][4096];
|
||||
nfapi_nr_pdu_t *tx_data_request[1023][20][10]; //[frame][slot][max_num_pdus]
|
||||
@@ -1146,18 +1109,14 @@ int pnf_phy_ul_dci_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
|
||||
|
||||
// LOG_D(PHY,"[PNF] HI_DCI0_REQUEST SFN/SF:%05d dci:%d hi:%d\n", NFAPI_SFNSF2DEC(req->sfn_sf), req->hi_dci0_request_body.number_of_dci, req->hi_dci0_request_body.number_of_hi);
|
||||
|
||||
//phy_info* phy = (phy_info*)(pnf_p7->user_data);
|
||||
struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
|
||||
if (proc ==NULL)
|
||||
proc = &gNB->proc.L1_proc;
|
||||
|
||||
for (int i=0; i<req->numPdus; i++) {
|
||||
//LOG_D(PHY,"[PNF] HI_DCI0_REQ sfn_sf:%d PDU[%d]\n", NFAPI_SFNSF2DEC(req->sfn_sf), i);
|
||||
if (req->ul_dci_pdu_list[i].PDUType == 0) {
|
||||
//LOG_D(PHY,"[PNF] HI_DCI0_REQ sfn_sf:%d PDU[%d] - NFAPI_HI_DCI0_DCI_PDU_TYPE\n", NFAPI_SFNSF2DEC(req->sfn_sf), i);
|
||||
nfapi_nr_ul_dci_request_pdus_t *ul_dci_req_pdu = &req->ul_dci_pdu_list[i];
|
||||
int SFN=req->SFN+2;
|
||||
handle_nfapi_nr_ul_dci_pdu(gNB, SFN, req->Slot, ul_dci_req_pdu);
|
||||
nfapi_nr_ul_dci_request_pdus_t *ul_dci_req_pdu = &req->ul_dci_pdu_list[i];
|
||||
handle_nfapi_nr_ul_dci_pdu(gNB, req->SFN, req->Slot, ul_dci_req_pdu);
|
||||
}
|
||||
else {
|
||||
LOG_E(PHY,"[PNF] UL_DCI_REQ sfn_slot:%d PDU[%d] - unknown pdu type:%d\n", NFAPI_SFNSLOT2DEC(req->SFN, req->Slot), i, req->ul_dci_pdu_list[i].PDUType);
|
||||
@@ -1217,7 +1176,6 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
|
||||
|
||||
int sfn = req->SFN;
|
||||
int slot = req->Slot;
|
||||
|
||||
struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
|
||||
if (proc==NULL)
|
||||
proc = &gNB->proc.L1_proc;
|
||||
@@ -1234,7 +1192,6 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
|
||||
req->dl_tti_request_body.PduIdx);
|
||||
|
||||
for (int i=0; i<req->dl_tti_request_body.nPDUs; i++) {
|
||||
// TODO: enable after adding gNB PDCCH:
|
||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sfn/sf:%d PDU[%d] size:%d pdcch_vars->num_dci:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, dl_config_pdu_list[i].pdu_size,pdcch_vars->num_dci);
|
||||
|
||||
if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE) {
|
||||
@@ -1246,18 +1203,16 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
|
||||
handle_nfapi_nr_pdcch_pdu(gNB, SFN, slot, &dl_tti_pdu->pdcch_pdu);
|
||||
//dl_tti_pdu_list[i].pdcch_pdu.pdcch_pdu_rel15.numDlDci++; // ?
|
||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() pdcch_vars->num_dci:%d\n", __FUNCTION__, pdcch_vars->num_dci);
|
||||
} else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_SSB_PDU_TYPE) {
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PDU:%d BCH: pdu_index:%u pdu_length:%d sdu_length:%d BCH_SDU:%x,%x,%x\n", __FUNCTION__, i, pdu_index, bch_pdu->bch_pdu_rel8.length, tx_request_pdu[sfn][sf][pdu_index]->segments[0].segment_length, sdu[0], sdu[1], sdu[2]);
|
||||
handle_nr_nfapi_ssb_pdu(gNB, sfn, slot, &dl_tti_pdu_list[i]);
|
||||
gNB->pbch_configured=1;
|
||||
//} else {
|
||||
// NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() BCH NULL TX PDU SFN/SF:%d PDU_INDEX:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), pdu_index);
|
||||
//}
|
||||
} else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE) {
|
||||
}
|
||||
else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_SSB_PDU_TYPE) {
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PDU:%d BCH: pdu_index:%u pdu_length:%d sdu_length:%d BCH_SDU:%x,%x,%x\n", __FUNCTION__, i, pdu_index, bch_pdu->bch_pdu_rel8.length, tx_request_pdu[sfn][sf][pdu_index]->segments[0].segment_length, sdu[0], sdu[1], sdu[2]);
|
||||
handle_nr_nfapi_ssb_pdu(gNB, sfn, slot, &dl_tti_pdu_list[i]);
|
||||
gNB->pbch_configured=1;
|
||||
}
|
||||
else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE) {
|
||||
nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu = &dl_tti_pdu_list[i].pdsch_pdu;
|
||||
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15_pdu = &pdsch_pdu->pdsch_pdu_rel15;
|
||||
//nfapi_nr_tx_data_request_t *tx_data = tx_data_request[sfn][slot][rel15_pdu->pduIndex];
|
||||
nfapi_nr_pdu_t *tx_data = tx_data_request[sfn][slot][0];
|
||||
nfapi_nr_pdu_t *tx_data = tx_data_request[sfn][slot][rel15_pdu->pduIndex];
|
||||
|
||||
if (tx_data != NULL) {
|
||||
int UE_id = find_nr_dlsch(rel15_pdu->rnti,gNB,SEARCH_EXIST_OR_FREE);
|
||||
@@ -1270,14 +1225,21 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
|
||||
LOG_E(PHY,"pnf_phy_dl_config_req illegal harq_pid %d\n", harq_pid);
|
||||
return(-1);
|
||||
}
|
||||
//uint8_t *dlsch_sdu = (uint8_t *)tx_data->TLVs[0].value.direct;
|
||||
|
||||
uint8_t *dlsch_sdu = nr_tx_pdus[UE_id][harq_pid];
|
||||
memcpy(dlsch_sdu, tx_data->TLVs[0].value.direct,tx_data->PDU_length);//TODO: Check if required
|
||||
memcpy(dlsch_sdu, tx_data->TLVs[0].value.direct,tx_data->PDU_length);
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() DLSCH:pdu_index:%d handle_nfapi_dlsch_pdu(eNB, proc_rxtx, dlsch_pdu, transport_blocks:%d sdu:%p) eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols:%d\n", __FUNCTION__, rel8_pdu->pdu_index, rel8_pdu->transport_blocks, dlsch_sdu, eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols);
|
||||
handle_nr_nfapi_pdsch_pdu(gNB, sfn, slot,pdsch_pdu, dlsch_sdu);
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() DLSCH NULL TX PDU SFN/SF:%d PDU_INDEX:%d\n", __FUNCTION__, NFAPI_SFNSLOT2DEC(sfn,slot), rel15_pdu->pduIndex); }
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() DLSCH NULL TX PDU SFN/SF:%d PDU_INDEX:%d\n", __FUNCTION__, NFAPI_SFNSLOT2DEC(sfn,slot), rel15_pdu->pduIndex);
|
||||
}
|
||||
}
|
||||
else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE) {
|
||||
nfapi_nr_dl_tti_csi_rs_pdu *csi_rs_pdu = &dl_tti_pdu_list[i].csi_rs_pdu;
|
||||
handle_nfapi_nr_csirs_pdu(gNB, sfn, slot, csi_rs_pdu);
|
||||
}
|
||||
else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() UNKNOWN:%d\n", __FUNCTION__, dl_tti_pdu_list[i].PDUType);
|
||||
}
|
||||
}
|
||||
@@ -1437,13 +1399,10 @@ int pnf_phy_tx_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_tx_request_t *req) {
|
||||
|
||||
|
||||
int pnf_phy_ul_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_nr_ul_tti_request_t *req) {
|
||||
// if (0)LOG_D(PHY,"[PNF] UL_CONFIG_REQ %s() sfn_sf:%d pdu:%d rach_prach_frequency_resources:%d srs_present:%u\n",
|
||||
// __FUNCTION__,
|
||||
// NFAPI_SFNSF2DEC(req->sfn_sf),
|
||||
// req->ul_config_request_body.number_of_pdus,
|
||||
// req->ul_config_request_body.rach_prach_frequency_resources,
|
||||
// req->ul_config_request_body.srs_present
|
||||
// );
|
||||
LOG_D(PHY,"[PNF] UL_TTI_REQ recvd, writing into structs, SFN/slot:%d.%d pdu:%d \n",
|
||||
req->SFN,req->Slot,
|
||||
req->n_pdus
|
||||
);
|
||||
|
||||
if (RC.ru == 0) {
|
||||
return -1;
|
||||
@@ -2199,7 +2158,7 @@ void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_add
|
||||
pnf.phys[0].udp.tx_port = vnf_p7_port;
|
||||
strcpy(pnf.phys[0].udp.tx_addr, vnf_ip_addr);
|
||||
strcpy(pnf.phys[0].local_addr, pnf_ip_addr);
|
||||
printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%u rx:%u]\n",
|
||||
printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%d rx:%d]\n",
|
||||
__FUNCTION__,config->vnf_ip_addr, config->vnf_p5_port,
|
||||
pnf.phys[0].local_addr,
|
||||
pnf.phys[0].udp.tx_addr, pnf.phys[0].udp.tx_port,
|
||||
@@ -2250,7 +2209,7 @@ void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr,
|
||||
pnf.phys[0].udp.tx_port = vnf_p7_port;
|
||||
strcpy(pnf.phys[0].udp.tx_addr, vnf_ip_addr);
|
||||
strcpy(pnf.phys[0].local_addr, pnf_ip_addr);
|
||||
printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%u rx:%u]\n",
|
||||
printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%d rx:%d]\n",
|
||||
__FUNCTION__,
|
||||
config->vnf_ip_addr, config->vnf_p5_port,
|
||||
pnf.phys[0].local_addr,
|
||||
@@ -2307,50 +2266,24 @@ void oai_subframe_ind(uint16_t sfn, uint16_t sf) {
|
||||
}
|
||||
}
|
||||
|
||||
void handle_nr_slot_ind(uint16_t sfn, uint16_t slot) {
|
||||
|
||||
long shift_ns,prev_ts_nsec,shift_us;
|
||||
void oai_slot_ind(uint16_t sfn, uint16_t slot) {
|
||||
|
||||
//slow down PNF
|
||||
|
||||
LOG_D(PHY,"%s(sfn:%d, slot:%d)\n", __FUNCTION__, sfn, slot);
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
|
||||
// if (!(sfn == 0 && slot == 0) && ts.tv_nsec > prev_ts_nsec){
|
||||
// shift_ns = ts.tv_nsec - prev_ts_nsec;
|
||||
// shift_us = shift_ns/1000;
|
||||
// printf("previous: %d, current: %d, shift: %d", prev_ts_nsec, ts.tv_nsec, shift_us);
|
||||
// if(500-shift_us > 0)
|
||||
// usleep(500-shift_us);
|
||||
// // usleep(50);
|
||||
// }
|
||||
prev_ts_nsec = ts.tv_nsec;
|
||||
|
||||
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] %s %d.%d (sfn:%u slot:%u) SFN/SLOT(TX):%u\n", __FUNCTION__, ts.tv_sec, ts.tv_nsec, sfn, slot, NFAPI_SFNSLOT2DEC(sfn, slot));
|
||||
//TODO FIXME - HACK - DJP - using a global to bodge it in
|
||||
if (p7_config_g != NULL && sync_var==0) {
|
||||
// DONE: changed for NR x x x x x x x x x x x x x x - - - - - - : x (Frame), - (Slot) (max_numer =2)
|
||||
uint16_t sfn_slot_tx = sfn<<6 | slot;
|
||||
// if ((sfn % 100 == 0) && slot==0) { // DOUBT: Why 100?
|
||||
// struct timespec ts;
|
||||
// clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] %s %d.%d (sfn:%u slot:%u) SFN/SLOT(TX):%u\n", __FUNCTION__, ts.tv_sec, ts.tv_nsec, sfn, slot, NFAPI_SFNSLOT2DEC(sfn, slot));
|
||||
// }
|
||||
|
||||
//TODO: send p7_config instead of p7_config_g
|
||||
int slot_ret = nfapi_pnf_p7_slot_ind(p7_config_g, p7_config_g->phy_id, sfn, slot);
|
||||
//send VNF slot indication, which is aligned with TX thread, so that it can call the scheduler
|
||||
nfapi_nr_slot_indication_scf_t *ind;
|
||||
ind = (nfapi_nr_slot_indication_scf_t *) malloc(sizeof(nfapi_nr_slot_indication_scf_t));
|
||||
uint8_t slot_ahead = 6;
|
||||
uint32_t sfn_slot_tx = sfnslot_add_slot(sfn, slot, slot_ahead);
|
||||
uint16_t sfn_tx = NFAPI_SFNSLOT2SFN(sfn_slot_tx);
|
||||
uint8_t slot_tx = NFAPI_SFNSLOT2SLOT(sfn_slot_tx);
|
||||
|
||||
// if (subframe_ret) {
|
||||
if (slot_ret) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF](frame:%u slot:%u) SFN/SLOT(TX):%u - PROBLEM with pnf_p7_slot_ind()\n", sfn, slot, sfn_slot_tx);
|
||||
// printing anything causes error: probably because there isn't enough time to accomodate a print statement
|
||||
} else {
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "***NFAPI subframe handler finished *** \n");
|
||||
}
|
||||
} else {
|
||||
}
|
||||
ind->sfn = sfn_tx;
|
||||
ind->slot = slot_tx;
|
||||
oai_nfapi_nr_slot_indication(ind);
|
||||
|
||||
//copy data from appropriate p7 slot buffers into channel structures for PHY processing
|
||||
nfapi_pnf_p7_slot_ind(p7_config_g, p7_config_g->phy_id, sfn, slot);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind) {
|
||||
@@ -2404,6 +2337,12 @@ int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind) {
|
||||
|
||||
//NR UPLINK INDICATION
|
||||
|
||||
int oai_nfapi_nr_slot_indication(nfapi_nr_slot_indication_scf_t *ind) {
|
||||
ind->header.phy_id = 1;
|
||||
ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION;
|
||||
return nfapi_pnf_p7_nr_slot_ind(p7_config_g, ind);
|
||||
}
|
||||
|
||||
int oai_nfapi_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind) {
|
||||
ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||
ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION;
|
||||
|
||||
@@ -19,13 +19,20 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#if !defined(NFAPI_PNF_H__)
|
||||
#define NFAPI_PNF_H__
|
||||
|
||||
extern nfapi_ue_release_request_body_t release_rntis;
|
||||
int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
|
||||
void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
|
||||
void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
|
||||
|
||||
void oai_subframe_ind(uint16_t sfn, uint16_t sf);
|
||||
void oai_slot_ind(uint16_t sfn, uint16_t slot);
|
||||
#endif
|
||||
void handle_nr_slot_ind(uint16_t sfn, uint16_t slot);
|
||||
uint32_t sfnslot_add_slot(uint16_t sfn, uint16_t slot, int offset);
|
||||
|
||||
int oai_nfapi_nr_slot_indication(nfapi_nr_slot_indication_scf_t *ind);
|
||||
int oai_nfapi_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind);
|
||||
int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind);
|
||||
int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind);
|
||||
int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind);
|
||||
int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind);
|
||||
|
||||
|
||||
@@ -33,13 +33,14 @@
|
||||
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
#include "nfapi_vnf_interface.h"
|
||||
#include "nfapi_vnf.h"
|
||||
#include "nfapi.h"
|
||||
#include "vendor_ext.h"
|
||||
|
||||
#include "nfapi_vnf.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
#include <targets/RT/USER/lte-softmodem.h>
|
||||
|
||||
#include "common/ran_context.h"
|
||||
#include "openair2/PHY_INTERFACE/queue.h"
|
||||
@@ -202,7 +203,6 @@ int vnf_unpack_vendor_extension_tlv(nfapi_tl_t *tl, uint8_t **ppReadPackedMessag
|
||||
void install_nr_schedule_handlers(NR_IF_Module_t *if_inst);
|
||||
void install_schedule_handlers(IF_Module_t *if_inst);
|
||||
extern int single_thread_flag;
|
||||
extern void init_eNB_afterRU(void);
|
||||
extern uint16_t sf_ahead;
|
||||
extern uint16_t slot_ahead;
|
||||
|
||||
@@ -245,6 +245,18 @@ void oai_enb_init(void) {
|
||||
|
||||
void oai_create_gnb(void) {
|
||||
int bodge_counter=0;
|
||||
|
||||
if (RC.gNB == NULL) {
|
||||
RC.gNB = (PHY_VARS_gNB **) calloc(1, sizeof(PHY_VARS_gNB *));
|
||||
LOG_I(PHY,"gNB L1 structure RC.gNB allocated @ %p\n",RC.gNB);
|
||||
}
|
||||
|
||||
|
||||
if (RC.gNB[0] == NULL) {
|
||||
RC.gNB[0] = (PHY_VARS_gNB *) calloc(1, sizeof(PHY_VARS_gNB));
|
||||
LOG_I(PHY,"[nr-gnb.c] gNB structure RC.gNB[%d] allocated @ %p\n",0,RC.gNB[0]);
|
||||
}
|
||||
|
||||
PHY_VARS_gNB *gNB = RC.gNB[0];
|
||||
RC.nb_nr_CC = (int *)malloc(sizeof(int)); // TODO: find a better function to place this in
|
||||
|
||||
@@ -590,7 +602,7 @@ extern pthread_mutex_t nfapi_sync_mutex;
|
||||
extern int nfapi_sync_var;
|
||||
|
||||
int phy_sync_indication(struct nfapi_vnf_p7_config *config, uint8_t sync) {
|
||||
printf("[VNF] SYNC %s\n", sync==1 ? "ACHIEVED" : "LOST");
|
||||
//printf("[VNF] SYNC %s\n", sync==1 ? "ACHIEVED" : "LOST");
|
||||
|
||||
if (sync==1 && nfapi_sync_var!=0) {
|
||||
|
||||
@@ -1215,6 +1227,49 @@ int phy_cqi_indication(struct nfapi_vnf_p7_config *config, nfapi_cqi_indication_
|
||||
return 1;
|
||||
}
|
||||
|
||||
//NR phy indication
|
||||
|
||||
int phy_nr_slot_indication(nfapi_nr_slot_indication_scf_t *ind) {
|
||||
|
||||
uint8_t vnf_slot_ahead = 2;
|
||||
uint32_t vnf_sfn_slot = sfnslot_add_slot(ind->sfn, ind->slot, vnf_slot_ahead);
|
||||
uint16_t vnf_sfn = NFAPI_SFNSLOT2SFN(vnf_sfn_slot);
|
||||
uint8_t vnf_slot = NFAPI_SFNSLOT2SLOT(vnf_sfn_slot); //offsetting the vnf from pnf by vnf_slot_head slots
|
||||
struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
|
||||
pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
gNB->UL_INFO.frame = vnf_sfn;
|
||||
gNB->UL_INFO.slot = vnf_slot;
|
||||
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||
LOG_D(MAC, "VNF SFN/Slot %d.%d \n", gNB->UL_INFO.frame, gNB->UL_INFO.slot);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int phy_nr_srs_indication(nfapi_nr_srs_indication_t *ind) {
|
||||
struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
|
||||
pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
|
||||
gNB->UL_INFO.srs_ind = *ind;
|
||||
|
||||
if (ind->number_of_pdus > 0)
|
||||
gNB->UL_INFO.srs_ind.pdu_list = malloc(sizeof(nfapi_nr_srs_indication_pdu_t)*ind->number_of_pdus);
|
||||
|
||||
for (int i=0; i<ind->number_of_pdus; i++) {
|
||||
memcpy(&gNB->UL_INFO.srs_ind.pdu_list[i], &ind->pdu_list[i], sizeof(ind->pdu_list[0]));
|
||||
|
||||
LOG_D(MAC, "%s() NFAPI SFN/Slot:%d.%d SRS_IND:number_of_pdus:%d UL_INFO:pdus:%d\n",
|
||||
__FUNCTION__,
|
||||
ind->sfn,ind->slot, ind->number_of_pdus, gNB->UL_INFO.srs_ind.number_of_pdus
|
||||
);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||
|
||||
return 1;
|
||||
}
|
||||
//end NR phy indication
|
||||
|
||||
int phy_lbt_dl_indication(struct nfapi_vnf_p7_config *config, nfapi_lbt_dl_indication_t *ind) {
|
||||
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
|
||||
//mac_lbt_dl_ind(p7_vnf->mac, ind);
|
||||
@@ -1385,6 +1440,8 @@ void *vnf_nr_p7_thread_start(void *ptr) {
|
||||
p7_vnf->config->lbt_dl_indication = &phy_lbt_dl_indication;
|
||||
p7_vnf->config->nb_harq_indication = &phy_nb_harq_indication;
|
||||
p7_vnf->config->nrach_indication = &phy_nrach_indication;
|
||||
p7_vnf->config->nr_slot_indication = &phy_nr_slot_indication;
|
||||
p7_vnf->config->nr_srs_indication = &phy_nr_srs_indication;
|
||||
p7_vnf->config->malloc = &vnf_allocate;
|
||||
p7_vnf->config->free = &vnf_deallocate;
|
||||
p7_vnf->config->vendor_ext = &phy_vendor_ext;
|
||||
@@ -1718,8 +1775,8 @@ void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port) {
|
||||
nfapi_setmode(NFAPI_MODE_VNF);
|
||||
memset(&vnf, 0, sizeof(vnf));
|
||||
memset(vnf.p7_vnfs, 0, sizeof(vnf.p7_vnfs));
|
||||
vnf.p7_vnfs[0].timing_window = 32;
|
||||
vnf.p7_vnfs[0].periodic_timing_enabled = 1;
|
||||
vnf.p7_vnfs[0].timing_window = 30;
|
||||
vnf.p7_vnfs[0].periodic_timing_enabled = 0;
|
||||
vnf.p7_vnfs[0].aperiodic_timing_enabled = 0;
|
||||
vnf.p7_vnfs[0].periodic_timing_period = 10;
|
||||
vnf.p7_vnfs[0].config = nfapi_vnf_p7_config_create();
|
||||
@@ -1853,7 +1910,7 @@ int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req)
|
||||
//LOG_I(PHY, "sfn:%d,slot:%d\n",dl_config_req->SFN,dl_config_req->Slot);
|
||||
//printf("\nEntering oai_nfapi_nr_dl_config_req sfn:%d,slot:%d\n",dl_config_req->SFN,dl_config_req->Slot);
|
||||
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
|
||||
dl_config_req->header.message_id= NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST;
|
||||
dl_config_req->header.message_id= NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST;
|
||||
dl_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||
|
||||
int retval = nfapi_vnf_p7_nr_dl_config_req(p7_config, dl_config_req);
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#if !defined(NFAPI_VNF_H__)
|
||||
#define NFAPI_VNF_H__
|
||||
|
||||
void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port);
|
||||
void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port);
|
||||
#endif
|
||||
|
||||
uint32_t sfnslot_add_slot(uint16_t sfn, uint16_t slot, int offset);
|
||||
|
||||
|
||||
@@ -101,6 +101,8 @@ typedef struct {
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8_t harq_pid;
|
||||
uint8_t ack_nack;
|
||||
uint32_t pdu_length;
|
||||
uint8_t* pdu;
|
||||
} fapi_nr_pdsch_pdu_t;
|
||||
@@ -112,20 +114,14 @@ typedef struct {
|
||||
uint8_t ssb_length;
|
||||
uint16_t cell_id;
|
||||
uint16_t ssb_start_subcarrier;
|
||||
short rsrp_dBm;
|
||||
} fapi_nr_ssb_pdu_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t pdu_length;
|
||||
uint8_t* pdu;
|
||||
uint32_t sibs_mask;
|
||||
} fapi_nr_sib_pdu_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t pdu_type;
|
||||
union {
|
||||
fapi_nr_pdsch_pdu_t pdsch_pdu;
|
||||
fapi_nr_ssb_pdu_t ssb_pdu;
|
||||
fapi_nr_sib_pdu_t sib_pdu;
|
||||
};
|
||||
} fapi_nr_rx_indication_body_t;
|
||||
|
||||
@@ -187,87 +183,33 @@ typedef struct {
|
||||
} fapi_nr_ul_config_prach_pdu;
|
||||
|
||||
typedef struct {
|
||||
|
||||
pucch_format_nr_t format; /* format 0 1 2 3 4 */
|
||||
uint8_t initialCyclicShift; /* x x */
|
||||
uint8_t nrofSymbols; /* x x x x x */
|
||||
uint8_t startingSymbolIndex; /* x x x x x */
|
||||
uint8_t timeDomainOCC; /* x */
|
||||
uint8_t nrofPRBs; /* x x */
|
||||
uint16_t startingPRB; /* maxNrofPhysicalResourceBlocks = 275 */
|
||||
uint8_t occ_length; /* x */
|
||||
uint8_t occ_Index; /* x */
|
||||
|
||||
feature_status_t intraSlotFrequencyHopping;
|
||||
uint16_t secondHopPRB;
|
||||
|
||||
/*
|
||||
-- Enabling inter-slot frequency hopping when PUCCH Format 1, 3 or 4 is repeated over multiple slots.
|
||||
-- The field is not applicable for format 2.
|
||||
*/
|
||||
feature_status_t interslotFrequencyHopping;
|
||||
/*
|
||||
-- Enabling 2 DMRS symbols per hop of a PUCCH Format 3 or 4 if both hops are more than X symbols when FH is enabled (X=4).
|
||||
-- Enabling 4 DMRS sybmols for a PUCCH Format 3 or 4 with more than 2X+1 symbols when FH is disabled (X=4).
|
||||
-- Corresponds to L1 parameter 'PUCCH-F3-F4-additional-DMRS' (see 38.213, section 9.2.1)
|
||||
-- The field is not applicable for format 1 and 2.
|
||||
*/
|
||||
enable_feature_t additionalDMRS;
|
||||
/*
|
||||
-- Max coding rate to determine how to feedback UCI on PUCCH for format 2, 3 or 4
|
||||
-- Corresponds to L1 parameter 'PUCCH-F2-maximum-coderate', 'PUCCH-F3-maximum-coderate' and 'PUCCH-F4-maximum-coderate'
|
||||
-- (see 38.213, section 9.2.5)
|
||||
-- The field is not applicable for format 1.
|
||||
*/
|
||||
PUCCH_MaxCodeRate_t maxCodeRate;
|
||||
/*
|
||||
-- Number of slots with the same PUCCH F1, F3 or F4. When the field is absent the UE applies the value n1.
|
||||
-- Corresponds to L1 parameter 'PUCCH-F1-number-of-slots', 'PUCCH-F3-number-of-slots' and 'PUCCH-F4-number-of-slots'
|
||||
-- (see 38.213, section 9.2.6)
|
||||
-- The field is not applicable for format 2.
|
||||
*/
|
||||
uint8_t nrofSlots;
|
||||
/*
|
||||
-- Enabling pi/2 BPSK for UCI symbols instead of QPSK for PUCCH.
|
||||
-- Corresponds to L1 parameter 'PUCCH-PF3-PF4-pi/2PBSK' (see 38.213, section 9.2.5)
|
||||
-- The field is not applicable for format 1 and 2.
|
||||
*/
|
||||
feature_status_t pi2PBSK;
|
||||
/*
|
||||
-- Enabling simultaneous transmission of CSI and HARQ-ACK feedback with or without SR with PUCCH Format 2, 3 or 4
|
||||
-- Corresponds to L1 parameter 'PUCCH-F2-Simultaneous-HARQ-ACK-CSI', 'PUCCH-F3-Simultaneous-HARQ-ACK-CSI' and
|
||||
-- 'PUCCH-F4-Simultaneous-HARQ-ACK-CSI' (see 38.213, section 9.2.5)
|
||||
-- When the field is absent the UE applies the value OFF
|
||||
-- The field is not applicable for format 1.
|
||||
*/
|
||||
enable_feature_t simultaneousHARQ_ACK_CSI;
|
||||
/*
|
||||
-- Configuration of group- and sequence hopping for all the PUCCH formats 0, 1, 3 and 4. "neither" implies neither group
|
||||
-- or sequence hopping is enabled. "enable" enables group hopping and disables sequence hopping. "disable"” disables group
|
||||
-- hopping and enables sequence hopping. Corresponds to L1 parameter 'PUCCH-GroupHopping' (see 38.211, section 6.4.1.3)
|
||||
pucch-GroupHopping ENUMERATED { neither, enable, disable },
|
||||
*/
|
||||
pucch_GroupHopping_t pucch_GroupHopping;
|
||||
/*
|
||||
-- Cell-Specific scrambling ID for group hoppping and sequence hopping if enabled.
|
||||
-- Corresponds to L1 parameter 'HoppingID' (see 38.211, section 6.3.2.2)
|
||||
hoppingId BIT STRING (SIZE (10)) OPTIONAL, -- Need R
|
||||
*/
|
||||
uint16_t hoppingId;
|
||||
/*
|
||||
-- Power control parameter P0 for PUCCH transmissions. Value in dBm. Only even values (step size 2) allowed.
|
||||
-- Corresponds to L1 parameter 'p0-nominal-pucch' (see 38.213, section 7.2)
|
||||
p0-nominal INTEGER (-202..24) OPTIONAL, -- Need R
|
||||
*/
|
||||
int8_t p0_nominal;
|
||||
|
||||
int8_t deltaF_PUCCH_f[NUMBER_PUCCH_FORMAT_NR];
|
||||
uint8_t p0_PUCCH_Id; /* INTEGER (1..8) */
|
||||
int8_t p0_PUCCH_Value;
|
||||
// pathlossReferenceRSs SEQUENCE (SIZE (1..maxNrofPUCCH-PathlossReferenceRSs)) OF PUCCH-PathlossReferenceRS OPTIONAL, -- Need M
|
||||
int8_t twoPUCCH_PC_AdjustmentStates;
|
||||
|
||||
} fapi_nr_ul_config_pucch_pdu;
|
||||
uint16_t rnti;
|
||||
uint16_t bwp_size;
|
||||
uint16_t bwp_start;
|
||||
uint8_t format_type;
|
||||
uint8_t start_symbol_index;
|
||||
uint8_t nr_of_symbols;
|
||||
uint16_t prb_start;
|
||||
uint16_t prb_size;
|
||||
uint32_t hopping_id;
|
||||
uint8_t freq_hop_flag;
|
||||
uint8_t group_hop_flag;
|
||||
uint8_t sequence_hop_flag;
|
||||
uint16_t second_hop_prb;
|
||||
uint16_t initial_cyclic_shift;
|
||||
uint8_t time_domain_occ_idx;
|
||||
uint8_t add_dmrs_flag;
|
||||
uint16_t dmrs_scrambling_id;
|
||||
uint16_t data_scrambling_id;
|
||||
uint8_t dmrs_cyclic_shift;
|
||||
uint8_t pi_2bpsk;
|
||||
uint8_t mcs;
|
||||
uint8_t pre_dft_occ_idx;
|
||||
uint8_t pre_dft_occ_len;
|
||||
int16_t pucch_tx_power;
|
||||
uint32_t n_bit;
|
||||
uint64_t payload;
|
||||
} fapi_nr_ul_config_pucch_pdu;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -459,11 +401,8 @@ typedef struct {
|
||||
uint8_t tb2_rv;
|
||||
uint8_t harq_process_nbr;
|
||||
vrb_to_prb_mapping_t vrb_to_prb_mapping;
|
||||
uint8_t dai;
|
||||
double scaling_factor_S;
|
||||
int8_t accumulated_delta_PUCCH;
|
||||
uint8_t pucch_resource_id;
|
||||
uint8_t pdsch_to_harq_feedback_time_ind;
|
||||
uint8_t n_dmrs_cdm_groups;
|
||||
uint8_t dmrs_ports[10];
|
||||
uint8_t n_front_load_symb;
|
||||
@@ -510,437 +449,6 @@ typedef struct {
|
||||
} fapi_nr_dl_config_request_t;
|
||||
|
||||
|
||||
//
|
||||
// P5
|
||||
//
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
fapi_nr_coreset_t coreset;
|
||||
|
||||
uint8_t monitoring_slot_peridicity;
|
||||
uint8_t monitoring_slot_offset;
|
||||
uint16_t duration;
|
||||
uint16_t monitoring_symbols_within_slot;
|
||||
uint8_t number_of_candidates[5]; // aggregation level 1, 2, 4, 8, 16
|
||||
|
||||
uint8_t dci_2_0_number_of_candidates[5]; // aggregation level 1, 2, 4, 8, 16
|
||||
uint8_t dci_2_3_monitorying_periodicity;
|
||||
uint8_t dci_2_3_number_of_candidates;
|
||||
|
||||
} fapi_nr_search_space_t;
|
||||
|
||||
typedef struct {
|
||||
fapi_nr_search_space_t search_space_sib1;
|
||||
fapi_nr_search_space_t search_space_others_sib;
|
||||
fapi_nr_search_space_t search_space_paging;
|
||||
//fapi_nr_coreset_t coreset_ra; // common coreset
|
||||
fapi_nr_search_space_t search_space_ra;
|
||||
} fapi_nr_pdcch_config_common_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t k0;
|
||||
uint8_t mapping_type;
|
||||
uint8_t symbol_starting;
|
||||
uint8_t symbol_length;
|
||||
} fapi_nr_pdsch_time_domain_resource_allocation_t;
|
||||
|
||||
typedef struct {
|
||||
fapi_nr_pdsch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_DL_ALLOCATIONS];
|
||||
} fapi_nr_pdsch_config_common_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t prach_configuration_index;
|
||||
uint8_t msg1_fdm;
|
||||
uint8_t msg1_frequency_start;
|
||||
uint8_t zero_correlation_zone_config;
|
||||
uint8_t preamble_received_target_power;
|
||||
uint8_t preamble_transmission_max;
|
||||
uint8_t power_ramping_step;
|
||||
uint8_t ra_window_size;
|
||||
|
||||
uint8_t total_number_of_preamble;
|
||||
uint8_t ssb_occasion_per_rach;
|
||||
uint8_t cb_preamble_per_ssb;
|
||||
|
||||
uint8_t group_a_msg3_size;
|
||||
uint8_t group_a_number_of_preamble;
|
||||
uint8_t group_b_power_offset;
|
||||
uint8_t contention_resolution_timer;
|
||||
uint8_t rsrp_threshold_ssb;
|
||||
uint8_t rsrp_threshold_ssb_sul;
|
||||
uint8_t prach_length; // l839, l139
|
||||
uint8_t prach_root_sequence_index; // 0 - 837 for l839, 0 - 137 for l139
|
||||
uint8_t msg1_subcarrier_spacing;
|
||||
uint8_t restrictedset_config;
|
||||
uint8_t msg3_transform_precoding;
|
||||
} fapi_nr_rach_config_common_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t k2;
|
||||
uint8_t mapping_type;
|
||||
uint8_t symbol_starting;
|
||||
uint8_t symbol_length;
|
||||
} fapi_nr_pusch_time_domain_resource_allocation_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t group_hopping_enabled_transform_precoding;
|
||||
fapi_nr_pusch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_UL_ALLOCATIONS];
|
||||
uint8_t msg3_delta_preamble;
|
||||
uint8_t p0_nominal_with_grant;
|
||||
} fapi_nr_pusch_config_common_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t pucch_resource_common;
|
||||
uint8_t pucch_group_hopping;
|
||||
uint8_t hopping_id;
|
||||
uint8_t p0_nominal;
|
||||
} fapi_nr_pucch_config_common_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
fapi_nr_pdcch_config_common_t pdcch_config_common;
|
||||
fapi_nr_pdsch_config_common_t pdsch_config_common;
|
||||
|
||||
} fapi_nr_dl_bwp_common_config_t;
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint16_t int_rnti;
|
||||
uint8_t time_frequency_set;
|
||||
uint8_t dci_payload_size;
|
||||
uint8_t serving_cell_id[FAPI_NR_MAX_NUM_SERVING_CELLS]; // interrupt configuration per serving cell
|
||||
uint8_t position_in_dci[FAPI_NR_MAX_NUM_SERVING_CELLS]; // interrupt configuration per serving cell
|
||||
} fapi_nr_downlink_preemption_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t tpc_index;
|
||||
uint8_t tpc_index_sul;
|
||||
uint8_t target_cell;
|
||||
} fapi_nr_pusch_tpc_command_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t tpc_index_pcell;
|
||||
uint8_t tpc_index_pucch_scell;
|
||||
} fapi_nr_pucch_tpc_command_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t starting_bit_of_format_2_3;
|
||||
uint8_t feild_type_format_2_3;
|
||||
} fapi_nr_srs_tpc_command_config_t;
|
||||
|
||||
typedef struct {
|
||||
fapi_nr_downlink_preemption_t downlink_preemption;
|
||||
fapi_nr_pusch_tpc_command_config_t tpc_pusch;
|
||||
fapi_nr_pucch_tpc_command_config_t tpc_pucch;
|
||||
fapi_nr_srs_tpc_command_config_t tpc_srs;
|
||||
} fapi_nr_pdcch_config_dedicated_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t dmrs_type;
|
||||
uint8_t dmrs_addition_position;
|
||||
uint8_t max_length;
|
||||
uint16_t scrambling_id0;
|
||||
uint16_t scrambling_id1;
|
||||
uint8_t ptrs_frequency_density[2]; // phase tracking rs
|
||||
uint8_t ptrs_time_density[3]; // phase tracking rs
|
||||
uint8_t ptrs_epre_ratio; // phase tracking rs
|
||||
uint8_t ptrs_resource_element_offset; // phase tracking rs
|
||||
} fapi_nr_dmrs_downlink_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t bwp_or_cell_level;
|
||||
uint8_t pattern_type;
|
||||
uint32_t resource_blocks[9]; // bitmaps type 275 bits
|
||||
uint8_t slot_type; // bitmaps type one/two slot(s)
|
||||
uint32_t symbols_in_resouece_block; // bitmaps type 14/28 bits
|
||||
uint8_t periodic; // bitmaps type
|
||||
uint32_t pattern[2]; // bitmaps type 2/4/5/8/10/20/40 bits
|
||||
|
||||
fapi_nr_coreset_t coreset; // coreset
|
||||
|
||||
uint8_t subcarrier_spacing;
|
||||
uint8_t mode;
|
||||
} fapi_nr_rate_matching_pattern_group_t;
|
||||
|
||||
typedef struct {
|
||||
// resource mapping
|
||||
uint8_t row; // row1/row2/row4/other
|
||||
uint16_t frequency_domain_allocation; // 4/12/3/6 bits
|
||||
uint8_t number_of_ports;
|
||||
uint8_t first_ofdm_symbol_in_time_domain;
|
||||
uint8_t first_ofdm_symbol_in_time_domain2;
|
||||
uint8_t cdm_type;
|
||||
uint8_t density; // .5/1/3
|
||||
uint8_t density_dot5_type; // even/odd PRBs
|
||||
|
||||
uint8_t frequency_band_starting_rb; // freqBand
|
||||
uint8_t frequency_band_number_of_rb; // freqBand
|
||||
|
||||
// periodicityAndOffset
|
||||
uint8_t periodicity; // slot4/5/8/10/16/20/32/40/64/80/160/320/640
|
||||
uint32_t offset; // 0..639 bits
|
||||
} fapi_nr_zp_csi_rs_resource_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t data_scrambling_id_pdsch;
|
||||
fapi_nr_dmrs_downlink_config_t dmrs_dl_for_pdsch_mapping_type_a;
|
||||
fapi_nr_dmrs_downlink_config_t dmrs_dl_for_pdsch_mapping_type_b;
|
||||
uint8_t vrb_to_prb_interleaver;
|
||||
uint8_t resource_allocation;
|
||||
fapi_nr_pdsch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_DL_ALLOCATIONS];
|
||||
uint8_t pdsch_aggregation_factor;
|
||||
fapi_nr_rate_matching_pattern_group_t rate_matching_pattern_group1;
|
||||
fapi_nr_rate_matching_pattern_group_t rate_matching_pattern_group2;
|
||||
uint8_t rbg_size;
|
||||
uint8_t mcs_table;
|
||||
uint8_t max_num_of_code_word_scheduled_by_dci;
|
||||
uint8_t bundle_size; // prb_bundling static
|
||||
uint8_t bundle_size_set1; // prb_bundling dynamic
|
||||
uint8_t bundle_size_set2; // prb_bundling dynamic
|
||||
fapi_nr_zp_csi_rs_resource_t periodically_zp_csi_rs_resource_set[FAPI_NR_MAX_NUM_ZP_CSI_RS_RESOURCE_PER_SET];
|
||||
} fapi_nr_pdsch_config_dedicated_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t starting_prb;
|
||||
uint8_t intra_slot_frequency_hopping;
|
||||
uint16_t second_hop_prb;
|
||||
uint8_t format; // pucch format 0..4
|
||||
uint8_t initial_cyclic_shift;
|
||||
uint8_t number_of_symbols;
|
||||
uint8_t starting_symbol_index;
|
||||
uint8_t time_domain_occ;
|
||||
uint8_t number_of_prbs;
|
||||
uint8_t occ_length;
|
||||
uint8_t occ_index;
|
||||
} fapi_nr_pucch_resource_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t periodicity;
|
||||
uint8_t number_of_harq_process;
|
||||
fapi_nr_pucch_resource_t n1_pucch_an;
|
||||
} fapi_nr_sps_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t beam_failure_instance_max_count;
|
||||
uint8_t beam_failure_detection_timer;
|
||||
} fapi_nr_radio_link_monitoring_config_t;
|
||||
|
||||
typedef struct {
|
||||
fapi_nr_pdcch_config_dedicated_t pdcch_config_dedicated;
|
||||
fapi_nr_pdsch_config_dedicated_t pdsch_config_dedicated;
|
||||
fapi_nr_sps_config_t sps_config;
|
||||
fapi_nr_radio_link_monitoring_config_t radio_link_monitoring_config;
|
||||
|
||||
} fapi_nr_dl_bwp_dedicated_config_t;
|
||||
|
||||
typedef struct {
|
||||
fapi_nr_rach_config_common_t rach_config_common;
|
||||
fapi_nr_pusch_config_common_t pusch_config_common;
|
||||
fapi_nr_pucch_config_common_t pucch_config_common;
|
||||
|
||||
} fapi_nr_ul_bwp_common_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t inter_slot_frequency_hopping;
|
||||
uint8_t additional_dmrs;
|
||||
uint8_t max_code_rate;
|
||||
uint8_t number_of_slots;
|
||||
uint8_t pi2bpsk;
|
||||
uint8_t simultaneous_harq_ack_csi;
|
||||
} fapi_nr_pucch_format_config_t;
|
||||
|
||||
typedef struct {
|
||||
fapi_nr_pucch_format_config_t format1;
|
||||
fapi_nr_pucch_format_config_t format2;
|
||||
fapi_nr_pucch_format_config_t format3;
|
||||
fapi_nr_pucch_format_config_t format4;
|
||||
fapi_nr_pucch_resource_t multi_csi_pucch_resources[2];
|
||||
uint8_t dl_data_to_ul_ack[8];
|
||||
// pucch power control
|
||||
uint8_t deltaF_pucch_f0;
|
||||
uint8_t deltaF_pucch_f1;
|
||||
uint8_t deltaF_pucch_f2;
|
||||
uint8_t deltaF_pucch_f3;
|
||||
uint8_t deltaF_pucch_f4;
|
||||
uint8_t two_pucch_pc_adjusment_states;
|
||||
} fapi_nr_pucch_config_dedicated_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t dmrs_type;
|
||||
uint8_t dmrs_addition_position;
|
||||
uint8_t ptrs_uplink_config; // to indicate if PTRS Uplink is configured of not
|
||||
uint8_t ptrs_type; //cp-OFDM, dft-S-OFDM
|
||||
uint16_t ptrs_frequency_density[2];
|
||||
uint8_t ptrs_time_density[3];
|
||||
uint8_t ptrs_max_number_of_ports;
|
||||
uint8_t ptrs_resource_element_offset;
|
||||
uint8_t ptrs_power;
|
||||
uint16_t ptrs_sample_density[5];
|
||||
uint8_t ptrs_time_density_transform_precoding;
|
||||
|
||||
uint8_t max_length;
|
||||
uint16_t scrambling_id0;
|
||||
uint16_t scrambling_id1;
|
||||
uint8_t npusch_identity;
|
||||
uint8_t disable_sequence_group_hopping;
|
||||
uint8_t sequence_hopping_enable;
|
||||
} fapi_nr_dmrs_uplink_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t tpc_accmulation;
|
||||
uint8_t msg3_alpha;
|
||||
uint8_t p0_nominal_with_grant;
|
||||
uint8_t two_pusch_pc_adjustments_states;
|
||||
uint8_t delta_mcs;
|
||||
} fapi_nr_pusch_power_control_t;
|
||||
|
||||
typedef enum {tx_config_codebook = 1, tx_config_nonCodebook = 2} tx_config_t;
|
||||
typedef enum {transform_precoder_enabled = 0, transform_precoder_disabled = 1} transform_precoder_t;
|
||||
typedef enum {
|
||||
codebook_subset_fullyAndPartialAndNonCoherent = 1,
|
||||
codebook_subset_partialAndNonCoherent = 2,
|
||||
codebook_subset_nonCoherent = 3} codebook_subset_t;
|
||||
typedef struct {
|
||||
uint16_t data_scrambling_identity;
|
||||
tx_config_t tx_config;
|
||||
fapi_nr_dmrs_uplink_config_t dmrs_ul_for_pusch_mapping_type_a;
|
||||
fapi_nr_dmrs_uplink_config_t dmrs_ul_for_pusch_mapping_type_b;
|
||||
fapi_nr_pusch_power_control_t pusch_power_control;
|
||||
uint8_t frequency_hopping;
|
||||
uint16_t frequency_hopping_offset_lists[4];
|
||||
uint8_t resource_allocation;
|
||||
fapi_nr_pusch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_UL_ALLOCATIONS];
|
||||
uint8_t pusch_aggregation_factor;
|
||||
uint8_t mcs_table;
|
||||
uint8_t mcs_table_transform_precoder;
|
||||
transform_precoder_t transform_precoder;
|
||||
codebook_subset_t codebook_subset;
|
||||
uint8_t max_rank;
|
||||
uint8_t rbg_size;
|
||||
|
||||
//uci-OnPUSCH
|
||||
uint8_t uci_on_pusch_type; //dynamic, semi-static
|
||||
uint8_t beta_offset_ack_index1[4];
|
||||
uint8_t beta_offset_ack_index2[4];
|
||||
uint8_t beta_offset_ack_index3[4];
|
||||
uint8_t beta_offset_csi_part1_index1[4];
|
||||
uint8_t beta_offset_csi_part1_index2[4];
|
||||
uint8_t beta_offset_csi_part2_index1[4];
|
||||
uint8_t beta_offset_csi_part2_index2[4];
|
||||
|
||||
uint8_t tp_pi2BPSK;
|
||||
} fapi_nr_pusch_config_dedicated_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t frequency_hopping;
|
||||
fapi_nr_dmrs_uplink_config_t cg_dmrs_configuration;
|
||||
uint8_t mcs_table;
|
||||
uint8_t mcs_table_transform_precoder;
|
||||
|
||||
//uci-OnPUSCH
|
||||
uint8_t uci_on_pusch_type; //dynamic, semi-static
|
||||
uint8_t beta_offset_ack_index1[4];
|
||||
uint8_t beta_offset_ack_index2[4];
|
||||
uint8_t beta_offset_ack_index3[4];
|
||||
uint8_t beta_offset_csi_part1_index1[4];
|
||||
uint8_t beta_offset_csi_part1_index2[4];
|
||||
uint8_t beta_offset_csi_part2_index1[4];
|
||||
uint8_t beta_offset_csi_part2_index2[4];
|
||||
|
||||
uint8_t resource_allocation;
|
||||
// rgb-Size structure missing in spec.
|
||||
uint8_t power_control_loop_to_use;
|
||||
// p0-PUSCH-Alpha
|
||||
uint8_t p0;
|
||||
uint8_t alpha;
|
||||
|
||||
uint8_t transform_precoder;
|
||||
uint8_t number_of_harq_process;
|
||||
uint8_t rep_k;
|
||||
uint8_t rep_k_rv;
|
||||
uint8_t periodicity;
|
||||
uint8_t configured_grant_timer;
|
||||
// rrc-ConfiguredUplinkGrant
|
||||
uint16_t time_domain_offset;
|
||||
uint8_t time_domain_allocation;
|
||||
uint32_t frequency_domain_allocation;
|
||||
uint8_t antenna_ports;
|
||||
uint8_t dmrs_seq_initialization;
|
||||
uint8_t precoding_and_number_of_layers;
|
||||
uint8_t srs_resource_indicator;
|
||||
uint8_t mcs_and_tbs;
|
||||
uint8_t frequency_hopping_offset;
|
||||
uint8_t path_loss_reference_index;
|
||||
|
||||
} fapi_nr_configured_grant_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t qcl_type1_serving_cell_index;
|
||||
uint8_t qcl_type1_bwp_id;
|
||||
uint8_t qcl_type1_rs_type; // csi-rs or ssb
|
||||
uint8_t qcl_type1_nzp_csi_rs_resource_id;
|
||||
uint8_t qcl_type1_ssb_index;
|
||||
uint8_t qcl_type1_type;
|
||||
|
||||
uint8_t qcl_type2_serving_cell_index;
|
||||
uint8_t qcl_type2_bwp_id;
|
||||
uint8_t qcl_type2_rs_type; // csi-rs or ssb
|
||||
uint8_t qcl_type2_nzp_csi_rs_resource_id;
|
||||
uint8_t qcl_type2_ssb_index;
|
||||
uint8_t qcl_type2_type;
|
||||
|
||||
} fapi_nr_tci_state_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t root_sequence_index;
|
||||
// rach genertic
|
||||
uint8_t prach_configuration_index;
|
||||
uint8_t msg1_fdm;
|
||||
uint8_t msg1_frequency_start;
|
||||
uint8_t zero_correlation_zone_config;
|
||||
uint8_t preamble_received_target_power;
|
||||
uint8_t preamble_transmission_max;
|
||||
uint8_t power_ramping_step;
|
||||
uint8_t ra_window_size;
|
||||
|
||||
uint8_t rsrp_threshold_ssb;
|
||||
// PRACH-ResourceDedicatedBFR
|
||||
uint8_t bfr_ssb_index[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
uint8_t bfr_ssb_ra_preamble_index[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
// NZP-CSI-RS-Resource
|
||||
uint8_t bfr_csi_rs_nzp_resource_mapping[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
uint8_t bfr_csi_rs_power_control_offset[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
uint8_t bfr_csi_rs_power_control_offset_ss[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
uint16_t bfr_csi_rs_scrambling_id[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
uint8_t bfr_csi_rs_resource_periodicity[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
uint16_t bfr_csi_rs_resource_offset[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
fapi_nr_tci_state_t qcl_infomation_periodic_csi_rs[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
|
||||
uint8_t bfr_csirs_ra_occasions[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
uint8_t bfr_csirs_ra_preamble_index[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS][FAPI_NR_MAX_RA_OCCASION_PER_CSIRS];
|
||||
|
||||
uint8_t ssb_per_rach_occasion;
|
||||
uint8_t ra_ssb_occasion_mask_index;
|
||||
fapi_nr_search_space_t recovery_search_space;
|
||||
// RA-Prioritization
|
||||
uint8_t power_ramping_step_high_priority;
|
||||
uint8_t scaling_factor_bi;
|
||||
uint8_t beam_failure_recovery_timer;
|
||||
} fapi_nr_beam_failure_recovery_config_t;
|
||||
|
||||
typedef struct {
|
||||
fapi_nr_pucch_config_dedicated_t pucch_config_dedicated;
|
||||
fapi_nr_pusch_config_dedicated_t pusch_config_dedicated;
|
||||
fapi_nr_configured_grant_config_t configured_grant_config;
|
||||
// SRS-Config
|
||||
uint8_t srs_tpc_accumulation;
|
||||
fapi_nr_beam_failure_recovery_config_t beam_failure_recovery_config;
|
||||
|
||||
} fapi_nr_ul_bwp_dedicated_config_t;
|
||||
|
||||
#define FAPI_NR_CONFIG_REQUEST_MASK_PBCH 0x01
|
||||
#define FAPI_NR_CONFIG_REQUEST_MASK_DL_BWP_COMMON 0x02
|
||||
#define FAPI_NR_CONFIG_REQUEST_MASK_UL_BWP_COMMON 0x04
|
||||
|
||||
@@ -2729,7 +2729,7 @@ typedef struct {
|
||||
} nfapi_cqi_indication_rel8_t;
|
||||
#define NFAPI_CQI_INDICATION_REL8_TAG 0x202f
|
||||
|
||||
#define NFAPI_CC_MAX 4
|
||||
#define NFAPI_CC_MAX MAX_NUM_CCs
|
||||
typedef struct {
|
||||
nfapi_tl_t tl;
|
||||
uint16_t length;
|
||||
|
||||
@@ -673,6 +673,7 @@ typedef struct {
|
||||
#define NFAPI_NR_SLOT_INDICATION_PERIOD_NUMEROLOGY_3 125 //us
|
||||
|
||||
typedef struct {
|
||||
nfapi_p7_message_header_t header;
|
||||
uint16_t sfn; //0->1023
|
||||
uint16_t slot;//0->319
|
||||
|
||||
@@ -1498,7 +1499,7 @@ typedef struct
|
||||
uint16_t sfn;
|
||||
uint16_t slot;
|
||||
uint16_t number_of_pdus;
|
||||
nfapi_nr_rx_data_pdu_t *pdu_list; //changed from pointer to struct - gokul
|
||||
nfapi_nr_rx_data_pdu_t *pdu_list;
|
||||
|
||||
} nfapi_nr_rx_data_indication_t;
|
||||
|
||||
|
||||
+581
-769
File diff suppressed because it is too large
Load Diff
+1637
-1890
File diff suppressed because it is too large
Load Diff
+1820
-2167
File diff suppressed because it is too large
Load Diff
Executable → Regular
+5997
-6855
File diff suppressed because it is too large
Load Diff
@@ -154,10 +154,17 @@ int pnf_p7_send_message(pnf_p7_t* pnf_p7, uint8_t* msg, uint32_t msg_len);
|
||||
|
||||
int pnf_p7_slot_ind(pnf_p7_t* config, uint16_t phy_id, uint16_t sfn, uint16_t slot);
|
||||
int pnf_p7_subframe_ind(pnf_p7_t* config, uint16_t phy_id, uint16_t sfn_sf);
|
||||
|
||||
int nfapi_pnf_p7_nr_slot_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_slot_indication_scf_t* ind);
|
||||
int nfapi_pnf_p7_nr_rx_data_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rx_data_indication_t* ind);
|
||||
int nfapi_pnf_p7_nr_crc_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_crc_indication_t* ind);
|
||||
int nfapi_pnf_p7_nr_srs_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_srs_indication_t* ind);
|
||||
int nfapi_pnf_p7_nr_uci_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_uci_indication_t* ind);
|
||||
int nfapi_pnf_p7_nr_rach_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rach_indication_t* ind);
|
||||
pnf_p7_rx_message_t* pnf_p7_rx_reassembly_queue_add_segment(pnf_p7_t* pnf_p7, pnf_p7_rx_reassembly_queue_t* queue, uint32_t rx_hr_time, uint16_t sequence_number, uint16_t segment_number, uint8_t m, uint8_t* data, uint16_t data_len);
|
||||
void pnf_p7_rx_reassembly_queue_remove_msg(pnf_p7_t* pnf_p7, pnf_p7_rx_reassembly_queue_t* queue, pnf_p7_rx_message_t* msg);
|
||||
void pnf_p7_rx_reassembly_queue_remove_old_msgs(pnf_p7_t* pnf_p7, pnf_p7_rx_reassembly_queue_t* queue, uint32_t rx_hr_time, uint32_t delta);
|
||||
|
||||
int pnf_nr_p7_pack_and_send_p7_message(pnf_p7_t* pnf_p7, nfapi_p7_message_header_t* header, uint32_t msg_len);
|
||||
|
||||
#endif /* _PNF_P7_H_ */
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ extern "C" {
|
||||
#include <openair2/PHY_INTERFACE/IF_Module.h>
|
||||
#include "nfapi_nr_interface.h"
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include "openair1/PHY/defs_gNB.h"
|
||||
|
||||
|
||||
+105
-159
@@ -156,17 +156,16 @@ nfapi_dl_config_request_t* allocate_nfapi_dl_config_request(pnf_p7_t* pnf_p7)
|
||||
void deallocate_nfapi_dl_tti_request(nfapi_nr_dl_tti_request_t* req, pnf_p7_t* pnf_p7)
|
||||
{
|
||||
//printf("%s() SFN/SF:%d %s req:%p pdu_list:%p\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), pnf_p7->_public.codec_config.deallocate ? "DEALLOCATE" : "FREE", req, req->dl_config_request_body.dl_config_pdu_list);
|
||||
/*
|
||||
if(pnf_p7->_public.codec_config.deallocate)
|
||||
{
|
||||
//nfapi_nr_dl_tti_request_pdu_t *temp = &req->dl_tti_pdu_list;
|
||||
(pnf_p7->_public.codec_config.deallocate)(req);
|
||||
}
|
||||
else
|
||||
{
|
||||
free(req);
|
||||
}
|
||||
*/
|
||||
|
||||
// if(pnf_p7->_public.codec_config.deallocate)
|
||||
// {
|
||||
// (pnf_p7->_public.codec_config.deallocate)(req);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// free(req);
|
||||
// }
|
||||
|
||||
pnf_p7_free(pnf_p7, req);
|
||||
}
|
||||
|
||||
@@ -915,14 +914,13 @@ void send_dummy_subframe(pnf_p7_t* pnf_p7, uint16_t sfn_sf)
|
||||
|
||||
|
||||
int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t slot)
|
||||
{
|
||||
{
|
||||
//This function is aligned with rx sfn/slot
|
||||
|
||||
// We could either send an event to the p7 thread have have it run the
|
||||
// subframe or we could handle it here and lock access to the subframe
|
||||
// buffers. If we do it on the p7 thread then we run the risk of blocking
|
||||
// on the udp send.
|
||||
//
|
||||
// todo : start a timer to give us more of the 1 ms tick before send back
|
||||
// the frame
|
||||
|
||||
// todo : consider a more efficent lock mechasium
|
||||
//uint16_t NUM_SLOTS = 20;//10* 2^mu
|
||||
@@ -935,21 +933,21 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
||||
|
||||
// save the curren time, sfn and slot
|
||||
pnf_p7->slot_start_time_hr = pnf_get_current_time_hr();
|
||||
pnf_p7->sfn = sfn;
|
||||
|
||||
pnf_p7->slot = slot;
|
||||
|
||||
|
||||
|
||||
slot_ahead = 6;
|
||||
uint32_t sfn_slot_tx = sfnslot_add_slot(sfn, slot, slot_ahead);
|
||||
uint16_t sfn_tx = sfn_slot_tx>>6;
|
||||
uint16_t slot_tx = sfn_slot_tx & 0X3F;
|
||||
uint16_t sfn_tx = NFAPI_SFNSLOT2SFN(sfn_slot_tx);
|
||||
uint8_t slot_tx = NFAPI_SFNSLOT2SLOT(sfn_slot_tx);
|
||||
|
||||
// uint32_t tx_sfn_slot_dec = NFAPI_SFNSLOT2DEC(sfn,slot);
|
||||
uint32_t tx_slot_dec = NFAPI_SFNSLOT2DEC(sfn,slot);
|
||||
//We align the pnf_p7 sfn/slot with tx sfn/slot, and vnf is synced with pnf_p7 sfn/slot. This is so that the scheduler runs slot_ahead from rx thread.
|
||||
|
||||
pnf_p7->sfn = sfn_tx;
|
||||
pnf_p7->slot = slot_tx;
|
||||
|
||||
//uint32_t tx_sfn_slot_dec = NFAPI_SFNSLOT2DEC(sfn_slot_tx);
|
||||
uint32_t rx_slot_dec = NFAPI_SFNSLOT2DEC(sfn, slot);
|
||||
uint8_t buffer_index_rx = rx_slot_dec % 20;
|
||||
|
||||
uint32_t tx_slot_dec = NFAPI_SFNSLOT2DEC(sfn_tx,slot_tx);
|
||||
uint8_t buffer_index_tx = tx_slot_dec % 20;
|
||||
|
||||
// If the subframe_buffer has been configured
|
||||
if(pnf_p7->_public.slot_buffer_size!= 0) // for now value is same as sf_buffer_size
|
||||
@@ -976,28 +974,20 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
||||
pnf_p7->slot_shift = 0;
|
||||
}
|
||||
|
||||
uint32_t slot_dec = NFAPI_SFNSLOT2DEC(sfn, slot);
|
||||
uint8_t buffer_index = slot_dec % pnf_p7->_public.slot_buffer_size;
|
||||
nfapi_pnf_p7_slot_buffer_t* rx_slot_buffer = &(pnf_p7->slot_buffer[buffer_index_rx]);
|
||||
|
||||
nfapi_pnf_p7_slot_buffer_t* slot_buffer = &(pnf_p7->slot_buffer[buffer_index]);
|
||||
// see where the PNF_P7 slot buffer its getting filled
|
||||
nfapi_pnf_p7_slot_buffer_t* tx_slot_buffer = &(pnf_p7->slot_buffer[buffer_index_tx]);
|
||||
|
||||
uint8_t tx_buffer_index = tx_slot_dec % pnf_p7->_public.slot_buffer_size;
|
||||
nfapi_pnf_p7_slot_buffer_t* tx_slot_buffer = &(pnf_p7->slot_buffer[tx_buffer_index]);
|
||||
|
||||
if (0) NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() shift:%d slot_buffer->sfn_sf:%d tx_slot_buffer->sfn_slot:%d sfn_sf:%d subframe_buffer[buffer_index:%u dl_config_req:%p tx_req:%p] "
|
||||
"TX:sfn_sf:%d:tx_buffer_index:%d[dl_config_req:%p tx_req:%p]\n",
|
||||
__FUNCTION__,
|
||||
pnf_p7->slot_shift,
|
||||
NFAPI_SFNSLOT2DEC(slot_buffer->sfn, slot_buffer->slot),
|
||||
NFAPI_SFNSLOT2DEC(tx_slot_buffer->sfn, tx_slot_buffer->slot),
|
||||
slot_dec, buffer_index, slot_buffer->dl_tti_req, slot_buffer->tx_data_req,
|
||||
tx_slot_dec, tx_buffer_index, tx_slot_buffer->dl_tti_req, tx_slot_buffer->tx_data_req);
|
||||
// if (0) NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() shift:%d slot_buffer->sfn_sf:%d tx_slot_buffer->sfn_slot:%d sfn_sf:%d subframe_buffer[buffer_index:%u dl_config_req:%p tx_req:%p] "
|
||||
// "TX:sfn_sf:%d:tx_buffer_index:%d[dl_config_req:%p tx_req:%p]\n",
|
||||
// __FUNCTION__,
|
||||
// pnf_p7->slot_shift,
|
||||
// NFAPI_SFNSLOT2DEC(rx_slot_buffer->sfn, rx_slot_buffer->slot),
|
||||
// NFAPI_SFNSLOT2DEC(tx_slot_buffer->sfn, tx_slot_buffer->slot),
|
||||
// slot_dec, buffer_index_rx, rx_slot_buffer->dl_tti_req, rx_slot_buffer->tx_data_req,
|
||||
// tx_slot_dec, buffer_index_tx, tx_slot_buffer->dl_tti_req, tx_slot_buffer->tx_data_req);
|
||||
//TODO: Change later if required
|
||||
|
||||
|
||||
// if the subframe buffer sfn sf is set then we have atlease 1 message
|
||||
// from the vnf.
|
||||
// todo : how to handle the messages we don't have, send dummies for
|
||||
// now
|
||||
|
||||
@@ -1006,12 +996,16 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
||||
//printf("tx_slot_buff_sfn - %d, tx_slot_buf_slot - %d, sfn_tx = %d, sllot_tx - %d \n",tx_slot_buffer->sfn,tx_slot_buffer->slot,sfn_tx,slot_tx);
|
||||
// if(tx_slot_buffer->slot == slot_tx && tx_slot_buffer->sfn == sfn_tx)
|
||||
// {
|
||||
|
||||
if(tx_slot_buffer->tx_data_req != 0)
|
||||
|
||||
//checking in the tx slot buffers to see if a p7 msg is present. todo: what if it's a mixed slot?
|
||||
|
||||
if(tx_slot_buffer->tx_data_req != 0 && tx_slot_buffer->tx_data_req->SFN == sfn_tx && tx_slot_buffer->tx_data_req->Slot == slot_tx)
|
||||
{
|
||||
|
||||
if(pnf_p7->_public.tx_data_req_fn)
|
||||
{
|
||||
{
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "Calling tx_data_req_fn in SFN/slot %d.%d \n",sfn,slot);
|
||||
LOG_D(PHY, "Process tx_data SFN/slot %d.%d buffer index: %d \n",sfn_tx,slot_tx,buffer_index_tx);
|
||||
(pnf_p7->_public.tx_data_req_fn)(&(pnf_p7->_public), tx_slot_buffer->tx_data_req);
|
||||
}
|
||||
}
|
||||
@@ -1027,11 +1021,11 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(tx_slot_buffer->dl_tti_req != 0)
|
||||
if(tx_slot_buffer->dl_tti_req != 0 && tx_slot_buffer->dl_tti_req->SFN == sfn_tx && tx_slot_buffer->dl_tti_req->Slot == slot_tx)
|
||||
{
|
||||
if(pnf_p7->_public.dl_tti_req_fn)
|
||||
{
|
||||
LOG_D(PHY, "Process dl_tti SFN/slot %d.%d buffer index: %d \n",sfn_tx,slot_tx,buffer_index_tx);
|
||||
(pnf_p7->_public.dl_tti_req_fn)(NULL, &(pnf_p7->_public), tx_slot_buffer->dl_tti_req);
|
||||
}
|
||||
}
|
||||
@@ -1047,10 +1041,12 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
||||
}
|
||||
|
||||
|
||||
if(tx_slot_buffer->ul_dci_req!= 0)
|
||||
if(tx_slot_buffer->ul_dci_req!= 0 && tx_slot_buffer->ul_dci_req->SFN == sfn_tx && tx_slot_buffer->ul_dci_req->Slot == slot_tx)
|
||||
{
|
||||
if(pnf_p7->_public.ul_dci_req_fn)
|
||||
{
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "Calling UL_dci_req_fn in SFN/slot %d.%d \n",sfn,slot);
|
||||
LOG_D(PHY, "Process ul_dci SFN/slot %d.%d buffer index: %d \n",sfn_tx,slot_tx,buffer_index_tx);
|
||||
(pnf_p7->_public.ul_dci_req_fn)(NULL, &(pnf_p7->_public), tx_slot_buffer->ul_dci_req);
|
||||
}
|
||||
}
|
||||
@@ -1081,10 +1077,14 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
||||
(pnf_p7->_public.ul_tti_req_fn)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_slot.ul_tti_req);
|
||||
}
|
||||
}
|
||||
|
||||
//deallocate slot buffers after passing down the PDUs to PHY processing
|
||||
|
||||
if(tx_slot_buffer->dl_tti_req != 0)
|
||||
{
|
||||
deallocate_nfapi_dl_tti_request(tx_slot_buffer->dl_tti_req, pnf_p7);
|
||||
tx_slot_buffer->dl_tti_req = 0;
|
||||
LOG_D(PHY,"SFN/slot %d.%d Buffer index : %d freed \n",sfn_tx,slot_tx,buffer_index_tx);
|
||||
}
|
||||
|
||||
if(tx_slot_buffer->tx_data_req != 0)
|
||||
@@ -1098,72 +1098,52 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
||||
deallocate_nfapi_ul_dci_request(tx_slot_buffer->ul_dci_req, pnf_p7);
|
||||
tx_slot_buffer->ul_dci_req = 0;
|
||||
}
|
||||
|
||||
|
||||
//checking in the rx slot buffers to see if a p7 msg is present.
|
||||
|
||||
if(rx_slot_buffer->ul_tti_req != 0 && rx_slot_buffer->ul_tti_req->SFN == sfn && rx_slot_buffer->ul_tti_req->Slot == slot)
|
||||
{
|
||||
if(pnf_p7->_public.ul_tti_req_fn)
|
||||
{
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "Calling UL_tti_req_fn in SFN/slot %d.%d \n",sfn,slot);
|
||||
(pnf_p7->_public.ul_tti_req_fn)(NULL, &(pnf_p7->_public), rx_slot_buffer->ul_tti_req);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we ever need to "send" a dummy ul_config this won't work!!!
|
||||
// send_dummy_subframe(pnf_p7, sfn_sf_tx);
|
||||
// send dummy
|
||||
if(pnf_p7->_public.ul_tti_req_fn && pnf_p7->_public.dummy_slot.ul_tti_req)
|
||||
{
|
||||
pnf_p7->_public.dummy_slot.ul_tti_req->SFN = sfn;
|
||||
pnf_p7->_public.dummy_slot.ul_tti_req->Slot = slot;
|
||||
LOG_D(PHY, "Process ul_tti SFN/slot %d.%d buffer index: %d \n",sfn,slot,buffer_index_rx);
|
||||
(pnf_p7->_public.ul_tti_req_fn)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_slot.ul_tti_req);
|
||||
}
|
||||
}
|
||||
if(rx_slot_buffer->ul_tti_req != 0)
|
||||
{
|
||||
deallocate_nfapi_ul_tti_request(rx_slot_buffer->ul_tti_req, pnf_p7);
|
||||
rx_slot_buffer->ul_tti_req = 0;
|
||||
|
||||
// send_dummy_slot(pnf_p7, sfn_tx, slot_tx);
|
||||
}
|
||||
|
||||
//reset slot buffer
|
||||
|
||||
|
||||
if(slot_buffer->sfn == sfn && slot_buffer->slot == slot )
|
||||
if ( rx_slot_buffer->dl_tti_req == 0 &&
|
||||
rx_slot_buffer->tx_data_req == 0 &&
|
||||
rx_slot_buffer->ul_tti_req == 0)
|
||||
{
|
||||
|
||||
if(slot_buffer->ul_tti_req != 0)
|
||||
{
|
||||
if(pnf_p7->_public.ul_tti_req_fn)
|
||||
{
|
||||
(pnf_p7->_public.ul_tti_req_fn)(NULL, &(pnf_p7->_public), slot_buffer->ul_tti_req);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// send dummy
|
||||
if(pnf_p7->_public.ul_tti_req_fn && pnf_p7->_public.dummy_slot.ul_tti_req)
|
||||
{
|
||||
pnf_p7->_public.dummy_slot.ul_tti_req->SFN = sfn;
|
||||
pnf_p7->_public.dummy_slot.ul_tti_req->Slot = slot;
|
||||
(pnf_p7->_public.ul_tti_req_fn)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_slot.ul_tti_req);
|
||||
}
|
||||
}
|
||||
//if(subframe_buffer->dl_config_req != 0)
|
||||
//deallocate_nfapi_dl_config_request(subframe_buffer->dl_config_req, pnf_p7);
|
||||
//if(subframe_buffer->tx_req != 0)
|
||||
//deallocate_nfapi_tx_request(subframe_buffer->tx_req, pnf_p7);
|
||||
if(slot_buffer->ul_tti_req != 0)
|
||||
{
|
||||
deallocate_nfapi_ul_tti_request(slot_buffer->ul_tti_req, pnf_p7);
|
||||
slot_buffer->ul_tti_req = 0;
|
||||
|
||||
}
|
||||
#if 0
|
||||
if(slot_buffer->lbt_dl_config_req != 0)
|
||||
{
|
||||
deallocate_nfapi_lbt_dl_config_request(slot_buffer->lbt_dl_config_req, pnf_p7);
|
||||
slot_buffer->lbt_dl_config_req = 0;
|
||||
}
|
||||
#endif
|
||||
} // sfn_slot match
|
||||
|
||||
|
||||
if ( slot_buffer->dl_tti_req == 0 &&
|
||||
slot_buffer->tx_data_req == 0 &&
|
||||
slot_buffer->ul_tti_req == 0)
|
||||
//slot_buffer->lbt_dl_config_req == 0 &&
|
||||
//slot_buffer->ue_release_req == 0)
|
||||
{
|
||||
memset(&(pnf_p7->slot_buffer[buffer_index]), 0, sizeof(nfapi_pnf_p7_slot_buffer_t));
|
||||
pnf_p7->slot_buffer[buffer_index].sfn = -1;
|
||||
pnf_p7->slot_buffer[buffer_index].slot = -1;
|
||||
memset(&(pnf_p7->slot_buffer[buffer_index_rx]), 0, sizeof(nfapi_pnf_p7_slot_buffer_t));
|
||||
pnf_p7->slot_buffer[buffer_index_rx].sfn = -1;
|
||||
pnf_p7->slot_buffer[buffer_index_rx].slot = -1;
|
||||
}
|
||||
|
||||
//printf("pnf_p7->_public.timing_info_mode_periodic:%d pnf_p7->timing_info_period_counter:%d pnf_p7->_public.timing_info_period:%d\n", pnf_p7->_public.timing_info_mode_periodic, pnf_p7->timing_info_period_counter, pnf_p7->_public.timing_info_period);
|
||||
//printf("pnf_p7->_public.timing_info_mode_aperiodic:%d pnf_p7->timing_info_aperiodic_send:%d\n", pnf_p7->_public.timing_info_mode_aperiodic, pnf_p7->timing_info_aperiodic_send);
|
||||
//printf("pnf_p7->timing_info_ms_counter:%d\n", pnf_p7->timing_info_ms_counter);
|
||||
|
||||
// send the periodic timing info if configured
|
||||
//send the periodic timing info if configured
|
||||
if(pnf_p7->_public.timing_info_mode_periodic && (pnf_p7->timing_info_period_counter++) == pnf_p7->_public.timing_info_period)
|
||||
{
|
||||
pnf_nr_pack_and_send_timing_info(pnf_p7);
|
||||
@@ -1182,26 +1162,6 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//send_dummy_subframe(pnf_p7, sfn_sf_tx);
|
||||
}
|
||||
|
||||
|
||||
//printf("pnf_p7->tick:%d\n", pnf_p7->tick);
|
||||
// if(pnf_p7->tick == 1000) // why?
|
||||
// {
|
||||
// // TODO: change stats to nr_stats
|
||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF P7:%d] (ONTIME/LATE) DL:(%d/%d) UL:(%d/%d) HI:(%d/%d) TX:(%d/%d)\n", pnf_p7->_public.phy_id,
|
||||
// pnf_p7->stats.dl_conf_ontime, pnf_p7->stats.dl_conf_late,
|
||||
// pnf_p7->stats.ul_conf_ontime, pnf_p7->stats.ul_conf_late,
|
||||
// pnf_p7->stats.hi_dci0_ontime, pnf_p7->stats.hi_dci0_late,
|
||||
// pnf_p7->stats.tx_ontime, pnf_p7->stats.tx_late);
|
||||
// pnf_p7->tick = 0;
|
||||
// memset(&pnf_p7->stats, 0, sizeof(pnf_p7->stats));
|
||||
// }
|
||||
// pnf_p7->tick++;
|
||||
|
||||
|
||||
if(pthread_mutex_unlock(&(pnf_p7->mutex)) != 0)
|
||||
{
|
||||
@@ -1561,11 +1521,11 @@ uint8_t is_nr_p7_request_in_window(uint16_t sfn,uint16_t slot, const char* name,
|
||||
// }
|
||||
if(current_sfn_slot_dec <= recv_sfn_slot_dec + timing_window){
|
||||
in_window = 1;
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in window %d\n", current_sfn_slot_dec, name, recv_sfn_slot_dec);
|
||||
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in window %d\n", current_sfn_slot_dec, name, recv_sfn_slot_dec);
|
||||
}
|
||||
else if(current_sfn_slot_dec + NFAPI_MAX_SFNSLOTDEC <= recv_sfn_slot_dec + timing_window){ //checking for wrap
|
||||
in_window = 1;
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in window %d\n", current_sfn_slot_dec, name, recv_sfn_slot_dec);
|
||||
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in window %d\n", current_sfn_slot_dec, name, recv_sfn_slot_dec);
|
||||
}
|
||||
|
||||
else
|
||||
@@ -1654,34 +1614,18 @@ void pnf_handle_dl_tti_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to lock mutex\n");
|
||||
return;
|
||||
}
|
||||
#if 0
|
||||
if (
|
||||
0 &&
|
||||
(NFAPI_SFNSF2DEC(req->sfn_sf) % 100 ==0 ||
|
||||
NFAPI_SFNSF2DEC(req->sfn_sf) % 105 ==0
|
||||
)
|
||||
)
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "DL_CONFIG.req sfn_sf:%d pdcch:%u dci:%u pdu:%u pdsch_rnti:%u pcfich:%u\n",
|
||||
NFAPI_SFNSF2DEC(req->sfn_sf),
|
||||
req->dl_config_request_body.number_pdcch_ofdm_symbols,
|
||||
req->dl_config_request_body.number_dci,
|
||||
req->dl_config_request_body.number_pdu,
|
||||
req->dl_config_request_body.number_pdsch_rnti,
|
||||
req->dl_config_request_body.transmission_power_pcfich
|
||||
);
|
||||
#endif
|
||||
|
||||
if(is_nr_p7_request_in_window(req->SFN,req->Slot, "dl_tti_request", pnf_p7))
|
||||
{
|
||||
uint32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(req->SFN,req->Slot);
|
||||
uint8_t buffer_index = sfn_slot_dec % pnf_p7->_public.slot_buffer_size;
|
||||
if(is_nr_p7_request_in_window(req->SFN,req->Slot, "dl_tti_request", pnf_p7))
|
||||
{
|
||||
uint32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(req->SFN,req->Slot);
|
||||
uint8_t buffer_index = sfn_slot_dec % 20;
|
||||
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_MONOTONIC, &t);
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_MONOTONIC, &t);
|
||||
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE DL_TTI_REQ sfn_slot:%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, sfn_slot_dec, buffer_index);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE DL_TTI_REQ current tx sfn/slot:%d.%d p7 msg sfn/slot: %d.%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, pnf_p7->sfn,pnf_p7->slot, req->SFN, req->Slot, buffer_index);
|
||||
|
||||
// if there is already an dl_config_req make sure we free it.
|
||||
// if there is already an dl_tti_req make sure we free it.
|
||||
if(pnf_p7->slot_buffer[buffer_index].dl_tti_req != 0)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "%s() is_nr_p7_request_in_window()=TRUE buffer_index occupied - free it first sfn_slot:%d buffer_index:%d\n", __FUNCTION__, NFAPI_SFNSLOT2DEC(req->SFN,req->Slot), buffer_index);
|
||||
@@ -1691,7 +1635,7 @@ void pnf_handle_dl_tti_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
|
||||
deallocate_nfapi_dl_tti_request(pnf_p7->slot_buffer[buffer_index].dl_tti_req, pnf_p7);
|
||||
}
|
||||
|
||||
// saving dl_config_request in subframe buffer
|
||||
// filling dl_tti_request in slot buffer
|
||||
pnf_p7->slot_buffer[buffer_index].sfn = req->SFN;
|
||||
pnf_p7->slot_buffer[buffer_index].slot = req->Slot;
|
||||
pnf_p7->slot_buffer[buffer_index].dl_tti_req = req;
|
||||
@@ -1840,12 +1784,12 @@ void pnf_handle_ul_tti_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
|
||||
if(is_nr_p7_request_in_window(req->SFN,req->Slot, "ul_tti_request", pnf_p7))
|
||||
{
|
||||
uint32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(req->SFN,req->Slot);
|
||||
uint8_t buffer_index = sfn_slot_dec % pnf_p7->_public.slot_buffer_size;
|
||||
uint8_t buffer_index = (sfn_slot_dec % 20);
|
||||
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_MONOTONIC, &t);
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE UL_TTI_REQ sfn_slot:%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, sfn_slot_dec, buffer_index);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE UL_TTI_REQ current tx sfn/slot:%d.%d p7 msg sfn/slot: %d.%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, pnf_p7->sfn,pnf_p7->slot, req->SFN, req->Slot, buffer_index);
|
||||
|
||||
if(pnf_p7->slot_buffer[buffer_index].ul_tti_req != 0)
|
||||
{
|
||||
@@ -1855,6 +1799,8 @@ void pnf_handle_ul_tti_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
|
||||
|
||||
deallocate_nfapi_ul_tti_request(pnf_p7->slot_buffer[buffer_index].ul_tti_req, pnf_p7);
|
||||
}
|
||||
|
||||
//filling slot buffer
|
||||
|
||||
pnf_p7->slot_buffer[buffer_index].sfn = req->SFN;
|
||||
pnf_p7->slot_buffer[buffer_index].slot = req->Slot;
|
||||
@@ -1986,7 +1932,7 @@ void pnf_handle_ul_dci_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
|
||||
if(is_nr_p7_request_in_window(req->SFN,req->Slot,"ul_dci_request", pnf_p7))
|
||||
{
|
||||
uint32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(req->SFN,req->Slot);
|
||||
uint8_t buffer_index = sfn_slot_dec % pnf_p7->_public.slot_buffer_size;
|
||||
uint8_t buffer_index = sfn_slot_dec % 20;
|
||||
|
||||
if(pnf_p7->slot_buffer[buffer_index].ul_dci_req!= 0)
|
||||
{
|
||||
@@ -2125,12 +2071,12 @@ void pnf_handle_tx_data_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7
|
||||
if(is_nr_p7_request_in_window(req->SFN, req->Slot,"tx_request", pnf_p7))
|
||||
{
|
||||
uint32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(req->SFN,req->Slot);
|
||||
uint8_t buffer_index = sfn_slot_dec % pnf_p7->_public.slot_buffer_size;
|
||||
uint8_t buffer_index = sfn_slot_dec % 20;
|
||||
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_MONOTONIC, &t);
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE TX_DATA_REQ sfn_sf:%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, sfn_slot_dec, buffer_index);
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE TX_DATA_REQ sfn_sf:%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, sfn_slot_dec, buffer_index);
|
||||
#if 0
|
||||
if (0 && NFAPI_SFNSF2DEC(req->sfn_sf)%100==0) NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() TX_REQ.req sfn_sf:%d pdus:%d - TX_REQ is within window\n",
|
||||
__FUNCTION__,
|
||||
@@ -2692,9 +2638,7 @@ void pnf_nr_dispatch_p7_message(void *pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7
|
||||
case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC:
|
||||
pnf_nr_handle_dl_node_sync(pRecvMsg, recvMsgLen, pnf_p7, rx_hr_time);
|
||||
break;
|
||||
|
||||
case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST:
|
||||
//printf("\nEntering pnf_handle_dl_tti_request sfn=%d,slot=%d \n",pnf_p7->sfn,pnf_p7->slot);
|
||||
pnf_handle_dl_tti_request(pRecvMsg, recvMsgLen, pnf_p7);
|
||||
break;
|
||||
case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST:
|
||||
@@ -3324,7 +3268,7 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_nsec = 500000;
|
||||
|
||||
struct timespec slot_duration;
|
||||
struct timespec slot_duration;
|
||||
slot_duration.tv_sec = 0;
|
||||
slot_duration.tv_nsec = 0.5e6;
|
||||
|
||||
@@ -3339,7 +3283,9 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
|
||||
FD_ZERO(&rfds);
|
||||
FD_SET(pnf_p7->p7_sock, &rfds);
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &pselect_start);
|
||||
struct timespec timeout;
|
||||
timeout.tv_sec = 100;
|
||||
timeout.tv_nsec = 0;
|
||||
|
||||
//setting the timeout
|
||||
|
||||
|
||||
@@ -251,6 +251,18 @@ int nfapi_pnf_ue_release_resp(nfapi_pnf_p7_config_t* config, nfapi_ue_release_re
|
||||
|
||||
//NR UPLINK INDICATION
|
||||
|
||||
int nfapi_pnf_p7_nr_slot_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_slot_indication_scf_t* ind)
|
||||
{
|
||||
if(config == NULL || ind == NULL)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
pnf_p7_t* _this = (pnf_p7_t*)(config);
|
||||
return pnf_nr_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_nr_rx_data_indication_t));
|
||||
}
|
||||
|
||||
int nfapi_pnf_p7_nr_rx_data_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rx_data_indication_t* ind)
|
||||
{
|
||||
if(config == NULL || ind == NULL)
|
||||
|
||||
@@ -278,7 +278,7 @@ void *fapi_thread_start(void *ptr) {
|
||||
|
||||
if(instance->tick == 1000) {
|
||||
if(instance->tx_byte_count > 0) {
|
||||
printf("[FAPI] Tx rate %u bytes/sec\n", instance->tx_byte_count);
|
||||
printf("[FAPI] Tx rate %d bytes/sec\n", instance->tx_byte_count);
|
||||
instance->tx_byte_count = 0;
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ void *fapi_thread_start(void *ptr) {
|
||||
millisec = now_ts.tv_nsec / 1e6;
|
||||
|
||||
if(last_millisec != -1 && ((last_millisec + 1 ) % 1000) != millisec) {
|
||||
printf("*** missing millisec %u %u\n", last_millisec, millisec);
|
||||
printf("*** missing millisec %d %d\n", last_millisec, millisec);
|
||||
catchup = millisec - last_millisec - 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#define TIME2TIMEHR(_time) (((uint32_t)(_time.tv_sec) & 0xFFF) << 20 | ((uint32_t)(_time.tv_usec) & 0xFFFFF))
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8_t* buffer;
|
||||
uint16_t length;
|
||||
|
||||
@@ -897,8 +897,12 @@ typedef struct nfapi_vnf_p7_config
|
||||
* be deallocated on return. If the client wishes to 'keep' the structures
|
||||
* then the substructure pointers should be set to 0 and then the client should
|
||||
* use the codec_config.deallocate function to release it at a future point
|
||||
*/
|
||||
int (*nrach_indication)(struct nfapi_vnf_p7_config* config, nfapi_nrach_indication_t* ind);
|
||||
*/
|
||||
int (*nrach_indication)(struct nfapi_vnf_p7_config* config, nfapi_nrach_indication_t* ind);
|
||||
|
||||
//The NR indication functions below copy uplink information received at the VNF into the UL info struct
|
||||
int (*nr_slot_indication)(nfapi_nr_slot_indication_scf_t* ind);
|
||||
int (*nr_srs_indication)(nfapi_nr_srs_indication_t* ind);
|
||||
|
||||
/*! A callback for any vendor extension messages
|
||||
* \param config A pointer to the vnf p7 configuration
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include "vnf_p7.h"
|
||||
|
||||
#ifdef NDEBUG
|
||||
@@ -462,7 +463,7 @@ int send_mac_subframe_indications(vnf_p7_t* vnf_p7)
|
||||
int vnf_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* p7_info, uint8_t* msg, const uint32_t len)
|
||||
{
|
||||
int sendto_result = sendto(vnf_p7->socket, msg, len, 0, (struct sockaddr*)&(p7_info->remote_addr), sizeof(p7_info->remote_addr));
|
||||
//printf("\nSending p7 message sfn=%d,slot=%d\n",vnf_p7->p7_connections->sfn,vnf_p7->p7_connections->slot);
|
||||
//printf("P7 msg sent \n");
|
||||
if(sendto_result != len)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sendto_result %d %d\n", __FUNCTION__, sendto_result, errno);
|
||||
@@ -539,6 +540,7 @@ int vnf_nr_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t*
|
||||
nfapi_p7_update_transmit_timestamp(buffer, calculate_transmit_timestamp(p7_connection->sfn, p7_connection->slot, vnf_p7->slot_start_time_hr));
|
||||
|
||||
send_result = vnf_send_p7_msg(vnf_p7, p7_connection, &tx_buffer[0], segment_size);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -555,7 +557,6 @@ int vnf_nr_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t*
|
||||
}
|
||||
|
||||
p7_connection->sequence_number++;
|
||||
|
||||
return send_result;
|
||||
}
|
||||
else
|
||||
@@ -673,7 +674,6 @@ int vnf_build_send_dl_node_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t
|
||||
|
||||
int vnf_nr_build_send_dl_node_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* p7_info)
|
||||
{
|
||||
|
||||
nfapi_nr_dl_node_sync_t dl_node_sync;
|
||||
memset(&dl_node_sync, 0, sizeof(dl_node_sync));
|
||||
|
||||
@@ -1291,7 +1291,7 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||
{
|
||||
if(phy->in_sync == 0)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "VNF P7 In Sync with phy (phy_id:%d)\n", phy->phy_id);
|
||||
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "VNF P7 In Sync with phy (phy_id:%d)\n", phy->phy_id);
|
||||
|
||||
if(vnf_p7->_public.sync_indication)
|
||||
(vnf_p7->_public.sync_indication)(&(vnf_p7->_public), phy->in_sync);
|
||||
@@ -1456,7 +1456,31 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||
}
|
||||
|
||||
//NR HANDLES FOR UPLINK MESSAGES
|
||||
void vnf_handle_nr_slot_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||
{
|
||||
// ensure it's valid
|
||||
if (pRecvMsg == NULL || vnf_p7 == NULL)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
|
||||
}
|
||||
else
|
||||
{
|
||||
nfapi_nr_slot_indication_scf_t ind;
|
||||
|
||||
if(nfapi_nr_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(vnf_p7->_public.nr_slot_indication)
|
||||
{
|
||||
(vnf_p7->_public.nr_slot_indication)(&ind);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
void vnf_handle_nr_rx_data_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||
{
|
||||
// ensure it's valid
|
||||
@@ -1524,7 +1548,13 @@ void vnf_handle_nr_srs_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if(vnf_p7->_public.nr_srs_indication)
|
||||
{
|
||||
(vnf_p7->_public.nr_srs_indication)(&ind);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1612,6 +1642,8 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
|
||||
// divide by 2 using shift operator
|
||||
uint32_t latency = (tx_2_rx - pnf_proc_time) >> 1;
|
||||
|
||||
//phy->in_sync = 1;
|
||||
|
||||
if(!(phy->filtered_adjust))
|
||||
{
|
||||
phy->latency[phy->min_sync_cycle_count] = latency;
|
||||
@@ -1661,17 +1693,24 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
|
||||
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%1d) %d.%d PNF to VNF phy_id:%2d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d(avg:%4d) offset(us):%8d filtered(us):%8d wrap[t1:%u t2:%u]\n",
|
||||
// phy->sfn, phy->slot, ts.tv_sec, ts.tv_nsec, ind.header.phy_id,
|
||||
// ind.t1, ind.t2, ind.t3, t4,
|
||||
// tx_2_rx, pnf_proc_time, latency, phy->average_latency, phy->slot_offset, phy->slot_offset_filtered,
|
||||
// (ind.t1<phy->previous_t1), (ind.t2<phy->previous_t2));
|
||||
// NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%1d) %d.%d PNF to VNF phy_id:%2d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d(avg:%4d) offset(us):%8d filtered(us):%8d wrap[t1:%u t2:%u]\n",
|
||||
// phy->sfn, phy->slot, ts.tv_sec, ts.tv_nsec, ind.header.phy_id,
|
||||
// ind.t1, ind.t2, ind.t3, t4,
|
||||
// tx_2_rx, pnf_proc_time, latency, phy->average_latency, phy->slot_offset, phy->slot_offset_filtered,
|
||||
// (ind.t1<phy->previous_t1), (ind.t2<phy->previous_t2));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (phy->filtered_adjust && (phy->slot_offset_filtered > 1e6 || phy->slot_offset_filtered < -1e6))
|
||||
{
|
||||
{ struct timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%1d) %ld.%ld PNF to VNF phy_id:%2d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d(avg:%4d) offset(us):%8d filtered(us):%8d wrap[t1:%u t2:%u]\n",
|
||||
phy->sfn, phy->slot, ts.tv_sec, ts.tv_nsec, ind.header.phy_id,
|
||||
ind.t1, ind.t2, ind.t3, t4,
|
||||
tx_2_rx, pnf_proc_time, latency, phy->average_latency, phy->slot_offset, phy->slot_offset_filtered,
|
||||
(ind.t1<phy->previous_t1), (ind.t2<phy->previous_t2));
|
||||
|
||||
phy->filtered_adjust = 0;
|
||||
phy->zero_count=0;
|
||||
phy->min_sync_cycle_count = 2;
|
||||
@@ -1703,7 +1742,7 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
|
||||
|
||||
sfn_slot_dec += (phy->slot_offset / 500);
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "PNF to VNF slot offset:%d sfn :%d slot:%d \n",phy->slot_offset,NFAPI_SFNSLOTDEC2SFN(sfn_slot_dec),NFAPI_SFNSLOTDEC2SLOT(sfn_slot_dec) );
|
||||
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "PNF to VNF slot offset:%d sfn :%d slot:%d \n",phy->slot_offset,NFAPI_SFNSLOTDEC2SFN(sfn_slot_dec),NFAPI_SFNSLOTDEC2SLOT(sfn_slot_dec) );
|
||||
|
||||
|
||||
}
|
||||
@@ -2165,7 +2204,11 @@ void vnf_nr_dispatch_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
|
||||
case NFAPI_TIMING_INFO:
|
||||
vnf_nr_handle_timing_info(pRecvMsg, recvMsgLen, vnf_p7);
|
||||
break;
|
||||
|
||||
|
||||
case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION:
|
||||
vnf_handle_nr_slot_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
||||
break;
|
||||
|
||||
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION:
|
||||
vnf_handle_nr_rx_data_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
||||
break;
|
||||
@@ -2178,13 +2221,13 @@ void vnf_nr_dispatch_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
|
||||
vnf_handle_nr_uci_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
||||
break;
|
||||
|
||||
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
|
||||
vnf_handle_nr_rach_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
||||
break;
|
||||
|
||||
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
|
||||
vnf_handle_nr_srs_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
||||
break;
|
||||
|
||||
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
|
||||
vnf_handle_nr_rach_indication(pRecvMsg, recvMsgLen, vnf_p7);
|
||||
break;
|
||||
|
||||
case NFAPI_UE_RELEASE_RESPONSE:
|
||||
vnf_handle_ue_release_resp(pRecvMsg, recvMsgLen, vnf_p7);
|
||||
|
||||
@@ -25,9 +25,14 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include "vnf_p7.h"
|
||||
#include "nfapi_vnf.h"
|
||||
|
||||
#include "common/ran_context.h"
|
||||
|
||||
#include "openair1/PHY/defs_gNB.h"
|
||||
#define FAPI2_IP_DSCP 0
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
nfapi_vnf_p7_config_t* nfapi_vnf_p7_config_create()
|
||||
{
|
||||
@@ -92,7 +97,9 @@ struct timespec timespec_sub(struct timespec lhs, struct timespec rhs)
|
||||
// monitor the p7 endpoints and the timing loop and
|
||||
// send indications to mac
|
||||
int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
|
||||
{
|
||||
{
|
||||
struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
|
||||
uint8_t prev_slot = 0;
|
||||
if(config == 0)
|
||||
return -1;
|
||||
|
||||
@@ -145,40 +152,14 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
|
||||
|
||||
//struct timespec original_pselect_timeout;
|
||||
struct timespec pselect_timeout;
|
||||
pselect_timeout.tv_sec = 0;
|
||||
pselect_timeout.tv_nsec = 500000; // ns in a 0.5 ms
|
||||
//pselect_timeout.tv_nsec = 500000;
|
||||
|
||||
struct timespec pselect_start;
|
||||
struct timespec pselect_stop;
|
||||
|
||||
//struct timespec sf_end;
|
||||
|
||||
long last_millisecond = -1;
|
||||
|
||||
|
||||
// struct timespec sf_duration; //Change to slot_duration?
|
||||
// sf_duration.tv_sec = 0;
|
||||
// sf_duration.tv_nsec = 0.5e6; // We want 1ms pause //We want 0.5 ms pause for NR
|
||||
struct timespec slot_duration;
|
||||
slot_duration.tv_sec = 0;
|
||||
//slot_duration.tv_nsec = 0.5e6;
|
||||
slot_duration.tv_nsec = 0.5e6;
|
||||
|
||||
|
||||
// struct timespec sf_start; //Change to slot_start?
|
||||
struct timespec slot_start;
|
||||
// clock_gettime(CLOCK_MONOTONIC, &sf_start);
|
||||
clock_gettime(CLOCK_MONOTONIC, &slot_start);
|
||||
long millisecond = slot_start.tv_nsec / 0.5e6; //Check if we have to change
|
||||
//long millisecond = slot_start.tv_nsec / 0.5e6;
|
||||
// sf_start = timespec_add(sf_start, sf_duration);
|
||||
slot_start = timespec_add(slot_start, slot_duration);
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "next slot will start at %ld.%ld\n", slot_start.tv_sec, slot_start.tv_nsec);
|
||||
pselect_timeout.tv_sec = 100;
|
||||
pselect_timeout.tv_nsec = 0;
|
||||
|
||||
struct timespec ref_time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ref_time);
|
||||
uint8_t setup_time;
|
||||
while(vnf_p7->terminate == 0)
|
||||
{
|
||||
{
|
||||
fd_set rfds;
|
||||
int maxSock = 0;
|
||||
FD_ZERO(&rfds);
|
||||
@@ -187,240 +168,34 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
|
||||
// Add the p7 socket
|
||||
FD_SET(vnf_p7->socket, &rfds);
|
||||
maxSock = vnf_p7->socket;
|
||||
|
||||
struct timespec curr_time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &curr_time);
|
||||
setup_time = curr_time.tv_sec - ref_time.tv_sec;
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &pselect_start);
|
||||
//long millisecond = pselect_start.tv_nsec / 1e6;
|
||||
if(setup_time > 10 && prev_slot != gNB->UL_INFO.slot){ //Give the VNF sufficient time to setup before starting scheduling
|
||||
|
||||
if((last_millisecond == -1) || (millisecond == last_millisecond) || (millisecond == (last_millisecond + 1) % 1000) )
|
||||
{
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "pselect_start:%d.%d sf_start:%d.%d\n", pselect_start.tv_sec, pselect_start.tv_nsec, sf_start.tv_sec, sf_start.tv_nsec);
|
||||
|
||||
|
||||
//if((pselect_start.tv_sec > sf_start.tv_sec) ||
|
||||
// ((pselect_start.tv_sec == sf_start.tv_sec) && (pselect_start.tv_nsec > sf_start.tv_nsec)))
|
||||
if((pselect_start.tv_sec > slot_start.tv_sec) || ((pselect_start.tv_sec == slot_start.tv_sec) && (pselect_start.tv_nsec > slot_start.tv_nsec)))
|
||||
{
|
||||
// overran the end of the subframe we do not want to wait
|
||||
pselect_timeout.tv_sec = 0;
|
||||
pselect_timeout.tv_nsec = 0;
|
||||
|
||||
//struct timespec overrun = timespec_sub(pselect_start, sf_start);
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "Subframe overrun detected of %d.%d running to catchup\n", overrun.tv_sec, overrun.tv_nsec);
|
||||
}
|
||||
else
|
||||
{
|
||||
// still time before the end of the subframe wait
|
||||
//pselect_timeout = timespec_sub(sf_start, pselect_start);
|
||||
pselect_timeout = timespec_sub(slot_start, pselect_start);
|
||||
}
|
||||
|
||||
//original_pselect_timeout = pselect_timeout;
|
||||
|
||||
// detemine how long to sleep in ns before the start of the next 1ms
|
||||
//pselect_timeout.tv_nsec = 1e6 - (pselect_start.tv_nsec % 1000000);
|
||||
|
||||
//uint8_t underrun_possible =0;
|
||||
|
||||
// if we are not sleeping until the next milisecond due to the
|
||||
// insycn minor adjment flag it so we don't consider it an error
|
||||
//uint8_t underrun_possible =0;
|
||||
/*
|
||||
{
|
||||
nfapi_vnf_p7_connection_info_t* phy = vnf_p7->p7_connections;
|
||||
if(phy && phy->in_sync && phy->insync_minor_adjustment != 0 && phy->insync_minor_adjustment_duration > 0 && pselect_start.tv_nsec != 0)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "[VNF] Subframe minor adjustment %d (%d->%d)\n", phy->insync_minor_adjustment,
|
||||
pselect_timeout.tv_nsec, pselect_timeout.tv_nsec - (phy->insync_minor_adjustment * 1000))
|
||||
if(phy->insync_minor_adjustment > 0)
|
||||
{
|
||||
// todo check we don't go below 0
|
||||
if((phy->insync_minor_adjustment * 1000) > pselect_timeout.tv_nsec)
|
||||
pselect_timeout.tv_nsec = 0;
|
||||
else
|
||||
pselect_timeout.tv_nsec = pselect_timeout.tv_nsec - (phy->insync_minor_adjustment * 1000);
|
||||
|
||||
|
||||
//underrun_possible = 1;
|
||||
}
|
||||
else if(phy->insync_minor_adjustment < 0)
|
||||
{
|
||||
// todo check we don't go below 0
|
||||
pselect_timeout.tv_nsec = pselect_timeout.tv_nsec - (phy->insync_minor_adjustment * 1000);
|
||||
|
||||
|
||||
//phy->insync_minor_adjustment = 0;
|
||||
phy->insync_minor_adjustment_duration--;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
//long wraps = pselect_timeout.tv_nsec % 1e9;
|
||||
|
||||
|
||||
selectRetval = pselect(maxSock+1, &rfds, NULL, NULL, &pselect_timeout, NULL);
|
||||
// selectRetval = pselect(120, &rfds, NULL, NULL, &pselect_timeout, NULL);
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &pselect_stop);
|
||||
|
||||
nfapi_vnf_p7_connection_info_t* phy = vnf_p7->p7_connections;
|
||||
|
||||
if (selectRetval==-1 && errno == 22)
|
||||
{
|
||||
// NFAPI_TRACE(NFAPI_TRACE_ERROR, "INVAL: pselect_timeout:%d.%ld adj[dur:%d adj:%d], sf_dur:%d.%ld\n",
|
||||
// pselect_timeout.tv_sec, pselect_timeout.tv_nsec,
|
||||
// phy->insync_minor_adjustment_duration, phy->insync_minor_adjustment,
|
||||
// sf_duration.tv_sec, sf_duration.tv_nsec);
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "INVAL: pselect_timeout:%ld.%ld adj[dur:%d adj:%d], sf_dur:%ld.%ld\n",
|
||||
pselect_timeout.tv_sec, pselect_timeout.tv_nsec,
|
||||
phy->insync_minor_adjustment_duration, phy->insync_minor_adjustment,
|
||||
slot_duration.tv_sec, slot_duration.tv_nsec);
|
||||
|
||||
}
|
||||
if(selectRetval == 0)
|
||||
{
|
||||
// calculate the start of the next slot
|
||||
//sf_start = timespec_add(sf_start, sf_duration);
|
||||
slot_start = timespec_add(slot_start, slot_duration);
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "next subframe will start at %d.%d\n", sf_start.tv_sec, sf_start.tv_nsec);
|
||||
|
||||
if(phy && phy->in_sync && phy->insync_minor_adjustment != 0 && phy->insync_minor_adjustment_duration > 0)
|
||||
{
|
||||
long insync_minor_adjustment_ns = (phy->insync_minor_adjustment * 1000);
|
||||
|
||||
//sf_start.tv_nsec -= insync_minor_adjustment_ns;
|
||||
slot_start.tv_nsec -= insync_minor_adjustment_ns;
|
||||
|
||||
#if 1
|
||||
/* if (sf_start.tv_nsec > 1e9) //Change to 0.5e6?
|
||||
{
|
||||
sf_start.tv_sec++;
|
||||
sf_start.tv_nsec-=1e9;
|
||||
}
|
||||
else if (sf_start.tv_nsec < 0)
|
||||
{
|
||||
sf_start.tv_sec--;
|
||||
sf_start.tv_nsec+=1e9;
|
||||
}*/
|
||||
if (slot_start.tv_nsec > 1e9)
|
||||
{
|
||||
slot_start.tv_sec++;
|
||||
slot_start.tv_nsec-=1e9;
|
||||
}
|
||||
else if (slot_start.tv_nsec < 0)
|
||||
{
|
||||
slot_start.tv_sec--;
|
||||
slot_start.tv_nsec+=1e9;
|
||||
}
|
||||
#else
|
||||
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[VNF] BEFORE adjustment - Subframe minor adjustment %dus sf_start.tv_nsec:%d\n", phy->insync_minor_adjustment, sf_start.tv_nsec);
|
||||
if(phy->insync_minor_adjustment > 0)
|
||||
{
|
||||
// decrease the subframe duration a little
|
||||
if (sf_start.tv_nsec > insync_minor_adjustment_ns)
|
||||
sf_start.tv_nsec -= insync_minor_adjustment_ns;
|
||||
else
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "[VNF] Adjustment would make it negative sf:%d.%ld adjust:%ld\n\n\n", sf_start.tv_sec, sf_start.tv_nsec, insync_minor_adjustment_ns);
|
||||
sf_start.tv_sec--;
|
||||
sf_start.tv_nsec += 1e9 - insync_minor_adjustment_ns;
|
||||
}
|
||||
}
|
||||
else if(phy->insync_minor_adjustment < 0)
|
||||
{
|
||||
// todo check we don't go below 0
|
||||
// increase the subframe duration a little
|
||||
sf_start.tv_nsec += insync_minor_adjustment_ns;
|
||||
|
||||
if (sf_start.tv_nsec < 0)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "[VNF] OVERFLOW %d.%ld\n\n\n\n", sf_start.tv_sec, sf_start.tv_nsec);
|
||||
sf_start.tv_sec++;
|
||||
sf_start.tv_nsec += 1e9;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//phy->insync_minor_adjustment = 0;
|
||||
phy->insync_minor_adjustment_duration--;
|
||||
|
||||
// NFAPI_TRACE(NFAPI_TRACE_NOTE, "[VNF] AFTER adjustment - Subframe minor adjustment %dus sf_start.tv_nsec:%d duration:%u\n",
|
||||
// phy->insync_minor_adjustment, sf_start.tv_nsec, phy->insync_minor_adjustment_duration);
|
||||
// NFAPI_TRACE(NFAPI_TRACE_NOTE, "[VNF] AFTER adjustment - Slot minor adjustment %dus slot_start.tv_nsec:%d duration:%u\n",
|
||||
// phy->insync_minor_adjustment, slot_start.tv_nsec, phy->insync_minor_adjustment_duration);
|
||||
|
||||
if (phy->insync_minor_adjustment_duration==0)
|
||||
{
|
||||
phy->insync_minor_adjustment = 0;
|
||||
}
|
||||
}
|
||||
/*
|
||||
long pselect_stop_millisecond = pselect_stop.tv_nsec / 1e6;
|
||||
if(millisecond == pselect_stop_millisecond)
|
||||
{
|
||||
// we have woke up in the same subframe
|
||||
if(underrun_possible == 0)
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "subframe pselect underrun %ld (%d.%d)\n", millisecond, pselect_stop.tv_sec, pselect_stop.tv_nsec);
|
||||
}
|
||||
else if(((millisecond + 1) % 1000) != pselect_stop_millisecond)
|
||||
{
|
||||
// we have overrun the subframe
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "subframe pselect overrun %ld %ld\n", millisecond, pselect_stop_millisecond);
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "subframe underrun %ld\n", millisecond);
|
||||
}
|
||||
last_millisecond = millisecond;
|
||||
*/
|
||||
|
||||
//millisecond ++;
|
||||
millisecond = millisecond + 1;
|
||||
|
||||
}
|
||||
//Call the scheduler
|
||||
pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
gNB->UL_INFO.module_id = gNB->Mod_id;
|
||||
gNB->UL_INFO.CC_id = gNB->CC_id;
|
||||
gNB->if_inst->NR_UL_indication(&gNB->UL_INFO);
|
||||
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||
prev_slot = gNB->UL_INFO.slot;
|
||||
}
|
||||
else
|
||||
{
|
||||
// we have overrun the subframe advance to go and collect $200
|
||||
|
||||
if((millisecond - last_millisecond) > 3)
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "subframe overrun %ld %ld (%ld)\n", millisecond, last_millisecond, millisecond - last_millisecond + 1);
|
||||
|
||||
last_millisecond = ( last_millisecond + 1 ) % 1000;
|
||||
selectRetval = 0;
|
||||
}
|
||||
selectRetval = pselect(maxSock+1, &rfds, NULL, NULL, &pselect_timeout, NULL);
|
||||
|
||||
if(selectRetval == 0)
|
||||
{
|
||||
//vnf_p7->sf_start_time_hr = vnf_get_current_time_hr();
|
||||
vnf_p7->slot_start_time_hr = vnf_get_current_time_hr();
|
||||
struct timespec current_time;
|
||||
clock_gettime(CLOCK_MONOTONIC, ¤t_time);
|
||||
// pselect timed out
|
||||
nfapi_vnf_p7_connection_info_t* curr = vnf_p7->p7_connections;
|
||||
while(curr != 0)
|
||||
{
|
||||
if (curr->slot == 19)
|
||||
{ //curr->slot = 0;
|
||||
if(curr->sfn == 1023)
|
||||
curr->sfn=0;
|
||||
else
|
||||
curr->sfn++;
|
||||
curr->slot=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
curr->slot++;
|
||||
}
|
||||
vnf_nr_sync(vnf_p7, curr);
|
||||
curr = curr->next;
|
||||
}
|
||||
send_mac_slot_indications(vnf_p7);
|
||||
// pselect timed out, continue
|
||||
}
|
||||
else if(selectRetval > 0)
|
||||
{
|
||||
// have a p7 message
|
||||
if(FD_ISSET(vnf_p7->socket, &rfds))
|
||||
{
|
||||
vnf_nr_p7_read_dispatch_message(vnf_p7);
|
||||
{
|
||||
vnf_nr_p7_read_dispatch_message(vnf_p7);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -432,7 +207,7 @@ struct timespec current_time;
|
||||
}
|
||||
else
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "P7 select failed result %d errno %d timeout:%ld.%ld orginal:%ld.%ld last_ms:%ld ms:%ld\n", selectRetval, errno, pselect_timeout.tv_sec, pselect_timeout.tv_nsec, pselect_timeout.tv_sec, pselect_timeout.tv_nsec, last_millisecond, millisecond);
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "P7 select failed result %d errno %d timeout:%d.%d orginal:%d.%d last_ms:%ld ms:%ld\n", selectRetval, errno, pselect_timeout.tv_sec, pselect_timeout.tv_nsec, pselect_timeout.tv_sec, pselect_timeout.tv_nsec, last_millisecond, millisecond);
|
||||
// should we exit now?
|
||||
if (selectRetval == -1 && errno == 22) // invalid argument??? not sure about timeout duration
|
||||
{
|
||||
@@ -440,10 +215,7 @@ struct timespec current_time;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Closing p7 socket\n");
|
||||
close(vnf_p7->socket);
|
||||
|
||||
@@ -860,7 +632,6 @@ int nfapi_vnf_p7_ul_tti_req(nfapi_vnf_p7_config_t* config, nfapi_nr_ul_tti_reque
|
||||
{
|
||||
if(config == 0 || req == 0)
|
||||
return -1;
|
||||
|
||||
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
|
||||
return vnf_nr_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
|
||||
}
|
||||
|
||||
@@ -373,10 +373,10 @@ char interleave_compact_byte(short *base_interleaver,unsigned char *input, unsig
|
||||
short *ptr_intl=base_interleaver;
|
||||
#if defined(__x86_64) || defined(__i386__)
|
||||
#ifndef __AVX2__
|
||||
__m128i tmp;
|
||||
__m128i tmp={0};
|
||||
uint16_t *systematic2_ptr=(uint16_t *) output;
|
||||
#else
|
||||
__m256i tmp;
|
||||
__m256i tmp={0};
|
||||
uint32_t *systematic2_ptr=(uint32_t *) output;
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
|
||||
@@ -933,7 +933,7 @@ unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y,
|
||||
uint32_t db;
|
||||
|
||||
|
||||
__m256i tmp, zeros=_mm256_setzero_si256();
|
||||
__m256i tmp={0}, zeros=_mm256_setzero_si256();
|
||||
|
||||
|
||||
int offset8_flag=0;
|
||||
|
||||
@@ -1105,7 +1105,7 @@ uint8_t phy_threegpplte_turbo_decoder16(int16_t *y,
|
||||
uint8_t temp;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *yp128;
|
||||
__m128i tmp, zeros=_mm_setzero_si128();
|
||||
__m128i tmp={0}, zeros=_mm_setzero_si128();
|
||||
__m128i tmpe;
|
||||
#elif defined(__arm__)
|
||||
int16x8_t *yp128;
|
||||
|
||||
@@ -819,7 +819,7 @@ uint8_t phy_threegpplte_turbo_decoder8(int16_t *y,
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *yp128;
|
||||
__m128i tmp128[(n+8)>>3];
|
||||
__m128i tmp, zeros=_mm_setzero_si128();
|
||||
__m128i tmp={0}, zeros=_mm_setzero_si128();
|
||||
#elif defined(__arm__)
|
||||
int8x16_t *yp128;
|
||||
int8x16_t tmp128[(n+8)>>3];
|
||||
|
||||
+20
-15
@@ -121,6 +121,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
int i;
|
||||
int Ptx=cfg->carrier_config.num_tx_ant.value;
|
||||
int Prx=cfg->carrier_config.num_rx_ant.value;
|
||||
int max_ul_mimo_layers = 4;
|
||||
|
||||
AssertFatal(Ptx>0 && Ptx<9,"Ptx %d is not supported\n",Ptx);
|
||||
AssertFatal(Prx>0 && Prx<9,"Prx %d is not supported\n",Prx);
|
||||
@@ -293,27 +294,30 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
init_prach_list(gNB);
|
||||
|
||||
int N_RB_UL = cfg->carrier_config.ul_grid_size[cfg->ssb_config.scs_common.value].value;
|
||||
int n_buf = Prx*max_ul_mimo_layers;
|
||||
|
||||
for (int ULSCH_id=0; ULSCH_id<gNB->number_of_nr_ulsch_max; ULSCH_id++) {
|
||||
pusch_vars[ULSCH_id] = (NR_gNB_PUSCH *)malloc16_clear( sizeof(NR_gNB_PUSCH) );
|
||||
pusch_vars[ULSCH_id]->rxdataF_ext = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->rxdataF_ext2 = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_estimates = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_estimates_ext = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_ptrs_estimates = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_ptrs_estimates_ext = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ptrs_phase_per_slot = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_estimates_time = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->rxdataF_comp = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_mag0 = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_magb0 = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_mag = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_magb = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->rho = (int32_t **)malloc16_clear(Prx*sizeof(int32_t*) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_estimates = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_estimates_ext = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_ptrs_estimates = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_ptrs_estimates_ext = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ptrs_phase_per_slot = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_estimates_time = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->rxdataF_comp = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_mag0 = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_magb0 = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_mag = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->ul_ch_magb = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
|
||||
pusch_vars[ULSCH_id]->rho = (int32_t **)malloc16_clear(n_buf*sizeof(int32_t*) );
|
||||
|
||||
for (i=0; i<Prx; i++) {
|
||||
pusch_vars[ULSCH_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*N_RB_UL*12*fp->symbols_per_slot );
|
||||
pusch_vars[ULSCH_id]->rxdataF_ext2[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*N_RB_UL*12*fp->symbols_per_slot );
|
||||
}
|
||||
for (i=0; i<n_buf; i++) {
|
||||
pusch_vars[ULSCH_id]->ul_ch_estimates[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2*fp->symbols_per_slot );
|
||||
pusch_vars[ULSCH_id]->ul_ch_estimates_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*N_RB_UL*12*fp->symbols_per_slot );
|
||||
pusch_vars[ULSCH_id]->ul_ch_estimates_time[i] = (int32_t *)malloc16_clear( 2*sizeof(int32_t)*fp->ofdm_symbol_size );
|
||||
@@ -339,7 +343,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
|
||||
void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
{
|
||||
//NR_DL_FRAME_PARMS* const fp = &gNB->frame_parms;
|
||||
NR_DL_FRAME_PARMS* const fp = &gNB->frame_parms;
|
||||
NR_gNB_COMMON *const common_vars = &gNB->common_vars;
|
||||
NR_gNB_PUSCH **const pusch_vars = gNB->pusch_vars;
|
||||
/*LTE_eNB_SRS *const srs_vars = gNB->srs_vars;
|
||||
@@ -380,9 +384,11 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
free_and_zero(prach_vars->rxsigF[0]);
|
||||
*/
|
||||
for (int ULSCH_id=0; ULSCH_id<gNB->number_of_nr_ulsch_max; ULSCH_id++) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
for (int i = 0; i < fp->nb_antennas_rx; i++) {
|
||||
free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext[i]);
|
||||
free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext2[i]);
|
||||
}
|
||||
for (int i = 0; i < 4*fp->nb_antennas_rx; i++) {
|
||||
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates[i]);
|
||||
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_ext[i]);
|
||||
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_time[i]);
|
||||
@@ -396,7 +402,6 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_magb[i]);
|
||||
free_and_zero(pusch_vars[ULSCH_id]->rho[i]);
|
||||
}
|
||||
|
||||
free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext);
|
||||
free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext2);
|
||||
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates);
|
||||
|
||||
@@ -181,6 +181,16 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////PUCCH init/////////////////////////
|
||||
///////////
|
||||
for (th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
|
||||
for (gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) {
|
||||
ue->pucch_vars[th_id][gNB_id] = (NR_UE_PUCCH *)malloc16(sizeof(NR_UE_PUCCH));
|
||||
for (i=0; i<2; i++)
|
||||
ue->pucch_vars[th_id][gNB_id]->active[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
///////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -198,9 +198,8 @@ int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg,
|
||||
|
||||
fp->slots_per_frame = 10* fp->slots_per_subframe;
|
||||
|
||||
fp->nb_antenna_ports_gNB = 1; // It corresponds to the number of common antenna ports
|
||||
fp->nb_antennas_rx = cfg->carrier_config.num_rx_ant.value; // It denotes the number of rx antennas at gNB
|
||||
fp->nb_antennas_tx = cfg->carrier_config.num_tx_ant.value; // It corresponds to pdsch_AntennaPorts
|
||||
fp->nb_antennas_tx = cfg->carrier_config.num_tx_ant.value; // It corresponds to pdsch_AntennaPorts (logical antenna ports)
|
||||
|
||||
fp->symbols_per_slot = ((Ncp == NORMAL)? 14 : 12); // to redefine for different slot formats
|
||||
fp->samples_per_subframe_wCP = fp->ofdm_symbol_size * fp->symbols_per_slot * fp->slots_per_subframe;
|
||||
|
||||
@@ -35,7 +35,6 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32
|
||||
#define SCALE 0x3FFF
|
||||
|
||||
static const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
|
||||
//static const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
|
||||
|
||||
extern unsigned short dftsizes[34];
|
||||
extern int16_t *ul_ref_sigs_rx[30][2][34];
|
||||
|
||||
@@ -1234,7 +1234,7 @@ void dlsch_channel_compensation(int **rxdataF_ext,
|
||||
unsigned short rb;
|
||||
unsigned char aatx,aarx,symbol_mod,pilots=0;
|
||||
__m128i *dl_ch128,*dl_ch128_2,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128,*rho128;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0};
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
|
||||
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) {
|
||||
@@ -1657,11 +1657,11 @@ void dlsch_channel_compensation_core(int **rxdataF_ext,
|
||||
int length_mod8 = 0;
|
||||
int length2;
|
||||
__m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b, *dl_ch128_2, *rxdataF128,*rxdataF_comp128,*rho128;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0};
|
||||
int aatx = 0, aarx = 0;
|
||||
|
||||
for (aatx=0; aatx<n_tx; aatx++) {
|
||||
__m128i QAM_amp128b;
|
||||
__m128i QAM_amp128b={0};
|
||||
|
||||
if (mod_order == 4) {
|
||||
QAM_amp128 = _mm_set1_epi16(QAM16_n1); // 2/sqrt(10)
|
||||
@@ -2004,7 +2004,7 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext,
|
||||
__m128i *dl_ch0_128,*dl_ch1_128,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128;
|
||||
unsigned char aarx=0,symbol_mod,pilots=0;
|
||||
int precoded_signal_strength=0;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0};
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
|
||||
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp)))
|
||||
@@ -2411,7 +2411,7 @@ void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int **rxdataF_comp0 = pdsch_vars->rxdataF_comp0;
|
||||
int **rxdataF_comp1 = pdsch_vars->rxdataF_comp1[harq_pid][round];
|
||||
unsigned char *pmi_ext = pdsch_vars->pmi_ext;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp0_128,QAM_amp1_128;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp0_128={0},QAM_amp1_128={0};
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
|
||||
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp)))
|
||||
|
||||
@@ -328,7 +328,7 @@ void mch_channel_compensation(int **rxdataF_ext,
|
||||
int aarx,nre,i;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0},QAM_amp128b={0};
|
||||
#elif defined(__arm__)
|
||||
#endif
|
||||
|
||||
@@ -455,7 +455,7 @@ void mch_channel_compensation_khz_1dot25(int **rxdataF_ext,
|
||||
int aarx,nre,i;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0},QAM_amp128b={0};
|
||||
#elif defined(__arm__)
|
||||
#endif
|
||||
/*if ((symbol == 2) || (symbol == 6) || (symbol == 10))
|
||||
|
||||
@@ -52,8 +52,7 @@
|
||||
|
||||
|
||||
|
||||
void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch)
|
||||
{
|
||||
void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch) {
|
||||
int i;
|
||||
int r;
|
||||
|
||||
@@ -68,6 +67,7 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch)
|
||||
free16(ulsch->harq_processes[i]->b,MAX_ULSCH_PAYLOAD_BYTES);
|
||||
ulsch->harq_processes[i]->b = NULL;
|
||||
}
|
||||
|
||||
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++) {
|
||||
if (ulsch->harq_processes[i]->c[r]) {
|
||||
free16(ulsch->harq_processes[i]->c[r],((r==0)?8:0) + 3+768);
|
||||
@@ -79,51 +79,47 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch)
|
||||
ulsch->harq_processes[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
free16(ulsch,sizeof(LTE_UE_ULSCH_t));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag)
|
||||
{
|
||||
|
||||
LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag) {
|
||||
LTE_UE_ULSCH_t *ulsch;
|
||||
unsigned char exit_flag = 0,i,j,r;
|
||||
unsigned char bw_scaling =1;
|
||||
|
||||
switch (N_RB_UL) {
|
||||
case 6:
|
||||
bw_scaling =16;
|
||||
break;
|
||||
case 6:
|
||||
bw_scaling =16;
|
||||
break;
|
||||
|
||||
case 25:
|
||||
bw_scaling =4;
|
||||
break;
|
||||
case 25:
|
||||
bw_scaling =4;
|
||||
break;
|
||||
|
||||
case 50:
|
||||
bw_scaling =2;
|
||||
break;
|
||||
|
||||
default:
|
||||
bw_scaling =1;
|
||||
break;
|
||||
case 50:
|
||||
bw_scaling =2;
|
||||
break;
|
||||
|
||||
default:
|
||||
bw_scaling =1;
|
||||
break;
|
||||
}
|
||||
|
||||
ulsch = (LTE_UE_ULSCH_t *)malloc16(sizeof(LTE_UE_ULSCH_t));
|
||||
|
||||
if (ulsch) {
|
||||
memset(ulsch,0,sizeof(LTE_UE_ULSCH_t));
|
||||
|
||||
ulsch->Mlimit = 4;
|
||||
|
||||
for (i=0; i<8; i++) {
|
||||
|
||||
ulsch->harq_processes[i] = (LTE_UL_UE_HARQ_t *)malloc16(sizeof(LTE_UL_UE_HARQ_t));
|
||||
|
||||
// printf("ulsch->harq_processes[%d] %p\n",i,ulsch->harq_processes[i]);
|
||||
if (ulsch->harq_processes[i]) {
|
||||
memset(ulsch->harq_processes[i], 0, sizeof(LTE_UL_UE_HARQ_t));
|
||||
ulsch->harq_processes[i]->b = (unsigned char*)malloc16(MAX_ULSCH_PAYLOAD_BYTES/bw_scaling);
|
||||
ulsch->harq_processes[i]->b = (unsigned char *)malloc16(MAX_ULSCH_PAYLOAD_BYTES/bw_scaling);
|
||||
|
||||
if (ulsch->harq_processes[i]->b)
|
||||
memset(ulsch->harq_processes[i]->b,0,MAX_ULSCH_PAYLOAD_BYTES/bw_scaling);
|
||||
@@ -134,7 +130,7 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag)
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++) {
|
||||
ulsch->harq_processes[i]->c[r] = (unsigned char*)malloc16(((r==0)?8:0) + 3+768); // account for filler in first segment and CRCs for multiple segment case
|
||||
ulsch->harq_processes[i]->c[r] = (unsigned char *)malloc16(((r==0)?8:0) + 3+768); // account for filler in first segment and CRCs for multiple segment case
|
||||
|
||||
if (ulsch->harq_processes[i]->c[r])
|
||||
memset(ulsch->harq_processes[i]->c[r],0,((r==0)?8:0) + 3+768);
|
||||
@@ -167,8 +163,6 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag)
|
||||
LOG_E(PHY,"new_ue_ulsch exit flag, size of %d , %zu\n",exit_flag, sizeof(LTE_UE_ULSCH_t));
|
||||
free_ue_ulsch(ulsch);
|
||||
return(NULL);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -179,15 +173,12 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
uint8_t subframe_rx,
|
||||
uint8_t tmode,
|
||||
uint8_t control_only_flag,
|
||||
uint8_t Nbundled)
|
||||
{
|
||||
|
||||
uint8_t Nbundled) {
|
||||
time_stats_t *seg_stats=&ue->ulsch_segmentation_stats;
|
||||
time_stats_t *rm_stats=&ue->ulsch_rate_matching_stats;
|
||||
time_stats_t *te_stats=&ue->ulsch_turbo_encoding_stats;
|
||||
time_stats_t *i_stats=&ue->ulsch_interleaving_stats;
|
||||
time_stats_t *m_stats=&ue->ulsch_multiplexing_stats;
|
||||
|
||||
// uint16_t offset;
|
||||
uint32_t crc=1;
|
||||
uint32_t A;
|
||||
@@ -237,7 +228,6 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING_FILL_CQI, VCD_FUNCTION_IN);
|
||||
rnti = ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti;
|
||||
fill_CQI(ulsch,meas,0,harq_pid,ue->frame_parms.N_RB_DL,rnti, tmode,ue->sinr_eff);
|
||||
|
||||
LOG_D(PHY,"ULSCH Encoding rnti %x \n", rnti);
|
||||
print_CQI(ulsch->o,ulsch->uci_format,0,ue->frame_parms.N_RB_DL);
|
||||
|
||||
@@ -246,6 +236,7 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
//LOG_I(PHY,"XXX saving pmi for DL %x\n",pmi2hex_2Ar1(((wideband_cqi_rank1_2A_5MHz *)ulsch->o)->pmi));
|
||||
dlsch[0]->pmi_alloc = ((wideband_cqi_rank1_2A_5MHz *)ulsch->o)->pmi;
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING_FILL_CQI, VCD_FUNCTION_OUT);
|
||||
}
|
||||
|
||||
@@ -268,17 +259,15 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
if (control_only_flag == 0) {
|
||||
A=ulsch->harq_processes[harq_pid]->TBS;
|
||||
Q_m = get_Qm_ul(ulsch->harq_processes[harq_pid]->mcs);
|
||||
|
||||
ulsch->harq_processes[harq_pid]->control_only = 0;
|
||||
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("[PHY][UE] ULSCH coding : A %d, Qm %d, mcs %d, harq_pid %d, round %d, RV %d\n",
|
||||
ulsch->harq_processes[harq_pid]->TBS,
|
||||
Q_m,
|
||||
ulsch->harq_processes[harq_pid]->mcs,
|
||||
harq_pid,
|
||||
ulsch->harq_processes[harq_pid]->round,
|
||||
ulsch->harq_processes[harq_pid]->rvidx);
|
||||
ulsch->harq_processes[harq_pid]->TBS,
|
||||
Q_m,
|
||||
ulsch->harq_processes[harq_pid]->mcs,
|
||||
harq_pid,
|
||||
ulsch->harq_processes[harq_pid]->round,
|
||||
ulsch->harq_processes[harq_pid]->rvidx);
|
||||
|
||||
for (i=0; i<ulsch->harq_processes[harq_pid]->O_ACK; i++)
|
||||
printf("ulsch_coding: o_ACK[%d] %d\n",i,ulsch->o_ACK[i]);
|
||||
@@ -301,16 +290,13 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
#endif
|
||||
|
||||
if (ulsch->harq_processes[harq_pid]->round == 0) { // this is a new packet
|
||||
|
||||
start_meas(seg_stats);
|
||||
// Add 24-bit crc (polynomial A) to payload
|
||||
crc = crc24a(a,
|
||||
A)>>8;
|
||||
|
||||
a[A>>3] = ((uint8_t*)&crc)[2];
|
||||
a[1+(A>>3)] = ((uint8_t*)&crc)[1];
|
||||
a[2+(A>>3)] = ((uint8_t*)&crc)[0];
|
||||
|
||||
a[A>>3] = ((uint8_t *)&crc)[2];
|
||||
a[1+(A>>3)] = ((uint8_t *)&crc)[1];
|
||||
a[2+(A>>3)] = ((uint8_t *)&crc)[0];
|
||||
ulsch->harq_processes[harq_pid]->B = A+24;
|
||||
ulsch->harq_processes[harq_pid]->b = a;
|
||||
lte_segmentation(ulsch->harq_processes[harq_pid]->b,
|
||||
@@ -322,7 +308,6 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
&ulsch->harq_processes[harq_pid]->Kplus,
|
||||
&ulsch->harq_processes[harq_pid]->Kminus,
|
||||
&ulsch->harq_processes[harq_pid]->F);
|
||||
|
||||
stop_meas(seg_stats);
|
||||
|
||||
for (r=0; r<ulsch->harq_processes[harq_pid]->C; r++) {
|
||||
@@ -332,25 +317,20 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
Kr = ulsch->harq_processes[harq_pid]->Kplus;
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("Generating Code Segment %d (%d bits)\n",r,Kr);
|
||||
// generate codewords
|
||||
|
||||
printf("bits_per_codeword (Kr)= %d\n",Kr);
|
||||
printf("N_RB = %d\n",ulsch->harq_processes[harq_pid]->nb_rb);
|
||||
printf("Ncp %d\n",frame_parms->Ncp);
|
||||
printf("Qm %d\n",Q_m);
|
||||
#endif
|
||||
|
||||
// offset=0;
|
||||
|
||||
|
||||
start_meas(te_stats);
|
||||
encoder(ulsch->harq_processes[harq_pid]->c[r],
|
||||
Kr>>3,
|
||||
&ulsch->harq_processes[harq_pid]->d[r][96],
|
||||
(r==0) ? ulsch->harq_processes[harq_pid]->F : 0
|
||||
Kr>>3,
|
||||
&ulsch->harq_processes[harq_pid]->d[r][96],
|
||||
(r==0) ? ulsch->harq_processes[harq_pid]->F : 0
|
||||
);
|
||||
stop_meas(te_stats);
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
@@ -366,7 +346,6 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
ulsch->harq_processes[harq_pid]->w[r]);
|
||||
stop_meas(i_stats);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (ulsch->harq_processes[harq_pid]->C == 0) {
|
||||
@@ -392,7 +371,6 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
|
||||
ulsch->harq_processes[harq_pid]->sumKr = sumKr;
|
||||
// Compute Q_ri (p. 23 36-212)
|
||||
|
||||
Qprime = ulsch->O_RI*ulsch->harq_processes[harq_pid]->Msc_initial*ulsch->harq_processes[harq_pid]->Nsymb_initial * ulsch->beta_offset_ri_times8;
|
||||
|
||||
if (Qprime > 0) {
|
||||
@@ -407,7 +385,6 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
|
||||
Q_RI = Q_m*Qprime;
|
||||
Qprime_RI = Qprime;
|
||||
|
||||
// Compute Q_ack (p. 23 36-212)
|
||||
Qprime = ulsch->harq_processes[harq_pid]->O_ACK*ulsch->harq_processes[harq_pid]->Msc_initial*ulsch->harq_processes[harq_pid]->Nsymb_initial * ulsch->beta_offset_harqack_times8;
|
||||
|
||||
@@ -423,20 +400,18 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
|
||||
Q_ACK = Qprime * Q_m;
|
||||
Qprime_ACK = Qprime;
|
||||
|
||||
LOG_D(PHY,"UE (%x/%d) O_ACK %d, Mcs_initial %d, Nsymb_initial %d, beta_offset_harqack*8 %d, sum Kr %d, Qprime_ACK %d, Q_ACK %d\n",
|
||||
rnti, harq_pid,
|
||||
ulsch->harq_processes[harq_pid]->O_ACK,
|
||||
ulsch->harq_processes[harq_pid]->Msc_initial,
|
||||
ulsch->harq_processes[harq_pid]->Nsymb_initial,
|
||||
ulsch->beta_offset_harqack_times8,
|
||||
sumKr,
|
||||
Qprime_ACK,
|
||||
Q_ACK);
|
||||
rnti, harq_pid,
|
||||
ulsch->harq_processes[harq_pid]->O_ACK,
|
||||
ulsch->harq_processes[harq_pid]->Msc_initial,
|
||||
ulsch->harq_processes[harq_pid]->Nsymb_initial,
|
||||
ulsch->beta_offset_harqack_times8,
|
||||
sumKr,
|
||||
Qprime_ACK,
|
||||
Q_ACK);
|
||||
|
||||
// Compute Q_cqi, assume O>11, p. 26 36-212
|
||||
if (control_only_flag == 0) {
|
||||
|
||||
if (ulsch->O < 12)
|
||||
L=0;
|
||||
else
|
||||
@@ -446,13 +421,13 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
Qprime = (ulsch->O + L) * ulsch->harq_processes[harq_pid]->Msc_initial*ulsch->harq_processes[harq_pid]->Nsymb_initial * ulsch->beta_offset_cqi_times8;
|
||||
else
|
||||
Qprime = 0;
|
||||
LOG_D(PHY,"Qprime %d, O_RI %d + %d, Msc %d, Nym %d beta %d\n",
|
||||
Qprime,
|
||||
ulsch->O, L,
|
||||
ulsch->harq_processes[harq_pid]->Msc_initial,
|
||||
ulsch->harq_processes[harq_pid]->Nsymb_initial,
|
||||
ulsch->beta_offset_cqi_times8);
|
||||
|
||||
LOG_D(PHY,"Qprime %d, O_RI %d + %d, Msc %d, Nym %d beta %d\n",
|
||||
Qprime,
|
||||
ulsch->O, L,
|
||||
ulsch->harq_processes[harq_pid]->Msc_initial,
|
||||
ulsch->harq_processes[harq_pid]->Nsymb_initial,
|
||||
ulsch->beta_offset_cqi_times8);
|
||||
|
||||
if (Qprime > 0) {
|
||||
if ((Qprime % (8*sumKr)) > 0)
|
||||
@@ -463,31 +438,29 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
|
||||
G = ulsch->harq_processes[harq_pid]->nb_rb * (12 * Q_m) * (ulsch->Nsymb_pusch);
|
||||
LOG_D(PHY,"G: rb %d * ( 12 * Qm %d ) * nsymb %d, Qprime %d, O_RI %d\n", ulsch->harq_processes[harq_pid]->nb_rb, Q_m, ulsch->Nsymb_pusch, Qprime, ulsch->O_RI);
|
||||
|
||||
if (Qprime > (G - ulsch->O_RI))
|
||||
Qprime = G - ulsch->O_RI;
|
||||
|
||||
Q_CQI = Q_m * Qprime;
|
||||
Qprime_CQI = Qprime;
|
||||
|
||||
|
||||
|
||||
G = G - Q_RI - Q_CQI;
|
||||
LOG_D(PHY,"new G: %d, Q_RI %d Q_CQI %d\n", G , Q_RI , Q_CQI);
|
||||
LOG_D(PHY,"new G: %d, Q_RI %d Q_CQI %d\n", G, Q_RI, Q_CQI);
|
||||
ulsch->harq_processes[harq_pid]->G = G;
|
||||
|
||||
/*
|
||||
LOG_I(PHY,"ULSCH Encoding G %d, Q_RI %d (O_RI%d, Msc_initial %d, Nsymb_initial%d, beta_offset_ri_times8 %d), Q_CQI %d, Q_ACK %d \n",G,Q_RI,ulsch->O_RI,ulsch->harq_processes[harq_pid]->Msc_initial,ulsch->harq_processes[harq_pid]->Nsymb_initial,ulsch->beta_offset_ri_times8,Q_CQI,Q_ACK);
|
||||
/*
|
||||
LOG_I(PHY,"ULSCH Encoding G %d, Q_RI %d (O_RI%d, Msc_initial %d, Nsymb_initial%d, beta_offset_ri_times8 %d), Q_CQI %d, Q_ACK %d \n",G,Q_RI,ulsch->O_RI,ulsch->harq_processes[harq_pid]->Msc_initial,ulsch->harq_processes[harq_pid]->Nsymb_initial,ulsch->beta_offset_ri_times8,Q_CQI,Q_ACK);
|
||||
|
||||
LOG_I(PHY,"ULSCH Encoding (Nid_cell %d, rnti %x): harq_pid %d round %d, RV %d, mcs %d, O_RI %d, O_ACK %d, G %d\n",
|
||||
frame_parms->Nid_cell,ulsch->rnti,
|
||||
harq_pid,
|
||||
ulsch->harq_processes[harq_pid]->round,
|
||||
ulsch->harq_processes[harq_pid]->rvidx,
|
||||
ulsch->harq_processes[harq_pid]->mcs,
|
||||
ulsch->O_RI,
|
||||
ulsch->harq_processes[harq_pid]->O_ACK,
|
||||
G);
|
||||
*/
|
||||
LOG_I(PHY,"ULSCH Encoding (Nid_cell %d, rnti %x): harq_pid %d round %d, RV %d, mcs %d, O_RI %d, O_ACK %d, G %d\n",
|
||||
frame_parms->Nid_cell,ulsch->rnti,
|
||||
harq_pid,
|
||||
ulsch->harq_processes[harq_pid]->round,
|
||||
ulsch->harq_processes[harq_pid]->rvidx,
|
||||
ulsch->harq_processes[harq_pid]->mcs,
|
||||
ulsch->O_RI,
|
||||
ulsch->harq_processes[harq_pid]->O_ACK,
|
||||
G);
|
||||
*/
|
||||
|
||||
if ((int)G < 0) {
|
||||
LOG_E(PHY,"FATAL: ulsch_coding.c G < 0 (%d) : Q_RI %d, Q_CQI %d, O %d, betaCQI_times8 %d)\n",G,Q_RI,Q_CQI,ulsch->O,ulsch->beta_offset_cqi_times8);
|
||||
@@ -495,26 +468,21 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
// Data and control multiplexing (5.2.2.7 36-212)
|
||||
|
||||
H = G + Q_CQI;
|
||||
Hprime = H/Q_m;
|
||||
|
||||
|
||||
|
||||
// Fill in the "e"-sequence from 36-212, V8.6 2009-03, p. 16-17 (for each "e") and concatenate the
|
||||
// outputs for each code segment, see Section 5.1.5 p.20
|
||||
|
||||
for (r=0; r<ulsch->harq_processes[harq_pid]->C; r++) {
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("Rate Matching, Code segment %d (coded bits (G) %d,unpunctured/repeated bits per code segment %d,mod_order %d, nb_rb %d)...\n",
|
||||
r,
|
||||
G,
|
||||
Kr*3,
|
||||
Q_m,ulsch->harq_processes[harq_pid]->nb_rb);
|
||||
r,
|
||||
G,
|
||||
Kr*3,
|
||||
Q_m,ulsch->harq_processes[harq_pid]->nb_rb);
|
||||
#endif
|
||||
|
||||
start_meas(rm_stats);
|
||||
r_offset += lte_rate_matching_turbo(ulsch->harq_processes[harq_pid]->RTC[r],
|
||||
G,
|
||||
@@ -529,7 +497,7 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
1,
|
||||
r,
|
||||
ulsch->harq_processes[harq_pid]->nb_rb);
|
||||
//ulsch->harq_processes[harq_pid]->mcs); // r
|
||||
//ulsch->harq_processes[harq_pid]->mcs); // r
|
||||
stop_meas(rm_stats);
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
|
||||
@@ -544,7 +512,6 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
Hprime = H/Q_m;
|
||||
}
|
||||
|
||||
|
||||
// Do CQI coding
|
||||
if ((ulsch->O>1) && (ulsch->O < 12)) {
|
||||
LOG_E(PHY,"short CQI sizes not supported yet\n");
|
||||
@@ -558,23 +525,18 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
printf("crc(cqi) tx : %x\n",crc);
|
||||
#endif
|
||||
memset((void *)&ulsch->o_d[0],LTE_NULL,96);
|
||||
|
||||
ccodelte_encode(ulsch->O,
|
||||
1,
|
||||
o_flip,
|
||||
&ulsch->o_d[96],
|
||||
0);
|
||||
|
||||
|
||||
o_RCC = sub_block_interleaving_cc(8+ulsch->O,
|
||||
&ulsch->o_d[96],
|
||||
ulsch->o_w);
|
||||
|
||||
lte_rate_matching_cc(o_RCC,
|
||||
Q_CQI,
|
||||
ulsch->o_w,
|
||||
ulsch->q);
|
||||
|
||||
}
|
||||
|
||||
i=0;
|
||||
@@ -582,29 +544,29 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
// Do RI coding
|
||||
if (ulsch->O_RI == 1) {
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
ulsch->q_RI[0] = ulsch->o_RI[0];
|
||||
ulsch->q_RI[1] = PUSCH_y;//ulsch->o_RI[0];
|
||||
len_RI=2;
|
||||
break;
|
||||
case 2:
|
||||
ulsch->q_RI[0] = ulsch->o_RI[0];
|
||||
ulsch->q_RI[1] = PUSCH_y;//ulsch->o_RI[0];
|
||||
len_RI=2;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
ulsch->q_RI[0] = ulsch->o_RI[0];
|
||||
ulsch->q_RI[1] = PUSCH_y;//1;
|
||||
ulsch->q_RI[2] = PUSCH_x;//ulsch->o_RI[0];
|
||||
ulsch->q_RI[3] = PUSCH_x;//1;
|
||||
len_RI=4;
|
||||
break;
|
||||
case 4:
|
||||
ulsch->q_RI[0] = ulsch->o_RI[0];
|
||||
ulsch->q_RI[1] = PUSCH_y;//1;
|
||||
ulsch->q_RI[2] = PUSCH_x;//ulsch->o_RI[0];
|
||||
ulsch->q_RI[3] = PUSCH_x;//1;
|
||||
len_RI=4;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
ulsch->q_RI[0] = ulsch->o_RI[0];
|
||||
ulsch->q_RI[1] = PUSCH_y;//1;
|
||||
ulsch->q_RI[2] = PUSCH_x;//1;
|
||||
ulsch->q_RI[3] = PUSCH_x;//ulsch->o_RI[0];
|
||||
ulsch->q_RI[4] = PUSCH_x;//1;
|
||||
ulsch->q_RI[5] = PUSCH_x;//1;
|
||||
len_RI=6;
|
||||
break;
|
||||
case 6:
|
||||
ulsch->q_RI[0] = ulsch->o_RI[0];
|
||||
ulsch->q_RI[1] = PUSCH_y;//1;
|
||||
ulsch->q_RI[2] = PUSCH_x;//1;
|
||||
ulsch->q_RI[3] = PUSCH_x;//ulsch->o_RI[0];
|
||||
ulsch->q_RI[4] = PUSCH_x;//1;
|
||||
ulsch->q_RI[5] = PUSCH_x;//1;
|
||||
len_RI=6;
|
||||
break;
|
||||
}
|
||||
} else if (ulsch->O_RI>1) {
|
||||
LOG_E(PHY,"RI cannot be more than 1 bit yet\n");
|
||||
@@ -616,35 +578,35 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
wACK_idx = (ulsch->bundling==0) ? 4 : ((Nbundled-1)&3);
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("ulsch_coding.c: Bundling %d, Nbundled %d, wACK_idx %d\n",
|
||||
ulsch->bundling,Nbundled,wACK_idx);
|
||||
ulsch->bundling,Nbundled,wACK_idx);
|
||||
#endif
|
||||
|
||||
// 1-bit ACK/NAK
|
||||
if (ulsch->harq_processes[harq_pid]->O_ACK == 1) {
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : ((ulsch->o_ACK[0]+wACK[wACK_idx][1])&1);//ulsch->o_ACK[0];
|
||||
len_ACK = 2;
|
||||
break;
|
||||
case 2:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : ((ulsch->o_ACK[0]+wACK[wACK_idx][1])&1);//ulsch->o_ACK[0];
|
||||
len_ACK = 2;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : ((ulsch->o_ACK[0]+wACK[wACK_idx][1])&1);
|
||||
ulsch->q_ACK[2] = PUSCH_x;
|
||||
ulsch->q_ACK[3] = PUSCH_x;
|
||||
len_ACK = 4;
|
||||
break;
|
||||
case 4:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : ((ulsch->o_ACK[0]+wACK[wACK_idx][1])&1);
|
||||
ulsch->q_ACK[2] = PUSCH_x;
|
||||
ulsch->q_ACK[3] = PUSCH_x;
|
||||
len_ACK = 4;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : ((ulsch->o_ACK[0]+wACK[wACK_idx][1])&1);
|
||||
ulsch->q_ACK[2] = PUSCH_x;
|
||||
ulsch->q_ACK[3] = PUSCH_x;
|
||||
ulsch->q_ACK[4] = PUSCH_x;
|
||||
ulsch->q_ACK[6] = PUSCH_x;
|
||||
len_ACK = 6;
|
||||
break;
|
||||
case 6:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : ((ulsch->o_ACK[0]+wACK[wACK_idx][1])&1);
|
||||
ulsch->q_ACK[2] = PUSCH_x;
|
||||
ulsch->q_ACK[3] = PUSCH_x;
|
||||
ulsch->q_ACK[4] = PUSCH_x;
|
||||
ulsch->q_ACK[6] = PUSCH_x;
|
||||
len_ACK = 6;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -653,56 +615,53 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
ack_parity = (ulsch->o_ACK[0]+ulsch->o_ACK[1])&1;
|
||||
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->o_ACK[1]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[2] = (ack_parity+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[3] = (ulsch->o_ACK[0]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[4] = (ulsch->o_ACK[1]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[5] = (ack_parity+wACK[wACK_idx][1])&1;
|
||||
len_ACK = 6;
|
||||
break;
|
||||
case 2:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->o_ACK[1]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[2] = (ack_parity+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[3] = (ulsch->o_ACK[0]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[4] = (ulsch->o_ACK[1]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[5] = (ack_parity+wACK[wACK_idx][1])&1;
|
||||
len_ACK = 6;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->o_ACK[1]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[2] = PUSCH_x;
|
||||
ulsch->q_ACK[3] = PUSCH_x;//1;
|
||||
ulsch->q_ACK[4] = (ack_parity+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[5] = (ulsch->o_ACK[0]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[6] = PUSCH_x;
|
||||
ulsch->q_ACK[7] = PUSCH_x;//1;
|
||||
ulsch->q_ACK[8] = (ulsch->o_ACK[1]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[9] = (ack_parity+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[10] = PUSCH_x;
|
||||
ulsch->q_ACK[11] = PUSCH_x;//1;
|
||||
len_ACK = 12;
|
||||
break;
|
||||
case 4:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->o_ACK[1]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[2] = PUSCH_x;
|
||||
ulsch->q_ACK[3] = PUSCH_x;//1;
|
||||
ulsch->q_ACK[4] = (ack_parity+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[5] = (ulsch->o_ACK[0]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[6] = PUSCH_x;
|
||||
ulsch->q_ACK[7] = PUSCH_x;//1;
|
||||
ulsch->q_ACK[8] = (ulsch->o_ACK[1]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[9] = (ack_parity+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[10] = PUSCH_x;
|
||||
ulsch->q_ACK[11] = PUSCH_x;//1;
|
||||
len_ACK = 12;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->o_ACK[1]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[2] = PUSCH_x;
|
||||
ulsch->q_ACK[3] = PUSCH_x;
|
||||
ulsch->q_ACK[4] = PUSCH_x;
|
||||
ulsch->q_ACK[5] = PUSCH_x;
|
||||
|
||||
ulsch->q_ACK[6] = (ack_parity+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[7] = (ulsch->o_ACK[0]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[8] = PUSCH_x;
|
||||
ulsch->q_ACK[9] = PUSCH_x;
|
||||
ulsch->q_ACK[10] = PUSCH_x;
|
||||
ulsch->q_ACK[11] = PUSCH_x;
|
||||
|
||||
ulsch->q_ACK[12] = (ulsch->o_ACK[1]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[13] = (ack_parity+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[14] = PUSCH_x;
|
||||
ulsch->q_ACK[15] = PUSCH_x;
|
||||
ulsch->q_ACK[16] = PUSCH_x;
|
||||
ulsch->q_ACK[17] = PUSCH_x;
|
||||
len_ACK = 18;
|
||||
|
||||
break;
|
||||
case 6:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->o_ACK[1]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[2] = PUSCH_x;
|
||||
ulsch->q_ACK[3] = PUSCH_x;
|
||||
ulsch->q_ACK[4] = PUSCH_x;
|
||||
ulsch->q_ACK[5] = PUSCH_x;
|
||||
ulsch->q_ACK[6] = (ack_parity+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[7] = (ulsch->o_ACK[0]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[8] = PUSCH_x;
|
||||
ulsch->q_ACK[9] = PUSCH_x;
|
||||
ulsch->q_ACK[10] = PUSCH_x;
|
||||
ulsch->q_ACK[11] = PUSCH_x;
|
||||
ulsch->q_ACK[12] = (ulsch->o_ACK[1]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[13] = (ack_parity+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[14] = PUSCH_x;
|
||||
ulsch->q_ACK[15] = PUSCH_x;
|
||||
ulsch->q_ACK[16] = PUSCH_x;
|
||||
ulsch->q_ACK[17] = PUSCH_x;
|
||||
len_ACK = 18;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -712,23 +671,17 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
// channel multiplexing/interleaving
|
||||
|
||||
start_meas(m_stats);
|
||||
Hpp = Hprime + Q_RI;
|
||||
|
||||
Cmux = ulsch->Nsymb_pusch;
|
||||
Rmux = Hpp*Q_m/Cmux;
|
||||
Rmux_prime = Rmux/Q_m;
|
||||
|
||||
Qprime_RI = Q_RI / Q_m;
|
||||
Qprime_ACK = Q_ACK / Q_m;
|
||||
Qprime_CQI = Q_CQI / Q_m;
|
||||
|
||||
// printf("Qprime_CQI = %d\n",Qprime_CQI);
|
||||
// RI BITS
|
||||
|
||||
memset(y,LTE_NULL,Q_m*Hpp);
|
||||
|
||||
if (frame_parms->Ncp == 0)
|
||||
@@ -747,10 +700,8 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
}
|
||||
|
||||
j=(j+3)&3;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// CQI and Data bits
|
||||
j=0;
|
||||
/*
|
||||
@@ -775,7 +726,6 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
*/
|
||||
|
||||
for (i=0; i<Qprime_CQI; i++) {
|
||||
|
||||
while (y[Q_m*j] != LTE_NULL) j++;
|
||||
|
||||
for (q=0; q<Q_m; q++) {
|
||||
@@ -789,47 +739,44 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
j2 = j*Q_m;
|
||||
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
for (iprime=0; iprime<(Hprime-Qprime_CQI)<<1; iprime+=2) {
|
||||
while (y[j2] != LTE_NULL) j2+=2;
|
||||
|
||||
case 2:
|
||||
y[j2] = ulsch->e[iprime];
|
||||
y[1+j2] = ulsch->e[1+iprime];
|
||||
j2+=2;
|
||||
}
|
||||
|
||||
for (iprime=0; iprime<(Hprime-Qprime_CQI)<<1; iprime+=2) {
|
||||
while (y[j2] != LTE_NULL) j2+=2;
|
||||
break;
|
||||
|
||||
y[j2] = ulsch->e[iprime];
|
||||
y[1+j2] = ulsch->e[1+iprime];
|
||||
j2+=2;
|
||||
}
|
||||
case 4:
|
||||
for (iprime=0; iprime<(Hprime-Qprime_CQI)<<2; iprime+=4) {
|
||||
while (y[j2] != LTE_NULL) j2+=4;
|
||||
|
||||
break;
|
||||
y[j2] = ulsch->e[iprime];
|
||||
y[1+j2] = ulsch->e[1+iprime];
|
||||
y[2+j2] = ulsch->e[2+iprime];
|
||||
y[3+j2] = ulsch->e[3+iprime];
|
||||
j2+=4;
|
||||
}
|
||||
|
||||
case 4:
|
||||
for (iprime=0; iprime<(Hprime-Qprime_CQI)<<2; iprime+=4) {
|
||||
while (y[j2] != LTE_NULL) j2+=4;
|
||||
break;
|
||||
|
||||
y[j2] = ulsch->e[iprime];
|
||||
y[1+j2] = ulsch->e[1+iprime];
|
||||
y[2+j2] = ulsch->e[2+iprime];
|
||||
y[3+j2] = ulsch->e[3+iprime];
|
||||
j2+=4;
|
||||
}
|
||||
case 6:
|
||||
for (iprime=0; iprime<(Hprime-Qprime_CQI)*6; iprime+=6) {
|
||||
while (y[j2] != LTE_NULL) j2+=6;
|
||||
|
||||
break;
|
||||
|
||||
case 6:
|
||||
for (iprime=0; iprime<(Hprime-Qprime_CQI)*6; iprime+=6) {
|
||||
while (y[j2] != LTE_NULL) j2+=6;
|
||||
|
||||
y[j2] = ulsch->e[iprime];
|
||||
y[1+j2] = ulsch->e[1+iprime];
|
||||
y[2+j2] = ulsch->e[2+iprime];
|
||||
y[3+j2] = ulsch->e[3+iprime];
|
||||
y[4+j2] = ulsch->e[4+iprime];
|
||||
y[5+j2] = ulsch->e[5+iprime];
|
||||
j2+=6;
|
||||
}
|
||||
|
||||
break;
|
||||
y[j2] = ulsch->e[iprime];
|
||||
y[1+j2] = ulsch->e[1+iprime];
|
||||
y[2+j2] = ulsch->e[2+iprime];
|
||||
y[3+j2] = ulsch->e[3+iprime];
|
||||
y[4+j2] = ulsch->e[4+iprime];
|
||||
y[5+j2] = ulsch->e[5+iprime];
|
||||
j2+=6;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// HARQ-ACK Bits (Note these overwrite some bits)
|
||||
@@ -848,57 +795,56 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
y[q+(Q_m*((r*Cmux) + columnset[j]))] = ulsch->q_ACK[(q+(Q_m*i))%len_ACK];
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("ulsch_coding.c: ACK %d => y[%d]=%d (i %d, r*Cmux %d, columnset %d)\n",q+(Q_m*i),
|
||||
q+(Q_m*((r*Cmux) + columnset[j])),ulsch->q_ACK[(q+(Q_m*i))%len_ACK],
|
||||
i,r*Cmux,columnset[j]);
|
||||
q+(Q_m*((r*Cmux) + columnset[j])),ulsch->q_ACK[(q+(Q_m*i))%len_ACK],
|
||||
i,r*Cmux,columnset[j]);
|
||||
#endif
|
||||
}
|
||||
|
||||
j=(j+3)&3;
|
||||
|
||||
}
|
||||
|
||||
// write out buffer
|
||||
j=0;
|
||||
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
for (i=0; i<Cmux; i++)
|
||||
for (r=0; r<Rmux_prime; r++) {
|
||||
yptr=&y[((r*Cmux)+i)<<1];
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
}
|
||||
case 2:
|
||||
for (i=0; i<Cmux; i++)
|
||||
for (r=0; r<Rmux_prime; r++) {
|
||||
yptr=&y[((r*Cmux)+i)<<1];
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
for (i=0; i<Cmux; i++)
|
||||
for (r=0; r<Rmux_prime; r++) {
|
||||
yptr = &y[((r*Cmux)+i)<<2];
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
}
|
||||
case 4:
|
||||
for (i=0; i<Cmux; i++)
|
||||
for (r=0; r<Rmux_prime; r++) {
|
||||
yptr = &y[((r*Cmux)+i)<<2];
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
for (i=0; i<Cmux; i++)
|
||||
for (r=0; r<Rmux_prime; r++) {
|
||||
yptr = &y[((r*Cmux)+i)*6];
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
}
|
||||
case 6:
|
||||
for (i=0; i<Cmux; i++)
|
||||
for (r=0; r<Rmux_prime; r++) {
|
||||
yptr = &y[((r*Cmux)+i)*6];
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
stop_meas(m_stats);
|
||||
|
||||
@@ -149,7 +149,7 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int first_symb,int num_symb) {
|
||||
//
|
||||
// Todo:
|
||||
// - averaging IIR filter for RX power and noise
|
||||
void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq_pid, unsigned char symbol){
|
||||
void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq_pid, unsigned char symbol, uint8_t nrOfLayers){
|
||||
|
||||
int rx_power_tot[NUMBER_OF_NR_ULSCH_MAX];
|
||||
int rx_power[NUMBER_OF_NR_ULSCH_MAX][NB_ANTENNAS_RX];
|
||||
@@ -169,9 +169,9 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq
|
||||
|
||||
rx_power[ulsch_id][aarx] = 0;
|
||||
|
||||
for (int aatx = 0; aatx < fp->nb_antennas_tx; aatx++){
|
||||
for (int aatx = 0; aatx < nrOfLayers; aatx++){
|
||||
|
||||
meas->rx_spatial_power[ulsch_id][aatx][aarx] = (signal_energy_nodc(&gNB->pusch_vars[ulsch_id]->ul_ch_estimates[aarx][ch_offset], N_RB_UL * NR_NB_SC_PER_RB));
|
||||
meas->rx_spatial_power[ulsch_id][aatx][aarx] = (signal_energy_nodc(&gNB->pusch_vars[ulsch_id]->ul_ch_estimates[aatx*fp->nb_antennas_rx+aarx][ch_offset], N_RB_UL * NR_NB_SC_PER_RB));
|
||||
|
||||
if (meas->rx_spatial_power[ulsch_id][aatx][aarx] < 0) {
|
||||
meas->rx_spatial_power[ulsch_id][aatx][aarx] = 0;
|
||||
|
||||
@@ -129,8 +129,10 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
//------------------generate DMRS------------------//
|
||||
|
||||
if (pusch_pdu->transform_precoding == transform_precoder_disabled) {
|
||||
nr_pusch_dmrs_rx(gNB, Ns, gNB->nr_gold_pusch_dmrs[pusch_pdu->scid][Ns][symbol], &pilot[0], 1000, 0, nb_rb_pusch, (pusch_pdu->bwp_start + pusch_pdu->rb_start)*NR_NB_SC_PER_RB, pusch_pdu->dmrs_config_type);
|
||||
// transform precoding = 1 means disabled
|
||||
if (pusch_pdu->transform_precoding == 1) {
|
||||
nr_pusch_dmrs_rx(gNB, Ns, gNB->nr_gold_pusch_dmrs[pusch_pdu->scid][Ns][symbol], &pilot[0], 1000, 0, nb_rb_pusch,
|
||||
(pusch_pdu->bwp_start + pusch_pdu->rb_start)*NR_NB_SC_PER_RB, pusch_pdu->dmrs_config_type);
|
||||
}
|
||||
else { // if transform precoding or SC-FDMA is enabled in Uplink
|
||||
|
||||
@@ -171,7 +173,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
pil = (int16_t *)&pilot[0];
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+nushift)];
|
||||
ul_ch = (int16_t *)&ul_ch_estimates[aarx][ch_offset];
|
||||
ul_ch = (int16_t *)&ul_ch_estimates[p*gNB->frame_parms.nb_antennas_rx+aarx][ch_offset];
|
||||
re_offset = k;
|
||||
|
||||
memset(ul_ch,0,4*(gNB->frame_parms.ofdm_symbol_size));
|
||||
@@ -370,7 +372,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
// check if PRB crosses DC and improve estimates around DC
|
||||
if ((bwp_start_subcarrier < gNB->frame_parms.ofdm_symbol_size) && (bwp_start_subcarrier+nb_rb_pusch*12 >= gNB->frame_parms.ofdm_symbol_size)) {
|
||||
ul_ch = (int16_t *)&ul_ch_estimates[aarx][ch_offset];
|
||||
ul_ch = (int16_t *)&ul_ch_estimates[p*gNB->frame_parms.nb_antennas_rx+aarx][ch_offset];
|
||||
uint16_t idxDC = 2*(gNB->frame_parms.ofdm_symbol_size - bwp_start_subcarrier);
|
||||
uint16_t idxPil = idxDC/2;
|
||||
re_offset = k;
|
||||
@@ -421,7 +423,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG_PUSCH
|
||||
ul_ch = (int16_t *)&ul_ch_estimates[aarx][ch_offset];
|
||||
ul_ch = (int16_t *)&ul_ch_estimates[p*gNB->frame_parms.nb_antennas_rx+aarx][ch_offset];
|
||||
for(uint16_t idxP=0; idxP<ceil((float)nb_rb_pusch*12/8); idxP++) {
|
||||
for(uint8_t idxI=0; idxI<16; idxI+=2) {
|
||||
printf("%d\t%d\t",ul_ch[idxP*16+idxI],ul_ch[idxP*16+idxI+1]);
|
||||
@@ -511,7 +513,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
ch_r,
|
||||
ul_ch);
|
||||
|
||||
ul_ch_128 = (__m128i *)&ul_ch_estimates[aarx][ch_offset];
|
||||
ul_ch_128 = (__m128i *)&ul_ch_estimates[p*gNB->frame_parms.nb_antennas_rx+aarx][ch_offset];
|
||||
|
||||
ul_ch_128[0] = _mm_slli_epi16 (ul_ch_128[0], 2);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB);
|
||||
|
||||
void gNB_I0_measurements(PHY_VARS_gNB *gNB,int first_symb,int num_symb);
|
||||
|
||||
void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq_pid, unsigned char symbol);
|
||||
void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq_pid, unsigned char symbol, uint8_t nrOfLayers);
|
||||
|
||||
int nr_est_timing_advance_pusch(PHY_VARS_gNB* phy_vars_gNB, int UE_id);
|
||||
|
||||
|
||||
@@ -278,8 +278,9 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
|
||||
printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n",
|
||||
start_sc, rel15->StartSymbolIndex, rel15->rbSize, nb_re,rel15->nrOfLayers);
|
||||
#endif
|
||||
|
||||
for (int ap=0; ap<rel15->nrOfLayers; ap++) {
|
||||
|
||||
|
||||
// DMRS params for this ap
|
||||
get_Wt(Wt, ap, dmrs_Type);
|
||||
get_Wf(Wf, ap, dmrs_Type);
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
extern short nr_qpsk_mod_table[8];
|
||||
|
||||
uint8_t nr_pbch_payload_interleaving_pattern[32] = {16, 23, 18, 17, 8, 30, 10, 6, 24, 7, 0, 5, 3, 2, 1, 4,
|
||||
const uint8_t nr_pbch_payload_interleaving_pattern[32] = {16, 23, 18, 17, 8, 30, 10, 6, 24, 7, 0, 5, 3, 2, 1, 4,
|
||||
9, 11, 12, 13, 14, 15, 19, 20, 21, 22, 25, 26, 27, 28, 29, 31
|
||||
};
|
||||
|
||||
@@ -141,7 +141,7 @@ int nr_generate_pbch_dmrs(uint32_t *gold_pbch_dmrs,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void nr_pbch_scrambling(NR_gNB_PBCH *pbch,
|
||||
static void nr_pbch_scrambling(NR_gNB_PBCH *pbch,
|
||||
uint32_t Nid,
|
||||
uint8_t nushift,
|
||||
uint16_t M,
|
||||
|
||||
@@ -78,19 +78,6 @@ int nr_generate_pbch_dmrs(uint32_t *gold_pbch_dmrs,
|
||||
nfapi_nr_config_request_scf_t *config,
|
||||
NR_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
/*!
|
||||
\fn int nr_pbch_scrambling
|
||||
\brief PBCH scrambling function
|
||||
@param
|
||||
*/
|
||||
void nr_pbch_scrambling(NR_gNB_PBCH *pbch,
|
||||
uint32_t Nid,
|
||||
uint8_t nushift,
|
||||
uint16_t M,
|
||||
uint16_t length,
|
||||
uint8_t encoded,
|
||||
uint32_t unscrambling_mask);
|
||||
|
||||
/*!
|
||||
\fn int nr_generate_pbch
|
||||
\brief Generation of the PBCH
|
||||
@@ -178,6 +165,7 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
|
||||
int32_t *avg,
|
||||
uint8_t symbol,
|
||||
uint32_t len,
|
||||
uint8_t nrOfLayers,
|
||||
unsigned short nb_rb);
|
||||
|
||||
/** \brief This function performs channel compensation (matched filtering) on the received RBs for this allocation. In addition, it computes the squared-magnitude of the channel with weightings for 16QAM/64QAM detection as well as dual-stream detection (cross-correlation)
|
||||
@@ -202,6 +190,7 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
unsigned char symbol,
|
||||
uint8_t is_dmrs_symbol,
|
||||
unsigned char mod_order,
|
||||
uint8_t nrOfLayers,
|
||||
unsigned short nb_rb,
|
||||
unsigned char output_shift);
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "PHY/NR_REFSIG/ptrs_nr.h"
|
||||
#include "PHY/NR_ESTIMATION/nr_ul_estimation.h"
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
|
||||
//#define DEBUG_CH_COMP
|
||||
//#define DEBUG_RB_EXT
|
||||
@@ -467,6 +468,7 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
|
||||
int32_t *avg,
|
||||
uint8_t symbol,
|
||||
uint32_t len,
|
||||
uint8_t nrOfLayers,
|
||||
unsigned short nb_rb)
|
||||
{
|
||||
|
||||
@@ -474,7 +476,6 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
|
||||
|
||||
short rb;
|
||||
unsigned char aatx, aarx;
|
||||
char nb_antennas_ue_tx = 1;
|
||||
__m128i *ul_ch128, avg128U;
|
||||
|
||||
int16_t x = factor2(len);
|
||||
@@ -486,12 +487,12 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
|
||||
int off = 0;
|
||||
#endif
|
||||
|
||||
for (aatx = 0; aatx < nb_antennas_ue_tx; aatx++)
|
||||
for (aatx = 0; aatx < nrOfLayers; aatx++)
|
||||
for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
|
||||
//clear average level
|
||||
avg128U = _mm_setzero_si128();
|
||||
|
||||
ul_ch128=(__m128i *)&ul_ch_estimates_ext[(aatx<<1)+aarx][symbol*(off+(nb_rb*12))];
|
||||
ul_ch128=(__m128i *)&ul_ch_estimates_ext[aatx*frame_parms->nb_antennas_rx+aarx][symbol*(off+(nb_rb*12))];
|
||||
|
||||
for (rb = 0; rb < len/12; rb++) {
|
||||
avg128U = _mm_add_epi32(avg128U, _mm_srai_epi32(_mm_madd_epi16(ul_ch128[0], ul_ch128[0]), x));
|
||||
@@ -500,10 +501,10 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
|
||||
ul_ch128+=3;
|
||||
}
|
||||
|
||||
avg[(aatx<<1)+aarx] = (((int32_t*)&avg128U)[0] +
|
||||
((int32_t*)&avg128U)[1] +
|
||||
((int32_t*)&avg128U)[2] +
|
||||
((int32_t*)&avg128U)[3] ) / y;
|
||||
avg[aatx*frame_parms->nb_antennas_rx+aarx] = (((int32_t*)&avg128U)[0] +
|
||||
((int32_t*)&avg128U)[1] +
|
||||
((int32_t*)&avg128U)[2] +
|
||||
((int32_t*)&avg128U)[3]) / y;
|
||||
|
||||
}
|
||||
|
||||
@@ -519,13 +520,13 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
|
||||
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
|
||||
for (aatx=0; aatx<frame_parms->nb_antenna_ports_gNB; aatx++) {
|
||||
for (aatx=0; aatx<nrOfLayers; aatx++) {
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
//clear average level
|
||||
avg128U = vdupq_n_s32(0);
|
||||
// 5 is always a symbol with no pilots for both normal and extended prefix
|
||||
|
||||
ul_ch128 = (int16x4_t *)&ul_ch_estimates_ext[(aatx<<1)+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
ul_ch128 = (int16x4_t *)&ul_ch_estimates_ext[aatx*frame_parms->nb_antennas_rx+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
|
||||
for (rb = 0; rb < nb_rb; rb++) {
|
||||
// printf("rb %d : ",rb);
|
||||
@@ -535,7 +536,7 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
|
||||
avg128U = vqaddq_s32(avg128U, vmull_s16(ul_ch128[2], ul_ch128[2]));
|
||||
avg128U = vqaddq_s32(avg128U, vmull_s16(ul_ch128[3], ul_ch128[3]));
|
||||
|
||||
if (((symbol_mod == 0) || (symbol_mod == (frame_parms->Ncp-1)))&&(frame_parms->nb_antenna_ports_gNB!=1)) {
|
||||
if (((symbol_mod == 0) || (symbol_mod == (frame_parms->Ncp-1)))&&(nrOfLayers!=1)) {
|
||||
ul_ch128+=4;
|
||||
} else {
|
||||
avg128U = vqaddq_s32(avg128U, vmull_s16(ul_ch128[4], ul_ch128[4]));
|
||||
@@ -557,10 +558,10 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
|
||||
else
|
||||
nre=12;
|
||||
|
||||
avg[(aatx<<1)+aarx] = (((int32_t*)&avg128U)[0] +
|
||||
((int32_t*)&avg128U)[1] +
|
||||
((int32_t*)&avg128U)[2] +
|
||||
((int32_t*)&avg128U)[3] ) / (nb_rb*nre);
|
||||
avg[aatx*frame_parms->nb_antennas_rx+aarx] = (((int32_t*)&avg128U)[0] +
|
||||
((int32_t*)&avg128U)[1] +
|
||||
((int32_t*)&avg128U)[2] +
|
||||
((int32_t*)&avg128U)[3]) / (nb_rb*nre);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -576,6 +577,7 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
unsigned char symbol,
|
||||
uint8_t is_dmrs_symbol,
|
||||
unsigned char mod_order,
|
||||
uint8_t nrOfLayers,
|
||||
unsigned short nb_rb,
|
||||
unsigned char output_shift) {
|
||||
|
||||
@@ -627,12 +629,11 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
|
||||
unsigned short rb;
|
||||
unsigned char aatx,aarx;
|
||||
char nb_antennas_ue_tx = 1;
|
||||
__m128i *ul_ch128,*ul_ch128_2,*ul_ch_mag128,*ul_ch_mag128b,*rxdataF128,*rxdataF_comp128,*rho128;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0},QAM_amp128b={0};
|
||||
QAM_amp128b = _mm_setzero_si128();
|
||||
|
||||
for (aatx=0; aatx<nb_antennas_ue_tx; aatx++) {
|
||||
for (aatx=0; aatx<nrOfLayers; aatx++) {
|
||||
|
||||
if (mod_order == 4) {
|
||||
QAM_amp128 = _mm_set1_epi16(QAM16_n1); // 2/sqrt(10)
|
||||
@@ -646,11 +647,11 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
|
||||
ul_ch128 = (__m128i *)&ul_ch_estimates_ext[(aatx<<1)+aarx][symbol*(off+(nb_rb*12))];
|
||||
ul_ch_mag128 = (__m128i *)&ul_ch_mag[(aatx<<1)+aarx][symbol*(off+(nb_rb*12))];
|
||||
ul_ch_mag128b = (__m128i *)&ul_ch_magb[(aatx<<1)+aarx][symbol*(off+(nb_rb*12))];
|
||||
ul_ch128 = (__m128i *)&ul_ch_estimates_ext[aatx*frame_parms->nb_antennas_rx+aarx][symbol*(off+(nb_rb*12))];
|
||||
ul_ch_mag128 = (__m128i *)&ul_ch_mag[aatx*frame_parms->nb_antennas_rx+aarx][symbol*(off+(nb_rb*12))];
|
||||
ul_ch_mag128b = (__m128i *)&ul_ch_magb[aatx*frame_parms->nb_antennas_rx+aarx][symbol*(off+(nb_rb*12))];
|
||||
rxdataF128 = (__m128i *)&rxdataF_ext[aarx][symbol*(off+(nb_rb*12))];
|
||||
rxdataF_comp128 = (__m128i *)&rxdataF_comp[(aatx<<1)+aarx][symbol*(off+(nb_rb*12))];
|
||||
rxdataF_comp128 = (__m128i *)&rxdataF_comp[aatx*frame_parms->nb_antennas_rx+aarx][symbol*(off+(nb_rb*12))];
|
||||
|
||||
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
@@ -884,7 +885,7 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
|
||||
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) {
|
||||
if (frame_parms->nb_antenna_ports_gNB==1) { // 10 out of 12 so don't reduce size
|
||||
if (nrOfLayers==1) { // 10 out of 12 so don't reduce size
|
||||
nb_rb=1+(5*nb_rb/6);
|
||||
}
|
||||
else {
|
||||
@@ -892,7 +893,7 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
}
|
||||
}
|
||||
|
||||
for (aatx=0; aatx<frame_parms->nb_antenna_ports_gNB; aatx++) {
|
||||
for (aatx=0; aatx<nrOfLayers; aatx++) {
|
||||
if (mod_order == 4) {
|
||||
QAM_amp128 = vmovq_n_s16(QAM16_n1); // 2/sqrt(10)
|
||||
QAM_amp128b = vmovq_n_s16(0);
|
||||
@@ -903,11 +904,11 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
// printf("comp: rxdataF_comp %p, symbol %d\n",rxdataF_comp[0],symbol);
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
ul_ch128 = (int16x4_t*)&ul_ch_estimates_ext[(aatx<<1)+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
ul_ch_mag128 = (int16x8_t*)&ul_ch_mag[(aatx<<1)+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
ul_ch_mag128b = (int16x8_t*)&ul_ch_magb[(aatx<<1)+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
ul_ch128 = (int16x4_t*)&ul_ch_estimates_ext[aatx*frame_parms->nb_antennas_rx+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
ul_ch_mag128 = (int16x8_t*)&ul_ch_mag[aatx*frame_parms->nb_antennas_rx+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
ul_ch_mag128b = (int16x8_t*)&ul_ch_magb[aatx*frame_parms->nb_antennas_rx+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
rxdataF128 = (int16x4_t*)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
rxdataF_comp128 = (int16x4x2_t*)&rxdataF_comp[(aatx<<1)+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
rxdataF_comp128 = (int16x4x2_t*)&rxdataF_comp[aatx*frame_parms->nb_antennas_rx+aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
if (mod_order>2) {
|
||||
@@ -1166,10 +1167,10 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
uint8_t aarx, aatx;
|
||||
uint32_t nb_re_pusch, bwp_start_subcarrier;
|
||||
int avgs;
|
||||
int avg[4];
|
||||
char nb_antennas_ue_tx = 1;
|
||||
|
||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||
nfapi_nr_pusch_pdu_t *rel15_ul = &gNB->ulsch[ulsch_id][0]->harq_processes[harq_pid]->ulsch_pdu;
|
||||
int avg[frame_parms->nb_antennas_rx*rel15_ul->nrOfLayers];
|
||||
|
||||
gNB->pusch_vars[ulsch_id]->dmrs_symbol = INVALID_VALUE;
|
||||
gNB->pusch_vars[ulsch_id]->cl_done = 0;
|
||||
@@ -1189,15 +1190,16 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
if (gNB->pusch_vars[ulsch_id]->dmrs_symbol == INVALID_VALUE)
|
||||
gNB->pusch_vars[ulsch_id]->dmrs_symbol = symbol;
|
||||
|
||||
nr_pusch_channel_estimation(gNB,
|
||||
slot,
|
||||
0, // p
|
||||
symbol,
|
||||
ulsch_id,
|
||||
bwp_start_subcarrier,
|
||||
rel15_ul);
|
||||
for (int nl=0; nl<rel15_ul->nrOfLayers; nl++)
|
||||
nr_pusch_channel_estimation(gNB,
|
||||
slot,
|
||||
get_dmrs_port(nl,rel15_ul->dmrs_ports),
|
||||
symbol,
|
||||
ulsch_id,
|
||||
bwp_start_subcarrier,
|
||||
rel15_ul);
|
||||
|
||||
nr_gnb_measurements(gNB, ulsch_id, harq_pid, symbol);
|
||||
nr_gnb_measurements(gNB, ulsch_id, harq_pid, symbol,rel15_ul->nrOfLayers);
|
||||
|
||||
for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
|
||||
if (symbol == rel15_ul->start_symbol_index) {
|
||||
@@ -1278,13 +1280,14 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
avg,
|
||||
symbol,
|
||||
nb_re_pusch,
|
||||
rel15_ul->nrOfLayers,
|
||||
rel15_ul->rb_size);
|
||||
|
||||
avgs = 0;
|
||||
|
||||
for (aatx=0;aatx<nb_antennas_ue_tx;aatx++)
|
||||
for (aatx=0;aatx<rel15_ul->nrOfLayers;aatx++)
|
||||
for (aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++)
|
||||
avgs = cmax(avgs,avg[(aatx<<1)+aarx]);
|
||||
avgs = cmax(avgs,avg[aatx*frame_parms->nb_antennas_rx+aarx]);
|
||||
|
||||
gNB->pusch_vars[ulsch_id]->log2_maxh = (log2_approx(avgs)/2)+3;
|
||||
gNB->pusch_vars[ulsch_id]->cl_done = 1;
|
||||
@@ -1299,11 +1302,12 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
gNB->pusch_vars[ulsch_id]->ul_ch_mag0,
|
||||
gNB->pusch_vars[ulsch_id]->ul_ch_magb0,
|
||||
gNB->pusch_vars[ulsch_id]->rxdataF_comp,
|
||||
(nb_antennas_ue_tx>1) ? gNB->pusch_vars[ulsch_id]->rho : NULL,
|
||||
(rel15_ul->nrOfLayers>1) ? gNB->pusch_vars[ulsch_id]->rho : NULL,
|
||||
frame_parms,
|
||||
symbol,
|
||||
dmrs_symbol_flag,
|
||||
rel15_ul->qam_mod_order,
|
||||
rel15_ul->nrOfLayers,
|
||||
rel15_ul->rb_size,
|
||||
gNB->pusch_vars[ulsch_id]->log2_maxh);
|
||||
stop_meas(&gNB->ulsch_channel_compensation_stats);
|
||||
@@ -1317,7 +1321,8 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
rel15_ul->rb_size);
|
||||
stop_meas(&gNB->ulsch_mrc_stats);
|
||||
|
||||
if (rel15_ul->transform_precoding == transform_precoder_enabled) {
|
||||
// transform precoding = 0 means enabled
|
||||
if (rel15_ul->transform_precoding == 0) {
|
||||
|
||||
#ifdef __AVX2__
|
||||
// For odd number of resource blocks need byte alignment to multiple of 8
|
||||
|
||||
@@ -49,6 +49,8 @@
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
|
||||
#include "T.h"
|
||||
|
||||
//#define DEBUG_NR_PUCCH_RX 1
|
||||
|
||||
@@ -963,7 +963,8 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
|
||||
currentPtrDCI);
|
||||
|
||||
n_rnti = rel15->rnti;
|
||||
LOG_D(PHY, "(%i.%i) dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d)\n", proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length);
|
||||
LOG_D(PHY, "(%i.%i) dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d)\n",
|
||||
proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length);
|
||||
if (crc == n_rnti) {
|
||||
LOG_D(PHY, "(%i.%i) Received dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d,payload %llx)\n",
|
||||
proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length,*(unsigned long long*)dci_estimation);
|
||||
@@ -978,6 +979,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
|
||||
dci_ind->slot = proc->nr_slot_rx;
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].rnti = n_rnti;
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].n_CCE = CCEind;
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].N_CCE = L;
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].dci_format = rel15->dci_format_options[k];
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].payloadSize = dci_length;
|
||||
memcpy((void*)dci_ind->dci_list[dci_ind->number_of_dcis].payloadBits,(void*)dci_estimation,8);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -811,7 +811,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
|
||||
unsigned short rb;
|
||||
unsigned char aatx,aarx,atx;
|
||||
__m128i *dl_ch128,*dl_ch128_2,*dl_ch_mag128,*dl_ch_mag128b,*dl_ch_mag128r,*rxdataF128,*rxdataF_comp128,*rho128;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b,QAM_amp128r;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0},QAM_amp128b={0},QAM_amp128r={0};
|
||||
|
||||
uint32_t nb_rb_0 = length/12 + ((length%12)?1:0);
|
||||
for (aatx=0; aatx<nb_aatx; aatx++) {
|
||||
@@ -1303,7 +1303,7 @@ void nr_dlsch_channel_compensation_core(int **rxdataF_ext,
|
||||
int length_mod8 = 0;
|
||||
int length2;
|
||||
__m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b, *dl_ch128_2, *rxdataF128,*rxdataF_comp128,*rho128;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0},QAM_amp128b={0};
|
||||
int aatx = 0, aarx = 0;
|
||||
|
||||
for (aatx=0; aatx<n_tx; aatx++) {
|
||||
@@ -2877,13 +2877,10 @@ uint8_t nr_zero_forcing_rx_2layers(int **rxdataF_comp,
|
||||
*
|
||||
*
|
||||
**************************************************************************/
|
||||
__m128i *rxdataF_comp128_0,*rxdataF_comp128_1,*determ_fin_128;//*dl_ch_mag128_1,*dl_ch_mag128b_1,*dl_ch_mag128r_1
|
||||
__m128i *dl_ch_mag128_0 = 0;
|
||||
__m128i *dl_ch_mag128b_0 = 0;
|
||||
__m128i *dl_ch_mag128r_0 = 0;
|
||||
__m128i *rxdataF_comp128_0,*rxdataF_comp128_1,*dl_ch_mag128_0=NULL,*dl_ch_mag128b_0=NULL,*dl_ch_mag128r_0=NULL,*determ_fin_128;//*dl_ch_mag128_1,*dl_ch_mag128b_1,*dl_ch_mag128r_1
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3;
|
||||
__m128i *after_mf_a_128,*after_mf_b_128, *after_mf_c_128, *after_mf_d_128;
|
||||
__m128i QAM_amp128,QAM_amp128b,QAM_amp128r;
|
||||
__m128i QAM_amp128={0},QAM_amp128b={0},QAM_amp128r={0};
|
||||
|
||||
determ_fin_128 = (__m128i *)&determ_fin[0];
|
||||
|
||||
|
||||
@@ -374,8 +374,6 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, int n_frames)
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
ue->is_synchronized_on_frame = is; // to notify on which of the two frames sync was successful
|
||||
|
||||
if (ue->UE_scan_carrier == 0) {
|
||||
|
||||
#if UE_AUTOTEST_TRACE
|
||||
|
||||
@@ -328,7 +328,7 @@ void nr_pbch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms,
|
||||
#endif
|
||||
}
|
||||
|
||||
void nr_pbch_unscrambling(NR_UE_PBCH *pbch,
|
||||
static void nr_pbch_unscrambling(NR_UE_PBCH *pbch,
|
||||
uint16_t Nid,
|
||||
uint8_t nushift,
|
||||
uint16_t M,
|
||||
@@ -549,7 +549,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
|
||||
nr_ue_pbch_vars->pbch_a_prime = a_reversed;
|
||||
//payload un-scrambling
|
||||
memset(&nr_ue_pbch_vars->pbch_a_interleaved, 0, sizeof(uint32_t) );
|
||||
nr_ue_pbch_vars->pbch_a_interleaved=0;
|
||||
M = (Lmax == 64)? (NR_POLAR_PBCH_PAYLOAD_BITS - 6) : (NR_POLAR_PBCH_PAYLOAD_BITS - 3);
|
||||
nushift = ((nr_ue_pbch_vars->pbch_a_prime>>24)&1) ^ (((nr_ue_pbch_vars->pbch_a_prime>>6)&1)<<1);
|
||||
nr_pbch_unscrambling(nr_ue_pbch_vars,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_PAYLOAD_BITS,1,unscrambling_mask);
|
||||
@@ -607,7 +607,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
uint16_t number_pdus = 1;
|
||||
|
||||
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
|
||||
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, number_pdus);
|
||||
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus);
|
||||
|
||||
if (ue->if_inst && ue->if_inst->dl_indication)
|
||||
ue->if_inst->dl_indication(&dl_indication, NULL);
|
||||
|
||||
@@ -1475,11 +1475,13 @@ void nr_get_carrier_frequencies(NR_DL_FRAME_PARMS *fp,
|
||||
@param dl_Carrier DL carrier to be set
|
||||
@param freq_offset Freq offset to be set
|
||||
*/
|
||||
void nr_rf_card_config(openair0_config_t *openair0_cfg,
|
||||
double rx_gain_off,
|
||||
uint64_t ul_Carrier,
|
||||
uint64_t dl_Carrier,
|
||||
int freq_offset);
|
||||
void nr_rf_card_config_gain(openair0_config_t *openair0_cfg,
|
||||
double rx_gain_off);
|
||||
|
||||
void nr_rf_card_config_freq(openair0_config_t *openair0_cfg,
|
||||
uint64_t ul_Carrier,
|
||||
uint64_t dl_Carrier,
|
||||
int freq_offset);
|
||||
|
||||
|
||||
void print_CQI(void *o,UCI_format_t uci_format,uint8_t eNB_id,int N_RB_DL);
|
||||
|
||||
@@ -56,34 +56,6 @@ typedef enum {
|
||||
RETRANSMISSION_HARQ
|
||||
} harq_result_t;
|
||||
|
||||
//#if defined(UPGRADE_RAT_NR)
|
||||
#if 1
|
||||
typedef struct {
|
||||
/// HARQ process id
|
||||
uint8_t harq_id;
|
||||
/// HARQ rx status
|
||||
harq_result_t rx_status;
|
||||
/// ACK bits (after decoding) 0:NACK / 1:ACK / 2:DTX
|
||||
uint8_t ack;
|
||||
/// send status (for PUCCH)
|
||||
uint8_t send_harq_status;
|
||||
/// nCCE (for PUCCH)
|
||||
uint8_t nCCE;
|
||||
/// DAI value detected from DCI1/1a/1b/1d/2/2a/2b/2c. 0xff indicates not touched
|
||||
uint8_t vDAI_DL;
|
||||
/// DAI value detected from DCI0/4. 0xff indicates not touched
|
||||
uint8_t vDAI_UL;
|
||||
/// allow to define pucch parameters TS 38.213 9.2.3 UE procedure for reporting HARQ-ACK
|
||||
uint8_t pucch_resource_indicator;
|
||||
/// slot on which feedback ack should be send to network
|
||||
uint16_t slot_for_feedback_ack;
|
||||
/// index of a first CCE for the PDCCH reception
|
||||
uint8_t n_CCE;
|
||||
/// number of CCEs in a control resource set of a PDCCH reception conveying DCI format 1_0
|
||||
uint8_t N_CCE;
|
||||
} NR_UE_HARQ_STATUS_t;
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
/// NDAPI struct for UE
|
||||
nfapi_nr_ue_pusch_pdu_t pusch_pdu;
|
||||
@@ -319,7 +291,7 @@ typedef struct {
|
||||
/// codeword this transport block is mapped to
|
||||
uint8_t codeword;
|
||||
/// HARQ-ACKs
|
||||
NR_UE_HARQ_STATUS_t harq_ack;
|
||||
uint8_t ack;
|
||||
/// PTRS Frequency Density
|
||||
uint8_t PTRSFreqDensity;
|
||||
/// PTRS Time Density
|
||||
|
||||
@@ -48,11 +48,9 @@ void nr_get_carrier_frequencies(NR_DL_FRAME_PARMS *fp, uint64_t *dl_carrier, uin
|
||||
|
||||
}
|
||||
|
||||
void nr_rf_card_config(openair0_config_t *openair0_cfg,
|
||||
double rx_gain_offset,
|
||||
uint64_t ul_carrier,
|
||||
uint64_t dl_carrier,
|
||||
int freq_offset){
|
||||
|
||||
void nr_rf_card_config_gain(openair0_config_t *openair0_cfg,
|
||||
double rx_gain_off){
|
||||
|
||||
uint8_t mod_id = 0;
|
||||
uint8_t cc_id = 0;
|
||||
@@ -61,6 +59,36 @@ void nr_rf_card_config(openair0_config_t *openair0_cfg,
|
||||
double rx_gain = ue->rx_total_gain_dB;
|
||||
double tx_gain = ue->tx_total_gain_dB;
|
||||
|
||||
for (int i = rf_chain; i < rf_chain + 4; i++) {
|
||||
|
||||
if (tx_gain)
|
||||
openair0_cfg->tx_gain[i] = tx_gain;
|
||||
if (rx_gain)
|
||||
openair0_cfg->rx_gain[i] = rx_gain - rx_gain_off;
|
||||
|
||||
openair0_cfg->autocal[i] = 1;
|
||||
|
||||
if (i < openair0_cfg->rx_num_channels) {
|
||||
LOG_I(PHY, "HW: Configuring channel %d (rf_chain %d): setting tx_gain %f, rx_gain %f\n",
|
||||
i,
|
||||
rf_chain,
|
||||
openair0_cfg->tx_gain[i],
|
||||
openair0_cfg->rx_gain[i]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void nr_rf_card_config_freq(openair0_config_t *openair0_cfg,
|
||||
uint64_t ul_carrier,
|
||||
uint64_t dl_carrier,
|
||||
int freq_offset){
|
||||
|
||||
uint8_t mod_id = 0;
|
||||
uint8_t cc_id = 0;
|
||||
PHY_VARS_NR_UE *ue = PHY_vars_UE_g[mod_id][cc_id];
|
||||
int rf_chain = ue->rf_map.chain;
|
||||
|
||||
for (int i = rf_chain; i < rf_chain + 4; i++) {
|
||||
|
||||
if (i < openair0_cfg->rx_num_channels)
|
||||
@@ -73,22 +101,15 @@ void nr_rf_card_config(openair0_config_t *openair0_cfg,
|
||||
else
|
||||
openair0_cfg->tx_freq[i] = 0.0;
|
||||
|
||||
if (tx_gain)
|
||||
openair0_cfg->tx_gain[i] = tx_gain;
|
||||
if (rx_gain)
|
||||
openair0_cfg->rx_gain[i] = rx_gain - rx_gain_offset;
|
||||
|
||||
openair0_cfg->autocal[i] = 1;
|
||||
|
||||
if (i < openair0_cfg->rx_num_channels) {
|
||||
LOG_I(PHY, "HW: Configuring channel %d (rf_chain %d): setting tx_gain %f, rx_gain %f, tx_freq %f Hz, rx_freq %f Hz\n",
|
||||
LOG_I(PHY, "HW: Configuring channel %d (rf_chain %d): setting tx_freq %f Hz, rx_freq %f Hz\n",
|
||||
i,
|
||||
rf_chain,
|
||||
openair0_cfg->tx_gain[i],
|
||||
openair0_cfg->rx_gain[i],
|
||||
openair0_cfg->tx_freq[i],
|
||||
openair0_cfg->rx_freq[i]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,14 +252,15 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
uint8_t u = 0, v = 0;
|
||||
int16_t *dmrs_seq = NULL;
|
||||
|
||||
if (pusch_pdu->transform_precoding == transform_precoder_enabled) {
|
||||
// if transform precoding is enbaled (value 0)
|
||||
if (pusch_pdu->transform_precoding == 0) {
|
||||
|
||||
uint32_t nb_re_pusch=nb_rb * NR_NB_SC_PER_RB;
|
||||
uint32_t y_offset = 0;
|
||||
uint16_t num_dmrs_res_per_symbol = nb_rb*(NR_NB_SC_PER_RB/2);
|
||||
|
||||
// Calculate index to dmrs seq array based on number of DMRS Subcarriers on this symbol
|
||||
index = get_index_for_dmrs_lowpapr_seq(num_dmrs_res_per_symbol);
|
||||
index = get_index_for_dmrs_lowpapr_seq(num_dmrs_res_per_symbol);
|
||||
u = pusch_pdu->dfts_ofdm.low_papr_group_number;
|
||||
v = pusch_pdu->dfts_ofdm.low_papr_sequence_number;
|
||||
dmrs_seq = dmrs_lowpaprtype1_ul_ref_sig[u][v][index];
|
||||
@@ -297,7 +298,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
}
|
||||
|
||||
printf("NR_ULSCH_UE: numSym: %d, num_dmrs_sym: %d", number_of_symbols,number_dmrs_symbols);
|
||||
for (int ll = 0; ll < (number_of_symbols-number_dmrs_symbols); ll++) {
|
||||
for (int ll = 0; ll < (number_of_symbols-number_dmrs_symbols); ll++) {
|
||||
|
||||
nr_idft(&debug_symbols[offset], nb_re_pusch);
|
||||
|
||||
@@ -353,8 +354,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
if ((ul_dmrs_symb_pos >> l) & 0x01) {
|
||||
is_dmrs_sym = 1;
|
||||
|
||||
|
||||
if (pusch_pdu->transform_precoding == transform_precoder_disabled){
|
||||
// transform precoding disabled (value 1)
|
||||
if (pusch_pdu->transform_precoding == 1){
|
||||
|
||||
if (dmrs_type == pusch_dmrs_type1)
|
||||
dmrs_idx = (pusch_pdu->bwp_start + start_rb)*6;
|
||||
@@ -371,9 +372,9 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
}
|
||||
|
||||
|
||||
} else if (pusch_pdu->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
|
||||
} else if (pusch_pdu->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
|
||||
|
||||
AssertFatal(pusch_pdu->transform_precoding == transform_precoder_disabled, "PTRS NOT SUPPORTED IF TRANSFORM PRECODING IS ENABLED\n");
|
||||
AssertFatal(pusch_pdu->transform_precoding == 1, "PTRS NOT SUPPORTED IF TRANSFORM PRECODING IS ENABLED\n");
|
||||
|
||||
if(is_ptrs_symbol(l, ulsch_ue->ptrs_symbols)) {
|
||||
is_ptrs_sym = 1;
|
||||
@@ -404,8 +405,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
}
|
||||
|
||||
if (is_dmrs == 1) {
|
||||
|
||||
if (pusch_pdu->transform_precoding == transform_precoder_enabled) {
|
||||
// if transform precoding is enabled
|
||||
if (pusch_pdu->transform_precoding == 0) {
|
||||
|
||||
((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*dmrs_seq[2*dmrs_idx]) >> 15;
|
||||
((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*dmrs_seq[(2*dmrs_idx) + 1]) >> 15;
|
||||
|
||||
@@ -54,16 +54,10 @@
|
||||
void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
long pucch_GroupHopping,
|
||||
long hoppingId,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t m0,
|
||||
uint8_t mcs,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint16_t startingPRB,
|
||||
uint16_t secondHopPRB) {
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu) {
|
||||
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch0] start function at slot(nr_slot_tx)=%d\n",nr_slot_tx);
|
||||
#endif
|
||||
@@ -97,21 +91,31 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
|
||||
// the value of u,v (delta always 0 for PUCCH) has to be calculated according to TS 38.211 Subclause 6.3.2.2.1
|
||||
uint8_t u[2]={0,0},v[2]={0,0};
|
||||
|
||||
LOG_D(PHY,"pucch0: nr_symbols %d, start_symbol %d, prb_start %d, second_hop_prb %d, group_hop_flag %d, sequence_hop_flag %d, mcs %d\n",pucch_pdu->nr_of_symbols,pucch_pdu->start_symbol_index,pucch_pdu->prb_start,pucch_pdu->second_hop_prb,pucch_pdu->group_hop_flag,pucch_pdu->sequence_hop_flag,pucch_pdu->mcs);
|
||||
|
||||
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch0] sequence generation: variable initialization for test\n");
|
||||
#endif
|
||||
// x_n contains the sequence r_u_v_alpha_delta(n)
|
||||
int16_t x_n_re[2][24],x_n_im[2][24];
|
||||
|
||||
uint16_t startingPRB = pucch_pdu->prb_start + pucch_pdu->bwp_start;
|
||||
pucch_GroupHopping_t pucch_GroupHopping = pucch_pdu->group_hop_flag + (pucch_pdu->sequence_hop_flag<<1);
|
||||
|
||||
// we proceed to calculate alpha according to TS 38.211 Subclause 6.3.2.2.2
|
||||
int prb_offset[2]={startingPRB,startingPRB};
|
||||
nr_group_sequence_hopping(pucch_GroupHopping,hoppingId,0,nr_slot_tx,&u[0],&v[0]); // calculating u and v value
|
||||
if (startingPRB!=secondHopPRB) {
|
||||
nr_group_sequence_hopping(pucch_GroupHopping,hoppingId,1,nr_slot_tx,&u[1],&v[1]); // calculating u and v value
|
||||
prb_offset[1] = secondHopPRB;
|
||||
nr_group_sequence_hopping(pucch_GroupHopping,pucch_pdu->hopping_id,0,nr_slot_tx,&u[0],&v[0]); // calculating u and v value
|
||||
if (pucch_pdu->freq_hop_flag == 1) {
|
||||
nr_group_sequence_hopping(pucch_GroupHopping,pucch_pdu->hopping_id,1,nr_slot_tx,&u[1],&v[1]); // calculating u and v value
|
||||
prb_offset[1] = pucch_pdu->second_hop_prb;
|
||||
}
|
||||
for (int l=0; l<nrofSymbols; l++) {
|
||||
alpha = nr_cyclic_shift_hopping(hoppingId,m0,mcs,l,startingSymbolIndex,nr_slot_tx);
|
||||
for (int l=0; l<pucch_pdu->nr_of_symbols; l++) {
|
||||
alpha = nr_cyclic_shift_hopping(pucch_pdu->hopping_id,
|
||||
pucch_pdu->initial_cyclic_shift,
|
||||
pucch_pdu->mcs,l,
|
||||
pucch_pdu->start_symbol_index,
|
||||
nr_slot_tx);
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch0] sequence generation \tu=%d \tv=%d \talpha=%lf \t(for symbol l=%d)\n",u[l],v[l],alpha,l);
|
||||
#endif
|
||||
@@ -135,8 +139,8 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
|
||||
uint32_t re_offset=0;
|
||||
uint8_t l2;
|
||||
|
||||
for (int l=0; l<nrofSymbols; l++) {
|
||||
l2=l+startingSymbolIndex;
|
||||
for (int l=0; l<pucch_pdu->nr_of_symbols; l++) {
|
||||
l2=l+pucch_pdu->start_symbol_index;
|
||||
re_offset = (12*prb_offset[l]) + frame_parms->first_carrier_offset;
|
||||
if (re_offset>= frame_parms->ofdm_symbol_size)
|
||||
re_offset-=frame_parms->ofdm_symbol_size;
|
||||
@@ -168,20 +172,20 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
|
||||
void nr_generate_pucch1(PHY_VARS_NR_UE *ue,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
uint64_t payload,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t m0,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint16_t startingPRB,
|
||||
uint16_t startingPRB_intraSlotHopping,
|
||||
uint8_t timeDomainOCC,
|
||||
uint8_t nr_bit) {
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu) {
|
||||
|
||||
uint16_t m0 = pucch_pdu->initial_cyclic_shift;
|
||||
uint64_t payload = pucch_pdu->payload;
|
||||
uint8_t startingSymbolIndex = pucch_pdu->start_symbol_index;
|
||||
uint8_t nrofSymbols = pucch_pdu->nr_of_symbols;
|
||||
uint16_t startingPRB = pucch_pdu->prb_start + pucch_pdu->bwp_start;
|
||||
uint8_t timeDomainOCC = pucch_pdu->time_domain_occ_idx;
|
||||
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch1] start function at slot(nr_slot_tx)=%d payload=%lu m0=%d nrofSymbols=%d startingSymbolIndex=%d startingPRB=%d startingPRB_intraSlotHopping=%d timeDomainOCC=%d nr_bit=%d\n",
|
||||
nr_slot_tx,payload,m0,nrofSymbols,startingSymbolIndex,startingPRB,startingPRB_intraSlotHopping,timeDomainOCC,nr_bit);
|
||||
printf("\t [nr_generate_pucch1] start function at slot(nr_slot_tx)=%d payload=%lu m0=%d nrofSymbols=%d startingSymbolIndex=%d startingPRB=%d second_hop_prb=%d timeDomainOCC=%d nr_bit=%d\n",
|
||||
nr_slot_tx,payload,m0,nrofSymbols,startingSymbolIndex,startingPRB,pucch_pdu->second_hop_prb,timeDomainOCC,pucch_pdu->n_bit);
|
||||
#endif
|
||||
/*
|
||||
* Implement TS 38.211 Subclause 6.3.2.4.1 Sequence modulation
|
||||
@@ -190,12 +194,12 @@ void nr_generate_pucch1(PHY_VARS_NR_UE *ue,
|
||||
// complex-valued symbol d_re, d_im containing complex-valued symbol d(0):
|
||||
int16_t d_re=0, d_im=0;
|
||||
|
||||
if (nr_bit == 1) { // using BPSK if M_bit=1 according to TC 38.211 Subclause 5.1.2
|
||||
if (pucch_pdu->n_bit == 1) { // using BPSK if M_bit=1 according to TC 38.211 Subclause 5.1.2
|
||||
d_re = (payload&1)==0 ? (int16_t)(((int32_t)amp*ONE_OVER_SQRT2)>>15) : -(int16_t)(((int32_t)amp*ONE_OVER_SQRT2)>>15);
|
||||
d_im = (payload&1)==0 ? (int16_t)(((int32_t)amp*ONE_OVER_SQRT2)>>15) : -(int16_t)(((int32_t)amp*ONE_OVER_SQRT2)>>15);
|
||||
}
|
||||
|
||||
if (nr_bit == 2) { // using QPSK if M_bit=2 according to TC 38.211 Subclause 5.1.2
|
||||
if (pucch_pdu->n_bit == 2) { // using QPSK if M_bit=2 according to TC 38.211 Subclause 5.1.2
|
||||
if (((payload&1)==0) && (((payload>>1)&1)==0)) {
|
||||
d_re = (int16_t)(((int32_t)amp*ONE_OVER_SQRT2)>>15); // 32767/sqrt(2) = 23170 (ONE_OVER_SQRT2)
|
||||
d_im = (int16_t)(((int32_t)amp*ONE_OVER_SQRT2)>>15);
|
||||
@@ -256,7 +260,7 @@ void nr_generate_pucch1(PHY_VARS_NR_UE *ue,
|
||||
//uint8_t PUCCH_Frequency_Hopping = 0 ; // from higher layers
|
||||
uint8_t intraSlotFrequencyHopping = 0;
|
||||
|
||||
if (startingPRB != startingPRB_intraSlotHopping) {
|
||||
if (pucch_pdu->freq_hop_flag) {
|
||||
intraSlotFrequencyHopping=1;
|
||||
}
|
||||
|
||||
@@ -287,8 +291,9 @@ void nr_generate_pucch1(PHY_VARS_NR_UE *ue,
|
||||
printf("\t [nr_generate_pucch1] entering function nr_group_sequence_hopping with n_hop=%d, nr_slot_tx=%d\n",
|
||||
n_hop,nr_slot_tx);
|
||||
#endif
|
||||
nr_group_sequence_hopping(ue->pucch_config_common_nr->pucch_GroupHopping,ue->pucch_config_common_nr->hoppingId,n_hop,nr_slot_tx,&u,&v); // calculating u and v value
|
||||
alpha = nr_cyclic_shift_hopping(ue->pucch_config_common_nr->hoppingId,m0,mcs,l,lprime,nr_slot_tx);
|
||||
pucch_GroupHopping_t pucch_GroupHopping = pucch_pdu->group_hop_flag + (pucch_pdu->sequence_hop_flag<<1);
|
||||
nr_group_sequence_hopping(pucch_GroupHopping,pucch_pdu->hopping_id,n_hop,nr_slot_tx,&u,&v); // calculating u and v value
|
||||
alpha = nr_cyclic_shift_hopping(pucch_pdu->hopping_id,m0,mcs,l,lprime,nr_slot_tx);
|
||||
|
||||
for (int n=0; n<12; n++) {
|
||||
r_u_v_alpha_delta_re[n] = (int16_t)(((((int32_t)(round(32767*cos(alpha*n))) * table_5_2_2_2_2_Re[u][n])>>15)
|
||||
@@ -441,7 +446,7 @@ void nr_generate_pucch1(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
|
||||
if ((intraSlotFrequencyHopping == 1) && (l<floor(nrofSymbols/2))) { // intra-slot hopping enabled, we need to calculate new offset PRB
|
||||
startingPRB = startingPRB + startingPRB_intraSlotHopping;
|
||||
startingPRB = startingPRB + pucch_pdu->second_hop_prb;
|
||||
}
|
||||
|
||||
if ((startingPRB < (frame_parms->N_RB_DL>>1)) && ((frame_parms->N_RB_DL & 1) == 0)) { // if number RBs in bandwidth is even and current PRB is lower band
|
||||
@@ -834,7 +839,7 @@ inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,
|
||||
c = (uint8_t)((s>>i)&1);
|
||||
btildep[i] = (((B>>i)&1) ^ c);
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t\t\t btilde[%d]=%lx from unscrambled bit %d and scrambling %d (%x)\n",i+(iprime<<5),btilde[i],((B>>i)&1),c,s>>i);
|
||||
printf("\t\t\t btilde[%d]=%x from unscrambled bit %d and scrambling %d (%x)\n",i+(iprime<<5),btilde[i],((B>>i)&1),c,s>>i);
|
||||
#endif
|
||||
}
|
||||
M_bit3-=32;
|
||||
@@ -848,7 +853,7 @@ inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,
|
||||
}
|
||||
void nr_uci_encoding(uint64_t payload,
|
||||
uint8_t nr_bit,
|
||||
pucch_format_nr_t fmt,
|
||||
int fmt,
|
||||
uint8_t is_pi_over_2_bpsk_enabled,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t nrofPRB,
|
||||
@@ -868,9 +873,9 @@ void nr_uci_encoding(uint64_t payload,
|
||||
// E is the rate matching output sequence length as given in TS 38.212 subclause 6.3.1.4.1
|
||||
uint16_t E=0,E_init;
|
||||
|
||||
if (fmt == pucch_format2_nr) E = 16*nrofSymbols*nrofPRB;
|
||||
if (fmt == 2) E = 16*nrofSymbols*nrofPRB;
|
||||
|
||||
if (fmt == pucch_format3_nr) {
|
||||
if (fmt == 3) {
|
||||
E_init = (is_pi_over_2_bpsk_enabled == 0) ? 24:12;
|
||||
|
||||
if (nrofSymbols == 4) {
|
||||
@@ -895,7 +900,7 @@ void nr_uci_encoding(uint64_t payload,
|
||||
}
|
||||
}
|
||||
|
||||
if (fmt == pucch_format4_nr) {
|
||||
if (fmt == 4) {
|
||||
E_init = (is_pi_over_2_bpsk_enabled == 0) ? 24:12;
|
||||
|
||||
if (nrofSymbols == 4) {
|
||||
@@ -953,28 +958,24 @@ void nr_uci_encoding(uint64_t payload,
|
||||
}
|
||||
//#if 0
|
||||
void nr_generate_pucch2(PHY_VARS_NR_UE *ue,
|
||||
uint16_t crnti,
|
||||
uint32_t dmrs_scrambling_id,
|
||||
uint32_t data_scrambling_id,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
uint64_t payload,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint8_t nrofPRB,
|
||||
uint16_t startingPRB,
|
||||
uint8_t nr_bit) {
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu) {
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch2] start function at slot(nr_slot_tx)=%d with payload=%lu and nr_bit=%d\n",nr_slot_tx, payload, nr_bit);
|
||||
printf("\t [nr_generate_pucch2] start function at slot(nr_slot_tx)=%d with payload=%lu and nr_bit=%d\n",nr_slot_tx, pucch_pdu->payload, pucch_pdu->n_bit);
|
||||
#endif
|
||||
// b is the block of bits transmitted on the physical channel after payload coding
|
||||
uint64_t b[16]; // limit to 1024-bit encoded length
|
||||
// M_bit is the number of bits of block b (payload after encoding)
|
||||
uint16_t M_bit;
|
||||
nr_uci_encoding(payload,nr_bit,pucch_format2_nr,0,nrofSymbols,nrofPRB,1,0,0,&b[0],&M_bit);
|
||||
nr_uci_encoding(pucch_pdu->payload,
|
||||
pucch_pdu->n_bit,
|
||||
2,0,
|
||||
pucch_pdu->nr_of_symbols,
|
||||
pucch_pdu->prb_size,
|
||||
1,0,0,&b[0],&M_bit);
|
||||
/*
|
||||
* Implementing TS 38.211
|
||||
* Subclauses 6.3.2.5.1 Scrambling (PUCCH format 2)
|
||||
@@ -989,14 +990,14 @@ void nr_generate_pucch2(PHY_VARS_NR_UE *ue,
|
||||
*/
|
||||
uint8_t *btilde = malloc(sizeof(int8_t)*M_bit);
|
||||
// rnti is given by the C-RNTI
|
||||
uint16_t rnti=crnti;
|
||||
uint16_t rnti=pucch_pdu->rnti;
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch2] rnti = %d ,\n",rnti);
|
||||
#endif
|
||||
/*
|
||||
* Implementing TS 38.211 Subclause 6.3.2.5.1 scrambling format 2
|
||||
*/
|
||||
nr_pucch2_3_4_scrambling(M_bit,rnti,data_scrambling_id,&b[0],btilde);
|
||||
nr_pucch2_3_4_scrambling(M_bit,rnti,pucch_pdu->data_scrambling_id,&b[0],btilde);
|
||||
/*
|
||||
* Implementing TS 38.211 Subclause 6.3.2.5.2 modulation format 2
|
||||
* btilde shall be modulated as described in subclause 5.1 using QPSK
|
||||
@@ -1042,9 +1043,12 @@ void nr_generate_pucch2(PHY_VARS_NR_UE *ue,
|
||||
uint32_t x1, x2, s=0;
|
||||
int i=0;
|
||||
int m=0;
|
||||
uint8_t startingSymbolIndex = pucch_pdu->start_symbol_index;
|
||||
uint16_t startingPRB = pucch_pdu->prb_start + pucch_pdu->bwp_start;
|
||||
|
||||
for (int l=0; l<nrofSymbols; l++) {
|
||||
x2 = (((1<<17)*((14*nr_slot_tx) + (l+startingSymbolIndex) + 1)*((2*dmrs_scrambling_id) + 1)) + (2*dmrs_scrambling_id))%(1U<<31); // c_init calculation according to TS38.211 subclause
|
||||
for (int l=0; l<pucch_pdu->nr_of_symbols; l++) {
|
||||
// c_init calculation according to TS38.211 subclause
|
||||
x2 = (((1<<17)*((14*nr_slot_tx) + (l+startingSymbolIndex) + 1)*((2*pucch_pdu->dmrs_scrambling_id) + 1)) + (2*pucch_pdu->dmrs_scrambling_id))%(1U<<31);
|
||||
|
||||
int reset = 1;
|
||||
for (int ii=0; ii<=(startingPRB>>2); ii++) {
|
||||
@@ -1052,7 +1056,7 @@ void nr_generate_pucch2(PHY_VARS_NR_UE *ue,
|
||||
reset = 0;
|
||||
}
|
||||
m = 0;
|
||||
for (int rb=0; rb<nrofPRB; rb++) {
|
||||
for (int rb=0; rb<pucch_pdu->prb_size; rb++) {
|
||||
//startingPRB = startingPRB + rb;
|
||||
if (((rb+startingPRB) < (frame_parms->N_RB_DL>>1)) && ((frame_parms->N_RB_DL & 1) == 0)) { // if number RBs in bandwidth is even and current PRB is lower band
|
||||
re_offset = ((l+startingSymbolIndex)*frame_parms->ofdm_symbol_size) + (12*(rb+startingPRB)) + frame_parms->first_carrier_offset;
|
||||
@@ -1124,52 +1128,53 @@ void nr_generate_pucch2(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
//#if 0
|
||||
void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
uint16_t crnti,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
pucch_format_nr_t fmt,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
uint64_t payload,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint8_t nrofPRB,
|
||||
uint16_t startingPRB,
|
||||
uint16_t startingPRB_intraSlotHopping,
|
||||
uint8_t nr_bit,
|
||||
uint8_t occ_length_format4,
|
||||
uint8_t occ_index_format4) {
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu) {
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch3_4] start function at slot(nr_slot_tx)=%d with payload=%lu and nr_bit=%d\n", nr_slot_tx, payload, nr_bit);
|
||||
printf("\t [nr_generate_pucch3_4] start function at slot(nr_slot_tx)=%d with payload=%lu and nr_bit=%d\n", nr_slot_tx, pucch_pdu->payload, pucch_pdu->n_bit);
|
||||
#endif
|
||||
// b is the block of bits transmitted on the physical channel after payload coding
|
||||
uint64_t b[16];
|
||||
// M_bit is the number of bits of block b (payload after encoding)
|
||||
uint16_t M_bit;
|
||||
// parameter PUCCH-F4-preDFT-OCC-length set of {2,4} -> to use table -1 or -2
|
||||
uint8_t n_SF_PUCCH_s = 2; // in format 4, n_SF_PUCCH_s = {2,4}, provided by higher layer parameter PUCCH-F4-preDFT-OCC-length (in format 3 n_SF_PUCCH_s=1), FIXME!!!
|
||||
uint8_t is_pi_over_2_bpsk_enabled = 0; // this value has to be provided by higher layers parameter
|
||||
// in format 4, n_SF_PUCCH_s = {2,4}, provided by higher layer parameter PUCCH-F4-preDFT-OCC-length (in format 3 n_SF_PUCCH_s=1)
|
||||
uint8_t n_SF_PUCCH_s;
|
||||
if (pucch_pdu->format_type == 3)
|
||||
n_SF_PUCCH_s = 1;
|
||||
else
|
||||
n_SF_PUCCH_s = pucch_pdu->pre_dft_occ_len;
|
||||
uint8_t is_pi_over_2_bpsk_enabled = pucch_pdu->pi_2bpsk;
|
||||
// Intra-slot frequency hopping shall be assumed when the higher-layer parameter intraSlotFrequencyHopping is provided,
|
||||
// regardless of whether the frequency-hop distance is zero or not,
|
||||
// otherwise no intra-slot frequency hopping shall be assumed
|
||||
//uint8_t PUCCH_Frequency_Hopping = 0 ; // from higher layers
|
||||
uint8_t intraSlotFrequencyHopping = 0;
|
||||
|
||||
if (startingPRB != startingPRB_intraSlotHopping) {
|
||||
if (pucch_pdu->freq_hop_flag) {
|
||||
intraSlotFrequencyHopping=1;
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch3_4] intraSlotFrequencyHopping=%d \n",intraSlotFrequencyHopping);
|
||||
#endif
|
||||
}
|
||||
|
||||
// add_dmrs indicates if we are using or not Additional DM-RS for formats 3 and 4. From higher layers. FIXME!!!
|
||||
uint8_t add_dmrs = 0;
|
||||
uint8_t nrofSymbols = pucch_pdu->nr_of_symbols;
|
||||
uint16_t nrofPRB = pucch_pdu->prb_size;
|
||||
uint16_t startingPRB = pucch_pdu->prb_start + pucch_pdu->bwp_start;
|
||||
uint8_t add_dmrs = pucch_pdu->add_dmrs_flag;
|
||||
|
||||
//nrofPRB = 2; // only for test purposes
|
||||
if (fmt == pucch_format4_nr) nrofPRB = 1;
|
||||
|
||||
nr_uci_encoding(payload,nr_bit,fmt,is_pi_over_2_bpsk_enabled,nrofSymbols,nrofPRB,n_SF_PUCCH_s,intraSlotFrequencyHopping,add_dmrs,&b[0],&M_bit);
|
||||
nr_uci_encoding(pucch_pdu->payload,
|
||||
pucch_pdu->n_bit,
|
||||
pucch_pdu->format_type,
|
||||
is_pi_over_2_bpsk_enabled,
|
||||
nrofSymbols,nrofPRB,
|
||||
n_SF_PUCCH_s,
|
||||
intraSlotFrequencyHopping,
|
||||
add_dmrs,
|
||||
&b[0],&M_bit);
|
||||
/*
|
||||
* Implementing TS 38.211
|
||||
* Subclauses 6.3.2.6.1 Scrambling (PUCCH formats 3 and 4)
|
||||
@@ -1184,7 +1189,7 @@ void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
*/
|
||||
uint8_t *btilde = malloc(sizeof(int8_t)*M_bit);
|
||||
// rnti is given by the C-RNTI
|
||||
uint16_t rnti=crnti, n_id=0;
|
||||
uint16_t rnti=pucch_pdu->rnti, n_id=0;
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch3_4] rnti = %d ,\n",rnti);
|
||||
#endif
|
||||
@@ -1300,12 +1305,11 @@ void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
||||
{0, 0, 0, 1, 1, 1, 0, 0, 0,-1,-1,-1}
|
||||
};
|
||||
//uint8_t occ_Length = occ_length_format4; // higher layer parameter occ-Length
|
||||
uint8_t occ_Index = occ_index_format4; // higher layer parameter occ-Index
|
||||
|
||||
uint8_t occ_Index = pucch_pdu->pre_dft_occ_idx; // higher layer parameter occ-Index
|
||||
|
||||
//occ_Index = 1; //only for testing purposes; to be removed FIXME!!!
|
||||
if (fmt == pucch_format3_nr) { // no block-wise spreading for format 3
|
||||
n_SF_PUCCH_s = 1;
|
||||
if (pucch_pdu->format_type == 3) { // no block-wise spreading for format 3
|
||||
|
||||
for (int l=0; l < floor(m_symbol/(12*nrofPRB)); l++) {
|
||||
for (int k=0; k < (12*nrofPRB); k++) {
|
||||
@@ -1319,7 +1323,7 @@ void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
}
|
||||
|
||||
if (fmt == pucch_format4_nr) {
|
||||
if (pucch_pdu->format_type == 4) {
|
||||
nrofPRB = 1;
|
||||
|
||||
for (int l=0; l < floor((n_SF_PUCCH_s*m_symbol)/(12*nrofPRB)); l++) {
|
||||
@@ -1414,9 +1418,9 @@ void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
uint8_t m0;
|
||||
uint8_t mcs=0;
|
||||
|
||||
if (fmt == pucch_format3_nr) m0 = 0;
|
||||
if (pucch_pdu->format_type == 3) m0 = 0;
|
||||
|
||||
if (fmt == pucch_format4_nr) {
|
||||
if (pucch_pdu->format_type == 4) {
|
||||
if (n_SF_PUCCH_s == 2) {
|
||||
m0 = (occ_Index == 0) ? 0 : 6;
|
||||
}
|
||||
@@ -1456,7 +1460,8 @@ void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
for (int l=0; l<nrofSymbols; l++) {
|
||||
if ((intraSlotFrequencyHopping == 1) && (l >= (int)floor(nrofSymbols/2))) n_hop = 1; // n_hop = 1 for second hop
|
||||
|
||||
nr_group_sequence_hopping(ue->pucch_config_common_nr->pucch_GroupHopping,ue->pucch_config_common_nr->hoppingId,n_hop,nr_slot_tx,&u,&v); // calculating u and v value
|
||||
pucch_GroupHopping_t pucch_GroupHopping = pucch_pdu->group_hop_flag + (pucch_pdu->sequence_hop_flag<<1);
|
||||
nr_group_sequence_hopping(pucch_GroupHopping,pucch_pdu->hopping_id,n_hop,nr_slot_tx,&u,&v); // calculating u and v value
|
||||
|
||||
// Next we proceed to calculate base sequence for DM-RS signal, according to TS 38.211 subclause 6.4.1.33
|
||||
if (nrofPRB >= 3) { // TS 38.211 subclause 5.2.2.1 (Base sequences of length 36 or larger) applies
|
||||
@@ -1501,12 +1506,13 @@ void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t startingSymbolIndex = pucch_pdu->start_symbol_index;
|
||||
uint16_t j=0;
|
||||
alpha = nr_cyclic_shift_hopping(ue->pucch_config_common_nr->hoppingId,m0,mcs,l,startingSymbolIndex,nr_slot_tx);
|
||||
alpha = nr_cyclic_shift_hopping(pucch_pdu->hopping_id,m0,mcs,l,startingSymbolIndex,nr_slot_tx);
|
||||
|
||||
for (int rb=0; rb<nrofPRB; rb++) {
|
||||
if ((intraSlotFrequencyHopping == 1) && (l<floor(nrofSymbols/2))) { // intra-slot hopping enabled, we need to calculate new offset PRB
|
||||
startingPRB = startingPRB + startingPRB_intraSlotHopping;
|
||||
startingPRB = startingPRB + pucch_pdu->second_hop_prb;
|
||||
}
|
||||
|
||||
//startingPRB = startingPRB + rb;
|
||||
|
||||
@@ -49,65 +49,30 @@
|
||||
void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
long pucch_GroupHopping,
|
||||
long hoppingId,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t m0,
|
||||
uint8_t mcs,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint16_t startingPRB,
|
||||
uint16_t secondHopPRB);
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu);
|
||||
|
||||
void nr_generate_pucch1(PHY_VARS_NR_UE *ue,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
uint64_t payload,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t m0,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint16_t startingPRB,
|
||||
uint16_t startingPRB_intraSlotHopping,
|
||||
uint8_t timeDomainOCC,
|
||||
uint8_t nr_bit);
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu);
|
||||
|
||||
void nr_generate_pucch2(PHY_VARS_NR_UE *ue,
|
||||
uint16_t crnti,
|
||||
uint32_t dmrs_scrambling_id,
|
||||
uint32_t data_scrambling_id,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
uint64_t payload,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint8_t nrofPRB,
|
||||
uint16_t startingPRB,
|
||||
uint8_t nr_bit);
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu);
|
||||
|
||||
void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
uint16_t crnti,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
pucch_format_nr_t fmt,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
uint64_t payload,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint8_t nrofPRB,
|
||||
uint16_t startingPRB,
|
||||
uint16_t startingPRB_intraSlotHopping,
|
||||
uint8_t nr_bit,
|
||||
uint8_t occ_length_format4,
|
||||
uint8_t occ_index_format4);
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu);
|
||||
|
||||
// tables for mcs values for different payloads
|
||||
static const uint8_t table1_mcs[]={0,6,3,9};
|
||||
|
||||
@@ -894,7 +894,7 @@ void phy_scope_nrUE(OAI_phy_scope_t *form,
|
||||
static void *nrUEscopeThread(void *arg) {
|
||||
PHY_VARS_NR_UE *ue=(PHY_VARS_NR_UE *)arg;
|
||||
size_t stksize;
|
||||
pthread_attr_t atr;
|
||||
pthread_attr_t atr={0};
|
||||
pthread_attr_getstacksize(&atr, &stksize);
|
||||
pthread_attr_setstacksize(&atr,32*1024*1024 );
|
||||
int fl_argc=1;
|
||||
|
||||
@@ -235,6 +235,11 @@ typedef struct {
|
||||
int32_t *txdataF_layers[NR_MAX_NB_LAYERS];
|
||||
} NR_UE_PUSCH;
|
||||
|
||||
typedef struct {
|
||||
bool active[2];
|
||||
fapi_nr_ul_config_pucch_pdu pucch_pdu[2];
|
||||
} NR_UE_PUCCH;
|
||||
|
||||
typedef struct {
|
||||
/// \brief Holds the transmit data in time domain.
|
||||
/// For IFFT_FPGA this points to the same memory as PHY_vars->tx_vars[a].TX_DMA_BUFFER.
|
||||
@@ -761,8 +766,6 @@ typedef struct {
|
||||
int UE_fo_compensation;
|
||||
/// \brief Indicator that UE is synchronized to a gNB
|
||||
int is_synchronized;
|
||||
/// \brief Indicates on which frame is synchronized in a two frame synchronization
|
||||
int is_synchronized_on_frame;
|
||||
/// \brief Indicator that UE lost frame synchronization
|
||||
int lost_sync;
|
||||
/// Data structure for UE process scheduling
|
||||
@@ -810,6 +813,7 @@ typedef struct {
|
||||
NR_UE_PDCCH *pdcch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_PRACH *prach_vars[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_PUSCH *pusch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_PUCCH *pucch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_DLSCH_t *dlsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX][NR_MAX_NB_CODEWORDS]; // two RxTx Threads
|
||||
NR_UE_ULSCH_t *ulsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX][NR_MAX_NB_CODEWORDS]; // two code words
|
||||
NR_UE_DLSCH_t *dlsch_SI[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
@@ -957,15 +961,10 @@ typedef struct {
|
||||
/// PUSCH contention-based access vars
|
||||
PUSCH_CA_CONFIG_DEDICATED pusch_ca_config_dedicated[NUMBER_OF_eNB_MAX]; // lola
|
||||
|
||||
/// PUCCH variables
|
||||
|
||||
PUCCH_CONFIG_DEDICATED pucch_config_dedicated[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
|
||||
//#if defined(UPGRADE_RAT_NR)
|
||||
#if 1
|
||||
SystemInformationBlockType1_nr_t systemInformationBlockType1_nr;
|
||||
PUCCH_ConfigCommon_nr_t pucch_config_common_nr[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
PUCCH_Config_t pucch_config_dedicated_nr[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
#endif
|
||||
|
||||
uint8_t ncs_cell[20][7];
|
||||
@@ -1068,6 +1067,7 @@ typedef struct {
|
||||
typedef struct nr_rxtx_thread_data_s {
|
||||
UE_nr_rxtx_proc_t proc;
|
||||
PHY_VARS_NR_UE *UE;
|
||||
NR_UE_SCHED_MODE_t ue_sched_mode;
|
||||
notifiedFIFO_t txFifo;
|
||||
} nr_rxtx_thread_data_t;
|
||||
|
||||
|
||||
@@ -427,23 +427,10 @@ typedef struct {
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
#define MAX_NR_OF_PUCCH_P0_PER_SET (8)
|
||||
#define NUMBER_PUCCH_FORMAT_NR (5)
|
||||
|
||||
typedef int8_t power_level_t; /* INTEGER (-16..15) */
|
||||
|
||||
typedef struct {
|
||||
uint8_t p0_PUCCH_Id; /* INTEGER (1..8) */
|
||||
power_level_t p0_PUCCH_Value;
|
||||
} P0_PUCCH_t;
|
||||
|
||||
typedef struct {
|
||||
power_level_t deltaF_PUCCH_f[NUMBER_PUCCH_FORMAT_NR];
|
||||
P0_PUCCH_t *p0_Set[MAX_NR_OF_PUCCH_P0_PER_SET];
|
||||
// pathlossReferenceRSs SEQUENCE (SIZE (1..maxNrofPUCCH-PathlossReferenceRSs)) OF PUCCH-PathlossReferenceRS OPTIONAL, -- Need M
|
||||
int8_t twoPUCCH_PC_AdjustmentStates;
|
||||
|
||||
} PUCCH_PowerControl_t;
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
@@ -633,9 +620,10 @@ typedef struct {
|
||||
PUCCH_FormatConfig_t *formatConfig[NUMBER_PUCCH_FORMAT_NR-1]; /* format 0 is not there */
|
||||
uint8_t dl_DataToUL_ACK[NB_DL_DATA_TO_UL_ACK]; /* table TS 38.213 Table 9.2.3-1: Mapping of PSDCH-to-HARQ_feedback timing indicator field values to numbers of slots */
|
||||
void *spatial_Relation_Info[MAX_NR_OF_SPATIAL_RELATION_INFOS];
|
||||
PUCCH_PowerControl_t pucch_PowerControl;
|
||||
} PUCCH_Config_t;
|
||||
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* FUNCTIONALITY : Scheduling Request Configuration (SR)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user