Merge from develop
@@ -1,17 +0,0 @@
|
||||
job1:
|
||||
script:
|
||||
- date
|
||||
- pwd
|
||||
- echo $OAI_TEST_CASE_GROUP
|
||||
- echo $MACHINELIST
|
||||
- echo $MACHINELISTGENERIC
|
||||
- echo $RESULT_DIR
|
||||
- echo $NRUNS_LTE_SOFTMODEM
|
||||
- source oaienv
|
||||
- rm -rf cmake_targets/autotests/log
|
||||
- mkdir cmake_targets/autotests/log
|
||||
- cd cmake_targets/autotests/v2
|
||||
- python main.py
|
||||
- date
|
||||
only:
|
||||
- triggers
|
||||
@@ -9,26 +9,36 @@ Please see NOTICE.txt for third party software that is included in the sources.
|
||||
The OpenAirInterface (OAI) software is composed of the following parts:
|
||||
|
||||
openairinterface5g
|
||||
├── cmake_targets: build utilities to compile (simulation, emulation and real-time platforms), and generated build files
|
||||
├── common : some common OAI utilities, other tools can be found at openair2/UTILS
|
||||
├── ci-scripts: Meta-scripts used by the OSA CI process. Contains also configuration files used day-to-day by CI.
|
||||
├── cmake_targets: Build utilities to compile (simulation, emulation and real-time platforms), and generated build files
|
||||
├── common : Some common OAI utilities, other tools can be found at openair2/UTILS
|
||||
├── doc : Contains an up-to-date feature set list
|
||||
├── LICENSE
|
||||
├── maketags : script to generate emacs tags
|
||||
├── openair1 : 3GPP LTE Rel-10 PHY layer + PHY RF simulation and a subset of Rel 12 Features.
|
||||
├── openair2 :3GPP LTE Rel-10 RLC/MAC/PDCP/RRC/X2AP implementation.
|
||||
├── maketags : Script to generate emacs tags
|
||||
├── nfapi : Contains the NFAPI code. A local Readme file provides more details.
|
||||
├── openair1 : 3GPP LTE Rel-10/12 PHY layer + PHY RF simulation. A local Readme file provides more details.
|
||||
├── openair2 : 3GPP LTE Rel-10 RLC/MAC/PDCP/RRC/X2AP implementation.
|
||||
├── COMMON
|
||||
├── DOCS
|
||||
├── ENB_APP
|
||||
├── LAYER2/RLC/ with the following subdirectories: UM_v9.3.0, TM_v9.3.0, and AM_v9.3.0.
|
||||
├── LAYER2/PDCP/PDCP_v10.1.0.
|
||||
├── RRC/LITE
|
||||
├── LAYER2/PDCP/PDCP_v10.1.0.
|
||||
├── NETWORK_DRIVER
|
||||
├── PHY_INTERFACE
|
||||
├── RRC/LITE
|
||||
├── UTIL
|
||||
├── X2AP
|
||||
├── ENB_APP
|
||||
├── openair3: 3GPP LTE Rel10 for S1AP, NAS GTPV1-U for both ENB and UE.
|
||||
├── COMMON
|
||||
├── DOCS
|
||||
├── GTPV1-U
|
||||
├── NAS
|
||||
├── NAS
|
||||
├── S1AP
|
||||
├── SCTP
|
||||
├── SECU
|
||||
├── UDP
|
||||
└── targets: top level wrapper for unitary simulation for PHY channels, system-level emulation (eNB-UE with and without S1), and realtime eNB and UE and RRH GW.
|
||||
├── UTILS
|
||||
└── targets: Top-level wrappers for unitary simulation for PHY channels, system-level emulation (eNB-UE with and without S1), and realtime eNB and UE and RRH GW.
|
||||
|
||||
|
||||
RELEASE NOTES:
|
||||
@@ -44,3 +54,10 @@ v0.6 -> RRH functionality, UE greatly improved, better TDD support,
|
||||
a lot of bugs fixed. WARNING: oaisim in PHY abstraction mode does not
|
||||
work, you need to use v0.5.2 for that.
|
||||
v0.6.1 -> Mostly bugfixes. This is the last version without NFAPI.
|
||||
v1.0.0 -> January 2019. This version first implements the architectural split described in doc/oai_lte_enb_func_split_arch.png picture.
|
||||
Only FAPI, nFAPI and IF4.5 interfaces are implemented.
|
||||
Repository tree structure prepares future integrations of features such as LTE-M, nbIOT or 5G-NR.
|
||||
Preliminary X2 support has been implemented.
|
||||
S1-flex has been introduced.
|
||||
New tools: config library, telnet server, ...
|
||||
A lot of bugfixes and a proper automated Continuous Integration process validates contributions.
|
||||
|
||||
@@ -41,7 +41,7 @@ pipeline {
|
||||
disableConcurrentBuilds()
|
||||
timestamps()
|
||||
gitLabConnection('OAI GitLab')
|
||||
gitlabBuilds(builds: ["Build eNb-USRP", "Build basic-sim", "Build phy-sim", "Build eNb-ethernet", "Build UE-ethernet", "Analysis with cppcheck", "Test phy-sim", "Test basic-sim", "Test-FDD-Band7", "Test-TDD-Band40", "Test-IF4p5-FDD-Band7", "Test-IF4p5-TDD-Band40"])
|
||||
gitlabBuilds(builds: ["Build eNb-USRP", "Build basic-sim", "Build phy-sim", "Build eNb-ethernet", "Build UE-ethernet", "Analysis with cppcheck", "Test phy-sim", "Test basic-sim", "Test L2-sim", "Test-FDD-Band7", "Test-TDD-Band40", "Test-IF4p5-FDD-Band7", "Test-IF4p5-TDD-Band40"])
|
||||
ansiColor('xterm')
|
||||
}
|
||||
|
||||
@@ -332,11 +332,11 @@ pipeline {
|
||||
}
|
||||
stage ("Test L2 simulator") {
|
||||
steps {
|
||||
//gitlabCommitStatus(name: "Test basic-sim") {
|
||||
gitlabCommitStatus(name: "Test L2-sim") {
|
||||
timeout (time: 30, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant l2-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build Flexran Controller") {
|
||||
@@ -534,7 +534,7 @@ pipeline {
|
||||
always {
|
||||
script {
|
||||
dir ('archives') {
|
||||
sh "if [ -d basic_sim/test ] || [ -d phy_sim/test ]; then zip -r -qq vm_tests_logs.zip */test ; fi"
|
||||
sh "if [ -d basic_sim/test ] || [ -d phy_sim/test ] || [ -d l2_sim/test ]; then zip -r -qq vm_tests_logs.zip */test ; fi"
|
||||
}
|
||||
if(fileExists('archives/vm_tests_logs.zip')) {
|
||||
archiveArtifacts artifacts: 'archives/vm_tests_logs.zip'
|
||||
|
||||
@@ -0,0 +1,443 @@
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
eNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
eNB_ID = 0xe00;
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
plmn_list = ( { mcc = 208; mnc = 93; mnc_length = 2;} );
|
||||
|
||||
tr_s_preference = "local_mac"
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
node_function = "3GPP_eNodeB";
|
||||
node_timing = "synch_to_ext_device";
|
||||
node_synch_ref = 0;
|
||||
frame_type = "FDD";
|
||||
tdd_config = 3;
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 13;
|
||||
downlink_frequency = 751000000L;
|
||||
uplink_frequency_offset = 31000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 50;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 110;
|
||||
pbch_repetition = "FALSE";
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
prach_zero_correlation = 1;
|
||||
prach_freq_offset = 1;
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 1;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pdsch_referenceSignalPower = -27;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
pusch_hoppingMode = "interSubFrame";
|
||||
pusch_hoppingOffset = 0;
|
||||
pusch_groupHoppingEnabled = "ENABLE";
|
||||
pusch_groupAssignment = 0;
|
||||
pusch_sequenceHoppingEnabled = "DISABLE";
|
||||
pusch_nDMRS1 = 1;
|
||||
phich_duration = "NORMAL";
|
||||
phich_resource = "ONESIXTH";
|
||||
srs_enable = "DISABLE";
|
||||
/* srs_BandwidthConfig =;
|
||||
srs_SubframeConfig =;
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
pucch_deltaF_Format2 = "deltaF0";
|
||||
pucch_deltaF_Format2a = "deltaF0";
|
||||
pucch_deltaF_Format2b = "deltaF0";
|
||||
|
||||
rach_numberOfRA_Preambles = "n64"; #64
|
||||
rach_preamblesGroupAConfig = "DISABLE";
|
||||
/*
|
||||
rach_sizeOfRA_PreamblesGroupA = ;
|
||||
rach_messageSizeGroupA = ;
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
*/
|
||||
rach_powerRampingStep = 4;
|
||||
rach_preambleInitialReceivedTargetPower = -108;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 48;
|
||||
rach_maxHARQ_Msg3Tx = 4;
|
||||
|
||||
pcch_default_PagingCycle = "rf128"; #128
|
||||
pcch_nB = "oneT";
|
||||
bcch_modificationPeriodCoeff = 2;
|
||||
ue_TimersAndConstants_t300 = "ms1000";
|
||||
ue_TimersAndConstants_t301 = "ms1000";
|
||||
ue_TimersAndConstants_t310 = "ms1000";
|
||||
ue_TimersAndConstants_t311 = "ms10000";
|
||||
ue_TimersAndConstants_n310 = "n20";
|
||||
ue_TimersAndConstants_n311 = "n1";
|
||||
ue_TransmissionMode = "tm1";
|
||||
|
||||
# eMTC Parameters
|
||||
emtc_parameters :
|
||||
{
|
||||
eMTC_configured = 1;
|
||||
#hyperSFN_r13 = 0;
|
||||
#eDRX_Allowed_r13 = 0;
|
||||
#q_QualMinRSRQ_CE_r13 = ;
|
||||
|
||||
#SIB1
|
||||
schedulingInfoSIB1_BR_r13 = 4;
|
||||
|
||||
#system_info_value_tag_SI =
|
||||
#(
|
||||
# {
|
||||
# systemInfoValueTagSi_r13 = 0;
|
||||
# }
|
||||
#);
|
||||
|
||||
cellSelectionInfoCE_r13 = "ENABLE";
|
||||
q_RxLevMinCE_r13 = -70;
|
||||
bandwidthReducedAccessRelatedInfo_r13 = "ENABLE"
|
||||
si_WindowLength_BR_r13 = "ms20"; #0
|
||||
si_RepetitionPattern_r13 = "everyRF"; #0
|
||||
|
||||
scheduling_info_br =
|
||||
(
|
||||
{
|
||||
si_Narrowband_r13 = 8;
|
||||
si_TBS_r13 = 5;
|
||||
}
|
||||
);
|
||||
|
||||
fdd_DownlinkOrTddSubframeBitmapBR_r13 = "subframePattern40-r13";
|
||||
fdd_DownlinkOrTddSubframeBitmapBR_val_r13 = 0xFFFFFFFFFF;
|
||||
startSymbolBR_r13 = 2;
|
||||
si_HoppingConfigCommon_r13 = "off"; #1; # Note: 1==OFF !
|
||||
si_ValidityTime_r13 = "true"; #0
|
||||
|
||||
freqHoppingParametersDL_r13 = "DISABLE"
|
||||
mpdcch_pdsch_HoppingNB_r13 = "nb2"; #0
|
||||
interval_DLHoppingConfigCommonModeA_r13 = "interval-FDD-r13"
|
||||
interval_DLHoppingConfigCommonModeA_r13_val = 0;
|
||||
interval_DLHoppingConfigCommonModeB_r13 = "interval-FDD-r13"
|
||||
interval_DLHoppingConfigCommonModeB_r13_val = 0;
|
||||
mpdcch_pdsch_HoppingOffset_r13 = 1;
|
||||
|
||||
|
||||
# SIB23
|
||||
frame_type = "FDD";
|
||||
preambleTransMax_CE_r13 = 10; #6
|
||||
|
||||
rach_numberOfRA_Preambles = 60; #14
|
||||
rach_powerRampingStep = 4;
|
||||
rach_preambleInitialReceivedTargetPower = -110;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 64;
|
||||
rach_maxHARQ_Msg3Tx = 4;
|
||||
|
||||
# max size for this array is 4
|
||||
rach_CE_LevelInfoList_r13 =
|
||||
(
|
||||
{
|
||||
firstPreamble_r13 = 60;
|
||||
lastPreamble_r13 = 63;
|
||||
ra_ResponseWindowSize_r13 = 20; #0
|
||||
mac_ContentionResolutionTimer_r13 = 80; #0
|
||||
rar_HoppingConfig_r13 = "off"; #1;
|
||||
}
|
||||
);
|
||||
|
||||
# BCCH CONFIG
|
||||
bcch_modificationPeriodCoeff = 2;
|
||||
|
||||
#PCCH Config
|
||||
pcch_default_PagingCycle = "rf128"; #128
|
||||
pcch_nB = "oneT";
|
||||
|
||||
#PRACH Config
|
||||
prach_root = 89;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
prach_zero_correlation = 1;
|
||||
prach_freq_offset = 1;
|
||||
|
||||
#PDSCH Config Common
|
||||
pdsch_referenceSignalPower = -27
|
||||
pdsch_p_b = 0;
|
||||
|
||||
|
||||
# PUSCH Config Common
|
||||
pusch_n_SB = 1;
|
||||
pusch_hoppingMode = "interSubFrame";
|
||||
pusch_hoppingOffset = 0;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
pusch_groupHoppingEnabled = "ENABLE";
|
||||
pusch_groupAssignment = 0;
|
||||
pusch_sequenceHoppingEnabled = "DISABLE";
|
||||
pusch_nDMRS1 = 1;
|
||||
|
||||
# PUCCH Config Common
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -104;
|
||||
pucch_deltaF_Format1 = "deltaF0";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
pucch_deltaF_Format2 = "deltaF0";
|
||||
pucch_deltaF_Format2a = "deltaF0";
|
||||
pucch_deltaF_Format2b = "deltaF0";
|
||||
|
||||
msg3_delta_Preamble = 6;
|
||||
|
||||
|
||||
prach_ConfigCommon_v1310 = "ENABLE";
|
||||
|
||||
mpdcch_startSF_CSS_RA_r13 = "fdd-r13";
|
||||
mpdcch_startSF_CSS_RA_r13_val = "v1"; #0
|
||||
prach_HoppingOffset_r13 = 0;
|
||||
|
||||
|
||||
pdsch_maxNumRepetitionCEmodeA_r13 = "r16"; #0
|
||||
#pdsch_maxNumRepetitionCEmodeB_r13 = "r384"; # NULL - 2
|
||||
|
||||
pusch_maxNumRepetitionCEmodeA_r13 = "r8"; #0
|
||||
#pusch_maxNumRepetitionCEmodeB_r13 = "r768"; #4 #NULL
|
||||
#pusch_HoppingOffset_v1310 = 5; #NULL
|
||||
|
||||
# max size for this array is 3
|
||||
rsrp_range_list =
|
||||
(
|
||||
{
|
||||
rsrp_range_br = 0;
|
||||
}
|
||||
);
|
||||
|
||||
# max size for this array is 4
|
||||
prach_parameters_ce_r13 =
|
||||
(
|
||||
{
|
||||
prach_config_index_br = 3;
|
||||
prach_freq_offset_br = 2;
|
||||
prach_StartingSubframe_r13 = 2;
|
||||
maxNumPreambleAttemptCE_r13 = 10; #6
|
||||
numRepetitionPerPreambleAttempt_r13 = 1; #0
|
||||
mpdcch_NumRepetition_RA_r13 = 1; #0
|
||||
prach_HoppingConfig_r13 = 0; #1
|
||||
max_available_narrow_band = [3];
|
||||
}
|
||||
);
|
||||
|
||||
n1PUCCH_AN_InfoList_r13 =
|
||||
(
|
||||
{
|
||||
pucch_info_value = 0;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
ue_TimersAndConstants_t300 = "ms1000";
|
||||
ue_TimersAndConstants_t301 = "ms400";
|
||||
ue_TimersAndConstants_t310 = "ms50";
|
||||
ue_TimersAndConstants_t311 = "ms30000";
|
||||
ue_TimersAndConstants_n310 = "n1";
|
||||
ue_TimersAndConstants_n311 = "n10";
|
||||
ue_TransmissionMode = "tm1";
|
||||
|
||||
pcch_config_v1310 :
|
||||
{
|
||||
paging_narrowbands_r13 = 1;
|
||||
mpdcch_numrepetition_paging_r13 = "r1"; #0
|
||||
#nb_v1310 = "one256thT"; #2
|
||||
}
|
||||
|
||||
|
||||
pucch_NumRepetitionCE_Msg4_Level0_r13 = "n1"; #0
|
||||
#pucch_NumRepetitionCE_Msg4_Level1_r13 = "n2"; #1
|
||||
#pucch_NumRepetitionCE_Msg4_Level2_r13 = "n16"; #2
|
||||
#pucch_NumRepetitionCE_Msg4_Level3_r13 = "n32"; #3
|
||||
|
||||
sib2_freq_hoppingParameters_r13 :
|
||||
{
|
||||
#sib2_mpdcch_pdsch_hoppingNB_r13 = "nb2"; #0
|
||||
#sib2_interval_DLHoppingConfigCommonModeA_r13 = "FDD"; # choice -> (0, FDD) (1, TDD)
|
||||
#sib2_interval_DLHoppingConfigCommonModeA_r13_val = "int1";
|
||||
#sib2_interval_DLHoppingConfigCommonModeB_r13 = "FDD"; # choice -> (0, FDD) (1, TDD)
|
||||
#sib2_interval_DLHoppingConfigCommonModeB_r13_val = "int2";
|
||||
|
||||
sib2_interval_ULHoppingConfigCommonModeA_r13 = "FDD"; # choice -> (0, FDD) (1, TDD)
|
||||
sib2_interval_ULHoppingConfigCommonModeA_r13_val = "int4"; #2
|
||||
# sib2_interval_ULHoppingConfigCommonModeB_r13 = "FDD"; # choice -> (0, FDD) (1, TDD)
|
||||
# sib2_interval_ULHoppingConfigCommonModeB_r13_val = "int2"; #0
|
||||
|
||||
# sib2_mpdcch_pdsch_hoppingOffset_r13 = 1;
|
||||
}
|
||||
|
||||
rach_preamblesGroupAConfig = "DISABLE";
|
||||
|
||||
phich_duration = "NORMAL";
|
||||
phich_resource = "ONESIXTH";
|
||||
srs_enable = "DISABLE";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
||||
|
||||
srb1_parameters :
|
||||
{
|
||||
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
|
||||
timer_poll_retransmit = 80;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
|
||||
timer_reordering = 35;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
|
||||
timer_status_prohibit = 0;
|
||||
|
||||
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
|
||||
poll_pdu = 4;
|
||||
|
||||
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
|
||||
poll_byte = 99999;
|
||||
|
||||
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
|
||||
max_retx_threshold = 4;
|
||||
}
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR";
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR";
|
||||
ENB_PORT_FOR_X2C = 36422; # Spec 36422
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
phy_test_mode = 0;
|
||||
puSch10xSnr = 200;
|
||||
puCch10xSnr = 200;
|
||||
}
|
||||
);
|
||||
|
||||
L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
}
|
||||
);
|
||||
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 1
|
||||
nb_rx = 1
|
||||
att_tx = 0
|
||||
att_rx = 0;
|
||||
bands = [13];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 125;
|
||||
eNB_instances = [0];
|
||||
}
|
||||
);
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
|
||||
@@ -417,6 +417,130 @@ function report_test {
|
||||
echo " </div>" >> ./test_simulator_results.html
|
||||
fi
|
||||
|
||||
ARCHIVES_LOC=archives/l2_sim/test
|
||||
if [ -d $ARCHIVES_LOC ]
|
||||
then
|
||||
echo " <h3>L2-NFAPI Simulator Check</h3>" >> ./test_simulator_results.html
|
||||
|
||||
if [ -f $ARCHIVES_LOC/test_final_status.log ]
|
||||
then
|
||||
if [ `grep -c TEST_OK $ARCHIVES_LOC/test_final_status.log` -eq 1 ]
|
||||
then
|
||||
echo " <div class=\"alert alert-success\">" >> ./test_simulator_results.html
|
||||
echo " <strong>TEST was SUCCESSFUL <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./test_simulator_results.html
|
||||
echo " </div>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html
|
||||
echo " <strong>TEST was a FAILURE! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html
|
||||
echo " </div>" >> ./test_simulator_results.html
|
||||
fi
|
||||
else
|
||||
echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html
|
||||
echo " <strong>COULD NOT DETERMINE TEST FINAL STATUS! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html
|
||||
echo " </div>" >> ./test_simulator_results.html
|
||||
fi
|
||||
|
||||
echo " <button data-toggle=\"collapse\" data-target=\"#oai-l2-sim-test-details\">More details on L2-NFAPI Simulator test results</button>" >> ./test_simulator_results.html
|
||||
echo " <div id=\"oai-l2-sim-test-details\" class=\"collapse\">" >> ./test_simulator_results.html
|
||||
echo " <table border = \"1\">" >> ./test_simulator_results.html
|
||||
echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html
|
||||
echo " <th>Log File Name</th>" >> ./test_simulator_results.html
|
||||
echo " <th>Command</th>" >> ./test_simulator_results.html
|
||||
echo " <th>Status</th>" >> ./test_simulator_results.html
|
||||
echo " <th>Statistics</th>" >> ./test_simulator_results.html
|
||||
echo " </tr>" >> ./test_simulator_results.html
|
||||
|
||||
TRANS_MODES=("fdd")
|
||||
BW_CASES=(05)
|
||||
for TMODE in ${TRANS_MODES[@]}
|
||||
do
|
||||
for BW in ${BW_CASES[@]}
|
||||
do
|
||||
ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_enb.log
|
||||
UE_LOG=`echo $ENB_LOG | sed -e "s#enb#ue#"`
|
||||
if [ -f $ENB_LOG ] && [ -f $UE_LOG ]
|
||||
then
|
||||
NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
|
||||
NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
|
||||
echo " <tr>" >> ./test_simulator_results.html
|
||||
echo " <td>$NAME_ENB --- $NAME_UE</td>" >> ./test_simulator_results.html
|
||||
echo " <td>N/A</td>" >> ./test_simulator_results.html
|
||||
NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG`
|
||||
NB_UE_GOT_SYNC=`egrep -c "got sync" $UE_LOG`
|
||||
NB_ENB_SYNCED_WITH_UE=`egrep -c "Sending NFAPI_START_RESPONSE" $UE_LOG`
|
||||
if [ $NB_ENB_GOT_SYNC -eq 1 ] && [ $NB_UE_GOT_SYNC -eq 3 ] && [ $NB_ENB_SYNCED_WITH_UE -eq 1 ]
|
||||
then
|
||||
echo " <td bgcolor = \"green\" >OK</td>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html
|
||||
fi
|
||||
echo " <td><pre>" >> ./test_simulator_results.html
|
||||
if [ $NB_ENB_GOT_SYNC -eq 1 ]
|
||||
then
|
||||
echo "<font color = \"blue\">- eNB --> got sync</font>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo "<font color = \"red\"><b>- eNB NEVER got sync</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
if [ $NB_UE_GOT_SYNC -eq 3 ]
|
||||
then
|
||||
echo "<font color = \"blue\">- UE --> got sync</font>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo "<font color = \"red\"><b>- UE NEVER got sync</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
if [ $NB_ENB_SYNCED_WITH_UE -eq 1 ]
|
||||
then
|
||||
echo "<font color = \"blue\">- UE attached to eNB</font>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo "<font color = \"red\"><b>- UE NEVER attached to eNB</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
echo " </pre></td>" >> ./test_simulator_results.html
|
||||
echo " </tr>" >> ./test_simulator_results.html
|
||||
fi
|
||||
PING_CASE=$ARCHIVES_LOC/${TMODE}_${BW}MHz_ping_epc.txt
|
||||
if [ -f $PING_CASE ]
|
||||
then
|
||||
echo " <tr>" >> ./test_simulator_results.html
|
||||
NAME=`echo $PING_CASE | sed -e "s#$ARCHIVES_LOC/##"`
|
||||
echo " <td>$NAME</td>" >> ./test_simulator_results.html
|
||||
CMD=`egrep "COMMAND IS" $PING_CASE | sed -e "s#COMMAND IS: ##"`
|
||||
echo " <td>$CMD</td>" >> ./test_simulator_results.html
|
||||
FILE_COMPLETE=`egrep -c "ping statistics" $PING_CASE`
|
||||
if [ $FILE_COMPLETE -eq 0 ]
|
||||
then
|
||||
echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html
|
||||
echo " <td>N/A</td>" >> ./test_simulator_results.html
|
||||
else
|
||||
NB_TR_PACKETS=`egrep "packets transmitted" $PING_CASE | sed -e "s# packets transmitted.*##"`
|
||||
NB_RC_PACKETS=`egrep "packets transmitted" $PING_CASE | sed -e "s#^.*packets transmitted, ##" -e "s# received,.*##"`
|
||||
if [ $NB_TR_PACKETS -eq $NB_RC_PACKETS ]
|
||||
then
|
||||
echo " <td bgcolor = \"green\" >OK</td>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html
|
||||
fi
|
||||
echo " <td>" >> ./test_simulator_results.html
|
||||
echo " <pre>" >> ./test_simulator_results.html
|
||||
STATS=`egrep "packets transmitted" $PING_CASE | sed -e "s#^.*received, ##" -e "s#, time.*##" -e "s# packet loss##"`
|
||||
echo "Packet Loss : $STATS" >> ./test_simulator_results.html
|
||||
RTTMIN=`egrep "rtt min" $PING_CASE | awk '{split($4,a,"/"); print a[1] " " $5}'`
|
||||
echo "RTT Minimal : $RTTMIN" >> ./test_simulator_results.html
|
||||
RTTAVG=`egrep "rtt min" $PING_CASE | awk '{split($4,a,"/"); print a[2] " " $5}'`
|
||||
echo "RTT Average : $RTTAVG" >> ./test_simulator_results.html
|
||||
RTTMAX=`egrep "rtt min" $PING_CASE | awk '{split($4,a,"/"); print a[3] " " $5}'`
|
||||
echo "RTT Maximal : $RTTMAX" >> ./test_simulator_results.html
|
||||
echo " </pre>" >> ./test_simulator_results.html
|
||||
echo " </td>" >> ./test_simulator_results.html
|
||||
fi
|
||||
echo " </tr>" >> ./test_simulator_results.html
|
||||
fi
|
||||
|
||||
done
|
||||
done
|
||||
|
||||
echo " </table>" >> ./test_simulator_results.html
|
||||
echo " </div>" >> ./test_simulator_results.html
|
||||
fi
|
||||
|
||||
ARCHIVES_LOC=archives/phy_sim/test
|
||||
if [ -d $ARCHIVES_LOC ]
|
||||
then
|
||||
|
||||
@@ -148,6 +148,15 @@ function ping_ue_ip_addr {
|
||||
rm -f $1
|
||||
}
|
||||
|
||||
function ping_epc_ip_addr {
|
||||
echo "echo \"COMMAND IS: ping -I oip1 -c 20 $3\" > $4" > $1
|
||||
echo "rm -f $4" >> $1
|
||||
echo "ping -I oip1 -c 20 $3 | tee -a $4" >> $1
|
||||
cat $1
|
||||
ssh -o StrictHostKeyChecking=no ubuntu@$2 < $1
|
||||
rm -f $1
|
||||
}
|
||||
|
||||
function check_ping_result {
|
||||
local LOC_PING_FILE=$1
|
||||
local LOC_NB_PINGS=$2
|
||||
@@ -157,16 +166,19 @@ function check_ping_result {
|
||||
if [ $FILE_COMPLETE -eq 0 ]
|
||||
then
|
||||
PING_STATUS=-1
|
||||
echo "ping file incomplete"
|
||||
else
|
||||
local ALL_PACKET_RECEIVED=`egrep -c "$LOC_NB_PINGS received" $LOC_PING_FILE`
|
||||
if [ $ALL_PACKET_RECEIVED -eq 1 ]
|
||||
then
|
||||
echo "got all ping packets"
|
||||
else
|
||||
echo "got NOT all ping packets"
|
||||
PING_STATUS=-1
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "ping file not present"
|
||||
PING_STATUS=-1
|
||||
fi
|
||||
}
|
||||
@@ -533,8 +545,30 @@ function start_l2_sim_enb {
|
||||
echo "sudo -E daemon --inherit --unsafe --name=enb_daemon --chdir=/home/ubuntu/tmp/cmake_targets/lte_build_oai/build/ -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1
|
||||
|
||||
ssh -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1
|
||||
sleep 10
|
||||
rm $1
|
||||
|
||||
local i="0"
|
||||
echo "egrep -c \"Waiting for PHY_config_req\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1
|
||||
while [ $i -lt 10 ]
|
||||
do
|
||||
sleep 5
|
||||
CONNECTED=`ssh -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1`
|
||||
if [ $CONNECTED -ne 0 ]
|
||||
then
|
||||
i="100"
|
||||
else
|
||||
i=$[$i+1]
|
||||
fi
|
||||
done
|
||||
rm $1
|
||||
if [ $i -lt 50 ]
|
||||
then
|
||||
ENB_SYNC=0
|
||||
echo "L2-SIM eNB is NOT sync'ed: process still alive?"
|
||||
else
|
||||
ENB_SYNC=1
|
||||
echo "L2-SIM eNB is sync'ed: waiting for UE(s) to connect"
|
||||
fi
|
||||
}
|
||||
|
||||
function start_l2_sim_ue {
|
||||
@@ -551,8 +585,31 @@ function start_l2_sim_ue {
|
||||
echo "sudo -E daemon --inherit --unsafe --name=ue_daemon --chdir=/home/ubuntu/tmp-ue/cmake_targets/lte_build_oai/build/ -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1
|
||||
|
||||
ssh -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1
|
||||
sleep 10
|
||||
rm $1
|
||||
|
||||
local i="0"
|
||||
echo "egrep -c \"Received NFAPI_START_REQ\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1
|
||||
while [ $i -lt 10 ]
|
||||
do
|
||||
sleep 5
|
||||
CONNECTED=`ssh -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1`
|
||||
if [ $CONNECTED -eq 1 ]
|
||||
then
|
||||
i="100"
|
||||
else
|
||||
i=$[$i+1]
|
||||
fi
|
||||
done
|
||||
rm $1
|
||||
if [ $i -lt 50 ]
|
||||
then
|
||||
UE_SYNC=0
|
||||
echo "L2-SIM UE is NOT sync'ed w/eNB"
|
||||
else
|
||||
UE_SYNC=1
|
||||
echo "L2-SIM UE is sync'ed w/eNB"
|
||||
fi
|
||||
sleep 10
|
||||
}
|
||||
|
||||
function run_test_on_vm {
|
||||
@@ -1197,10 +1254,24 @@ function run_test_on_vm {
|
||||
echo "############################################################"
|
||||
CURRENT_UE_LOG_FILE=fdd_05MHz_ue.log
|
||||
start_l2_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf
|
||||
if [ $UE_SYNC -eq 0 ]
|
||||
then
|
||||
echo "Problem w/ eNB and UE not syncing"
|
||||
terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
|
||||
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
|
||||
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
|
||||
exit -1
|
||||
fi
|
||||
|
||||
sleep 30
|
||||
echo "ping -I oip1 -c 20 $REAL_EPC_IP_ADDR" > $VM_CMDS
|
||||
ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS
|
||||
echo "############################################################"
|
||||
echo "Pinging the EPC from UE"
|
||||
echo "############################################################"
|
||||
PING_LOG_FILE=fdd_05MHz_ping_epc.txt
|
||||
ping_epc_ip_addr $VM_CMDS $VM_IP_ADDR $REAL_EPC_IP_ADDR $PING_LOG_FILE
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC
|
||||
check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20
|
||||
|
||||
echo "############################################################"
|
||||
echo "Terminate enb/ue simulators"
|
||||
@@ -1226,6 +1297,11 @@ function run_test_on_vm {
|
||||
ssh-keygen -R $EPC_VM_IP_ADDR
|
||||
fi
|
||||
|
||||
echo "############################################################"
|
||||
echo "Checking run status"
|
||||
echo "############################################################"
|
||||
|
||||
if [ $PING_STATUS -ne 0 ]; then STATUS=-1; fi
|
||||
if [ $STATUS -eq 0 ]
|
||||
then
|
||||
echo "TEST_OK" > $ARCHIVES_LOC/test_final_status.log
|
||||
|
||||
@@ -1372,6 +1372,8 @@ set (MAC_SRC_UE
|
||||
set (ENB_APP_SRC
|
||||
${OPENAIR2_DIR}/ENB_APP/enb_app.c
|
||||
${OPENAIR2_DIR}/ENB_APP/enb_config.c
|
||||
${OPENAIR2_DIR}/ENB_APP/enb_config_SL.c
|
||||
${OPENAIR2_DIR}/ENB_APP/enb_config_eMTC.c
|
||||
${OPENAIR2_DIR}/ENB_APP/RRC_config_tools.c
|
||||
)
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ OS_DISTRO=$(grep "^ID=" /etc/os-release | sed "s/ID=//" | sed "s/\"//g")
|
||||
OS_RELEASE=$(grep "^VERSION_ID=" /etc/os-release | sed "s/VERSION_ID=//" | sed "s/\"//g")
|
||||
case "$OS_DISTRO" in
|
||||
fedora) OS_BASEDISTRO="fedora"; INSTALLER="dnf"; CMAKE="cmake" ;;
|
||||
rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;;
|
||||
centos) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;;
|
||||
rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum --skip-broken"; CMAKE="cmake3" ;;
|
||||
centos) OS_BASEDISTRO="fedora"; INSTALLER="yum --skip-broken"; CMAKE="cmake3" ;;
|
||||
debian) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
|
||||
ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
|
||||
esac
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# OAI configuration module
|
||||
|
||||
The configuration module provides an api that other oai components can use to get parameters at init time. It defines a parameter structure, used to describe parameters attributes (for example name and type). The same structure includes a pointer to the variable where the configuration module writes the parameter value, at run time, when calling config_get or config_getlist functions. For each parameter a function to check the value can be specified and pre-defined functions are provided for some common parameter validations (integer in a range or in a list, string in a list). The module also include a mechanism to check that no unknown options have been entered on the command line
|
||||
The configuration module provides an api that other oai components can use to get parameters at init time. It defines a parameter structure, used to describe parameters attributes (for example name and type). The same structure includes a pointer to the variable where the configuration module writes the parameter value, at run time, when calling config_get or config_getlist functions. For each parameter a function to check the value can be specified and pre-defined functions are provided for some common parameter validations (integer in a range or in a list, string in a list). The module also include an api to check that no unknown options have been entered on the command line and a a mechanism to display a help text for suppoted parameters.
|
||||
|
||||
## Documentation
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
```c
|
||||
configmodule_interface_t *load_configmodule(int argc, char **argv)
|
||||
configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t initflags)
|
||||
```
|
||||
* Parses the command line options, looking for the –O argument
|
||||
* Loads the `libparams_<configsource>.so` (today `libparams_libconfig.so`) shared library
|
||||
* Looks for `config_<config source>_init` symbol and calls it , passing it an array of string corresponding to the « : » separated strings used in the –O option
|
||||
* Looks for `config_<config source>_get`, `config_<config source>_getlist` and `config_<config source>_end` symbols which are the three functions a configuration library should implement. Get and getlist are mandatory, end is optional.
|
||||
* Stores all the necessary information in a `configmodule_interface_t structure`, which is of no use for caller as long as we only use one configuration source.
|
||||
* Stores all the necessary information in a `configmodule_interface_t structure`, which is of no use for caller as long as we only use one configuration source.
|
||||
* if the bit CONFIG_ENABLECMDLINEONLY is set in `initflags` then the module allows parameters to be set only via the command line. This is used for the oai UE.
|
||||
|
||||
```c
|
||||
void End_configmodule(void)
|
||||
|
||||
@@ -27,6 +27,63 @@ $ ./lte-softmodem -O libconfig:<config>:dbgl1
|
||||
```bash
|
||||
$ ./lte-uesoftmodem -O cmdlineonly:dbgl1
|
||||
```
|
||||
To get help on supported parameters you can use specific options:
|
||||
* ---help: print help for command line only parameters and for parameters not defined in a specific section
|
||||
* ---help_< prefix > : print help for parameters defined under the section < prefix >
|
||||
|
||||
```
|
||||
./lte-softmodem -O libconfig:/usr/local/oai/conf/enb.nbiot.band7.tm1.50PRB.usrpb210.conf --help
|
||||
[CONFIG] get parameters from libconfig /usr/local/oai/conf/enb.nbiot.band7.tm1.50PRB.usrpb210.conf , debug flags: 0x00000000
|
||||
.............................................
|
||||
[LIBCONFIG] (root): 19/19 parameters successfully set, (16 to default value)
|
||||
|
||||
-----Help for section (root section) : 019 entries------
|
||||
--rf-config-file: Configuration file for front-end (e.g. LMS7002M)
|
||||
--ulsch-max-errors: set the eNodeB max ULSCH erros
|
||||
--phy-test: test UE phy layer, mac disabled
|
||||
--usim-test: use XOR autentication algo in case of test usim mode
|
||||
--emulate-rf: Emulated RF enabled(disable by defult)
|
||||
--clock: tells hardware to use a clock reference (0:internal, 1:external, 2:gpsdo)
|
||||
--wait-for-sync: Help string not specified
|
||||
--single-thread-enable: Disables single-thread mode in lte-softmodem
|
||||
-C: Set the downlink frequency for all component carriers
|
||||
-a: Channel id offset
|
||||
-d: Enable soft scope and L1 and L2 stats (Xforms)
|
||||
-q: Enable processing timing measurement of lte softmodem on per subframe basis
|
||||
-S: Skip the missed slots/subframes
|
||||
--numerology: adding numerology for 5G
|
||||
--parallel-config: three config for level of parallelism 'PARALLEL_SINGLE_THREAD', 'PARALLEL_RU_L1_SPLIT', or 'PARALLEL_RU_L1_TRX_SPLIT'
|
||||
--worker-config: two option for worker 'WORKER_DISABLE' or 'WORKER_ENABLE'
|
||||
--nbiot-disable: disable nb-iot, even if defined in config
|
||||
--noS1: Disable s1 interface
|
||||
--nokrnmod: (noS1 only): Use tun instead of namesh module
|
||||
--------------------------------------------------------------------
|
||||
|
||||
[LIBCONFIG] (root): 4/4 parameters successfully set, (4 to default value)
|
||||
|
||||
-----Help for section (root section) : 004 entries------
|
||||
-R: Enable online log
|
||||
-g: Set the global log level, valide options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))
|
||||
--telnetsrv: Start embedded telnet server
|
||||
--msc: Enable the MSC tracing utility
|
||||
--------------------------------------------------------------------
|
||||
|
||||
[LIBCONFIG] loader: 2/2 parameters successfully set, (2 to default value)
|
||||
[LIBCONFIG] loader.telnetsrv: 2/2 parameters successfully set, (1 to default value)
|
||||
[LOADER] library libtelnetsrv.so is not loaded: libtelnetsrv.so: cannot open shared object file: No such file or directory
|
||||
Getting ENBSParams
|
||||
[LIBCONFIG] (root): 3/3 parameters successfully set, (1 to default value)
|
||||
|
||||
-----Help for section (root section) : 003 entries------
|
||||
--Asn1_verbosity: Help string not specified
|
||||
--Active_eNBs: Help string not specified
|
||||
--noS1: Help string not specified
|
||||
--------------------------------------------------------------------
|
||||
|
||||
/usr/local/oai/issue390_configmodule_cmdlinebug/openairinterface5g/common/config/config_cmdline.c:224 config_process_cmdline() Exiting OAI softmodem: [CONFIG] Exiting after displaying help
|
||||
|
||||
```
|
||||
|
||||
For the lte-softmodem (the eNodeB) The config source parameter defaults to libconfig, preserving the initial -O option format. In this case you cannot specify the debug level.
|
||||
|
||||
```bash
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <errno.h>
|
||||
#include <platform_types.h>
|
||||
#include "config_userapi.h"
|
||||
|
||||
#include "../utils/LOG/log.h"
|
||||
|
||||
int parse_stringlist(paramdef_t *cfgoptions, char *val) {
|
||||
char *atoken;
|
||||
@@ -74,15 +74,15 @@ int processoption(paramdef_t *cfgoptions, char *value) {
|
||||
|
||||
if ( value == NULL) {
|
||||
if( (cfgoptions->paramflags &PARAMFLAG_BOOL) == 0 ) { /* not a boolean, argument required */
|
||||
fprintf(stderr,"[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname);
|
||||
exit_fun("[CONFIG] command line parsing fatal error");
|
||||
return 0;
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname);
|
||||
} else { /* boolean value option without argument, set value to true*/
|
||||
tmpval = defbool;
|
||||
}
|
||||
}
|
||||
|
||||
switch(cfgoptions->type) {
|
||||
char *charptr;
|
||||
|
||||
case TYPE_STRING:
|
||||
if (cfgoptions->numelt == 0 ) {
|
||||
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval)+1);
|
||||
@@ -106,14 +106,24 @@ int processoption(paramdef_t *cfgoptions, char *value) {
|
||||
case TYPE_UINT8:
|
||||
case TYPE_INT8:
|
||||
config_check_valptr(cfgoptions, (char **)&(cfgoptions->iptr),sizeof(int32_t));
|
||||
config_assign_int(cfgoptions,cfgoptions->optname,(int32_t)strtol(tmpval,NULL,0));
|
||||
config_assign_int(cfgoptions,cfgoptions->optname,(int32_t)strtol(tmpval,&charptr,0));
|
||||
|
||||
if( *charptr != 0) {
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires an integer argument\n",cfgoptions->optname);
|
||||
}
|
||||
|
||||
optisset=1;
|
||||
break;
|
||||
|
||||
case TYPE_UINT64:
|
||||
case TYPE_INT64:
|
||||
config_check_valptr(cfgoptions, (char **)&(cfgoptions->i64ptr),sizeof(uint64_t));
|
||||
*(cfgoptions->i64ptr)=strtoll(tmpval,NULL,0);
|
||||
*(cfgoptions->i64ptr)=strtoll(tmpval,&charptr,0);
|
||||
|
||||
if( *charptr != 0) {
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires an integer argument\n",cfgoptions->optname);
|
||||
}
|
||||
|
||||
printf_cmdl("[CONFIG] %s set to %lli from command line\n", cfgoptions->optname, (long long)*(cfgoptions->i64ptr));
|
||||
optisset=1;
|
||||
break;
|
||||
@@ -124,7 +134,12 @@ int processoption(paramdef_t *cfgoptions, char *value) {
|
||||
|
||||
case TYPE_DOUBLE:
|
||||
config_check_valptr(cfgoptions, (char **)&(cfgoptions->dblptr),sizeof(double));
|
||||
*(cfgoptions->dblptr) = strtof(tmpval,NULL);
|
||||
*(cfgoptions->dblptr) = strtof(tmpval,&charptr);
|
||||
|
||||
if( *charptr != 0) {
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires a double argument\n",cfgoptions->optname);
|
||||
}
|
||||
|
||||
printf_cmdl("[CONFIG] %s set to %lf from command line\n", cfgoptions->optname, *(cfgoptions->dblptr));
|
||||
optisset=1;
|
||||
break;
|
||||
@@ -133,7 +148,7 @@ int processoption(paramdef_t *cfgoptions, char *value) {
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr,"[CONFIG] command line, %s type %i not supported\n",cfgoptions->optname, cfgoptions->type);
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] command line, %s type %i not supported\n",cfgoptions->optname, cfgoptions->type);
|
||||
break;
|
||||
} /* switch on param type */
|
||||
|
||||
@@ -149,14 +164,15 @@ int processoption(paramdef_t *cfgoptions, char *value) {
|
||||
*/
|
||||
int config_check_unknown_cmdlineopt(char *prefix) {
|
||||
int unknowndetected=0;
|
||||
char testprefix[CONFIG_MAXOPTLENGTH]="";
|
||||
char testprefix[CONFIG_MAXOPTLENGTH];
|
||||
int finalcheck = 0;
|
||||
|
||||
memset(testprefix,0,sizeof(testprefix));
|
||||
if (prefix != NULL) {
|
||||
if (strcmp(prefix,CONFIG_CHECKALLSECTIONS) == 0)
|
||||
finalcheck = 1;
|
||||
else if (strlen(prefix) > 0) {
|
||||
sprintf(testprefix,"--%s.",prefix);
|
||||
sprintf(testprefix,"--%.*s.",CONFIG_MAXOPTLENGTH-1,prefix);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,8 +192,11 @@ int config_check_unknown_cmdlineopt(char *prefix) {
|
||||
}
|
||||
}
|
||||
|
||||
printf_cmdl("[CONFIG] %i unknown option(s) in command line starting with %s (section %s)\n",
|
||||
unknowndetected,testprefix,((prefix==NULL)?"":prefix));
|
||||
if (unknowndetected > 0) {
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] %i unknown option(s) in command line starting with %s (section %s)\n",
|
||||
unknowndetected,testprefix,((prefix==NULL)?"":prefix));
|
||||
}
|
||||
|
||||
return unknowndetected;
|
||||
} /* config_check_unknown_cmdlineopt */
|
||||
|
||||
@@ -200,7 +219,7 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
|
||||
|
||||
if (pp == NULL || strcasecmp(pp,config_get_if()->argv[i] ) == 0 ) {
|
||||
if( prefix == NULL) {
|
||||
config_printhelp(cfgoptions,numoptions);
|
||||
config_printhelp(cfgoptions,numoptions,"(root section)");
|
||||
|
||||
if ( ! ( CONFIG_ISFLAGSET(CONFIG_NOEXITONHELP)))
|
||||
exit_fun("[CONFIG] Exiting after displaying help\n");
|
||||
@@ -209,8 +228,7 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
|
||||
pp=strtok_r(NULL, " ",&tokctx);
|
||||
|
||||
if ( prefix != NULL && pp != NULL && strncasecmp(prefix,pp,strlen(pp)) == 0 ) {
|
||||
printf ("Help for %s section:\n",prefix);
|
||||
config_printhelp(cfgoptions,numoptions);
|
||||
config_printhelp(cfgoptions,numoptions,prefix);
|
||||
|
||||
if ( ! (CONFIG_ISFLAGSET(CONFIG_NOEXITONHELP))) {
|
||||
fprintf(stderr,"[CONFIG] %s %i section %s:", __FILE__, __LINE__, prefix);
|
||||
@@ -273,16 +291,5 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
|
||||
} /* fin du while */
|
||||
|
||||
printf_cmdl("[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "(root)":prefix),j);
|
||||
|
||||
if ( !(CONFIG_ISFLAGSET( CONFIG_NOCHECKUNKOPT )) ) {
|
||||
i=config_check_unknown_cmdlineopt(prefix);
|
||||
|
||||
if (i > 0) {
|
||||
fprintf(stderr,"[CONFIG] %i unknown options for section %s detected in command line\n",
|
||||
i,((prefix==NULL)?"\"root section\"":prefix));
|
||||
exit_fun(" Exiting after detecting errors in command line \n");
|
||||
}
|
||||
}
|
||||
|
||||
return j;
|
||||
} /* parse_cmdline*/
|
||||
|
||||
@@ -36,12 +36,15 @@
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <dlfcn.h>
|
||||
#include <platform_types.h>
|
||||
|
||||
#define CONFIG_LOADCONFIG_MAIN
|
||||
#include "config_load_configmodule.h"
|
||||
#include "config_userapi.h"
|
||||
#include "../utils/LOG/log.h"
|
||||
#define CONFIG_SHAREDLIBFORMAT "libparams_%s.so"
|
||||
|
||||
|
||||
int load_config_sharedlib(configmodule_interface_t *cfgptr) {
|
||||
void *lib_handle;
|
||||
char fname[128];
|
||||
@@ -198,7 +201,7 @@ configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t init
|
||||
}
|
||||
|
||||
if ( strstr(argv[i], "help_config") != NULL ) {
|
||||
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params));
|
||||
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params),CONFIG_SECTIONNAME);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@@ -304,7 +307,7 @@ configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t init
|
||||
if (cfgmode != NULL) free(cfgmode);
|
||||
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
|
||||
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params));
|
||||
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params),CONFIG_SECTIONNAME );
|
||||
// exit(-1);
|
||||
}
|
||||
|
||||
@@ -342,7 +345,7 @@ void free_configmodule(void) {
|
||||
|
||||
if( cfgptr->cfgmode != NULL) free(cfgptr->cfgmode);
|
||||
|
||||
printf ("[CONFIG] free %u config parameter pointers\n",cfgptr->num_cfgP);
|
||||
printf ("[CONFIG] free %i config parameter pointers\n",cfgptr->num_cfgP);
|
||||
|
||||
for (int i=0; i<cfgptr->num_cfgP; i++) {
|
||||
if ( cfgptr->cfgP[i] != NULL) free(cfgptr->cfgP[i]);
|
||||
|
||||
@@ -51,7 +51,6 @@
|
||||
#define CONFIG_PRINTPARAMS 1 // print parameters values while processing
|
||||
#define CONFIG_DEBUGPTR (1<<1) // print memory allocation/free debug messages
|
||||
#define CONFIG_DEBUGCMDLINE (1<<2) // print command line processing messages
|
||||
#define CONFIG_NOCHECKUNKOPT (1<<3) // disable check unprocessed (so invalid) command line options
|
||||
#define CONFIG_NOABORTONCHKF (1<<4) // disable abort execution when parameter checking function fails
|
||||
#define CONFIG_NOEXITONHELP (1<<19) // do not exit after printing help
|
||||
#define CONFIG_HELP (1<<20) // print help message
|
||||
@@ -109,5 +108,7 @@ extern configmodule_interface_t *cfgptr;
|
||||
#define CONFIG_ENABLECMDLINEONLY (1<<1)
|
||||
extern configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t initflags);
|
||||
extern void end_configmodule(void);
|
||||
#define CONFIG_PRINTF_ERROR(f, x... ) if (isLogInitDone ()) { LOG_E(ENB_APP,f,x);} else {printf(f,x);}; if ( !CONFIG_ISFLAGSET(CONFIG_NOABORTONCHKF) ) exit_fun("exit because configuration failed\n");
|
||||
|
||||
|
||||
#endif /* INCLUDE_CONFIG_LOADCONFIGMODULE_H */
|
||||
|
||||
@@ -39,15 +39,13 @@
|
||||
#include <errno.h>
|
||||
#include <dlfcn.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <platform_types.h>
|
||||
#include "config_userapi.h"
|
||||
|
||||
#include "../utils/LOG/log.h"
|
||||
|
||||
configmodule_interface_t *config_get_if(void) {
|
||||
if (cfgptr == NULL) {
|
||||
fprintf(stderr,"[CONFIG] %s %d config module not initialized\n",__FILE__, __LINE__);
|
||||
exit(-1);
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] %s %d config module not initialized\n",__FILE__,__LINE__);
|
||||
}
|
||||
|
||||
return cfgptr;
|
||||
@@ -66,9 +64,8 @@ char *config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) {
|
||||
config_get_if()->numptrs++;
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "[CONFIG] %s %d option %s, cannot allocate pointer: %s \n",
|
||||
__FILE__, __LINE__, cfgoptions->optname, strerror(errno));
|
||||
exit(-1);
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] %s %d option %s, cannot allocate pointer: %s \n",
|
||||
__FILE__, __LINE__, cfgoptions->optname, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,9 +75,8 @@ char *config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) {
|
||||
if (*ptr != NULL) {
|
||||
return *ptr;
|
||||
} else {
|
||||
fprintf(stderr,"[CONFIG] %s %d option %s, definition error: value pointer is NULL, declared as %i bytes allocated\n",
|
||||
__FILE__, __LINE__,cfgoptions->optname, cfgoptions->numelt);
|
||||
exit(-1);
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] %s %d option %s, definition error: value pointer is NULL, declared as %i bytes allocated\n",
|
||||
__FILE__, __LINE__,cfgoptions->optname, cfgoptions->numelt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,8 +91,7 @@ char *config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) {
|
||||
config_get_if()->numptrs++;
|
||||
}
|
||||
} else {
|
||||
fprintf (stderr,"[CONFIG] %s %d malloc error\n",__FILE__, __LINE__);
|
||||
exit(-1);
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] %s %d malloc error\n",__FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,8 +152,7 @@ void config_assign_processedint(paramdef_t *cfgoption, int val) {
|
||||
if ( cfgoption->processedvalue != NULL) {
|
||||
*(cfgoption->processedvalue) = val;
|
||||
} else {
|
||||
fprintf (stderr,"[CONFIG] %s %d malloc error\n",__FILE__, __LINE__);
|
||||
exit(-1);
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] %s %d malloc error\n",__FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,15 +171,17 @@ int config_get_processedint(paramdef_t *cfgoption) {
|
||||
|
||||
return ret;
|
||||
}
|
||||
void config_printhelp(paramdef_t *params,int numparams) {
|
||||
void config_printhelp(paramdef_t *params,int numparams, char *prefix) {
|
||||
printf("\n-----Help for section %-26s: %03i entries------\n",(prefix==NULL)?"(root section)":prefix ,numparams);
|
||||
|
||||
for (int i=0 ; i<numparams ; i++) {
|
||||
if ( params[i].helpstr != NULL) {
|
||||
printf("%s%s: %s",
|
||||
(strlen(params[i].optname) <= 1) ? "-" : "--",
|
||||
params[i].optname,
|
||||
params[i].helpstr);
|
||||
}
|
||||
}
|
||||
printf(" %s%s: %s",
|
||||
(strlen(params[i].optname) <= 1) ? "-" : "--",
|
||||
params[i].optname,
|
||||
(params[i].helpstr != NULL)?params[i].helpstr:"Help string not specified\n");
|
||||
} /* for on params entries */
|
||||
|
||||
printf("--------------------------------------------------------------------\n\n");
|
||||
}
|
||||
|
||||
int config_execcheck(paramdef_t *params,int numparams, char *prefix) {
|
||||
@@ -202,11 +198,7 @@ int config_execcheck(paramdef_t *params,int numparams, char *prefix) {
|
||||
}
|
||||
|
||||
if (st != 0) {
|
||||
fprintf(stderr,"[CONFIG] config_execcheck: section %s %i parameters with wrong value\n", prefix, -st);
|
||||
|
||||
if ( CONFIG_ISFLAGSET(CONFIG_NOABORTONCHKF) == 0) {
|
||||
exit_fun("exit because configuration failed\n");
|
||||
}
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] config_execcheck: section %s %i parameters with wrong value\n", prefix, -st);
|
||||
}
|
||||
|
||||
return st;
|
||||
@@ -263,6 +255,7 @@ int config_getlist(paramlist_def_t *ParamList, paramdef_t *params, int numparams
|
||||
for (int i = 0; i < ParamList->numelt; ++i) {
|
||||
// TODO config_process_cmdline?
|
||||
sprintf(cfgpath, "%s.[%i]", newprefix, i);
|
||||
config_process_cmdline(ParamList->paramarray[i],numparams,cfgpath);
|
||||
config_execcheck(ParamList->paramarray[i], numparams, cfgpath);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ extern "C"
|
||||
/* utility functions, to be used by configuration module and/or configuration libraries */
|
||||
extern configmodule_interface_t *config_get_if(void);
|
||||
extern char *config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) ;
|
||||
extern void config_printhelp(paramdef_t *,int numparams);
|
||||
extern void config_printhelp(paramdef_t *,int numparams, char *prefix);
|
||||
extern int config_process_cmdline(paramdef_t *params,int numparams, char *prefix);
|
||||
extern void config_assign_processedint(paramdef_t *cfgoption, int val);
|
||||
extern void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val);
|
||||
|
||||
@@ -219,7 +219,6 @@ void log_getconfig(log_t *g_log) {
|
||||
paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS];
|
||||
paramdef_t logparams_debug[sizeof(log_maskmap)/sizeof(mapping)];
|
||||
paramdef_t logparams_dump[sizeof(log_maskmap)/sizeof(mapping)];
|
||||
CONFIG_SETRTFLAG(CONFIG_NOCHECKUNKOPT);
|
||||
int ret = config_get( logparams_defaults,sizeof(logparams_defaults)/sizeof(paramdef_t),CONFIG_STRING_LOG_PREFIX);
|
||||
|
||||
if (ret <0) {
|
||||
@@ -305,8 +304,8 @@ void log_getconfig(log_t *g_log) {
|
||||
}
|
||||
|
||||
config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX);
|
||||
CONFIG_CLEARRTFLAG(CONFIG_NOCHECKUNKOPT);
|
||||
config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX);
|
||||
config_check_unknown_cmdlineopt(CONFIG_STRING_LOG_PREFIX);
|
||||
|
||||
/* set the debug mask according to the debug parameters values */
|
||||
for (int i=0; log_maskmap[i].name != NULL ; i++) {
|
||||
|
||||
@@ -145,6 +145,7 @@ extern "C" {
|
||||
#define DEBUG_CTRLSOCKET (1<<10)
|
||||
#define DEBUG_SECURITY (1<<11)
|
||||
#define DEBUG_NAS (1<<12)
|
||||
#define DEBUG_RLC (1<<13)
|
||||
#define UE_TIMING (1<<20)
|
||||
|
||||
|
||||
@@ -162,6 +163,7 @@ extern "C" {
|
||||
{"CTRLSOCKET", DEBUG_CTRLSOCKET},\
|
||||
{"SECURITY", DEBUG_SECURITY},\
|
||||
{"NAS", DEBUG_NAS},\
|
||||
{"RLC", DEBUG_RLC},\
|
||||
{"UE_TIMING", UE_TIMING},\
|
||||
{NULL,-1}\
|
||||
}
|
||||
@@ -345,6 +347,8 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
|
||||
}
|
||||
|
||||
#define LOG_OPTIONS_IDX 2
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
/** @defgroup _debugging debugging macros
|
||||
* @ingroup _macro
|
||||
|
||||
@@ -12,15 +12,17 @@
|
||||
#include "common/config/config_userapi.h"
|
||||
|
||||
#define QUIT(x) do { \
|
||||
printf("T tracer: QUIT: %s\n", x); \
|
||||
exit(1); \
|
||||
} while (0)
|
||||
printf("T tracer: QUIT: %s\n", x); \
|
||||
exit(1); \
|
||||
} while (0)
|
||||
|
||||
/* array used to activate/disactivate a log */
|
||||
static int T_IDs[T_NUMBER_OF_IDS];
|
||||
int *T_active = T_IDs;
|
||||
|
||||
int T_stdout = 1;
|
||||
|
||||
|
||||
static int T_socket;
|
||||
|
||||
/* T_cache
|
||||
@@ -32,125 +34,159 @@ volatile int *T_freelist_head = &_T_freelist_head;
|
||||
T_cache_t *T_cache;
|
||||
|
||||
#if BASIC_SIMULATOR
|
||||
/* global variables used by T_GET_SLOT, see in T.h */
|
||||
volatile uint64_t T_next_id;
|
||||
volatile uint64_t T_active_id;
|
||||
/* global variables used by T_GET_SLOT, see in T.h */
|
||||
volatile uint64_t T_next_id;
|
||||
volatile uint64_t T_active_id;
|
||||
#endif
|
||||
|
||||
static void get_message(int s)
|
||||
{
|
||||
static void get_message(int s) {
|
||||
char t;
|
||||
int l;
|
||||
int id;
|
||||
int is_on;
|
||||
|
||||
if (read(s, &t, 1) != 1) QUIT("get_message fails");
|
||||
printf("T tracer: got mess %d\n", t);
|
||||
|
||||
printf("T tracer: got mess %d\n", t);
|
||||
|
||||
switch (t) {
|
||||
case 0:
|
||||
/* toggle all those IDs */
|
||||
/* optimze? (too much syscalls) */
|
||||
if (read(s, &l, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
|
||||
while (l) {
|
||||
if (read(s, &id, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
|
||||
T_IDs[id] = 1 - T_IDs[id];
|
||||
l--;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
/* set IDs as given */
|
||||
/* optimize? */
|
||||
if (read(s, &l, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
|
||||
id = 0;
|
||||
while (l) {
|
||||
if (read(s, &is_on, sizeof(int)) != sizeof(int))
|
||||
QUIT("get_message fails");
|
||||
T_IDs[id] = is_on;
|
||||
id++;
|
||||
l--;
|
||||
}
|
||||
break;
|
||||
case 2: break; /* do nothing, this message is to wait for local tracer */
|
||||
case 0:
|
||||
|
||||
/* toggle all those IDs */
|
||||
/* optimze? (too much syscalls) */
|
||||
if (read(s, &l, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
|
||||
|
||||
while (l) {
|
||||
if (read(s, &id, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
|
||||
|
||||
T_IDs[id] = 1 - T_IDs[id];
|
||||
l--;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1:
|
||||
|
||||
/* set IDs as given */
|
||||
/* optimize? */
|
||||
if (read(s, &l, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
|
||||
|
||||
id = 0;
|
||||
|
||||
while (l) {
|
||||
if (read(s, &is_on, sizeof(int)) != sizeof(int))
|
||||
QUIT("get_message fails");
|
||||
|
||||
T_IDs[id] = is_on;
|
||||
id++;
|
||||
l--;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
break; /* do nothing, this message is to wait for local tracer */
|
||||
}
|
||||
}
|
||||
|
||||
static void *T_receive_thread(void *_)
|
||||
{
|
||||
static void *T_receive_thread(void *_) {
|
||||
while (1) get_message(T_socket);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void new_thread(void *(*f)(void *), void *data)
|
||||
{
|
||||
static void new_thread(void *(*f)(void *), void *data) {
|
||||
pthread_t t;
|
||||
pthread_attr_t att;
|
||||
|
||||
if (pthread_attr_init(&att))
|
||||
{ fprintf(stderr, "pthread_attr_init err\n"); exit(1); }
|
||||
if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED))
|
||||
{ fprintf(stderr, "pthread_attr_setdetachstate err\n"); exit(1); }
|
||||
if (pthread_create(&t, &att, f, data))
|
||||
{ fprintf(stderr, "pthread_create err\n"); exit(1); }
|
||||
if (pthread_attr_destroy(&att))
|
||||
{ fprintf(stderr, "pthread_attr_destroy err\n"); exit(1); }
|
||||
if (pthread_attr_init(&att)) {
|
||||
fprintf(stderr, "pthread_attr_init err\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED)) {
|
||||
fprintf(stderr, "pthread_attr_setdetachstate err\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (pthread_create(&t, &att, f, data)) {
|
||||
fprintf(stderr, "pthread_create err\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (pthread_attr_destroy(&att)) {
|
||||
fprintf(stderr, "pthread_attr_destroy err\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* defined in local_tracer.c */
|
||||
void T_local_tracer_main(int remote_port, int wait_for_tracer,
|
||||
int local_socket, void *shm_array);
|
||||
int local_socket, void *shm_array);
|
||||
|
||||
/* We monitor the tracee and the local tracer processes.
|
||||
* When one dies we forcefully kill the other.
|
||||
*/
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
static void monitor_and_kill(int child1, int child2)
|
||||
{
|
||||
static void monitor_and_kill(int child1, int child2) {
|
||||
int child;
|
||||
int status;
|
||||
|
||||
child = wait(&status);
|
||||
|
||||
if (child == -1) perror("wait");
|
||||
|
||||
kill(child1, SIGKILL);
|
||||
kill(child2, SIGKILL);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void T_init(int remote_port, int wait_for_tracer, int dont_fork)
|
||||
{
|
||||
void T_init(int remote_port, int wait_for_tracer, int dont_fork) {
|
||||
int socket_pair[2];
|
||||
int s;
|
||||
int child1, child2;
|
||||
int i;
|
||||
|
||||
if (socketpair(AF_UNIX, SOCK_STREAM, 0, socket_pair))
|
||||
{ perror("socketpair"); abort(); }
|
||||
if (socketpair(AF_UNIX, SOCK_STREAM, 0, socket_pair)) {
|
||||
perror("socketpair");
|
||||
abort();
|
||||
}
|
||||
|
||||
/* setup shared memory */
|
||||
T_cache = mmap(NULL, T_CACHE_SIZE * sizeof(T_cache_t),
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0);
|
||||
if (T_cache == MAP_FAILED)
|
||||
{ perror("mmap"); abort(); }
|
||||
|
||||
if (T_cache == MAP_FAILED) {
|
||||
perror("mmap");
|
||||
abort();
|
||||
}
|
||||
|
||||
/* let's garbage the memory to catch some potential problems
|
||||
* (think multiprocessor sync issues, barriers, etc.)
|
||||
*/
|
||||
memset(T_cache, 0x55, T_CACHE_SIZE * sizeof(T_cache_t));
|
||||
|
||||
for (i = 0; i < T_CACHE_SIZE; i++) T_cache[i].busy = 0;
|
||||
|
||||
/* child1 runs the local tracer and child2 (or main) runs the tracee */
|
||||
child1 = fork();
|
||||
|
||||
if (child1 == -1) abort();
|
||||
|
||||
child1 = fork(); if (child1 == -1) abort();
|
||||
if (child1 == 0) {
|
||||
close(socket_pair[1]);
|
||||
T_local_tracer_main(remote_port, wait_for_tracer, socket_pair[0],
|
||||
T_cache);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
close(socket_pair[0]);
|
||||
|
||||
if (dont_fork == 0) {
|
||||
child2 = fork(); if (child2 == -1) abort();
|
||||
child2 = fork();
|
||||
|
||||
if (child2 == -1) abort();
|
||||
|
||||
if (child2 != 0) {
|
||||
close(socket_pair[1]);
|
||||
munmap(T_cache, T_CACHE_SIZE * sizeof(T_cache_t));
|
||||
@@ -161,27 +197,21 @@ void T_init(int remote_port, int wait_for_tracer, int dont_fork)
|
||||
s = socket_pair[1];
|
||||
/* wait for first message - initial list of active T events */
|
||||
get_message(s);
|
||||
|
||||
T_socket = s;
|
||||
|
||||
new_thread(T_receive_thread, NULL);
|
||||
}
|
||||
|
||||
void T_Config_Init(void)
|
||||
{
|
||||
int T_port; /* by default we wait for the tracer */
|
||||
int T_nowait; /* default port to listen to to wait for the tracer */
|
||||
int T_dont_fork; /* default is to fork, see 'T_init' to understand */
|
||||
|
||||
void T_Config_Init(void) {
|
||||
int T_port=TTRACER_DEFAULT_PORTNUM; /* by default we wait for the tracer */
|
||||
int T_nowait=0; /* default port to listen to to wait for the tracer */
|
||||
int T_dont_fork=0; /* default is to fork, see 'T_init' to understand */
|
||||
paramdef_t ttraceparams[] = CMDLINE_TTRACEPARAMS_DESC;
|
||||
|
||||
/* for a cleaner config file, TTracer params should be defined in a
|
||||
* specific section...
|
||||
*/
|
||||
config_get(ttraceparams,
|
||||
sizeof(ttraceparams) / sizeof(paramdef_t),
|
||||
TTRACER_CONFIG_PREFIX);
|
||||
|
||||
/* compatibility: look for TTracer command line options in root section */
|
||||
config_process_cmdline(ttraceparams,
|
||||
sizeof(ttraceparams) / sizeof(paramdef_t),
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "T_defs.h"
|
||||
|
||||
#ifdef T_SEND_TIME
|
||||
#include <time.h>
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
/* T message IDs */
|
||||
@@ -76,13 +76,13 @@
|
||||
T_BUFFER_MAX - T_LOCAL_size, T_PUT_printf_deref x); \
|
||||
if (T_PUT_len < 0) { \
|
||||
printf("%s:%d:%s: you can't read this, or can you?", \
|
||||
__FILE__, __LINE__, __FUNCTION__); \
|
||||
__FILE__, __LINE__, __FUNCTION__); \
|
||||
abort(); \
|
||||
} \
|
||||
if (T_PUT_len >= T_BUFFER_MAX - T_LOCAL_size) { \
|
||||
printf("%s:%d:%s: cannot put argument %d in T macro, not enough space" \
|
||||
", consider increasing T_BUFFER_MAX (%d)\n", \
|
||||
__FILE__, __LINE__, __FUNCTION__, argnum, T_BUFFER_MAX); \
|
||||
", consider increasing T_BUFFER_MAX (%d)\n", \
|
||||
__FILE__, __LINE__, __FUNCTION__, argnum, T_BUFFER_MAX); \
|
||||
abort(); \
|
||||
} \
|
||||
T_LOCAL_size += T_PUT_len + 1; \
|
||||
@@ -97,9 +97,9 @@ struct T_header;
|
||||
/* T macro tricks */
|
||||
extern int T_stdout;
|
||||
#define TN(...) TN_N(__VA_ARGS__,33,32,31,30,29,28,27,26,25,24,23,22,21,\
|
||||
20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)(__VA_ARGS__)
|
||||
20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)(__VA_ARGS__)
|
||||
#define TN_N(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,\
|
||||
n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n,...) T##n
|
||||
n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n,...) T##n
|
||||
#define T(...) do { if (T_stdout == 0) TN(__VA_ARGS__); } while (0)
|
||||
|
||||
/* type used to send arbitrary buffer data */
|
||||
@@ -119,30 +119,30 @@ extern int *T_active;
|
||||
*/
|
||||
#if BASIC_SIMULATOR
|
||||
# define T_GET_SLOT \
|
||||
do { \
|
||||
extern volatile uint64_t T_next_id; \
|
||||
extern volatile uint64_t T_active_id; \
|
||||
uint64_t id; \
|
||||
/* get a ticket */ \
|
||||
id = __sync_fetch_and_add(&T_next_id, 1); \
|
||||
/* wait for our turn */ \
|
||||
while (id != __sync_fetch_and_add(&T_active_id, 0)) /* busy wait */; \
|
||||
/* this is our turn, try to acquire the slot until it's free */ \
|
||||
do { \
|
||||
T_LOCAL_busy = __sync_fetch_and_or(&T_cache[T_LOCAL_slot].busy, 0x01); \
|
||||
if (T_LOCAL_busy & 0x01) usleep(100); \
|
||||
} while (T_LOCAL_busy & 0x01); \
|
||||
/* check that there are still some tickets */ \
|
||||
if (__sync_fetch_and_add(&T_active_id, 0) == 0xffffffffffffffff) { \
|
||||
printf("T: reached the end of times, bye...\n"); \
|
||||
abort(); \
|
||||
} \
|
||||
/* free our ticket, which signals the next waiter that it's its turn */ \
|
||||
(void)__sync_fetch_and_add(&T_active_id, 1); \
|
||||
} while (0)
|
||||
do { \
|
||||
extern volatile uint64_t T_next_id; \
|
||||
extern volatile uint64_t T_active_id; \
|
||||
uint64_t id; \
|
||||
/* get a ticket */ \
|
||||
id = __sync_fetch_and_add(&T_next_id, 1); \
|
||||
/* wait for our turn */ \
|
||||
while (id != __sync_fetch_and_add(&T_active_id, 0)) /* busy wait */; \
|
||||
/* this is our turn, try to acquire the slot until it's free */ \
|
||||
do { \
|
||||
T_LOCAL_busy = __sync_fetch_and_or(&T_cache[T_LOCAL_slot].busy, 0x01); \
|
||||
if (T_LOCAL_busy & 0x01) usleep(100); \
|
||||
} while (T_LOCAL_busy & 0x01); \
|
||||
/* check that there are still some tickets */ \
|
||||
if (__sync_fetch_and_add(&T_active_id, 0) == 0xffffffffffffffff) { \
|
||||
printf("T: reached the end of times, bye...\n"); \
|
||||
abort(); \
|
||||
} \
|
||||
/* free our ticket, which signals the next waiter that it's its turn */ \
|
||||
(void)__sync_fetch_and_add(&T_active_id, 1); \
|
||||
} while (0)
|
||||
#else
|
||||
# define T_GET_SLOT \
|
||||
T_LOCAL_busy = __sync_fetch_and_or(&T_cache[T_LOCAL_slot].busy, 0x01);
|
||||
T_LOCAL_busy = __sync_fetch_and_or(&T_cache[T_LOCAL_slot].busy, 0x01);
|
||||
#endif
|
||||
|
||||
/* used at header of Tn, allocates buffer */
|
||||
@@ -172,8 +172,8 @@ extern int *T_active;
|
||||
#define T_CHECK_SIZE(len, argnum) \
|
||||
if (T_LOCAL_size + (len) > T_BUFFER_MAX) { \
|
||||
printf("%s:%d:%s: cannot put argument %d in T macro, not enough space" \
|
||||
", consider increasing T_BUFFER_MAX (%d)\n", \
|
||||
__FILE__, __LINE__, __FUNCTION__, argnum, T_BUFFER_MAX); \
|
||||
", consider increasing T_BUFFER_MAX (%d)\n", \
|
||||
__FILE__, __LINE__, __FUNCTION__, argnum, T_BUFFER_MAX); \
|
||||
abort(); \
|
||||
}
|
||||
|
||||
@@ -598,20 +598,21 @@ extern int *T_active;
|
||||
|
||||
|
||||
#define TTRACER_CONFIG_PREFIX "TTracer"
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* configuration parameters for TTRACE utility */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* configuration parameters for TTRACE utility */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define TTRACER_DEFAULT_PORTNUM 2021
|
||||
#define CMDLINE_TTRACEPARAMS_DESC { \
|
||||
{"T_port", CONFIG_HLP_TPORT, 0, iptr:&T_port, defintval:2021, TYPE_INT, 0}, \
|
||||
{"T_nowait", CONFIG_HLP_NOTWAIT, PARAMFLAG_BOOL, iptr:&T_nowait, defintval:0, TYPE_INT, 0}, \
|
||||
{"T_dont_fork", CONFIG_HLP_TNOFORK, PARAMFLAG_BOOL, iptr:&T_dont_fork, defintval:0, TYPE_INT, 0}, \
|
||||
{"T_stdout", CONFIG_HLP_STDOUT, PARAMFLAG_BOOL, iptr:&T_stdout, defintval:1, TYPE_INT, 0}, \
|
||||
}
|
||||
{"T_port", CONFIG_HLP_TPORT, 0, iptr:&T_port, defintval:TTRACER_DEFAULT_PORTNUM, TYPE_INT, 0},\
|
||||
{"T_nowait", CONFIG_HLP_NOTWAIT, PARAMFLAG_BOOL, iptr:&T_nowait, defintval:0, TYPE_INT, 0},\
|
||||
{"T_dont_fork", CONFIG_HLP_TNOFORK, PARAMFLAG_BOOL, iptr:&T_dont_fork, defintval:0, TYPE_INT, 0},\
|
||||
{"T_stdout", CONFIG_HLP_STDOUT, PARAMFLAG_BOOL, iptr:&T_stdout, defintval:1, TYPE_INT, 0},\
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* log on stdout */
|
||||
/* log on stdout */
|
||||
void T_init(int remote_port, int wait_for_tracer, int dont_fork);
|
||||
void T_Config_Init(void);
|
||||
#else /* T_TRACER */
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
//-------------------------------
|
||||
|
||||
FILE* g_msc_fd;
|
||||
FILE *g_msc_fd;
|
||||
char g_msc_proto2str[MAX_MSC_PROTOS][MSC_MAX_PROTO_NAME_LENGTH];
|
||||
|
||||
|
||||
@@ -70,15 +70,11 @@ void *msc_task(void *args_p)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
MessageDef *received_message_p = NULL;
|
||||
// const char *msg_name = NULL;
|
||||
// instance_t instance = 0;
|
||||
// const char *msg_name = NULL;
|
||||
// instance_t instance = 0;
|
||||
long timer_id;
|
||||
|
||||
itti_mark_task_ready(TASK_MSC);
|
||||
|
||||
msc_start_use();
|
||||
|
||||
|
||||
timer_setup(0, // seconds
|
||||
50000, // usec
|
||||
TASK_MSC,
|
||||
@@ -91,20 +87,18 @@ void *msc_task(void *args_p)
|
||||
itti_receive_msg(TASK_MSC, &received_message_p);
|
||||
|
||||
if (received_message_p != NULL) {
|
||||
// msg_name = ITTI_MSG_NAME (received_message_p);
|
||||
// instance = ITTI_MSG_INSTANCE (received_message_p);
|
||||
|
||||
// msg_name = ITTI_MSG_NAME (received_message_p);
|
||||
// instance = ITTI_MSG_INSTANCE (received_message_p);
|
||||
switch (ITTI_MSG_ID(received_message_p)) {
|
||||
|
||||
case TIMER_HAS_EXPIRED: {
|
||||
msc_flush_messages();
|
||||
msc_flush_messages();
|
||||
}
|
||||
break;
|
||||
|
||||
case TERMINATE_MESSAGE: {
|
||||
fprintf(stderr, " *** Exiting MSC thread\n");
|
||||
timer_remove(timer_id);
|
||||
msc_end();
|
||||
msc_end();
|
||||
itti_exit_task();
|
||||
}
|
||||
break;
|
||||
@@ -119,6 +113,7 @@ void *msc_task(void *args_p)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "Task MSC exiting\n");
|
||||
return NULL;
|
||||
}
|
||||
@@ -132,15 +127,16 @@ int msc_init(const msc_env_t envP, const int max_threadsP)
|
||||
void *pointer_p;
|
||||
char msc_filename[256];
|
||||
fprintf(stderr, "Initializing MSC logs\n");
|
||||
rv = snprintf(msc_filename, 256, "/tmp/openair.msc.%i.log", envP); // TODO NAME
|
||||
|
||||
rv = snprintf(msc_filename, 256, "/tmp/openair.msc.%u.log", envP); // TODO NAME
|
||||
if ((0 >= rv) || (256 < rv)){
|
||||
if ((0 >= rv) || (256 < rv)) {
|
||||
fprintf(stderr, "Error in MSC log file name");
|
||||
}
|
||||
|
||||
g_msc_fd = fopen(msc_filename,"w");
|
||||
AssertFatal(g_msc_fd != NULL, "Could not open MSC log file %s : %s", msc_filename, strerror(errno));
|
||||
|
||||
rv = lfds611_stack_new(&g_msc_memory_stack_p, (lfds611_atom_t)max_threadsP + 2);
|
||||
|
||||
if (0 >= rv) {
|
||||
AssertFatal (0, "lfds611_stack_new failed!\n");
|
||||
}
|
||||
@@ -153,7 +149,7 @@ int msc_init(const msc_env_t envP, const int max_threadsP)
|
||||
for (i=0; i < max_threadsP * 30; i++) {
|
||||
pointer_p = malloc(MSC_MAX_MESSAGE_LENGTH);
|
||||
AssertFatal (pointer_p, "malloc failed!\n");
|
||||
rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, pointer_p );
|
||||
rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, pointer_p );
|
||||
AssertFatal (rv, "lfds611_stack_guaranteed_push failed for item %u\n", i);
|
||||
}
|
||||
|
||||
@@ -161,182 +157,335 @@ int msc_init(const msc_env_t envP, const int max_threadsP)
|
||||
switch (i) {
|
||||
case MSC_IP_UE:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "IP_UE");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_IP_ENB:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "IP_ENB");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if (envP == MSC_E_UTRAN_LIPA) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_NAS_UE:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_UE");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_RRC_UE:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RRC_UE");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_PDCP_UE:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PDCP_UE");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_RLC_UE:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RLC_UE");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RLC_UE");
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_MAC_UE:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "MAC_UE");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
msc_log_declare_proto(i);
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_PHY_UE:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PHY_UE");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_PHY_ENB:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PHY_ENB");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_MAC_ENB:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "MAC_ENB");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_RLC_ENB:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RLC_ENB");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_PDCP_ENB:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PDCP_ENB");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_RRC_ENB:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RRC_ENB");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_S1AP_ENB:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S1AP_ENB");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_E_UTRAN) || (envP == MSC_MME_GW) || (envP == MSC_MME)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_GTPU_ENB:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "GTPU_ENB");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_GTPU_SGW:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "GTPU_SGW");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_MME_GW) || (envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_S1AP_MME:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S1AP_MME");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_MME_GW) || (envP == MSC_MME) || (envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_MMEAPP_MME:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "MME_APP");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_MME_GW) || (envP == MSC_MME)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_NAS_MME:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_MME");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
msc_log_declare_proto(i);
|
||||
break;
|
||||
|
||||
case MSC_NAS_EMM_MME:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_EMM");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_MME_GW) || (envP == MSC_MME)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_NAS_ESM_MME:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_ESM");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_MME_GW) || (envP == MSC_MME)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_SP_GWAPP_MME:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "SP_GW_MME");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if (envP == MSC_MME_GW) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_S11_MME:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S11_MME");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if (envP == MSC_MME) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_S6A_MME:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S6A");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_MME_GW) || (envP == MSC_MME)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSC_HSS:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "HSS");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
|
||||
if ((envP == MSC_MME_GW) || (envP == MSC_MME)) {
|
||||
msc_log_declare_proto(i);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "UNKNOWN");
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
|
||||
|
||||
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
|
||||
g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rv = itti_create_task (TASK_MSC, msc_task, NULL);
|
||||
AssertFatal (rv == 0, "Create task for MSC failed!\n");
|
||||
fprintf(stderr, "Initializing MSC logs Done\n");
|
||||
@@ -359,15 +508,17 @@ void msc_flush_messages(void)
|
||||
int rv;
|
||||
msc_queue_item_t *item_p = NULL;
|
||||
|
||||
while ((rv = lfds611_queue_dequeue( g_msc_message_queue_p, (void**)&item_p )) == 1) {
|
||||
if (NULL != item_p->message_str) {
|
||||
fputs(item_p->message_str, g_msc_fd);
|
||||
// TODO BIN DATA
|
||||
rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, item_p->message_str );
|
||||
}
|
||||
// TODO FREE BIN DATA
|
||||
free(item_p);
|
||||
while ((rv = lfds611_queue_dequeue( g_msc_message_queue_p, (void **)&item_p )) == 1) {
|
||||
if (NULL != item_p->message_str) {
|
||||
fputs(item_p->message_str, g_msc_fd);
|
||||
// TODO BIN DATA
|
||||
rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, item_p->message_str );
|
||||
}
|
||||
|
||||
// TODO FREE BIN DATA
|
||||
free(item_p);
|
||||
}
|
||||
|
||||
fflush(g_msc_fd);
|
||||
}
|
||||
|
||||
@@ -377,23 +528,27 @@ void msc_end(void)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
int rv;
|
||||
|
||||
if (NULL != g_msc_fd ) {
|
||||
msc_flush_messages();
|
||||
msc_flush_messages();
|
||||
rv = fflush(g_msc_fd);
|
||||
if (rv != 0) {
|
||||
fprintf(stderr, "Error while flushing stream of MSC log file: %s", strerror(errno));
|
||||
}
|
||||
rv = fclose(g_msc_fd);
|
||||
|
||||
if (rv != 0) {
|
||||
fprintf(stderr, "Error while closing MSC log file: %s", strerror(errno));
|
||||
fprintf(stderr, "Error while flushing stream of MSC log file: %s", strerror(errno));
|
||||
}
|
||||
|
||||
rv = fclose(g_msc_fd);
|
||||
|
||||
if (rv != 0) {
|
||||
fprintf(stderr, "Error while closing MSC log file: %s", strerror(errno));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void msc_log_declare_proto(
|
||||
const msc_proto_t protoP
|
||||
)
|
||||
const msc_proto_t protoP
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
int rv = 0;
|
||||
@@ -401,47 +556,55 @@ void msc_log_declare_proto(
|
||||
char *char_message_p = NULL;
|
||||
|
||||
if ((MIN_MSC_PROTOS <= protoP) && (MAX_MSC_PROTOS > protoP)) {
|
||||
// may be build a memory pool for that also ?
|
||||
new_item_p = malloc(sizeof(msc_queue_item_t));
|
||||
if (NULL != new_item_p) {
|
||||
// may be build a memory pool for that also ?
|
||||
new_item_p = malloc(sizeof(msc_queue_item_t));
|
||||
|
||||
rv = lfds611_stack_pop(g_msc_memory_stack_p, (void**)&char_message_p);
|
||||
if (0 == rv) {
|
||||
msc_flush_messages();
|
||||
rv = lfds611_stack_pop(g_msc_memory_stack_p, (void**)&char_message_p);
|
||||
}
|
||||
if (1 == rv) {
|
||||
if (NULL != new_item_p) {
|
||||
rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p);
|
||||
|
||||
if (0 == rv) {
|
||||
msc_flush_messages();
|
||||
rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p);
|
||||
}
|
||||
|
||||
if (1 == rv) {
|
||||
rv = snprintf(char_message_p, MSC_MAX_MESSAGE_LENGTH, "%"PRIu64" [PROTO] %d %s\n", __sync_fetch_and_add (&g_message_number, 1), protoP, &g_msc_proto2str[protoP][0]);
|
||||
|
||||
if (0 > rv) {
|
||||
fprintf(stderr, "Error while declaring new protocol in MSC: %s", strerror(errno));
|
||||
}
|
||||
|
||||
new_item_p->message_str = char_message_p;
|
||||
new_item_p->message_str_size = rv;
|
||||
new_item_p->message_bin = NULL;
|
||||
new_item_p->message_bin_size = 0;
|
||||
rv = lfds611_queue_enqueue( g_msc_message_queue_p, new_item_p );
|
||||
if (0 == rv) {
|
||||
rv = lfds611_queue_guaranteed_enqueue(g_msc_message_queue_p, new_item_p );
|
||||
if (0 == rv) {
|
||||
|
||||
if (0 == rv) {
|
||||
rv = lfds611_queue_guaranteed_enqueue(g_msc_message_queue_p, new_item_p );
|
||||
|
||||
if (0 == rv) {
|
||||
fprintf(stderr, "Error while lfds611_queue_guaranteed_enqueue message %s in MSC", char_message_p);
|
||||
rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p );
|
||||
free(new_item_p);
|
||||
}
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
fprintf(stderr, "Error while lfds611_stack_pop()\n");
|
||||
}
|
||||
rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p );
|
||||
free(new_item_p);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
} else {
|
||||
fprintf(stderr, "Error while lfds611_stack_pop()\n");
|
||||
}
|
||||
|
||||
free(new_item_p);
|
||||
} else {
|
||||
} else {
|
||||
fprintf(stderr, "Error while malloc in MSC");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void msc_log_event(
|
||||
const msc_proto_t protoP,
|
||||
char *format, ...)
|
||||
const msc_proto_t protoP,
|
||||
char *format, ...)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
va_list args;
|
||||
@@ -450,52 +613,62 @@ void msc_log_event(
|
||||
msc_queue_item_t *new_item_p = NULL;
|
||||
char *char_message_p = NULL;
|
||||
|
||||
|
||||
if ((MIN_MSC_PROTOS > protoP) || (MAX_MSC_PROTOS <= protoP)) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
new_item_p = malloc(sizeof(msc_queue_item_t));
|
||||
if (NULL != new_item_p) {
|
||||
|
||||
rv = lfds611_stack_pop(g_msc_memory_stack_p, (void**)&char_message_p);
|
||||
new_item_p = malloc(sizeof(msc_queue_item_t));
|
||||
|
||||
if (NULL != new_item_p) {
|
||||
rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p);
|
||||
|
||||
if (0 == rv) {
|
||||
msc_flush_messages();
|
||||
rv = lfds611_stack_pop(g_msc_memory_stack_p, (void**)&char_message_p);
|
||||
rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p);
|
||||
}
|
||||
|
||||
if (1 == rv) {
|
||||
rv = snprintf(char_message_p, MSC_MAX_MESSAGE_LENGTH, "%"PRIu64" [EVENT] %d ", __sync_fetch_and_add (&g_message_number, 1), protoP);
|
||||
|
||||
if ((0 > rv) || (MSC_MAX_MESSAGE_LENGTH < rv)) {
|
||||
fprintf(stderr, "Error while logging MSC event : %s", &g_msc_proto2str[protoP][0]);
|
||||
goto error_event;
|
||||
}
|
||||
|
||||
va_start(args, format);
|
||||
rv2 = vsnprintf(&char_message_p[rv],MSC_MAX_MESSAGE_LENGTH - rv, format, args);
|
||||
va_end(args);
|
||||
|
||||
if ((0 > rv2) || ((MSC_MAX_MESSAGE_LENGTH - rv) < rv2)) {
|
||||
fprintf(stderr, "Error while logging MSC event : %s", &g_msc_proto2str[protoP][0]);
|
||||
goto error_event;
|
||||
}
|
||||
|
||||
rv += rv2;
|
||||
rv2 = snprintf(&char_message_p[rv],MSC_MAX_MESSAGE_LENGTH - rv, "\n");
|
||||
|
||||
if ((0 > rv2) || ((MSC_MAX_MESSAGE_LENGTH - rv) < rv2)) {
|
||||
fprintf(stderr, "Error while logging MSC event : %s", &g_msc_proto2str[protoP][0]);
|
||||
goto error_event;
|
||||
}
|
||||
|
||||
rv += rv2;
|
||||
new_item_p->message_str = char_message_p;
|
||||
new_item_p->message_str_size = rv;
|
||||
new_item_p->message_bin = NULL;
|
||||
new_item_p->message_bin_size = 0;
|
||||
rv = lfds611_queue_enqueue( g_msc_message_queue_p, new_item_p );
|
||||
if (0 == rv) {
|
||||
|
||||
if (0 == rv) {
|
||||
fprintf(stderr, "Error while lfds611_queue_guaranteed_enqueue message %s in MSC", char_message_p);
|
||||
rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p );
|
||||
free(new_item_p);
|
||||
}
|
||||
rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p );
|
||||
free(new_item_p);
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "Error while lfds611_stack_pop()\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
error_event:
|
||||
rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p );
|
||||
@@ -503,12 +676,12 @@ error_event:
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void msc_log_message(
|
||||
const char * const message_operationP,
|
||||
const msc_proto_t proto1P,
|
||||
const msc_proto_t proto2P,
|
||||
const uint8_t * const bytesP,
|
||||
const unsigned int num_bytes,
|
||||
char *format, ...)
|
||||
const char *const message_operationP,
|
||||
const msc_proto_t proto1P,
|
||||
const msc_proto_t proto2P,
|
||||
const uint8_t *const bytesP,
|
||||
const unsigned int num_bytes,
|
||||
char *format, ...)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
va_list args;
|
||||
@@ -518,56 +691,65 @@ void msc_log_message(
|
||||
msc_queue_item_t *new_item_p = NULL;
|
||||
char *char_message_p = NULL;
|
||||
|
||||
|
||||
if ((MIN_MSC_PROTOS > proto1P) || (MAX_MSC_PROTOS <= proto1P) ||
|
||||
(MIN_MSC_PROTOS > proto2P) || (MAX_MSC_PROTOS <= proto2P) ) {
|
||||
(MIN_MSC_PROTOS > proto2P) || (MAX_MSC_PROTOS <= proto2P) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
new_item_p = malloc(sizeof(msc_queue_item_t));
|
||||
if (NULL != new_item_p) {
|
||||
|
||||
rv = lfds611_stack_pop(g_msc_memory_stack_p, (void**)&char_message_p);
|
||||
if (NULL != new_item_p) {
|
||||
rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p);
|
||||
|
||||
if (0 == rv) {
|
||||
msc_flush_messages();
|
||||
rv = lfds611_stack_pop(g_msc_memory_stack_p, (void**)&char_message_p);
|
||||
}
|
||||
rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p);
|
||||
}
|
||||
|
||||
if (1 == rv) {
|
||||
rv = snprintf(char_message_p, MSC_MAX_MESSAGE_LENGTH, "%"PRIu64" [MESSAGE] %d %s %d %"PRIu64" ",
|
||||
__sync_fetch_and_add (&g_message_number, 1), proto1P, message_operationP, proto2P, mac);
|
||||
__sync_fetch_and_add (&g_message_number, 1), proto1P, message_operationP, proto2P, mac);
|
||||
|
||||
if ((0 > rv) || (MSC_MAX_MESSAGE_LENGTH < rv)) {
|
||||
fprintf(stderr, "Error while logging MSC message : %s/%s", &g_msc_proto2str[proto1P][0], &g_msc_proto2str[proto2P][0]);
|
||||
goto error_event;
|
||||
}
|
||||
|
||||
va_start(args, format);
|
||||
rv2 = vsnprintf(&char_message_p[rv],MSC_MAX_MESSAGE_LENGTH - rv, format, args);
|
||||
va_end(args);
|
||||
|
||||
if ((0 > rv2) || ((MSC_MAX_MESSAGE_LENGTH - rv) < rv2)) {
|
||||
fprintf(stderr, "Error while logging MSC message : %s/%s", &g_msc_proto2str[proto1P][0], &g_msc_proto2str[proto2P][0]);
|
||||
goto error_event;
|
||||
}
|
||||
|
||||
rv += rv2;
|
||||
rv2 = snprintf(&char_message_p[rv],MSC_MAX_MESSAGE_LENGTH - rv, "\n");
|
||||
|
||||
if ((0 > rv2) || ((MSC_MAX_MESSAGE_LENGTH - rv) < rv2)) {
|
||||
fprintf(stderr, "Error while logging MSC message : %s/%s", &g_msc_proto2str[proto1P][0], &g_msc_proto2str[proto2P][0]);
|
||||
goto error_event;
|
||||
}
|
||||
|
||||
rv += rv2;
|
||||
new_item_p->message_str = char_message_p;
|
||||
new_item_p->message_str_size = rv;
|
||||
new_item_p->message_bin = NULL; // TO DO
|
||||
new_item_p->message_bin_size = 0; // TO DO
|
||||
rv = lfds611_queue_enqueue( g_msc_message_queue_p, new_item_p );
|
||||
if (0 == rv) {
|
||||
|
||||
if (0 == rv) {
|
||||
fprintf(stderr, "Error while lfds611_queue_guaranteed_enqueue message %s in MSC", char_message_p);
|
||||
rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p );
|
||||
free(new_item_p);
|
||||
}
|
||||
rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p );
|
||||
free(new_item_p);
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "Error while lfds611_stack_pop()\n");
|
||||
msc_flush_messages();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
error_event:
|
||||
rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p );
|
||||
@@ -578,8 +760,7 @@ error_event:
|
||||
// function called when oai loader loads the msc shared lib
|
||||
int msc_autoinit(msc_interface_t *msc_interface)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
{
|
||||
msc_interface->msc_init = msc_init;
|
||||
msc_interface->msc_start_use = msc_start_use;
|
||||
msc_interface->msc_end = msc_end;
|
||||
@@ -587,4 +768,4 @@ int msc_autoinit(msc_interface_t *msc_interface)
|
||||
msc_interface->msc_log_message = msc_log_message;
|
||||
msc_interface->msc_loaded = 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,46 +25,46 @@
|
||||
#include <stdint.h>
|
||||
|
||||
typedef enum {
|
||||
MIN_MSC_ENV = 0,
|
||||
MSC_E_UTRAN = MIN_MSC_ENV,
|
||||
MSC_E_UTRAN_LIPA,
|
||||
MSC_MME_GW,
|
||||
MSC_MME,
|
||||
MSC_SP_GW,
|
||||
MAX_MSC_ENV
|
||||
MIN_MSC_ENV = 0,
|
||||
MSC_E_UTRAN = MIN_MSC_ENV,
|
||||
MSC_E_UTRAN_LIPA,
|
||||
MSC_MME_GW,
|
||||
MSC_MME,
|
||||
MSC_SP_GW,
|
||||
MAX_MSC_ENV
|
||||
} msc_env_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
MIN_MSC_PROTOS = 0,
|
||||
MSC_IP_UE = MIN_MSC_PROTOS,
|
||||
MSC_NAS_UE,
|
||||
MSC_RRC_UE,
|
||||
MSC_PDCP_UE,
|
||||
MSC_RLC_UE,
|
||||
MSC_MAC_UE,
|
||||
MSC_PHY_UE,
|
||||
MSC_PHY_ENB,
|
||||
MSC_MAC_ENB,
|
||||
MSC_RLC_ENB,
|
||||
MSC_PDCP_ENB,
|
||||
MSC_RRC_ENB,
|
||||
MSC_IP_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
MSC_GTPU_ENB,
|
||||
MSC_GTPU_SGW,
|
||||
MSC_S1AP_MME,
|
||||
MSC_MMEAPP_MME,
|
||||
MSC_NAS_MME,
|
||||
MSC_NAS_EMM_MME,
|
||||
MSC_NAS_ESM_MME,
|
||||
MSC_SP_GWAPP_MME,
|
||||
MSC_S11_MME,
|
||||
MSC_S6A_MME,
|
||||
MSC_HSS,
|
||||
MAX_MSC_PROTOS,
|
||||
MSC_X2AP_SRC_ENB,
|
||||
MSC_X2AP_TARGET_ENB,
|
||||
MIN_MSC_PROTOS = 0,
|
||||
MSC_IP_UE = MIN_MSC_PROTOS,
|
||||
MSC_NAS_UE,
|
||||
MSC_RRC_UE,
|
||||
MSC_PDCP_UE,
|
||||
MSC_RLC_UE,
|
||||
MSC_MAC_UE,
|
||||
MSC_PHY_UE,
|
||||
MSC_PHY_ENB,
|
||||
MSC_MAC_ENB,
|
||||
MSC_RLC_ENB,
|
||||
MSC_PDCP_ENB,
|
||||
MSC_RRC_ENB,
|
||||
MSC_IP_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
MSC_GTPU_ENB,
|
||||
MSC_GTPU_SGW,
|
||||
MSC_S1AP_MME,
|
||||
MSC_MMEAPP_MME,
|
||||
MSC_NAS_MME,
|
||||
MSC_NAS_EMM_MME,
|
||||
MSC_NAS_ESM_MME,
|
||||
MSC_SP_GWAPP_MME,
|
||||
MSC_S11_MME,
|
||||
MSC_S6A_MME,
|
||||
MSC_HSS,
|
||||
MAX_MSC_PROTOS,
|
||||
MSC_X2AP_SRC_ENB,
|
||||
MSC_X2AP_TARGET_ENB,
|
||||
} msc_proto_t;
|
||||
|
||||
|
||||
@@ -73,22 +73,22 @@ typedef enum {
|
||||
#define MSC_AS_TIME_FMT "%05u:%02u"
|
||||
|
||||
#define MSC_AS_TIME_ARGS(CTXT_Pp) \
|
||||
(CTXT_Pp)->frame, \
|
||||
(CTXT_Pp)->subframe
|
||||
(CTXT_Pp)->frame, \
|
||||
(CTXT_Pp)->subframe
|
||||
|
||||
typedef int(*msc_init_t)(const msc_env_t, const int );
|
||||
typedef void(*msc_start_use_t)(void );
|
||||
typedef void(*msc_end_t)(void);
|
||||
typedef void(*msc_log_event_t)(const msc_proto_t,char *, ...);
|
||||
typedef void(*msc_log_message_t)(const char * const, const msc_proto_t, const msc_proto_t,
|
||||
const uint8_t* const, const unsigned int, char * , ...);
|
||||
typedef void(*msc_log_message_t)(const char *const, const msc_proto_t, const msc_proto_t,
|
||||
const uint8_t *const, const unsigned int, char *, ...);
|
||||
typedef struct msc_interface {
|
||||
int msc_loaded;
|
||||
msc_init_t msc_init;
|
||||
msc_start_use_t msc_start_use;
|
||||
msc_end_t msc_end;
|
||||
msc_log_event_t msc_log_event;
|
||||
msc_log_message_t msc_log_message;
|
||||
int msc_loaded;
|
||||
msc_init_t msc_init;
|
||||
msc_start_use_t msc_start_use;
|
||||
msc_end_t msc_end;
|
||||
msc_log_event_t msc_log_event;
|
||||
msc_log_message_t msc_log_message;
|
||||
} msc_interface_t;
|
||||
|
||||
#ifdef MSC_LIBRARY
|
||||
@@ -99,15 +99,17 @@ void msc_end(void);
|
||||
void msc_log_declare_proto(const msc_proto_t protoP);
|
||||
void msc_log_event(const msc_proto_t protoP,char *format, ...);
|
||||
void msc_log_message(
|
||||
const char * const message_operationP,
|
||||
const msc_proto_t receiverP,
|
||||
const msc_proto_t senderP,
|
||||
const uint8_t* const bytesP,
|
||||
const unsigned int num_bytes,
|
||||
char *format, ...);
|
||||
const char *const message_operationP,
|
||||
const msc_proto_t receiverP,
|
||||
const msc_proto_t senderP,
|
||||
const uint8_t *const bytesP,
|
||||
const unsigned int num_bytes,
|
||||
char *format, ...);
|
||||
|
||||
#else
|
||||
|
||||
#define MESSAGE_CHART_GENERATOR msc_interface.msc_loaded
|
||||
|
||||
msc_interface_t msc_interface;
|
||||
#define MSC_INIT(arg1,arg2) if(msc_interface.msc_loaded) msc_interface.msc_init(arg1,arg2)
|
||||
#define MSC_START_USE if(msc_interface.msc_loaded) msc_interface.msc_start_use
|
||||
@@ -119,4 +121,4 @@ msc_interface_t msc_interface;
|
||||
#define MSC_LOG_TX_MESSAGE_FAILED(sENDER, rECEIVER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("-x",sENDER, rECEIVER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
5. [eNB RRC Layer](#enb-rrc-layer)
|
||||
6. [eNB X2AP](#enb-x2ap)
|
||||
7. [eNB Advanced Features](#enb-advanced-features)
|
||||
2. [OpenAirInterface UE Feature Set](#openairinterface-ue-feature-set)
|
||||
2. [OpenAirInterface Functional Split](#openairinterface-functional-split)
|
||||
3. [OpenAirInterface UE Feature Set](#openairinterface-ue-feature-set)
|
||||
1. [LTE UE PHY Layer](#lte-ue-phy-layer)
|
||||
2. [LTE UE MAC Layer](#lte-ue-mac-layer)
|
||||
3. [LTE UE RLC Layer](#lte-ue-rlc-layer)
|
||||
@@ -128,6 +129,18 @@ The X2AP layer is based on **3GPP 36.423** v14.6.0 and implements the following
|
||||
|
||||
**To be completed**
|
||||
|
||||
# OpenAirInterface Functional Split #
|
||||
|
||||
- RCC: Radio-Cloud Center
|
||||
- RAU: Radio-Access Unit
|
||||
- RRU: Remote Radio-Unit
|
||||
|
||||

|
||||
|
||||
- IF4.5 / IF5 : similar to IEEE P1914.1
|
||||
- FAPI (IF2) : specified by Small Cell Forum (open-nFAPI implementation)
|
||||
- IF1 : F1 in 3GPP Release 15 (not implemented yet)
|
||||
|
||||
# OpenAirInterface UE Feature Set #
|
||||
|
||||
## LTE UE PHY Layer ##
|
||||
@@ -169,3 +182,10 @@ The RRC layer is based on **3GPP 36.331** v14.3.0 and implements the following f
|
||||
|
||||
- System Information decoding
|
||||
- RRC connection establishment
|
||||
|
||||
## LTE UE NAS Layer ##
|
||||
|
||||
The NAS layer is based on **3GPP 24.301** and implements the following functions:
|
||||
|
||||
- EMM attach/detach, authentication, tracking area update, and more
|
||||
- ESM default/dedicated bearer, PDN connectivity, and more
|
||||
|
||||
|
After Width: | Height: | Size: 60 KiB |
@@ -270,6 +270,7 @@ int pnf_param_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_param_re
|
||||
for(int i = 0; i < resp->pnf_phy.number_of_phys; ++i)
|
||||
{
|
||||
phy_info phy;
|
||||
memset(&phy,0,sizeof(phy));
|
||||
phy.index = resp->pnf_phy.phy[i].phy_config_index;
|
||||
|
||||
printf("[VNF] (PHY:%d) phy_config_idx:%d\n", i, resp->pnf_phy.phy[i].phy_config_index);
|
||||
@@ -287,6 +288,7 @@ int pnf_param_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_param_re
|
||||
|
||||
for(int i = 0; i < resp->pnf_rf.number_of_rfs; ++i) {
|
||||
rf_info rf;
|
||||
memset(&rf,0,sizeof(rf));
|
||||
rf.index = resp->pnf_rf.rf[i].rf_config_index;
|
||||
|
||||
printf("[VNF] (RF:%d) rf_config_idx:%d\n", i, resp->pnf_rf.rf[i].rf_config_index);
|
||||
@@ -897,7 +899,7 @@ int param_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_param_response_t
|
||||
|
||||
// for now just 1
|
||||
|
||||
printf("[VNF] %d.%d pnf p7 %s:%d timing %d %d %d %d\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);
|
||||
printf("[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);
|
||||
|
||||
req->header.message_id = NFAPI_CONFIG_REQUEST;
|
||||
req->header.phy_id = phy->id;
|
||||
@@ -919,7 +921,7 @@ int param_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_param_response_t
|
||||
|
||||
req->nfapi_config.timing_window.tl.tag = NFAPI_NFAPI_TIMING_WINDOW_TAG;
|
||||
req->nfapi_config.timing_window.value = p7_vnf->timing_window;
|
||||
printf("[VNF] Timing window:%d\n", p7_vnf->timing_window);
|
||||
printf("[VNF] Timing window:%u\n", p7_vnf->timing_window);
|
||||
req->num_tlv++;
|
||||
|
||||
if(p7_vnf->periodic_timing_enabled || p7_vnf->aperiodic_timing_enabled) {
|
||||
|
||||
@@ -1237,11 +1237,11 @@ int pnf_connect(pnf_t* pnf)
|
||||
}
|
||||
|
||||
struct addrinfo *p = servinfo;
|
||||
int i = 0;
|
||||
int connected = 0;
|
||||
|
||||
while(p != NULL && connected == 0)
|
||||
{
|
||||
#ifdef NFAPI_TRACE_ENABLED
|
||||
char* family = "Unknown";
|
||||
char* address = "Unknown";
|
||||
char _addr[128];
|
||||
@@ -1260,7 +1260,8 @@ int pnf_connect(pnf_t* pnf)
|
||||
address = inet_ntoa(addr->sin_addr);
|
||||
}
|
||||
|
||||
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "Host address info %d Family:%s Address:%s\n", i++, family, address);
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "Host address info %d Family:%s Address:%s\n", i++, family, address);
|
||||
#endif
|
||||
|
||||
if (pnf->sctp)
|
||||
{
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
date: 09.2012
|
||||
*/
|
||||
#ifndef TC_MAIN
|
||||
#include "coding_defs.h"
|
||||
#include "coding_defs.h"
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -66,11 +66,11 @@ struct treillis {
|
||||
union {
|
||||
uint8x8_t systematic_andp1_64[3];
|
||||
char systematic_andp1_8[24];
|
||||
}__attribute__((aligned(64)));
|
||||
} __attribute__((aligned(64)));
|
||||
union {
|
||||
uint8x8_t parity2_64[3];
|
||||
char parity2_8[24];
|
||||
}__attribute__((aligned(64)));
|
||||
} __attribute__((aligned(64)));
|
||||
int exit_state;
|
||||
};
|
||||
#endif
|
||||
@@ -79,23 +79,20 @@ struct treillis all_treillis[8][256];
|
||||
|
||||
int all_treillis_initialized=0;
|
||||
|
||||
static inline unsigned char threegpplte_rsc(unsigned char input,unsigned char *state)
|
||||
{
|
||||
static inline unsigned char threegpplte_rsc(unsigned char input,unsigned char *state) {
|
||||
unsigned char output;
|
||||
output = (input ^ (*state>>2) ^ (*state>>1))&1;
|
||||
*state = (((input<<2)^(*state>>1))^((*state>>1)<<2)^((*state)<<2))&7;
|
||||
return(output);
|
||||
}
|
||||
|
||||
static inline void threegpplte_rsc_termination(unsigned char *x,unsigned char *z,unsigned char *state)
|
||||
{
|
||||
static inline void threegpplte_rsc_termination(unsigned char *x,unsigned char *z,unsigned char *state) {
|
||||
*z = ((*state>>2) ^ (*state)) &1;
|
||||
*x = ((*state) ^ (*state>>1)) &1;
|
||||
*state = (*state)>>1;
|
||||
}
|
||||
|
||||
static void treillis_table_init(void)
|
||||
{
|
||||
static void treillis_table_init(void) {
|
||||
//struct treillis t[][]=all_treillis;
|
||||
//t=memalign(16,sizeof(struct treillis)*8*256);
|
||||
int i, j,b;
|
||||
@@ -114,8 +111,8 @@ static void treillis_table_init(void)
|
||||
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].parity1_8[b*3+1]=v; // for the yparity1
|
||||
all_treillis[i][j].systematic_andp1_8[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
|
||||
}
|
||||
|
||||
@@ -128,14 +125,12 @@ static void treillis_table_init(void)
|
||||
}
|
||||
|
||||
|
||||
char interleave_compact_byte(short * base_interleaver,unsigned char * input, unsigned char * output, int n)
|
||||
{
|
||||
|
||||
char interleave_compact_byte(short *base_interleaver,unsigned char *input, unsigned char *output, int n) {
|
||||
char expandInput[768*8] __attribute__((aligned(32)));
|
||||
int i,loop=n>>4;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
#ifndef __AVX2__
|
||||
__m128i *i_128=(__m128i *)input, *o_128=(__m128i*)expandInput;
|
||||
__m128i *i_128=(__m128i *)input, *o_128=(__m128i *)expandInput;
|
||||
__m128i tmp1, tmp2, tmp3, tmp4;
|
||||
__m128i BIT_MASK = _mm_set_epi8( 0b00000001,
|
||||
0b00000010,
|
||||
@@ -153,42 +148,41 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000);
|
||||
|
||||
#else
|
||||
__m256i *i_256=(__m256i *)input, *o_256=(__m256i*)expandInput;
|
||||
__m256i *i_256=(__m256i *)input, *o_256=(__m256i *)expandInput;
|
||||
__m256i tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
|
||||
__m256i BIT_MASK = _mm256_set_epi8( 0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000,
|
||||
0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000,
|
||||
0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000,
|
||||
0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000);
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000,
|
||||
0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000,
|
||||
0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000,
|
||||
0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000);
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
uint8x16_t *i_128=(uint8x16_t *)input, *o_128=(uint8x16_t *)expandInput;
|
||||
@@ -196,40 +190,41 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
uint16x8_t tmp3;
|
||||
uint32x4_t tmp4;
|
||||
uint8x16_t and_tmp;
|
||||
uint8x16_t BIT_MASK = { 0b10000000,
|
||||
0b01000000,
|
||||
0b00100000,
|
||||
0b00010000,
|
||||
0b00001000,
|
||||
0b00000100,
|
||||
0b00000010,
|
||||
0b00000001,
|
||||
0b10000000,
|
||||
0b01000000,
|
||||
0b00100000,
|
||||
0b00010000,
|
||||
0b00001000,
|
||||
0b00000100,
|
||||
0b00000010,
|
||||
0b00000001};
|
||||
uint8x16_t BIT_MASK = { 0b10000000,
|
||||
0b01000000,
|
||||
0b00100000,
|
||||
0b00010000,
|
||||
0b00001000,
|
||||
0b00000100,
|
||||
0b00000010,
|
||||
0b00000001,
|
||||
0b10000000,
|
||||
0b01000000,
|
||||
0b00100000,
|
||||
0b00010000,
|
||||
0b00001000,
|
||||
0b00000100,
|
||||
0b00000010,
|
||||
0b00000001
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __AVX2__
|
||||
|
||||
if ((n&15) > 0)
|
||||
loop++;
|
||||
|
||||
#else
|
||||
loop=n>>5;
|
||||
|
||||
if ((n&31) > 0)
|
||||
loop++;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
for (i=0; i<loop ; i++ ) {
|
||||
// int cur_byte=i<<3;
|
||||
// for (b=0;b<8;b++)
|
||||
// expandInput[cur_byte+b] = (input[i]&(1<<(7-b)))>>(7-b);
|
||||
|
||||
// int cur_byte=i<<3;
|
||||
// for (b=0;b<8;b++)
|
||||
// expandInput[cur_byte+b] = (input[i]&(1<<(7-b)))>>(7-b);
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
#ifndef __AVX2__
|
||||
tmp1=_mm_load_si128(i_128++); // tmp1 = B0,B1,...,B15
|
||||
@@ -237,29 +232,22 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
tmp3=_mm_unpacklo_epi16(tmp2,tmp2); // tmp3 = B0,B0,B0,B0,B1,B1,B1,B1,B2,B2,B2,B2,B3,B3,B3,B3
|
||||
tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 - B0,B0,B0,B0,B0,B0,B0,B0,B1,B1,B1,B1,B1,B1,B1,B1
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);
|
||||
|
||||
tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 - B2,B2,B2,B2,B2,B2,B2,B2,B3,B3,B3,B3,B3,B3,B3,B3
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp3=_mm_unpackhi_epi16(tmp2,tmp2); // tmp3 = B4,B4,B4,B4,B5,B5,B5,B5,B6,B6,B6,B6,B7,B7,B7,B7
|
||||
tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 - B4,B4,B4,B4,B4,B4,B4,B4,B5,B5,B5,B5,B5,B5,B5,B5
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 - B6,B6,B6,B6,B6,B6,B6,B6,B7,B7,B7,B7,B7,B7,B7,B7
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp2=_mm_unpackhi_epi8(tmp1,tmp1); // tmp2 = B8,B8,B9,B9,...,B15,B15
|
||||
tmp3=_mm_unpacklo_epi16(tmp2,tmp2); // tmp3 = B8,B8,B8,B8,B9,B9,B9,B9,B10,B10,B10,B10,B11,B11,B11,B11
|
||||
tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 = B8,B8,B8,B8,B8,B8,B8,B8,B9,B9,B9,B9,B9,B9,B9,B9
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 = B10,B10,B10,B10,B10,B10,B10,B10,B11,B11,B11,B11,B11,B11,B11,B11
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp3=_mm_unpackhi_epi16(tmp2,tmp2); // tmp3 = B12,B12,B12,B12,B13,B13,B13,B13,B14,B14,B14,B14,B15,B15,B15,B15
|
||||
tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 = B12,B12,B12,B12,B12,B12,B12,B12,B13,B13,B13,B13,B13,B13,B13,B13
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 = B14,B14,B14,B14,B14,B14,B14,B14,B15,B15,B15,B15,B15,B15,B15,B15
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
#else
|
||||
@@ -281,7 +269,6 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
//print_bytes2("out",(uint8_t*)o_256);
|
||||
o_256[4]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);;
|
||||
//print_bytes2("out",(uint8_t*)(o_256+4));
|
||||
|
||||
tmp3=_mm256_unpackhi_epi16(tmp2,tmp2); // tmp3 = B4,B4,B4,B4,B5,B5,B5,B5,B6,B6,B6,B6,B7,B7,B7,B7,B20,B20,B20,B20,...,B23,B23,B23,B23
|
||||
tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 - B4,B4,B4,B4,B4,B4,B4,B4,B5,B5,B5,B5,B5,B5,B5,B5,B20,B20...,B21..,B21
|
||||
tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 - B6,B6,B6,B6,B6,B6,B6,B6,B7,B7,B7,B7,B7,B7,B7,B7,B22...,B22,B23,...,B23
|
||||
@@ -297,7 +284,6 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
//print_bytes2("out",(uint8_t*)(o_256+1));
|
||||
o_256[5]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);;
|
||||
//print_bytes2("out",(uint8_t*)(o_256+4));
|
||||
|
||||
tmp2=_mm256_unpackhi_epi8(tmp1,tmp1); // tmp2 = B8 B9 B10 B11 B12 B13 B14 B15 B25 B26 B27 B28 B29 B30 B31
|
||||
tmp3=_mm256_unpacklo_epi16(tmp2,tmp2); // tmp3 = B8,B9,B10,B11,B26,B27,B28,B29
|
||||
tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 - B8,B9,B26,B27
|
||||
@@ -314,11 +300,10 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
//print_bytes2("out",(uint8_t*)(o_256+2));
|
||||
o_256[6]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);;
|
||||
//print_bytes2("out",(uint8_t*)(o_256+4));
|
||||
|
||||
tmp3=_mm256_unpackhi_epi16(tmp2,tmp2); // tmp3 = B12 B13 B14 B15 B28 B29 B30 B31
|
||||
tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 = B12 B13 B28 B29
|
||||
tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 = B14 B15 B30 B31
|
||||
tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1); // tmp6 = B12 B13 B14 B15
|
||||
tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 = B14 B15 B30 B31
|
||||
tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1); // tmp6 = B12 B13 B14 B15
|
||||
tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0); // tmp7 = B28 B29 B30 B31
|
||||
//print_bytes2("tmp2",(uint8_t*)&tmp2);
|
||||
//print_bytes2("tmp3",(uint8_t*)&tmp3);
|
||||
@@ -330,48 +315,35 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
//print_bytes2("out",(uint8_t*)(o_256+3));
|
||||
o_256[7]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);;
|
||||
//print_bytes2("out",(uint8_t*)(o_256+7));
|
||||
|
||||
o_256+=8;
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
tmp1=vld1q_u8((uint8_t*)i_128);
|
||||
tmp1=vld1q_u8((uint8_t *)i_128);
|
||||
//print_bytes("tmp1:",(uint8_t*)&tmp1);
|
||||
|
||||
uint8x16x2_t temp1 = vzipq_u8(tmp1,tmp1);
|
||||
tmp2 = temp1.val[0];
|
||||
|
||||
uint16x8x2_t temp2 = vzipq_u16((uint16x8_t)tmp2,(uint16x8_t)tmp2);
|
||||
tmp3 = temp2.val[0];
|
||||
|
||||
uint32x4x2_t temp3 = vzipq_u32((uint32x4_t)tmp3,(uint32x4_t)tmp3);
|
||||
tmp4 = temp3.val[0];
|
||||
//print_bytes("tmp4:",(uint8_t*)&tmp4);
|
||||
|
||||
*o_128++=vceqq_u8(vandq_u8((uint8x16_t)tmp4,BIT_MASK),BIT_MASK); //1
|
||||
//print_bytes("o:",(uint8_t*)(o_128-1));
|
||||
|
||||
tmp4 = temp3.val[1];
|
||||
//print_bytes("tmp4:",(uint8_t*)&tmp4);
|
||||
|
||||
*o_128++=vceqq_u8(vandq_u8((uint8x16_t)tmp4,BIT_MASK),BIT_MASK); //2
|
||||
//print_bytes("o:",(uint8_t*)(o_128-1));
|
||||
|
||||
tmp3 = temp2.val[1];
|
||||
temp3 = vzipq_u32((uint32x4_t)tmp3,(uint32x4_t)tmp3);
|
||||
tmp4 = temp3.val[0];
|
||||
//print_bytes("tmp4:",(uint8_t*)&tmp4);
|
||||
|
||||
*o_128++=vceqq_u8(vandq_u8((uint8x16_t)tmp4,BIT_MASK),BIT_MASK); //3
|
||||
//print_bytes("o:",(uint8_t*)(o_128-1));
|
||||
|
||||
tmp4 = temp3.val[1];
|
||||
//print_bytes("tmp4:",(uint8_t*)&tmp4);
|
||||
|
||||
*o_128++=vceqq_u8(vandq_u8((uint8x16_t)tmp4,BIT_MASK),BIT_MASK); //4
|
||||
//and_tmp = vandq_u8((uint8x16_t)tmp4,BIT_MASK); print_bytes("and:",and_tmp);
|
||||
//and_tmp = vandq_u8((uint8x16_t)tmp4,BIT_MASK); print_bytes("and:",and_tmp);
|
||||
//print_bytes("o:",(uint8_t*)(o_128-1));
|
||||
|
||||
|
||||
temp1 = vzipq_u8(tmp1,tmp1);
|
||||
tmp2 = temp1.val[1];
|
||||
temp2 = vzipq_u16((uint16x8_t)tmp2,(uint16x8_t)tmp2);
|
||||
@@ -379,52 +351,41 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
temp3 = vzipq_u32((uint32x4_t)tmp3,(uint32x4_t)tmp3);
|
||||
tmp4 = temp3.val[0];
|
||||
//print_bytes("tmp4:",(uint8_t*)&tmp4);
|
||||
|
||||
*o_128++=vceqq_u8(vandq_u8((uint8x16_t)tmp4,BIT_MASK),BIT_MASK); //5
|
||||
//print_bytes("o:",(uint8_t*)(o_128-1));
|
||||
|
||||
tmp4 = temp3.val[1];
|
||||
//print_bytes("tmp4:",(uint8_t*)&tmp4);
|
||||
|
||||
*o_128++=vceqq_u8(vandq_u8((uint8x16_t)tmp4,BIT_MASK),BIT_MASK); //6
|
||||
//print_bytes("o:",(uint8_t*)(o_128-1));
|
||||
|
||||
|
||||
temp2 = vzipq_u16((uint16x8_t)tmp2,(uint16x8_t)tmp2);
|
||||
tmp3 = temp2.val[1];
|
||||
temp3 = vzipq_u32((uint32x4_t)tmp3,(uint32x4_t)tmp3);
|
||||
tmp4 = temp3.val[0];
|
||||
//print_bytes("tmp4:",(uint8_t*)&tmp4);
|
||||
|
||||
*o_128++=vceqq_u8(vandq_u8((uint8x16_t)tmp4,BIT_MASK),BIT_MASK); //7
|
||||
//print_bytes("o:",(uint8_t*)(o_128-1));
|
||||
|
||||
tmp4 = temp3.val[1];
|
||||
//print_bytes("tmp4:",(uint8_t*)&tmp4);
|
||||
|
||||
*o_128++=vceqq_u8(vandq_u8((uint8x16_t)tmp4,BIT_MASK),BIT_MASK); //7
|
||||
//print_bytes("o:",(uint8_t*)(o_128-1));
|
||||
|
||||
i_128++;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
short * ptr_intl=base_interleaver;
|
||||
short *ptr_intl=base_interleaver;
|
||||
#if defined(__x86_64) || defined(__i386__)
|
||||
#ifndef __AVX2__
|
||||
__m128i tmp;
|
||||
uint16_t *systematic2_ptr=(uint16_t *) output;
|
||||
uint16_t *systematic2_ptr=(uint16_t *) output;
|
||||
#else
|
||||
__m256i tmp;
|
||||
uint32_t *systematic2_ptr=(uint32_t *) output;
|
||||
uint32_t *systematic2_ptr=(uint32_t *) output;
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
uint8x16_t tmp;
|
||||
const uint8_t __attribute__ ((aligned (16))) _Powers[16]=
|
||||
{ 1, 2, 4, 8, 16, 32, 64, 128, 1, 2, 4, 8, 16, 32, 64, 128 };
|
||||
|
||||
// Set the powers of 2 (do it once for all, if applicable)
|
||||
const uint8_t __attribute__ ((aligned (16))) _Powers[16]=
|
||||
{ 1, 2, 4, 8, 16, 32, 64, 128, 1, 2, 4, 8, 16, 32, 64, 128 };
|
||||
// Set the powers of 2 (do it once for all, if applicable)
|
||||
uint8x16_t Powers= vld1q_u8(_Powers);
|
||||
uint8_t *systematic2_ptr=(uint8_t *) output;
|
||||
#endif
|
||||
@@ -435,8 +396,6 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
#endif
|
||||
|
||||
for ( i=0; i< input_length_words ; i ++ ) {
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
#ifndef __AVX2__
|
||||
tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],7);
|
||||
@@ -465,7 +424,6 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],2);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],1);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],0);
|
||||
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+7);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+6);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+5);
|
||||
@@ -474,7 +432,6 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+2);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+1);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+0);
|
||||
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+7);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+6);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+5);
|
||||
@@ -483,7 +440,6 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+2);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+1);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+0);
|
||||
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+7);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+6);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+5);
|
||||
@@ -492,7 +448,6 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+2);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+1);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+0);
|
||||
|
||||
*systematic2_ptr++=(unsigned int)_mm256_movemask_epi8(tmp);
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
@@ -512,11 +467,10 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
tmp=vsetq_lane_u8(expandInput[*ptr_intl++],tmp,8+2);
|
||||
tmp=vsetq_lane_u8(expandInput[*ptr_intl++],tmp,8+1);
|
||||
tmp=vsetq_lane_u8(expandInput[*ptr_intl++],tmp,8+0);
|
||||
// Compute the mask from the input
|
||||
// Compute the mask from the input
|
||||
uint64x2_t Mask= vpaddlq_u32(vpaddlq_u16(vpaddlq_u8(vandq_u8(tmp, Powers))));
|
||||
vst1q_lane_u8(systematic2_ptr++, (uint8x16_t)Mask, 0);
|
||||
vst1q_lane_u8(systematic2_ptr++, (uint8x16_t)Mask, 8);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -537,14 +491,12 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
void threegpplte_turbo_encoder_sse(unsigned char *input,
|
||||
unsigned short input_length_bytes,
|
||||
unsigned char *output,
|
||||
unsigned char F)
|
||||
{
|
||||
|
||||
unsigned char F) {
|
||||
int i;
|
||||
unsigned char *x;
|
||||
unsigned char state0=0,state1=0;
|
||||
unsigned short input_length_bits = input_length_bytes<<3;
|
||||
short * base_interleaver;
|
||||
short *base_interleaver;
|
||||
|
||||
if ( all_treillis_initialized == 0 ) {
|
||||
treillis_table_init();
|
||||
@@ -560,15 +512,12 @@ void threegpplte_turbo_encoder_sse(unsigned char *input,
|
||||
base_interleaver=il_tb+f1f2mat[i].beg_index;
|
||||
}
|
||||
|
||||
|
||||
unsigned char systematic2[768] __attribute__((aligned(32)));
|
||||
|
||||
interleave_compact_byte(base_interleaver,input,systematic2,input_length_bytes);
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m64 *ptr_output=(__m64*) output;
|
||||
__m64 *ptr_output=(__m64 *) output;
|
||||
#elif defined(__arm__)
|
||||
uint8x8_t *ptr_output=(uint8x8_t*)output;
|
||||
uint8x8_t *ptr_output=(uint8x8_t *)output;
|
||||
#endif
|
||||
unsigned char cur_s1, cur_s2;
|
||||
int code_rate;
|
||||
@@ -582,54 +531,45 @@ void threegpplte_turbo_encoder_sse(unsigned char *input,
|
||||
/*
|
||||
*ptr_output++ = _mm_add_pi8(all_treillis[state0][cur_s1].systematic_64[code_rate],
|
||||
_mm_add_pi8(all_treillis[state0][cur_s1].parity1_64[code_rate],
|
||||
all_treillis[state1][cur_s2].parity2_64[code_rate]));
|
||||
*/
|
||||
|
||||
all_treillis[state1][cur_s2].parity2_64[code_rate]));
|
||||
*/
|
||||
*ptr_output++ = _mm_add_pi8(all_treillis[state0][cur_s1].systematic_andp1_64[code_rate],
|
||||
all_treillis[state1][cur_s2].parity2_64[code_rate]);
|
||||
|
||||
|
||||
all_treillis[state1][cur_s2].parity2_64[code_rate]);
|
||||
#elif defined(__arm__)
|
||||
*ptr_output++ = vadd_u8(all_treillis[state0][cur_s1].systematic_andp1_64[code_rate],
|
||||
all_treillis[state0][cur_s1].parity2_64[code_rate]);
|
||||
*ptr_output++ = vadd_u8(all_treillis[state0][cur_s1].systematic_andp1_64[code_rate],
|
||||
all_treillis[state0][cur_s1].parity2_64[code_rate]);
|
||||
#endif
|
||||
}
|
||||
|
||||
state0=all_treillis[state0][cur_s1].exit_state;
|
||||
state1=all_treillis[state1][cur_s2].exit_state;
|
||||
}
|
||||
|
||||
state0=all_treillis[state0][cur_s1].exit_state;
|
||||
state1=all_treillis[state1][cur_s2].exit_state;
|
||||
}
|
||||
|
||||
x=output+(input_length_bits*3);
|
||||
|
||||
// Trellis termination
|
||||
threegpplte_rsc_termination(&x[0],&x[1],&state0);
|
||||
#ifdef DEBUG_TURBO_ENCODER
|
||||
printf("term: x0 %d, x1 %d, state0 %d\n",x[0],x[1],state0);
|
||||
printf("term: x0 %u, x1 %u, state0 %d\n",x[0],x[1],state0);
|
||||
#endif //DEBUG_TURBO_ENCODER
|
||||
|
||||
threegpplte_rsc_termination(&x[2],&x[3],&state0);
|
||||
#ifdef DEBUG_TURBO_ENCODER
|
||||
printf("term: x0 %d, x1 %d, state0 %d\n",x[2],x[3],state0);
|
||||
printf("term: x0 %u, x1 %u, state0 %d\n",x[2],x[3],state0);
|
||||
#endif //DEBUG_TURBO_ENCODER
|
||||
|
||||
threegpplte_rsc_termination(&x[4],&x[5],&state0);
|
||||
#ifdef DEBUG_TURBO_ENCODER
|
||||
printf("term: x0 %d, x1 %d, state0 %d\n",x[4],x[5],state0);
|
||||
printf("term: x0 %u, x1 %u, state0 %d\n",x[4],x[5],state0);
|
||||
#endif //DEBUG_TURBO_ENCODER
|
||||
|
||||
threegpplte_rsc_termination(&x[6],&x[7],&state1);
|
||||
|
||||
#ifdef DEBUG_TURBO_ENCODER
|
||||
printf("term: x0 %d, x1 %d, state1 %d\n",x[6],x[7],state1);
|
||||
printf("term: x0 %u, x1 %u, state1 %d\n",x[6],x[7],state1);
|
||||
#endif //DEBUG_TURBO_ENCODER
|
||||
threegpplte_rsc_termination(&x[8],&x[9],&state1);
|
||||
#ifdef DEBUG_TURBO_ENCODER
|
||||
printf("term: x0 %d, x1 %d, state1 %d\n",x[8],x[9],state1);
|
||||
printf("term: x0 %u, x1 %u, state1 %d\n",x[8],x[9],state1);
|
||||
#endif //DEBUG_TURBO_ENCODER
|
||||
threegpplte_rsc_termination(&x[10],&x[11],&state1);
|
||||
|
||||
#ifdef DEBUG_TURBO_ENCODER
|
||||
printf("term: x0 %d, x1 %d, state1 %d\n",x[10],x[11],state1);
|
||||
printf("term: x0 %u, x1 %u, state1 %d\n",x[10],x[11],state1);
|
||||
#endif //DEBUG_TURBO_ENCODER
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
_mm_empty();
|
||||
@@ -638,32 +578,31 @@ void threegpplte_turbo_encoder_sse(unsigned char *input,
|
||||
}
|
||||
|
||||
void init_encoder_sse (void) {
|
||||
treillis_table_init();
|
||||
treillis_table_init();
|
||||
}
|
||||
/* function which will be called by the shared lib loader, to check shared lib version
|
||||
against main exec version. version mismatch no considered as fatal (interfaces not supposed to change)
|
||||
*/
|
||||
int coding_checkbuildver(char * mainexec_buildversion, char ** shlib_buildversion)
|
||||
{
|
||||
*/
|
||||
int coding_checkbuildver(char *mainexec_buildversion, char **shlib_buildversion) {
|
||||
#ifndef PACKAGE_VERSION
|
||||
#define PACKAGE_VERSION "standalone built: " __DATE__ __TIME__
|
||||
#endif
|
||||
*shlib_buildversion = PACKAGE_VERSION;
|
||||
if (strcmp(mainexec_buildversion, *shlib_buildversion) != 0) {
|
||||
fprintf(stderr,"[CODING] shared lib version %s, doesn't match main version %s, compatibility should be checked\n",
|
||||
mainexec_buildversion,*shlib_buildversion);
|
||||
}
|
||||
return 0;
|
||||
*shlib_buildversion = PACKAGE_VERSION;
|
||||
|
||||
if (strcmp(mainexec_buildversion, *shlib_buildversion) != 0) {
|
||||
fprintf(stderr,"[CODING] shared lib version %s, doesn't match main version %s, compatibility should be checked\n",
|
||||
mainexec_buildversion,*shlib_buildversion);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef TC_MAIN
|
||||
#define INPUT_LENGTH 20
|
||||
#define INPUT_LENGTH 20
|
||||
#define F1 21
|
||||
#define F2 120
|
||||
|
||||
int main(int argc,char **argv)
|
||||
{
|
||||
|
||||
int main(int argc,char **argv) {
|
||||
unsigned char input[INPUT_LENGTH+32],state,state2;
|
||||
unsigned char output[12+(3*(INPUT_LENGTH<<3))],x,z;
|
||||
int i;
|
||||
@@ -680,28 +619,27 @@ int main(int argc,char **argv)
|
||||
printf("\n");
|
||||
|
||||
for (state=0; state<8; state++) {
|
||||
|
||||
state2=state;
|
||||
threegpplte_rsc_termination(&x,&z,&state2);
|
||||
printf("Termination: (%d->%d) : (%d,%d)\n",state,state2,x,z);
|
||||
}
|
||||
|
||||
memset((void*)input,0,INPUT_LENGTH+16);
|
||||
memset((void *)input,0,INPUT_LENGTH+16);
|
||||
|
||||
for (i=0; i<INPUT_LENGTH; i++) {
|
||||
input[i] = i*219;
|
||||
printf("Input %d : %d\n",i,input[i]);
|
||||
printf("Input %d : %u\n",i,input[i]);
|
||||
}
|
||||
|
||||
threegpplte_turbo_encoder_sse(&input[0],
|
||||
INPUT_LENGTH,
|
||||
&output[0],
|
||||
0);
|
||||
INPUT_LENGTH,
|
||||
&output[0],
|
||||
0);
|
||||
|
||||
for (i=0; i<12+(INPUT_LENGTH*24); i++)
|
||||
printf("%u",output[i]);
|
||||
|
||||
for (i=0;i<12+(INPUT_LENGTH*24);i++)
|
||||
printf("%d",output[i]);
|
||||
printf("\n");
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,27 +47,20 @@ void
|
||||
ccodedot11_encode (unsigned int numbytes,
|
||||
unsigned char *inPtr,
|
||||
unsigned char *outPtr,
|
||||
unsigned char puncturing)
|
||||
{
|
||||
unsigned char puncturing) {
|
||||
unsigned int state;
|
||||
|
||||
unsigned char c, out, shiftbit =0;
|
||||
|
||||
// printf("In ccodedot11_encode (%d,%p,%p,%d)\n",numbytes,inPtr,outPtr,puncturing);
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
unsigned int dummy;
|
||||
#endif //DEBUG_CCODE
|
||||
int bit_index;
|
||||
|
||||
/* The input bit is shifted in position 8 of the state.
|
||||
Shiftbit will take values between 1 and 8 */
|
||||
state = 0;
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
dummy = 0;
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
/* Do not increment inPtr until we read the next octet */
|
||||
bit_index=0;
|
||||
|
||||
@@ -78,85 +71,75 @@ ccodedot11_encode (unsigned int numbytes,
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
switch (puncturing) {
|
||||
case 0: //rate 1/2
|
||||
for (shiftbit = 0; shiftbit<8; shiftbit++) {
|
||||
case 0: //rate 1/2
|
||||
for (shiftbit = 0; shiftbit<8; shiftbit++) {
|
||||
state >>= 1;
|
||||
|
||||
state >>= 1;
|
||||
if ((c&(1<<shiftbit)) != 0) {
|
||||
state |= 64;
|
||||
}
|
||||
|
||||
if ((c&(1<<shiftbit)) != 0) {
|
||||
state |= 64;
|
||||
out = ccodedot11_table[state];
|
||||
*outPtr++ = out & 1;
|
||||
*outPtr++ = (out>>1)&1;
|
||||
#ifdef DEBUG_CCODE
|
||||
printf("%u: %u -> %d (%u)\n",dummy,state,out,ccodedot11_table[state]);
|
||||
dummy+=2;
|
||||
#endif //DEBUG_CCODE
|
||||
}
|
||||
|
||||
out = ccodedot11_table[state];
|
||||
break;
|
||||
|
||||
*outPtr++ = out & 1;
|
||||
*outPtr++ = (out>>1)&1;
|
||||
case 1: // rate 3/4
|
||||
for (shiftbit = 0; shiftbit<8; shiftbit++) {
|
||||
state >>= 1;
|
||||
|
||||
if ((c&(1<<shiftbit)) != 0) {
|
||||
state |= 64;
|
||||
}
|
||||
|
||||
out = ccodedot11_table[state];
|
||||
|
||||
if (bit_index<2)
|
||||
*outPtr++ = out & 1;
|
||||
|
||||
if (bit_index!=1)
|
||||
*outPtr++ = (out>>1)&1;
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
printf("%d: %d -> %d (%d)\n",dummy,state,out,ccodedot11_table[state]);
|
||||
dummy+=2;
|
||||
printf("%u: %u -> %d (%u)\n",dummy,state,out,ccodedot11_table[state]);
|
||||
dummy+=2;
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1: // rate 3/4
|
||||
for (shiftbit = 0; shiftbit<8; shiftbit++) {
|
||||
|
||||
state >>= 1;
|
||||
|
||||
if ((c&(1<<shiftbit)) != 0) {
|
||||
state |= 64;
|
||||
bit_index=(bit_index==2)?0:(bit_index+1);
|
||||
}
|
||||
|
||||
out = ccodedot11_table[state];
|
||||
break;
|
||||
|
||||
if (bit_index<2)
|
||||
case 2: // rate 2/3
|
||||
for (shiftbit = 0; shiftbit<8; shiftbit++) {
|
||||
state >>= 1;
|
||||
|
||||
if ((c&(1<<shiftbit)) != 0) {
|
||||
state |= 64;
|
||||
}
|
||||
|
||||
out = ccodedot11_table[state];
|
||||
*outPtr++ = out & 1;
|
||||
|
||||
if (bit_index!=1)
|
||||
*outPtr++ = (out>>1)&1;
|
||||
if (bit_index==0)
|
||||
*outPtr++ = (out>>1)&1;
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
printf("%d: %d -> %d (%d)\n",dummy,state,out,ccodedot11_table[state]);
|
||||
dummy+=2;
|
||||
printf("%d: %u -> %d (%u)\n",dummy,state,out,ccodedot11_table[state]);
|
||||
dummy+=2;
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
bit_index=(bit_index==2)?0:(bit_index+1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2: // rate 2/3
|
||||
for (shiftbit = 0; shiftbit<8; shiftbit++) {
|
||||
|
||||
state >>= 1;
|
||||
|
||||
if ((c&(1<<shiftbit)) != 0) {
|
||||
state |= 64;
|
||||
bit_index=(bit_index==0)?1:0;
|
||||
}
|
||||
|
||||
out = ccodedot11_table[state];
|
||||
break;
|
||||
|
||||
*outPtr++ = out & 1;
|
||||
|
||||
if (bit_index==0)
|
||||
*outPtr++ = (out>>1)&1;
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
printf("%d: %d -> %d (%d)\n",dummy,state,out,ccodedot11_table[state]);
|
||||
dummy+=2;
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
bit_index=(bit_index==0)?1:0;
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,8 +164,6 @@ ccodedot11_encode (unsigned int numbytes,
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -197,8 +178,7 @@ ccodedot11_encode (unsigned int numbytes,
|
||||
/* Basic code table initialization for constraint length 7 */
|
||||
/* Input in MSB, followed by state in 6 LSBs */
|
||||
|
||||
void ccodedot11_init(void)
|
||||
{
|
||||
void ccodedot11_init(void) {
|
||||
unsigned int i, j, k, sum;
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
@@ -219,8 +199,7 @@ void ccodedot11_init(void)
|
||||
}
|
||||
|
||||
/* Input in LSB, followed by state in 6 MSBs */
|
||||
void ccodedot11_init_inv(void)
|
||||
{
|
||||
void ccodedot11_init_inv(void) {
|
||||
unsigned int i, j, k, sum;
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
@@ -251,21 +230,15 @@ void ccodedot11_init_inv(void)
|
||||
#ifdef DEBUG_CCODE
|
||||
#include <stdio.h>
|
||||
|
||||
main()
|
||||
{
|
||||
main() {
|
||||
unsigned char test[] = "0Thebigredfox";
|
||||
unsigned char output[512], *inPtr, *outPtr;
|
||||
unsigned int i;
|
||||
|
||||
test[0] = 128;
|
||||
test[1] = 0;
|
||||
|
||||
|
||||
ccodedot11_init();
|
||||
|
||||
inPtr = test;
|
||||
outPtr = output;
|
||||
|
||||
ccodedot11_encode(16, inPtr, outPtr,0);
|
||||
|
||||
for (i = 0; i < 32; i++) printf("%x ", output[i]);
|
||||
|
||||
@@ -52,20 +52,16 @@ ccodelte_encode (int32_t numbits,
|
||||
uint8_t add_crc,
|
||||
uint8_t *inPtr,
|
||||
uint8_t *outPtr,
|
||||
uint16_t rnti)
|
||||
{
|
||||
uint16_t rnti) {
|
||||
uint32_t state;
|
||||
|
||||
uint8_t c, out, first_bit;
|
||||
int8_t shiftbit=0;
|
||||
uint16_t c16;
|
||||
uint16_t next_last_byte=0;
|
||||
uint32_t crc=0;
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
uint32_t dummy=0;
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
/* The input bit is shifted in position 8 of the state.
|
||||
Shiftbit will take values between 1 and 8 */
|
||||
state = 0;
|
||||
@@ -137,17 +133,12 @@ ccodelte_encode (int32_t numbits,
|
||||
#endif //DEBUG_CCODE
|
||||
/* Do not increment inPtr until we read the next octet */
|
||||
|
||||
|
||||
|
||||
|
||||
while (numbits > 0) {
|
||||
|
||||
c = *inPtr++;
|
||||
#ifdef DEBUG_CCODE
|
||||
printf("** %x **\n",c);
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
|
||||
// for (shiftbit = 0; (shiftbit<8) && (numbits>0);shiftbit++,numbits--) {
|
||||
for (shiftbit = 7; (shiftbit>=0) && (numbits>0); shiftbit--,numbits--) {
|
||||
state >>= 1;
|
||||
@@ -157,23 +148,18 @@ ccodelte_encode (int32_t numbits,
|
||||
}
|
||||
|
||||
out = ccodelte_table[state];
|
||||
|
||||
*outPtr++ = out & 1;
|
||||
*outPtr++ = (out>>1)&1;
|
||||
*outPtr++ = (out>>2)&1;
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
printf("numbits %d, input %d, outbit %d: %d -> %d (%d%d%d)\n",numbits,state>>6,dummy,state,out,out&1,(out>>1)&1,(out>>2)&1);
|
||||
dummy+=3;
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// now code 8-bit CRC for UCI
|
||||
if (add_crc == 1) {
|
||||
|
||||
c = (uint8_t)(crc>>24);
|
||||
|
||||
// for (shiftbit = 0; (shiftbit<8);shiftbit++) {
|
||||
@@ -185,22 +171,18 @@ ccodelte_encode (int32_t numbits,
|
||||
}
|
||||
|
||||
out = ccodelte_table[state];
|
||||
|
||||
*outPtr++ = out & 1;
|
||||
*outPtr++ = (out>>1)&1;
|
||||
*outPtr++ = (out>>2)&1;
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
printf("crc bit %d input %d, outbit %d: %d -> %d (%d)\n",shiftbit,state>>6,dummy,state,out,ccodelte_table[state]);
|
||||
printf("crc bit %d input %d, outbit %d: %d -> %d (%u)\n",shiftbit,state>>6,dummy,state,out,ccodelte_table[state]);
|
||||
dummy+=3;
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// now code 16-bit CRC for DCI
|
||||
if (add_crc == 2) {
|
||||
|
||||
c16 = (uint16_t)(crc>>16);
|
||||
|
||||
// for (shiftbit = 0; (shiftbit<16);shiftbit++) {
|
||||
@@ -212,16 +194,13 @@ ccodelte_encode (int32_t numbits,
|
||||
}
|
||||
|
||||
out = ccodelte_table[state];
|
||||
|
||||
*outPtr++ = out & 1;
|
||||
*outPtr++ = (out>>1)&1;
|
||||
*outPtr++ = (out>>2)&1;
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
printf("crc bit %d input %d, outbit %d: %d -> %d (%d)\n",shiftbit,state>>6,dummy,state,out,ccodelte_table[state]);
|
||||
printf("crc bit %d input %d, outbit %d: %d -> %d (%u)\n",shiftbit,state>>6,dummy,state,out,ccodelte_table[state]);
|
||||
dummy+=3;
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -238,8 +217,7 @@ ccodelte_encode (int32_t numbits,
|
||||
/* Basic code table initialization for constraint length 7 */
|
||||
/* Input in MSB, followed by state in 6 LSBs */
|
||||
|
||||
void ccodelte_init(void)
|
||||
{
|
||||
void ccodelte_init(void) {
|
||||
unsigned int i, j, k, sum;
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
@@ -260,8 +238,7 @@ void ccodelte_init(void)
|
||||
}
|
||||
|
||||
/* Input in LSB, followed by state in 6 MSBs */
|
||||
void ccodelte_init_inv(void)
|
||||
{
|
||||
void ccodelte_init_inv(void) {
|
||||
unsigned int i, j, k, sum;
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
@@ -281,8 +258,7 @@ void ccodelte_init_inv(void)
|
||||
}
|
||||
}
|
||||
|
||||
void ccodedab_init(void)
|
||||
{
|
||||
void ccodedab_init(void) {
|
||||
unsigned int i, j, k, sum;
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
@@ -303,8 +279,7 @@ void ccodedab_init(void)
|
||||
}
|
||||
|
||||
/* Input in LSB, followed by state in 6 MSBs */
|
||||
void ccodedab_init_inv(void)
|
||||
{
|
||||
void ccodedab_init_inv(void) {
|
||||
unsigned int i, j, k, sum;
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
@@ -334,21 +309,15 @@ void ccodedab_init_inv(void)
|
||||
#ifdef CCODE_MAIN
|
||||
#include <stdio.h>
|
||||
|
||||
main()
|
||||
{
|
||||
main() {
|
||||
unsigned char test[] = "Thebigredfox";
|
||||
unsigned char output[512], *inPtr, *outPtr;
|
||||
unsigned int i;
|
||||
|
||||
test[0] = 128;
|
||||
test[1] = 0;
|
||||
|
||||
|
||||
ccodelte_init();
|
||||
|
||||
inPtr = test;
|
||||
outPtr = output;
|
||||
|
||||
ccodelte_encode(21, inPtr, outPtr);
|
||||
|
||||
for (i = 0; i < 21*3; i++) printf("%x ", output[i]);
|
||||
|
||||
@@ -32,21 +32,6 @@
|
||||
|
||||
#include "PHY/types.h"
|
||||
|
||||
// For initialization && verification purposes, bit by bit implementation with any polynomial
|
||||
// The first bit is in the MSB of each byte
|
||||
|
||||
// Reference 38.212 V15.1.1 Section 5.1 (36-212 v8.6.0 , pp 8-9)
|
||||
// The highest degree is set by default
|
||||
/** 1000 0110 0100 1100 1111 1011 D^24 + D^23 + D^18 + D^17 + D^14 + D^11 + D^10 + D^7 + D^6 + D^5 + D^4 + D^3 + D + 1 */
|
||||
static const uint32_t poly24a = 0x864cfb00;
|
||||
/** 1000 0000 0000 0000 0110 0011 D^24 + D^23 + D^6 + D^5 + D + 1 */
|
||||
static const uint32_t poly24b = 0x80006300;
|
||||
/** 0001 0000 0010 0001 D^16 + D^12 + D^5 + 1 */
|
||||
static const uint32_t poly16 = 0x10210000;
|
||||
/** 1000 0000 1111 D^12 + D^11 + D^3 + D^2 + D + 1 */
|
||||
static const uint32_t poly12 = 0x80F00000;
|
||||
/** 1001 1011 D^8 + D^7 + D^4 + D^3 + D + 1 */
|
||||
static const uint32_t poly8 = 0x9B000000;
|
||||
|
||||
// The following arrays are generated with the function 'crcTableInit'
|
||||
/** Encoding table for CRC 24A */
|
||||
@@ -96,6 +81,24 @@ uint32_t crcbit (uint8_t * inputptr, int32_t octetlen, uint32_t poly)
|
||||
// CRC table initialization
|
||||
|
||||
/*
|
||||
RK: Note that this should be brought back and use crcTableInit instead of static declaration
|
||||
Commented out to remove warning
|
||||
// For initialization && verification purposes, bit by bit implementation with any polynomial
|
||||
// The first bit is in the MSB of each byte
|
||||
|
||||
// Reference 38.212 V15.1.1 Section 5.1 (36-212 v8.6.0 , pp 8-9)
|
||||
// The highest degree is set by default
|
||||
// 1000 0110 0100 1100 1111 1011 D^24 + D^23 + D^18 + D^17 + D^14 + D^11 + D^10 + D^7 + D^6 + D^5 + D^4 + D^3 + D + 1
|
||||
static const uint32_t poly24a = 0x864cfb00;
|
||||
// 1000 0000 0000 0000 0110 0011 D^24 + D^23 + D^6 + D^5 + D + 1
|
||||
static const uint32_t poly24b = 0x80006300;
|
||||
// 0001 0000 0010 0001 D^16 + D^12 + D^5 + 1
|
||||
static const uint32_t poly16 = 0x10210000;
|
||||
// 1000 0000 1111 D^12 + D^11 + D^3 + D^2 + D + 1
|
||||
static const uint32_t poly12 = 0x80F00000;
|
||||
// 1001 1011 D^8 + D^7 + D^4 + D^3 + D + 1
|
||||
static const uint32_t poly8 = 0x9B000000;
|
||||
|
||||
void crcTableInit (void)
|
||||
{
|
||||
uint8_t c = 0;
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
date: 21.10.2009
|
||||
*/
|
||||
#ifdef MAIN
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_common.h"
|
||||
@@ -42,9 +42,7 @@ static uint32_t bitrev_cc[32] = {1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31,0,16
|
||||
//#define RM_DEBUG2 1
|
||||
//#define RM_DEBUG_CC 1
|
||||
|
||||
uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
{
|
||||
|
||||
uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w) {
|
||||
uint32_t RTC = (D>>5), ND, ND3;
|
||||
uint32_t row,col,Kpi;
|
||||
uint32_t index3,k,k2;
|
||||
@@ -64,7 +62,6 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
printf("RTC = %d, Kpi=%d, ND=%d\n",RTC,Kpi,ND);
|
||||
#endif
|
||||
ND3 = ND*3;
|
||||
|
||||
// copy d02 to dD2 (for mod Kpi operation from clause (4), p.16 of 36.212
|
||||
d[(3*D)+2] = d[2];
|
||||
k=0;
|
||||
@@ -80,12 +77,9 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
index3 = bitrev_x3[col];//3*index;
|
||||
|
||||
for (row=0; row<RTC; row++) {
|
||||
|
||||
w[k] = d1[index3];//d[index3-ND3];
|
||||
w[Kpi+k2] = d2[index3];//d[index3-ND3+1];
|
||||
w[Kpi+1+k2] = d3[index3];//d[index3-ND3+5];
|
||||
|
||||
|
||||
#ifdef RM_DEBUG
|
||||
printf("row %d, index %d, index-Nd %d index-Nd+1 %d (k,Kpi+2k,Kpi+2k+1) (%d,%d,%d) w(%d,%d,%d)\n",row,index,index-ND,((index+1)%Kpi)-ND,k,Kpi+(k<<1),Kpi+(k<<1)+1,w[k],w[Kpi+(k<<1)],w[Kpi+1+(k<<1)]);
|
||||
|
||||
@@ -100,7 +94,8 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
|
||||
#endif
|
||||
index3+=96;
|
||||
k++;k2+=2;
|
||||
k++;
|
||||
k2+=2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,9 +115,7 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
}
|
||||
|
||||
|
||||
uint32_t sub_block_interleaving_cc(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
{
|
||||
|
||||
uint32_t sub_block_interleaving_cc(uint32_t D, uint8_t *d,uint8_t *w) {
|
||||
uint32_t RCC = (D>>5), ND, ND3;
|
||||
uint32_t row,col,Kpi,index;
|
||||
uint32_t index3,k;
|
||||
@@ -141,7 +134,6 @@ uint32_t sub_block_interleaving_cc(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
printf("RCC = %d, Kpi=%d, ND=%d\n",RCC,Kpi,ND);
|
||||
#endif
|
||||
ND3 = ND*3;
|
||||
|
||||
k=0;
|
||||
|
||||
for (col=0; col<32; col++) {
|
||||
@@ -180,9 +172,7 @@ uint32_t sub_block_interleaving_cc(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
return(RCC);
|
||||
}
|
||||
|
||||
void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w)
|
||||
{
|
||||
|
||||
void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w) {
|
||||
uint32_t RTC = (D>>5), ND, ND3;
|
||||
uint32_t row,col,Kpi,index;
|
||||
uint32_t index3,k,k2;
|
||||
@@ -199,7 +189,6 @@ void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w)
|
||||
printf("RTC = %d, Kpi=%d, ND=%d\n",RTC,Kpi,ND);
|
||||
#endif
|
||||
ND3 = ND*3;
|
||||
|
||||
// copy d02 to dD2 (for mod Kpi operation from clause (4), p.16 of 36.212
|
||||
k=0;
|
||||
k2=0;
|
||||
@@ -215,7 +204,6 @@ void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w)
|
||||
index3 = bitrev_x3[col];//3*index;
|
||||
|
||||
for (row=0; row<RTC; row++) {
|
||||
|
||||
d1[index3] = w[k];
|
||||
d2[index3] = w[Kpi+k2];
|
||||
d3[index3] = w[Kpi+1+k2];
|
||||
@@ -229,12 +217,9 @@ void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w)
|
||||
|
||||
// if (ND>0)
|
||||
// d[2] = LTE_NULL;//d[(3*D)+2];
|
||||
|
||||
}
|
||||
|
||||
void sub_block_deinterleaving_cc(uint32_t D,int8_t *d,int8_t *w)
|
||||
{
|
||||
|
||||
void sub_block_deinterleaving_cc(uint32_t D,int8_t *d,int8_t *w) {
|
||||
//WANG_Hao uint32_t RCC = (D>>5), ND, ND3;
|
||||
uint32_t RCC = (D>>5);
|
||||
ptrdiff_t ND, ND3;
|
||||
@@ -251,10 +236,9 @@ void sub_block_deinterleaving_cc(uint32_t D,int8_t *d,int8_t *w)
|
||||
ND = Kpi - D;
|
||||
#ifdef RM_DEBUG2
|
||||
printf("sub_block_interleaving_cc : D = %d (%d), d %p, w %p\n",D,D*3,d,w);
|
||||
printf("RCC = %d, Kpi=%d, ND=%d\n",RCC,Kpi,ND);
|
||||
printf("RCC = %d, Kpi=%d, ND=%ld\n",RCC,Kpi,ND);
|
||||
#endif
|
||||
ND3 = ND*3;
|
||||
|
||||
k=0;
|
||||
|
||||
for (col=0; col<32; col++) {
|
||||
@@ -265,24 +249,20 @@ void sub_block_deinterleaving_cc(uint32_t D,int8_t *d,int8_t *w)
|
||||
index3 = 3*index;
|
||||
|
||||
for (row=0; row<RCC; row++) {
|
||||
|
||||
d[index3-ND3] = w[k];
|
||||
d[index3-ND3+1] = w[Kpi+k];
|
||||
d[index3-ND3+2] = w[(Kpi<<1)+k];
|
||||
#ifdef RM_DEBUG2
|
||||
printf("row %d, index %d k %d index3-ND3 %d w(%d,%d,%d)\n",row,index,k,index3-ND3,w[k],w[Kpi+k],w[(Kpi<<1)+k]);
|
||||
printf("row %d, index %d k %d index3-ND3 %ld w(%d,%d,%d)\n",row,index,k,index3-ND3,w[k],w[Kpi+k],w[(Kpi<<1)+k]);
|
||||
#endif
|
||||
index3+=96;
|
||||
index+=32;
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
uint32_t generate_dummy_w(uint32_t D, uint8_t *w,uint8_t F)
|
||||
{
|
||||
|
||||
uint32_t generate_dummy_w(uint32_t D, uint8_t *w,uint8_t F) {
|
||||
uint32_t RTC = (D>>5), ND;
|
||||
uint32_t col,Kpi,index;
|
||||
int32_t k,k2;
|
||||
@@ -301,8 +281,6 @@ uint32_t generate_dummy_w(uint32_t D, uint8_t *w,uint8_t F)
|
||||
printf("dummy sub_block_interleaving_turbo : D = %d (%d)\n",D,D*3);
|
||||
printf("RTC = %d, Kpi=%d, ND=%d, F=%d (Nulled %d)\n",RTC,Kpi,ND,F,(2*F + 3*ND));
|
||||
#endif
|
||||
|
||||
|
||||
k=0;
|
||||
k2=0;
|
||||
wKpi = &w[Kpi];
|
||||
@@ -371,9 +349,7 @@ uint32_t generate_dummy_w(uint32_t D, uint8_t *w,uint8_t F)
|
||||
return(RTC);
|
||||
}
|
||||
|
||||
uint32_t generate_dummy_w_cc(uint32_t D, uint8_t *w)
|
||||
{
|
||||
|
||||
uint32_t generate_dummy_w_cc(uint32_t D, uint8_t *w) {
|
||||
uint32_t RCC = (D>>5), ND;
|
||||
uint32_t col,Kpi,index;
|
||||
int32_t k;
|
||||
@@ -392,7 +368,6 @@ uint32_t generate_dummy_w_cc(uint32_t D, uint8_t *w)
|
||||
printf("RCC = %d, Kpi=%d, ND=%d, (Nulled %d)\n",RCC,Kpi,ND,3*ND);
|
||||
#endif
|
||||
// ND3 = ND*3;
|
||||
|
||||
// copy d02 to dD2 (for mod Kpi operation from clause (4), p.16 of 36.212
|
||||
k=0;
|
||||
|
||||
@@ -466,8 +441,6 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
|
||||
uint8_t nb_rb)
|
||||
// uint8_t m)
|
||||
{
|
||||
|
||||
|
||||
uint32_t Nir,Ncb,Gp,GpmodC,E,Ncbmod,ind,k;
|
||||
// int cnt=0;
|
||||
uint8_t *e2;
|
||||
@@ -487,11 +460,11 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
|
||||
if (Mdlharq>0) { // Downlink
|
||||
Nir = Nsoft/Kmimo/cmin(8,Mdlharq);
|
||||
Ncb = cmin(Nir/C,3*(RTC<<5));
|
||||
}
|
||||
else { // Uplink
|
||||
} else { // Uplink
|
||||
Nir=0;
|
||||
Ncb = 3*(RTC<<5); // Kw
|
||||
}
|
||||
|
||||
#ifdef RM_DEBUG_TX
|
||||
|
||||
if (rvidx==0 && r==0) {
|
||||
@@ -518,9 +491,8 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
|
||||
AssertFatal(Qm>0,"Qm is 0\n");
|
||||
Gp = G/Nl/Qm;
|
||||
GpmodC = Gp%C;
|
||||
|
||||
#ifdef RM_DEBUG
|
||||
printf("lte_rate_matching_turbo: Ncb %d, Kw %d, Nir/C %d, rvidx %d, G %d, Qm %d, Nl%d, r %d\n",Ncb,3*(RTC<<5),Nir/C,rvidx, G, Qm,Nl,r);
|
||||
LOG_D(PHY,"lte_rate_matching_turbo: Ncb %d, Kw %d, Nir/C %d, rvidx %d, G %d, Qm %d, Nl%d, r %d\n",Ncb,3*(RTC<<5),Nir/C,rvidx, G, Qm,Nl,r);
|
||||
#endif
|
||||
|
||||
if (r < (C-(GpmodC)))
|
||||
@@ -529,16 +501,12 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
|
||||
E = Nl*Qm * ((GpmodC==0?0:1) + (Gp/C));
|
||||
|
||||
Ncbmod = Ncb%(RTC<<3);
|
||||
|
||||
ind = RTC * (2+(rvidx*(((Ncbmod==0)?0:1) + (Ncb/(RTC<<3)))*2));
|
||||
|
||||
#ifdef RM_DEBUG_TX
|
||||
printf("lte_rate_matching_turbo: E %d, k0 %d, Ncbmod %d, Ncb/(RTC<<3) %d\n",E,ind,Ncbmod,Ncb/(RTC<<3));
|
||||
#endif
|
||||
|
||||
//e2=e+(r*E);
|
||||
e2 = e;
|
||||
|
||||
k=0;
|
||||
|
||||
for (; (ind<Ncb)&&(k<E); ind++) {
|
||||
@@ -633,25 +601,16 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
|
||||
uint32_t lte_rate_matching_cc(uint32_t RCC,
|
||||
uint16_t E,
|
||||
uint8_t *w,
|
||||
uint8_t *e)
|
||||
{
|
||||
|
||||
|
||||
uint8_t *e) {
|
||||
uint32_t ind=0,k;
|
||||
|
||||
uint16_t Kw = 3*(RCC<<5);
|
||||
|
||||
#ifdef RM_DEBUG_CC
|
||||
uint32_t nulled=0;
|
||||
|
||||
printf("lte_rate_matching_cc: Kw %d, E %d\n",Kw, E);
|
||||
#endif
|
||||
|
||||
for (k=0; k<E; k++) {
|
||||
|
||||
|
||||
while(w[ind] == LTE_NULL) {
|
||||
|
||||
#ifdef RM_DEBUG_CC
|
||||
nulled++;
|
||||
printf("RM_TX_CC : ind %d, NULL\n",ind);
|
||||
@@ -662,7 +621,6 @@ uint32_t lte_rate_matching_cc(uint32_t RCC,
|
||||
ind=0;
|
||||
}
|
||||
|
||||
|
||||
e[k] = w[ind];
|
||||
#ifdef RM_DEBUG_CC
|
||||
// printf("k %d ind %d, w %c(%d)\n",k,ind,w[ind],w[ind]);
|
||||
@@ -695,10 +653,7 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
|
||||
uint8_t Qm,
|
||||
uint8_t Nl,
|
||||
uint8_t r,
|
||||
uint32_t *E_out)
|
||||
{
|
||||
|
||||
|
||||
uint32_t *E_out) {
|
||||
uint32_t Nir,Ncb,Gp,GpmodC,E,Ncbmod,ind,k;
|
||||
int16_t *soft_input2;
|
||||
// int32_t w_tmp;
|
||||
@@ -708,15 +663,14 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
|
||||
|
||||
if (Kmimo==0 || C==0 || Qm==0 || Nl==0) {
|
||||
printf("lte_rate_matching.c: invalid parameters (Kmimo %d, Mdlharq %d, C %d, Qm %d, Nl %d\n",
|
||||
Kmimo,Mdlharq,C,Qm,Nl);
|
||||
Kmimo,Mdlharq,C,Qm,Nl);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (Mdlharq>0) { // Downlink
|
||||
Nir = Nsoft/Kmimo/cmin(8,Mdlharq);
|
||||
Ncb = cmin(Nir/C,3*(RTC<<5));
|
||||
}
|
||||
else { // Uplink
|
||||
} else { // Uplink
|
||||
Nir=0;
|
||||
Ncb = 3*(RTC<<5);
|
||||
}
|
||||
@@ -726,17 +680,13 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
|
||||
Gp = G/Nl/Qm;
|
||||
GpmodC = Gp%C;
|
||||
|
||||
|
||||
|
||||
if (r < (C-(GpmodC)))
|
||||
E = Nl*Qm * (Gp/C);
|
||||
else
|
||||
E = Nl*Qm * ((GpmodC==0?0:1) + (Gp/C));
|
||||
|
||||
Ncbmod = Ncb%(RTC<<3);
|
||||
|
||||
ind = RTC * (2+(rvidx*(((Ncbmod==0)?0:1) + (Ncb/(RTC<<3)))*2));
|
||||
|
||||
#ifdef RM_DEBUG
|
||||
printf("lte_rate_matching_turbo_rx: Clear %d, E %d, Ncb %d, Kw %d, rvidx %d, G %d, Qm %d, Nl%d, r %d\n",clear,E,Ncb,3*(RTC<<5),rvidx, G, Qm,Nl,r);
|
||||
#endif
|
||||
@@ -751,8 +701,8 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
|
||||
if (dummy_w[ind] != LTE_NULL) {
|
||||
/*
|
||||
if ((w[ind]>0 && soft_input2[k]<0) ||
|
||||
(w[ind]<0 && soft_input2[k]>0))
|
||||
printf("ind %d: w %d => soft_in %d\n",ind,w[ind],soft_input2[k]);*/
|
||||
(w[ind]<0 && soft_input2[k]>0))
|
||||
printf("ind %d: w %d => soft_in %d\n",ind,w[ind],soft_input2[k]);*/
|
||||
w[ind] += soft_input2[k++];
|
||||
#ifdef RM_DEBUG
|
||||
printf("RM_RX k%d Ind: %d (%d)\n",k-1,ind,w[ind]);
|
||||
@@ -831,10 +781,8 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
|
||||
ind=0;
|
||||
}
|
||||
*/
|
||||
|
||||
*E_out = E;
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -842,28 +790,19 @@ void lte_rate_matching_cc_rx(uint32_t RCC,
|
||||
uint16_t E,
|
||||
int8_t *w,
|
||||
uint8_t *dummy_w,
|
||||
int8_t *soft_input)
|
||||
{
|
||||
|
||||
|
||||
|
||||
int8_t *soft_input) {
|
||||
uint32_t ind=0,k;
|
||||
uint16_t Kw = 3*(RCC<<5);
|
||||
uint32_t acc=1;
|
||||
int16_t w16[Kw];
|
||||
#ifdef RM_DEBUG_CC
|
||||
uint32_t nulled=0;
|
||||
|
||||
printf("lte_rate_matching_cc_rx: Kw %d, E %d, w %p, soft_input %p\n",3*(RCC<<5),E,w,soft_input);
|
||||
#endif
|
||||
|
||||
|
||||
memset(w,0,Kw);
|
||||
memset(w16,0,Kw*sizeof(int16_t));
|
||||
|
||||
for (k=0; k<E; k++) {
|
||||
|
||||
|
||||
while(dummy_w[ind] == LTE_NULL) {
|
||||
#ifdef RM_DEBUG_CC
|
||||
nulled++;
|
||||
@@ -883,10 +822,7 @@ void lte_rate_matching_cc_rx(uint32_t RCC,
|
||||
#ifdef RM_DEBUG_CC
|
||||
printf("RM_RX_CC k %d (%d) ind: %d (%d)\n",k,soft_input[k],ind,w16[ind]);
|
||||
#endif
|
||||
|
||||
|
||||
w16[ind] += soft_input[k];
|
||||
|
||||
ind++;
|
||||
|
||||
if (ind==Kw) {
|
||||
@@ -907,7 +843,6 @@ void lte_rate_matching_cc_rx(uint32_t RCC,
|
||||
}
|
||||
|
||||
#ifdef RM_DEBUG_CC
|
||||
|
||||
printf("Nulled %d\n",nulled);
|
||||
#endif
|
||||
}
|
||||
@@ -915,8 +850,7 @@ void lte_rate_matching_cc_rx(uint32_t RCC,
|
||||
|
||||
#ifdef MAIN
|
||||
|
||||
void main()
|
||||
{
|
||||
void main() {
|
||||
uint8_t d[96+3+(3*6144)];
|
||||
uint8_t w[3*6144],e[12*6144];
|
||||
uint32_t RTC,G,rvidx;
|
||||
@@ -924,7 +858,6 @@ void main()
|
||||
uint32_t mod_order = 4;
|
||||
uint32_t first_dlsch_symbol = 2;
|
||||
uint32_t i;
|
||||
|
||||
G = ( nb_rb * (12 * mod_order) * (12-first_dlsch_symbol-3)) ;//( nb_rb * (12 * mod_order) * (14-first_dlsch_symbol-3)) :
|
||||
|
||||
// initialize 96 first positions to "LTE_NULL"
|
||||
|
||||
@@ -38,9 +38,7 @@ int lte_segmentation(unsigned char *input_buffer,
|
||||
unsigned int *Cminus,
|
||||
unsigned int *Kplus,
|
||||
unsigned int *Kminus,
|
||||
unsigned int *F)
|
||||
{
|
||||
|
||||
unsigned int *F) {
|
||||
unsigned int L,Bprime,Bprime_by_C,r,Kr,k,s,crc;
|
||||
|
||||
if (B<=6144) {
|
||||
@@ -56,19 +54,19 @@ int lte_segmentation(unsigned char *input_buffer,
|
||||
|
||||
Bprime = B+((*C)*L);
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("Bprime %d\n",Bprime);
|
||||
printf("Bprime %u\n",Bprime);
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((*C)>MAX_NUM_DLSCH_SEGMENTS) {
|
||||
LOG_E(PHY,"lte_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime);
|
||||
LOG_E(PHY,"lte_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// Find K+
|
||||
Bprime_by_C = Bprime/(*C);
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("Bprime_by_C %d\n",Bprime_by_C);
|
||||
printf("Bprime_by_C %u\n",Bprime_by_C);
|
||||
#endif
|
||||
// Bprime = Bprime_by_C>>3;
|
||||
|
||||
@@ -93,17 +91,16 @@ int lte_segmentation(unsigned char *input_buffer,
|
||||
|
||||
*Kminus = (*Kplus - 32);
|
||||
} else if (Bprime_by_C <=6144 ) { // increase by 8 bytes til here
|
||||
|
||||
*Kplus = (Bprime_by_C>>6)<<6;
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("Bprime_by_C_by_C %d , Kplus %d\n",Bprime_by_C,*Kplus);
|
||||
printf("Bprime_by_C_by_C %u , Kplus %u\n",Bprime_by_C,*Kplus);
|
||||
#endif
|
||||
|
||||
if (*Kplus < Bprime_by_C)
|
||||
*Kplus = *Kplus + 64;
|
||||
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("Bprime_by_C_by_C %d , Kplus2 %d\n",Bprime_by_C,*Kplus);
|
||||
printf("Bprime_by_C_by_C %u , Kplus2 %u\n",Bprime_by_C,*Kplus);
|
||||
#endif
|
||||
*Kminus = (*Kplus - 64);
|
||||
} else {
|
||||
@@ -116,25 +113,21 @@ int lte_segmentation(unsigned char *input_buffer,
|
||||
*Kminus = 0;
|
||||
*Cminus = 0;
|
||||
} else {
|
||||
|
||||
// printf("More than one segment (%d), exiting \n",*C);
|
||||
// exit(-1);
|
||||
*Cminus = ((*C)*(*Kplus) - (Bprime))/((*Kplus) - (*Kminus));
|
||||
*Cplus = (*C) - (*Cminus);
|
||||
}
|
||||
|
||||
|
||||
AssertFatal(Bprime <= (*Cplus)*(*Kplus) + (*Cminus)*(*Kminus),
|
||||
"Bprime %d < (*Cplus %d)*(*Kplus %d) + (*Cminus %d)*(*Kminus %d)\n",
|
||||
Bprime,*Cplus,*Kplus,*Cminus,*Kminus);
|
||||
|
||||
"Bprime %d < (*Cplus %d)*(*Kplus %d) + (*Cminus %d)*(*Kminus %d)\n",
|
||||
Bprime,*Cplus,*Kplus,*Cminus,*Kminus);
|
||||
*F = ((*Cplus)*(*Kplus) + (*Cminus)*(*Kminus) - (Bprime));
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("C %d, Cplus %d, Cminus %d, Kplus %d, Kminus %d, Bprime_bytes %d, Bprime %d, F %d\n",*C,*Cplus,*Cminus,*Kplus,*Kminus,Bprime>>3,Bprime,*F);
|
||||
printf("C %u, Cplus %u, Cminus %u, Kplus %u, Kminus %u, Bprime_bytes %u, Bprime %u, F %u\n",*C,*Cplus,*Cminus,*Kplus,*Kminus,Bprime>>3,Bprime,*F);
|
||||
#endif
|
||||
|
||||
if ((input_buffer) && (output_buffers)) {
|
||||
|
||||
for (k=0; k<*F>>3; k++) {
|
||||
output_buffers[0][k] = 0;
|
||||
}
|
||||
@@ -142,7 +135,6 @@ int lte_segmentation(unsigned char *input_buffer,
|
||||
s=0;
|
||||
|
||||
for (r=0; r<*C; r++) {
|
||||
|
||||
if (r<*Cminus)
|
||||
Kr = *Kminus;
|
||||
else
|
||||
@@ -150,18 +142,18 @@ int lte_segmentation(unsigned char *input_buffer,
|
||||
|
||||
while (k<((Kr - L)>>3)) {
|
||||
output_buffers[r][k] = input_buffer[s];
|
||||
// printf("encoding segment %d : byte %d (%d) => %d\n",r,k,Kr>>3,input_buffer[s]);
|
||||
// printf("encoding segment %d : byte %d (%d) => %d\n",r,k,Kr>>3,input_buffer[s]);
|
||||
k++;
|
||||
s++;
|
||||
}
|
||||
|
||||
if (*C > 1) { // add CRC
|
||||
crc = crc24b(output_buffers[r],Kr-24)>>8;
|
||||
output_buffers[r][(Kr-24)>>3] = ((uint8_t*)&crc)[2];
|
||||
output_buffers[r][1+((Kr-24)>>3)] = ((uint8_t*)&crc)[1];
|
||||
output_buffers[r][2+((Kr-24)>>3)] = ((uint8_t*)&crc)[0];
|
||||
output_buffers[r][(Kr-24)>>3] = ((uint8_t *)&crc)[2];
|
||||
output_buffers[r][1+((Kr-24)>>3)] = ((uint8_t *)&crc)[1];
|
||||
output_buffers[r][2+((Kr-24)>>3)] = ((uint8_t *)&crc)[0];
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("Segment %d : CRC %x\n",r,crc);
|
||||
printf("Segment %u : CRC %x\n",r,crc);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -175,9 +167,7 @@ int lte_segmentation(unsigned char *input_buffer,
|
||||
|
||||
|
||||
#ifdef MAIN
|
||||
main()
|
||||
{
|
||||
|
||||
main() {
|
||||
unsigned int Kplus,Kminus,C,Cplus,Cminus,F,Bbytes;
|
||||
|
||||
for (Bbytes=5; Bbytes<2*768; Bbytes++) {
|
||||
|
||||
@@ -40,12 +40,14 @@ extern int32_t get_uldl_offset(int eutra_bandP);
|
||||
|
||||
extern uint16_t prach_root_sequence_map0_3[838];
|
||||
extern uint16_t prach_root_sequence_map4[138];
|
||||
uint8_t dmrs1_tab[8] = {0,2,3,4,6,8,9,10};
|
||||
uint8_t dmrs1_tab[8] = { 0, 2, 3, 4, 6, 8, 9, 10 };
|
||||
|
||||
|
||||
int N_RB_DL_array[6] = {6,15,25,50,75,100};
|
||||
int N_RB_DL_array[6] = { 6, 15, 25, 50, 75, 100 };
|
||||
|
||||
int l1_north_init_eNB() {
|
||||
int
|
||||
l1_north_init_eNB ()
|
||||
{
|
||||
|
||||
int i,j;
|
||||
|
||||
@@ -85,8 +87,8 @@ int l1_north_init_eNB() {
|
||||
|
||||
void phy_config_request(PHY_Config_t *phy_config) {
|
||||
|
||||
uint8_t Mod_id = phy_config->Mod_id;
|
||||
int CC_id = phy_config->CC_id;
|
||||
uint8_t Mod_id = phy_config->Mod_id;
|
||||
int CC_id = phy_config->CC_id;
|
||||
nfapi_config_request_t *cfg = phy_config->cfg;
|
||||
|
||||
|
||||
@@ -105,9 +107,9 @@ void phy_config_request(PHY_Config_t *phy_config) {
|
||||
cfg->phich_config.phich_resource.value,
|
||||
cfg->phich_config.phich_duration.value);
|
||||
|
||||
AssertFatal(RC.eNB != NULL, "PHY instance pointer doesn't exist\n");
|
||||
AssertFatal(RC.eNB[Mod_id] != NULL, "PHY instance %d doesn't exist\n",Mod_id);
|
||||
AssertFatal(RC.eNB[Mod_id][CC_id] != NULL, "PHY instance %d, CCid %d doesn't exist\n",Mod_id,CC_id);
|
||||
AssertFatal (RC.eNB != NULL, "PHY instance pointer doesn't exist\n");
|
||||
AssertFatal (RC.eNB[Mod_id] != NULL, "PHY instance %d doesn't exist\n", Mod_id);
|
||||
AssertFatal (RC.eNB[Mod_id][CC_id] != NULL, "PHY instance %d, CCid %d doesn't exist\n", Mod_id, CC_id);
|
||||
|
||||
|
||||
if (RC.eNB[Mod_id][CC_id]->configured == 1)
|
||||
@@ -116,7 +118,7 @@ void phy_config_request(PHY_Config_t *phy_config) {
|
||||
return;
|
||||
}
|
||||
|
||||
RC.eNB[Mod_id][CC_id]->mac_enabled = 1;
|
||||
RC.eNB[Mod_id][CC_id]->mac_enabled = 1;
|
||||
|
||||
fp = &RC.eNB[Mod_id][CC_id]->frame_parms;
|
||||
|
||||
@@ -129,164 +131,157 @@ void phy_config_request(PHY_Config_t *phy_config) {
|
||||
fp->Ncp_UL = Ncp;
|
||||
fp->nb_antenna_ports_eNB = p_eNB;
|
||||
|
||||
fp->threequarter_fs = 0;
|
||||
fp->threequarter_fs = 0;
|
||||
|
||||
AssertFatal(cfg->phich_config.phich_resource.value<4, "Illegal phich_Resource\n");
|
||||
AssertFatal (cfg->phich_config.phich_resource.value < 4, "Illegal phich_Resource\n");
|
||||
|
||||
fp->phich_config_common.phich_resource = phich_resource_table[cfg->phich_config.phich_resource.value];
|
||||
fp->phich_config_common.phich_duration = cfg->phich_config.phich_duration.value;
|
||||
// Note: "from_earfcn" has to be in a common library with MACRLC
|
||||
fp->dl_CarrierFreq = from_earfcn(eutra_band,dl_CarrierFreq);
|
||||
fp->ul_CarrierFreq = fp->dl_CarrierFreq - (get_uldl_offset(eutra_band)*100000);
|
||||
fp->dl_CarrierFreq = from_earfcn (eutra_band, dl_CarrierFreq);
|
||||
fp->ul_CarrierFreq = fp->dl_CarrierFreq - (get_uldl_offset (eutra_band) * 100000);
|
||||
|
||||
fp->tdd_config = 0;
|
||||
fp->tdd_config_S = 0;
|
||||
fp->tdd_config = 0;
|
||||
fp->tdd_config_S = 0;
|
||||
|
||||
if (fp->dl_CarrierFreq==fp->ul_CarrierFreq)
|
||||
if (fp->dl_CarrierFreq == fp->ul_CarrierFreq)
|
||||
fp->frame_type = TDD;
|
||||
else
|
||||
fp->frame_type = FDD;
|
||||
|
||||
init_frame_parms(fp,1);
|
||||
init_lte_top(fp);
|
||||
init_frame_parms (fp, 1);
|
||||
init_lte_top (fp);
|
||||
|
||||
if (cfg->subframe_config.duplex_mode.value == 0) {
|
||||
fp->tdd_config = cfg->tdd_frame_structure_config.subframe_assignment.value;
|
||||
fp->tdd_config_S = cfg->tdd_frame_structure_config.special_subframe_patterns.value;
|
||||
fp->frame_type = TDD;
|
||||
}
|
||||
else {
|
||||
fp->frame_type = FDD;
|
||||
fp->tdd_config = cfg->tdd_frame_structure_config.subframe_assignment.value;
|
||||
fp->tdd_config_S = cfg->tdd_frame_structure_config.special_subframe_patterns.value;
|
||||
fp->frame_type = TDD;
|
||||
} else {
|
||||
fp->frame_type = FDD;
|
||||
}
|
||||
|
||||
fp->prach_config_common.rootSequenceIndex = cfg->prach_config.root_sequence_index.value;
|
||||
LOG_I(PHY,"prach_config_common.rootSequenceIndex = %d\n",cfg->prach_config.root_sequence_index.value);
|
||||
fp->prach_config_common.rootSequenceIndex = cfg->prach_config.root_sequence_index.value;
|
||||
LOG_I (PHY, "prach_config_common.rootSequenceIndex = %d\n", cfg->prach_config.root_sequence_index.value);
|
||||
|
||||
fp->prach_config_common.prach_Config_enabled=1;
|
||||
fp->prach_config_common.prach_Config_enabled = 1;
|
||||
|
||||
fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =cfg->prach_config.configuration_index.value;
|
||||
LOG_I(PHY,"prach_config_common.prach_ConfigInfo.prach_ConfigIndex = %d\n",cfg->prach_config.configuration_index.value);
|
||||
fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex = cfg->prach_config.configuration_index.value;
|
||||
LOG_I (PHY, "prach_config_common.prach_ConfigInfo.prach_ConfigIndex = %d\n", cfg->prach_config.configuration_index.value);
|
||||
|
||||
fp->prach_config_common.prach_ConfigInfo.highSpeedFlag =cfg->prach_config.high_speed_flag.value;
|
||||
LOG_I(PHY,"prach_config_common.prach_ConfigInfo.highSpeedFlag = %d\n",cfg->prach_config.high_speed_flag.value);
|
||||
fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =cfg->prach_config.zero_correlation_zone_configuration.value;
|
||||
LOG_I(PHY,"prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig = %d\n",cfg->prach_config.zero_correlation_zone_configuration.value);
|
||||
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset =cfg->prach_config.frequency_offset.value;
|
||||
LOG_I(PHY,"prach_config_common.prach_ConfigInfo.prach_FreqOffset = %d\n",cfg->prach_config.frequency_offset.value);
|
||||
fp->prach_config_common.prach_ConfigInfo.highSpeedFlag = cfg->prach_config.high_speed_flag.value;
|
||||
LOG_I (PHY, "prach_config_common.prach_ConfigInfo.highSpeedFlag = %d\n", cfg->prach_config.high_speed_flag.value);
|
||||
fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig = cfg->prach_config.zero_correlation_zone_configuration.value;
|
||||
LOG_I (PHY, "prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig = %d\n", cfg->prach_config.zero_correlation_zone_configuration.value);
|
||||
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset = cfg->prach_config.frequency_offset.value;
|
||||
LOG_I (PHY, "prach_config_common.prach_ConfigInfo.prach_FreqOffset = %d\n", cfg->prach_config.frequency_offset.value);
|
||||
|
||||
init_prach_tables (839);
|
||||
compute_prach_seq (fp->prach_config_common.rootSequenceIndex,
|
||||
fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
|
||||
fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, fp->prach_config_common.prach_ConfigInfo.highSpeedFlag, fp->frame_type, RC.eNB[Mod_id][CC_id]->X_u);
|
||||
|
||||
init_prach_tables(839);
|
||||
compute_prach_seq(fp->prach_config_common.rootSequenceIndex,
|
||||
fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
|
||||
fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
|
||||
fp->prach_config_common.prach_ConfigInfo.highSpeedFlag,
|
||||
fp->frame_type,
|
||||
RC.eNB[Mod_id][CC_id]->X_u);
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
fp->prach_emtc_config_common.prach_Config_enabled=1;
|
||||
if (cfg->emtc_config.prach_ce_level_0_enable.value == 1) {
|
||||
fp->prach_emtc_config_common.prach_Config_enabled = 1;
|
||||
|
||||
fp->prach_emtc_config_common.rootSequenceIndex = cfg->emtc_config.prach_catm_root_sequence_index.value;
|
||||
fp->prach_emtc_config_common.rootSequenceIndex = cfg->emtc_config.prach_catm_root_sequence_index.value;
|
||||
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag = cfg->emtc_config.prach_catm_high_speed_flag.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig = cfg->emtc_config.prach_catm_zero_correlation_zone_configuration.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag = cfg->emtc_config.prach_catm_high_speed_flag.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig = cfg->emtc_config.prach_catm_zero_correlation_zone_configuration.value;
|
||||
|
||||
// CE Level 3 parameters
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[3] = cfg->emtc_config.prach_ce_level_3_enable.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[3] = cfg->emtc_config.prach_ce_level_3_starting_subframe_periodicity.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[3] = cfg->emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt.value;
|
||||
AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[3]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[3],
|
||||
"prach_starting_subframe_periodicity[3] < prach_numPetitionPerPreambleAttempt[3]\n");
|
||||
// CE Level 3 parameters
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[3] = cfg->emtc_config.prach_ce_level_3_enable.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[3] = cfg->emtc_config.prach_ce_level_3_starting_subframe_periodicity.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[3] = cfg->emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt.value;
|
||||
AssertFatal (fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[3] >= fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[3],
|
||||
"prach_starting_subframe_periodicity[3] < prach_numPetitionPerPreambleAttempt[3]\n");
|
||||
|
||||
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3] = cfg->emtc_config.prach_ce_level_3_configuration_index.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[3] = cfg->emtc_config.prach_ce_level_3_frequency_offset.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[3] = cfg->emtc_config.prach_ce_level_3_hopping_enable.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[3] = cfg->emtc_config.prach_ce_level_3_hopping_offset.value;
|
||||
if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[3] == 1)
|
||||
compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag,
|
||||
fp->frame_type,
|
||||
RC.eNB[Mod_id][CC_id]->X_u_br[3]);
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3] = cfg->emtc_config.prach_ce_level_3_configuration_index.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[3] = cfg->emtc_config.prach_ce_level_3_frequency_offset.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[3] = cfg->emtc_config.prach_ce_level_3_hopping_enable.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[3] = cfg->emtc_config.prach_ce_level_3_hopping_offset.value;
|
||||
if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[3] == 1)
|
||||
compute_prach_seq (fp->prach_emtc_config_common.rootSequenceIndex,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, fp->frame_type, RC.eNB[Mod_id][CC_id]->X_u_br[3]);
|
||||
|
||||
// CE Level 2 parameters
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[2] = cfg->emtc_config.prach_ce_level_2_enable.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[2] = cfg->emtc_config.prach_ce_level_2_starting_subframe_periodicity.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[2] = cfg->emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt.value;
|
||||
AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[2]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[2],
|
||||
"prach_starting_subframe_periodicity[2] < prach_numPetitionPerPreambleAttempt[2]\n");
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[2] = cfg->emtc_config.prach_ce_level_2_configuration_index.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[2] = cfg->emtc_config.prach_ce_level_2_frequency_offset.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[2] = cfg->emtc_config.prach_ce_level_2_hopping_enable.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[2] = cfg->emtc_config.prach_ce_level_2_hopping_offset.value;
|
||||
if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[2] == 1)
|
||||
compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag,
|
||||
fp->frame_type,
|
||||
RC.eNB[Mod_id][CC_id]->X_u_br[2]);
|
||||
// CE Level 2 parameters
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[2] = cfg->emtc_config.prach_ce_level_2_enable.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[2] = cfg->emtc_config.prach_ce_level_2_starting_subframe_periodicity.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[2] = cfg->emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt.value;
|
||||
AssertFatal (fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[2] >= fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[2],
|
||||
"prach_starting_subframe_periodicity[2] < prach_numPetitionPerPreambleAttempt[2]\n");
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[2] = cfg->emtc_config.prach_ce_level_2_configuration_index.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[2] = cfg->emtc_config.prach_ce_level_2_frequency_offset.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[2] = cfg->emtc_config.prach_ce_level_2_hopping_enable.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[2] = cfg->emtc_config.prach_ce_level_2_hopping_offset.value;
|
||||
if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[2] == 1)
|
||||
compute_prach_seq (fp->prach_emtc_config_common.rootSequenceIndex,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, fp->frame_type, RC.eNB[Mod_id][CC_id]->X_u_br[2]);
|
||||
|
||||
// CE Level 1 parameters
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[1] = cfg->emtc_config.prach_ce_level_1_enable.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[1] = cfg->emtc_config.prach_ce_level_1_starting_subframe_periodicity.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[1] = cfg->emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt.value;
|
||||
AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[1]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[1],
|
||||
"prach_starting_subframe_periodicity[1] < prach_numPetitionPerPreambleAttempt[1]\n");
|
||||
// CE Level 1 parameters
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[1] = cfg->emtc_config.prach_ce_level_1_enable.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[1] = cfg->emtc_config.prach_ce_level_1_starting_subframe_periodicity.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[1] = cfg->emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt.value;
|
||||
AssertFatal (fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[1] >= fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[1],
|
||||
"prach_starting_subframe_periodicity[1] < prach_numPetitionPerPreambleAttempt[1]\n");
|
||||
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[1] = cfg->emtc_config.prach_ce_level_1_configuration_index.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[1] = cfg->emtc_config.prach_ce_level_1_frequency_offset.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[1] = cfg->emtc_config.prach_ce_level_1_hopping_enable.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[1] = cfg->emtc_config.prach_ce_level_1_hopping_offset.value;
|
||||
if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[1] == 1)
|
||||
compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag,
|
||||
fp->frame_type,
|
||||
RC.eNB[Mod_id][CC_id]->X_u_br[1]);
|
||||
|
||||
// CE Level 0 parameters
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] = cfg->emtc_config.prach_ce_level_0_enable.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0] = cfg->emtc_config.prach_ce_level_0_starting_subframe_periodicity.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] = cfg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.value;
|
||||
AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0],
|
||||
"prach_starting_subframe_periodicity[0] %d < prach_numPetitionPerPreambleAttempt[0] %d\n",
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0],
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]);
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[1] = cfg->emtc_config.prach_ce_level_1_configuration_index.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[1] = cfg->emtc_config.prach_ce_level_1_frequency_offset.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[1] = cfg->emtc_config.prach_ce_level_1_hopping_enable.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[1] = cfg->emtc_config.prach_ce_level_1_hopping_offset.value;
|
||||
if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[1] == 1)
|
||||
compute_prach_seq (fp->prach_emtc_config_common.rootSequenceIndex,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, fp->frame_type, RC.eNB[Mod_id][CC_id]->X_u_br[1]);
|
||||
|
||||
// CE Level 0 parameters
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] = cfg->emtc_config.prach_ce_level_0_enable.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0] = cfg->emtc_config.prach_ce_level_0_starting_subframe_periodicity.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] = cfg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.value;
|
||||
AssertFatal (fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0] >= fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0],
|
||||
"prach_starting_subframe_periodicity[0] %d < prach_numPetitionPerPreambleAttempt[0] %d\n",
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0], fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]);
|
||||
AssertFatal (fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] > 0, "prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]==0\n");
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[0] = cfg->emtc_config.prach_ce_level_0_configuration_index.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[0] = cfg->emtc_config.prach_ce_level_0_frequency_offset.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[0] = cfg->emtc_config.prach_ce_level_0_hopping_enable.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[0] = cfg->emtc_config.prach_ce_level_0_hopping_offset.value;
|
||||
if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] == 1) {
|
||||
compute_prach_seq (fp->prach_emtc_config_common.rootSequenceIndex,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, fp->frame_type, RC.eNB[Mod_id][CC_id]->X_u_br[0]);
|
||||
init_mpdcch(RC.eNB[Mod_id][CC_id]);
|
||||
}
|
||||
}
|
||||
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[0] = cfg->emtc_config.prach_ce_level_0_configuration_index.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[0] = cfg->emtc_config.prach_ce_level_0_frequency_offset.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[0] = cfg->emtc_config.prach_ce_level_0_hopping_enable.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[0] = cfg->emtc_config.prach_ce_level_0_hopping_offset.value;
|
||||
if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] == 1)
|
||||
compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag,
|
||||
fp->frame_type,
|
||||
RC.eNB[Mod_id][CC_id]->X_u_br[0]);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
fp->pucch_config_common.deltaPUCCH_Shift = 1+cfg->pucch_config.delta_pucch_shift.value;
|
||||
fp->pucch_config_common.nRB_CQI = cfg->pucch_config.n_cqi_rb.value;
|
||||
fp->pucch_config_common.nCS_AN = cfg->pucch_config.n_an_cs.value;
|
||||
fp->pucch_config_common.n1PUCCH_AN = cfg->pucch_config.n1_pucch_an.value;
|
||||
fp->pucch_config_common.deltaPUCCH_Shift = 1 + cfg->pucch_config.delta_pucch_shift.value;
|
||||
fp->pucch_config_common.nRB_CQI = cfg->pucch_config.n_cqi_rb.value;
|
||||
fp->pucch_config_common.nCS_AN = cfg->pucch_config.n_an_cs.value;
|
||||
fp->pucch_config_common.n1PUCCH_AN = cfg->pucch_config.n1_pucch_an.value;
|
||||
|
||||
fp->pdsch_config_common.referenceSignalPower = cfg->rf_config.reference_signal_power.value;
|
||||
fp->pdsch_config_common.p_b = cfg->subframe_config.pb.value;
|
||||
fp->pdsch_config_common.referenceSignalPower = cfg->rf_config.reference_signal_power.value;
|
||||
fp->pdsch_config_common.p_b = cfg->subframe_config.pb.value;
|
||||
|
||||
fp->pusch_config_common.n_SB = cfg->pusch_config.number_of_subbands.value;
|
||||
LOG_I(PHY,"pusch_config_common.n_SB = %d\n",fp->pusch_config_common.n_SB );
|
||||
fp->pusch_config_common.n_SB = cfg->pusch_config.number_of_subbands.value;
|
||||
LOG_I (PHY, "pusch_config_common.n_SB = %d\n", fp->pusch_config_common.n_SB);
|
||||
|
||||
fp->pusch_config_common.hoppingMode = cfg->pusch_config.hopping_mode.value;
|
||||
LOG_I(PHY,"pusch_config_common.hoppingMode = %d\n",fp->pusch_config_common.hoppingMode);
|
||||
fp->pusch_config_common.hoppingMode = cfg->pusch_config.hopping_mode.value;
|
||||
LOG_I (PHY, "pusch_config_common.hoppingMode = %d\n", fp->pusch_config_common.hoppingMode);
|
||||
|
||||
fp->pusch_config_common.pusch_HoppingOffset = cfg->pusch_config.hopping_offset.value;
|
||||
LOG_I(PHY,"pusch_config_common.pusch_HoppingOffset = %d\n",fp->pusch_config_common.pusch_HoppingOffset);
|
||||
fp->pusch_config_common.pusch_HoppingOffset = cfg->pusch_config.hopping_offset.value;
|
||||
LOG_I (PHY, "pusch_config_common.pusch_HoppingOffset = %d\n", fp->pusch_config_common.pusch_HoppingOffset);
|
||||
|
||||
fp->pusch_config_common.enable64QAM = 0;//radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM;
|
||||
LOG_I(PHY,"pusch_config_common.enable64QAM = %d\n",fp->pusch_config_common.enable64QAM );
|
||||
@@ -300,29 +295,30 @@ void phy_config_request(PHY_Config_t *phy_config) {
|
||||
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = cfg->uplink_reference_signal_config.group_assignment.value;
|
||||
LOG_I(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH);
|
||||
|
||||
LOG_I(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled);
|
||||
LOG_I (PHY, "pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = %d\n", fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled);
|
||||
|
||||
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = dmrs1_tab[cfg->uplink_reference_signal_config.cyclic_shift_1_for_drms.value];
|
||||
LOG_I(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift);
|
||||
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = dmrs1_tab[cfg->uplink_reference_signal_config.cyclic_shift_1_for_drms.value];
|
||||
LOG_I (PHY, "pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = %d\n", fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift);
|
||||
|
||||
init_ul_hopping(fp);
|
||||
init_ul_hopping (fp);
|
||||
|
||||
fp->soundingrs_ul_config_common.enabled_flag = 0;// 1; Don't know how to turn this off in NFAPI
|
||||
fp->soundingrs_ul_config_common.srs_BandwidthConfig = cfg->srs_config.bandwidth_configuration.value;
|
||||
fp->soundingrs_ul_config_common.srs_SubframeConfig = cfg->srs_config.srs_subframe_configuration.value;
|
||||
fp->soundingrs_ul_config_common.enabled_flag = 0; // 1; Don't know how to turn this off in NFAPI
|
||||
fp->soundingrs_ul_config_common.srs_BandwidthConfig = cfg->srs_config.bandwidth_configuration.value;
|
||||
fp->soundingrs_ul_config_common.srs_SubframeConfig = cfg->srs_config.srs_subframe_configuration.value;
|
||||
fp->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = cfg->srs_config.srs_acknack_srs_simultaneous_transmission.value;
|
||||
fp->soundingrs_ul_config_common.srs_MaxUpPts = cfg->srs_config.max_up_pts.value;
|
||||
fp->soundingrs_ul_config_common.srs_MaxUpPts = cfg->srs_config.max_up_pts.value;
|
||||
|
||||
fp->num_MBSFN_config = 0;
|
||||
|
||||
init_ncs_cell(fp,RC.eNB[Mod_id][CC_id]->ncs_cell);
|
||||
init_ncs_cell (fp, RC.eNB[Mod_id][CC_id]->ncs_cell);
|
||||
|
||||
|
||||
init_ul_hopping(fp);
|
||||
RC.eNB[Mod_id][CC_id]->configured = 1;
|
||||
LOG_I(PHY,"eNB %d/%d configured\n",Mod_id,CC_id);
|
||||
init_ul_hopping (fp);
|
||||
RC.eNB[Mod_id][CC_id]->configured = 1;
|
||||
LOG_I (PHY, "eNB %d/%d configured\n", Mod_id, CC_id);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void phy_config_sib2_eNB(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
@@ -406,9 +402,9 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
|
||||
fp->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
|
||||
|
||||
if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts)
|
||||
fp->soundingrs_ul_config_common.srs_MaxUpPts = 1;
|
||||
fp->soundingrs_ul_config_common.srs_MaxUpPts = 1;
|
||||
else
|
||||
fp->soundingrs_ul_config_common.srs_MaxUpPts = 0;
|
||||
fp->soundingrs_ul_config_common.srs_MaxUpPts = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -438,16 +434,15 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
|
||||
if (mbsfn_SubframeConfigList != NULL) {
|
||||
fp->num_MBSFN_config = mbsfn_SubframeConfigList->list.count;
|
||||
|
||||
for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) {
|
||||
for (i = 0; i < mbsfn_SubframeConfigList->list.count; i++) {
|
||||
fp->MBSFN_config[i].radioframeAllocationPeriod = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationPeriod;
|
||||
fp->MBSFN_config[i].radioframeAllocationOffset = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationOffset;
|
||||
|
||||
if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) {
|
||||
fp->MBSFN_config[i].fourFrames_flag = 0;
|
||||
fp->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
|
||||
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i,
|
||||
fp->MBSFN_config[i].mbsfn_SubframeConfig);
|
||||
} else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
|
||||
fp->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
|
||||
LOG_I (PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i, fp->MBSFN_config[i].mbsfn_SubframeConfig);
|
||||
} else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
|
||||
fp->MBSFN_config[i].fourFrames_flag = 1;
|
||||
fp->MBSFN_config[i].mbsfn_SubframeConfig =
|
||||
mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]|
|
||||
@@ -466,6 +461,7 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
void phy_config_sib13_eNB(module_id_t Mod_id,int CC_id,int mbsfn_Area_idx,
|
||||
long mbsfn_AreaId_r9)
|
||||
{
|
||||
@@ -473,41 +469,43 @@ void phy_config_sib13_eNB(module_id_t Mod_id,int CC_id,int mbsfn_Area_idx,
|
||||
LTE_DL_FRAME_PARMS *fp = &RC.eNB[Mod_id][CC_id]->frame_parms;
|
||||
|
||||
|
||||
LOG_I(PHY,"[eNB%d] Applying MBSFN_Area_id %ld for index %d\n",Mod_id,mbsfn_AreaId_r9,mbsfn_Area_idx);
|
||||
LOG_I (PHY, "[eNB%d] Applying MBSFN_Area_id %ld for index %d\n", Mod_id, mbsfn_AreaId_r9, mbsfn_Area_idx);
|
||||
|
||||
if (mbsfn_Area_idx == 0) {
|
||||
fp->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
|
||||
LOG_I(PHY,"Fix me: only called when mbsfn_Area_idx == 0)\n");
|
||||
}
|
||||
|
||||
lte_gold_mbsfn(fp,RC.eNB[Mod_id][CC_id]->lte_gold_mbsfn_table,fp->Nid_cell_mbsfn);
|
||||
lte_gold_mbsfn (fp, RC.eNB[Mod_id][CC_id]->lte_gold_mbsfn_table, fp->Nid_cell_mbsfn);
|
||||
}
|
||||
|
||||
|
||||
void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
|
||||
void
|
||||
phy_config_dedicated_eNB_step2 (PHY_VARS_eNB * eNB)
|
||||
{
|
||||
uint16_t UE_id;
|
||||
struct LTE_PhysicalConfigDedicated *physicalConfigDedicated;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
struct LTE_PhysicalConfigDedicated *physicalConfigDedicated;
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
|
||||
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
|
||||
physicalConfigDedicated = eNB->physicalConfigDedicated[UE_id];
|
||||
|
||||
if (physicalConfigDedicated != NULL) {
|
||||
LOG_I(PHY,"[eNB %d] Sent physicalConfigDedicated=%p for UE %d\n",eNB->Mod_id,physicalConfigDedicated,UE_id);
|
||||
LOG_D(PHY,"------------------------------------------------------------------------\n");
|
||||
LOG_I (PHY, "[eNB %d] Sent physicalConfigDedicated=%p for UE %d\n", eNB->Mod_id, physicalConfigDedicated, UE_id);
|
||||
LOG_D (PHY, "------------------------------------------------------------------------\n");
|
||||
|
||||
if (physicalConfigDedicated->pdsch_ConfigDedicated) {
|
||||
eNB->pdsch_config_dedicated[UE_id].p_a=physicalConfigDedicated->pdsch_ConfigDedicated->p_a;
|
||||
LOG_D(PHY,"pdsch_config_dedicated.p_a %d\n",eNB->pdsch_config_dedicated[UE_id].p_a);
|
||||
LOG_D(PHY,"\n");
|
||||
eNB->pdsch_config_dedicated[UE_id].p_a = physicalConfigDedicated->pdsch_ConfigDedicated->p_a;
|
||||
LOG_D (PHY, "pdsch_config_dedicated.p_a %d\n", eNB->pdsch_config_dedicated[UE_id].p_a);
|
||||
LOG_D (PHY, "\n");
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated->pucch_ConfigDedicated) {
|
||||
if (physicalConfigDedicated->pucch_ConfigDedicated->ackNackRepetition.present==LTE_PUCCH_ConfigDedicated__ackNackRepetition_PR_release)
|
||||
eNB->pucch_config_dedicated[UE_id].ackNackRepetition=0;
|
||||
else {
|
||||
eNB->pucch_config_dedicated[UE_id].ackNackRepetition=1;
|
||||
eNB->pucch_config_dedicated[UE_id].ackNackRepetition = 1;
|
||||
}
|
||||
|
||||
if (fp->frame_type == FDD) {
|
||||
@@ -519,10 +517,10 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
|
||||
eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode = bundling;
|
||||
}
|
||||
|
||||
if ( eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode == multiplexing)
|
||||
LOG_D(PHY,"pucch_config_dedicated.tdd_AckNackFeedbackMode = multiplexing\n");
|
||||
if (eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode == multiplexing)
|
||||
LOG_D (PHY, "pucch_config_dedicated.tdd_AckNackFeedbackMode = multiplexing\n");
|
||||
else
|
||||
LOG_D(PHY,"pucch_config_dedicated.tdd_AckNackFeedbackMode = bundling\n");
|
||||
LOG_D (PHY, "pucch_config_dedicated.tdd_AckNackFeedbackMode = bundling\n");
|
||||
|
||||
}
|
||||
|
||||
@@ -542,38 +540,38 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
|
||||
if (physicalConfigDedicated->uplinkPowerControlDedicated) {
|
||||
|
||||
eNB->ul_power_control_dedicated[UE_id].p0_UE_PUSCH = physicalConfigDedicated->uplinkPowerControlDedicated->p0_UE_PUSCH;
|
||||
eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled= physicalConfigDedicated->uplinkPowerControlDedicated->deltaMCS_Enabled;
|
||||
eNB->ul_power_control_dedicated[UE_id].accumulationEnabled= physicalConfigDedicated->uplinkPowerControlDedicated->accumulationEnabled;
|
||||
eNB->ul_power_control_dedicated[UE_id].p0_UE_PUCCH= physicalConfigDedicated->uplinkPowerControlDedicated->p0_UE_PUCCH;
|
||||
eNB->ul_power_control_dedicated[UE_id].pSRS_Offset= physicalConfigDedicated->uplinkPowerControlDedicated->pSRS_Offset;
|
||||
eNB->ul_power_control_dedicated[UE_id].filterCoefficient= *physicalConfigDedicated->uplinkPowerControlDedicated->filterCoefficient;
|
||||
LOG_D(PHY,"ul_power_control_dedicated.p0_UE_PUSCH %d\n",eNB->ul_power_control_dedicated[UE_id].p0_UE_PUSCH);
|
||||
LOG_D(PHY,"ul_power_control_dedicated.deltaMCS_Enabled %d\n",eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled);
|
||||
LOG_D(PHY,"ul_power_control_dedicated.accumulationEnabled %d\n",eNB->ul_power_control_dedicated[UE_id].accumulationEnabled);
|
||||
LOG_D(PHY,"ul_power_control_dedicated.p0_UE_PUCCH %d\n",eNB->ul_power_control_dedicated[UE_id].p0_UE_PUCCH);
|
||||
LOG_D(PHY,"ul_power_control_dedicated.pSRS_Offset %d\n",eNB->ul_power_control_dedicated[UE_id].pSRS_Offset);
|
||||
LOG_D(PHY,"ul_power_control_dedicated.filterCoefficient %d\n",eNB->ul_power_control_dedicated[UE_id].filterCoefficient);
|
||||
LOG_D(PHY,"\n");
|
||||
eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled = physicalConfigDedicated->uplinkPowerControlDedicated->deltaMCS_Enabled;
|
||||
eNB->ul_power_control_dedicated[UE_id].accumulationEnabled = physicalConfigDedicated->uplinkPowerControlDedicated->accumulationEnabled;
|
||||
eNB->ul_power_control_dedicated[UE_id].p0_UE_PUCCH = physicalConfigDedicated->uplinkPowerControlDedicated->p0_UE_PUCCH;
|
||||
eNB->ul_power_control_dedicated[UE_id].pSRS_Offset = physicalConfigDedicated->uplinkPowerControlDedicated->pSRS_Offset;
|
||||
eNB->ul_power_control_dedicated[UE_id].filterCoefficient = *physicalConfigDedicated->uplinkPowerControlDedicated->filterCoefficient;
|
||||
LOG_D (PHY, "ul_power_control_dedicated.p0_UE_PUSCH %d\n", eNB->ul_power_control_dedicated[UE_id].p0_UE_PUSCH);
|
||||
LOG_D (PHY, "ul_power_control_dedicated.deltaMCS_Enabled %d\n", eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled);
|
||||
LOG_D (PHY, "ul_power_control_dedicated.accumulationEnabled %d\n", eNB->ul_power_control_dedicated[UE_id].accumulationEnabled);
|
||||
LOG_D (PHY, "ul_power_control_dedicated.p0_UE_PUCCH %d\n", eNB->ul_power_control_dedicated[UE_id].p0_UE_PUCCH);
|
||||
LOG_D (PHY, "ul_power_control_dedicated.pSRS_Offset %d\n", eNB->ul_power_control_dedicated[UE_id].pSRS_Offset);
|
||||
LOG_D (PHY, "ul_power_control_dedicated.filterCoefficient %d\n", eNB->ul_power_control_dedicated[UE_id].filterCoefficient);
|
||||
LOG_D (PHY, "\n");
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated->antennaInfo) {
|
||||
eNB->transmission_mode[UE_id] = 1+(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode);
|
||||
LOG_D(PHY,"Transmission Mode (phy_config_dedicated_eNB_step2) %d\n",eNB->transmission_mode[UE_id]);
|
||||
LOG_D(PHY,"\n");
|
||||
eNB->transmission_mode[UE_id] = 1 + (physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode);
|
||||
LOG_D (PHY, "Transmission Mode (phy_config_dedicated_eNB_step2) %d\n", eNB->transmission_mode[UE_id]);
|
||||
LOG_D (PHY, "\n");
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated->schedulingRequestConfig) {
|
||||
if (physicalConfigDedicated->schedulingRequestConfig->present == LTE_SchedulingRequestConfig_PR_setup) {
|
||||
eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex = physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex;
|
||||
eNB->scheduling_request_config[UE_id].sr_ConfigIndex=physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_ConfigIndex;
|
||||
eNB->scheduling_request_config[UE_id].dsr_TransMax=physicalConfigDedicated->schedulingRequestConfig->choice.setup.dsr_TransMax;
|
||||
eNB->scheduling_request_config[UE_id].sr_ConfigIndex = physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_ConfigIndex;
|
||||
eNB->scheduling_request_config[UE_id].dsr_TransMax = physicalConfigDedicated->schedulingRequestConfig->choice.setup.dsr_TransMax;
|
||||
|
||||
LOG_D(PHY,"scheduling_request_config.sr_PUCCH_ResourceIndex %d\n",eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex);
|
||||
LOG_D(PHY,"scheduling_request_config.sr_ConfigIndex %d\n",eNB->scheduling_request_config[UE_id].sr_ConfigIndex);
|
||||
LOG_D(PHY,"scheduling_request_config.dsr_TransMax %d\n",eNB->scheduling_request_config[UE_id].dsr_TransMax);
|
||||
LOG_D (PHY, "scheduling_request_config.sr_PUCCH_ResourceIndex %d\n", eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex);
|
||||
LOG_D (PHY, "scheduling_request_config.sr_ConfigIndex %d\n", eNB->scheduling_request_config[UE_id].sr_ConfigIndex);
|
||||
LOG_D (PHY, "scheduling_request_config.dsr_TransMax %d\n", eNB->scheduling_request_config[UE_id].dsr_TransMax);
|
||||
}
|
||||
|
||||
LOG_D(PHY,"------------------------------------------------------------\n");
|
||||
LOG_D (PHY, "------------------------------------------------------------\n");
|
||||
|
||||
}
|
||||
|
||||
@@ -587,14 +585,14 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].srs_Bandwidth = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].srs_ConfigIndex = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].srs_HoppingBandwidth = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].transmissionComb = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].transmissionComb = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb;
|
||||
|
||||
|
||||
LOG_D(PHY,"soundingrs_ul_config_dedicated.srs_ConfigIndex %d\n",eNB->soundingrs_ul_config_dedicated[UE_id].srs_ConfigIndex);
|
||||
LOG_D (PHY, "soundingrs_ul_config_dedicated.srs_ConfigIndex %d\n", eNB->soundingrs_ul_config_dedicated[UE_id].srs_ConfigIndex);
|
||||
|
||||
}
|
||||
|
||||
LOG_D(PHY,"------------------------------------------------------------\n");
|
||||
LOG_D (PHY, "------------------------------------------------------------\n");
|
||||
|
||||
}
|
||||
|
||||
@@ -651,7 +649,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
|
||||
eNB->transmission_mode[UE_id] = 7;
|
||||
break;
|
||||
default:
|
||||
LOG_E(PHY,"Unknown transmission mode!\n");
|
||||
LOG_E (PHY, "Unknown transmission mode!\n");
|
||||
break;
|
||||
}
|
||||
LOG_I(PHY,"Transmission Mode (phy_config_dedicated_eNB) %d\n",eNB->transmission_mode[UE_id]);
|
||||
@@ -667,6 +665,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
|
||||
uint16_t rnti,
|
||||
@@ -716,8 +715,6 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
unsigned char is_secondary_eNB,
|
||||
unsigned char abstraction_flag)
|
||||
@@ -732,16 +729,14 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
LTE_eNB_PRACH* const prach_vars_br = &eNB->prach_vars_br;
|
||||
#endif
|
||||
int i, UE_id;
|
||||
int i, UE_id;
|
||||
|
||||
LOG_I(PHY,"[eNB %d] %s() About to wait for eNB to be configured", eNB->Mod_id, __FUNCTION__);
|
||||
|
||||
eNB->total_dlsch_bitrate = 0;
|
||||
eNB->total_transmitted_bits = 0;
|
||||
eNB->total_system_throughput = 0;
|
||||
eNB->check_for_MUMIMO_transmissions=0;
|
||||
|
||||
while(eNB->configured == 0) usleep(10000);
|
||||
eNB->check_for_MUMIMO_transmissions = 0;
|
||||
|
||||
LOG_I(PHY,"[eNB %"PRIu8"] Initializing DL_FRAME_PARMS : N_RB_DL %"PRIu8", PHICH Resource %d, PHICH Duration %d nb_antennas_tx:%u nb_antennas_rx:%u nb_antenna_ports_eNB:%u PRACH[rootSequenceIndex:%u prach_Config_enabled:%u configIndex:%u highSpeed:%u zeroCorrelationZoneConfig:%u freqOffset:%u]\n",
|
||||
eNB->Mod_id,
|
||||
@@ -757,18 +752,21 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
);
|
||||
LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_eNB][MOD %02"PRIu8"][]\n", eNB->Mod_id);
|
||||
|
||||
LOG_I (PHY, "[eNB %" PRIu8 "] Initializing DL_FRAME_PARMS : N_RB_DL %" PRIu8 ", PHICH Resource %d, PHICH Duration %d\n",
|
||||
eNB->Mod_id, fp->N_RB_DL, fp->phich_config_common.phich_resource, fp->phich_config_common.phich_duration);
|
||||
LOG_D (PHY, "[MSC_NEW][FRAME 00000][PHY_eNB][MOD %02" PRIu8 "][]\n", eNB->Mod_id);
|
||||
|
||||
lte_gold(fp,eNB->lte_gold_table,fp->Nid_cell);
|
||||
generate_pcfich_reg_mapping(fp);
|
||||
generate_phich_reg_mapping(fp);
|
||||
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
eNB->first_run_timing_advance[UE_id] =
|
||||
1; ///This flag used to be static. With multiple eNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
|
||||
|
||||
lte_gold (fp, eNB->lte_gold_table, fp->Nid_cell);
|
||||
generate_pcfich_reg_mapping (fp);
|
||||
generate_phich_reg_mapping (fp);
|
||||
|
||||
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
|
||||
eNB->first_run_timing_advance[UE_id] = 1; ///This flag used to be static. With multiple eNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
|
||||
|
||||
// clear whole structure
|
||||
bzero( &eNB->UE_stats[UE_id], sizeof(LTE_eNB_UE_stats) );
|
||||
|
||||
bzero (&eNB->UE_stats[UE_id], sizeof (LTE_eNB_UE_stats));
|
||||
|
||||
eNB->physicalConfigDedicated[UE_id] = NULL;
|
||||
}
|
||||
|
||||
@@ -791,51 +789,53 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
i,common_vars->txdataF[i],
|
||||
fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Channel estimates for SRS
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
|
||||
srs_vars[UE_id].srs_ch_estimates = (int32_t**)malloc16( 64*sizeof(int32_t*) );
|
||||
srs_vars[UE_id].srs_ch_estimates_time = (int32_t**)malloc16( 64*sizeof(int32_t*) );
|
||||
|
||||
for (i=0; i<64; i++) {
|
||||
srs_vars[UE_id].srs_ch_estimates[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size );
|
||||
srs_vars[UE_id].srs_ch_estimates_time[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
|
||||
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
|
||||
|
||||
srs_vars[UE_id].srs_ch_estimates = (int32_t **) malloc16 (64 * sizeof (int32_t *));
|
||||
srs_vars[UE_id].srs_ch_estimates_time = (int32_t **) malloc16 (64 * sizeof (int32_t *));
|
||||
|
||||
for (i = 0; i < 64; i++) {
|
||||
srs_vars[UE_id].srs_ch_estimates[i] = (int32_t *) malloc16_clear (sizeof (int32_t) * fp->ofdm_symbol_size);
|
||||
srs_vars[UE_id].srs_ch_estimates_time[i] = (int32_t *) malloc16_clear (sizeof (int32_t) * fp->ofdm_symbol_size * 2);
|
||||
}
|
||||
} //UE_id
|
||||
} //UE_id
|
||||
|
||||
|
||||
generate_ul_ref_sigs_rx();
|
||||
|
||||
init_ulsch_power_LUT();
|
||||
generate_ul_ref_sigs_rx ();
|
||||
|
||||
init_ulsch_power_LUT ();
|
||||
|
||||
// SRS
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
srs_vars[UE_id].srs = (int32_t*)malloc16_clear(2*fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
|
||||
srs_vars[UE_id].srs = (int32_t *) malloc16_clear (2 * fp->ofdm_symbol_size * sizeof (int32_t));
|
||||
}
|
||||
|
||||
// PRACH
|
||||
prach_vars->prachF = (int16_t*)malloc16_clear( 1024*2*sizeof(int16_t) );
|
||||
prach_vars->prachF = (int16_t *) malloc16_clear (1024 * 2 * sizeof (int16_t));
|
||||
|
||||
// assume maximum of 64 RX antennas for PRACH receiver
|
||||
prach_vars->prach_ifft[0] = (int32_t**)malloc16_clear(64*sizeof(int32_t*));
|
||||
for (i=0;i<64;i++) prach_vars->prach_ifft[0][i] = (int32_t*)malloc16_clear(1024*2*sizeof(int32_t));
|
||||
prach_vars->prach_ifft[0] = (int32_t **) malloc16_clear (64 * sizeof (int32_t *));
|
||||
for (i = 0; i < 64; i++)
|
||||
prach_vars->prach_ifft[0][i] = (int32_t *) malloc16_clear (1024 * 2 * sizeof (int32_t));
|
||||
|
||||
prach_vars->rxsigF[0] = (int16_t**)malloc16_clear(64*sizeof(int16_t*));
|
||||
prach_vars->rxsigF[0] = (int16_t **) malloc16_clear (64 * sizeof (int16_t *));
|
||||
// PRACH BR
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
prach_vars_br->prachF = (int16_t*)malloc16_clear( 1024*2*sizeof(int32_t) );
|
||||
|
||||
// assume maximum of 64 RX antennas for PRACH receiver
|
||||
for (int ce_level=0;ce_level<4;ce_level++) {
|
||||
prach_vars_br->prach_ifft[ce_level] = (int32_t**)malloc16_clear(64*sizeof(int32_t*));
|
||||
for (i=0;i<64;i++) prach_vars_br->prach_ifft[ce_level][i] = (int32_t*)malloc16_clear(1024*2*sizeof(int32_t));
|
||||
prach_vars->rxsigF[ce_level] = (int16_t**)malloc16_clear(64*sizeof(int16_t*));
|
||||
for (int ce_level = 0; ce_level < 4; ce_level++) {
|
||||
prach_vars_br->prach_ifft[ce_level] = (int32_t **) malloc16_clear (64 * sizeof (int32_t *));
|
||||
for (i = 0; i < 64; i++)
|
||||
prach_vars_br->prach_ifft[ce_level][i] = (int32_t *) malloc16_clear (1024 * 2 * sizeof (int32_t));
|
||||
prach_vars->rxsigF[ce_level] = (int16_t **) malloc16_clear (64 * sizeof (int16_t *));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* number of elements of an array X is computed as sizeof(X) / sizeof(X[0])
|
||||
AssertFatal(fp->nb_antennas_rx <= sizeof(prach_vars->rxsigF) / sizeof(prach_vars->rxsigF[0]),
|
||||
"nb_antennas_rx too large");
|
||||
@@ -847,20 +847,20 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
|
||||
//FIXME
|
||||
pusch_vars[UE_id] = (LTE_eNB_PUSCH*)malloc16_clear( NUMBER_OF_UE_MAX*sizeof(LTE_eNB_PUSCH) );
|
||||
|
||||
pusch_vars[UE_id]->rxdataF_ext = (int32_t**)malloc16( 2*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->rxdataF_ext2 = (int32_t**)malloc16( 2*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->drs_ch_estimates = (int32_t**)malloc16( 2*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->drs_ch_estimates_time = (int32_t**)malloc16( 2*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->rxdataF_comp = (int32_t**)malloc16( 2*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->ul_ch_mag = (int32_t**)malloc16( 2*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->ul_ch_magb = (int32_t**)malloc16( 2*sizeof(int32_t*) );
|
||||
|
||||
AssertFatal(fp->ofdm_symbol_size > 127, "fp->ofdm_symbol_size %d<128\n",fp->ofdm_symbol_size);
|
||||
AssertFatal(fp->symbols_per_tti > 11, "fp->symbols_per_tti %d < 12\n",fp->symbols_per_tti);
|
||||
AssertFatal(fp->N_RB_UL > 5, "fp->N_RB_UL %d < 6\n",fp->N_RB_UL);
|
||||
for (i=0; i<2; i++) {
|
||||
pusch_vars[UE_id] = (LTE_eNB_PUSCH *) malloc16_clear (NUMBER_OF_UE_MAX * sizeof (LTE_eNB_PUSCH));
|
||||
|
||||
pusch_vars[UE_id]->rxdataF_ext = (int32_t **) malloc16 (2 * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->rxdataF_ext2 = (int32_t **) malloc16 (2 * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->drs_ch_estimates = (int32_t **) malloc16 (2 * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->drs_ch_estimates_time = (int32_t **) malloc16 (2 * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->rxdataF_comp = (int32_t **) malloc16 (2 * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->ul_ch_mag = (int32_t **) malloc16 (2 * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->ul_ch_magb = (int32_t **) malloc16 (2 * sizeof (int32_t *));
|
||||
|
||||
AssertFatal (fp->ofdm_symbol_size > 127, "fp->ofdm_symbol_size %d<128\n", fp->ofdm_symbol_size);
|
||||
AssertFatal (fp->symbols_per_tti > 11, "fp->symbols_per_tti %d < 12\n", fp->symbols_per_tti);
|
||||
AssertFatal (fp->N_RB_UL > 5, "fp->N_RB_UL %d < 6\n", fp->N_RB_UL);
|
||||
for (i = 0; i < 2; i++) {
|
||||
// RK 2 times because of output format of FFT!
|
||||
// FIXME We should get rid of this
|
||||
pusch_vars[UE_id]->rxdataF_ext[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
@@ -875,12 +875,12 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
pusch_vars[UE_id]->llr = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||
} //UE_id
|
||||
|
||||
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++)
|
||||
|
||||
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++)
|
||||
eNB->UE_stats_ptr[UE_id] = &eNB->UE_stats[UE_id];
|
||||
|
||||
eNB->pdsch_config_dedicated->p_a = dB0; //defaul value until overwritten by RRCConnectionReconfiguration
|
||||
|
||||
|
||||
eNB->pdsch_config_dedicated->p_a = dB0; //defaul value until overwritten by RRCConnectionReconfiguration
|
||||
|
||||
|
||||
return (0);
|
||||
|
||||
|
||||
@@ -34,8 +34,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
unsigned char Ns,
|
||||
unsigned char p,
|
||||
unsigned char l,
|
||||
unsigned char symbol)
|
||||
{
|
||||
unsigned char symbol) {
|
||||
int pilot[2][200] __attribute__((aligned(16)));
|
||||
unsigned char nu,aarx;
|
||||
unsigned short k;
|
||||
@@ -45,16 +44,14 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
// unsigned int n;
|
||||
// int i;
|
||||
static int interpolateS11S12 = 1;
|
||||
|
||||
uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1];
|
||||
|
||||
uint8_t nushift,pilot0,pilot1,pilot2,pilot3;
|
||||
uint8_t previous_thread_id = ue->current_thread_id[Ns>>1]==0 ? (RX_NB_TH-1):(ue->current_thread_id[Ns>>1]-1);
|
||||
int **dl_ch_estimates =ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset];
|
||||
int **dl_ch_estimates_previous=ue->common_vars.common_vars_rx_data_per_thread[previous_thread_id].dl_ch_estimates[eNB_offset];
|
||||
int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF;
|
||||
|
||||
pilot0 = 0;
|
||||
|
||||
if (ue->frame_parms.Ncp == 0) { // normal prefix
|
||||
pilot1 = 4;
|
||||
pilot2 = 7;
|
||||
@@ -81,7 +78,6 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
//ch_offset = (l*(ue->frame_parms.ofdm_symbol_size));
|
||||
if (ue->high_speed_flag == 0) // use second channel estimate position for temporary storage
|
||||
ch_offset = ue->frame_parms.ofdm_symbol_size ;
|
||||
@@ -89,93 +85,88 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
ch_offset = ue->frame_parms.ofdm_symbol_size*symbol;
|
||||
|
||||
symbol_offset = ue->frame_parms.ofdm_symbol_size*symbol;
|
||||
|
||||
k = (nu + nushift)%6;
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("Channel Estimation : ThreadId %d, eNB_offset %d cell_id %d ch_offset %d, OFDM size %d, Ncp=%d, l=%d, Ns=%d, k=%d\n",ue->current_thread_id[Ns>>1], eNB_offset,Nid_cell,ch_offset,ue->frame_parms.ofdm_symbol_size,
|
||||
printf("Channel Estimation : ThreadId %d, eNB_offset %d cell_id %d ch_offset %d, OFDM size %d, Ncp=%d, l=%d, Ns=%d, k=%d\n",ue->current_thread_id[Ns>>1], eNB_offset,Nid_cell,ch_offset,
|
||||
ue->frame_parms.ofdm_symbol_size,
|
||||
ue->frame_parms.Ncp,l,Ns,k);
|
||||
#endif
|
||||
|
||||
switch (k) {
|
||||
case 0 :
|
||||
f=filt24_0; //for first pilot of RB, first half
|
||||
f2=filt24_2; //for second pilot of RB, first half
|
||||
fl=filt24_0; //for first pilot of leftmost RB
|
||||
f2l2=filt24_2;
|
||||
// fr=filt24_2r; //for first pilot of rightmost RB
|
||||
fr=filt24_0r2; //for first pilot of rightmost RB
|
||||
// f2r2=filt24_0r2;
|
||||
f2r2=filt24_2r;
|
||||
case 0 :
|
||||
f=filt24_0; //for first pilot of RB, first half
|
||||
f2=filt24_2; //for second pilot of RB, first half
|
||||
fl=filt24_0; //for first pilot of leftmost RB
|
||||
f2l2=filt24_2;
|
||||
// fr=filt24_2r; //for first pilot of rightmost RB
|
||||
fr=filt24_0r2; //for first pilot of rightmost RB
|
||||
// f2r2=filt24_0r2;
|
||||
f2r2=filt24_2r;
|
||||
f_dc=filt24_0_dcr;
|
||||
f2_dc=filt24_2_dcl;
|
||||
break;
|
||||
|
||||
f_dc=filt24_0_dcr;
|
||||
f2_dc=filt24_2_dcl;
|
||||
case 1 :
|
||||
f=filt24_1;
|
||||
f2=filt24_3;
|
||||
fl=filt24_1l;
|
||||
f2l2=filt24_3l2;
|
||||
fr=filt24_1r2;
|
||||
f2r2=filt24_3r;
|
||||
f_dc=filt24_1_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_3_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
|
||||
break;
|
||||
case 2 :
|
||||
f=filt24_2;
|
||||
f2=filt24_4;
|
||||
fl=filt24_2l;
|
||||
f2l2=filt24_4l2;
|
||||
fr=filt24_2r2;
|
||||
f2r2=filt24_4r;
|
||||
f_dc=filt24_2_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_4_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
|
||||
case 1 :
|
||||
f=filt24_1;
|
||||
f2=filt24_3;
|
||||
fl=filt24_1l;
|
||||
f2l2=filt24_3l2;
|
||||
fr=filt24_1r2;
|
||||
f2r2=filt24_3r;
|
||||
f_dc=filt24_1_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_3_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
case 3 :
|
||||
f=filt24_3;
|
||||
f2=filt24_5;
|
||||
fl=filt24_3l;
|
||||
f2l2=filt24_5l2;
|
||||
fr=filt24_3r2;
|
||||
f2r2=filt24_5r;
|
||||
f_dc=filt24_3_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_5_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
|
||||
case 2 :
|
||||
f=filt24_2;
|
||||
f2=filt24_4;
|
||||
fl=filt24_2l;
|
||||
f2l2=filt24_4l2;
|
||||
fr=filt24_2r2;
|
||||
f2r2=filt24_4r;
|
||||
f_dc=filt24_2_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_4_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
case 4 :
|
||||
f=filt24_4;
|
||||
f2=filt24_6;
|
||||
fl=filt24_4l;
|
||||
f2l2=filt24_6l2;
|
||||
fr=filt24_4r2;
|
||||
f2r2=filt24_6r;
|
||||
f_dc=filt24_4_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_6_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
|
||||
case 3 :
|
||||
f=filt24_3;
|
||||
f2=filt24_5;
|
||||
fl=filt24_3l;
|
||||
f2l2=filt24_5l2;
|
||||
fr=filt24_3r2;
|
||||
f2r2=filt24_5r;
|
||||
f_dc=filt24_3_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_5_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
case 5 :
|
||||
f=filt24_5;
|
||||
f2=filt24_7;
|
||||
fl=filt24_5l;
|
||||
f2l2=filt24_7l2;
|
||||
fr=filt24_5r2;
|
||||
f2r2=filt24_7r;
|
||||
f_dc=filt24_5_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_7_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
|
||||
case 4 :
|
||||
f=filt24_4;
|
||||
f2=filt24_6;
|
||||
fl=filt24_4l;
|
||||
f2l2=filt24_6l2;
|
||||
fr=filt24_4r2;
|
||||
f2r2=filt24_6r;
|
||||
f_dc=filt24_4_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_6_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
|
||||
case 5 :
|
||||
f=filt24_5;
|
||||
f2=filt24_7;
|
||||
fl=filt24_5l;
|
||||
f2l2=filt24_7l2;
|
||||
fr=filt24_5r2;
|
||||
f2r2=filt24_7r;
|
||||
f_dc=filt24_5_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_7_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(PHY,"lte_dl_channel_estimation: k=%d -> ERROR\n",k);
|
||||
return(-1);
|
||||
break;
|
||||
default:
|
||||
LOG_E(PHY,"lte_dl_channel_estimation: k=%d -> ERROR\n",k);
|
||||
return(-1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// generate pilot
|
||||
lte_dl_cell_spec_rx(ue,
|
||||
eNB_offset,
|
||||
@@ -184,27 +175,25 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
(l==0)?0:1,
|
||||
p);
|
||||
|
||||
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
||||
|
||||
pil = (int16_t *)&pilot[p][0];
|
||||
rxF = (int16_t *)&rxdataF[aarx][((symbol_offset+k+ue->frame_parms.first_carrier_offset))];
|
||||
dl_ch = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset];
|
||||
|
||||
|
||||
// if (eNb_id==0)
|
||||
memset(dl_ch,0,4*(ue->frame_parms.ofdm_symbol_size));
|
||||
|
||||
if (ue->high_speed_flag==0) // multiply previous channel estimate by ch_est_alpha
|
||||
multadd_complex_vector_real_scalar(dl_ch-(ue->frame_parms.ofdm_symbol_size<<1),
|
||||
ue->ch_est_alpha,dl_ch-(ue->frame_parms.ofdm_symbol_size<<1),
|
||||
1,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("k %d, first_carrier %d\n",k,ue->frame_parms.first_carrier_offset);
|
||||
#endif
|
||||
|
||||
if ((ue->frame_parms.N_RB_DL==6) ||
|
||||
(ue->frame_parms.N_RB_DL==50) ||
|
||||
(ue->frame_parms.N_RB_DL==100)) {
|
||||
|
||||
//First half of pilots
|
||||
// Treat first 2 pilots specially (left edge)
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
@@ -219,7 +208,6 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
@@ -234,28 +222,22 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
dl_ch+=16;
|
||||
|
||||
for (pilot_cnt=2; pilot_cnt<((ue->frame_parms.N_RB_DL)-1); pilot_cnt+=2) {
|
||||
|
||||
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); //Re
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); //Im
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(f,
|
||||
ch,
|
||||
dl_ch,
|
||||
24);
|
||||
|
||||
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(f2,
|
||||
ch,
|
||||
@@ -264,29 +246,25 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=16;
|
||||
|
||||
}
|
||||
|
||||
// printf("Second half\n");
|
||||
// Second half of RBs
|
||||
|
||||
k = (nu + nushift)%6;
|
||||
|
||||
if (k > 6)
|
||||
k -=6;
|
||||
|
||||
rxF = (int16_t *)&rxdataF[aarx][((symbol_offset+1+k))];
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("second half k %d\n",k);
|
||||
#endif
|
||||
|
||||
for (pilot_cnt=0; pilot_cnt<((ue->frame_parms.N_RB_DL)-3); pilot_cnt+=2) {
|
||||
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(f,
|
||||
ch,
|
||||
@@ -295,11 +273,10 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(f2,
|
||||
ch,
|
||||
@@ -308,13 +285,12 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=16;
|
||||
|
||||
}
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fr,
|
||||
ch,
|
||||
@@ -323,34 +299,25 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(f2r2,
|
||||
ch,
|
||||
dl_ch,
|
||||
24);
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (ue->frame_parms.N_RB_DL==25) {
|
||||
} else if (ue->frame_parms.N_RB_DL==25) {
|
||||
//printf("Channel estimation\n");
|
||||
|
||||
// Treat first 2 pilots specially (left edge)
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot 0 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(fl,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -358,17 +325,13 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot 1 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(f2l2,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -378,21 +341,15 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
dl_ch+=16;
|
||||
|
||||
for (pilot_cnt=2; pilot_cnt<24; pilot_cnt+=2) {
|
||||
|
||||
// printf("pilot[%d][%d] (%d,%d)\n",p,rb,pil[0],pil[1]);
|
||||
// printf("rx[%d][%d] -> (%d,%d)\n",p,ue->frame_parms.first_carrier_offset + ue->frame_parms.nushift + 6*rb+(3*p),rxF[0],rxF[1]);
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
|
||||
multadd_real_vector_complex_scalar(f,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -400,13 +357,10 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
@@ -417,39 +371,31 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=16;
|
||||
|
||||
}
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot 24: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
|
||||
multadd_real_vector_complex_scalar(f_dc,
|
||||
ch,
|
||||
dl_ch,
|
||||
24);
|
||||
pil+=2; // Re Im
|
||||
dl_ch+=8;
|
||||
|
||||
// printf("Second half\n");
|
||||
// Second half of RBs
|
||||
rxF = (int16_t *)&rxdataF[aarx][((symbol_offset+1+k))];
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot 25: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(f2_dc,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -459,19 +405,15 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
dl_ch+=16;
|
||||
|
||||
for (pilot_cnt=0; pilot_cnt<22; pilot_cnt+=2) {
|
||||
|
||||
// printf("* pilot[%d][%d] (%d,%d)\n",p,rb,pil[0],pil[1]);
|
||||
// printf("rx[%d][%d] -> (%d,%d)\n",p,ue->frame_parms.first_carrier_offset + ue->frame_parms.nushift + 6*rb+(3*p),rxF[0],rxF[1]);
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",26+pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
printf("pilot %u rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",26+pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(f,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -479,16 +421,13 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",27+pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
printf("pilot %u : rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",27+pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(f2,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -496,20 +435,15 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=16;
|
||||
|
||||
}
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot 49: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
|
||||
multadd_real_vector_complex_scalar(fr,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -517,28 +451,20 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
|
||||
printf("pilot 50: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(f2r2,
|
||||
ch,
|
||||
dl_ch,
|
||||
24);
|
||||
|
||||
} else if (ue->frame_parms.N_RB_DL==15) {
|
||||
|
||||
//printf("First Half\n");
|
||||
for (rb=0; rb<28; rb+=4) {
|
||||
|
||||
//printf("aarx=%d\n",aarx);
|
||||
//printf("pilot[%d][%d] (%d,%d)\n",p,rb,pil[0],pil[1]);
|
||||
//printf("rx[%d][%d] -> (%d,%d)\n",p,
|
||||
@@ -555,7 +481,6 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
//printf("ch -> (%d,%d)\n",ch[0],ch[1]);
|
||||
@@ -566,7 +491,6 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=16;
|
||||
|
||||
}
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
@@ -578,13 +502,11 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
24);
|
||||
pil+=2; // Re Im
|
||||
dl_ch+=8;
|
||||
|
||||
//printf("Second half\n");
|
||||
//Second half of RBs
|
||||
rxF = (int16_t *)&rxdataF[aarx][((symbol_offset+1+nushift + (3*p)))];
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(f2,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -602,7 +524,6 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
// rxF[1]);
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(f,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -610,10 +531,8 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(f2,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -621,17 +540,14 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=16;
|
||||
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"channel estimation not implemented for ue->frame_parms.N_RB_DL = %d\n",ue->frame_parms.N_RB_DL);
|
||||
}
|
||||
|
||||
|
||||
if (ue->perfect_ce == 0) {
|
||||
// Temporal Interpolation
|
||||
// printf("ch_offset %d\n",ch_offset);
|
||||
|
||||
dl_ch = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset];
|
||||
|
||||
if (ue->high_speed_flag == 0) {
|
||||
@@ -639,182 +555,155 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
32767-ue->ch_est_alpha,
|
||||
dl_ch-(ue->frame_parms.ofdm_symbol_size<<1),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else { // high_speed_flag == 1
|
||||
if ((symbol == 0)) {
|
||||
// printf("Interpolating %d->0\n",4-ue->frame_parms.Ncp);
|
||||
// dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][(4-ue->frame_parms.Ncp)*(ue->frame_parms.ofdm_symbol_size)];
|
||||
if(((Ns>>1)!=0) || ( ((Ns>>1)==0) && interpolateS11S12))
|
||||
{
|
||||
//LOG_I(PHY,"Interpolate s11-->s0 to get s12 and s13 Ns %d \n", Ns);
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates_previous[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
|
||||
if ((symbol == 0)) {
|
||||
// printf("Interpolating %d->0\n",4-ue->frame_parms.Ncp);
|
||||
// dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][(4-ue->frame_parms.Ncp)*(ue->frame_parms.ofdm_symbol_size)];
|
||||
if(((Ns>>1)!=0) || ( ((Ns>>1)==0) && interpolateS11S12)) {
|
||||
//LOG_I(PHY,"Interpolate s11-->s0 to get s12 and s13 Ns %d \n", Ns);
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates_previous[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
}
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
interpolateS11S12 = 1;
|
||||
} // this is 1/3,2/3 combination for pilots spaced by 3 symbols
|
||||
else if (symbol == pilot1) {
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][0];
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
}
|
||||
//LOG_I(PHY,"Interpolate s0-->s4 to get s1 s2 and s3 Ns %d \n", Ns);
|
||||
if (ue->frame_parms.Ncp==0) {// pilot spacing 4 symbols (1/4,1/2,3/4 combination)
|
||||
uint8_t previous_subframe;
|
||||
|
||||
interpolateS11S12 = 1;
|
||||
} // this is 1/3,2/3 combination for pilots spaced by 3 symbols
|
||||
else if (symbol == pilot1) {
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][0];
|
||||
|
||||
//LOG_I(PHY,"Interpolate s0-->s4 to get s1 s2 and s3 Ns %d \n", Ns);
|
||||
if (ue->frame_parms.Ncp==0) {// pilot spacing 4 symbols (1/4,1/2,3/4 combination)
|
||||
|
||||
uint8_t previous_subframe;
|
||||
if(Ns>>1 == 0)
|
||||
previous_subframe = 9;
|
||||
else
|
||||
previous_subframe = ((Ns>>1) - 1 )%9;
|
||||
|
||||
if((subframe_select(&ue->frame_parms,previous_subframe) == SF_UL))
|
||||
{
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,24576,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,8192,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,24576,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
}
|
||||
} else {
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} // pilot spacing 3 symbols (1/3,2/3 combination)
|
||||
} else if (symbol == pilot2) {
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot1*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else { // symbol == pilot3
|
||||
// printf("Interpolating 0->%d\n",4-ue->frame_parms.Ncp);
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
if (ue->frame_parms.Ncp==0) {// pilot spacing 4 symbols (1/4,1/2,3/4 combination)
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,24576,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,8192,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,24576,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else {
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} // pilot spacing 3 symbols (1/3,2/3 combination)
|
||||
|
||||
if((ue->rx_offset_diff !=0) && ((Ns>>1) == 9))
|
||||
{
|
||||
//LOG_I(PHY,"Extrapolate s7-->s11 to get s12 and s13 Ns %d\n", Ns);
|
||||
interpolateS11S12 = 0;
|
||||
//LOG_E(PHY,"Interpolate s7--s11 s12 s13 pilot 3 Ns %d l %d symbol %d \n", Ns, l, symbol);
|
||||
int16_t *dlChEst_ofdm11 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
|
||||
int16_t *dlChEst_ofdm7 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
// interpolate ofdm s12: 5/4*ofdms11 + -1/4*ofdms7 5/4 q1.15 40960 -1/4 q1.15 8192
|
||||
int16_t *dlChEst_ofdm12 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][12*ue->frame_parms.ofdm_symbol_size];
|
||||
for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++)
|
||||
{
|
||||
int64_t tmp_mult = 0;
|
||||
tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 40960 - (int64_t)dlChEst_ofdm7[i] * 8192);
|
||||
|
||||
tmp_mult = tmp_mult >> 15;
|
||||
dlChEst_ofdm12[i] = tmp_mult;
|
||||
}
|
||||
|
||||
// interpolate ofdm s13: 3/2*ofdms11 + -1/2*ofdms7 3/2 q1.15 49152 1/2 q1.15 16384
|
||||
int16_t *dlChEst_ofdm13 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][13*ue->frame_parms.ofdm_symbol_size];
|
||||
for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++)
|
||||
{
|
||||
int64_t tmp_mult = 0;
|
||||
tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 49152 - (int64_t)dlChEst_ofdm7[i] * 16384);
|
||||
|
||||
tmp_mult = tmp_mult >> 15;
|
||||
dlChEst_ofdm13[i] = tmp_mult;
|
||||
}
|
||||
}
|
||||
if(Ns>>1 == 0)
|
||||
previous_subframe = 9;
|
||||
else
|
||||
previous_subframe = ((Ns>>1) - 1 )%9;
|
||||
|
||||
if((subframe_select(&ue->frame_parms,previous_subframe) == SF_UL)) {
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else {
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,24576,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,8192,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,24576,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} // pilot spacing 3 symbols (1/3,2/3 combination)
|
||||
} else if (symbol == pilot2) {
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot1*(ue->frame_parms.ofdm_symbol_size)];
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else { // symbol == pilot3
|
||||
// printf("Interpolating 0->%d\n",4-ue->frame_parms.Ncp);
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
if (ue->frame_parms.Ncp==0) {// pilot spacing 4 symbols (1/4,1/2,3/4 combination)
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,24576,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,8192,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,24576,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else {
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} // pilot spacing 3 symbols (1/3,2/3 combination)
|
||||
|
||||
if((ue->rx_offset_diff !=0) && ((Ns>>1) == 9)) {
|
||||
//LOG_I(PHY,"Extrapolate s7-->s11 to get s12 and s13 Ns %d\n", Ns);
|
||||
interpolateS11S12 = 0;
|
||||
//LOG_E(PHY,"Interpolate s7--s11 s12 s13 pilot 3 Ns %d l %d symbol %d \n", Ns, l, symbol);
|
||||
int16_t *dlChEst_ofdm11 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
|
||||
int16_t *dlChEst_ofdm7 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
|
||||
// interpolate ofdm s12: 5/4*ofdms11 + -1/4*ofdms7 5/4 q1.15 40960 -1/4 q1.15 8192
|
||||
int16_t *dlChEst_ofdm12 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][12*ue->frame_parms.ofdm_symbol_size];
|
||||
|
||||
for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++) {
|
||||
int64_t tmp_mult = 0;
|
||||
tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 40960 - (int64_t)dlChEst_ofdm7[i] * 8192);
|
||||
tmp_mult = tmp_mult >> 15;
|
||||
dlChEst_ofdm12[i] = tmp_mult;
|
||||
}
|
||||
|
||||
// interpolate ofdm s13: 3/2*ofdms11 + -1/2*ofdms7 3/2 q1.15 49152 1/2 q1.15 16384
|
||||
int16_t *dlChEst_ofdm13 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][13*ue->frame_parms.ofdm_symbol_size];
|
||||
|
||||
for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++) {
|
||||
int64_t tmp_mult = 0;
|
||||
tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 49152 - (int64_t)dlChEst_ofdm7[i] * 16384);
|
||||
tmp_mult = tmp_mult >> 15;
|
||||
dlChEst_ofdm13[i] = tmp_mult;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void (*idft)(int16_t *,int16_t *, int);
|
||||
|
||||
switch (ue->frame_parms.ofdm_symbol_size) {
|
||||
case 128:
|
||||
idft = idft128;
|
||||
break;
|
||||
case 128:
|
||||
idft = idft128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
idft = idft256;
|
||||
break;
|
||||
case 256:
|
||||
idft = idft256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
idft = idft512;
|
||||
break;
|
||||
case 512:
|
||||
idft = idft512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
idft = idft1024;
|
||||
break;
|
||||
case 1024:
|
||||
idft = idft1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
idft = idft1536;
|
||||
break;
|
||||
case 1536:
|
||||
idft = idft1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
idft = idft2048;
|
||||
break;
|
||||
case 2048:
|
||||
idft = idft2048;
|
||||
break;
|
||||
|
||||
default:
|
||||
idft = idft512;
|
||||
break;
|
||||
default:
|
||||
idft = idft512;
|
||||
break;
|
||||
}
|
||||
|
||||
if( ((Ns%2) == 0) && (l == pilot0))
|
||||
{
|
||||
// do ifft of channel estimate
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++)
|
||||
for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) {
|
||||
if (ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx])
|
||||
{
|
||||
//LOG_I(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d \n", Ns, ue->current_thread_id[Ns>>1], l);
|
||||
idft((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx][8],
|
||||
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1);
|
||||
}
|
||||
}
|
||||
if( ((Ns%2) == 0) && (l == pilot0)) {
|
||||
// do ifft of channel estimate
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++)
|
||||
for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) {
|
||||
if (ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx]) {
|
||||
//LOG_I(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d \n", Ns, ue->current_thread_id[Ns>>1], l);
|
||||
idft((int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx][8],
|
||||
(int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(eNB_id),
|
||||
T_INT(ue->proc.proc_rxtx[ue->current_thread_id[Ns>>1]].frame_rx%1024), T_INT(ue->proc.proc_rxtx[ue->current_thread_id[Ns>>1]].subframe_rx),
|
||||
T_INT(0), T_BUFFER(&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][0][0], 512 * 4));
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,12 +46,12 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
|
||||
int32_t **ul_ch_estimates_time= pusch_vars->drs_ch_estimates_time;
|
||||
int32_t **rxdataF_ext= pusch_vars->rxdataF_ext;
|
||||
int subframe = proc->subframe_rx;
|
||||
uint8_t harq_pid = subframe2harq_pid(frame_parms,proc->frame_rx,subframe);
|
||||
uint8_t harq_pid;
|
||||
int16_t delta_phase = 0;
|
||||
int16_t *ru1 = ru_90;
|
||||
int16_t *ru2 = ru_90;
|
||||
int16_t current_phase1,current_phase2;
|
||||
uint16_t N_rb_alloc = eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb;
|
||||
|
||||
uint16_t aa,Msc_RS,Msc_RS_idx;
|
||||
uint16_t * Msc_idx_ptr;
|
||||
int k,pilot_pos1 = 3 - frame_parms->Ncp, pilot_pos2 = 10 - 2*frame_parms->Ncp;
|
||||
@@ -65,7 +65,7 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
|
||||
uint32_t alpha_ind;
|
||||
uint32_t u=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[Ns+(subframe<<1)];
|
||||
uint32_t v=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[Ns+(subframe<<1)];
|
||||
int32_t tmp_estimates[N_rb_alloc*12] __attribute__((aligned(16)));
|
||||
|
||||
|
||||
int symbol_offset,i;
|
||||
|
||||
@@ -83,7 +83,19 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
|
||||
int32x4_t mmtmp0,mmtmp1,mmtmp_re,mmtmp_im;
|
||||
#endif
|
||||
|
||||
int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32)));
|
||||
int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32)));
|
||||
|
||||
|
||||
#ifdef Rel14
|
||||
if (eNB->ulsch[UE_id]->ue_type > 0) harq_pid = 0;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
harq_pid = subframe2harq_pid(frame_parms,proc->frame_rx,subframe);
|
||||
}
|
||||
|
||||
uint16_t N_rb_alloc = eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb;
|
||||
int32_t tmp_estimates[N_rb_alloc*12] __attribute__((aligned(16)));
|
||||
|
||||
Msc_RS = N_rb_alloc*12;
|
||||
|
||||
|
||||
@@ -98,43 +98,25 @@ void dci_encoding(uint8_t *a,
|
||||
#endif
|
||||
RCC = sub_block_interleaving_cc(D,d+96,w);
|
||||
|
||||
#ifdef DEBUG_DCI_ENCODING
|
||||
printf("Doing DCI rate matching for %d channel bits, RCC %d, e %p\n",E,RCC,e);
|
||||
#endif
|
||||
//#ifdef DEBUG_DCI_ENCODING
|
||||
if (E>1000) printf("Doing DCI rate matching for %d channel bits, RCC %d, e %p\n",E,RCC,e);
|
||||
//#endif
|
||||
lte_rate_matching_cc(RCC,E,w,e);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
uint8_t *generate_dci0(uint8_t *dci,
|
||||
uint8_t *e,
|
||||
uint8_t DCI_LENGTH,
|
||||
uint8_t aggregation_level,
|
||||
uint16_t coded_bits,
|
||||
uint16_t rnti)
|
||||
{
|
||||
|
||||
uint16_t coded_bits;
|
||||
uint8_t dci_flip[8];
|
||||
|
||||
AssertFatal((aggregation_level==1) ||
|
||||
(aggregation_level==2) ||
|
||||
(aggregation_level==4) ||
|
||||
(aggregation_level==8)
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) // Added for EPDCCH/MPDCCH
|
||||
||
|
||||
(aggregation_level==16) ||
|
||||
(aggregation_level==24) ||
|
||||
(aggregation_level==32)
|
||||
#endif
|
||||
,
|
||||
"generate_dci FATAL, illegal aggregation_level %d\n",aggregation_level);
|
||||
|
||||
|
||||
coded_bits = 72 * aggregation_level;
|
||||
|
||||
|
||||
|
||||
#ifdef DEBUG_DCI_ENCODING
|
||||
for (int i=0;i<1+((DCI_LENGTH+16)/8);i++)
|
||||
printf("i %d : %x\n",i,dci[i]);
|
||||
@@ -387,7 +369,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
|
||||
e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
|
||||
e+(72*dci_alloc[i].firstCCE),
|
||||
dci_alloc[i].dci_length,
|
||||
dci_alloc[i].L,
|
||||
72*dci_alloc[i].L,
|
||||
dci_alloc[i].rnti);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,29 +283,33 @@ uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int sub
|
||||
}
|
||||
|
||||
|
||||
void conv_eMTC_rballoc(uint16_t resource_block_coding,
|
||||
uint32_t N_RB_DL,
|
||||
uint32_t *rb_alloc) {
|
||||
void conv_eMTC_rballoc (uint16_t resource_block_coding, uint32_t N_RB_DL, uint32_t * rb_alloc)
|
||||
{
|
||||
|
||||
|
||||
int narrowband = resource_block_coding>>5;
|
||||
int RIV = resource_block_coding&31;
|
||||
int N_NB_DL = N_RB_DL/6;
|
||||
int i0 = (N_RB_DL>>1) - (3*N_NB_DL);
|
||||
int first_rb = (6*narrowband)+i0;
|
||||
int alloc = localRIV2alloc_LUT6[RIV];
|
||||
int ind = first_rb>>5;
|
||||
int ind_mod = first_rb&31;
|
||||
int RIV = resource_block_coding&31;
|
||||
int narrowband = resource_block_coding>>5;
|
||||
int N_NB_DL = N_RB_DL / 6;
|
||||
int i0 = (N_RB_DL >> 1) - (3 * N_NB_DL);
|
||||
int first_rb = (6 * narrowband) + i0;
|
||||
int alloc = localRIV2alloc_LUT6[RIV];
|
||||
int ind = first_rb >> 5;
|
||||
int ind_mod = first_rb & 31;
|
||||
|
||||
if (((N_RB_DL&1) > 0) && (narrowband>=(N_NB_DL>>1))) first_rb++;
|
||||
rb_alloc[0] = 0;
|
||||
rb_alloc[1] = 0;
|
||||
rb_alloc[2] = 0;
|
||||
rb_alloc[3] = 0;
|
||||
rb_alloc[ind] = alloc<<ind_mod;
|
||||
if (ind_mod > 26) rb_alloc[ind+1] = alloc>>(6-(ind_mod-26));
|
||||
AssertFatal(RIV<32,"RIV is %d > 31\n",RIV);
|
||||
|
||||
if (((N_RB_DL & 1) > 0) && (narrowband >= (N_NB_DL >> 1)))
|
||||
first_rb++;
|
||||
rb_alloc[0] = 0;
|
||||
rb_alloc[1] = 0;
|
||||
rb_alloc[2] = 0;
|
||||
rb_alloc[3] = 0;
|
||||
rb_alloc[ind] = alloc << ind_mod;
|
||||
if (ind_mod > 26)
|
||||
rb_alloc[ind + 1] = alloc >> (6 - (ind_mod - 26));
|
||||
}
|
||||
|
||||
|
||||
void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t *rb_alloc2)
|
||||
{
|
||||
|
||||
|
||||
@@ -615,6 +615,7 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(get_thread_worker_conf() == WORKER_ENABLE)
|
||||
{
|
||||
if(C >= 8)//one main three worker
|
||||
|
||||
@@ -52,7 +52,6 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
{
|
||||
|
||||
int n;
|
||||
|
||||
// uint8_t reset;
|
||||
uint32_t x1, x2, s=0;
|
||||
uint8_t *dlsch_e=dlsch->harq_processes[harq_pid]->e;
|
||||
|
||||
@@ -19,30 +19,32 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/dci.c
|
||||
* \brief Implements PDCCH physical channel TX/RX procedures (36.211) and DCI encoding/decoding (36.212/36.213). Current LTE compliance V8.6 2009-03.
|
||||
* \author R. Knopp
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/edci.c
|
||||
* \brief Implements M/EPDCCH physical channel TX/RX procedures (36.211).
|
||||
* \author R. Knopp
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "SIMULATION/TOOLS/sim.h" // for taus
|
||||
#include "SIMULATION/TOOLS/sim.h" // for taus
|
||||
#include "PHY/sse_intrin.h"
|
||||
#include "transport_proto.h"
|
||||
#include "transport_common_proto.h"
|
||||
#include "assertions.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
|
||||
#include "assertions.h"
|
||||
#include "T.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
//#define DEBUG_DCI_ENCODING 1
|
||||
//#define DEBUG_DCI_DECODING 1
|
||||
//#define DEBUG_PHY
|
||||
@@ -52,129 +54,300 @@ void generate_edci_top(PHY_VARS_eNB *eNB, int frame, int subframe) {
|
||||
|
||||
}
|
||||
|
||||
void mpdcch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
mDCI_ALLOC_t *mdci,
|
||||
uint16_t i,
|
||||
uint8_t *e,
|
||||
uint32_t length)
|
||||
void mpdcch_scrambling(LTE_DL_FRAME_PARMS * frame_parms, mDCI_ALLOC_t * mdci, uint16_t i, uint8_t * e, uint32_t length)
|
||||
{
|
||||
int n;
|
||||
uint8_t reset;
|
||||
uint32_t x1, x2, s=0;
|
||||
uint8_t Nacc=4;
|
||||
uint16_t j0,j,idelta;
|
||||
uint16_t i0 = mdci->i0;
|
||||
int n;
|
||||
uint8_t reset;
|
||||
uint32_t x1, x2, s = 0;
|
||||
uint8_t Nacc = 4;
|
||||
uint16_t j0, j, idelta;
|
||||
uint16_t i0 = mdci->i0;
|
||||
|
||||
// Note: we could actually not do anything if i-i0 < Nacc, save it for later
|
||||
|
||||
reset = 1;
|
||||
// x1 is set in lte_gold_generic
|
||||
|
||||
if ((mdci->rnti == 0xFFFE) ||
|
||||
(mdci->ce_mode == 2)) // CEModeB Note: also for mdci->rnti==SC_RNTI
|
||||
Nacc=frame_parms->frame_type == FDD ? 4 : 10;
|
||||
else Nacc=1;
|
||||
|
||||
if (frame_parms->frame_type == FDD || Nacc == 1) idelta = 0;
|
||||
else idelta = Nacc-2;
|
||||
|
||||
j0 = (i0+idelta)/Nacc;
|
||||
j = (i - i0)/Nacc;
|
||||
if ((mdci->rnti == 0xFFFE) || (mdci->ce_mode == 2)) // CEModeB Note: also for mdci->rnti==SC_RNTI
|
||||
Nacc = frame_parms->frame_type == FDD ? 4 : 10;
|
||||
else
|
||||
Nacc = 1;
|
||||
|
||||
if (frame_parms->frame_type == FDD || Nacc == 1)
|
||||
idelta = 0;
|
||||
else
|
||||
idelta = Nacc - 2;
|
||||
|
||||
j0 = (i0 + idelta) / Nacc;
|
||||
j = (i - i0) / Nacc;
|
||||
|
||||
|
||||
|
||||
// rule for BL/CE UEs from Section 6.8.B2 in 36.211
|
||||
x2= ((((j0+j)*Nacc)%10)<<9) + mdci->dmrs_scrambling_init;
|
||||
|
||||
for (n=0; n<length; n++) {
|
||||
if ((i&0x1f)==0) {
|
||||
x2 = ((((j0 + j) * Nacc) % 10) << 9) + mdci->dmrs_scrambling_init;
|
||||
LOG_I(PHY,"MPDCCH cinit = %x (mdci->dmrs_scrambling_init = %d), scrambling %d encoded DCI bits\n",
|
||||
x2,mdci->dmrs_scrambling_init,length);
|
||||
for (n = 0; n < length; n++) {
|
||||
if ((n & 0x1f) == 0) {
|
||||
s = lte_gold_generic(&x1, &x2, reset);
|
||||
//printf("lte_gold[%d]=%x\n",i,s);
|
||||
reset = 0;
|
||||
}
|
||||
e[i] = (e[i]&1) ^ ((s>>(i&0x1f))&1);
|
||||
|
||||
e[n] = (e[n] & 1) ^ ((s >> (n & 0x1f)) & 1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// this table is the allocation of modulated MPDCCH format 5 symbols to REs
|
||||
// There are in total 36 REs/ECCE * 4 ECCE/PRB_pair = 144 REs in total/PRB_pair, total is 168 REs => 24 REs for DMRS
|
||||
// For format 5 there are 6 PRB pairs => 864 REs for 24 total ECCE
|
||||
static uint16_t mpdcch5tab[864];
|
||||
// this table is the allocation of modulated MPDCCH format 5 symbols to REs, antenna ports 107,108
|
||||
// start symbol is symbol 1 and L'=24 => all 6 PRBs in the set
|
||||
// 9 symbols without DMRS = 9*12*6 REs = 648 REs
|
||||
// 4 symbols with DMRS (3 REs stolen per symbol = 4*9*6 REs = 216 REs
|
||||
// Total = 648+216 = 864 REs = 1728 bits
|
||||
static uint16_t mpdcch5ss1tab[864];
|
||||
|
||||
void init_mpdcch5tab_normal_regular_subframe_evenNRBDL(PHY_VARS_eNB *eNB) {
|
||||
int l,k,kmod,re;
|
||||
void init_mpdcch5ss1tab_normal_regular_subframe_evenNRBDL(PHY_VARS_eNB * eNB)
|
||||
{
|
||||
int l, k, kmod, re=0;
|
||||
|
||||
LOG_I(PHY,"Inititalizing mpdcch5tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n");
|
||||
for (l=0,re=0;l<14;l++) {
|
||||
for (k=0;k<72;k++){
|
||||
kmod = k % 12;
|
||||
if (((l!=5) && (l!=6) && (l!=12) && (l!=13)) ||
|
||||
(((l==5)||(l==6)||(l==12)||(l==13))&&(kmod!=0)&&(kmod!=5)&&(kmod!=10)))
|
||||
mpdcch5tab[re++]=(l*eNB->frame_parms.ofdm_symbol_size)+k;
|
||||
LOG_I(PHY, "Inititalizing mpdcchss15tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n");
|
||||
|
||||
for (l = 1; l < 14; l++) {
|
||||
for (k = 0; k < 72; k++) {
|
||||
kmod = k % 12;
|
||||
if (((l != 5) && (l != 6) && (l != 12) && (l != 13)) || (kmod == 2) || (kmod == 3) || (kmod == 4) || (kmod == 7) || (kmod == 8) || (kmod == 9)) {
|
||||
mpdcch5ss1tab[re] = (l * eNB->frame_parms.ofdm_symbol_size) + k;
|
||||
re++;
|
||||
printf("l %d, k %d (kmod %d) => re %d\n", l, k, kmod, re);
|
||||
} else if ((kmod == 0) || (kmod == 5) || (kmod == 10)) {
|
||||
mpdcch5ss1tab[re++] = (l * eNB->frame_parms.ofdm_symbol_size) + k;
|
||||
}
|
||||
}
|
||||
}
|
||||
AssertFatal(re==864,"RE count not equal to 864\n");
|
||||
AssertFatal(re == 864, "RE count not equal to 864 (%d)\n", re);
|
||||
}
|
||||
|
||||
extern uint8_t *generate_dci0(uint8_t *dci,
|
||||
uint8_t *e,
|
||||
uint8_t DCI_LENGTH,
|
||||
uint8_t aggregation_level,
|
||||
uint16_t rnti);
|
||||
// this table is the allocation of modulated MPDCCH format 5 symbols to REs, antenna ports 107,108
|
||||
// start symbol is symbol 2 and L'=24 => all 6 PRBs in the set
|
||||
// 8 symbols without DMRS = 8*12*6 REs = 576 REs
|
||||
// 4 symbols with DMRS (3 REs stolen per symbol = 4*9*6 REs = 216 REs
|
||||
// Total = 576+216 = 792 REs = 1584 bits
|
||||
static uint16_t mpdcch5ss2tab[792];
|
||||
|
||||
void generate_mdci_top(PHY_VARS_eNB *eNB, int frame, int subframe,int16_t amp,int32_t **txdataF) {
|
||||
void init_mpdcch5ss2tab_normal_regular_subframe_evenNRBDL(PHY_VARS_eNB * eNB)
|
||||
{
|
||||
int l, k, kmod, re=0;
|
||||
int nushift = eNB->frame_parms.Nid_cell % 6;
|
||||
int nushiftp3 = (eNB->frame_parms.Nid_cell+3) % 6;
|
||||
// NOTE : THIS IS FOR TM1 ONLY FOR NOW!!!!!!!
|
||||
LOG_I(PHY, "Inititalizing mpdcch5ss2tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n");
|
||||
for (l = 2; l < 14; l++) {
|
||||
for (k = 0; k < 72; k++) {
|
||||
kmod = k % 12;
|
||||
if ((((l == 4)||(l==11)) && (kmod != nushiftp3) && (kmod != (nushiftp3+6))) ||
|
||||
((l == 7) && (kmod != nushift) &&(kmod != (nushift+6)))) { // CS RS
|
||||
mpdcch5ss2tab[re] = (l * eNB->frame_parms.ofdm_symbol_size) + k;
|
||||
re++;
|
||||
}
|
||||
if (((l!=4)&&(l!=7)&&(l!=11)) &&
|
||||
(((l != 5) && (l != 6) && (l != 12) && (l != 13)) || (kmod == 2) || (kmod == 3) || (kmod == 4) || (kmod == 7) || (kmod == 8) || (kmod == 9))) {
|
||||
mpdcch5ss2tab[re] = (l * eNB->frame_parms.ofdm_symbol_size) + k;
|
||||
re++;
|
||||
}
|
||||
}
|
||||
}
|
||||
AssertFatal(re == 684, "RE count not equal to 684\n");
|
||||
}
|
||||
|
||||
LTE_eNB_MPDCCH *mpdcch= &eNB->mpdcch_vars[subframe&2];
|
||||
mDCI_ALLOC_t *mdci;
|
||||
int coded_bits;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
int i;
|
||||
int gain_lin_QPSK;
|
||||
// this table is the allocation of modulated MPDCCH format 5 symbols to REs, antenna ports 107,108
|
||||
// start symbol is symbol 3 and L'=24 => all 6 PRBs in the set
|
||||
// 7 symbols without DMRS = 7*12*6 REs = 504 REs
|
||||
// 4 symbols with DMRS (3 REs stolen per symbol = 4*9*6 REs = 216 REs
|
||||
// Total = 504+216 = 720 REs = 1440 bits
|
||||
static uint16_t mpdcch5ss3tab[720];
|
||||
void init_mpdcch5ss3tab_normal_regular_subframe_evenNRBDL(PHY_VARS_eNB * eNB)
|
||||
{
|
||||
int l, k, kmod, re=0;
|
||||
|
||||
for (i=0;i<mpdcch->num_dci;i++) {
|
||||
LOG_I(PHY, "Inititalizing mpdcch5ss3tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n");
|
||||
for (l = 3; l < 14; l++) {
|
||||
for (k = 0; k < 72; k++) {
|
||||
kmod = k % 12;
|
||||
if (((l != 5) && (l != 6) && (l != 12) && (l != 13)) || (kmod == 2) || (kmod == 3) || (kmod == 4) || (kmod == 7) || (kmod == 8) || (kmod == 9)) {
|
||||
mpdcch5ss3tab[re] = (l * eNB->frame_parms.ofdm_symbol_size) + k;
|
||||
re++;
|
||||
} else if ((kmod == 0) || (kmod == 5) || (kmod == 10)) {
|
||||
mpdcch5ss3tab[re++] = (l * eNB->frame_parms.ofdm_symbol_size) + k;
|
||||
}
|
||||
}
|
||||
}
|
||||
AssertFatal(re == 720, "RE count not equal to 792\n");
|
||||
}
|
||||
|
||||
// this table is the allocation of modulated MPDCCH format 3 symbols to REs, antenna ports 107,108
|
||||
// with start symbol 1, using L'=16 => first 4 PRBs in the set
|
||||
// 8 symbols without DMRS = 9*12*4 REs = 432 REs
|
||||
// 4 symbols with DMRS (3 REs stolen per symbol = 4*9*4 REs = 144 REs
|
||||
// Total = 432+144 = 576 = 16CCE*36RE/CCE
|
||||
static uint16_t mpdcch3ss1tab[576];
|
||||
|
||||
void init_mpdcch3ss1tab_normal_regular_subframe_evenNRBDL(PHY_VARS_eNB * eNB)
|
||||
{
|
||||
int l, k, kmod, re=0;
|
||||
|
||||
LOG_I(PHY, "Inititalizing mpdcch3ss1tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n");
|
||||
for (l = 1, re = 0; l < 14; l++) {
|
||||
for (k = 0; k < 48; k++) {
|
||||
kmod = k % 12;
|
||||
if (((l != 5) && (l != 6) && (l != 12) && (l != 13)) || (((l == 5) || (l == 6) || (l == 12) || (l == 13)) && (kmod != 0) && (kmod != 5) && (kmod != 10))) {
|
||||
mpdcch3ss1tab[re] = (l * eNB->frame_parms.ofdm_symbol_size) + k;
|
||||
re++;
|
||||
}
|
||||
}
|
||||
}
|
||||
AssertFatal(re == 576, "RE count not equal to 864\n");
|
||||
}
|
||||
|
||||
// this table is the allocation of modulated MPDCCH format 2 symbols to REs, antenna ports 107,108
|
||||
// with start symbol 1, using L'=8 => last 2 PRBs in the set
|
||||
// 8 symbols without DMRS = 9*12*2 REs = 216 REs
|
||||
// 4 symbols with DMRS (3 REs stolen per symbol = 4*9*2 REs = 72 REs
|
||||
// Total = 216+72 = 288 = 8CCE*36RE/CCE
|
||||
static uint16_t mpdcch2ss1tab[288];
|
||||
|
||||
void init_mpdcch2ss1tab_normal_regular_subframe_evenNRBDL(PHY_VARS_eNB * eNB)
|
||||
{
|
||||
int l, k, kmod, re=0;
|
||||
|
||||
LOG_I(PHY, "Inititalizing mpdcch2ss1tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n");
|
||||
for (l = 1, re = 0; l < 14; l++) {
|
||||
for (k = 0; k < 24; k++) {
|
||||
kmod = k % 12;
|
||||
if (((l != 5) && (l != 6) && (l != 12) && (l != 13)) || (((l == 5) || (l == 6) || (l == 12) || (l == 13)) && (kmod != 0) && (kmod != 5) && (kmod != 10))) {
|
||||
mpdcch2ss1tab[re] = (l * eNB->frame_parms.ofdm_symbol_size) + k;
|
||||
re++;
|
||||
}
|
||||
}
|
||||
}
|
||||
AssertFatal(re == 288, "RE count not equal to 288\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
extern uint8_t *generate_dci0(uint8_t * dci, uint8_t * e, uint8_t DCI_LENGTH, uint16_t coded_bits, uint16_t rnti);
|
||||
|
||||
|
||||
uint16_t mpdcch_dmrs_tab[12 * 6];
|
||||
|
||||
void init_mpdcch_dmrs_tab(uint16_t oss)
|
||||
{
|
||||
|
||||
int re = 5 * oss;
|
||||
int pos = 0;
|
||||
|
||||
for (int symb = 0; symb < 4; symb++) {
|
||||
for (int prb = 0; prb < 6; prb++, re += 12) {
|
||||
mpdcch_dmrs_tab[pos++] = re;
|
||||
mpdcch_dmrs_tab[pos++] = re + 5;
|
||||
mpdcch_dmrs_tab[pos++] = re + 10;
|
||||
}
|
||||
if (symb == 0)
|
||||
re = 6 * oss;
|
||||
else if (symb == 1)
|
||||
re = 12 * oss;
|
||||
else if (symb == 2)
|
||||
re = 13 * oss;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void generate_mdci_top(PHY_VARS_eNB * eNB, int frame, int subframe, int16_t amp, int32_t ** txdataF)
|
||||
{
|
||||
|
||||
LTE_eNB_MPDCCH *mpdcch = &eNB->mpdcch_vars[subframe & 1];
|
||||
mDCI_ALLOC_t *mdci;
|
||||
int coded_bits;
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
int i;
|
||||
int gain_lin_QPSK;
|
||||
uint16_t *mpdcchtab;
|
||||
|
||||
uint32_t x1, x2, s = 0;
|
||||
uint8_t Nacc = 4;
|
||||
uint16_t j0, j, idelta;
|
||||
uint16_t i0;
|
||||
|
||||
int off=0;
|
||||
|
||||
// Assumption: only handle a single MPDCCH per narrowband
|
||||
|
||||
int nsymb = (fp->Ncp==0) ? 14:12;
|
||||
|
||||
int symbol_offset = (uint32_t)fp->ofdm_symbol_size*(subframe*nsymb);
|
||||
|
||||
int wp[2][4] = {{1,1,1,1},{1,-1,1,-1}};
|
||||
int *w;
|
||||
|
||||
LOG_I(PHY, "generate_mdci_top: num_dci %d\n", mpdcch->num_dci);
|
||||
|
||||
for (i = 0; i < mpdcch->num_dci; i++) {
|
||||
mdci = &mpdcch->mdci_alloc[i];
|
||||
|
||||
|
||||
AssertFatal(fp->frame_type==FDD,"TDD is not yet supported for MPDCCH\n");
|
||||
AssertFatal(fp->Ncp == NORMAL,"Extended Prefix not yet supported for MPDCCH\n");
|
||||
AssertFatal(mdci->L<=24,"L is %d\n",mdci->L);
|
||||
AssertFatal(fp->N_RB_DL==50 || fp->N_RB_DL==100,"Only N_RB_DL=50,100 for MPDCCH\n");
|
||||
AssertFatal(fp->frame_type == FDD, "TDD is not yet supported for MPDCCH\n");
|
||||
AssertFatal(fp->Ncp == NORMAL, "Extended Prefix not yet supported for MPDCCH\n");
|
||||
AssertFatal(mdci->L <= 24, "L is %d\n", mdci->L);
|
||||
AssertFatal(fp->N_RB_DL == 50 || fp->N_RB_DL == 100, "Only N_RB_DL=50,100 for MPDCCH\n");
|
||||
// Force MPDDCH format 5
|
||||
AssertFatal(mdci->number_of_prb_pairs==6,"2 or 4 PRB pairs not support yet for MPDCCH\n");
|
||||
AssertFatal(mdci->reps>0,"mdci->reps==0\n");
|
||||
AssertFatal(mdci->number_of_prb_pairs == 6, "2 or 4 PRB pairs not support yet for MPDCCH\n");
|
||||
|
||||
// 9 REs/EREG * 4 EREG/ECCE => 36 REs/ECCE => 72 bits/ECCE, so same as regular PDCCH channel encoding
|
||||
// These are to avoid unimplemented things
|
||||
AssertFatal(mdci->ce_mode == 1, "CE mode (%d) B not activated yet\n", mdci->ce_mode);
|
||||
AssertFatal(mdci->L == 24, "Only 2+4 and aggregation 24 for now\n");
|
||||
int a_index=mdci->rnti & 3;
|
||||
|
||||
i0 = mdci->i0;
|
||||
// antenna index
|
||||
|
||||
if (mdci->start_symbol == 1) {
|
||||
mpdcchtab = mpdcch5ss1tab;
|
||||
coded_bits = 756*2;
|
||||
} else if (mdci->start_symbol == 2) {
|
||||
mpdcchtab = mpdcch5ss2tab;
|
||||
coded_bits=684*2;
|
||||
} else if (mdci->start_symbol == 3) {
|
||||
mpdcchtab = mpdcch5ss3tab;
|
||||
coded_bits = 612*2;
|
||||
} else
|
||||
AssertFatal(1 == 0, "Illegal combination start_symbol %d, a_index %d\n", mdci->start_symbol, a_index);
|
||||
|
||||
LOG_I(PHY, "mdci %d, length %d: rnti %x, L %d, prb_pairs %d, ce_mode %d, transmission type %s, i0 %d, ss %d ,coded_bits %d\n",
|
||||
i, mdci->dci_length,mdci->rnti,
|
||||
mdci->L, mdci->number_of_prb_pairs,
|
||||
mdci->ce_mode,
|
||||
mdci->transmission_type == 1? "dist" : "loc",
|
||||
mdci->i0, mdci->start_symbol,
|
||||
coded_bits);
|
||||
|
||||
// Note: We only have to run this every Nacc subframes during repetitions, data and scrambling are constant, but we do it for now to simplify during testing
|
||||
|
||||
generate_dci0(mdci->dci_pdu,
|
||||
mpdcch->e+(72*mdci->firstCCE),
|
||||
mdci->dci_length,
|
||||
mdci->L,
|
||||
mdci->rnti);
|
||||
generate_dci0(mdci->dci_pdu, mpdcch->e, mdci->dci_length, coded_bits, mdci->rnti);
|
||||
|
||||
|
||||
|
||||
coded_bits = 72 * mdci->L;
|
||||
|
||||
// scrambling
|
||||
uint16_t absSF = (frame*10)+subframe;
|
||||
uint16_t absSF = (frame * 10) + subframe;
|
||||
|
||||
AssertFatal(absSF < 1024,
|
||||
"Absolute subframe %d = %d*10 + %d > 1023\n",
|
||||
absSF,frame,subframe);
|
||||
|
||||
mpdcch_scrambling(fp,
|
||||
mdci,
|
||||
absSF,
|
||||
mpdcch->e+(72*mdci->firstCCE),
|
||||
coded_bits);
|
||||
AssertFatal(absSF < 10240, "Absolute subframe %d = %d*10 + %d > 10239\n", absSF, frame, subframe);
|
||||
|
||||
mpdcch_scrambling(fp, mdci, absSF, mpdcch->e, coded_bits);
|
||||
|
||||
// Modulation for PDCCH
|
||||
if (fp->nb_antenna_ports_eNB==1)
|
||||
gain_lin_QPSK = (int16_t)((amp*ONE_OVER_SQRT2_Q15)>>15);
|
||||
if (fp->nb_antenna_ports_eNB == 1)
|
||||
gain_lin_QPSK = (int16_t) ((amp * ONE_OVER_SQRT2_Q15) >> 15);
|
||||
else
|
||||
gain_lin_QPSK = amp/2;
|
||||
gain_lin_QPSK = amp / 2;
|
||||
|
||||
uint8_t *e_ptr = mpdcch->e;
|
||||
uint8_t *e_ptr = mpdcch->e;
|
||||
|
||||
// if (mdci->transmission_type==0) nprime=mdci->rnti&3; // for Localized 2+4 we use 6.8B.5 rule
|
||||
// map directly to one antenna port for now
|
||||
@@ -183,20 +356,135 @@ void generate_mdci_top(PHY_VARS_eNB *eNB, int frame, int subframe,int16_t amp,in
|
||||
// first RE of narrowband
|
||||
// mpdcchtab5 below contains the mapping from each coded symbol to relative RE avoiding the DMRS
|
||||
|
||||
int nb_i0;
|
||||
switch (fp->N_RB_DL) {
|
||||
|
||||
int re_offset = fp->first_carrier_offset + 1 + ((fp->N_RB_DL==100)?1:0) + mdci->narrowband*12*6;
|
||||
if (re_offset>fp->ofdm_symbol_size) re_offset-=(fp->ofdm_symbol_size-1);
|
||||
int32_t *txF = &txdataF[0][re_offset];
|
||||
int32_t yIQ;
|
||||
|
||||
for (i=0; i<(coded_bits>>1); i++) {
|
||||
// QPSK modulation to yIQ
|
||||
((int16_t*)&yIQ)[0] = (*e_ptr == 1) ? -gain_lin_QPSK : gain_lin_QPSK; e_ptr++;
|
||||
((int16_t*)&yIQ)[1] = (*e_ptr == 1) ? -gain_lin_QPSK : gain_lin_QPSK; e_ptr++;
|
||||
txF[mpdcch5tab[i+(36*mdci->firstCCE)]] = yIQ;
|
||||
case 6:
|
||||
case 25:
|
||||
nb_i0 = 0;
|
||||
break;
|
||||
case 15:
|
||||
case 50:
|
||||
case 75:
|
||||
nb_i0 = 1;
|
||||
break;
|
||||
case 100:
|
||||
nb_i0 = 2;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "Illegal N_RB_DL %d\n", fp->N_RB_DL);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
int re_offset = fp->first_carrier_offset + (12 * nb_i0) + (mdci->narrowband * 12 * 6);
|
||||
if (re_offset > fp->ofdm_symbol_size)
|
||||
re_offset -= (fp->ofdm_symbol_size - 1);
|
||||
int32_t *txF = &txdataF[0][symbol_offset+re_offset];
|
||||
int32_t yIQ;
|
||||
|
||||
for (i = 0; i < (coded_bits >> 1); i++) {
|
||||
// QPSK modulation to yIQ
|
||||
((int16_t *) & yIQ)[0] = (*e_ptr == 1) ? -gain_lin_QPSK : gain_lin_QPSK;
|
||||
e_ptr++;
|
||||
((int16_t *) & yIQ)[1] = (*e_ptr == 1) ? -gain_lin_QPSK : gain_lin_QPSK;
|
||||
e_ptr++;
|
||||
txF[mpdcchtab[i]] = yIQ;
|
||||
/*
|
||||
LOG_I(PHY,"Frame %d, subframe %d: mpdcch pos %d (%d,%d) => (%d,%d)\n",
|
||||
frame,subframe,i,mpdcchtab[i]+re_offset,mpdcchtab[i]/fp->ofdm_symbol_size,
|
||||
((int16_t *) & yIQ)[0],((int16_t *) & yIQ)[1]);*/
|
||||
}
|
||||
|
||||
if (mdci->transmission_type == 1) w=0; // distributed
|
||||
else w = wp[a_index&1];
|
||||
// pilot scrambling initiatlization (note: this is for a single repetition)
|
||||
|
||||
// x1 is set in lte_gold_generic
|
||||
|
||||
// rule for BL/CE UEs from Section 6.10.3A.1 in 36.211
|
||||
|
||||
if ((mdci->rnti == 0xFFFE) || (mdci->ce_mode == 2)) // CEModeB Note: also for mdci->rnti==SC_RNTI
|
||||
Nacc = fp->frame_type == FDD ? 4 : 10;
|
||||
else
|
||||
Nacc = 1;
|
||||
|
||||
if (fp->frame_type == FDD || Nacc == 1)
|
||||
idelta = 0;
|
||||
else
|
||||
idelta = Nacc - 2;
|
||||
|
||||
j0 = (i0 + idelta) / Nacc;
|
||||
j = (absSF - i0) / Nacc;
|
||||
|
||||
|
||||
|
||||
uint32_t a = ((((j0 + j) * Nacc) % 10) + 1);
|
||||
uint32_t b = ((mdci->dmrs_scrambling_init << 1) + 1) << 16;
|
||||
x2 = a * b;
|
||||
x2 = x2 + 2;
|
||||
LOG_I(PHY, "mpdcch_dmrs cinit %x (a=%d,b=%d,i0=%d,j0=%d)\n", x2,a,b,i0,j0);
|
||||
|
||||
// add MPDCCH pilots
|
||||
int reset = 1;
|
||||
|
||||
int first_prb = (mdci->narrowband*6) + nb_i0;
|
||||
int last_prb = (mdci->narrowband*6) + nb_i0 + 5;
|
||||
int soffset[4] = {5,6,12,13};
|
||||
|
||||
|
||||
for (int lprime=0,i=0;lprime<4;lprime++) {
|
||||
for (int nprb=0;nprb<110;nprb++) {
|
||||
if (nprb<fp->N_RB_DL) {
|
||||
re_offset = fp->first_carrier_offset + (12 * nprb);
|
||||
if (re_offset > fp->ofdm_symbol_size)
|
||||
re_offset -= (fp->ofdm_symbol_size - 1);
|
||||
txF = &txdataF[0][symbol_offset + re_offset + fp->ofdm_symbol_size*soffset[lprime]];
|
||||
}
|
||||
for (int mprime=0;mprime<3;mprime++,i+=2) {
|
||||
|
||||
if ((i & 0x1f) == 0) {
|
||||
s = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
|
||||
// select PRBs corresponding to narrowband
|
||||
if ((nprb>= first_prb) &&
|
||||
(nprb<= last_prb)) {
|
||||
((int16_t *) & yIQ)[0] = (((s >> (i & 0x1f)) & 1) == 1) ? -gain_lin_QPSK : gain_lin_QPSK;
|
||||
((int16_t *) & yIQ)[1] = (((s >> ((i + 1) & 0x1f)) & 1) == 1) ? -gain_lin_QPSK : gain_lin_QPSK;
|
||||
AssertFatal(mdci->transmission_type==1,"transmission_type %d!=1, handle this ...\n",mdci->transmission_type);
|
||||
if (mdci->transmission_type==1) { // same thing on both 107 and 109
|
||||
txF[(5*mprime)] = yIQ;
|
||||
txF[1+(5*mprime)] = yIQ;
|
||||
}
|
||||
else { // put on selected antenna port with w sequence
|
||||
|
||||
if (((mprime+nprb)&1) == 0)
|
||||
txF[off+(5*mprime)] = yIQ*w[lprime];
|
||||
else
|
||||
txF[off+(5*mprime)] = yIQ*w[3-lprime];
|
||||
}
|
||||
/*
|
||||
LOG_I(PHY, "mpdcch_dmrs pos (dist %d, l %d,nprb %d,mprime %d) %d => (%d,%d)\n",
|
||||
mdci->transmission_type, soffset[lprime],nprb,mprime,
|
||||
re_offset + fp->ofdm_symbol_size*soffset[lprime]+(5*mprime),
|
||||
((int16_t *) & yIQ)[0], ((int16_t *) & yIQ)[1]);*/
|
||||
} // narrowband condition
|
||||
} // RE (m') loop
|
||||
} // nprb loop
|
||||
} // symbol (l') loop
|
||||
} // num_dci loop
|
||||
}
|
||||
|
||||
void init_mpdcch(PHY_VARS_eNB * eNB)
|
||||
{
|
||||
|
||||
init_mpdcch5ss1tab_normal_regular_subframe_evenNRBDL(eNB);
|
||||
init_mpdcch5ss2tab_normal_regular_subframe_evenNRBDL(eNB);
|
||||
init_mpdcch5ss3tab_normal_regular_subframe_evenNRBDL(eNB);
|
||||
init_mpdcch3ss1tab_normal_regular_subframe_evenNRBDL(eNB);
|
||||
init_mpdcch2ss1tab_normal_regular_subframe_evenNRBDL(eNB);
|
||||
init_mpdcch_dmrs_tab(eNB->frame_parms.ofdm_symbol_size);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -150,6 +150,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
|
||||
|
||||
for (element_id=0; element_id<db_halflength; element_id+=8) {
|
||||
i = (uint16_t*) &rx0[element_id];
|
||||
|
||||
d = (uint16_t*) &data_block[element_id];
|
||||
d[0] = ((uint16_t) lin2alaw_if4p5[i[0]]) | ((uint16_t)(lin2alaw_if4p5[i[1]]<<8));
|
||||
d[1] = ((uint16_t) lin2alaw_if4p5[i[2]]) | ((uint16_t)(lin2alaw_if4p5[i[3]]<<8));
|
||||
|
||||
@@ -59,7 +59,9 @@ struct DCI6_0A_5MHz {
|
||||
/// Modulation and Coding Scheme and Redundancy Version
|
||||
uint32_t mcs:4;
|
||||
/// RB Assignment (ceil(log2(floor(N_RB_UL/6))) + 5 bits)
|
||||
uint32_t rballoc:7;
|
||||
uint32_t rballoc:5;
|
||||
/// narrowband index log2(floor(N_RB_DL/6))) bits
|
||||
uint32_t narrowband:2;
|
||||
/// Hopping flag
|
||||
uint32_t hopping:1;
|
||||
/// type = 0 => DCI Format 0, type = 1 => DCI Format 1A
|
||||
@@ -92,7 +94,9 @@ struct DCI6_1A_5MHz {
|
||||
/// Modulation and Coding Scheme and Redundancy Version
|
||||
uint32_t mcs:4;
|
||||
/// Resource block assignment (assignment flag = 0 for 5 MHz, ceil(log2(floor(N_RB_DL/6)))+5)
|
||||
uint32_t rballoc:7;
|
||||
uint32_t rballoc:5;
|
||||
/// narrowband index log2(floor(N_RB_DL/6))) bits
|
||||
uint32_t narrowband:2;
|
||||
/// Frequency hopping flag
|
||||
uint32_t hopping:1;
|
||||
/// 0/1A differentiator
|
||||
@@ -125,7 +129,9 @@ struct DCI6_0A_10MHz {
|
||||
/// Modulation and Coding Scheme and Redundancy Version
|
||||
uint32_t mcs:4;
|
||||
/// RB Assignment (ceil(log2(floor(N_RB_UL/6))) + 5 bits)
|
||||
uint32_t rballoc:8;
|
||||
uint32_t rballoc:5;
|
||||
/// narrowband index log2(floor(N_RB_DL/6))) bits
|
||||
uint32_t narrowband:3;
|
||||
/// Hopping flag
|
||||
uint32_t hopping:1;
|
||||
/// type = 0 => DCI Format 0, type = 1 => DCI Format 1A
|
||||
@@ -138,7 +144,7 @@ typedef struct DCI6_0A_10MHz DCI6_0A_10MHz_t;
|
||||
/// basic DCI Format Type 6-1A (10 MHz, FDD primary carrier, 24 bits, 5 bit format, TM!=9,TM!=6, no scheduling enhancement)
|
||||
struct DCI6_1A_10MHz {
|
||||
/// padding to fill 32-bit word
|
||||
uint32_t padding:4;
|
||||
uint32_t padding:3;
|
||||
/// DCI subframe repetition number
|
||||
uint32_t dci_rep:2;
|
||||
/// HARQ-ACK resource offset
|
||||
@@ -157,8 +163,10 @@ struct DCI6_1A_10MHz {
|
||||
uint32_t rep:2;
|
||||
/// Modulation and Coding Scheme and Redundancy Version
|
||||
uint32_t mcs:4;
|
||||
/// Resource block assignment (assignment flag = 0 for 10 MHz, ceil(log2(floor(N_RB_DL/6)))+5)
|
||||
uint32_t rballoc:8;
|
||||
/// Resource block assignment
|
||||
uint32_t rballoc:5;
|
||||
/// narrowband index log2(floor(N_RB_DL/6))) bits
|
||||
uint32_t narrowband:3;
|
||||
/// Frequency hopping flag
|
||||
uint32_t hopping:1;
|
||||
/// 0/1A differentiator
|
||||
@@ -191,7 +199,9 @@ struct DCI6_0A_20MHz {
|
||||
/// Modulation and Coding Scheme and Redundancy Version
|
||||
uint32_t mcs:4;
|
||||
/// RB Assignment (ceil(log2(floor(N_RB_UL/6))) + 5 bits)
|
||||
uint32_t rballoc:9;
|
||||
uint32_t rballoc:5;
|
||||
/// narrowband index log2(floor(N_RB_DL/6))) bits
|
||||
uint32_t narrowband:4;
|
||||
/// Hopping flag
|
||||
uint32_t hopping:1;
|
||||
/// type = 0 => DCI Format 0, type = 1 => DCI Format 1A
|
||||
@@ -224,7 +234,9 @@ struct DCI6_1A_20MHz {
|
||||
/// Modulation and Coding Scheme and Redundancy Version
|
||||
uint32_t mcs:4;
|
||||
/// Resource block assignment (assignment flag = 0 for 20 MHz, ceil(log2(floor(N_RB_DL/6)))+5)
|
||||
uint32_t rballoc:9;
|
||||
uint32_t rballoc:5;
|
||||
/// narrowband index log2(floor(N_RB_DL/6))) bits
|
||||
uint32_t narrowband:4;
|
||||
/// Frequency hopping flag
|
||||
uint32_t hopping:1;
|
||||
/// 0/1A differentiator
|
||||
|
||||
@@ -0,0 +1,804 @@
|
||||
/*
|
||||
* 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 PHY/LTE_TRANSPORT/print_stats.c
|
||||
* \brief PHY statstic logging function
|
||||
* \author R. Knopp, F. Kaltenberger, navid nikaein
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr, navid.nikaein@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "PHY/LTE_TRANSPORT/proto.h"
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "SCHED/extern.h"
|
||||
|
||||
#ifdef OPENAIR2
|
||||
#include "openair2/LAYER2/MAC/proto.h"
|
||||
#include "openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
|
||||
#endif
|
||||
|
||||
extern int mac_get_rrc_status(uint8_t Mod_id,uint8_t eNB_flag,uint8_t index);
|
||||
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
#include "common_lib.h"
|
||||
extern openair0_config_t openair0_cfg[];
|
||||
#endif
|
||||
|
||||
int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length, runmode_t mode, int input_level_dBm)
|
||||
{
|
||||
|
||||
uint8_t eNB=0;
|
||||
uint32_t RRC_status;
|
||||
int len=length;
|
||||
int harq_pid,round;
|
||||
|
||||
if (ue==NULL)
|
||||
return 0;
|
||||
|
||||
if ((mode == normal_txrx) || (mode == no_L2_connect)) {
|
||||
len += sprintf(&buffer[len], "[UE_PROC] UE %d, RNTI %x\n",ue->Mod_id, ue->pdcch_vars[0][0]->crnti);
|
||||
len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE (NF %.1f dB)\n",
|
||||
10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB,
|
||||
10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB,
|
||||
10*log10(ue->measurements.rsrq[0]),
|
||||
ue->measurements.n0_power_tot_dBm,
|
||||
(double)ue->measurements.n0_power_tot_dBm+132.24);
|
||||
|
||||
/*
|
||||
len += sprintf(&buffer[len],
|
||||
"[UE PROC] Frame count: %d\neNB0 RSSI %d dBm/RE (%d dB, %d dB)\neNB1 RSSI %d dBm/RE (%d dB, %d dB)neNB2 RSSI %d dBm/RE (%d dB, %d dB)\nN0 %d dBm/RE, %f dBm/%dPRB (%d dB, %d dB)\n",
|
||||
proc->frame_rx,
|
||||
ue->measurements.rx_rssi_dBm[0],
|
||||
ue->measurements.rx_power_dB[0][0],
|
||||
ue->measurements.rx_power_dB[0][1],
|
||||
ue->measurements.rx_rssi_dBm[1],
|
||||
ue->measurements.rx_power_dB[1][0],
|
||||
ue->measurements.rx_power_dB[1][1],
|
||||
ue->measurements.rx_rssi_dBm[2],
|
||||
ue->measurements.rx_power_dB[2][0],
|
||||
ue->measurements.rx_power_dB[2][1],
|
||||
ue->measurements.n0_power_tot_dBm,
|
||||
ue->measurements.n0_power_tot_dBm+10*log10(12*ue->frame_parms.N_RB_DL),
|
||||
ue->frame_parms.N_RB_DL,
|
||||
ue->measurements.n0_power_dB[0],
|
||||
ue->measurements.n0_power_dB[1]);
|
||||
*/
|
||||
|
||||
#ifdef EXMIMO
|
||||
len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB (LNA %d, vga %d dB)\n",ue->rx_total_gain_dB, openair0_cfg[0].rxg_mode[0],(int)openair0_cfg[0].rx_gain[0]);
|
||||
#endif
|
||||
#if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB\n",ue->rx_total_gain_dB);
|
||||
#endif
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
len += sprintf(&buffer[len], "[UE_PROC] Frequency offset %d Hz, estimated carrier frequency %f Hz\n",ue->common_vars.freq_offset,openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset);
|
||||
#endif
|
||||
len += sprintf(&buffer[len], "[UE PROC] UE mode = %s (%d)\n",mode_string[ue->UE_mode[0]],ue->UE_mode[0]);
|
||||
len += sprintf(&buffer[len], "[UE PROC] timing_advance = %d\n",ue->timing_advance);
|
||||
if (ue->UE_mode[0]==PUSCH) {
|
||||
len += sprintf(&buffer[len], "[UE PROC] Po_PUSCH = %d dBm (PL %d dB, Po_NOMINAL_PUSCH %d dBm, PHR %d dB)\n",
|
||||
ue->ulsch[0]->Po_PUSCH,
|
||||
get_PL(ue->Mod_id,ue->CC_id,0),
|
||||
ue->frame_parms.ul_power_control_config_common.p0_NominalPUSCH,
|
||||
ue->ulsch[0]->PHR);
|
||||
len += sprintf(&buffer[len], "[UE PROC] Po_PUCCH = %d dBm (Po_NOMINAL_PUCCH %d dBm, g_pucch %d dB)\n",
|
||||
get_PL(ue->Mod_id,ue->CC_id,0)+
|
||||
ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH+
|
||||
ue->dlsch[0][0][0]->g_pucch,
|
||||
ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
|
||||
ue->dlsch[0][0][0]->g_pucch);
|
||||
}
|
||||
//for (eNB=0;eNB<NUMBER_OF_eNB_MAX;eNB++) {
|
||||
for (eNB=0; eNB<1; eNB++) {
|
||||
len += sprintf(&buffer[len], "[UE PROC] RX spatial power eNB%d: [%d %d; %d %d] dB\n",
|
||||
eNB,
|
||||
ue->measurements.rx_spatial_power_dB[eNB][0][0],
|
||||
ue->measurements.rx_spatial_power_dB[eNB][0][1],
|
||||
ue->measurements.rx_spatial_power_dB[eNB][1][0],
|
||||
ue->measurements.rx_spatial_power_dB[eNB][1][1]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] RX total power eNB%d: %d dB, avg: %d dB\n",eNB,ue->measurements.rx_power_tot_dB[eNB],ue->measurements.rx_power_avg_dB[eNB]);
|
||||
len += sprintf(&buffer[len], "[UE PROC] RX total power lin: %d, avg: %d, RX total noise lin: %d, avg: %d\n",ue->measurements.rx_power_tot[eNB],
|
||||
ue->measurements.rx_power_avg[eNB], ue->measurements.n0_power_tot, ue->measurements.n0_power_avg);
|
||||
len += sprintf(&buffer[len], "[UE PROC] effective SINR %.2f dB\n",ue->sinr_eff);
|
||||
len += sprintf(&buffer[len], "[UE PROC] Wideband CQI eNB %d: %d dB, avg: %d dB\n",eNB,ue->measurements.wideband_cqi_tot[eNB],ue->measurements.wideband_cqi_avg[eNB]);
|
||||
|
||||
switch (ue->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d] dB\n",
|
||||
eNB,
|
||||
ue->measurements.subband_cqi_dB[eNB][0][0],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][1],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][2],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][3],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][4],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][5]);
|
||||
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d] dB\n",
|
||||
eNB,
|
||||
ue->measurements.subband_cqi_dB[eNB][1][0],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][1],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][2],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][3],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][4],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][5]);
|
||||
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
|
||||
eNB,
|
||||
ue->measurements.subband_pmi_re[eNB][0][0],
|
||||
ue->measurements.subband_pmi_im[eNB][0][0],
|
||||
ue->measurements.subband_pmi_re[eNB][1][0],
|
||||
ue->measurements.subband_pmi_im[eNB][1][0],
|
||||
ue->measurements.subband_pmi_re[eNB][2][0],
|
||||
ue->measurements.subband_pmi_im[eNB][2][0],
|
||||
ue->measurements.subband_pmi_re[eNB][3][0],
|
||||
ue->measurements.subband_pmi_im[eNB][3][0],
|
||||
ue->measurements.subband_pmi_re[eNB][4][0],
|
||||
ue->measurements.subband_pmi_im[eNB][4][0],
|
||||
ue->measurements.subband_pmi_re[eNB][5][0],
|
||||
ue->measurements.subband_pmi_im[eNB][5][0]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
|
||||
eNB,
|
||||
ue->measurements.subband_pmi_re[eNB][0][1],
|
||||
ue->measurements.subband_pmi_im[eNB][0][1],
|
||||
ue->measurements.subband_pmi_re[eNB][1][1],
|
||||
ue->measurements.subband_pmi_im[eNB][1][1],
|
||||
ue->measurements.subband_pmi_re[eNB][2][1],
|
||||
ue->measurements.subband_pmi_im[eNB][2][1],
|
||||
ue->measurements.subband_pmi_re[eNB][3][1],
|
||||
ue->measurements.subband_pmi_im[eNB][3][1],
|
||||
ue->measurements.subband_pmi_re[eNB][4][1],
|
||||
ue->measurements.subband_pmi_im[eNB][4][1],
|
||||
ue->measurements.subband_pmi_re[eNB][5][1],
|
||||
ue->measurements.subband_pmi_im[eNB][5][1]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d]\n",
|
||||
eNB,
|
||||
ue->measurements.selected_rx_antennas[eNB][0],
|
||||
ue->measurements.selected_rx_antennas[eNB][1],
|
||||
ue->measurements.selected_rx_antennas[eNB][2],
|
||||
ue->measurements.selected_rx_antennas[eNB][3],
|
||||
ue->measurements.selected_rx_antennas[eNB][4],
|
||||
ue->measurements.selected_rx_antennas[eNB][5]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,6)));
|
||||
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB,
|
||||
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,6)),
|
||||
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,6)));
|
||||
break;
|
||||
|
||||
case 25:
|
||||
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d] dB\n",
|
||||
eNB,
|
||||
ue->measurements.subband_cqi_dB[eNB][0][0],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][1],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][2],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][3],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][4],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][5],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][6]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d] dB\n",
|
||||
eNB,
|
||||
ue->measurements.subband_cqi_dB[eNB][1][0],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][1],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][2],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][3],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][4],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][5],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][6]);
|
||||
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
|
||||
eNB,
|
||||
ue->measurements.subband_pmi_re[eNB][0][0],
|
||||
ue->measurements.subband_pmi_im[eNB][0][0],
|
||||
ue->measurements.subband_pmi_re[eNB][1][0],
|
||||
ue->measurements.subband_pmi_im[eNB][1][0],
|
||||
ue->measurements.subband_pmi_re[eNB][2][0],
|
||||
ue->measurements.subband_pmi_im[eNB][2][0],
|
||||
ue->measurements.subband_pmi_re[eNB][3][0],
|
||||
ue->measurements.subband_pmi_im[eNB][3][0],
|
||||
ue->measurements.subband_pmi_re[eNB][4][0],
|
||||
ue->measurements.subband_pmi_im[eNB][4][0],
|
||||
ue->measurements.subband_pmi_re[eNB][5][0],
|
||||
ue->measurements.subband_pmi_im[eNB][5][0],
|
||||
ue->measurements.subband_pmi_re[eNB][6][0],
|
||||
ue->measurements.subband_pmi_im[eNB][6][0]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
|
||||
eNB,
|
||||
ue->measurements.subband_pmi_re[eNB][0][1],
|
||||
ue->measurements.subband_pmi_im[eNB][0][1],
|
||||
ue->measurements.subband_pmi_re[eNB][1][1],
|
||||
ue->measurements.subband_pmi_im[eNB][1][1],
|
||||
ue->measurements.subband_pmi_re[eNB][2][1],
|
||||
ue->measurements.subband_pmi_im[eNB][2][1],
|
||||
ue->measurements.subband_pmi_re[eNB][3][1],
|
||||
ue->measurements.subband_pmi_im[eNB][3][1],
|
||||
ue->measurements.subband_pmi_re[eNB][4][1],
|
||||
ue->measurements.subband_pmi_im[eNB][4][1],
|
||||
ue->measurements.subband_pmi_re[eNB][5][1],
|
||||
ue->measurements.subband_pmi_im[eNB][5][1],
|
||||
ue->measurements.subband_pmi_re[eNB][6][1],
|
||||
ue->measurements.subband_pmi_im[eNB][6][1]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d]\n",
|
||||
eNB,
|
||||
ue->measurements.selected_rx_antennas[eNB][0],
|
||||
ue->measurements.selected_rx_antennas[eNB][1],
|
||||
ue->measurements.selected_rx_antennas[eNB][2],
|
||||
ue->measurements.selected_rx_antennas[eNB][3],
|
||||
ue->measurements.selected_rx_antennas[eNB][4],
|
||||
ue->measurements.selected_rx_antennas[eNB][5],
|
||||
ue->measurements.selected_rx_antennas[eNB][6]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,7)));
|
||||
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB,
|
||||
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,7)),
|
||||
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,7)));
|
||||
break;
|
||||
|
||||
case 50:
|
||||
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d] dB\n",
|
||||
eNB,
|
||||
ue->measurements.subband_cqi_dB[eNB][0][0],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][1],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][2],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][3],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][4],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][5],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][6],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][7],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][8]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d] dB\n",
|
||||
eNB,
|
||||
ue->measurements.subband_cqi_dB[eNB][1][0],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][1],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][2],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][3],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][4],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][5],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][6],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][7],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][8]);
|
||||
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
|
||||
eNB,
|
||||
ue->measurements.subband_pmi_re[eNB][0][0],
|
||||
ue->measurements.subband_pmi_im[eNB][0][0],
|
||||
ue->measurements.subband_pmi_re[eNB][1][0],
|
||||
ue->measurements.subband_pmi_im[eNB][1][0],
|
||||
ue->measurements.subband_pmi_re[eNB][2][0],
|
||||
ue->measurements.subband_pmi_im[eNB][2][0],
|
||||
ue->measurements.subband_pmi_re[eNB][3][0],
|
||||
ue->measurements.subband_pmi_im[eNB][3][0],
|
||||
ue->measurements.subband_pmi_re[eNB][4][0],
|
||||
ue->measurements.subband_pmi_im[eNB][4][0],
|
||||
ue->measurements.subband_pmi_re[eNB][5][0],
|
||||
ue->measurements.subband_pmi_im[eNB][5][0],
|
||||
ue->measurements.subband_pmi_re[eNB][6][0],
|
||||
ue->measurements.subband_pmi_im[eNB][6][0],
|
||||
ue->measurements.subband_pmi_re[eNB][7][0],
|
||||
ue->measurements.subband_pmi_im[eNB][7][0],
|
||||
ue->measurements.subband_pmi_re[eNB][8][0],
|
||||
ue->measurements.subband_pmi_im[eNB][8][0]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
|
||||
eNB,
|
||||
ue->measurements.subband_pmi_re[eNB][0][1],
|
||||
ue->measurements.subband_pmi_im[eNB][0][1],
|
||||
ue->measurements.subband_pmi_re[eNB][1][1],
|
||||
ue->measurements.subband_pmi_im[eNB][1][1],
|
||||
ue->measurements.subband_pmi_re[eNB][2][1],
|
||||
ue->measurements.subband_pmi_im[eNB][2][1],
|
||||
ue->measurements.subband_pmi_re[eNB][3][1],
|
||||
ue->measurements.subband_pmi_im[eNB][3][1],
|
||||
ue->measurements.subband_pmi_re[eNB][4][1],
|
||||
ue->measurements.subband_pmi_im[eNB][4][1],
|
||||
ue->measurements.subband_pmi_re[eNB][5][1],
|
||||
ue->measurements.subband_pmi_im[eNB][5][1],
|
||||
ue->measurements.subband_pmi_re[eNB][6][1],
|
||||
ue->measurements.subband_pmi_im[eNB][6][1],
|
||||
ue->measurements.subband_pmi_re[eNB][7][1],
|
||||
ue->measurements.subband_pmi_im[eNB][7][1],
|
||||
ue->measurements.subband_pmi_re[eNB][8][1],
|
||||
ue->measurements.subband_pmi_im[eNB][8][1]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d]\n",
|
||||
eNB,
|
||||
ue->measurements.selected_rx_antennas[eNB][0],
|
||||
ue->measurements.selected_rx_antennas[eNB][1],
|
||||
ue->measurements.selected_rx_antennas[eNB][2],
|
||||
ue->measurements.selected_rx_antennas[eNB][3],
|
||||
ue->measurements.selected_rx_antennas[eNB][4],
|
||||
ue->measurements.selected_rx_antennas[eNB][5],
|
||||
ue->measurements.selected_rx_antennas[eNB][6],
|
||||
ue->measurements.selected_rx_antennas[eNB][7],
|
||||
ue->measurements.selected_rx_antennas[eNB][8]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,9)));
|
||||
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB,
|
||||
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,9)),
|
||||
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,9)));
|
||||
break;
|
||||
|
||||
case 100:
|
||||
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n",
|
||||
eNB,
|
||||
ue->measurements.subband_cqi_dB[eNB][0][0],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][1],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][2],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][3],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][4],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][5],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][6],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][7],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][8],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][9],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][10],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][11],
|
||||
ue->measurements.subband_cqi_dB[eNB][0][12]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n",
|
||||
eNB,
|
||||
ue->measurements.subband_cqi_dB[eNB][1][0],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][1],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][2],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][3],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][4],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][5],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][6],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][7],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][8],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][9],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][10],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][11],
|
||||
ue->measurements.subband_cqi_dB[eNB][1][12]);
|
||||
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
|
||||
eNB,
|
||||
ue->measurements.subband_pmi_re[eNB][0][0],
|
||||
ue->measurements.subband_pmi_im[eNB][0][0],
|
||||
ue->measurements.subband_pmi_re[eNB][1][0],
|
||||
ue->measurements.subband_pmi_im[eNB][1][0],
|
||||
ue->measurements.subband_pmi_re[eNB][2][0],
|
||||
ue->measurements.subband_pmi_im[eNB][2][0],
|
||||
ue->measurements.subband_pmi_re[eNB][3][0],
|
||||
ue->measurements.subband_pmi_im[eNB][3][0],
|
||||
ue->measurements.subband_pmi_re[eNB][4][0],
|
||||
ue->measurements.subband_pmi_im[eNB][4][0],
|
||||
ue->measurements.subband_pmi_re[eNB][5][0],
|
||||
ue->measurements.subband_pmi_im[eNB][5][0],
|
||||
ue->measurements.subband_pmi_re[eNB][6][0],
|
||||
ue->measurements.subband_pmi_im[eNB][6][0],
|
||||
ue->measurements.subband_pmi_re[eNB][7][0],
|
||||
ue->measurements.subband_pmi_im[eNB][7][0],
|
||||
ue->measurements.subband_pmi_re[eNB][8][0],
|
||||
ue->measurements.subband_pmi_im[eNB][8][0],
|
||||
ue->measurements.subband_pmi_re[eNB][9][0],
|
||||
ue->measurements.subband_pmi_im[eNB][9][0],
|
||||
ue->measurements.subband_pmi_re[eNB][10][0],
|
||||
ue->measurements.subband_pmi_im[eNB][10][0],
|
||||
ue->measurements.subband_pmi_re[eNB][11][0],
|
||||
ue->measurements.subband_pmi_im[eNB][11][0],
|
||||
ue->measurements.subband_pmi_re[eNB][12][0],
|
||||
ue->measurements.subband_pmi_im[eNB][12][0]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
|
||||
eNB,
|
||||
ue->measurements.subband_pmi_re[eNB][0][1],
|
||||
ue->measurements.subband_pmi_im[eNB][0][1],
|
||||
ue->measurements.subband_pmi_re[eNB][1][1],
|
||||
ue->measurements.subband_pmi_im[eNB][1][1],
|
||||
ue->measurements.subband_pmi_re[eNB][2][1],
|
||||
ue->measurements.subband_pmi_im[eNB][2][1],
|
||||
ue->measurements.subband_pmi_re[eNB][3][1],
|
||||
ue->measurements.subband_pmi_im[eNB][3][1],
|
||||
ue->measurements.subband_pmi_re[eNB][4][1],
|
||||
ue->measurements.subband_pmi_im[eNB][4][1],
|
||||
ue->measurements.subband_pmi_re[eNB][5][1],
|
||||
ue->measurements.subband_pmi_im[eNB][5][1],
|
||||
ue->measurements.subband_pmi_re[eNB][6][1],
|
||||
ue->measurements.subband_pmi_im[eNB][6][1],
|
||||
ue->measurements.subband_pmi_re[eNB][7][1],
|
||||
ue->measurements.subband_pmi_im[eNB][7][1],
|
||||
ue->measurements.subband_pmi_re[eNB][8][1],
|
||||
ue->measurements.subband_pmi_im[eNB][8][1],
|
||||
ue->measurements.subband_pmi_re[eNB][9][1],
|
||||
ue->measurements.subband_pmi_im[eNB][9][1],
|
||||
ue->measurements.subband_pmi_re[eNB][10][1],
|
||||
ue->measurements.subband_pmi_im[eNB][10][1],
|
||||
ue->measurements.subband_pmi_re[eNB][11][1],
|
||||
ue->measurements.subband_pmi_im[eNB][11][1],
|
||||
ue->measurements.subband_pmi_re[eNB][12][1],
|
||||
ue->measurements.subband_pmi_im[eNB][12][1]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d %d %d %d %d]\n",
|
||||
eNB,
|
||||
ue->measurements.selected_rx_antennas[eNB][0],
|
||||
ue->measurements.selected_rx_antennas[eNB][1],
|
||||
ue->measurements.selected_rx_antennas[eNB][2],
|
||||
ue->measurements.selected_rx_antennas[eNB][3],
|
||||
ue->measurements.selected_rx_antennas[eNB][4],
|
||||
ue->measurements.selected_rx_antennas[eNB][5],
|
||||
ue->measurements.selected_rx_antennas[eNB][6],
|
||||
ue->measurements.selected_rx_antennas[eNB][7],
|
||||
ue->measurements.selected_rx_antennas[eNB][8],
|
||||
ue->measurements.selected_rx_antennas[eNB][9],
|
||||
ue->measurements.selected_rx_antennas[eNB][10],
|
||||
ue->measurements.selected_rx_antennas[eNB][11],
|
||||
ue->measurements.selected_rx_antennas[eNB][12]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,13)));
|
||||
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB,
|
||||
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,13)),
|
||||
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,13)));
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef OPENAIR2
|
||||
RRC_status = mac_UE_get_rrc_status(ue->Mod_id, 0);
|
||||
len += sprintf(&buffer[len],"[UE PROC] RRC status = %d\n",RRC_status);
|
||||
#endif
|
||||
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] Transmission Mode %d \n",ue->transmission_mode[eNB]);
|
||||
len += sprintf(&buffer[len], "[UE PROC] PBCH err conseq %d, PBCH error total %d, PBCH FER %d\n",
|
||||
ue->pbch_vars[eNB]->pdu_errors_conseq,
|
||||
ue->pbch_vars[eNB]->pdu_errors,
|
||||
ue->pbch_vars[eNB]->pdu_fer);
|
||||
|
||||
if (ue->transmission_mode[eNB] == 6)
|
||||
len += sprintf(&buffer[len], "[UE PROC] Mode 6 Wideband CQI eNB %d : %d dB\n",eNB,ue->measurements.precoded_cqi_dB[eNB][0]);
|
||||
|
||||
for (harq_pid=0;harq_pid<8;harq_pid++) {
|
||||
len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 0 harq_pid %d, mcs %d:",eNB,harq_pid,ue->dlsch[0][0][0]->harq_processes[harq_pid]->mcs);
|
||||
for (round=0;round<8;round++)
|
||||
len+=sprintf(&buffer[len],"%d/%d ",
|
||||
ue->dlsch[0][0][0]->harq_processes[harq_pid]->errors[round],
|
||||
ue->dlsch[0][0][0]->harq_processes[harq_pid]->trials[round]);
|
||||
len+=sprintf(&buffer[len],"\n");
|
||||
}
|
||||
if (ue->dlsch[0][0] && ue->dlsch[0][0][0] && ue->dlsch[0][0][1]) {
|
||||
len += sprintf(&buffer[len], "[UE PROC] Saved PMI for DLSCH eNB %d : %jx (%p)\n",eNB,pmi2hex_2Ar1(ue->dlsch[0][0][0]->pmi_alloc),ue->dlsch[0][0][0]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] eNB %d: dl_power_off = %d\n",eNB,ue->dlsch[0][0][0]->harq_processes[0]->dl_power_off);
|
||||
|
||||
for (harq_pid=0;harq_pid<8;harq_pid++) {
|
||||
len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 1 harq_pid %d, mcs %d:",eNB,harq_pid,ue->dlsch[0][0][1]->harq_processes[0]->mcs);
|
||||
for (round=0;round<8;round++)
|
||||
len+=sprintf(&buffer[len],"%d/%d ",
|
||||
ue->dlsch[0][0][1]->harq_processes[harq_pid]->errors[round],
|
||||
ue->dlsch[0][0][1]->harq_processes[harq_pid]->trials[round]);
|
||||
len+=sprintf(&buffer[len],"\n");
|
||||
}
|
||||
}
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] DLSCH Total %d, Error %d, FER %d\n",ue->dlsch_received[0],ue->dlsch_errors[0],ue->dlsch_fer[0]);
|
||||
len += sprintf(&buffer[len], "[UE PROC] DLSCH (SI) Total %d, Error %d\n",ue->dlsch_SI_received[0],ue->dlsch_SI_errors[0]);
|
||||
len += sprintf(&buffer[len], "[UE PROC] DLSCH (RA) Total %d, Error %d\n",ue->dlsch_ra_received[0],ue->dlsch_ra_errors[0]);
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
int i=0;
|
||||
|
||||
//len += sprintf(&buffer[len], "[UE PROC] MCH Total %d\n", ue->dlsch_mch_received[0]);
|
||||
for(i=0; i <ue->frame_parms.num_MBSFN_config; i++ ) {
|
||||
len += sprintf(&buffer[len], "[UE PROC] MCH (MCCH MBSFN %d) Total %d, Error %d, Trials %d\n",
|
||||
i, ue->dlsch_mcch_received[i][0],ue->dlsch_mcch_errors[i][0],ue->dlsch_mcch_trials[i][0]);
|
||||
len += sprintf(&buffer[len], "[UE PROC] MCH (MTCH MBSFN %d) Total %d, Error %d, Trials %d\n",
|
||||
i, ue->dlsch_mtch_received[i][0],ue->dlsch_mtch_errors[i][0],ue->dlsch_mtch_trials[i][0]);
|
||||
}
|
||||
|
||||
#endif
|
||||
len += sprintf(&buffer[len], "[UE PROC] DLSCH Bitrate %dkbps\n",(ue->bitrate[0]/1000));
|
||||
len += sprintf(&buffer[len], "[UE PROC] Total Received Bits %dkbits\n",(ue->total_received_bits[0]/1000));
|
||||
len += sprintf(&buffer[len], "[UE PROC] IA receiver %d\n",ue->use_ia_receiver);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
len += sprintf(&buffer[len], "[UE PROC] Frame count: %d, RSSI %3.2f dB (%d dB, %d dB), N0 %3.2f dB (%d dB, %d dB)\n",
|
||||
proc->frame_rx,
|
||||
10*log10(ue->measurements.rssi),
|
||||
ue->measurements.rx_power_dB[0][0],
|
||||
ue->measurements.rx_power_dB[0][1],
|
||||
10*log10(ue->measurements.n0_power_tot),
|
||||
ue->measurements.n0_power_dB[0],
|
||||
ue->measurements.n0_power_dB[1]);
|
||||
#ifdef EXMIMO
|
||||
ue->rx_total_gain_dB = ((int)(10*log10(ue->measurements.rssi)))-input_level_dBm;
|
||||
len += sprintf(&buffer[len], "[UE PROC] rxg_mode %d, input level (set by user) %d dBm, VGA gain %d dB ==> total gain %3.2f dB, noise figure %3.2f dB\n",
|
||||
openair0_cfg[0].rxg_mode[0],
|
||||
input_level_dBm,
|
||||
(int)openair0_cfg[0].rx_gain[0],
|
||||
10*log10(ue->measurements.rssi)-input_level_dBm,
|
||||
10*log10(ue->measurements.n0_power_tot)-ue->rx_total_gain_dB+105);
|
||||
#endif
|
||||
}
|
||||
|
||||
len += sprintf(&buffer[len],"EOF\n");
|
||||
|
||||
return len;
|
||||
} // is_clusterhead
|
||||
|
||||
/*
|
||||
int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length)
|
||||
{
|
||||
|
||||
unsigned int success=0;
|
||||
uint8_t eNB_id,UE_id,i,j,number_of_cards_l=1;
|
||||
uint32_t ulsch_errors=0,dlsch_errors=0;
|
||||
uint32_t ulsch_round_attempts[4]= {0,0,0,0},ulsch_round_errors[4]= {0,0,0,0};
|
||||
uint32_t dlsch_round_attempts[4]= {0,0,0,0},dlsch_round_errors[4]= {0,0,0,0};
|
||||
uint32_t UE_id_mac, RRC_status;
|
||||
eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];
|
||||
if (eNB==NULL)
|
||||
return 0;
|
||||
|
||||
int len = length;
|
||||
|
||||
// if(eNB->frame==0){
|
||||
eNB->total_dlsch_bitrate = 0;//eNB->UE_stats[UE_id].dlsch_bitrate + eNB->total_dlsch_bitrate;
|
||||
eNB->total_transmitted_bits = 0;// eNB->UE_stats[UE_id].total_transmitted_bits + eNB->total_transmitted_bits;
|
||||
eNB->total_system_throughput = 0;//eNB->UE_stats[UE_id].total_transmitted_bits + eNB->total_system_throughput;
|
||||
// }
|
||||
|
||||
for (eNB_id=0; eNB_id<number_of_cards_l; eNB_id++) {
|
||||
len += sprintf(&buffer[len],"eNB %d/%d Frame %d: RX Gain %d dB, I0 %d dBm (%d,%d) dB \n",
|
||||
eNB_id,number_of_cards_l,
|
||||
proc->frame_tx,
|
||||
eNB->rx_total_gain_dB,
|
||||
eNB->measurements.n0_power_tot_dBm,
|
||||
eNB->measurements.n0_power_dB[0],
|
||||
eNB->measurements.n0_power_dB[1]);
|
||||
|
||||
len += sprintf(&buffer[len],"PRB I0 (%X.%X.%X.%X): ",
|
||||
eNB->rb_mask_ul[0],
|
||||
eNB->rb_mask_ul[1],eNB->rb_mask_ul[2],eNB->rb_mask_ul[3]);
|
||||
|
||||
for (i=0; i<eNB->frame_parms.N_RB_UL; i++) {
|
||||
len += sprintf(&buffer[len],"%4d ",
|
||||
eNB->measurements.n0_subband_power_tot_dBm[i]);
|
||||
if ((i>0) && ((i%25) == 0))
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
}
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
len += sprintf(&buffer[len],"\nPERFORMANCE PARAMETERS\n");
|
||||
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
if (eNB &&
|
||||
(eNB->dlsch!=NULL) &&
|
||||
(eNB->dlsch[(uint8_t)UE_id]!=NULL) &&
|
||||
(eNB->dlsch[(uint8_t)UE_id][0]->rnti>0)&&
|
||||
(eNB->UE_stats[UE_id].mode == PUSCH)) {
|
||||
|
||||
eNB->total_dlsch_bitrate = eNB->UE_stats[UE_id].dlsch_bitrate + eNB->total_dlsch_bitrate;
|
||||
eNB->total_transmitted_bits = eNB->UE_stats[UE_id].total_TBS + eNB->total_transmitted_bits;
|
||||
|
||||
//eNB->total_system_throughput = eNB->UE_stats[UE_id].total_transmitted_bits + eNB->total_system_throughput;
|
||||
|
||||
for (i=0; i<8; i++)
|
||||
success = success + (eNB->UE_stats[UE_id].dlsch_trials[i][0] - eNB->UE_stats[UE_id].dlsch_l2_errors[i]);
|
||||
|
||||
|
||||
|
||||
len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(eNB->total_transmitted_bits/1000),proc->frame_tx+1);
|
||||
len += sprintf(&buffer[len],"Total DLSCH throughput %d kbps ",(eNB->total_dlsch_bitrate/1000));
|
||||
len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,proc->frame_tx+1);
|
||||
//len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->FULL_MUMIMO_transmissions,eNB->check_for_total_transmissions);
|
||||
//len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_MUMIMO_transmissions,eNB->check_for_total_transmissions);
|
||||
//len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_SUMIMO_transmissions,eNB->check_for_total_transmissions);
|
||||
|
||||
len += sprintf(&buffer[len],"UE %d (%x) Power: (%d,%d) dB, Po_PUSCH: (%d,%d) dBm, Po_PUCCH (%d/%d) dBm, Po_PUCCH1 (%d,%d) dBm, PUCCH1 Thres %d dBm \n",
|
||||
UE_id,
|
||||
eNB->UE_stats[UE_id].crnti,
|
||||
dB_fixed(eNB->pusch_vars[UE_id]->ulsch_power[0]),
|
||||
dB_fixed(eNB->pusch_vars[UE_id]->ulsch_power[1]),
|
||||
eNB->UE_stats[UE_id].UL_rssi[0],
|
||||
eNB->UE_stats[UE_id].UL_rssi[1],
|
||||
dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB,
|
||||
eNB->frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
|
||||
dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH1_below/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB,
|
||||
dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH1_above/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB,
|
||||
PUCCH1_THRES+eNB->measurements.n0_power_tot_dBm-dB_fixed(eNB->frame_parms.N_RB_UL));
|
||||
|
||||
len+= sprintf(&buffer[len],"DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d, ",
|
||||
eNB->dlsch[(uint8_t)UE_id][0]->harq_processes[0]->mcs,
|
||||
eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->mcs,
|
||||
eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->nb_rb,
|
||||
eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->delta_TF);
|
||||
|
||||
len += sprintf(&buffer[len],"Wideband CQI: (%d,%d) dB\n",
|
||||
eNB->measurements.wideband_cqi_dB[UE_id][0],
|
||||
eNB->measurements.wideband_cqi_dB[UE_id][1]);
|
||||
|
||||
len += sprintf(&buffer[len],"DL TM %d, DL_cqi %d, DL_pmi_single %jx ",
|
||||
eNB->transmission_mode[UE_id],
|
||||
eNB->UE_stats[UE_id].DL_cqi[0],
|
||||
pmi2hex_2Ar1(eNB->UE_stats[UE_id].DL_pmi_single));
|
||||
|
||||
len += sprintf(&buffer[len],"Timing advance %d samples (%d 16Ts), update %d ",
|
||||
eNB->UE_stats[UE_id].UE_timing_offset,
|
||||
eNB->UE_stats[UE_id].UE_timing_offset>>2,
|
||||
eNB->UE_stats[UE_id].timing_advance_update);
|
||||
|
||||
len += sprintf(&buffer[len],"Mode = %s(%d) ",
|
||||
mode_string[eNB->UE_stats[UE_id].mode],
|
||||
eNB->UE_stats[UE_id].mode);
|
||||
UE_id_mac = find_UE_id(eNB->Mod_id,eNB->dlsch[(uint8_t)UE_id][0]->rnti);
|
||||
|
||||
if (UE_id_mac != -1) {
|
||||
RRC_status = mac_eNB_get_rrc_status(eNB->Mod_id,eNB->dlsch[(uint8_t)UE_id][0]->rnti);
|
||||
len += sprintf(&buffer[len],"UE_id_mac = %d, RRC status = %d\n",UE_id_mac,RRC_status);
|
||||
} else
|
||||
len += sprintf(&buffer[len],"UE_id_mac = -1\n");
|
||||
|
||||
len += sprintf(&buffer[len],"SR received/total: %d/%d (diff %d)\n",
|
||||
eNB->UE_stats[UE_id].sr_received,
|
||||
eNB->UE_stats[UE_id].sr_total,
|
||||
eNB->UE_stats[UE_id].sr_total-eNB->UE_stats[UE_id].sr_received);
|
||||
|
||||
len += sprintf(&buffer[len],"DL Subband CQI: ");
|
||||
|
||||
int nb_sb;
|
||||
switch (eNB->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
nb_sb=0;
|
||||
break;
|
||||
case 15:
|
||||
nb_sb = 4;
|
||||
case 25:
|
||||
nb_sb = 7;
|
||||
break;
|
||||
case 50:
|
||||
nb_sb = 9;
|
||||
break;
|
||||
case 75:
|
||||
nb_sb = 10;
|
||||
break;
|
||||
case 100:
|
||||
nb_sb = 13;
|
||||
break;
|
||||
default:
|
||||
nb_sb=0;
|
||||
break;
|
||||
}
|
||||
for (i=0; i<nb_sb; i++)
|
||||
len += sprintf(&buffer[len],"%2d ",
|
||||
eNB->UE_stats[UE_id].DL_subband_cqi[0][i]);
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
|
||||
|
||||
|
||||
ulsch_errors = 0;
|
||||
|
||||
for (j=0; j<4; j++) {
|
||||
ulsch_round_attempts[j]=0;
|
||||
ulsch_round_errors[j]=0;
|
||||
}
|
||||
|
||||
len += sprintf(&buffer[len],"ULSCH errors/attempts per harq (per round): \n");
|
||||
|
||||
for (i=0; i<8; i++) {
|
||||
len += sprintf(&buffer[len]," harq %d: %d/%d (fer %d) (%d/%d, %d/%d, %d/%d, %d/%d) ",
|
||||
i,
|
||||
eNB->UE_stats[UE_id].ulsch_errors[i],
|
||||
eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][0],
|
||||
eNB->UE_stats[UE_id].ulsch_round_fer[i][0],
|
||||
eNB->UE_stats[UE_id].ulsch_round_errors[i][0],
|
||||
eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][0],
|
||||
eNB->UE_stats[UE_id].ulsch_round_errors[i][1],
|
||||
eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][1],
|
||||
eNB->UE_stats[UE_id].ulsch_round_errors[i][2],
|
||||
eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][2],
|
||||
eNB->UE_stats[UE_id].ulsch_round_errors[i][3],
|
||||
eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][3]);
|
||||
if ((i&1) == 1)
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
|
||||
ulsch_errors+=eNB->UE_stats[UE_id].ulsch_errors[i];
|
||||
|
||||
for (j=0; j<4; j++) {
|
||||
ulsch_round_attempts[j]+=eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][j];
|
||||
ulsch_round_errors[j]+=eNB->UE_stats[UE_id].ulsch_round_errors[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
len += sprintf(&buffer[len],"ULSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d)\n",
|
||||
ulsch_errors,ulsch_round_attempts[0],
|
||||
|
||||
ulsch_round_errors[0],ulsch_round_attempts[0],
|
||||
ulsch_round_errors[1],ulsch_round_attempts[1],
|
||||
ulsch_round_errors[2],ulsch_round_attempts[2],
|
||||
ulsch_round_errors[3],ulsch_round_attempts[3]);
|
||||
|
||||
dlsch_errors = 0;
|
||||
|
||||
for (j=0; j<4; j++) {
|
||||
dlsch_round_attempts[j]=0;
|
||||
dlsch_round_errors[j]=0;
|
||||
}
|
||||
|
||||
len += sprintf(&buffer[len],"DLSCH errors/attempts per harq (per round): \n");
|
||||
|
||||
for (i=0; i<8; i++) {
|
||||
len += sprintf(&buffer[len]," harq %d: %d/%d (%d/%d/%d, %d/%d/%d, %d/%d/%d, %d/%d/%d) ",
|
||||
i,
|
||||
eNB->UE_stats[UE_id].dlsch_l2_errors[i],
|
||||
eNB->UE_stats[UE_id].dlsch_trials[i][0],
|
||||
eNB->UE_stats[UE_id].dlsch_ACK[i][0],
|
||||
eNB->UE_stats[UE_id].dlsch_NAK[i][0],
|
||||
eNB->UE_stats[UE_id].dlsch_trials[i][0],
|
||||
eNB->UE_stats[UE_id].dlsch_ACK[i][1],
|
||||
eNB->UE_stats[UE_id].dlsch_NAK[i][1],
|
||||
eNB->UE_stats[UE_id].dlsch_trials[i][1],
|
||||
eNB->UE_stats[UE_id].dlsch_ACK[i][2],
|
||||
eNB->UE_stats[UE_id].dlsch_NAK[i][2],
|
||||
eNB->UE_stats[UE_id].dlsch_trials[i][2],
|
||||
eNB->UE_stats[UE_id].dlsch_ACK[i][3],
|
||||
eNB->UE_stats[UE_id].dlsch_NAK[i][3],
|
||||
eNB->UE_stats[UE_id].dlsch_trials[i][3]);
|
||||
if ((i&1) == 1)
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
|
||||
|
||||
dlsch_errors+=eNB->UE_stats[UE_id].dlsch_l2_errors[i];
|
||||
|
||||
for (j=0; j<4; j++) {
|
||||
dlsch_round_attempts[j]+=eNB->UE_stats[UE_id].dlsch_trials[i][j];
|
||||
dlsch_round_errors[j]+=eNB->UE_stats[UE_id].dlsch_NAK[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
len += sprintf(&buffer[len],"DLSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d): \n",
|
||||
dlsch_errors,dlsch_round_attempts[0],
|
||||
dlsch_round_errors[0],dlsch_round_attempts[0],
|
||||
dlsch_round_errors[1],dlsch_round_attempts[1],
|
||||
dlsch_round_errors[2],dlsch_round_attempts[2],
|
||||
dlsch_round_errors[3],dlsch_round_attempts[3]);
|
||||
|
||||
|
||||
len += sprintf(&buffer[len],"DLSCH total bits from MAC: %dkbit ",(eNB->UE_stats[UE_id].total_TBS_MAC)/1000);
|
||||
len += sprintf(&buffer[len],"DLSCH total bits ack'ed: %dkbit ",(eNB->UE_stats[UE_id].total_TBS)/1000);
|
||||
len += sprintf(&buffer[len],"DLSCH Average throughput (100 frames): %dkbps\n",(eNB->UE_stats[UE_id].dlsch_bitrate/1000));
|
||||
// len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",eNB->transmission_mode[UE_id]);
|
||||
}
|
||||
}
|
||||
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
}
|
||||
|
||||
len += sprintf(&buffer[len],"EOF\n");
|
||||
|
||||
return len;
|
||||
}
|
||||
*/
|
||||
@@ -718,7 +718,11 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
uint8_t *payload,
|
||||
int frame,
|
||||
uint8_t subframe,
|
||||
uint8_t pucch1_thres)
|
||||
uint8_t pucch1_thres
|
||||
#ifdef Rel14
|
||||
,uint8_t br_flag
|
||||
#endif
|
||||
)
|
||||
{
|
||||
|
||||
|
||||
@@ -727,7 +731,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
|
||||
// PUCCH_CONFIG_DEDICATED *pucch_config_dedicated = &eNB->pucch_config_dedicated[UE_id];
|
||||
|
||||
int8_t sigma2_dB = 20;//eNB->measurements.n0_subband_power_tot_dB[0]-10;
|
||||
int8_t sigma2_dB = max(eNB->measurements.n0_subband_power_tot_dB[0],
|
||||
eNB->measurements.n0_subband_power_tot_dB[eNB->frame_parms.N_RB_UL-1]);
|
||||
|
||||
uint32_t u,v,n,aa;
|
||||
uint32_t z[12*14];
|
||||
@@ -984,14 +989,25 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
|
||||
//for (j=0,l=0;l<(nsymb-1);l++) {
|
||||
for (j=0,l=0; l<nsymb; l++) {
|
||||
if ((l<(nsymb>>1)) && ((m&1) == 0))
|
||||
re_offset = (m*6) + frame_parms->first_carrier_offset;
|
||||
else if ((l<(nsymb>>1)) && ((m&1) == 1))
|
||||
re_offset = frame_parms->first_carrier_offset + (frame_parms->N_RB_DL - (m>>1) - 1)*12;
|
||||
else if ((m&1) == 0)
|
||||
re_offset = frame_parms->first_carrier_offset + (frame_parms->N_RB_DL - (m>>1) - 1)*12;
|
||||
#ifdef Rel14
|
||||
if (br_flag > 0 ) {
|
||||
if ((m&1) == 0)
|
||||
re_offset = (m*6) + frame_parms->first_carrier_offset;
|
||||
else
|
||||
re_offset = frame_parms->first_carrier_offset + (frame_parms->N_RB_DL - (m>>1) - 1)*12;
|
||||
}
|
||||
else
|
||||
re_offset = ((m-1)*6) + frame_parms->first_carrier_offset;
|
||||
#endif
|
||||
{
|
||||
if ((l<(nsymb>>1)) && ((m&1) == 0))
|
||||
re_offset = (m*6) + frame_parms->first_carrier_offset;
|
||||
else if ((l<(nsymb>>1)) && ((m&1) == 1))
|
||||
re_offset = frame_parms->first_carrier_offset + (frame_parms->N_RB_DL - (m>>1) - 1)*12;
|
||||
else if ((m&1) == 0)
|
||||
re_offset = frame_parms->first_carrier_offset + (frame_parms->N_RB_DL - (m>>1) - 1)*12;
|
||||
else
|
||||
re_offset = ((m-1)*6) + frame_parms->first_carrier_offset;
|
||||
}
|
||||
|
||||
if (re_offset > frame_parms->ofdm_symbol_size)
|
||||
re_offset -= (frame_parms->ofdm_symbol_size);
|
||||
@@ -1302,7 +1318,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
printf("[eNB] PUCCH subframe %d chest1[%d][%d] => (%d,%d)\n",subframe,aa,re,
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
/// Status Flag indicating for this DLSCH (idle,active,disabled)
|
||||
SCH_status_t status;
|
||||
@@ -443,6 +444,10 @@ typedef struct {
|
||||
} LTE_eNB_UE_stats;
|
||||
|
||||
typedef struct {
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
/// UE type (normal, CEModeA, CEModeB)
|
||||
uint8_t ue_type;
|
||||
#endif
|
||||
/// HARQ process mask, indicates which processes are currently active
|
||||
uint16_t harq_mask;
|
||||
/// Pointers to 8 HARQ processes for the ULSCH
|
||||
|
||||
@@ -385,6 +385,8 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
|
||||
uint32_t sub_frame_offset);
|
||||
|
||||
|
||||
void generate_mdci_top(PHY_VARS_eNB * eNB, int frame, int subframe, int16_t amp, int32_t ** txdataF);
|
||||
|
||||
void generate_64qam_table(void);
|
||||
void generate_16qam_table(void);
|
||||
|
||||
@@ -421,6 +423,8 @@ void fill_dci0(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc,DCI
|
||||
|
||||
void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame,int subframe);
|
||||
|
||||
void fill_mpdcch_dci0 (PHY_VARS_eNB * eNB, L1_rxtx_proc_t * proc, mDCI_ALLOC_t * dci_alloc, nfapi_hi_dci0_mpdcch_dci_pdu * pdu);
|
||||
|
||||
int generate_eNB_ulsch_params_from_rar(PHY_VARS_eNB *eNB,
|
||||
unsigned char *rar_pdu,
|
||||
uint32_t frame,
|
||||
|
||||
@@ -806,10 +806,16 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
|
||||
|
||||
|
||||
|
||||
harq_pid = subframe2harq_pid(frame_parms,frame,subframe);
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if (ulsch->ue_type>0) harq_pid = 0;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
harq_pid = subframe2harq_pid(frame_parms,proc->frame_rx,subframe);
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,1);
|
||||
|
||||
|
||||
// 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];
|
||||
|
||||
@@ -1127,17 +1127,20 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
|
||||
int16_t *llrp;
|
||||
int subframe = proc->subframe_rx;
|
||||
|
||||
harq_pid = subframe2harq_pid(frame_parms,proc->frame_rx,subframe);
|
||||
#ifdef Rel14
|
||||
if (ulsch[UE_id]->ue_type > 0) harq_pid =0;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
harq_pid = subframe2harq_pid(frame_parms,proc->frame_rx,subframe);
|
||||
}
|
||||
Qm = ulsch[UE_id]->harq_processes[harq_pid]->Qm;
|
||||
if(LOG_DEBUGFLAG(DEBUG_ULSCH)) {
|
||||
LOG_I(PHY,"rx_ulsch: harq_pid %d, nb_rb %d first_rb %d\n",harq_pid,ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,ulsch[UE_id]->harq_processes[harq_pid]->first_rb);
|
||||
}
|
||||
|
||||
if (ulsch[UE_id]->harq_processes[harq_pid]->nb_rb == 0) {
|
||||
LOG_E(PHY,"PUSCH (%d/%x) nb_rb=0!\n", harq_pid,ulsch[UE_id]->rnti);
|
||||
return;
|
||||
}
|
||||
|
||||
AssertFatal(ulsch[UE_id]->harq_processes[harq_pid]->nb_rb > 0,
|
||||
"PUSCH (%d/%x) nb_rb=0!\n", harq_pid,ulsch[UE_id]->rnti);
|
||||
for (l=0; l<(frame_parms->symbols_per_tti-ulsch[UE_id]->harq_processes[harq_pid]->srs_active); l++) {
|
||||
|
||||
if(LOG_DEBUGFLAG(DEBUG_ULSCH)) {
|
||||
|
||||
@@ -1361,6 +1361,10 @@ void init_ul_hopping(LTE_DL_FRAME_PARMS *frame_parms);
|
||||
@param nB nB from 36.304 (0=4T,1=2T,2=T,3=T/2,4=T/4,5=T/8,6=T/16,7=T/32*/
|
||||
int init_ue_paging_info(PHY_VARS_UE *ue, long defaultPagingCycle, long nB);
|
||||
|
||||
#ifdef Rel14
|
||||
void init_mpdcch(PHY_VARS_eNB *eNB);
|
||||
#endif
|
||||
|
||||
int32_t compareints (const void * a, const void * b);
|
||||
|
||||
|
||||
@@ -1606,7 +1610,6 @@ void generate_pucch3x(int32_t **txdataF,
|
||||
uint8_t subframe,
|
||||
uint16_t rnti);
|
||||
|
||||
|
||||
void init_ulsch_power_LUT(void);
|
||||
|
||||
/*!
|
||||
|
||||
@@ -808,6 +808,8 @@ typedef struct {
|
||||
uint8_t harq_pid;
|
||||
/// Narrowband index
|
||||
uint8_t narrowband;
|
||||
/// number of mdpcch repetitions
|
||||
uint16_t reps;
|
||||
/// number of PRB pairs for MPDCCH
|
||||
uint8_t number_of_prb_pairs;
|
||||
/// mpdcch resource assignment (combinatorial index r)
|
||||
@@ -822,8 +824,6 @@ typedef struct {
|
||||
uint16_t dmrs_scrambling_init;
|
||||
/// Absolute subframe of the initial transmission (0-10239)
|
||||
uint16_t i0;
|
||||
/// number of mdpcch repetitions
|
||||
uint16_t reps;
|
||||
/// current absolute subframe number
|
||||
uint16_t absSF;
|
||||
/// DCI pdu
|
||||
|
||||
@@ -68,4 +68,5 @@ typedef struct {
|
||||
int32_t **tdd_calib_coeffs;
|
||||
} RU_COMMON;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
This folder contains the software for the device driver of CBMIMO1 and the physical layer signal processing.
|
||||
This folder contains the software for layer 1 of the OpenAirInterface eNB and UE as well as the unitary simulators
|
||||
|
||||
|-- PHY // contains all signal processing related to physical layer (used in real-time AND simulation)
|
||||
|
||||
General remarks: every directory contains at least defs.h (for declaration of structure and functions), vars.h (for definitions of variables), and extern.h (variables are defined only once in cbmimo1_device.c (for real-time HW operation) or a top-level simulation (in SIMULATION/xxx), if variables are needed in another file, use extern.h)
|
||||
General remarks: every directory contains at least defs.h (for declaration of structure and functions), vars.h (for definitions of variables), and extern.h (variables are defined only once in xxx-softmodem.c (for real-time HW operation) or a top-level simulation (in SIMULATION/xxx), if variables are needed in another file, use extern.h)
|
||||
|
||||
| |-- CODING // turbo and convolutional (de-)coders, rate-matching, crc generation (implementation of 36-212)
|
||||
| | `-- TESTBENCH // This contains unitary testbenches for the different channel coders/decoders
|
||||
| |-- INIT // variables defined in vars.h are initialzed here (memory allocation)
|
||||
| |-- LTE_ESTIMATION // estimation for LTE
|
||||
| |-- LTE_REFSIG // reference signals for LTE (sync and pilot sequences) reference signals from 36-211
|
||||
| |-- NR_REFSIG // reference signals for NR (sync and pilot sequences) reference signals from 38-211
|
||||
| |-- LTE_TRANSPORT // these are the top level routines for different transport and physical channels (for example DL-SCH, PSS) implements a subset of 36-211,36-212
|
||||
| |-- LTE_UE_TRANSPORT // these are the top level routines for different transport and physical channels (for example DL-SCH, PSS) implements a subset of 36-211,36-212
|
||||
| |-- NR_TRANSPORT // these are the top level routines for different transport and physical channels (for example DL-SCH, PSS) implements a subset of 38-211,38-212
|
||||
| |-- NR_UE_TRANSPORT // these are the top level routines for different transport and physical channels (for example DL-SCH, PSS) implements a subset of 38-211,38-212
|
||||
| |-- NBIoT_TRANSPORT // these are the top level routines for different transport and physical channels for NB-IoT
|
||||
| |-- MODULATION // modulation and demodulation includes FFT/SC-FDMA front-end processing from 36-211
|
||||
| |-- TOOLS // tools like (I)FFT, vector operations, matrix multiplication, etc.
|
||||
| | `-- FFTTEST // unitary testbench for FFT routines
|
||||
@@ -22,20 +27,25 @@ General remarks: every directory contains at least defs.h (for declaration of st
|
||||
| |-- spec_defs_top.h
|
||||
| |-- types.h
|
||||
| `-- vars.h
|
||||
|-- SCHED // schedules the different PHY functions according to the nodes role
|
||||
|-- SCHED // schedules the different LTE eNB functions
|
||||
| |-- defs.h
|
||||
| |-- extern.h
|
||||
| |-- phy_procedures_emos.c // non-LTE PHY procedures for EMOS
|
||||
| |-- phy_procedures_emos.h
|
||||
| |-- phy_procedures_lte_eNb.c // LTE PHY procedures for eNB (from 36-213)
|
||||
| |-- phy_procedures_lte_ue.c // LTE PHY procedures for UE (from 36-213)
|
||||
| |-- phy_procedures_lte_common.c // LTE PHY procedures common for UE and eNB (from 36-213)
|
||||
| |-- prach_procedures.c //LTE PRACH procedures (from 36-213)
|
||||
| |-- ru_procedures.c //RU procedures
|
||||
| |-- fapi_l1.c //L1 side of the FAPI interface
|
||||
| |-- phy_mac_stub.c //MAC stub that generates channels when used in phy-test-mode
|
||||
| |-- rt_compat.h
|
||||
| `-- vars.h
|
||||
|-- SCHED_UE // schedules the different LTE UE functions
|
||||
| |-- phy_procedures_lte_ue.c // LTE PHY procedures for UE (from 36-213)
|
||||
| |-- pucch_pc.c // power control for PUCCH
|
||||
| |-- pusch_pc.c // power control for PUSCH
|
||||
| |-- srs_pc.c // power control for SRS
|
||||
| |-- rt_compat.h
|
||||
| `-- vars.h
|
||||
|-- SCHED_NB_IOT // same as above for NB-IOT
|
||||
|-- SCHED_NR // same as above for NR gNB
|
||||
|-- SCHED_NR_UE // same as above for NR UE
|
||||
|-- SIMULATION // contains simulation routines to test PHY
|
||||
| |-- LTE_PHY // LTE simulation testbenches for unitary simulation of transport/physical channels
|
||||
| | |-- pbchsim.c // PBCH simulation testbench
|
||||
@@ -43,7 +53,7 @@ General remarks: every directory contains at least defs.h (for declaration of st
|
||||
| | |-- dlsim.c // PDSCH simulation testbench
|
||||
| | |-- ulsim.c // PUSCH simulation testbench
|
||||
| | |-- pucchsim.c // PUCCH simulation testbench
|
||||
| |-- RF
|
||||
| |-- RF // RF simulation tools
|
||||
| |-- ETH_TRANSPORT
|
||||
| `-- TOOLS
|
||||
|
||||
|
||||
@@ -55,6 +55,8 @@ void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,
|
||||
LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[idx];
|
||||
nfapi_dl_config_dci_dl_pdu *pdu = &dl_config_pdu->dci_dl_pdu;
|
||||
|
||||
if (nfapi_mode==2) return;
|
||||
|
||||
LOG_D(PHY,"Frame %d, Subframe %d: DCI processing - populating pdcch_vars->dci_alloc[%d] proc:subframe_tx:%d idx:%d pdcch_vars->num_dci:%d\n",frame,subframe, pdcch_vars->num_dci, proc->subframe_tx, idx, pdcch_vars->num_dci);
|
||||
|
||||
// copy dci configuration into eNB structure
|
||||
@@ -73,6 +75,8 @@ void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB,
|
||||
LTE_eNB_MPDCCH *mpdcch_vars = &eNB->mpdcch_vars[idx];
|
||||
nfapi_dl_config_mpdcch_pdu *pdu = &dl_config_pdu->mpdcch_pdu;
|
||||
|
||||
if (nfapi_mode==2) return;
|
||||
|
||||
LOG_D(PHY,"Frame %d, Subframe %d: MDCI processing\n",proc->frame_tx,proc->subframe_tx);
|
||||
|
||||
// copy dci configuration into eNB structure
|
||||
@@ -87,17 +91,35 @@ void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rx
|
||||
int idx = subframe&1;
|
||||
LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[idx];
|
||||
|
||||
if (nfapi_mode==2) return;
|
||||
|
||||
//LOG_D(PHY,"%s() SFN/SF:%04d%d Before num_dci:%d\n", __FUNCTION__,frame,subframe,pdcch_vars->num_dci);
|
||||
|
||||
// copy dci configuration in to eNB structure
|
||||
fill_dci0(eNB,frame,subframe,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci], &hi_dci0_config_pdu->dci_pdu);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void handle_nfapi_hi_dci0_mpdcch_dci_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
|
||||
nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu)
|
||||
{
|
||||
int idx = proc->subframe_tx&1;
|
||||
LTE_eNB_MPDCCH *pdcch_vars = &eNB->mpdcch_vars[idx];
|
||||
if (nfapi_mode==2) return;
|
||||
|
||||
// copy dci configuration in to eNB structure
|
||||
fill_mpdcch_dci0(eNB,proc,&pdcch_vars->mdci_alloc[pdcch_vars->num_dci], &hi_dci0_config_pdu->mpdcch_dci_pdu);
|
||||
}
|
||||
|
||||
|
||||
void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc,
|
||||
nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu)
|
||||
{
|
||||
LTE_eNB_PHICH *phich = &eNB->phich_vars[subframe&1];
|
||||
|
||||
if (nfapi_mode==2) return;
|
||||
|
||||
// copy dci configuration in to eNB structure
|
||||
LOG_D(PHY,"Received HI PDU with value %d (rbstart %d,cshift %d)\n",
|
||||
hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.hi_value,
|
||||
@@ -118,6 +140,8 @@ void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
|
||||
{
|
||||
nfapi_dl_config_bch_pdu_rel8_t *rel8 = &dl_config_pdu->bch_pdu.bch_pdu_rel8;
|
||||
|
||||
if (nfapi_mode==2) return;
|
||||
|
||||
AssertFatal(rel8->length == 3, "BCH PDU has length %d != 3\n",rel8->length);
|
||||
|
||||
//LOG_D(PHY,"bch_pdu: %x,%x,%x\n",sdu[0],sdu[1],sdu[2]);
|
||||
@@ -156,6 +180,8 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
|
||||
int UE_id;
|
||||
int harq_pid;
|
||||
|
||||
if (nfapi_mode==2) return;
|
||||
|
||||
UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE);
|
||||
if( (UE_id<0) || (UE_id>=NUMBER_OF_UE_MAX) ){
|
||||
LOG_E(PHY,"illegal UE_id found!!! rnti %04x UE_id %d\n",rel8->rnti,UE_id);
|
||||
@@ -168,24 +194,24 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
|
||||
dlsch1 = eNB->dlsch[UE_id][1];
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
|
||||
if ((rel13->pdsch_payload_type < 2) && (rel13->ue_type>0)) dlsch0->harq_ids[frame%2][subframe] = 0;
|
||||
if ((rel13->pdsch_payload_type < 2) && (rel13->ue_type>0)) dlsch0->harq_ids[proc->frame_tx%2][proc->subframe_tx] = 0;
|
||||
#endif
|
||||
|
||||
harq_pid = dlsch0->harq_ids[frame%2][subframe];
|
||||
harq_pid = dlsch0->harq_ids[proc->frame_tx%2][proc->subframe_tx];
|
||||
AssertFatal((harq_pid>=0) && (harq_pid<8),"harq_pid %d not in 0...7 frame:%d subframe:%d subframe(TX):%d rnti:%x UE_id:%d dlsch0[harq_ids:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d]\n",
|
||||
harq_pid,
|
||||
frame,subframe,
|
||||
proc->subframe_tx,rel8->rnti,UE_id,
|
||||
dlsch0->harq_ids[frame%2][0],
|
||||
dlsch0->harq_ids[frame%2][1],
|
||||
dlsch0->harq_ids[frame%2][2],
|
||||
dlsch0->harq_ids[frame%2][3],
|
||||
dlsch0->harq_ids[frame%2][4],
|
||||
dlsch0->harq_ids[frame%2][5],
|
||||
dlsch0->harq_ids[frame%2][6],
|
||||
dlsch0->harq_ids[frame%2][7],
|
||||
dlsch0->harq_ids[frame%2][8],
|
||||
dlsch0->harq_ids[frame%2][9]
|
||||
dlsch0->harq_ids[proc->frame_tx%2][0],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][1],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][2],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][3],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][4],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][5],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][6],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][7],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][8],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][9]
|
||||
);
|
||||
dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
dlsch1_harq = dlsch1->harq_processes[harq_pid];
|
||||
@@ -194,7 +220,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
|
||||
// compute DL power control parameters
|
||||
eNB->pdsch_config_dedicated[UE_id].p_a = rel8->pa;
|
||||
|
||||
#ifdef PHY_TX_THREAD
|
||||
#ifdef PHY_TX_THREAD
|
||||
if (dlsch0->active[proc->subframe_tx]){
|
||||
# else
|
||||
if (dlsch0->active){
|
||||
@@ -211,7 +237,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
|
||||
computeRhoB_eNB(rel8->pa,eNB->frame_parms.pdsch_config_common.p_b,eNB->frame_parms.nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off);
|
||||
}
|
||||
|
||||
dlsch0_harq->pdsch_start = eNB->pdcch_vars[subframe & 1].num_pdcch_symbols;
|
||||
dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols;
|
||||
|
||||
if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU
|
||||
if(sdu == NULL) {
|
||||
@@ -244,18 +270,36 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
|
||||
#endif
|
||||
|
||||
if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR
|
||||
UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE);
|
||||
AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n");
|
||||
AssertFatal(UE_id<NUMBER_OF_UE_MAX,"returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX);
|
||||
|
||||
dlsch0 = eNB->dlsch[UE_id][0];
|
||||
dlsch0->harq_mask = 1;
|
||||
dlsch0_harq = dlsch0->harq_processes[0];
|
||||
dlsch0_harq->pdu = sdu;
|
||||
|
||||
if (proc->frame_tx < 200) LOG_D(PHY,"NFAPI: frame %d, subframe %d (TX %d.%d): Programming SI-BR (%d) => %d\n",frame,subframe,proc->frame_tx,proc->subframe_tx,rel13->pdsch_payload_type,UE_id);
|
||||
|
||||
dlsch0->rnti = 0xFFFF;
|
||||
dlsch0->Kmimo = 1;
|
||||
dlsch0->Mdlharq = 4;
|
||||
dlsch0->Nsoft = 25344;
|
||||
|
||||
dlsch0->i0 = rel13->initial_transmission_sf_io;
|
||||
dlsch0_harq->pdsch_start = rel10->pdsch_start;
|
||||
dlsch0->harq_ids[proc->frame_tx%2][proc->subframe_rx] = 0;
|
||||
dlsch0_harq->frame = proc->frame_tx;
|
||||
dlsch0_harq->subframe = proc->subframe_tx;
|
||||
|
||||
|
||||
#ifdef PHY_TX_THREAD
|
||||
if (rel13->pdsch_payload_type == 0) dlsch0_harq->sib1_br_flag=1;
|
||||
#else
|
||||
if (rel13->pdsch_payload_type == 0) dlsch0->sib1_br_flag=1;
|
||||
#endif
|
||||
|
||||
// configure PDSCH
|
||||
// configure PDSCH
|
||||
switch (eNB->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT6[rel8->resource_block_coding];
|
||||
@@ -299,12 +343,19 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
|
||||
dlsch0_harq->codeword = 0;
|
||||
dlsch0_harq->pdsch_start = rel10->pdsch_start;
|
||||
}
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0_harq->i0 = rel13->initial_transmission_sf_io;
|
||||
#else
|
||||
dlsch0->i0 = rel13->initial_transmission_sf_io;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE);
|
||||
AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n");
|
||||
AssertFatal(UE_id<NUMBER_OF_UE_MAX,"returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX);
|
||||
|
||||
dlsch0 = eNB->dlsch[UE_id][0];
|
||||
dlsch1 = eNB->dlsch[UE_id][1];
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
dlsch0->sib1_br_flag=0;
|
||||
dlsch0->i0 = 0xFFFF;
|
||||
#endif
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
@@ -323,9 +374,52 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
|
||||
rel8->length
|
||||
);
|
||||
#endif
|
||||
|
||||
dlsch0->active = 1;
|
||||
harq_pid = dlsch0->harq_ids[frame%2][proc->subframe_tx];
|
||||
dlsch0->harq_mask |= (1<<harq_pid);
|
||||
|
||||
AssertFatal((harq_pid>=0) && (harq_pid<8),"subframe %d: harq_pid %d not in 0...7\n",proc->subframe_tx,harq_pid);
|
||||
dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
dlsch1_harq = dlsch1->harq_processes[harq_pid];
|
||||
AssertFatal(dlsch0_harq!=NULL,"dlsch_harq is null\n");
|
||||
|
||||
// compute DL power control parameters
|
||||
|
||||
|
||||
if (dlsch0->active){
|
||||
computeRhoA_eNB(rel8->pa,dlsch0,dlsch0_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB);
|
||||
computeRhoB_eNB(rel8->pa,eNB->frame_parms.pdsch_config_common.p_b,eNB->frame_parms.nb_antenna_ports_eNB,dlsch0,dlsch0_harq->dl_power_off);
|
||||
}
|
||||
if (dlsch1->active){
|
||||
computeRhoA_eNB(rel8->pa, dlsch1,dlsch1_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB);
|
||||
computeRhoB_eNB(rel8->pa,eNB->frame_parms.pdsch_config_common.p_b,eNB->frame_parms.nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off);
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols;
|
||||
#else
|
||||
dlsch0_harq->pdsch_start = rel10->pdsch_start;
|
||||
#endif
|
||||
if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU
|
||||
AssertFatal(sdu!=NULL,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d\n",
|
||||
proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid,
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index);
|
||||
if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d\n",
|
||||
proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid);
|
||||
if (codeword_index == 0) dlsch0_harq->pdu = sdu;
|
||||
else dlsch1_harq->pdu = sdu;
|
||||
}
|
||||
else {
|
||||
if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round %d, rnti %x, UE_id %d, harq_pid %d\n",
|
||||
proc->frame_tx,proc->subframe_tx,dlsch0_harq->round,
|
||||
rel8->rnti,UE_id,harq_pid);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t to_beta_offset_harqack[16]={16,20,25,32,40,50,64,80,101,127,160,248,400,640,1008,8};
|
||||
int16_t to_beta_offset_harqack[16]={16,20,25,32,40,50,64,80,101,127,160,248,400,640,1008,8};
|
||||
|
||||
void handle_ulsch_harq_pdu(
|
||||
PHY_VARS_eNB *eNB,
|
||||
@@ -340,6 +434,8 @@ void handle_ulsch_harq_pdu(
|
||||
LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id];
|
||||
LTE_UL_eNB_HARQ_t *ulsch_harq;
|
||||
|
||||
if (nfapi_mode==2) return;
|
||||
|
||||
int harq_pid = rel8->harq_process_number;
|
||||
ulsch_harq = ulsch->harq_processes[harq_pid];
|
||||
ulsch_harq->frame = frame;
|
||||
@@ -363,6 +459,8 @@ void handle_ulsch_cqi_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request
|
||||
int harq_pid = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number;
|
||||
LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid];
|
||||
|
||||
if (nfapi_mode==2) return;
|
||||
|
||||
ulsch_harq->frame = frame;
|
||||
ulsch_harq->subframe = subframe;
|
||||
ulsch_harq->O_RI = rel9->aperiodic_cqi_pmi_ri_report.cc[0].ri_size;
|
||||
@@ -384,6 +482,8 @@ void handle_ulsch_cqi_harq_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_re
|
||||
LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid];
|
||||
nfapi_ul_config_ulsch_harq_information *harq_information = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.harq_information;
|
||||
|
||||
if (nfapi_mode==2) return;
|
||||
|
||||
ulsch_harq->frame = frame;
|
||||
ulsch_harq->subframe = subframe;
|
||||
ulsch_harq->O_RI = rel9->aperiodic_cqi_pmi_ri_report.cc[0].ri_size;
|
||||
@@ -399,6 +499,9 @@ void handle_ulsch_cqi_harq_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_re
|
||||
|
||||
void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_config_harq_information *harq_information)
|
||||
{
|
||||
|
||||
if (nfapi_mode==2) return;
|
||||
|
||||
if (eNB->frame_parms.frame_type == FDD) {
|
||||
uci->num_pucch_resources = harq_information->harq_information_rel9_fdd.number_of_pucch_resources;
|
||||
|
||||
@@ -452,7 +555,7 @@ void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_co
|
||||
uci->n_pucch_3[0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0;
|
||||
uci->n_pucch_3[1] = harq_information->harq_information_rel11.n_pucch_2_0;
|
||||
}
|
||||
else AssertFatal(1==0,"unsupported HARQ mode %d\n",harq_information->harq_information_rel9_fdd.ack_nack_mode);
|
||||
else AssertFatal(1==0,"unsupported FDD HARQ mode %d size %d\n",harq_information->harq_information_rel9_fdd.ack_nack_mode,harq_information->harq_information_rel9_fdd.harq_size);
|
||||
}
|
||||
else { // TDD
|
||||
uci->num_pucch_resources = harq_information->harq_information_rel10_tdd.number_of_pucch_resources;
|
||||
@@ -497,6 +600,8 @@ void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t
|
||||
{
|
||||
LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id];
|
||||
|
||||
if (nfapi_mode==2) return;
|
||||
|
||||
uci->frame = frame;
|
||||
uci->subframe = subframe;
|
||||
uci->rnti = ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti;
|
||||
@@ -507,7 +612,11 @@ void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t
|
||||
uci->n_pucch_1_0_sr[0] = ul_config_pdu->uci_sr_pdu.sr_information.sr_information_rel8.pucch_index;
|
||||
uci->srs_active = srs_active;
|
||||
uci->active = 1;
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
uci->ue_type = ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel13.ue_type;
|
||||
uci->empty_symbols = ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel13.empty_symbols;
|
||||
uci->total_repetitions = ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel13.total_number_of_repetitions;
|
||||
#endif
|
||||
LOG_D(PHY,"Programming UCI SR rnti %x, pucch1_0 %d for (%d,%d)\n",
|
||||
uci->rnti,uci->n_pucch_1_0_sr[0],frame,subframe);
|
||||
}
|
||||
@@ -516,6 +625,8 @@ void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_
|
||||
{
|
||||
LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id];
|
||||
|
||||
if (nfapi_mode==2) return;
|
||||
|
||||
uci->frame = frame;
|
||||
uci->subframe = subframe;
|
||||
uci->rnti = ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti;
|
||||
@@ -525,7 +636,11 @@ void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_
|
||||
uci->n_pucch_1_0_sr[0] = ul_config_pdu->uci_sr_harq_pdu.sr_information.sr_information_rel8.pucch_index;
|
||||
uci->srs_active = srs_active;
|
||||
uci->active = 1;
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
uci->ue_type = ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel13.ue_type;
|
||||
uci->empty_symbols = ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel13.empty_symbols;
|
||||
uci->total_repetitions = ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel13.total_number_of_repetitions;
|
||||
#endif
|
||||
handle_uci_harq_information(eNB,uci,&ul_config_pdu->uci_sr_harq_pdu.harq_information);
|
||||
}
|
||||
|
||||
@@ -533,6 +648,8 @@ void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu
|
||||
{
|
||||
LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id];
|
||||
|
||||
if (nfapi_mode==2) return;
|
||||
|
||||
LOG_D(PHY,"Frame %d, Subframe %d: Programming UCI_HARQ process (type %d)\n",frame,subframe,HARQ);
|
||||
uci->frame = frame;
|
||||
uci->subframe = subframe;
|
||||
@@ -540,7 +657,11 @@ void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu
|
||||
uci->type = HARQ;
|
||||
uci->srs_active = srs_active;
|
||||
uci->num_antenna_ports = ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel11.num_ant_ports;
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
uci->ue_type = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.ue_type;
|
||||
uci->empty_symbols = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.empty_symbols;
|
||||
uci->total_repetitions = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.total_number_of_repetitions;
|
||||
#endif
|
||||
handle_uci_harq_information(eNB,uci,&ul_config_pdu->uci_harq_pdu.harq_information);
|
||||
|
||||
uci->active=1;
|
||||
@@ -550,6 +671,8 @@ void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_p
|
||||
{
|
||||
int i;
|
||||
|
||||
if (nfapi_mode==2) return;
|
||||
|
||||
for (i=0;i<NUMBER_OF_UE_MAX;i++) {
|
||||
|
||||
if (eNB->soundingrs_ul_config_dedicated[i].active==1) continue;
|
||||
@@ -576,6 +699,8 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
|
||||
nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8;
|
||||
int16_t UE_id;
|
||||
|
||||
if (nfapi_mode==2) return;
|
||||
|
||||
// check if we have received a dci for this ue and ulsch descriptor is configured
|
||||
|
||||
if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) {
|
||||
@@ -616,6 +741,9 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
|
||||
AssertFatal((UE_id = find_uci(ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti,
|
||||
proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0,
|
||||
"No available UE UCI for rnti %x\n",ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti);
|
||||
LOG_D(PHY,"Applying UL UCI_HARQ config for UE %d, rnti %x for frame %d, subframe %d\n",
|
||||
UE_id,ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti,frame,subframe);
|
||||
|
||||
handle_uci_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe,srs_present);
|
||||
}
|
||||
else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE) {
|
||||
@@ -697,6 +825,9 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
|
||||
eNB->pdcch_vars[subframe&1].num_pdcch_symbols = number_pdcch_ofdm_symbols;
|
||||
eNB->pdcch_vars[subframe&1].num_dci = 0;
|
||||
eNB->phich_vars[subframe&1].num_hi = 0;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
eNB->mpdcch_vars[subframe&1].num_dci = 0;
|
||||
#endif
|
||||
|
||||
LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SF:%04d%d DL_req:SFN/SF:%04d%d:dl_pdu:%d tx_req:SFN/SF:%04d%d:pdus:%d\n",
|
||||
frame,subframe,
|
||||
@@ -722,6 +853,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
|
||||
|
||||
harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe);
|
||||
|
||||
|
||||
// clear DCI allocation maps for new subframe
|
||||
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
@@ -852,16 +984,20 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
|
||||
|
||||
switch (hi_dci0_req_pdu->pdu_type) {
|
||||
|
||||
case NFAPI_HI_DCI0_DCI_PDU_TYPE:
|
||||
case NFAPI_HI_DCI0_DCI_PDU_TYPE:
|
||||
|
||||
handle_nfapi_hi_dci0_dci_pdu(eNB,NFAPI_SFNSF2SFN(HI_DCI0_req->sfn_sf),NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf),proc,hi_dci0_req_pdu);
|
||||
eNB->pdcch_vars[NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf)&1].num_dci++;
|
||||
break;
|
||||
|
||||
case NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE:
|
||||
handle_nfapi_hi_dci0_mpdcch_dci_pdu(eNB,proc,hi_dci0_req_pdu);
|
||||
eNB->mpdcch_vars[subframe&1].num_dci++;
|
||||
break;
|
||||
|
||||
handle_nfapi_hi_dci0_dci_pdu(eNB,NFAPI_SFNSF2SFN(HI_DCI0_req->sfn_sf),NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf),proc,hi_dci0_req_pdu);
|
||||
|
||||
eNB->pdcch_vars[NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf)&1].num_dci++;
|
||||
break;
|
||||
|
||||
case NFAPI_HI_DCI0_HI_PDU_TYPE:
|
||||
handle_nfapi_hi_dci0_hi_pdu(eNB,NFAPI_SFNSF2SFN(HI_DCI0_req->sfn_sf),NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf),proc,hi_dci0_req_pdu);
|
||||
break;
|
||||
case NFAPI_HI_DCI0_HI_PDU_TYPE:
|
||||
handle_nfapi_hi_dci0_hi_pdu(eNB,NFAPI_SFNSF2SFN(HI_DCI0_req->sfn_sf),NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf),proc,hi_dci0_req_pdu);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -123,44 +123,45 @@ void prach_procedures(PHY_VARS_eNB *eNB
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if (br_flag==1) {
|
||||
int prach_mask;
|
||||
|
||||
eNB->UL_INFO.rach_ind_br.rach_indication_body.preamble_list = eNB->preamble_list_br;
|
||||
int ind=0;
|
||||
int ce_level=0;
|
||||
/* Save for later, it doesn't work
|
||||
int prach_mask = is_prach_subframe(&eNB->frame_parms,eNB->proc.frame_prach_br,eNB->proc.subframe_prach_br);
|
||||
for (int ind=0,ce_level=0;ce_level<4;ce_level++) {
|
||||
|
||||
if ((eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[ce_level]==1)&&
|
||||
(prach_mask&(1<<(1+ce_level)) > 0) && // prach is active and CE level has finished its repetitions
|
||||
(eNB->prach_vars_br.repetition_number[ce_level]==
|
||||
eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level])) {
|
||||
*/
|
||||
if (eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0]==1){
|
||||
if ((eNB->prach_energy_counter == 100) &&
|
||||
(max_preamble_energy[0] > eNB->measurements.prach_I0 + 100)) {
|
||||
eNB->UL_INFO.rach_ind_br.rach_indication_body.number_of_preambles++;
|
||||
|
||||
eNB->preamble_list_br[ind].preamble_rel8.timing_advance = max_preamble_delay[ind];//
|
||||
eNB->preamble_list_br[ind].preamble_rel8.preamble = max_preamble[ind];
|
||||
// note: fid is implicitly 0 here, this is the rule for eMTC RA-RNTI from 36.321, Section 5.1.4
|
||||
eNB->preamble_list_br[ind].preamble_rel8.rnti = 1+subframe+(eNB->prach_vars_br.first_frame[ce_level]%40);
|
||||
eNB->preamble_list_br[ind].instance_length = 0; //don't know exactly what this is
|
||||
eNB->preamble_list_br[ind].preamble_rel13.rach_resource_type = 1+ce_level; // CE Level
|
||||
LOG_D(PHY,"Filling NFAPI indication for RACH %d CELevel %d (mask %x) : TA %d, Preamble %d, rnti %x, rach_resource_type %d\n",
|
||||
ind,
|
||||
ce_level,
|
||||
is_prach_subframe(&eNB->frame_parms,eNB->proc.frame_prach_br,eNB->proc.subframe_prach_br),
|
||||
eNB->preamble_list_br[ind].preamble_rel8.timing_advance,
|
||||
eNB->preamble_list_br[ind].preamble_rel8.preamble,
|
||||
eNB->preamble_list_br[ind].preamble_rel8.rnti,
|
||||
eNB->preamble_list_br[ind].preamble_rel13.rach_resource_type);
|
||||
prach_mask = is_prach_subframe (&eNB->frame_parms, eNB->proc.frame_prach_br, eNB->proc.subframe_prach_br);
|
||||
|
||||
eNB->UL_INFO.rach_ind_br.rach_indication_body.preamble_list = eNB->preamble_list_br;
|
||||
int ind = 0;
|
||||
int ce_level = 0;
|
||||
/* Save for later, it doesn't work
|
||||
for (int ind=0,ce_level=0;ce_level<4;ce_level++) {
|
||||
|
||||
if ((eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[ce_level]==1)&&
|
||||
(prach_mask&(1<<(1+ce_level)) > 0) && // prach is active and CE level has finished its repetitions
|
||||
(eNB->prach_vars_br.repetition_number[ce_level]==
|
||||
eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level])) {
|
||||
|
||||
*/
|
||||
|
||||
if (eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] == 1) {
|
||||
if ((eNB->prach_energy_counter == 100) && (max_preamble_energy[0] > eNB->measurements.prach_I0 + 200)) {
|
||||
eNB->UL_INFO.rach_ind_br.rach_indication_body.number_of_preambles++;
|
||||
|
||||
eNB->preamble_list_br[ind].preamble_rel8.timing_advance = max_preamble_delay[ind]; //
|
||||
eNB->preamble_list_br[ind].preamble_rel8.preamble = max_preamble[ind];
|
||||
// note: fid is implicitly 0 here, this is the rule for eMTC RA-RNTI from 36.321, Section 5.1.4
|
||||
eNB->preamble_list_br[ind].preamble_rel8.rnti = 1 + subframe + (60*(eNB->prach_vars_br.first_frame[ce_level] % 40));
|
||||
eNB->preamble_list_br[ind].instance_length = 0; //don't know exactly what this is
|
||||
eNB->preamble_list_br[ind].preamble_rel13.rach_resource_type = 1 + ce_level; // CE Level
|
||||
LOG_I (PHY, "Filling NFAPI indication for RACH %d CELevel %d (mask %x) : TA %d, Preamble %d, rnti %x, rach_resource_type %d\n",
|
||||
ind,
|
||||
ce_level,
|
||||
prach_mask,
|
||||
eNB->preamble_list_br[ind].preamble_rel8.timing_advance,
|
||||
eNB->preamble_list_br[ind].preamble_rel8.preamble, eNB->preamble_list_br[ind].preamble_rel8.rnti, eNB->preamble_list_br[ind].preamble_rel13.rach_resource_type);
|
||||
}
|
||||
}
|
||||
/*
|
||||
ind++;
|
||||
}
|
||||
} */// ce_level
|
||||
}
|
||||
}
|
||||
} */// ce_level
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
@@ -413,9 +413,9 @@ int main(int argc, char **argv) {
|
||||
// enable these lines if you need debug info
|
||||
// however itti will catch all signals, so ctrl-c won't work anymore
|
||||
// alternatively you can disable ITTI completely in CMakeLists.txt
|
||||
//itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL);
|
||||
//set_comp_log(PHY,LOG_DEBUG,LOG_MED,1);
|
||||
//set_glog(LOG_DEBUG,LOG_MED);
|
||||
// itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL);
|
||||
// set_comp_log(PHY,LOG_DEBUG,LOG_HIGH,1);
|
||||
// set_glog(LOG_DEBUG,LOG_HIGH);
|
||||
//hapZEbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:LF
|
||||
static paramdef_t options[] = {
|
||||
{ "awgn", "Use AWGN channel and not multipath", PARAMFLAG_BOOL, strptr:NULL, defintval:0, TYPE_INT, 0, NULL, NULL },
|
||||
|
||||
@@ -236,6 +236,9 @@ typedef struct protocol_ctxt_s {
|
||||
sub_frame_t subframe; /*!< \brief LTE sub frame number.*/
|
||||
eNB_index_t eNB_index; /*!< \brief valid for UE indicating the index of connected eNB(s) */
|
||||
boolean_t configured; /*!< \brief flag indicating whether the instance is configured or not */
|
||||
#ifdef Rel14
|
||||
boolean_t brOption;
|
||||
#endif
|
||||
} protocol_ctxt_t;
|
||||
// warning time hardcoded
|
||||
#define PROTOCOL_CTXT_TIME_MILLI_SECONDS(CtXt_h) ((CtXt_h)->frame*10+(CtXt_h)->subframe)
|
||||
|
||||
@@ -87,11 +87,81 @@ typedef struct RrcStateInd_s {
|
||||
Rrc_Sub_State_t sub_state;
|
||||
} RrcStateInd;
|
||||
|
||||
typedef struct RadioResourceConfig_s {
|
||||
long prach_root;
|
||||
long prach_config_index;
|
||||
BOOLEAN_t prach_high_speed;
|
||||
long prach_zero_correlation;
|
||||
long prach_freq_offset;
|
||||
long pucch_delta_shift;
|
||||
long pucch_nRB_CQI;
|
||||
long pucch_nCS_AN;
|
||||
long pucch_n1_AN;
|
||||
long pdsch_referenceSignalPower;
|
||||
long pdsch_p_b;
|
||||
long pusch_n_SB;
|
||||
long pusch_hoppingMode;
|
||||
long pusch_hoppingOffset;
|
||||
BOOLEAN_t pusch_enable64QAM;
|
||||
BOOLEAN_t pusch_groupHoppingEnabled;
|
||||
long pusch_groupAssignment;
|
||||
BOOLEAN_t pusch_sequenceHoppingEnabled;
|
||||
long pusch_nDMRS1;
|
||||
long phich_duration;
|
||||
long phich_resource;
|
||||
BOOLEAN_t srs_enable;
|
||||
long srs_BandwidthConfig;
|
||||
long srs_SubframeConfig;
|
||||
BOOLEAN_t srs_ackNackST;
|
||||
BOOLEAN_t srs_MaxUpPts;
|
||||
long pusch_p0_Nominal;
|
||||
long pusch_alpha;
|
||||
long pucch_p0_Nominal;
|
||||
long msg3_delta_Preamble;
|
||||
long ul_CyclicPrefixLength;
|
||||
e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1 pucch_deltaF_Format1;
|
||||
e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b pucch_deltaF_Format1b;
|
||||
e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2 pucch_deltaF_Format2;
|
||||
e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a pucch_deltaF_Format2a;
|
||||
e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b pucch_deltaF_Format2b;
|
||||
long rach_numberOfRA_Preambles;
|
||||
BOOLEAN_t rach_preamblesGroupAConfig;
|
||||
long rach_sizeOfRA_PreamblesGroupA;
|
||||
long rach_messageSizeGroupA;
|
||||
e_LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB rach_messagePowerOffsetGroupB;
|
||||
long rach_powerRampingStep;
|
||||
long rach_preambleInitialReceivedTargetPower;
|
||||
long rach_preambleTransMax;
|
||||
long rach_raResponseWindowSize;
|
||||
long rach_macContentionResolutionTimer;
|
||||
long rach_maxHARQ_Msg3Tx;
|
||||
long bcch_modificationPeriodCoeff;
|
||||
long pcch_defaultPagingCycle;
|
||||
long pcch_nB;
|
||||
long ue_TimersAndConstants_t300;
|
||||
long ue_TimersAndConstants_t301;
|
||||
long ue_TimersAndConstants_t310;
|
||||
long ue_TimersAndConstants_t311;
|
||||
long ue_TimersAndConstants_n310;
|
||||
long ue_TimersAndConstants_n311;
|
||||
long ue_TransmissionMode;
|
||||
long ue_multiple_max;
|
||||
#ifdef Rel14
|
||||
//SIB2 BR Options
|
||||
long* preambleTransMax_CE_r13;
|
||||
BOOLEAN_t prach_ConfigCommon_v1310;
|
||||
BOOLEAN_t* mpdcch_startSF_CSS_RA_r13;
|
||||
long mpdcch_startSF_CSS_RA_r13_val;
|
||||
long* prach_HoppingOffset_r13;
|
||||
#endif
|
||||
} RadioResourceConfig;
|
||||
|
||||
// eNB: ENB_APP -> RRC messages
|
||||
typedef struct RrcConfigurationReq_s {
|
||||
uint32_t cell_identity;
|
||||
uint32_t cell_identity;
|
||||
|
||||
uint16_t tac;
|
||||
|
||||
uint16_t tac;
|
||||
|
||||
uint16_t mcc[PLMN_LIST_MAX_SIZE];
|
||||
uint16_t mnc[PLMN_LIST_MAX_SIZE];
|
||||
@@ -113,68 +183,89 @@ typedef struct RrcConfigurationReq_s {
|
||||
int16_t Nid_cell[MAX_NUM_CCs];// for testing, change later
|
||||
int16_t N_RB_DL[MAX_NUM_CCs];// for testing, change later
|
||||
int nb_antenna_ports[MAX_NUM_CCs];
|
||||
long prach_root[MAX_NUM_CCs];
|
||||
long prach_config_index[MAX_NUM_CCs];
|
||||
BOOLEAN_t prach_high_speed[MAX_NUM_CCs];
|
||||
long prach_zero_correlation[MAX_NUM_CCs];
|
||||
long prach_freq_offset[MAX_NUM_CCs];
|
||||
long pucch_delta_shift[MAX_NUM_CCs];
|
||||
long pucch_nRB_CQI[MAX_NUM_CCs];
|
||||
long pucch_nCS_AN[MAX_NUM_CCs];
|
||||
//#if (LTE_RRC_VERSION < MAKE_VERSION(10, 0, 0))
|
||||
long pucch_n1_AN[MAX_NUM_CCs];
|
||||
//#endif
|
||||
long pdsch_referenceSignalPower[MAX_NUM_CCs];
|
||||
long pdsch_p_b[MAX_NUM_CCs];
|
||||
long pusch_n_SB[MAX_NUM_CCs];
|
||||
long pusch_hoppingMode[MAX_NUM_CCs];
|
||||
long pusch_hoppingOffset[MAX_NUM_CCs];
|
||||
BOOLEAN_t pusch_enable64QAM[MAX_NUM_CCs];
|
||||
BOOLEAN_t pusch_groupHoppingEnabled[MAX_NUM_CCs];
|
||||
long pusch_groupAssignment[MAX_NUM_CCs];
|
||||
BOOLEAN_t pusch_sequenceHoppingEnabled[MAX_NUM_CCs];
|
||||
long pusch_nDMRS1[MAX_NUM_CCs];
|
||||
long phich_duration[MAX_NUM_CCs];
|
||||
long phich_resource[MAX_NUM_CCs];
|
||||
BOOLEAN_t srs_enable[MAX_NUM_CCs];
|
||||
long srs_BandwidthConfig[MAX_NUM_CCs];
|
||||
long srs_SubframeConfig[MAX_NUM_CCs];
|
||||
BOOLEAN_t srs_ackNackST[MAX_NUM_CCs];
|
||||
BOOLEAN_t srs_MaxUpPts[MAX_NUM_CCs];
|
||||
long pusch_p0_Nominal[MAX_NUM_CCs];
|
||||
long pusch_alpha[MAX_NUM_CCs];
|
||||
long pucch_p0_Nominal[MAX_NUM_CCs];
|
||||
long msg3_delta_Preamble[MAX_NUM_CCs];
|
||||
long ul_CyclicPrefixLength[MAX_NUM_CCs];
|
||||
e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1 pucch_deltaF_Format1[MAX_NUM_CCs];
|
||||
e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b pucch_deltaF_Format1b[MAX_NUM_CCs];
|
||||
e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2 pucch_deltaF_Format2[MAX_NUM_CCs];
|
||||
e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a pucch_deltaF_Format2a[MAX_NUM_CCs];
|
||||
e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b pucch_deltaF_Format2b[MAX_NUM_CCs];
|
||||
long rach_numberOfRA_Preambles[MAX_NUM_CCs];
|
||||
BOOLEAN_t rach_preamblesGroupAConfig[MAX_NUM_CCs];
|
||||
long rach_sizeOfRA_PreamblesGroupA[MAX_NUM_CCs];
|
||||
long rach_messageSizeGroupA[MAX_NUM_CCs];
|
||||
e_LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB rach_messagePowerOffsetGroupB[MAX_NUM_CCs];
|
||||
long rach_powerRampingStep[MAX_NUM_CCs];
|
||||
long rach_preambleInitialReceivedTargetPower[MAX_NUM_CCs];
|
||||
long rach_preambleTransMax[MAX_NUM_CCs];
|
||||
long rach_raResponseWindowSize[MAX_NUM_CCs];
|
||||
long rach_macContentionResolutionTimer[MAX_NUM_CCs];
|
||||
long rach_maxHARQ_Msg3Tx[MAX_NUM_CCs];
|
||||
long bcch_modificationPeriodCoeff[MAX_NUM_CCs];
|
||||
long pcch_defaultPagingCycle[MAX_NUM_CCs];
|
||||
long pcch_nB[MAX_NUM_CCs];
|
||||
long ue_TimersAndConstants_t300[MAX_NUM_CCs];
|
||||
long ue_TimersAndConstants_t301[MAX_NUM_CCs];
|
||||
long ue_TimersAndConstants_t310[MAX_NUM_CCs];
|
||||
long ue_TimersAndConstants_t311[MAX_NUM_CCs];
|
||||
long ue_TimersAndConstants_n310[MAX_NUM_CCs];
|
||||
long ue_TimersAndConstants_n311[MAX_NUM_CCs];
|
||||
long ue_TransmissionMode[MAX_NUM_CCs];
|
||||
long ue_multiple_max[MAX_NUM_CCs];
|
||||
int eMBMS_configured;
|
||||
int eMTC_configured;
|
||||
int SL_configured;
|
||||
|
||||
//TTN - for D2D
|
||||
RadioResourceConfig radioresourceconfig[MAX_NUM_CCs];
|
||||
RadioResourceConfig radioresourceconfig_BR[MAX_NUM_CCs];
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
|
||||
//MIB
|
||||
long schedulingInfoSIB1_BR_r13[MAX_NUM_CCs];
|
||||
//SIB1 BR options
|
||||
uint16_t* hyperSFN_r13 [MAX_NUM_CCs];
|
||||
long* eDRX_Allowed_r13 [MAX_NUM_CCs];
|
||||
BOOLEAN_t cellSelectionInfoCE_r13 [MAX_NUM_CCs];
|
||||
long q_RxLevMinCE_r13 [MAX_NUM_CCs];
|
||||
long* q_QualMinRSRQ_CE_r13 [MAX_NUM_CCs];
|
||||
BOOLEAN_t bandwidthReducedAccessRelatedInfo_r13 [MAX_NUM_CCs];
|
||||
long si_Narrowband_r13 [MAX_NUM_CCs][32];
|
||||
long si_TBS_r13 [MAX_NUM_CCs][32];
|
||||
int scheduling_info_br_size [MAX_NUM_CCs];
|
||||
long si_WindowLength_BR_r13 [MAX_NUM_CCs];
|
||||
long si_RepetitionPattern_r13 [MAX_NUM_CCs];
|
||||
BOOLEAN_t * fdd_DownlinkOrTddSubframeBitmapBR_r13 [MAX_NUM_CCs];
|
||||
uint64_t fdd_DownlinkOrTddSubframeBitmapBR_val_r13 [MAX_NUM_CCs];
|
||||
uint16_t *fdd_UplinkSubframeBitmapBR_r13 [MAX_NUM_CCs];
|
||||
long startSymbolBR_r13 [MAX_NUM_CCs];
|
||||
long si_HoppingConfigCommon_r13 [MAX_NUM_CCs];
|
||||
long* si_ValidityTime_r13 [MAX_NUM_CCs];
|
||||
long systemInfoValueTagSi_r13 [MAX_NUM_CCs][10];
|
||||
int system_info_value_tag_SI_size [MAX_NUM_CCs];
|
||||
BOOLEAN_t freqHoppingParametersDL_r13 [MAX_NUM_CCs];
|
||||
long* mpdcch_pdsch_HoppingNB_r13 [MAX_NUM_CCs];
|
||||
BOOLEAN_t interval_DLHoppingConfigCommonModeA_r13 [MAX_NUM_CCs];
|
||||
long interval_DLHoppingConfigCommonModeA_r13_val [MAX_NUM_CCs];
|
||||
BOOLEAN_t interval_DLHoppingConfigCommonModeB_r13 [MAX_NUM_CCs];
|
||||
long interval_DLHoppingConfigCommonModeB_r13_val [MAX_NUM_CCs];
|
||||
long* mpdcch_pdsch_HoppingOffset_r13 [MAX_NUM_CCs];
|
||||
long firstPreamble_r13 [MAX_NUM_CCs][4];
|
||||
long lastPreamble_r13 [MAX_NUM_CCs][4];
|
||||
long ra_ResponseWindowSize_r13 [MAX_NUM_CCs][4];
|
||||
long mac_ContentionResolutionTimer_r13 [MAX_NUM_CCs][4];
|
||||
long rar_HoppingConfig_r13 [MAX_NUM_CCs][4];
|
||||
int rach_CE_LevelInfoList_r13_size [MAX_NUM_CCs];
|
||||
// long pcch_defaultPagingCycle_br;
|
||||
long rsrp_range [MAX_NUM_CCs][3];
|
||||
int rsrp_range_list_size [MAX_NUM_CCs];
|
||||
long prach_config_index [MAX_NUM_CCs][4];
|
||||
long prach_freq_offset [MAX_NUM_CCs][4];
|
||||
long *prach_StartingSubframe_r13 [MAX_NUM_CCs][4];
|
||||
long *maxNumPreambleAttemptCE_r13 [MAX_NUM_CCs][4];
|
||||
long numRepetitionPerPreambleAttempt_r13 [MAX_NUM_CCs][4];
|
||||
long mpdcch_NumRepetition_RA_r13 [MAX_NUM_CCs][4];
|
||||
long prach_HoppingConfig_r13 [MAX_NUM_CCs][4];
|
||||
int prach_parameters_list_size [MAX_NUM_CCs];
|
||||
long max_available_narrow_band [MAX_NUM_CCs][4][2];
|
||||
int max_available_narrow_band_size [MAX_NUM_CCs][4];
|
||||
long pucch_info_value [MAX_NUM_CCs][4];
|
||||
int pucch_info_value_size [MAX_NUM_CCs];
|
||||
bool pcch_config_v1310 [MAX_NUM_CCs];
|
||||
long paging_narrowbands_r13 [MAX_NUM_CCs];
|
||||
long mpdcch_numrepetition_paging_r13 [MAX_NUM_CCs];
|
||||
long *nb_v1310 [MAX_NUM_CCs];
|
||||
long *pucch_NumRepetitionCE_Msg4_Level0_r13 [MAX_NUM_CCs];
|
||||
long *pucch_NumRepetitionCE_Msg4_Level1_r13 [MAX_NUM_CCs];
|
||||
long *pucch_NumRepetitionCE_Msg4_Level2_r13 [MAX_NUM_CCs];
|
||||
long *pucch_NumRepetitionCE_Msg4_Level3_r13 [MAX_NUM_CCs];
|
||||
bool sib2_freq_hoppingParameters_r13_exists [MAX_NUM_CCs];
|
||||
long *sib2_mpdcch_pdsch_hoppingNB_r13 [MAX_NUM_CCs];
|
||||
long *sib2_interval_DLHoppingConfigCommonModeA_r13 [MAX_NUM_CCs];
|
||||
long sib2_interval_DLHoppingConfigCommonModeA_r13_val [MAX_NUM_CCs];
|
||||
long *sib2_interval_DLHoppingConfigCommonModeB_r13 [MAX_NUM_CCs];
|
||||
long sib2_interval_DLHoppingConfigCommonModeB_r13_val [MAX_NUM_CCs];
|
||||
long *sib2_interval_ULHoppingConfigCommonModeA_r13 [MAX_NUM_CCs];
|
||||
long sib2_interval_ULHoppingConfigCommonModeA_r13_val [MAX_NUM_CCs];
|
||||
long *sib2_interval_ULHoppingConfigCommonModeB_r13 [MAX_NUM_CCs];
|
||||
long sib2_interval_ULHoppingConfigCommonModeB_r13_val [MAX_NUM_CCs];
|
||||
long *sib2_mpdcch_pdsch_hoppingOffset_r13 [MAX_NUM_CCs];
|
||||
long *pdsch_maxNumRepetitionCEmodeA_r13 [MAX_NUM_CCs];
|
||||
long *pdsch_maxNumRepetitionCEmodeB_r13 [MAX_NUM_CCs];
|
||||
long *pusch_maxNumRepetitionCEmodeA_r13 [MAX_NUM_CCs];
|
||||
long *pusch_maxNumRepetitionCEmodeB_r13 [MAX_NUM_CCs];
|
||||
long *pusch_HoppingOffset_v1310 [MAX_NUM_CCs];
|
||||
#endif
|
||||
//SIB18
|
||||
e_LTE_SL_CP_Len_r12 rxPool_sc_CP_Len[MAX_NUM_CCs];
|
||||
e_LTE_SL_PeriodComm_r12 rxPool_sc_Period[MAX_NUM_CCs];
|
||||
@@ -224,9 +315,7 @@ typedef struct RrcConfigurationReq_s {
|
||||
|
||||
typedef struct NbIoTRrcConfigurationReq_s {
|
||||
uint32_t cell_identity;
|
||||
|
||||
uint16_t tac;
|
||||
|
||||
uint16_t mcc;
|
||||
uint16_t mnc;
|
||||
uint8_t mnc_digit_length;
|
||||
|
||||
@@ -25,18 +25,11 @@ TASK_DEF(TASK_TIMER, TASK_PRIORITY_MAX, 10)
|
||||
// Other possible tasks in the process
|
||||
|
||||
// Common tasks:
|
||||
/// Layer 2 and Layer 1 task supporting all the synchronous processing
|
||||
TASK_DEF(TASK_L2L1, TASK_PRIORITY_MAX_LEAST, 200)
|
||||
|
||||
/// Bearers Manager task
|
||||
TASK_DEF(TASK_BM, TASK_PRIORITY_MED, 200)
|
||||
|
||||
// eNodeB tasks and sub-tasks:
|
||||
//// Layer 2 and Layer 1 sub-tasks
|
||||
SUB_TASK_DEF(TASK_L2L1, TASK_PHY_ENB, 200)
|
||||
SUB_TASK_DEF(TASK_L2L1, TASK_MAC_ENB, 200)
|
||||
SUB_TASK_DEF(TASK_L2L1, TASK_RLC_ENB, 200)
|
||||
SUB_TASK_DEF(TASK_L2L1, TASK_PDCP_ENB, 200)
|
||||
|
||||
/// Radio Resource Control task
|
||||
TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200)
|
||||
@@ -63,11 +56,6 @@ TASK_DEF(TASK_ENB_APP, TASK_PRIORITY_MED, 200)
|
||||
TASK_DEF(TASK_FLEXRAN_AGENT, TASK_PRIORITY_MED, 200)
|
||||
|
||||
// UE tasks and sub-tasks:
|
||||
//// Layer 2 and Layer 1 sub-tasks
|
||||
SUB_TASK_DEF(TASK_L2L1, TASK_PHY_UE, 200)
|
||||
SUB_TASK_DEF(TASK_L2L1, TASK_MAC_UE, 200)
|
||||
SUB_TASK_DEF(TASK_L2L1, TASK_RLC_UE, 200)
|
||||
SUB_TASK_DEF(TASK_L2L1, TASK_PDCP_UE, 200)
|
||||
|
||||
/// Radio Resource Control task
|
||||
TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200)
|
||||
|
||||
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |