Merge branch 'integration_2025_w04' into 'develop'
Integration: `2025.w04` Closes #876, #896, #875, #893, and #878 See merge request oai/openairinterface5g!3226 * !3198 remove a set of compile options that don't work anyway * !3171 Refactor SCTP Association Response Handling and E1 connection loss at CU-UP * !3023 usrp constant and slow derive timestamp * !3215 Remove unused code * !3192 fix nr phy-test mode in ntn * !3214 fix(nrLDPC_coding_t2): Miscellaneous fixes related to T2 * !3020 use ML receiver for 64 QAM UL-MIMO * Demote error logs to debug for "PUCCH not processed" * !3217 minor improvements in T hacks * !3199 Add a small FAPI Hex parser utility * !3209 Remove most of m64 type usage * !3211 Avoid huge calloc by alloc'ing TBs independently * !3212 F1AP IDs: Allow AddMod, fix concurrency bug * !3152 E1 Setup enc/dec library and unit test * !2999 Repair nFAPI in 5G * !3210 FHI72: FDD support * !3220 Improve RA logs
This commit is contained in:
+8
-33
@@ -260,7 +260,6 @@ endif()
|
||||
|
||||
# Debug related options
|
||||
#########################################
|
||||
add_boolean_option(DEBUG_ASN1 False "Enable ASN1 debug logs" OFF)
|
||||
# asn1c skeletons have hardcoded this flag to make customized debug logs
|
||||
# OAI uses this feature to re-use OAI LOG_I(ASN1, ...)
|
||||
# see common/utils/config.h
|
||||
@@ -346,6 +345,7 @@ set(NGAP_DIR ${OPENAIR3_DIR}/NGAP)
|
||||
include_directories ("${NGAP_DIR}")
|
||||
add_library(ngap
|
||||
${NGAP_DIR}/ngap_gNB.c
|
||||
${NGAP_DIR}/ngap_common.c
|
||||
${NGAP_DIR}/ngap_gNB_context_management_procedures.c
|
||||
${NGAP_DIR}/ngap_gNB_decoder.c
|
||||
${NGAP_DIR}/ngap_gNB_encoder.c
|
||||
@@ -494,7 +494,6 @@ include_directories ("${OPENAIR_DIR}/radio/COMMON")
|
||||
add_boolean_option(UE_EXPANSION False "enable UE_EXPANSION with max 256 UE" ON)
|
||||
add_boolean_option(PHY_TX_THREAD False "enable UE_EXPANSION with max 256 UE" ON)
|
||||
add_boolean_option(PRE_SCD_THREAD False "enable UE_EXPANSION with max 256 UE" ON)
|
||||
add_boolean_option(UESIM_EXPANSION False "enable UESIM_EXPANSION with max 256 UE" ON)
|
||||
|
||||
##########################
|
||||
# SCHEDULING/REAL-TIME/PERF options
|
||||
@@ -506,20 +505,15 @@ add_boolean_option(ENABLE_VCD_FIFO False "time measurements of proc cal
|
||||
##########################
|
||||
# PHY options
|
||||
##########################
|
||||
add_boolean_option(LOCALIZATION False "???" ON)
|
||||
add_integer_option(MAX_NUM_CCs 1 "????" ON)
|
||||
add_integer_option(MAX_NUM_CCs 1 "Carrier component data arrays size (oai doesn't support carrier aggreagtion for now)" ON)
|
||||
add_boolean_option(SMBV False "Rohde&Schwarz SMBV100A vector signal generator" ON)
|
||||
add_boolean_option(DEBUG_PHY False "Enable PHY layer debugging options" ON)
|
||||
add_boolean_option(DEBUG_PHY_PROC False "Enable debugging of PHY layer procedures" ON)
|
||||
add_boolean_option(MEX False "Enabling compilation with mex" ON)
|
||||
|
||||
##########################
|
||||
# NAS LAYER OPTIONS
|
||||
##########################
|
||||
add_boolean_option(ENABLE_NAS_UE_LOGGING True "????" ON)
|
||||
add_boolean_option(NAS_BUILT_IN_UE True "UE NAS layer present in this executable" ON)
|
||||
add_boolean_option(NAS_UE True "NAS UE INSTANCE (<> NAS_MME)" ON)
|
||||
|
||||
|
||||
##########################
|
||||
# RRC LAYER OPTIONS
|
||||
@@ -716,6 +710,7 @@ set(NFAPI_PNF_SRC
|
||||
)
|
||||
add_library(NFAPI_PNF_LIB ${NFAPI_PNF_SRC})
|
||||
target_link_libraries(NFAPI_PNF_LIB PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
|
||||
target_link_libraries(NFAPI_PNF_LIB PUBLIC nr_fapi_p7)
|
||||
|
||||
include_directories(${NFAPI_DIR}/pnf/public_inc)
|
||||
include_directories(${NFAPI_DIR}/pnf/inc)
|
||||
@@ -746,6 +741,9 @@ set(NFAPI_USER_SRC
|
||||
add_library(NFAPI_USER_LIB ${NFAPI_USER_SRC})
|
||||
target_link_libraries(NFAPI_USER_LIB PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs UTIL)
|
||||
target_link_libraries(NFAPI_USER_LIB PRIVATE nr_fapi_p7)
|
||||
if(OAI_AERIAL)
|
||||
target_compile_definitions(NFAPI_USER_LIB PRIVATE ENABLE_AERIAL)
|
||||
endif()
|
||||
include_directories(${NFAPI_USER_DIR})
|
||||
|
||||
# Layer 1
|
||||
@@ -897,6 +895,7 @@ set(PHY_SRC_UE
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/ulsch_coding.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/rar_tools_ue.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/initial_sync.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation_avx2.c
|
||||
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep.c
|
||||
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_mbsfn.c
|
||||
${OPENAIR1_DIR}/PHY/MODULATION/ul_7_5_kHz_ue.c
|
||||
@@ -1026,8 +1025,6 @@ if (${SMBV})
|
||||
set(PHY_SRC "${PHY_SRC} ${OPENAIR1_DIR}/PHY/TOOLS/smbv.c")
|
||||
endif (${SMBV})
|
||||
|
||||
set(PHY_SRC_UE ${PHY_SRC_UE} ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation_avx2.c)
|
||||
|
||||
add_library(PHY_COMMON ${PHY_SRC_COMMON})
|
||||
target_link_libraries(PHY_COMMON PRIVATE shlib_loader)
|
||||
add_dependencies(PHY_COMMON dfts)
|
||||
@@ -1063,28 +1060,6 @@ target_link_libraries(PHY_NR_UE PRIVATE asn1_nr_rrc_hdrs nr_phy_common nr_common
|
||||
add_library(PHY_RU ${PHY_SRC_RU})
|
||||
target_link_libraries(PHY_RU PRIVATE asn1_lte_rrc_hdrs UTIL)
|
||||
|
||||
#Library for mex functions
|
||||
#########################3
|
||||
set(PHY_MEX_UE
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/linear_preprocessing_rec.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/get_pmi.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/dB_routines.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch_common.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/cmult_sv.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/cmult_vv.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/signal_energy.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/simde_operations.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation_avx2.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ue_measurements.c
|
||||
)
|
||||
add_library(PHY_MEX ${PHY_MEX_UE})
|
||||
target_link_libraries(PHY_MEX PRIVATE asn1_lte_rrc_hdrs UTIL)
|
||||
|
||||
#Layer 2 library
|
||||
#####################
|
||||
set(MAC_DIR ${OPENAIR2_DIR}/LAYER2/MAC)
|
||||
@@ -2214,7 +2189,7 @@ if (${T_TRACER})
|
||||
SECURITY SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL
|
||||
NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB
|
||||
MISC_NFAPI_LTE_LIB MISC_NFAPI_NR_LIB
|
||||
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX
|
||||
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU
|
||||
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_UE_NR ngap
|
||||
CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT SIMU OPENAIR0_LIB
|
||||
dfts config_internals nr_common)
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "nfapi";
|
||||
remote_n_address = "192.168.71.140"; // vnf addr
|
||||
local_n_address = "192.168.71.141"; // pnf addr
|
||||
local_n_portc = 50000; // pnf p5 port [!]
|
||||
remote_n_portc = 50001; // vnf p5 port
|
||||
local_n_portd = 50010; // pnf p7 port
|
||||
remote_n_portd = 50011; // vnf p7 port
|
||||
prach_dtx_threshold = 120;
|
||||
pucch0_dtx_threshold = 150;
|
||||
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
|
||||
}
|
||||
);
|
||||
|
||||
RUs = ({
|
||||
local_rf = "yes";
|
||||
nb_tx = 1;
|
||||
nb_rx = 1;
|
||||
att_tx = 0;
|
||||
att_rx = 0;
|
||||
bands = [7];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 114;
|
||||
sf_extension = 0;
|
||||
eNB_instances = [0];
|
||||
});
|
||||
|
||||
rfsimulator :
|
||||
{
|
||||
serveraddr = "server";
|
||||
serverport = 4043;
|
||||
options = (); #("saviq"); or/and "chanmod"
|
||||
modelname = "AWGN";
|
||||
IQfile = "/tmp/rfsimulator.iqs";
|
||||
};
|
||||
|
||||
log_config: {
|
||||
global_log_level = "info";
|
||||
hw_log_level = "info";
|
||||
phy_log_level = "info";
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
usrp-tx-thread-config = 1;
|
||||
tune-offset = 30720000;
|
||||
|
||||
L1s = ({
|
||||
num_cc = 1;
|
||||
tr_n_preference = "nfapi";
|
||||
remote_n_address = "127.0.0.1"; // vnf addr
|
||||
local_n_address = "127.0.0.1"; // pnf addr
|
||||
local_n_portc = 50000; // pnf p5 port [!]
|
||||
remote_n_portc = 50001; // vnf p5 port
|
||||
local_n_portd = 50010; // pnf p7 port
|
||||
remote_n_portd = 50011; // vnf p7 port
|
||||
prach_dtx_threshold = 120;
|
||||
pusch_dtx_threshold = 20;
|
||||
max_ldpc_iterations = 10;
|
||||
});
|
||||
|
||||
RUs = ({
|
||||
local_rf = "yes"
|
||||
nb_tx = 4;
|
||||
nb_rx = 4;
|
||||
att_tx = 0;
|
||||
att_rx = 0;
|
||||
bands = [77];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 75;
|
||||
eNB_instances = [0];
|
||||
#clock_src = "internal";
|
||||
sdr_addrs = "addr=192.168.80.53, clock_source=internal,time_source=internal"
|
||||
});
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
Active_gNBs = ( "5G-GOA-gNB");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
gNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_ID = 0xe00;
|
||||
gNB_name = "5G-GOA-gNB";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
plmn_list = ({ mcc = 208; mnc = 99; mnc_length = 2; snssaiList = ({ sst = 1 }) });
|
||||
|
||||
nr_cellid = 12345678L;
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
sib1_tda = 5;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
servingCellConfigCommon = (
|
||||
{
|
||||
#spCellConfigCommon
|
||||
|
||||
physCellId = 0;
|
||||
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# this is 2150.43 MHz + 14 PRBs@15kHz SCS (same as initial BWP), points to Subcarrier 0 of RB#10 of SSB block
|
||||
absoluteFrequencySSB = 430590;
|
||||
dl_frequencyBand = 66;
|
||||
# this is 2150.43 MHz
|
||||
dl_absoluteFrequencyPointA = 430086;
|
||||
#scs-SpecificCarrierList
|
||||
dl_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
dl_subcarrierSpacing = 0;
|
||||
dl_carrierBandwidth = 25;
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=0,L=25 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 6600;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 0;
|
||||
#pdcch-ConfigCommon
|
||||
initialDLBWPcontrolResourceSetZero = 2;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 66;
|
||||
# this is 1750.43 MHz
|
||||
ul_absoluteFrequencyPointA = 350086;
|
||||
#scs-SpecificCarrierList
|
||||
ul_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
ul_subcarrierSpacing = 0;
|
||||
ul_carrierBandwidth = 25;
|
||||
pMax = 20;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 6600;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialULBWPsubcarrierSpacing = 0;
|
||||
#rach-ConfigCommon
|
||||
#rach-ConfigGeneric
|
||||
prach_ConfigurationIndex = 98;
|
||||
#prach_msg1_FDM
|
||||
#0 = one, 1=two, 2=four, 3=eight
|
||||
prach_msg1_FDM = 0;
|
||||
prach_msg1_FrequencyStart = 0;
|
||||
zeroCorrelationZoneConfig = 13;
|
||||
preambleReceivedTargetPower = -118;
|
||||
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
|
||||
preambleTransMax = 6;
|
||||
#powerRampingStep
|
||||
# 0=dB0,1=dB2,2=dB4,3=dB6
|
||||
powerRampingStep = 1;
|
||||
#ra_ReponseWindow
|
||||
#1,2,4,8,10,20,40,80
|
||||
ra_ResponseWindow = 5;
|
||||
#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
|
||||
#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
|
||||
#one (0..15) 4,8,12,16,...60,64
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
|
||||
#ra_ContentionResolutionTimer
|
||||
#(0..7) 8,16,24,32,40,48,56,64
|
||||
ra_ContentionResolutionTimer = 7;
|
||||
rsrp_ThresholdSSB = 19;
|
||||
#prach-RootSequenceIndex_PR
|
||||
#1 = 839, 2 = 139
|
||||
prach_RootSequenceIndex_PR = 2;
|
||||
prach_RootSequenceIndex = 1;
|
||||
# SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
|
||||
#
|
||||
msg1_SubcarrierSpacing = 0;
|
||||
# restrictedSetConfig
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0;
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
# pucch-ConfigCommon setup :
|
||||
# pucchGroupHopping
|
||||
# 0 = neither, 1= group hopping, 2=sequence hopping
|
||||
pucchGroupHopping = 0;
|
||||
hoppingId = 40;
|
||||
p0_nominal = -90;
|
||||
|
||||
ssb_PositionsInBurst_Bitmap = 1;
|
||||
|
||||
# ssb_periodicityServingCell
|
||||
# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
|
||||
ssb_periodicityServingCell = 2;
|
||||
|
||||
# dmrs_TypeA_position
|
||||
# 0 = pos2, 1 = pos3
|
||||
dmrs_TypeA_Position = 0;
|
||||
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
subcarrierSpacing = 0;
|
||||
|
||||
|
||||
#tdd-UL-DL-ConfigurationCommon
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
referenceSubcarrierSpacing = 0;
|
||||
# pattern1
|
||||
# dl_UL_TransmissionPeriodicity
|
||||
# 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
|
||||
dl_UL_TransmissionPeriodicity = 6;
|
||||
nrofDownlinkSlots = 7;
|
||||
nrofDownlinkSymbols = 6;
|
||||
nrofUplinkSlots = 2;
|
||||
nrofUplinkSymbols = 4;
|
||||
|
||||
ssPBCH_BlockPower = -25;
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// AMF parameters:
|
||||
amf_ip_address = ({ ipv4 = "192.168.71.132"; });
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.71.140/26";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.71.140/26";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "nfapi";
|
||||
remote_s_address = "192.168.71.141"; // pnf addr [!]
|
||||
local_s_address = "192.168.71.140"; // vnf addr
|
||||
local_s_portc = 50001; // vnf p5 port
|
||||
remote_s_portc = 50000; // pnf p5 port [!]
|
||||
local_s_portd = 50011; // vnf p7 port [!]
|
||||
remote_s_portd = 50010; // pnf p7 port [!]
|
||||
tr_n_preference = "local_RRC";
|
||||
pusch_TargetSNRx10 = 150;
|
||||
pucch_TargetSNRx10 = 200;
|
||||
}
|
||||
);
|
||||
|
||||
security = {
|
||||
# preferred ciphering algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nea0, nea1, nea2, nea3
|
||||
ciphering_algorithms = ( "nea0" );
|
||||
|
||||
# preferred integrity algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nia0, nia1, nia2, nia3
|
||||
integrity_algorithms = ( "nia2", "nia0" );
|
||||
|
||||
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
|
||||
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
|
||||
drb_ciphering = "yes";
|
||||
drb_integrity = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
hw_log_level ="info";
|
||||
phy_log_level ="info";
|
||||
mac_log_level ="info";
|
||||
rlc_log_level ="info";
|
||||
pdcp_log_level ="info";
|
||||
rrc_log_level ="info";
|
||||
ngap_log_level ="debug";
|
||||
f1ap_log_level ="info";
|
||||
};
|
||||
@@ -0,0 +1,224 @@
|
||||
Active_gNBs = ( "gNB-OAI");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
gNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_ID = 0xe00;
|
||||
gNB_name = "gNB-OAI";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
plmn_list = ({ mcc = 208; mnc = 97; mnc_length = 2; snssaiList = ({ sst = 1; }) });
|
||||
|
||||
nr_cellid = 12345678L;
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
pdsch_AntennaPorts_XP = 2;
|
||||
pusch_AntennaPorts = 4;
|
||||
pdsch_AntennaPorts_N1 = 2;
|
||||
maxMIMO_layers = 4;
|
||||
do_CSIRS = 1;
|
||||
do_SRS = 1;
|
||||
|
||||
servingCellConfigCommon = (
|
||||
{
|
||||
#spCellConfigCommon
|
||||
|
||||
physCellId = 0;
|
||||
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# this is 4100.16 MHz
|
||||
absoluteFrequencySSB = 673344;
|
||||
# this is 4071 MHz
|
||||
dl_absoluteFrequencyPointA = 671400;
|
||||
dl_frequencyBand = 77;
|
||||
#scs-SpecificCarrierList
|
||||
dl_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
dl_subcarrierSpacing = 1;
|
||||
dl_carrierBandwidth = 162;
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=0,L=162 (275*(275-L+1))+(274-RBstart))
|
||||
initialDLBWPlocationAndBandwidth = 31624;
|
||||
#
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
#pdcch-ConfigCommon
|
||||
initialDLBWPcontrolResourceSetZero = 12;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 77;
|
||||
#scs-SpecificCarrierList
|
||||
ul_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
ul_subcarrierSpacing = 1;
|
||||
ul_carrierBandwidth = 162;
|
||||
pMax = 20;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 31624;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
#rach-ConfigCommon
|
||||
#rach-ConfigGeneric
|
||||
prach_ConfigurationIndex = 98;
|
||||
#prach_msg1_FDM
|
||||
#0 = one, 1=two, 2=four, 3=eight
|
||||
prach_msg1_FDM = 0;
|
||||
prach_msg1_FrequencyStart = 0;
|
||||
zeroCorrelationZoneConfig = 12;
|
||||
preambleReceivedTargetPower = -96;
|
||||
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
|
||||
preambleTransMax = 6;
|
||||
#powerRampingStep
|
||||
# 0=dB0,1=dB2,2=dB4,3=dB6
|
||||
powerRampingStep = 1;
|
||||
#ra_ReponseWindow
|
||||
#1,2,4,8,10,20,40,80
|
||||
ra_ResponseWindow = 5;
|
||||
#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
|
||||
#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
|
||||
#one (0..15) 4,8,12,16,...60,64
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
|
||||
#ra_ContentionResolutionTimer
|
||||
#(0..7) 8,16,24,32,40,48,56,64
|
||||
ra_ContentionResolutionTimer = 7;
|
||||
rsrp_ThresholdSSB = 19;
|
||||
#prach-RootSequenceIndex_PR
|
||||
#1 = 839, 2 = 139
|
||||
prach_RootSequenceIndex_PR = 2;
|
||||
prach_RootSequenceIndex = 1;
|
||||
# SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
|
||||
#
|
||||
msg1_SubcarrierSpacing = 1,
|
||||
# restrictedSetConfig
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
# pucch-ConfigCommon setup :
|
||||
# pucchGroupHopping
|
||||
# 0 = neither, 1= group hopping, 2=sequence hopping
|
||||
pucchGroupHopping = 0;
|
||||
hoppingId = 40;
|
||||
p0_nominal = -70;
|
||||
|
||||
ssb_PositionsInBurst_Bitmap = 1;
|
||||
|
||||
# ssb_periodicityServingCell
|
||||
# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
|
||||
ssb_periodicityServingCell = 2;
|
||||
|
||||
# dmrs_TypeA_position
|
||||
# 0 = pos2, 1 = pos3
|
||||
dmrs_TypeA_Position = 0;
|
||||
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
subcarrierSpacing = 1;
|
||||
|
||||
|
||||
#tdd-UL-DL-ConfigurationCommon
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
referenceSubcarrierSpacing = 1;
|
||||
# pattern1
|
||||
# dl_UL_TransmissionPeriodicity
|
||||
# 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
|
||||
dl_UL_TransmissionPeriodicity = 5;
|
||||
nrofDownlinkSlots = 3;
|
||||
nrofDownlinkSymbols = 6;
|
||||
nrofUplinkSlots = 1;
|
||||
nrofUplinkSymbols = 4;
|
||||
|
||||
ssPBCH_BlockPower = -25;
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// AMF parameters:
|
||||
amf_ip_address = ({ ipv4 = "192.168.61.132"; });
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.61.129/26";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.61.129/26";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "nfapi";
|
||||
remote_s_address = "127.0.0.1"; // pnf addr [!]
|
||||
local_s_address = "127.0.0.1"; // vnf addr
|
||||
local_s_portc = 50001; // vnf p5 port
|
||||
remote_s_portc = 50000; // pnf p5 port [!]
|
||||
local_s_portd = 50011; // vnf p7 port [!]
|
||||
remote_s_portd = 50010; // pnf p7 port [!]
|
||||
|
||||
tr_n_preference = "local_RRC";
|
||||
pusch_TargetSNRx10 = 250;
|
||||
pucch_TargetSNRx10 = 250;
|
||||
pusch_FailureThres = 100;
|
||||
ul_max_mcs = 28;
|
||||
}
|
||||
);
|
||||
|
||||
security = {
|
||||
# preferred ciphering algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nea0, nea1, nea2, nea3
|
||||
ciphering_algorithms = ( "nea1", "nea0" );
|
||||
|
||||
# preferred integrity algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nia0, nia1, nia2, nia3
|
||||
integrity_algorithms = ( "nia1", "nia0" );
|
||||
|
||||
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
|
||||
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
|
||||
drb_ciphering = "yes";
|
||||
drb_integrity = "yes";
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
hw_log_level ="info";
|
||||
phy_log_level ="info";
|
||||
mac_log_level ="info";
|
||||
rlc_log_level ="info";
|
||||
pdcp_log_level ="info";
|
||||
rrc_log_level ="info";
|
||||
ngap_log_level ="debug";
|
||||
f1ap_log_level ="debug";
|
||||
};
|
||||
@@ -22,7 +22,7 @@
|
||||
-->
|
||||
<testCaseList>
|
||||
<htmlTabRef>rfsim-5gnr-fdd-u0-25prb</htmlTabRef>
|
||||
<htmlTabName>Monolithic SA FDD u0 25PRB gNB</htmlTabName>
|
||||
<htmlTabName>VNF-PNF nFAPI FDD u0 25PRB gNB</htmlTabName>
|
||||
<htmlTabIcon>wrench</htmlTabIcon>
|
||||
<TestCaseRequestedList>
|
||||
111111
|
||||
@@ -62,9 +62,9 @@
|
||||
|
||||
<testCase id="000002">
|
||||
<class>Deploy_Object</class>
|
||||
<desc>Deploy OAI 5G gNB+nrUE RF sim SA</desc>
|
||||
<desc>Deploy OAI 5G VNF+PNF+nrUE RF sim SA</desc>
|
||||
<yaml_path>ci-scripts/yaml_files/5g_rfsimulator_u0_25prb</yaml_path>
|
||||
<services>oai-gnb oai-nr-ue</services>
|
||||
<services>oai-vnf oai-pnf oai-nr-ue</services>
|
||||
<eNB_instance>0</eNB_instance>
|
||||
<eNB_serverId>0</eNB_serverId>
|
||||
</testCase>
|
||||
@@ -122,6 +122,7 @@
|
||||
<class>Undeploy_Object</class>
|
||||
<always_exec>true</always_exec>
|
||||
<desc>Undeploy all OAI 5G stack</desc>
|
||||
<services>oai-vnf oai-pnf</services>
|
||||
<yaml_path>ci-scripts/yaml_files/5g_rfsimulator_u0_25prb</yaml_path>
|
||||
<d_retx_th>1,0,0,0</d_retx_th>
|
||||
<u_retx_th>1,0,0,0</u_retx_th>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
-->
|
||||
<testCaseList>
|
||||
<htmlTabRef>TEST-SA-FR1-N310-4x4-60MHz</htmlTabRef>
|
||||
<htmlTabName>60 MHz 4x4 TDD SA</htmlTabName>
|
||||
<htmlTabName>nFAPI 60 MHz 4x4 TDD SA</htmlTabName>
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
<TestCaseRequestedList>
|
||||
100000
|
||||
@@ -85,7 +85,7 @@
|
||||
</testCase>
|
||||
<testCase id="030101">
|
||||
<class>Deploy_Object</class>
|
||||
<desc>Deploy gNB (TDD/Band77/60MHz/N310) in a container</desc>
|
||||
<desc>Deploy VNF-PNF (TDD/Band77/60MHz/N310) in a container</desc>
|
||||
<yaml_path>ci-scripts/yaml_files/5g_sa_n310_4x4_60MHz</yaml_path>
|
||||
<eNB_instance>0</eNB_instance>
|
||||
<eNB_serverId>0</eNB_serverId>
|
||||
@@ -144,11 +144,11 @@
|
||||
<testCase id="030201">
|
||||
<class>Undeploy_Object</class>
|
||||
<always_exec>true</always_exec>
|
||||
<desc>Undeploy gNB</desc>
|
||||
<desc>Undeploy VNF-PNF</desc>
|
||||
<yaml_path>ci-scripts/yaml_files/5g_sa_n310_4x4_60MHz</yaml_path>
|
||||
<eNB_instance>0</eNB_instance>
|
||||
<eNB_serverId>0</eNB_serverId>
|
||||
<services>oai-gnb</services>
|
||||
<services>oai-vnf oai-pnf</services>
|
||||
<d_retx_th>10,100,100,100</d_retx_th>
|
||||
<u_retx_th>10,100,100,100</u_retx_th>
|
||||
</testCase>
|
||||
|
||||
@@ -80,13 +80,15 @@ services:
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
oai-gnb:
|
||||
|
||||
oai-vnf:
|
||||
image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop}
|
||||
container_name: rfsim5g-oai-gnb
|
||||
container_name: rfsim5g-oai-vnf
|
||||
cap_drop:
|
||||
- ALL
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time
|
||||
USE_ADDITIONAL_OPTIONS: --nfapi VNF --log_config.global_log_options level,nocolor,time
|
||||
NFAPI_TRACE_LEVEL: info
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-ext-dn
|
||||
@@ -94,7 +96,29 @@ services:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.140
|
||||
volumes:
|
||||
- ../../conf_files/gnb.sa.band66.u0.25prb.rfsim.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
- ../../conf_files/gnb-vnf.sa.band66.u0.25prb.nfapi.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
oai-pnf:
|
||||
image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop}
|
||||
container_name: rfsim5g-oai-pnf
|
||||
cap_drop:
|
||||
- ALL
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --nfapi PNF --rfsim --log_config.global_log_options level,nocolor,time
|
||||
NFAPI_TRACE_LEVEL: info
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-vnf
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.141
|
||||
volumes:
|
||||
- ../../conf_files/gnb-pnf.band66.rfsim.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
@@ -110,9 +134,9 @@ services:
|
||||
- NET_ADMIN # for interface bringup
|
||||
- NET_RAW # for ping
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --rfsim -r 25 --numerology 0 --uicc0.imsi 208990100001100 --band 66 -C 2152680000 --CO -400000000 --ssb 48 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
USE_ADDITIONAL_OPTIONS: --rfsim -r 25 --numerology 0 --uicc0.imsi 208990100001100 --band 66 -C 2152680000 --CO -400000000 --ssb 48 --rfsimulator.serveraddr 192.168.71.141 --log_config.global_log_options level,nocolor,time
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
- oai-pnf
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.150
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
services:
|
||||
oai-gnb:
|
||||
oai-vnf:
|
||||
image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop}
|
||||
network_mode: "host"
|
||||
container_name: oai-gnb
|
||||
container_name: oai-vnf
|
||||
cap_drop:
|
||||
- ALL
|
||||
cap_add:
|
||||
@@ -10,9 +10,30 @@ services:
|
||||
- IPC_LOCK
|
||||
environment:
|
||||
TZ: Europe/Paris
|
||||
USE_ADDITIONAL_OPTIONS: --log_config.global_log_options level,nocolor,time
|
||||
USE_ADDITIONAL_OPTIONS: --nfapi VNF
|
||||
NFAPI_TRACE_LEVEL: info
|
||||
volumes:
|
||||
- ../../conf_files/gnb.sa.band77.162prb.usrpn310.4x4.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
- ../../conf_files/gnb-vnf.sa.band77.162prb.nfapi.4x4.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
oai-pnf:
|
||||
image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop}
|
||||
network_mode: "host"
|
||||
container_name: oai-pnf
|
||||
cap_drop:
|
||||
- ALL
|
||||
cap_add:
|
||||
- SYS_NICE
|
||||
- IPC_LOCK
|
||||
environment:
|
||||
TZ: Europe/Paris
|
||||
USE_ADDITIONAL_OPTIONS: --nfapi PNF
|
||||
NFAPI_TRACE_LEVEL: info
|
||||
volumes:
|
||||
- ../../conf_files/gnb-pnf.band77.usrpn310.4x4.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
|
||||
@@ -105,11 +105,7 @@ add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"")
|
||||
##########################
|
||||
# NAS LAYER OPTIONS
|
||||
##########################
|
||||
add_boolean_option(ENABLE_NAS_UE_LOGGING True "????")
|
||||
add_boolean_option(NAS_BUILT_IN_EPC False "MME NAS layer not present in this executable")
|
||||
add_boolean_option(NAS_BUILT_IN_UE False "UE NAS layer present in this executable")
|
||||
add_boolean_option(NAS_UE True "NAS UE INSTANCE (<> NAS_MME)")
|
||||
add_boolean_option(NAS_MME False "NAS_UE and NAS_MME are incompatible options")
|
||||
|
||||
################################################################################
|
||||
# SECU LIB
|
||||
|
||||
@@ -228,6 +228,10 @@ It can also be retrieved when using the telnet server, as explained [below](###
|
||||
| `<flag>_debug` | `boolean` | 0 = false | Triggers the activation of conditional code identified by the specified flag.
|
||||
| `<flag>_dump` | `boolean` | 0 = false| Triggers buffer dump, on the console in text form or in a file in matlab format, depending on the developper choice and forcasted usage|
|
||||
|
||||
Example: dump all ASN.1 structures during operation with
|
||||
`--log_config.ASN1_debug`. To get a list of all flag/dump options, provide an
|
||||
invalid flag, e.g. `--log_config.HELP_debug`.
|
||||
|
||||
### Using the configuration file to configure the logging facility
|
||||
The following example sets all components log level to info, exept for hw,phy,mac,rlc,pdcp,rrc which log levels are set to error or warning.
|
||||
```bash
|
||||
|
||||
+37
-50
@@ -120,28 +120,6 @@ mapping * log_option_names_ptr(void)
|
||||
return log_options;
|
||||
}
|
||||
|
||||
static mapping log_maskmap[] = {{"PRACH", DEBUG_PRACH},
|
||||
{"RU", DEBUG_RU},
|
||||
{"UE_PHYPROC", DEBUG_UE_PHYPROC},
|
||||
{"LTEESTIM", DEBUG_LTEESTIM},
|
||||
{"DLCELLSPEC", DEBUG_DLCELLSPEC},
|
||||
{"ULSCH", DEBUG_ULSCH},
|
||||
{"RRC", DEBUG_RRC},
|
||||
{"PDCP", DEBUG_PDCP},
|
||||
{"DFT", DEBUG_DFT},
|
||||
{"ASN1", DEBUG_ASN1},
|
||||
{"CTRLSOCKET", DEBUG_CTRLSOCKET},
|
||||
{"SECURITY", DEBUG_SECURITY},
|
||||
{"NAS", DEBUG_NAS},
|
||||
{"RLC", DEBUG_RLC},
|
||||
{"DLSCH_DECOD", DEBUG_DLSCH_DECOD},
|
||||
{"UE_TIMING", UE_TIMING},
|
||||
{NULL, -1}};
|
||||
mapping * log_maskmap_ptr(void)
|
||||
{
|
||||
return log_maskmap;
|
||||
}
|
||||
|
||||
/* .log_format = 0x13 uncolored standard messages
|
||||
* .log_format = 0x93 colored standard messages */
|
||||
/* keep white space in first position; switching it to 0 allows colors to be disabled*/
|
||||
@@ -327,6 +305,9 @@ int write_file_matlab(const char *fname, const char *vname, void *data, int leng
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define FLAG_SETDEBUG(flag) g_log->debug_mask.DEBUG_##flag = *logparams_debug[i++].uptr;
|
||||
#define FLAG_SETDUMP(flag) g_log->dump_mask.DEBUG_##flag = *logparams_dump[i++].uptr;
|
||||
|
||||
/* get log parameters from configuration file */
|
||||
void log_getconfig(log_t *g_log)
|
||||
{
|
||||
@@ -335,8 +316,6 @@ void log_getconfig(log_t *g_log)
|
||||
paramdef_t logparams_defaults[] = LOG_GLOBALPARAMS_DESC;
|
||||
paramdef_t logparams_level[MAX_LOG_PREDEF_COMPONENTS];
|
||||
paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS];
|
||||
paramdef_t logparams_debug[sizeofArray(log_maskmap)];
|
||||
paramdef_t logparams_dump[sizeofArray(log_maskmap)];
|
||||
int ret = config_get(config_get_if(), logparams_defaults, sizeofArray(logparams_defaults), CONFIG_STRING_LOG_PREFIX);
|
||||
|
||||
if (ret <0) {
|
||||
@@ -404,37 +383,45 @@ void log_getconfig(log_t *g_log)
|
||||
}
|
||||
|
||||
/* build then read the debug and dump parameter array */
|
||||
for (int i=0; log_maskmap[i].name != NULL ; i++) {
|
||||
sprintf(logparams_debug[i].optname, LOG_CONFIG_DEBUG_FORMAT, log_maskmap[i].name);
|
||||
sprintf(logparams_dump[i].optname, LOG_CONFIG_DUMP_FORMAT, log_maskmap[i].name);
|
||||
logparams_debug[i].defuintval = 0;
|
||||
logparams_debug[i].type = TYPE_UINT;
|
||||
logparams_debug[i].paramflags = PARAMFLAG_BOOL;
|
||||
logparams_debug[i].uptr = NULL;
|
||||
logparams_debug[i].chkPptr = NULL;
|
||||
logparams_debug[i].numelt = 0;
|
||||
logparams_dump[i].defuintval = 0;
|
||||
logparams_dump[i].type = TYPE_UINT;
|
||||
logparams_dump[i].paramflags = PARAMFLAG_BOOL;
|
||||
logparams_dump[i].uptr = NULL;
|
||||
logparams_dump[i].chkPptr = NULL;
|
||||
logparams_dump[i].numelt = 0;
|
||||
int sz = 0;
|
||||
for (const char *const *ptr = flag_name; strlen(*ptr) > 1; ptr++)
|
||||
sz++;
|
||||
paramdef_t logparams_debug[sz];
|
||||
paramdef_t logparams_dump[sz];
|
||||
for (int i = 0; i < sz; i++) {
|
||||
logparams_debug[i] = (paramdef_t){
|
||||
.type = TYPE_UINT,
|
||||
.paramflags = PARAMFLAG_BOOL,
|
||||
};
|
||||
sprintf(logparams_debug[i].optname, LOG_CONFIG_DEBUG_FORMAT, flag_name[i]);
|
||||
logparams_dump[i] = (paramdef_t){.type = TYPE_UINT, .paramflags = PARAMFLAG_BOOL};
|
||||
sprintf(logparams_dump[i].optname, LOG_CONFIG_DUMP_FORMAT, flag_name[i]);
|
||||
}
|
||||
|
||||
config_get(config_get_if(), logparams_debug, sizeofArray(log_maskmap) - 1, CONFIG_STRING_LOG_PREFIX);
|
||||
config_get(config_get_if(), logparams_dump, sizeofArray(log_maskmap) - 1, CONFIG_STRING_LOG_PREFIX);
|
||||
config_get(config_get_if(), logparams_debug, sz, CONFIG_STRING_LOG_PREFIX);
|
||||
config_get(config_get_if(), logparams_dump, sz, CONFIG_STRING_LOG_PREFIX);
|
||||
|
||||
if (config_check_unknown_cmdlineopt(config_get_if(), CONFIG_STRING_LOG_PREFIX) > 0)
|
||||
bool old = CONFIG_ISFLAGSET(CONFIG_NOABORTONCHKF);
|
||||
CONFIG_SETRTFLAG(CONFIG_NOABORTONCHKF);
|
||||
if (config_check_unknown_cmdlineopt(config_get_if(), CONFIG_STRING_LOG_PREFIX) > 0) {
|
||||
printf("Existing log_config options:\n");
|
||||
printf(" Boolean options:\n");
|
||||
for (int i = 0; i < sz; i++)
|
||||
printf(" %s, \t%s\n", logparams_debug[i].optname, logparams_dump[i].optname);
|
||||
printf(" Log level per module (");
|
||||
for (int i = 0; log_level_names[i].name != NULL; i++)
|
||||
printf("%s ", log_level_names[i].name);
|
||||
printf(")\n");
|
||||
for (int i = 0; i < MAX_LOG_PREDEF_COMPONENTS; i++)
|
||||
printf(" %s\n", logparams_level[i].optname);
|
||||
exit(1);
|
||||
|
||||
/* set the debug mask according to the debug parameters values */
|
||||
for (int i=0; log_maskmap[i].name != NULL ; i++) {
|
||||
if (*(logparams_debug[i].uptr) )
|
||||
g_log->debug_mask = g_log->debug_mask | log_maskmap[i].value;
|
||||
|
||||
if (*(logparams_dump[i].uptr) )
|
||||
g_log->dump_mask = g_log->dump_mask | log_maskmap[i].value;
|
||||
}
|
||||
if (!old)
|
||||
CONFIG_CLEARRTFLAG(CONFIG_NOABORTONCHKF);
|
||||
int i = 0;
|
||||
FOREACH_FLAG(FLAG_SETDEBUG);
|
||||
i = 0;
|
||||
FOREACH_FLAG(FLAG_SETDUMP);
|
||||
|
||||
/* log globally enabled/disabled */
|
||||
set_glog_onlinelog(consolelog);
|
||||
|
||||
+60
-30
@@ -88,7 +88,7 @@ extern "C" {
|
||||
#define NUM_LOG_LEVEL 6 /*!< \brief the number of message levels users have with LOG (OAILOG_DISABLE is not available to user as a level, so it is not included)*/
|
||||
/** @}*/
|
||||
|
||||
#define SET_LOG_OPTION(O) g_log->flag = (g_log->flag | O)
|
||||
#define SET_LOG_OPTION(O) g_log->flag = (g_log->flag | O)
|
||||
#define CLEAR_LOG_OPTION(O) g_log->flag = (g_log->flag & (~O))
|
||||
|
||||
/** @defgroup macros to identify a debug entity
|
||||
@@ -99,28 +99,37 @@ extern "C" {
|
||||
* server.
|
||||
* @brief
|
||||
* @{*/
|
||||
#define DEBUG_PRACH (1<<0)
|
||||
#define DEBUG_RU (1<<1)
|
||||
#define DEBUG_UE_PHYPROC (1<<2)
|
||||
#define DEBUG_LTEESTIM (1<<3)
|
||||
#define DEBUG_DLCELLSPEC (1<<4)
|
||||
#define DEBUG_ULSCH (1<<5)
|
||||
#define DEBUG_RRC (1<<6)
|
||||
#define DEBUG_PDCP (1<<7)
|
||||
#define DEBUG_DFT (1<<8)
|
||||
#define DEBUG_ASN1 (1<<9)
|
||||
#define DEBUG_CTRLSOCKET (1<<10)
|
||||
#define DEBUG_SECURITY (1<<11)
|
||||
#define DEBUG_NAS (1<<12)
|
||||
#define DEBUG_RLC (1<<13)
|
||||
#define DEBUG_DLSCH_DECOD (1<<14)
|
||||
#define UE_TIMING (1<<20)
|
||||
|
||||
#define SET_LOG_DEBUG(B) g_log->debug_mask = (g_log->debug_mask | B)
|
||||
#define CLEAR_LOG_DEBUG(B) g_log->debug_mask = (g_log->debug_mask & (~B))
|
||||
#define FOREACH_FLAG(FLAG_DEF) \
|
||||
FLAG_DEF(PRACH) \
|
||||
FLAG_DEF(UE_PHYPROC) \
|
||||
FLAG_DEF(LTEESTIM) \
|
||||
FLAG_DEF(DLCELLSPEC) \
|
||||
FLAG_DEF(ULSCH) \
|
||||
FLAG_DEF(RRC) \
|
||||
FLAG_DEF(PDCP) \
|
||||
FLAG_DEF(DFT) \
|
||||
FLAG_DEF(ASN1) \
|
||||
FLAG_DEF(CTRLSOCKET) \
|
||||
FLAG_DEF(SECURITY) \
|
||||
FLAG_DEF(NAS) \
|
||||
FLAG_DEF(DLSCH_DECOD) \
|
||||
FLAG_DEF(UE_TIMING) \
|
||||
FLAG_DEF(F1AP)
|
||||
|
||||
#define SET_LOG_DUMP(B) g_log->dump_mask = (g_log->dump_mask | B)
|
||||
#define CLEAR_LOG_DUMP(B) g_log->dump_mask = (g_log->dump_mask & (~B))
|
||||
#define FLAG_BITF(flag) uint64_t DEBUG_##flag: 1;
|
||||
typedef struct {
|
||||
FOREACH_FLAG(FLAG_BITF)
|
||||
} debug_flags_t;
|
||||
|
||||
#define FLAG_TEXT(flag) #flag,
|
||||
static const char *const flag_name[] = {FOREACH_FLAG(FLAG_TEXT) ""};
|
||||
|
||||
#define SET_LOG_DEBUG(B) g_log->debug_mask.B = true
|
||||
#define CLEAR_LOG_DEBUG(B) g_log->debug_mask.B = false
|
||||
|
||||
#define SET_LOG_DUMP(B) g_log->dump_mask.B = true
|
||||
#define CLEAR_LOG_DUMP(B) g_log->dump_mask.B = false
|
||||
|
||||
#define FOREACH_COMP(COMP_DEF) \
|
||||
COMP_DEF(PHY, log) \
|
||||
@@ -215,8 +224,8 @@ typedef struct {
|
||||
char level2string[NUM_LOG_LEVEL];
|
||||
int flag;
|
||||
char *filelog_name;
|
||||
uint64_t debug_mask;
|
||||
uint64_t dump_mask;
|
||||
debug_flags_t debug_mask;
|
||||
debug_flags_t dump_mask;
|
||||
} log_t;
|
||||
|
||||
#ifdef LOG_MAIN
|
||||
@@ -230,7 +239,28 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define FLAG_DEBUG_SET(flag) \
|
||||
if (strcmp(name, #flag) == 0) { \
|
||||
g_log->debug_mask.DEBUG_##flag = val; \
|
||||
return true; \
|
||||
};
|
||||
static inline bool set_log_debug(char *name, bool val)
|
||||
{
|
||||
FOREACH_FLAG(FLAG_DEBUG_SET);
|
||||
printf("Error: setting log debug of %s option, not existing\n", name);
|
||||
return false;
|
||||
}
|
||||
#define FLAG_DUMP_SET(flag) \
|
||||
if (strcmp(name, #flag) == 0) { \
|
||||
g_log->dump_mask.DEBUG_##flag = val; \
|
||||
return true; \
|
||||
};
|
||||
static inline bool set_log_dump(char *name, bool val)
|
||||
{
|
||||
FOREACH_FLAG(FLAG_DUMP_SET);
|
||||
printf("Error: setting log dump of %s option, not existing\n", name);
|
||||
return false;
|
||||
}
|
||||
/*----------------------------------------------------------------------------*/
|
||||
int logInit (void);
|
||||
void logTerm (void);
|
||||
@@ -418,15 +448,15 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
|
||||
/* macro used to dump a buffer or a message as in openair2/RRC/LTE/RRC_eNB.c, replaces LOG_F macro */
|
||||
#define LOG_DUMPMSG(c, f, b, s, x...) \
|
||||
do { \
|
||||
if (g_log->dump_mask & f) \
|
||||
if (g_log->dump_mask.f) \
|
||||
log_dump(c, b, s, LOG_DUMP_CHAR, x); \
|
||||
} while (0)
|
||||
|
||||
/* bitmask dependent macros, to isolate debugging code */
|
||||
#define LOG_DEBUGFLAG(D) (g_log->debug_mask & D)
|
||||
#define LOG_DEBUGFLAG(D) (g_log->debug_mask.D)
|
||||
|
||||
/* bitmask dependent macros, to generate debug file such as matlab file or message dump */
|
||||
#define LOG_DUMPFLAG(D) (g_log->dump_mask & D)
|
||||
#define LOG_DUMPFLAG(D) (g_log->dump_mask.D)
|
||||
|
||||
#define LOG_M(file, vector, data, len, dec, format) \
|
||||
do { \
|
||||
@@ -529,11 +559,11 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
|
||||
} while (0)
|
||||
|
||||
#define nfapi_log(FILE, FNC, LN, COMP, LVL, FMT...)
|
||||
#define LOG_DEBUGFLAG(D) (g_log->debug_mask & D)
|
||||
#define LOG_DUMPFLAG(D) (g_log->dump_mask & D)
|
||||
#define LOG_DEBUGFLAG(D) (g_log->debug_mask.D)
|
||||
#define LOG_DUMPFLAG(D) (g_log->dump_mask.D)
|
||||
#define LOG_DUMPMSG(c, f, b, s, x...) \
|
||||
do { \
|
||||
if (g_log->dump_mask & f) \
|
||||
if (g_log->dump_mask.f) \
|
||||
log_dump(c, b, s, LOG_DUMP_CHAR, x); \
|
||||
} while (0) /* */
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ CMake Error at /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:463 (message):
|
||||
Run:
|
||||
|
||||
```shell
|
||||
sudo apt-get install libxft-dev
|
||||
sudo apt-get install libx11-dev libpng-dev libxft-dev
|
||||
```
|
||||
|
||||
## Run the softmodem
|
||||
|
||||
@@ -25,4 +25,4 @@ multi-rru-clean: ../utils.o ../database.o ../event.o ../configuration.o multi-rr
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f *.o core dump_nack_signal time_meas timeplot
|
||||
rm -f *.o core dump_nack_signal time_meas timeplot multi-rru-clean
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include "utils.h"
|
||||
#include "event.h"
|
||||
#include "database.h"
|
||||
@@ -14,7 +15,8 @@ void usage(void)
|
||||
" -d <database file> this option is mandatory\n"
|
||||
" -ip <host> connect to given IP address (default %s)\n"
|
||||
" -p <port> connect to given port (default %d)\n"
|
||||
" -e <event> event to trace (default VCD_FUNCTION_ENB_DLSCH_ULSCH_SCHEDULER)\n",
|
||||
" -e <event> event to trace (default VCD_FUNCTION_ENB_DLSCH_ULSCH_SCHEDULER)\n"
|
||||
" -s stat mode, print every second min/avg/max + count\n",
|
||||
DEFAULT_REMOTE_IP,
|
||||
DEFAULT_REMOTE_PORT
|
||||
);
|
||||
@@ -34,6 +36,21 @@ struct timespec time_sub(struct timespec a, struct timespec b)
|
||||
return ret;
|
||||
}
|
||||
|
||||
volatile uint64_t acc, count, acc_min, acc_max;
|
||||
|
||||
void *stat_thread(void *_)
|
||||
{
|
||||
while (1) {
|
||||
uint64_t v = acc;
|
||||
uint64_t c = count;
|
||||
uint64_t min = acc_min;
|
||||
uint64_t max = acc_max;
|
||||
acc = acc_min = acc_max = count = 0;
|
||||
printf("%ld %ld %ld [%ld]\n", min, c==0 ? 0 : v/c, max, c);
|
||||
sleepms(1000);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int n, char **v)
|
||||
{
|
||||
char *database_filename = NULL;
|
||||
@@ -49,6 +66,7 @@ int main(int n, char **v)
|
||||
int start_valid = 0;
|
||||
struct timespec start_time, stop_time, delta_time;
|
||||
char *name = "VCD_FUNCTION_ENB_DLSCH_ULSCH_SCHEDULER";
|
||||
int stat_mode = 0;
|
||||
|
||||
for (i = 1; i < n; i++) {
|
||||
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
|
||||
@@ -58,9 +76,13 @@ int main(int n, char **v)
|
||||
if (!strcmp(v[i], "-p"))
|
||||
{ if (i > n-2) usage(); port = atoi(v[++i]); continue; }
|
||||
if (!strcmp(v[i], "-e")) { if (i > n-2) usage(); name = v[++i]; continue; }
|
||||
if (!strcmp(v[i], "-s")) { stat_mode = 1; continue; }
|
||||
usage();
|
||||
}
|
||||
|
||||
if (stat_mode)
|
||||
new_thread(stat_thread, NULL);
|
||||
|
||||
if (database_filename == NULL) {
|
||||
printf("ERROR: provide a database file (-d)\n");
|
||||
exit(1);
|
||||
@@ -96,7 +118,8 @@ int main(int n, char **v)
|
||||
if (e.type != ev_fun)
|
||||
{ printf("unhandled event %d\n", e.type); continue; }
|
||||
on_off = e.e[0].i;
|
||||
printf("yo %d\n", on_off);
|
||||
if (!stat_mode)
|
||||
printf("yo %d\n", on_off);
|
||||
if (on_off == 1) {
|
||||
start_time = e.sending_time;
|
||||
start_valid = 1;
|
||||
@@ -104,11 +127,20 @@ printf("yo %d\n", on_off);
|
||||
}
|
||||
if (on_off != 0) { printf("fatal!\n"); abort(); }
|
||||
if (!start_valid) continue;
|
||||
start_valid = 0;
|
||||
stop_time = e.sending_time;
|
||||
delta_time = time_sub(stop_time, start_time);
|
||||
fprintf(stderr, "%ld\n",
|
||||
delta_time.tv_sec * 1000000000UL + delta_time.tv_nsec);
|
||||
fflush(stderr);
|
||||
if (stat_mode) {
|
||||
uint64_t v = delta_time.tv_sec * 1000000000UL + delta_time.tv_nsec;
|
||||
if (count == 0 || v < acc_min) acc_min = v;
|
||||
if (v > acc_max) acc_max = v;
|
||||
acc += v;
|
||||
count++;
|
||||
} else {
|
||||
fprintf(stderr, "%ld\n",
|
||||
delta_time.tv_sec * 1000000000UL + delta_time.tv_nsec);
|
||||
fflush(stderr);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -72,3 +72,17 @@ byte_array_t cp_str_to_ba(const char* str)
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
char* cp_ba_to_str(const byte_array_t ba)
|
||||
{
|
||||
assert(ba.len > 0);
|
||||
|
||||
const size_t sz = ba.len;
|
||||
char* str = calloc(sz+1, sizeof(char));
|
||||
assert(str != NULL && "Memory exhausted");
|
||||
|
||||
memcpy(str, ba.buf, sz);
|
||||
str[sz] = '\0';
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -42,5 +42,6 @@ void free_byte_array(byte_array_t ba);
|
||||
bool eq_byte_array(const byte_array_t* m0, const byte_array_t* m1);
|
||||
|
||||
byte_array_t cp_str_to_ba(const char* str);
|
||||
char* cp_ba_to_str(const byte_array_t ba);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -251,12 +251,17 @@ void print_threads(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
proccmd_get_threaddata(buf, debug, prnt, NULL);
|
||||
}
|
||||
|
||||
#define FLAG_PRINT_DEBUG_DUMP(flag) \
|
||||
logsdata->lines[i].val[0] = (char *)flag_name[i]; \
|
||||
logsdata->lines[i].val[1] = g_log->debug_mask.DEBUG_##flag ? "true" : "false"; \
|
||||
logsdata->lines[i].val[1] = g_log->dump_mask.DEBUG_##flag ? "true" : "false"; \
|
||||
i++;
|
||||
|
||||
int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfunc_t prnt)
|
||||
{
|
||||
webdatadef_t *logsdata = (webdatadef_t *)data;
|
||||
const mapping *const log_level_names = log_level_names_ptr();
|
||||
const mapping *const log_options = log_option_names_ptr();
|
||||
const mapping *log_maskmap = log_maskmap_ptr();
|
||||
if (strncmp(cmdbuff, "set", 3) == 0) {
|
||||
telnet_printfunc_t printfunc = (prnt != NULL) ? prnt : (telnet_printfunc_t)printf;
|
||||
if (strcasestr(cmdbuff, "loglvl") != NULL) {
|
||||
@@ -291,23 +296,16 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
|
||||
}
|
||||
}
|
||||
if (strcasestr(cmdbuff, "dbgopt") != NULL) {
|
||||
int optbit = map_str_to_int(log_maskmap, logsdata->lines[0].val[0]);
|
||||
if (optbit < 0) {
|
||||
printfunc("debug option %s unknown\n", logsdata->lines[0].val[0]);
|
||||
} else {
|
||||
if (strcmp(logsdata->lines[0].val[1], "true") == 0)
|
||||
SET_LOG_DEBUG(optbit);
|
||||
else
|
||||
CLEAR_LOG_DEBUG(optbit);
|
||||
if (strcmp(logsdata->lines[0].val[2], "true") == 0)
|
||||
SET_LOG_DUMP(optbit);
|
||||
else
|
||||
CLEAR_LOG_DUMP(optbit);
|
||||
printfunc("%s debug %s dump %s\n",
|
||||
logsdata->lines[0].val[0],
|
||||
(strcmp(logsdata->lines[0].val[1], "true") == 0) ? "enabled" : "disabled",
|
||||
(strcmp(logsdata->lines[0].val[2], "true") == 0) ? "enabled" : "disabled");
|
||||
}
|
||||
if (strcmp(logsdata->lines[0].val[1], "true") == 0)
|
||||
if (!set_log_debug(logsdata->lines[0].val[0], strcmp(logsdata->lines[0].val[2], "true") == 0))
|
||||
printfunc("debug option %s unknown\n", logsdata->lines[0].val[0]);
|
||||
if (strcmp(logsdata->lines[0].val[2], "true") == 0)
|
||||
if (!set_log_dump(logsdata->lines[0].val[0], strcmp(logsdata->lines[0].val[2], "true") == 0))
|
||||
printfunc("debug option %s unknown\n", logsdata->lines[0].val[0]);
|
||||
printfunc("%s debug %s dump %s\n",
|
||||
logsdata->lines[0].val[0],
|
||||
(strcmp(logsdata->lines[0].val[1], "true") == 0) ? "enabled" : "disabled",
|
||||
(strcmp(logsdata->lines[0].val[2], "true") == 0) ? "enabled" : "disabled");
|
||||
}
|
||||
if (strcasestr(cmdbuff, "threadsched") != NULL) {
|
||||
unsigned int tid = strtoll(logsdata->lines[0].val[0], NULL, 0);
|
||||
@@ -354,12 +352,9 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
|
||||
snprintf(logsdata->columns[2].coltitle, TELNET_CMD_MAXSIZE, "dump");
|
||||
logsdata->columns[2].coltype = TELNET_CHECKVAL_BOOL;
|
||||
|
||||
for (int i = 0; log_maskmap[i].name != NULL; i++) {
|
||||
logsdata->numlines++;
|
||||
logsdata->lines[i].val[0] = (char *)log_maskmap[i].name;
|
||||
logsdata->lines[i].val[1] = (g_log->debug_mask & log_maskmap[i].value) ? "true" : "false";
|
||||
logsdata->lines[i].val[2] = (g_log->dump_mask & log_maskmap[i].value) ? "true" : "false";
|
||||
}
|
||||
int i = 0;
|
||||
FOREACH_FLAG(FLAG_PRINT_DEBUG_DUMP);
|
||||
logsdata->numlines += i;
|
||||
}
|
||||
|
||||
if (strcasestr(cmdbuff, "logopt") != NULL) {
|
||||
@@ -385,6 +380,14 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define FLAG_PRINT2_DEBUG_DUMP(flag) \
|
||||
prnt("%02i %17.17s %5.5s %5.5s\n", \
|
||||
i, \
|
||||
flag_name[i], \
|
||||
g_log->debug_mask.DEBUG_##flag ? "Y" : "N", \
|
||||
g_log->dump_mask.DEBUG_##flag ? "Y" : "N"); \
|
||||
i++;
|
||||
|
||||
int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
if (buf == NULL) {
|
||||
@@ -422,12 +425,8 @@ int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
}
|
||||
if (strcasestr(buf,"dbgopt") != NULL) {
|
||||
prnt("\n module debug dumpfile\n");
|
||||
const mapping *log_maskmap = log_maskmap_ptr();
|
||||
for (int i=0; log_maskmap[i].name != NULL ; i++) {
|
||||
prnt("%02i %17.17s %5.5s %5.5s\n",i ,log_maskmap[i].name,
|
||||
((g_log->debug_mask & log_maskmap[i].value)?"Y":"N"),
|
||||
((g_log->dump_mask & log_maskmap[i].value)?"Y":"N") );
|
||||
}
|
||||
int i = 0;
|
||||
FOREACH_FLAG(FLAG_PRINT2_DEBUG_DUMP);
|
||||
}
|
||||
if (strcasestr(buf,"config") != NULL) {
|
||||
prnt("Command line arguments:\n");
|
||||
@@ -593,28 +592,16 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
|
||||
}
|
||||
}
|
||||
else if (l == 2 && strcmp(logparam,"debug") == 0){
|
||||
optbit = map_str_to_int(log_maskmap, opt);
|
||||
if (optbit < 0) {
|
||||
int ret = set_log_debug(opt, idx1 > 0);
|
||||
if (!ret)
|
||||
prnt("module %s unknown\n", opt);
|
||||
} else {
|
||||
if (idx1 > 0)
|
||||
SET_LOG_DEBUG(optbit);
|
||||
else
|
||||
CLEAR_LOG_DEBUG(optbit);
|
||||
proccmd_show("dbgopt", debug, prnt);
|
||||
}
|
||||
proccmd_show("dbgopt", debug, prnt);
|
||||
}
|
||||
else if (l == 2 && strcmp(logparam,"dump") == 0){
|
||||
optbit = map_str_to_int(log_maskmap, opt);
|
||||
if (optbit < 0) {
|
||||
int ret = set_log_dump(opt, idx1 > 0);
|
||||
if (!ret)
|
||||
prnt("module %s unknown\n", opt);
|
||||
} else {
|
||||
if (idx1 > 0)
|
||||
SET_LOG_DUMP(optbit);
|
||||
else
|
||||
CLEAR_LOG_DUMP(optbit);
|
||||
proccmd_show("dump", debug, prnt);
|
||||
}
|
||||
proccmd_show("dump", debug, prnt);
|
||||
}
|
||||
if (logparam != NULL) free(logparam);
|
||||
if (opt != NULL) free(opt);
|
||||
|
||||
@@ -997,7 +997,6 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../executables/softmodem-common.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../executables/nr-softmodem.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../executables/nr-gnb.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../executables/rt_profiling.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../executables/nr-uesoftmodem.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../executables/nr-uesoftmodem.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../executables/lte-softmodem.h \
|
||||
|
||||
@@ -194,3 +194,7 @@ Note that CU-UPs are not released from CU-CP internal structures. That means
|
||||
that you have to restart the CU-CP if you want to connect the CU-UP again
|
||||
(e.g., after a crash). The CU-CP might also misfunction during attach if a
|
||||
CU-UP was connected, but disconnected in the meantime.
|
||||
|
||||
# 5. Abnormal conditions
|
||||
|
||||
* The CU-UP goes offline during normal operation (e.g. UEs have a valid PDU Session and are exchanging data on the UP): after restarting the CU-UP, the UP is not restored and the user will notice GTP errors. In this case the UEs have to reconnect.
|
||||
|
||||
@@ -145,8 +145,8 @@ In the last lines:
|
||||
|
||||
## Split-related options (running in a DU)
|
||||
|
||||
See [nFAPI documentation](../L2NFAPI.md) or [Aerial
|
||||
tutorial](../Aerial_FAPI_Split_Tutorial.md) for information about the FAPI
|
||||
See [nFAPI documentation](../nfapi.md) or [Aerial
|
||||
tutorial](../Aerial_FAPI_Split_Tutorial.md) for information about the (n)FAPI
|
||||
split.
|
||||
|
||||
See [F1 documentation](../F1-design.md) for information about the F1 split.
|
||||
|
||||
+2
-1
@@ -57,7 +57,8 @@ There is some general information in the [OpenAirInterface Gitlab Wiki](https://
|
||||
- [How to use the L2 simulator](./L2NFAPI.md)
|
||||
- [How to use the OAI channel simulator](../openair1/SIMULATION/TOOLS/DOC/channel_simulation.md)
|
||||
- [How to use multiple BWPs](./RUN_NR_multiple_BWPs.md)
|
||||
- [How to run OAI-VNF and OAI-PNF](./RUN_NR_NFAPI.md) _Note: does not work currently_
|
||||
- [How to run OAI-VNF and OAI-PNF](./nfapi.md): how to run the nFAPI split,
|
||||
including some general remarks on FAPI/nFAPI.
|
||||
- [How to use the positioning reference signal (PRS)](./RUN_NR_PRS.md)
|
||||
- [How to use device-to-device communication (D2D, 4G)](./d2d_emulator_setup.txt)
|
||||
- [How to run with E2 agent](../openair2/E2AP/README.md)
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
# Procedure to run nFAPI in 5G NR
|
||||
|
||||
## Contributed by 5G Testbed IISc
|
||||
|
||||
### Developers: Gokul S, Mahesh A, Aniq U R
|
||||
|
||||
## Procedure to Build gNB and UE
|
||||
|
||||
The regular commands to build gNB and UE can be used
|
||||
```
|
||||
sudo ./build_oai --gNB --nrUE
|
||||
|
||||
```
|
||||
## Procedure to run NR nFAPI using RF-Simulator
|
||||
|
||||
### Bring up another loopback interface
|
||||
|
||||
If running for the first time on your computer, or you have restarted your computer, bring up another loopback interface with this command:
|
||||
|
||||
sudo ifconfig lo: 127.0.0.2 netmask 255.0.0.0 up
|
||||
|
||||
### VNF command
|
||||
```
|
||||
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf --nfapi VNF --noS1 --phy-test
|
||||
|
||||
```
|
||||
### PNF command
|
||||
```
|
||||
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf --nfapi PNF --rfsim --phy-test --rfsimulator.serveraddr server
|
||||
|
||||
```
|
||||
### UE command
|
||||
```
|
||||
sudo ./nr-uesoftmodem --rfsim --phy-test -d --rfsimulator.serveraddr 127.0.0.1
|
||||
|
||||
```
|
||||
## Procedure to run NR nFAPI using Hardware (tested with USRP x310)
|
||||
|
||||
### VNF command
|
||||
```
|
||||
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf --nfapi VNF --noS1 --phy-test
|
||||
|
||||
```
|
||||
### PNF command
|
||||
```
|
||||
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf --nfapi PNF --phy-test
|
||||
|
||||
```
|
||||
### UE command
|
||||
```
|
||||
sudo ./nr-uesoftmodem --usrp-args "addr=*USRP_ADDRESS*,clock_source=external,time_source=external" --phy-test
|
||||
|
||||
```
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
OAI uses/supports a number of environment variables, documented in the following:
|
||||
|
||||
- `NFAPI_TRACE_LEVEL`: set the nfapi custom logging framework's log level; can be one of `error`, `warn`, `note`, `info`, `debug`
|
||||
- `NFAPI_TRACE_LEVEL`: set the nfapi custom logging framework's log level; can be one of `error`, `warn`, `note`, `info`, `debug`. Default is `warn`.
|
||||
- `NR_AWGN_RESULTS_DIR`: directory containing BLER curves for L2simulator channel modelling in SISO case
|
||||
- `NR_MIMO2x2_AWGN_RESULTS_DIR`: directory containing BLER curves for L2simulator channel modelling in 2x2 MIMO case
|
||||
- `NVRAM_DIR`: directory to read/write NVRAM data in (5G) `nvram` tool; if not defined, will use `PWD` (working directory)
|
||||
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
This document describes the SmallCellForum (SCF) (n)FAPI split in 5G, i.e.,
|
||||
between the MAC/L2 and PHY/L1.
|
||||
|
||||
The interested reader is recommended to read a copy of the SCF 222.10
|
||||
specification ("FAPI"). This includes information on what is P5, P7, and how
|
||||
FAPI works. The currently used version is SCF 222.10.02, with some messages
|
||||
upgraded to SCF 222.10.04 due to bugfixes in the spec. Further information
|
||||
about nFAPI can be found in SCF 225.2.0.
|
||||
|
||||
# Quickstart
|
||||
|
||||
Compile OAI as normal. Start the CN and make sure that the VNF configuration
|
||||
matches the PLMN/IP addresses. Then, run the VNF
|
||||
|
||||
sudo NFAPI_TRACE_LEVEL=info ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.106prb.nfapi.conf --nfapi VNF
|
||||
|
||||
Afterwards, start and connect the PNF
|
||||
|
||||
sudo NFAPI_TRACE_LEVEL=info ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.conf --nfapi PNF --rfsim
|
||||
|
||||
Finally, you can start the UE (observe the radio configuration info in the
|
||||
VNF!)
|
||||
|
||||
sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 -O ue.conf
|
||||
|
||||
You should not observe a difference between nFAPI split and monolithic.
|
||||
|
||||
|
||||
# Status
|
||||
|
||||
All FAPI message can be transferred between VNF and PNF. This is because OAI
|
||||
uses FAPI with its corresponding messages internally, whether a split is in use
|
||||
or not.
|
||||
|
||||
The nFAPI split mode supports any radio configuration that is also supported by
|
||||
the monolithic gNB, with the notable exceptions that only numerologies of 15kHz
|
||||
and 30kHz (mu=0 and mu=1, respectively) are supported.
|
||||
|
||||
The VNF requests to be notified about every slot by the PNF. No delay
|
||||
management is employed as of now; instead, the PNF sends a Slot.indication to
|
||||
the VNF in every slot (in divergence from the nFAPI spec).
|
||||
|
||||
Currently, downlink transmissions work the same in monolithic and nFAPI. In
|
||||
uplink, we observe an increased number of retransmissions, which limits the MCS
|
||||
and hence the achievable throughput (which is limited to 10-20Mbps). We are still
|
||||
debugging the root cause of this.
|
||||
|
||||
After stopping the PNF, you also have to restart the VNF.
|
||||
|
||||
When using RFsim, the system might run slower than in monolithic. This is
|
||||
because the PNF needs to slow down the execution time of a specific slot,
|
||||
because it has to send a Slot.indication to the VNF for scheduling.
|
||||
|
||||
# Configuration
|
||||
|
||||
Both PNF and VNF are run through the `nr-softmodem` executable. The type of
|
||||
mode is switched through the `--nfapi` switch, with options `MONOLITHIC`
|
||||
(default if not provided), `VNF`, `PNF`.
|
||||
|
||||
If the type is `VNF`, you have to modify the `MACRLCs.tr_s_preference`
|
||||
(transport south preference) to `nfapi`. Further, configure these options:
|
||||
|
||||
- `MACRLCs.remote_s_address` (remote south address): IP of the PNF
|
||||
- `MACRLCs.local_s_address` (local south address): IP of the VNF
|
||||
- `MACRLCs.local_s_portc` (local south port for control): VNF's P5 local port
|
||||
- `MACRLCs.remote_s_portc` (remote south port for data): PNF's P5 remote port
|
||||
- `MACRLCs.local_s_portd` (local south port for control): VNF's P5 local port
|
||||
- `MACRLCs.remote_s_portd` (remote south port for data): PNF's P7 remote port
|
||||
|
||||
Note that any L1-specific section (`L1s`, `RUs`,
|
||||
RFsimulator-specific/IF7.2-specific configuration or other radios, if
|
||||
necessary) will be ignored and can be deleted.
|
||||
|
||||
If the type is `PNF`, you have to modify modify the `L1s.tr_n_preference`
|
||||
(transport north preference) to `nfapi`. Further, configure these options:
|
||||
|
||||
- `L1s.remote_n_address` (remote north address): IP of the VNF
|
||||
- `L1s.local_n_address` (local north address): IP of the PNF
|
||||
- `L1s.local_n_portc` (local north port for control): PNF's P5 local port
|
||||
- `L1s.remote_n_portc` (remote north port for control): VNF's P5 remote port
|
||||
- `L1s.local_n_portd` (local north port for data): PNF's P7 local port
|
||||
- `L1s.remote_n_portd` (remote north port for data): VNF's P7 remote port
|
||||
|
||||
Note that this file should contain additional, L1-specific sections (`L1s`,
|
||||
`RUs` RFsimulator-specific/IF7.2-specific configuration or other radios, if
|
||||
necessary).
|
||||
|
||||
To split an existing config file `monolithic.conf` for nFAPI operation, you
|
||||
can proceed as follows:
|
||||
|
||||
- copy `monolithic.conf`, which will be your VNF file (`vnf.conf`)
|
||||
- in `vnf.conf`
|
||||
* modify `MACRLCs` section to configure south-bound nFAPI transport
|
||||
* delete `L1s`, `RUs`, and radio-specific sections.
|
||||
* in `gNBs` section, increase the `ra_ResponseWindow` by one to extend the RA
|
||||
window: this is necessary because the PNF triggers the scheduler in the VNF
|
||||
in advance, which might make the RA window more likely to run out
|
||||
- copy `monolithic.conf`, which will be your PNF file (`pnf.conf`)
|
||||
- in `pnf.conf`
|
||||
* modify `L1s` section to configure north-bound nFAPI transport (make sure it
|
||||
matches the `MACRLCs` section for `vnf.conf`
|
||||
* delete all the `gNBs`, `MACRLCs`, `security` sections (they are not needed)
|
||||
- if you have root-level options in `monolithic.conf`, such as
|
||||
`usrp-tx-thread-config` or `tune-offset`, make sure to to add them to
|
||||
`pnf.conf`, or provide them on the command line for the PNF.
|
||||
- to run, proceed as described in the quick start above.
|
||||
|
||||
Note: all L1-specific options have to be passed to the PNF, and remaining
|
||||
options to the VNF.
|
||||
|
||||
# nFAPI logging system
|
||||
|
||||
nFAPI has its own logging system, independent of OAI's. It can be activated by
|
||||
setting the `NFAPI_TRACE_LEVEL` environment variable to an appropriate value;
|
||||
see [the environment variables documentation](./environment-variables.md) for
|
||||
more info.
|
||||
|
||||
To see the (any) periodical output at the PNF, define `NFAPI_TRACE_LEVEL=info`.
|
||||
This output shows:
|
||||
|
||||
```
|
||||
41056.739654 [I] 3556767424: pnf_p7_slot_ind: [P7:1] msgs ontime 489 thr DL 0.06 UL 0.01 msg late 0 (vtime)
|
||||
```
|
||||
|
||||
The first numbers are timestamps. `pnf_p7_slot_ind` is the name of the
|
||||
functions that prints the output. `[P7:1]` refers to the fact that these are
|
||||
information on P7, of PHY ID 1. Finally, `msgs ontime 489` means that in the
|
||||
last window (since the last print), 489 messages arrived at the PNF in total.
|
||||
The combined throughput of `TX_data.requests` (DL traffic) was 0.06 Mbps; note
|
||||
that this includes SIB1 and other periodical data channels. In UL, 0.01 Mbps
|
||||
have been sent through `RX_data.indication`. `msg late 0` means that 0 packets
|
||||
have been late. _This number is an aggregate over the total runtime_, unlike
|
||||
the other messages. Finally, `(vtime)` is a reminder that the calculations are
|
||||
done over virtual time, i.e., frames/slots as executed by the 5G Systems. For
|
||||
instance, these numbers might be slightly higher or slower in RFsim than in
|
||||
wall-clock time, depending if the system advances faster or slower than
|
||||
wall-clock time.
|
||||
@@ -568,7 +568,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
int ret;
|
||||
LOG_D(PHY,"ENTERED wakeup_rxtx, %d.%d\n",ru_proc->frame_rx,ru_proc->tti_rx);
|
||||
// wake up TX for subframe n+sl_ahead
|
||||
// wake up TX for subframe n+sf_ahead
|
||||
// lock the TX mutex and make sure the thread is ready
|
||||
AssertFatal((ret=pthread_mutex_lock(&L1_proc->mutex)) == 0,"mutex_lock returns %d\n", ret);
|
||||
|
||||
|
||||
@@ -195,6 +195,15 @@ void handle_nr_srs_measurements(const module_id_t module_id,
|
||||
/* forward declarations */
|
||||
void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
|
||||
|
||||
/* TODO these declarations are to be removed */
|
||||
void nr_schedule_dl_tti_req(void) {};
|
||||
void nr_schedule_ul_dci_req() {};
|
||||
void nr_schedule_tx_req() {};
|
||||
void nr_schedule_ul_tti_req() {};
|
||||
void nr_slot_select() {};
|
||||
void NR_UL_indication(NR_UL_IND_t *UL_INFO) {};
|
||||
void gNB_dlsch_ulsch_scheduler() {};
|
||||
|
||||
/*---------------------BMC: timespec helpers -----------------------------*/
|
||||
|
||||
struct timespec min_diff_time = { .tv_sec = 0, .tv_nsec = 0 };
|
||||
|
||||
@@ -1726,7 +1726,8 @@ void *UE_thread(void *arg) {
|
||||
pthread_mutex_unlock(&sync_mutex);
|
||||
*/
|
||||
wait_sync("UE thread");
|
||||
#ifdef NAS_UE
|
||||
|
||||
#ifdef NAS_BUILT_IN_UE
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message(TASK_NAS_UE, 0, INITIALIZE_MESSAGE);
|
||||
itti_send_msg_to_task (TASK_NAS_UE, UE->Mod_id + NB_eNB_INST, message_p);
|
||||
@@ -2089,7 +2090,7 @@ void init_UE_single_thread_stub(int nb_inst) {
|
||||
AssertFatal(PHY_vars_UE_g[i][0]!=NULL,"PHY_vars_UE_g[inst][0] is NULL\n");
|
||||
|
||||
if(NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF) {
|
||||
#ifdef NAS_UE
|
||||
#ifdef NAS_BUILT_IN_UE
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message(TASK_NAS_UE, 0, INITIALIZE_MESSAGE);
|
||||
itti_send_msg_to_task (TASK_NAS_UE, i + NB_eNB_INST, message_p);
|
||||
|
||||
@@ -155,6 +155,12 @@ double cpuf;
|
||||
extern char uecap_xer[1024];
|
||||
char uecap_xer_in=0;
|
||||
|
||||
/* TODO these declarations are to be removed */
|
||||
void nr_schedule_dl_tti_req(void) {};
|
||||
void nr_schedule_ul_dci_req() {};
|
||||
void nr_schedule_tx_req() {};
|
||||
void nr_schedule_ul_tti_req() {};
|
||||
void nr_slot_select() {};
|
||||
|
||||
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
|
||||
* this is very hackish - find a proper solution
|
||||
|
||||
@@ -172,6 +172,7 @@ int main(int argc, char **argv)
|
||||
MessageDef *msg = RCconfig_NR_CU_E1(&e1type);
|
||||
AssertFatal(msg != NULL, "Send init to task for E1AP UP failed\n");
|
||||
itti_send_msg_to_task(TASK_CUUP_E1, 0, msg);
|
||||
LOG_D(E1AP, "Send E1AP REGISTER REQ to TASK_CUUP_E1\n");
|
||||
|
||||
#ifdef E2_AGENT
|
||||
//////////////////////////////////
|
||||
|
||||
+18
-37
@@ -36,7 +36,6 @@
|
||||
#include "assertions.h"
|
||||
#include <common/utils/LOG/log.h>
|
||||
#include <common/utils/system.h>
|
||||
#include "rt_profiling.h"
|
||||
|
||||
#include "PHY/types.h"
|
||||
|
||||
@@ -91,12 +90,6 @@ static void tx_func(processingData_L1tx_t *info)
|
||||
int slot_tx = info->slot;
|
||||
int frame_rx = info->frame_rx;
|
||||
int slot_rx = info->slot_rx;
|
||||
int64_t absslot_tx = info->timestamp_tx / info->gNB->frame_parms.get_samples_per_slot(slot_tx, &info->gNB->frame_parms);
|
||||
int64_t absslot_rx = absslot_tx - info->gNB->RU_list[0]->sl_ahead;
|
||||
if (absslot_rx < 0) {
|
||||
LOG_W(NR_PHY, "Slot ahead %d is larger than absslot_tx %ld. Cannot start TX yet.\n", info->gNB->RU_list[0]->sl_ahead, absslot_tx);
|
||||
return;
|
||||
}
|
||||
LOG_D(NR_PHY, "%d.%d running tx_func\n", frame_tx, slot_tx);
|
||||
PHY_VARS_gNB *gNB = info->gNB;
|
||||
module_id_t module_id = gNB->Mod_id;
|
||||
@@ -134,8 +127,6 @@ static void tx_func(processingData_L1tx_t *info)
|
||||
if (tx_slot_type == NR_DOWNLINK_SLOT || tx_slot_type == NR_MIXED_SLOT || get_softmodem_params()->continuous_tx) {
|
||||
start_meas(&info->gNB->phy_proc_tx);
|
||||
phy_procedures_gNB_TX(info, frame_tx, slot_tx, 1);
|
||||
const int rt_prof_idx = absslot_rx % RT_PROF_DEPTH;
|
||||
clock_gettime(CLOCK_MONOTONIC, &info->gNB->rt_L1_profiling.return_L1_TX[rt_prof_idx]);
|
||||
|
||||
PHY_VARS_gNB *gNB = info->gNB;
|
||||
processingData_RU_t syncMsgRU;
|
||||
@@ -147,9 +138,14 @@ static void tx_func(processingData_L1tx_t *info)
|
||||
ru_tx_func((void *)&syncMsgRU);
|
||||
stop_meas(&info->gNB->phy_proc_tx);
|
||||
}
|
||||
/* this thread is done with the sched_info, decrease the reference counter */
|
||||
LOG_D(NR_PHY, "Calling deref_sched_response for id %d (tx_func) in %d.%d\n", info->sched_response_id, frame_tx, slot_tx);
|
||||
deref_sched_response(info->sched_response_id);
|
||||
|
||||
if (NFAPI_MODE == NFAPI_MONOLITHIC) {
|
||||
/* this thread is done with the sched_info, decrease the reference counter.
|
||||
* This only applies for monolithic; in the PNF, the memory is allocated in
|
||||
* a ring buffer that should never be overwritten (one frame duration). */
|
||||
LOG_D(NR_PHY, "Calling deref_sched_response for id %d (tx_func) in %d.%d\n", info->sched_response_id, frame_tx, slot_tx);
|
||||
deref_sched_response(info->sched_response_id);
|
||||
}
|
||||
}
|
||||
|
||||
void *L1_rx_thread(void *arg)
|
||||
@@ -187,24 +183,6 @@ static void rx_func(processingData_L1_t *info)
|
||||
int frame_rx = info->frame_rx;
|
||||
int slot_rx = info->slot_rx;
|
||||
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
|
||||
int cumul_samples = gNB->frame_parms.get_samples_per_slot(0, &gNB->frame_parms);
|
||||
int i = 1;
|
||||
for (; i < gNB->frame_parms.slots_per_subframe / 2; i++)
|
||||
cumul_samples += gNB->frame_parms.get_samples_per_slot(i, &gNB->frame_parms);
|
||||
int samples = cumul_samples / i;
|
||||
int64_t absslot_tx = info->timestamp_tx / samples;
|
||||
int64_t absslot_rx = absslot_tx - gNB->RU_list[0]->sl_ahead;
|
||||
int rt_prof_idx = absslot_rx % RT_PROF_DEPTH;
|
||||
clock_gettime(CLOCK_MONOTONIC, &info->gNB->rt_L1_profiling.start_L1_RX[rt_prof_idx]);
|
||||
|
||||
// *******************************************************************
|
||||
|
||||
if (NFAPI_MODE == NFAPI_MODE_PNF) {
|
||||
// I am a PNF and I need to let nFAPI know that we have a (sub)frame tick
|
||||
// LOG_D(PHY, "oai_nfapi_slot_ind(frame:%u, slot:%d) ********\n", frame_rx, slot_rx);
|
||||
handle_nr_slot_ind(frame_rx, slot_rx);
|
||||
}
|
||||
// ****************************************
|
||||
|
||||
// RX processing
|
||||
int rx_slot_type = nr_slot_select(cfg, frame_rx, slot_rx);
|
||||
@@ -253,7 +231,6 @@ static void rx_func(processingData_L1_t *info)
|
||||
#endif
|
||||
}
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &info->gNB->rt_L1_profiling.return_L1_RX[rt_prof_idx]);
|
||||
}
|
||||
|
||||
static size_t dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output, size_t outputlen) {
|
||||
@@ -331,7 +308,13 @@ void *nrL1_stats_thread(void *param) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void init_gNB_Tpool(int inst) {
|
||||
void init_gNB_Tpool(int inst)
|
||||
{
|
||||
AssertFatal(NFAPI_MODE == NFAPI_MODE_PNF || NFAPI_MODE == NFAPI_MONOLITHIC,
|
||||
"illegal NFAPI_MODE %d (%s): it cannot have an L1\n",
|
||||
NFAPI_MODE,
|
||||
nfapi_get_strmode());
|
||||
|
||||
PHY_VARS_gNB *gNB;
|
||||
gNB = RC.gNB[inst];
|
||||
gNB_L1_proc_t *proc = &gNB->proc;
|
||||
@@ -364,8 +347,7 @@ void init_gNB_Tpool(int inst) {
|
||||
// this will be removed when the msgDataTx is not necessary anymore
|
||||
gNB->msgDataTx = msgDataTx;
|
||||
|
||||
if ((!get_softmodem_params()->emulate_l1) && (!IS_SOFTMODEM_NOSTATS) && (NFAPI_MODE != NFAPI_MODE_VNF)
|
||||
&& (NFAPI_MODE != NFAPI_MODE_AERIAL))
|
||||
if (!IS_SOFTMODEM_NOSTATS)
|
||||
threadCreate(&proc->L1_stats_thread, nrL1_stats_thread, (void *)gNB, "L1_stats", -1, OAI_PRIORITY_RT_LOW);
|
||||
}
|
||||
|
||||
@@ -384,8 +366,7 @@ void term_gNB_Tpool(int inst) {
|
||||
abortNotifiedFIFO(&gNB->L1_rx_out);
|
||||
|
||||
gNB_L1_proc_t *proc = &gNB->proc;
|
||||
if (!get_softmodem_params()->emulate_l1)
|
||||
pthread_join(proc->L1_stats_thread, NULL);
|
||||
pthread_join(proc->L1_stats_thread, NULL);
|
||||
}
|
||||
|
||||
/// eNB kept in function name for nffapi calls, TO FIX
|
||||
@@ -393,7 +374,7 @@ void init_eNB_afterRU(void) {
|
||||
int inst,ru_id,i,aa;
|
||||
PHY_VARS_gNB *gNB;
|
||||
|
||||
for (inst=0; inst<RC.nb_nr_inst; inst++) {
|
||||
for (inst=0; inst<RC.nb_nr_L1_inst; inst++) {
|
||||
gNB = RC.gNB[inst];
|
||||
|
||||
phy_init_nr_gNB(gNB);
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "common/utils/assertions.h"
|
||||
#include "common/utils/system.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "rt_profiling.h"
|
||||
|
||||
#include "radio/COMMON/common_lib.h"
|
||||
#include "radio/ETHERNET/ethernet_lib.h"
|
||||
@@ -69,7 +68,6 @@ static int DEFRUTPCORES[] = {-1,-1,-1,-1};
|
||||
#include <nfapi/oai_integration/vendor_ext.h>
|
||||
#include "executables/nr-softmodem-common.h"
|
||||
|
||||
int sl_ahead;
|
||||
static void NRRCconfig_RU(configmodule_interface_t *cfg);
|
||||
|
||||
/*************************************************************/
|
||||
@@ -1038,15 +1036,6 @@ void ru_tx_func(void *param)
|
||||
int print_frame = 8;
|
||||
char filename[40];
|
||||
|
||||
int cumul_samples = fp->get_samples_per_slot(0, fp);
|
||||
int i = 1;
|
||||
for (; i < fp->slots_per_subframe / 2; i++)
|
||||
cumul_samples += fp->get_samples_per_slot(i, fp);
|
||||
int samples = cumul_samples / i;
|
||||
int64_t absslot_tx = info->timestamp_tx / samples;
|
||||
int64_t absslot_rx = absslot_tx - ru->sl_ahead;
|
||||
int rt_prof_idx = absslot_rx % RT_PROF_DEPTH;
|
||||
clock_gettime(CLOCK_MONOTONIC,&ru->rt_ru_profiling.start_RU_TX[rt_prof_idx]);
|
||||
// do TX front-end processing if needed (precoding and/or IDFTs)
|
||||
if (ru->feptx_prec)
|
||||
ru->feptx_prec(ru,frame_tx,slot_tx);
|
||||
@@ -1093,11 +1082,6 @@ void ru_tx_func(void *param)
|
||||
}//for (i=0; i<ru->nb_tx; i++)
|
||||
}//if(frame_tx == print_frame)
|
||||
}//else emulate_rf
|
||||
clock_gettime(CLOCK_MONOTONIC,&ru->rt_ru_profiling.return_RU_TX[rt_prof_idx]);
|
||||
struct timespec *t0=&ru->rt_ru_profiling.start_RU_TX[rt_prof_idx];
|
||||
struct timespec *t1=&ru->rt_ru_profiling.return_RU_TX[rt_prof_idx];
|
||||
|
||||
LOG_D(PHY,"rt_prof_idx %d : RU_TX time %d\n",rt_prof_idx,(int)(1e9 * (t1->tv_sec - t0->tv_sec) + (t1->tv_nsec-t0->tv_nsec)));
|
||||
}
|
||||
|
||||
void *ru_thread(void *param)
|
||||
@@ -1216,29 +1200,7 @@ void *ru_thread(void *param)
|
||||
struct timespec slot_start;
|
||||
clock_gettime(CLOCK_MONOTONIC, &slot_start);
|
||||
|
||||
struct timespec slot_duration;
|
||||
slot_duration.tv_sec = 0;
|
||||
//slot_duration.tv_nsec = 0.5e6;
|
||||
slot_duration.tv_nsec = 0.5e6;
|
||||
|
||||
|
||||
|
||||
while (!oai_exit) {
|
||||
|
||||
if (NFAPI_MODE==NFAPI_MODE_VNF || NFAPI_MODE == NFAPI_MODE_AERIAL ) {
|
||||
// We should make a VNF main loop with proper tasks calls in case of VNF
|
||||
slot_start = timespec_add(slot_start,slot_duration);
|
||||
struct timespec curr_time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &curr_time);
|
||||
struct timespec sleep_time;
|
||||
|
||||
if((slot_start.tv_sec > curr_time.tv_sec) ||
|
||||
(slot_start.tv_sec == curr_time.tv_sec && slot_start.tv_nsec > curr_time.tv_nsec)){
|
||||
sleep_time = timespec_sub(slot_start,curr_time);
|
||||
usleep(sleep_time.tv_nsec * 1e-3);
|
||||
}
|
||||
}
|
||||
|
||||
if (slot==(fp->slots_per_frame-1)) {
|
||||
slot=0;
|
||||
frame++;
|
||||
@@ -1273,9 +1235,6 @@ void *ru_thread(void *param)
|
||||
proc->timestamp_tx += fp->get_samples_per_slot(i % fp->slots_per_frame, fp);
|
||||
proc->tti_tx = (proc->tti_rx + ru->sl_ahead) % fp->slots_per_frame;
|
||||
proc->frame_tx = proc->tti_rx > proc->tti_tx ? (proc->frame_rx + 1) & 1023 : proc->frame_rx;
|
||||
int64_t absslot_rx = proc->timestamp_rx/fp->get_samples_per_slot(proc->tti_rx,fp);
|
||||
int rt_prof_idx = absslot_rx % RT_PROF_DEPTH;
|
||||
clock_gettime(CLOCK_MONOTONIC,&ru->rt_ru_profiling.return_RU_south_in[rt_prof_idx]);
|
||||
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,
|
||||
@@ -1321,7 +1280,6 @@ void *ru_thread(void *param)
|
||||
rx_tti_busy[proc->tti_rx % RU_RX_SLOT_DEPTH] = true;
|
||||
ru->feprx(ru,proc->tti_rx);
|
||||
LOG_D(NR_PHY, "Setting %d.%d (%d) to busy\n", proc->frame_rx, proc->tti_rx, proc->tti_rx % RU_RX_SLOT_DEPTH);
|
||||
clock_gettime(CLOCK_MONOTONIC,&ru->rt_ru_profiling.return_RU_feprx[rt_prof_idx]);
|
||||
//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);
|
||||
gNBscopeCopy(RC.gNB[0],
|
||||
@@ -1352,15 +1310,10 @@ void *ru_thread(void *param)
|
||||
proc->frame_rx,
|
||||
proc->tti_rx);
|
||||
}
|
||||
clock_gettime(CLOCK_MONOTONIC,&ru->rt_ru_profiling.return_RU_prachrx[rt_prof_idx]);
|
||||
free_nr_ru_prach_entry(ru,prach_id);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 0);
|
||||
} // end if (prach_id > 0)
|
||||
} // end if (ru->feprx)
|
||||
else {
|
||||
memset(&ru->rt_ru_profiling.return_RU_feprx[rt_prof_idx],0,sizeof(struct timespec));
|
||||
memset(&ru->rt_ru_profiling.return_RU_prachrx[rt_prof_idx],0,sizeof(struct timespec));
|
||||
}
|
||||
} // end if (slot_type == NR_UPLINK_SLOT || slot_type == NR_MIXED_SLOT) {
|
||||
#endif
|
||||
|
||||
|
||||
+14
-11
@@ -678,26 +678,29 @@ int main( int argc, char **argv ) {
|
||||
|
||||
#endif // E2_AGENT
|
||||
|
||||
// wait for F1 Setup Response before starting L1 for real
|
||||
if (NFAPI_MODE != NFAPI_MODE_PNF && (NODE_IS_DU(node_type) || NODE_IS_MONOLITHIC(node_type)))
|
||||
wait_f1_setup_response();
|
||||
|
||||
if (RC.nb_RU > 0)
|
||||
start_NR_RU();
|
||||
|
||||
#ifdef ENABLE_AERIAL
|
||||
gNB_MAC_INST *nrmac = RC.nrmac[0];
|
||||
nvIPC_Init(nrmac->nvipc_params_s);
|
||||
#endif
|
||||
|
||||
for (int idx = 0; idx < RC.nb_nr_L1_inst; idx++)
|
||||
RC.gNB[idx]->if_inst->sl_ahead = sl_ahead;
|
||||
|
||||
if (NFAPI_MODE==NFAPI_MODE_PNF) {
|
||||
wait_nfapi_init("main?");
|
||||
}
|
||||
|
||||
// wait for F1 Setup Response before starting L1 for real
|
||||
if (NODE_IS_DU(node_type) || NODE_IS_MONOLITHIC(node_type))
|
||||
wait_f1_setup_response();
|
||||
|
||||
if (RC.nb_RU > 0)
|
||||
start_NR_RU();
|
||||
#ifdef ENABLE_AERIAL
|
||||
gNB_MAC_INST *nrmac = RC.nrmac[0];
|
||||
nvIPC_Init(nrmac->nvipc_params_s);
|
||||
#endif
|
||||
if (RC.nb_nr_L1_inst > 0) {
|
||||
wait_RUs();
|
||||
// once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration)
|
||||
|
||||
for (int idx=0;idx<RC.nb_nr_L1_inst;idx++) RC.gNB[idx]->if_inst->sl_ahead = sl_ahead;
|
||||
if (IS_SOFTMODEM_DOSCOPE || IS_SOFTMODEM_IMSCOPE_ENABLED) {
|
||||
sleep(1);
|
||||
scopeParms_t p;
|
||||
|
||||
+20
-14
@@ -190,17 +190,21 @@ void init_nrUE_standalone_thread(int ue_idx)
|
||||
pthread_setname_np(phy_thread, "oai:nrue-stand-phy");
|
||||
}
|
||||
|
||||
static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot)
|
||||
static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn, int slot)
|
||||
{
|
||||
struct sfn_slot_s sfn_slot = {.sfn = sfn, .slot = slot};
|
||||
nfapi_nr_rach_indication_t *rach_ind = unqueue_matching(&nr_rach_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot);
|
||||
nfapi_nr_dl_tti_request_t *dl_tti_request = get_queue(&nr_dl_tti_req_queue);
|
||||
nfapi_nr_ul_dci_request_t *ul_dci_request = get_queue(&nr_ul_dci_req_queue);
|
||||
|
||||
for (int i = 0; i < NR_MAX_HARQ_PROCESSES; i++) {
|
||||
LOG_D(NR_MAC, "Try to get a ul_tti_req by matching CRC active SFN %d/SLOT %d from queue with %lu items\n",
|
||||
NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn_slot),
|
||||
NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn_slot), nr_ul_tti_req_queue.num_items);
|
||||
nfapi_nr_ul_tti_request_t *ul_tti_request_crc = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn_slot);
|
||||
LOG_D(NR_MAC,
|
||||
"Try to get a ul_tti_req by matching CRC active sfn/slot %d.%d from queue with %lu items\n",
|
||||
sfn,
|
||||
slot,
|
||||
nr_ul_tti_req_queue.num_items);
|
||||
struct sfn_slot_s sfn_sf = {.sfn = mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn, .slot = mac->nr_ue_emul_l1.harq[i].active_ul_harq_slot };
|
||||
nfapi_nr_ul_tti_request_t *ul_tti_request_crc = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_sf);
|
||||
if (ul_tti_request_crc && ul_tti_request_crc->n_pdus > 0) {
|
||||
check_and_process_dci(NULL, NULL, NULL, ul_tti_request_crc);
|
||||
free_and_zero(ul_tti_request_crc);
|
||||
@@ -216,11 +220,11 @@ static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot)
|
||||
free_and_zero(rach_ind);
|
||||
}
|
||||
if (dl_tti_request) {
|
||||
int dl_tti_sfn_slot = NFAPI_SFNSLOT2HEX(dl_tti_request->SFN, dl_tti_request->Slot);
|
||||
nfapi_nr_tx_data_request_t *tx_data_request = unqueue_matching(&nr_tx_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &dl_tti_sfn_slot);
|
||||
struct sfn_slot_s sfn_slot = {.sfn = dl_tti_request->SFN, .slot = dl_tti_request->Slot};
|
||||
nfapi_nr_tx_data_request_t *tx_data_request = unqueue_matching(&nr_tx_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot);
|
||||
if (!tx_data_request) {
|
||||
LOG_E(NR_MAC, "[%d %d] No corresponding tx_data_request for given dl_tti_request sfn/slot\n",
|
||||
NFAPI_SFNSLOT2SFN(dl_tti_sfn_slot), NFAPI_SFNSLOT2SLOT(dl_tti_sfn_slot));
|
||||
LOG_E(NR_MAC, "[%d.%d] No corresponding tx_data_request for given dl_tti_request sfn/slot\n",
|
||||
dl_tti_request->SFN, dl_tti_request->Slot);
|
||||
if (get_softmodem_params()->nsa)
|
||||
save_nr_measurement_info(dl_tti_request);
|
||||
free_and_zero(dl_tti_request);
|
||||
@@ -262,7 +266,8 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
for (int i = 0; i < NR_MAX_HARQ_PROCESSES; i++) {
|
||||
mac->nr_ue_emul_l1.harq[i].active = false;
|
||||
mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn_slot = -1;
|
||||
mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn = -1;
|
||||
mac->nr_ue_emul_l1.harq[i].active_ul_harq_slot = -1;
|
||||
}
|
||||
|
||||
while (!oai_exit) {
|
||||
@@ -285,8 +290,9 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
|
||||
free_and_zero(ch_info);
|
||||
}
|
||||
|
||||
frame_t frame = NFAPI_SFNSLOT2SFN(sfn_slot);
|
||||
int slot = NFAPI_SFNSLOT2SLOT(sfn_slot);
|
||||
int mu = 1; // NR-UE emul-L1 is hardcoded to 30kHZ, see check_and_process_dci()
|
||||
frame_t frame = NFAPI_SFNSLOTDEC2SFN(mu, sfn_slot);
|
||||
int slot = NFAPI_SFNSLOTDEC2SLOT(mu, sfn_slot);
|
||||
if (sfn_slot == last_sfn_slot) {
|
||||
LOG_D(NR_MAC, "repeated sfn_sf = %d.%d\n",
|
||||
frame, slot);
|
||||
@@ -300,7 +306,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
|
||||
if (IS_SA_MODE(get_softmodem_params()) && mac->mib == NULL) {
|
||||
LOG_D(NR_MAC, "We haven't gotten MIB. Lets see if we received it\n");
|
||||
nr_ue_dl_indication(&mac->dl_info);
|
||||
process_queued_nr_nfapi_msgs(mac, sfn_slot);
|
||||
process_queued_nr_nfapi_msgs(mac, frame, slot);
|
||||
}
|
||||
|
||||
int CC_id = 0;
|
||||
@@ -340,7 +346,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
|
||||
LOG_D(NR_MAC, "Slot %d. calling nr_ue_ul_ind()\n", ul_info.slot);
|
||||
nr_ue_ul_scheduler(mac, &ul_info);
|
||||
}
|
||||
process_queued_nr_nfapi_msgs(mac, sfn_slot);
|
||||
process_queued_nr_nfapi_msgs(mac, frame, slot);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,6 @@ nrUE_params_t nrUE_params = {0};
|
||||
pthread_cond_t nfapi_sync_cond;
|
||||
pthread_mutex_t nfapi_sync_mutex;
|
||||
int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
|
||||
int sf_ahead = 6; //??? value ???
|
||||
pthread_cond_t sync_cond;
|
||||
pthread_mutex_t sync_mutex;
|
||||
int sync_var=-1; //!< protected by mutex \ref sync_mutex.
|
||||
@@ -573,6 +572,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
free_nrLDPC_coding_interface(&nrLDPC_coding_interface);
|
||||
free(pckg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*! \file rt_profiling.h
|
||||
* \brief Definitions for proflling real-time scheduling
|
||||
* \author
|
||||
* \date 2022
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email:
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#ifndef TIME_PROFILING_H
|
||||
#define TIME_PROFILING_H
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
// depth of trace in slots
|
||||
#define RT_PROF_DEPTH 100
|
||||
typedef struct {
|
||||
int64_t absslot_rx[RT_PROF_DEPTH];
|
||||
struct timespec return_RU_south_in[RT_PROF_DEPTH];
|
||||
struct timespec return_RU_feprx[RT_PROF_DEPTH];
|
||||
struct timespec return_RU_prachrx[RT_PROF_DEPTH];
|
||||
struct timespec return_RU_pushL1[RT_PROF_DEPTH];
|
||||
struct timespec start_RU_TX[RT_PROF_DEPTH];
|
||||
struct timespec return_RU_TX[RT_PROF_DEPTH];
|
||||
} rt_ru_profiling_t;
|
||||
|
||||
typedef struct {
|
||||
int64_t absslot_ux[RT_PROF_DEPTH];
|
||||
struct timespec start_L1_RX[RT_PROF_DEPTH];
|
||||
struct timespec return_L1_RX[RT_PROF_DEPTH];
|
||||
struct timespec start_L1_TX[RT_PROF_DEPTH];
|
||||
struct timespec return_L1_TX[RT_PROF_DEPTH];
|
||||
struct timespec return_L1_prachrx[RT_PROF_DEPTH];
|
||||
struct timespec return_L1_puschL1[RT_PROF_DEPTH];
|
||||
} rt_L1_profiling_t;
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -352,7 +352,6 @@ void set_softmodem_sighandler(void);
|
||||
extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
extern int usrp_tx_thread;
|
||||
extern int sl_ahead;
|
||||
extern int sf_ahead;
|
||||
extern int oai_exit;
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ void *aerial_vnf_nr_p7_config_init(void *ptr)
|
||||
init_queue(&gnb_rx_ind_queue);
|
||||
init_queue(&gnb_crc_ind_queue);
|
||||
init_queue(&gnb_uci_ind_queue);
|
||||
init_queue(&gnb_slot_ind_queue);
|
||||
|
||||
p7_vnf->config->port = p7_vnf->local_port;
|
||||
p7_vnf->config->sync_indication = NULL;
|
||||
@@ -335,12 +334,6 @@ int aerial_nr_config_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_co
|
||||
int aerial_nr_start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_start_response_scf_t *resp)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Received NFAPI_START_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
|
||||
vnf_info *vnf = (vnf_info *)(config->user_data);
|
||||
pnf_info *pnf = vnf->pnfs;
|
||||
phy_info *phy = pnf->phys;
|
||||
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
|
||||
|
||||
nfapi_vnf_p7_add_pnf((p7_vnf->config), phy->remote_addr, phy->remote_port, phy->id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -93,56 +93,17 @@ int aerial_phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind)
|
||||
return 1;
|
||||
}
|
||||
|
||||
NR_Sched_Rsp_t g_sched_resp;
|
||||
void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, sub_frame_t slot, NR_Sched_Rsp_t* sched_info);
|
||||
int oai_fapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req);
|
||||
int oai_fapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req);
|
||||
int oai_fapi_tx_data_req(nfapi_nr_tx_data_request_t* tx_data_req);
|
||||
int oai_fapi_ul_dci_req(nfapi_nr_ul_dci_request_t* ul_dci_req);
|
||||
int oai_fapi_send_end_request(int cell, uint32_t frame, uint32_t slot);
|
||||
|
||||
int trigger_scheduler(nfapi_nr_slot_indication_scf_t *slot_ind)
|
||||
{
|
||||
|
||||
NR_UL_IND_t ind = {.frame = slot_ind->sfn, .slot = slot_ind->slot, };
|
||||
NR_UL_indication(&ind);
|
||||
// Call into the scheduler (this is hardcoded and should be init properly!)
|
||||
// memset(sched_resp, 0, sizeof(*sched_resp));
|
||||
gNB_dlsch_ulsch_scheduler(0, slot_ind->sfn, slot_ind->slot, &g_sched_resp);
|
||||
|
||||
bool send_slt_resp = false;
|
||||
if (g_sched_resp.DL_req.dl_tti_request_body.nPDUs> 0) {
|
||||
oai_fapi_dl_tti_req(&g_sched_resp.DL_req);
|
||||
send_slt_resp = true;
|
||||
}
|
||||
if (g_sched_resp.UL_tti_req.n_pdus > 0) {
|
||||
oai_fapi_ul_tti_req(&g_sched_resp.UL_tti_req);
|
||||
send_slt_resp = true;
|
||||
}
|
||||
if (g_sched_resp.TX_req.Number_of_PDUs > 0) {
|
||||
oai_fapi_tx_data_req(&g_sched_resp.TX_req);
|
||||
send_slt_resp = true;
|
||||
}
|
||||
if (g_sched_resp.UL_dci_req.numPdus > 0) {
|
||||
oai_fapi_ul_dci_req(&g_sched_resp.UL_dci_req);
|
||||
send_slt_resp = true;
|
||||
}
|
||||
if (send_slt_resp) {
|
||||
oai_fapi_send_end_request(0,slot_ind->sfn, slot_ind->slot);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
extern int trigger_scheduler(nfapi_nr_slot_indication_scf_t *slot_ind);
|
||||
|
||||
int aerial_phy_nr_slot_indication(nfapi_nr_slot_indication_scf_t *ind)
|
||||
{
|
||||
uint8_t vnf_slot_ahead = 0;
|
||||
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);
|
||||
LOG_D(MAC, "VNF SFN/Slot %d.%d \n", vnf_sfn, vnf_slot);
|
||||
// printf( "VNF SFN/Slot %d.%d \n", vnf_sfn, vnf_slot);
|
||||
LOG_D(MAC, "VNF SFN/Slot %d.%d \n", ind->sfn, ind->slot);
|
||||
trigger_scheduler(ind);
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -25,4 +25,3 @@ queue_t gnb_rach_ind_queue;
|
||||
queue_t gnb_rx_ind_queue;
|
||||
queue_t gnb_crc_ind_queue;
|
||||
queue_t gnb_uci_ind_queue;
|
||||
queue_t gnb_slot_ind_queue;
|
||||
|
||||
@@ -6,4 +6,3 @@ extern queue_t gnb_rach_ind_queue;
|
||||
extern queue_t gnb_rx_ind_queue;
|
||||
extern queue_t gnb_crc_ind_queue;
|
||||
extern queue_t gnb_uci_ind_queue;
|
||||
extern queue_t gnb_slot_ind_queue;
|
||||
|
||||
@@ -544,7 +544,6 @@ int param_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfapi
|
||||
nfapi_resp.num_tlv++;
|
||||
nfapi_pnf_param_resp(config, &nfapi_resp);
|
||||
printf("[PNF] Sent NFAPI_PARAM_RESPONSE phy_id:%d number_of_tlvs:%u\n", req->header.phy_id, nfapi_resp.num_tlv);
|
||||
printf("[PNF] param request .. exit\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -763,7 +762,6 @@ int nr_param_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nf
|
||||
nfapi_nr_pnf_param_resp(config, &nfapi_resp);
|
||||
|
||||
printf("[PNF] Sent NFAPI_PNF_PARAM_RESPONSE phy_id:%d number_of_tlvs:%u\n", req->header.phy_id, nfapi_resp.num_tlv);
|
||||
printf("[PNF] param request .. exit\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1102,38 +1100,13 @@ void pnf_nr_phy_deallocate_p7_vendor_ext(void *header)
|
||||
free(header);
|
||||
}
|
||||
|
||||
notifiedFIFO_elt_t *l1tx_message_extract(PHY_VARS_gNB *gNB, int frame, int slot) {
|
||||
notifiedFIFO_elt_t *res;
|
||||
|
||||
//TODO: This needs to be reworked for nfapi to work
|
||||
res = pullNotifiedFIFO(&gNB->L1_tx_free);
|
||||
return res;
|
||||
}
|
||||
|
||||
int pnf_phy_ul_dci_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_nr_ul_dci_request_t *req) {
|
||||
extern void nr_schedule_ul_dci_req(PHY_VARS_gNB *gNB, nfapi_nr_ul_dci_request_t *UL_dci_req);
|
||||
int pnf_phy_ul_dci_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_nr_ul_dci_request_t *req)
|
||||
{
|
||||
DevAssert(RC.gNB != NULL && RC.gNB[0] != NULL);
|
||||
PHY_VARS_gNB *gNB = RC.gNB[0]; // phy_inst?
|
||||
|
||||
// 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);
|
||||
|
||||
struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
|
||||
|
||||
// extract the next available thread message (priority to message with current slot, then free message)
|
||||
notifiedFIFO_elt_t *res;
|
||||
res = l1tx_message_extract(gNB, req->SFN, req->Slot);
|
||||
processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res);
|
||||
|
||||
if (proc ==NULL)
|
||||
proc = &gNB->proc.L1_proc;
|
||||
|
||||
if (req->numPdus > 0) {
|
||||
for (int i=0; i<req->numPdus; i++) {
|
||||
if (req->ul_dci_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE) // only possible value 0: PDCCH PDU
|
||||
msgTx->ul_pdcch_pdu[i] = req->ul_dci_pdu_list[i];
|
||||
else
|
||||
LOG_E(PHY,"[PNF] UL_DCI_REQ sfn_slot:%d PDU[%d] - unknown pdu type:%d\n", NFAPI_SFNSLOT2DEC(req->SFN, req->Slot), req->numPdus-1, req->ul_dci_pdu_list[req->numPdus-1].PDUType);
|
||||
}
|
||||
}
|
||||
|
||||
pushNotifiedFIFO(&gNB->L1_tx_filled, res);
|
||||
nr_schedule_ul_dci_req(gNB, req);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1168,84 +1141,16 @@ int pnf_phy_hi_dci0_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfa
|
||||
}
|
||||
|
||||
|
||||
int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_nr_dl_tti_request_t *req) {
|
||||
if (RC.ru == 0) {
|
||||
return -1;
|
||||
}
|
||||
// from dl_tti_req_fn fptr
|
||||
extern void nr_schedule_dl_tti_req(PHY_VARS_gNB *gNB, nfapi_nr_dl_tti_request_t *DL_req);
|
||||
int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_nr_dl_tti_request_t *DL_req)
|
||||
{
|
||||
DevAssert(proc == NULL);
|
||||
DevAssert(sync_var == 0);
|
||||
DevAssert(RC.gNB != NULL && RC.gNB[0] != NULL);
|
||||
PHY_VARS_gNB *gNB = RC.gNB[0]; // phy_inst?
|
||||
|
||||
if (RC.gNB == 0) {
|
||||
return -2;
|
||||
}
|
||||
|
||||
if (RC.gNB[0] == 0) {
|
||||
return -3;
|
||||
}
|
||||
|
||||
if (sync_var != 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() Main system not up - is this a dummy subframe?\n", __FUNCTION__);
|
||||
return -4;
|
||||
}
|
||||
|
||||
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;
|
||||
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu_list = req->dl_tti_request_body.dl_tti_pdu_list;
|
||||
|
||||
if (req->dl_tti_request_body.nPDUs)
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() TX:%d/%d RX:%d/%d; sfn:%d, slot:%d, nGroup:%u, nPDUs: %u, nUE: %p, PduIdx: %p,\n",
|
||||
__FUNCTION__, proc->frame_tx, proc->slot_tx, proc->frame_rx, proc->slot_rx, // TODO: change subframes to slot
|
||||
req->SFN,
|
||||
req->Slot,
|
||||
req->dl_tti_request_body.nGroup,
|
||||
req->dl_tti_request_body.nPDUs,
|
||||
req->dl_tti_request_body.nUe,
|
||||
req->dl_tti_request_body.PduIdx);
|
||||
|
||||
for (int i=0; i<req->dl_tti_request_body.nPDUs; i++) {
|
||||
// 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);
|
||||
notifiedFIFO_elt_t *res;
|
||||
res = l1tx_message_extract(gNB, sfn, slot);
|
||||
processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res);
|
||||
|
||||
if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE) {
|
||||
msgTx->pdcch_pdu[i] = dl_tti_pdu_list[i].pdcch_pdu; // copies all the received PDCCH PDUs
|
||||
}
|
||||
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(msgTx, sfn, slot, &dl_tti_pdu_list[i]);
|
||||
}
|
||||
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_pdu_t *tx_data = tx_data_request[sfn][slot][rel15_pdu->pduIndex];
|
||||
|
||||
if (tx_data != NULL) {
|
||||
uint8_t *dlsch_sdu = (uint8_t *)tx_data->TLVs[0].value.direct;
|
||||
//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);
|
||||
AssertFatal(msgTx->num_pdsch_slot < gNB->max_nb_pdsch,
|
||||
"Number of PDSCH PDUs %d exceeded the limit %d\n",
|
||||
msgTx->num_pdsch_slot,
|
||||
gNB->max_nb_pdsch);
|
||||
handle_nr_nfapi_pdsch_pdu(msgTx, 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 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(msgTx, sfn, slot, csi_rs_pdu);
|
||||
}
|
||||
else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() UNKNOWN:%d\n", __FUNCTION__, dl_tti_pdu_list[i].PDUType);
|
||||
}
|
||||
pushNotifiedFIFO(&gNB->L1_tx_filled, res);
|
||||
}
|
||||
|
||||
if(req->vendor_extension)
|
||||
free(req->vendor_extension);
|
||||
nr_schedule_dl_tti_req(gNB, DL_req);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1343,29 +1248,13 @@ int pnf_phy_dl_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, n
|
||||
}
|
||||
|
||||
|
||||
extern void nr_schedule_tx_req(PHY_VARS_gNB *gNB, nfapi_nr_tx_data_request_t *TX_req);
|
||||
int pnf_phy_tx_data_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_nr_tx_data_request_t *req)
|
||||
{
|
||||
DevAssert(RC.gNB != NULL && RC.gNB[0] != NULL);
|
||||
PHY_VARS_gNB *gNB = RC.gNB[0]; // phy_inst?
|
||||
|
||||
int pnf_phy_tx_data_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_nr_tx_data_request_t *req) {
|
||||
uint16_t sfn = req->SFN;
|
||||
uint16_t slot = req->Slot;
|
||||
|
||||
if (req->Number_of_PDUs == 0)
|
||||
LOG_D(PHY,"%s() SFN/SLOT:%d%d PDUs:%d\n", __FUNCTION__, sfn, slot, req->Number_of_PDUs);
|
||||
|
||||
//if (req->pdu_list[0].TLVs->tag == NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST) {
|
||||
for (int i=0; i<req->Number_of_PDUs; i++) {
|
||||
// LOG_D(PHY,"%s() SFN/SF:%d%d number_of_pdus:%d [PDU:%d] pdu_length:%d pdu_index:%d num_segments:%d\n",
|
||||
// __FUNCTION__,
|
||||
// sfn, sf,
|
||||
// req->tx_request_body.number_of_pdus,
|
||||
// i,
|
||||
// req->tx_request_body.tx_pdu_list[i].pdu_length,
|
||||
// req->tx_request_body.tx_pdu_list[i].pdu_index,
|
||||
// req->tx_request_body.tx_pdu_list[i].num_segments
|
||||
// );
|
||||
// tx_request_pdu[sfn][sf][i] = &req->tx_request_body.tx_pdu_list[i];
|
||||
tx_data_request[sfn][slot][i] = &req->pdu_list[i];
|
||||
}
|
||||
//}
|
||||
nr_schedule_tx_req(gNB, req);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1396,77 +1285,13 @@ int pnf_phy_tx_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_tx_request_t *req) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern void nr_schedule_ul_tti_req(PHY_VARS_gNB *gNB, nfapi_nr_ul_tti_request_t *UL_tti_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)
|
||||
{
|
||||
DevAssert(RC.gNB != NULL && RC.gNB[0] != NULL);
|
||||
PHY_VARS_gNB *gNB = RC.gNB[0]; // phy_inst?
|
||||
|
||||
|
||||
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) {
|
||||
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;
|
||||
}
|
||||
|
||||
if (RC.gNB == 0) {
|
||||
return -2;
|
||||
}
|
||||
|
||||
if (RC.gNB[0] == 0) {
|
||||
return -3;
|
||||
}
|
||||
|
||||
if (sync_var != 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() Main system not up - is this a dummy slot?\n", __FUNCTION__);
|
||||
return -4;
|
||||
}
|
||||
uint16_t curr_sfn = req->SFN;
|
||||
uint16_t curr_slot = req->Slot;
|
||||
struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
|
||||
|
||||
if (proc==NULL)
|
||||
proc = &gNB->proc.L1_proc;
|
||||
|
||||
nfapi_nr_ul_tti_request_number_of_pdus_t *ul_tti_pdu_list = req->pdus_list;
|
||||
|
||||
for (int i=0; i< req->n_pdus; i++) {
|
||||
switch (ul_tti_pdu_list[i].pdu_type) {
|
||||
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
|
||||
//LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PUSCH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
||||
//curr_sfn = curr_sfn + 3; //Gokul
|
||||
nr_fill_ulsch(gNB,curr_sfn, curr_slot, &ul_tti_pdu_list[i].pusch_pdu);
|
||||
break;
|
||||
case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:
|
||||
//LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PUCCH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
||||
nr_fill_pucch(gNB,curr_sfn, curr_slot, &ul_tti_pdu_list[i].pucch_pdu);
|
||||
break;
|
||||
case NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE:
|
||||
//LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PRACH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
||||
nr_fill_prach(gNB, curr_sfn, curr_slot, &ul_tti_pdu_list[i].prach_pdu);
|
||||
if (gNB->RU_list[0]->if_south == LOCAL_RF) nr_fill_prach_ru(gNB->RU_list[0], curr_sfn, curr_slot, &ul_tti_pdu_list[i].prach_pdu);
|
||||
break;
|
||||
default:
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() PDU:%i UNKNOWN type :%d\n", __FUNCTION__, i, ul_tti_pdu_list[i].pdu_type);
|
||||
break;
|
||||
|
||||
}
|
||||
// //LOG_D(PHY, "%s() sfn/sf:%d PDU[%d] size:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, ul_config_pdu_list[i].pdu_size);
|
||||
// if (
|
||||
// ul_tti_pdu_list[i].pdu_type == NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE ||
|
||||
// ul_tti_pdu_list[i].pdu_type == NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE ||
|
||||
// ul_tti_pdu_list[i].pdu_type == NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE ||
|
||||
// ul_tti_pdu_list[i].pdu_type == NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE
|
||||
// ) {
|
||||
// //LOG_D(PHY, "%s() handle_nfapi_ul_pdu() for PDU:%d\n", __FUNCTION__, i);
|
||||
// // handle_nfapi_ul_pdu(eNB,proc,&ul_config_pdu_list[i],curr_sfn,curr_sf,req->ul_config_request_body.srs_present);
|
||||
|
||||
// // TODO: dont have an NR function for this, also srs_present flag not there
|
||||
|
||||
// } else {
|
||||
// NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() PDU:%i UNKNOWN type :%d\n", __FUNCTION__, i, ul_tti_pdu_list[i].pdu_type);
|
||||
// }
|
||||
}
|
||||
|
||||
nr_schedule_ul_tti_req(gNB, req);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1931,6 +1756,18 @@ int nr_start_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nf
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] HACK - Set p7_config global ready for subframe ind%s\n", __FUNCTION__);
|
||||
p7_config_g = p7_config;
|
||||
|
||||
// Hack? in the config request (which comes before the start request here),
|
||||
// we receive the SCS/mu. The PNF needs that for calculating frame/slot
|
||||
// offsets. However, the memory for the structure which actually keeps track
|
||||
// of the time, is only allocated here, so "pick" the SCS from memory.
|
||||
PHY_VARS_gNB *gNB = RC.gNB[0];
|
||||
DevAssert(gNB != NULL);
|
||||
// check that SCS has actually been received
|
||||
const nfapi_uint8_tlv_t *scs = &gNB->gNB_config.ssb_config.scs_common;
|
||||
DevAssert(scs->tl.tag == NFAPI_NR_CONFIG_SCS_COMMON_TAG);
|
||||
pnf_p7_t* pnf_p7 = (pnf_p7_t*)(p7_config);
|
||||
pnf_p7->mu = scs->value;
|
||||
|
||||
// Need to wait for main thread to create RU structures
|
||||
while (config_sync_var < 0) {
|
||||
usleep(5000000);
|
||||
@@ -1955,7 +1792,7 @@ int nr_start_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nf
|
||||
}
|
||||
|
||||
while(sync_var<0) {
|
||||
usleep(5000000);
|
||||
usleep(50000);
|
||||
printf("[PNF] waiting for OAI to be started\n");
|
||||
}
|
||||
|
||||
@@ -2430,24 +2267,53 @@ void oai_subframe_ind(uint16_t sfn, uint16_t sf) {
|
||||
}
|
||||
}
|
||||
|
||||
void handle_nr_slot_ind(uint16_t sfn, uint16_t slot) {
|
||||
#define SLOT_DURATION 800 // in microseconds
|
||||
static void maybe_slow_down_pnf(int mu)
|
||||
{
|
||||
/* uses a usleep to wait for approximately the same time period (300 us) */
|
||||
static struct timespec last_execution = {0};
|
||||
struct timespec current_execution;
|
||||
clock_gettime(CLOCK_REALTIME, ¤t_execution);
|
||||
// Calculate elapsed time since last execution
|
||||
long elapsed_time = (current_execution.tv_sec - last_execution.tv_sec) * 1000000; // Convert seconds to microseconds
|
||||
elapsed_time += (current_execution.tv_nsec - last_execution.tv_nsec) / 1000; // Convert nanoseconds to microseconds
|
||||
int duration = SLOT_DURATION >> mu;
|
||||
if (elapsed_time < duration)
|
||||
usleep(duration - elapsed_time);
|
||||
// Update last_execution time
|
||||
last_execution = current_execution;
|
||||
}
|
||||
|
||||
void handle_nr_slot_ind(uint16_t sfn, uint16_t slot)
|
||||
{
|
||||
nfapi_pnf_p7_config_t *config = p7_config_g;
|
||||
pnf_p7_t *_this = (pnf_p7_t *)(config);
|
||||
int mu = _this->mu;
|
||||
|
||||
if (IS_SOFTMODEM_RFSIM) {
|
||||
// RFsim can run faster than realtime. However, we need to give the VNF
|
||||
// some time to send an answer, so the PNF can run faster than realtime,
|
||||
// but it should not too much. This function will "maybe" slow down, up to
|
||||
// a slot length
|
||||
maybe_slow_down_pnf(mu);
|
||||
}
|
||||
|
||||
//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));
|
||||
int 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);
|
||||
//we give four additional slots (2ms) which should be enough time for the VNF to
|
||||
//answer
|
||||
int slot_ahead = 2 << mu;
|
||||
uint16_t sfn_tx = sfn;
|
||||
uint16_t slot_tx = slot;
|
||||
sfnslot_add_slot(mu, &sfn_tx, &slot_tx, slot_ahead); // modify: do in place
|
||||
|
||||
ind->sfn = sfn_tx;
|
||||
ind->slot = slot_tx;
|
||||
oai_nfapi_nr_slot_indication(ind);
|
||||
// printf("send slot indication for sfn/slot:%4d.%2d current:%4d.%2d\n", sfn_tx, slot_tx, sfn, slot);
|
||||
nfapi_nr_slot_indication_scf_t ind = {.sfn = sfn_tx, .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);
|
||||
// copy data from appropriate p7 slot buffers into channel structures for PHY processing
|
||||
nfapi_pnf_p7_slot_ind(config, config->phy_id, sfn, slot);
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind) {
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef 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);
|
||||
@@ -27,7 +29,7 @@ void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_add
|
||||
|
||||
void oai_subframe_ind(uint16_t sfn, uint16_t sf);
|
||||
void handle_nr_slot_ind(uint16_t sfn, uint16_t slot);
|
||||
uint32_t sfnslot_add_slot(uint16_t sfn, uint16_t slot, int offset);
|
||||
void sfnslot_add_slot(int mu, 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);
|
||||
@@ -36,3 +38,4 @@ 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);
|
||||
|
||||
#endif /* NFAPI_PNF_H_ */
|
||||
|
||||
@@ -50,6 +50,9 @@
|
||||
#include "nr_fapi_p7_utils.h"
|
||||
#include <NR_MAC_gNB/mac_proto.h>
|
||||
|
||||
#ifdef ENABLE_AERIAL
|
||||
#include "aerial/fapi_vnf_p5.h"
|
||||
#endif
|
||||
|
||||
#define TEST
|
||||
|
||||
@@ -272,49 +275,6 @@ void oai_enb_init(void) {
|
||||
init_eNB_afterRU();
|
||||
}
|
||||
|
||||
|
||||
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_D(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_D(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
|
||||
|
||||
gNB->Mod_id = bodge_counter;
|
||||
gNB->CC_id = bodge_counter;
|
||||
RC.nb_nr_CC[bodge_counter] = 1;
|
||||
|
||||
if (gNB->if_inst==0) {
|
||||
gNB->if_inst = NR_IF_Module_init(bodge_counter);
|
||||
}
|
||||
|
||||
|
||||
// This will cause phy_config_request to be installed. That will result in RRC configuring the PHY
|
||||
// that will result in gNB->configured being set to true.
|
||||
// See we need to wait for that to happen otherwise the NFAPI message exchanges won't contain the right parameter values
|
||||
if (RC.gNB[0]->if_inst==0 || RC.gNB[0]->if_inst->NR_PHY_config_req==0 || RC.gNB[0]->if_inst->NR_Schedule_response==0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "RC.gNB[0][0]->if_inst->NR_PHY_config_req is not installed - install it\n");
|
||||
install_nr_schedule_handlers(RC.gNB[0]->if_inst);
|
||||
}
|
||||
|
||||
do {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() Waiting for gNB to become configured (by RRC/PHY) - need to wait otherwise NFAPI messages won't contain correct values\n", __FUNCTION__);
|
||||
usleep(50000);
|
||||
} while(gNB->configured != 1);
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() gNB is now configured\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
int pnf_connection_indication_cb(nfapi_vnf_config_t *config, int p5_idx) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] pnf connection indication idx:%d\n", p5_idx);
|
||||
oai_create_enb();
|
||||
@@ -327,7 +287,6 @@ int pnf_connection_indication_cb(nfapi_vnf_config_t *config, int p5_idx) {
|
||||
|
||||
int pnf_nr_connection_indication_cb(nfapi_vnf_config_t *config, int p5_idx) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] pnf connection indication idx:%d\n", p5_idx);
|
||||
oai_create_gnb();
|
||||
nfapi_nr_pnf_param_request_t req;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.header.message_id = NFAPI_NR_PHY_MSG_TYPE_PNF_PARAM_REQUEST;
|
||||
@@ -650,7 +609,7 @@ int phy_slot_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id, uin
|
||||
static uint8_t first_time = 1;
|
||||
|
||||
if (first_time) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] slot indication %d\n", NFAPI_SFNSLOT2DEC(sfn, slot));
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] slot indication %d.%d\n", sfn, slot);
|
||||
first_time = 0;
|
||||
}
|
||||
|
||||
@@ -1118,24 +1077,66 @@ int phy_cqi_indication(struct nfapi_vnf_p7_config *config, nfapi_cqi_indication_
|
||||
|
||||
//NR phy indication
|
||||
|
||||
int phy_nr_slot_indication(nfapi_nr_slot_indication_scf_t *ind) {
|
||||
|
||||
uint8_t vnf_slot_ahead = 0;
|
||||
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);
|
||||
LOG_D(MAC, "VNF SFN/Slot %d.%d \n", vnf_sfn, vnf_slot);
|
||||
NR_Sched_Rsp_t g_sched_resp;
|
||||
void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, sub_frame_t slot, NR_Sched_Rsp_t* sched_info);
|
||||
int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req);
|
||||
int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req);
|
||||
int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t* tx_data_req);
|
||||
int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t* ul_dci_req);
|
||||
|
||||
nfapi_nr_slot_indication_scf_t *nr_slot_ind = CALLOC(1, sizeof(*nr_slot_ind));
|
||||
nr_slot_ind->header = ind->header;
|
||||
nr_slot_ind->sfn = vnf_sfn;
|
||||
nr_slot_ind->slot = vnf_slot;
|
||||
if (!put_queue(&gnb_slot_ind_queue, nr_slot_ind))
|
||||
{
|
||||
LOG_E(NR_MAC, "Put_queue failed for slot_ind\n");
|
||||
free(nr_slot_ind);
|
||||
nr_slot_ind = NULL;
|
||||
}
|
||||
int trigger_scheduler(nfapi_nr_slot_indication_scf_t *slot_ind)
|
||||
{
|
||||
// Call into the scheduler (this is hardcoded and should be init properly!)
|
||||
// memset(sched_resp, 0, sizeof(*sched_resp));
|
||||
gNB_dlsch_ulsch_scheduler(0, slot_ind->sfn, slot_ind->slot, &g_sched_resp);
|
||||
|
||||
#ifdef ENABLE_AERIAL
|
||||
bool send_slt_resp = false;
|
||||
if (g_sched_resp.DL_req.dl_tti_request_body.nPDUs> 0) {
|
||||
oai_fapi_dl_tti_req(&g_sched_resp.DL_req);
|
||||
send_slt_resp = true;
|
||||
}
|
||||
if (g_sched_resp.UL_tti_req.n_pdus > 0) {
|
||||
oai_fapi_ul_tti_req(&g_sched_resp.UL_tti_req);
|
||||
send_slt_resp = true;
|
||||
}
|
||||
if (g_sched_resp.TX_req.Number_of_PDUs > 0) {
|
||||
oai_fapi_tx_data_req(&g_sched_resp.TX_req);
|
||||
send_slt_resp = true;
|
||||
}
|
||||
if (g_sched_resp.UL_dci_req.numPdus > 0) {
|
||||
oai_fapi_ul_dci_req(&g_sched_resp.UL_dci_req);
|
||||
send_slt_resp = true;
|
||||
}
|
||||
if (send_slt_resp) {
|
||||
oai_fapi_send_end_request(0,slot_ind->sfn, slot_ind->slot);
|
||||
}
|
||||
#else
|
||||
if (g_sched_resp.DL_req.dl_tti_request_body.nPDUs > 0)
|
||||
oai_nfapi_dl_tti_req(&g_sched_resp.DL_req);
|
||||
|
||||
if (g_sched_resp.UL_tti_req.n_pdus > 0)
|
||||
oai_nfapi_ul_tti_req(&g_sched_resp.UL_tti_req);
|
||||
|
||||
if (g_sched_resp.TX_req.Number_of_PDUs > 0)
|
||||
oai_nfapi_tx_data_req(&g_sched_resp.TX_req);
|
||||
|
||||
if (g_sched_resp.UL_dci_req.numPdus > 0)
|
||||
oai_nfapi_ul_dci_req(&g_sched_resp.UL_dci_req);
|
||||
#endif
|
||||
|
||||
NR_UL_IND_t ind = {.frame = slot_ind->sfn, .slot = slot_ind->slot, };
|
||||
NR_UL_indication(&ind);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int phy_nr_slot_indication(nfapi_nr_slot_indication_scf_t *ind)
|
||||
{
|
||||
LOG_D(MAC, "VNF SFN/Slot %d.%d \n", ind->sfn, ind->slot);
|
||||
|
||||
trigger_scheduler(ind);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -1413,7 +1414,6 @@ void *vnf_nr_p7_thread_start(void *ptr)
|
||||
init_queue(&gnb_rx_ind_queue);
|
||||
init_queue(&gnb_crc_ind_queue);
|
||||
init_queue(&gnb_uci_ind_queue);
|
||||
init_queue(&gnb_slot_ind_queue);
|
||||
|
||||
vnf_p7_info *p7_vnf = (vnf_p7_info *)ptr;
|
||||
p7_vnf->config->port = p7_vnf->local_port;
|
||||
@@ -1551,6 +1551,17 @@ int nr_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_param_resp
|
||||
// for now just 1
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %d.%d pnf p7 %s:%d timing %u %u %u %u\n", p5_idx, phy->id, phy->remote_addr, phy->remote_port, p7_vnf->timing_window, p7_vnf->periodic_timing_period, p7_vnf->aperiodic_timing_enabled,
|
||||
p7_vnf->periodic_timing_period);
|
||||
// Hack? the VNF might need the subcarrier spacing for some calculations
|
||||
// (that we actually don't use as of now...). We therefore need to save the
|
||||
// mu, for the current PNF connection (together with where we have frame/slot
|
||||
// info). nfapi_vnf_p7_add_pnf() prepends the current P7 connection to the
|
||||
// beginning of the list. Pick it from there, and save the mu.
|
||||
// check that SCS has actually been set
|
||||
const nfapi_uint8_tlv_t *scs = &req->ssb_config.scs_common;
|
||||
DevAssert(scs->tl.tag == NFAPI_NR_CONFIG_SCS_COMMON_TAG);
|
||||
int mu = scs->value;
|
||||
nfapi_vnf_p7_add_pnf((p7_vnf->config), phy->remote_addr, phy->remote_port, phy->id, mu);
|
||||
|
||||
req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_CONFIG_REQUEST;
|
||||
req->header.phy_id = phy->id;
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Send NFAPI_CONFIG_REQUEST\n");
|
||||
@@ -1683,18 +1694,12 @@ int start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_start_response_t
|
||||
pnf_info *pnf = vnf->pnfs;
|
||||
phy_info *phy = pnf->phys;
|
||||
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
|
||||
nfapi_vnf_p7_add_pnf((p7_vnf->config), phy->remote_addr, htons(phy->remote_port), phy->id);
|
||||
nfapi_vnf_p7_add_pnf((p7_vnf->config), phy->remote_addr, htons(phy->remote_port), phy->id, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nr_start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_start_response_scf_t *resp) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Received NFAPI_START_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
|
||||
vnf_info *vnf = (vnf_info *)(config->user_data);
|
||||
pnf_info *pnf = vnf->pnfs;
|
||||
phy_info *phy = pnf->phys;
|
||||
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
|
||||
|
||||
nfapi_vnf_p7_add_pnf((p7_vnf->config), phy->remote_addr, phy->remote_port, phy->id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1816,7 +1821,7 @@ void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port, char *pnf_ip_addr,
|
||||
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].periodic_timing_period = 1;
|
||||
vnf.p7_vnfs[0].config = nfapi_vnf_p7_config_create();
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,
|
||||
"[VNF] %s() vnf.p7_vnfs[0].config:%p VNF ADDRESS:%s:%d\n",
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef NFAPI_VNF_H_
|
||||
#define NFAPI_VNF_H_
|
||||
|
||||
void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
|
||||
void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
|
||||
|
||||
uint32_t sfnslot_add_slot(uint16_t sfn, uint16_t slot, int offset);
|
||||
|
||||
#endif /* NFAPI_VNF_H_ */
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
add_subdirectory(common)
|
||||
add_subdirectory(fapi)
|
||||
add_subdirectory(utils)
|
||||
|
||||
@@ -66,7 +66,7 @@ void nfapi_trace(nfapi_trace_level_t level,
|
||||
{
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
printf("%ld%06ld [%c] %10u: %s: ",
|
||||
printf("%ld.%06ld [%c] %10u: %s: ",
|
||||
ts.tv_sec,
|
||||
ts.tv_nsec / 1000,
|
||||
"XEWNID"[level], // NFAPI_TRACE_NONE, NFAPI_TRACE_ERROR, ...
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
#include "assertions.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define INDENTED_PRINTF(format, ...) printf("%*s" format, depth * 2, "", ##__VA_ARGS__)
|
||||
|
||||
#define EQ_TLV(_tlv_a, _tlv_b) \
|
||||
do { \
|
||||
EQ(_tlv_a.tl.tag, _tlv_b.tl.tag); \
|
||||
|
||||
@@ -56,4 +56,15 @@ void copy_stop_request(const nfapi_nr_stop_request_scf_t *src, nfapi_nr_stop_req
|
||||
void copy_stop_indication(const nfapi_nr_stop_indication_scf_t *src, nfapi_nr_stop_indication_scf_t *dst);
|
||||
void copy_error_indication(const nfapi_nr_error_indication_scf_t *src, nfapi_nr_error_indication_scf_t *dst);
|
||||
|
||||
void dump_param_request(const nfapi_nr_param_request_scf_t *msg);
|
||||
void dump_param_response(const nfapi_nr_param_response_scf_t *msg);
|
||||
void dump_config_request(const nfapi_nr_config_request_scf_t *msg);
|
||||
void dump_config_response(const nfapi_nr_config_response_scf_t *msg);
|
||||
void dump_start_request(const nfapi_nr_start_request_scf_t *msg);
|
||||
void dump_start_response(const nfapi_nr_start_response_scf_t *msg);
|
||||
void dump_stop_request(const nfapi_nr_stop_request_scf_t *msg);
|
||||
void dump_stop_indication(const nfapi_nr_stop_indication_scf_t *msg);
|
||||
void dump_error_indication(const nfapi_nr_error_indication_scf_t *msg);
|
||||
|
||||
|
||||
#endif // OPENAIRINTERFACE_NR_FAPI_P5_UTILS_H
|
||||
|
||||
@@ -75,4 +75,16 @@ size_t get_crc_indication_size(const nfapi_nr_crc_indication_t *msg);
|
||||
size_t get_uci_indication_size(const nfapi_nr_uci_indication_t *msg);
|
||||
size_t get_srs_indication_size(const nfapi_nr_srs_indication_t *msg);
|
||||
size_t get_rach_indication_size(nfapi_nr_rach_indication_t *msg);
|
||||
|
||||
void dump_dl_tti_request(const nfapi_nr_dl_tti_request_t *msg);
|
||||
void dump_ul_tti_request(const nfapi_nr_ul_tti_request_t *msg);
|
||||
void dump_slot_indication(const nfapi_nr_slot_indication_scf_t *msg);
|
||||
void dump_ul_dci_request(const nfapi_nr_ul_dci_request_t *msg);
|
||||
void dump_tx_data_request(const nfapi_nr_tx_data_request_t *msg);
|
||||
void dump_rx_data_indication(const nfapi_nr_rx_data_indication_t *msg);
|
||||
void dump_crc_indication(const nfapi_nr_crc_indication_t *msg);
|
||||
void dump_uci_indication(const nfapi_nr_uci_indication_t *msg);
|
||||
void dump_srs_indication(const nfapi_nr_srs_indication_t *msg);
|
||||
void dump_rach_indication(const nfapi_nr_rach_indication_t *msg);
|
||||
|
||||
#endif // OPENAIRINTERFACE_NR_FAPI_P7_UTILS_H
|
||||
|
||||
@@ -714,16 +714,7 @@ uint8_t unpack_nr_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *
|
||||
{NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG, &pNfapiMsg->nfapi_config.timing_info_mode, &unpack_uint8_tlv_value},
|
||||
{NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG, &pNfapiMsg->nfapi_config.timing_info_period, &unpack_uint8_tlv_value},
|
||||
};
|
||||
// print ppReadPackedMsg
|
||||
uint8_t *ptr = *ppReadPackedMsg;
|
||||
printf("\n Read message unpack_param_response: ");
|
||||
|
||||
while (ptr < end) {
|
||||
printf(" 0x%02x", *ptr);
|
||||
ptr++;
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
return (pull8(ppReadPackedMsg, &pNfapiMsg->error_code, end) && pull8(ppReadPackedMsg, &pNfapiMsg->num_tlv, end)
|
||||
&& unpack_nr_tlv_list(unpack_fns,
|
||||
sizeof(unpack_fns) / sizeof(unpack_tlv_t),
|
||||
@@ -1017,22 +1008,24 @@ uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *e
|
||||
|
||||
// END SSB Table
|
||||
// START TDD Table
|
||||
retval &=
|
||||
pack_nr_tlv(NFAPI_NR_CONFIG_TDD_PERIOD_TAG, &(pNfapiMsg->tdd_table.tdd_period), ppWritePackedMsg, end, &pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160};
|
||||
// Assuming always CP_Normal, because Cyclic prefix is not included in CONFIG.request 10.02, but is present in 10.04
|
||||
uint8_t cyclicprefix = 1;
|
||||
// 3GPP 38.211 Table 4.3.2.1 & Table 4.3.2.2
|
||||
uint8_t number_of_symbols_per_slot = cyclicprefix ? 14 : 12;
|
||||
for (int i = 0; i < slotsperframe[pNfapiMsg->ssb_config.scs_common.value]; i++) { // TODO check right number of slots
|
||||
for (int k = 0; k < number_of_symbols_per_slot; k++) { // TODO can change?
|
||||
retval &= pack_nr_tlv(NFAPI_NR_CONFIG_SLOT_CONFIG_TAG,
|
||||
&pNfapiMsg->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list[k].slot_config,
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
if (pNfapiMsg->cell_config.frame_duplex_type.value == 1 /* TDD */) {
|
||||
retval &=
|
||||
pack_nr_tlv(NFAPI_NR_CONFIG_TDD_PERIOD_TAG, &(pNfapiMsg->tdd_table.tdd_period), ppWritePackedMsg, end, &pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160};
|
||||
// Assuming always CP_Normal, because Cyclic prefix is not included in CONFIG.request 10.02, but is present in 10.04
|
||||
uint8_t cyclicprefix = 1;
|
||||
// 3GPP 38.211 Table 4.3.2.1 & Table 4.3.2.2
|
||||
uint8_t number_of_symbols_per_slot = cyclicprefix ? 14 : 12;
|
||||
for (int i = 0; i < slotsperframe[pNfapiMsg->ssb_config.scs_common.value]; i++) { // TODO check right number of slots
|
||||
for (int k = 0; k < number_of_symbols_per_slot; k++) { // TODO can change?
|
||||
retval &= pack_nr_tlv(NFAPI_NR_CONFIG_SLOT_CONFIG_TAG,
|
||||
&pNfapiMsg->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list[k].slot_config,
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1232,27 +1225,28 @@ uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *
|
||||
pNfapiMsg->prach_config.num_prach_fd_occasions.tl.tag = generic_tl.tag;
|
||||
pNfapiMsg->prach_config.num_prach_fd_occasions.tl.length = generic_tl.length;
|
||||
result = (*unpack_fns[idx].unpack_func)(&pNfapiMsg->prach_config.num_prach_fd_occasions, ppReadPackedMsg, end);
|
||||
pNfapiMsg->prach_config.num_prach_fd_occasions_list = (nfapi_nr_num_prach_fd_occasions_t *)malloc(
|
||||
pNfapiMsg->prach_config.num_prach_fd_occasions.value * sizeof(nfapi_nr_num_prach_fd_occasions_t));
|
||||
pNfapiMsg->prach_config.num_prach_fd_occasions_list = calloc(pNfapiMsg->prach_config.num_prach_fd_occasions.value, sizeof(nfapi_nr_num_prach_fd_occasions_t));
|
||||
prach_root_seq_idx = 0;
|
||||
break;
|
||||
case NFAPI_NR_CONFIG_SCS_COMMON_TAG:
|
||||
pNfapiMsg->ssb_config.scs_common.tl.tag = generic_tl.tag;
|
||||
pNfapiMsg->ssb_config.scs_common.tl.length = generic_tl.length;
|
||||
result = (*unpack_fns[idx].unpack_func)(&pNfapiMsg->ssb_config.scs_common, ppReadPackedMsg, end);
|
||||
const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160};
|
||||
|
||||
// Assuming always CP_Normal, because Cyclic prefix is not included in CONFIG.request 10.02, but is present in 10.04
|
||||
uint8_t cyclicprefix = 1;
|
||||
// 3GPP 38.211 Table 4.3.2.1 & Table 4.3.2.2
|
||||
uint8_t number_of_symbols_per_slot = cyclicprefix ? 14 : 12;
|
||||
|
||||
pNfapiMsg->tdd_table.max_tdd_periodicity_list = (nfapi_nr_max_tdd_periodicity_t *)malloc(
|
||||
slotsperframe[pNfapiMsg->ssb_config.scs_common.value] * sizeof(nfapi_nr_max_tdd_periodicity_t));
|
||||
if (pNfapiMsg->cell_config.frame_duplex_type.value == 1 /* TDD */) {
|
||||
const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160};
|
||||
int n = slotsperframe[pNfapiMsg->ssb_config.scs_common.value];
|
||||
pNfapiMsg->tdd_table.max_tdd_periodicity_list = calloc(n, sizeof(nfapi_nr_max_tdd_periodicity_t));
|
||||
|
||||
for (int i = 0; i < slotsperframe[pNfapiMsg->ssb_config.scs_common.value]; i++) {
|
||||
pNfapiMsg->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list =
|
||||
(nfapi_nr_max_num_of_symbol_per_slot_t *)malloc(number_of_symbols_per_slot
|
||||
* sizeof(nfapi_nr_max_num_of_symbol_per_slot_t));
|
||||
for (int i = 0; i < n; i++) {
|
||||
pNfapiMsg->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list =
|
||||
calloc(number_of_symbols_per_slot, sizeof(nfapi_nr_max_num_of_symbol_per_slot_t));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NFAPI_NR_CONFIG_PRACH_ROOT_SEQUENCE_INDEX_TAG:
|
||||
|
||||
@@ -240,18 +240,20 @@ bool eq_config_request(const nfapi_nr_config_request_scf_t *unpacked_req, const
|
||||
EQ_TLV(unpacked_req->ssb_table.ssb_beam_id_list[i].beam_id, req->ssb_table.ssb_beam_id_list[i].beam_id);
|
||||
}
|
||||
|
||||
EQ_TLV(unpacked_req->tdd_table.tdd_period, req->tdd_table.tdd_period);
|
||||
if (req->cell_config.frame_duplex_type.value == 1 /* TDD */) {
|
||||
EQ_TLV(unpacked_req->tdd_table.tdd_period, req->tdd_table.tdd_period);
|
||||
|
||||
const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160};
|
||||
// Assuming always CP_Normal, because Cyclic prefix is not included in CONFIG.request 10.02, but is present in 10.04
|
||||
uint8_t cyclicprefix = 1;
|
||||
// 3GPP 38.211 Table 4.3.2.1 & Table 4.3.2.2
|
||||
uint8_t number_of_symbols_per_slot = cyclicprefix ? 14 : 12;
|
||||
const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160};
|
||||
// Assuming always CP_Normal, because Cyclic prefix is not included in CONFIG.request 10.02, but is present in 10.04
|
||||
uint8_t cyclicprefix = 1;
|
||||
// 3GPP 38.211 Table 4.3.2.1 & Table 4.3.2.2
|
||||
uint8_t number_of_symbols_per_slot = cyclicprefix ? 14 : 12;
|
||||
|
||||
for (int i = 0; i < slotsperframe[unpacked_req->ssb_config.scs_common.value]; i++) {
|
||||
for (int k = 0; k < number_of_symbols_per_slot; k++) {
|
||||
EQ_TLV(unpacked_req->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list[k].slot_config,
|
||||
req->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list[k].slot_config);
|
||||
for (int i = 0; i < slotsperframe[unpacked_req->ssb_config.scs_common.value]; i++) {
|
||||
for (int k = 0; k < number_of_symbols_per_slot; k++) {
|
||||
EQ_TLV(unpacked_req->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list[k].slot_config,
|
||||
req->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list[k].slot_config);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -768,24 +770,26 @@ void copy_config_request(const nfapi_nr_config_request_scf_t *src, nfapi_nr_conf
|
||||
COPY_TLV(dst->ssb_table.ssb_beam_id_list[i].beam_id, src->ssb_table.ssb_beam_id_list[i].beam_id);
|
||||
}
|
||||
|
||||
COPY_TLV(dst->tdd_table.tdd_period, src->tdd_table.tdd_period);
|
||||
if (src->cell_config.frame_duplex_type.value == 1 /* TDD */) {
|
||||
COPY_TLV(dst->tdd_table.tdd_period, src->tdd_table.tdd_period);
|
||||
|
||||
const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160};
|
||||
// Assuming always CP_Normal, because Cyclic prefix is not included in CONFIG.request 10.02, but is present in 10.04
|
||||
uint8_t cyclicprefix = 1;
|
||||
// 3GPP 38.211 Table 4.3.2.1 & Table 4.3.2.2
|
||||
uint8_t number_of_symbols_per_slot = cyclicprefix ? 14 : 12;
|
||||
dst->tdd_table.max_tdd_periodicity_list = (nfapi_nr_max_tdd_periodicity_t *)malloc(slotsperframe[dst->ssb_config.scs_common.value]
|
||||
* sizeof(nfapi_nr_max_tdd_periodicity_t));
|
||||
const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160};
|
||||
// Assuming always CP_Normal, because Cyclic prefix is not included in CONFIG.request 10.02, but is present in 10.04
|
||||
uint8_t cyclicprefix = 1;
|
||||
// 3GPP 38.211 Table 4.3.2.1 & Table 4.3.2.2
|
||||
uint8_t number_of_symbols_per_slot = cyclicprefix ? 14 : 12;
|
||||
dst->tdd_table.max_tdd_periodicity_list = (nfapi_nr_max_tdd_periodicity_t *)malloc(slotsperframe[dst->ssb_config.scs_common.value]
|
||||
* sizeof(nfapi_nr_max_tdd_periodicity_t));
|
||||
|
||||
for (int i = 0; i < slotsperframe[dst->ssb_config.scs_common.value]; i++) {
|
||||
dst->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list =
|
||||
(nfapi_nr_max_num_of_symbol_per_slot_t *)malloc(number_of_symbols_per_slot * sizeof(nfapi_nr_max_num_of_symbol_per_slot_t));
|
||||
}
|
||||
for (int i = 0; i < slotsperframe[dst->ssb_config.scs_common.value]; i++) { // TODO check right number of slots
|
||||
for (int k = 0; k < number_of_symbols_per_slot; k++) { // TODO can change?
|
||||
COPY_TLV(dst->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list[k].slot_config,
|
||||
src->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list[k].slot_config);
|
||||
for (int i = 0; i < slotsperframe[dst->ssb_config.scs_common.value]; i++) {
|
||||
dst->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list =
|
||||
(nfapi_nr_max_num_of_symbol_per_slot_t *)malloc(number_of_symbols_per_slot * sizeof(nfapi_nr_max_num_of_symbol_per_slot_t));
|
||||
}
|
||||
for (int i = 0; i < slotsperframe[dst->ssb_config.scs_common.value]; i++) { // TODO check right number of slots
|
||||
for (int k = 0; k < number_of_symbols_per_slot; k++) { // TODO can change?
|
||||
COPY_TLV(dst->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list[k].slot_config,
|
||||
src->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list[k].slot_config);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -936,3 +940,113 @@ void copy_error_indication(const nfapi_nr_error_indication_scf_t *src, nfapi_nr_
|
||||
dst->message_id = src->message_id;
|
||||
dst->error_code = src->error_code;
|
||||
}
|
||||
|
||||
static void dump_p5_message_header(const nfapi_nr_p4_p5_message_header_t *hdr, int depth)
|
||||
{
|
||||
INDENTED_PRINTF("Message ID = 0x%02x\n", hdr->message_id);
|
||||
INDENTED_PRINTF("Message Length = 0x%02x\n", hdr->message_length);
|
||||
}
|
||||
|
||||
void dump_param_request(const nfapi_nr_param_request_scf_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p5_message_header(&msg->header,depth);
|
||||
}
|
||||
|
||||
void dump_param_response(const nfapi_nr_param_response_scf_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p5_message_header(&msg->header,depth);
|
||||
depth++;
|
||||
INDENTED_PRINTF("Error Code = 0x%02x\n", msg->error_code);
|
||||
INDENTED_PRINTF("Number of TLVs = 0x%02x\n", msg->num_tlv);
|
||||
/* dump all TLVs from each table */
|
||||
depth--;
|
||||
}
|
||||
|
||||
void dump_config_request(const nfapi_nr_config_request_scf_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p5_message_header(&msg->header,depth);
|
||||
depth++;
|
||||
INDENTED_PRINTF("Number of TLVs = 0x%02x\n", msg->num_tlv);
|
||||
/* dump all TLVs from each table */
|
||||
depth--;
|
||||
}
|
||||
|
||||
void dump_config_response(const nfapi_nr_config_response_scf_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p5_message_header(&msg->header,depth);
|
||||
depth++;
|
||||
INDENTED_PRINTF("Error Code = 0x%02x\n", msg->error_code);
|
||||
INDENTED_PRINTF("Number of Invalid or Unsupported TLVs = 0x%02x\n", msg->num_invalid_tlvs);
|
||||
INDENTED_PRINTF("Number of Invalid TLVs that can be configured in IDLE = 0x%02x\n", msg->num_invalid_tlvs_configured_in_idle);
|
||||
INDENTED_PRINTF("Number of Invalid TLVs that can be configured in RUNNING = 0x%02x\n",
|
||||
msg->num_invalid_tlvs_configured_in_running);
|
||||
INDENTED_PRINTF("Number of Missing TLVs = 0x%02x\n", msg->num_missing_tlvs);
|
||||
/* dump all TLVs from each table */
|
||||
depth--;
|
||||
}
|
||||
|
||||
void dump_start_request(const nfapi_nr_start_request_scf_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p5_message_header(&msg->header,depth);
|
||||
}
|
||||
|
||||
void dump_start_response(const nfapi_nr_start_response_scf_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p5_message_header(&msg->header,depth);
|
||||
}
|
||||
|
||||
void dump_stop_request(const nfapi_nr_stop_request_scf_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p5_message_header(&msg->header,depth);
|
||||
}
|
||||
|
||||
void dump_stop_indication(const nfapi_nr_stop_indication_scf_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p5_message_header(&msg->header,depth);
|
||||
}
|
||||
|
||||
static char *error_code_to_str(uint8_t error_code)
|
||||
{
|
||||
switch (error_code) {
|
||||
case NFAPI_NR_PHY_API_MSG_OK:
|
||||
return "NFAPI_NR_PHY_API_MSG_OK";
|
||||
case NFAPI_NR_PHY_API_MSG_INVALID_STATE:
|
||||
return "NFAPI_NR_PHY_API_MSG_INVALID_STATE";
|
||||
case NFAPI_NR_PHY_API_MSG_INVALID_CONFIG:
|
||||
return "NFAPI_NR_PHY_API_MSG_INVALID_CONFIG";
|
||||
case NFAPI_NR_PHY_API_SFN_OUT_OF_SYNC:
|
||||
return "NFAPI_NR_PHY_API_SFN_OUT_OF_SYNC";
|
||||
case NFAPI_NR_PHY_API_MSG_SLOR_ERR:
|
||||
return "NFAPI_NR_PHY_API_MSG_SLOR_ERR";
|
||||
case NFAPI_NR_PHY_API_MSG_BCH_MISSING:
|
||||
return "NFAPI_NR_PHY_API_MSG_BCH_MISSING";
|
||||
case NFAPI_NR_PHY_API_MSG_INVALID_SFN:
|
||||
return "NFAPI_NR_PHY_API_MSG_INVALID_SFN";
|
||||
case NFAPI_NR_PHY_API_MSG_UL_DCI_ERR:
|
||||
return "NFAPI_NR_PHY_API_MSG_UL_DCI_ERR";
|
||||
case NFAPI_NR_PHY_API_MSG_TX_ERR:
|
||||
return "NFAPI_NR_PHY_API_MSG_TX_ERR";
|
||||
default:
|
||||
return "Unknown Error code";
|
||||
}
|
||||
}
|
||||
|
||||
void dump_error_indication(const nfapi_nr_error_indication_scf_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p5_message_header(&msg->header,depth);
|
||||
depth++;
|
||||
INDENTED_PRINTF("SFN = 0x%02x (%d)\n", msg->sfn, msg->sfn);
|
||||
INDENTED_PRINTF("Slot = 0x%02x (%d)\n", msg->slot, msg->slot);
|
||||
INDENTED_PRINTF("Message ID = 0x%02x\n", msg->message_id);
|
||||
INDENTED_PRINTF("Error Code = 0x%02x (%s) \n", msg->error_code, error_code_to_str(msg->error_code));
|
||||
depth--;
|
||||
}
|
||||
|
||||
@@ -2001,3 +2001,743 @@ size_t get_rach_indication_size(nfapi_nr_rach_indication_t *msg)
|
||||
|
||||
return total_size;
|
||||
}
|
||||
|
||||
static void dump_p7_message_header(const nfapi_nr_p7_message_header_t *hdr, int depth)
|
||||
{
|
||||
INDENTED_PRINTF("Message ID = 0x%02x\n", hdr->message_id);
|
||||
INDENTED_PRINTF("Message Length = 0x%02x\n", hdr->message_length);
|
||||
}
|
||||
|
||||
static void dump_dl_beamforming_pdu(const nfapi_nr_tx_precoding_and_beamforming_t *pdu, int depth)
|
||||
{
|
||||
INDENTED_PRINTF("numPRGs = %d\n", pdu->num_prgs);
|
||||
INDENTED_PRINTF("prgSize = %d\n", pdu->prg_size);
|
||||
INDENTED_PRINTF("digBFInterfaces = %d\n", pdu->dig_bf_interfaces);
|
||||
depth++;
|
||||
for (int i = 0; i < pdu->num_prgs; ++i) {
|
||||
INDENTED_PRINTF("PMIdx = %d\n", pdu->prgs_list[i].pm_idx);
|
||||
depth++;
|
||||
for (int j = 0; j < pdu->dig_bf_interfaces; ++j) {
|
||||
INDENTED_PRINTF("beamIDX = %d\n", pdu->prgs_list[i].dig_bf_interface_list[j].beam_idx);
|
||||
}
|
||||
depth--;
|
||||
}
|
||||
}
|
||||
|
||||
static void dump_dl_dci_pdu(const nfapi_nr_dl_dci_pdu_t *pdu, int depth)
|
||||
{
|
||||
INDENTED_PRINTF("RNTI = 0x%x\n", pdu->RNTI);
|
||||
INDENTED_PRINTF("ScramblingId = %d\n", pdu->ScramblingId);
|
||||
INDENTED_PRINTF("ScramblingRNTI = 0x%x\n", pdu->ScramblingRNTI);
|
||||
INDENTED_PRINTF("CCEIndex = %d\n", pdu->CceIndex);
|
||||
INDENTED_PRINTF("AggregationLevel = %d\n", pdu->AggregationLevel);
|
||||
dump_dl_beamforming_pdu(&pdu->precodingAndBeamforming, depth + 1);
|
||||
INDENTED_PRINTF("beta_PDCCH_1_0 = %d\n", pdu->beta_PDCCH_1_0);
|
||||
INDENTED_PRINTF("powerControlOffsetSS = %d\n", pdu->powerControlOffsetSS);
|
||||
INDENTED_PRINTF("PayloadSizeBits = %d\n", pdu->PayloadSizeBits);
|
||||
INDENTED_PRINTF("Payload = ");
|
||||
for (int i = 0; i < (pdu->PayloadSizeBits + 7) / 8; ++i) {
|
||||
printf("0x%02x ", pdu->Payload[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static void dump_dl_tti_request_PDCCH_PDU(const nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdu, int depth)
|
||||
{
|
||||
INDENTED_PRINTF("BWPSize = %d\n", pdu->BWPSize);
|
||||
INDENTED_PRINTF("BWPStart = %d\n", pdu->BWPStart);
|
||||
INDENTED_PRINTF("Subcarrier Spacing = %d\n", pdu->SubcarrierSpacing);
|
||||
INDENTED_PRINTF("Ciclic Prefix = %d\n", pdu->CyclicPrefix);
|
||||
INDENTED_PRINTF("StartSymbolIndex = %d\n", pdu->StartSymbolIndex);
|
||||
INDENTED_PRINTF("DurationSymbols = %d\n", pdu->DurationSymbols);
|
||||
INDENTED_PRINTF("FrequencyDomainResource : ");
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
printf("%d ", pdu->FreqDomainResource[i]);
|
||||
}
|
||||
printf("\n");
|
||||
INDENTED_PRINTF("CCE Reg Mapping Type = %d\n", pdu->CceRegMappingType);
|
||||
INDENTED_PRINTF("Reg Bundle Size = %d\n", pdu->RegBundleSize);
|
||||
INDENTED_PRINTF("Interleaver Size = %d\n", pdu->InterleaverSize);
|
||||
INDENTED_PRINTF("CoreSetType = %d\n", pdu->CoreSetType);
|
||||
INDENTED_PRINTF("ShiftIndex = %d\n", pdu->ShiftIndex);
|
||||
INDENTED_PRINTF("precoderGranularity = %d\n", pdu->precoderGranularity);
|
||||
INDENTED_PRINTF("numDLDCI = %d\n", pdu->numDlDci);
|
||||
for (int i = 0; i < pdu->numDlDci; ++i) {
|
||||
dump_dl_dci_pdu(&pdu->dci_pdu[i], depth + 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void dump_dl_tti_request_PDSCH_PDU(const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdu, int depth)
|
||||
{
|
||||
INDENTED_PRINTF("pduBitmap = %d\n", pdu->pduBitmap);
|
||||
INDENTED_PRINTF("RNTI = 0x%x\n", pdu->rnti);
|
||||
INDENTED_PRINTF("pduIndex = %d\n", pdu->pduIndex);
|
||||
INDENTED_PRINTF("BWPSize = %d\n", pdu->BWPSize);
|
||||
INDENTED_PRINTF("BWPStart = %d\n", pdu->BWPStart);
|
||||
INDENTED_PRINTF("SubcarrierSpacing = %d\n", pdu->SubcarrierSpacing);
|
||||
INDENTED_PRINTF("CyclicPrefix = %d\n", pdu->CyclicPrefix);
|
||||
INDENTED_PRINTF("NrOfCodewords = %d\n", pdu->NrOfCodewords);
|
||||
for (int i = 0; i < pdu->NrOfCodewords; ++i) {
|
||||
depth++;
|
||||
INDENTED_PRINTF("Codeword #%d\n", i);
|
||||
depth++;
|
||||
INDENTED_PRINTF("targetCoderate = %d\n", pdu->targetCodeRate[i]);
|
||||
INDENTED_PRINTF("qamModOrder = %d\n", pdu->qamModOrder[i]);
|
||||
INDENTED_PRINTF("mcsIndex = %d\n", pdu->mcsIndex[i]);
|
||||
INDENTED_PRINTF("mcsTable = %d\n", pdu->mcsTable[i]);
|
||||
INDENTED_PRINTF("rvIndex = %d\n", pdu->rvIndex[i]);
|
||||
INDENTED_PRINTF("TBSize = %d\n", pdu->TBSize[i]);
|
||||
depth--;
|
||||
depth--;
|
||||
}
|
||||
|
||||
INDENTED_PRINTF("dataScramblingId = %d\n", pdu->dataScramblingId);
|
||||
INDENTED_PRINTF("nrOfLayers = %d\n", pdu->nrOfLayers);
|
||||
INDENTED_PRINTF("transmissionScheme = %d\n", pdu->transmissionScheme);
|
||||
INDENTED_PRINTF("refPoint = %d\n", pdu->refPoint);
|
||||
INDENTED_PRINTF("dlDmrsSymbPos = %d\n", pdu->dlDmrsSymbPos);
|
||||
INDENTED_PRINTF("dmrsConfigType = %d\n", pdu->dmrsConfigType);
|
||||
INDENTED_PRINTF("dlDmrsScramblingId = %d\n", pdu->dlDmrsScramblingId);
|
||||
INDENTED_PRINTF("SCID = %d\n", pdu->SCID);
|
||||
INDENTED_PRINTF("numDmrsCdmGrpsNoData = %d\n", pdu->numDmrsCdmGrpsNoData);
|
||||
INDENTED_PRINTF("dmrsPorts = %d\n", pdu->dmrsPorts);
|
||||
INDENTED_PRINTF("resourceAlloc = %d\n", pdu->resourceAlloc);
|
||||
INDENTED_PRINTF("rbBitmap = ");
|
||||
for (int i = 0; i < 36; ++i) {
|
||||
printf("%d ", pdu->rbBitmap[i]);
|
||||
}
|
||||
printf("\n");
|
||||
INDENTED_PRINTF("rbStart = %d\n", pdu->rbStart);
|
||||
INDENTED_PRINTF("rbSize = %d\n", pdu->rbSize);
|
||||
INDENTED_PRINTF("VRBtoPRBMapping = %d\n", pdu->VRBtoPRBMapping);
|
||||
INDENTED_PRINTF("StartSymbolIndex = %d\n", pdu->StartSymbolIndex);
|
||||
INDENTED_PRINTF("NrOfSymbols = %d\n", pdu->NrOfSymbols);
|
||||
|
||||
INDENTED_PRINTF("PTRSPortIndex = %d\n", pdu->PTRSPortIndex);
|
||||
INDENTED_PRINTF("PTRSTimeDensity = %d\n", pdu->PTRSTimeDensity);
|
||||
INDENTED_PRINTF("PTRSFreqDensity = %d\n", pdu->PTRSFreqDensity);
|
||||
INDENTED_PRINTF("PTRSReOffset = %d\n", pdu->PTRSReOffset);
|
||||
INDENTED_PRINTF("nEpreRatioOfPDSCHToPTRS = %d\n", pdu->nEpreRatioOfPDSCHToPTRS);
|
||||
|
||||
dump_dl_beamforming_pdu(&pdu->precodingAndBeamforming, depth + 1);
|
||||
INDENTED_PRINTF("powerControlOffset = %d\n", pdu->powerControlOffset);
|
||||
INDENTED_PRINTF("powerControlOffsetSS = %d\n", pdu->powerControlOffsetSS);
|
||||
|
||||
INDENTED_PRINTF("isLastCbPresent = %d\n", pdu->isLastCbPresent);
|
||||
INDENTED_PRINTF("isInlineTbCrc = %d\n", pdu->isInlineTbCrc);
|
||||
INDENTED_PRINTF("dlTbCrc = %d\n", pdu->dlTbCrc);
|
||||
}
|
||||
|
||||
static void dump_dl_tti_request_CSI_RS_PDU(const nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *pdu, int depth)
|
||||
{
|
||||
INDENTED_PRINTF("BWPSize = %d\n", pdu->bwp_size);
|
||||
INDENTED_PRINTF("BWPStart = %d\n", pdu->bwp_start);
|
||||
INDENTED_PRINTF("SubcarrierSpacing = %d\n", pdu->subcarrier_spacing);
|
||||
INDENTED_PRINTF("CyclicPrefix = %d\n", pdu->cyclic_prefix);
|
||||
INDENTED_PRINTF("StartRB = %d\n", pdu->start_rb);
|
||||
INDENTED_PRINTF("NrOfRBs = %d\n", pdu->nr_of_rbs);
|
||||
INDENTED_PRINTF("CSIType = %d\n", pdu->csi_type);
|
||||
INDENTED_PRINTF("Row = %d\n", pdu->row);
|
||||
INDENTED_PRINTF("FreqDomain = %d\n", pdu->freq_domain);
|
||||
INDENTED_PRINTF("SymbL0 = %d\n", pdu->symb_l0);
|
||||
INDENTED_PRINTF("SymbL1 = %d\n", pdu->symb_l1);
|
||||
INDENTED_PRINTF("CDMType = %d\n", pdu->cdm_type);
|
||||
INDENTED_PRINTF("FreqDensity = %d\n", pdu->freq_density);
|
||||
INDENTED_PRINTF("ScrambId = %d\n", pdu->scramb_id);
|
||||
INDENTED_PRINTF("powerControllOffset = %d\n", pdu->power_control_offset);
|
||||
INDENTED_PRINTF("powerControllOffsetSS = %d\n", pdu->power_control_offset_ss);
|
||||
dump_dl_beamforming_pdu(&pdu->precodingAndBeamforming, depth + 1);
|
||||
}
|
||||
|
||||
static void dump_dl_tti_request_SSB_PDU(const nfapi_nr_dl_tti_ssb_pdu_rel15_t *pdu, int depth)
|
||||
{
|
||||
INDENTED_PRINTF("physCellId = %d\n", pdu->PhysCellId);
|
||||
INDENTED_PRINTF("BetaPss = %d\n", pdu->BetaPss);
|
||||
INDENTED_PRINTF("SSBBlockIndex = %d\n", pdu->SsbBlockIndex);
|
||||
INDENTED_PRINTF("SSBSubcarrierOffset = %d\n", pdu->SsbSubcarrierOffset);
|
||||
INDENTED_PRINTF("SSBOffsetPointA = %d\n", pdu->ssbOffsetPointA);
|
||||
INDENTED_PRINTF("bchPayloadFlag = %d\n", pdu->bchPayloadFlag);
|
||||
INDENTED_PRINTF("bchPayload = %x\n", pdu->bchPayload);
|
||||
dump_dl_beamforming_pdu(&pdu->precoding_and_beamforming, depth + 1);
|
||||
}
|
||||
|
||||
static char *dl_tti_pdu_type_to_str(uint16_t pdu_type)
|
||||
{
|
||||
switch (pdu_type) {
|
||||
case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE:
|
||||
return "NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE";
|
||||
case NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE:
|
||||
return "NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE";
|
||||
case NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE:
|
||||
return "NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE";
|
||||
case NFAPI_NR_DL_TTI_SSB_PDU_TYPE:
|
||||
return "NFAPI_NR_DL_TTI_SSB_PDU_TYPE";
|
||||
default:
|
||||
return "Unknown";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void dump_dl_tti_request(const nfapi_nr_dl_tti_request_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p7_message_header(&msg->header, depth);
|
||||
depth++;
|
||||
INDENTED_PRINTF("SFN = %d\n", msg->SFN);
|
||||
INDENTED_PRINTF("Slot = %d\n", msg->Slot);
|
||||
INDENTED_PRINTF("nPDUs = %d\n", msg->dl_tti_request_body.nPDUs);
|
||||
INDENTED_PRINTF("nGroup = %d\n", msg->dl_tti_request_body.nGroup);
|
||||
for (int i = 0; i < msg->dl_tti_request_body.nPDUs; ++i) {
|
||||
const nfapi_nr_dl_tti_request_pdu_t *pdu = &msg->dl_tti_request_body.dl_tti_pdu_list[i];
|
||||
depth++;
|
||||
INDENTED_PRINTF("PDU #%d\n", i);
|
||||
INDENTED_PRINTF("PDUType = 0x%02x (%s)\n", pdu->PDUType, dl_tti_pdu_type_to_str(pdu->PDUType));
|
||||
INDENTED_PRINTF("PDUSize = 0x%02x\n", pdu->PDUSize);
|
||||
/* call to dump_dl_tti_request_<PDU_Type>_pdu */
|
||||
switch (pdu->PDUType) {
|
||||
case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE:
|
||||
dump_dl_tti_request_PDCCH_PDU(&pdu->pdcch_pdu.pdcch_pdu_rel15, depth + 1);
|
||||
break;
|
||||
case NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE:
|
||||
dump_dl_tti_request_PDSCH_PDU(&pdu->pdsch_pdu.pdsch_pdu_rel15, depth + 1);
|
||||
break;
|
||||
case NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE:
|
||||
dump_dl_tti_request_CSI_RS_PDU(&pdu->csi_rs_pdu.csi_rs_pdu_rel15, depth + 1);
|
||||
break;
|
||||
case NFAPI_NR_DL_TTI_SSB_PDU_TYPE:
|
||||
dump_dl_tti_request_SSB_PDU(&pdu->ssb_pdu.ssb_pdu_rel15, depth + 1);
|
||||
break;
|
||||
default:
|
||||
INDENTED_PRINTF("Unknown PDU type 0x%02x\n", pdu->PDUType);
|
||||
break;
|
||||
}
|
||||
depth--;
|
||||
}
|
||||
for (int group_idx = 0; group_idx < msg->dl_tti_request_body.nGroup; group_idx++) {
|
||||
depth++;
|
||||
INDENTED_PRINTF("Group #%d\n", group_idx);
|
||||
INDENTED_PRINTF("nUe[%d] = 0x%02x\n", group_idx, msg->dl_tti_request_body.nUe[group_idx]);
|
||||
for (int ue_idx = 0; ue_idx < msg->dl_tti_request_body.nUe[group_idx]; ue_idx++) {
|
||||
depth++;
|
||||
INDENTED_PRINTF("UE #%d\n", ue_idx);
|
||||
INDENTED_PRINTF("PduIdx[%d][%d] = 0x%02x\n", group_idx, ue_idx, msg->dl_tti_request_body.PduIdx[group_idx][ue_idx]);
|
||||
depth--;
|
||||
}
|
||||
depth--;
|
||||
}
|
||||
}
|
||||
|
||||
static void dump_ul_tti_beamforming(const nfapi_nr_ul_beamforming_t *pdu, int depth)
|
||||
{
|
||||
INDENTED_PRINTF("TRP Scheme = %d\n", pdu->trp_scheme);
|
||||
INDENTED_PRINTF("numPRGs = %d\n", pdu->num_prgs);
|
||||
INDENTED_PRINTF("prgSize = %d\n", pdu->prg_size);
|
||||
INDENTED_PRINTF("digBFInterface = %d\n", pdu->dig_bf_interface);
|
||||
for (int prg = 0; prg < pdu->num_prgs; ++prg) {
|
||||
INDENTED_PRINTF("PRG #%d \n", prg);
|
||||
depth++;
|
||||
for (int dbf_if = 0; dbf_if < pdu->dig_bf_interface; ++dbf_if) {
|
||||
INDENTED_PRINTF("digBFInterface #%d \n", dbf_if);
|
||||
depth++;
|
||||
INDENTED_PRINTF("beamIdx = %d\n", pdu->prgs_list[prg].dig_bf_interface_list[dbf_if].beam_idx);
|
||||
depth--;
|
||||
}
|
||||
depth--;
|
||||
}
|
||||
}
|
||||
|
||||
static char *ul_tti_prach_format_to_str(int prach_format)
|
||||
{
|
||||
switch (prach_format) {
|
||||
case 0:
|
||||
return "0";
|
||||
case 1:
|
||||
return "1";
|
||||
case 2:
|
||||
return "2";
|
||||
case 3:
|
||||
return "3";
|
||||
case 4:
|
||||
return "A1";
|
||||
case 5:
|
||||
return "A2";
|
||||
case 6:
|
||||
return "A3";
|
||||
case 7:
|
||||
return "B1";
|
||||
case 8:
|
||||
return "B4";
|
||||
case 9:
|
||||
return "C0";
|
||||
case 10:
|
||||
return "C2";
|
||||
case 11:
|
||||
return "A1/B1";
|
||||
case 12:
|
||||
return "A2/B2";
|
||||
case 13:
|
||||
return "A3/B3";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static void dump_ul_tti_request_PRACH_PDU(const nfapi_nr_prach_pdu_t *pdu, int depth)
|
||||
{
|
||||
INDENTED_PRINTF("physCellID = %d\n", pdu->phys_cell_id);
|
||||
INDENTED_PRINTF("NumPrachOcas = %d\n", pdu->num_prach_ocas);
|
||||
INDENTED_PRINTF("prachFormat = %d (%s)\n", pdu->prach_format, ul_tti_prach_format_to_str(pdu->prach_format));
|
||||
INDENTED_PRINTF("numRa = %d\n", pdu->num_ra);
|
||||
INDENTED_PRINTF("prachStartSymbol = %d\n", pdu->prach_start_symbol);
|
||||
INDENTED_PRINTF("numCs = %d\n", pdu->num_cs);
|
||||
dump_ul_tti_beamforming(&pdu->beamforming, depth + 1);
|
||||
}
|
||||
|
||||
static void dump_ul_tti_request_PUSCH_PDU(const nfapi_nr_pusch_pdu_t *pdu, int depth)
|
||||
{
|
||||
INDENTED_PRINTF("pduBitmap = %d\n", pdu->pdu_bit_map);
|
||||
INDENTED_PRINTF("RNTI = 0x%x\n", pdu->rnti);
|
||||
INDENTED_PRINTF("Handle = %d\n", pdu->handle);
|
||||
INDENTED_PRINTF("BWPSize = %d\n", pdu->bwp_size);
|
||||
INDENTED_PRINTF("BWPStart = %d\n", pdu->bwp_start);
|
||||
INDENTED_PRINTF("SubcarrierSpacing = %d\n", pdu->subcarrier_spacing);
|
||||
INDENTED_PRINTF("CyclicPrefix = %d\n", pdu->cyclic_prefix);
|
||||
INDENTED_PRINTF("targetCodeRate = %d\n", pdu->target_code_rate);
|
||||
INDENTED_PRINTF("qamModOrder = %d\n", pdu->qam_mod_order);
|
||||
INDENTED_PRINTF("mcsIndex = %d\n", pdu->mcs_index);
|
||||
INDENTED_PRINTF("mcsTable = %d\n", pdu->mcs_table);
|
||||
INDENTED_PRINTF("TransformPrecoding = %d\n", pdu->transform_precoding);
|
||||
INDENTED_PRINTF("dataScramblingId = %d\n", pdu->data_scrambling_id);
|
||||
INDENTED_PRINTF("nrOfLayers = %d\n", pdu->nrOfLayers);
|
||||
INDENTED_PRINTF("ulDmrsSymbPos = %d\n", pdu->ul_dmrs_symb_pos);
|
||||
INDENTED_PRINTF("dmrsConfigType = %d\n", pdu->dmrs_config_type);
|
||||
INDENTED_PRINTF("ulDmrsScramblingId = %d\n", pdu->ul_dmrs_scrambling_id);
|
||||
INDENTED_PRINTF("puschIdentity = %d\n", pdu->pusch_identity);
|
||||
INDENTED_PRINTF("SCID = %d\n", pdu->scid);
|
||||
INDENTED_PRINTF("numDmrsCdmGrpsNoData = %d\n", pdu->num_dmrs_cdm_grps_no_data);
|
||||
INDENTED_PRINTF("dmrsPorts = %d\n", pdu->dmrs_ports);
|
||||
INDENTED_PRINTF("resourceAlloc = %d\n", pdu->resource_alloc);
|
||||
INDENTED_PRINTF("rbBitmap = ");
|
||||
for (int i = 0; i < 36; ++i) {
|
||||
printf("%d ", pdu->rb_bitmap[i]);
|
||||
}
|
||||
printf("\n");
|
||||
INDENTED_PRINTF("rbStart = %d\n", pdu->rb_start);
|
||||
INDENTED_PRINTF("rbSize = %d\n", pdu->rb_size);
|
||||
INDENTED_PRINTF("VRBtoPRBMapping = %d\n", pdu->vrb_to_prb_mapping);
|
||||
INDENTED_PRINTF("FrequencyHopping = %d\n", pdu->frequency_hopping);
|
||||
INDENTED_PRINTF("txDirectCurrentLocation = %d\n", pdu->tx_direct_current_location);
|
||||
INDENTED_PRINTF("uplinkFrequencyShift7p5khz = %d\n", pdu->uplink_frequency_shift_7p5khz);
|
||||
INDENTED_PRINTF("NrOfSymbols = %d\n", pdu->nr_of_symbols);
|
||||
|
||||
INDENTED_PRINTF("puschData (%s)\n", pdu->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_DATA ? "included" : "not included");
|
||||
if (pdu->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_DATA) {
|
||||
depth++;
|
||||
INDENTED_PRINTF("rvIndex = %d\n", pdu->pusch_data.rv_index);
|
||||
INDENTED_PRINTF("harqProcessID = %d\n", pdu->pusch_data.harq_process_id);
|
||||
INDENTED_PRINTF("newDataIndicator = %d\n", pdu->pusch_data.new_data_indicator);
|
||||
INDENTED_PRINTF("TBSize = %d\n", pdu->pusch_data.tb_size);
|
||||
INDENTED_PRINTF("numCB = %d\n", pdu->pusch_data.num_cb);
|
||||
INDENTED_PRINTF("cbPresentAndPosition = ");
|
||||
for (int i = 0; i < (pdu->pusch_data.num_cb + 7) / 8; i++) {
|
||||
printf("%d ", pdu->pusch_data.cb_present_and_position[i]);
|
||||
}
|
||||
printf("\n");
|
||||
depth--;
|
||||
}
|
||||
|
||||
INDENTED_PRINTF("puschUci (%s)\n", pdu->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_UCI ? "included" : "not included");
|
||||
if (pdu->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_UCI) {
|
||||
depth++;
|
||||
INDENTED_PRINTF("harqAckBitLength = %d\n", pdu->pusch_uci.harq_ack_bit_length);
|
||||
INDENTED_PRINTF("csiPart1BitLength = %d\n", pdu->pusch_uci.csi_part1_bit_length);
|
||||
INDENTED_PRINTF("csiPart2BitLength = %d\n", pdu->pusch_uci.csi_part2_bit_length);
|
||||
INDENTED_PRINTF("AlphaScaling = %d\n", pdu->pusch_uci.alpha_scaling);
|
||||
INDENTED_PRINTF("betaOffsetHarqAck = %d\n", pdu->pusch_uci.beta_offset_harq_ack);
|
||||
INDENTED_PRINTF("betaOffsetCsi1 = %d\n", pdu->pusch_uci.beta_offset_csi1);
|
||||
INDENTED_PRINTF("betaOffsetCsi2 = %d\n", pdu->pusch_uci.beta_offset_csi2);
|
||||
depth--;
|
||||
}
|
||||
|
||||
INDENTED_PRINTF("puschPtrs (%s)\n", pdu->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS ? "included" : "not included");
|
||||
if (pdu->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
|
||||
depth++;
|
||||
INDENTED_PRINTF("lowPaprGroupNumber = %d\n", pdu->pusch_ptrs.num_ptrs_ports);
|
||||
for (int i = 0; i < pdu->pusch_ptrs.num_ptrs_ports; ++i) {
|
||||
INDENTED_PRINTF("ptrsPort #%d\n", i);
|
||||
depth++;
|
||||
INDENTED_PRINTF("PTRSPortIndex = %d\n", pdu->pusch_ptrs.ptrs_ports_list[i].ptrs_port_index);
|
||||
INDENTED_PRINTF("PTRSDmrsPort = %d\n", pdu->pusch_ptrs.ptrs_ports_list[i].ptrs_dmrs_port);
|
||||
INDENTED_PRINTF("PTRSReOffset = %d\n", pdu->pusch_ptrs.ptrs_ports_list[i].ptrs_re_offset);
|
||||
depth--;
|
||||
}
|
||||
INDENTED_PRINTF("PTRSTimeDensity = %d\n", pdu->pusch_ptrs.ptrs_time_density);
|
||||
INDENTED_PRINTF("PTRSFreqDensity = %d\n", pdu->pusch_ptrs.ptrs_freq_density);
|
||||
INDENTED_PRINTF("ulPTRSPower = %d\n", pdu->pusch_ptrs.ul_ptrs_power);
|
||||
depth--;
|
||||
}
|
||||
|
||||
INDENTED_PRINTF("dtfsOfdm (%s)\n", pdu->pdu_bit_map & PUSCH_PDU_BITMAP_DFTS_OFDM ? "included" : "not included");
|
||||
if (pdu->pdu_bit_map & PUSCH_PDU_BITMAP_DFTS_OFDM) {
|
||||
depth++;
|
||||
INDENTED_PRINTF("lowPaprGroupNumber = %d\n", pdu->dfts_ofdm.low_papr_group_number);
|
||||
INDENTED_PRINTF("lowPaprSequenceNumber = %d\n", pdu->dfts_ofdm.low_papr_sequence_number);
|
||||
INDENTED_PRINTF("ulPtrsSampleDensity = %d\n", pdu->dfts_ofdm.ul_ptrs_sample_density);
|
||||
INDENTED_PRINTF("ulPtrsTimeDensityTransformPrecoding = %d\n", pdu->dfts_ofdm.ul_ptrs_time_density_transform_precoding);
|
||||
depth--;
|
||||
}
|
||||
dump_ul_tti_beamforming(&pdu->beamforming, depth + 1);
|
||||
}
|
||||
|
||||
static void dump_ul_tti_request_PUCCH_PDU(const nfapi_nr_pucch_pdu_t *pdu, int depth)
|
||||
{
|
||||
INDENTED_PRINTF("RNTI = 0x%x\n", pdu->rnti);
|
||||
INDENTED_PRINTF("Handle = %d\n", pdu->handle);
|
||||
INDENTED_PRINTF("BWPSize = %d\n", pdu->bwp_size);
|
||||
INDENTED_PRINTF("BWPStart = %d\n", pdu->bwp_start);
|
||||
INDENTED_PRINTF("SubcarrierSpacing = %d\n", pdu->subcarrier_spacing);
|
||||
INDENTED_PRINTF("CyclicPrefix = %d\n", pdu->cyclic_prefix);
|
||||
INDENTED_PRINTF("FormatType = %d\n", pdu->format_type);
|
||||
INDENTED_PRINTF("multiSlotTxIndicator = %d\n", pdu->multi_slot_tx_indicator);
|
||||
INDENTED_PRINTF("pi2Bpsk = %d\n", pdu->pi_2bpsk);
|
||||
INDENTED_PRINTF("prbStart = %d\n", pdu->prb_start);
|
||||
INDENTED_PRINTF("prbSize = %d\n", pdu->prb_size);
|
||||
INDENTED_PRINTF("StartSymbolIndex = %d\n", pdu->start_symbol_index);
|
||||
INDENTED_PRINTF("NrOfSymbols = %d\n", pdu->nr_of_symbols);
|
||||
INDENTED_PRINTF("freqHopFlag = %d\n", pdu->freq_hop_flag);
|
||||
INDENTED_PRINTF("secondHopPRB = %d\n", pdu->second_hop_prb);
|
||||
INDENTED_PRINTF("groupHopFlag = %d\n", pdu->group_hop_flag);
|
||||
INDENTED_PRINTF("sequenceHopFlag = %d\n", pdu->sequence_hop_flag);
|
||||
INDENTED_PRINTF("hoppingId = %d\n", pdu->hopping_id);
|
||||
INDENTED_PRINTF("InitialCyclicShift = %d\n", pdu->initial_cyclic_shift);
|
||||
INDENTED_PRINTF("dataScramblingId = %d\n", pdu->data_scrambling_id);
|
||||
INDENTED_PRINTF("TimeDomainOccIdx = %d\n", pdu->time_domain_occ_idx);
|
||||
INDENTED_PRINTF("PreDftOccIdx = %d\n", pdu->pre_dft_occ_idx);
|
||||
INDENTED_PRINTF("PreDftOccLen = %d\n", pdu->pre_dft_occ_len);
|
||||
INDENTED_PRINTF("AddDmrsFlag = %d\n", pdu->add_dmrs_flag);
|
||||
INDENTED_PRINTF("DmrsScramblingId = %d\n", pdu->dmrs_scrambling_id);
|
||||
INDENTED_PRINTF("DMRScyclicshift = %d\n", pdu->dmrs_cyclic_shift);
|
||||
INDENTED_PRINTF("SRFlag = %d\n", pdu->sr_flag);
|
||||
INDENTED_PRINTF("BitLenHarq = %d\n", pdu->bit_len_harq);
|
||||
INDENTED_PRINTF("BitLenCsiPart1 = %d\n", pdu->bit_len_csi_part1);
|
||||
INDENTED_PRINTF("BitLenCsiPart2 = %d\n", pdu->bit_len_csi_part2);
|
||||
dump_ul_tti_beamforming(&pdu->beamforming, depth + 1);
|
||||
}
|
||||
|
||||
static void dump_ul_tti_request_srs_parameters(const nfapi_v4_srs_parameters_t *pdu, const uint8_t num_symbols, uint8_t depth)
|
||||
{
|
||||
INDENTED_PRINTF("srsBandwidthSize = %d\n", pdu->srs_bandwidth_size);
|
||||
for (int symbol_idx = 0; symbol_idx < num_symbols; ++symbol_idx) {
|
||||
const nfapi_v4_srs_parameters_symbols_t *symbol = &pdu->symbol_list[symbol_idx];
|
||||
INDENTED_PRINTF("Symbol #%d\n", symbol_idx);
|
||||
depth++;
|
||||
INDENTED_PRINTF("srsBandwidthStart = %d\n", symbol->srs_bandwidth_start);
|
||||
INDENTED_PRINTF("sequenceGroup = %d\n", symbol->sequence_group);
|
||||
INDENTED_PRINTF("sequenceNumber = %d\n", symbol->sequence_number);
|
||||
depth--;
|
||||
}
|
||||
const uint8_t nUsage = __builtin_popcount(pdu->usage);
|
||||
INDENTED_PRINTF("Usage = %d (nUsage = %d)\n", pdu->usage, nUsage);
|
||||
depth++;
|
||||
for (int idx = 0; idx < nUsage; ++idx) {
|
||||
INDENTED_PRINTF("ReportType[%d] = %d\n", idx, pdu->report_type[idx]);
|
||||
}
|
||||
depth--;
|
||||
INDENTED_PRINTF("singular Value Representation = %d\n", pdu->singular_Value_representation);
|
||||
INDENTED_PRINTF("iq Representation = %d\n", pdu->iq_representation);
|
||||
INDENTED_PRINTF("prgSize = %d\n", pdu->prg_size);
|
||||
INDENTED_PRINTF("numTotalUeAntennas = %d\n", pdu->num_total_ue_antennas);
|
||||
INDENTED_PRINTF("ueAntennasInThisSrsResourceSet = %d\n", pdu->ue_antennas_in_this_srs_resource_set);
|
||||
INDENTED_PRINTF("sampledUeAntennas = %d\n", pdu->sampled_ue_antennas);
|
||||
INDENTED_PRINTF("reportScope = %d\n", pdu->report_scope);
|
||||
INDENTED_PRINTF("NumULSpatialStreamsPorts = %d\n", pdu->num_ul_spatial_streams_ports);
|
||||
depth++;
|
||||
for (int idx = 0; idx < pdu->num_ul_spatial_streams_ports; ++idx) {
|
||||
INDENTED_PRINTF("UlSpatialStreamPorts[%d] = %d\n", idx, pdu->Ul_spatial_stream_ports[idx]);
|
||||
}
|
||||
}
|
||||
|
||||
static void dump_ul_tti_request_SRS_PDU(const nfapi_nr_srs_pdu_t *pdu, int depth)
|
||||
{
|
||||
INDENTED_PRINTF("RNTI = 0x%x\n", pdu->rnti);
|
||||
INDENTED_PRINTF("Handle = %d\n", pdu->handle);
|
||||
INDENTED_PRINTF("BWPSize = %d\n", pdu->bwp_size);
|
||||
INDENTED_PRINTF("BWPStart = %d\n", pdu->bwp_start);
|
||||
INDENTED_PRINTF("SubcarrierSpacing = %d\n", pdu->subcarrier_spacing);
|
||||
INDENTED_PRINTF("CyclicPrefix = %d\n", pdu->cyclic_prefix);
|
||||
INDENTED_PRINTF("numAntPorts = %d\n", pdu->num_ant_ports);
|
||||
INDENTED_PRINTF("numSymbols = %d\n", pdu->num_symbols);
|
||||
INDENTED_PRINTF("numRepetitions = %d\n", pdu->num_repetitions);
|
||||
INDENTED_PRINTF("timeStartPosition = %d\n", pdu->time_start_position);
|
||||
INDENTED_PRINTF("configIndex = %d\n", pdu->config_index);
|
||||
INDENTED_PRINTF("sequenceId = %d\n", pdu->sequence_id);
|
||||
INDENTED_PRINTF("bandwidthIndex = %d\n", pdu->bandwidth_index);
|
||||
INDENTED_PRINTF("combSize = %d\n", pdu->comb_size);
|
||||
INDENTED_PRINTF("combOffset = %d\n", pdu->comb_offset);
|
||||
INDENTED_PRINTF("cyclicShift = %d\n", pdu->cyclic_shift);
|
||||
INDENTED_PRINTF("frequencyPosition = %d\n", pdu->frequency_position);
|
||||
INDENTED_PRINTF("frequencyShift = %d\n", pdu->frequency_shift);
|
||||
INDENTED_PRINTF("frequencyHopping = %d\n", pdu->frequency_hopping);
|
||||
INDENTED_PRINTF("groupOrSequenceHopping = %d\n", pdu->group_or_sequence_hopping);
|
||||
INDENTED_PRINTF("resourceType = %d\n", pdu->resource_type);
|
||||
INDENTED_PRINTF("Tsrs = %d\n", pdu->t_srs);
|
||||
INDENTED_PRINTF("Toffset = %d\n", pdu->t_offset);
|
||||
dump_ul_tti_beamforming(&pdu->beamforming, depth + 1);
|
||||
dump_ul_tti_request_srs_parameters(&pdu->srs_parameters_v4, 1 << pdu->num_symbols, depth + 1);
|
||||
}
|
||||
|
||||
static char *ul_tti_pdu_type_to_str(uint16_t pdu_type)
|
||||
{
|
||||
switch (pdu_type) {
|
||||
case NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE:
|
||||
return "NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE";
|
||||
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
|
||||
return "NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE";
|
||||
case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:
|
||||
return "NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE";
|
||||
case NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE:
|
||||
return "NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE";
|
||||
default:
|
||||
return "Unknown";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void dump_ul_tti_request(const nfapi_nr_ul_tti_request_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p7_message_header(&msg->header, depth);
|
||||
depth++;
|
||||
INDENTED_PRINTF("SFN = %d\n", msg->SFN);
|
||||
INDENTED_PRINTF("Slot = %d\n", msg->Slot);
|
||||
INDENTED_PRINTF("nPDUs = %d\n", msg->n_pdus);
|
||||
INDENTED_PRINTF("RachPresent = %d\n", msg->rach_present);
|
||||
INDENTED_PRINTF("nULSCH = %d\n", msg->n_ulsch);
|
||||
INDENTED_PRINTF("nULCCH = %d\n", msg->n_ulcch);
|
||||
INDENTED_PRINTF("nGroup = %d\n", msg->n_group);
|
||||
for (int i = 0; i < msg->n_pdus; ++i) {
|
||||
const nfapi_nr_ul_tti_request_number_of_pdus_t *pdu = &msg->pdus_list[i];
|
||||
depth++;
|
||||
INDENTED_PRINTF("PDU #%d\n", i);
|
||||
INDENTED_PRINTF("PDUType = 0x%02x (%s)\n", pdu->pdu_type, ul_tti_pdu_type_to_str(pdu->pdu_type));
|
||||
INDENTED_PRINTF("PDUSize = 0x%02x\n", pdu->pdu_size);
|
||||
/* call to dump_ul_tti_request_<PDU_Type>_pdu */
|
||||
switch (pdu->pdu_type) {
|
||||
case NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE:
|
||||
dump_ul_tti_request_PRACH_PDU(&pdu->prach_pdu, depth + 1);
|
||||
break;
|
||||
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
|
||||
dump_ul_tti_request_PUSCH_PDU(&pdu->pusch_pdu, depth + 1);
|
||||
break;
|
||||
case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:
|
||||
dump_ul_tti_request_PUCCH_PDU(&pdu->pucch_pdu, depth + 1);
|
||||
break;
|
||||
case NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE:
|
||||
dump_ul_tti_request_SRS_PDU(&pdu->srs_pdu, depth + 1);
|
||||
break;
|
||||
default:
|
||||
INDENTED_PRINTF("Unknown PDU type 0x%02x\n", pdu->pdu_type);
|
||||
break;
|
||||
}
|
||||
depth--;
|
||||
}
|
||||
for (int group_idx = 0; group_idx < msg->n_group; group_idx++) {
|
||||
const nfapi_nr_ul_tti_request_number_of_groups_t *grp = &msg->groups_list[group_idx];
|
||||
depth++;
|
||||
INDENTED_PRINTF("Group #%d\n", group_idx);
|
||||
INDENTED_PRINTF("nUe[%d] = 0x%02x\n", group_idx, grp->n_ue);
|
||||
for (int ue_idx = 0; ue_idx < grp->n_ue; ue_idx++) {
|
||||
depth++;
|
||||
INDENTED_PRINTF("UE #%d\n", ue_idx);
|
||||
INDENTED_PRINTF("PduIdx[%d][%d] = 0x%02x\n", group_idx, ue_idx, grp->ue_list[ue_idx].pdu_idx);
|
||||
depth--;
|
||||
}
|
||||
depth--;
|
||||
}
|
||||
}
|
||||
|
||||
void dump_slot_indication(const nfapi_nr_slot_indication_scf_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p7_message_header(&msg->header, depth);
|
||||
depth++;
|
||||
INDENTED_PRINTF("SFN = %d\n", msg->sfn);
|
||||
INDENTED_PRINTF("Slot = %d\n", msg->slot);
|
||||
}
|
||||
|
||||
void dump_ul_dci_request(const nfapi_nr_ul_dci_request_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p7_message_header(&msg->header, depth);
|
||||
depth++;
|
||||
INDENTED_PRINTF("SFN = %d\n", msg->SFN);
|
||||
INDENTED_PRINTF("Slot = %d\n", msg->Slot);
|
||||
|
||||
INDENTED_PRINTF("numPDUs = %d\n", msg->numPdus);
|
||||
for (int i = 0; i < msg->numPdus; i++) {
|
||||
depth++;
|
||||
INDENTED_PRINTF("PDU #%d\n", i);
|
||||
const nfapi_nr_ul_dci_request_pdus_t *pdu = &msg->ul_dci_pdu_list[i];
|
||||
INDENTED_PRINTF("PDUType = 0x%02x\n", pdu->PDUType);
|
||||
INDENTED_PRINTF("PDUSize = 0x%02x\n", pdu->PDUSize);
|
||||
/* call to dump_dl_tti_request_pdcch_pdu */
|
||||
dump_dl_tti_request_PDCCH_PDU(&pdu->pdcch_pdu.pdcch_pdu_rel15, depth + 1);
|
||||
depth--;
|
||||
}
|
||||
}
|
||||
|
||||
void dump_tx_data_request(const nfapi_nr_tx_data_request_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p7_message_header(&msg->header, depth);
|
||||
depth++;
|
||||
INDENTED_PRINTF("SFN = %d\n", msg->SFN);
|
||||
INDENTED_PRINTF("Slot = %d\n", msg->Slot);
|
||||
INDENTED_PRINTF("Number of PDUs = %d\n", msg->Number_of_PDUs);
|
||||
for (int i = 0; i < msg->Number_of_PDUs; i++) {
|
||||
depth++;
|
||||
INDENTED_PRINTF("PDU #%d\n", i);
|
||||
const nfapi_nr_pdu_t *pdu = &msg->pdu_list[i];
|
||||
INDENTED_PRINTF("PDU Length = 0x%02x\n", pdu->PDU_length);
|
||||
INDENTED_PRINTF("PDU Index = 0x%02x\n", pdu->PDU_index);
|
||||
INDENTED_PRINTF("numTLV = 0x%02x\n", pdu->num_TLV);
|
||||
/* call to dump_tx_data_request_tlv */
|
||||
depth--;
|
||||
}
|
||||
}
|
||||
|
||||
void dump_rx_data_indication(const nfapi_nr_rx_data_indication_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p7_message_header(&msg->header, depth);
|
||||
depth++;
|
||||
INDENTED_PRINTF("SFN = %d\n", msg->sfn);
|
||||
INDENTED_PRINTF("Slot = %d\n", msg->slot);
|
||||
INDENTED_PRINTF("Number of PDUs = %d\n", msg->number_of_pdus);
|
||||
for (int pdu_idx = 0; pdu_idx < msg->number_of_pdus; pdu_idx++) {
|
||||
depth++;
|
||||
INDENTED_PRINTF("PDU #%d\n", pdu_idx);
|
||||
const nfapi_nr_rx_data_pdu_t *pdu = &msg->pdu_list[pdu_idx];
|
||||
INDENTED_PRINTF("Handle = 0x%02x\n", pdu->handle);
|
||||
INDENTED_PRINTF("RNTI = 0x%02x\n", pdu->rnti);
|
||||
INDENTED_PRINTF("HarqID = 0x%02x\n", pdu->harq_id);
|
||||
INDENTED_PRINTF("PDU Length = 0x%02x\n", pdu->pdu_length);
|
||||
INDENTED_PRINTF("UL_CQI = 0x%02x\n", pdu->ul_cqi);
|
||||
INDENTED_PRINTF("Timing advance = 0x%02x\n", pdu->timing_advance);
|
||||
INDENTED_PRINTF("RSSI = 0x%02x\n", pdu->rssi);
|
||||
INDENTED_PRINTF("PDU =");
|
||||
for (int i = 0; i < pdu->pdu_length; i++) {
|
||||
printf("%02x ", pdu->pdu[i]);
|
||||
}
|
||||
printf("\n");
|
||||
depth--;
|
||||
}
|
||||
}
|
||||
|
||||
void dump_crc_indication(const nfapi_nr_crc_indication_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p7_message_header(&msg->header, depth);
|
||||
depth++;
|
||||
INDENTED_PRINTF("SFN = %d\n", msg->sfn);
|
||||
INDENTED_PRINTF("Slot = %d\n", msg->slot);
|
||||
INDENTED_PRINTF("NumCRCs = %d\n", msg->number_crcs);
|
||||
for (int i = 0; i < msg->number_crcs; i++) {
|
||||
depth++;
|
||||
INDENTED_PRINTF("CRC #%d\n", i);
|
||||
const nfapi_nr_crc_t *crc = &msg->crc_list[i];
|
||||
INDENTED_PRINTF("Handle = 0x%02x\n", crc->handle);
|
||||
INDENTED_PRINTF("RNTI = 0x%02x\n", crc->rnti);
|
||||
INDENTED_PRINTF("HarqID = 0x%02x\n", crc->harq_id);
|
||||
INDENTED_PRINTF("TbCrcStatus = 0x%02x\n", crc->tb_crc_status);
|
||||
INDENTED_PRINTF("NumCb = 0x%02x\n", crc->num_cb);
|
||||
const uint16_t cb_len = (crc->num_cb / 8) + 1; // length is ceil(NumCb/8)
|
||||
INDENTED_PRINTF("CbCrcStatus =\n");
|
||||
for (int j = 0; j < cb_len; j++) {
|
||||
printf("%02x ", crc->cb_crc_status[j]);
|
||||
}
|
||||
printf("\n");
|
||||
INDENTED_PRINTF("UL_CQI = 0x%02x\n", crc->ul_cqi);
|
||||
INDENTED_PRINTF("Timing advance = 0x%02x\n", crc->timing_advance);
|
||||
INDENTED_PRINTF("RSSI = 0x%02x\n", crc->rssi);
|
||||
depth--;
|
||||
}
|
||||
}
|
||||
|
||||
void dump_uci_indication(const nfapi_nr_uci_indication_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p7_message_header(&msg->header, depth);
|
||||
depth++;
|
||||
INDENTED_PRINTF("SFN = %d\n", msg->sfn);
|
||||
INDENTED_PRINTF("Slot = %d\n", msg->slot);
|
||||
|
||||
INDENTED_PRINTF("NumUCIS = %d\n", msg->num_ucis);
|
||||
for (int i = 0; i < msg->num_ucis; i++) {
|
||||
depth++;
|
||||
INDENTED_PRINTF("UCI #%d\n", i);
|
||||
const nfapi_nr_uci_t *uci = &msg->uci_list[i];
|
||||
INDENTED_PRINTF("PDUType = 0x%02x\n", uci->pdu_type);
|
||||
INDENTED_PRINTF("PDUSize = 0x%02x\n", uci->pdu_size);
|
||||
/* call to dump_uci_indication_<PDU_Type>_pdu */
|
||||
depth--;
|
||||
}
|
||||
}
|
||||
|
||||
void dump_srs_indication(const nfapi_nr_srs_indication_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p7_message_header(&msg->header, depth);
|
||||
depth++;
|
||||
INDENTED_PRINTF("SFN = %d\n", msg->sfn);
|
||||
INDENTED_PRINTF("Slot = %d\n", msg->slot);
|
||||
|
||||
INDENTED_PRINTF("controlLength = %d\n", msg->control_length);
|
||||
INDENTED_PRINTF("Number of PDUs = %d\n", msg->number_of_pdus);
|
||||
for (int i = 0; i < msg->number_of_pdus; i++) {
|
||||
depth++;
|
||||
INDENTED_PRINTF("PDU #%d\n", i);
|
||||
const nfapi_nr_srs_indication_pdu_t *pdu = &msg->pdu_list[i];
|
||||
INDENTED_PRINTF("Handle = 0x%02x\n", pdu->handle);
|
||||
INDENTED_PRINTF("RNTI = 0x%02x\n", pdu->rnti);
|
||||
INDENTED_PRINTF("Timing advance offset = 0x%02x\n", pdu->timing_advance_offset);
|
||||
INDENTED_PRINTF("Timing advance offset in nanoseconds = 0x%02x\n", pdu->timing_advance_offset_nsec);
|
||||
INDENTED_PRINTF("SRS usage = 0x%02x\n", pdu->srs_usage);
|
||||
INDENTED_PRINTF("Report Type = 0x%02x\n", pdu->report_type);
|
||||
/* call to dump_srs_report_tlv */
|
||||
depth--;
|
||||
}
|
||||
}
|
||||
|
||||
void dump_rach_indication(const nfapi_nr_rach_indication_t *msg)
|
||||
{
|
||||
int depth = 0;
|
||||
dump_p7_message_header(&msg->header, depth);
|
||||
depth++;
|
||||
INDENTED_PRINTF("SFN = %d\n", msg->sfn);
|
||||
INDENTED_PRINTF("Slot = %d\n", msg->slot);
|
||||
|
||||
INDENTED_PRINTF("Number of PDUs = %d\n", msg->number_of_pdus);
|
||||
for (int i = 0; i < msg->number_of_pdus; i++) {
|
||||
depth++;
|
||||
INDENTED_PRINTF("PRACH PDU #%d\n", i);
|
||||
const nfapi_nr_prach_indication_pdu_t *pdu = &msg->pdu_list[i];
|
||||
INDENTED_PRINTF("physCellID = 0x%02x\n", pdu->phy_cell_id);
|
||||
INDENTED_PRINTF("SymbolIndex = 0x%02x\n", pdu->symbol_index);
|
||||
INDENTED_PRINTF("SlotIndex = 0x%02x\n", pdu->slot_index);
|
||||
INDENTED_PRINTF("FreqIndex = 0x%02x\n", pdu->freq_index);
|
||||
INDENTED_PRINTF("avgRssi = 0x%02x\n", pdu->avg_rssi);
|
||||
INDENTED_PRINTF("avgSnr = 0x%02x\n", pdu->avg_snr);
|
||||
INDENTED_PRINTF("numPreamble = 0x%02x\n", pdu->num_preamble);
|
||||
for (int j = 0; j < pdu->num_preamble; j++) {
|
||||
depth++;
|
||||
INDENTED_PRINTF("Preamble #%d\n", j);
|
||||
const nfapi_nr_prach_indication_preamble_t *preamble = &pdu->preamble_list[j];
|
||||
INDENTED_PRINTF("preambleIndex = 0x%02x\n", preamble->preamble_index);
|
||||
INDENTED_PRINTF("Timing advance = 0x%02x\n", preamble->timing_advance);
|
||||
INDENTED_PRINTF("PreamblePwr = 0x%02x\n", preamble->preamble_pwr);
|
||||
depth--;
|
||||
}
|
||||
depth--;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,16 +120,14 @@ typedef struct {
|
||||
#define NFAPI_TAG_LENGTH_PACKED_LEN 4
|
||||
|
||||
// Convenience methods to convert between SFN/SLOT formats
|
||||
#define NFAPI_SFNSLOT2DEC(_sfn,_slot) ( _sfn*20 + _slot ) // total count of slots
|
||||
#define NFAPI_SFNSLOTDEC2SFNSLOT(_sfnslot_dec) ((((_sfnslot_dec) / 20) << 6) | (((_sfnslot_dec) - (((_sfnslot_dec) / 20) * 20)) & 0x3F))
|
||||
#define NFAPI_SLOTNUM(_mu) (10 << (_mu))
|
||||
#define NFAPI_SLOTLEN(_mu) (1000.f / (1 << _mu))
|
||||
|
||||
#define NFAPI_SFNSLOT2SFN(_sfnslot) ((_sfnslot) >> 6)
|
||||
#define NFAPI_SFNSLOT2SLOT(_sfnslot) ((_sfnslot) & 0x3F)
|
||||
#define NFAPI_SFNSLOTDEC2SFN(_sfnslot_dec) ((_sfnslot_dec) / 20)
|
||||
#define NFAPI_SFNSLOTDEC2SLOT(_sfnslot_dec) ((_sfnslot_dec) % 20)
|
||||
#define NFAPI_SFNSLOT2HEX(_sfn,_slot) ((_sfn << 6) | (_slot & 0x3F))
|
||||
#define NFAPI_SFNSLOT2DEC(_mu, _sfn, _slot) ((_sfn) * NFAPI_SLOTNUM(_mu) + (_slot))
|
||||
#define NFAPI_SFNSLOTDEC2SFN(_mu, _sfnslot_dec) ((_sfnslot_dec) / NFAPI_SLOTNUM(_mu))
|
||||
#define NFAPI_SFNSLOTDEC2SLOT(_mu, _sfnslot_dec) ((_sfnslot_dec) % NFAPI_SLOTNUM(_mu))
|
||||
|
||||
#define NFAPI_MAX_SFNSLOTDEC 1024*20 // 20 is for numerology 1
|
||||
#define NFAPI_MAX_SFNSLOTDEC(_mu) (1024 * NFAPI_SLOTNUM(_mu))
|
||||
|
||||
// Convenience methods to convert between SFN/SFN formats
|
||||
#define NFAPI_SFNSF2DEC(_sfnsf) ((((_sfnsf) >> 4) * 10) + ((_sfnsf) & 0xF))
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#define _NFAPI_NR_INTERFACE_H_
|
||||
#include "nfapi_common_interface.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#define NFAPI_NR_P5_HEADER_LENGTH 10
|
||||
#define NFAPI_NR_P7_HEADER_LENGTH 18
|
||||
|
||||
@@ -177,6 +179,18 @@ int nfapi_nr_p7_message_unpack(void *pMessageBuf,
|
||||
uint32_t unpackedBufLen,
|
||||
nfapi_p7_codec_config_t *config);
|
||||
|
||||
/*! \brief Peeks the SFN and Slot of an (n)FAPI P7 message
|
||||
* \param pMessageBuf A pointer to an encoded P7 message header
|
||||
* \param messageBufLen The size of the encoded P7 message header
|
||||
* \param SFN A pointer to store the peeked SFN
|
||||
* \param Slot A pointer to store the peeked Slot
|
||||
* \return true on success, false, otherwise.
|
||||
*
|
||||
* The function will decode the encoded SFN and Slot from an encoded P7 (n)FAPI message
|
||||
|
||||
*/
|
||||
bool peek_nr_nfapi_p7_sfn_slot(void *pMessageBuf, uint32_t messageBufLen, uint16_t *SFN, uint16_t *Slot);
|
||||
|
||||
/*! \brief Calculates the checksum of a message
|
||||
*
|
||||
* \param buffer Pointer to the packed message
|
||||
|
||||
@@ -6202,6 +6202,18 @@ int nfapi_p7_message_unpack(void *pMessageBuf,
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool peek_nr_nfapi_p7_sfn_slot(void *pMessageBuf, uint32_t messageBufLen, uint16_t *SFN, uint16_t *Slot)
|
||||
{
|
||||
uint8_t *pReadPackedMessage = &((uint8_t *)pMessageBuf)[NFAPI_NR_P7_HEADER_LENGTH];
|
||||
uint8_t *end = (uint8_t*)pMessageBuf + messageBufLen;
|
||||
if(!(pull16(&pReadPackedMessage, SFN, end) && pull16(&pReadPackedMessage, Slot, end))) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "Failed to peek SFN.Slot\n");
|
||||
return false;
|
||||
}
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "Peeked SFN.Slot is (%d.%d)\n", *SFN, *Slot);
|
||||
return true;
|
||||
}
|
||||
|
||||
int nfapi_nr_p7_message_unpack(void *pMessageBuf,
|
||||
uint32_t messageBufLen,
|
||||
void *pUnpackedBuf,
|
||||
|
||||
@@ -29,37 +29,32 @@
|
||||
|
||||
typedef struct {
|
||||
uint16_t dl_conf_ontime;
|
||||
uint16_t dl_tti_ontime;
|
||||
uint16_t dl_conf_late;
|
||||
uint16_t dl_tti_late;
|
||||
uint16_t ul_conf_ontime;
|
||||
uint16_t ul_tti_ontime;
|
||||
uint16_t ul_conf_late;
|
||||
uint16_t ul_tti_late;
|
||||
uint16_t hi_dci0_ontime;
|
||||
uint16_t hi_dci0_late;
|
||||
uint16_t ul_dci_ontime;
|
||||
uint16_t ul_dci_late;
|
||||
uint16_t tx_ontime;
|
||||
uint16_t tx_late;
|
||||
uint16_t tx_data_ontime;
|
||||
uint16_t tx_data_late;
|
||||
} pnf_p7_stats_t;
|
||||
|
||||
|
||||
typedef struct { // TODO: replace with the stats
|
||||
uint16_t dl_tti_ontime;
|
||||
uint16_t dl_tti_late;
|
||||
uint16_t ul_tti_ontime;
|
||||
uint16_t ul_tti_late;
|
||||
uint16_t ul_dci_ontime;
|
||||
uint16_t ul_dci_late;
|
||||
uint16_t tx_data_ontime;
|
||||
uint16_t tx_data_late;
|
||||
typedef struct pnf_p7_arr_time {
|
||||
uint16_t ontime;
|
||||
uint16_t late;
|
||||
} pnf_p7_arr_time_t;
|
||||
typedef struct pnf_p7_dir {
|
||||
uint32_t bytes;
|
||||
} pnf_p7_dir_t;
|
||||
typedef struct {
|
||||
pnf_p7_arr_time_t dl_tti;
|
||||
pnf_p7_arr_time_t ul_tti;
|
||||
pnf_p7_arr_time_t ul_dci;
|
||||
pnf_p7_arr_time_t tx_data;
|
||||
pnf_p7_dir_t dl;
|
||||
pnf_p7_dir_t ul;
|
||||
} pnf_p7_nr_stats_t;
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8_t* buffer;
|
||||
uint16_t length;
|
||||
@@ -119,6 +114,7 @@ typedef struct {
|
||||
|
||||
uint16_t sfn;
|
||||
uint16_t slot;
|
||||
int mu;
|
||||
uint16_t sfn_slot;
|
||||
uint32_t slot_start_time_hr;
|
||||
int32_t slot_shift;
|
||||
|
||||
@@ -573,11 +573,10 @@ typedef struct
|
||||
//uint16_t sfn_slot
|
||||
uint16_t sfn;
|
||||
uint16_t slot;
|
||||
//TODO: Change P7 structs to NR
|
||||
nfapi_nr_dl_tti_request_t* dl_tti_req;//nfapi_dl_config_request_t* dl_config_req;
|
||||
nfapi_nr_ul_tti_request_t* ul_tti_req;//nfapi_ul_config_request_t* ul_config_req;
|
||||
nfapi_nr_ul_dci_request_t* ul_dci_req;//nfapi_hi_dci0_request_t* hi_dci0_req;
|
||||
nfapi_nr_tx_data_request_t* tx_data_req;//nfapi_tx_request_t* tx_req;
|
||||
nfapi_nr_dl_tti_request_t dl_tti_req;
|
||||
nfapi_nr_ul_tti_request_t ul_tti_req;
|
||||
nfapi_nr_ul_dci_request_t ul_dci_req;
|
||||
nfapi_nr_tx_data_request_t tx_data_req;
|
||||
|
||||
//TODO: check these two later
|
||||
//nfapi_lbt_dl_config_request_t* lbt_dl_config_req;
|
||||
|
||||
+271
-689
File diff suppressed because it is too large
Load Diff
@@ -21,14 +21,15 @@
|
||||
|
||||
nfapi_pnf_p7_config_t* nfapi_pnf_p7_config_create()
|
||||
{
|
||||
pnf_p7_t* _this = (pnf_p7_t*)calloc(1, sizeof(pnf_p7_t));
|
||||
pnf_p7_t* _this = NULL;
|
||||
int rc = posix_memalign((void**)&_this, 32, sizeof(pnf_p7_t));
|
||||
|
||||
if(_this == 0)
|
||||
return 0;
|
||||
if (_this == NULL || rc != 0)
|
||||
return 0;
|
||||
|
||||
|
||||
// set the default parameters
|
||||
_this->_public.segment_size = 1400;
|
||||
_this->_public.segment_size = 65000; // UDP max packet size is 65535
|
||||
_this->max_num_segments = 8;
|
||||
|
||||
_this->_public.subframe_buffer_size = 8;// TODO: Initialize the slot_buffer size
|
||||
@@ -271,7 +272,13 @@ int nfapi_pnf_p7_nr_rx_data_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rx_data_
|
||||
}
|
||||
|
||||
pnf_p7_t* _this = (pnf_p7_t*)(config);
|
||||
return pnf_nr_p7_pack_and_send_p7_message(_this, (nfapi_nr_p7_message_header_t*)ind, sizeof(nfapi_nr_rx_data_indication_t));
|
||||
|
||||
int ret = pnf_nr_p7_pack_and_send_p7_message(_this, (nfapi_nr_p7_message_header_t*)ind, sizeof(nfapi_nr_rx_data_indication_t));
|
||||
if (ret == 0) {
|
||||
for (int i = 0; i < ind->number_of_pdus; ++i)
|
||||
_this->nr_stats.ul.bytes += ind->pdu_list[i].pdu_length;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int nfapi_pnf_p7_nr_crc_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_crc_indication_t* ind)
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
add_executable(nfapi_hex_parser nfapi_hex_parser.c)
|
||||
target_link_libraries(nfapi_hex_parser PUBLIC nr_fapi_p5 nr_fapi_p7)
|
||||
# This makes it so nfapi_hex_parser is always compiled whenever NFAPI_LIB is compiled
|
||||
add_dependencies(NFAPI_LIB nfapi_hex_parser )
|
||||
@@ -0,0 +1,401 @@
|
||||
# Example runs of nfapi_hex_parser
|
||||
## 1 - An invalid DL_TTI.request
|
||||
```
|
||||
./nfapi/open-nFAPI/utils/nfapi_hex_parser 0x00 0x00 0x00 0x80 0x00 0x00 0x01 0x7e 0x00 0x62 0x00 0x00 0x03 0x01 0x00 0x03 0x00 0x15 0x00 0x01 0x00 0x00 0x00 0x00 0x18 0x01 0x06 0x00 0x0d 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x34 0x01 0x11 0x00 0x00 0x00 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0xe0 0x01 0x01 0x06 0x02 0x00 0x00 0x01 0x00 0x00 0x01 0xff 0xff 0x00 0x01 0x00 0x00 0x00 0x04 0x00 0x01 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x1c 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x71 0x00 0x00 0xff 0xff 0x00 0x00 0x01 0x11 0x00 0x00 0x00 0x00 0x01 0x01 0x34 0x02 0x04 0x00 0x00 0x00 0x00 0x00 0x7b 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x04 0x00 0x00 0x01 0x00 0x01 0x00 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x2d 0x00 0x0e 0x00 0x03 0x0b 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||
Parsed 382 bytes:
|
||||
00 00 00 80 00 00 01 7e 00 62 00 00 03 01 00 03
|
||||
00 15 00 01 00 00 00 00 18 01 06 00 0d 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 34 01 11 00 00 00 00 00 02 00
|
||||
00 00 00 e0 01 01 06 02 00 00 01 00 00 01 ff ff
|
||||
00 01 00 00 00 04 00 01 00 01 00 00 00 00 00 00
|
||||
00 00 1c 00 00 00 80 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 01 00 71 00 00 ff ff
|
||||
00 00 01 11 00 00 00 00 01 01 34 02 04 00 00 00
|
||||
00 00 7b 00 00 00 00 00 00 00 00 00 00 00 01 01
|
||||
00 00 00 04 00 00 01 00 01 00 01 01 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 2d 00 0e 00 03 0b 00 00 00 00 00 00 01 00 01
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
Decoded message NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST message length 0x17e
|
||||
Message ID = 0x80
|
||||
Message Length = 0x17e
|
||||
SFN = 98
|
||||
Slot = 0
|
||||
nPDUs = 3
|
||||
nGroup = 1
|
||||
PDU #0
|
||||
PDUType = 0x03 (NFAPI_NR_DL_TTI_SSB_PDU_TYPE)
|
||||
PDUSize = 0x15
|
||||
physCellId = 1
|
||||
BetaPss = 0
|
||||
SSBBlockIndex = 0
|
||||
SSBSubcarrierOffset = 0
|
||||
SSBOffsetPointA = 24
|
||||
bchPayloadFlag = 1
|
||||
bchPayload = 6000d
|
||||
numPRGs = 0
|
||||
prgSize = 0
|
||||
digBFInterfaces = 0
|
||||
PDU #1
|
||||
PDUType = 0x00 (NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE)
|
||||
PDUSize = 0x00
|
||||
BWPSize = 0
|
||||
BWPStart = 0
|
||||
Subcarrier Spacing = 0
|
||||
Ciclic Prefix = 0
|
||||
StartSymbolIndex = 0
|
||||
DurationSymbols = 0
|
||||
FrequencyDomainResource : 0 0 0 0 0 0
|
||||
CCE Reg Mapping Type = 0
|
||||
Reg Bundle Size = 0
|
||||
Interleaver Size = 0
|
||||
CoreSetType = 0
|
||||
ShiftIndex = 0
|
||||
precoderGranularity = 0
|
||||
numDLDCI = 0
|
||||
PDU #2
|
||||
PDUType = 0x00 (NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE)
|
||||
PDUSize = 0x00
|
||||
BWPSize = 0
|
||||
BWPStart = 0
|
||||
Subcarrier Spacing = 0
|
||||
Ciclic Prefix = 0
|
||||
StartSymbolIndex = 0
|
||||
DurationSymbols = 0
|
||||
FrequencyDomainResource : 0 0 0 0 0 0
|
||||
CCE Reg Mapping Type = 0
|
||||
Reg Bundle Size = 0
|
||||
Interleaver Size = 0
|
||||
CoreSetType = 0
|
||||
ShiftIndex = 0
|
||||
precoderGranularity = 0
|
||||
numDLDCI = 0
|
||||
Group #0
|
||||
nUe[0] = 0x00
|
||||
```
|
||||
|
||||
## 2 - A valid ERROR.indication
|
||||
```
|
||||
./nfapi/open-nFAPI/utils/nfapi_hex_parser 0x00 0x00 0x00 0x07 0x00 0x00 0x00 0x06 0x00 0x0a 0x00 0x10 0x80 0x06
|
||||
Parsed values:
|
||||
00 00 00 07 00 00 00 06 00 0a 00 10 80 06
|
||||
Processing message NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION
|
||||
Message ID = 0x07
|
||||
Message Length = 0x06
|
||||
SFN = 0x0a
|
||||
Slot = 0x10
|
||||
Message ID = 0x80
|
||||
Error Code = 0x06 (NFAPI_NR_PHY_API_MSG_INVALID_SFN)
|
||||
```
|
||||
|
||||
## 3 - A valid SLOT.indication
|
||||
```
|
||||
./nfapi/open-nFAPI/utils/nfapi_hex_parser 0x00 0x01 0x00 0x82 0x00 0x00 0x00 0x04 0x00 0x05 0x00 0x06
|
||||
Parsed values:
|
||||
00 01 00 82 00 00 00 04 00 05 00 06
|
||||
Processing message NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION
|
||||
Message ID = 0x82
|
||||
Message Length = 0x04
|
||||
SFN = 5
|
||||
Slot = 6
|
||||
```
|
||||
|
||||
## 4 - A valid ERROR.indication, with diverging formats for the hexdump passed as a parameter
|
||||
```
|
||||
user@user-PC:~/nfapi_parser/cmake_targets/ran_build/build$ ./nfapi/open-nFAPI/utils/nfapi_hex_parser "00 0 0x00 7 0x00 0x00 0x00" 0x06 0x00 "a 0x00 0x10 0x80 7"
|
||||
Parsed 14 bytes:
|
||||
00 00 00 07 00 00 00 06 00 0a 00 10 80 07
|
||||
Decoded message NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION message length 0x06
|
||||
Message ID = 0x07
|
||||
Message Length = 0x06
|
||||
SFN = 0x0a (10)
|
||||
Slot = 0x10 (16)
|
||||
Message ID = 0x80
|
||||
Error Code = 0x07 (NFAPI_NR_PHY_API_MSG_UL_DCI_ERR)
|
||||
```
|
||||
|
||||
## 5 - An invalid message, passing less bytes than the minimum required to encode a FAPI message header
|
||||
```
|
||||
user@user-PC:~/nfapi_parser/cmake_targets/ran_build/build$ ./nfapi/open-nFAPI/utils/nfapi_hex_parser 1
|
||||
Parsed 1 bytes:
|
||||
01
|
||||
|
||||
Assertion (byte_count >= sizeof(fapi_message_header_t)) failed!
|
||||
In main() /home/user/nfapi_parser/nfapi/open-nFAPI/utils/nfapi_hex_parser.c:293
|
||||
Read byte amount not enough to encode the header. Should have a minimum of 8 bytes, aborting...
|
||||
Exiting execution
|
||||
/home/user/nfapi_parser/nfapi/open-nFAPI/utils/nfapi_hex_parser.c:293 main() Exiting OAI (n)FAPI Hex Parser: _Assert_Exit_
|
||||
Aborted (core dumped)
|
||||
```
|
||||
|
||||
## 7 - A valid DL_TTI.request
|
||||
```
|
||||
./nfapi/open-nFAPI/utils/nfapi_hex_parser 0x00 0x01 0x00 0x80 0x00 0x00 0x00 0xc3 0x00 0x02 0x00 0x00 0x03 0x00 0x00 0x03 0x00 0x19 0x00 0x00 0x00 0x00 0x0c 0x00 0xfc 0x01 0x06 0xc6 0x01 0x00 0x00 0x01 0x01 0x13 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x31 0x00 0x30 0x00 0x6e 0x01 0x00 0x00 0x01 0xff 0x00 0x00 0x00 0x00 0x00 0x01 0x06 0x02 0x00 0x00 0x00 0x00 0x00 0x01 0xff 0xff 0x00 0x00 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0x00 0x01 0x00 0x01 0x00 0x27 0x00 0x00 0x14 0x01 0x2d 0x00 0x01 0x00 0x61 0x00 0x00 0xff 0xff 0x00 0x00 0x00 0x30 0x00 0x6e 0x01 0x00 0x01 0x0e 0xce 0x02 0x05 0x00 0x00 0x00 0x00 0x00 0x81 0x00 0x00 0x01 0x00 0x01 0x02 0x44 0x00 0x00 0x00 0x00 0x02 0x00 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x10 0x00 0x02 0x0a 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x02 0x00 0x00 0xe0 0x20 0x10 0x29 0x00 0x01 0x62 0x00 0x00 0x00
|
||||
Parsed 193 bytes:
|
||||
00 01 00 80 00 00 00 c3 00 02 00 00 03 00 00 03
|
||||
00 19 00 00 00 00 0c 00 fc 01 06 c6 01 00 00 01
|
||||
01 13 01 00 00 00 00 00 00 00 31 00 30 00 6e 01
|
||||
00 00 01 ff 00 00 00 00 00 01 06 02 00 00 00 00
|
||||
00 01 ff ff 00 00 00 00 00 04 00 00 00 00 01 00
|
||||
01 00 27 00 00 14 01 2d 00 01 00 61 00 00 ff ff
|
||||
00 00 00 30 00 6e 01 00 01 0e ce 02 05 00 00 00
|
||||
00 00 81 00 00 01 00 01 02 44 00 00 00 00 02 00
|
||||
01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 10 00 02 0a 00 00 00
|
||||
00 01 00 00 02 00 00 e0 20 10 29 00 01 62 00 00
|
||||
00
|
||||
Decoded message NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST message length 0xc3
|
||||
Message ID = 0x80
|
||||
Message Length = 0xc3
|
||||
SFN = 2
|
||||
Slot = 0
|
||||
nPDUs = 3
|
||||
nGroup = 0
|
||||
PDU #0
|
||||
PDUType = 0x03 (NFAPI_NR_DL_TTI_SSB_PDU_TYPE)
|
||||
PDUSize = 0x19
|
||||
physCellId = 0
|
||||
BetaPss = 0
|
||||
SSBBlockIndex = 0
|
||||
SSBSubcarrierOffset = 12
|
||||
SSBOffsetPointA = 252
|
||||
bchPayloadFlag = 1
|
||||
bchPayload = 6c601
|
||||
numPRGs = 1
|
||||
prgSize = 275
|
||||
digBFInterfaces = 1
|
||||
PMIdx = 0
|
||||
beamIDX = 0
|
||||
PDU #1
|
||||
PDUType = 0x00 (NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE)
|
||||
PDUSize = 0x31
|
||||
BWPSize = 48
|
||||
BWPStart = 110
|
||||
Subcarrier Spacing = 1
|
||||
Ciclic Prefix = 0
|
||||
StartSymbolIndex = 0
|
||||
DurationSymbols = 1
|
||||
FrequencyDomainResource : 255 0 0 0 0 0
|
||||
CCE Reg Mapping Type = 1
|
||||
Reg Bundle Size = 6
|
||||
Interleaver Size = 2
|
||||
CoreSetType = 0
|
||||
ShiftIndex = 0
|
||||
precoderGranularity = 0
|
||||
numDLDCI = 1
|
||||
RNTI = 0xffff
|
||||
ScramblingId = 0
|
||||
ScramblingRNTI = 0x0
|
||||
CCEIndex = 0
|
||||
AggregationLevel = 4
|
||||
numPRGs = 0
|
||||
prgSize = 0
|
||||
digBFInterfaces = 1
|
||||
beta_PDCCH_1_0 = 0
|
||||
powerControlOffsetSS = 1
|
||||
PayloadSizeBits = 39
|
||||
Payload = 0x00 0x00 0x14 0x01 0x2d
|
||||
PDU #2
|
||||
PDUType = 0x01 (NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE)
|
||||
PDUSize = 0x61
|
||||
pduBitmap = 0
|
||||
RNTI = ffff
|
||||
pduIndex = 0
|
||||
BWPSize = 48
|
||||
BWPStart = 110
|
||||
SubcarrierSpacing = 1
|
||||
CyclicPrefix = 0
|
||||
NrOfCodewords = 1
|
||||
Codeword #0
|
||||
targetCoderate = 3790
|
||||
qamModOrder = 2
|
||||
mcsIndex = 5
|
||||
mcsTable = 0
|
||||
rvIndex = 0
|
||||
TBSize = 129
|
||||
dataScramblingId = 0
|
||||
nrOfLayers = 1
|
||||
transmissionScheme = 0
|
||||
refPoint = 1
|
||||
dlDmrsSymbPos = 580
|
||||
dmrsConfigType = 0
|
||||
dlDmrsScramblingId = 0
|
||||
SCID = 0
|
||||
numDmrsCdmGrpsNoData = 2
|
||||
dmrsPorts = 1
|
||||
resourceAlloc = 1
|
||||
rbBitmap = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
rbStart = 0
|
||||
rbSize = 16
|
||||
VRBtoPRBMapping = 0
|
||||
StartSymbolIndex = 2
|
||||
NrOfSymbols = 10
|
||||
PTRSPortIndex = 0
|
||||
PTRSTimeDensity = 0
|
||||
PTRSFreqDensity = 0
|
||||
PTRSReOffset = 0
|
||||
nEpreRatioOfPDSCHToPTRS = 0
|
||||
numPRGs = 0
|
||||
prgSize = 0
|
||||
digBFInterfaces = 1
|
||||
powerControlOffset = 0
|
||||
powerControlOffsetSS = 0
|
||||
isLastCbPresent = 0
|
||||
isInlineTbCrc = 0
|
||||
dlTbCrc = 0
|
||||
```
|
||||
|
||||
## 7 - A Valid UL_TTI.request
|
||||
|
||||
```
|
||||
./nfapi/open-nFAPI/utils/nfapi_hex_parser 0x00 0x01 0x00 0x81 0x00 0x00 0x00 0x98 0x02 0xd0 0x00 0x04 0x02 0x00 0x00 0x01 0x00 0x00 0x03 0x00 0x45 0x30 0x39 0x00 0x00 0x00 0x00 0x01 0x11 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x0c 0x3d 0x00 0x28 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x02 0x00 0x50 0x00 0x04 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x10 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x02 0x01 0x00 0x01 0x00 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x02 0x00 0x38 0x30 0x39 0x00 0x00 0x00 0x00 0x01 0x11 0x00 0x00 0x01 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x03 0x0d 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x28 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x07 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||
Parsed 150 bytes:
|
||||
00 01 00 81 00 00 00 98 02 d0 00 04 02 00 00 01
|
||||
00 00 03 00 45 30 39 00 00 00 00 01 11 00 00 01
|
||||
00 00 00 00 0c 3d 00 28 00 00 00 00 00 00 00 00
|
||||
00 02 00 50 00 04 00 00 00 00 00 00 01 10 00 00
|
||||
00 00 00 00 00 02 01 00 01 00 01 01 00 00 00 00
|
||||
00 00 00 00 00 00 00 02 00 38 30 39 00 00 00 00
|
||||
01 11 00 00 01 00 02 00 00 00 00 00 03 0d 01 00
|
||||
00 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 07 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00
|
||||
Decoded message NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST message length 0x98
|
||||
Message ID = 0x81
|
||||
Message Length = 0x98
|
||||
SFN = 720
|
||||
Slot = 4
|
||||
nPDUs = 2
|
||||
RachPresent = 0
|
||||
nULSCH = 0
|
||||
nULCCH = 1
|
||||
nGroup = 0
|
||||
PDU #0
|
||||
PDUType = 0x03 (NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE)
|
||||
PDUSize = 0x45
|
||||
RNTI = 3039
|
||||
Handle = 0
|
||||
BWPSize = 273
|
||||
BWPStart = 0
|
||||
SubcarrierSpacing = 1
|
||||
CyclicPrefix = 0
|
||||
numAntPorts = 0
|
||||
numSymbols = 0
|
||||
numRepetitions = 0
|
||||
timeStartPosition = 12
|
||||
configIndex = 61
|
||||
sequenceId = 40
|
||||
bandwidthIndex = 0
|
||||
combSize = 0
|
||||
combOffset = 0
|
||||
cyclicShift = 0
|
||||
frequencyPosition = 0
|
||||
frequencyShift = 0
|
||||
frequencyHopping = 0
|
||||
groupOrSequenceHopping = 0
|
||||
resourceType = 2
|
||||
Tsrs = 80
|
||||
Toffset = 4
|
||||
TRP Scheme = 0
|
||||
numPRGs = 0
|
||||
prgSize = 0
|
||||
digBFInterface = 0
|
||||
srsBandwidthSize = 272
|
||||
Symbol #0
|
||||
srsBandwidthStart = 0
|
||||
sequenceGroup = 0
|
||||
sequenceNumber = 0
|
||||
Usage = 2 (nUsage = 1)
|
||||
ReportType[0] = 1
|
||||
singular Value Representation = 0
|
||||
iq Representation = 1
|
||||
prgSize = 1
|
||||
numTotalUeAntennas = 1
|
||||
ueAntennasInThisSrsResourceSet = 0
|
||||
sampledUeAntennas = 0
|
||||
reportScope = 0
|
||||
NumULSpatialStreamsPorts = 0
|
||||
PDU #1
|
||||
PDUType = 0x02 (NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE)
|
||||
PDUSize = 0x38
|
||||
RNTI = 3039
|
||||
Handle = 0
|
||||
BWPSize = 273
|
||||
BWPStart = 0
|
||||
SubcarrierSpacing = 1
|
||||
CyclicPrefix = 0
|
||||
FormatType = 2
|
||||
multiSlotTxIndicator = 0
|
||||
pi2Bpsk = 0
|
||||
prbStart = 0
|
||||
prbSize = 3
|
||||
StartSymbolIndex = 13
|
||||
NrOfSymbols = 1
|
||||
freqHopFlag = 0
|
||||
secondHopPRB = 0
|
||||
groupHopFlag = 0
|
||||
sequenceHopFlag = 0
|
||||
hoppingId = 40
|
||||
InitialCyclicShift = 0
|
||||
dataScramblingId = 0
|
||||
TimeDomainOccIdx = 0
|
||||
PreDftOccIdx = 0
|
||||
PreDftOccLen = 0
|
||||
AddDmrsFlag = 0
|
||||
DmrsScramblingId = 0
|
||||
DMRScyclicshift = 0
|
||||
SRFlag = 0
|
||||
BitLenHarq = 0
|
||||
BitLenCsiPart1 = 7
|
||||
BitLenCsiPart2 = 0
|
||||
TRP Scheme = 0
|
||||
numPRGs = 0
|
||||
prgSize = 0
|
||||
digBFInterface = 0
|
||||
|
||||
```
|
||||
|
||||
## 8 - A valid UL_TTI.request with a PRACH PDU
|
||||
|
||||
```
|
||||
./nfapi/open-nFAPI/utils/nfapi_hex_parser 0x00 0x01 0x00 0x81 0x00 0x00 0x00 0x2d 0x02 0xd1 0x00 0x13 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x12 0x00 0x00 0x03 0x05 0x00 0x00 0x00 0x1b 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x08 0x00 0x01 0x0d 0x01 0x00
|
||||
Parsed 43 bytes:
|
||||
00 01 00 81 00 00 00 2d 02 d1 00 13 01 01 00 00
|
||||
00 00 00 00 12 00 00 03 05 00 00 00 1b 00 00 00
|
||||
00 00 01 00 00 08 00 01 0d 01 00
|
||||
Decoded message NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST message length 0x2d
|
||||
Message ID = 0x81
|
||||
Message Length = 0x2d
|
||||
SFN = 721
|
||||
Slot = 19
|
||||
nPDUs = 1
|
||||
RachPresent = 1
|
||||
nULSCH = 0
|
||||
nULCCH = 0
|
||||
nGroup = 0
|
||||
PDU #0
|
||||
PDUType = 0x00 (NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE)
|
||||
PDUSize = 0x12
|
||||
physCellID = 0
|
||||
NumPrachOcas = 3
|
||||
prachFormat = 5 (A2)
|
||||
numRa = 0
|
||||
prachStartSymbol = 0
|
||||
numCs = 27
|
||||
TRP Scheme = 0
|
||||
numPRGs = 0
|
||||
prgSize = 0
|
||||
digBFInterface = 1
|
||||
```
|
||||
@@ -0,0 +1,294 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include "nr_fapi.h"
|
||||
#include "nr_fapi_p5.h"
|
||||
#include "nr_fapi_p5_utils.h"
|
||||
#include "nr_fapi_p7.h"
|
||||
#include "nr_fapi_p7_utils.h"
|
||||
#define MAX_BUFFER_SIZE (1024 * 1024 * 2)
|
||||
|
||||
void exit_function(const char *file, const char *function, const int line, const char *s, const int assert)
|
||||
{
|
||||
if (s != NULL) {
|
||||
printf("%s:%d %s() Exiting OAI (n)FAPI Hex Parser: %s\n", file, line, function, s);
|
||||
}
|
||||
abort();
|
||||
}
|
||||
|
||||
char *message_id_to_str(uint32_t message_id)
|
||||
{
|
||||
switch (message_id) {
|
||||
case NFAPI_NR_PHY_MSG_TYPE_PARAM_REQUEST:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_PARAM_REQUEST";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_PARAM_RESPONSE:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_PARAM_RESPONSE";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_CONFIG_REQUEST:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_CONFIG_REQUEST";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_CONFIG_RESPONSE:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_CONFIG_RESPONSE";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_START_REQUEST:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_START_REQUEST";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_STOP_REQUEST:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_STOP_REQUEST";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_STOP_INDICATION:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_STOP_INDICATION";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION";
|
||||
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
|
||||
return "NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION";
|
||||
default:
|
||||
return "UNKNOWN PHY MSG TYPE";
|
||||
}
|
||||
}
|
||||
|
||||
void unpack_and_dump_message(void *buf, fapi_message_header_t hdr)
|
||||
{
|
||||
void *unpacked_req = calloc(1,MAX_BUFFER_SIZE);
|
||||
AssertFatal(unpacked_req != NULL, "malloc failed");
|
||||
if (hdr.message_id >= NFAPI_NR_PHY_MSG_TYPE_PARAM_REQUEST && hdr.message_id <= NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION) {
|
||||
const int ret = fapi_nr_p5_message_unpack(buf, hdr.message_length + NFAPI_HEADER_LENGTH, unpacked_req, MAX_BUFFER_SIZE, 0);
|
||||
DevAssert(ret >= 0);
|
||||
} else if (hdr.message_id >= NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST && hdr.message_id <= NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION) {
|
||||
const int ret = fapi_nr_p7_message_unpack(buf, hdr.message_length + NFAPI_HEADER_LENGTH, unpacked_req, MAX_BUFFER_SIZE, 0);
|
||||
DevAssert(ret >= 0);
|
||||
}
|
||||
|
||||
switch (hdr.message_id) {
|
||||
/* P5 messages */
|
||||
case NFAPI_NR_PHY_MSG_TYPE_PARAM_REQUEST: {
|
||||
dump_param_request(unpacked_req);
|
||||
free_param_request(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_PARAM_RESPONSE: {
|
||||
dump_param_response(unpacked_req);
|
||||
free_param_response(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_CONFIG_REQUEST: {
|
||||
dump_config_request(unpacked_req);
|
||||
free_config_request(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_CONFIG_RESPONSE: {
|
||||
dump_config_response(unpacked_req);
|
||||
free_config_response(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_START_REQUEST: {
|
||||
dump_start_request(unpacked_req);
|
||||
free_start_request(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE: {
|
||||
dump_start_response(unpacked_req);
|
||||
free_start_response(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_STOP_REQUEST: {
|
||||
dump_stop_request(unpacked_req);
|
||||
free_stop_request(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_STOP_INDICATION: {
|
||||
dump_stop_indication(unpacked_req);
|
||||
free_stop_indication(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION: {
|
||||
dump_error_indication(unpacked_req);
|
||||
free_error_indication(unpacked_req);
|
||||
return;
|
||||
}
|
||||
/* P7 messages */
|
||||
case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: {
|
||||
dump_dl_tti_request(unpacked_req);
|
||||
free_dl_tti_request(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: {
|
||||
dump_ul_tti_request(unpacked_req);
|
||||
free_ul_tti_request(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION: {
|
||||
dump_slot_indication(unpacked_req);
|
||||
free_slot_indication(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: {
|
||||
dump_ul_dci_request(unpacked_req);
|
||||
free_ul_dci_request(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: {
|
||||
dump_tx_data_request(unpacked_req);
|
||||
free_tx_data_request(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: {
|
||||
dump_rx_data_indication(unpacked_req);
|
||||
free_rx_data_indication(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: {
|
||||
dump_crc_indication(unpacked_req);
|
||||
free_crc_indication(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: {
|
||||
dump_uci_indication(unpacked_req);
|
||||
free_crc_indication(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION: {
|
||||
dump_srs_indication(unpacked_req);
|
||||
free_srs_indication(unpacked_req);
|
||||
return;
|
||||
}
|
||||
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: {
|
||||
dump_rach_indication(unpacked_req);
|
||||
free_rach_indication(unpacked_req);
|
||||
return;
|
||||
}
|
||||
default:
|
||||
printf("Unknown Msg ID 0x%02x\n", hdr.message_id);
|
||||
}
|
||||
free(unpacked_req);
|
||||
}
|
||||
|
||||
static uint8_t to_hex(char c)
|
||||
{
|
||||
if (c >= '0' && c <= '9')
|
||||
return c - '0';
|
||||
if (c >= 'a' && c <= 'f')
|
||||
return c - 'a' + 10;
|
||||
printf("found invalid char %c\n", c);
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
/* @brief decodes one byte in text representation (0xab or just ab) of s and places it in b
|
||||
* @return the number of bytes read, or -1 on error */
|
||||
static int parse_byte(const char *s, uint8_t *b)
|
||||
{
|
||||
if (!s)
|
||||
return -1;
|
||||
int c = 0;
|
||||
// skip any whitespaces
|
||||
while (s[0] && isspace(*s)) {
|
||||
c++;
|
||||
s++;
|
||||
}
|
||||
// end of string -> nothing to be read
|
||||
if (s[0] == 0)
|
||||
return -1;
|
||||
// jump over leading "0x"
|
||||
if (s[0] == '0' && s[1] == 'x') {
|
||||
c += 2;
|
||||
s += 2;
|
||||
}
|
||||
// only one digit, if s[1] has other garbage, it will be caught after
|
||||
if (s[1] == 0 || s[1] == ' ') {
|
||||
// only one digit
|
||||
*b = to_hex(s[0]);
|
||||
// check if valid
|
||||
return *b != 0xff ? c + 1 : -1;
|
||||
}
|
||||
// read both bytes, check if valid
|
||||
uint8_t hb = to_hex(s[0]);
|
||||
uint8_t lb = to_hex(s[1]);
|
||||
if (hb == 0xff || lb == 0xff)
|
||||
return -1;
|
||||
*b = ((hb & 0xf) << 4) | (lb & 0xf);
|
||||
return c + 2;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// Check if there are enough arguments
|
||||
if (argc < 2) {
|
||||
printf("Usage: %s [0xNN 0xNN ... | NN NN ... ]\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t hex_values[MAX_BUFFER_SIZE]; // Array to hold the parsed values, assuming max 1024 values
|
||||
int byte_count = 0;
|
||||
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
const char *l = argv[i];
|
||||
int ret;
|
||||
do {
|
||||
ret = parse_byte(l, &hex_values[byte_count]);
|
||||
if (ret > 0)
|
||||
byte_count++;
|
||||
l += ret;
|
||||
} while (ret > 0 && byte_count < MAX_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
// Print the converted values
|
||||
printf("Parsed %d bytes:\n", byte_count);
|
||||
for (int i = 0; i < byte_count; i++) {
|
||||
if (i % 16 == 0 && i != 0) {
|
||||
printf("\n"); // Start a new line every 16 bytes
|
||||
} else if (i % 8 == 0 && i % 16 != 0) {
|
||||
printf(" "); // Add extra space between 8-byte sections
|
||||
}
|
||||
printf("%02x ", hex_values[i]);
|
||||
}
|
||||
printf("\n");
|
||||
AssertFatal(byte_count >= sizeof(fapi_message_header_t), "Read byte amount not enough to encode the header. Should have a minimum of %lu bytes, aborting...", sizeof(fapi_message_header_t));
|
||||
uint8_t *ptr = hex_values; // Points to the first element of the array
|
||||
uint8_t **msg_ptr = &ptr; // Pointer to the pointer
|
||||
|
||||
fapi_message_header_t hdr = {.num_msg = 0, .opaque_handle = 0, .message_id = 0, .message_length = 0};
|
||||
fapi_nr_message_header_unpack(msg_ptr, NFAPI_HEADER_LENGTH, &hdr, sizeof(fapi_message_header_t), 0);
|
||||
|
||||
printf("Decoded message %s message length 0x%02x\n", message_id_to_str(hdr.message_id), hdr.message_length);
|
||||
// Unpack the message
|
||||
unpack_and_dump_message((uint8_t *)hex_values, hdr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -91,6 +91,8 @@ typedef struct nfapi_vnf_p7_connection_info {
|
||||
int sfn_sf;
|
||||
int sfn;
|
||||
int slot;
|
||||
int mu; // some 5G slot calculations need the numerology to know the number
|
||||
// of slots
|
||||
|
||||
int socket;
|
||||
struct sockaddr_in local_addr;
|
||||
|
||||
@@ -901,7 +901,6 @@ void nfapi_vnf_p7_config_destory(nfapi_vnf_p7_config_t* config);
|
||||
* This function is blocking and will not return until the nfapi_vnf_p7_stop
|
||||
* function is called.
|
||||
*/
|
||||
extern queue_t gnb_slot_ind_queue;
|
||||
int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config);
|
||||
int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config);
|
||||
|
||||
@@ -933,13 +932,14 @@ int nfapi_vnf_p7_release_pdu(nfapi_vnf_p7_config_t* config, void*);
|
||||
* \param pnf_p7_addr The udp address the pnf p7 entity has chosen
|
||||
* \param pnf_p7_port The udp port the pnf p7 entity has chosen
|
||||
* \param phy_id The unique phy id for the pnf p7 entity
|
||||
* \param mu The subcarrier spacing the PNF is operating with.
|
||||
* \return A status value. 0 equal success, -1 indicates failure
|
||||
*
|
||||
* This function should be used to each pnf p7 entity that is to be added to this
|
||||
* vnf p7 entity. Once added the vnf p7 entity will start establish sync with the
|
||||
* pnf p7 entity and that has been sucessfull will generate subframe indications for it
|
||||
*/
|
||||
int nfapi_vnf_p7_add_pnf(nfapi_vnf_p7_config_t* config, const char* pnf_p7_addr, int pnf_p7_port, int phy_id);
|
||||
int nfapi_vnf_p7_add_pnf(nfapi_vnf_p7_config_t* config, const char* pnf_p7_addr, int pnf_p7_port, int phy_id, int mu);
|
||||
|
||||
/*! Delete a vnf p7 instance to the vnf p7 module
|
||||
* \param config A pointer to the vnf p7 configuration
|
||||
|
||||
@@ -93,20 +93,14 @@ nfapi_vnf_pnf_info_t* nfapi_vnf_pnf_list_find(nfapi_vnf_config_t* config, int p5
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "config->pnf_list:%p\n", config->pnf_list);
|
||||
|
||||
nfapi_vnf_pnf_info_t* curr = config->pnf_list;
|
||||
while(curr != 0)
|
||||
{
|
||||
if(curr->p5_idx == p5_idx)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s : curr->p5_idx:%d p5_idx:%d\n", __FUNCTION__, curr->p5_idx, p5_idx);
|
||||
return curr;
|
||||
}
|
||||
while (curr != 0) {
|
||||
if (curr->p5_idx == p5_idx)
|
||||
return curr;
|
||||
curr = curr->next;
|
||||
}
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s(): could not find P5 connection for p5_idx %d\n", __func__, p5_idx);
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s : curr->next:%p\n", __FUNCTION__, curr->next);
|
||||
|
||||
curr = curr->next;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void vnf_nr_handle_pnf_param_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_t* config, int p5_idx)
|
||||
@@ -129,7 +123,9 @@ void vnf_nr_handle_pnf_param_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_
|
||||
if(config->pnf_nr_param_resp)
|
||||
{
|
||||
(config->pnf_nr_param_resp)(config, p5_idx, &msg);
|
||||
}
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s(): no pnf_nr_param_resp cb installed\n", __func__);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -162,7 +158,9 @@ void vnf_handle_pnf_param_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_con
|
||||
if(config->pnf_param_resp)
|
||||
{
|
||||
(config->pnf_param_resp)(config, p5_idx, &msg);
|
||||
}
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s(): no pnf_params_resp cb installed\n", __func__);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -196,7 +194,9 @@ void vnf_nr_handle_pnf_config_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf
|
||||
if(config->pnf_nr_config_resp)
|
||||
{
|
||||
(config->pnf_nr_config_resp)(config, p5_idx, &msg);
|
||||
}
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s(): no pnf_nr_config_resp cb installed\n", __func__);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -229,7 +229,9 @@ void vnf_handle_pnf_config_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_co
|
||||
if(config->pnf_config_resp)
|
||||
{
|
||||
(config->pnf_config_resp)(config, p5_idx, &msg);
|
||||
}
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s(): no pnf_config_resp cb installed\n", __func__);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -261,7 +263,9 @@ void vnf_nr_handle_pnf_start_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_
|
||||
if(config->pnf_nr_start_resp)
|
||||
{
|
||||
(config->pnf_nr_start_resp)(config, p5_idx, &msg);
|
||||
}
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s(): no pnf_nr_start_resp cb installed\n", __func__);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -293,7 +297,9 @@ void vnf_handle_pnf_start_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_con
|
||||
if(config->pnf_start_resp)
|
||||
{
|
||||
(config->pnf_start_resp)(config, p5_idx, &msg);
|
||||
}
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s(): no pnf_start_resp cb installed\n", __func__);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -325,7 +331,9 @@ void vnf_handle_pnf_stop_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_conf
|
||||
if(config->pnf_stop_resp)
|
||||
{
|
||||
(config->pnf_stop_resp)(config, p5_idx, &msg);
|
||||
}
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s(): no pnf_stop_resp cb installed\n", __func__);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -565,7 +573,9 @@ void vnf_handle_start_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_config_
|
||||
if(config->start_resp)
|
||||
{
|
||||
(config->start_resp)(config, p5_idx, &msg);
|
||||
}
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s(): no start_resp cb installed\n", __func__);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -598,7 +608,9 @@ void vnf_nr_handle_start_response(void *pRecvMsg, int recvMsgLen, nfapi_vnf_conf
|
||||
if(config->nr_start_resp)
|
||||
{
|
||||
(config->nr_start_resp)(config, p5_idx, &msg);
|
||||
}
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s(): no nr_start_resp cb installed\n", __func__);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -89,16 +89,14 @@ void vnf_p7_connection_info_list_add(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_i
|
||||
nfapi_vnf_p7_connection_info_t* vnf_p7_connection_info_list_find(vnf_p7_t* vnf_p7, uint16_t phy_id)
|
||||
{
|
||||
nfapi_vnf_p7_connection_info_t* curr = vnf_p7->p7_connections;
|
||||
while(curr != 0)
|
||||
{
|
||||
if(curr->phy_id == phy_id)
|
||||
{
|
||||
return curr;
|
||||
}
|
||||
curr = curr->next;
|
||||
}
|
||||
while (curr != 0) {
|
||||
if (curr->phy_id == phy_id)
|
||||
return curr;
|
||||
curr = curr->next;
|
||||
}
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s(): could not find P7 connection for phy_id %d\n", __func__, phy_id);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
nfapi_vnf_p7_connection_info_t* vnf_p7_connection_info_list_delete(vnf_p7_t* vnf_p7, uint16_t phy_id)
|
||||
@@ -243,7 +241,7 @@ void vnf_p7_rx_reassembly_queue_remove_old_msgs(vnf_p7_t* vnf_p7, vnf_p7_rx_reas
|
||||
previous->next = iterator->next;
|
||||
}
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "Deleting stale reassembly message (%u %u %d)\n", iterator->rx_hr_time, rx_hr_time, delta);
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "Deleting stale reassembly message (packet rx_hr_time %u current rx_hr_time %u delta %d us)\n", iterator->rx_hr_time, rx_hr_time, delta);
|
||||
|
||||
vnf_p7_rx_message_t* to_delete = iterator;
|
||||
iterator = iterator->next;
|
||||
@@ -364,13 +362,13 @@ uint32_t calculate_t1(uint16_t sfn_sf, uint32_t sf_start_time_hr)
|
||||
return t1;
|
||||
}
|
||||
|
||||
uint32_t calculate_nr_t1(uint16_t sfn, uint16_t slot, uint32_t slot_start_time_hr)
|
||||
uint32_t calculate_nr_t1(int mu, uint16_t sfn, uint16_t slot, uint32_t slot_start_time_hr)
|
||||
{
|
||||
uint32_t now_time_hr = vnf_get_current_time_hr();
|
||||
|
||||
uint32_t slot_time_us = get_slot_time(now_time_hr, slot_start_time_hr);
|
||||
|
||||
uint32_t t1 = (NFAPI_SFNSLOT2DEC(sfn,slot) * 500) + slot_time_us;
|
||||
uint32_t t1 = NFAPI_SFNSLOT2DEC(mu, sfn,slot) * NFAPI_SLOTLEN(mu) + slot_time_us;
|
||||
|
||||
return t1;
|
||||
}
|
||||
@@ -386,24 +384,24 @@ uint32_t calculate_t4(uint32_t now_time_hr, uint16_t sfn_sf, uint32_t sf_start_t
|
||||
|
||||
}
|
||||
|
||||
uint32_t calculate_nr_t4(uint32_t now_time_hr, uint16_t sfn, uint16_t slot, uint32_t slot_start_time_hr)
|
||||
uint32_t calculate_nr_t4(uint32_t now_time_hr, int mu, uint16_t sfn, uint16_t slot, uint32_t slot_start_time_hr)
|
||||
{
|
||||
uint32_t slot_time_us = get_slot_time(now_time_hr, slot_start_time_hr);
|
||||
|
||||
uint32_t t4 = (NFAPI_SFNSLOT2DEC(sfn,slot) * 500) + slot_time_us;
|
||||
uint32_t t4 = NFAPI_SFNSLOT2DEC(mu, sfn,slot) * NFAPI_SLOTLEN(mu) + slot_time_us;
|
||||
|
||||
return t4;
|
||||
|
||||
}
|
||||
|
||||
|
||||
uint32_t calculate_transmit_timestamp(uint16_t sfn, uint16_t slot, uint32_t slot_start_time_hr)
|
||||
uint32_t calculate_transmit_timestamp(int mu, uint16_t sfn, uint16_t slot, uint32_t slot_start_time_hr)
|
||||
{
|
||||
uint32_t now_time_hr = vnf_get_current_time_hr();
|
||||
|
||||
uint32_t slot_time_us = get_slot_time(now_time_hr, slot_start_time_hr);
|
||||
|
||||
uint32_t tt = (NFAPI_SFNSLOT2DEC(sfn, slot) * 500) + slot_time_us;
|
||||
uint32_t tt = NFAPI_SFNSLOT2DEC(mu, sfn, slot) * NFAPI_SLOTLEN(mu) + slot_time_us;
|
||||
|
||||
return tt;
|
||||
}
|
||||
@@ -509,7 +507,7 @@ int vnf_nr_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_nr_p7_message_header_
|
||||
int segment = 0;
|
||||
int offset = NFAPI_NR_P7_HEADER_LENGTH;
|
||||
uint8_t tx_buffer[vnf_p7->_public.segment_size];
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() MORE THAN ONE SEGMENT phy_id:%d nfapi_p7_message_pack()=len=%d vnf_p7->_public.segment_size:%u\n", __FUNCTION__, header->phy_id, len, vnf_p7->_public.segment_size);
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "%s() MORE THAN ONE SEGMENT phy_id:%d nfapi_p7_message_pack()=len=%d vnf_p7->_public.segment_size:%u\n", __FUNCTION__, header->phy_id, len, vnf_p7->_public.segment_size);
|
||||
for(segment = 0; segment < segment_count; ++segment)
|
||||
{
|
||||
uint8_t last = 0;
|
||||
@@ -540,7 +538,7 @@ int vnf_nr_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_nr_p7_message_header_
|
||||
nfapi_nr_p7_update_checksum(tx_buffer, segment_size);
|
||||
}
|
||||
|
||||
nfapi_nr_p7_update_transmit_timestamp(buffer, calculate_transmit_timestamp(p7_connection->sfn, p7_connection->slot, vnf_p7->slot_start_time_hr));
|
||||
nfapi_nr_p7_update_transmit_timestamp(buffer, calculate_transmit_timestamp(p7_connection->mu, 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);
|
||||
|
||||
@@ -553,7 +551,7 @@ int vnf_nr_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_nr_p7_message_header_
|
||||
nfapi_nr_p7_update_checksum(buffer, len);
|
||||
}
|
||||
|
||||
nfapi_nr_p7_update_transmit_timestamp(buffer, calculate_transmit_timestamp(p7_connection->sfn, p7_connection->slot, vnf_p7->slot_start_time_hr));
|
||||
nfapi_nr_p7_update_transmit_timestamp(buffer, calculate_transmit_timestamp(p7_connection->mu, p7_connection->sfn, p7_connection->slot, vnf_p7->slot_start_time_hr));
|
||||
|
||||
// simple case that the message fits in a single segement
|
||||
send_result = vnf_send_p7_msg(vnf_p7, p7_connection, &buffer[0], len);
|
||||
@@ -634,7 +632,7 @@ int vnf_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t* hea
|
||||
nfapi_p7_update_checksum(tx_buffer, segment_size);
|
||||
}
|
||||
|
||||
nfapi_p7_update_transmit_timestamp(buffer, calculate_transmit_timestamp(p7_connection->sfn, p7_connection->slot, vnf_p7->slot_start_time_hr));
|
||||
nfapi_p7_update_transmit_timestamp(buffer, calculate_transmit_timestamp(p7_connection->mu, 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);
|
||||
}
|
||||
@@ -646,7 +644,7 @@ int vnf_p7_pack_and_send_p7_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t* hea
|
||||
nfapi_p7_update_checksum(buffer, len);
|
||||
}
|
||||
|
||||
nfapi_p7_update_transmit_timestamp(buffer, calculate_transmit_timestamp(p7_connection->sfn, p7_connection->slot, vnf_p7->slot_start_time_hr));
|
||||
nfapi_p7_update_transmit_timestamp(buffer, calculate_transmit_timestamp(p7_connection->mu, p7_connection->sfn, p7_connection->slot, vnf_p7->slot_start_time_hr));
|
||||
|
||||
// simple case that the message fits in a single segement
|
||||
send_result = vnf_send_p7_msg(vnf_p7, p7_connection, &buffer[0], len);
|
||||
@@ -683,7 +681,7 @@ int vnf_nr_build_send_dl_node_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_inf
|
||||
dl_node_sync.header.phy_id = p7_info->phy_id;
|
||||
dl_node_sync.header.message_id = NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC;
|
||||
//dl_node_sync.t1 = calculate_t1(p7_info->sfn_sf, vnf_p7->sf_start_time_hr);
|
||||
dl_node_sync.t1 = calculate_nr_t1(p7_info->sfn,p7_info->slot, vnf_p7->slot_start_time_hr);
|
||||
dl_node_sync.t1 = calculate_nr_t1(p7_info->mu, p7_info->sfn,p7_info->slot, vnf_p7->slot_start_time_hr);
|
||||
dl_node_sync.delta_sfn_slot = 0;
|
||||
|
||||
return vnf_nr_p7_pack_and_send_p7_msg(vnf_p7, &dl_node_sync.header);
|
||||
@@ -695,11 +693,9 @@ int vnf_nr_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* p7_info)
|
||||
if(p7_info->in_sync == 1)
|
||||
{
|
||||
uint16_t dl_sync_period_mask = p7_info->dl_in_sync_period-1;
|
||||
// uint16_t sfn_sf_dec = NFAPI_SFNSF2DEC(p7_info->sfn_sf);
|
||||
uint16_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(p7_info->sfn,p7_info->slot);
|
||||
uint16_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(p7_info->mu, p7_info->sfn,p7_info->slot);
|
||||
|
||||
//if ((((sfn_sf_dec + p7_info->dl_in_sync_offset) % NFAPI_MAX_SFNSFDEC) & dl_sync_period_mask) == 0)
|
||||
if ((((sfn_slot_dec + p7_info->dl_in_sync_offset) % NFAPI_MAX_SFNSLOTDEC) & dl_sync_period_mask) == 0)
|
||||
if ((((sfn_slot_dec + p7_info->dl_in_sync_offset) % NFAPI_MAX_SFNSLOTDEC(p7_info->mu)) & dl_sync_period_mask) == 0)
|
||||
{
|
||||
vnf_nr_build_send_dl_node_sync(vnf_p7, p7_info);
|
||||
}
|
||||
@@ -708,10 +704,9 @@ int vnf_nr_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* p7_info)
|
||||
{
|
||||
uint16_t dl_sync_period_mask = p7_info->dl_out_sync_period-1;
|
||||
//uint16_t sfn_sf_dec = NFAPI_SFNSF2DEC(p7_info->sfn_sf);
|
||||
uint16_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(p7_info->sfn, p7_info->slot);
|
||||
uint16_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(p7_info->mu, p7_info->sfn, p7_info->slot);
|
||||
|
||||
//if ((((sfn_sf_dec + p7_info->dl_out_sync_offset) % NFAPI_MAX_SFNSFDEC) & dl_sync_period_mask) == 0)
|
||||
if ((((sfn_slot_dec + p7_info->dl_out_sync_offset) % NFAPI_MAX_SFNSLOTDEC) & dl_sync_period_mask) == 0)
|
||||
if ((((sfn_slot_dec + p7_info->dl_out_sync_offset) % NFAPI_MAX_SFNSLOTDEC(p7_info->mu)) & dl_sync_period_mask) == 0)
|
||||
{
|
||||
vnf_nr_build_send_dl_node_sync(vnf_p7, p7_info);
|
||||
}
|
||||
@@ -1499,7 +1494,7 @@ void vnf_handle_nr_slot_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf
|
||||
}
|
||||
else
|
||||
{
|
||||
nfapi_nr_slot_indication_scf_t ind;
|
||||
nfapi_nr_slot_indication_scf_t ind = {0};
|
||||
|
||||
if(nfapi_nr_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
|
||||
{
|
||||
@@ -1534,7 +1529,7 @@ void vnf_handle_nr_rx_data_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t*
|
||||
}
|
||||
else
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling RX Indication\n", __FUNCTION__);
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "%s: Handling RX Indication\n", __FUNCTION__);
|
||||
if(vnf_p7->_public.nr_rx_data_indication)
|
||||
{
|
||||
(vnf_p7->_public.nr_rx_data_indication)(&ind);
|
||||
@@ -1561,7 +1556,7 @@ void vnf_handle_nr_crc_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_
|
||||
}
|
||||
else
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling CRC Indication\n", __FUNCTION__);
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "%s: Handling CRC Indication\n", __FUNCTION__);
|
||||
if(vnf_p7->_public.nr_crc_indication)
|
||||
{
|
||||
(vnf_p7->_public.nr_crc_indication)(&ind);
|
||||
@@ -1614,7 +1609,7 @@ void vnf_handle_nr_uci_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_
|
||||
}
|
||||
else
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling UCI Indication\n", __FUNCTION__);
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "%s: Handling UCI Indication\n", __FUNCTION__);
|
||||
if(vnf_p7->_public.nr_uci_indication)
|
||||
{
|
||||
(vnf_p7->_public.nr_uci_indication)(&ind);
|
||||
@@ -1673,9 +1668,9 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "Received UL_NODE_SYNC phy_id:%d t1:%d t2:%d t3:%d\n", ind.header.phy_id, ind.t1, ind.t2, ind.t3);
|
||||
|
||||
nfapi_vnf_p7_connection_info_t* phy = vnf_p7_connection_info_list_find(vnf_p7, ind.header.phy_id);
|
||||
uint32_t t4 = calculate_nr_t4(now_time_hr, phy->sfn, phy->slot, vnf_p7->slot_start_time_hr);
|
||||
uint32_t t4 = calculate_nr_t4(now_time_hr, phy->mu, phy->sfn, phy->slot, vnf_p7->slot_start_time_hr);
|
||||
|
||||
uint32_t tx_2_rx = t4>ind.t1 ? t4 - ind.t1 : t4 + NFAPI_MAX_SFNSLOTDEC - ind.t1 ; //time taken to receive ul node sync - time taken to send dl node sync
|
||||
uint32_t tx_2_rx = t4>ind.t1 ? t4 - ind.t1 : t4 + NFAPI_MAX_SFNSLOTDEC(phy->mu) - ind.t1 ; //time taken to receive ul node sync - time taken to send dl node sync
|
||||
uint32_t pnf_proc_time = ind.t3 - ind.t2;
|
||||
|
||||
// divide by 2 using shift operator
|
||||
@@ -1700,12 +1695,12 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
|
||||
if (ind.t2 < phy->previous_t2 && ind.t1 > phy->previous_t1)
|
||||
{
|
||||
// Only t2 wrap has occurred!!!
|
||||
phy->slot_offset = (NFAPI_MAX_SFNSLOTDEC + ind.t2) - ind.t1 - latency;
|
||||
phy->slot_offset = (NFAPI_MAX_SFNSLOTDEC(phy->mu) + ind.t2) - ind.t1 - latency;
|
||||
}
|
||||
else if (ind.t2 > phy->previous_t2 && ind.t1 < phy->previous_t1)
|
||||
{
|
||||
// Only t1 wrap has occurred
|
||||
phy->slot_offset = ind.t2 - ( ind.t1 + NFAPI_MAX_SFNSLOTDEC) - latency;
|
||||
phy->slot_offset = ind.t2 - ( ind.t1 + NFAPI_MAX_SFNSLOTDEC(phy->mu)) - latency;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1757,7 +1752,7 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
|
||||
{
|
||||
uint32_t curr_sfn = phy->sfn;
|
||||
uint32_t curr_slot = phy->slot;
|
||||
int32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(phy->sfn,phy->slot);
|
||||
int32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(phy->mu, phy->sfn,phy->slot);
|
||||
|
||||
if(!phy->filtered_adjust)
|
||||
{
|
||||
@@ -1774,7 +1769,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(phy->mu, sfn_slot_dec),NFAPI_SFNSLOTDEC2SLOT(phy->mu, sfn_slot_dec) );
|
||||
|
||||
|
||||
}
|
||||
@@ -1786,19 +1781,19 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
|
||||
|
||||
if(sfn_slot_dec < 0)
|
||||
{
|
||||
sfn_slot_dec += NFAPI_MAX_SFNSLOTDEC;
|
||||
sfn_slot_dec += NFAPI_MAX_SFNSLOTDEC(phy->mu);
|
||||
}
|
||||
else if( sfn_slot_dec >= NFAPI_MAX_SFNSLOTDEC)
|
||||
else if( sfn_slot_dec >= NFAPI_MAX_SFNSLOTDEC(phy->mu))
|
||||
{
|
||||
sfn_slot_dec -= NFAPI_MAX_SFNSLOTDEC;
|
||||
sfn_slot_dec -= NFAPI_MAX_SFNSLOTDEC(phy->mu);
|
||||
}
|
||||
|
||||
|
||||
uint16_t new_sfn = NFAPI_SFNSLOTDEC2SFN(sfn_slot_dec);
|
||||
uint16_t new_slot = NFAPI_SFNSLOTDEC2SLOT(sfn_slot_dec);
|
||||
uint16_t new_sfn = NFAPI_SFNSLOTDEC2SFN(phy->mu, sfn_slot_dec);
|
||||
uint16_t new_slot = NFAPI_SFNSLOTDEC2SLOT(phy->mu, sfn_slot_dec);
|
||||
|
||||
{
|
||||
phy->adjustment = NFAPI_SFNSLOT2DEC(new_sfn, new_slot) - NFAPI_SFNSLOT2DEC(curr_sfn, curr_slot);
|
||||
phy->adjustment = NFAPI_SFNSLOT2DEC(phy->mu, new_sfn, new_slot) - NFAPI_SFNSLOT2DEC(phy->mu, curr_sfn, curr_slot);
|
||||
|
||||
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "PNF to VNF phy_id:%d adjustment%d phy->previous_slot_offset_filtered:%d phy->previous_slot_offset_filtered:%d phy->slot_offset_trend:%d\n", ind.header.phy_id, phy->adjustment, phy->previous_slot_offset_filtered, phy->previous_slot_offset_filtered, phy->slot_offset_trend);
|
||||
|
||||
@@ -1906,15 +1901,24 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
|
||||
|
||||
if(phy->insync_minor_adjustment != 0)
|
||||
{
|
||||
// NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d slots (slot_offset_filtered:%d) %d %d %d NEW:%d CURR:%d adjustment:%d\n",
|
||||
// phy->sfn, phy->slot, ind.header.phy_id,
|
||||
// phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration,
|
||||
// phy->slot_offset_filtered,
|
||||
// insync_minor_adjustment_1, insync_minor_adjustment_2, phy->slot_offset_trend,
|
||||
// NFAPI_SFNSLOT2DEC(new_sfn, new_slot),
|
||||
// NFAPI_SFNSLOT2DEC(curr_sfn, curr_slot),
|
||||
// phy->adjustment);
|
||||
}
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG,
|
||||
"(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d slots (slot_offset_filtered:%d) %d %d "
|
||||
"%d NEW:%d.%d CURR:%d.%d adjustment:%d\n",
|
||||
phy->sfn,
|
||||
phy->slot,
|
||||
ind.header.phy_id,
|
||||
phy->insync_minor_adjustment,
|
||||
phy->insync_minor_adjustment_duration,
|
||||
phy->slot_offset_filtered,
|
||||
insync_minor_adjustment_1,
|
||||
insync_minor_adjustment_2,
|
||||
phy->slot_offset_trend,
|
||||
new_sfn,
|
||||
new_slot,
|
||||
curr_sfn,
|
||||
curr_slot,
|
||||
phy->adjustment);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1948,16 +1952,27 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
|
||||
{
|
||||
// out of sync?
|
||||
}
|
||||
|
||||
// NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d slots (adjustment:%d slot_offset_filtered:%d) %d %d %d NEW:%d CURR:%d adj:%d\n",
|
||||
// phy->sfn, phy->slot, ind.header.phy_id,
|
||||
// phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration, phy->adjustment, phy->slot_offset_filtered,
|
||||
// insync_minor_adjustment_1, insync_minor_adjustment_2, phy->slot_offset_trend,
|
||||
// NFAPI_SFNSLOT2DEC(new_sfn, new_slot),
|
||||
// NFAPI_SFNSLOT2DEC(curr_sfn, curr_slot),
|
||||
// phy->adjustment);
|
||||
|
||||
}
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG,
|
||||
"(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d slots (adjustment:%d "
|
||||
"slot_offset_filtered:%d) %d %d %d NEW:%d.%d CURR:%d.%d adj:%d\n",
|
||||
phy->sfn,
|
||||
phy->slot,
|
||||
ind.header.phy_id,
|
||||
phy->insync_minor_adjustment,
|
||||
phy->insync_minor_adjustment_duration,
|
||||
phy->adjustment,
|
||||
phy->slot_offset_filtered,
|
||||
insync_minor_adjustment_1,
|
||||
insync_minor_adjustment_2,
|
||||
phy->slot_offset_trend,
|
||||
new_sfn,
|
||||
new_slot,
|
||||
curr_sfn,
|
||||
curr_slot,
|
||||
phy->adjustment);
|
||||
|
||||
}
|
||||
else if(phy->adjustment < 0)
|
||||
{
|
||||
// VNF is fast
|
||||
@@ -2088,15 +2103,16 @@ void vnf_nr_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||
if (vnf_p7 && vnf_p7->p7_connections)
|
||||
{
|
||||
//int16_t vnf_pnf_sfnsf_delta = NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf) - NFAPI_SFNSF2DEC(ind.last_sfn_sf);
|
||||
vnf_pnf_sfnslot_delta = NFAPI_SFNSLOT2DEC(vnf_p7->p7_connections[0].sfn,vnf_p7->p7_connections[0].slot) - NFAPI_SFNSLOT2DEC(ind.last_sfn,ind.last_slot);
|
||||
nfapi_vnf_p7_connection_info_t *p7_con = &vnf_p7->p7_connections[0];
|
||||
vnf_pnf_sfnslot_delta = NFAPI_SFNSLOT2DEC(p7_con->mu, p7_con->sfn,p7_con->slot) - NFAPI_SFNSLOT2DEC(p7_con->mu, ind.last_sfn,ind.last_slot);
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PNF:SFN/SF:%d VNF:SFN/SF:%d deltaSFNSF:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind.last_sfn_sf), NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf), vnf_pnf_sfnsf_delta);
|
||||
|
||||
// Panos: Careful here!!! Modification of the original nfapi-code
|
||||
//if (vnf_pnf_sfnsf_delta>1 || vnf_pnf_sfnsf_delta < -1)
|
||||
//printf("VNF-PNF delta - %d", vnf_pnf_sfnslot_delta);
|
||||
if (vnf_pnf_sfnslot_delta != 0)
|
||||
if (vnf_pnf_sfnslot_delta > 1) // we need to have a small delta, otherwise it would mean we don't advance
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() LARGE SFN/SLOT DELTA between PNF and VNF. Delta %d. PNF:%d.%d VNF:%d.%d\n\n\n\n\n\n\n\n\n",
|
||||
NFAPI_TRACE(NFAPI_TRACE_WARN, "%s() LARGE SFN/SLOT DELTA between PNF and VNF. Delta %d slots. PNF:%d.%d VNF:%d.%d\n",
|
||||
__FUNCTION__, vnf_pnf_sfnslot_delta,
|
||||
ind.last_sfn, ind.last_slot,
|
||||
vnf_p7->p7_connections[0].sfn, vnf_p7->p7_connections[0].slot);
|
||||
@@ -2507,7 +2523,8 @@ void vnf_nr_handle_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||
vnf_p7_rx_reassembly_queue_remove_msg(vnf_p7, &(phy->reassembly_queue), rx_msg);
|
||||
}
|
||||
|
||||
vnf_p7_rx_reassembly_queue_remove_old_msgs(vnf_p7, &(phy->reassembly_queue), 1000);
|
||||
// see corresponding comment in pnf_nr_handle_p7_message() [same commit]
|
||||
vnf_p7_rx_reassembly_queue_remove_old_msgs(vnf_p7, &(phy->reassembly_queue), 10000);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ nfapi_vnf_p7_config_t* nfapi_vnf_p7_config_create()
|
||||
return 0;
|
||||
|
||||
// todo : initialize
|
||||
_this->_public.segment_size = 1400;
|
||||
_this->_public.segment_size = 65000; // UDP max packet size is 65535
|
||||
_this->_public.max_num_segments = 8;
|
||||
_this->_public.checksum_enabled = 1;
|
||||
|
||||
@@ -98,8 +98,6 @@ struct timespec timespec_sub(struct timespec lhs, struct timespec rhs)
|
||||
// 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;
|
||||
|
||||
@@ -157,7 +155,6 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
|
||||
|
||||
struct timespec ref_time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ref_time);
|
||||
uint8_t setup_done;
|
||||
while(vnf_p7->terminate == 0)
|
||||
{
|
||||
fd_set rfds;
|
||||
@@ -169,39 +166,6 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
|
||||
FD_SET(vnf_p7->socket, &rfds);
|
||||
maxSock = vnf_p7->socket;
|
||||
|
||||
if (setup_done == 0) {
|
||||
struct timespec curr_time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &curr_time);
|
||||
uint8_t setup_time = curr_time.tv_sec - ref_time.tv_sec;
|
||||
if (setup_time > 3) {
|
||||
setup_done = 1;
|
||||
}
|
||||
}
|
||||
|
||||
nfapi_nr_slot_indication_scf_t *slot_ind = get_queue(&gnb_slot_ind_queue);
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "This is the slot_ind queue size %ld in %s():%d\n",
|
||||
gnb_slot_ind_queue.num_items, __FUNCTION__, __LINE__);
|
||||
if (slot_ind) {
|
||||
NR_UL_IND_t UL_INFO = {.frame = slot_ind->sfn, .slot = slot_ind->slot};
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "UL_INFO.frame = %d and slot %d, prev_slot = %d\n", UL_INFO.frame, UL_INFO.slot, prev_slot);
|
||||
if (setup_done && prev_slot != UL_INFO.slot) { // Give the VNF sufficient time to setup before starting scheduling &&
|
||||
// prev_slot != UL_INFO.slot
|
||||
|
||||
// Call the scheduler
|
||||
UL_INFO.module_id = gNB->Mod_id;
|
||||
UL_INFO.CC_id = gNB->CC_id;
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG,
|
||||
"Calling NR_UL_indication for UL_INFO.frame = %d and slot %d\n",
|
||||
UL_INFO.frame,
|
||||
UL_INFO.slot);
|
||||
gNB->if_inst->NR_UL_indication(&UL_INFO);
|
||||
prev_slot = UL_INFO.slot;
|
||||
}
|
||||
free(slot_ind);
|
||||
slot_ind = NULL;
|
||||
}
|
||||
|
||||
selectRetval = pselect(maxSock+1, &rfds, NULL, NULL, &pselect_timeout, NULL);
|
||||
|
||||
if(selectRetval == 0)
|
||||
@@ -570,7 +534,7 @@ int nfapi_vnf_p7_stop(nfapi_vnf_p7_config_t* config)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nfapi_vnf_p7_add_pnf(nfapi_vnf_p7_config_t* config, const char* pnf_p7_addr, int pnf_p7_port, int phy_id)
|
||||
int nfapi_vnf_p7_add_pnf(nfapi_vnf_p7_config_t* config, const char* pnf_p7_addr, int pnf_p7_port, int phy_id, int mu)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(config:%p phy_id:%d pnf_addr:%s pnf_p7_port:%d)\n", __FUNCTION__, config, phy_id, pnf_p7_addr, pnf_p7_port);
|
||||
|
||||
@@ -594,6 +558,7 @@ int nfapi_vnf_p7_add_pnf(nfapi_vnf_p7_config_t* config, const char* pnf_p7_addr,
|
||||
node->sfn = 0;
|
||||
node->slot = 0;
|
||||
node->min_sync_cycle_count = 8;
|
||||
node->mu = mu;
|
||||
|
||||
// save the remote endpoint information
|
||||
node->remote_addr.sin_family = AF_INET;
|
||||
|
||||
@@ -769,7 +769,7 @@ int start_response(nfapi_vnf_config_t* config, int p5_idx, nfapi_start_response_
|
||||
|
||||
vnf_test_config_vnf_t* vnf = &(vnf_test_config[0].vnfs[phy->vnf_idx]);
|
||||
|
||||
nfapi_vnf_p7_add_pnf(vnf->config, addr, port, response->header.phy_id);
|
||||
nfapi_vnf_p7_add_pnf(vnf->config, addr, port, response->header.phy_id, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -22,7 +22,7 @@
|
||||
#include "nr_fapi_p5.h"
|
||||
#include "nr_fapi_p5_utils.h"
|
||||
|
||||
void fill_config_request_tlv(nfapi_nr_config_request_scf_t *nfapi_resp)
|
||||
static void fill_config_request_tlv_tdd_rand(nfapi_nr_config_request_scf_t *nfapi_resp)
|
||||
{
|
||||
FILL_TLV(nfapi_resp->carrier_config.dl_bandwidth, NFAPI_NR_CONFIG_DL_BANDWIDTH_TAG, rand16());
|
||||
nfapi_resp->num_tlv++;
|
||||
@@ -70,7 +70,8 @@ void fill_config_request_tlv(nfapi_nr_config_request_scf_t *nfapi_resp)
|
||||
FILL_TLV(nfapi_resp->cell_config.phy_cell_id, NFAPI_NR_CONFIG_PHY_CELL_ID_TAG, rand16());
|
||||
nfapi_resp->num_tlv++;
|
||||
|
||||
FILL_TLV(nfapi_resp->cell_config.frame_duplex_type, NFAPI_NR_CONFIG_FRAME_DUPLEX_TYPE_TAG, rand8());
|
||||
// TDD because below we pack the TDD table
|
||||
FILL_TLV(nfapi_resp->cell_config.frame_duplex_type, NFAPI_NR_CONFIG_FRAME_DUPLEX_TYPE_TAG, 1 /* TDD */);
|
||||
nfapi_resp->num_tlv++;
|
||||
|
||||
FILL_TLV(nfapi_resp->ssb_config.ss_pbch_power, NFAPI_NR_CONFIG_SS_PBCH_POWER_TAG, (int32_t)rand32());
|
||||
@@ -230,7 +231,7 @@ void fill_config_request_tlv(nfapi_nr_config_request_scf_t *nfapi_resp)
|
||||
nfapi_resp->num_tlv++;
|
||||
}
|
||||
|
||||
void test_pack_unpack(nfapi_nr_config_request_scf_t *req)
|
||||
static void test_pack_unpack(nfapi_nr_config_request_scf_t *req)
|
||||
{
|
||||
uint8_t msg_buf[65535];
|
||||
uint16_t msg_len = sizeof(*req);
|
||||
@@ -263,7 +264,7 @@ void test_pack_unpack(nfapi_nr_config_request_scf_t *req)
|
||||
free_config_request(&unpacked_req);
|
||||
}
|
||||
|
||||
void test_copy(const nfapi_nr_config_request_scf_t *msg)
|
||||
static void test_copy(const nfapi_nr_config_request_scf_t *msg)
|
||||
{
|
||||
// Test copy function
|
||||
nfapi_nr_config_request_scf_t copy = {0};
|
||||
@@ -272,16 +273,173 @@ void test_copy(const nfapi_nr_config_request_scf_t *msg)
|
||||
free_config_request(©);
|
||||
}
|
||||
|
||||
int main(int n, char *v[])
|
||||
static void test_config_req_rand(void)
|
||||
{
|
||||
fapi_test_init();
|
||||
nfapi_nr_config_request_scf_t req = {.header.message_id = NFAPI_NR_PHY_MSG_TYPE_CONFIG_REQUEST};
|
||||
// Fill CONFIG.request TVLs
|
||||
fill_config_request_tlv(&req);
|
||||
fill_config_request_tlv_tdd_rand(&req);
|
||||
// Perform tests
|
||||
test_pack_unpack(&req);
|
||||
test_copy(&req);
|
||||
// All tests successful!
|
||||
free_config_request(&req);
|
||||
}
|
||||
|
||||
static void fill_config_request_tlv_fdd(nfapi_nr_config_request_scf_t *req)
|
||||
{
|
||||
/* carrier config */
|
||||
FILL_TLV(req->carrier_config.dl_bandwidth, NFAPI_NR_CONFIG_DL_BANDWIDTH_TAG, 5);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->carrier_config.dl_frequency, NFAPI_NR_CONFIG_DL_FREQUENCY_TAG, 2150430);
|
||||
req->num_tlv++;
|
||||
for (int i = 0; i < 5; ++i)
|
||||
FILL_TLV(req->carrier_config.dl_k0[i], NFAPI_NR_CONFIG_DL_K0_TAG, 0);
|
||||
// these 5 are 1 tlv
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->carrier_config.dl_grid_size[0], NFAPI_NR_CONFIG_DL_GRID_SIZE_TAG, 25);
|
||||
for (int i = 1; i < 5; ++i)
|
||||
FILL_TLV(req->carrier_config.dl_grid_size[i], NFAPI_NR_CONFIG_DL_GRID_SIZE_TAG, 0);
|
||||
// these 5 are 1 tlv
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->carrier_config.num_tx_ant, NFAPI_NR_CONFIG_NUM_TX_ANT_TAG, 1);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->carrier_config.uplink_bandwidth, NFAPI_NR_CONFIG_UPLINK_BANDWIDTH_TAG, 5);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->carrier_config.uplink_frequency, NFAPI_NR_CONFIG_UPLINK_FREQUENCY_TAG, 1750430);
|
||||
req->num_tlv++;
|
||||
for (int i = 0; i < 5; ++i)
|
||||
FILL_TLV(req->carrier_config.ul_k0[i], NFAPI_NR_CONFIG_UL_K0_TAG, 0);
|
||||
// these 5 are 1 tlv
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->carrier_config.ul_grid_size[0], NFAPI_NR_CONFIG_UL_GRID_SIZE_TAG, 25);
|
||||
for (int i = 0; i < 5; ++i)
|
||||
FILL_TLV(req->carrier_config.ul_grid_size[i], NFAPI_NR_CONFIG_UL_GRID_SIZE_TAG, 0);
|
||||
// these 5 are 1 tlv
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->carrier_config.num_rx_ant, NFAPI_NR_CONFIG_NUM_RX_ANT_TAG, 1);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->carrier_config.frequency_shift_7p5khz, NFAPI_NR_CONFIG_FREQUENCY_SHIFT_7P5KHZ_TAG, 0);
|
||||
req->num_tlv++;
|
||||
|
||||
/* cell config */
|
||||
FILL_TLV(req->cell_config.phy_cell_id, NFAPI_NR_CONFIG_PHY_CELL_ID_TAG, 0);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->cell_config.frame_duplex_type, NFAPI_NR_CONFIG_FRAME_DUPLEX_TYPE_TAG, 0 /* FDD */);
|
||||
req->num_tlv++;
|
||||
|
||||
/* SSB config */
|
||||
FILL_TLV(req->ssb_config.ss_pbch_power, NFAPI_NR_CONFIG_SS_PBCH_POWER_TAG, -25);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->ssb_config.bch_payload, NFAPI_NR_CONFIG_BCH_PAYLOAD_TAG, 1 /* PHY generates timing bits */);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->ssb_config.scs_common, NFAPI_NR_CONFIG_SCS_COMMON_TAG, 0 /* 15 kHz */);
|
||||
req->num_tlv++;
|
||||
|
||||
/* PRACH config */
|
||||
FILL_TLV(req->prach_config.prach_sequence_length, NFAPI_NR_CONFIG_PRACH_SEQUENCE_LENGTH_TAG, 1);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->prach_config.prach_sub_c_spacing, NFAPI_NR_CONFIG_PRACH_SUB_C_SPACING_TAG, 0);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->prach_config.restricted_set_config, NFAPI_NR_CONFIG_RESTRICTED_SET_CONFIG_TAG, 0);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->prach_config.prach_ConfigurationIndex, NFAPI_NR_CONFIG_PRACH_CONFIG_INDEX_TAG, 98);
|
||||
req->num_tlv++;
|
||||
int num_prach = 1;
|
||||
FILL_TLV(req->prach_config.num_prach_fd_occasions, NFAPI_NR_CONFIG_NUM_PRACH_FD_OCCASIONS_TAG, num_prach);
|
||||
req->num_tlv++;
|
||||
nfapi_nr_num_prach_fd_occasions_t *l = calloc(num_prach, sizeof(*l));
|
||||
req->prach_config.num_prach_fd_occasions_list = l;
|
||||
FILL_TLV(l->prach_root_sequence_index, NFAPI_NR_CONFIG_PRACH_ROOT_SEQUENCE_INDEX_TAG, 1);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(l->num_root_sequences, NFAPI_NR_CONFIG_NUM_ROOT_SEQUENCES_TAG, 16);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(l->k1, NFAPI_NR_CONFIG_K1_TAG, 0);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(l->prach_zero_corr_conf, NFAPI_NR_CONFIG_PRACH_ZERO_CORR_CONF_TAG, 13);
|
||||
req->num_tlv++;
|
||||
/* should be at least according to spec */
|
||||
FILL_TLV(l->num_unused_root_sequences, NFAPI_NR_CONFIG_NUM_UNUSED_ROOT_SEQUENCES_TAG, 0);
|
||||
req->num_tlv++;
|
||||
l->unused_root_sequences_list = NULL;
|
||||
FILL_TLV(req->prach_config.ssb_per_rach, NFAPI_NR_CONFIG_SSB_PER_RACH_TAG, 3);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->prach_config.prach_multiple_carriers_in_a_band, NFAPI_NR_CONFIG_PRACH_MULTIPLE_CARRIERS_IN_A_BAND_TAG, 0);
|
||||
req->num_tlv++;
|
||||
|
||||
/* SSB table */
|
||||
FILL_TLV(req->ssb_table.ssb_offset_point_a, NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG, 4);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->ssb_table.ssb_period, NFAPI_NR_CONFIG_SSB_PERIOD_TAG, 2);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->ssb_table.ssb_subcarrier_offset, NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG, 0);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->ssb_table.MIB, NFAPI_NR_CONFIG_MIB_TAG, 0);
|
||||
req->num_tlv++;
|
||||
|
||||
FILL_TLV(req->ssb_table.ssb_mask_list[0].ssb_mask, NFAPI_NR_CONFIG_SSB_MASK_TAG, 2147483648);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->ssb_table.ssb_mask_list[1].ssb_mask, NFAPI_NR_CONFIG_SSB_MASK_TAG, 0);
|
||||
req->num_tlv++;
|
||||
for (int i = 0; i < 64; i++) {
|
||||
FILL_TLV(req->ssb_table.ssb_beam_id_list[i].beam_id, NFAPI_NR_CONFIG_BEAM_ID_TAG, 0);
|
||||
req->num_tlv++;
|
||||
}
|
||||
|
||||
/* NOTE: no TDD table! */
|
||||
|
||||
/* Measurement config rssi_measurement NULL -> not present */
|
||||
|
||||
/* nFAPI config */
|
||||
/* IPv4 address is 127.0.0.1 */
|
||||
req->nfapi_config.p7_vnf_address_ipv4.tl.tag = NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG;
|
||||
req->nfapi_config.p7_vnf_address_ipv4.address[0] = 127;
|
||||
req->nfapi_config.p7_vnf_address_ipv4.address[1] = 0;
|
||||
req->nfapi_config.p7_vnf_address_ipv4.address[2] = 0;
|
||||
req->nfapi_config.p7_vnf_address_ipv4.address[3] = 1;
|
||||
req->num_tlv++;
|
||||
/* no IPv6 address */
|
||||
FILL_TLV(req->nfapi_config.p7_vnf_port, NFAPI_NR_NFAPI_P7_VNF_PORT_TAG, 50011);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->nfapi_config.timing_window, NFAPI_NR_NFAPI_TIMING_WINDOW_TAG, 30);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->nfapi_config.timing_info_mode, NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG, 3);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->nfapi_config.timing_info_period, NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG, 10);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->nfapi_config.dl_tti_timing_offset, NFAPI_NR_NFAPI_DL_TTI_TIMING_OFFSET, 0);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->nfapi_config.dl_tti_timing_offset, NFAPI_NR_NFAPI_UL_TTI_TIMING_OFFSET, 0);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->nfapi_config.dl_tti_timing_offset, NFAPI_NR_NFAPI_UL_DCI_TIMING_OFFSET, 0);
|
||||
req->num_tlv++;
|
||||
FILL_TLV(req->nfapi_config.dl_tti_timing_offset, NFAPI_NR_NFAPI_TX_DATA_TIMING_OFFSET, 0);
|
||||
req->num_tlv++;
|
||||
|
||||
/* PMI list NULL */
|
||||
|
||||
/* Digital beamforming NULL */
|
||||
|
||||
/* Analog beamforming NULL */
|
||||
|
||||
//DevAssert(req->num_tlv == 103);
|
||||
}
|
||||
|
||||
static void test_config_req_fdd(void)
|
||||
{
|
||||
nfapi_nr_config_request_scf_t req = {.header.phy_id = 1, .header.message_id = NFAPI_NR_PHY_MSG_TYPE_CONFIG_REQUEST};
|
||||
// Fill CONFIG.request TVLs
|
||||
fill_config_request_tlv_fdd(&req);
|
||||
// Perform tests
|
||||
test_pack_unpack(&req);
|
||||
test_copy(&req);
|
||||
// All tests successful!
|
||||
free_config_request(&req);
|
||||
}
|
||||
|
||||
int main(int n, char *v[])
|
||||
{
|
||||
fapi_test_init();
|
||||
test_config_req_rand();
|
||||
test_config_req_fdd();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -47,14 +47,8 @@
|
||||
//#define CALLGRIND 1
|
||||
|
||||
struct treillis {
|
||||
union {
|
||||
simde__m64 systematic_andp1_64[3];
|
||||
uint8_t systematic_andp1_8[24];
|
||||
};
|
||||
union {
|
||||
simde__m64 parity2_64[3];
|
||||
uint8_t parity2_8[24];
|
||||
};
|
||||
uint8_t systematic_andp1[24] __attribute__((aligned(32)));
|
||||
uint8_t parity2[24] __attribute__((aligned(32)));
|
||||
int exit_state;
|
||||
} __attribute__ ((aligned(64)));
|
||||
|
||||
@@ -91,12 +85,11 @@ static void treillis_table_init(void) {
|
||||
current_state=i;
|
||||
|
||||
for (b=0; b<8 ; b++ ) { // pre-compute the image of the byte j in _m128i vector right place
|
||||
all_treillis[i][j].systematic_andp1_8[b*3]= (j&(1<<(7-b)))>>(7-b);
|
||||
v=threegpplte_rsc( all_treillis[i][j].systematic_andp1_8[b*3] ,
|
||||
¤t_state);
|
||||
all_treillis[i][j].systematic_andp1_8[b*3+1]=v; // for the yparity1
|
||||
all_treillis[i][j].systematic_andp1[b * 3] = (j & (1 << (7 - b))) >> (7 - b);
|
||||
v = threegpplte_rsc(all_treillis[i][j].systematic_andp1[b * 3], ¤t_state);
|
||||
all_treillis[i][j].systematic_andp1[b * 3 + 1] = v; // for the yparity1
|
||||
// all_treillis[i][j].parity1_8[b*3+1]=v; // for the yparity1
|
||||
all_treillis[i][j].parity2_8[b*3+2]=v; // for the yparity2
|
||||
all_treillis[i][j].parity2[b * 3 + 2] = v; // for the yparity2
|
||||
}
|
||||
|
||||
all_treillis[i][j].exit_state=current_state;
|
||||
@@ -275,13 +268,9 @@ char interleave_compact_byte(short *base_interleaver,unsigned char *input, unsig
|
||||
}
|
||||
*/
|
||||
|
||||
void threegpplte_turbo_encoder_sse(unsigned char *input,
|
||||
unsigned short input_length_bytes,
|
||||
unsigned char *output,
|
||||
unsigned char F) {
|
||||
int i;
|
||||
void threegpplte_turbo_encoder_sse(unsigned char *input, unsigned short input_length_bytes, unsigned char *output, unsigned char F)
|
||||
{
|
||||
unsigned char *x;
|
||||
unsigned char state0=0,state1=0;
|
||||
unsigned short input_length_bits = input_length_bytes<<3;
|
||||
short *base_interleaver;
|
||||
|
||||
@@ -290,6 +279,7 @@ void threegpplte_turbo_encoder_sse(unsigned char *input,
|
||||
}
|
||||
|
||||
// look for f1 and f2 precomputed interleaver values
|
||||
int i;
|
||||
for (i=0; i < 188 && f1f2mat[i].nb_bits != input_length_bits; i++);
|
||||
|
||||
if ( i == 188 ) {
|
||||
@@ -301,24 +291,19 @@ void threegpplte_turbo_encoder_sse(unsigned char *input,
|
||||
|
||||
unsigned char systematic2[768] __attribute__((aligned(32)));
|
||||
interleave_compact_byte(base_interleaver, input, systematic2, input_length_bytes);
|
||||
simde__m64 *ptr_output = (simde__m64 *)output;
|
||||
unsigned char cur_s1, cur_s2;
|
||||
int code_rate;
|
||||
|
||||
for ( state0=state1=i=0 ; i<input_length_bytes; i++ ) {
|
||||
cur_s1=input[i];
|
||||
cur_s2=systematic2[i];
|
||||
|
||||
for (code_rate = 0; code_rate < 3; code_rate++) {
|
||||
/*
|
||||
*ptr_output++ = simde_mm_add_pi8(all_treillis[state0][cur_s1].systematic_64[code_rate],
|
||||
simde_mm_add_pi8(all_treillis[state0][cur_s1].parity1_64[code_rate],
|
||||
all_treillis[state1][cur_s2].parity2_64[code_rate]));
|
||||
*/
|
||||
*ptr_output++ = simde_mm_add_pi8(all_treillis[state0][cur_s1].systematic_andp1_64[code_rate],
|
||||
all_treillis[state1][cur_s2].parity2_64[code_rate]);
|
||||
unsigned char *ptr_output = output;
|
||||
unsigned char state0 = 0, state1 = 0;
|
||||
for (int i = 0; i < input_length_bytes; i++) {
|
||||
int cur_s1 = input[i];
|
||||
uint8_t *systematic_andp1 = all_treillis[state0][cur_s1].systematic_andp1;
|
||||
int cur_s2 = systematic2[i];
|
||||
uint8_t *parity2 = all_treillis[state1][cur_s2].parity2;
|
||||
simde_mm_storeu_si128((simde__m128i *)ptr_output,
|
||||
simde_mm_add_epi8(*(simde__m128i *)systematic_andp1, *(simde__m128i *)parity2));
|
||||
ptr_output += 16;
|
||||
for (int code_rate = 16; code_rate < 24; code_rate++) {
|
||||
*ptr_output++ = systematic_andp1[code_rate] + parity2[code_rate];
|
||||
}
|
||||
|
||||
state0=all_treillis[state0][cur_s1].exit_state;
|
||||
state1=all_treillis[state1][cur_s2].exit_state;
|
||||
}
|
||||
|
||||
@@ -54,10 +54,6 @@
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#ifdef MEX
|
||||
#include "mex.h"
|
||||
#endif
|
||||
|
||||
#include "PHY/sse_intrin.h"
|
||||
|
||||
//#define DEBUG_LOGMAP
|
||||
@@ -837,19 +833,11 @@ void init_td16avx2(void)
|
||||
|
||||
for (ind=0; ind<188; ind++) {
|
||||
n = f1f2mat[ind].nb_bits;
|
||||
base_interleaver=il_tb+f1f2mat[ind].beg_index;
|
||||
#ifdef MEX
|
||||
// This is needed for the Mex implementation to make the memory persistent
|
||||
pi2tab16[ind] = mxMalloc((n+8)*sizeof(int));
|
||||
pi5tab16[ind] = mxMalloc((n+8)*sizeof(int));
|
||||
pi4tab16[ind] = mxMalloc((n+8)*sizeof(int));
|
||||
pi6tab16[ind] = mxMalloc((n+8)*sizeof(int));
|
||||
#else
|
||||
base_interleaver = il_tb + f1f2mat[ind].beg_index;
|
||||
pi2tab16avx2[ind] = malloc((n+8)*sizeof(int));
|
||||
pi5tab16avx2[ind] = malloc((n+8)*sizeof(int));
|
||||
pi4tab16avx2[ind] = malloc((n+8)*sizeof(int));
|
||||
pi6tab16avx2[ind] = malloc((n+8)*sizeof(int));
|
||||
#endif
|
||||
pi6tab16avx2[ind] = malloc((n + 8) * sizeof(int));
|
||||
|
||||
// fprintf(fdavx2,"Interleaver index %d\n",ind);
|
||||
for (i=i2=0; i2<8; i2++) {
|
||||
|
||||
@@ -52,12 +52,6 @@
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#ifdef MEX
|
||||
#include "mex.h"
|
||||
#endif
|
||||
|
||||
//#define DEBUG_LOGMAP
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
#define print_shorts(s,x) fprintf(fdsse4,"%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
|
||||
#endif
|
||||
@@ -933,20 +927,11 @@ void init_td16(void) {
|
||||
|
||||
for (ind=0; ind<188; ind++) {
|
||||
n = f1f2mat[ind].nb_bits;
|
||||
base_interleaver=il_tb+f1f2mat[ind].beg_index;
|
||||
#ifdef MEX
|
||||
// This is needed for the Mex implementation to make the memory persistent
|
||||
pi2tab16[ind] = mxMalloc((n+8)*sizeof(int));
|
||||
pi5tab16[ind] = mxMalloc((n+8)*sizeof(int));
|
||||
pi4tab16[ind] = mxMalloc((n+8)*sizeof(int));
|
||||
pi6tab16[ind] = mxMalloc((n+8)*sizeof(int));
|
||||
#else
|
||||
base_interleaver = il_tb + f1f2mat[ind].beg_index;
|
||||
pi2tab16[ind] = malloc((n+8)*sizeof(int));
|
||||
pi5tab16[ind] = malloc((n+8)*sizeof(int));
|
||||
pi4tab16[ind] = malloc((n+8)*sizeof(int));
|
||||
pi6tab16[ind] = malloc((n+8)*sizeof(int));
|
||||
#endif
|
||||
|
||||
pi6tab16[ind] = malloc((n + 8) * sizeof(int));
|
||||
for (i=i2=0; i2<8; i2++) {
|
||||
j=i2;
|
||||
|
||||
|
||||
@@ -50,10 +50,6 @@
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#ifdef MEX
|
||||
#include "mex.h"
|
||||
#endif
|
||||
|
||||
#include "common/ran_context.h"
|
||||
|
||||
#define SHUFFLE16(a, b, c, d, e, f, g, h) \
|
||||
@@ -858,19 +854,11 @@ void init_td8(void) {
|
||||
|
||||
for (ind=0; ind<188; ind++) {
|
||||
n = f1f2mat[ind].nb_bits;
|
||||
base_interleaver=il_tb+f1f2mat[ind].beg_index;
|
||||
#ifdef MEX
|
||||
// This is needed for the Mex implementation to make the memory persistent
|
||||
pi2tab8[ind] = mxMalloc((n+8)*sizeof(int));
|
||||
pi5tab8[ind] = mxMalloc((n+8)*sizeof(int));
|
||||
pi4tab8[ind] = mxMalloc((n+8)*sizeof(int));
|
||||
pi6tab8[ind] = mxMalloc((n+8)*sizeof(int));
|
||||
#else
|
||||
base_interleaver = il_tb + f1f2mat[ind].beg_index;
|
||||
pi2tab8[ind] = malloc((n+8)*sizeof(int));
|
||||
pi5tab8[ind] = malloc((n+8)*sizeof(int));
|
||||
pi4tab8[ind] = malloc((n+8)*sizeof(int));
|
||||
pi6tab8[ind] = malloc((n+8)*sizeof(int));
|
||||
#endif
|
||||
pi6tab8[ind] = malloc((n + 8) * sizeof(int));
|
||||
|
||||
if ((n&15)>0) {
|
||||
n2 = n+8;
|
||||
|
||||
@@ -70,5 +70,9 @@ int load_nrLDPC_coding_interface(char *version, nrLDPC_coding_interface_t *itf)
|
||||
|
||||
int free_nrLDPC_coding_interface(nrLDPC_coding_interface_t *interface)
|
||||
{
|
||||
return interface->nrLDPC_coding_shutdown();
|
||||
if (interface->nrLDPC_coding_shutdown) {
|
||||
return interface->nrLDPC_coding_shutdown();
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -177,8 +177,6 @@ static int nrLDPC_prepare_TB_encoding(nrLDPC_slot_encoding_parameters_t *nrLDPC_
|
||||
impp.toutput = nrLDPC_slot_encoding_parameters->toutput;
|
||||
impp.Kb = nrLDPC_TB_encoding_parameters->Kb;
|
||||
impp.Zc = nrLDPC_TB_encoding_parameters->Z;
|
||||
NR_DL_gNB_HARQ_t harq;
|
||||
impp.harq = &harq;
|
||||
impp.BG = nrLDPC_TB_encoding_parameters->BG;
|
||||
impp.output = nrLDPC_TB_encoding_parameters->segments->output;
|
||||
impp.K = nrLDPC_TB_encoding_parameters->K;
|
||||
|
||||
@@ -559,8 +559,18 @@ set_ldpc_dec_op(struct rte_bbdev_dec_op **ops,
|
||||
ops[j]->ldpc_dec.op_flags |= RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK;
|
||||
}
|
||||
ops[j]->ldpc_dec.code_block_mode = 1;
|
||||
ops[j]->ldpc_dec.harq_combined_input.offset = (((nrLDPC_slot_decoding_parameters->TBs[h].harq_unique_pid * NR_LDPC_MAX_NUM_CB) % HARQ_CODEBLOCK_ID_MAX) + i) * LDPC_MAX_CB_SIZE;
|
||||
ops[j]->ldpc_dec.harq_combined_output.offset = (((nrLDPC_slot_decoding_parameters->TBs[h].harq_unique_pid * NR_LDPC_MAX_NUM_CB) % HARQ_CODEBLOCK_ID_MAX) + i) * LDPC_MAX_CB_SIZE;
|
||||
|
||||
// Calculate offset in the HARQ combined buffers
|
||||
// Unique segment offset
|
||||
uint32_t segment_offset = (nrLDPC_slot_decoding_parameters->TBs[h].harq_unique_pid * NR_LDPC_MAX_NUM_CB) + i;
|
||||
// Prune to avoid shooting above maximum id
|
||||
uint32_t pruned_segment_offset = segment_offset % HARQ_CODEBLOCK_ID_MAX;
|
||||
// Segment offset to byte offset
|
||||
uint32_t harq_combined_offset = pruned_segment_offset * LDPC_MAX_CB_SIZE;
|
||||
|
||||
ops[j]->ldpc_dec.harq_combined_input.offset = harq_combined_offset;
|
||||
ops[j]->ldpc_dec.harq_combined_output.offset = harq_combined_offset;
|
||||
|
||||
if (bufs->hard_outputs != NULL)
|
||||
ops[j]->ldpc_dec.hard_output = bufs->hard_outputs[start_idx + j];
|
||||
if (bufs->inputs != NULL)
|
||||
|
||||
@@ -165,18 +165,4 @@ static inline void nrLDPC_debug_initBuffer2File(e_nrLDPC_buffers buffer)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Prints 256 data type
|
||||
\param in Input to print
|
||||
*/
|
||||
static inline void nrLDPC_debug_print256i_epi8(simde__m256i* in)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
for (i=0; i<32; i++)
|
||||
{
|
||||
mexPrintf("%d ", ((int8_t*)&in)[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -66,7 +66,6 @@ typedef struct {
|
||||
uint32_t Zc;
|
||||
/// Number of "Filler" bits
|
||||
uint32_t F;
|
||||
void *harq;
|
||||
/// Encoder BG
|
||||
uint8_t BG;
|
||||
/// Interleaver outputs
|
||||
|
||||
@@ -252,6 +252,7 @@ static inline void applyFtoleft(const t_nrPolar_params *pp, decoder_node_t *node
|
||||
simde__m128i minabs128 = simde_mm_min_epi16(absa128, absb128);
|
||||
*((simde__m128i *)alpha_l) = simde_mm_sign_epi16(minabs128, simde_mm_sign_epi16(a128, b128));
|
||||
} else if (avx2mod == 4) {
|
||||
// this uses __m64, but only with SSE instructions, so we can disable MMX even with this piece of code
|
||||
simde__m64 a64 = *((simde__m64 *)alpha_v);
|
||||
simde__m64 b64 = ((simde__m64 *)alpha_v)[1];
|
||||
simde__m64 absa64 = simde_mm_abs_pi16(a64);
|
||||
|
||||
@@ -128,7 +128,7 @@ void phy_init_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
load_dftslib();
|
||||
|
||||
crcTableInit();
|
||||
init_scrambling_luts();
|
||||
init_byte2m128i();
|
||||
init_pucch2_luts();
|
||||
|
||||
nr_init_fde(); // Init array for frequency equalization of transform precoding of PUSCH
|
||||
@@ -292,6 +292,9 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
free_and_zero(pusch_vars->llr);
|
||||
} // ULSCH_id
|
||||
free(gNB->pusch_vars);
|
||||
|
||||
free_nrLDPC_coding_interface(&gNB->nrLDPC_coding_interface);
|
||||
|
||||
}
|
||||
|
||||
//Adding nr_schedule_handler
|
||||
|
||||
@@ -515,7 +515,7 @@ void phy_init_nr_top(PHY_VARS_NR_UE *ue) {
|
||||
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
init_delay_table(frame_parms->ofdm_symbol_size, MAX_DELAY_COMP, NR_MAX_OFDM_SYMBOL_SIZE, frame_parms->delay_table);
|
||||
crcTableInit();
|
||||
init_scrambling_luts();
|
||||
init_byte2m128i();
|
||||
load_dftslib();
|
||||
init_context_synchro_nr(frame_parms);
|
||||
generate_ul_reference_signal_sequences(SHRT_MAX);
|
||||
|
||||
@@ -756,17 +756,7 @@ typedef struct {
|
||||
/// num active cba group
|
||||
uint8_t num_active_cba_groups;
|
||||
/// allocated CBA RNTI for this ulsch
|
||||
uint16_t cba_rnti[4];//NUM_MAX_CBA_GROUP];
|
||||
#ifdef LOCALIZATION
|
||||
/// epoch timestamp in millisecond
|
||||
int32_t reference_timestamp_ms;
|
||||
/// aggregate physical states every n millisecond
|
||||
int32_t aggregation_period_ms;
|
||||
/// a set of lists used for localization
|
||||
struct list loc_rss_list[10], loc_rssi_list[10], loc_subcarrier_rss_list[10], loc_timing_advance_list[10], loc_timing_update_list[10];
|
||||
struct list tot_loc_rss_list, tot_loc_rssi_list, tot_loc_subcarrier_rss_list, tot_loc_timing_advance_list, tot_loc_timing_update_list;
|
||||
#endif
|
||||
|
||||
uint16_t cba_rnti[4]; // NUM_MAX_CBA_GROUP];
|
||||
} NB_IoT_eNB_NULSCH_t;
|
||||
|
||||
#define NPBCH_A 34
|
||||
|
||||
@@ -132,7 +132,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
prach_ifftp = eNB->prach_vars_br.prach_ifft[ce_level];
|
||||
rxsigF = eNB->prach_vars_br.rxsigF[ce_level];
|
||||
|
||||
if (LOG_DEBUGFLAG(PRACH)) {
|
||||
if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
|
||||
if (((frame_prach)&1023) < 20) LOG_D(PHY,
|
||||
"PRACH (eNB) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d, rootSequenceIndex %d, repetition number %d,numRepetitionsPrePreambleAttempt %d\n",
|
||||
br_flag,ce_level,frame_prach,subframe,
|
||||
@@ -145,23 +145,26 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
prach_ifftp = eNB->prach_vars.prach_ifft[0];
|
||||
rxsigF = eNB->prach_vars.rxsigF[0];
|
||||
|
||||
//if (LOG_DEBUGFLAG(PRACH)) {
|
||||
if (((frame_prach)&1023) < 20) LOG_D(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n", subframe,
|
||||
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex,rootSequenceIndex);
|
||||
//}
|
||||
if (((frame_prach) & 1023) < 20)
|
||||
LOG_D(PHY,
|
||||
"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n",
|
||||
subframe,
|
||||
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,
|
||||
prach_ConfigIndex,
|
||||
rootSequenceIndex);
|
||||
}
|
||||
} else {
|
||||
if (br_flag == 1) {
|
||||
rxsigF = ru->prach_rxsigF_br[ce_level];
|
||||
|
||||
if (LOG_DEBUGFLAG(PRACH)) {
|
||||
if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
|
||||
if (((frame_prach)&1023) < 20) LOG_D(PHY,"PRACH (RU) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
|
||||
br_flag,ce_level,frame_prach,subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex);
|
||||
}
|
||||
} else {
|
||||
rxsigF = ru->prach_rxsigF[0];
|
||||
|
||||
if (LOG_DEBUGFLAG(PRACH)) {
|
||||
if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
|
||||
if (((frame_prach)&1023) < 20) LOG_D(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
|
||||
subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex);
|
||||
}
|
||||
@@ -178,7 +181,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
// DJP - indexing below in subframe zero takes us off the beginning of the array???
|
||||
prach[aa] = (int16_t *)&ru->common.rxdata[aa][(subframe*fp->samples_per_tti)-ru->N_TA_offset];
|
||||
|
||||
if (LOG_DUMPFLAG(PRACH)) {
|
||||
if (LOG_DUMPFLAG(DEBUG_PRACH)) {
|
||||
int32_t en0=signal_energy((int32_t *)prach[aa],fp->samples_per_tti);
|
||||
dBEn0 = dB_fixed(en0);
|
||||
int8_t rach_dBm = dBEn0 - ru->rx_total_gain_dB;
|
||||
@@ -281,7 +284,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
if (((eNB!=NULL) && (ru->function != NGFI_RAU_IF4p5))||
|
||||
((eNB==NULL) && (ru->function == NGFI_RRU_IF4p5))) { // compute the DFTs of the PRACH temporal resources
|
||||
// Do forward transform
|
||||
if (LOG_DEBUGFLAG(PRACH)) {
|
||||
if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
|
||||
LOG_D(PHY,"rx_prach: Doing FFT for N_RB_UL %d nb_rx:%d Ncp:%d\n",fp->N_RB_UL, nb_rx, Ncp);
|
||||
}
|
||||
|
||||
@@ -353,7 +356,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
|
||||
return;
|
||||
} else if (eNB!=NULL) {
|
||||
if ( LOG_DEBUGFLAG(PRACH)) {
|
||||
if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
|
||||
int en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840));
|
||||
|
||||
if ((en > 10)&&(br_flag==1)) LOG_I(PHY,"PRACH (br_flag %d,ce_level %d, n_ra_prb %d, k %d): Frame %d, Subframe %d => %d dB\n",br_flag,ce_level,n_ra_prb,k,frame_prach,subframe,en);
|
||||
@@ -394,8 +397,8 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
uint64_t avg_en=0;
|
||||
|
||||
for (preamble_index=0 ; preamble_index<64 ; preamble_index++) {
|
||||
if (LOG_DEBUGFLAG(PRACH)) {
|
||||
// int en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840));
|
||||
if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
|
||||
// int en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840));
|
||||
|
||||
if (dBEn0>30) LOG_I(PHY,"frame %d, subframe %d : Trying preamble %d (br_flag %d)\n",frame_prach,subframe,preamble_index,br_flag);
|
||||
}
|
||||
@@ -479,7 +482,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
}
|
||||
|
||||
// Compute DFT of RX signal (conjugate input, results in conjugate output) for each new rootSequenceIndex
|
||||
if (LOG_DEBUGFLAG(PRACH)) {
|
||||
if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
|
||||
//en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840));
|
||||
|
||||
if (dBEn0>30) LOG_I(PHY,"frame %d, subframe %d : preamble index %d: offset %d, preamble shift %d (br_flag %d, en %d)\n",
|
||||
@@ -502,8 +505,8 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
memset(prach_ifft,0,((N_ZC==839) ? 2048 : 256)*sizeof(int32_t));
|
||||
}
|
||||
c16_t prachF[1024] __attribute__((aligned(32)))={0};
|
||||
|
||||
if (LOG_DUMPFLAG(PRACH))
|
||||
|
||||
if (LOG_DUMPFLAG(DEBUG_PRACH))
|
||||
for (int z=0; z<nb_rx; z++)
|
||||
if( prach[z] ) {
|
||||
char tmp[128];
|
||||
@@ -543,7 +546,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[(i<<1)] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>9;
|
||||
}
|
||||
|
||||
if (LOG_DUMPFLAG(PRACH)) {
|
||||
if (LOG_DUMPFLAG(DEBUG_PRACH)) {
|
||||
if (aa==0) LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
|
||||
|
||||
if (aa==1) LOG_M("prach_rxF_comp1.m","prach_rxF_comp1",prachF,1024,1,1);
|
||||
@@ -555,7 +558,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
if ((br_flag==0) ||
|
||||
(eNB->prach_vars_br.repetition_number[ce_level]==
|
||||
eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level])) {
|
||||
if (LOG_DEBUGFLAG(PRACH)) {
|
||||
if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
|
||||
int en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840));
|
||||
|
||||
if (en>60) LOG_I(PHY,"frame %d, subframe %d: Checking for peak in time-domain (br_flag %d, en %d)\n",frame_prach,subframe,br_flag,en);
|
||||
@@ -573,8 +576,8 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
*max_preamble_delay = ((i*fft_size)>>log2_ifft_size)*update_TA/update_TA2;
|
||||
*max_preamble = preamble_index;
|
||||
|
||||
if (LOG_DEBUGFLAG(PRACH)) {
|
||||
// int en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840));
|
||||
if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
|
||||
// int en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840));
|
||||
|
||||
if (dBEn0>30)
|
||||
LOG_D(PHY,"frame %d, subframe %d : max_preamble_energy %d, max_preamble_delay %d, max_preamble %d (br_flag %d,ce_level %d, levdB %d, lev %d)\n",
|
||||
@@ -613,7 +616,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
LOG_M("prach_ifft0_br.m","prach_t0_br",prach_ifft,1024,1,1);
|
||||
}
|
||||
}
|
||||
} /* LOG_DUMPFLAG(PRACH) */
|
||||
}
|
||||
|
||||
if (eNB) stop_meas(&eNB->rx_prach);
|
||||
AssertFatal(exit_flag==0,"exiting\n");
|
||||
|
||||
@@ -42,25 +42,24 @@
|
||||
#include "PHY_INTERFACE/phy_interface.h"
|
||||
#include "transport_proto.h"
|
||||
|
||||
static const int8_t wACK_RX[5][4] = {{-1, -1, -1, -1}, {-1, 1, -1, 1}, {-1, -1, 1, 1}, {-1, 1, 1, -1}, {1, 1, 1, 1}};
|
||||
|
||||
void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch) {
|
||||
int i,r;
|
||||
static const int wACK_RX[5][4] = {{-1, -1, -1, -1}, {-1, 1, -1, 1}, {-1, -1, 1, 1}, {-1, 1, 1, -1}, {1, 1, 1, 1}};
|
||||
|
||||
void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch)
|
||||
{
|
||||
if (ulsch) {
|
||||
for (i=0; i<8; i++) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (ulsch->harq_processes[i]) {
|
||||
if (ulsch->harq_processes[i]->decodedBytes) {
|
||||
free16(ulsch->harq_processes[i]->decodedBytes,MAX_ULSCH_PAYLOAD_BYTES);
|
||||
ulsch->harq_processes[i]->decodedBytes = NULL;
|
||||
}
|
||||
|
||||
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++) {
|
||||
for (int r = 0; r < MAX_NUM_ULSCH_SEGMENTS; r++) {
|
||||
free16(ulsch->harq_processes[i]->c[r],((r==0)?8:0) + 768);
|
||||
ulsch->harq_processes[i]->c[r] = NULL;
|
||||
}
|
||||
|
||||
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++)
|
||||
for (int r = 0; r < MAX_NUM_ULSCH_SEGMENTS; r++)
|
||||
if (ulsch->harq_processes[i]->d[r]) {
|
||||
free16(ulsch->harq_processes[i]->d[r],((3*8*6144)+12+96)*sizeof(short));
|
||||
ulsch->harq_processes[i]->d[r] = NULL;
|
||||
@@ -411,32 +410,17 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
|
||||
LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id];
|
||||
uint8_t harq_pid;
|
||||
unsigned short nb_rb;
|
||||
unsigned int A;
|
||||
uint8_t Q_m;
|
||||
unsigned int i,i2,q,j,j2;
|
||||
int iprime;
|
||||
unsigned int ret=0;
|
||||
// uint8_t dummy_channel_output[(3*8*block_length)+12];
|
||||
int r,Kr;
|
||||
unsigned int ret = 0;
|
||||
const uint8_t *columnset;
|
||||
unsigned int sumKr=0;
|
||||
unsigned int Qprime,L,G,Q_CQI,Q_RI,H,Hprime,Hpp,Cmux,Rmux_prime,O_RCC;
|
||||
unsigned int Qprime_ACK,Qprime_RI,len_ACK=0,len_RI=0;
|
||||
// uint8_t q_ACK[MAX_ACK_PAYLOAD],q_RI[MAX_RI_PAYLOAD];
|
||||
int metric,metric_new;
|
||||
uint32_t x1, x2, s=0;
|
||||
int16_t ys,c;
|
||||
uint32_t wACK_idx;
|
||||
unsigned int Qprime_ACK, Qprime_RI, len_ACK = 0, len_RI = 0;
|
||||
uint8_t dummy_w_cc[3*(MAX_CQI_BITS+8+32)];
|
||||
int16_t y[6*14*1200] __attribute__((aligned(32)));
|
||||
uint8_t ytag[14*1200];
|
||||
// uint8_t ytag2[6*14*1200],*ytag2_ptr;
|
||||
int16_t cseq[6*14*1200] __attribute__((aligned(32)));
|
||||
int off;
|
||||
int frame = proc->frame_rx;
|
||||
int subframe = proc->subframe_rx;
|
||||
LTE_UL_eNB_HARQ_t *ulsch_harq;
|
||||
const int frame = proc->frame_rx;
|
||||
const int subframe = proc->subframe_rx;
|
||||
|
||||
LOG_D(PHY,"ue_type %d\n",ulsch->ue_type);
|
||||
|
||||
@@ -446,15 +430,16 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
harq_pid = subframe2harq_pid(frame_parms,proc->frame_rx,subframe);
|
||||
|
||||
// x1 is set in lte_gold_generic
|
||||
x2 = ((uint32_t)ulsch->rnti<<14) + ((uint32_t)subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1
|
||||
ulsch_harq = ulsch->harq_processes[harq_pid];
|
||||
uint32_t x2 =
|
||||
((uint32_t)ulsch->rnti << 14) + ((uint32_t)subframe << 9) + frame_parms->Nid_cell; // this is c_init in 36.211 Sec 6.3.1
|
||||
LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid];
|
||||
AssertFatal(harq_pid!=255,
|
||||
"FATAL ERROR: illegal harq_pid, returning\n");
|
||||
AssertFatal(ulsch_harq->Nsymb_pusch != 0,
|
||||
"FATAL ERROR: harq_pid %d, Nsymb 0!\n",harq_pid);
|
||||
nb_rb = ulsch_harq->nb_rb;
|
||||
A = ulsch_harq->TBS;
|
||||
Q_m = ulsch_harq->Qm;
|
||||
const int nb_rb = ulsch_harq->nb_rb;
|
||||
const uint A = ulsch_harq->TBS;
|
||||
const uint Q_m = ulsch_harq->Qm;
|
||||
G = nb_rb * (12 * Q_m) * ulsch_harq->Nsymb_pusch;
|
||||
LOG_D(PHY, "PUSCH nb_rb %d Q_m %d ulsch_harq->Nsymb_pusch %d\n",nb_rb, Q_m, ulsch_harq->Nsymb_pusch);
|
||||
//#ifdef DEBUG_ULSCH_DECODING
|
||||
@@ -517,15 +502,12 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
// CLEAR LLR's HERE for first packet in process
|
||||
//}
|
||||
// printf("after segmentation c[%d] = %p\n",0,ulsch_harq->c[0]);
|
||||
sumKr = 0;
|
||||
|
||||
for (r=0; r<ulsch_harq->C; r++) {
|
||||
unsigned int sumKr = 0;
|
||||
for (int r = 0; r < ulsch_harq->C; r++) {
|
||||
if (r<ulsch_harq->Cminus)
|
||||
Kr = ulsch_harq->Kminus;
|
||||
sumKr += ulsch_harq->Kminus;
|
||||
else
|
||||
Kr = ulsch_harq->Kplus;
|
||||
|
||||
sumKr += Kr;
|
||||
sumKr += ulsch_harq->Kplus;
|
||||
}
|
||||
|
||||
AssertFatal(sumKr>0,
|
||||
@@ -616,15 +598,13 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
Cmux = ulsch_harq->Nsymb_pusch;
|
||||
Rmux_prime = Hpp/Cmux;
|
||||
// Clear "tag" interleaving matrix to allow for CQI/DATA identification
|
||||
memset(ytag,0,Cmux*Rmux_prime);
|
||||
i=0;
|
||||
memset(ytag, 0, Cmux * Rmux_prime);
|
||||
memset(y,LTE_NULL,Q_m*Hpp);
|
||||
// read in buffer and unscramble llrs for everything but placeholder bits
|
||||
// llrs stored per symbol correspond to columns of interleaving matrix
|
||||
s = lte_gold_unscram(&x1, &x2, 1);
|
||||
i2=0;
|
||||
|
||||
for (i=0; i<((Hpp*Q_m)>>5); i++) {
|
||||
uint32_t x1 = 0;
|
||||
uint32_t s = lte_gold_unscram(&x1, &x2, 1);
|
||||
for (int i = 0, i2 = 0; i < ((Hpp * Q_m) >> 5); i++) {
|
||||
/*
|
||||
for (j=0; j<32; j++) {
|
||||
cseq[i2++] = (int16_t)((((s>>j)&1)<<1)-1);
|
||||
@@ -642,18 +622,18 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
else
|
||||
columnset = cs_ri_extended;
|
||||
|
||||
j=0;
|
||||
int j = 0;
|
||||
|
||||
for (i=0; i<Qprime_RI; i++) {
|
||||
r = Rmux_prime - 1 - (i>>2);
|
||||
for (int i = 0; i < Qprime_RI; i++) {
|
||||
int r = Rmux_prime - 1 - (i >> 2);
|
||||
/*
|
||||
for (q=0;q<Q_m;q++)
|
||||
ytag2[q+(Q_m*((r*Cmux) + columnset[j]))] = q_RI[(q+(Q_m*i))%len_RI];
|
||||
*/
|
||||
off =((Rmux_prime*Q_m*columnset[j])+(r*Q_m));
|
||||
int off = ((Rmux_prime * Q_m * columnset[j]) + (r * Q_m));
|
||||
cseq[off+1] = cseq[off]; // PUSCH_y
|
||||
|
||||
for (q=2; q<Q_m; q++)
|
||||
for (int q = 2; q < Q_m; q++)
|
||||
cseq[off+q] = -1; // PUSCH_x
|
||||
|
||||
j=(j+3)&3;
|
||||
@@ -669,18 +649,18 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
|
||||
j=0;
|
||||
|
||||
for (i=0; i<Qprime_ACK; i++) {
|
||||
r = Rmux_prime - 1 - (i>>2);
|
||||
off =((Rmux_prime*Q_m*columnset[j])+(r*Q_m));
|
||||
for (int i = 0; i < Qprime_ACK; i++) {
|
||||
int r = Rmux_prime - 1 - (i >> 2);
|
||||
int off = ((Rmux_prime * Q_m * columnset[j]) + (r * Q_m));
|
||||
|
||||
if (ulsch_harq->O_ACK == 1) {
|
||||
if (ulsch->bundling==0)
|
||||
cseq[off+1] = cseq[off]; // PUSCH_y
|
||||
|
||||
for (q=2; q<Q_m; q++)
|
||||
for (int q = 2; q < Q_m; q++)
|
||||
cseq[off+q] = -1; // PUSCH_x
|
||||
} else if (ulsch_harq->O_ACK == 2) {
|
||||
for (q=2; q<Q_m; q++)
|
||||
for (int q = 2; q < Q_m; q++)
|
||||
cseq[off+q] = -1; // PUSCH_x
|
||||
}
|
||||
|
||||
@@ -690,79 +670,52 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
j=(j+3)&3;
|
||||
}
|
||||
|
||||
i=0;
|
||||
int16_t *in = ulsch_llr;
|
||||
int16_t *cseqp = cseq;
|
||||
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
for (j=0; j<Cmux; j++) {
|
||||
i2=j<<1;
|
||||
|
||||
for (r=0; r<Rmux_prime; r++) {
|
||||
c = cseq[i];
|
||||
// printf("ulsch %d: %d * ",i,c);
|
||||
y[i2++] = c*ulsch_llr[i++];
|
||||
// printf("%d\n",ulsch_llr[i-1]);
|
||||
c = cseq[i];
|
||||
// printf("ulsch %d: %d * ",i,c);
|
||||
y[i2] = c*ulsch_llr[i++];
|
||||
// printf("%d\n",ulsch_llr[i-1]);
|
||||
i2=(i2+(Cmux<<1)-1);
|
||||
for (j = 0; j < Cmux; j++) {
|
||||
int i2 = j << 1;
|
||||
for (int r = 0; r < Rmux_prime; r++) {
|
||||
y[i2] = *cseqp++ * *in++;
|
||||
y[i2 + 1] = *cseqp++ * *in++;
|
||||
i2 += Cmux << 1;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
for (j=0; j<Cmux; j++) {
|
||||
i2=j<<2;
|
||||
|
||||
for (r=0; r<Rmux_prime; r++) {
|
||||
/*
|
||||
c = cseq[i];
|
||||
y[i2++] = c*ulsch_llr[i++];
|
||||
c = cseq[i];
|
||||
y[i2++] = c*ulsch_llr[i++];
|
||||
c = cseq[i];
|
||||
y[i2++] = c*ulsch_llr[i++];
|
||||
c = cseq[i];
|
||||
y[i2] = c*ulsch_llr[i++];
|
||||
i2=(i2+(Cmux<<2)-3);
|
||||
*/
|
||||
// slightly more optimized version (equivalent to above) for 16QAM to improve computational performance
|
||||
*(simde__m64 *)&y[i2] = simde_mm_sign_pi16(*(simde__m64 *)&ulsch_llr[i],*(simde__m64 *)&cseq[i]);
|
||||
i+=4;
|
||||
i2+=(Cmux<<2);
|
||||
for (j = 0; j < Cmux; j++) {
|
||||
int i2 = j << 2;
|
||||
for (int r = 0; r < Rmux_prime; r++) {
|
||||
y[i2] = *cseqp++ * *in++;
|
||||
y[i2 + 1] = *cseqp++ * *in++;
|
||||
y[i2 + 2] = *cseqp++ * *in++;
|
||||
y[i2 + 3] = *cseqp++ * *in++;
|
||||
i2 += Cmux << 2;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 6:
|
||||
for (j=0; j<Cmux; j++) {
|
||||
i2=j*6;
|
||||
|
||||
for (r=0; r<Rmux_prime; r++) {
|
||||
c = cseq[i];
|
||||
y[i2++] = c*ulsch_llr[i++];
|
||||
c = cseq[i];
|
||||
y[i2++] = c*ulsch_llr[i++];
|
||||
c = cseq[i];
|
||||
y[i2++] = c*ulsch_llr[i++];
|
||||
c = cseq[i];
|
||||
y[i2++] = c*ulsch_llr[i++];
|
||||
c = cseq[i];
|
||||
y[i2++] = c*ulsch_llr[i++];
|
||||
c = cseq[i];
|
||||
y[i2] = c*ulsch_llr[i++];
|
||||
i2=(i2+(Cmux*6)-5);
|
||||
for (j = 0; j < Cmux; j++) {
|
||||
int i2 = j * 6;
|
||||
for (int r = 0; r < Rmux_prime; r++) {
|
||||
y[i2] = *cseqp++ * *in++;
|
||||
y[i2 + 1] = *cseqp++ * *in++;
|
||||
y[i2 + 2] = *cseqp++ * *in++;
|
||||
y[i2 + 3] = *cseqp++ * *in++;
|
||||
y[i2 + 4] = *cseqp++ * *in++;
|
||||
y[i2 + 5] = *cseqp++ * *in++;
|
||||
i2 += Cmux * 6;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (i!=(H+Q_RI))
|
||||
LOG_D(PHY,"ulsch_decoding.c: Error in input buffer length (j %d, H+Q_RI %d)\n",i,H+Q_RI);
|
||||
if ((in - ulsch_llr) != (H + Q_RI))
|
||||
LOG_D(PHY, "ulsch_decoding.c: Error in input buffer length (j %ld, H+Q_RI %d)\n", in - ulsch_llr, H + Q_RI);
|
||||
|
||||
// HARQ-ACK Bits (LLRs are nulled in overwritten bits after copying HARQ-ACK LLR)
|
||||
|
||||
@@ -810,17 +763,17 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
return(-1);
|
||||
}
|
||||
|
||||
for (i=0; i<len_ACK; i++)
|
||||
for (int i = 0; i < len_ACK; i++)
|
||||
ulsch_harq->q_ACK[i] = 0;
|
||||
|
||||
for (i=0; i<Qprime_ACK; i++) {
|
||||
r = Rmux_prime -1 - (i>>2);
|
||||
for (int i = 0; i < Qprime_ACK; i++) {
|
||||
int r = Rmux_prime - 1 - (i >> 2);
|
||||
|
||||
for (q=0; q<Q_m; q++) {
|
||||
if (y[q+(Q_m*((r*Cmux) + columnset[j]))]!=0)
|
||||
ulsch_harq->q_ACK[(q+(Q_m*i))%len_ACK] += y[q+(Q_m*((r*Cmux) + columnset[j]))];
|
||||
for (int q = 0; q < Q_m; q++) {
|
||||
if (y[q + Q_m * (r * Cmux + columnset[j])] != 0)
|
||||
ulsch_harq->q_ACK[(q + (Q_m * i)) % len_ACK] += y[q + Q_m * (r * Cmux + columnset[j])];
|
||||
|
||||
y[q+(Q_m*((r*Cmux) + columnset[j]))]=0; // NULL LLRs in ACK positions
|
||||
y[q + Q_m * (r * Cmux + columnset[j])] = 0; // NULL LLRs in ACK positions
|
||||
}
|
||||
|
||||
j=(j+3)&3;
|
||||
@@ -851,7 +804,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
return(-1);
|
||||
}
|
||||
|
||||
for (i=0; i<len_RI; i++)
|
||||
for (int i = 0; i < len_RI; i++)
|
||||
ulsch_harq->q_RI[i] = 0;
|
||||
|
||||
if (frame_parms->Ncp == 0)
|
||||
@@ -861,10 +814,10 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
|
||||
j=0;
|
||||
|
||||
for (i=0; i<Qprime_RI; i++) {
|
||||
r = Rmux_prime -1 - (i>>2);
|
||||
for (int i = 0; i < Qprime_RI; i++) {
|
||||
int r = Rmux_prime - 1 - (i >> 2);
|
||||
|
||||
for (q=0; q<Q_m; q++)
|
||||
for (int q = 0; q < Q_m; q++)
|
||||
ulsch_harq->q_RI[(q+(Q_m*i))%len_RI] += y[q+(Q_m*((r*Cmux) + columnset[j]))];
|
||||
|
||||
ytag[(r*Cmux) + columnset[j]] = LTE_NULL;
|
||||
@@ -874,19 +827,19 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
// printf("after RI2 c[%d] = %p\n",0,ulsch_harq->c[0]);
|
||||
// CQI and Data bits
|
||||
j=0;
|
||||
j2=0;
|
||||
int j2 = 0;
|
||||
|
||||
// r=0;
|
||||
if (Q_RI>0) {
|
||||
for (i=0; i<(Q_CQI/Q_m); i++) {
|
||||
for (int i = 0; i < (Q_CQI / Q_m); i++) {
|
||||
while (ytag[j]==LTE_NULL) {
|
||||
j++;
|
||||
j2+=Q_m;
|
||||
}
|
||||
|
||||
for (q=0; q<Q_m; q++) {
|
||||
for (int q = 0; q < Q_m; q++) {
|
||||
// ys = y[q+(Q_m*((r*Cmux)+j))];
|
||||
ys = y[q+j2];
|
||||
int ys = y[q + j2];
|
||||
|
||||
if (ys>127)
|
||||
ulsch_harq->q[q+(Q_m*i)] = 127;
|
||||
@@ -901,7 +854,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
for (iprime=0; iprime<G;) {
|
||||
for (int iprime = 0; iprime < G;) {
|
||||
while (ytag[j]==LTE_NULL) {
|
||||
j++;
|
||||
j2+=2;
|
||||
@@ -914,7 +867,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
break;
|
||||
|
||||
case 4:
|
||||
for (iprime=0; iprime<G;) {
|
||||
for (int iprime = 0; iprime < G;) {
|
||||
while (ytag[j]==LTE_NULL) {
|
||||
j++;
|
||||
j2+=4;
|
||||
@@ -929,7 +882,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
break;
|
||||
|
||||
case 6:
|
||||
for (iprime=0; iprime<G;) {
|
||||
for (int iprime = 0; iprime < G;) {
|
||||
while (ytag[j]==LTE_NULL) {
|
||||
j++;
|
||||
j2+=6;
|
||||
@@ -947,9 +900,9 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
}
|
||||
} // Q_RI>0
|
||||
else {
|
||||
for (i=0; i<(Q_CQI/Q_m); i++) {
|
||||
for (q=0; q<Q_m; q++) {
|
||||
ys = y[q+j2];
|
||||
for (int i = 0; i < (Q_CQI / Q_m); i++) {
|
||||
for (int q = 0; q < Q_m; q++) {
|
||||
int ys = y[q + j2];
|
||||
|
||||
if (ys>127)
|
||||
ulsch_harq->q[q+(Q_m*i)] = 127;
|
||||
@@ -961,88 +914,74 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
|
||||
j2+=Q_m;
|
||||
}
|
||||
|
||||
/* To be improved according to alignment of j2
|
||||
for (iprime=0; iprime<G;iprime+=16,j2+=16)
|
||||
*((simde__m256i *)&ulsch_harq->e[iprime]) = *((simde__m256i *)&y[j2]);
|
||||
*/
|
||||
int16_t *yp,*ep;
|
||||
|
||||
for (iprime=0,yp=&y[j2],ep=&ulsch_harq->eUL[0];
|
||||
iprime<G;
|
||||
iprime+=8,j2+=8,ep+=8,yp+=8) {
|
||||
ep[0] = yp[0];
|
||||
ep[1] = yp[1];
|
||||
ep[2] = yp[2];
|
||||
ep[3] = yp[3];
|
||||
ep[4] = yp[4];
|
||||
ep[5] = yp[5];
|
||||
ep[6] = yp[6];
|
||||
ep[7] = yp[7];
|
||||
}
|
||||
int16_t *yp = &y[j2], *ep = ulsch_harq->eUL;
|
||||
memcpy(ep, yp, G * sizeof(*yp));
|
||||
}
|
||||
|
||||
stop_meas(&eNB->ulsch_demultiplexing_stats);
|
||||
// printf("after ACKNAK2 c[%d] = %p (iprime %d, G %d)\n",0,ulsch_harq->c[0],iprime,G);
|
||||
// Do CQI/RI/HARQ-ACK Decoding first and pass to MAC
|
||||
// HARQ-ACK
|
||||
wACK_idx = (ulsch->bundling==0) ? 4 : ((Nbundled-1)&3);
|
||||
const uint32_t wACK_idx = ulsch->bundling == 0 ? 4 : (Nbundled - 1) & 3;
|
||||
const int *wACK = wACK_RX[wACK_idx];
|
||||
uint8_t *o_ACK = ulsch_harq->o_ACK;
|
||||
int16_t *q_ACK = ulsch_harq->q_ACK;
|
||||
|
||||
if (ulsch_harq->O_ACK == 1) {
|
||||
ulsch_harq->q_ACK[0] *= wACK_RX[wACK_idx][0];
|
||||
ulsch_harq->q_ACK[0] += (ulsch->bundling==0) ? ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][0] : ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][1];
|
||||
q_ACK[0] *= wACK[0];
|
||||
q_ACK[0] += (ulsch->bundling == 0) ? q_ACK[1] * wACK[0] : q_ACK[1] * wACK[1];
|
||||
|
||||
if (ulsch_harq->q_ACK[0] < 0)
|
||||
ulsch_harq->o_ACK[0] = 0;
|
||||
if (q_ACK[0] < 0)
|
||||
o_ACK[0] = 0;
|
||||
else
|
||||
ulsch_harq->o_ACK[0] = 1;
|
||||
o_ACK[0] = 1;
|
||||
}
|
||||
|
||||
if (ulsch_harq->O_ACK == 2) {
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
ulsch_harq->q_ACK[0] = ulsch_harq->q_ACK[0]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[3]*wACK_RX[wACK_idx][1];
|
||||
ulsch_harq->q_ACK[1] = ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[4]*wACK_RX[wACK_idx][1];
|
||||
ulsch_harq->q_ACK[2] = ulsch_harq->q_ACK[2]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[5]*wACK_RX[wACK_idx][1];
|
||||
q_ACK[0] = q_ACK[0] * wACK[0] + q_ACK[3] * wACK[1];
|
||||
q_ACK[1] = q_ACK[1] * wACK[0] + q_ACK[4] * wACK[1];
|
||||
q_ACK[2] = q_ACK[2] * wACK[0] + q_ACK[5] * wACK[1];
|
||||
break;
|
||||
|
||||
case 4:
|
||||
ulsch_harq->q_ACK[0] = ulsch_harq->q_ACK[0]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[5]*wACK_RX[wACK_idx][1];
|
||||
ulsch_harq->q_ACK[1] = ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[8]*wACK_RX[wACK_idx][1];
|
||||
ulsch_harq->q_ACK[2] = ulsch_harq->q_ACK[4]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[9]*wACK_RX[wACK_idx][1];
|
||||
q_ACK[0] = q_ACK[0] * wACK[0] + q_ACK[5] * wACK[1];
|
||||
q_ACK[1] = q_ACK[1] * wACK[0] + q_ACK[8] * wACK[1];
|
||||
q_ACK[2] = q_ACK[4] * wACK[0] + q_ACK[9] * wACK[1];
|
||||
break;
|
||||
|
||||
case 6:
|
||||
ulsch_harq->q_ACK[0] = ulsch_harq->q_ACK[0]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[7]*wACK_RX[wACK_idx][1];
|
||||
ulsch_harq->q_ACK[1] = ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[12]*wACK_RX[wACK_idx][1];
|
||||
ulsch_harq->q_ACK[2] = ulsch_harq->q_ACK[6]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[13]*wACK_RX[wACK_idx][1];
|
||||
q_ACK[0] = q_ACK[0] * wACK[0] + q_ACK[7] * wACK[1];
|
||||
q_ACK[1] = q_ACK[1] * wACK[0] + q_ACK[12] * wACK[1];
|
||||
q_ACK[2] = q_ACK[6] * wACK[0] + q_ACK[13] * wACK[1];
|
||||
break;
|
||||
}
|
||||
|
||||
ulsch_harq->o_ACK[0] = 1;
|
||||
ulsch_harq->o_ACK[1] = 1;
|
||||
metric = ulsch_harq->q_ACK[0]+ulsch_harq->q_ACK[1]-ulsch_harq->q_ACK[2];
|
||||
metric_new = -ulsch_harq->q_ACK[0]+ulsch_harq->q_ACK[1]+ulsch_harq->q_ACK[2];
|
||||
o_ACK[0] = 1;
|
||||
o_ACK[1] = 1;
|
||||
int metric = q_ACK[0] + q_ACK[1] - q_ACK[2];
|
||||
int metric_new = -q_ACK[0] + q_ACK[1] + q_ACK[2];
|
||||
|
||||
if (metric_new > metric) {
|
||||
ulsch_harq->o_ACK[0]=0;
|
||||
ulsch_harq->o_ACK[1]=1;
|
||||
o_ACK[0] = 0;
|
||||
o_ACK[1] = 1;
|
||||
metric = metric_new;
|
||||
}
|
||||
|
||||
metric_new = ulsch_harq->q_ACK[0]-ulsch_harq->q_ACK[1]+ulsch_harq->q_ACK[2];
|
||||
metric_new = q_ACK[0] - q_ACK[1] + q_ACK[2];
|
||||
|
||||
if (metric_new > metric) {
|
||||
ulsch_harq->o_ACK[0] = 1;
|
||||
ulsch_harq->o_ACK[1] = 0;
|
||||
o_ACK[0] = 1;
|
||||
o_ACK[1] = 0;
|
||||
metric = metric_new;
|
||||
}
|
||||
|
||||
metric_new = -ulsch_harq->q_ACK[0]-ulsch_harq->q_ACK[1]-ulsch_harq->q_ACK[2];
|
||||
metric_new = -q_ACK[0] - q_ACK[1] - q_ACK[2];
|
||||
|
||||
if (metric_new > metric) {
|
||||
ulsch_harq->o_ACK[0] = 0;
|
||||
ulsch_harq->o_ACK[1] = 0;
|
||||
o_ACK[0] = 0;
|
||||
o_ACK[1] = 0;
|
||||
metric = metric_new;
|
||||
}
|
||||
}
|
||||
@@ -1100,32 +1039,40 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||
void dump_ulsch_stats(FILE *fd,PHY_VARS_eNB *eNB,int frame) {
|
||||
|
||||
char output[16384];
|
||||
int stroff=0;
|
||||
for (int i=0;i<NUMBER_OF_ULSCH_MAX;i++)
|
||||
if (eNB->ulsch_stats[i].rnti>0 && eNB->ulsch_stats[i].round_trials[0]>100) {
|
||||
for (int aa=0;aa<eNB->frame_parms.nb_antennas_rx;aa++)
|
||||
stroff+=sprintf(output+stroff,"ULSCH RNTI %x: ulsch_power[%d] %d, ulsch_noise_power[%d] %d\n",
|
||||
eNB->ulsch_stats[i].rnti, aa,eNB->ulsch_stats[i].ulsch_power[aa],aa,eNB->ulsch_stats[i].ulsch_noise_power[aa]);
|
||||
AssertFatal(stroff<(STATSTRLEN-1000),"Increase STATSTRLEN\n");
|
||||
stroff+=sprintf(output+stroff,"ULSCH RNTI %x: round_trials %d(%1.1e):%d(%1.1e):%d(%1.1e):%d\n",
|
||||
eNB->ulsch_stats[i].rnti,
|
||||
eNB->ulsch_stats[i].round_trials[0],
|
||||
(double)eNB->ulsch_stats[i].round_trials[1]/eNB->ulsch_stats[i].round_trials[0],
|
||||
eNB->ulsch_stats[i].round_trials[1],
|
||||
(double)eNB->ulsch_stats[i].round_trials[2]/eNB->ulsch_stats[i].round_trials[0],
|
||||
eNB->ulsch_stats[i].round_trials[2],
|
||||
(double)eNB->ulsch_stats[i].round_trials[3]/eNB->ulsch_stats[i].round_trials[0],
|
||||
eNB->ulsch_stats[i].round_trials[3]);
|
||||
stroff+=sprintf(output+stroff,"ULSCH RNTI %x: current_Qm %d, current_G %d, current_TBS %d, current_rate %f,current_RI %d, timing_offset %d, total_bytes RX/SCHED %d/%d\n",
|
||||
eNB->ulsch_stats[i].rnti,
|
||||
eNB->ulsch_stats[i].current_Qm,
|
||||
eNB->ulsch_stats[i].current_G,
|
||||
eNB->ulsch_stats[i].current_TBS,
|
||||
(double)eNB->ulsch_stats[i].current_G/eNB->ulsch_stats[i].current_TBS,
|
||||
eNB->ulsch_stats[i].current_RI,
|
||||
eNB->ulsch_stats[i].timing_offset,
|
||||
eNB->ulsch_stats[i].total_bytes_rx,
|
||||
eNB->ulsch_stats[i].total_bytes_tx);
|
||||
char *str = output;
|
||||
for (eNB_SCH_STATS_t *st = eNB->ulsch_stats; st < eNB->ulsch_stats + sizeofArray(eNB->ulsch_stats); st++)
|
||||
if (st->rnti > 0 && st->round_trials[0] > 100) {
|
||||
for (int aa = 0; aa < eNB->frame_parms.nb_antennas_rx; aa++)
|
||||
str += sprintf(str,
|
||||
"ULSCH RNTI %x: ulsch_power[%d] %d, ulsch_noise_power[%d] %d\n",
|
||||
st->rnti,
|
||||
aa,
|
||||
st->ulsch_power[aa],
|
||||
aa,
|
||||
st->ulsch_noise_power[aa]);
|
||||
AssertFatal((str - output) < (STATSTRLEN - 1000), "Increase STATSTRLEN\n");
|
||||
str += sprintf(str,
|
||||
"ULSCH RNTI %x: round_trials %d(%1.1e):%d(%1.1e):%d(%1.1e):%d\n",
|
||||
st->rnti,
|
||||
st->round_trials[0],
|
||||
(double)st->round_trials[1] / st->round_trials[0],
|
||||
st->round_trials[1],
|
||||
(double)st->round_trials[2] / st->round_trials[0],
|
||||
st->round_trials[2],
|
||||
(double)st->round_trials[3] / st->round_trials[0],
|
||||
st->round_trials[3]);
|
||||
str += sprintf(str,
|
||||
"ULSCH RNTI %x: current_Qm %d, current_G %d, current_TBS %d, current_rate %f,current_RI %d, timing_offset "
|
||||
"%d, total_bytes RX/SCHED %d/%d\n",
|
||||
st->rnti,
|
||||
st->current_Qm,
|
||||
st->current_G,
|
||||
st->current_TBS,
|
||||
(double)st->current_G / st->current_TBS,
|
||||
st->current_RI,
|
||||
st->timing_offset,
|
||||
st->total_bytes_rx,
|
||||
st->total_bytes_tx);
|
||||
}
|
||||
fprintf(fd,"%s",output);
|
||||
}
|
||||
|
||||
@@ -44,12 +44,10 @@ void nr_generate_csi_rs(const NR_DL_FRAME_PARMS *frame_parms,
|
||||
const nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params,
|
||||
const int slot,
|
||||
const csi_mapping_parms_t *phy_csi_parms);
|
||||
void init_byte2m128i(void);
|
||||
|
||||
void init_scrambling_luts(void);
|
||||
void nr_generate_modulation_table(void);
|
||||
|
||||
extern simde__m64 byte2m64_re[256];
|
||||
extern simde__m64 byte2m64_im[256];
|
||||
extern simde__m128i byte2m128i[256];
|
||||
|
||||
int nr_pusch_lowpaprtype1_dmrs_rx(PHY_VARS_gNB *gNB,
|
||||
|
||||
@@ -22,40 +22,13 @@
|
||||
/* Lookup tables for 3GPP scrambling/unscrambling */
|
||||
|
||||
/* Author R. Knopp / EURECOM / OpenAirInterface.org */
|
||||
#ifndef __SCRAMBLING_LUTS__C__
|
||||
#define __SCRAMBLING_LUTS__C__
|
||||
|
||||
#include "PHY/impl_defs_nr.h"
|
||||
#include "PHY/sse_intrin.h"
|
||||
#include <common/utils/LOG/log.h>
|
||||
|
||||
simde__m64 byte2m64_re[256];
|
||||
simde__m64 byte2m64_im[256];
|
||||
|
||||
simde__m128i byte2m128i[256];
|
||||
|
||||
void init_byte2m64(void) {
|
||||
|
||||
for (int s=0;s<256;s++) {
|
||||
byte2m64_re[s] = simde_mm_insert_pi16(byte2m64_re[s],(1-2*(s&1)),0);
|
||||
byte2m64_im[s] = simde_mm_insert_pi16(byte2m64_im[s],(1-2*((s>>1)&1)),0);
|
||||
byte2m64_re[s] = simde_mm_insert_pi16(byte2m64_re[s],(1-2*((s>>2)&1)),1);
|
||||
byte2m64_im[s] = simde_mm_insert_pi16(byte2m64_im[s],(1-2*((s>>3)&1)),1);
|
||||
byte2m64_re[s] = simde_mm_insert_pi16(byte2m64_re[s],(1-2*((s>>4)&1)),2);
|
||||
byte2m64_im[s] = simde_mm_insert_pi16(byte2m64_im[s],(1-2*((s>>5)&1)),2);
|
||||
byte2m64_re[s] = simde_mm_insert_pi16(byte2m64_re[s],(1-2*((s>>6)&1)),3);
|
||||
byte2m64_im[s] = simde_mm_insert_pi16(byte2m64_im[s],(1-2*((s>>7)&1)),3);
|
||||
LOG_T(PHY,"init_scrambling_luts: s %x (%d) ((%d,%d),(%d,%d),(%d,%d),(%d,%d))\n",
|
||||
((uint16_t*)&s)[0],
|
||||
(1-2*(s&1)),
|
||||
((int16_t*)&byte2m64_re[s])[0],((int16_t*)&byte2m64_im[s])[0],
|
||||
((int16_t*)&byte2m64_re[s])[1],((int16_t*)&byte2m64_im[s])[1],
|
||||
((int16_t*)&byte2m64_re[s])[2],((int16_t*)&byte2m64_im[s])[2],
|
||||
((int16_t*)&byte2m64_re[s])[3],((int16_t*)&byte2m64_im[s])[3]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void init_byte2m128i(void) {
|
||||
|
||||
for (int s=0;s<256;s++) {
|
||||
@@ -70,10 +43,3 @@ void init_byte2m128i(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void init_scrambling_luts(void) {
|
||||
|
||||
init_byte2m64();
|
||||
init_byte2m128i();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -93,7 +93,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot)
|
||||
harq->unav_res = ptrsSymbPerSlot * n_ptrs;
|
||||
|
||||
/// CRC, coding, interleaving and rate matching
|
||||
AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n");
|
||||
AssertFatal(harq->pdu != NULL, "%4d.%2d no HARQ PDU for PDSCH generation\n", msgTx->frame, msgTx->slot);
|
||||
|
||||
/* output and its parts for each dlsch should be aligned on 64 bytes
|
||||
* => size_output is a sum of parts sizes rounded up to a multiple of 64
|
||||
@@ -533,7 +533,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot)
|
||||
int rb = 0;
|
||||
while(rb < rel15->rbSize) {
|
||||
//get pmi info
|
||||
const int pmi = (pb->prg_size > 0) ? (pb->prgs_list[(int)rb / pb->prg_size].pm_idx) : 0;
|
||||
const int pmi = (pb->num_prgs > 0 && pb->prg_size > 0) ? (pb->prgs_list[(int)rb / pb->prg_size].pm_idx) : 0;
|
||||
const int pmi2 = (rb < (rel15->rbSize - 1) && pb->prg_size > 0) ? (pb->prgs_list[(int)(rb+1)/pb->prg_size].pm_idx) : -1;
|
||||
|
||||
// If pmi of next RB and pmi of current RB are the same, we do 2 RB in a row
|
||||
|
||||
@@ -35,9 +35,8 @@
|
||||
|
||||
#include "PHY/defs_gNB.h"
|
||||
|
||||
void nr_fill_dlsch(processingData_L1tx_t *msgTx,
|
||||
nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
|
||||
unsigned char *sdu);
|
||||
void nr_fill_dlsch_dl_tti_req(processingData_L1tx_t *msgTx, nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu);
|
||||
void nr_fill_dlsch_tx_req(processingData_L1tx_t *msgTx, int idx, uint8_t *sdu);
|
||||
|
||||
void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
int frame,
|
||||
@@ -57,8 +56,6 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
time_stats_t *dlsch_interleaving_stats,
|
||||
time_stats_t *dlsch_segmentation_stats);
|
||||
|
||||
void nr_emulate_dlsch_payload(uint8_t* payload, uint16_t size);
|
||||
|
||||
void dump_pdsch_stats(FILE *fd,PHY_VARS_gNB *gNB);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -66,7 +66,6 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch, uint16_t N_RB, const NR_DL_FRAME_PARM
|
||||
harq->c[r] = NULL;
|
||||
}
|
||||
free(harq->c);
|
||||
free(harq->pdu);
|
||||
}
|
||||
|
||||
NR_gNB_DLSCH_t new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, uint16_t N_RB)
|
||||
@@ -87,10 +86,6 @@ NR_gNB_DLSCH_t new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, uint16_t N_RB)
|
||||
bzero(harq, sizeof(NR_DL_gNB_HARQ_t));
|
||||
harq->b = malloc16(dlsch_bytes);
|
||||
AssertFatal(harq->b, "cannot allocate memory for harq->b\n");
|
||||
harq->pdu = malloc16(dlsch_bytes);
|
||||
AssertFatal(harq->pdu, "cannot allocate memory for harq->pdu\n");
|
||||
bzero(harq->pdu, dlsch_bytes);
|
||||
nr_emulate_dlsch_payload(harq->pdu, (dlsch_bytes) >> 3);
|
||||
bzero(harq->b, dlsch_bytes);
|
||||
|
||||
harq->c = (uint8_t **)malloc16(a_segments*sizeof(uint8_t *));
|
||||
|
||||
@@ -36,21 +36,29 @@
|
||||
|
||||
extern void set_taus_seed(unsigned int seed_type);
|
||||
|
||||
|
||||
/// Payload emulation
|
||||
void nr_emulate_dlsch_payload(uint8_t* pdu, uint16_t size) {
|
||||
set_taus_seed(0);
|
||||
for (int i=0; i<size; i++)
|
||||
*(pdu+i) = (uint8_t)rand();
|
||||
}
|
||||
|
||||
void nr_fill_dlsch(processingData_L1tx_t *msgTx, nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu, uint8_t *sdu)
|
||||
void nr_fill_dlsch_dl_tti_req(processingData_L1tx_t *msgTx, nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu)
|
||||
{
|
||||
NR_gNB_DLSCH_t *dlsch = &msgTx->dlsch[msgTx->num_pdsch_slot][0];
|
||||
NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process;
|
||||
/// DLSCH struct
|
||||
memcpy((void*)&harq->pdsch_pdu, (void*)pdsch_pdu, sizeof(nfapi_nr_dl_tti_pdsch_pdu));
|
||||
AssertFatal(msgTx->num_pdsch_slot == pdsch_pdu->pdsch_pdu_rel15.pduIndex,
|
||||
"PDSCH PDU index %d does not match msgTx index %d\n",
|
||||
pdsch_pdu->pdsch_pdu_rel15.pduIndex,
|
||||
msgTx->num_pdsch_slot);
|
||||
msgTx->num_pdsch_slot++;
|
||||
harq->pdu = NULL;
|
||||
}
|
||||
|
||||
void nr_fill_dlsch_tx_req(processingData_L1tx_t *msgTx, int idx, uint8_t *sdu)
|
||||
{
|
||||
AssertFatal(sdu != NULL, "sdu is null\n");
|
||||
|
||||
/* not sure if FAPI could transmit DL_TTI_req and TX_req in different orders.
|
||||
* for the moment, assume they are in the same order (and check!) */
|
||||
NR_gNB_DLSCH_t *dlsch = &msgTx->dlsch[idx][0];
|
||||
NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process;
|
||||
nfapi_nr_dl_tti_pdsch_pdu *pdsch = &harq->pdsch_pdu;
|
||||
AssertFatal(pdsch->pdsch_pdu_rel15.pduIndex == idx, "PDSCH PDU index %d does not match %d\n", pdsch->pdsch_pdu_rel15.pduIndex, idx);
|
||||
harq->pdu = sdu;
|
||||
}
|
||||
|
||||
@@ -383,11 +383,10 @@ void rx_nr_prach_ru(RU_t *ru, int prachFormat, int numRA, int prachStartSymbol,
|
||||
const dft_size_idx_t dftsize = get_dft(dftlen);
|
||||
|
||||
// Do forward transform
|
||||
if (LOG_DEBUGFLAG(PRACH)) {
|
||||
if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
|
||||
LOG_D(PHY, "rx_prach: Doing PRACH FFT for nb_rx:%d Ncp:%d dftlen:%d\n", ru->nb_rx, Ncp, dftlen);
|
||||
}
|
||||
|
||||
|
||||
// Note: Assumes PUSCH SCS @ 30 kHz, take values for formats 0-2 and adjust for others below
|
||||
int kbar = 1;
|
||||
int K = 24;
|
||||
@@ -497,7 +496,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
LOG_D(PHY,"L1 PRACH RX: rooSequenceIndex %d, numRootSeqeuences %d, NCS %d, N_ZC %d, format %d \n",rootSequenceIndex,numrootSequenceIndex,NCS,N_ZC,prach_fmt);
|
||||
|
||||
prach_ifft = gNB->prach_vars.prach_ifft;
|
||||
if (LOG_DEBUGFLAG(PRACH)){
|
||||
if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
|
||||
if ((frame&1023) < 20) LOG_D(PHY,"PRACH (gNB) : running rx_prach for slot %d, msg1_frequencystart %d, rootSequenceIndex %d\n", slot, msg1_frequencystart, rootSequenceIndex);
|
||||
}
|
||||
|
||||
@@ -520,8 +519,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
*max_preamble = 0;
|
||||
int16_t prachF[2 * 1024];
|
||||
for (preamble_index=0 ; preamble_index<64 ; preamble_index++) {
|
||||
|
||||
if (LOG_DEBUGFLAG(PRACH)){
|
||||
if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
|
||||
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],(N_ZC==839) ? 840: 140));
|
||||
if (en>60) LOG_D(PHY,"frame %d, slot %d : Trying preamble %d \n",frame,slot,preamble_index);
|
||||
}
|
||||
@@ -599,7 +597,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
|
||||
// Compute DFT of RX signal (conjugate input, results in conjugate output) for each new rootSequenceIndex
|
||||
if (LOG_DEBUGFLAG(PRACH)) {
|
||||
if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
|
||||
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
|
||||
if (en>60)
|
||||
LOG_D(PHY,
|
||||
@@ -626,11 +624,11 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
|
||||
memset(prach_ifft,0,((N_ZC==839) ? 2048 : 256)*sizeof(int32_t));
|
||||
memset(prachF, 0, sizeof(int16_t) * 2 * 1024);
|
||||
if (LOG_DUMPFLAG(PRACH)) {
|
||||
if (LOG_DUMPFLAG(DEBUG_PRACH)) {
|
||||
LOG_M("prach_rxF0.m","prach_rxF0",rxsigF[0],N_ZC,1,1);
|
||||
LOG_M("prach_rxF1.m","prach_rxF1",rxsigF[1],6144,1,1);
|
||||
}
|
||||
|
||||
|
||||
for (int aa = 0; aa < nb_rx; aa++) {
|
||||
// Do componentwise product with Xu* on each antenna
|
||||
|
||||
@@ -653,7 +651,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
prach_ifft[i] += (int32_t)prach_ifft_tmp[i<<1]*(int32_t)prach_ifft_tmp[(i<<1)] + (int32_t)prach_ifft_tmp[1+(i<<1)]*(int32_t)prach_ifft_tmp[1+(i<<1)];
|
||||
}
|
||||
|
||||
if (LOG_DUMPFLAG(PRACH)) {
|
||||
if (LOG_DUMPFLAG(DEBUG_PRACH)) {
|
||||
if (aa == 0)
|
||||
LOG_M("prach_rxF_comp0.m","prach_rxF_comp0", prachF, 1024, 1, 1);
|
||||
if (aa == 1)
|
||||
@@ -717,8 +715,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
else *TA = *TA/2;
|
||||
|
||||
|
||||
if (LOG_DUMPFLAG(PRACH)) {
|
||||
if (LOG_DUMPFLAG(DEBUG_PRACH)) {
|
||||
//int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
|
||||
// if (en>60) {
|
||||
int k = (12 * n_ra_prb) - 6 * fp->N_RB_UL;
|
||||
@@ -734,7 +731,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
LOG_M("Xu.m","xu", Xu, N_ZC, 1, 1);
|
||||
LOG_M("prach_ifft0.m","prach_t0", prach_ifft, 1024, 1, 1);
|
||||
// }
|
||||
} /* LOG_DUMPFLAG(PRACH) */
|
||||
}
|
||||
stop_meas(&gNB->rx_prach);
|
||||
|
||||
}
|
||||
|
||||
@@ -1102,7 +1102,7 @@ static void inner_rx(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
|
||||
if (nb_layer == 2) {
|
||||
if (rel15_ul->qam_mod_order < 6) {
|
||||
if (rel15_ul->qam_mod_order <= 6) {
|
||||
nr_ulsch_compute_ML_llr(pusch_vars,
|
||||
symbol,
|
||||
(c16_t*)&pusch_vars->rxdataF_comp[0][symbol * buffer_length],
|
||||
@@ -1133,7 +1133,7 @@ static void inner_rx(PHY_VARS_gNB *gNB,
|
||||
buffer_length);
|
||||
}
|
||||
}
|
||||
if (nb_layer != 2 || rel15_ul->qam_mod_order >= 6)
|
||||
if (nb_layer != 2 || rel15_ul->qam_mod_order > 6)
|
||||
for (int aatx = 0; aatx < nb_layer; aatx++)
|
||||
nr_ulsch_compute_llr((int32_t*)&pusch_vars->rxdataF_comp[aatx * nb_rx_ant][symbol * buffer_length],
|
||||
(int32_t*)rxF_ch_maga[aatx],
|
||||
@@ -1453,9 +1453,11 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
|
||||
for (int aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++)
|
||||
avgs = cmax(avgs, avg[nl * frame_parms->nb_antennas_rx + aarx]);
|
||||
|
||||
if (rel15_ul->nrOfLayers == 2 && rel15_ul->qam_mod_order >= 6)
|
||||
if (rel15_ul->nrOfLayers == 2 && rel15_ul->qam_mod_order > 6)
|
||||
pusch_vars->log2_maxh = (log2_approx(avgs) >> 1) - 3; // for MMSE
|
||||
else
|
||||
else if (rel15_ul->nrOfLayers == 2)
|
||||
pusch_vars->log2_maxh = (log2_approx(avgs) >> 1) - 2 + log2_approx(frame_parms->nb_antennas_rx >> 1);
|
||||
else
|
||||
pusch_vars->log2_maxh = (log2_approx(avgs) >> 1) + 1 + log2_approx(frame_parms->nb_antennas_rx >> 1);
|
||||
|
||||
if (pusch_vars->log2_maxh < 0)
|
||||
|
||||
@@ -62,10 +62,6 @@ void nr_fill_pucch(PHY_VARS_gNB *gNB,
|
||||
int slot,
|
||||
nfapi_nr_pucch_pdu_t *pucch_pdu)
|
||||
{
|
||||
|
||||
if (NFAPI_MODE == NFAPI_MODE_PNF)
|
||||
gNB->pucch[0].active = false; // check if true in monolithic mode
|
||||
|
||||
bool found = false;
|
||||
for (int i = 0; i < gNB->max_nb_pucch; i++) {
|
||||
NR_gNB_PUCCH_t *pucch = &gNB->pucch[i];
|
||||
@@ -1299,7 +1295,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
||||
corr_dB = dB_fixed64(corr);
|
||||
LOG_D(PHY, "metric %d dB\n", corr_dB);
|
||||
} else
|
||||
LOG_E(PHY, "PUCCH not processed: nb_bit %d decoderState %d\n", nb_bit, decoderState);
|
||||
LOG_D(PHY, "PUCCH not processed: nb_bit %d decoderState %d\n", nb_bit, decoderState);
|
||||
|
||||
LOG_D(PHY, "UCI decoderState %d, payload[0] %llu\n", decoderState, (unsigned long long)decodedPayload[0]);
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int frame, uint8_t
|
||||
|
||||
LOG_I(PHY,
|
||||
"PRACH [UE %d] in frame.slot %d.%d, placing PRACH in position %d, Msg1/MsgA-Preamble frequency start %d (k1 %d), "
|
||||
"preamble_offset %d, first_nonzero_root_idx %d\n",
|
||||
"preamble_offset %d, first_nonzero_root_idx %d, preambleIndex = %d\n",
|
||||
Mod_id,
|
||||
frame,
|
||||
slot,
|
||||
@@ -235,7 +235,8 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int frame, uint8_t
|
||||
n_ra_prb,
|
||||
nrUE_config->prach_config.num_prach_fd_occasions_list[fd_occasion].k1,
|
||||
preamble_offset,
|
||||
first_nonzero_root_idx);
|
||||
first_nonzero_root_idx,
|
||||
prach_pdu->ra_PreambleIndex);
|
||||
|
||||
// Ncp and dftlen here is given in terms of T_s wich is 30.72MHz sampling
|
||||
if (prach_sequence_length == 0) {
|
||||
|
||||
@@ -726,13 +726,6 @@ int32_t sub_cpx_vector16(int16_t *x,
|
||||
*/
|
||||
int32_t signal_energy(int32_t *,uint32_t);
|
||||
|
||||
#ifdef LOCALIZATION
|
||||
/*!\fn int32_t signal_energy(int *,uint32_t);
|
||||
\brief Computes the signal energy per subcarrier
|
||||
*/
|
||||
int32_t subcarrier_energy(int32_t *,uint32_t, int32_t *subcarrier_energy, uint16_t rx_power_correction);
|
||||
#endif
|
||||
|
||||
/*!\fn uint32_t signal_energy_nodc(c16_t *,uint32_t);
|
||||
\brief Computes the signal energy per subcarrier, without DC removal
|
||||
*/
|
||||
|
||||
@@ -45,17 +45,13 @@
|
||||
#include "defs_eNB.h"
|
||||
//#include <complex.h>
|
||||
#include "assertions.h"
|
||||
#ifdef MEX
|
||||
#define msg mexPrintf
|
||||
#else
|
||||
#if ENABLE_RAL
|
||||
#include "collection/hashtable/hashtable.h"
|
||||
#include "COMMON/ral_messages_types.h"
|
||||
#include "UTIL/queue.h"
|
||||
#endif
|
||||
#include "common/utils/LOG/log.h"
|
||||
#define msg(aRGS...) LOG_D(PHY, ##aRGS)
|
||||
#if ENABLE_RAL
|
||||
#include "collection/hashtable/hashtable.h"
|
||||
#include "COMMON/ral_messages_types.h"
|
||||
#include "UTIL/queue.h"
|
||||
#endif
|
||||
#include "common/utils/LOG/log.h"
|
||||
#define msg(aRGS...) LOG_D(PHY, ##aRGS)
|
||||
//use msg in the real-time thread context
|
||||
#define msg_nrt printf
|
||||
//use msg_nrt in the non real-time context (for initialization, ...)
|
||||
@@ -663,13 +659,7 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
|
||||
time_stats_t ulsch_tc_gamma_stats;
|
||||
time_stats_t ulsch_tc_ext_stats;
|
||||
time_stats_t ulsch_tc_intl1_stats;
|
||||
time_stats_t ulsch_tc_intl2_stats;
|
||||
|
||||
#ifdef LOCALIZATION
|
||||
/// time state for localization
|
||||
time_stats_t localization_stats;
|
||||
#endif
|
||||
|
||||
time_stats_t ulsch_tc_intl2_stats;
|
||||
int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX_NB_IoT][10];
|
||||
int32_t pucch1_stats[NUMBER_OF_UE_MAX_NB_IoT][10*1024];
|
||||
int32_t pucch1_stats_thres[NUMBER_OF_UE_MAX_NB_IoT][10*1024];
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
#include "time_meas.h"
|
||||
#include "defs_common.h"
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
#include <executables/rt_profiling.h>
|
||||
#include "common/utils/threadPool/task_ans.h"
|
||||
#include "common/utils/threadPool/thread-pool.h"
|
||||
|
||||
@@ -663,8 +662,6 @@ typedef struct RU_t_s {
|
||||
int tpcores[16];
|
||||
/// number of cores for RU ThreadPool
|
||||
int num_tpcores;
|
||||
/// structure for analyzing high-level RT measurements
|
||||
rt_ru_profiling_t rt_ru_profiling;
|
||||
void* scopeData;
|
||||
} RU_t;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user