Merge remote-tracking branch 'eurecom/bandwidth-testing-abs' into episys/mel/merge_bw_testing_abs
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
// Location of the python executor node shall be in the same subnet as the others servers
|
||||
def pythonExecutor = params.pythonExecutor
|
||||
def DataBaseHost = params.DataBaseHost
|
||||
|
||||
// Location of the test XML file to be run
|
||||
def testXMLFile = params.pythonTestXmlFile
|
||||
@@ -45,10 +46,12 @@ def eNB_CommitID
|
||||
def eNB_AllowMergeRequestProcess
|
||||
def eNB_TargetBranch
|
||||
|
||||
//Status fed to the database
|
||||
def StatusForDb = ""
|
||||
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
label pythonExecutor
|
||||
}
|
||||
agent {label pythonExecutor}
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
ansiColor('xterm')
|
||||
@@ -270,9 +273,18 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("SQL Collect"){
|
||||
agent {label DataBaseHost}
|
||||
steps {
|
||||
script {
|
||||
if (currentBuild.result=='FAILURE') {StatusForDb = 'FAIL'} else {StatusForDb = 'PASS'}
|
||||
sh "python3 /home/oaicicd/mysql/sql_connect.py ${JOB_NAME} ${params.eNB_MR} ${params.eNB_Branch} ${env.BUILD_ID} ${env.BUILD_URL} ${StatusForDb} ''"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
|
||||
@@ -0,0 +1,322 @@
|
||||
Active_gNBs = ( "gNB-OAI");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
gNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_CU_ID = 0xe00;
|
||||
|
||||
# cell_type = "CELL_MACRO_GNB";
|
||||
|
||||
gNB_name = "gNB-OAI";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
|
||||
plmn_list = ({
|
||||
mcc = 208;
|
||||
mnc = 99;
|
||||
mnc_length = 2;
|
||||
snssaiList = (
|
||||
{
|
||||
sst = 1;
|
||||
sd = 0x010203; // 0 false, else true
|
||||
},
|
||||
{
|
||||
sst = 1;
|
||||
sd = 0x112233; // 0 false, else true
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
nr_cellid = 12345678L
|
||||
|
||||
# tr_s_preference = "local_mac"
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 2;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
{
|
||||
controlResourceSetZero = 11;
|
||||
searchSpaceZero = 0;
|
||||
}
|
||||
);
|
||||
|
||||
servingCellConfigCommon = (
|
||||
{
|
||||
#spCellConfigCommon
|
||||
|
||||
physCellId = 0;
|
||||
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6
|
||||
#absoluteFrequencySSB = 620640;
|
||||
# this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68
|
||||
absoluteFrequencySSB = 621312;
|
||||
# this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2
|
||||
#absoluteFrequencySSB = 634080;
|
||||
# this is 3600.48 MHz
|
||||
#absoluteFrequencySSB = 640032;
|
||||
#dl_frequencyBand = 78;
|
||||
# this is 3301.68 MHz
|
||||
#dl_absoluteFrequencyPointA = 620112;
|
||||
# this is 3300.60 MHz
|
||||
dl_absoluteFrequencyPointA = 620040;
|
||||
# this is 3502.56 MHz
|
||||
#dl_absoluteFrequencyPointA = 633552;
|
||||
# this is 3600.48 MHz
|
||||
#dl_absoluteFrequencyPointA = 640032;
|
||||
#scs-SpecificCarrierList
|
||||
dl_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
dl_subcarrierSpacing = 1;
|
||||
dl_carrierBandwidth = 106;
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=0,L=106 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 28875;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
#pdcch-ConfigCommon
|
||||
initialDLBWPcontrolResourceSetZero = 11;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=1,L=5
|
||||
initialDLBWPstartSymbolAndLength_1 = 57;
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 78;
|
||||
#scs-SpecificCarrierList
|
||||
ul_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
ul_subcarrierSpacing = 1;
|
||||
ul_carrierBandwidth = 106;
|
||||
pMax = 20;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 28875;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
#rach-ConfigCommon
|
||||
#rach-ConfigGeneric
|
||||
prach_ConfigurationIndex = 98;
|
||||
#prach_msg1_FDM
|
||||
#0 = one, 1=two, 2=four, 3=eight
|
||||
prach_msg1_FDM = 0;
|
||||
prach_msg1_FrequencyStart = 0;
|
||||
zeroCorrelationZoneConfig = 12;
|
||||
preambleReceivedTargetPower = -104;
|
||||
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
|
||||
preambleTransMax = 6;
|
||||
#powerRampingStep
|
||||
# 0=dB0,1=dB2,2=dB4,3=dB6
|
||||
powerRampingStep = 1;
|
||||
#ra_ReponseWindow
|
||||
#1,2,4,8,10,20,40,80
|
||||
ra_ResponseWindow = 4;
|
||||
#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
|
||||
#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3;
|
||||
#oneHalf (0..15) 4,8,12,16,...60,64
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
|
||||
#ra_ContentionResolutionTimer
|
||||
#(0..7) 8,16,24,32,40,48,56,64
|
||||
ra_ContentionResolutionTimer = 7;
|
||||
rsrp_ThresholdSSB = 19;
|
||||
#prach-RootSequenceIndex_PR
|
||||
#1 = 839, 2 = 139
|
||||
prach_RootSequenceIndex_PR = 2;
|
||||
prach_RootSequenceIndex = 1;
|
||||
# SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
|
||||
#
|
||||
msg1_SubcarrierSpacing = 1,
|
||||
# restrictedSetConfig
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 2;
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=2 L=13
|
||||
initialULBWPstartSymbolAndLength_0 = 41;
|
||||
|
||||
initialULBWPk2_1 = 2;
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=4
|
||||
initialULBWPstartSymbolAndLength_1 = 52;
|
||||
|
||||
initialULBWPk2_2 = 7;
|
||||
initialULBWPmappingType_2 = 1;
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
# pucch-ConfigCommon setup :
|
||||
# pucchGroupHopping
|
||||
# 0 = neither, 1= group hopping, 2=sequence hopping
|
||||
pucchGroupHopping = 0;
|
||||
hoppingId = 40;
|
||||
p0_nominal = -90;
|
||||
# ssb_PositionsInBurs_BitmapPR
|
||||
# 1=short, 2=medium, 3=long
|
||||
ssb_PositionsInBurst_PR = 2;
|
||||
ssb_PositionsInBurst_Bitmap = 1;
|
||||
|
||||
# ssb_periodicityServingCell
|
||||
# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
|
||||
ssb_periodicityServingCell = 2;
|
||||
|
||||
# dmrs_TypeA_position
|
||||
# 0 = pos2, 1 = pos3
|
||||
dmrs_TypeA_Position = 0;
|
||||
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
subcarrierSpacing = 1;
|
||||
|
||||
|
||||
#tdd-UL-DL-ConfigurationCommon
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
referenceSubcarrierSpacing = 1;
|
||||
# pattern1
|
||||
# dl_UL_TransmissionPeriodicity
|
||||
# 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
|
||||
dl_UL_TransmissionPeriodicity = 6;
|
||||
nrofDownlinkSlots = 7;
|
||||
nrofDownlinkSymbols = 6;
|
||||
nrofUplinkSlots = 2;
|
||||
nrofUplinkSymbols = 4;
|
||||
|
||||
ssPBCH_BlockPower = -25;
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
////////// AMF parameters:
|
||||
amf_ip_address = ( { ipv4 = "192.168.69.131";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
GNB_INTERFACE_NAME_FOR_NG_AMF = "em1";
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.18.194/24";
|
||||
GNB_INTERFACE_NAME_FOR_NGU = "em1";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.18.194/24";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
pusch_TargetSNRx10 = 200;
|
||||
pucch_TargetSNRx10 = 150;
|
||||
ulsch_max_slots_inactivity=20;
|
||||
}
|
||||
);
|
||||
|
||||
L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
pusch_proc_threads = 2;
|
||||
prach_dtx_threshold = 120;
|
||||
pucch0_dtx_threshold = 150;
|
||||
}
|
||||
);
|
||||
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 2
|
||||
nb_rx = 2
|
||||
att_tx = 0
|
||||
att_rx = 0;
|
||||
bands = [78];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 75;
|
||||
eNB_instances = [0];
|
||||
##beamforming 1x2 matrix: 1 layer x 2 antennas
|
||||
bf_weights = [0x00007fff, 0x0000];
|
||||
##beamforming 1x4 matrix: 1 layer x 4 antennas
|
||||
#bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000];
|
||||
## beamforming 2x2 matrix:
|
||||
# bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
|
||||
## beamforming 4x4 matrix:
|
||||
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
|
||||
|
||||
sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_SINGLE_THREAD";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
f1ap_log_level ="debug";
|
||||
f1ap_log_verbosity ="medium";
|
||||
};
|
||||
@@ -0,0 +1,318 @@
|
||||
Active_gNBs = ( "gNB-OAI");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
Num_Threads_PUSCH = 8;
|
||||
|
||||
gNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_CU_ID = 0xe00;
|
||||
|
||||
# cell_type = "CELL_MACRO_GNB";
|
||||
|
||||
gNB_name = "gNB-OAI";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
|
||||
plmn_list = ({
|
||||
mcc = 208;
|
||||
mnc = 99;
|
||||
mnc_length = 2;
|
||||
snssaiList = (
|
||||
{
|
||||
sst = 1;
|
||||
sd = 0x010203; // 0 false, else true
|
||||
},
|
||||
{
|
||||
sst = 1;
|
||||
sd = 0x112233; // 0 false, else true
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
nr_cellid = 12345678L
|
||||
|
||||
# tr_s_preference = "local_mac"
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 2;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
{
|
||||
controlResourceSetZero = 10;
|
||||
searchSpaceZero = 0;
|
||||
}
|
||||
);
|
||||
|
||||
servingCellConfigCommon = (
|
||||
{
|
||||
#spCellConfigCommon
|
||||
|
||||
physCellId = 0;
|
||||
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6
|
||||
absoluteFrequencySSB = 620640;
|
||||
# this is 3502.56 MHz
|
||||
#absoluteFrequencySSB = 633504;
|
||||
# this is 3600.48 MHz
|
||||
#absoluteFrequencySSB = 640032;
|
||||
#dl_frequencyBand = 78;
|
||||
# this is 3301.68 MHz
|
||||
dl_absoluteFrequencyPointA = 620112;
|
||||
# this is 3502.56 MHz
|
||||
#dl_absoluteFrequencyPointA = 633504;
|
||||
# this is 3600.48 MHz
|
||||
#dl_absoluteFrequencyPointA = 640032;
|
||||
#scs-SpecificCarrierList
|
||||
dl_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
dl_subcarrierSpacing = 1;
|
||||
dl_carrierBandwidth = 133;
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=0,L=133 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 36300;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
#pdcch-ConfigCommon
|
||||
initialDLBWPcontrolResourceSetZero = 10;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=1,L=5
|
||||
initialDLBWPstartSymbolAndLength_1 = 57;
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 78;
|
||||
#scs-SpecificCarrierList
|
||||
ul_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
ul_subcarrierSpacing = 1;
|
||||
ul_carrierBandwidth = 133;
|
||||
pMax = 20;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 36300;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
#rach-ConfigCommon
|
||||
#rach-ConfigGeneric
|
||||
prach_ConfigurationIndex = 98;
|
||||
#prach_msg1_FDM
|
||||
#0 = one, 1=two, 2=four, 3=eight
|
||||
prach_msg1_FDM = 0;
|
||||
prach_msg1_FrequencyStart = 0;
|
||||
zeroCorrelationZoneConfig = 12;
|
||||
preambleReceivedTargetPower = -108;
|
||||
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
|
||||
preambleTransMax = 6;
|
||||
#powerRampingStep
|
||||
# 0=dB0,1=dB2,2=dB4,3=dB6
|
||||
powerRampingStep = 1;
|
||||
#ra_ReponseWindow
|
||||
#1,2,4,8,10,20,40,80
|
||||
ra_ResponseWindow = 4;
|
||||
#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
|
||||
#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3;
|
||||
#oneHalf (0..15) 4,8,12,16,...60,64
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
|
||||
#ra_ContentionResolutionTimer
|
||||
#(0..7) 8,16,24,32,40,48,56,64
|
||||
ra_ContentionResolutionTimer = 7;
|
||||
rsrp_ThresholdSSB = 19;
|
||||
#prach-RootSequenceIndex_PR
|
||||
#1 = 839, 2 = 139
|
||||
prach_RootSequenceIndex_PR = 2;
|
||||
prach_RootSequenceIndex = 1;
|
||||
# SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
|
||||
#
|
||||
msg1_SubcarrierSpacing = 1,
|
||||
# restrictedSetConfig
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6;
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=2 L=13
|
||||
initialULBWPstartSymbolAndLength_0 = 41;
|
||||
|
||||
initialULBWPk2_1 = 6;
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=4
|
||||
initialULBWPstartSymbolAndLength_1 = 52;
|
||||
|
||||
initialULBWPk2_2 = 7;
|
||||
initialULBWPmappingType_2 = 1;
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
# pucch-ConfigCommon setup :
|
||||
# pucchGroupHopping
|
||||
# 0 = neither, 1= group hopping, 2=sequence hopping
|
||||
pucchGroupHopping = 0;
|
||||
hoppingId = 40;
|
||||
p0_nominal = -90;
|
||||
# ssb_PositionsInBurs_BitmapPR
|
||||
# 1=short, 2=medium, 3=long
|
||||
ssb_PositionsInBurst_PR = 2;
|
||||
ssb_PositionsInBurst_Bitmap = 1;
|
||||
|
||||
# ssb_periodicityServingCell
|
||||
# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
|
||||
ssb_periodicityServingCell = 2;
|
||||
|
||||
# dmrs_TypeA_position
|
||||
# 0 = pos2, 1 = pos3
|
||||
dmrs_TypeA_Position = 0;
|
||||
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
subcarrierSpacing = 1;
|
||||
|
||||
|
||||
#tdd-UL-DL-ConfigurationCommon
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
referenceSubcarrierSpacing = 1;
|
||||
# pattern1
|
||||
# dl_UL_TransmissionPeriodicity
|
||||
# 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
|
||||
dl_UL_TransmissionPeriodicity = 6;
|
||||
nrofDownlinkSlots = 7;
|
||||
nrofDownlinkSymbols = 6;
|
||||
nrofUplinkSlots = 2;
|
||||
nrofUplinkSymbols = 4;
|
||||
|
||||
ssPBCH_BlockPower = -25;
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
////////// AMF parameters:
|
||||
amf_ip_address = ( { ipv4 = "192.168.69.131";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
GNB_INTERFACE_NAME_FOR_NG_AMF = "em1";
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.18.194/24";
|
||||
GNB_INTERFACE_NAME_FOR_NGU = "em1";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.18.194/24";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
pusch_TargetSNRx10 = 200;
|
||||
pucch_TargetSNRx10 = 150;
|
||||
ulsch_max_slots_inactivity=20;
|
||||
}
|
||||
);
|
||||
|
||||
L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
pusch_proc_threads = 2;
|
||||
prach_dtx_threshold = 120;
|
||||
}
|
||||
);
|
||||
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 2
|
||||
nb_rx = 2
|
||||
att_tx = 0
|
||||
att_rx = 0;
|
||||
bands = [78];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 75;
|
||||
eNB_instances = [0];
|
||||
##beamforming 1x2 matrix: 1 layer x 2 antennas
|
||||
bf_weights = [0x00007fff, 0x0000];
|
||||
##beamforming 1x4 matrix: 1 layer x 4 antennas
|
||||
#bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000];
|
||||
## beamforming 2x2 matrix:
|
||||
# bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
|
||||
## beamforming 4x4 matrix:
|
||||
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
|
||||
|
||||
sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
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";
|
||||
f1ap_log_level ="debug";
|
||||
f1ap_log_verbosity ="medium";
|
||||
};
|
||||
@@ -270,6 +270,23 @@ THREAD_STRUCT = (
|
||||
}
|
||||
);
|
||||
|
||||
security = {
|
||||
# preferred ciphering algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nea0, nea1, nea2, nea3
|
||||
ciphering_algorithms = ( "nea0" );
|
||||
|
||||
# preferred integrity algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nia0, nia1, nia2, nia3
|
||||
integrity_algorithms = ( "nia2", "nia0" );
|
||||
|
||||
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
|
||||
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
|
||||
drb_ciphering = "yes";
|
||||
drb_integrity = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
|
||||
@@ -259,6 +259,23 @@ THREAD_STRUCT = (
|
||||
}
|
||||
);
|
||||
|
||||
security = {
|
||||
# preferred ciphering algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nea0, nea1, nea2, nea3
|
||||
ciphering_algorithms = ( "nea0" );
|
||||
|
||||
# preferred integrity algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nia0, nia1, nia2, nia3
|
||||
integrity_algorithms = ( "nia2", "nia0" );
|
||||
|
||||
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
|
||||
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
|
||||
drb_ciphering = "yes";
|
||||
drb_integrity = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
|
||||
@@ -276,6 +276,23 @@ security = {
|
||||
integrity_algorithms = ( "nia0" );
|
||||
};
|
||||
|
||||
security = {
|
||||
# preferred ciphering algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nea0, nea1, nea2, nea3
|
||||
ciphering_algorithms = ( "nea0" );
|
||||
|
||||
# preferred integrity algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nia0, nia1, nia2, nia3
|
||||
integrity_algorithms = ( "nia2", "nia0" );
|
||||
|
||||
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
|
||||
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
|
||||
drb_ciphering = "yes";
|
||||
drb_integrity = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Active_gNBs = ( "gNB-Eurecom-DU");
|
||||
Active_gNBs = ( "gNB-OAI");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
@@ -6,42 +6,47 @@ gNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_ID = 0xe00;
|
||||
gNB_name = "gNB-Eurecom-DU";
|
||||
gNB_CU_ID = 0xe00;
|
||||
|
||||
# cell_type = "CELL_MACRO_GNB";
|
||||
|
||||
gNB_name = "gNB-OAI";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
|
||||
plmn_list = ({
|
||||
mcc = 208;
|
||||
mnc = 99;
|
||||
mnc = 97;
|
||||
mnc_length = 2;
|
||||
snssaiList = (
|
||||
{
|
||||
sst = 1;
|
||||
sd = 0x1; // 0 false, else true
|
||||
},
|
||||
{
|
||||
sst = 1;
|
||||
sd = 0x112233; // 0 false, else true
|
||||
}
|
||||
);
|
||||
{
|
||||
sst = 1;
|
||||
sd = 0x010203; // 0 false, else true
|
||||
},
|
||||
{
|
||||
sst = 1;
|
||||
sd = 0x112233; // 0 false, else true
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
nr_cellid = 12345678L
|
||||
|
||||
nr_cellid = 12345678L;
|
||||
# tr_s_preference = "local_mac"
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 2;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
pdcch_ConfigSIB1 = (
|
||||
{
|
||||
controlResourceSetZero = 12;
|
||||
controlResourceSetZero = 11;
|
||||
searchSpaceZero = 0;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
servingCellConfigCommon = (
|
||||
{
|
||||
@@ -51,11 +56,23 @@ gNBs =
|
||||
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
|
||||
absoluteFrequencySSB = 641280;
|
||||
dl_frequencyBand = 78;
|
||||
# this is 3600 MHz
|
||||
dl_absoluteFrequencyPointA = 640008;
|
||||
# this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6
|
||||
#absoluteFrequencySSB = 620640;
|
||||
# this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68
|
||||
absoluteFrequencySSB = 621312;
|
||||
# this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2
|
||||
#absoluteFrequencySSB = 634080;
|
||||
# this is 3600.48 MHz
|
||||
#absoluteFrequencySSB = 640032;
|
||||
#dl_frequencyBand = 78;
|
||||
# this is 3301.68 MHz
|
||||
#dl_absoluteFrequencyPointA = 620112;
|
||||
# this is 3300.60 MHz
|
||||
dl_absoluteFrequencyPointA = 620040;
|
||||
# this is 3502.56 MHz
|
||||
#dl_absoluteFrequencyPointA = 633552;
|
||||
# this is 3600.48 MHz
|
||||
#dl_absoluteFrequencyPointA = 640032;
|
||||
#scs-SpecificCarrierList
|
||||
dl_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
@@ -64,40 +81,44 @@ gNBs =
|
||||
dl_carrierBandwidth = 106;
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=27,L=48 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 12952; # 6366 12925 12956 28875 12952
|
||||
# this is RBstart=0,L=106 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 28875;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
#pdcch-ConfigCommon
|
||||
initialDLBWPcontrolResourceSetZero = 12;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
initialDLBWPcontrolResourceSetZero = 11;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=1,L=5
|
||||
initialDLBWPstartSymbolAndLength_1 = 57;
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 78;
|
||||
ul_frequencyBand = 78;
|
||||
#scs-SpecificCarrierList
|
||||
ul_offstToCarrier = 0;
|
||||
ul_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
ul_subcarrierSpacing = 1;
|
||||
ul_carrierBandwidth = 106;
|
||||
ul_subcarrierSpacing = 1;
|
||||
ul_carrierBandwidth = 106;
|
||||
pMax = 20;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 12952;
|
||||
initialULBWPlocationAndBandwidth = 28875;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
#rach-ConfigCommon
|
||||
#rach-ConfigGeneric
|
||||
prach_ConfigurationIndex = 98;
|
||||
@@ -105,8 +126,8 @@ gNBs =
|
||||
#0 = one, 1=two, 2=four, 3=eight
|
||||
prach_msg1_FDM = 0;
|
||||
prach_msg1_FrequencyStart = 0;
|
||||
zeroCorrelationZoneConfig = 13;
|
||||
preambleReceivedTargetPower = -96;
|
||||
zeroCorrelationZoneConfig = 12;
|
||||
preambleReceivedTargetPower = -104;
|
||||
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
|
||||
preambleTransMax = 6;
|
||||
#powerRampingStep
|
||||
@@ -117,9 +138,9 @@ gNBs =
|
||||
ra_ResponseWindow = 4;
|
||||
#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
|
||||
#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3;
|
||||
#oneHalf (0..15) 4,8,12,16,...60,64
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14;
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
|
||||
#ra_ContentionResolutionTimer
|
||||
#(0..7) 8,16,24,32,40,48,56,64
|
||||
ra_ContentionResolutionTimer = 7;
|
||||
@@ -136,17 +157,20 @@ gNBs =
|
||||
restrictedSetConfig = 0,
|
||||
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6; # used for UL slot
|
||||
initialULBWPk2_0 = 6;
|
||||
initialULBWPmappingType_0 = 1
|
||||
initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13
|
||||
# this is SS=2 L=13
|
||||
initialULBWPstartSymbolAndLength_0 = 41;
|
||||
|
||||
initialULBWPk2_1 = 6; # used for mixed slot
|
||||
initialULBWPk2_1 = 6;
|
||||
initialULBWPmappingType_1 = 1;
|
||||
initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4
|
||||
# this is SS=0 L=4
|
||||
initialULBWPstartSymbolAndLength_1 = 52;
|
||||
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPk2_2 = 7;
|
||||
initialULBWPmappingType_2 = 1;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
@@ -188,7 +212,7 @@ gNBs =
|
||||
nrofUplinkSlots = 2;
|
||||
nrofUplinkSymbols = 4;
|
||||
|
||||
ssPBCH_BlockPower = -25;
|
||||
ssPBCH_BlockPower = -25;
|
||||
}
|
||||
|
||||
);
|
||||
@@ -202,61 +226,68 @@ gNBs =
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
////////// AMF parameters:
|
||||
amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
////////// MME parameters:
|
||||
amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
GNB_INTERFACE_NAME_FOR_NG_AMF = "eth0";
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR";
|
||||
GNB_INTERFACE_NAME_FOR_NGU = "eth0";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
GNB_INTERFACE_NAME_FOR_NG_AMF = "em1";
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR";
|
||||
GNB_INTERFACE_NAME_FOR_NGU = "em1";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
ulsch_max_slots_inactivity = 100;
|
||||
pusch_TargetSNRx10 = 200;
|
||||
pucch_TargetSNRx10 = 200;
|
||||
}
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
pusch_TargetSNRx10 = 200;
|
||||
pucch_TargetSNRx10 = 150;
|
||||
ulsch_max_slots_inactivity=20;
|
||||
}
|
||||
);
|
||||
|
||||
L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
pusch_proc_threads = 8;
|
||||
}
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
pusch_proc_threads = 2;
|
||||
prach_dtx_threshold = 120;
|
||||
pucch0_dtx_threshold = 150;
|
||||
}
|
||||
);
|
||||
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 1
|
||||
nb_rx = 1
|
||||
nb_tx = 2
|
||||
nb_rx = 2
|
||||
att_tx = 0
|
||||
att_rx = 0;
|
||||
bands = [7];
|
||||
bands = [78];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 81;
|
||||
max_rxgain = 75;
|
||||
eNB_instances = [0];
|
||||
#beamforming 1x4 matrix:
|
||||
bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
|
||||
#clock_src = "external";
|
||||
##beamforming 1x2 matrix: 1 layer x 2 antennas
|
||||
bf_weights = [0x00007fff, 0x0000];
|
||||
##beamforming 1x4 matrix: 1 layer x 4 antennas
|
||||
#bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000];
|
||||
## beamforming 2x2 matrix:
|
||||
# bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
|
||||
## beamforming 4x4 matrix:
|
||||
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
|
||||
|
||||
sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
|
||||
}
|
||||
);
|
||||
@@ -270,13 +301,21 @@ THREAD_STRUCT = (
|
||||
}
|
||||
);
|
||||
|
||||
rfsimulator :
|
||||
{
|
||||
serveraddr = "server";
|
||||
serverport = "4043";
|
||||
options = (); #("saviq"); or/and "chanmod"
|
||||
modelname = "AWGN";
|
||||
IQfile = "/tmp/rfsimulator.iqs";
|
||||
security = {
|
||||
# preferred ciphering algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nea0, nea1, nea2, nea3
|
||||
#fff ciphering_algorithms = ( "nea0" );
|
||||
|
||||
# preferred integrity algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nia0, nia1, nia2, nia3
|
||||
integrity_algorithms = ( "nia2", "nia0" );
|
||||
|
||||
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
|
||||
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
|
||||
drb_ciphering = "yes";
|
||||
drb_integrity = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
@@ -295,7 +334,6 @@ rfsimulator :
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
ngap_log_level ="debug";
|
||||
ngap_log_verbosity ="medium";
|
||||
f1ap_log_level ="debug";
|
||||
f1ap_log_verbosity ="medium";
|
||||
};
|
||||
|
||||
|
||||
@@ -257,6 +257,23 @@ THREAD_STRUCT = (
|
||||
}
|
||||
);
|
||||
|
||||
security = {
|
||||
# preferred ciphering algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nea0, nea1, nea2, nea3
|
||||
ciphering_algorithms = ( "nea0" );
|
||||
|
||||
# preferred integrity algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nia0, nia1, nia2, nia3
|
||||
integrity_algorithms = ( "nia2", "nia0" );
|
||||
|
||||
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
|
||||
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
|
||||
drb_ciphering = "yes";
|
||||
drb_integrity = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
|
||||
@@ -262,6 +262,23 @@ THREAD_STRUCT = (
|
||||
}
|
||||
);
|
||||
|
||||
security = {
|
||||
# preferred ciphering algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nea0, nea1, nea2, nea3
|
||||
ciphering_algorithms = ( "nea0" );
|
||||
|
||||
# preferred integrity algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nia0, nia1, nia2, nia3
|
||||
integrity_algorithms = ( "nia2", "nia0" );
|
||||
|
||||
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
|
||||
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
|
||||
drb_ciphering = "yes";
|
||||
drb_integrity = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
|
||||
@@ -272,6 +272,23 @@ THREAD_STRUCT = (
|
||||
}
|
||||
);
|
||||
|
||||
security = {
|
||||
# preferred ciphering algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nea0, nea1, nea2, nea3
|
||||
ciphering_algorithms = ( "nea0" );
|
||||
|
||||
# preferred integrity algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nia0, nia1, nia2, nia3
|
||||
integrity_algorithms = ( "nia2", "nia0" );
|
||||
|
||||
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
|
||||
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
|
||||
drb_ciphering = "yes";
|
||||
drb_integrity = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
|
||||
@@ -286,7 +286,7 @@ class gDashboard:
|
||||
|
||||
|
||||
def main():
|
||||
my_gDashboard=gDashboard("/home/oaicicd/remi/creds.json", 'OAI RAN Dashboard', 'MR Status')
|
||||
my_gDashboard=gDashboard("/opt/dashboard/g_creds.json", 'OAI RAN Dashboard', 'MR Status')
|
||||
cmd="""curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests?state=opened&per_page=100" """
|
||||
my_gDashboard.fetchData(cmd)
|
||||
my_gDashboard.gBuild("MR Status")
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ cd cmake_targets/
|
||||
./build_oai -I -w USRP --eNB --UE --nrUE --gNB
|
||||
```
|
||||
|
||||
- The `-I` option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed.
|
||||
- The `-I` option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed. Note: for Ubuntu 20 use cmake_targets/install_external_packages.ubuntu20 instead!
|
||||
- The `-w` option is to select the radio head support you want to include in your build. Radio head support is provided via a shared library, which is called the "oai device" The build script creates a soft link from `liboai_device.so` to the true device which will be used at run-time (here the USRP one,`liboai_usrpdevif.so` . USRP is the only hardware tested today in the Continuous Integration process. The RF simulator[RF simulator](../targets/ARCH/rfsimulator/README.md) is implemented as a specific device replacing RF hardware, it can be specifically built using `-w SIMU` option, but is also built during any softmodem build.
|
||||
- `--eNB` is to build the `lte-softmodem` executable and all required shared libraries
|
||||
- `--gNB` is to build the `nr-softmodem` executable and all required shared libraries
|
||||
|
||||
+159
-33
@@ -272,10 +272,10 @@ The following features are valid for the gNB and the 5G-NR UE.
|
||||
* 30KHz SCS for FR1 and 120 KHz SCS for FR2
|
||||
* Generation of NR-PSS/NR-SSS
|
||||
* NR-PBCH supports multiple SSBs and flexible periodicity
|
||||
* Generation of NR-PDCCH for SIB1 (including generation of DCI, polar encoding, scrambling, modulation, RB mapping, etc)
|
||||
- common search space configured by MIB
|
||||
- user-specific search space configured by RRC
|
||||
- DCI formats: 00, 10 (01 and 11 **under integration**)
|
||||
* Generation of NR-PDCCH (including generation of DCI, polar encoding, scrambling, modulation, RB mapping, etc)
|
||||
- common search space
|
||||
- user-specific search space
|
||||
- DCI formats: 00, 10, 01 and 11
|
||||
* Generation of NR-PDSCH (including Segmentation, LDPC encoding, rate matching, scrambling, modulation, RB mapping, etc).
|
||||
- PDSCH mapping type A and B
|
||||
- DMRS configuration type 1 and 2
|
||||
@@ -292,8 +292,8 @@ The following features are valid for the gNB and the 5G-NR UE.
|
||||
- Support for 1 RX antenna
|
||||
- Support for 1 layer
|
||||
* NR-PUCCH
|
||||
- Format 0 (2 bits, mainly for ACK/NACK)
|
||||
- Format 2 (up to 64 bits, mainly for CSI feedback)
|
||||
- Format 0 (2 bits, for ACK/NACK and SR)
|
||||
- Format 2 (up to 11 bits, mainly for CSI feedback)
|
||||
* NR-PRACH
|
||||
- Formats 0,1,2,3, A1-A3, B1-B3
|
||||
* Highly efficient 3GPP compliant LDPC encoder and decoder (BG1 and BG2 are supported)
|
||||
@@ -302,34 +302,103 @@ The following features are valid for the gNB and the 5G-NR UE.
|
||||
|
||||
## gNB Higher Layers ##
|
||||
|
||||
**gNB RRC**
|
||||
- NR RRC (38.331) Rel 15 messages using new asn1c
|
||||
- LTE RRC (36.331) also updated to Rel 15
|
||||
- Generation of CellGroupConfig (for eNB) and MIB
|
||||
- Generation of system information block 1 (SIB1)
|
||||
- Application to read configuration file and program gNB RRC
|
||||
- RRC can configure PDCP, RLC, MAC
|
||||
|
||||
**gNB X2AP**
|
||||
- X2 setup with eNB
|
||||
- Handling of SgNB Addition Request / Addition Request Acknowledge / Reconfiguration Complete
|
||||
|
||||
**gNB MAC**
|
||||
- MAC -> PHY configuration using NR FAPI P5 interface
|
||||
- MAC <-> PHY data interface using FAPI P7 interface for BCH PDU, DCI PDU, PDSCH PDU
|
||||
- Scheduler procedures for SIB1
|
||||
- Scheduler procedures for RA
|
||||
- Contention free RA procedure
|
||||
- Contention based RA procedure
|
||||
- Scheduler procedures for CSI-RS
|
||||
- MAC downlink scheduler (fixed allocations)
|
||||
- MAC downlink scheduler
|
||||
- phy-test scheduler (fixed allocation and usable also without UE)
|
||||
- regular scheduler with dynamic allocation
|
||||
- MAC header generation (including timing advance)
|
||||
- ACK / NACK handling and HARQ procedures for downlink
|
||||
- **As of May 2020** only DL was validated with COTS phone ; UL in progress, validated with OAI UE in noS1 mode
|
||||
- MAC uplink scheduler
|
||||
- phy-test scheduler (fixed allocation)
|
||||
- regular scheduler with dynamic allocation
|
||||
- HARQ procedures for uplink
|
||||
- MAC procedures to handle CSI measurement report
|
||||
- evalution of RSRP report
|
||||
- evaluation of CQI report
|
||||
- MAC scheduling of SR reception
|
||||
|
||||
**gNB RLC**
|
||||
- Send/Receive operations according to 38.322 Rel.16
|
||||
- Segmentation and reassembly procedures
|
||||
- RLC Acknowledged mode supporting PDU retransmissions
|
||||
- RLC Unacknowledged mode
|
||||
- DRBs and SRBs establishment/handling and association with RLC entities
|
||||
- Timers implementation
|
||||
- Interfaces with PDCP, MAC
|
||||
- Interfaces with gtp-u (data Tx/Rx over F1-U at the DU)
|
||||
|
||||
**gNB PDCP**
|
||||
- Send/Receive operations according to 38.323 Rel.16
|
||||
- Integrity protection and ciphering procedures
|
||||
- Sequence number management, SDU dicard and in-order delivery
|
||||
- Radio bearer establishment/handling and association with PDCP entities
|
||||
- Interfaces with RRC, RLC
|
||||
- Interfaces with gtp-u (data Tx/Rx over N3 and F1-U interfaces)
|
||||
|
||||
**gNB RRC**
|
||||
- NR RRC (38.331) Rel 16 messages using new asn1c
|
||||
- LTE RRC (36.331) also updated to Rel 15
|
||||
- Generation of CellGroupConfig (for eNB) and MIB
|
||||
- Generation of system information block 1 (SIB1)
|
||||
- Generation of system information block 2 (SIB2)
|
||||
- Application to read configuration file and program gNB RRC
|
||||
- RRC can configure PDCP, RLC, MAC
|
||||
- Interface with gtp-u (tunnel creation/handling for S1-U (NSA), N3 (SA) interfaces)
|
||||
- Integration of RRC messages and procedures supporting UE 5G SA connection
|
||||
- RRCSetupRequest/RRCSetup/RRCSetupComplete
|
||||
- RRC Uplink/Downlink Information transfer carrying NAS messages transparently
|
||||
- RRC Reconfiguration/Reconfiguration complete
|
||||
- Support for master cell group configuration
|
||||
- Interface with NGAP for the interactions with the AMF
|
||||
- Interface with F1AP for CU/DU split deployment option
|
||||
|
||||
**gNB X2AP**
|
||||
- Integration of X2AP messages and procedures for the exchanges with the eNB over X2 interface supporting the NSA setup according to 36.423 Rel. 15
|
||||
- X2 setup with eNB
|
||||
- Handling of SgNB Addition Request / Addition Request Acknowledge / Reconfiguration Complete
|
||||
|
||||
**gNB NGAP**
|
||||
|
||||
- Integration of NGAP messages and procedures for the exchanges with the AMF over N2 interface according to 38.413 Rel. 15
|
||||
- NGAP Setup request/response
|
||||
- NGAP Initial UE message
|
||||
- NGAP Initial context setup request/response
|
||||
- NGAP Downlink/Uplink NAS transfer
|
||||
- NGAP UE context release request/complete
|
||||
- NGAP UE radio capability info indication
|
||||
- NGAP PDU session resource setup request/response
|
||||
- Interface with RRC
|
||||
|
||||
**gNB F1AP**
|
||||
|
||||
- Integration of F1AP messages and procedures for the control plane exchanges between the CU and DU entities according to 38.473 Rel. 16
|
||||
- F1 Setup request/response
|
||||
- F1 DL/UL RRC message transfer
|
||||
- F1 Initial UL RRC message transfer
|
||||
- F1 UE Context setup request/response
|
||||
- F1 gNB CU configuration update
|
||||
- Interface with RRC
|
||||
- Interface with gtp-u (tunnel creation/handling for F1-U interface)
|
||||
|
||||
**gNB GTP-U**
|
||||
- New gtp-u implementation supporting both N3 and F1-U interfaces according to 29.281 Rel.15
|
||||
- Interfaces with RRC, F1AP for tunnel creation
|
||||
- Interfaces with PDCP and RLC for data send/receive at the CU and DU respectively (F1-U interface)
|
||||
|
||||
# OpenAirInterface 5G-NR UE Feature Set #
|
||||
|
||||
**as of May 2020** only supporting "noS1" mode (DL):
|
||||
- Creates TUN interface to PDCP to inject and receive user-place traffic
|
||||
- Will only work with OAI gNB configured in the same mode
|
||||
* Supporting "noS1" mode (DL and UL):
|
||||
- Creates TUN interface to PDCP to inject and receive user-place traffic
|
||||
- No connection to the core network
|
||||
* Supporting Standalone (SA) mode:
|
||||
- UE can register with the 5G Core Network, establish a PDU Session and exchange user-plane traffic
|
||||
|
||||
## NR UE PHY Layer ##
|
||||
|
||||
@@ -339,10 +408,10 @@ The following features are valid for the gNB and the 5G-NR UE.
|
||||
* 30KHz SCS for FR1 and 120 KHz SCS for FR2
|
||||
* Reception of NR-PSS/NR-SSS
|
||||
* NR-PBCH supports multiple SSBs and flexible periodicity
|
||||
* Reception of NR-PDCCH for SIB1 (including reception of DCI, polar decoding, de-scrambling, de-modulation, RB de-mapping, etc)
|
||||
* Reception of NR-PDCCH (including reception of DCI, polar decoding, de-scrambling, de-modulation, RB de-mapping, etc)
|
||||
- common search space configured by MIB
|
||||
- user-specific search space configured by RRC
|
||||
- DCI formats: 00, 10 (01 and 11 **under integration**)
|
||||
- DCI formats: 00, 10, 01 and 11
|
||||
* Reception of NR-PDSCH (including Segmentation, LDPC decoding, rate de-matching, de-scrambling, de-modulation, RB de-mapping, etc).
|
||||
- PDSCH mapping type A and B
|
||||
- DMRS configuration type 1 and 2
|
||||
@@ -358,29 +427,86 @@ The following features are valid for the gNB and the 5G-NR UE.
|
||||
- Support for 1 TX antenna
|
||||
- Support for 1 layer
|
||||
* NR-PUCCH
|
||||
- Format 0 (2 bits, mainly for ACK/NACK)
|
||||
- Format 0 (2 bits for ACK/NACK and SR)
|
||||
- Format 2 (up to 64 bits, mainly for CSI feedback)
|
||||
- Format 1, 3 and 4 present but old code never dested (need restructuring before verification)
|
||||
* NR-PRACH
|
||||
- Formats 0,1,2,3, A1-A3, B1-B3
|
||||
* NR-SRS
|
||||
- Old code never dested (need restructuring before verification)
|
||||
* SS-RSRP
|
||||
- RSRP measured on synchronization SSB (ok only for single SSB)
|
||||
* Highly efficient 3GPP compliant LDPC encoder and decoder (BG1 and BG2 are supported)
|
||||
* Highly efficient 3GPP compliant polar encoder and decoder
|
||||
* Encoder and decoder for short block
|
||||
|
||||
## NR UE FAPI ##
|
||||
|
||||
* MAC -> PHY configuration via UE FAPI P5 interface
|
||||
* Basic MAC to control PHY via UE FAPI P7 interface
|
||||
* PHY -> MAC indication (needs some improvement)
|
||||
|
||||
## NR UE Higher Layers ##
|
||||
|
||||
**UE MAC**
|
||||
* Minimum system information (MSI)
|
||||
- Initial sync and MIB detection
|
||||
- System information block 1 (SIB1) reception
|
||||
* MAC -> PHY configuration of PHY via UE FAPI P5 interface
|
||||
* Basic MAC to control PHY via UE FAPI P7 interface
|
||||
* Random access procedure
|
||||
- MIB processing
|
||||
- Scheduling of system information block 1 (SIB1) reception
|
||||
* Random access procedure (needs improvement, there is still not a clear separation between MAC and PHY)
|
||||
- Mapping SSBs to multiple ROs
|
||||
- Scheduling of PRACH
|
||||
- Processing of RAR
|
||||
- Transmission and re-transmission of Msg3
|
||||
- Msg4 and contention resolution
|
||||
* DCI processing
|
||||
- format 10 (RA-RNTI, C-RNTI, SI-RNTI, TC-RNTI)
|
||||
- format 00 (C-RNTI, TC-RNTI)
|
||||
- format 11 (C-RNTI)
|
||||
- format 01 (C-RNTI)
|
||||
* UCI processing
|
||||
- ACK/NACK processing
|
||||
- Triggering periodic SR
|
||||
- CSI measurement reporting (SSB RSRP only)
|
||||
* DLSH scheduler
|
||||
- Configuration of fapi PDU according to DCI
|
||||
- HARQ procedures
|
||||
* ULSCH scheduler
|
||||
- Configuration of fapi PDU according to DCI
|
||||
|
||||
|
||||
**RLC**
|
||||
**UE RLC**
|
||||
* Tx/Rx operations according to 38.322 Rel.16
|
||||
- Segmentation and reassembly procedures
|
||||
- RLC Acknowledged mode supporting PDU retransmissions
|
||||
- RLC Unacknowledged mode
|
||||
- DRBs and SRBs establishment and handling
|
||||
- Timers implementation
|
||||
- Interfaces with PDCP, MAC
|
||||
|
||||
**PDCP**
|
||||
**UE PDCP**
|
||||
* Tx/Rx operations according to 38.323 Rel.16
|
||||
- Integrity protection and ciphering procedures
|
||||
- Sequence number management, SDU dicard and in-order delivery
|
||||
- Radio bearer establishment/handling and association with PDCP entities
|
||||
- Interfaces with RRC, RLC
|
||||
|
||||
**UE RRC**
|
||||
* Integration of RRC messages and procedures supporting UE 5G SA connection according to 38.331 Rel.16
|
||||
- RRCSetupRequest/RRCSetup/RRCSetupComplete
|
||||
- RRC Uplink/Downlink Information transfer carrying NAS messages transparently
|
||||
- RRC Reconfiguration/Reconfiguration complete
|
||||
- Support for master cell group configuration
|
||||
* Interface with PDCP: configuration, DCCH and CCCH message handling
|
||||
* Interface with RLC and MAC for configuration
|
||||
|
||||
**UE NAS**
|
||||
* Transfer of NAS messages between the AMF and the UE supporting the UE registration with the core network and the PDU session establishment according to 24.501 Rel.16
|
||||
- Identity Request/Response
|
||||
- Authentication Request/Response
|
||||
- Security Mode Command/Complete
|
||||
- Registration Request/Accept/Complete
|
||||
- PDU Session Establishment Request/Accept
|
||||
- NAS configuration and basic interfacing with RRC
|
||||
|
||||
|
||||
|
||||
|
||||
+191
-73
@@ -1,5 +1,27 @@
|
||||
<table style="border-collapse: collapse; border: none;">
|
||||
<tr style="border-collapse: collapse; border: none;">
|
||||
<td style="border-collapse: collapse; border: none;">
|
||||
<a href="http://www.openairinterface.org/">
|
||||
<img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150>
|
||||
</img>
|
||||
</a>
|
||||
</td>
|
||||
<td style="border-collapse: collapse; border: none; vertical-align: center;">
|
||||
<b><font size = "5">OAI 5G SA tutorial</font></b>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
# OAI 5G SA tutorial [Under construction]
|
||||
**TABLE OF CONTENTS**
|
||||
|
||||
1. [SA setup with COTS UE](#1--sa-setup-with-cots-ue)
|
||||
1. [gNB build and configuration](#11--gnb-build-and-configuration)
|
||||
2. [OAI 5G Core Network installation and configuration](#12--oai-5g-core-network-installation-and-configuration)
|
||||
3. [Execution of SA scenario](#13--execution-of-sa-scenario)
|
||||
2. [SA Setup with OAI NR UE Softmodem](#2-sa-setup-with-oai-nr-ue-softmodem)
|
||||
1. [Build and configuration](#21-build-and-configuration)
|
||||
2. [OAI 5G Core Network installation and configuration](#22--oai-5g-core-network-installation-and-configuration)
|
||||
3. [Execution of SA scenario](#23-execution-of-sa-scenario)
|
||||
|
||||
In the following tutorial we describe how to deploy configure and test the two SA OAI setups:
|
||||
|
||||
@@ -12,10 +34,10 @@ The operating system and hardware requirements to support OAI 5G NR are describe
|
||||
At the moment of writing this document interoperability with the following COTS UE devices is being tested:
|
||||
|
||||
- [Quectel RM500Q-GL](https://www.quectel.com/product/5g-rm500q-gl/)
|
||||
- [Simcom SIMCOM8200EA](https://www.simcom.com/product/SIM8200G.html)
|
||||
- [Simcom SIMCOM8200EA](https://www.simcom.com/product/SIM8200EA_M2.html)
|
||||
- Huawei Mate 30 Pro
|
||||
|
||||
End-to-end control plane signaling to achieve a 5G SA connection, UE registration and PDU session establishment with the CN, as well as some basic user-plane traffic tests have been validated so far using the Quectel module and Huawei Mate 30 pro and partially validated with SIMCOM module. In terms of interoperability with different 5G Core Networks, so far this setup has been tested with:
|
||||
End-to-end control plane signaling to achieve a 5G SA connection, UE registration and PDU session establishment with the CN, as well as some basic user-plane traffic tests have been validated so far using SIMCOM/Quectel modules and Huawei Mate 30 pro. In terms of interoperability with different 5G Core Networks, so far this setup has been tested with:
|
||||
|
||||
|
||||
- [OAI CN](https://openairinterface.org/oai-5g-core-network-project/)
|
||||
@@ -23,20 +45,57 @@ At the moment of writing this document interoperability with the following COTS
|
||||
- [Free CN](https://www.free5gc.org/)
|
||||
|
||||
|
||||
## 1.1 gNB build and configuration
|
||||
At the moment of writing this document, most of the code to support the SA setup is not merged into develop branch yet, but it is accessible through the following branches:
|
||||
## 1.1 gNB build and configuration
|
||||
To get the code and build the gNB executable:
|
||||
|
||||
- NR_SA_F1AP_5GRECORDS
|
||||
- develop-NR_SA_F1AP_5GRECORDS (up-to-date with latest develop branch)
|
||||
|
||||
To build the gNB executable:
|
||||
### Ubuntu 18.04
|
||||
```bash
|
||||
cd cmake_targets
|
||||
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
|
||||
git checkout develop
|
||||
cd openairinterface5g/
|
||||
source oaienv
|
||||
cd cmake_targets/
|
||||
./build_oai -I -w USRP #For OAI first time installation only to install software dependencies
|
||||
./build_oai --gNB -w USRP
|
||||
```
|
||||
|
||||
A reference configuration file for the gNB is provided [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop-NR_SA_F1AP_5GRECORDS/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf).
|
||||
### Ubuntu 20.04
|
||||
```bash
|
||||
# Build UHD from source
|
||||
# https://files.ettus.com/manual/page_build_guide.html
|
||||
sudo apt-get install libboost-all-dev libusb-1.0-0-dev doxygen python3-docutils python3-mako python3-numpy python3-requests python3-ruamel.yaml python3-setuptools cmake build-essential
|
||||
|
||||
git clone https://github.com/EttusResearch/uhd.git
|
||||
cd uhd/host
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ../
|
||||
make -j 4
|
||||
make test # This step is optional
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
sudo uhd_images_downloader
|
||||
|
||||
|
||||
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
|
||||
git checkout develop
|
||||
|
||||
# Install dependencies in Ubuntu 20.04
|
||||
cd
|
||||
cd openairinterface5g/
|
||||
source oaienv
|
||||
cd cmake_targets/
|
||||
./install_external_packages.ubuntu20
|
||||
|
||||
# Build OAI gNB
|
||||
cd
|
||||
cd openairinterface5g/
|
||||
source oaienv
|
||||
cd cmake_targets/
|
||||
./build_oai --gNB -w USRP
|
||||
```
|
||||
|
||||
A reference configuration file for the gNB is provided [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf).
|
||||
|
||||
|
||||
In the following, we highlight the fields of the file that have to be configured according to the configuration and interfaces of the Core Network. First, the PLMN section has to be filled with the proper values that match the configuration of the AMF and the UE USIM.
|
||||
@@ -58,42 +117,69 @@ In the following, we highlight the fields of the file that have to be configured
|
||||
}
|
||||
);
|
||||
});
|
||||
```
|
||||
```
|
||||
Then, the source and destination IP interfaces for the communication with
|
||||
the Core Network also need to be set as shown below.
|
||||
|
||||
```bash
|
||||
////////// MME parameters:
|
||||
amf_ip_address = ( { ipv4 = "192.168.70.132";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai";
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24";
|
||||
GNB_INTERFACE_NAME_FOR_NGU = "demo-oai";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
```
|
||||
////////// AMF parameters:
|
||||
amf_ip_address = ( { ipv4 = "192.168.70.132";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai";
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24";
|
||||
GNB_INTERFACE_NAME_FOR_NGU = "demo-oai";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
```
|
||||
In the first part (*amf_ip_address*) we specify the IP of the AMF and in the second part (*NETWORK_INTERFACES*) we specify the gNB local interface with AMF (N2 interface) and the UPF (N3 interface).
|
||||
|
||||
**CAUTION:** the `192.168.70.132` AMF IF address is the OAI-CN5G `AMF` Container IP address. You certainly will need to do some networking manipulations for the `gNB` server to be able to see this AMF container.
|
||||
|
||||
Please read [CN5G tutorial for more details](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/blob/master/README.md).
|
||||
|
||||
### **gNB configuration in CU/DU split mode**
|
||||
For the configuration of the gNB in CU and DU blocks the following sample configuration files are provided for the CU and DU entities respectively.
|
||||
......
|
||||
At the point of writing this document the control-plane exchanges between the CU and the DU over *F1-C* interface have been validated. The integration of *F1-U* over gtp-u for the support of data plane traffic is ongoing.
|
||||
For the configuration of the gNB in CU and DU blocks, the following sample configuration files are provided for the [CU](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf) and the [DU](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf) entities respectively. These configuration files have to be updated with the IP addresses of the CU and the DU over the F1 interface. For example, in the following section from the DU configuration file, *local_n_address* corresponds to the DU address and *remote_n_address* corresponds to the CU address:
|
||||
|
||||
```bash
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "f1";
|
||||
local_n_if_name = "lo";
|
||||
local_n_address = "127.0.0.3";
|
||||
remote_n_address = "127.0.0.4";
|
||||
local_n_portc = 601;
|
||||
local_n_portd = 2152;
|
||||
remote_n_portc = 600;
|
||||
remote_n_portd = 2152;
|
||||
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
|
||||
At the point of writing this document the control-plane exchanges between the CU and the DU over *F1-C* interface, as well as some IP traffic tests over *F1-U* have been validated using the OAI gNB/nrUE in RFSIMULATOR mode.
|
||||
|
||||
*These extensions are not yet fully integrated into develop branch, as they are under merge request. Until they get fully integrated, the CU/DU functionalities can be tested in [NR_F1C_F1U_extensions](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/NR_F1C_F1U_extensions) branch.*
|
||||
|
||||
## 1.2 OAI 5G Core Network installation and configuration
|
||||
The instructions for the installation of OAI CN components (AMF, SMF, NRF, UPF) using docker compose can be found [here](https://gitlab.eurecom.fr/oai/cn5g). Below are some complementary instructions which can be useful for the deployment.
|
||||
The instructions for the installation of OAI CN components (AMF, SMF, NRF, UPF) using `docker-compose` can be found [here](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/blob/master/README.md).
|
||||
|
||||
## 1.3 Execution of SA scenario
|
||||
## 1.3 Execution of SA scenario
|
||||
|
||||
After having configured the gNB, we can start the individual components in the following sequence:
|
||||
|
||||
- Launch Core Network
|
||||
- Launch 5G Core Network
|
||||
- Launch gNB
|
||||
- Launch COTS UE (disable airplane mode)
|
||||
|
||||
@@ -101,62 +187,94 @@ The execution command to start the gNB (in monolithic mode) is the following:
|
||||
```bash
|
||||
cd cmake_targets/ran_build/build
|
||||
sudo ./nr-softmodem -E --sa -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf
|
||||
```
|
||||
```
|
||||
|
||||
# 2. SA Setup with OAI UE
|
||||
The SA setup with OAI UE has been validated with RFSIMULATOR for the moment. The control plane for the successful UE registration and PDU Session establishment has been verified with OAI and Nokia SA Box CNs. User-plane traffic validation after the establishment of the 5G connection is still pending for this setup.
|
||||
# 2. SA Setup with OAI NR UE Softmodem
|
||||
The SA setup with OAI UE has been validated with **RFSIMULATOR**. Both control plane and user plane for the successful UE registration and PDU Session establishment has been verified with OAI and Nokia SA Box CNs.
|
||||
|
||||
In the following, we provide the instructions on how to build, configure and execute this SA setup.
|
||||
|
||||
### NAS configuration for the OAI UE
|
||||
The NAS configuration parameters of the OAI UE can be set as input parameters, configuration file or can be hardcoded. More specifically:
|
||||
- SUCI (*Subscription Concealed Identifier*)
|
||||
- USIM_API_K and OPc keys
|
||||
- NSSAI (*Network Slice Assistance Information*)
|
||||
- DNN (*Data Network Name*)
|
||||
|
||||
Below is a sample configuration file that can be parsed through the execution command ([section 2.3](#23-execution-of-sa-scenario)).
|
||||
|
||||
```bash
|
||||
uicc0 = {
|
||||
imsi = "208990000007487";
|
||||
key = "fec86ba6eb707ed08905757b1bb44b8f";
|
||||
opc= "C42449363BBAD02B66D16BC975D77CC1";
|
||||
dnn= "oai";
|
||||
nssai_sst=1;
|
||||
nssai_sd=1;
|
||||
}
|
||||
```
|
||||
|
||||
Alternatively, the values can be hardcoded/edited in source file ***openair3/UICC/usim_interface.c*** through the following lines:
|
||||
```bash
|
||||
#define UICC_PARAMS_DESC {\
|
||||
{"imsi", "USIM IMSI\n", 0, strptr:&(uicc->imsiStr), defstrval:"2089900007487", TYPE_STRING, 0 },\
|
||||
{"nmc_size" "number of digits in NMC", 0, iptr:&(uicc->nmc_size), defintval:2, TYPE_INT, 0 },\
|
||||
{"key", "USIM Ki\n", 0, strptr:&(uicc->keyStr), defstrval:"fec86ba6eb707ed08905757b1bb44b8f", TYPE_STRING, 0 },\
|
||||
{"opc", "USIM OPc\n", 0, strptr:&(uicc->opcStr), defstrval:"c42449363bbad02b66d16bc975d77cc1", TYPE_STRING, 0 },\
|
||||
{"amf", "USIM amf\n", 0, strptr:&(uicc->amfStr), defstrval:"8000", TYPE_STRING, 0 },\
|
||||
{"sqn", "USIM sqn\n", 0, strptr:&(uicc->sqnStr), defstrval:"000000", TYPE_STRING, 0 },\
|
||||
{"dnn", "UE dnn (apn)\n", 0, strptr:&(uicc->dnnStr), defstrval:"oai", TYPE_STRING, 0 },\
|
||||
{"nssai_sst", "UE nssai\n", 0, iptr:&(uicc->nssai_sst), defintval:1, TYPE_INT, 0 }, \
|
||||
{"nssai_sd", "UE nssai\n", 0, iptr:&(uicc->nssai_sd), defintval:1, TYPE_INT, 0 }, \
|
||||
};
|
||||
```
|
||||
|
||||
For interoperability with OAI or other CNs, it should be ensured that the configuration of the aforementioned parameters match the configuration of the corresponding subscribed user at the core network.
|
||||
|
||||
In the following, we provide the instructions on how to build, configure and execute this SA setup.
|
||||
|
||||
## 2.1 Build and configuration
|
||||
To build the gNB and OAI UE executables:
|
||||
|
||||
```bash
|
||||
cd cmake_targets
|
||||
./build_oai -I #For OAI first time installation only to install software dependencies
|
||||
# Note: For OAI first time installation please install software dependencies as described in 1.1.
|
||||
./build_oai --gNB --nrUE -w SIMU
|
||||
```
|
||||
The gNB configuration can be performed according to what is described in section 1.1, using the same reference configuration file as with the RF scenario.
|
||||
The gNB configuration can be performed according to what is described in [section 1.1](#11--gnb-build-and-configuration), using the same reference configuration file as with the RF scenario.
|
||||
|
||||
### NAS configuration for the OAI UE
|
||||
At the moment, the NAS configuration parameters of the OAI UE are hardcoded in ***openair3/NAS/NR_UE/nr_nas_msg_sim.c***. More specifically:
|
||||
## 2.2 OAI 5G Core Network installation and configuration
|
||||
The instructions for the installation of OAI CN components (AMF, SMF, NRF, UPF) using `docker-compose` can be found [here](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/blob/master/README.md).
|
||||
|
||||
- The SUCI (*Subscription Concealed Identifier*) corresponding to default IMSI 2089900007487 is hardcoded in functions *generateRegistrationRequest()* and *generateIdentityResponse()* through the following lines:
|
||||
```bash
|
||||
mm_msg->registration_request.fgsmobileidentity.suci.typeofidentity = FGS_MOBILE_IDENTITY_SUCI;
|
||||
mm_msg->registration_request.fgsmobileidentity.suci.mncdigit1 = 9;
|
||||
mm_msg->registration_request.fgsmobileidentity.suci.mncdigit2 = 9;
|
||||
mm_msg->registration_request.fgsmobileidentity.suci.mncdigit3 = 0xf;
|
||||
mm_msg->registration_request.fgsmobileidentity.suci.mccdigit1 = 2;
|
||||
mm_msg->registration_request.fgsmobileidentity.suci.mccdigit2 = 0;
|
||||
mm_msg->registration_request.fgsmobileidentity.suci.mccdigit3 = 8;
|
||||
mm_msg->registration_request.fgsmobileidentity.suci.schemeoutput = 0x4778;
|
||||
```
|
||||
- USIM_API_K and OPc keys are hardcoded at the beginning of the file:
|
||||
```bash
|
||||
// USIM_API_K: fe c8 6b a6 eb 70 7e d0 89 05 75 7b 1b b4 4b 8f
|
||||
uint8_t k[16] = {0xfe, 0xc8, 0x6b, 0xa6, 0xeb, 0x70, 0x7e, 0xd0, 0x89, 0x05, 0x75, 0x7b, 0x1b, 0xb4, 0x4b, 0x8f};
|
||||
// OPC: c4 24 49 36 3b ba d0 2b 66 d1 6b c9 75 d7 7c c1
|
||||
const uint8_t opc[16] = {0xc4, 0x24, 0x49, 0x36, 0x3b, 0xba, 0xd0, 0x2b, 0x66, 0xd1, 0x6b, 0xc9, 0x75, 0xd7, 0x7c, 0xc1};
|
||||
```
|
||||
- The NSSAI (*Network Slice Assistance Information*) and DNN (*Data Network Name*) are hardcoded in function *generatePduSessionEstablishRequest()*
|
||||
```bash
|
||||
uint8_t nssai[]={1,0,0,1}; //Corresponding to SST:1, SD:1
|
||||
uint8_t dnn[4]={0x4,0x6f,0x61,0x69}; //Corresponding to dnn:"oai"
|
||||
```
|
||||
For interoperability with OAI or other CNs, it should be ensured that the configuration of the aforementioned parameters match the configuration of the corresponding subscribed user at the core network.
|
||||
Hardcoding of the USIM information will soon be substituted with parsing those parameters from a configuration file.
|
||||
In addition, if you do not want to build anything, please have a look at [this tutorial](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/ci-scripts/yaml_files/5g_rfsimulator/README.md).
|
||||
|
||||
## 2.2 Execution of SA scenario
|
||||
## 2.3 Execution of SA scenario
|
||||
|
||||
The order of starting the different components should be the same as the one described in section 1.3.
|
||||
The order of starting the different components should be the same as the one described in [section 1.3](#13--execution-of-sa-scenario).
|
||||
|
||||
- To launch the gNB:
|
||||
the gNB can be launched in 2 modes:
|
||||
|
||||
- To launch the gNB in `monolithic` mode:
|
||||
```bash
|
||||
sudo RFSIMULATOR=server ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --rfsim --sa
|
||||
sudo RFSIMULATOR=server ./nr-softmodem --rfsim --sa \
|
||||
-O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf
|
||||
```
|
||||
- To launch the OAI UE:
|
||||
- To launch the gNB in `CU/DU split` mode:
|
||||
|
||||
1. Launch the CU component:
|
||||
```bash
|
||||
sudo RFSIMULATOR=server ./nr-softmodem --rfsim --sa \
|
||||
-O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf
|
||||
```
|
||||
2. Launch the DU component:
|
||||
```bash
|
||||
sudo RFSIMULATOR=server ./nr-softmodem --rfsim --sa \
|
||||
-O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf
|
||||
```
|
||||
|
||||
- To launch the OAI UE (valid in `monolithic` gNB and `CU/DU split` gNB):
|
||||
```bash
|
||||
sudo RFSIMULATOR=127.0.0.1 ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa --nokrnmod
|
||||
sudo RFSIMULATOR=127.0.0.1 ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 \
|
||||
--rfsim --sa --nokrnmod -O <PATH_TO_UE_CONF_FILE>
|
||||
```
|
||||
|
||||
The IP address at the execution command of the OAI UE corresponds to the target IP of the gNB host that the RFSIMULATOR at the UE will connect to. In the above example, we assume that the gNB and UE are running on the same host so the specified address (127.0.0.1) is the one of the loopback interface.
|
||||
|
||||
@@ -275,6 +275,23 @@ THREAD_STRUCT = (
|
||||
}
|
||||
);
|
||||
|
||||
security = {
|
||||
# preferred ciphering algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nea0, nea1, nea2, nea3
|
||||
ciphering_algorithms = ( "nea0" );
|
||||
|
||||
# preferred integrity algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nia0, nia1, nia2, nia3
|
||||
integrity_algorithms = ( "nia2", "nia0" );
|
||||
|
||||
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
|
||||
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
|
||||
drb_ciphering = "yes";
|
||||
drb_integrity = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
#include "executables/softmodem-common.h"
|
||||
#include <nfapi/oai_integration/nfapi_pnf.h>
|
||||
#include <openair1/PHY/NR_TRANSPORT/nr_ulsch.h>
|
||||
#include <openair1/PHY/NR_TRANSPORT/nr_dlsch.h>
|
||||
#include <PHY/NR_ESTIMATION/nr_ul_estimation.h>
|
||||
//#define DEBUG_THREADS 1
|
||||
|
||||
@@ -184,7 +185,7 @@ void rx_func(void *param) {
|
||||
int down_removed = 0;
|
||||
int pucch_removed = 0;
|
||||
for (int i = 0; i < rnti_to_remove_count; i++) {
|
||||
LOG_W(PHY, "to remove rnti %d\n", rnti_to_remove[i]);
|
||||
LOG_W(NR_PHY, "to remove rnti %d\n", rnti_to_remove[i]);
|
||||
void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch);
|
||||
void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);
|
||||
int j;
|
||||
@@ -224,7 +225,7 @@ void rx_func(void *param) {
|
||||
gNB->prach_vars.list[j].frame = -1;
|
||||
#endif
|
||||
}
|
||||
if (rnti_to_remove_count) LOG_W(PHY, "to remove rnti_to_remove_count=%d, up_removed=%d down_removed=%d pucch_removed=%d\n", rnti_to_remove_count, up_removed, down_removed, pucch_removed);
|
||||
if (rnti_to_remove_count) LOG_W(NR_PHY, "to remove rnti_to_remove_count=%d, up_removed=%d down_removed=%d pucch_removed=%d\n", rnti_to_remove_count, up_removed, down_removed, pucch_removed);
|
||||
rnti_to_remove_count = 0;
|
||||
if (pthread_mutex_unlock(&rnti_to_remove_mutex)) exit(1);
|
||||
|
||||
@@ -381,6 +382,7 @@ void *nrL1_stats_thread(void *param) {
|
||||
fd=fopen("nrL1_stats.log","w");
|
||||
AssertFatal(fd!=NULL,"Cannot open nrL1_stats.log\n");
|
||||
dump_nr_I0_stats(fd,gNB);
|
||||
dump_pdsch_stats(fd,gNB);
|
||||
dump_pusch_stats(fd,gNB);
|
||||
// nr_dump_uci_stats(fd,eNB,eNB->proc.L1_proc_tx.frame_tx);
|
||||
fclose(fd);
|
||||
|
||||
+173
-110
@@ -302,15 +302,20 @@ void fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp) {
|
||||
/* Input Fronthaul from south RCC/RAU */
|
||||
|
||||
// Synchronous if5 from south
|
||||
|
||||
uint64_t ts_rx[20];
|
||||
void fh_if5_south_in(RU_t *ru,
|
||||
int *frame,
|
||||
int *tti) {
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
recv_IF5(ru, &proc->timestamp_rx, *tti, IF5_RRH_GW_UL);
|
||||
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_subframe*10))&1023;
|
||||
uint32_t idx_sf = proc->timestamp_rx / fp->samples_per_subframe;
|
||||
proc->tti_rx = (idx_sf * fp->slots_per_subframe + (int)round((float)(proc->timestamp_rx % fp->samples_per_subframe) / fp->samples_per_slot0))%(fp->slots_per_frame);
|
||||
if (proc->first_rx == 1) ru->ts_offset = proc->timestamp_rx;
|
||||
proc->frame_rx = ((proc->timestamp_rx-ru->ts_offset) / (fp->samples_per_subframe*10))&1023;
|
||||
proc->tti_rx = fp->get_slot_from_timestamp(proc->timestamp_rx-ru->ts_offset,fp);
|
||||
//(idx_sf * fp->slots_per_subframe + (int)round((float)(proc->timestamp_rx % fp->samples_per_subframe) / fp->samples_per_slot0))%(fp->slots_per_frame);
|
||||
ts_rx[*tti] = proc->timestamp_rx;
|
||||
LOG_D(PHY,"IF5 %d.%d => RX %d.%d first_rx %d\n",*frame,*tti,proc->frame_rx,proc->tti_rx,proc->first_rx);
|
||||
|
||||
if (proc->first_rx == 0) {
|
||||
if (proc->tti_rx != *tti) {
|
||||
@@ -319,7 +324,7 @@ void fh_if5_south_in(RU_t *ru,
|
||||
}
|
||||
|
||||
if (proc->frame_rx != *frame) {
|
||||
LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)\n",proc->frame_rx,*frame);
|
||||
LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d proc->tti_rx %d tti %d)\n",proc->frame_rx,*frame,proc->tti_rx,*tti);
|
||||
exit_fun("Exiting");
|
||||
}
|
||||
} else {
|
||||
@@ -611,6 +616,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
||||
openair0_timestamp ts,old_ts;
|
||||
AssertFatal(*slot<fp->slots_per_frame && *slot>=0, "slot %d is illegal (%d)\n",*slot,fp->slots_per_frame);
|
||||
|
||||
start_meas(&ru->rx_fhaul);
|
||||
for (i=0; i<ru->nb_rx; i++)
|
||||
rxp[i] = (void *)&ru->common.rxdata[i][fp->get_samples_slot_timestamp(*slot,fp,0)];
|
||||
|
||||
@@ -654,11 +660,11 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
||||
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_subframe*10))&1023;
|
||||
proc->tti_rx = fp->get_slot_from_timestamp(proc->timestamp_rx,fp);
|
||||
// synchronize first reception to frame 0 subframe 0
|
||||
LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, slot %d.%d / %d\n",
|
||||
LOG_D(PHY,"RU %d/%d TS %llu , frame %d, slot %d.%d / %d\n",
|
||||
ru->idx,
|
||||
0,
|
||||
(unsigned long long int)proc->timestamp_rx,
|
||||
(int)ru->ts_offset,proc->frame_rx,proc->tti_rx,proc->tti_tx,fp->slots_per_frame);
|
||||
(unsigned long long int)(proc->timestamp_rx+ru->ts_offset),
|
||||
proc->frame_rx,proc->tti_rx,proc->tti_tx,fp->slots_per_frame);
|
||||
|
||||
// dump VCD output for first RU in list
|
||||
if (ru == RC.ru[0]) {
|
||||
@@ -684,12 +690,14 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
||||
}
|
||||
|
||||
//printf("timestamp_rx %lu, frame %d(%d), subframe %d(%d)\n",ru->timestamp_rx,proc->frame_rx,frame,proc->tti_rx,subframe);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, (proc->timestamp_rx+ru->ts_offset)&0xffffffff );
|
||||
|
||||
if (rxs != samples_per_slot) {
|
||||
//exit_fun( "problem receiving samples" );
|
||||
LOG_E(PHY, "problem receiving samples\n");
|
||||
}
|
||||
|
||||
stop_meas(&ru->rx_fhaul);
|
||||
}
|
||||
|
||||
|
||||
@@ -699,13 +707,13 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
||||
void *txp[ru->nb_tx];
|
||||
unsigned int txs;
|
||||
int i,txsymb;
|
||||
int i,txsymb=fp->symbols_per_slot;
|
||||
T(T_ENB_PHY_OUTPUT_SIGNAL, T_INT(0), T_INT(0), T_INT(frame), T_INT(slot),
|
||||
T_INT(0), T_BUFFER(&ru->common.txdata[0][fp->get_samples_slot_timestamp(slot,fp,0)], fp->samples_per_subframe * 4));
|
||||
int slot_type = nr_slot_select(cfg,frame,slot%fp->slots_per_frame);
|
||||
int prevslot_type = nr_slot_select(cfg,frame,(slot+(fp->slots_per_frame-1))%fp->slots_per_frame);
|
||||
int nextslot_type = nr_slot_select(cfg,frame,(slot+1)%fp->slots_per_frame);
|
||||
int sf_extension = 0; //sf_extension = ru->sf_extension;
|
||||
int sf_extension = 0;
|
||||
int siglen=fp->get_samples_per_slot(slot,fp);
|
||||
int flags=1;
|
||||
|
||||
@@ -731,9 +739,10 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
flags = 3; // end of burst
|
||||
}
|
||||
|
||||
if (slot_type == NR_DOWNLINK_SLOT && prevslot_type == NR_UPLINK_SLOT)
|
||||
if (slot_type == NR_DOWNLINK_SLOT && prevslot_type == NR_UPLINK_SLOT) {
|
||||
flags = 2; // start of burst
|
||||
|
||||
sf_extension = ru->sf_extension;
|
||||
}
|
||||
if (slot_type == NR_DOWNLINK_SLOT && nextslot_type == NR_UPLINK_SLOT)
|
||||
flags = 3; // end of burst
|
||||
}
|
||||
@@ -759,27 +768,28 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
flags |= beam<<8;
|
||||
LOG_D(HW,"slot %d, beam %d\n",slot,ru->common.beam_id[0][slot*fp->symbols_per_slot]);
|
||||
}
|
||||
if (proc->first_tx == 1) proc->first_tx = 0;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_WRITE_FLAGS, flags );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, frame );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_TX0_RU, slot );
|
||||
|
||||
for (i=0; i<ru->nb_tx; i++)
|
||||
txp[i] = (void *)&ru->common.txdata[i][fp->get_samples_slot_timestamp(slot,fp,0)-sf_extension];
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp-ru->openair0_cfg.tx_sample_advance)&0xffffffff );
|
||||
txp[i] = (void *)&ru->common.txdata[i][fp->get_samples_slot_timestamp(slot,fp,0)]-sf_extension*sizeof(int32_t);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance)&0xffffffff );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
|
||||
// prepare tx buffer pointers
|
||||
// prepare tx buffer pointers
|
||||
txs = ru->rfdevice.trx_write_func(&ru->rfdevice,
|
||||
timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension,
|
||||
txp,
|
||||
siglen+sf_extension,
|
||||
ru->nb_tx,
|
||||
flags);
|
||||
LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, slot %di, returned %d\n",ru->idx,
|
||||
(long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot, txs);
|
||||
LOG_D(PHY,"[TXPATH] RU %d aa %d tx_rf, writing to TS %llu, %d.%d, unwrapped_frame %d, slot %d, flags %d, siglen+sf_extension %d, returned %d, E %f\n",ru->idx,i,
|
||||
(long long unsigned int)(timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension),frame,slot,proc->frame_tx_unwrap,slot, flags, siglen+sf_extension, txs,10*log10((double)signal_energy(txp[0],siglen+sf_extension)));
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
|
||||
//AssertFatal(txs == 0,"trx write function error %d\n", txs);
|
||||
//AssertFatal(txs == 0,"trx write function error %d\n", txs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -794,79 +804,86 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
|
||||
|
||||
if (mu == NR_MU_0) {
|
||||
switch(N_RB) {
|
||||
case 270:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=92.16e6;
|
||||
cfg->samples_per_frame = 921600;
|
||||
cfg->tx_bw = 50e6;
|
||||
cfg->rx_bw = 50e6;
|
||||
} else {
|
||||
cfg->sample_rate=61.44e6;
|
||||
cfg->samples_per_frame = 614400;
|
||||
cfg->tx_bw = 50e6;
|
||||
cfg->rx_bw = 50e6;
|
||||
}
|
||||
|
||||
case 216:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=46.08e6;
|
||||
cfg->samples_per_frame = 460800;
|
||||
cfg->tx_bw = 40e6;
|
||||
cfg->rx_bw = 40e6;
|
||||
} else {
|
||||
cfg->sample_rate=61.44e6;
|
||||
cfg->samples_per_frame = 614400;
|
||||
cfg->tx_bw = 40e6;
|
||||
cfg->rx_bw = 40e6;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 106:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=23.04e6;
|
||||
cfg->samples_per_frame = 230400;
|
||||
cfg->tx_bw = 20e6;
|
||||
cfg->rx_bw = 20e6;
|
||||
} else {
|
||||
cfg->sample_rate=30.72e6;
|
||||
cfg->samples_per_frame = 307200;
|
||||
cfg->tx_bw = 20e6;
|
||||
cfg->rx_bw = 20e6;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 52:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=11.52e6;
|
||||
cfg->samples_per_frame = 115200;
|
||||
cfg->tx_bw = 10e6;
|
||||
cfg->rx_bw = 10e6;
|
||||
} else {
|
||||
cfg->sample_rate=15.36e6;
|
||||
cfg->samples_per_frame = 153600;
|
||||
cfg->tx_bw = 10e6;
|
||||
cfg->rx_bw = 10e6;
|
||||
}
|
||||
|
||||
case 25:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=5.76e6;
|
||||
cfg->samples_per_frame = 57600;
|
||||
cfg->tx_bw = 5e6;
|
||||
cfg->rx_bw = 5e6;
|
||||
} else {
|
||||
cfg->sample_rate=7.68e6;
|
||||
cfg->samples_per_frame = 76800;
|
||||
cfg->tx_bw = 5e6;
|
||||
cfg->rx_bw = 5e6;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(0==1,"N_RB %d not yet supported for numerology %d\n",N_RB,mu);
|
||||
case 270:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=92.16e6;
|
||||
cfg->samples_per_frame = 921600;
|
||||
cfg->tx_bw = 50e6;
|
||||
cfg->rx_bw = 50e6;
|
||||
} else {
|
||||
cfg->sample_rate=61.44e6;
|
||||
cfg->samples_per_frame = 614400;
|
||||
cfg->tx_bw = 50e6;
|
||||
cfg->rx_bw = 50e6;
|
||||
}
|
||||
case 216:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=46.08e6;
|
||||
cfg->samples_per_frame = 460800;
|
||||
cfg->tx_bw = 40e6;
|
||||
cfg->rx_bw = 40e6;
|
||||
}
|
||||
else {
|
||||
cfg->sample_rate=61.44e6;
|
||||
cfg->samples_per_frame = 614400;
|
||||
cfg->tx_bw = 40e6;
|
||||
cfg->rx_bw = 40e6;
|
||||
}
|
||||
break;
|
||||
case 160: //30 MHz
|
||||
case 133: //25 MHz
|
||||
if (fp->threequarter_fs) {
|
||||
AssertFatal(1==0,"N_RB %d cannot use 3/4 sampling\n",N_RB);
|
||||
}
|
||||
else {
|
||||
cfg->sample_rate=30.72e6;
|
||||
cfg->samples_per_frame = 307200;
|
||||
cfg->tx_bw = 20e6;
|
||||
cfg->rx_bw = 20e6;
|
||||
}
|
||||
case 106:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=23.04e6;
|
||||
cfg->samples_per_frame = 230400;
|
||||
cfg->tx_bw = 20e6;
|
||||
cfg->rx_bw = 20e6;
|
||||
}
|
||||
else {
|
||||
cfg->sample_rate=30.72e6;
|
||||
cfg->samples_per_frame = 307200;
|
||||
cfg->tx_bw = 20e6;
|
||||
cfg->rx_bw = 20e6;
|
||||
}
|
||||
break;
|
||||
case 52:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=11.52e6;
|
||||
cfg->samples_per_frame = 115200;
|
||||
cfg->tx_bw = 10e6;
|
||||
cfg->rx_bw = 10e6;
|
||||
}
|
||||
else {
|
||||
cfg->sample_rate=15.36e6;
|
||||
cfg->samples_per_frame = 153600;
|
||||
cfg->tx_bw = 10e6;
|
||||
cfg->rx_bw = 10e6;
|
||||
}
|
||||
case 25:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=5.76e6;
|
||||
cfg->samples_per_frame = 57600;
|
||||
cfg->tx_bw = 5e6;
|
||||
cfg->rx_bw = 5e6;
|
||||
}
|
||||
else {
|
||||
cfg->sample_rate=7.68e6;
|
||||
cfg->samples_per_frame = 76800;
|
||||
cfg->tx_bw = 5e6;
|
||||
cfg->rx_bw = 5e6;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(0==1,"N_RB %d not yet supported for numerology %d\n",N_RB,mu);
|
||||
}
|
||||
} else if (mu == NR_MU_1) {
|
||||
switch(N_RB) {
|
||||
@@ -897,6 +914,19 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
|
||||
cfg->rx_bw = 80e6;
|
||||
}
|
||||
break;
|
||||
case 162 :
|
||||
if (fp->threequarter_fs) {
|
||||
AssertFatal(1==0,"N_RB %d cannot use 3/4 sampling\n",N_RB);
|
||||
}
|
||||
else {
|
||||
cfg->sample_rate=61.44e6;
|
||||
cfg->samples_per_frame = 614400;
|
||||
cfg->tx_bw = 60e6;
|
||||
cfg->rx_bw = 60e6;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 133 :
|
||||
if (fp->threequarter_fs) {
|
||||
AssertFatal(1==0,"N_RB %d cannot use 3/4 sampling\n",N_RB);
|
||||
@@ -1140,8 +1170,7 @@ void *ru_stats_thread(void *param) {
|
||||
print_meas(&ru->ofdm_total_stats,"feptx_total",NULL,NULL);
|
||||
}
|
||||
|
||||
if (ru->fh_north_asynch_in) print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL);
|
||||
|
||||
print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL);
|
||||
print_meas(&ru->tx_fhaul,"tx_fhaul",NULL,NULL);
|
||||
|
||||
if (ru->fh_north_out) {
|
||||
@@ -1217,8 +1246,14 @@ void *ru_thread( void *param ) {
|
||||
int slot = fp->slots_per_frame-1;
|
||||
int frame = 1023;
|
||||
char threadname[40];
|
||||
int aa;
|
||||
int initial_wait=0;
|
||||
int opp_enabled0 = opp_enabled;
|
||||
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
||||
|
||||
// set the timing measurements for startup phase, for RX fronthaul settling measurements, put it to configured value after
|
||||
opp_enabled = 0;
|
||||
|
||||
// set default return value
|
||||
ru_thread_status = 0;
|
||||
// set default return value
|
||||
@@ -1237,22 +1272,25 @@ void *ru_thread( void *param ) {
|
||||
exit(-1);
|
||||
}
|
||||
} else {
|
||||
nr_init_frame_parms(&ru->config, fp);
|
||||
nr_dump_frame_parms(fp);
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
nr_phy_init_RU(ru);
|
||||
|
||||
// Start IF device if any
|
||||
if (ru->nr_start_if) {
|
||||
LOG_I(PHY,"Starting IF interface for RU %d\n",ru->idx);
|
||||
AssertFatal(ru->nr_start_if(ru,NULL) == 0, "Could not start the IF device\n");
|
||||
|
||||
if (ru->if_south == LOCAL_RF) ret = connect_rau(ru);
|
||||
else ret = attach_rru(ru);
|
||||
if (ru->has_ctrl_prt > 0) {
|
||||
if (ru->if_south == LOCAL_RF) ret = connect_rau(ru);
|
||||
else ret = attach_rru(ru);
|
||||
|
||||
AssertFatal(ret==0,"Cannot connect to remote radio\n");
|
||||
}
|
||||
|
||||
AssertFatal(ret==0,"Cannot connect to remote radio\n");
|
||||
}
|
||||
|
||||
if (ru->if_south == LOCAL_RF) { // configure RF parameters only
|
||||
nr_init_frame_parms(&ru->config, fp);
|
||||
nr_dump_frame_parms(fp);
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
nr_phy_init_RU(ru);
|
||||
else if (ru->if_south == LOCAL_RF) { // configure RF parameters only
|
||||
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
|
||||
AssertFatal(ret==0,"Cannot connect to local radio\n");
|
||||
}
|
||||
@@ -1264,7 +1302,7 @@ void *ru_thread( void *param ) {
|
||||
}
|
||||
|
||||
sf_ahead = (uint16_t) ceil((float)6/(0x01<<fp->numerology_index));
|
||||
LOG_I(PHY, "Signaling main thread that RU %d is ready\n",ru->idx);
|
||||
LOG_I(PHY, "Signaling main thread that RU %d is ready, sf_ahead %d\n",ru->idx,sf_ahead);
|
||||
pthread_mutex_lock(&RC.ru_mutex);
|
||||
RC.ru_mask &= ~(1<<ru->idx);
|
||||
pthread_cond_signal(&RC.ru_cond);
|
||||
@@ -1343,6 +1381,19 @@ void *ru_thread( void *param ) {
|
||||
if (ru->fh_south_in) ru->fh_south_in(ru,&frame,&slot);
|
||||
else AssertFatal(1==0, "No fronthaul interface at south port");
|
||||
|
||||
if (initial_wait == 1 && proc->frame_rx < 300 && ru->fh_south_in == rx_rf) {
|
||||
if (proc->frame_rx>0 && ((proc->frame_rx % 100) == 0) && proc->tti_rx==0) {
|
||||
LOG_I(PHY,"delay processing to let RX stream settle, frame %d (trials %d)\n",proc->frame_rx,ru->rx_fhaul.trials);
|
||||
print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL);
|
||||
reset_meas(&ru->rx_fhaul);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (proc->frame_rx>=300) {
|
||||
initial_wait=0;
|
||||
opp_enabled = opp_enabled0;
|
||||
}
|
||||
if (initial_wait == 0 && ru->rx_fhaul.trials > 1000) reset_meas(&ru->rx_fhaul);
|
||||
proc->timestamp_tx = proc->timestamp_rx + (sf_ahead*fp->samples_per_subframe);
|
||||
proc->frame_tx = (proc->tti_rx > (fp->slots_per_frame-1-(fp->slots_per_subframe*sf_ahead))) ? (proc->frame_rx+1)&1023 : proc->frame_rx;
|
||||
proc->tti_tx = (proc->tti_rx + (fp->slots_per_subframe*sf_ahead))%fp->slots_per_frame;
|
||||
@@ -1363,12 +1414,13 @@ void *ru_thread( void *param ) {
|
||||
ru->feprx(ru,proc->tti_rx);
|
||||
//LOG_M("rxdata.m","rxs",ru->common.rxdata[0],1228800,1,1);
|
||||
LOG_D(PHY,"RU proc: frame_rx = %d, tti_rx = %d\n", proc->frame_rx, proc->tti_rx);
|
||||
/*
|
||||
LOG_D(PHY,"Copying rxdataF from RU to gNB\n");
|
||||
|
||||
for (aa=0; aa<ru->nb_rx; aa++)
|
||||
for (int aa=0; aa<ru->nb_rx; aa++)
|
||||
memcpy((void *)RC.gNB[0]->common_vars.rxdataF[aa],
|
||||
(void *)ru->common.rxdataF[aa], fp->symbols_per_slot*fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
|
||||
*/
|
||||
if (IS_SOFTMODEM_DOSCOPE && RC.gNB[0]->scopeData)
|
||||
((scopeData_t *)RC.gNB[0]->scopeData)->slotFunc(ru->common.rxdataF[0],proc->tti_rx, RC.gNB[0]->scopeData);
|
||||
|
||||
@@ -1439,6 +1491,11 @@ void *ru_thread( void *param ) {
|
||||
return &ru_thread_status;
|
||||
}
|
||||
|
||||
int start_streaming(RU_t *ru) {
|
||||
LOG_I(PHY,"Starting streaming on third-party RRU\n");
|
||||
return(ru->ifdevice.thirdparty_startstreaming(&ru->ifdevice));
|
||||
}
|
||||
|
||||
int nr_start_if(struct RU_t_s *ru, struct PHY_VARS_gNB_s *gNB) {
|
||||
return(ru->ifdevice.trx_start_func(&ru->ifdevice));
|
||||
}
|
||||
@@ -1695,6 +1752,7 @@ void set_function_spec_param(RU_t *ru) {
|
||||
|
||||
switch (ru->if_south) {
|
||||
case LOCAL_RF: // this is an RU with integrated RF (RRU, gNB)
|
||||
reset_meas(&ru->rx_fhaul);
|
||||
if (ru->function == NGFI_RRU_IF5) { // IF5 RRU
|
||||
ru->do_prach = 0; // no prach processing in RU
|
||||
ru->fh_north_in = NULL; // no shynchronous incoming fronthaul from north
|
||||
@@ -1732,7 +1790,6 @@ void set_function_spec_param(RU_t *ru) {
|
||||
ru->ifdevice.host_type = RRU_HOST;
|
||||
ru->rfdevice.host_type = RRU_HOST;
|
||||
ru->ifdevice.eth_params = &ru->eth_params;
|
||||
reset_meas(&ru->rx_fhaul);
|
||||
reset_meas(&ru->tx_fhaul);
|
||||
reset_meas(&ru->compression);
|
||||
reset_meas(&ru->transport);
|
||||
@@ -1784,7 +1841,7 @@ void set_function_spec_param(RU_t *ru) {
|
||||
ru->fh_south_in = fh_if5_south_in; // synchronous IF5 reception
|
||||
ru->fh_south_out = fh_if5_south_out; // synchronous IF5 transmission
|
||||
ru->fh_south_asynch_in = NULL; // no asynchronous UL
|
||||
ru->start_rf = NULL; // no local RF
|
||||
ru->start_rf = ru->eth_params.transp_preference == ETH_UDP_IF5_ECPRI_MODE ? start_streaming : NULL;
|
||||
ru->stop_rf = NULL;
|
||||
ru->start_write_thread = NULL;
|
||||
ru->nr_start_if = nr_start_if; // need to start if interface for IF5
|
||||
@@ -2040,7 +2097,7 @@ static void NRRCconfig_RU(void) {
|
||||
RC.ru[j]->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);;
|
||||
RC.ru[j]->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr);
|
||||
RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt;
|
||||
|
||||
RC.ru[j]->sf_extension = *(RUParamList.paramarray[j][RU_SF_EXTENSION_IDX].uptr);
|
||||
for (i=0; i<RC.ru[j]->num_bands; i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i];
|
||||
} //strcmp(local_rf, "yes") == 0
|
||||
else {
|
||||
@@ -2057,6 +2114,12 @@ static void NRRCconfig_RU(void) {
|
||||
RC.ru[j]->if_south = REMOTE_IF5;
|
||||
RC.ru[j]->function = NGFI_RAU_IF5;
|
||||
RC.ru[j]->eth_params.transp_preference = ETH_UDP_MODE;
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_ecpri_if5") == 0) {
|
||||
RC.ru[j]->if_south = REMOTE_IF5;
|
||||
RC.ru[j]->function = NGFI_RAU_IF5;
|
||||
RC.ru[j]->eth_params.transp_preference = ETH_UDP_IF5_ECPRI_MODE;
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_ecpri_if5") == 0) {
|
||||
RC.ru[j]->if_south = REMOTE_IF5;
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) {
|
||||
RC.ru[j]->if_south = REMOTE_IF5;
|
||||
RC.ru[j]->function = NGFI_RAU_IF5;
|
||||
|
||||
+1
-9
@@ -407,14 +407,6 @@ static void UE_synch(void *arg) {
|
||||
|
||||
if (UE->UE_scan == 0) {
|
||||
|
||||
#ifdef FR2_TEST
|
||||
// Overwrite DL frequency (for FR2 testing)
|
||||
if (downlink_frequency[0][0]!=0){
|
||||
UE->frame_parms.dl_CarrierFreq = downlink_frequency[0][0];
|
||||
UE->frame_parms.ul_CarrierFreq = downlink_frequency[0][0];
|
||||
}
|
||||
#endif
|
||||
|
||||
for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) {
|
||||
|
||||
LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %f, UL %f (RF card %d, oai_exit %d, channel %d, rx_num_channels %d)\n",
|
||||
@@ -480,7 +472,7 @@ static void UE_synch(void *arg) {
|
||||
LOG_I(PHY, "[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode);
|
||||
|
||||
uint64_t dl_carrier, ul_carrier;
|
||||
nr_get_carrier_frequencies(&UE->frame_parms, &dl_carrier, &ul_carrier);
|
||||
nr_get_carrier_frequencies(UE, &dl_carrier, &ul_carrier);
|
||||
|
||||
if (nr_initial_sync(&syncD->proc, UE, 2, get_softmodem_params()->sa, get_nrUE_params()->nr_dlsch_parallel) == 0) {
|
||||
freq_offset = UE->common_vars.freq_offset; // frequency offset computed with pss in initial sync
|
||||
|
||||
@@ -329,8 +329,8 @@ void set_options(int CC_id, PHY_VARS_NR_UE *UE){
|
||||
UE->rf_map.card = card_offset;
|
||||
UE->rf_map.chain = CC_id + chain_offset;
|
||||
|
||||
LOG_I(PHY,"Set UE mode %d, UE_fo_compensation %d, UE_scan_carrier %d, UE_no_timing_correction %d \n, do_prb_interpolation %d\n",
|
||||
UE->mode, UE->UE_fo_compensation, UE->UE_scan_carrier, UE->no_timing_correction, UE->prb_interpolation);
|
||||
LOG_I(PHY,"Set UE mode %d, UE_fo_compensation %d, UE_scan_carrier %d, UE_no_timing_correction %d \n, do_prb_interpolation %d\n",
|
||||
UE->mode, UE->UE_fo_compensation, UE->UE_scan_carrier, UE->no_timing_correction, UE->prb_interpolation);
|
||||
|
||||
// Set FP variables
|
||||
|
||||
@@ -339,7 +339,7 @@ void set_options(int CC_id, PHY_VARS_NR_UE *UE){
|
||||
LOG_I(PHY, "Set UE frame_type %d\n", fp->frame_type);
|
||||
}
|
||||
|
||||
LOG_I(PHY, "Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d\n", fp->nb_antennas_rx, fp->nb_antennas_tx, fp->threequarter_fs);
|
||||
LOG_I(PHY, "Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d, ssb_start_subcarrier %d\n", fp->nb_antennas_rx, fp->nb_antennas_tx, fp->threequarter_fs, fp->ssb_start_subcarrier);
|
||||
|
||||
fp->ofdm_offset_divisor = nrUE_params.ofdm_offset_divisor;
|
||||
|
||||
@@ -376,7 +376,7 @@ void init_openair0(void) {
|
||||
openair0_cfg[card].rx_num_channels,
|
||||
duplex_mode[openair0_cfg[card].duplex_mode]);
|
||||
|
||||
nr_get_carrier_frequencies(frame_parms, &dl_carrier, &ul_carrier);
|
||||
nr_get_carrier_frequencies(PHY_vars_UE_g[0][0], &dl_carrier, &ul_carrier);
|
||||
|
||||
nr_rf_card_config_freq(&openair0_cfg[card], ul_carrier, dl_carrier, freq_off);
|
||||
nr_rf_card_config_gain(&openair0_cfg[card], rx_gain_off);
|
||||
@@ -433,7 +433,7 @@ int main( int argc, char **argv ) {
|
||||
|
||||
get_options (); //Command-line options specific for NRUE
|
||||
|
||||
get_common_options(SOFTMODEM_5GUE_BIT );
|
||||
get_common_options(SOFTMODEM_5GUE_BIT);
|
||||
init_tpools(nrUE_params.nr_dlsch_parallel);
|
||||
CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP);
|
||||
#if T_TRACER
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
#define CONFIG_HLP_IF_FREQ "IF frequency for RF, if needed"
|
||||
#define CONFIG_HLP_IF_FREQ_OFF "UL IF frequency offset for RF, if needed"
|
||||
#define CONFIG_HLP_DLSCH_PARA "number of threads for dlsch processing 0 for no parallelization\n"
|
||||
#define CONFIG_HLP_OFFSET_DIV "Divisor for computing OFDM symbol offset in Rx chain (num samples in CP/<the value>). Default value is 8. To set the sample offset to 0, set this value ~ 10e6\n"
|
||||
/***************************************************************************************************************************************/
|
||||
@@ -50,7 +51,7 @@
|
||||
{ NOL2CONNECT_OPT, CONFIG_HLP_NOL2CN, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \
|
||||
{ CALIBPRACH_OPT, CONFIG_HLP_CALPRACH, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \
|
||||
{ DUMPFRAME_OPT, CONFIG_HLP_DUMPFRAME, PARAMFLAG_BOOL, iptr:&dumpframe, defintval:0, TYPE_INT, 0}, \
|
||||
{"ue-rxgain", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:0, TYPE_DOUBLE,0}, \
|
||||
{"ue-rxgain", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:110, TYPE_DOUBLE,0}, \
|
||||
{"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, dblptr:&rx_gain_off, defdblval:0, TYPE_DOUBLE,0}, \
|
||||
{"ue-txgain", CONFIG_HLP_UETXG, 0, dblptr:&(tx_gain[0][0]), defdblval:0, TYPE_DOUBLE,0}, \
|
||||
{"ue-nb-ant-rx", CONFIG_HLP_UENANTR, 0, u8ptr:&(fp->nb_antennas_rx), defuintval:1, TYPE_UINT8, 0}, \
|
||||
@@ -63,6 +64,8 @@
|
||||
{"r" , CONFIG_HLP_PRB_SA, 0, iptr:&(fp->N_RB_DL), defintval:106, TYPE_UINT, 0}, \
|
||||
{"s" , CONFIG_HLP_SSC, 0, u16ptr:&(fp->ssb_start_subcarrier), defintval:516, TYPE_UINT16,0}, \
|
||||
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"if_freq" , CONFIG_HLP_IF_FREQ, 0, u64ptr:&(UE->if_freq), defuintval:0, TYPE_UINT64,0}, \
|
||||
{"if_freq_off" , CONFIG_HLP_IF_FREQ_OFF, 0, iptr:&(UE->if_freq_off), defuintval:0, TYPE_INT, 0}, \
|
||||
{"do-prb-interpolation", CONFIG_HLP_PRBINTER, PARAMFLAG_BOOL, iptr:&(UE->prb_interpolation), defintval:0, TYPE_INT, 0}, \
|
||||
{"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&(UE->no_timing_correction), defintval:0, TYPE_INT, 0}, \
|
||||
}
|
||||
|
||||
@@ -55,7 +55,6 @@ int32_t nrLDPC_decod(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_
|
||||
t_nrLDPC_lut* p_lut = &lut;
|
||||
|
||||
//printf("p_procBuf->cnProcBuf = %p\n", p_procBuf->cnProcBuf);
|
||||
|
||||
// Initialize decoder core(s) with correct LUTs
|
||||
numLLR = nrLDPC_init(p_decParams, p_lut);
|
||||
|
||||
@@ -231,7 +230,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP
|
||||
|
||||
// First iteration finished
|
||||
|
||||
while ( (i < (numMaxIter-1)) && (pcRes != 0) )
|
||||
while ( (i < numMaxIter) && (pcRes != 0) )
|
||||
{
|
||||
// Increase iteration counter
|
||||
i++;
|
||||
|
||||
@@ -258,10 +258,11 @@ static inline void polar_rate_matching(const t_nrPolar_params *polarParams,void
|
||||
// handle rate matching with a single 128 bit word using bit shuffling
|
||||
// can be done with SIMD intrisics if needed
|
||||
if (polarParams->groupsize < 8) {
|
||||
AssertFatal(polarParams->encoderLength<=128,"Need to handle groupsize<8 and N>128\n");
|
||||
AssertFatal(polarParams->encoderLength<=512,"Need to handle groupsize(%d)<8 and N(%d)>512\n",polarParams->groupsize,polarParams->encoderLength);
|
||||
uint128_t *out128=(uint128_t*)out;
|
||||
uint128_t *in128=(uint128_t*)in;
|
||||
*out128=0;
|
||||
for (int i=0;i<=polarParams->encoderLength>>7;i++)
|
||||
out128[i]=0;
|
||||
uint128_t tmp0;
|
||||
#ifdef DEBUG_POLAR_ENCODER
|
||||
uint128_t tmp1;
|
||||
@@ -270,15 +271,21 @@ static inline void polar_rate_matching(const t_nrPolar_params *polarParams,void
|
||||
#ifdef DEBUG_POLAR_ENCODER
|
||||
printf("%d<-%u : %llx.%llx =>",i,polarParams->rate_matching_pattern[i],((uint64_t *)out)[1],((uint64_t *)out)[0]);
|
||||
#endif
|
||||
tmp0 = (*in128&(((uint128_t)1)<<polarParams->rate_matching_pattern[i]));
|
||||
uint8_t pi=polarParams->rate_matching_pattern[i];
|
||||
uint8_t pi7=pi>>7;
|
||||
uint8_t pimod128=pi&127;
|
||||
uint8_t imod128=i&127;
|
||||
uint8_t i7=i>>7;
|
||||
|
||||
tmp0 = (in128[pi7]&(((uint128_t)1)<<(pimod128)));
|
||||
|
||||
if (tmp0!=0) {
|
||||
*out128 = *out128 | ((uint128_t)1)<<i;
|
||||
out128[i7] = out128[i7] | ((uint128_t)1)<<imod128;
|
||||
#ifdef DEBUG_POLAR_ENCODER
|
||||
tmp1 = ((uint128_t)1)<<i;
|
||||
printf("%llx.%llx<->%llx.%llx => %llx.%llx\n",
|
||||
((uint64_t *)&tmp0)[1],((uint64_t *)&tmp0)[0],
|
||||
((uint64_t *)&tmp1)[1],((uint64_t *)&tmp1)[0],
|
||||
((uint64_t *)out)[1],((uint64_t *)out)[0]);
|
||||
printf("%llx.%llx<->%llx.%llx => %llx.%llx\n",
|
||||
((uint64_t *)&tmp0)[1],((uint64_t *)&tmp0)[0],
|
||||
((uint64_t *)&tmp1)[1],((uint64_t *)&tmp1)[0],
|
||||
((uint64_t *)out)[1],((uint64_t *)out)[0]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,9 +92,7 @@ if ((Kprime%Kb) > 0)
|
||||
else
|
||||
Z = (Kprime/Kb);
|
||||
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("nr segmetation B %u Bprime %u Kprime %u z %u \n", B, Bprime, Kprime, Z);
|
||||
#endif
|
||||
LOG_D(PHY,"nr segmetation B %u Bprime %u Kprime %u z %u \n", B, Bprime, Kprime, Z);
|
||||
|
||||
if (Z <= 2) {
|
||||
*K = 2;
|
||||
@@ -148,10 +146,8 @@ else
|
||||
|
||||
*F = ((*K) - Kprime);
|
||||
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("final nr seg output Z %u K %u F %u \n", *Zout, *K, *F);
|
||||
printf("C %u, K %u, Bprime_bytes %u, Bprime %u, F %u\n",*C,*K,Bprime>>3,Bprime,*F);
|
||||
#endif
|
||||
LOG_D(PHY,"final nr seg output Z %u K %u F %u \n", *Zout, *K, *F);
|
||||
LOG_D(PHY,"C %u, K %u, Bprime_bytes %u, Bprime %u, F %u\n",*C,*K,Bprime>>3,Bprime,*F);
|
||||
|
||||
if ((input_buffer) && (output_buffers)) {
|
||||
|
||||
|
||||
@@ -124,6 +124,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
|
||||
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
pdcch_dmrs[slot][symb] = (uint32_t *)malloc16(NR_MAX_PDCCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t));
|
||||
LOG_I(PHY,"pdcch_dmrs[%d][%d] %p\n",slot,symb,pdcch_dmrs[slot][symb]);
|
||||
AssertFatal(pdcch_dmrs[slot][symb]!=NULL, "NR init: pdcch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,10 +60,12 @@ int nr_phy_init_RU(RU_t *ru) {
|
||||
|
||||
for (i=0; i<ru->nb_tx; i++) {
|
||||
// Allocate 10 subframes of I/Q TX signal data (time) if not
|
||||
ru->common.txdata[i] = (int32_t*)malloc16_clear( fp->samples_per_frame*sizeof(int32_t) );
|
||||
ru->common.txdata[i] = (int32_t*)malloc16_clear( ru->sf_extension + (fp->samples_per_frame*sizeof(int32_t) ));
|
||||
LOG_I(PHY,"[INIT] common.txdata[%d] = %p (%lu bytes,sf_extension %d)\n",i,ru->common.txdata[i],
|
||||
(ru->sf_extension + fp->samples_per_frame)*sizeof(int32_t),ru->sf_extension);
|
||||
ru->common.txdata[i] = &ru->common.txdata[i][ru->sf_extension];
|
||||
|
||||
LOG_I(PHY,"[INIT] common.txdata[%d] = %p (%lu bytes)\n",i,ru->common.txdata[i],
|
||||
fp->samples_per_frame*sizeof(int32_t));
|
||||
LOG_I(PHY,"[INIT] common.txdata[%d] = %p \n",i,ru->common.txdata[i]);
|
||||
|
||||
}
|
||||
for (i=0;i<ru->nb_rx;i++) {
|
||||
@@ -100,8 +102,8 @@ int nr_phy_init_RU(RU_t *ru) {
|
||||
// allocate FFT output buffers (RX)
|
||||
ru->common.rxdataF = (int32_t**)malloc16(ru->nb_rx*sizeof(int32_t*) );
|
||||
for (i=0; i<ru->nb_rx; i++) {
|
||||
// allocate 2 subframes of I/Q signal data (frequency)
|
||||
ru->common.rxdataF[i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(2*fp->samples_per_subframe_wCP) );
|
||||
// allocate 4 slots of I/Q signal data (frequency)
|
||||
ru->common.rxdataF[i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(4*fp->symbols_per_slot*fp->ofdm_symbol_size) );
|
||||
LOG_I(PHY,"rxdataF[%d] %p for RU %d\n",i,ru->common.rxdataF[i],ru->idx);
|
||||
}
|
||||
|
||||
@@ -176,7 +178,11 @@ void nr_phy_free_RU(RU_t *ru)
|
||||
free_and_zero(ru->frame_parms);
|
||||
|
||||
if (ru->if_south <= REMOTE_IF5) { // this means REMOTE_IF5 or LOCAL_RF, so free memory for time-domain signals
|
||||
for (i = 0; i < ru->nb_tx; i++) free_and_zero(ru->common.txdata[i]);
|
||||
int32_t *ptr;
|
||||
for (i = 0; i < ru->nb_tx; i++) {
|
||||
ptr=&ru->common.txdata[i][-ru->sf_extension];
|
||||
free_and_zero(ptr);
|
||||
}
|
||||
for (i = 0; i < ru->nb_rx; i++) free_and_zero(ru->common.rxdata[i]);
|
||||
free_and_zero(ru->common.txdata);
|
||||
free_and_zero(ru->common.rxdata);
|
||||
|
||||
@@ -102,7 +102,7 @@ void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, int N_RB_DL)
|
||||
if (fp->nr_band == 5 || fp->nr_band == 66)
|
||||
fp->ssb_type = nr_ssb_type_B;
|
||||
else{
|
||||
if (fp->nr_band == 41 || ( fp->nr_band > 76 && fp->nr_band < 80) )
|
||||
if (fp->nr_band == 41 || fp->nr_band == 38 || ( fp->nr_band > 76 && fp->nr_band < 80) )
|
||||
fp->ssb_type = nr_ssb_type_C;
|
||||
else
|
||||
AssertFatal(1==0,"NR Operating Band n%d not available for SS block SCS with mu=%d\n", fp->nr_band, mu);
|
||||
@@ -141,6 +141,8 @@ void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, int N_RB_DL)
|
||||
fp->first_carrier_offset = fp->ofdm_symbol_size - (N_RB_DL * 12 / 2);
|
||||
fp->nb_prefix_samples = fp->ofdm_symbol_size / 128 * 9;
|
||||
fp->nb_prefix_samples0 = fp->ofdm_symbol_size / 128 * (9 + (1 << mu));
|
||||
LOG_I(PHY,"Init: N_RB_DL %d, first_carrier_offset %d, nb_prefix_samples %d,nb_prefix_samples0 %d\n",
|
||||
N_RB_DL,fp->first_carrier_offset,fp->nb_prefix_samples,fp->nb_prefix_samples0);
|
||||
}
|
||||
|
||||
uint32_t get_samples_per_slot(int slot, NR_DL_FRAME_PARMS* fp)
|
||||
|
||||
@@ -31,15 +31,14 @@
|
||||
*/
|
||||
|
||||
#include <time.h>
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include <stdio.h>
|
||||
#include "PHY/defs_RU.h"
|
||||
#include "PHY/TOOLS/alaw_lut.h"
|
||||
//#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
|
||||
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
//#define DEBUG_DL_MOBIPASS
|
||||
//#define DEBUG_UL_MOBIPASS
|
||||
#define SUBFRAME_SKIP_NUM_MOBIPASS 8
|
||||
|
||||
const uint8_t lin2alaw_if5[65536] = {213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 214, 214, 214, 214,
|
||||
214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
|
||||
@@ -1050,18 +1049,12 @@ static inline int64_t clock_difftime_ns(struct timespec start, struct timespec e
|
||||
return temp_ns;
|
||||
}
|
||||
|
||||
void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t *seqno, uint16_t packet_type) {
|
||||
void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seqno, uint16_t packet_type) {
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp=ru->frame_parms;
|
||||
int32_t *txp[fp->nb_antennas_tx], *rxp[fp->nb_antennas_rx];
|
||||
int32_t *tx_buffer=NULL;
|
||||
#ifdef DEBUG_DL_MOBIPASS
|
||||
int8_t dummy_buffer[fp->samples_per_tti*2];
|
||||
#endif
|
||||
void *alaw_buffer = ru->ifbuffer.tx[subframe&1];
|
||||
uint16_t *data_block = NULL;
|
||||
uint16_t *j = NULL;
|
||||
uint16_t packet_id=0, i=0, element_id=0;
|
||||
uint16_t packet_id=0, i=0;
|
||||
|
||||
uint32_t spp_eth = (uint32_t) ru->ifdevice.openair0_cfg->samples_per_packet;
|
||||
uint32_t spsf = (uint32_t) ru->ifdevice.openair0_cfg->samples_per_frame/10;
|
||||
@@ -1072,6 +1065,12 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
|
||||
if (eth->compression == ALAW_COMPRESS) {
|
||||
AssertFatal(1==0,"IF5 compression needs reworking\n");
|
||||
/*
|
||||
void *alaw_buffer = ru->ifbuffer.tx[subframe&1];
|
||||
int element_id=0;
|
||||
|
||||
uint16_t *data_block = NULL;
|
||||
uint16_t *j = NULL;
|
||||
|
||||
if (eth->flags == ETH_RAW_MODE) {
|
||||
data_block = (uint16_t*)(alaw_buffer + APP_HEADER_SIZE_BYTES + MAC_HEADER_SIZE_BYTES);
|
||||
} else {
|
||||
@@ -1105,10 +1104,22 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
|
||||
*/
|
||||
} else if (eth->compression == NO_COMPRESS) {
|
||||
|
||||
NR_DL_FRAME_PARMS *nrfp = ru->nr_frame_parms;
|
||||
|
||||
int offset,siglen;
|
||||
if (nrfp) {
|
||||
offset = nrfp->get_samples_slot_timestamp(tti,nrfp,0);
|
||||
siglen = nrfp->get_samples_per_slot(tti,nrfp);
|
||||
}
|
||||
else {
|
||||
offset = tti*fp->samples_per_subframe;
|
||||
siglen = spsf;
|
||||
}
|
||||
|
||||
for (i=0; i < ru->nb_tx; i++)
|
||||
txp[i] = (int32_t*)&ru->common.txdata[i][subframe*fp->samples_per_tti];
|
||||
txp[i] = (int32_t*)&ru->common.txdata[i][offset];
|
||||
|
||||
for (packet_id=0; packet_id < spsf / spp_eth; packet_id++) {
|
||||
for (packet_id=0; packet_id < siglen / spp_eth; packet_id++) {
|
||||
for (int aid=0; aid<ru->nb_tx;aid++) {
|
||||
//VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id );
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 1 );
|
||||
@@ -1119,9 +1130,9 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
|
||||
spp_eth,
|
||||
aid,
|
||||
0);
|
||||
LOG_D(HW,"SF %d : packet %d, TS %llu\n",subframe,packet_id,(unsigned long long)(proc_timestamp+packet_id*spp_eth));
|
||||
LOG_D(HW,"TTI %d : packet %d, TS %llu\n",tti,packet_id,(unsigned long long)(proc_timestamp-ru->ts_offset+packet_id*spp_eth));
|
||||
clock_gettime( CLOCK_MONOTONIC, &end_comp);
|
||||
LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_comp, end_comp));
|
||||
LOG_D(HW,"[TTI %d] IF_Write_Time: %"PRId64"\n",tti,clock_difftime_ns(start_comp, end_comp));
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 0 );
|
||||
txp[aid] += spp_eth;
|
||||
|
||||
@@ -1130,7 +1141,8 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
|
||||
}
|
||||
} else if (packet_type == IF5_RRH_GW_UL) {
|
||||
if (eth->compression == ALAW_COMPRESS) {
|
||||
if (eth->flags == ETH_RAW_MODE) {
|
||||
AssertFatal(1==0,"ALAW IF5 requires work\n");
|
||||
/* if (eth->flags == ETH_RAW_MODE) {
|
||||
data_block = (uint16_t*)(alaw_buffer + APP_HEADER_SIZE_BYTES + MAC_HEADER_SIZE_BYTES);
|
||||
} else {
|
||||
data_block = (uint16_t*)(alaw_buffer + APP_HEADER_SIZE_BYTES);
|
||||
@@ -1160,9 +1172,10 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
|
||||
LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_comp, end_comp));
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 0 );
|
||||
}
|
||||
*/
|
||||
} else if (eth->compression == NO_COMPRESS) {
|
||||
for (i=0; i < fp->nb_antennas_rx; i++)
|
||||
rxp[i] = (void*)&ru->common.rxdata[i][subframe*fp->samples_per_tti];
|
||||
rxp[i] = (void*)&ru->common.rxdata[i][tti*fp->samples_per_tti];
|
||||
|
||||
for (packet_id=0; packet_id < spsf / spp_eth; packet_id++) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id );
|
||||
@@ -1175,153 +1188,28 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
|
||||
fp->nb_antennas_rx,
|
||||
0);
|
||||
clock_gettime( CLOCK_MONOTONIC, &end_comp);
|
||||
LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_comp, end_comp));
|
||||
LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",tti,clock_difftime_ns(start_comp, end_comp));
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 0 );
|
||||
for (i=0; i < fp->nb_antennas_rx; i++)
|
||||
rxp[i] += spp_eth;
|
||||
|
||||
}
|
||||
}
|
||||
} else if (packet_type == IF5_MOBIPASS) {
|
||||
/* the only difference between mobipass standalone and the other one
|
||||
* is the timestamp in trx_write_func, but let's duplicate anyway
|
||||
* (plus we don't call malloc for the standalone case)
|
||||
*/
|
||||
if (ru->if_timing == synch_to_mobipass_standalone) {
|
||||
uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES;
|
||||
|
||||
__m128i *data_block=NULL, *data_block_head=NULL;
|
||||
__m128i *txp128;
|
||||
__m128i t0, t1;
|
||||
|
||||
unsigned char _tx_buffer[MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t)];
|
||||
tx_buffer=(int32_t *)_tx_buffer;
|
||||
|
||||
IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES);
|
||||
data_block_head = (__m128i *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t);
|
||||
|
||||
header->flags = 0;
|
||||
header->fifo_status = 0;
|
||||
header->seqno = *seqno;
|
||||
header->ack = 0;
|
||||
header->word0 = 0;
|
||||
|
||||
txp[0] = (void*)&ru->common.txdata[0][subframe*ru->frame_parms->samples_per_tti];
|
||||
txp128 = (__m128i *) txp[0];
|
||||
|
||||
for (packet_id=0; packet_id<fp->samples_per_tti/db_fulllength; packet_id++) {
|
||||
header->time_stamp = htonl((uint32_t)(proc_timestamp + packet_id*db_fulllength));
|
||||
data_block = data_block_head;
|
||||
|
||||
for (i=0; i<db_fulllength>>2; i+=2) {
|
||||
t0 = _mm_srai_epi16(*txp128++, 4);
|
||||
t1 = _mm_srai_epi16(*txp128++, 4);
|
||||
_mm_storeu_si128(data_block++, _mm_packs_epi16(t0, t1));
|
||||
}
|
||||
|
||||
// Write the packet to the fronthaul
|
||||
if ((ru->ifdevice.trx_write_func(&ru->ifdevice,
|
||||
proc_timestamp + packet_id*db_fulllength,
|
||||
(void**)&tx_buffer,
|
||||
db_fulllength,
|
||||
1,
|
||||
IF5_MOBIPASS)) < 0) {
|
||||
perror("ETHERNET write for IF5_MOBIPASS\n");
|
||||
}
|
||||
header->seqno += 1;
|
||||
}
|
||||
*seqno = header->seqno;
|
||||
tx_buffer = NULL;
|
||||
} else {
|
||||
uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES;
|
||||
|
||||
__m128i *data_block=NULL, *data_block_head=NULL;
|
||||
|
||||
__m128i *txp128;
|
||||
__m128i t0, t1;
|
||||
|
||||
// tx_buffer = memalign(16, MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
|
||||
tx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
|
||||
IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES);
|
||||
data_block_head = (__m128i *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t);
|
||||
|
||||
header->flags = 0;
|
||||
header->fifo_status = 0;
|
||||
header->seqno = *seqno;
|
||||
header->ack = 0;
|
||||
header->word0 = 0;
|
||||
|
||||
txp[0] = (void*)&ru->common.txdata[0][subframe*ru->frame_parms->samples_per_tti];
|
||||
txp128 = (__m128i *) txp[0];
|
||||
|
||||
for (packet_id=0; packet_id<fp->samples_per_tti/db_fulllength; packet_id++) {
|
||||
header->time_stamp = htonl((uint32_t)(proc_timestamp + packet_id*db_fulllength));
|
||||
data_block = data_block_head;
|
||||
|
||||
for (i=0; i<db_fulllength>>2; i+=2) {
|
||||
t0 = _mm_srai_epi16(*txp128++, 4);
|
||||
t1 = _mm_srai_epi16(*txp128++, 4);
|
||||
// *data_block++ = _mm_packs_epi16(t0, t1);
|
||||
_mm_storeu_si128(data_block++, _mm_packs_epi16(t0, t1));
|
||||
}
|
||||
|
||||
// Write the packet to the fronthaul
|
||||
if ((ru->ifdevice.trx_write_func(&ru->ifdevice,
|
||||
packet_id,
|
||||
(void**)&tx_buffer,
|
||||
db_fulllength,
|
||||
1,
|
||||
IF5_MOBIPASS)) < 0) {
|
||||
perror("ETHERNET write for IF5_MOBIPASS\n");
|
||||
}
|
||||
|
||||
#ifdef DEBUG_DL_MOBIPASS
|
||||
if ((subframe==0)&&(dummy_cnt == 100)) {
|
||||
memcpy((void*)&dummy_buffer[packet_id*db_fulllength*2],(void*)data_block_head,db_fulllength*2);
|
||||
}
|
||||
#endif
|
||||
header->seqno += 1;
|
||||
}
|
||||
*seqno = header->seqno;
|
||||
|
||||
#ifdef DEBUG_DL_MOBIPASS
|
||||
uint8_t txe;
|
||||
txe = dB_fixed(signal_energy(txp[0],fp->samples_per_tti));
|
||||
if (txe > 0){
|
||||
LOG_D(PHY,"[Mobipass] frame:%d, subframe:%d, energy %d\n", (proc_timestamp/(10*fp->samples_per_tti))&1023,subframe, txe);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
AssertFatal(1==0, "send_IF5 - Unknown packet_type %x", packet_type);
|
||||
}
|
||||
|
||||
free(tx_buffer);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF5, 0 );
|
||||
#ifdef DEBUG_DL_MOBIPASS
|
||||
if(subframe==0) {
|
||||
if (dummy_cnt==100) {
|
||||
LOG_M("txsigmb.m","txs",(void*)dummy_buffer, fp->samples_per_tti,1, 5);
|
||||
exit(-1);
|
||||
} else {
|
||||
dummy_cnt++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16_t packet_type) {
|
||||
void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t packet_type) {
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp=ru->frame_parms;
|
||||
int32_t *txp[ru->nb_tx], *rxp[ru->nb_rx];
|
||||
|
||||
uint16_t packet_id=0, i=0;
|
||||
#ifdef DEBUG_UL_MOBIPASS
|
||||
//int8_t dummy_buffer_rx[fp->samples_per_tti*2];
|
||||
uint8_t rxe;
|
||||
#endif
|
||||
|
||||
|
||||
int32_t spp_eth = (int32_t) ru->ifdevice.openair0_cfg->samples_per_packet;
|
||||
@@ -1375,6 +1263,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
|
||||
}
|
||||
*/
|
||||
} else if (eth->compression == NO_COMPRESS) {
|
||||
int subframe = tti;
|
||||
for (i=0; i < fp->nb_antennas_tx; i++)
|
||||
txp[i] = (void*)&ru->common.txdata[i][subframe*fp->samples_per_tti];
|
||||
|
||||
@@ -1433,14 +1322,25 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
|
||||
}
|
||||
*/
|
||||
} else if (eth->compression == NO_COMPRESS) {
|
||||
int16_t temp_rx[spp_eth*2] __attribute__((aligned(32)));
|
||||
int16_t temp_rx[spp_eth*2] __attribute__((aligned(32)));
|
||||
NR_DL_FRAME_PARMS *nrfp = ru->nr_frame_parms;
|
||||
|
||||
int offset,siglen;
|
||||
if (nrfp) {
|
||||
offset = nrfp->get_samples_slot_timestamp(tti,nrfp,0);
|
||||
siglen = nrfp->get_samples_per_slot(tti,nrfp);
|
||||
}
|
||||
else {
|
||||
offset = tti*fp->samples_per_subframe;
|
||||
siglen = spsf;
|
||||
}
|
||||
for (i=0; i < ru->nb_rx; i++)
|
||||
rxp[i] = &ru->common.rxdata[i][subframe*fp->samples_per_tti];
|
||||
rxp[i] = &ru->common.rxdata[i][offset];
|
||||
int aid;
|
||||
int firstTS=1;
|
||||
openair0_timestamp oldTS=0;
|
||||
|
||||
for (packet_id=0; packet_id < ru->nb_rx*spsf / spp_eth; packet_id++) {
|
||||
for (packet_id=0; packet_id < ru->nb_rx*siglen / spp_eth; packet_id++) {
|
||||
//VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id );
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF0, 1 );
|
||||
clock_gettime( CLOCK_MONOTONIC, &if_time);
|
||||
@@ -1453,7 +1353,8 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
|
||||
clock_gettime( CLOCK_MONOTONIC, &if_time);
|
||||
timeout[packet_id] = if_time.tv_nsec;
|
||||
timestamp[packet_id] /= (30720/spsf);
|
||||
LOG_D(PHY,"subframe %d: Received packet %d: aid %d, TS %llu, oldTS %llu, diff %lld, \n",subframe,packet_id,aid,(unsigned long long)timestamp[packet_id],(unsigned long long)oldTS,(unsigned long long)(timestamp[packet_id]-timestamp[0]));
|
||||
LOG_D(PHY,"TTI %d: Received packet %d: aid %d, TS %llu, oldTS %llu, diff %lld, \n",tti,packet_id,aid,(unsigned long long)timestamp[packet_id],(unsigned long long)oldTS,(unsigned long long)(timestamp[packet_id]-timestamp[0]));
|
||||
|
||||
if (aid==0) {
|
||||
if (firstTS==1) firstTS=0;
|
||||
else if (oldTS + 256 != timestamp[packet_id]) {
|
||||
@@ -1474,7 +1375,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
|
||||
(void*)temp_rx,
|
||||
spp_eth<<2);
|
||||
clock_gettime( CLOCK_MONOTONIC, &end_decomp);
|
||||
LOG_D(HW,"[SF %d] IF_Read_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_decomp, end_decomp));
|
||||
LOG_D(HW,"[TTI %d] IF_Read_Time: %"PRId64"\n",tti,clock_difftime_ns(start_decomp, end_decomp));
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF0, 0 );
|
||||
|
||||
}
|
||||
|
||||
@@ -109,11 +109,11 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
||||
// use OFDM symbol from within 1/8th of the CP to avoid ISI
|
||||
rx_offset -= (nb_prefix_samples / frame_parms->ofdm_offset_divisor);
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
//#ifdef DEBUG_FEP
|
||||
// if (ue->frame <100)
|
||||
printf("slot_fep: slot %d, symbol %d, nb_prefix_samples %u, nb_prefix_samples0 %u, rx_offset %u\n",
|
||||
Ns, symbol, nb_prefix_samples, nb_prefix_samples0, rx_offset);
|
||||
#endif
|
||||
LOG_D(PHY,"slot_fep: slot %d, symbol %d, nb_prefix_samples %u, nb_prefix_samples0 %u, rx_offset %u energy %d\n",
|
||||
Ns, symbol, nb_prefix_samples, nb_prefix_samples0, rx_offset, dB_fixed(signal_energy(&common_vars->rxdata[0][rx_offset],frame_parms->ofdm_symbol_size)));
|
||||
//#endif
|
||||
|
||||
for (unsigned char aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
|
||||
memset(&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int32_t));
|
||||
@@ -355,23 +355,24 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
|
||||
int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
|
||||
int soffset = (slot&3)*frame_parms->symbols_per_slot*frame_parms->ofdm_symbol_size;
|
||||
|
||||
for (int symbol=first_symbol;symbol<nsymb;symbol++) {
|
||||
|
||||
uint32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation[1])[symbol + symb_offset];
|
||||
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1];
|
||||
LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",slot,symb_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]);
|
||||
rotate_cpx_vector((int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol],
|
||||
rotate_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
|
||||
(int16_t*)&rot2,
|
||||
(int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol],
|
||||
(int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
|
||||
length,
|
||||
15);
|
||||
|
||||
int16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
|
||||
|
||||
multadd_cpx_vector((int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol],
|
||||
multadd_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
|
||||
shift_rot,
|
||||
(int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol],
|
||||
(int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
|
||||
1,
|
||||
length,
|
||||
15);
|
||||
|
||||
@@ -85,61 +85,84 @@ void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB) {
|
||||
fprintf(fd,"%2d.",gNB->measurements.n0_subband_power_tot_dB[i]-gNB->measurements.n0_subband_power_avg_dB);
|
||||
if (i%25 == 24) fprintf(fd,"\n");
|
||||
}
|
||||
|
||||
fprintf(fd,"\nmax_I0 %d (rb %d), min_I0 %d (rb %d), avg I0 %d\n", max_I0, amax, min_I0, amin, gNB->measurements.n0_subband_power_avg_dB);
|
||||
|
||||
fprintf(fd,"PRACH I0 = %d.%d dB\n",gNB->measurements.prach_I0/10,gNB->measurements.prach_I0%10);
|
||||
fprintf(fd,"\n");
|
||||
fprintf(fd,"max_IO = %d (%d), min_I0 = %d (%d), avg_I0 = %d dB",max_I0,amax,min_I0,amin,gNB->measurements.n0_subband_power_avg_dB);
|
||||
if (gNB->frame_parms.nb_antennas_rx>1) {
|
||||
fprintf(fd,"(");
|
||||
for (int aarx=0;aarx<gNB->frame_parms.nb_antennas_rx;aarx++)
|
||||
fprintf(fd,"%d.",gNB->measurements.n0_subband_power_avg_perANT_dB[aarx]);
|
||||
fprintf(fd,")");
|
||||
}
|
||||
fprintf(fd,"\nPRACH I0 = %d.%d dB\n",gNB->measurements.prach_I0/10,gNB->measurements.prach_I0%10);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void gNB_I0_measurements(PHY_VARS_gNB *gNB,int first_symb,int num_symb) {
|
||||
void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb) {
|
||||
|
||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||
NR_gNB_COMMON *common_vars = &gNB->common_vars;
|
||||
PHY_MEASUREMENTS_gNB *measurements = &gNB->measurements;
|
||||
uint32_t *rb_mask = gNB->rb_mask_ul;
|
||||
int rb, offset, offset0, nb_rb, len;
|
||||
int rb, offset, offset0, nb_symb[275], len;
|
||||
int32_t *ul_ch;
|
||||
int32_t n0_power_tot;
|
||||
int64_t n0_power_tot2;
|
||||
|
||||
nb_rb = 0;
|
||||
n0_power_tot2=0;
|
||||
for (rb=0; rb<frame_parms->N_RB_UL; rb++) {
|
||||
n0_power_tot=0;
|
||||
offset0 = (frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size;
|
||||
if ((rb_mask[rb>>5]&(1<<(rb&31))) == 0) { // check that rb was not used in this subframe
|
||||
nb_rb++;
|
||||
for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
measurements->n0_subband_power[aarx][rb]=0;
|
||||
for (int s=first_symb;s<(first_symb+num_symb);s++) {
|
||||
LOG_D(PHY,"slot %d Doing I0 for first_symb %d, num_symb %d\n",slot,first_symb,num_symb);
|
||||
for (int s=first_symb;s<(first_symb+num_symb);s++) {
|
||||
for (rb=0; rb<frame_parms->N_RB_UL; rb++) {
|
||||
|
||||
offset = offset0 + (s*frame_parms->ofdm_symbol_size);
|
||||
ul_ch = &common_vars->rxdataF[aarx][offset];
|
||||
len = 12;
|
||||
if (((frame_parms->N_RB_UL&1) == 1) &&
|
||||
(rb==(frame_parms->N_RB_UL>>1))) {
|
||||
len=6;
|
||||
}
|
||||
AssertFatal(ul_ch, "RX signal buffer (freq) problem\n");
|
||||
measurements->n0_subband_power[aarx][rb] += signal_energy_nodc(ul_ch,len);
|
||||
} // symbol
|
||||
measurements->n0_subband_power[aarx][rb]/=num_symb;
|
||||
measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(measurements->n0_subband_power[aarx][rb]);
|
||||
n0_power_tot += measurements->n0_subband_power[aarx][rb];
|
||||
} //antenna
|
||||
n0_power_tot/=frame_parms->nb_antennas_rx;
|
||||
n0_power_tot2 += n0_power_tot;
|
||||
measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_power_tot);
|
||||
if (s==first_symb) {
|
||||
nb_symb[rb]=0;
|
||||
for (int aarx=0; aarx<frame_parms->nb_antennas_rx;aarx++)
|
||||
measurements->n0_subband_power[aarx][rb]=0;
|
||||
}
|
||||
offset0 = (slot&3)*(frame_parms->symbols_per_slot * frame_parms->ofdm_symbol_size) + (frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size;
|
||||
if ((gNB->rb_mask_ul[s][rb>>5]&(1<<(rb&31))) == 0) { // check that rb was not used in this subframe
|
||||
nb_symb[rb]++;
|
||||
for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
offset = offset0 + (s*frame_parms->ofdm_symbol_size);
|
||||
ul_ch = &common_vars->rxdataF[aarx][offset];
|
||||
len = 12;
|
||||
if (((frame_parms->N_RB_UL&1) == 1) &&
|
||||
(rb==(frame_parms->N_RB_UL>>1))) {
|
||||
len=6;
|
||||
}
|
||||
AssertFatal(ul_ch, "RX signal buffer (freq) problem\n");
|
||||
measurements->n0_subband_power[aarx][rb] += signal_energy_nodc(ul_ch,len);
|
||||
} //antenna
|
||||
}
|
||||
} //rb
|
||||
} // symb
|
||||
int nb_rb=0;
|
||||
int32_t n0_subband_tot=0;
|
||||
int32_t n0_subband_tot_perPRB=0;
|
||||
int32_t n0_subband_tot_perANT[1+frame_parms->nb_antennas_rx];
|
||||
|
||||
for (int rb = 0 ; rb<frame_parms->N_RB_UL;rb++) {
|
||||
n0_subband_tot_perPRB=0;
|
||||
if (nb_symb[rb] > 0) {
|
||||
for (int aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++) {
|
||||
measurements->n0_subband_power[aarx][rb]/=nb_symb[rb];
|
||||
measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(measurements->n0_subband_power[aarx][rb]);
|
||||
n0_subband_tot_perPRB+=measurements->n0_subband_power[aarx][rb];
|
||||
if (rb==0) n0_subband_tot_perANT[aarx]=measurements->n0_subband_power[aarx][rb];
|
||||
else n0_subband_tot_perANT[aarx]+=measurements->n0_subband_power[aarx][rb];
|
||||
}
|
||||
n0_subband_tot_perPRB/=frame_parms->nb_antennas_rx;
|
||||
measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_subband_tot_perPRB);
|
||||
measurements->n0_subband_power_tot_dBm[rb] = measurements->n0_subband_power_tot_dB[rb] - gNB->rx_total_gain_dB - dB_fixed(frame_parms->N_RB_UL);
|
||||
LOG_D(PHY,"n0_subband_power_tot_dB[%d] => %d, over %d symbols\n",rb,measurements->n0_subband_power_tot_dB[rb],nb_symb[rb]);
|
||||
n0_subband_tot += n0_subband_tot_perPRB;
|
||||
nb_rb++;
|
||||
}
|
||||
} //rb
|
||||
|
||||
if (nb_rb>0) measurements->n0_subband_power_avg_dB = dB_fixed(n0_power_tot2/nb_rb);
|
||||
|
||||
}
|
||||
if (nb_rb>0) {
|
||||
measurements->n0_subband_power_avg_dB = dB_fixed(n0_subband_tot/nb_rb);
|
||||
for (int aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++) {
|
||||
measurements->n0_subband_power_avg_perANT_dB[aarx] = dB_fixed(n0_subband_tot_perANT[aarx]/nb_rb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -179,6 +202,7 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq
|
||||
rx_power[ulsch_id][aarx] += meas->rx_spatial_power[ulsch_id][aatx][aarx];
|
||||
|
||||
}
|
||||
LOG_D(PHY, "[ULSCH ID %d] RX power in antenna %d = %d\n", ulsch_id, aarx, rx_power[ulsch_id][aarx]);
|
||||
|
||||
rx_power_tot[ulsch_id] += rx_power[ulsch_id][aarx];
|
||||
|
||||
@@ -190,12 +214,13 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq
|
||||
meas->wideband_cqi_tot[ulsch_id] = dB_fixed2(rx_power_tot[ulsch_id], meas->n0_power_tot);
|
||||
meas->rx_rssi_dBm[ulsch_id] = rx_power_avg_dB[ulsch_id] + 30 - 10 * log10(pow(2, 30)) - (rx_gain - rx_gain_offset) - dB_fixed(fp->ofdm_symbol_size);
|
||||
|
||||
LOG_D(PHY, "[ULSCH %d] RSSI %d dBm/RE, RSSI (digital) %d dB (N_RB_UL %d), WBand CQI tot %d dB, N0 Power tot %d\n",
|
||||
LOG_D(PHY, "[ULSCH %d] RSSI %d dBm/RE, RSSI (digital) %d dB (N_RB_UL %d), WBand CQI tot %d dB, N0 Power tot %d, RX Power tot %d\n",
|
||||
ulsch_id,
|
||||
meas->rx_rssi_dBm[ulsch_id],
|
||||
rx_power_avg_dB[ulsch_id],
|
||||
N_RB_UL,
|
||||
meas->wideband_cqi_tot[ulsch_id],
|
||||
meas->n0_power_tot);
|
||||
meas->n0_power_tot,
|
||||
rx_power_tot[ulsch_id]);
|
||||
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
uint8_t nushift;
|
||||
int **ul_ch_estimates = gNB->pusch_vars[ul_id]->ul_ch_estimates;
|
||||
int **rxdataF = gNB->common_vars.rxdataF;
|
||||
|
||||
int soffset = (Ns&3)*gNB->frame_parms.symbols_per_slot*gNB->frame_parms.ofdm_symbol_size;
|
||||
nushift = (p>>1)&1;
|
||||
gNB->frame_parms.nushift = nushift;
|
||||
|
||||
@@ -81,16 +81,14 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
uint16_t nb_rb_pusch = pusch_pdu->rb_size;
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
LOG_I(PHY, "In %s: ch_offset %d, symbol_offset %d OFDM size %d, Ns = %d, k = %d symbol %d\n",
|
||||
LOG_D(PHY, "In %s: ch_offset %d, soffset %d, symbol_offset %d OFDM size %d, Ns = %d, k = %d symbol %d\n",
|
||||
__FUNCTION__,
|
||||
ch_offset,
|
||||
ch_offset, soffset,
|
||||
symbol_offset,
|
||||
gNB->frame_parms.ofdm_symbol_size,
|
||||
Ns,
|
||||
k,
|
||||
symbol);
|
||||
#endif
|
||||
|
||||
switch (nushift) {
|
||||
case 0:
|
||||
@@ -174,7 +172,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
re_offset = k; /* Initializing the Resource element offset for each Rx antenna */
|
||||
|
||||
pil = (int16_t *)&pilot[0];
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+nushift)];
|
||||
rxF = (int16_t *)&rxdataF[aarx][(soffset+symbol_offset+k+nushift)];
|
||||
ul_ch = (int16_t *)&ul_ch_estimates[p*gNB->frame_parms.nb_antennas_rx+aarx][ch_offset];
|
||||
re_offset = k;
|
||||
|
||||
@@ -216,7 +214,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
8);
|
||||
pil += 2;
|
||||
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
rxF = (int16_t *)&rxdataF[aarx][(soffset+symbol_offset+nushift+re_offset)];
|
||||
//for (int i= 0; i<8; i++)
|
||||
//printf("ul_ch addr %p %d\n", ul_ch+i, *(ul_ch+i));
|
||||
|
||||
@@ -247,7 +245,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
8);
|
||||
pil += 2;
|
||||
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
rxF = (int16_t *)&rxdataF[aarx][(soffset+symbol_offset+nushift+re_offset)];
|
||||
//printf("ul_ch addr %p\n",ul_ch);
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
@@ -281,8 +279,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
pil += 2;
|
||||
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
ul_ch += 8;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(soffset+symbol_offset+nushift+re_offset)];
|
||||
ul_ch+=8;
|
||||
|
||||
for (pilot_cnt=3; pilot_cnt<(6*nb_rb_pusch-3); pilot_cnt += 2) {
|
||||
|
||||
@@ -299,7 +297,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
8);
|
||||
pil += 2;
|
||||
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
rxF = (int16_t *)&rxdataF[aarx][(soffset+symbol_offset+nushift+re_offset)];
|
||||
//printf("ul_ch addr %p\n",ul_ch);
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
@@ -319,9 +317,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
pil += 2;
|
||||
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
ul_ch += 8;
|
||||
|
||||
rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
|
||||
ul_ch+=8;
|
||||
}
|
||||
|
||||
// Treat first 2 pilots specially (right edge)
|
||||
@@ -341,7 +338,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
pil += 2;
|
||||
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
|
||||
|
||||
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);
|
||||
@@ -357,8 +354,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
pil += 2;
|
||||
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
ul_ch += 8;
|
||||
rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
|
||||
ul_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);
|
||||
@@ -383,7 +380,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
ul_ch += (idxDC-4);
|
||||
ul_ch = memset(ul_ch, 0, sizeof(int16_t)*10);
|
||||
re_offset = (re_offset+idxDC/2-2) % gNB->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
|
||||
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);
|
||||
|
||||
@@ -414,7 +411,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
pil += 4;
|
||||
re_offset = (re_offset+4) % gNB->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
|
||||
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);
|
||||
|
||||
@@ -438,7 +435,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
LOG_D(PHY,"PUSCH estimation DMRS type 2, Freq-domain interpolation");
|
||||
// Treat first DMRS specially (left edge)
|
||||
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
|
||||
|
||||
ul_ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ul_ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
@@ -450,7 +447,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
for (re_cnt = 1; re_cnt < (nb_rb_pusch*NR_NB_SC_PER_RB) - 5; re_cnt += 6){
|
||||
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
|
||||
|
||||
ch_l[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch_l[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
@@ -468,7 +465,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
re_offset = (re_offset+5)%gNB->frame_parms.ofdm_symbol_size;
|
||||
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
rxF = (int16_t *)&rxdataF[aarx][soffset+symbol_offset+nushift+re_offset];
|
||||
|
||||
ch_r[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch_r[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
@@ -496,7 +493,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
// Treat last pilot specially (right edge)
|
||||
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
|
||||
|
||||
ch_l[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch_l[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
@@ -49,7 +49,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB);
|
||||
|
||||
void gNB_I0_measurements(PHY_VARS_gNB *gNB,int first_symb,int num_symb);
|
||||
void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot,int first_symb,int num_symb);
|
||||
|
||||
void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq_pid, unsigned char symbol, uint8_t nrOfLayers);
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid)
|
||||
|
||||
reset = 1;
|
||||
x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((Nid<<1)+1) + (Nid<<1));
|
||||
|
||||
LOG_D(PHY,"PDCCH DMRS slot %d, symb %d, Nid %d, x2 %x\n",slot,symb,Nid,x2);
|
||||
for (uint32_t n=0; n<NR_MAX_PDCCH_DMRS_INIT_LENGTH_DWORD; n++) {
|
||||
pdcch_dmrs[slot][symb][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
@@ -92,7 +92,7 @@ void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid)
|
||||
for (uint8_t symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
reset = 1;
|
||||
x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid[n_scid]<<1)+1) +((N_n_scid[n_scid]<<1)+n_scid));
|
||||
LOG_D(PHY,"DMRS slot %d, symb %d x2 %x\n",slot,symb,x2);
|
||||
LOG_D(PHY,"PDSCH DMRS slot %d, symb %d x2 %x, N_n_scid %d,n_scid %d\n",slot,symb,x2,N_n_scid[n_scid],n_scid);
|
||||
for (uint32_t n=0; n<NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD; n++) {
|
||||
pdsch_dmrs[slot][symb][0][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
|
||||
@@ -81,7 +81,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
|
||||
|
||||
int rb_offset;
|
||||
int n_rb;
|
||||
|
||||
|
||||
// compute rb_offset and n_prb based on frequency allocation
|
||||
nr_fill_cce_list(gNB,0,pdcch_pdu_rel15);
|
||||
get_coreset_rballoc(pdcch_pdu_rel15->FreqDomainResource,&n_rb,&rb_offset);
|
||||
@@ -102,7 +102,9 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
|
||||
// DMRS length is per OFDM symbol
|
||||
uint32_t dmrs_length = n_rb*6; //2(QPSK)*3(per RB)*6(REG per CCE)
|
||||
uint32_t encoded_length = dci_pdu->AggregationLevel*108; //2(QPSK)*9(per RB)*6(REG per CCE)
|
||||
LOG_D(PHY, "DMRS length per symbol %d\t DCI encoded length %d (precoder_granularity %d,reg_mapping %d)\n", dmrs_length, encoded_length,pdcch_pdu_rel15->precoderGranularity,pdcch_pdu_rel15->CceRegMappingType);
|
||||
LOG_D(PHY, "DL_DCI : rb_offset %d, nb_rb %d, DMRS length per symbol %d\t DCI encoded length %d (precoder_granularity %d,reg_mapping %d),Scrambling_Id %d,ScramblingRNTI %x,PayloadSizeBits %d\n",
|
||||
rb_offset, n_rb,dmrs_length, encoded_length,pdcch_pdu_rel15->precoderGranularity,pdcch_pdu_rel15->CceRegMappingType,
|
||||
dci_pdu->ScramblingId,dci_pdu->ScramblingRNTI,dci_pdu->PayloadSizeBits);
|
||||
dmrs_length += rb_offset*6; // To accommodate more DMRS symbols in case of rb offset
|
||||
|
||||
/// DMRS QPSK modulation
|
||||
@@ -111,11 +113,11 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
|
||||
nr_modulation(gold_pdcch_dmrs[symb], dmrs_length, DMRS_MOD_ORDER, mod_dmrs[symb]); //Qm = 2 as DMRS is QPSK modulated
|
||||
|
||||
#ifdef DEBUG_PDCCH_DMRS
|
||||
|
||||
if(dci_pdu->RNTI!=0xFFFF) {
|
||||
for (int i=0; i<dmrs_length>>1; i++)
|
||||
printf("symb %d i %d gold seq 0x%08x mod_dmrs %d %d\n", symb, i,
|
||||
gold_pdcch_dmrs[symb][i>>5], mod_dmrs[symb][i<<1], mod_dmrs[symb][(i<<1)+1] );
|
||||
|
||||
printf("symb %d i %d %p gold seq 0x%08x mod_dmrs %d %d\n", symb, i,
|
||||
&gold_pdcch_dmrs[symb][i>>5],gold_pdcch_dmrs[symb][i>>5], mod_dmrs[symb][i<<1], mod_dmrs[symb][(i<<1)+1] );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -211,7 +213,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
|
||||
(amp * mod_dmrs[l][(dmrs_idx << 1) + 1]) >> 15;
|
||||
|
||||
#ifdef DEBUG_PDCCH_DMRS
|
||||
printf("PDCCH DMRS: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms->ofdm_symbol_size + k)<<1],
|
||||
LOG_D(PHY,"PDCCH DMRS %d: l %d position %d => (%d,%d)\n",dmrs_idx,l,k,((int16_t *)txdataF)[(l*frame_parms->ofdm_symbol_size + k)<<1],
|
||||
((int16_t *)txdataF)[((l*frame_parms->ofdm_symbol_size + k)<<1)+1]);
|
||||
#endif
|
||||
|
||||
@@ -223,7 +225,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
|
||||
((int16_t *) txdataF)[((l * frame_parms->ofdm_symbol_size + k) << 1) + 1] =
|
||||
(amp * mod_dci[(dci_idx << 1) + 1]) >> 15;
|
||||
#ifdef DEBUG_DCI
|
||||
printf("PDCCH: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms->ofdm_symbol_size + k)<<1],
|
||||
LOG_D(PHY,"PDCCH: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms->ofdm_symbol_size + k)<<1],
|
||||
((int16_t *)txdataF)[((l*frame_parms->ofdm_symbol_size + k)<<1)+1]);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_r
|
||||
C = N_reg/(bsize*R);
|
||||
}
|
||||
|
||||
LOG_D(PHY, "CCE list generation for candidate %d: bundle size %d ilv size %d CceIndex %d\n", m, bsize, R, pdcch_pdu_rel15->dci_pdu[d].CceIndex);
|
||||
if (pdcch_pdu_rel15->dci_pdu[d].RNTI != 0xFFFF) LOG_D(PHY, "CCE list generation for candidate %d: bundle size %d ilv size %d CceIndex %d\n", m, bsize, R, pdcch_pdu_rel15->dci_pdu[d].CceIndex);
|
||||
for (uint8_t cce_idx=0; cce_idx<L; cce_idx++) {
|
||||
cce = &gNB->cce_list[d][cce_idx];
|
||||
cce->cce_idx = pdcch_pdu_rel15->dci_pdu[d].CceIndex + cce_idx;
|
||||
|
||||
@@ -527,15 +527,17 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void dump_pdsch_stats(PHY_VARS_gNB *gNB) {
|
||||
void dump_pdsch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
|
||||
|
||||
for (int i=0;i<NUMBER_OF_NR_SCH_STATS_MAX;i++)
|
||||
if (gNB->dlsch_stats[i].rnti > 0)
|
||||
LOG_D(PHY,"DLSCH RNTI %x: current_Qm %d, current_RI %d, total_bytes TX %d\n",
|
||||
if (gNB->dlsch_stats[i].rnti > 0 && gNB->dlsch_stats[i].frame != gNB->dlsch_stats[i].dump_frame) {
|
||||
gNB->dlsch_stats[i].dump_frame = gNB->dlsch_stats[i].frame;
|
||||
fprintf(fd,"DLSCH RNTI %x: current_Qm %d, current_RI %d, total_bytes TX %d\n",
|
||||
gNB->dlsch_stats[i].rnti,
|
||||
gNB->dlsch_stats[i].current_Qm,
|
||||
gNB->dlsch_stats[i].current_RI,
|
||||
gNB->dlsch_stats[i].total_bytes_tx);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
void init_dlsch_tpool(uint8_t nun_dlsch_threads);
|
||||
void nr_emulate_dlsch_payload(uint8_t* payload, uint16_t size);
|
||||
|
||||
void dump_pdsch_stats(PHY_VARS_gNB *gNB);
|
||||
void dump_pdsch_stats(FILE *fd,PHY_VARS_gNB *gNB);
|
||||
|
||||
void clear_pdsch_stats(PHY_VARS_gNB *gNB);
|
||||
|
||||
|
||||
@@ -46,11 +46,11 @@ uint32_t nr_get_E(uint32_t G, uint8_t C, uint8_t Qm, uint8_t Nl, uint8_t r) {
|
||||
|
||||
AssertFatal(Nl>0,"Nl is 0\n");
|
||||
AssertFatal(Qm>0,"Qm is 0\n");
|
||||
LOG_D(PHY,"nr_get_E : (G %d, C %d, Qm %d, Nl %d, r %d)\n",G, C, Qm, Nl, r);
|
||||
if (r <= Cprime - ((G/(Nl*Qm))%Cprime) - 1)
|
||||
E = Nl*Qm*(G/(Nl*Qm*Cprime));
|
||||
else
|
||||
E = Nl*Qm*((G/(Nl*Qm*Cprime))+1);
|
||||
|
||||
LOG_D(PHY,"nr_get_E : (G %d, C %d, Qm %d, Nl %d, r %d), E %d\n",G, C, Qm, Nl, r, E);
|
||||
return E;
|
||||
}
|
||||
|
||||
@@ -140,6 +140,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
*/
|
||||
void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
|
||||
NR_gNB_PUSCH *pusch_vars,
|
||||
int slot,
|
||||
unsigned char symbol,
|
||||
uint8_t is_dmrs_symbol,
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu,
|
||||
|
||||
@@ -137,27 +137,24 @@ void nr_ulsch_unscrambling_optim(int16_t* llr,
|
||||
#endif
|
||||
}
|
||||
|
||||
#define STATSTRLEN 16384
|
||||
void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
|
||||
|
||||
char output[16384];
|
||||
int stroff=0;
|
||||
|
||||
for (int i=0;i<gNB->number_of_nr_ulsch_max;i++) {
|
||||
if (gNB->ulsch_stats[i].rnti>0) {
|
||||
|
||||
if (gNB->ulsch_stats[i].rnti>0 && gNB->ulsch_stats[i].frame != gNB->ulsch_stats[i].dump_frame) {
|
||||
gNB->ulsch_stats[i].dump_frame = gNB->ulsch_stats[i].frame;
|
||||
for (int aa=0;aa<gNB->frame_parms.nb_antennas_rx;aa++)
|
||||
if (aa==0) stroff+=sprintf(output+stroff,"ULSCH RNTI %4x: ulsch_power[%d] %d,%d ulsch_noise_power[%d] %d.%d\n",
|
||||
gNB->ulsch_stats[i].rnti,
|
||||
if (aa==0) fprintf(fd,"ULSCH RNTI %4x, %d.%d: ulsch_power[%d] %d,%d ulsch_noise_power[%d] %d.%d, sync_pos %d\n",
|
||||
gNB->ulsch_stats[i].rnti,gNB->ulsch_stats[i].frame,gNB->ulsch_stats[i].dump_frame,
|
||||
aa,gNB->ulsch_stats[i].power[aa]/10,gNB->ulsch_stats[i].power[aa]%10,
|
||||
aa,gNB->ulsch_stats[i].noise_power[aa]/10,gNB->ulsch_stats[i].noise_power[aa]%10);
|
||||
else stroff+=sprintf(output+stroff," ulsch_power[%d] %d.%d, ulsch_noise_power[%d] %d.%d\n",
|
||||
aa,gNB->ulsch_stats[i].noise_power[aa]/10,gNB->ulsch_stats[i].noise_power[aa]%10,
|
||||
gNB->ulsch_stats[i].sync_pos);
|
||||
else fprintf(fd," ulsch_power[%d] %d.%d, ulsch_noise_power[%d] %d.%d\n",
|
||||
aa,gNB->ulsch_stats[i].power[aa]/10,gNB->ulsch_stats[i].power[aa]%10,
|
||||
aa,gNB->ulsch_stats[i].noise_power[aa]/10,gNB->ulsch_stats[i].noise_power[aa]%10);
|
||||
|
||||
AssertFatal(stroff<(STATSTRLEN-1000),"Increase STATSTRLEN\n");
|
||||
|
||||
|
||||
stroff+=sprintf(output+stroff," round_trials %d(%1.1e):%d(%1.1e):%d(%1.1e):%d, DTX %d, current_Qm %d, current_RI %d, total_bytes RX/SCHED %d/%d\n",
|
||||
fprintf(fd," round_trials %d(%1.1e):%d(%1.1e):%d(%1.1e):%d, DTX %d, current_Qm %d, current_RI %d, total_bytes RX/SCHED %d/%d\n",
|
||||
gNB->ulsch_stats[i].round_trials[0],
|
||||
(double)gNB->ulsch_stats[i].round_trials[1]/gNB->ulsch_stats[i].round_trials[0],
|
||||
gNB->ulsch_stats[i].round_trials[1],
|
||||
@@ -165,14 +162,13 @@ void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
|
||||
gNB->ulsch_stats[i].round_trials[2],
|
||||
(double)gNB->ulsch_stats[i].round_trials[3]/gNB->ulsch_stats[i].round_trials[0],
|
||||
gNB->ulsch_stats[i].round_trials[3],
|
||||
gNB->ulsch_stats[i].DTX,
|
||||
gNB->ulsch_stats[i].DTX,
|
||||
gNB->ulsch_stats[i].current_Qm,
|
||||
gNB->ulsch_stats[i].current_RI,
|
||||
gNB->ulsch_stats[i].total_bytes_rx,
|
||||
gNB->ulsch_stats[i].total_bytes_tx);
|
||||
}
|
||||
}
|
||||
fprintf(fd,"%s",output);
|
||||
}
|
||||
|
||||
void clear_pusch_stats(PHY_VARS_gNB *gNB) {
|
||||
|
||||
@@ -220,8 +220,6 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
|
||||
ulsch->harq_processes[i]->rar_alloc=0;
|
||||
ulsch->harq_processes[i]->status=NR_SCH_IDLE;
|
||||
ulsch->harq_processes[i]->subframe_scheduling_flag=0;
|
||||
ulsch->harq_processes[i]->phich_active=0;
|
||||
ulsch->harq_processes[i]->phich_ACK=0;
|
||||
ulsch->harq_processes[i]->previous_first_rb=0;
|
||||
ulsch->harq_processes[i]->handled=0;
|
||||
ulsch->harq_processes[i]->delta_TF=0;
|
||||
@@ -430,10 +428,11 @@ void nr_processULSegment(void* arg) {
|
||||
p_procTime);
|
||||
|
||||
if (check_crc((uint8_t*)llrProcBuf,length_dec,ulsch_harq->F,crc_type)) {
|
||||
// #ifdef PRINT_CRC_CHECK
|
||||
LOG_I(PHY, "Segment %d CRC OK\n",r);
|
||||
// #endif
|
||||
#ifdef PRINT_CRC_CHECK
|
||||
LOG_I(PHY, "Segment %d CRC OK, iterations %d/%d\n",r,no_iteration_ldpc,max_ldpc_iterations);
|
||||
#endif
|
||||
rdata->decodeIterations = no_iteration_ldpc;
|
||||
if (rdata->decodeIterations > p_decoderParms->numMaxIter) rdata->decodeIterations--;
|
||||
} else {
|
||||
// #ifdef PRINT_CRC_CHECK
|
||||
LOG_I(PHY, "CRC NOK\n");
|
||||
@@ -508,12 +507,12 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING,1);
|
||||
harq_process->TBS = pusch_pdu->pusch_data.tb_size;
|
||||
harq_process->round = nr_rv_round_map[pusch_pdu->pusch_data.rv_index];
|
||||
|
||||
// harq_process->round = nr_rv_round_map[pusch_pdu->pusch_data.rv_index];
|
||||
if (pusch_pdu->pusch_data.rv_index == 0) harq_process->round = 0;
|
||||
|
||||
A = (harq_process->TBS)<<3;
|
||||
|
||||
LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d\n",harq_pid,A,G, mcs, n_layers, nb_rb, Qm, n_layers);
|
||||
//printf("ULSCH in %d.%d \n", frame, nr_tti_rx);
|
||||
LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d, Coderate %d\n",harq_pid,A,G, mcs, n_layers, nb_rb, Qm, n_layers, R);
|
||||
|
||||
if (R<1024)
|
||||
Coderate = (float) R /(float) 1024;
|
||||
@@ -559,6 +558,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
}
|
||||
}
|
||||
if (stats) {
|
||||
stats->frame = frame;
|
||||
stats->rnti = ulsch->rnti;
|
||||
stats->round_trials[harq_process->round]++;
|
||||
for (int aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++) {
|
||||
|
||||
@@ -304,6 +304,7 @@ void nr_idft(int32_t *z, uint32_t Msc_PUSCH)
|
||||
|
||||
void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
|
||||
NR_gNB_PUSCH *pusch_vars,
|
||||
int slot,
|
||||
unsigned char symbol,
|
||||
uint8_t is_dmrs_symbol,
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu,
|
||||
@@ -320,7 +321,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
|
||||
int16_t *rxF,*rxF_ext;
|
||||
int *ul_ch0,*ul_ch0_ext;
|
||||
uint8_t delta = 0;
|
||||
|
||||
int soffset = (slot&3)*frame_parms->symbols_per_slot*frame_parms->ofdm_symbol_size;
|
||||
#ifdef DEBUG_RB_EXT
|
||||
|
||||
printf("--------------------symbol = %d-----------------------\n", symbol);
|
||||
@@ -339,7 +340,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
|
||||
|
||||
for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
|
||||
|
||||
rxF = (int16_t *)&rxdataF[aarx][symbol * frame_parms->ofdm_symbol_size];
|
||||
rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol * frame_parms->ofdm_symbol_size)];
|
||||
rxF_ext = (int16_t *)&pusch_vars->rxdataF_ext[aarx][symbol * nb_re_pusch2]; // [hna] rxdataF_ext isn't contiguous in order to solve an alignment problem ib llr computation in case of mod_order = 4, 6
|
||||
|
||||
ul_ch0 = &pusch_vars->ul_ch_estimates[aarx][pusch_vars->dmrs_symbol*frame_parms->ofdm_symbol_size]; // update channel estimates if new dmrs symbol are available
|
||||
@@ -581,22 +582,29 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
unsigned short nb_rb,
|
||||
unsigned char output_shift) {
|
||||
|
||||
#ifdef __AVX2__
|
||||
int off = ((nb_rb&1) == 1)? 4:0;
|
||||
#else
|
||||
int off = 0;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_CH_COMP
|
||||
int16_t *rxF, *ul_ch;
|
||||
int prnt_idx;
|
||||
|
||||
rxF = (int16_t *)&rxdataF_ext[0][symbol*(off+(nb_rb*12))];
|
||||
ul_ch = (int16_t *)&ul_ch_estimates_ext[0][symbol*(off+(nb_rb*1))2];
|
||||
for (int ant=0; ant<frame_parms->nb_antennas_rx; ant++) {
|
||||
rxF = (int16_t *)&rxdataF_ext[ant][symbol*(off+(nb_rb*12))];
|
||||
ul_ch = (int16_t *)&ul_ch_estimates_ext[ant][symbol*(off+(nb_rb*12))];
|
||||
|
||||
printf("--------------------symbol = %d, mod_order = %d, output_shift = %d-----------------------\n", symbol, mod_order, output_shift);
|
||||
printf("----------------Before compensation------------------\n");
|
||||
printf("--------------------symbol = %d, mod_order = %d, output_shift = %d-----------------------\n", symbol, mod_order, output_shift);
|
||||
printf("----------------Before compensation------------------\n");
|
||||
|
||||
for (prnt_idx=0;prnt_idx<12*nb_rb*2;prnt_idx+=2){
|
||||
for (prnt_idx=0;prnt_idx<12*5*2;prnt_idx+=2){
|
||||
|
||||
printf("rxF[%d] = (%d,%d)\n", prnt_idx>>1, rxF[prnt_idx],rxF[prnt_idx+1]);
|
||||
printf("ul_ch[%d] = (%d,%d)\n", prnt_idx>>1, ul_ch[prnt_idx],ul_ch[prnt_idx+1]);
|
||||
printf("rxF[%d] = (%d,%d)\n", prnt_idx>>1, rxF[prnt_idx],rxF[prnt_idx+1]);
|
||||
printf("ul_ch[%d] = (%d,%d)\n", prnt_idx>>1, ul_ch[prnt_idx],ul_ch[prnt_idx+1]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -606,25 +614,21 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
int print_idx;
|
||||
|
||||
|
||||
ch_mag = (int16_t *)&ul_ch_mag[0][symbol*(off+(nb_rb*12))];
|
||||
for (int ant=0; ant<frame_parms->nb_antennas_rx; ant++) {
|
||||
ch_mag = (int16_t *)&ul_ch_mag[ant][symbol*(off+(nb_rb*12))];
|
||||
|
||||
printf("--------------------symbol = %d, mod_order = %d-----------------------\n", symbol, mod_order);
|
||||
printf("----------------Before computation------------------\n");
|
||||
printf("--------------------symbol = %d, mod_order = %d-----------------------\n", symbol, mod_order);
|
||||
printf("----------------Before computation------------------\n");
|
||||
|
||||
for (print_idx=0;print_idx<50;print_idx++){
|
||||
for (print_idx=0;print_idx<5;print_idx++){
|
||||
|
||||
printf("ch_mag[%d] = %d\n", print_idx, ch_mag[print_idx]);
|
||||
printf("ch_mag[%d] = %d\n", print_idx, ch_mag[print_idx]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __AVX2__
|
||||
int off = ((nb_rb&1) == 1)? 4:0;
|
||||
#else
|
||||
int off = 0;
|
||||
#endif
|
||||
|
||||
#if defined(__i386) || defined(__x86_64__)
|
||||
|
||||
unsigned short rb;
|
||||
@@ -1067,14 +1071,16 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
|
||||
#ifdef DEBUG_CH_COMP
|
||||
|
||||
rxF = (int16_t *)&rxdataF_comp[0][(symbol*(off+(nb_rb*12)))];
|
||||
for (int ant=0; ant<frame_parms->nb_antennas_rx; ant++) {
|
||||
rxF = (int16_t *)&rxdataF_comp[ant][(symbol*(off+(nb_rb*12)))];
|
||||
|
||||
printf("----------------After compansation------------------\n");
|
||||
printf("----------------After compansation------------------\n");
|
||||
|
||||
for (prnt_idx=0;prnt_idx<12*nb_rb*2;prnt_idx+=2){
|
||||
for (prnt_idx=0;prnt_idx<12*5*2;prnt_idx+=2){
|
||||
|
||||
printf("rxF[%d] = (%d,%d)\n", prnt_idx>>1, rxF[prnt_idx],rxF[prnt_idx+1]);
|
||||
printf("rxF[%d] = (%d,%d)\n", prnt_idx>>1, rxF[prnt_idx],rxF[prnt_idx+1]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1082,14 +1088,16 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
#ifdef DEBUG_CH_MAG
|
||||
|
||||
|
||||
ch_mag = (int16_t *)&ul_ch_mag[0][(symbol*(off+(nb_rb*12)))];
|
||||
for (int ant=0; ant<frame_parms->nb_antennas_rx; ant++) {
|
||||
ch_mag = (int16_t *)&ul_ch_mag[ant][(symbol*(off+(nb_rb*12)))];
|
||||
|
||||
printf("----------------After computation------------------\n");
|
||||
printf("----------------After computation------------------\n");
|
||||
|
||||
for (print_idx=0;print_idx<12*nb_rb*2;print_idx+=2){
|
||||
for (print_idx=0;print_idx<12*5*2;print_idx+=2){
|
||||
|
||||
printf("ch_mag[%d] = (%d,%d)\n", print_idx>>1, ch_mag[print_idx],ch_mag[print_idx+1]);
|
||||
printf("ch_mag[%d] = (%d,%d)\n", print_idx>>1, ch_mag[print_idx],ch_mag[print_idx+1]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1124,13 +1132,13 @@ void nr_ulsch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms,
|
||||
rxdataF_comp128[aa] = (__m128i *)&rxdataF_comp[aa][(symbol*(nb_re + off))];
|
||||
ul_ch_mag128[aa] = (__m128i *)&ul_ch_mag[aa][(symbol*(nb_re + off))];
|
||||
ul_ch_mag128b[aa] = (__m128i *)&ul_ch_magb[aa][(symbol*(nb_re + off))];
|
||||
|
||||
}
|
||||
for (int aa=1;aa<frame_parms->nb_antennas_rx;aa++) {
|
||||
// MRC on each re of rb, both on MF output and magnitude (for 16QAM/64QAM llr computation)
|
||||
for (i=0; i<nb_rb*3; i++) {
|
||||
rxdataF_comp128[0][i] = _mm_adds_epi16(_mm_srai_epi16(rxdataF_comp128[aa][i],1),_mm_srai_epi16(rxdataF_comp128[aa][i],1));
|
||||
ul_ch_mag128[0][i] = _mm_adds_epi16(_mm_srai_epi16(ul_ch_mag128[aa][i],1),_mm_srai_epi16(ul_ch_mag128[aa][i],1));
|
||||
ul_ch_mag128b[0][i] = _mm_adds_epi16(_mm_srai_epi16(ul_ch_mag128b[aa][i],1),_mm_srai_epi16(ul_ch_mag128b[aa][i],1));
|
||||
// rxdataF_comp128[0][i] = _mm_add_epi16(rxdataF_comp128_0[i],(*(__m128i *)&jitterc[0]));
|
||||
rxdataF_comp128[0][i] = _mm_adds_epi16(rxdataF_comp128[0][i],rxdataF_comp128[aa][i]);
|
||||
ul_ch_mag128[0][i] = _mm_adds_epi16(ul_ch_mag128[0][i], ul_ch_mag128[aa][i]);
|
||||
ul_ch_mag128b[0][i] = _mm_adds_epi16(ul_ch_mag128b[0][i],ul_ch_mag128b[aa][i]);
|
||||
}
|
||||
}
|
||||
#elif defined(__arm__)
|
||||
@@ -1176,8 +1184,8 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
gNB->pusch_vars[ulsch_id]->cl_done = 0;
|
||||
|
||||
bwp_start_subcarrier = ((rel15_ul->rb_start + rel15_ul->bwp_start)*NR_NB_SC_PER_RB + frame_parms->first_carrier_offset) % frame_parms->ofdm_symbol_size;
|
||||
LOG_D(PHY,"bwp_start_subcarrier %d, rb_start %d, first_carrier_offset %d\n", bwp_start_subcarrier, rel15_ul->rb_start, frame_parms->first_carrier_offset);
|
||||
LOG_D(PHY,"ul_dmrs_symb_pos %x\n",rel15_ul->ul_dmrs_symb_pos);
|
||||
LOG_D(PHY,"pusch %d.%d : bwp_start_subcarrier %d, rb_start %d, first_carrier_offset %d\n", frame,slot,bwp_start_subcarrier, rel15_ul->rb_start, frame_parms->first_carrier_offset);
|
||||
LOG_D(PHY,"pusch %d.%d : ul_dmrs_symb_pos %x\n",frame,slot,rel15_ul->ul_dmrs_symb_pos);
|
||||
|
||||
//----------------------------------------------------------
|
||||
//--------------------- Channel estimation ---------------------
|
||||
@@ -1257,6 +1265,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
start_meas(&gNB->ulsch_rbs_extraction_stats);
|
||||
nr_ulsch_extract_rbs_single(gNB->common_vars.rxdataF,
|
||||
gNB->pusch_vars[ulsch_id],
|
||||
slot,
|
||||
symbol,
|
||||
dmrs_symbol_flag,
|
||||
rel15_ul,
|
||||
@@ -1289,7 +1298,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
for (aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++)
|
||||
avgs = cmax(avgs,avg[aatx*frame_parms->nb_antennas_rx+aarx]);
|
||||
|
||||
gNB->pusch_vars[ulsch_id]->log2_maxh = (log2_approx(avgs)/2)+3;
|
||||
gNB->pusch_vars[ulsch_id]->log2_maxh = (log2_approx(avgs)/2)+2;
|
||||
gNB->pusch_vars[ulsch_id]->cl_done = 1;
|
||||
}
|
||||
|
||||
@@ -1297,6 +1306,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
//--------------------- Channel Compensation ---------------
|
||||
//----------------------------------------------------------
|
||||
start_meas(&gNB->ulsch_channel_compensation_stats);
|
||||
LOG_D(PHY,"Doing channel compensations log2_maxh %d, avgs %d (%d,%d)\n",gNB->pusch_vars[ulsch_id]->log2_maxh,avgs,avg[0],avg[1]);
|
||||
nr_ulsch_channel_compensation(gNB->pusch_vars[ulsch_id]->rxdataF_ext,
|
||||
gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext,
|
||||
gNB->pusch_vars[ulsch_id]->ul_ch_mag0,
|
||||
@@ -1315,8 +1325,8 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
start_meas(&gNB->ulsch_mrc_stats);
|
||||
nr_ulsch_detection_mrc(frame_parms,
|
||||
gNB->pusch_vars[ulsch_id]->rxdataF_comp,
|
||||
gNB->pusch_vars[ulsch_id]->ul_ch_mag,
|
||||
gNB->pusch_vars[ulsch_id]->ul_ch_magb,
|
||||
gNB->pusch_vars[ulsch_id]->ul_ch_mag0,
|
||||
gNB->pusch_vars[ulsch_id]->ul_ch_magb0,
|
||||
symbol,
|
||||
rel15_ul->rb_size);
|
||||
stop_meas(&gNB->ulsch_mrc_stats);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -148,7 +148,7 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
|
||||
}
|
||||
|
||||
|
||||
int f_bundle_j_list[NR_MAX_PDCCH_AGG_LEVEL] = {};
|
||||
int f_bundle_j_list[(2*NR_MAX_PDCCH_AGG_LEVEL) - 1] = {};
|
||||
|
||||
for (int reg = 0; reg < coreset_nbr_rb; reg++) {
|
||||
if ((reg % reg_bundle_size_L) == 0) {
|
||||
@@ -170,12 +170,14 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
|
||||
|
||||
// Get cce_list indices by reg_idx in ascending order
|
||||
int f_bundle_j_list_id = 0;
|
||||
int f_bundle_j_list_ord[NR_MAX_PDCCH_AGG_LEVEL] = {};
|
||||
int f_bundle_j_list_ord[(2*NR_MAX_PDCCH_AGG_LEVEL)-1] = {};
|
||||
for (int c_id = 0; c_id < number_of_candidates; c_id++ ) {
|
||||
f_bundle_j_list_id = CCE[c_id];
|
||||
for (int p = 0; p < NR_MAX_PDCCH_AGG_LEVEL; p++) {
|
||||
for (int p2 = CCE[c_id]; p2 < CCE[c_id] + L[c_id]; p2++) {
|
||||
AssertFatal(p2<2*NR_MAX_PDCCH_AGG_LEVEL,"number_of_candidates %d : p2 %d, CCE[%d] %d, L[%d] %d\n",number_of_candidates,p2,c_id,CCE[c_id],c_id,L[c_id]);
|
||||
if (f_bundle_j_list[p2] == p) {
|
||||
AssertFatal(f_bundle_j_list_id < 2*NR_MAX_PDCCH_AGG_LEVEL,"f_bundle_j_list_id %d\n",f_bundle_j_list_id);
|
||||
f_bundle_j_list_ord[f_bundle_j_list_id] = p;
|
||||
f_bundle_j_list_id++;
|
||||
break;
|
||||
@@ -413,7 +415,6 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
|
||||
* we have to point the pointer at (1+c_rb-N_RB_DL/2) in rxdataF
|
||||
*/
|
||||
|
||||
LOG_DDD("n_BWP_start=%d, coreset_nbr_rb=%d\n",n_BWP_start,coreset_nbr_rb);
|
||||
int c_rb_by6;
|
||||
c_rb = 0;
|
||||
for (int rb=0;rb<coreset_nbr_rb;rb++,c_rb++) {
|
||||
@@ -425,7 +426,6 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
|
||||
c_rb_by6 = c_rb/6;
|
||||
}
|
||||
|
||||
LOG_DDD("c_rb=%d\n",c_rb);
|
||||
rxF=NULL;
|
||||
|
||||
// first we set initial conditions for pointer to rxdataF depending on the situation of the first RB within the CORESET (c_rb = n_BWP_start)
|
||||
@@ -547,6 +547,7 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
|
||||
#endif
|
||||
|
||||
|
||||
#define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
|
||||
|
||||
void nr_pdcch_channel_compensation(int32_t **rxdataF_ext,
|
||||
int32_t **dl_ch_estimates_ext,
|
||||
@@ -581,16 +582,15 @@ void nr_pdcch_channel_compensation(int32_t **rxdataF_ext,
|
||||
#endif
|
||||
|
||||
for (rb=0; rb<(coreset_nbr_rb*3)>>2; rb++) {
|
||||
//printf("rb %d\n",rb);
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
// multiply by conjugated channel
|
||||
mmtmpP0 = _mm_madd_epi16(dl_ch128[0],rxdataF128[0]);
|
||||
// print_ints("re",&mmtmpP0);
|
||||
//print_ints("re",&mmtmpP0);
|
||||
// mmtmpP0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpP1 = _mm_shufflelo_epi16(dl_ch128[0],_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpP1 = _mm_shufflehi_epi16(mmtmpP1,_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpP1 = _mm_sign_epi16(mmtmpP1,*(__m128i *)&conjugate[0]);
|
||||
// print_ints("im",&mmtmpP1);
|
||||
//print_ints("im",&mmtmpP1);
|
||||
mmtmpP1 = _mm_madd_epi16(mmtmpP1,rxdataF128[0]);
|
||||
// mmtmpP1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpP0 = _mm_srai_epi32(mmtmpP0,output_shift);
|
||||
@@ -599,12 +599,12 @@ void nr_pdcch_channel_compensation(int32_t **rxdataF_ext,
|
||||
// print_ints("im(shift)",&mmtmpP1);
|
||||
mmtmpP2 = _mm_unpacklo_epi32(mmtmpP0,mmtmpP1);
|
||||
mmtmpP3 = _mm_unpackhi_epi32(mmtmpP0,mmtmpP1);
|
||||
// print_ints("c0",&mmtmpP2);
|
||||
// print_ints("c1",&mmtmpP3);
|
||||
//print_ints("c0",&mmtmpP2);
|
||||
//print_ints("c1",&mmtmpP3);
|
||||
rxdataF_comp128[0] = _mm_packs_epi32(mmtmpP2,mmtmpP3);
|
||||
//print_shorts("rx:",rxdataF128);
|
||||
//print_shorts("ch:",dl_ch128);
|
||||
//print_shorts("pack:",rxdataF_comp128);
|
||||
// print_shorts("rx:",(int16_t*)rxdataF128);
|
||||
// print_shorts("ch:",(int16_t*)dl_ch128);
|
||||
// print_shorts("pack:",(int16_t*)rxdataF_comp128);
|
||||
// multiply by conjugated channel
|
||||
mmtmpP0 = _mm_madd_epi16(dl_ch128[1],rxdataF128[1]);
|
||||
// mmtmpP0 contains real part of 4 consecutive outputs (32-bit)
|
||||
@@ -800,7 +800,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
|
||||
#endif
|
||||
}
|
||||
|
||||
LOG_D(PHY,"we enter nr_pdcch_demapping_deinterleaving()\n");
|
||||
LOG_D(PHY,"we enter nr_pdcch_demapping_deinterleaving(), number of candidates %d\n",rel15->number_of_candidates);
|
||||
nr_pdcch_demapping_deinterleaving((uint32_t *) pdcch_vars->llr,
|
||||
(uint32_t *) pdcch_vars->e_rx,
|
||||
rel15->coreset.duration,
|
||||
@@ -933,11 +933,22 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
|
||||
|
||||
// Loop over possible DCI lengths
|
||||
for (int k = 0; k < rel15->num_dci_options; k++) {
|
||||
// skip this candidate if we've already found one with the
|
||||
// same rnti and format at a different aggregation level
|
||||
int dci_found=0;
|
||||
for (int ind=0;ind < dci_ind->number_of_dcis ; ind++) {
|
||||
if (rel15->rnti== dci_ind->dci_list[ind].rnti &&
|
||||
rel15->dci_format_options[k]==dci_ind->dci_list[ind].dci_format) {
|
||||
dci_found=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dci_found==1) continue;
|
||||
int dci_length = rel15->dci_length_options[k];
|
||||
uint64_t dci_estimation[2]= {0};
|
||||
const t_nrPolar_params *currentPtrDCI = nr_polar_params(NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L, 1, &ue->polarList);
|
||||
|
||||
LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d\n", j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L);
|
||||
LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n", j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]);
|
||||
|
||||
nr_pdcch_unscrambling(&pdcch_vars->e_rx[CCEind*108], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e);
|
||||
|
||||
|
||||
@@ -328,8 +328,8 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
harq_process->G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, dmrs_length, harq_process->Qm,harq_process->Nl);
|
||||
G = harq_process->G;
|
||||
|
||||
LOG_D(PHY,"DLSCH Decoding, harq_pid %d TBS %d (%d) G %d nb_re_dmrs %d length dmrs %d mcs %d Nl %d nb_symb_sch %d nb_rb %d\n",
|
||||
harq_pid,A,A/8,G, nb_re_dmrs, dmrs_length, harq_process->mcs, harq_process->Nl, nb_symb_sch,nb_rb);
|
||||
LOG_D(PHY,"%d.%d DLSCH Decoding, harq_pid %d TBS %d (%d) G %d nb_re_dmrs %d length dmrs %d mcs %d Nl %d nb_symb_sch %d nb_rb %d\n",
|
||||
frame,nr_slot_rx,harq_pid,A,A/8,G, nb_re_dmrs, dmrs_length, harq_process->mcs, harq_process->Nl, nb_symb_sch,nb_rb);
|
||||
|
||||
if ((harq_process->R)<1024)
|
||||
Coderate = (float) (harq_process->R) /(float) 1024;
|
||||
@@ -1200,7 +1200,8 @@ void nr_dlsch_decoding_process(void *arg) {
|
||||
ret = dlsch->max_ldpc_iterations;
|
||||
harq_process->G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, harq_process->Qm,harq_process->Nl);
|
||||
G = harq_process->G;
|
||||
LOG_D(PHY,"DLSCH Decoding process, harq_pid %d TBS %d G %d mcs %d Nl %d nb_symb_sch %d nb_rb %d\n",harq_pid,A,G, harq_process->mcs, harq_process->Nl, nb_symb_sch,nb_rb);
|
||||
|
||||
LOG_D(PHY,"DLSCH Decoding process, harq_pid %d TBS %d G %d mcs %d Nl %d nb_symb_sch %d nb_rb %d, Coderate %d\n",harq_pid,A,G, harq_process->mcs, harq_process->Nl, nb_symb_sch,nb_rb,harq_process->R);
|
||||
|
||||
if ((harq_process->R)<1024)
|
||||
Coderate = (float) (harq_process->R) /(float) 1024;
|
||||
|
||||
@@ -1466,7 +1466,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
|
||||
@param dl_Carrier Pointer to DL carrier to be set
|
||||
@param ul_Carrier Pointer to UL carrier to be set
|
||||
*/
|
||||
void nr_get_carrier_frequencies(NR_DL_FRAME_PARMS *fp,
|
||||
void nr_get_carrier_frequencies(PHY_VARS_NR_UE *ue,
|
||||
uint64_t *dl_Carrier,
|
||||
uint64_t *ul_Carrier);
|
||||
|
||||
|
||||
@@ -33,19 +33,17 @@
|
||||
#include "nr_transport_proto_ue.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
|
||||
void nr_get_carrier_frequencies(NR_DL_FRAME_PARMS *fp, uint64_t *dl_carrier, uint64_t *ul_carrier){
|
||||
void nr_get_carrier_frequencies(PHY_VARS_NR_UE *ue, uint64_t *dl_carrier, uint64_t *ul_carrier){
|
||||
|
||||
if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra==1 || !downlink_frequency[0][0]) {
|
||||
NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
|
||||
if (ue->if_freq!=0) {
|
||||
*dl_carrier = ue->if_freq;
|
||||
*ul_carrier = *dl_carrier + ue->if_freq_off;
|
||||
}
|
||||
else{
|
||||
*dl_carrier = fp->dl_CarrierFreq;
|
||||
} else {
|
||||
*dl_carrier = downlink_frequency[0][0];
|
||||
*ul_carrier = fp->ul_CarrierFreq;
|
||||
}
|
||||
|
||||
if (uplink_frequency_offset[0][0])
|
||||
*ul_carrier = *dl_carrier + uplink_frequency_offset[0][0];
|
||||
else
|
||||
*ul_carrier = *dl_carrier + fp->ul_CarrierFreq - fp->dl_CarrierFreq;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
|
||||
// the value of u,v (delta always 0 for PUCCH) has to be calculated according to TS 38.211 Subclause 6.3.2.2.1
|
||||
uint8_t u[2]={0,0},v[2]={0,0};
|
||||
|
||||
LOG_D(PHY,"pucch0: nr_symbols %d, start_symbol %d, prb_start %d, second_hop_prb %d, group_hop_flag %d, sequence_hop_flag %d, mcs %d\n",pucch_pdu->nr_of_symbols,pucch_pdu->start_symbol_index,pucch_pdu->prb_start,pucch_pdu->second_hop_prb,pucch_pdu->group_hop_flag,pucch_pdu->sequence_hop_flag,pucch_pdu->mcs);
|
||||
LOG_D(PHY,"pucch0: slot %d nr_symbols %d, start_symbol %d, prb_start %d, second_hop_prb %d, group_hop_flag %d, sequence_hop_flag %d, mcs %d\n",nr_slot_tx,pucch_pdu->nr_of_symbols,pucch_pdu->start_symbol_index,pucch_pdu->prb_start,pucch_pdu->second_hop_prb,pucch_pdu->group_hop_flag,pucch_pdu->sequence_hop_flag,pucch_pdu->mcs);
|
||||
|
||||
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
|
||||
@@ -64,8 +64,8 @@ int cpumeas(int action)
|
||||
}
|
||||
|
||||
void print_meas_now(time_stats_t *ts,
|
||||
const char *name,
|
||||
FILE *file_name)
|
||||
const char *name,
|
||||
FILE *file_name)
|
||||
{
|
||||
if (opp_enabled) {
|
||||
//static double cpu_freq_GHz = 3.2;
|
||||
@@ -80,9 +80,9 @@ void print_meas_now(time_stats_t *ts,
|
||||
}
|
||||
|
||||
void print_meas(time_stats_t *ts,
|
||||
const char *name,
|
||||
time_stats_t *total_exec_time,
|
||||
time_stats_t *sf_exec_time)
|
||||
const char *name,
|
||||
time_stats_t *total_exec_time,
|
||||
time_stats_t *sf_exec_time)
|
||||
{
|
||||
if (opp_enabled) {
|
||||
static int first_time = 0;
|
||||
|
||||
+17
-13
@@ -134,6 +134,8 @@ typedef struct {
|
||||
} NR_gNB_UL_PDCCH_t;
|
||||
|
||||
typedef struct {
|
||||
int frame;
|
||||
int dump_frame;
|
||||
uint16_t rnti;
|
||||
int round_trials[8];
|
||||
int total_bytes_tx;
|
||||
@@ -143,6 +145,7 @@ typedef struct {
|
||||
int power[NB_ANTENNAS_RX];
|
||||
int noise_power[NB_ANTENNAS_RX];
|
||||
int DTX;
|
||||
int sync_pos;
|
||||
} NR_gNB_SCH_STATS_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -659,31 +662,33 @@ typedef struct {
|
||||
//! estimated noise power (linear)
|
||||
unsigned int n0_power[MAX_NUM_RU_PER_gNB];
|
||||
//! estimated noise power (dB)
|
||||
unsigned short n0_power_dB[MAX_NUM_RU_PER_gNB];
|
||||
unsigned int n0_power_dB[MAX_NUM_RU_PER_gNB];
|
||||
//! total estimated noise power (linear)
|
||||
unsigned int n0_power_tot;
|
||||
//! estimated avg noise power (dB)
|
||||
unsigned short n0_power_tot_dB;
|
||||
unsigned int n0_power_tot_dB;
|
||||
//! estimated avg noise power (dB)
|
||||
short n0_power_tot_dBm;
|
||||
int n0_power_tot_dBm;
|
||||
//! estimated avg noise power per RB per RX ant (lin)
|
||||
unsigned short n0_subband_power[MAX_NUM_RU_PER_gNB][275];
|
||||
unsigned int n0_subband_power[MAX_NUM_RU_PER_gNB][275];
|
||||
//! estimated avg noise power per RB per RX ant (dB)
|
||||
unsigned short n0_subband_power_dB[MAX_NUM_RU_PER_gNB][275];
|
||||
unsigned int n0_subband_power_dB[MAX_NUM_RU_PER_gNB][275];
|
||||
//! estimated avg subband noise power (dB)
|
||||
unsigned short n0_subband_power_avg_dB;
|
||||
unsigned int n0_subband_power_avg_dB;
|
||||
//! estimated avg subband noise power per antenna (dB)
|
||||
unsigned int n0_subband_power_avg_perANT_dB[NB_ANTENNAS_RX];
|
||||
//! estimated avg noise power per RB (dB)
|
||||
short n0_subband_power_tot_dB[275];
|
||||
int n0_subband_power_tot_dB[275];
|
||||
//! estimated avg noise power per RB (dBm)
|
||||
short n0_subband_power_tot_dBm[275];
|
||||
int n0_subband_power_tot_dBm[275];
|
||||
|
||||
// gNB measurements (per user)
|
||||
//! estimated received spatial signal power (linear)
|
||||
unsigned int rx_spatial_power[NUMBER_OF_NR_ULSCH_MAX][NB_ANTENNAS_TX][NB_ANTENNAS_RX];
|
||||
//! estimated received spatial signal power (dB)
|
||||
unsigned short rx_spatial_power_dB[NUMBER_OF_NR_ULSCH_MAX][NB_ANTENNAS_TX][NB_ANTENNAS_RX];
|
||||
unsigned int rx_spatial_power_dB[NUMBER_OF_NR_ULSCH_MAX][NB_ANTENNAS_TX][NB_ANTENNAS_RX];
|
||||
//! estimated rssi (dBm)
|
||||
short rx_rssi_dBm[NUMBER_OF_NR_ULSCH_MAX];
|
||||
int rx_rssi_dBm[NUMBER_OF_NR_ULSCH_MAX];
|
||||
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
|
||||
int rx_correlation[NUMBER_OF_NR_ULSCH_MAX][2];
|
||||
//! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation)
|
||||
@@ -804,9 +809,8 @@ typedef struct PHY_VARS_gNB_s {
|
||||
/// PUSCH DMRS
|
||||
uint32_t ****nr_gold_pusch_dmrs;
|
||||
|
||||
// Mask of occupied RBs
|
||||
uint32_t rb_mask_ul[9];
|
||||
int ulmask_symb;
|
||||
// Mask of occupied RBs, per symbol and PRB
|
||||
uint32_t rb_mask_ul[14][9];
|
||||
|
||||
/// CSI RS sequence
|
||||
uint32_t ***nr_gold_csi_rs;
|
||||
|
||||
@@ -767,6 +767,10 @@ typedef struct {
|
||||
int UE_scan_carrier;
|
||||
/// \brief Indicator that UE should enable estimation and compensation of frequency offset
|
||||
int UE_fo_compensation;
|
||||
/// IF frequency for RF
|
||||
uint64_t if_freq;
|
||||
/// UL IF frequency offset for RF
|
||||
int if_freq_off;
|
||||
/// \brief Indicator that UE is synchronized to a gNB
|
||||
int is_synchronized;
|
||||
/// \brief Indicator that UE lost frame synchronization
|
||||
|
||||
@@ -272,7 +272,7 @@
|
||||
#define NB_NUMEROLOGIES_NR (5)
|
||||
#define TDD_CONFIG_NB_FRAMES (2)
|
||||
#define NR_MAX_SLOTS_PER_FRAME (160) /* number of slots per frame */
|
||||
#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (6) /* FFS_NR_TODO it defines ue capability which is the number of slots */
|
||||
#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (5) /* FFS_NR_TODO it defines ue capability which is the number of slots */
|
||||
/* - between reception of pdsch and tarnsmission of its acknowlegment */
|
||||
/* - between reception of un uplink grant and its related transmission */
|
||||
#ifndef NO_RAT_NR
|
||||
|
||||
@@ -184,7 +184,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
uint8_t number_tx_data_pdu = (TX_req == NULL) ? 0 : TX_req->Number_of_PDUs;
|
||||
|
||||
if (NFAPI_MODE == NFAPI_MONOLITHIC){
|
||||
if (DL_req != NULL && TX_req!=NULL)
|
||||
if (DL_req != NULL && TX_req!=NULL && (number_dl_pdu > 0 || number_ul_dci_pdu > 0 || number_ul_tti_pdu > 0))
|
||||
LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SLOT:%04d/%d DL_req:SFN/SLO:%04d/%d:dl_pdu:%d tx_req:SFN/SLOT:%04d/%d:pdus:%d;ul_dci %d ul_tti %d\n",
|
||||
frame,slot,
|
||||
DL_req->SFN,DL_req->Slot,number_dl_pdu,
|
||||
@@ -238,7 +238,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
for (int i=0;i<number_ul_dci_pdu;i++) {
|
||||
handle_nfapi_nr_ul_dci_pdu(gNB, frame, slot, &UL_dci_req->ul_dci_pdu_list[i]);
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < number_ul_tti_pdu; i++) {
|
||||
switch (UL_tti_req->pdus_list[i].pdu_type) {
|
||||
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
|
||||
|
||||
@@ -56,7 +56,7 @@ void handle_nr_nfapi_pdsch_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
|
||||
uint8_t *sdu);
|
||||
|
||||
|
||||
void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t harq_pid, uint8_t crc_flag);
|
||||
void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t harq_pid, uint8_t crc_flag,int dtx_flag);
|
||||
//added
|
||||
|
||||
void handle_nfapi_nr_ul_dci_pdu(PHY_VARS_gNB *gNB,
|
||||
|
||||
@@ -125,7 +125,7 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot) {
|
||||
|
||||
if ((gNB->prach_energy_counter == 100) && (max_preamble_energy[0] > gNB->measurements.prach_I0+gNB->prach_thres)) {
|
||||
|
||||
LOG_I(PHY,"[gNB %d][RAPROC] Frame %d, slot %d Initiating RA procedure with preamble %d, energy %d.%d dB (I0 %d, thres %d), delay %d start symbol %u freq index %u\n",
|
||||
LOG_I(NR_PHY,"[gNB %d][RAPROC] Frame %d, slot %d Initiating RA procedure with preamble %d, energy %d.%d dB (I0 %d, thres %d), delay %d start symbol %u freq index %u\n",
|
||||
gNB->Mod_id,
|
||||
frame,
|
||||
slot,
|
||||
|
||||
@@ -531,12 +531,12 @@ void nr_fep0(RU_t *ru, int first_half) {
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+proc->tti_rx, 1);
|
||||
|
||||
// remove_7_5_kHz(ru,(slot&1)+(proc->tti_rx<<1));
|
||||
int offset = (proc->tti_rx&3) * fp->symbols_per_slot * fp->ofdm_symbol_size;
|
||||
for (l = start_symbol; l < end_symbol; l++) {
|
||||
for (aa = 0; aa < fp->nb_antennas_rx; aa++) {
|
||||
nr_slot_fep_ul(fp,
|
||||
ru->common.rxdata[aa],
|
||||
ru->common.rxdataF[aa],
|
||||
&ru->common.rxdataF[aa][offset],
|
||||
l,
|
||||
proc->tti_rx,
|
||||
ru->N_TA_offset);
|
||||
@@ -665,14 +665,15 @@ void nr_fep_full(RU_t *ru, int slot) {
|
||||
start_meas(&ru->ofdm_demod_stats);
|
||||
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
|
||||
|
||||
|
||||
// remove_7_5_kHz(ru,proc->tti_rx<<1);
|
||||
// remove_7_5_kHz(ru,1+(proc->tti_rx<<1));
|
||||
|
||||
int offset = (proc->tti_rx&3)*(fp->symbols_per_slot * fp->ofdm_symbol_size);
|
||||
for (l = 0; l < fp->symbols_per_slot; l++) {
|
||||
for (aa = 0; aa < fp->nb_antennas_rx; aa++) {
|
||||
nr_slot_fep_ul(fp,
|
||||
ru->common.rxdata[aa],
|
||||
ru->common.rxdataF[aa],
|
||||
&ru->common.rxdataF[aa][offset],
|
||||
l,
|
||||
proc->tti_rx,
|
||||
ru->N_TA_offset);
|
||||
|
||||
@@ -65,7 +65,7 @@ void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_scf_t *cfg, NR_DL_FRAME
|
||||
|
||||
fp->ssb_start_subcarrier = (12 * cfg->ssb_table.ssb_offset_point_a.value + sco);
|
||||
LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier,cfg->ssb_table.ssb_offset_point_a.value,sco);
|
||||
}
|
||||
}
|
||||
|
||||
void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_dl_tti_ssb_pdu ssb_pdu) {
|
||||
|
||||
@@ -208,7 +208,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
|
||||
|
||||
if (do_meas==1) stop_meas(&gNB->phy_proc_tx);
|
||||
|
||||
if ((frame&127) == 0) dump_pdsch_stats(gNB);
|
||||
// if ((frame&127) == 0) dump_pdsch_stats(gNB);
|
||||
|
||||
//apply the OFDM symbol rotation here
|
||||
for (aa=0; aa<cfg->carrier_config.num_tx_ant.value; aa++) {
|
||||
@@ -234,6 +234,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
|
||||
NR_UL_gNB_HARQ_t *ulsch_harq = rdata->ulsch_harq;
|
||||
NR_gNB_ULSCH_t *ulsch = rdata->ulsch;
|
||||
int r = rdata->segment_r;
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[rdata->ulsch_id][0]->harq_processes[rdata->harq_pid]->ulsch_pdu;
|
||||
|
||||
bool decodeSuccess = (rdata->decodeIterations <= rdata->decoderParms.numMaxIter);
|
||||
ulsch_harq->processedSegments++;
|
||||
@@ -260,21 +261,24 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
|
||||
}
|
||||
}
|
||||
|
||||
// if all segments are done
|
||||
//int dumpsig=0;
|
||||
// if all segments are done
|
||||
if (rdata->nbSegments == ulsch_harq->processedSegments) {
|
||||
if (decodeSuccess) {
|
||||
LOG_D(PHY,"[gNB %d] ULSCH: Setting ACK for slot %d TBS %d\n",
|
||||
gNB->Mod_id,ulsch_harq->slot,ulsch_harq->TBS);
|
||||
LOG_D(PHY,"[gNB %d] ULSCH: Setting ACK for SFN/SF %d.%d (pid %d, ndi %d, status %d, round %d, TBS %d, Max interation (all seg) %d)\n",
|
||||
gNB->Mod_id,ulsch_harq->frame,ulsch_harq->slot,rdata->harq_pid,pusch_pdu->pusch_data.new_data_indicator,ulsch_harq->status,ulsch_harq->round,ulsch_harq->TBS,rdata->decodeIterations);
|
||||
ulsch_harq->status = SCH_IDLE;
|
||||
ulsch_harq->round = 0;
|
||||
ulsch->harq_mask &= ~(1 << rdata->harq_pid);
|
||||
|
||||
LOG_D(PHY, "ULSCH received ok \n");
|
||||
nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 0);
|
||||
nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 0,0);
|
||||
//dumpsig=1;
|
||||
} else {
|
||||
LOG_D(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d) r %d\n",
|
||||
LOG_D(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, ndi %d, status %d, round %d, RV %d, TBS %d) r %d\n",
|
||||
gNB->Mod_id, ulsch_harq->frame, ulsch_harq->slot,
|
||||
rdata->harq_pid,ulsch_harq->status, ulsch_harq->round,ulsch_harq->TBS,r);
|
||||
rdata->harq_pid,pusch_pdu->pusch_data.new_data_indicator,ulsch_harq->status, ulsch_harq->round, ulsch_harq->ulsch_pdu.pusch_data.rv_index,ulsch_harq->TBS,r);
|
||||
ulsch_harq->round++;
|
||||
if (ulsch_harq->round >= ulsch->Mlimit) {
|
||||
ulsch_harq->status = SCH_IDLE;
|
||||
ulsch_harq->round = 0;
|
||||
@@ -284,8 +288,42 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
|
||||
ulsch_harq->handled = 1;
|
||||
|
||||
LOG_D(PHY, "ULSCH %d in error\n",rdata->ulsch_id);
|
||||
nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 1);
|
||||
nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 1,0);
|
||||
}
|
||||
/*
|
||||
if (ulsch_harq->ulsch_pdu.mcs_index == 9 && dumpsig==1) {
|
||||
#ifdef __AVX2__
|
||||
int off = ((ulsch_harq->ulsch_pdu.rb_size&1) == 1)? 4:0;
|
||||
#else
|
||||
int off = 0;
|
||||
#endif
|
||||
|
||||
LOG_M("rxsigF0_ext.m","rxsF0_ext",
|
||||
&gNB->pusch_vars[0]->rxdataF_ext[0][ulsch_harq->ulsch_pdu.start_symbol_index*NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size],ulsch_harq->ulsch_pdu.nr_of_symbols*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size)),1,1);
|
||||
LOG_M("chestF0.m","chF0",
|
||||
&gNB->pusch_vars[0]->ul_ch_estimates[0][ulsch_harq->ulsch_pdu.start_symbol_index*gNB->frame_parms.ofdm_symbol_size],gNB->frame_parms.ofdm_symbol_size,1,1);
|
||||
LOG_M("chestF0_ext.m","chF0_ext",
|
||||
&gNB->pusch_vars[0]->ul_ch_estimates_ext[0][(ulsch_harq->ulsch_pdu.start_symbol_index+1)*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size))],
|
||||
(ulsch_harq->ulsch_pdu.nr_of_symbols-1)*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size)),1,1);
|
||||
LOG_M("rxsigF0_comp.m","rxsF0_comp",
|
||||
&gNB->pusch_vars[0]->rxdataF_comp[0][ulsch_harq->ulsch_pdu.start_symbol_index*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size))],ulsch_harq->ulsch_pdu.nr_of_symbols*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size)),1,1);
|
||||
LOG_M("rxsigF0_llr.m","rxsF0_llr",
|
||||
&gNB->pusch_vars[0]->llr[0],(ulsch_harq->ulsch_pdu.nr_of_symbols-1)*NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size * ulsch_harq->ulsch_pdu.qam_mod_order,1,0);
|
||||
if (gNB->frame_parms.nb_antennas_rx > 1) {
|
||||
|
||||
LOG_M("rxsigF1_ext.m","rxsF0_ext",
|
||||
&gNB->pusch_vars[0]->rxdataF_ext[1][ulsch_harq->ulsch_pdu.start_symbol_index*NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size],ulsch_harq->ulsch_pdu.nr_of_symbols*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size)),1,1);
|
||||
LOG_M("chestF1.m","chF1",
|
||||
&gNB->pusch_vars[0]->ul_ch_estimates[1][ulsch_harq->ulsch_pdu.start_symbol_index*gNB->frame_parms.ofdm_symbol_size],gNB->frame_parms.ofdm_symbol_size,1,1);
|
||||
LOG_M("chestF1_ext.m","chF1_ext",
|
||||
&gNB->pusch_vars[0]->ul_ch_estimates_ext[1][(ulsch_harq->ulsch_pdu.start_symbol_index+1)*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size))],
|
||||
(ulsch_harq->ulsch_pdu.nr_of_symbols-1)*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size)),1,1);
|
||||
LOG_M("rxsigF1_comp.m","rxsF1_comp",
|
||||
&gNB->pusch_vars[0]->rxdataF_comp[1][ulsch_harq->ulsch_pdu.start_symbol_index*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size))],ulsch_harq->ulsch_pdu.nr_of_symbols*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size)),1,1);
|
||||
}
|
||||
exit(-1);
|
||||
|
||||
} */
|
||||
ulsch->last_iteration_cnt = rdata->decodeIterations;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING,0);
|
||||
}
|
||||
@@ -367,7 +405,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
}
|
||||
|
||||
|
||||
void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, uint8_t harq_pid, uint8_t crc_flag) {
|
||||
void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, uint8_t harq_pid, uint8_t crc_flag, int dtx_flag) {
|
||||
|
||||
pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
|
||||
@@ -375,6 +413,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
int sync_pos;
|
||||
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
|
||||
NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid];
|
||||
NR_gNB_SCH_STATS_t *stats=get_ulsch_stats(gNB,ulsch);
|
||||
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu = &harq_process->ulsch_pdu;
|
||||
|
||||
@@ -389,6 +428,8 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
sync_pos_rounded = sync_pos + (bw_scaling / 2) - 1;
|
||||
else
|
||||
sync_pos_rounded = sync_pos - (bw_scaling / 2) - 1;
|
||||
if (stats) stats->sync_pos = sync_pos;
|
||||
|
||||
timing_advance_update = sync_pos_rounded / bw_scaling;
|
||||
|
||||
// put timing advance command in 0..63 range
|
||||
@@ -397,8 +438,16 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
if (timing_advance_update < 0) timing_advance_update = 0;
|
||||
if (timing_advance_update > 63) timing_advance_update = 63;
|
||||
|
||||
LOG_D(PHY, "Estimated timing advance PUSCH is = %d, timing_advance_update is %d \n", sync_pos,timing_advance_update);
|
||||
|
||||
if (crc_flag == 0) LOG_D(PHY, "%d.%d : Received PUSCH : Estimated timing advance PUSCH is = %d, timing_advance_update is %d \n", frame,slot_rx,sync_pos,timing_advance_update);
|
||||
else if (harq_process->round>0 || dtx_flag == 0) { // increment round if crc_flag == 1 and not(dtx_flag ==1 and round==0)
|
||||
harq_process->round++;
|
||||
if (harq_process->round >= ulsch->Mlimit) {
|
||||
harq_process->status = SCH_IDLE;
|
||||
harq_process->round = 0;
|
||||
harq_process->handled = 0;
|
||||
ulsch->harq_mask &= ~(1 << harq_pid);
|
||||
}
|
||||
}
|
||||
// estimate UL_CQI for MAC
|
||||
|
||||
int SNRtimes10 = dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot) -
|
||||
@@ -410,6 +459,41 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
else if (SNRtimes10 > 635) cqi=255;
|
||||
else cqi=(640+SNRtimes10)/5;
|
||||
|
||||
|
||||
if (0/*pusch_pdu->mcs_index == 9*/) {
|
||||
#ifdef __AVX2__
|
||||
int off = ((pusch_pdu->rb_size&1) == 1)? 4:0;
|
||||
#else
|
||||
int off = 0;
|
||||
#endif
|
||||
LOG_M("rxsigF0.m","rxsF0",&gNB->common_vars.rxdataF[0][(slot_rx&3)*gNB->frame_parms.ofdm_symbol_size*gNB->frame_parms.symbols_per_slot],gNB->frame_parms.ofdm_symbol_size*gNB->frame_parms.symbols_per_slot,1,1);
|
||||
LOG_M("rxsigF0_ext.m","rxsF0_ext",
|
||||
&gNB->pusch_vars[0]->rxdataF_ext[0][pusch_pdu->start_symbol_index*NR_NB_SC_PER_RB * pusch_pdu->rb_size],pusch_pdu->nr_of_symbols*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_M("chestF0.m","chF0",
|
||||
&gNB->pusch_vars[0]->ul_ch_estimates[0][pusch_pdu->start_symbol_index*gNB->frame_parms.ofdm_symbol_size],gNB->frame_parms.ofdm_symbol_size,1,1);
|
||||
LOG_M("chestF0_ext.m","chF0_ext",
|
||||
&gNB->pusch_vars[0]->ul_ch_estimates_ext[0][(pusch_pdu->start_symbol_index+1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],
|
||||
(pusch_pdu->nr_of_symbols-1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_M("rxsigF0_comp.m","rxsF0_comp",
|
||||
&gNB->pusch_vars[0]->rxdataF_comp[0][pusch_pdu->start_symbol_index*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],pusch_pdu->nr_of_symbols*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_M("rxsigF0_llr.m","rxsF0_llr",
|
||||
&gNB->pusch_vars[0]->llr[0],(pusch_pdu->nr_of_symbols-1)*NR_NB_SC_PER_RB *pusch_pdu->rb_size * pusch_pdu->qam_mod_order,1,0);
|
||||
if (gNB->frame_parms.nb_antennas_rx > 1) {
|
||||
LOG_M("rxsigF1.m","rxsF1",&gNB->common_vars.rxdataF[1][(slot_rx&3)*gNB->frame_parms.ofdm_symbol_size*gNB->frame_parms.symbols_per_slot],gNB->frame_parms.ofdm_symbol_size*gNB->frame_parms.symbols_per_slot,1,1);
|
||||
LOG_M("rxsigF1_ext.m","rxsF1_ext",
|
||||
&gNB->pusch_vars[0]->rxdataF_ext[1][pusch_pdu->start_symbol_index*NR_NB_SC_PER_RB * pusch_pdu->rb_size],pusch_pdu->nr_of_symbols*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_M("chestF1.m","chF1",
|
||||
&gNB->pusch_vars[0]->ul_ch_estimates[1][pusch_pdu->start_symbol_index*gNB->frame_parms.ofdm_symbol_size],gNB->frame_parms.ofdm_symbol_size,1,1);
|
||||
LOG_M("chestF1_ext.m","chF1_ext",
|
||||
&gNB->pusch_vars[0]->ul_ch_estimates_ext[1][(pusch_pdu->start_symbol_index+1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],
|
||||
(pusch_pdu->nr_of_symbols-1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_M("rxsigF1_comp.m","rxsF1_comp",
|
||||
&gNB->pusch_vars[0]->rxdataF_comp[1][pusch_pdu->start_symbol_index*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],pusch_pdu->nr_of_symbols*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
}
|
||||
exit(-1);
|
||||
|
||||
}
|
||||
|
||||
// crc indication
|
||||
uint16_t num_crc = gNB->UL_INFO.crc_ind.number_crcs;
|
||||
gNB->UL_INFO.crc_ind.crc_list = &gNB->crc_pdu_list[0];
|
||||
@@ -424,7 +508,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
gNB->crc_pdu_list[num_crc].ul_cqi = cqi;
|
||||
gNB->crc_pdu_list[num_crc].timing_advance = timing_advance_update;
|
||||
// in terms of dBFS range -128 to 0 with 0.1 step
|
||||
gNB->crc_pdu_list[num_crc].rssi = 1280 - (10*dB_fixed(32767*32767)-dB_fixed_times10(gNB->pusch_vars[ULSCH_id]->ulsch_power[0]));
|
||||
gNB->crc_pdu_list[num_crc].rssi = (dtx_flag==0) ? 1280 - (10*dB_fixed(32767*32767)-dB_fixed_times10(gNB->pusch_vars[ULSCH_id]->ulsch_power[0])) : 0;
|
||||
|
||||
gNB->UL_INFO.crc_ind.number_crcs++;
|
||||
|
||||
@@ -438,7 +522,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
gNB->rx_pdu_list[num_rx].harq_id = harq_pid;
|
||||
gNB->rx_pdu_list[num_rx].ul_cqi = cqi;
|
||||
gNB->rx_pdu_list[num_rx].timing_advance = timing_advance_update;
|
||||
gNB->rx_pdu_list[num_rx].rssi = 1280 - (10*dB_fixed(32767*32767)-dB_fixed_times10(gNB->pusch_vars[ULSCH_id]->ulsch_power[0]));
|
||||
gNB->rx_pdu_list[num_rx].rssi = gNB->crc_pdu_list[num_crc].rssi;
|
||||
if (crc_flag)
|
||||
gNB->rx_pdu_list[num_rx].pdu_length = 0;
|
||||
else {
|
||||
@@ -455,64 +539,61 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
void fill_ul_rb_mask(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
|
||||
int rb2, rb, nb_rb;
|
||||
for (int symbol=0;symbol<14;symbol++) {
|
||||
if (gNB->gNB_config.tdd_table.max_tdd_periodicity_list[slot_rx].max_num_of_symbol_per_slot_list[symbol].slot_config.value==1){
|
||||
nb_rb = 0;
|
||||
for (int m=0;m<9;m++) gNB->rb_mask_ul[m] = 0;
|
||||
gNB->ulmask_symb = -1;
|
||||
if (1/*(gNB->gNB_config.tdd_table.max_tdd_periodicity_list[slot_rx].max_num_of_symbol_per_slot_list[symbol].slot_config.value==1*/){
|
||||
nb_rb = 0;
|
||||
for (int symbol=0;symbol<14;symbol++)
|
||||
for (int m=0;m<9;m++) gNB->rb_mask_ul[symbol][m] = 0;
|
||||
|
||||
for (int i=0;i<NUMBER_OF_NR_PUCCH_MAX;i++){
|
||||
NR_gNB_PUCCH_t *pucch = gNB->pucch[i];
|
||||
if (pucch) {
|
||||
if ((pucch->active == 1) &&
|
||||
(pucch->frame == frame_rx) &&
|
||||
(pucch->slot == slot_rx) ) {
|
||||
gNB->ulmask_symb = symbol;
|
||||
nfapi_nr_pucch_pdu_t *pucch_pdu = &pucch->pucch_pdu;
|
||||
if ((symbol>=pucch_pdu->start_symbol_index) &&
|
||||
(symbol<(pucch_pdu->start_symbol_index + pucch_pdu->nr_of_symbols))){
|
||||
for (rb=0; rb<pucch_pdu->prb_size; rb++) {
|
||||
rb2 = rb+pucch_pdu->prb_start+pucch_pdu->bwp_start;
|
||||
gNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31));
|
||||
}
|
||||
nb_rb+=pucch_pdu->prb_size;
|
||||
for (int i=0;i<NUMBER_OF_NR_PUCCH_MAX;i++){
|
||||
NR_gNB_PUCCH_t *pucch = gNB->pucch[i];
|
||||
if (pucch) {
|
||||
if ((pucch->active == 1) &&
|
||||
(pucch->frame == frame_rx) &&
|
||||
(pucch->slot == slot_rx) ) {
|
||||
nfapi_nr_pucch_pdu_t *pucch_pdu = &pucch->pucch_pdu;
|
||||
LOG_D(PHY,"%d.%d pucch %d : start_symbol %d, nb_symbols %d, prb_size %d\n",frame_rx,slot_rx,i,pucch_pdu->start_symbol_index,pucch_pdu->nr_of_symbols,pucch_pdu->prb_size);
|
||||
for (int symbol=pucch_pdu->start_symbol_index ; symbol<(pucch_pdu->start_symbol_index+pucch_pdu->nr_of_symbols);symbol++) {
|
||||
for (rb=0; rb<pucch_pdu->prb_size; rb++) {
|
||||
rb2 = rb+(symbol < pucch_pdu->start_symbol_index+(pucch_pdu->nr_of_symbols>>1) ? pucch_pdu->prb_start : pucch_pdu->second_hop_prb)+pucch_pdu->bwp_start;
|
||||
LOG_D(PHY,"%d.%d pucch %d : symbol %d, rb %d\n",frame_rx,slot_rx,i,symbol,rb2);
|
||||
gNB->rb_mask_ul[symbol][rb2>>5] |= (1<<(rb2&31));
|
||||
}
|
||||
if (symbol==pucch_pdu->start_symbol_index) nb_rb+=pucch_pdu->prb_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int ULSCH_id=0;ULSCH_id<gNB->number_of_nr_ulsch_max;ULSCH_id++) {
|
||||
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
|
||||
int harq_pid;
|
||||
NR_UL_gNB_HARQ_t *ulsch_harq;
|
||||
|
||||
if ((ulsch) &&
|
||||
(ulsch->rnti > 0)) {
|
||||
for (harq_pid=0;harq_pid<NR_MAX_ULSCH_HARQ_PROCESSES;harq_pid++) {
|
||||
ulsch_harq = ulsch->harq_processes[harq_pid];
|
||||
AssertFatal(ulsch_harq!=NULL,"harq_pid %d is not allocated\n",harq_pid);
|
||||
if ((ulsch_harq->status == NR_ACTIVE) &&
|
||||
(ulsch_harq->frame == frame_rx) &&
|
||||
(ulsch_harq->slot == slot_rx) &&
|
||||
(ulsch_harq->handled == 0)){
|
||||
uint8_t symbol_start = ulsch_harq->ulsch_pdu.start_symbol_index;
|
||||
uint8_t symbol_end = symbol_start + ulsch_harq->ulsch_pdu.nr_of_symbols;
|
||||
gNB->ulmask_symb = symbol;
|
||||
if ((symbol>=symbol_start) &&
|
||||
(symbol<symbol_end)){
|
||||
for (rb=0; rb<ulsch_harq->ulsch_pdu.rb_size; rb++) {
|
||||
rb2 = rb+ulsch_harq->ulsch_pdu.rb_start+ulsch_harq->ulsch_pdu.bwp_start;
|
||||
gNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31));
|
||||
}
|
||||
nb_rb+=ulsch_harq->ulsch_pdu.rb_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//TODO Add check for PRACH as well?
|
||||
}
|
||||
if (nb_rb<gNB->frame_parms.N_RB_UL)
|
||||
return;
|
||||
}
|
||||
for (int ULSCH_id=0;ULSCH_id<gNB->number_of_nr_ulsch_max;ULSCH_id++) {
|
||||
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
|
||||
int harq_pid;
|
||||
NR_UL_gNB_HARQ_t *ulsch_harq;
|
||||
|
||||
if ((ulsch) &&
|
||||
(ulsch->rnti > 0)) {
|
||||
for (harq_pid=0;harq_pid<NR_MAX_ULSCH_HARQ_PROCESSES;harq_pid++) {
|
||||
ulsch_harq = ulsch->harq_processes[harq_pid];
|
||||
AssertFatal(ulsch_harq!=NULL,"harq_pid %d is not allocated\n",harq_pid);
|
||||
if ((ulsch_harq->status == NR_ACTIVE) &&
|
||||
(ulsch_harq->frame == frame_rx) &&
|
||||
(ulsch_harq->slot == slot_rx) &&
|
||||
(ulsch_harq->handled == 0)){
|
||||
uint8_t symbol_start = ulsch_harq->ulsch_pdu.start_symbol_index;
|
||||
uint8_t symbol_end = symbol_start + ulsch_harq->ulsch_pdu.nr_of_symbols;
|
||||
for (int symbol=symbol_start ; symbol<symbol_end ; symbol++) {
|
||||
LOG_D(PHY,"symbol %d Filling rb_mask_ul rb_size %d\n",symbol,ulsch_harq->ulsch_pdu.rb_size);
|
||||
for (rb=0; rb<ulsch_harq->ulsch_pdu.rb_size; rb++) {
|
||||
rb2 = rb+ulsch_harq->ulsch_pdu.rb_start+ulsch_harq->ulsch_pdu.bwp_start;
|
||||
gNB->rb_mask_ul[symbol][rb2>>5] |= (1<<(rb2&31));
|
||||
}
|
||||
if (symbol==symbol_start) nb_rb+=ulsch_harq->ulsch_pdu.rb_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//TODO Add check for PRACH as well?
|
||||
if (nb_rb<gNB->frame_parms.N_RB_UL)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -564,7 +645,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
}
|
||||
}
|
||||
else num_symb=NR_NUMBER_OF_SYMBOLS_PER_SLOT;
|
||||
gNB_I0_measurements(gNB,first_symb,num_symb);
|
||||
gNB_I0_measurements(gNB,slot_rx,first_symb,num_symb);
|
||||
|
||||
int offset = 10*gNB->frame_parms.ofdm_symbol_size + gNB->frame_parms.first_carrier_offset;
|
||||
int power_rxF = signal_energy_nodc(&gNB->common_vars.rxdataF[0][offset+(47*12)],12*18);
|
||||
@@ -600,7 +681,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
LOG_D(PHY,"frame %d, slot %d: PUCCH signal energy %d\n",frame_rx,slot_rx,power_rxF);
|
||||
|
||||
nr_decode_pucch0(gNB,
|
||||
frame_rx,
|
||||
frame_rx,
|
||||
slot_rx,
|
||||
uci_pdu_format0,
|
||||
pucch_pdu);
|
||||
@@ -686,7 +767,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
no_sig = nr_rx_pusch(gNB, ULSCH_id, frame_rx, slot_rx, harq_pid);
|
||||
if (no_sig) {
|
||||
LOG_D(PHY, "PUSCH not detected in frame %d, slot %d\n", frame_rx, slot_rx);
|
||||
nr_fill_indication(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid, 1);
|
||||
nr_fill_indication(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid, 1,1);
|
||||
return 1;
|
||||
}
|
||||
gNB->pusch_vars[ULSCH_id]->ulsch_power_tot=0;
|
||||
@@ -705,7 +786,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot),
|
||||
dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot),gNB->pusch_thres);
|
||||
gNB->pusch_vars[ULSCH_id]->ulsch_power_tot = gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot;
|
||||
nr_fill_indication(gNB,frame_rx, slot_rx, ULSCH_id, harq_pid, 1);
|
||||
nr_fill_indication(gNB,frame_rx, slot_rx, ULSCH_id, harq_pid, 1,1);
|
||||
gNB->pusch_vars[ULSCH_id]->DTX=1;
|
||||
if (stats) stats->DTX++;
|
||||
return 1;
|
||||
@@ -726,7 +807,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
stop_meas(&gNB->phy_proc_rx);
|
||||
// figure out a better way to choose slot_rx, 19 is ok for a particular TDD configuration with 30kHz SCS
|
||||
if ((frame_rx&127) == 0 && slot_rx==19) {
|
||||
LOG_I(PHY, "Number of bad PUCCH received: %lu\n", gNB->bad_pucch);
|
||||
LOG_I(NR_PHY, "Number of bad PUCCH received: %lu\n", gNB->bad_pucch);
|
||||
}
|
||||
|
||||
if (pucch_decode_done || pusch_decode_done) {
|
||||
|
||||
@@ -252,7 +252,7 @@ void ue_ta_procedures(PHY_VARS_NR_UE *ue, int slot_tx, int frame_tx){
|
||||
|
||||
ue->timing_advance += (ul_time_alignment->ta_command - 31) * bw_scaling;
|
||||
|
||||
LOG_I(PHY, "In %s: [UE %d] [%d.%d] Got timing advance command %u from MAC, new value is %d\n",
|
||||
LOG_D(PHY, "In %s: [UE %d] [%d.%d] Got timing advance command %u from MAC, new value is %d\n",
|
||||
__FUNCTION__,
|
||||
ue->Mod_id,
|
||||
frame_tx,
|
||||
@@ -480,8 +480,8 @@ unsigned int nr_get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb
|
||||
#ifdef NR_PDCCH_SCHED
|
||||
|
||||
int nr_ue_pdcch_procedures(uint8_t gNB_id,
|
||||
PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
int n_ss)
|
||||
{
|
||||
int frame_rx = proc->frame_rx;
|
||||
@@ -1682,7 +1682,9 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN);
|
||||
|
||||
LOG_D(PHY," ****** start RX-Chain for Frame.Slot %d.%d ****** \n", frame_rx%1024, nr_slot_rx);
|
||||
LOG_D(PHY," ****** start RX-Chain for Frame.Slot %d.%d (energy %d dB)****** \n",
|
||||
frame_rx%1024, nr_slot_rx,
|
||||
dB_fixed(signal_energy(ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF[0],2048*14)));
|
||||
|
||||
/*
|
||||
uint8_t next1_thread_id = proc->thread_id== (RX_NB_TH-1) ? 0:(proc->thread_id+1);
|
||||
@@ -1743,9 +1745,9 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
|
||||
if ((frame_rx%64 == 0) && (nr_slot_rx==0)) {
|
||||
LOG_I(PHY,"============================================\n");
|
||||
LOG_I(PHY,"Harq round stats for Downlink: %d/%d/%d/%d DLSCH errors: %d\n",ue->dl_stats[0],ue->dl_stats[1],ue->dl_stats[2],ue->dl_stats[3],ue->dl_stats[4]);
|
||||
LOG_I(PHY,"============================================\n");
|
||||
LOG_I(NR_PHY,"============================================\n");
|
||||
LOG_I(NR_PHY,"Harq round stats for Downlink: %d/%d/%d/%d DLSCH errors: %d\n",ue->dl_stats[0],ue->dl_stats[1],ue->dl_stats[2],ue->dl_stats[3],ue->dl_stats[4]);
|
||||
LOG_I(NR_PHY,"============================================\n");
|
||||
}
|
||||
|
||||
#ifdef NR_PDCCH_SCHED
|
||||
|
||||
@@ -341,12 +341,14 @@ void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue,
|
||||
|
||||
int tx_amp;
|
||||
|
||||
/*
|
||||
tx_amp = nr_get_tx_amp(pucch_tx_power,
|
||||
ue->tx_power_max_dBm,
|
||||
ue->frame_parms.N_RB_UL,
|
||||
nb_of_prbs);
|
||||
if (tx_amp == 0)
|
||||
tx_amp = AMP;
|
||||
if (tx_amp == 0)*/
|
||||
// FIXME temporarly using fixed amplitude before pucch power control implementation revised
|
||||
tx_amp = AMP;
|
||||
|
||||
|
||||
LOG_D(PHY,"Generation of PUCCH format %d at frame.slot %d.%d\n",pucch_pdu->format_type,proc->frame_tx,nr_slot_tx);
|
||||
|
||||
@@ -182,7 +182,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
|
||||
|
||||
if (UE->perfect_ce==1) {
|
||||
// fill in perfect channel estimates
|
||||
freq_channel(eNB2UE[round],UE->frame_parms.N_RB_DL,12*UE->frame_parms.N_RB_DL + 1);
|
||||
freq_channel(eNB2UE[round],UE->frame_parms.N_RB_DL,12*UE->frame_parms.N_RB_DL + 1, 15);
|
||||
/*
|
||||
LOG_M("channel.m","ch",eNB2UE[round]->ch[0],eNB2UE[round]->channel_length,1,8);
|
||||
LOG_M("channelF.m","chF",eNB2UE[round]->chF[0],12*UE->frame_parms.N_RB_DL + 1,1,8);
|
||||
@@ -193,7 +193,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
|
||||
if(abstx) {
|
||||
if (trials==0 && round==0) {
|
||||
// calculate freq domain representation to compute SINR
|
||||
freq_channel(eNB2UE[0], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1);
|
||||
freq_channel(eNB2UE[0], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1, 15);
|
||||
// snr=pow(10.0,.1*SNR);
|
||||
fprintf(csv_fd,"%f,",SNR);
|
||||
|
||||
@@ -208,7 +208,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
|
||||
}
|
||||
|
||||
if(num_rounds>1) {
|
||||
freq_channel(eNB2UE[1], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1);
|
||||
freq_channel(eNB2UE[1], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1, 15);
|
||||
|
||||
for (u=0; u<2*ru->frame_parms->N_RB_DL; u++) {
|
||||
for (aarx=0; aarx<eNB2UE[1]->nb_rx; aarx++) {
|
||||
@@ -220,7 +220,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
|
||||
}
|
||||
}
|
||||
|
||||
freq_channel(eNB2UE[2], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1);
|
||||
freq_channel(eNB2UE[2], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1, 15);
|
||||
|
||||
for (u=0; u<2*ru->frame_parms->N_RB_DL; u++) {
|
||||
for (aarx=0; aarx<eNB2UE[2]->nb_rx; aarx++) {
|
||||
@@ -232,7 +232,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
|
||||
}
|
||||
}
|
||||
|
||||
freq_channel(eNB2UE[3], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1);
|
||||
freq_channel(eNB2UE[3], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1, 15);
|
||||
|
||||
for (u=0; u<2*ru->frame_parms->N_RB_DL; u++) {
|
||||
for (aarx=0; aarx<eNB2UE[3]->nb_rx; aarx++) {
|
||||
|
||||
@@ -181,7 +181,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
|
||||
|
||||
if (UE->perfect_ce==1) {
|
||||
// fill in perfect channel estimates
|
||||
freq_channel(eNB2UE[round],UE->frame_parms.N_RB_DL,12*UE->frame_parms.N_RB_DL + 1);
|
||||
freq_channel(eNB2UE[round],UE->frame_parms.N_RB_DL,12*UE->frame_parms.N_RB_DL + 1, 15);
|
||||
/*
|
||||
LOG_M("channel.m","ch",eNB2UE[round]->ch[0],eNB2UE[round]->channel_length,1,8);
|
||||
LOG_M("channelF.m","chF",eNB2UE[round]->chF[0],12*UE->frame_parms.N_RB_DL + 1,1,8);
|
||||
@@ -192,7 +192,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
|
||||
if(abstx) {
|
||||
if (trials==0 && round==0) {
|
||||
// calculate freq domain representation to compute SINR
|
||||
freq_channel(eNB2UE[0], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1);
|
||||
freq_channel(eNB2UE[0], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1, 15);
|
||||
// snr=pow(10.0,.1*SNR);
|
||||
fprintf(csv_fd,"%f,",SNR);
|
||||
|
||||
@@ -207,7 +207,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
|
||||
}
|
||||
|
||||
if(num_rounds>1) {
|
||||
freq_channel(eNB2UE[1], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1);
|
||||
freq_channel(eNB2UE[1], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1, 15);
|
||||
|
||||
for (u=0; u<2*ru->frame_parms.N_RB_DL; u++) {
|
||||
for (aarx=0; aarx<eNB2UE[1]->nb_rx; aarx++) {
|
||||
@@ -219,7 +219,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
|
||||
}
|
||||
}
|
||||
|
||||
freq_channel(eNB2UE[2], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1);
|
||||
freq_channel(eNB2UE[2], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1, 15);
|
||||
|
||||
for (u=0; u<2*ru->frame_parms.N_RB_DL; u++) {
|
||||
for (aarx=0; aarx<eNB2UE[2]->nb_rx; aarx++) {
|
||||
@@ -231,7 +231,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
|
||||
}
|
||||
}
|
||||
|
||||
freq_channel(eNB2UE[3], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1);
|
||||
freq_channel(eNB2UE[3], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1, 15);
|
||||
|
||||
for (u=0; u<2*ru->frame_parms.N_RB_DL; u++) {
|
||||
for (aarx=0; aarx<eNB2UE[3]->nb_rx; aarx++) {
|
||||
|
||||
@@ -1102,7 +1102,7 @@ int main(int argc, char **argv) {
|
||||
if(saving_bler==0)
|
||||
if (trials==0 && round==0) {
|
||||
// calculate freq domain representation to compute SINR
|
||||
freq_channel(UE2eNB, N_RB_DL,12*N_RB_DL + 1);
|
||||
freq_channel(UE2eNB, N_RB_DL,12*N_RB_DL + 1, 15);
|
||||
// snr=pow(10.0,.1*SNR);
|
||||
fprintf(csv_fdUL,"%f,%u,%u,%f,%f,%f,",SNR,tx_lev,tx_lev_dB,sigma2_dB,tx_gain,SNR2);
|
||||
|
||||
|
||||
@@ -261,19 +261,23 @@ void nr_dlsim_preprocessor(module_id_t module_id,
|
||||
uint8_t nr_of_candidates;
|
||||
find_aggregation_candidates(&sched_ctrl->aggregation_level,
|
||||
&nr_of_candidates,
|
||||
sched_ctrl->search_space);
|
||||
sched_ctrl->coreset = get_coreset(scc, sched_ctrl->active_bwp, sched_ctrl->search_space, target_ss);
|
||||
sched_ctrl->search_space,4);
|
||||
sched_ctrl->coreset = get_coreset(scc, sched_ctrl->active_bwp->bwp_Dedicated, sched_ctrl->search_space, target_ss);
|
||||
sched_ctrl->cce_index = 0;
|
||||
|
||||
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
|
||||
|
||||
ps->nrOfLayers = g_nrOfLayers;
|
||||
|
||||
int dci_format = sched_ctrl->search_space && sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats ?
|
||||
NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0;
|
||||
|
||||
nr_set_pdsch_semi_static(scc,
|
||||
UE_info->CellGroup[0],
|
||||
sched_ctrl->active_bwp,
|
||||
NULL,
|
||||
/* tda = */ 2,
|
||||
/* num_dmrs_cdm_grps_no_data = */ 1,
|
||||
dci_format,
|
||||
ps);
|
||||
|
||||
NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch;
|
||||
@@ -780,9 +784,9 @@ int main(int argc, char **argv)
|
||||
AssertFatal((gNB->if_inst = NR_IF_Module_init(0))!=NULL,"Cannot register interface");
|
||||
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
|
||||
// common configuration
|
||||
rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, 0, 0, NULL);
|
||||
rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, NULL, 0, 0, NULL);
|
||||
// UE dedicated configuration
|
||||
rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
|
||||
rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
|
||||
// reset preprocessor to the one of DLSIM after it has been set during
|
||||
// rrc_mac_config_req_gNB
|
||||
gNB_mac->pre_processor_dl = nr_dlsim_preprocessor;
|
||||
@@ -1261,7 +1265,7 @@ int main(int argc, char **argv)
|
||||
(float) n_errors / (float) n_trials);
|
||||
printf("*****************************************\n");
|
||||
printf("\n");
|
||||
dump_pdsch_stats(gNB);
|
||||
dump_pdsch_stats(stdout,gNB);
|
||||
printf("SNR %f : n_errors (negative CRC) = %d/%d, Avg round %.2f, Channel BER %e, BLER %.2f, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %u bits/slot\n", SNR, n_errors, n_trials,roundStats[snrRun],berStats[snrRun],blerStats[snrRun],effRate,effRate/TBS*100,TBS);
|
||||
printf("\n");
|
||||
|
||||
@@ -1324,6 +1328,8 @@ int main(int argc, char **argv)
|
||||
LOG_M("chestF0.m","chF0",&UE->pdsch_vars[0][0]->dl_ch_estimates_ext[0][0],g_rbSize*12*14,1,1);
|
||||
write_output("rxF_comp.m","rxFc",&UE->pdsch_vars[0][0]->rxdataF_comp0[0][0],N_RB_DL*12*14,1,1);
|
||||
LOG_M("rxF_llr.m","rxFllr",UE->pdsch_vars[UE_proc.thread_id][0]->llr[0],available_bits,1,0);
|
||||
LOG_M("pdcch_rxFcomp.m","pdcch_rxFcomp",&UE->pdcch_vars[0][0]->rxdataF_comp[0][0],96*12,1,1);
|
||||
LOG_M("pdcch_rxFllr.m","pdcch_rxFllr",UE->pdcch_vars[0][0]->llr,96*12,1,1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {}
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char c;
|
||||
int i,aa=0;//,l;
|
||||
int i;//,l;
|
||||
double sigma2, sigma2_dB=10,SNR,snr0=-2.0,snr1=2.0;
|
||||
double cfo=0;
|
||||
uint8_t snr1set=0;
|
||||
@@ -104,7 +104,8 @@ int main(int argc, char **argv)
|
||||
SCM_t channel_model=AWGN;//Rayleigh1_anticorr;
|
||||
|
||||
double DS_TDL = .03;
|
||||
|
||||
|
||||
double delay_us = 0;
|
||||
int N_RB_DL=273,mu=1;
|
||||
float target_error_rate=0.001;
|
||||
int frame_length_complex_samples;
|
||||
@@ -113,7 +114,7 @@ int main(int argc, char **argv)
|
||||
//unsigned char frame_type = 0;
|
||||
int loglvl=OAILOG_WARNING;
|
||||
int sr_flag = 0;
|
||||
|
||||
int pucch_DTX_thres = 50;
|
||||
cpuf = get_cpu_freq_GHz();
|
||||
|
||||
if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0) {
|
||||
@@ -123,7 +124,7 @@ int main(int argc, char **argv)
|
||||
randominit(0);
|
||||
logInit();
|
||||
|
||||
while ((c = getopt (argc, argv, "f:hA:f:g:i:I:P:B:b:T:m:n:r:o:s:S:x:y:z:N:F:GR:IL:q:c")) != -1) {
|
||||
while ((c = getopt (argc, argv, "f:hA:f:g:i:I:P:B:b:t:T:m:n:r:o:s:S:x:y:z:N:F:GR:IL:q:cd:")) != -1) {
|
||||
switch (c) {
|
||||
case 'f':
|
||||
//write_output_file=1;
|
||||
@@ -207,11 +208,11 @@ int main(int argc, char **argv)
|
||||
printf("Setting SNR1 to %f\n",snr1);
|
||||
break;
|
||||
|
||||
/*
|
||||
|
||||
case 't':
|
||||
Td= atof(optarg);
|
||||
pucch_DTX_thres= atoi(optarg);
|
||||
break;
|
||||
|
||||
/*
|
||||
case 'p':
|
||||
extended_prefix_flag=1;
|
||||
break;
|
||||
@@ -228,6 +229,9 @@ int main(int argc, char **argv)
|
||||
}
|
||||
break;
|
||||
*/
|
||||
case 'd':
|
||||
delay_us=atof(optarg);
|
||||
break;
|
||||
case 'x':
|
||||
transmission_mode=atoi(optarg);
|
||||
|
||||
@@ -251,7 +255,7 @@ int main(int argc, char **argv)
|
||||
case 'z':
|
||||
n_rx=atoi(optarg);
|
||||
|
||||
if ((n_rx==0) || (n_rx>2)) {
|
||||
if ((n_rx==0) || (n_rx>8)) {
|
||||
printf("Unsupported number of rx antennas %d\n",n_rx);
|
||||
exit(-1);
|
||||
}
|
||||
@@ -346,29 +350,33 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
double phase = (1<<mu)*30e-3*delay_us;
|
||||
|
||||
set_glog(loglvl);
|
||||
|
||||
if (snr1set==0) snr1 = snr0+10;
|
||||
|
||||
printf("Initializing gNodeB for mu %d, N_RB_DL %d\n",mu,N_RB_DL);
|
||||
printf("Initializing gNodeB for mu %d, N_RB_DL %d, n_rx %d\n",mu,N_RB_DL,n_rx);
|
||||
|
||||
if((format!=0) && (format!=1) && (format!=2)){
|
||||
printf("PUCCH format %d not supported\n",format);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
AssertFatal(((format < 2)&&(nr_bit<3)&&(actual_payload<4)) ||
|
||||
AssertFatal(((format < 2)&&(nr_bit<3)&&(actual_payload<5)) ||
|
||||
((format == 2)&&(nr_bit>2)&&(nr_bit<65)),"illegal combination format %d, nr_bit %d\n",
|
||||
format,nr_bit);
|
||||
int do_DTX=0;
|
||||
if ((format < 2) && (actual_payload == 4)) do_DTX=1;
|
||||
|
||||
actual_payload &= ((1<<nr_bit)-1);
|
||||
|
||||
printf("Transmitted payload is %ld\n",actual_payload);
|
||||
printf("Transmitted payload is %ld, do_DTX = %d\n",actual_payload,do_DTX);
|
||||
|
||||
RC.gNB = (PHY_VARS_gNB**) malloc(sizeof(PHY_VARS_gNB *));
|
||||
RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB));
|
||||
RC.gNB[0] = calloc(1,sizeof(PHY_VARS_gNB));
|
||||
gNB = RC.gNB[0];
|
||||
memset((void*)gNB,0,sizeof(*gNB));
|
||||
gNB->pucch0_thres = pucch_DTX_thres;
|
||||
frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH)
|
||||
frame_parms->nb_antennas_tx = n_tx;
|
||||
frame_parms->nb_antennas_rx = n_rx;
|
||||
@@ -430,31 +438,28 @@ int main(int argc, char **argv)
|
||||
frame_length_complex_samples = frame_parms->samples_per_subframe*NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
||||
//frame_length_complex_samples_no_prefix = frame_parms->samples_per_subframe_wCP;
|
||||
|
||||
s_re = malloc(2*sizeof(double*));
|
||||
s_im = malloc(2*sizeof(double*));
|
||||
r_re = malloc(2*sizeof(double*));
|
||||
r_im = malloc(2*sizeof(double*));
|
||||
txdataF = malloc(2*sizeof(int*));
|
||||
rxdataF = malloc(2*sizeof(int*));
|
||||
s_re = malloc(n_tx*sizeof(double*));
|
||||
s_im = malloc(n_tx*sizeof(double*));
|
||||
r_re = malloc(n_rx*sizeof(double*));
|
||||
r_im = malloc(n_rx*sizeof(double*));
|
||||
txdataF = malloc(n_tx*sizeof(int*));
|
||||
rxdataF = malloc(n_rx*sizeof(int*));
|
||||
gNB->common_vars.rxdataF=rxdataF;
|
||||
memcpy((void*)&gNB->frame_parms,(void*)frame_parms,sizeof(frame_parms));
|
||||
for (i=0; i<2; i++) {
|
||||
for (int aatx=0; aatx<n_tx; aatx++) {
|
||||
s_re[aatx] = calloc(1,frame_length_complex_samples*sizeof(double));
|
||||
s_im[aatx] = calloc(1,frame_length_complex_samples*sizeof(double));
|
||||
printf("Allocating %d samples for txdataF\n",frame_parms->symbols_per_slot*frame_parms->ofdm_symbol_size);
|
||||
txdataF[aatx] = memalign(32,14*frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
bzero(txdataF[aatx],14*frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
}
|
||||
|
||||
s_re[i] = malloc(frame_length_complex_samples*sizeof(double));
|
||||
bzero(s_re[i],frame_length_complex_samples*sizeof(double));
|
||||
s_im[i] = malloc(frame_length_complex_samples*sizeof(double));
|
||||
bzero(s_im[i],frame_length_complex_samples*sizeof(double));
|
||||
|
||||
r_re[i] = malloc(frame_length_complex_samples*sizeof(double));
|
||||
bzero(r_re[i],frame_length_complex_samples*sizeof(double));
|
||||
r_im[i] = malloc(frame_length_complex_samples*sizeof(double));
|
||||
bzero(r_im[i],frame_length_complex_samples*sizeof(double));
|
||||
|
||||
printf("Allocating %d samples for txdataF/rxdataF\n",14*frame_parms->ofdm_symbol_size);
|
||||
txdataF[i] = memalign(32,14*frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
bzero(txdataF[i],14*frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
rxdataF[i] = memalign(32,14*frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
bzero(rxdataF[i],14*frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
for (int aarx=0; aarx<n_rx; aarx++) {
|
||||
r_re[aarx] = calloc(1,frame_length_complex_samples*sizeof(double));
|
||||
r_im[aarx] = calloc(1,frame_length_complex_samples*sizeof(double));
|
||||
printf("Allocating %d samples for rxdataF\n",frame_parms->symbols_per_slot*frame_parms->ofdm_symbol_size);
|
||||
rxdataF[aarx] = memalign(32,14*frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
bzero(rxdataF[aarx],14*frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
}
|
||||
|
||||
uint8_t mcs=0;
|
||||
@@ -471,14 +476,26 @@ int main(int argc, char **argv)
|
||||
else AssertFatal(1==0,"Either nr_bit %d or sr_flag %d must be non-zero\n", nr_bit, sr_flag);
|
||||
}
|
||||
else if (format == 2 && nr_bit > 11) gNB->uci_polarParams = nr_polar_params(2, nr_bit, nrofPRB, 1, NULL);
|
||||
|
||||
startingPRB_intraSlotHopping=N_RB_DL-1;
|
||||
uint32_t hopping_id=Nid_cell;
|
||||
uint32_t dmrs_scrambling_id = 0, data_scrambling_id=0;
|
||||
|
||||
startingPRB_intraSlotHopping = N_RB_DL-1;
|
||||
uint32_t hopping_id = Nid_cell;
|
||||
uint32_t dmrs_scrambling_id = 0;
|
||||
uint32_t data_scrambling_id = 0;
|
||||
|
||||
//configure UE
|
||||
UE = malloc(sizeof(PHY_VARS_NR_UE));
|
||||
UE = calloc(1,sizeof(PHY_VARS_NR_UE));
|
||||
memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS));
|
||||
UE->frame_parms.nb_antennas_rx=1;
|
||||
UE->perfect_ce = 0;
|
||||
|
||||
if(eps!=0.0)
|
||||
UE->UE_fo_compensation = 1; // if a frequency offset is set then perform fo estimation and compensation
|
||||
|
||||
if (init_nr_ue_signal(UE, 1, 0) != 0)
|
||||
{
|
||||
printf("Error at UE NR initialisation\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
fapi_nr_ul_config_pucch_pdu pucch_tx_pdu;
|
||||
if (format==0) {
|
||||
@@ -514,80 +531,112 @@ int main(int argc, char **argv)
|
||||
pucch_tx_pdu.second_hop_prb = startingPRB_intraSlotHopping;
|
||||
}
|
||||
|
||||
UE->perfect_ce = 0;
|
||||
|
||||
if(eps!=0.0)
|
||||
UE->UE_fo_compensation = 1; // if a frequency offset is set then perform fo estimation and compensation
|
||||
|
||||
if (init_nr_ue_signal(UE, 1, 0) != 0)
|
||||
{
|
||||
printf("Error at UE NR initialisation\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
pucch_GroupHopping_t PUCCH_GroupHopping = pucch_tx_pdu.group_hop_flag + (pucch_tx_pdu.sequence_hop_flag<<1);
|
||||
|
||||
//t_nrPolar_params *currentPtr;
|
||||
|
||||
for(SNR=snr0;SNR<=snr1;SNR=SNR+1){
|
||||
for(SNR=snr0;SNR<=snr1;SNR+=1){
|
||||
ack_nack_errors=0;
|
||||
sr_errors=0;
|
||||
n_errors = 0;
|
||||
for (trial=0; trial<n_trials; trial++) {
|
||||
bzero(txdataF[aa],frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
if(format==0){
|
||||
nr_generate_pucch0(UE,
|
||||
txdataF,
|
||||
frame_parms,
|
||||
amp,
|
||||
nr_slot_tx,
|
||||
&pucch_tx_pdu);
|
||||
for (int aatx=0;aatx<1;aatx++)
|
||||
bzero(txdataF[aatx],frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
if(format==0 && do_DTX==0){
|
||||
nr_generate_pucch0(UE, txdataF, frame_parms, amp, nr_slot_tx, &pucch_tx_pdu);
|
||||
} else if (format == 1 && do_DTX==0){
|
||||
nr_generate_pucch1(UE, txdataF, frame_parms, amp, nr_slot_tx, &pucch_tx_pdu);
|
||||
} else if (do_DTX == 0){
|
||||
nr_generate_pucch2(UE, txdataF, frame_parms, amp, nr_slot_tx, &pucch_tx_pdu);
|
||||
}
|
||||
else if (format == 1){
|
||||
nr_generate_pucch1(UE,
|
||||
txdataF,
|
||||
frame_parms,
|
||||
amp,
|
||||
nr_slot_tx,
|
||||
&pucch_tx_pdu);
|
||||
}
|
||||
else {
|
||||
nr_generate_pucch2(UE,
|
||||
txdataF,
|
||||
frame_parms,
|
||||
amp,
|
||||
nr_slot_tx,
|
||||
&pucch_tx_pdu);
|
||||
}
|
||||
|
||||
int txlev = signal_energy(&txdataF[aa][startingSymbolIndex*frame_parms->ofdm_symbol_size],
|
||||
frame_parms->ofdm_symbol_size);
|
||||
// printf("txlev %d (%d dB), offset %d\n",txlev,dB_fixed(txlev),startingSymbolIndex*frame_parms->ofdm_symbol_size);
|
||||
|
||||
// note : this scaling
|
||||
int nb_re = (format == 0 || format == 1)? 12 : 12*nrofPRB;
|
||||
sigma2_dB = 10*log10((double)txlev*UE->frame_parms.ofdm_symbol_size/nb_re)-SNR;
|
||||
sigma2 = pow(10,sigma2_dB/10);
|
||||
|
||||
for(i=startingSymbolIndex*frame_parms->ofdm_symbol_size; i<(startingSymbolIndex+1)*frame_parms->ofdm_symbol_size; i++) {
|
||||
((int16_t*)rxdataF[aa])[i<<1] = (int16_t)(100.0*((double)(((int16_t *)txdataF[aa])[(i<<1)]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0))/sqrt((double)txlev));
|
||||
((int16_t*)rxdataF[aa])[1+(i<<1)]=(int16_t)(100.0*((double)(((int16_t *)txdataF[aa])[(i<<1)+1])+ sqrt(sigma2/2)*gaussdouble(0.0,1.0))/sqrt((double)txlev));
|
||||
}
|
||||
int rxlev = signal_energy(&rxdataF[aa][startingSymbolIndex*frame_parms->ofdm_symbol_size],
|
||||
frame_parms->ofdm_symbol_size);
|
||||
|
||||
// noise measurement
|
||||
gNB->ulmask_symb = startingSymbolIndex;
|
||||
for (int rb=0; rb<nrofPRB; rb++) {
|
||||
int rb2 = rb+startingPRB;
|
||||
gNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31));
|
||||
}
|
||||
gNB_I0_measurements(gNB, startingSymbolIndex, nrofSymbols);
|
||||
// SNR Computation
|
||||
// standard says: SNR = S / N, where S is the total signal energy, N is the noise energy in the transmission bandwidth (i.e. N_RB_DL resource blocks)
|
||||
// txlev = S.
|
||||
int txlev = signal_energy(&txdataF[0][startingSymbolIndex*frame_parms->ofdm_symbol_size], frame_parms->ofdm_symbol_size);
|
||||
|
||||
if (n_trials==1) printf("rxlev %d (%d dB), sigma2 %f dB, SNR %f, TX %f\n",rxlev,dB_fixed(rxlev),sigma2_dB,SNR,10*log10((double)txlev*UE->frame_parms.ofdm_symbol_size/12));
|
||||
// sigma2 is variance per dimension, so N/(N_RB*12)
|
||||
// so, sigma2 = N/(N_RB_DL*12) => (S/SNR)/(N_RB*12)
|
||||
int N_RB = (format == 0 || format == 1) ? 1 : nrofPRB;
|
||||
sigma2_dB = 10*log10(txlev*(N_RB_DL/N_RB))-SNR;
|
||||
sigma2 = pow(10.0,sigma2_dB/10.0);
|
||||
|
||||
if (n_trials==1) printf("txlev %d (%f dB), offset %d, sigma2 %f ( %f dB)\n",txlev,10*log10(txlev),startingSymbolIndex*frame_parms->ofdm_symbol_size,sigma2,sigma2_dB);
|
||||
|
||||
int i0;
|
||||
double txr,txi,rxr,rxi,nr,ni;
|
||||
for (int symb=0; symb<gNB->frame_parms.symbols_per_slot;symb++) {
|
||||
if (symb<startingSymbolIndex || symb >= startingSymbolIndex+nrofSymbols) {
|
||||
i0 = symb*gNB->frame_parms.ofdm_symbol_size;
|
||||
for (int re=0;re<N_RB_DL*12;re++) {
|
||||
i=i0+((gNB->frame_parms.first_carrier_offset + re)%gNB->frame_parms.ofdm_symbol_size);
|
||||
for (int aarx=0;aarx<n_rx;aarx++) {
|
||||
nr = sqrt(sigma2/2)*gaussdouble(0.0,1.0);
|
||||
ni = sqrt(sigma2/2)*gaussdouble(0.0,1.0);
|
||||
((int16_t*)rxdataF[aarx])[i<<1] = (int16_t)(100.0*(nr)/sqrt((double)txlev));
|
||||
((int16_t*)rxdataF[aarx])[1+(i<<1)] = (int16_t)(100.0*(ni)/sqrt((double)txlev));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
random_channel(UE2gNB,0);
|
||||
freq_channel(UE2gNB,N_RB_DL,2*N_RB_DL+1,scs/1000);
|
||||
struct complexd phasor;
|
||||
double rxr_tmp;
|
||||
for (int symb=0; symb<nrofSymbols; symb++) {
|
||||
i0 = (startingSymbolIndex + symb)*gNB->frame_parms.ofdm_symbol_size;
|
||||
for (int re=0;re<N_RB_DL*12;re++) {
|
||||
i=i0+((gNB->frame_parms.first_carrier_offset + re)%gNB->frame_parms.ofdm_symbol_size);
|
||||
phasor.r = cos(2*M_PI*phase*re);
|
||||
phasor.i = sin(2*M_PI*phase*re);
|
||||
for (int aarx=0;aarx<n_rx;aarx++) {
|
||||
txr = (double)(((int16_t *)txdataF[0])[(i<<1)]);
|
||||
txi = (double)(((int16_t *)txdataF[0])[1+(i<<1)]);
|
||||
rxr = txr*UE2gNB->chF[aarx][re].r - txi*UE2gNB->chF[aarx][re].i;
|
||||
rxi = txr*UE2gNB->chF[aarx][re].i + txi*UE2gNB->chF[aarx][re].r;
|
||||
rxr_tmp = rxr*phasor.r - rxi*phasor.i;
|
||||
rxi = rxr*phasor.i + rxi*phasor.r;
|
||||
rxr = rxr_tmp;
|
||||
nr = sqrt(sigma2/2)*gaussdouble(0.0,1.0);
|
||||
ni = sqrt(sigma2/2)*gaussdouble(0.0,1.0);
|
||||
((int16_t*)rxdataF[aarx])[i<<1] = (int16_t)(100.0*(rxr + nr)/sqrt((double)txlev));
|
||||
((int16_t*)rxdataF[aarx])[1+(i<<1)]=(int16_t)(100.0*(rxi + ni)/sqrt((double)txlev));
|
||||
|
||||
if (n_trials==1 && abs(txr) > 0) printf("symb %d, re %d , aarx %d : txr %f, txi %f, chr %f, chi %f, nr %f, ni %f, rxr %f, rxi %f => %d,%d\n",
|
||||
symb, re, aarx, txr,txi,
|
||||
UE2gNB->chF[aarx][re].r,UE2gNB->chF[aarx][re].i,
|
||||
nr,ni, rxr,rxi,
|
||||
((int16_t*)rxdataF[aarx])[i<<1],((int16_t*)rxdataF[aarx])[1+(i<<1)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int rxlev=0;
|
||||
for (int aarx=0;aarx<n_rx;aarx++) rxlev += signal_energy(&rxdataF[aarx][startingSymbolIndex*frame_parms->ofdm_symbol_size],
|
||||
frame_parms->ofdm_symbol_size);
|
||||
|
||||
int rxlev_pucch=0;
|
||||
|
||||
for (int aarx=0;aarx<n_rx;aarx++) rxlev_pucch += signal_energy(&rxdataF[aarx][startingSymbolIndex*frame_parms->ofdm_symbol_size],
|
||||
12);
|
||||
|
||||
// set UL mask for pucch allocation
|
||||
for (int s=0;s<frame_parms->symbols_per_slot;s++){
|
||||
if (s>=startingSymbolIndex && s<(startingSymbolIndex+nrofSymbols))
|
||||
for (int rb=0; rb<N_RB; rb++) {
|
||||
int rb2 = rb+startingPRB;
|
||||
gNB->rb_mask_ul[s][rb2>>5] |= (1<<(rb2&31));
|
||||
}
|
||||
}
|
||||
|
||||
// noise measurement (all PRBs)
|
||||
gNB_I0_measurements(gNB, nr_slot_tx, 0, gNB->frame_parms.symbols_per_slot);
|
||||
|
||||
if (n_trials==1) printf("noise rxlev %d (%d dB), rxlev pucch %d dB sigma2 %f dB, SNR %f, TX %f, I0 (pucch) %d, I0 (avg) %d\n",rxlev,dB_fixed(rxlev),dB_fixed(rxlev_pucch),sigma2_dB,SNR,10*log10((double)txlev*UE->frame_parms.ofdm_symbol_size/12),gNB->measurements.n0_subband_power_tot_dB[startingPRB],gNB->measurements.n0_subband_power_avg_dB);
|
||||
if(format==0){
|
||||
nfapi_nr_uci_pucch_pdu_format_0_1_t uci_pdu;
|
||||
nfapi_nr_pucch_pdu_t pucch_pdu;
|
||||
gNB->uci_stats[0].rnti = 0x1234;
|
||||
pucch_pdu.rnti = 0x1234;
|
||||
pucch_pdu.subcarrier_spacing = 1;
|
||||
pucch_pdu.group_hop_flag = PUCCH_GroupHopping&1;
|
||||
pucch_pdu.sequence_hop_flag = (PUCCH_GroupHopping>>1)&1;
|
||||
@@ -601,18 +650,27 @@ int main(int argc, char **argv)
|
||||
pucch_pdu.start_symbol_index = startingSymbolIndex;
|
||||
pucch_pdu.prb_start = startingPRB;
|
||||
pucch_pdu.bwp_start = 0;
|
||||
pucch_pdu.freq_hop_flag = 0;
|
||||
pucch_pdu.bwp_size = N_RB_DL;
|
||||
if (nrofSymbols>1) {
|
||||
pucch_pdu.freq_hop_flag = 1;
|
||||
pucch_pdu.second_hop_prb = N_RB_DL-1;
|
||||
}
|
||||
else pucch_pdu.freq_hop_flag = 0;
|
||||
|
||||
nr_decode_pucch0(gNB, nr_frame_tx, nr_slot_tx,&uci_pdu,&pucch_pdu);
|
||||
if(sr_flag==1){
|
||||
if (uci_pdu.sr->sr_indication == 0 || uci_pdu.sr->sr_confidence_level == 1)
|
||||
sr_errors+=1;
|
||||
}
|
||||
if(nr_bit>0){
|
||||
if(nr_bit==1)
|
||||
if (nr_bit==1 && do_DTX == 0)
|
||||
ack_nack_errors+=(actual_payload^uci_pdu.harq->harq_list[0].harq_value);
|
||||
else
|
||||
else if (do_DTX == 0)
|
||||
ack_nack_errors+=(((actual_payload&1)^uci_pdu.harq->harq_list[0].harq_value)+((actual_payload>>1)^uci_pdu.harq->harq_list[1].harq_value));
|
||||
free(uci_pdu.harq->harq_list);
|
||||
else if ((uci_pdu.harq->harq_confidence_level == 0 && uci_pdu.harq->harq_list[0].harq_value == 1) ||
|
||||
(uci_pdu.harq->harq_confidence_level == 0 && nr_bit == 2 && uci_pdu.harq->harq_list[1].harq_value==1))
|
||||
ack_nack_errors++;
|
||||
free(uci_pdu.harq->harq_list);
|
||||
}
|
||||
}
|
||||
else if (format==1) {
|
||||
@@ -644,6 +702,11 @@ int main(int argc, char **argv)
|
||||
pucch_pdu.prb_start = startingPRB;
|
||||
pucch_pdu.dmrs_scrambling_id = dmrs_scrambling_id;
|
||||
pucch_pdu.data_scrambling_id = data_scrambling_id;
|
||||
if (nrofSymbols>1) {
|
||||
pucch_pdu.freq_hop_flag = 1;
|
||||
pucch_pdu.second_hop_prb = N_RB_DL-1;
|
||||
}
|
||||
else pucch_pdu.freq_hop_flag = 0;
|
||||
nr_decode_pucch2(gNB,nr_slot_tx,&uci_pdu,&pucch_pdu);
|
||||
int csi_part1_bytes=pucch_pdu.bit_len_csi_part1>>3;
|
||||
if ((pucch_pdu.bit_len_csi_part1&7) > 0) csi_part1_bytes++;
|
||||
@@ -668,13 +731,15 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<2; i++) {
|
||||
free(s_re[i]);
|
||||
free(s_im[i]);
|
||||
free(r_re[i]);
|
||||
free(r_im[i]);
|
||||
free(txdataF[i]);
|
||||
free(rxdataF[i]);
|
||||
for (int aatx=0; aatx<n_tx; aatx++) {
|
||||
free(s_re[aatx]);
|
||||
free(s_im[aatx]);
|
||||
free(txdataF[aatx]);
|
||||
}
|
||||
for (int aarx=0; aarx<n_rx; aarx++) {
|
||||
free(r_re[aarx]);
|
||||
free(r_im[aarx]);
|
||||
free(rxdataF[aarx]);
|
||||
}
|
||||
free(s_re);
|
||||
free(s_im);
|
||||
|
||||
@@ -243,11 +243,6 @@ openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
//const uint8_t nr_rv_round_map[4] = {0, 2, 1, 3};
|
||||
|
||||
channel_desc_t *UE2gNB[NUMBER_OF_UE_MAX][NUMBER_OF_gNB_MAX];
|
||||
double s_re0[122880],s_im0[122880],r_re0[122880],r_im0[122880];
|
||||
double s_re1[122880],s_im1[122880],r_re1[122880],r_im1[122880];
|
||||
double r_re2[122880],r_im2[122880];
|
||||
double r_re3[122880],r_im3[122880];
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
@@ -259,10 +254,7 @@ int main(int argc, char **argv)
|
||||
uint8_t snr1set = 0;
|
||||
int slot = 8, frame = 1;
|
||||
FILE *output_fd = NULL;
|
||||
double *s_re[2]= {s_re0,s_re1};
|
||||
double *s_im[2]= {s_im0,s_im1};
|
||||
double *r_re[4]= {r_re0,r_re1,r_re2,r_re3};
|
||||
double *r_im[4]= {r_im0,r_im1,r_im2,r_im3};
|
||||
double **s_re,**s_im,**r_re,**r_im;
|
||||
//uint8_t write_output_file = 0;
|
||||
int trial, n_trials = 1, n_false_positive = 0, delay = 0;
|
||||
double maxDoppler = 0.0;
|
||||
@@ -298,8 +290,9 @@ int main(int argc, char **argv)
|
||||
cpuf = get_cpu_freq_GHz();
|
||||
int msg3_flag = 0;
|
||||
int rv_index = 0;
|
||||
float roundStats[50];
|
||||
float effRate;
|
||||
float roundStats[100];
|
||||
double effRate[100];
|
||||
double effTP[100];
|
||||
//float eff_tp_check = 0.7;
|
||||
uint8_t snrRun;
|
||||
int prb_inter = 0;
|
||||
@@ -502,7 +495,7 @@ int main(int argc, char **argv)
|
||||
case 'z':
|
||||
n_rx = atoi(optarg);
|
||||
|
||||
if ((n_rx == 0) || (n_rx > 2)) {
|
||||
if ((n_rx == 0) || (n_rx > 8)) {
|
||||
printf("Unsupported number of rx antennas %d\n", n_rx);
|
||||
exit(-1);
|
||||
}
|
||||
@@ -670,7 +663,7 @@ int main(int argc, char **argv)
|
||||
gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
|
||||
gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
|
||||
char tp_param[] = "n";
|
||||
initTpool(tp_param, gNB->threadPool, true);
|
||||
initTpool(tp_param, gNB->threadPool, false);
|
||||
initNotifiedFIFO(gNB->respDecode);
|
||||
//gNB_config = &gNB->gNB_config;
|
||||
|
||||
@@ -682,13 +675,14 @@ int main(int argc, char **argv)
|
||||
gNB->prb_interpolation = prb_inter;
|
||||
frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH)
|
||||
|
||||
|
||||
//frame_parms->nb_antennas_tx = n_tx;
|
||||
//frame_parms->nb_antennas_rx = n_rx;
|
||||
frame_parms->N_RB_DL = N_RB_DL;
|
||||
frame_parms->N_RB_UL = N_RB_UL;
|
||||
frame_parms->Ncp = extended_prefix_flag ? EXTENDED : NORMAL;
|
||||
|
||||
s_re = malloc(n_tx*sizeof(double*));
|
||||
s_im = malloc(n_tx*sizeof(double*));
|
||||
r_re = malloc(n_rx*sizeof(double*));
|
||||
r_im = malloc(n_rx*sizeof(double*));
|
||||
|
||||
RC.nb_nr_macrlc_inst = 1;
|
||||
RC.nb_nr_mac_CC = (int*)malloc(RC.nb_nr_macrlc_inst*sizeof(int));
|
||||
@@ -723,9 +717,15 @@ int main(int argc, char **argv)
|
||||
|
||||
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
|
||||
// common configuration
|
||||
rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, 0, 0, NULL);
|
||||
rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, scc, &rrc.carrier.mib,0, 0, NULL);
|
||||
// UE dedicated configuration
|
||||
rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
|
||||
rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, scc, &rrc.carrier.mib,1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
|
||||
frame_parms->nb_antennas_tx = n_tx;
|
||||
frame_parms->nb_antennas_rx = n_rx;
|
||||
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
|
||||
cfg->carrier_config.num_tx_ant.value = n_tx;
|
||||
cfg->carrier_config.num_rx_ant.value = n_rx;
|
||||
nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,0,0x01);
|
||||
phy_init_nr_gNB(gNB,0,1);
|
||||
N_RB_DL = gNB->frame_parms.N_RB_DL;
|
||||
|
||||
@@ -767,8 +767,16 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
nr_l2_init_ue(NULL);
|
||||
|
||||
//Configure UE
|
||||
NR_UE_RRC_INST_t rrcue;
|
||||
memset(&rrcue,0,sizeof(NR_UE_RRC_INST_t));
|
||||
rrc.carrier.MIB = (uint8_t*) malloc(4);
|
||||
rrc.carrier.sizeof_MIB = do_MIB_NR(&rrc,0);
|
||||
rrcue.mib = rrc.carrier.mib.message.choice.mib;
|
||||
rrcue.scell_group_config=secondaryCellGroup;
|
||||
nr_l2_init_ue(&rrcue);
|
||||
|
||||
NR_UE_MAC_INST_t* UE_mac = get_mac_inst(0);
|
||||
|
||||
UE->if_inst = nr_ue_if_module_init(0);
|
||||
@@ -779,11 +787,7 @@ int main(int argc, char **argv)
|
||||
|
||||
UE_mac->if_module = nr_ue_if_module_init(0);
|
||||
|
||||
//Configure UE
|
||||
rrc.carrier.MIB = (uint8_t*) malloc(4);
|
||||
rrc.carrier.sizeof_MIB = do_MIB_NR(&rrc,0);
|
||||
|
||||
nr_rrc_mac_config_req_ue(0,0,0,rrc.carrier.mib.message.choice.mib, NULL, NULL, secondaryCellGroup);
|
||||
// nr_rrc_mac_config_req_ue(0,0,0,rrc.carrier.mib.message.choice.mib, NULL, NULL, secondaryCellGroup);
|
||||
|
||||
nr_ue_phy_config_request(&UE_mac->phy_config);
|
||||
|
||||
@@ -851,12 +855,13 @@ int main(int argc, char **argv)
|
||||
{
|
||||
add_pos = dmrs_arg[1];
|
||||
}
|
||||
printf("NOTE: DMRS config is modified with Mapping Type %d , Additional Position %d \n", mapping_type, add_pos );
|
||||
}
|
||||
printf("NOTE: DMRS config is modified with Mapping Type %d , Additional Position %d \n", mapping_type, add_pos );
|
||||
|
||||
uint8_t length_dmrs = pusch_len1;
|
||||
uint16_t l_prime_mask = get_l_prime(nb_symb_sch, mapping_type, add_pos, length_dmrs, start_symbol, NR_MIB__dmrs_TypeA_Position_pos2);
|
||||
uint16_t number_dmrs_symbols = get_dmrs_symbols_in_slot(l_prime_mask, nb_symb_sch);
|
||||
printf("num dmrs sym %d\n",number_dmrs_symbols);
|
||||
uint8_t nb_re_dmrs = (dmrs_config_type == pusch_dmrs_type1) ? 6 : 4;
|
||||
|
||||
// if transform precoding is enabled
|
||||
@@ -868,11 +873,11 @@ int main(int argc, char **argv)
|
||||
AssertFatal(index >= 0, "Num RBs not configured according to 3GPP 38.211 section 6.3.1.4. For PUSCH with transform precoding, num RBs cannot be multiple of any other primenumber other than 2,3,5\n");
|
||||
|
||||
dmrs_config_type = pusch_dmrs_type1;
|
||||
nb_re_dmrs = nb_re_dmrs * num_dmrs_cdm_grps_no_data;
|
||||
|
||||
printf("[ULSIM]: TRANSFORM PRECODING ENABLED. Num RBs: %d, index for DMRS_SEQ: %d\n", nb_rb, index);
|
||||
}
|
||||
|
||||
nb_re_dmrs = nb_re_dmrs * num_dmrs_cdm_grps_no_data;
|
||||
|
||||
unsigned int available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, number_dmrs_symbols, mod_order, 1);
|
||||
unsigned int TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs * number_dmrs_symbols, 0, 0, precod_nbr_layers);
|
||||
@@ -914,13 +919,24 @@ int main(int argc, char **argv)
|
||||
printf("NOTE: PTRS Enabled with L %d, K %d \n", ptrs_time_density, ptrs_freq_density );
|
||||
}
|
||||
|
||||
if (input_fd != NULL) max_rounds=1;
|
||||
if (input_fd != NULL || n_trials == 1) max_rounds=1;
|
||||
|
||||
if(1<<ptrs_time_density >= nb_symb_sch)
|
||||
pdu_bit_map &= ~PUSCH_PDU_BITMAP_PUSCH_PTRS; // disable PUSCH PTRS
|
||||
|
||||
printf("\n");
|
||||
|
||||
int frame_length_complex_samples = frame_parms->samples_per_subframe*NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
||||
for (int aatx=0; aatx<n_tx; aatx++) {
|
||||
s_re[aatx] = calloc(1,frame_length_complex_samples*sizeof(double));
|
||||
s_im[aatx] = calloc(1,frame_length_complex_samples*sizeof(double));
|
||||
}
|
||||
|
||||
for (int aarx=0; aarx<n_rx; aarx++) {
|
||||
r_re[aarx] = calloc(1,frame_length_complex_samples*sizeof(double));
|
||||
r_im[aarx] = calloc(1,frame_length_complex_samples*sizeof(double));
|
||||
}
|
||||
|
||||
//for (int i=0;i<16;i++) printf("%f\n",gaussdouble(0.0,1.0));
|
||||
snrRun = 0;
|
||||
int n_errs = 0;
|
||||
@@ -962,7 +978,10 @@ int main(int argc, char **argv)
|
||||
sizeof(int16_t),
|
||||
slot_length<<1,
|
||||
input_fd);
|
||||
if (read_errors==0) exit(1);
|
||||
if (read_errors==0) {
|
||||
printf("error reading file\n");
|
||||
exit(1);
|
||||
}
|
||||
for (int i=0;i<16;i+=2) printf("slot_offset %d : %d,%d\n",
|
||||
slot_offset,
|
||||
((int16_t*)&gNB->common_vars.rxdata[0][slot_offset])[i],
|
||||
@@ -972,14 +991,24 @@ int main(int argc, char **argv)
|
||||
code_rate = nr_get_code_rate_ul(Imcs, mcs_table);
|
||||
}
|
||||
|
||||
uint32_t errors_scrambling[4][100];
|
||||
int n_errors[4][100];
|
||||
int round_trials[4][100];
|
||||
double blerStats[4][100];
|
||||
double berStats[4][100];
|
||||
double snrStats[100];
|
||||
memset(errors_scrambling, 0, sizeof(uint32_t)*4*100);
|
||||
memset(n_errors, 0, sizeof(int)*4*100);
|
||||
memset(round_trials, 0, sizeof(int)*4*100);
|
||||
memset(blerStats, 0, sizeof(double)*4*100);
|
||||
memset(berStats, 0, sizeof(double)*4*100);
|
||||
memset(snrStats, 0, sizeof(double)*100);
|
||||
for (SNR = snr0; SNR < snr1; SNR += snr_step) {
|
||||
varArray_t *table_rx=initVarArray(1000,sizeof(double));
|
||||
int error_flag = 0;
|
||||
n_false_positive = 0;
|
||||
effRate = 0;
|
||||
int n_errors[4] = {0,0,0,0};;
|
||||
int round_trials[4]={0,0,0,0};
|
||||
uint32_t errors_scrambling[4] = {0,0,0,0};
|
||||
effRate[snrRun] = 0;
|
||||
effTP[snrRun] = 0;
|
||||
reset_meas(&gNB->phy_proc_rx);
|
||||
reset_meas(&gNB->rx_pusch_stats);
|
||||
reset_meas(&gNB->ulsch_decoding_stats);
|
||||
@@ -1004,7 +1033,7 @@ int main(int argc, char **argv)
|
||||
errors_decoding = 0;
|
||||
memset((void*)roundStats,0,50*sizeof(roundStats[0]));
|
||||
while (round<max_rounds && crc_status) {
|
||||
round_trials[round]++;
|
||||
round_trials[round][snrRun]++;
|
||||
ulsch_ue[0]->harq_processes[harq_pid]->round = round;
|
||||
gNB->ulsch[0][0]->harq_processes[harq_pid]->round = round;
|
||||
rv_index = nr_rv_round_map[round];
|
||||
@@ -1054,7 +1083,7 @@ int main(int argc, char **argv)
|
||||
pusch_pdu->ul_dmrs_scrambling_id = *scc->physCellId;
|
||||
pusch_pdu->scid = 0;
|
||||
pusch_pdu->dmrs_ports = 1;
|
||||
pusch_pdu->num_dmrs_cdm_grps_no_data = msg3_flag == 0 ? 1 : 2;
|
||||
pusch_pdu->num_dmrs_cdm_grps_no_data = num_dmrs_cdm_grps_no_data;
|
||||
pusch_pdu->resource_alloc = 1;
|
||||
pusch_pdu->rb_start = start_rb;
|
||||
pusch_pdu->rb_size = nb_rb;
|
||||
@@ -1117,7 +1146,7 @@ int main(int argc, char **argv)
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.dmrs_config_type = dmrs_config_type;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.mcs_index = Imcs;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.mcs_table = mcs_table;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.num_dmrs_cdm_grps_no_data = msg3_flag == 0 ? 1 : 2;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.num_dmrs_cdm_grps_no_data = num_dmrs_cdm_grps_no_data;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.nrOfLayers = precod_nbr_layers;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.absolute_delta_PUSCH = 0;
|
||||
|
||||
@@ -1264,6 +1293,58 @@ int main(int argc, char **argv)
|
||||
(nb_symb_sch-1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_M("rxsigF0_comp.m","rxsF0_comp",
|
||||
&gNB->pusch_vars[0]->rxdataF_comp[0][start_symbol*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_M("chmagF0.m","chmF0",
|
||||
&gNB->pusch_vars[0]->ul_ch_mag[0][start_symbol*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_M("chmagbF0.m","chmbF0",
|
||||
&gNB->pusch_vars[0]->ul_ch_magb[0][start_symbol*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
if (n_rx == 2) {
|
||||
LOG_MM("rxsigF0_comp.m","rxsF1_comp",
|
||||
&gNB->pusch_vars[0]->rxdataF_comp[1][start_symbol*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("rxsigF0_ext.m","rxsF1_ext",
|
||||
&gNB->pusch_vars[0]->rxdataF_ext[1][start_symbol*NR_NB_SC_PER_RB * pusch_pdu->rb_size],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("chestF0_ext.m","chF1_ext",
|
||||
&gNB->pusch_vars[0]->ul_ch_estimates_ext[1][(start_symbol+1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],
|
||||
(nb_symb_sch-1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("chmagF0.m","chmF1",
|
||||
&gNB->pusch_vars[0]->ul_ch_mag[1][start_symbol*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("chmagbF0.m","chmbF1",
|
||||
&gNB->pusch_vars[0]->ul_ch_magb[1][start_symbol*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
} else if (n_rx == 4) {
|
||||
LOG_MM("rxsigF0_comp.m","rxsF1_comp",
|
||||
&gNB->pusch_vars[0]->rxdataF_comp[1][start_symbol*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("rxsigF0_comp.m","rxsF2_comp",
|
||||
&gNB->pusch_vars[0]->rxdataF_comp[2][start_symbol*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("rxsigF0_comp.m","rxsF3_comp",
|
||||
&gNB->pusch_vars[0]->rxdataF_comp[3][start_symbol*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("rxsigF0_ext.m","rxsF1_ext",
|
||||
&gNB->pusch_vars[0]->rxdataF_ext[1][start_symbol*NR_NB_SC_PER_RB * pusch_pdu->rb_size],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("rxsigF0_ext.m","rxsF2_ext",
|
||||
&gNB->pusch_vars[0]->rxdataF_ext[2][start_symbol*NR_NB_SC_PER_RB * pusch_pdu->rb_size],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("rxsigF0_ext.m","rxsF3_ext",
|
||||
&gNB->pusch_vars[0]->rxdataF_ext[3][start_symbol*NR_NB_SC_PER_RB * pusch_pdu->rb_size],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("chestF0_ext.m","chF1_ext",
|
||||
&gNB->pusch_vars[0]->ul_ch_estimates_ext[1][(start_symbol+1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],
|
||||
(nb_symb_sch-1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("chestF0_ext.m","chF2_ext",
|
||||
&gNB->pusch_vars[0]->ul_ch_estimates_ext[2][(start_symbol+1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],
|
||||
(nb_symb_sch-1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("chestF0_ext.m","chF3_ext",
|
||||
&gNB->pusch_vars[0]->ul_ch_estimates_ext[3][(start_symbol+1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],
|
||||
(nb_symb_sch-1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("chmagF0.m","chmF1",
|
||||
&gNB->pusch_vars[0]->ul_ch_mag[1][start_symbol*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("chmagF0.m","chmF2",
|
||||
&gNB->pusch_vars[0]->ul_ch_mag[2][start_symbol*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("chmagF0.m","chmF3",
|
||||
&gNB->pusch_vars[0]->ul_ch_mag[3][start_symbol*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("chmagbF0.m","chmbF1",
|
||||
&gNB->pusch_vars[0]->ul_ch_magb[1][start_symbol*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("chmagbF0.m","chmbF2",
|
||||
&gNB->pusch_vars[0]->ul_ch_magb[2][start_symbol*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
LOG_MM("chmagbF0.m","chmbF3",
|
||||
&gNB->pusch_vars[0]->ul_ch_magb[3][start_symbol*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
|
||||
}
|
||||
|
||||
LOG_M("rxsigF0_llr.m","rxsF0_llr",
|
||||
&gNB->pusch_vars[0]->llr[0],(nb_symb_sch-1)*NR_NB_SC_PER_RB * pusch_pdu->rb_size * mod_order,1,0);
|
||||
}
|
||||
@@ -1272,7 +1353,7 @@ int main(int argc, char **argv)
|
||||
if ((gNB->ulsch[0][0]->last_iteration_cnt >=
|
||||
gNB->ulsch[0][0]->max_ldpc_iterations+1) || ul_proc_error == 1) {
|
||||
error_flag = 1;
|
||||
n_errors[round]++;
|
||||
n_errors[round][snrRun]++;
|
||||
crc_status = 1;
|
||||
} else {
|
||||
crc_status = 0;
|
||||
@@ -1300,15 +1381,15 @@ int main(int argc, char **argv)
|
||||
{
|
||||
/*if(errors_scrambling == 0)
|
||||
printf("\x1B[34m" "[frame %d][trial %d]\t1st bit in error in unscrambling = %d\n" "\x1B[0m", frame, trial, i);*/
|
||||
errors_scrambling[round]++;
|
||||
errors_scrambling[round][snrRun]++;
|
||||
}
|
||||
}
|
||||
round++;
|
||||
|
||||
} // round
|
||||
|
||||
if (n_trials == 1 && errors_scrambling[0] > 0) {
|
||||
printf("\x1B[31m""[frame %d][trial %d]\tnumber of errors in unscrambling = %u\n" "\x1B[0m", frame, trial, errors_scrambling[0]);
|
||||
if (n_trials == 1 && errors_scrambling[0][snrRun] > 0) {
|
||||
printf("\x1B[31m""[frame %d][trial %d]\tnumber of errors in unscrambling = %u\n" "\x1B[0m", frame, trial, errors_scrambling[0][snrRun]);
|
||||
}
|
||||
|
||||
for (i = 0; i < TBS; i++) {
|
||||
@@ -1325,8 +1406,8 @@ int main(int argc, char **argv)
|
||||
if (n_trials == 1) {
|
||||
for (int r=0;r<ulsch_ue[0]->harq_processes[harq_pid]->C;r++)
|
||||
for (int i=0;i<ulsch_ue[0]->harq_processes[harq_pid]->K>>3;i++) {
|
||||
/*if ((ulsch_ue[0]->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]) != 0) printf("************");
|
||||
printf("r %d: in[%d] %x, out[%d] %x (%x)\n",r,
|
||||
if ((ulsch_ue[0]->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]) != 0) printf("************");
|
||||
/*printf("r %d: in[%d] %x, out[%d] %x (%x)\n",r,
|
||||
i,ulsch_ue[0]->harq_processes[harq_pid]->c[r][i],
|
||||
i,ulsch_gNB->harq_processes[harq_pid]->c[r][i],
|
||||
ulsch_ue[0]->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]);*/
|
||||
@@ -1338,26 +1419,36 @@ int main(int argc, char **argv)
|
||||
printf("\x1B[31m""[frame %d][trial %d]\tnumber of errors in decoding = %u\n" "\x1B[0m", frame, trial, errors_decoding);
|
||||
}
|
||||
roundStats[snrRun] += ((float)round);
|
||||
if (!crc_status) effRate += ((float)TBS)/round;
|
||||
if (!crc_status) effRate[snrRun] += ((double)TBS)/(double)round;
|
||||
} // trial loop
|
||||
|
||||
roundStats[snrRun]/=((float)n_trials);
|
||||
effRate /= n_trials;
|
||||
effRate[snrRun] /= (double)n_trials;
|
||||
|
||||
printf("*****************************************\n");
|
||||
printf("SNR %f: n_errors (%d/%d,%d/%d,%d/%d,%d/%d) (negative CRC), false_positive %d/%d, errors_scrambling (%u/%u,%u/%u,%u/%u,%u/%u\n", SNR, n_errors[0], round_trials[0],n_errors[1], round_trials[1],n_errors[2], round_trials[2],n_errors[3], round_trials[3], n_false_positive, n_trials, errors_scrambling[0],available_bits*n_trials,errors_scrambling[1],available_bits*n_trials,errors_scrambling[2],available_bits*n_trials,errors_scrambling[3],available_bits*n_trials);
|
||||
printf("SNR %f: n_errors (%d/%d,%d/%d,%d/%d,%d/%d) (negative CRC), false_positive %d/%d, errors_scrambling (%u/%u,%u/%u,%u/%u,%u/%u\n", SNR, n_errors[0][snrRun], round_trials[0][snrRun],n_errors[1][snrRun], round_trials[1][snrRun],n_errors[2][snrRun], round_trials[2][snrRun],n_errors[3][snrRun], round_trials[3][snrRun], n_false_positive, n_trials, errors_scrambling[0][snrRun],available_bits*n_trials,errors_scrambling[1][snrRun],available_bits*n_trials,errors_scrambling[2][snrRun],available_bits*n_trials,errors_scrambling[3][snrRun],available_bits*n_trials);
|
||||
printf("\n");
|
||||
blerStats[0][snrRun] = (double)n_errors[0][snrRun]/round_trials[0][snrRun];
|
||||
blerStats[1][snrRun] = (double)n_errors[1][snrRun]/round_trials[1][snrRun];
|
||||
blerStats[2][snrRun] = (double)n_errors[2][snrRun]/round_trials[2][snrRun];
|
||||
blerStats[3][snrRun] = (double)n_errors[3][snrRun]/round_trials[3][snrRun];
|
||||
|
||||
berStats[0][snrRun] = (double)errors_scrambling[0][snrRun]/available_bits/round_trials[0][snrRun];
|
||||
berStats[1][snrRun] = (double)errors_scrambling[1][snrRun]/available_bits/round_trials[1][snrRun];
|
||||
berStats[2][snrRun] = (double)errors_scrambling[2][snrRun]/available_bits/round_trials[2][snrRun];
|
||||
berStats[3][snrRun] = (double)errors_scrambling[3][snrRun]/available_bits/round_trials[3][snrRun];
|
||||
effTP[snrRun] = effRate[snrRun]/(double)TBS*(double)100;
|
||||
printf("SNR %f: Channel BLER (%e,%e,%e,%e), Channel BER (%e,%e,%e,%e) Avg round %.2f, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %u bits/slot\n",
|
||||
SNR,
|
||||
(double)n_errors[0]/round_trials[0],
|
||||
(double)n_errors[1]/round_trials[0],
|
||||
(double)n_errors[2]/round_trials[0],
|
||||
(double)n_errors[3]/round_trials[0],
|
||||
(double)errors_scrambling[0]/available_bits/round_trials[0],
|
||||
(double)errors_scrambling[1]/available_bits/round_trials[0],
|
||||
(double)errors_scrambling[2]/available_bits/round_trials[0],
|
||||
(double)errors_scrambling[3]/available_bits/round_trials[0],
|
||||
roundStats[snrRun],effRate,effRate/TBS*100,TBS);
|
||||
blerStats[0][snrRun],
|
||||
blerStats[1][snrRun],
|
||||
blerStats[2][snrRun],
|
||||
blerStats[3][snrRun],
|
||||
berStats[0][snrRun],
|
||||
berStats[1][snrRun],
|
||||
berStats[2][snrRun],
|
||||
berStats[3][snrRun],
|
||||
roundStats[snrRun],effRate[snrRun],effTP[snrRun],TBS);
|
||||
|
||||
FILE *fd=fopen("nr_ulsim.log","w");
|
||||
dump_pusch_stats(fd,gNB);
|
||||
@@ -1390,18 +1481,47 @@ int main(int argc, char **argv)
|
||||
if(n_trials==1)
|
||||
break;
|
||||
|
||||
if ((float)n_errors[0]/(float)n_trials <= target_error_rate) {
|
||||
if ((float)n_errors[0][snrRun]/(float)n_trials <= target_error_rate) {
|
||||
printf("*************\n");
|
||||
printf("PUSCH test OK\n");
|
||||
printf("*************\n");
|
||||
break;
|
||||
}
|
||||
|
||||
snrStats[snrRun] = SNR;
|
||||
snrRun++;
|
||||
n_errs = n_errors[0];
|
||||
n_errs = n_errors[0][snrRun];
|
||||
} // SNR loop
|
||||
printf("\n");
|
||||
|
||||
printf( "Num RB:\t%d\n"
|
||||
"Num symbols:\t%d\n"
|
||||
"MCS:\t%d\n"
|
||||
"DMRS config type:\t%d\n"
|
||||
"DMRS add pos:\t%d\n"
|
||||
"PUSCH mapping type:\t%d\n"
|
||||
"DMRS length:\t%d\n"
|
||||
"DMRS CDM gr w/o data:\t%d\n",
|
||||
nb_rb,
|
||||
nb_symb_sch,
|
||||
Imcs,
|
||||
dmrs_config_type,
|
||||
add_pos,
|
||||
mapping_type,
|
||||
length_dmrs,
|
||||
num_dmrs_cdm_grps_no_data);
|
||||
|
||||
LOG_M("ulsimStats.m","SNR",snrStats,snrRun,1,7);
|
||||
LOG_MM("ulsimStats.m","BLER_round0",blerStats[0],snrRun,1,7);
|
||||
LOG_MM("ulsimStats.m","BLER_round1",blerStats[1],snrRun,1,7);
|
||||
LOG_MM("ulsimStats.m","BLER_round2",blerStats[2],snrRun,1,7);
|
||||
LOG_MM("ulsimStats.m","BLER_round3",blerStats[3],snrRun,1,7);
|
||||
LOG_MM("ulsimStats.m","BER_round0",berStats[0],snrRun,1,7);
|
||||
LOG_MM("ulsimStats.m","BER_round1",berStats[1],snrRun,1,7);
|
||||
LOG_MM("ulsimStats.m","BER_round2",berStats[2],snrRun,1,7);
|
||||
LOG_MM("ulsimStats.m","BER_round3",berStats[3],snrRun,1,7);
|
||||
LOG_MM("ulsimStats.m","EffRate",effRate,snrRun,1,7);
|
||||
LOG_MM("ulsimStats.m","EffTP",effTP,snrRun,1,7);
|
||||
free(test_input_bit);
|
||||
free(estimated_output_bit);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ double **cos_lut=NULL,* *sin_lut=NULL;
|
||||
|
||||
|
||||
|
||||
int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) {
|
||||
int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples,int scs) {
|
||||
double delta_f,freq; // 90 kHz spacing
|
||||
double delay;
|
||||
int16_t f;
|
||||
@@ -52,7 +52,7 @@ int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) {
|
||||
|
||||
cos_lut = (double **)malloc(n_samples*sizeof(double *));
|
||||
sin_lut = (double **)malloc(n_samples*sizeof(double *));
|
||||
delta_f = nb_rb*180000/(n_samples-1);
|
||||
delta_f = nb_rb*12*scs*1000/(n_samples-1);
|
||||
|
||||
for (f=-(n_samples>>1); f<=(n_samples>>1); f++) {
|
||||
freq=delta_f*(double)f*1e-6;// due to the fact that delays is in mus
|
||||
@@ -67,14 +67,14 @@ int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) {
|
||||
|
||||
cos_lut[f+(n_samples>>1)][l] = cos(2*M_PI*freq*delay);
|
||||
sin_lut[f+(n_samples>>1)][l] = sin(2*M_PI*freq*delay);
|
||||
//printf("values cos:%d, sin:%d\n", cos_lut[f][l], sin_lut[f][l]);
|
||||
// printf("values cos:%f, sin:%f\n", cos_lut[f+(n_samples>>1)][l], sin_lut[f+(n_samples>>1)][l]);
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
int freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) {
|
||||
int freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples,int scs) {
|
||||
int16_t f,f2,d;
|
||||
uint8_t aarx,aatx,l;
|
||||
double *clut,*slut;
|
||||
@@ -95,14 +95,14 @@ int freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) {
|
||||
// if called with n_samples<12*nb_rb+1, we decimate the lut
|
||||
n_samples_max=12*nb_rb+1;
|
||||
|
||||
if (init_freq_channel(desc,nb_rb,n_samples_max)==0)
|
||||
if (init_freq_channel(desc,nb_rb,n_samples_max,scs)==0)
|
||||
freq_channel_init=1;
|
||||
else
|
||||
return(-1);
|
||||
}
|
||||
|
||||
d=(n_samples_max-1)/(n_samples-1);
|
||||
//printf("no_samples=%d, n_samples_max=%d, d=%d\n",n_samples,n_samples_max,d);
|
||||
// printf("no_samples=%d, n_samples_max=%d, d=%d,nb_taps %d\n",n_samples,n_samples_max,d,desc->nb_taps);
|
||||
start_meas(&desc->interp_freq);
|
||||
|
||||
for (f=-n_samples_max/2,f2=-n_samples/2; f<n_samples_max/2; f+=d,f2++) {
|
||||
@@ -111,6 +111,7 @@ int freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) {
|
||||
|
||||
for (aarx=0; aarx<desc->nb_rx; aarx++) {
|
||||
for (aatx=0; aatx<desc->nb_tx; aatx++) {
|
||||
AssertFatal(n_samples/2+f2 < (2+(275*12)),"reading past chF %d (n_samples %d, f2 %d)\n",n_samples/2+f2,n_samples,f2);
|
||||
desc->chF[aarx+(aatx*desc->nb_rx)][n_samples/2+f2].r=0.0;
|
||||
desc->chF[aarx+(aatx*desc->nb_rx)][n_samples/2+f2].i=0.0;
|
||||
|
||||
|
||||
@@ -519,12 +519,12 @@ void tdlModel(int tdl_paths, double *tdl_delays, double *tdl_amps_dB, double DS
|
||||
chan_desc->ch[i] = (struct complexd *) malloc(chan_desc->channel_length * sizeof(struct complexd));
|
||||
|
||||
for (int i = 0; i<nb_tx*nb_rx; i++)
|
||||
chan_desc->chF[i] = (struct complexd *) malloc(1200 * sizeof(struct complexd));
|
||||
chan_desc->chF[i] = (struct complexd *) malloc((2+(275*12)) * sizeof(struct complexd));
|
||||
|
||||
for (int i = 0; i<chan_desc->nb_taps; i++)
|
||||
chan_desc->a[i] = (struct complexd *) malloc(nb_tx*nb_rx * sizeof(struct complexd));
|
||||
|
||||
chan_desc->R_sqrt = (struct complexd **) malloc(6*sizeof(struct complexd **));
|
||||
chan_desc->R_sqrt = (struct complexd **) malloc(tdl_pathsby3*sizeof(struct complexd **));
|
||||
|
||||
if (nb_tx==2 && nb_rx==2) {
|
||||
for (int i = 0; i<(tdl_pathsby3); i++)
|
||||
@@ -1708,10 +1708,8 @@ void set_channeldesc_name(channel_desc_t *cdesc,char *modelname) {
|
||||
int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) {
|
||||
double s;
|
||||
int i,k,l,aarx,aatx;
|
||||
struct complexd anew[NB_ANTENNAS_TX*NB_ANTENNAS_RX],acorr[NB_ANTENNAS_TX*NB_ANTENNAS_RX];
|
||||
struct complexd anew[desc->nb_tx*desc->nb_rx],acorr[desc->nb_tx*desc->nb_rx];
|
||||
struct complexd phase, alpha, beta;
|
||||
AssertFatal(desc->nb_tx<=NB_ANTENNAS_TX && desc->nb_rx <= NB_ANTENNAS_RX,
|
||||
"random_channel.c: Error: temporary buffer for channel not big enough (%d,%d)\n",desc->nb_tx,desc->nb_rx);
|
||||
start_meas(&desc->random_channel);
|
||||
|
||||
for (i=0; i<(int)desc->nb_taps; i++) {
|
||||
@@ -1735,7 +1733,7 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) {
|
||||
}
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("(%d,%d,%d) %f->(%f,%f) (%f,%f) phase (%f,%f)\n",aarx,aatx,i,desc->amps[i],anew[aarx+(aatx*desc->nb_rx)].x,anew[aarx+(aatx*desc->nb_rx)].y,desc->aoa,desc->ricean_factor,phase.x,phase.y);
|
||||
printf("(%d,%d,%d) %f->(%f,%f) (%f,%f) phase (%f,%f)\n",aarx,aatx,i,desc->amps[i],anew[aarx+(aatx*desc->nb_rx)].r,anew[aarx+(aatx*desc->nb_rx)].i,desc->aoa,desc->ricean_factor,phase.r,phase.i);
|
||||
#endif
|
||||
} //aatx
|
||||
} //aarx
|
||||
@@ -1827,7 +1825,7 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) {
|
||||
} //nb_taps
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("(%d,%d,%d)->(%e,%e)\n",k,aarx,aatx,desc->ch[aarx+(aatx*desc->nb_rx)][k].x,desc->ch[aarx+(aatx*desc->nb_rx)][k].y);
|
||||
printf("(%d,%d,%d)->(%e,%e)\n",k,aarx,aatx,desc->ch[aarx+(aatx*desc->nb_rx)][k].r,desc->ch[aarx+(aatx*desc->nb_rx)][k].i);
|
||||
#endif
|
||||
} //channel_length
|
||||
}
|
||||
|
||||
@@ -477,8 +477,8 @@ int gauss(unsigned int *gauss_LUT,unsigned char Nbits);
|
||||
double gaussdouble(double,double);
|
||||
void randominit(unsigned int seed_init);
|
||||
double uniformrandom(void);
|
||||
int freq_channel(channel_desc_t *desc,uint16_t nb_rb, int16_t n_samples);
|
||||
int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples);
|
||||
int freq_channel(channel_desc_t *desc,uint16_t nb_rb, int16_t n_samples,int scs);
|
||||
int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples,int scs);
|
||||
uint8_t multipath_channel_nosigconv(channel_desc_t *desc);
|
||||
void multipath_tv_channel(channel_desc_t *desc,
|
||||
double **tx_sig_re,
|
||||
|
||||
@@ -369,6 +369,57 @@ typedef enum ngap_Cause_e {
|
||||
|
||||
} ngap_Cause_t;
|
||||
|
||||
typedef enum ngap_Cause_radio_network_e {
|
||||
NGAP_CAUSE_RADIO_NETWORK_UNSPECIFIED,
|
||||
NGAP_CAUSE_RADIO_NETWORK_TXNRELOCOVERALL_EXPIRY,
|
||||
NGAP_CAUSE_RADIO_NETWORK_SUCCESSFUL_HANDOVER,
|
||||
NGAP_CAUSE_RADIO_NETWORK_RELEASE_DUE_TO_NGRAN_GENERATED_REASON,
|
||||
NGAP_CAUSE_RADIO_NETWORK_RELEASE_DUE_TO_5GC_GENERATED_REASON,
|
||||
NGAP_CAUSE_RADIO_NETWORK_HANDOVER_CANCELLED,
|
||||
NGAP_CAUSE_RADIO_NETWORK_PARTIAL_HANDOVER,
|
||||
NGAP_CAUSE_RADIO_NETWORK_HO_FAILURE_IN_TARGET_5GC_NGRAN_NODE_OR_TARGET_SYSTEM,
|
||||
NGAP_CAUSE_RADIO_NETWORK_HO_TARGET_NOT_ALLOWED,
|
||||
NGAP_CAUSE_RADIO_NETWORK_TNGRELOCOVERALL_EXPIRY,
|
||||
NGAP_CAUSE_RADIO_NETWORK_TNGRELOCPREP_EXPIRY,
|
||||
NGAP_CAUSE_RADIO_NETWORK_CELL_NOT_AVAILABLE,
|
||||
NGAP_CAUSE_RADIO_NETWORK_UNKNOWN_TARGETID,
|
||||
NGAP_CAUSE_RADIO_NETWORK_NO_RADIO_RESOURCES_AVAILABLE_IN_TARGET_CELL,
|
||||
NGAP_CAUSE_RADIO_NETWORK_UNKNOWN_LOCAL_UE_NGAP_ID,
|
||||
NGAP_CAUSE_RADIO_NETWORK_INCONSISTENT_REMOTE_UE_NGAP_ID,
|
||||
NGAP_CAUSE_RADIO_NETWORK_HANDOVER_DESIRABLE_FOR_RADIO_REASON,
|
||||
NGAP_CAUSE_RADIO_NETWORK_TIME_CRITICAL_HANDOVER,
|
||||
NGAP_CAUSE_RADIO_NETWORK_RESOURCE_OPTIMISATION_HANDOVER,
|
||||
NGAP_CAUSE_RADIO_NETWORK_REDUCE_LOAD_IN_SERVING_CELL,
|
||||
NGAP_CAUSE_RADIO_NETWORK_USER_INACTIVITY,
|
||||
NGAP_CAUSE_RADIO_NETWORK_RADIO_CONNECTION_WITH_UE_LOST,
|
||||
NGAP_CAUSE_RADIO_NETWORK_RADIO_RESOURCES_NOT_AVAILABLE,
|
||||
NGAP_CAUSE_RADIO_NETWORK_INVALID_QOS_COMBINATION,
|
||||
NGAP_CAUSE_RADIO_NETWORK_FAILURE_IN_RADIO_INTERFACE_PROCEDURE,
|
||||
NGAP_CAUSE_RADIO_NETWORK_INTERACTION_WITH_OTHER_PROCEDURE,
|
||||
NGAP_CAUSE_RADIO_NETWORK_UNKNOWN_PDU_SESSION_ID,
|
||||
NGAP_CAUSE_RADIO_NETWORK_UNKOWN_QOS_FLOW_ID,
|
||||
NGAP_CAUSE_RADIO_NETWORK_MULTIPLE_PDU_SESSION_ID_INSTANCES,
|
||||
NGAP_CAUSE_RADIO_NETWORK_MULTIPLE_QOS_FLOW_ID_INSTANCES,
|
||||
NGAP_CAUSE_RADIO_NETWORK_ENCRYPTION_AND_OR_INTEGRITY_PROTECTION_ALGORITHMS_NOT_SUPPORTED,
|
||||
NGAP_CAUSE_RADIO_NETWORK_NG_INTRA_SYSTEM_HANDOVER_TRIGGERED,
|
||||
NGAP_CAUSE_RADIO_NETWORK_NG_INTER_SYSTEM_HANDOVER_TRIGGERED,
|
||||
NGAP_CAUSE_RADIO_NETWORK_XN_HANDOVER_TRIGGERED,
|
||||
NGAP_CAUSE_RADIO_NETWORK_NOT_SUPPORTED_5QI_VALUE,
|
||||
NGAP_CAUSE_RADIO_NETWORK_UE_CONTEXT_TRANSFER,
|
||||
NGAP_CAUSE_RADIO_NETWORK_IMS_VOICE_EPS_FALLBACK_OR_RAT_FALLBACK_TRIGGERED,
|
||||
NGAP_CAUSE_RADIO_NETWORK_UP_INTEGRITY_PROTECTION_NOT_POSSIBLE,
|
||||
NGAP_CAUSE_RADIO_NETWORK_UP_CONFIDENTIALITY_PROTECTION_NOT_POSSIBLE,
|
||||
NGAP_CAUSE_RADIO_NETWORK_SLICE_NOT_SUPPORTED,
|
||||
NGAP_CAUSE_RADIO_NETWORK_UE_IN_RRC_INACTIVE_STATE_NOT_REACHABLE,
|
||||
NGAP_CAUSE_RADIO_NETWORK_REDIRECTION,
|
||||
NGAP_CAUSE_RADIO_NETWORK_RESOURCES_NOT_AVAILABLE_FOR_THE_SLICE,
|
||||
NGAP_CAUSE_RADIO_NETWORK_UE_MAX_INTEGRITY_PROTECTED_DATA_RATE_REASON,
|
||||
NGAP_CAUSE_RADIO_NETWORK_RELEASE_DUE_TO_CN_DETECTED_MOBILITY,
|
||||
NGAP_CAUSE_RADIO_NETWORK_N26_INTERFACE_NOT_AVAILABLE,
|
||||
NGAP_CAUSE_RADIO_NETWORK_RELEASE_DUE_TO_PRE_EMPTION,
|
||||
NGAP_CAUSE_RADIO_NETWORK_MULTIPLE_LOCATION_REPORTING_REFERENCE_ID_INSTANCES
|
||||
} ngap_Cause_radio_network_t;
|
||||
|
||||
typedef struct pdusession_failed_s {
|
||||
/* Unique pdusession_id for the UE. */
|
||||
uint8_t pdusession_id;
|
||||
|
||||
@@ -414,6 +414,7 @@ typedef struct NRRrcConfigurationReq_s {
|
||||
int sib1_tda;
|
||||
int pdsch_AntennaPorts;
|
||||
int pusch_AntennaPorts;
|
||||
int minRXTXTIMEpdsch;
|
||||
int do_CSIRS;
|
||||
int pusch_TargetSNRx10;
|
||||
int pucch_TargetSNRx10;
|
||||
|
||||
@@ -156,7 +156,7 @@ typedef enum {
|
||||
{CONFIG_STRING_RU_SDR_ADDRS, NULL, 0, strptr:NULL, defstrval:"type=b200", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_SDR_CLK_SRC, NULL, 0, strptr:NULL, defstrval:"internal", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_SDR_TME_SRC, NULL, 0, strptr:NULL, defstrval:"internal", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_SF_EXTENSION, NULL, 0, uptr:NULL, defuintval:312, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_SF_EXTENSION, NULL, 0, uptr:NULL, defuintval:320, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_END_OF_BURST_DELAY, NULL, 0, uptr:NULL, defuintval:400, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_OTA_SYNC_ENABLE, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_BF_WEIGHTS_LIST, NULL, 0, iptr:NULL, defintarrayval:DEFBFW, TYPE_INTARRAY, 0}, \
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
#define MACRLC_ULSCH_MAX_SLOTS_INACTIVITY 17
|
||||
#define MACRLC_PUSCHTARGETSNRX10_IDX 18
|
||||
#define MACRLC_PUCCHTARGETSNRX10_IDX 19
|
||||
#define MACRLC_PUCCHFAILURETHRES_IDX 20
|
||||
#define MACRLC_PUCCHFAILURETHRES_IDX 20
|
||||
#define MACRLC_PUSCHFAILURETHRES_IDX 21
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#endif
|
||||
|
||||
@@ -650,7 +650,12 @@ void RCconfig_nr_macrlc() {
|
||||
RC.nrmac[j]->pucch_target_snrx10 = *(MacRLC_ParamList.paramarray[j][MACRLC_PUCCHTARGETSNRX10_IDX].iptr);
|
||||
RC.nrmac[j]->pucch_failure_thres = *(MacRLC_ParamList.paramarray[j][MACRLC_PUCCHFAILURETHRES_IDX].iptr);
|
||||
RC.nrmac[j]->pusch_failure_thres = *(MacRLC_ParamList.paramarray[j][MACRLC_PUSCHFAILURETHRES_IDX].iptr);
|
||||
|
||||
|
||||
LOG_I(NR_MAC,"PUSCH Target %d, PUCCH Target %d, PUCCH Failure %d, PUSCH Failure %d\n",
|
||||
RC.nrmac[j]->pusch_target_snrx10,
|
||||
RC.nrmac[j]->pucch_target_snrx10,
|
||||
RC.nrmac[j]->pucch_failure_thres,
|
||||
RC.nrmac[j]->pusch_failure_thres);
|
||||
if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_RRC") == 0) {
|
||||
// check number of instances is same as RRC/PDCP
|
||||
|
||||
@@ -707,83 +712,86 @@ void RCconfig_nr_macrlc() {
|
||||
|
||||
void config_security(gNB_RRC_INST *rrc)
|
||||
{
|
||||
paramdef_t logparams_defaults[] = SECURITY_GLOBALPARAMS_DESC;
|
||||
int ret = config_get(logparams_defaults,
|
||||
sizeof(logparams_defaults) / sizeof(paramdef_t),
|
||||
paramdef_t sec_params[] = SECURITY_GLOBALPARAMS_DESC;
|
||||
int ret = config_get(sec_params,
|
||||
sizeof(sec_params) / sizeof(paramdef_t),
|
||||
CONFIG_STRING_SECURITY);
|
||||
int i;
|
||||
|
||||
if (ret < 0) {
|
||||
LOG_W(RRC, "configuration file does not contain a \"security\" section, applying default parameters (no security)\n");
|
||||
LOG_W(RRC, "configuration file does not contain a \"security\" section, applying default parameters (nia2 nea0, integrity disabled for DRBs)\n");
|
||||
rrc->security.ciphering_algorithms[0] = 0; /* nea0 = no ciphering */
|
||||
rrc->security.ciphering_algorithms_count = 1;
|
||||
rrc->security.integrity_algorithms[0] = 0; /* nia0 = no integrity */
|
||||
rrc->security.integrity_algorithms_count = 1;
|
||||
rrc->security.integrity_algorithms[0] = 2; /* nia2 */
|
||||
rrc->security.integrity_algorithms[1] = 0; /* nia0 = no integrity, as a fallback (but nia2 should be supported by all UEs) */
|
||||
rrc->security.integrity_algorithms_count = 2;
|
||||
rrc->security.do_drb_ciphering = 1; /* even if nea0 let's activate so that we don't generate cipheringDisabled in pdcp_Config */
|
||||
rrc->security.do_drb_integrity = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (logparams_defaults[SECURITY_CONFIG_CIPHERING_IDX].numelt > 4) {
|
||||
if (sec_params[SECURITY_CONFIG_CIPHERING_IDX].numelt > 4) {
|
||||
LOG_E(RRC, "too much ciphering algorithms in section \"security\" of the configuration file, maximum is 4\n");
|
||||
exit(1);
|
||||
}
|
||||
if (logparams_defaults[SECURITY_CONFIG_INTEGRITY_IDX].numelt > 4) {
|
||||
if (sec_params[SECURITY_CONFIG_INTEGRITY_IDX].numelt > 4) {
|
||||
LOG_E(RRC, "too much integrity algorithms in section \"security\" of the configuration file, maximum is 4\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* get ciphering algorithms */
|
||||
rrc->security.ciphering_algorithms_count = 0;
|
||||
for (i = 0; i < logparams_defaults[SECURITY_CONFIG_CIPHERING_IDX].numelt; i++) {
|
||||
if (!strcmp(logparams_defaults[SECURITY_CONFIG_CIPHERING_IDX].strlistptr[i], "nea0")) {
|
||||
for (i = 0; i < sec_params[SECURITY_CONFIG_CIPHERING_IDX].numelt; i++) {
|
||||
if (!strcmp(sec_params[SECURITY_CONFIG_CIPHERING_IDX].strlistptr[i], "nea0")) {
|
||||
rrc->security.ciphering_algorithms[rrc->security.ciphering_algorithms_count] = 0;
|
||||
rrc->security.ciphering_algorithms_count++;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(logparams_defaults[SECURITY_CONFIG_CIPHERING_IDX].strlistptr[i], "nea1")) {
|
||||
if (!strcmp(sec_params[SECURITY_CONFIG_CIPHERING_IDX].strlistptr[i], "nea1")) {
|
||||
rrc->security.ciphering_algorithms[rrc->security.ciphering_algorithms_count] = 1;
|
||||
rrc->security.ciphering_algorithms_count++;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(logparams_defaults[SECURITY_CONFIG_CIPHERING_IDX].strlistptr[i], "nea2")) {
|
||||
if (!strcmp(sec_params[SECURITY_CONFIG_CIPHERING_IDX].strlistptr[i], "nea2")) {
|
||||
rrc->security.ciphering_algorithms[rrc->security.ciphering_algorithms_count] = 2;
|
||||
rrc->security.ciphering_algorithms_count++;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(logparams_defaults[SECURITY_CONFIG_CIPHERING_IDX].strlistptr[i], "nea3")) {
|
||||
if (!strcmp(sec_params[SECURITY_CONFIG_CIPHERING_IDX].strlistptr[i], "nea3")) {
|
||||
rrc->security.ciphering_algorithms[rrc->security.ciphering_algorithms_count] = 3;
|
||||
rrc->security.ciphering_algorithms_count++;
|
||||
continue;
|
||||
}
|
||||
LOG_E(RRC, "unknown ciphering algorithm \"%s\" in section \"security\" of the configuration file\n",
|
||||
logparams_defaults[SECURITY_CONFIG_CIPHERING_IDX].strlistptr[i]);
|
||||
sec_params[SECURITY_CONFIG_CIPHERING_IDX].strlistptr[i]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* get integrity algorithms */
|
||||
rrc->security.integrity_algorithms_count = 0;
|
||||
for (i = 0; i < logparams_defaults[SECURITY_CONFIG_INTEGRITY_IDX].numelt; i++) {
|
||||
if (!strcmp(logparams_defaults[SECURITY_CONFIG_INTEGRITY_IDX].strlistptr[i], "nia0")) {
|
||||
for (i = 0; i < sec_params[SECURITY_CONFIG_INTEGRITY_IDX].numelt; i++) {
|
||||
if (!strcmp(sec_params[SECURITY_CONFIG_INTEGRITY_IDX].strlistptr[i], "nia0")) {
|
||||
rrc->security.integrity_algorithms[rrc->security.integrity_algorithms_count] = 0;
|
||||
rrc->security.integrity_algorithms_count++;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(logparams_defaults[SECURITY_CONFIG_INTEGRITY_IDX].strlistptr[i], "nia1")) {
|
||||
if (!strcmp(sec_params[SECURITY_CONFIG_INTEGRITY_IDX].strlistptr[i], "nia1")) {
|
||||
rrc->security.integrity_algorithms[rrc->security.integrity_algorithms_count] = 1;
|
||||
rrc->security.integrity_algorithms_count++;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(logparams_defaults[SECURITY_CONFIG_INTEGRITY_IDX].strlistptr[i], "nia2")) {
|
||||
if (!strcmp(sec_params[SECURITY_CONFIG_INTEGRITY_IDX].strlistptr[i], "nia2")) {
|
||||
rrc->security.integrity_algorithms[rrc->security.integrity_algorithms_count] = 2;
|
||||
rrc->security.integrity_algorithms_count++;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(logparams_defaults[SECURITY_CONFIG_INTEGRITY_IDX].strlistptr[i], "nia3")) {
|
||||
if (!strcmp(sec_params[SECURITY_CONFIG_INTEGRITY_IDX].strlistptr[i], "nia3")) {
|
||||
rrc->security.integrity_algorithms[rrc->security.integrity_algorithms_count] = 3;
|
||||
rrc->security.integrity_algorithms_count++;
|
||||
continue;
|
||||
}
|
||||
LOG_E(RRC, "unknown integrity algorithm \"%s\" in section \"security\" of the configuration file\n",
|
||||
logparams_defaults[SECURITY_CONFIG_INTEGRITY_IDX].strlistptr[i]);
|
||||
sec_params[SECURITY_CONFIG_INTEGRITY_IDX].strlistptr[i]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -794,9 +802,30 @@ void config_security(gNB_RRC_INST *rrc)
|
||||
}
|
||||
|
||||
if (rrc->security.integrity_algorithms_count == 0) {
|
||||
LOG_W(RRC, "no preferred integrity algorithm set in configuration file, applying default parameters (no security)\n");
|
||||
rrc->security.integrity_algorithms[0] = 0; /* nia0 = no integrity */
|
||||
rrc->security.integrity_algorithms_count = 1;
|
||||
LOG_W(RRC, "no preferred integrity algorithm set in configuration file, applying default parameters (nia2)\n");
|
||||
rrc->security.integrity_algorithms[0] = 2; /* nia2 */
|
||||
rrc->security.integrity_algorithms[1] = 0; /* nia0 = no integrity */
|
||||
rrc->security.integrity_algorithms_count = 2;
|
||||
}
|
||||
|
||||
if (!strcmp(*sec_params[SECURITY_CONFIG_DO_DRB_CIPHERING_IDX].strptr, "yes")) {
|
||||
rrc->security.do_drb_ciphering = 1;
|
||||
} else if (!strcmp(*sec_params[SECURITY_CONFIG_DO_DRB_CIPHERING_IDX].strptr, "no")) {
|
||||
rrc->security.do_drb_ciphering = 0;
|
||||
} else {
|
||||
LOG_E(RRC, "in configuration file, bad drb_ciphering value '%s', only 'yes' and 'no' allowed\n",
|
||||
*sec_params[SECURITY_CONFIG_DO_DRB_CIPHERING_IDX].strptr);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!strcmp(*sec_params[SECURITY_CONFIG_DO_DRB_INTEGRITY_IDX].strptr, "yes")) {
|
||||
rrc->security.do_drb_integrity = 1;
|
||||
} else if (!strcmp(*sec_params[SECURITY_CONFIG_DO_DRB_INTEGRITY_IDX].strptr, "no")) {
|
||||
rrc->security.do_drb_integrity = 0;
|
||||
} else {
|
||||
LOG_E(RRC, "in configuration file, bad drb_integrity value '%s', only 'yes' and 'no' allowed\n",
|
||||
*sec_params[SECURITY_CONFIG_DO_DRB_INTEGRITY_IDX].strptr);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1017,6 +1046,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr;
|
||||
printf("pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr;
|
||||
printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr;
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr;
|
||||
printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr;
|
||||
@@ -1899,6 +1930,7 @@ void configure_gnb_du_mac(int inst) {
|
||||
rrc->configuration.pusch_AntennaPorts,
|
||||
rrc->configuration.sib1_tda,
|
||||
rrc->configuration.scc,
|
||||
NULL,
|
||||
0,
|
||||
0, // rnti
|
||||
(NR_CellGroupConfig_t *)NULL
|
||||
|
||||
@@ -119,6 +119,7 @@ typedef enum {
|
||||
#define GNB_CONFIG_STRING_SIB1TDA "sib1_tda"
|
||||
#define GNB_CONFIG_STRING_DOCSIRS "do_CSIRS"
|
||||
#define GNB_CONFIG_STRING_NRCELLID "nr_cellid"
|
||||
#define GNB_CONFIG_STRING_MINRXTXTIMEPDSCH "min_rxtxtime_pdsch"
|
||||
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* cell configuration parameters */
|
||||
@@ -145,6 +146,7 @@ typedef enum {
|
||||
{GNB_CONFIG_STRING_SIB1TDA, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_NRCELLID, NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \
|
||||
{GNB_CONFIG_STRING_MINRXTXTIMEPDSCH, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0} \
|
||||
}
|
||||
|
||||
#define GNB_GNB_ID_IDX 0
|
||||
@@ -167,6 +169,7 @@ typedef enum {
|
||||
#define GNB_SIB1_TDA_IDX 17
|
||||
#define GNB_DO_CSIRS_IDX 18
|
||||
#define GNB_NRCELLID_IDX 19
|
||||
#define GNB_MINRXTXTIMEPDSCH_IDX 20
|
||||
|
||||
#define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD}
|
||||
#define GNBPARAMS_CHECK { \
|
||||
@@ -463,10 +466,12 @@ typedef enum {
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* security configuration */
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define CONFIG_STRING_SECURITY "security"
|
||||
#define CONFIG_STRING_SECURITY "security"
|
||||
|
||||
#define SECURITY_CONFIG_CIPHERING "ciphering_algorithms"
|
||||
#define SECURITY_CONFIG_INTEGRITY "integrity_algorithms"
|
||||
#define SECURITY_CONFIG_CIPHERING "ciphering_algorithms"
|
||||
#define SECURITY_CONFIG_INTEGRITY "integrity_algorithms"
|
||||
#define SECURITY_CONFIG_DO_DRB_CIPHERING "drb_ciphering"
|
||||
#define SECURITY_CONFIG_DO_DRB_INTEGRITY "drb_integrity"
|
||||
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* security configuration */
|
||||
@@ -475,10 +480,15 @@ typedef enum {
|
||||
#define SECURITY_GLOBALPARAMS_DESC { \
|
||||
{SECURITY_CONFIG_CIPHERING, "preferred ciphering algorithms\n", 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST, 0}, \
|
||||
{SECURITY_CONFIG_INTEGRITY, "preferred integrity algorithms\n", 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST, 0}, \
|
||||
{SECURITY_CONFIG_DO_DRB_CIPHERING, "use ciphering for DRBs", 0, strptr:NULL, defstrval:"yes", TYPE_STRING, 0}, \
|
||||
{SECURITY_CONFIG_DO_DRB_INTEGRITY, "use integrity for DRBs", 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
|
||||
}
|
||||
|
||||
#define SECURITY_CONFIG_CIPHERING_IDX 0
|
||||
#define SECURITY_CONFIG_INTEGRITY_IDX 1
|
||||
#define SECURITY_CONFIG_CIPHERING_IDX 0
|
||||
#define SECURITY_CONFIG_INTEGRITY_IDX 1
|
||||
#define SECURITY_CONFIG_DO_DRB_CIPHERING_IDX 2
|
||||
#define SECURITY_CONFIG_DO_DRB_INTEGRITY_IDX 3
|
||||
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -51,7 +51,7 @@ uint32_t nr_compute_tbs(uint16_t Qm,
|
||||
uint32_t Ninfo, Np_info, C;
|
||||
uint8_t n, scale;
|
||||
|
||||
LOG_D(MAC,"nb_symb_sch %d, nb_dmrs_prb %d, nb_rb_oh %d\n",nb_symb_sch,nb_dmrs_prb,nb_rb_oh);
|
||||
LOG_D(NR_MAC,"nb_symb_sch %d, nb_dmrs_prb %d, nb_rb_oh %d\n",nb_symb_sch,nb_dmrs_prb,nb_rb_oh);
|
||||
|
||||
nbp_re = NR_NB_SC_PER_RB * nb_symb_sch - nb_dmrs_prb - nb_rb_oh;
|
||||
nb_re = min(156, nbp_re) * nb_rb;
|
||||
@@ -59,6 +59,7 @@ uint32_t nr_compute_tbs(uint16_t Qm,
|
||||
// Intermediate number of information bits
|
||||
Ninfo = ((nb_re * R * Qm * Nl)>>scale)>>tb_scaling;
|
||||
|
||||
|
||||
if (Ninfo <=3824) {
|
||||
n = max(3, floor(log2(Ninfo)) - 6);
|
||||
Np_info = max(24, (Ninfo>>n)<<n);
|
||||
@@ -85,7 +86,7 @@ uint32_t nr_compute_tbs(uint16_t Qm,
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(PHY, "In %s: Ninfo %d nbp_re %d nb_re %d Qm %d, R %d, tbs %d\n", __FUNCTION__, Ninfo, nbp_re, nb_re, Qm, R, nr_tbs);
|
||||
LOG_D(NR_MAC, "In %s: Ninfo %d nbp_re %d nb_re %d Qm %d, R %d, tbs %d\n", __FUNCTION__, Ninfo, nbp_re, nb_re, Qm, R, nr_tbs);
|
||||
|
||||
return nr_tbs;
|
||||
|
||||
|
||||
@@ -1286,31 +1286,42 @@ int64_t *get_prach_config_info(frequency_range_t freq_range,
|
||||
|
||||
void find_aggregation_candidates(uint8_t *aggregation_level,
|
||||
uint8_t *nr_of_candidates,
|
||||
NR_SearchSpace_t *ss) {
|
||||
|
||||
if (ss->nrofCandidates->aggregationLevel1 != NR_SearchSpace__nrofCandidates__aggregationLevel1_n0) {
|
||||
*aggregation_level = 1;
|
||||
*nr_of_candidates = ss->nrofCandidates->aggregationLevel1;
|
||||
}
|
||||
if (ss->nrofCandidates->aggregationLevel2 != NR_SearchSpace__nrofCandidates__aggregationLevel2_n0) {
|
||||
*aggregation_level = 2;
|
||||
*nr_of_candidates = ss->nrofCandidates->aggregationLevel2;
|
||||
}
|
||||
if (ss->nrofCandidates->aggregationLevel4 != NR_SearchSpace__nrofCandidates__aggregationLevel4_n0) {
|
||||
*aggregation_level = 4;
|
||||
*nr_of_candidates = ss->nrofCandidates->aggregationLevel4;
|
||||
}
|
||||
if (ss->nrofCandidates->aggregationLevel8 != NR_SearchSpace__nrofCandidates__aggregationLevel8_n0) {
|
||||
*aggregation_level = 8;
|
||||
*nr_of_candidates = ss->nrofCandidates->aggregationLevel8;
|
||||
}
|
||||
if (ss->nrofCandidates->aggregationLevel16 != NR_SearchSpace__nrofCandidates__aggregationLevel16_n0) {
|
||||
*aggregation_level = 16;
|
||||
*nr_of_candidates = ss->nrofCandidates->aggregationLevel16;
|
||||
}
|
||||
// n8 does not correspont to a value of 8 but 7, the following corrects this
|
||||
if(*nr_of_candidates == 7)
|
||||
*nr_of_candidates = 8;
|
||||
NR_SearchSpace_t *ss,
|
||||
int L) {
|
||||
AssertFatal(L>=1 && L<=16,"L %d not ok\n",L);
|
||||
*nr_of_candidates = 0;
|
||||
switch(L) {
|
||||
case 1:
|
||||
if (ss->nrofCandidates->aggregationLevel1 != NR_SearchSpace__nrofCandidates__aggregationLevel1_n0) {
|
||||
*aggregation_level = 1;
|
||||
*nr_of_candidates = ss->nrofCandidates->aggregationLevel1;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (ss->nrofCandidates->aggregationLevel2 != NR_SearchSpace__nrofCandidates__aggregationLevel2_n0) {
|
||||
*aggregation_level = 2;
|
||||
*nr_of_candidates = ss->nrofCandidates->aggregationLevel2;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (ss->nrofCandidates->aggregationLevel4 != NR_SearchSpace__nrofCandidates__aggregationLevel4_n0) {
|
||||
*aggregation_level = 4;
|
||||
*nr_of_candidates = ss->nrofCandidates->aggregationLevel4;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
if (ss->nrofCandidates->aggregationLevel8 != NR_SearchSpace__nrofCandidates__aggregationLevel8_n0) {
|
||||
*aggregation_level = 8;
|
||||
*nr_of_candidates = ss->nrofCandidates->aggregationLevel8;
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
if (ss->nrofCandidates->aggregationLevel16 != NR_SearchSpace__nrofCandidates__aggregationLevel16_n0) {
|
||||
*aggregation_level = 16;
|
||||
*nr_of_candidates = ss->nrofCandidates->aggregationLevel16;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1519,7 +1530,7 @@ int get_nr_prach_occasion_info_from_index(uint8_t index,
|
||||
if (table_6_3_3_2_3_prachConfig_Index[index][1] != -1)
|
||||
format2 = (uint8_t) table_6_3_3_2_3_prachConfig_Index[index][1];
|
||||
*format = ((uint8_t) table_6_3_3_2_3_prachConfig_Index[index][0]) | (format2<<8);
|
||||
LOG_I(MAC,"Getting Total PRACH info from index %d (col %lu ) absoluteFrequencyPointA %u mu %u frame_type %u start_symbol %u N_t_slot %u N_dur %u N_RA_sfn = %u\n",
|
||||
LOG_D(NR_MAC,"Getting Total PRACH info from index %d (col %lu ) absoluteFrequencyPointA %u mu %u frame_type %u start_symbol %u N_t_slot %u N_dur %u N_RA_sfn = %u\n",
|
||||
index, table_6_3_3_2_3_prachConfig_Index[index][6],
|
||||
pointa,
|
||||
mu,
|
||||
@@ -2002,7 +2013,7 @@ int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index)
|
||||
|
||||
int32_t delta_duplex = (nr_bandtable[nr_table_idx].ul_min - nr_bandtable[nr_table_idx].dl_min);
|
||||
|
||||
LOG_I(PHY, "NR band duplex spacing is %d KHz (nr_bandtable[%d].band = %d)\n", delta_duplex, nr_table_idx, nr_bandtable[nr_table_idx].band);
|
||||
LOG_I(NR_MAC, "NR band duplex spacing is %d KHz (nr_bandtable[%d].band = %d)\n", delta_duplex, nr_table_idx, nr_bandtable[nr_table_idx].band);
|
||||
|
||||
return delta_duplex;
|
||||
}
|
||||
@@ -2017,7 +2028,7 @@ lte_frame_type_t get_frame_type(uint16_t current_band, uint8_t scs_index)
|
||||
else
|
||||
current_type = FDD;
|
||||
|
||||
LOG_I(MAC, "NR band %d, duplex mode %s, duplex spacing = %d KHz\n", current_band, duplex_mode[current_type], delta_duplex);
|
||||
LOG_I(NR_MAC, "NR band %d, duplex mode %s, duplex spacing = %d KHz\n", current_band, duplex_mode[current_type], delta_duplex);
|
||||
|
||||
return current_type;
|
||||
}
|
||||
@@ -2154,7 +2165,7 @@ uint32_t to_nrarfcn(int nr_bandP,
|
||||
uint32_t nrarfcn;
|
||||
int i = get_nr_table_idx(nr_bandP, scs_index);
|
||||
|
||||
LOG_I(MAC,"Searching for nr band %d DL Carrier frequency %llu bw %u\n",nr_bandP,(long long unsigned int)dl_CarrierFreq,bw);
|
||||
LOG_I(NR_MAC,"Searching for nr band %d DL Carrier frequency %llu bw %u\n",nr_bandP,(long long unsigned int)dl_CarrierFreq,bw);
|
||||
|
||||
AssertFatal(dl_CarrierFreq_by_1k >= nr_bandtable[i].dl_min,
|
||||
"Band %d, bw %u : DL carrier frequency %llu kHz < %llu\n",
|
||||
@@ -2231,14 +2242,14 @@ uint64_t from_nrarfcn(int nr_bandP,
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(MAC, "Frequency from NR-ARFCN for N_OFFs %lu, duplex spacing %d KHz, deltaFglobal %d KHz\n", N_OFFs, delta_duplex, deltaFglobal);
|
||||
LOG_D(NR_MAC, "Frequency from NR-ARFCN for N_OFFs %lu, duplex spacing %d KHz, deltaFglobal %d KHz\n", N_OFFs, delta_duplex, deltaFglobal);
|
||||
|
||||
AssertFatal(nrarfcn >= N_OFFs,"nrarfcn %u < N_OFFs[%d] %llu\n", nrarfcn, nr_bandtable[i].band, (long long unsigned int)N_OFFs);
|
||||
get_delta_arfcn(i, nrarfcn, N_OFFs);
|
||||
|
||||
frequency = 1000*(F_REF_Offs_khz + (nrarfcn - N_REF_Offs) * deltaFglobal);
|
||||
|
||||
LOG_I(MAC, "Computing frequency (pointA %llu => %llu KHz (freq_min %llu KHz, NR band %d N_OFFs %llu))\n",
|
||||
LOG_I(NR_MAC, "Computing frequency (pointA %llu => %llu KHz (freq_min %llu KHz, NR band %d N_OFFs %llu))\n",
|
||||
(unsigned long long)nrarfcn,
|
||||
(unsigned long long)frequency/1000,
|
||||
(unsigned long long)freq_min,
|
||||
@@ -2583,7 +2594,7 @@ int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmr
|
||||
uint8_t row, colomn;
|
||||
int32_t l_prime;
|
||||
|
||||
LOG_D(MAC, "PUSCH: NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d\n", duration_in_symbols, start_symbol, mapping_type, dmrs_typeA_position);
|
||||
LOG_D(NR_MAC, "PUSCH: NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d\n", duration_in_symbols, start_symbol, mapping_type, dmrs_typeA_position);
|
||||
|
||||
// Section 6.4.1.1.3 in Spec 38.211
|
||||
// For PDSCH Mapping TypeA, ld is duration between first OFDM of the slot and last OFDM symbol of the scheduled PUSCH resources
|
||||
@@ -2610,7 +2621,7 @@ int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmr
|
||||
l0 = 1<<l0 | 1<<(l0+1);
|
||||
}
|
||||
|
||||
LOG_D(MAC, "PUSCH - l0:%d, ld:%d,row:%d, column:%d, addpos:%d, maxlen:%d\n", l0, ld, row, colomn, additional_pos, pusch_maxLength);
|
||||
LOG_D(NR_MAC, "PUSCH - l0:%d, ld:%d,row:%d, column:%d, addpos:%d, maxlen:%d\n", l0, ld, row, colomn, additional_pos, pusch_maxLength);
|
||||
AssertFatal(l_prime>=0,"invalid l_prime < 0\n");
|
||||
|
||||
l_prime = (mapping_type == typeA) ? (l_prime | l0) : (l_prime << start_symbol);
|
||||
@@ -2653,7 +2664,7 @@ uint8_t get_L_ptrs(uint8_t mcs1, uint8_t mcs2, uint8_t mcs3, uint8_t I_mcs, uint
|
||||
else if (I_mcs >= mcs3 && I_mcs < mcs4)
|
||||
return 0;
|
||||
else {
|
||||
LOG_I(PHY, "PT-RS time-density determination is obtained from the DCI for the same transport block in the initial transmission\n");
|
||||
LOG_D(NR_MAC, "PT-RS time-density determination is obtained from the DCI for the same transport block in the initial transmission\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -2686,22 +2697,22 @@ uint8_t get_K_ptrs(uint16_t nrb0, uint16_t nrb1, uint16_t N_RB) {
|
||||
// - "UE procedure for applying transform precoding on PUSCH"
|
||||
uint8_t get_transformPrecoding(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
||||
const NR_PUSCH_Config_t *pusch_config,
|
||||
const NR_BWP_Uplink_t *ubwp,
|
||||
const NR_BWP_UplinkDedicated_t *ubwp,
|
||||
uint8_t *dci_format,
|
||||
int rnti_type,
|
||||
uint8_t configuredGrant){
|
||||
|
||||
if (configuredGrant) {
|
||||
if (ubwp->bwp_Dedicated->configuredGrantConfig) {
|
||||
if (ubwp->bwp_Dedicated->configuredGrantConfig->choice.setup->transformPrecoder) {
|
||||
return *ubwp->bwp_Dedicated->configuredGrantConfig->choice.setup->transformPrecoder;
|
||||
if (ubwp->configuredGrantConfig) {
|
||||
if (ubwp->configuredGrantConfig->choice.setup->transformPrecoder) {
|
||||
return *ubwp->configuredGrantConfig->choice.setup->transformPrecoder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rnti_type != NR_RNTI_RA && rnti_type != NR_RNTI_TC) {
|
||||
if (*dci_format != NR_UL_DCI_FORMAT_0_0) {
|
||||
if (pusch_config->transformPrecoder != NULL) {
|
||||
if (pusch_config && pusch_config->transformPrecoder != NULL) {
|
||||
return *pusch_config->transformPrecoder;
|
||||
}
|
||||
}
|
||||
@@ -2718,7 +2729,8 @@ uint8_t get_transformPrecoding(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
||||
return -1;
|
||||
}
|
||||
|
||||
uint16_t nr_dci_size(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
||||
uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
|
||||
const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
||||
const NR_CellGroupConfig_t *cg,
|
||||
dci_pdu_rel15_t *dci_pdu,
|
||||
nr_dci_format_t format,
|
||||
@@ -2732,27 +2744,47 @@ uint16_t nr_dci_size(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
||||
int num_entries = 0;
|
||||
int pusch_antenna_ports = 1; // TODO hardcoded number of antenna ports for pusch
|
||||
|
||||
NR_BWP_Downlink_t *bwp = NULL;
|
||||
NR_BWP_Uplink_t *ubwp = NULL;
|
||||
NR_PDSCH_Config_t *pdsch_config = NULL;
|
||||
NR_PUSCH_Config_t *pusch_Config = NULL;
|
||||
NR_SRS_Config_t *srs_config = NULL;
|
||||
const NR_BWP_DownlinkDedicated_t *bwpd = NULL;
|
||||
const NR_BWP_UplinkDedicated_t *ubwpd = NULL;
|
||||
const NR_BWP_DownlinkCommon_t *bwpc = NULL;
|
||||
const NR_BWP_UplinkCommon_t *ubwpc = NULL;
|
||||
const NR_PDSCH_Config_t *pdsch_Config = NULL;
|
||||
const NR_PUSCH_Config_t *pusch_Config = NULL;
|
||||
const NR_PUCCH_Config_t *pucch_Config = NULL;
|
||||
const NR_PDCCH_Config_t *pdcch_Config = NULL;
|
||||
const NR_SRS_Config_t *srs_config = NULL;
|
||||
if(bwp_id > 0) {
|
||||
AssertFatal(cg!=NULL,"Cellgroup is null and bwp_id!=0");
|
||||
bwp=cg->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id-1];
|
||||
ubwp=cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[bwp_id-1];
|
||||
pdsch_config = bwp->bwp_Dedicated->pdsch_Config->choice.setup;
|
||||
pusch_Config = ubwp->bwp_Dedicated->pusch_Config->choice.setup;
|
||||
srs_config = ubwp->bwp_Dedicated->srs_Config->choice.setup;
|
||||
bwpd=cg->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id-1]->bwp_Dedicated;
|
||||
bwpc=cg->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id-1]->bwp_Common;
|
||||
ubwpd=cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[bwp_id-1]->bwp_Dedicated;
|
||||
ubwpc=cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[bwp_id-1]->bwp_Common;
|
||||
pdsch_Config = (bwpd->pdsch_Config) ? bwpd->pdsch_Config->choice.setup : NULL;
|
||||
pdcch_Config = (bwpd->pdcch_Config) ? bwpd->pdcch_Config->choice.setup : NULL;
|
||||
pucch_Config = (ubwpd->pucch_Config) ? ubwpd->pucch_Config->choice.setup : NULL;
|
||||
pusch_Config = (ubwpd->pusch_Config) ? ubwpd->pusch_Config->choice.setup : NULL;
|
||||
srs_config = (ubwpd->srs_Config) ? ubwpd->srs_Config->choice.setup : NULL;
|
||||
}
|
||||
else if (cg){
|
||||
bwpd=cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP;
|
||||
bwpc=initialDownlinkBWP;
|
||||
ubwpd=cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP;
|
||||
ubwpc=initialUplinkBWP;
|
||||
pdsch_Config = (bwpd->pdsch_Config) ? bwpd->pdsch_Config->choice.setup : NULL;
|
||||
pdcch_Config = (bwpd->pdcch_Config) ? bwpd->pdcch_Config->choice.setup : NULL;
|
||||
pucch_Config = (ubwpd->pucch_Config) ? ubwpd->pucch_Config->choice.setup : NULL;
|
||||
pusch_Config = (ubwpd->pusch_Config) ? ubwpd->pusch_Config->choice.setup : NULL;
|
||||
srs_config = (ubwpd->srs_Config) ? ubwpd->srs_Config->choice.setup: NULL;
|
||||
}
|
||||
|
||||
int n_ul_bwp=1,n_dl_bwp=1;
|
||||
switch(format) {
|
||||
/*Only sizes for 0_0 and 1_0 are correct at the moment*/
|
||||
case NR_UL_DCI_FORMAT_0_0:
|
||||
/// fixed: Format identifier 1, Hop flag 1, MCS 5, NDI 1, RV 2, HARQ PID 4, PUSCH TPC 2 Time Domain assgnmt 4 --20
|
||||
size += 20;
|
||||
size += (uint8_t)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); // Freq domain assignment -- hopping scenario to be updated
|
||||
size += nr_dci_size(initialUplinkBWP,cg,dci_pdu,NR_DL_DCI_FORMAT_1_0, rnti_type, N_RB, bwp_id) - size; // Padding to match 1_0 size
|
||||
size += nr_dci_size(initialDownlinkBWP,initialUplinkBWP,cg,dci_pdu,NR_DL_DCI_FORMAT_1_0, rnti_type, N_RB, bwp_id) - size; // Padding to match 1_0 size
|
||||
// UL/SUL indicator assumed to be 0
|
||||
break;
|
||||
|
||||
@@ -2770,56 +2802,71 @@ uint16_t nr_dci_size(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
||||
size += dci_pdu->ul_sul_indicator.nbits;
|
||||
}
|
||||
// BWP Indicator
|
||||
uint8_t n_ul_bwp = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count;
|
||||
n_ul_bwp = 0;
|
||||
if (cg->spCellConfig->spCellConfigDedicated->uplinkConfig &&
|
||||
cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList)
|
||||
n_ul_bwp = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count;
|
||||
if (n_ul_bwp < 2)
|
||||
dci_pdu->bwp_indicator.nbits = n_ul_bwp;
|
||||
else
|
||||
dci_pdu->bwp_indicator.nbits = 2;
|
||||
size += dci_pdu->bwp_indicator.nbits;
|
||||
// Freq domain assignment
|
||||
if (cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pusch_Config->choice.setup->rbg_Size != NULL)
|
||||
rbg_size_config = 1;
|
||||
else
|
||||
rbg_size_config = 0;
|
||||
numRBG = getNRBG(NRRIV2BW(ubwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE),
|
||||
NRRIV2PRBOFFSET(ubwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE),
|
||||
rbg_size_config);
|
||||
if (pusch_Config->resourceAllocation == 0)
|
||||
dci_pdu->frequency_domain_assignment.nbits = numRBG;
|
||||
else if (pusch_Config->resourceAllocation == 1)
|
||||
dci_pdu->frequency_domain_assignment.nbits = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) );
|
||||
else
|
||||
dci_pdu->frequency_domain_assignment.nbits = ((int)ceil( log2( (N_RB*(N_RB+1))>>1 ) )>numRBG) ? (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) )+1 : numRBG+1;
|
||||
if (pusch_Config) {
|
||||
if (pusch_Config->rbg_Size != NULL)
|
||||
rbg_size_config = 1;
|
||||
else
|
||||
rbg_size_config = 0;
|
||||
numRBG = getNRBG(NRRIV2BW(ubwpc->genericParameters.locationAndBandwidth, MAX_BWP_SIZE),
|
||||
NRRIV2PRBOFFSET(ubwpc->genericParameters.locationAndBandwidth, MAX_BWP_SIZE),
|
||||
rbg_size_config);
|
||||
if (pusch_Config->resourceAllocation == 0)
|
||||
dci_pdu->frequency_domain_assignment.nbits = numRBG;
|
||||
else if (pusch_Config->resourceAllocation == 1)
|
||||
dci_pdu->frequency_domain_assignment.nbits = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) );
|
||||
else
|
||||
dci_pdu->frequency_domain_assignment.nbits = ((int)ceil( log2( (N_RB*(N_RB+1))>>1 ) )>numRBG) ? (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) )+1 : numRBG+1;
|
||||
}
|
||||
else dci_pdu->frequency_domain_assignment.nbits = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) );
|
||||
LOG_D(NR_MAC,"PUSCH Frequency Domain Assignment nbits %d, N_RB %d\n",dci_pdu->frequency_domain_assignment.nbits,N_RB);
|
||||
size += dci_pdu->frequency_domain_assignment.nbits;
|
||||
// Time domain assignment
|
||||
if (pusch_Config->pusch_TimeDomainAllocationList==NULL) {
|
||||
if (ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList==NULL)
|
||||
if (pusch_Config==NULL || pusch_Config->pusch_TimeDomainAllocationList==NULL) {
|
||||
if (ubwpc->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList==NULL)
|
||||
num_entries = 16; // num of entries in default table
|
||||
else
|
||||
num_entries = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.count;
|
||||
num_entries = ubwpc->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.count;
|
||||
}
|
||||
else
|
||||
num_entries = pusch_Config->pusch_TimeDomainAllocationList->choice.setup->list.count;
|
||||
dci_pdu->time_domain_assignment.nbits = (int)ceil(log2(num_entries));
|
||||
LOG_D(NR_MAC,"PUSCH Time Domain Allocation nbits %d, pusch_Config %p\n",dci_pdu->time_domain_assignment.nbits,pusch_Config);
|
||||
size += dci_pdu->time_domain_assignment.nbits;
|
||||
// Frequency Hopping flag
|
||||
if ((pusch_Config->frequencyHopping!=NULL) && (pusch_Config->resourceAllocation != NR_PUSCH_Config__resourceAllocation_resourceAllocationType0)) {
|
||||
if (pusch_Config &&
|
||||
pusch_Config->frequencyHopping!=NULL &&
|
||||
pusch_Config->resourceAllocation != NR_PUSCH_Config__resourceAllocation_resourceAllocationType0) {
|
||||
dci_pdu->frequency_hopping_flag.nbits = 1;
|
||||
size += 1;
|
||||
}
|
||||
// 1st DAI
|
||||
if (cg->physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook==NR_PhysicalCellGroupConfig__pdsch_HARQ_ACK_Codebook_dynamic)
|
||||
if (cg->physicalCellGroupConfig &&
|
||||
cg->physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook==NR_PhysicalCellGroupConfig__pdsch_HARQ_ACK_Codebook_dynamic)
|
||||
dci_pdu->dai[0].nbits = 2;
|
||||
else
|
||||
dci_pdu->dai[0].nbits = 1;
|
||||
size += dci_pdu->dai[0].nbits;
|
||||
LOG_D(NR_MAC,"DAI1 nbits %d\n",dci_pdu->dai[0].nbits);
|
||||
// 2nd DAI
|
||||
if (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL) { //TODO not sure about that
|
||||
if (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig &&
|
||||
cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL) { //TODO not sure about that
|
||||
dci_pdu->dai[1].nbits = 2;
|
||||
size += dci_pdu->dai[1].nbits;
|
||||
}
|
||||
// SRS resource indicator
|
||||
if (pusch_Config->txConfig != NULL){
|
||||
if (srs_config &&
|
||||
pusch_Config &&
|
||||
pusch_Config->txConfig != NULL){
|
||||
int count=0;
|
||||
if (*pusch_Config->txConfig == NR_PUSCH_Config__txConfig_codebook){
|
||||
for (int i=0; i<srs_config->srs_ResourceSetToAddModList->list.count; i++) {
|
||||
@@ -2834,7 +2881,8 @@ uint16_t nr_dci_size(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
||||
else {
|
||||
int lmin,Lmax = 0;
|
||||
int lsum = 0;
|
||||
if ( cg->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig != NULL) {
|
||||
if ( cg->spCellConfig->spCellConfigDedicated->uplinkConfig &&
|
||||
cg->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig != NULL) {
|
||||
if ( cg->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers != NULL)
|
||||
Lmax = *cg->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers;
|
||||
else
|
||||
@@ -2854,11 +2902,13 @@ uint16_t nr_dci_size(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
||||
dci_pdu->srs_resource_indicator.nbits = (int)ceil(log2(lsum));
|
||||
size += dci_pdu->srs_resource_indicator.nbits;
|
||||
}
|
||||
}
|
||||
} else dci_pdu->srs_resource_indicator.nbits = 0;
|
||||
LOG_D(NR_MAC,"dci_pdu->srs_resource_indicator.nbits %d\n",dci_pdu->srs_resource_indicator.nbits);
|
||||
// Precoding info and number of layers
|
||||
long transformPrecoder = get_transformPrecoding(initialUplinkBWP, pusch_Config, ubwp, (uint8_t*)&format, rnti_type, 0);
|
||||
|
||||
if (pusch_Config->txConfig != NULL){
|
||||
long transformPrecoder = get_transformPrecoding(initialUplinkBWP, pusch_Config, ubwpd, (uint8_t*)&format, rnti_type, 0);
|
||||
dci_pdu->precoding_information.nbits=0;
|
||||
if (pusch_Config &&
|
||||
pusch_Config->txConfig != NULL){
|
||||
if (*pusch_Config->txConfig == NR_PUSCH_Config__txConfig_codebook){
|
||||
if (pusch_antenna_ports > 1) {
|
||||
if (pusch_antenna_ports == 4) {
|
||||
@@ -2882,15 +2932,18 @@ uint16_t nr_dci_size(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
||||
}
|
||||
}
|
||||
size += dci_pdu->precoding_information.nbits;
|
||||
LOG_D(NR_MAC,"dci_pdu->precoding_informaiton.nbits=%d\n",dci_pdu->precoding_information.nbits);
|
||||
// Antenna ports
|
||||
NR_DMRS_UplinkConfig_t *NR_DMRS_UplinkConfig = NULL;
|
||||
int xa=0;
|
||||
int xb=0;
|
||||
if(pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA != NULL){
|
||||
if(pusch_Config &&
|
||||
pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA != NULL){
|
||||
NR_DMRS_UplinkConfig = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup;
|
||||
xa = ul_ant_bits(NR_DMRS_UplinkConfig,transformPrecoder);
|
||||
}
|
||||
if(pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB != NULL){
|
||||
if(pusch_Config &&
|
||||
pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB != NULL){
|
||||
NR_DMRS_UplinkConfig = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup;
|
||||
xb = ul_ant_bits(NR_DMRS_UplinkConfig,transformPrecoder);
|
||||
}
|
||||
@@ -2899,6 +2952,7 @@ uint16_t nr_dci_size(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
||||
else
|
||||
dci_pdu->antenna_ports.nbits = xb;
|
||||
size += dci_pdu->antenna_ports.nbits;
|
||||
LOG_D(NR_MAC,"dci_pdu->antenna_ports.nbits = %d\n",dci_pdu->antenna_ports.nbits);
|
||||
// SRS request
|
||||
if (cg->spCellConfig->spCellConfigDedicated->supplementaryUplink==NULL)
|
||||
dci_pdu->srs_request.nbits = 2;
|
||||
@@ -2913,20 +2967,26 @@ uint16_t nr_dci_size(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
||||
}
|
||||
}
|
||||
// CBGTI
|
||||
if (cg->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL) {
|
||||
if (cg->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig &&
|
||||
cg->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL) {
|
||||
int num = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->codeBlockGroupTransmission->choice.setup->maxCodeBlockGroupsPerTransportBlock;
|
||||
dci_pdu->cbgti.nbits = 2 + (num<<1);
|
||||
size += dci_pdu->cbgti.nbits;
|
||||
}
|
||||
// PTRS - DMRS association
|
||||
if ( (NR_DMRS_UplinkConfig->phaseTrackingRS == NULL && transformPrecoder == NR_PUSCH_Config__transformPrecoder_disabled) ||
|
||||
transformPrecoder == NR_PUSCH_Config__transformPrecoder_enabled || (*pusch_Config->maxRank==1) )
|
||||
if ( (NR_DMRS_UplinkConfig &&
|
||||
NR_DMRS_UplinkConfig->phaseTrackingRS == NULL &&
|
||||
transformPrecoder == NR_PUSCH_Config__transformPrecoder_disabled) ||
|
||||
transformPrecoder == NR_PUSCH_Config__transformPrecoder_enabled ||
|
||||
(pusch_Config && pusch_Config->maxRank &&
|
||||
*pusch_Config->maxRank==1) )
|
||||
dci_pdu->ptrs_dmrs_association.nbits = 0;
|
||||
else
|
||||
dci_pdu->ptrs_dmrs_association.nbits = 2;
|
||||
size += dci_pdu->ptrs_dmrs_association.nbits;
|
||||
// beta offset indicator
|
||||
if (pusch_Config->uci_OnPUSCH!=NULL){
|
||||
if (pusch_Config &&
|
||||
pusch_Config->uci_OnPUSCH!=NULL){
|
||||
if (pusch_Config->uci_OnPUSCH->choice.setup->betaOffsets->present == NR_UCI_OnPUSCH__betaOffsets_PR_dynamic) {
|
||||
dci_pdu->beta_offset_indicator.nbits = 2;
|
||||
size += dci_pdu->beta_offset_indicator.nbits;
|
||||
@@ -2950,6 +3010,7 @@ uint16_t nr_dci_size(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
||||
break;
|
||||
|
||||
case NR_DL_DCI_FORMAT_1_1:
|
||||
LOG_D(NR_MAC,"DCI_FORMAT 1_1 : pdsch_Config %p, pucch_Config %p\n",pdsch_Config,pucch_Config);
|
||||
// General note: 0 bits condition is ignored as default nbits is 0.
|
||||
// Format identifier
|
||||
size = 1;
|
||||
@@ -2958,89 +3019,105 @@ uint16_t nr_dci_size(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
||||
dci_pdu->carrier_indicator.nbits=3;
|
||||
size += dci_pdu->carrier_indicator.nbits;
|
||||
}
|
||||
|
||||
// BWP Indicator
|
||||
uint8_t n_dl_bwp = cg->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count;
|
||||
n_dl_bwp = 0;
|
||||
if (cg->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList)
|
||||
n_dl_bwp = cg->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count;
|
||||
if (n_dl_bwp < 2)
|
||||
dci_pdu->bwp_indicator.nbits = n_dl_bwp;
|
||||
else
|
||||
dci_pdu->bwp_indicator.nbits = 2;
|
||||
size += dci_pdu->bwp_indicator.nbits;
|
||||
// Freq domain assignment
|
||||
rbg_size_config = cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->rbg_Size;
|
||||
numRBG = getNRBG(NRRIV2BW(bwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE),
|
||||
NRRIV2PRBOFFSET(bwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE),
|
||||
if (pdsch_Config) rbg_size_config = pdsch_Config->rbg_Size;
|
||||
else rbg_size_config = 0;
|
||||
|
||||
numRBG = getNRBG(NRRIV2BW(bwpc->genericParameters.locationAndBandwidth, MAX_BWP_SIZE),
|
||||
NRRIV2PRBOFFSET(bwpc->genericParameters.locationAndBandwidth, MAX_BWP_SIZE),
|
||||
rbg_size_config);
|
||||
if (pdsch_config->resourceAllocation == 0)
|
||||
dci_pdu->frequency_domain_assignment.nbits = numRBG;
|
||||
else if (pdsch_config->resourceAllocation == 1)
|
||||
dci_pdu->frequency_domain_assignment.nbits = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) );
|
||||
if (pdsch_Config && pdsch_Config->resourceAllocation == 0)
|
||||
dci_pdu->frequency_domain_assignment.nbits = numRBG;
|
||||
else if (pdsch_Config == NULL || pdsch_Config->resourceAllocation == 1)
|
||||
dci_pdu->frequency_domain_assignment.nbits = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) );
|
||||
else
|
||||
dci_pdu->frequency_domain_assignment.nbits = ((int)ceil( log2( (N_RB*(N_RB+1))>>1 ) )>numRBG) ? (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) )+1 : numRBG+1;
|
||||
dci_pdu->frequency_domain_assignment.nbits = ((int)ceil( log2( (N_RB*(N_RB+1))>>1 ) )>numRBG) ? (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) )+1 : numRBG+1;
|
||||
size += dci_pdu->frequency_domain_assignment.nbits;
|
||||
LOG_D(NR_MAC,"dci_pdu->frequency_domain_assignment.nbits %d (N_RB %d)\n",dci_pdu->frequency_domain_assignment.nbits,N_RB);
|
||||
// Time domain assignment (see table 5.1.2.1.1-1 in 38.214
|
||||
if (pdsch_config->pdsch_TimeDomainAllocationList==NULL) {
|
||||
if (bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList==NULL)
|
||||
if (pdsch_Config == NULL || pdsch_Config->pdsch_TimeDomainAllocationList==NULL) {
|
||||
if (bwpc->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList==NULL)
|
||||
num_entries = 16; // num of entries in default table
|
||||
else
|
||||
num_entries = bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count;
|
||||
num_entries = bwpc->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count;
|
||||
}
|
||||
else
|
||||
num_entries = pdsch_config->pdsch_TimeDomainAllocationList->choice.setup->list.count;
|
||||
num_entries = pdsch_Config->pdsch_TimeDomainAllocationList->choice.setup->list.count;
|
||||
dci_pdu->time_domain_assignment.nbits = (int)ceil(log2(num_entries));
|
||||
LOG_D(NR_MAC,"pdsch tda.nbits= %d\n",dci_pdu->time_domain_assignment.nbits);
|
||||
size += dci_pdu->time_domain_assignment.nbits;
|
||||
// VRB to PRB mapping
|
||||
if ((pdsch_config->resourceAllocation == 1) && (bwp->bwp_Dedicated->pdsch_Config->choice.setup->vrb_ToPRB_Interleaver != NULL)) {
|
||||
if (pdsch_Config &&
|
||||
pdsch_Config->resourceAllocation == 1 &&
|
||||
pdsch_Config->vrb_ToPRB_Interleaver != NULL) {
|
||||
dci_pdu->vrb_to_prb_mapping.nbits = 1;
|
||||
size += dci_pdu->vrb_to_prb_mapping.nbits;
|
||||
}
|
||||
// PRB bundling size indicator
|
||||
if (pdsch_config->prb_BundlingType.present == NR_PDSCH_Config__prb_BundlingType_PR_dynamicBundling) {
|
||||
if (pdsch_Config &&
|
||||
pdsch_Config->prb_BundlingType.present == NR_PDSCH_Config__prb_BundlingType_PR_dynamicBundling) {
|
||||
dci_pdu->prb_bundling_size_indicator.nbits = 1;
|
||||
size += dci_pdu->prb_bundling_size_indicator.nbits;
|
||||
}
|
||||
// Rate matching indicator
|
||||
NR_RateMatchPatternGroup_t *group1 = pdsch_config->rateMatchPatternGroup1;
|
||||
NR_RateMatchPatternGroup_t *group2 = pdsch_config->rateMatchPatternGroup2;
|
||||
NR_RateMatchPatternGroup_t *group1 = pdsch_Config ? pdsch_Config->rateMatchPatternGroup1 : NULL;
|
||||
NR_RateMatchPatternGroup_t *group2 = pdsch_Config ? pdsch_Config->rateMatchPatternGroup2 : NULL;
|
||||
if ((group1 != NULL) && (group2 != NULL))
|
||||
dci_pdu->rate_matching_indicator.nbits = 2;
|
||||
if ((group1 != NULL) != (group2 != NULL))
|
||||
dci_pdu->rate_matching_indicator.nbits = 1;
|
||||
size += dci_pdu->rate_matching_indicator.nbits;
|
||||
// ZP CSI-RS trigger
|
||||
if (pdsch_config->aperiodic_ZP_CSI_RS_ResourceSetsToAddModList != NULL) {
|
||||
uint8_t nZP = pdsch_config->aperiodic_ZP_CSI_RS_ResourceSetsToAddModList->list.count;
|
||||
if (pdsch_Config &&
|
||||
pdsch_Config->aperiodic_ZP_CSI_RS_ResourceSetsToAddModList != NULL) {
|
||||
uint8_t nZP = pdsch_Config->aperiodic_ZP_CSI_RS_ResourceSetsToAddModList->list.count;
|
||||
dci_pdu->zp_csi_rs_trigger.nbits = (int)ceil(log2(nZP+1));
|
||||
}
|
||||
size += dci_pdu->zp_csi_rs_trigger.nbits;
|
||||
// TB1- MCS 5, NDI 1, RV 2
|
||||
size += 8;
|
||||
// TB2
|
||||
long *maxCWperDCI = pdsch_config->maxNrofCodeWordsScheduledByDCI;
|
||||
long *maxCWperDCI = pdsch_Config ? pdsch_Config->maxNrofCodeWordsScheduledByDCI : NULL;
|
||||
if ((maxCWperDCI != NULL) && (*maxCWperDCI == 2)) {
|
||||
size += 8;
|
||||
}
|
||||
// HARQ PID
|
||||
size += 4;
|
||||
// DAI
|
||||
if (cg->physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook == NR_PhysicalCellGroupConfig__pdsch_HARQ_ACK_Codebook_dynamic) { // FIXME in case of more than one serving cell
|
||||
if (cg->physicalCellGroupConfig &&
|
||||
cg->physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook == NR_PhysicalCellGroupConfig__pdsch_HARQ_ACK_Codebook_dynamic) { // FIXME in case of more than one serving cell
|
||||
dci_pdu->dai[0].nbits = 2;
|
||||
size += dci_pdu->dai[0].nbits;
|
||||
}
|
||||
LOG_D(NR_MAC,"dci_pdu->dai[0].nbits %d\n",dci_pdu->dai[0].nbits);
|
||||
// TPC PUCCH
|
||||
size += 2;
|
||||
// PUCCH resource indicator
|
||||
size += 3;
|
||||
// PDSCH to HARQ timing indicator
|
||||
uint8_t I = ubwp->bwp_Dedicated->pucch_Config->choice.setup->dl_DataToUL_ACK->list.count;
|
||||
uint8_t I = pucch_Config->dl_DataToUL_ACK ? pucch_Config->dl_DataToUL_ACK->list.count : 8;
|
||||
dci_pdu->pdsch_to_harq_feedback_timing_indicator.nbits = (int)ceil(log2(I));
|
||||
size += dci_pdu->pdsch_to_harq_feedback_timing_indicator.nbits;
|
||||
LOG_D(NR_MAC,"dci_pdu->pdsch_to_harq_feedback_timing_indicator.nbits %d\n",dci_pdu->pdsch_to_harq_feedback_timing_indicator.nbits);
|
||||
// Antenna ports
|
||||
NR_SetupRelease_DMRS_DownlinkConfig_t *typeA = pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA;
|
||||
NR_SetupRelease_DMRS_DownlinkConfig_t *typeB = pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeB;
|
||||
NR_SetupRelease_DMRS_DownlinkConfig_t *typeA = pdsch_Config ? pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA : NULL;
|
||||
NR_SetupRelease_DMRS_DownlinkConfig_t *typeB = pdsch_Config ? pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB : NULL;
|
||||
AssertFatal(typeA!=NULL || typeB!=NULL, "either dmrs_typeA or typeB must be configured\n");
|
||||
dci_pdu->antenna_ports.nbits = getAntPortBitWidth(typeA,typeB);
|
||||
size += dci_pdu->antenna_ports.nbits;
|
||||
LOG_D(NR_MAC,"dci_pdu->antenna_ports.nbits %d\n",dci_pdu->antenna_ports.nbits);
|
||||
// Tx Config Indication
|
||||
long *isTciEnable = bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list.array[bwp_id-1]->tci_PresentInDCI;
|
||||
long *isTciEnable = pdcch_Config->controlResourceSetToAddModList->list.array[0]->tci_PresentInDCI;
|
||||
if (isTciEnable != NULL) {
|
||||
dci_pdu->transmission_configuration_indication.nbits = 3;
|
||||
size += dci_pdu->transmission_configuration_indication.nbits;
|
||||
@@ -3052,9 +3129,10 @@ uint16_t nr_dci_size(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
||||
dci_pdu->srs_request.nbits = 3;
|
||||
size += dci_pdu->srs_request.nbits;
|
||||
// CBGTI
|
||||
if (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL) {
|
||||
if (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig&&
|
||||
cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL) {
|
||||
uint8_t maxCBGperTB = (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission->choice.setup->maxCodeBlockGroupsPerTransportBlock + 1) * 2;
|
||||
long *maxCWperDCI_rrc = pdsch_config->maxNrofCodeWordsScheduledByDCI;
|
||||
long *maxCWperDCI_rrc = pdsch_Config->maxNrofCodeWordsScheduledByDCI;
|
||||
uint8_t maxCW = (maxCWperDCI_rrc == NULL) ? 1 : *maxCWperDCI_rrc;
|
||||
dci_pdu->cbgti.nbits = maxCBGperTB * maxCW;
|
||||
size += dci_pdu->cbgti.nbits;
|
||||
@@ -3562,9 +3640,10 @@ void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PD
|
||||
type0_PDCCH_CSS_config->num_rbs = -1;
|
||||
type0_PDCCH_CSS_config->num_symbols = -1;
|
||||
type0_PDCCH_CSS_config->rb_offset = -1;
|
||||
LOG_D(NR_MAC,"NR_SubcarrierSpacing_kHz30 %d, scs_ssb %d, scs_pdcch %d, min_chan_bw %d\n",(int)NR_SubcarrierSpacing_kHz30,(int)scs_ssb,(int)scs_pdcch,min_channel_bw);
|
||||
|
||||
// type0-pdcch coreset
|
||||
switch( (scs_ssb << 3) | scs_pdcch ){
|
||||
switch( ((int)scs_ssb << 3) | (int)scs_pdcch ){
|
||||
case (NR_SubcarrierSpacing_kHz15 << 5) | NR_SubcarrierSpacing_kHz15:
|
||||
AssertFatal(index_4msb < 15, "38.213 Table 13-1 4 MSB out of range\n");
|
||||
type0_PDCCH_CSS_config->type0_pdcch_ss_mux_pattern = 1;
|
||||
@@ -3597,7 +3676,7 @@ void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PD
|
||||
}else{ ; }
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case (NR_SubcarrierSpacing_kHz30 << 3) | NR_SubcarrierSpacing_kHz30:
|
||||
if((min_channel_bw & bw_5MHz) | (min_channel_bw & bw_10MHz)){
|
||||
type0_PDCCH_CSS_config->type0_pdcch_ss_mux_pattern = 1;
|
||||
@@ -3674,13 +3753,14 @@ void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PD
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(NR_MAC,"NR_SubcarrierSpacing_kHz30 %d, scs_ssb %d, scs_pdcch %d, min_chan_bw %d\n",NR_SubcarrierSpacing_kHz30,(int)scs_ssb,(int)scs_pdcch,min_channel_bw);
|
||||
break;
|
||||
}
|
||||
|
||||
LOG_D(MAC,"Coreset0: index_4msb=%d, num_rbs=%d, num_symb=%d, rb_offset=%d\n",
|
||||
LOG_D(NR_MAC,"Coreset0: index_4msb=%d, num_rbs=%d, num_symb=%d, rb_offset=%d\n",
|
||||
index_4msb,type0_PDCCH_CSS_config->num_rbs,type0_PDCCH_CSS_config->num_symbols,type0_PDCCH_CSS_config->rb_offset );
|
||||
|
||||
AssertFatal(type0_PDCCH_CSS_config->num_rbs != -1, "Type0 PDCCH coreset num_rbs undefined");
|
||||
AssertFatal(type0_PDCCH_CSS_config->num_rbs != -1, "Type0 PDCCH coreset num_rbs undefined, index_4msb=%d, min_channel_bw %d, scs_ssb %d, scs_pdcch %d\n",index_4msb,min_channel_bw,(int)scs_ssb,(int)scs_pdcch);
|
||||
AssertFatal(type0_PDCCH_CSS_config->num_symbols != -1, "Type0 PDCCH coreset num_symbols undefined");
|
||||
AssertFatal(type0_PDCCH_CSS_config->rb_offset != -1, "Type0 PDCCH coreset rb_offset undefined");
|
||||
|
||||
@@ -3990,15 +4070,15 @@ uint8_t fill_searchSpaceZero(NR_SearchSpace_t *ss0, NR_Type0_PDCCH_CSS_config_t
|
||||
case 4:
|
||||
ss0->nrofCandidates->aggregationLevel4 = (((max_agg>>2) > 4)? 4 : max_agg>>2);
|
||||
ss0->nrofCandidates->aggregationLevel8 = NR_SearchSpace__nrofCandidates__aggregationLevel8_n0;
|
||||
ss0->nrofCandidates->aggregationLevel8 = NR_SearchSpace__nrofCandidates__aggregationLevel16_n0;
|
||||
ss0->nrofCandidates->aggregationLevel16 = NR_SearchSpace__nrofCandidates__aggregationLevel16_n0;
|
||||
break;
|
||||
case 8:
|
||||
ss0->nrofCandidates->aggregationLevel8 = NR_SearchSpace__nrofCandidates__aggregationLevel4_n0;
|
||||
ss0->nrofCandidates->aggregationLevel4 = NR_SearchSpace__nrofCandidates__aggregationLevel4_n0;
|
||||
ss0->nrofCandidates->aggregationLevel8 = (((max_agg>>3) > 2)? 2 : max_agg>>3);
|
||||
ss0->nrofCandidates->aggregationLevel8 = NR_SearchSpace__nrofCandidates__aggregationLevel16_n0;
|
||||
ss0->nrofCandidates->aggregationLevel16 = NR_SearchSpace__nrofCandidates__aggregationLevel16_n0;
|
||||
break;
|
||||
case 16:
|
||||
ss0->nrofCandidates->aggregationLevel8 = NR_SearchSpace__nrofCandidates__aggregationLevel4_n0;
|
||||
ss0->nrofCandidates->aggregationLevel4 = NR_SearchSpace__nrofCandidates__aggregationLevel4_n0;
|
||||
ss0->nrofCandidates->aggregationLevel8 = NR_SearchSpace__nrofCandidates__aggregationLevel8_n0;
|
||||
ss0->nrofCandidates->aggregationLevel16 = (((max_agg>>4) > 1)? 1 : max_agg>>4);
|
||||
break;
|
||||
|
||||
@@ -53,7 +53,8 @@ int is_nr_DL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon,slo
|
||||
|
||||
int is_nr_UL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, slot_t slotP, lte_frame_type_t frame_type);
|
||||
|
||||
uint16_t nr_dci_size(const NR_BWP_UplinkCommon_t *initialULBWP,
|
||||
uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDLBWP,
|
||||
const NR_BWP_UplinkCommon_t *initialULBWP,
|
||||
const NR_CellGroupConfig_t *cg,
|
||||
dci_pdu_rel15_t *dci_pdu,
|
||||
nr_dci_format_t format,
|
||||
@@ -63,7 +64,8 @@ uint16_t nr_dci_size(const NR_BWP_UplinkCommon_t *initialULBWP,
|
||||
|
||||
void find_aggregation_candidates(uint8_t *aggregation_level,
|
||||
uint8_t *nr_of_candidates,
|
||||
NR_SearchSpace_t *ss);
|
||||
NR_SearchSpace_t *ss,
|
||||
int maxL);
|
||||
|
||||
void find_monitoring_periodicity_offset_common(NR_SearchSpace_t *ss,
|
||||
uint16_t *slot_period,
|
||||
@@ -192,7 +194,7 @@ uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Posi
|
||||
@returns transformPrecoding value */
|
||||
uint8_t get_transformPrecoding(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
||||
const NR_PUSCH_Config_t *pusch_config,
|
||||
const NR_BWP_Uplink_t *ubwp,
|
||||
const NR_BWP_UplinkDedicated_t *ubwp,
|
||||
uint8_t *dci_format,
|
||||
int rnti_type,
|
||||
uint8_t configuredGrant);
|
||||
|
||||
@@ -516,12 +516,12 @@ void config_bwp_ue(NR_UE_MAC_INST_t *mac, uint16_t *bwp_ind, uint8_t *dci_format
|
||||
else if (scd->defaultDownlinkBWP_Id)
|
||||
mac->DL_BWP_Id = *scd->defaultDownlinkBWP_Id;
|
||||
else
|
||||
mac->DL_BWP_Id = 1;
|
||||
mac->DL_BWP_Id = 0;
|
||||
|
||||
if (scd->uplinkConfig && scd->uplinkConfig->firstActiveUplinkBWP_Id)
|
||||
mac->UL_BWP_Id = *scd->uplinkConfig->firstActiveUplinkBWP_Id;
|
||||
else
|
||||
mac->UL_BWP_Id = 1;
|
||||
mac->UL_BWP_Id = 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -537,20 +537,22 @@ void config_bwp_ue(NR_UE_MAC_INST_t *mac, uint16_t *bwp_ind, uint8_t *dci_format
|
||||
void config_control_ue(NR_UE_MAC_INST_t *mac){
|
||||
|
||||
uint8_t coreset_id = 1, ss_id;
|
||||
|
||||
NR_ServingCellConfig_t *scd = mac->cg->spCellConfig->spCellConfigDedicated;
|
||||
AssertFatal(scd->downlinkBWP_ToAddModList != NULL, "downlinkBWP_ToAddModList is null\n");
|
||||
AssertFatal(scd->downlinkBWP_ToAddModList->list.count == 1, "downlinkBWP_ToAddModList->list->count is %d\n", scd->downlinkBWP_ToAddModList->list.count);
|
||||
|
||||
config_bwp_ue(mac, NULL, NULL);
|
||||
NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id;
|
||||
AssertFatal(dl_bwp_id != 0, "DL_BWP_Id is 0!");
|
||||
NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id;
|
||||
NR_ServingCellConfig_t *scd = mac->cg->spCellConfig->spCellConfigDedicated;
|
||||
if (dl_bwp_id==0) AssertFatal(mac->scc_SIB,"dl_bwp_id 0 (DL %d,UL %d) means mac->scc_SIB should exist here!\n",(int)mac->DL_BWP_Id,(int)mac->UL_BWP_Id);
|
||||
NR_BWP_DownlinkCommon_t *bwp_Common = dl_bwp_id>0 ? scd->downlinkBWP_ToAddModList->list.array[dl_bwp_id - 1]->bwp_Common :
|
||||
&mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP;
|
||||
|
||||
NR_BWP_DownlinkCommon_t *bwp_Common = scd->downlinkBWP_ToAddModList->list.array[dl_bwp_id - 1]->bwp_Common;
|
||||
AssertFatal(bwp_Common != NULL, "bwp_Common is null\n");
|
||||
|
||||
NR_BWP_DownlinkDedicated_t *dl_bwp_Dedicated = scd->downlinkBWP_ToAddModList->list.array[dl_bwp_id - 1]->bwp_Dedicated;
|
||||
if (dl_bwp_id > 0 ) {
|
||||
AssertFatal(scd->downlinkBWP_ToAddModList != NULL, "downlinkBWP_ToAddModList is null\n");
|
||||
AssertFatal(scd->downlinkBWP_ToAddModList->list.count == 1, "downlinkBWP_ToAddModList->list->count is %d\n", scd->downlinkBWP_ToAddModList->list.count);
|
||||
}
|
||||
NR_BWP_DownlinkDedicated_t *dl_bwp_Dedicated = dl_bwp_id>0 ? scd->downlinkBWP_ToAddModList->list.array[dl_bwp_id - 1]->bwp_Dedicated:
|
||||
scd->initialDownlinkBWP;
|
||||
AssertFatal(dl_bwp_Dedicated != NULL, "dl_bwp_Dedicated is null\n");
|
||||
config_bwp_ue(mac, NULL, NULL);
|
||||
|
||||
NR_SetupRelease_PDCCH_Config_t *pdcch_Config = dl_bwp_Dedicated->pdcch_Config;
|
||||
AssertFatal(pdcch_Config != NULL, "pdcch_Config is null\n");
|
||||
@@ -574,16 +576,17 @@ void config_control_ue(NR_UE_MAC_INST_t *mac){
|
||||
AssertFatal(searchSpacesToAddModList->list.count < FAPI_NR_MAX_SS_PER_CORESET, "too many searchpaces per coreset %d\n", searchSpacesToAddModList->list.count);
|
||||
|
||||
struct NR_UplinkConfig__uplinkBWP_ToAddModList *uplinkBWP_ToAddModList = scd->uplinkConfig->uplinkBWP_ToAddModList;
|
||||
AssertFatal(uplinkBWP_ToAddModList != NULL, "uplinkBWP_ToAddModList is null\n");
|
||||
AssertFatal(uplinkBWP_ToAddModList->list.count == 1, "uplinkBWP_ToAddModList->list->count is %d\n", uplinkBWP_ToAddModList->list.count);
|
||||
|
||||
if (ul_bwp_id > 0) {
|
||||
AssertFatal(uplinkBWP_ToAddModList != NULL, "uplinkBWP_ToAddModList is null\n");
|
||||
AssertFatal(uplinkBWP_ToAddModList->list.count == 1, "uplinkBWP_ToAddModList->list->count is %d\n", uplinkBWP_ToAddModList->list.count);
|
||||
}
|
||||
// check pdcch_Config, pdcch_ConfigCommon and DL BWP
|
||||
mac->DLbwp[0] = scd->downlinkBWP_ToAddModList->list.array[dl_bwp_id - 1];
|
||||
mac->coreset[dl_bwp_id - 1][coreset_id - 1] = controlResourceSetToAddModList->list.array[0];
|
||||
mac->DLbwp[0] = dl_bwp_id>0?scd->downlinkBWP_ToAddModList->list.array[dl_bwp_id - 1]:NULL;
|
||||
mac->coreset[dl_bwp_id][coreset_id - 1] = controlResourceSetToAddModList->list.array[0];
|
||||
|
||||
// Check dedicated UL BWP and pass to MAC
|
||||
mac->ULbwp[0] = uplinkBWP_ToAddModList->list.array[0];
|
||||
AssertFatal(mac->ULbwp[0]->bwp_Dedicated != NULL, "UL bwp_Dedicated is null\n");
|
||||
mac->ULbwp[0] = ul_bwp_id>0?uplinkBWP_ToAddModList->list.array[0]:NULL;
|
||||
if (mac->ULbwp[0]) AssertFatal(mac->ULbwp[0]->bwp_Dedicated != NULL, "UL bwp_Dedicated is null\n");
|
||||
|
||||
// check available Search Spaces in the searchSpacesToAddModList and pass to MAC
|
||||
// note: the network configures at most 10 Search Spaces per BWP per cell (including UE-specific and common Search Spaces).
|
||||
@@ -591,10 +594,10 @@ void config_control_ue(NR_UE_MAC_INST_t *mac){
|
||||
NR_SearchSpace_t *ss = searchSpacesToAddModList->list.array[ss_id];
|
||||
AssertFatal(ss->controlResourceSetId != NULL, "ss->controlResourceSetId is null\n");
|
||||
AssertFatal(ss->searchSpaceType != NULL, "ss->searchSpaceType is null\n");
|
||||
AssertFatal(*ss->controlResourceSetId == mac->coreset[dl_bwp_id - 1][coreset_id - 1]->controlResourceSetId, "ss->controlResourceSetId is unknown\n");
|
||||
AssertFatal(*ss->controlResourceSetId == mac->coreset[dl_bwp_id][coreset_id - 1]->controlResourceSetId, "ss->controlResourceSetId is unknown\n");
|
||||
AssertFatal(ss->monitoringSymbolsWithinSlot != NULL, "NR_SearchSpace->monitoringSymbolsWithinSlot is null\n");
|
||||
AssertFatal(ss->monitoringSymbolsWithinSlot->buf != NULL, "NR_SearchSpace->monitoringSymbolsWithinSlot->buf is null\n");
|
||||
mac->SSpace[0][0][ss_id] = ss;
|
||||
mac->SSpace[dl_bwp_id][0][ss_id] = ss;
|
||||
}
|
||||
|
||||
// Check available CSSs in the commonSearchSpaceList (list of additional common search spaces)
|
||||
@@ -602,11 +605,12 @@ void config_control_ue(NR_UE_MAC_INST_t *mac){
|
||||
for (int css_id = 0; css_id < commonSearchSpaceList->list.count; css_id++) {
|
||||
NR_SearchSpace_t *css = commonSearchSpaceList->list.array[css_id];
|
||||
AssertFatal(css->controlResourceSetId != NULL, "ss->controlResourceSetId is null\n");
|
||||
AssertFatal(*css->controlResourceSetId == mac->coreset[dl_bwp_id - 1][coreset_id - 1]->controlResourceSetId, "ss->controlResourceSetId is unknown\n");
|
||||
AssertFatal(*css->controlResourceSetId == 0 || *css->controlResourceSetId == mac->coreset[dl_bwp_id][coreset_id - 1]->controlResourceSetId, "css->controlResourceSetId %ld is unknown, mac->coreset[%ld][%d]->controlResourceSetId %ld\n",*css->controlResourceSetId,dl_bwp_id,coreset_id-1,mac->coreset[dl_bwp_id][coreset_id - 1]->controlResourceSetId);
|
||||
|
||||
AssertFatal(css->searchSpaceType != NULL, "css->searchSpaceType is null\n");
|
||||
AssertFatal(css->monitoringSymbolsWithinSlot != NULL, "css->monitoringSymbolsWithinSlot is null\n");
|
||||
AssertFatal(css->monitoringSymbolsWithinSlot->buf != NULL, "css->monitoringSymbolsWithinSlot->buf is null\n");
|
||||
mac->SSpace[0][0][ss_id] = css;
|
||||
mac->SSpace[dl_bwp_id][0][ss_id] = css;
|
||||
ss_id++;
|
||||
}
|
||||
}
|
||||
@@ -652,6 +656,9 @@ int nr_rrc_mac_config_req_ue(
|
||||
if(scell_group_config != NULL ){
|
||||
mac->cg = scell_group_config;
|
||||
mac->servCellIndex = *scell_group_config->spCellConfig->servCellIndex;
|
||||
mac->DL_BWP_Id=mac->cg->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id ? *mac->cg->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id : 0;
|
||||
mac->UL_BWP_Id=mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id ? *mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id : 0;
|
||||
|
||||
config_control_ue(mac);
|
||||
if (scell_group_config->spCellConfig->reconfigurationWithSync) {
|
||||
if (scell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated) {
|
||||
@@ -671,6 +678,8 @@ int nr_rrc_mac_config_req_ue(
|
||||
LOG_I(MAC,"Applying CellGroupConfig from gNodeB\n");
|
||||
mac->cg = cell_group_config;
|
||||
mac->servCellIndex = cell_group_config->spCellConfig->servCellIndex ? *cell_group_config->spCellConfig->servCellIndex : 0;
|
||||
mac->DL_BWP_Id=mac->cg->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id ? *mac->cg->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id : 0;
|
||||
mac->UL_BWP_Id=mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id ? *mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id : 0;
|
||||
if(get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra==1 || get_softmodem_params()->nsa) {
|
||||
config_control_ue(mac);
|
||||
if (cell_group_config->spCellConfig->reconfigurationWithSync) {
|
||||
|
||||
@@ -309,6 +309,7 @@ typedef struct {
|
||||
bool ack_received;
|
||||
uint8_t pucch_resource_indicator;
|
||||
uint16_t feedback_to_ul;
|
||||
int is_common;
|
||||
frame_t dl_frame;
|
||||
int dl_slot;
|
||||
uint8_t ack;
|
||||
@@ -344,6 +345,7 @@ typedef struct {
|
||||
uint32_t csi_part2_payload;
|
||||
int resource_indicator;
|
||||
int resource_set_id;
|
||||
int is_common;
|
||||
int initial_pucch_id;
|
||||
NR_PUCCH_Resource_t *pucch_resource;
|
||||
int n_CCE;
|
||||
|
||||
@@ -178,6 +178,14 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
|
||||
void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl_config, frame_t frame, int slot);
|
||||
|
||||
void get_bwp_info(NR_UE_MAC_INST_t *mac,
|
||||
int dl_bwp_id,
|
||||
int ul_bwp_id,
|
||||
NR_BWP_DownlinkDedicated_t **bwpd,
|
||||
NR_BWP_DownlinkCommon_t **bwpc,
|
||||
NR_BWP_UplinkDedicated_t **ubwpd,
|
||||
NR_BWP_UplinkCommon_t **ubwpc);
|
||||
|
||||
uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
|
||||
uint8_t dci_format,
|
||||
uint8_t dci_length,
|
||||
@@ -185,15 +193,20 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
|
||||
uint64_t *dci_pdu,
|
||||
dci_pdu_rel15_t *nr_pdci_info_extracted);
|
||||
|
||||
NR_PUSCH_TimeDomainResourceAllocationList_t *choose_ul_tda_list(NR_PUSCH_Config_t *pusch_Config,NR_PUSCH_ConfigCommon_t *pusch_ConfigCommon);
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *choose_dl_tda_list(NR_PDSCH_Config_t *pdsch_Config,NR_PDSCH_ConfigCommon_t *pdsch_ConfigCommon);
|
||||
|
||||
int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
|
||||
NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList,
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList,
|
||||
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu,
|
||||
uint8_t time_domain_ind,
|
||||
int default_abc,
|
||||
bool use_default);
|
||||
|
||||
|
||||
uint8_t nr_ue_get_sdu(module_id_t module_idP,
|
||||
int cc_id,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframe,
|
||||
uint8_t gNB_index,
|
||||
@@ -212,6 +225,7 @@ void set_harq_status(NR_UE_MAC_INST_t *mac,
|
||||
uint8_t dai,
|
||||
int n_CCE,
|
||||
int N_CCE,
|
||||
int is_common,
|
||||
frame_t frame,
|
||||
int slot);
|
||||
|
||||
|
||||
@@ -51,16 +51,25 @@
|
||||
|
||||
void fill_dci_search_candidates(NR_SearchSpace_t *ss,fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15) {
|
||||
|
||||
LOG_D(MAC,"Filling search candidates for DCI\n");
|
||||
LOG_D(NR_MAC,"Filling search candidates for DCI\n");
|
||||
|
||||
uint8_t aggregation;
|
||||
find_aggregation_candidates(&aggregation,
|
||||
&rel15->number_of_candidates,
|
||||
ss);
|
||||
uint8_t number_of_candidates=0;
|
||||
rel15->number_of_candidates=0;
|
||||
int i=0;
|
||||
for (int maxL=16;maxL>0;maxL>>=1) {
|
||||
find_aggregation_candidates(&aggregation,
|
||||
&number_of_candidates,
|
||||
ss,maxL);
|
||||
|
||||
for (int i=0; i<rel15->number_of_candidates; i++) {
|
||||
rel15->CCE[i] = i*aggregation;
|
||||
rel15->L[i] = aggregation;
|
||||
if (number_of_candidates>0) {
|
||||
LOG_D(NR_MAC,"L %d, number of candidates %d, aggregation %d\n",maxL,number_of_candidates,aggregation);
|
||||
rel15->number_of_candidates += number_of_candidates;
|
||||
for (int j=0; j<number_of_candidates; i++,j++) {
|
||||
rel15->CCE[i] = j*aggregation;
|
||||
rel15->L[i] = aggregation;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,18 +91,14 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
if (scc!=NULL || scc_SIB != NULL) {
|
||||
initialDownlinkBWP = scc!=NULL ? scc->downlinkConfigCommon->initialDownlinkBWP : &scc_SIB->downlinkConfigCommon.initialDownlinkBWP;
|
||||
initialUplinkBWP = scc!=NULL ? scc->uplinkConfigCommon->initialUplinkBWP : &scc_SIB->uplinkConfigCommon->initialUplinkBWP;
|
||||
|
||||
bwp_Common = bwp_id>0 ? mac->DLbwp[bwp_id-1]->bwp_Common : NULL;
|
||||
}
|
||||
bwp_Common = bwp_id>0 ? mac->DLbwp[bwp_id-1]->bwp_Common : NULL;
|
||||
|
||||
NR_SearchSpace_t *ss;
|
||||
NR_ControlResourceSet_t *coreset;
|
||||
if(ss_id>=0) {
|
||||
AssertFatal(mac->scc != NULL, "scc is null\n");
|
||||
initialDownlinkBWP = scc->downlinkConfigCommon->initialDownlinkBWP;
|
||||
bwp_Common = mac->DLbwp[bwp_id - 1]->bwp_Common;
|
||||
ss = mac->SSpace[bwp_id - 1][coreset_id - 1][ss_id];
|
||||
coreset = mac->coreset[bwp_id - 1][coreset_id - 1];
|
||||
ss = mac->SSpace[bwp_id][coreset_id - 1][ss_id];
|
||||
coreset = mac->coreset[bwp_id][coreset_id - 1];
|
||||
rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG;
|
||||
} else {
|
||||
ss = mac->search_space_zero;
|
||||
@@ -153,7 +158,7 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
rel15->SubcarrierSpacing = bwp_Common->genericParameters.subcarrierSpacing;
|
||||
}
|
||||
for (int i = 0; i < rel15->num_dci_options; i++) {
|
||||
rel15->dci_length_options[i] = nr_dci_size(initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_C, rel15->BWPSize, bwp_id);
|
||||
rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_C, rel15->BWPSize, bwp_id);
|
||||
}
|
||||
break;
|
||||
case NR_RNTI_RA:
|
||||
@@ -161,14 +166,15 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
sps = initialDownlinkBWP->genericParameters.cyclicPrefix == NULL ? 14 : 12;
|
||||
monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps));
|
||||
rel15->rnti = mac->ra.ra_rnti;
|
||||
rel15->BWPSize = NRRIV2BW(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
if (get_softmodem_params()->sa) {
|
||||
rel15->BWPStart = NRRIV2PRBOFFSET(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
rel15->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs;
|
||||
rel15->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb;
|
||||
} else { // NSA mode is not using the Initial BWP
|
||||
rel15->BWPSize = NRRIV2BW(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
rel15->BWPStart = NRRIV2PRBOFFSET(bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
}
|
||||
rel15->SubcarrierSpacing = initialDownlinkBWP->genericParameters.subcarrierSpacing;
|
||||
rel15->dci_length_options[0] = nr_dci_size(initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[0]], rel15->dci_format_options[0], NR_RNTI_RA, rel15->BWPSize, bwp_id);
|
||||
rel15->dci_length_options[0] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[0]], rel15->dci_format_options[0], NR_RNTI_RA, rel15->BWPSize, bwp_id);
|
||||
break;
|
||||
case NR_RNTI_P:
|
||||
break;
|
||||
@@ -179,11 +185,12 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
sps = initialDownlinkBWP->genericParameters.cyclicPrefix == NULL ? 14 : 12;
|
||||
monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps));
|
||||
rel15->rnti = mac->ra.t_crnti;
|
||||
rel15->BWPSize = NRRIV2BW(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
rel15->BWPStart = NRRIV2PRBOFFSET(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
rel15->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs;
|
||||
rel15->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb;
|
||||
rel15->SubcarrierSpacing = initialDownlinkBWP->genericParameters.subcarrierSpacing;
|
||||
for (int i = 0; i < rel15->num_dci_options; i++)
|
||||
rel15->dci_length_options[i] = nr_dci_size(initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_TC, rel15->BWPSize, bwp_id);
|
||||
for (int i = 0; i < rel15->num_dci_options; i++) {
|
||||
rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_TC, rel15->BWPSize, bwp_id);
|
||||
}
|
||||
break;
|
||||
case NR_RNTI_SP_CSI:
|
||||
break;
|
||||
@@ -205,7 +212,7 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
rel15->SubcarrierSpacing = mac->mib->subCarrierSpacingCommon + 2;
|
||||
|
||||
for (int i = 0; i < rel15->num_dci_options; i++) {
|
||||
rel15->dci_length_options[i] = nr_dci_size(initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_SI, rel15->BWPSize, 0);
|
||||
rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_SI, rel15->BWPSize, 0);
|
||||
}
|
||||
break;
|
||||
case NR_RNTI_SFI:
|
||||
@@ -248,20 +255,19 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
|
||||
RA_config_t *ra = &mac->ra;
|
||||
int ss_id;
|
||||
|
||||
uint8_t bwp_id = (mac->cg) ? 1 : 0, coreset_id = (mac->cg) ? 1 : 0;
|
||||
uint8_t bwp_id = (mac->cg) ? mac->DL_BWP_Id : 0, coreset_id = (mac->cg) ? 1 : 0;
|
||||
//NR_ServingCellConfig_t *scd = mac->scg->spCellConfig->spCellConfigDedicated;
|
||||
NR_BWP_Downlink_t *bwp = (mac->cg) ? mac->DLbwp[bwp_id - 1] : NULL;
|
||||
NR_BWP_DownlinkDedicated_t *bwpd = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Dedicated : mac->cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP;
|
||||
NR_BWP_DownlinkCommon_t *bwp_Common = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Common : &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP;
|
||||
|
||||
LOG_D(MAC, "[DCI_CONFIG] ra_rnti %p (%x) crnti %p (%x) t_crnti %p (%x)\n", &ra->ra_rnti, ra->ra_rnti, &mac->crnti, mac->crnti, &ra->t_crnti, ra->t_crnti);
|
||||
LOG_D(NR_MAC, "[DCI_CONFIG] ra_rnti %p (%x) crnti %p (%x) t_crnti %p (%x)\n", &ra->ra_rnti, ra->ra_rnti, &mac->crnti, mac->crnti, &ra->t_crnti, ra->t_crnti);
|
||||
|
||||
if (mac->cg) { // do this only after we have a Master or Secondary Cell group
|
||||
// loop over all available SS for BWP ID 1, CORESET ID 1
|
||||
if (bwp) {
|
||||
for (ss_id = 0; ss_id < FAPI_NR_MAX_SS_PER_CORESET && mac->SSpace[bwp_id - 1][coreset_id - 1][ss_id] != NULL; ss_id++){
|
||||
LOG_D(MAC, "[DCI_CONFIG] ss_id %d\n",ss_id);
|
||||
NR_SearchSpace_t *ss = mac->SSpace[bwp_id - 1][coreset_id - 1][ss_id];
|
||||
// loop over all available SS for CORESET ID 1
|
||||
if (bwpd) {
|
||||
for (ss_id = 0; ss_id < FAPI_NR_MAX_SS_PER_CORESET && mac->SSpace[bwp_id][coreset_id - 1][ss_id] != NULL; ss_id++){
|
||||
LOG_D(NR_MAC, "[DCI_CONFIG] ss_id %d\n",ss_id);
|
||||
NR_SearchSpace_t *ss = mac->SSpace[bwp_id][coreset_id - 1][ss_id];
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15;
|
||||
NR_BWP_DownlinkCommon_t *bwp_Common = bwp->bwp_Common;
|
||||
NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon;
|
||||
struct NR_PhysicalCellGroupConfig *phy_cgc = mac->cg->physicalCellGroupConfig;
|
||||
switch (ss->searchSpaceType->present){
|
||||
@@ -275,7 +281,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
|
||||
pdcch_ConfigCommon->choice.setup->searchSpaceSIB1=calloc(1,sizeof(*pdcch_ConfigCommon->choice.setup->searchSpaceSIB1));
|
||||
}
|
||||
*pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 = 0;
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure SearchSpace#0 of the initial BWP\n");
|
||||
LOG_D(NR_MAC, "[DCI_CONFIG] Configure SearchSpace#0 of the initial BWP\n");
|
||||
}
|
||||
if (ss->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0){
|
||||
// check available SS IDs
|
||||
@@ -308,30 +314,30 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
|
||||
if (pdcch_ConfigCommon->choice.setup->searchSpaceSIB1){
|
||||
if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->searchSpaceSIB1){
|
||||
// Configure monitoring of PDCCH candidates in Type0-PDCCH common search space on the MCG
|
||||
LOG_W(MAC, "[DCI_CONFIG] This seach space should not be configured yet...");
|
||||
//LOG_W(MAC, "[DCI_CONFIG] This seach space should not be configured yet...");
|
||||
}
|
||||
}
|
||||
if (pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation){
|
||||
if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation){
|
||||
// Configure monitoring of PDCCH candidates in Type0-PDCCH common search space on the MCG
|
||||
LOG_W(MAC, "[DCI_CONFIG] This seach space should not be configured yet...");
|
||||
//LOG_W(MAC, "[DCI_CONFIG] This seach space should not be configured yet...");
|
||||
}
|
||||
}
|
||||
if (pdcch_ConfigCommon->choice.setup->pagingSearchSpace){
|
||||
if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->pagingSearchSpace){
|
||||
// Configure monitoring of PDCCH candidates in Type2-PDCCH common search space on the MCG
|
||||
LOG_W(MAC, "[DCI_CONFIG] This seach space should not be configured yet...");
|
||||
//LOG_W(MAC, "[DCI_CONFIG] This seach space should not be configured yet...");
|
||||
}
|
||||
}
|
||||
if (phy_cgc){
|
||||
if (phy_cgc->cs_RNTI){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type3-PDCCH common search space for dci_Format0_0_AndFormat1_0 with CRC scrambled by CS-RNTI...\n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...\n");
|
||||
}
|
||||
if (phy_cgc->ext1){
|
||||
if (phy_cgc->ext1->mcs_C_RNTI){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in user specific search space for dci_Format0_0_AndFormat1_0 with CRC scrambled by MCS-C-RNTI...\n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -339,71 +345,68 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
|
||||
// DCI 2_0
|
||||
if (ss->searchSpaceType->choice.common->dci_Format2_0){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type3-PDCCH common search space for DCI format 2_0 with CRC scrambled by SFI-RNTI \n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This format should not be configured yet...");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This format should not be configured yet...\n");
|
||||
}
|
||||
// DCI 2_1
|
||||
if (ss->searchSpaceType->choice.common->dci_Format2_1){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type3-PDCCH common search space for DCI format 2_1 with CRC scrambled by INT-RNTI \n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This format should not be configured yet...");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This format should not be configured yet...\n");
|
||||
}
|
||||
// DCI 2_2
|
||||
if (ss->searchSpaceType->choice.common->dci_Format2_2){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type3-PDCCH common search space for DCI format 2_2 with CRC scrambled by TPC-RNTI \n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This format should not be configured yet...");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This format should not be configured yet...\n");
|
||||
}
|
||||
// DCI 2_3
|
||||
if (ss->searchSpaceType->choice.common->dci_Format2_3){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type3-PDCCH common search space for DCI format 2_3 with CRC scrambled by TPC-SRS-RNTI \n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This format should not be configured yet...");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This format should not be configured yet...\n");
|
||||
}
|
||||
|
||||
break;
|
||||
case NR_SearchSpace__searchSpaceType_PR_ue_Specific:
|
||||
// this is an USS
|
||||
if (ss->searchSpaceType->choice.ue_Specific){
|
||||
if(ss->searchSpaceType->choice.ue_Specific->dci_Formats == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_1_And_1_1){
|
||||
if (ss->searchSpaceType->choice.ue_Specific &&
|
||||
ss->searchSpaceType->choice.ue_Specific->dci_Formats == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_1_And_1_1 &&
|
||||
(ra->ra_state == RA_SUCCEEDED || get_softmodem_params()->phy_test) &&
|
||||
mac->crnti > 0) {
|
||||
// Monitors DCI 01 and 11 scrambled with C-RNTI, or CS-RNTI(s), or SP-CSI-RNTI
|
||||
if ((ra->ra_state == RA_SUCCEEDED || get_softmodem_params()->phy_test) && mac->crnti > 0) {
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in the user specific search space\n");
|
||||
rel15->num_dci_options = 2;
|
||||
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_1;
|
||||
rel15->dci_format_options[1] = NR_UL_DCI_FORMAT_0_1;
|
||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_C, ss_id);
|
||||
fill_dci_search_candidates(ss, rel15);
|
||||
LOG_D(NR_MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in the user specific search space\n");
|
||||
rel15->num_dci_options = 2;
|
||||
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_1;
|
||||
rel15->dci_format_options[1] = NR_UL_DCI_FORMAT_0_1;
|
||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_C, ss_id);
|
||||
fill_dci_search_candidates(ss, rel15);
|
||||
|
||||
#ifdef DEBUG_DCI
|
||||
LOG_D(MAC, "[DCI_CONFIG] ss %d ue_Specific %p searchSpaceType->present %d dci_Formats %d\n",
|
||||
//#ifdef DEBUG_DCI
|
||||
LOG_D(NR_MAC, "[DCI_CONFIG] ss %d ue_Specific %p searchSpaceType->present %d dci_Formats %d\n",
|
||||
ss_id,
|
||||
ss->searchSpaceType->choice.ue_Specific,
|
||||
ss->searchSpaceType->present,
|
||||
ss->searchSpaceType->choice.ue_Specific->dci_Formats);
|
||||
#endif
|
||||
}
|
||||
if (phy_cgc){
|
||||
if (phy_cgc->cs_RNTI){
|
||||
(int)ss->searchSpaceType->present,
|
||||
(int)ss->searchSpaceType->choice.ue_Specific->dci_Formats);
|
||||
//#endif
|
||||
}
|
||||
if (phy_cgc){
|
||||
if (phy_cgc->cs_RNTI){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in user specific search space for dci_Format0_0_AndFormat1_0 with CRC scrambled by CS-RNTI...\n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...");
|
||||
}
|
||||
if (phy_cgc->sp_CSI_RNTI){
|
||||
}
|
||||
if (phy_cgc->sp_CSI_RNTI){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in user specific search space for dci_Format0_0_AndFormat1_0 with CRC scrambled by SP-CSI-RNTI...\n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...");
|
||||
}
|
||||
if (phy_cgc->ext1){
|
||||
if (phy_cgc->ext1->mcs_C_RNTI){
|
||||
}
|
||||
if (phy_cgc->ext1 &&
|
||||
phy_cgc->ext1->mcs_C_RNTI){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in user specific search space for dci_Format0_0_AndFormat1_0 with CRC scrambled by MCS-C-RNTI...\n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "[DCI_CONFIG] Unrecognized search space type...");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // switch searchspace
|
||||
} // for ss_id
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -411,8 +414,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
|
||||
}
|
||||
// Search space 0, CORESET ID 0
|
||||
|
||||
NR_BWP_DownlinkCommon_t *bwp_Common = bwp ? bwp->bwp_Common : NULL;
|
||||
NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp?bwp_Common->pdcch_ConfigCommon:NULL;
|
||||
NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon;
|
||||
|
||||
if (pdcch_ConfigCommon &&
|
||||
pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 &&
|
||||
|
||||
@@ -135,6 +135,82 @@ const initial_pucch_resource_t initial_pucch_resource[16] = {
|
||||
};
|
||||
|
||||
|
||||
void get_bwp_info(NR_UE_MAC_INST_t *mac,
|
||||
int dl_bwp_id,
|
||||
int ul_bwp_id,
|
||||
NR_BWP_DownlinkDedicated_t **bwpd,
|
||||
NR_BWP_DownlinkCommon_t **bwpc,
|
||||
NR_BWP_UplinkDedicated_t **ubwpd,
|
||||
NR_BWP_UplinkCommon_t **ubwpc) {
|
||||
|
||||
if (dl_bwp_id > 0) {
|
||||
AssertFatal(mac->DLbwp[dl_bwp_id-1]!=NULL,"mac->DLbwp[%d] is null, shouldn't be\n",
|
||||
(int)dl_bwp_id-1);
|
||||
*bwpd = mac->DLbwp[dl_bwp_id-1]->bwp_Dedicated;
|
||||
if (mac->DLbwp[dl_bwp_id-1]->bwp_Common) *bwpc = mac->DLbwp[dl_bwp_id-1]->bwp_Common;
|
||||
else if (mac->scc_SIB) *bwpc = &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP;
|
||||
else if (mac->scc) *bwpc = mac->scc->downlinkConfigCommon->initialDownlinkBWP;
|
||||
AssertFatal(*bwpc!=NULL,"bwpc shouldn't be null\n");
|
||||
} else {
|
||||
if (mac->cg &&
|
||||
mac->cg->spCellConfig &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP)
|
||||
*bwpd = mac->cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP;
|
||||
if (mac->scc_SIB) *bwpc = &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP;
|
||||
else if (mac->scc) *bwpc = mac->scc->downlinkConfigCommon->initialDownlinkBWP;
|
||||
AssertFatal(*bwpc!=NULL,"bwpc shouldn't be null\n");
|
||||
}
|
||||
|
||||
if (ul_bwp_id > 0) {
|
||||
AssertFatal(mac->ULbwp[ul_bwp_id-1]!=NULL,"mac->ULbwp[%d] is null, shouldn't be\n",
|
||||
ul_bwp_id-1);
|
||||
*ubwpd = mac->ULbwp[ul_bwp_id-1]->bwp_Dedicated;
|
||||
if (mac->ULbwp[ul_bwp_id-1]->bwp_Common) *ubwpc = mac->ULbwp[ul_bwp_id-1]->bwp_Common;
|
||||
else if (mac->scc_SIB) *ubwpc = &mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP;
|
||||
else if (mac->scc) *ubwpc = mac->scc->uplinkConfigCommon->initialUplinkBWP;
|
||||
AssertFatal(*bwpc!=NULL,"bwpc shouldn't be null\n");
|
||||
|
||||
}
|
||||
else {
|
||||
if (mac->cg &&
|
||||
mac->cg->spCellConfig &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP)
|
||||
*ubwpd = mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP;
|
||||
if (mac->scc_SIB) *ubwpc = &mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP;
|
||||
else if (mac->scc) *ubwpc = mac->scc->uplinkConfigCommon->initialUplinkBWP;
|
||||
AssertFatal(*ubwpc!=NULL,"ubwpc shouldn't be null\n");
|
||||
}
|
||||
}
|
||||
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *choose_dl_tda_list(NR_PDSCH_Config_t *pdsch_Config,NR_PDSCH_ConfigCommon_t *pdsch_ConfigCommon) {
|
||||
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList=NULL;
|
||||
|
||||
if (pdsch_Config &&
|
||||
pdsch_Config->pdsch_TimeDomainAllocationList)
|
||||
pdsch_TimeDomainAllocationList = pdsch_Config->pdsch_TimeDomainAllocationList->choice.setup;
|
||||
else if (pdsch_ConfigCommon->pdsch_TimeDomainAllocationList)
|
||||
pdsch_TimeDomainAllocationList = pdsch_ConfigCommon->pdsch_TimeDomainAllocationList;
|
||||
|
||||
return(pdsch_TimeDomainAllocationList);
|
||||
}
|
||||
|
||||
NR_PUSCH_TimeDomainResourceAllocationList_t *choose_ul_tda_list(NR_PUSCH_Config_t *pusch_Config,NR_PUSCH_ConfigCommon_t *pusch_ConfigCommon) {
|
||||
|
||||
NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList=NULL;
|
||||
|
||||
if (pusch_Config &&
|
||||
pusch_Config->pusch_TimeDomainAllocationList)
|
||||
pusch_TimeDomainAllocationList = pusch_Config->pusch_TimeDomainAllocationList->choice.setup;
|
||||
else if (pusch_ConfigCommon->pusch_TimeDomainAllocationList)
|
||||
pusch_TimeDomainAllocationList = pusch_ConfigCommon->pusch_TimeDomainAllocationList;
|
||||
|
||||
return(pusch_TimeDomainAllocationList);
|
||||
}
|
||||
|
||||
int get_rnti_type(NR_UE_MAC_INST_t *mac, uint16_t rnti){
|
||||
|
||||
RA_config_t *ra = &mac->ra;
|
||||
@@ -171,7 +247,7 @@ int8_t nr_ue_decode_mib(module_id_t module_id,
|
||||
uint16_t ssb_start_subcarrier,
|
||||
uint16_t cell_id)
|
||||
{
|
||||
LOG_I(MAC,"[L2][MAC] decode mib\n");
|
||||
LOG_D(MAC,"[L2][MAC] decode mib\n");
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
||||
mac->physCellId = cell_id;
|
||||
@@ -342,6 +418,8 @@ int8_t nr_ue_process_dci_freq_dom_resource_assignment(nfapi_nr_ue_pusch_pdu_t *p
|
||||
}
|
||||
|
||||
int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
|
||||
NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList,
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList,
|
||||
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu,
|
||||
uint8_t time_domain_ind,
|
||||
@@ -398,17 +476,6 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
|
||||
* TS 38.214 subclause 5.1.2.1 Resource allocation in time domain (downlink)
|
||||
*/
|
||||
if(dlsch_config_pdu != NULL){
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList = NULL;
|
||||
if (mac->DLbwp[0] &&
|
||||
mac->DLbwp[0]->bwp_Dedicated &&
|
||||
mac->DLbwp[0]->bwp_Dedicated->pdsch_Config &&
|
||||
mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList)
|
||||
pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList->choice.setup;
|
||||
else if (mac->DLbwp[0] && mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList)
|
||||
pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
else if (mac->scc_SIB && mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup)
|
||||
pdsch_TimeDomainAllocationList = mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
|
||||
if (pdsch_TimeDomainAllocationList && use_default==false) {
|
||||
|
||||
if (time_domain_ind >= pdsch_TimeDomainAllocationList->list.count) {
|
||||
@@ -446,23 +513,6 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
|
||||
* TS 38.214 subclause 6.1.2.1 Resource allocation in time domain (uplink)
|
||||
*/
|
||||
if(pusch_config_pdu != NULL){
|
||||
NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = NULL;
|
||||
if (mac->ULbwp[0] &&
|
||||
mac->ULbwp[0]->bwp_Dedicated &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->pusch_TimeDomainAllocationList) {
|
||||
pusch_TimeDomainAllocationList = mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->pusch_TimeDomainAllocationList->choice.setup;
|
||||
}
|
||||
else if (mac->ULbwp[0] &&
|
||||
mac->ULbwp[0]->bwp_Common &&
|
||||
mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon &&
|
||||
mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup &&
|
||||
mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList) {
|
||||
pusch_TimeDomainAllocationList = mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
}
|
||||
else pusch_TimeDomainAllocationList = mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
|
||||
if (pusch_TimeDomainAllocationList && use_default==false) {
|
||||
if (time_domain_ind >= pusch_TimeDomainAllocationList->list.count) {
|
||||
LOG_E(MAC, "time_domain_ind %d >= pusch->TimeDomainAllocationList->list.count %d\n",
|
||||
@@ -645,7 +695,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
// Config PUSCH PDU
|
||||
ret = nr_config_pusch_pdu(mac, pusch_config_pdu, dci, NULL, rnti, &dci_format);
|
||||
|
||||
}
|
||||
} else AssertFatal(1==0,"Cannot schedule PUSCH\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -705,8 +755,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu_1_0 = &dl_config->dl_config_list[dl_config->number_pdus].dlsch_config_pdu.dlsch_config_rel15;
|
||||
|
||||
NR_PDSCH_Config_t *pdsch_config= (mac->DLbwp[0]) ? mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup : NULL;
|
||||
uint16_t BWPSize = n_RB_DLBWP;
|
||||
|
||||
int is_common=0;
|
||||
if(rnti == SI_RNTI) {
|
||||
NR_Type0_PDCCH_CSS_config_t type0_PDCCH_CSS_config = mac->type0_PDCCH_CSS_config;
|
||||
default_abc = type0_PDCCH_CSS_config.type0_pdcch_ss_mux_pattern;
|
||||
@@ -715,7 +764,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
dlsch_config_pdu_1_0->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb;
|
||||
dlsch_config_pdu_1_0->SubcarrierSpacing = mac->mib->subCarrierSpacingCommon;
|
||||
if (pdsch_config) pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NULL; // For PDSCH with mapping type A, the UE shall assume dmrs-AdditionalPosition='pos2'
|
||||
BWPSize = dlsch_config_pdu_1_0->BWPSize;
|
||||
} else {
|
||||
if (ra->RA_window_cnt >= 0 && rnti == ra->ra_rnti){
|
||||
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_RA_DLSCH;
|
||||
@@ -723,9 +771,10 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_DLSCH;
|
||||
}
|
||||
if( (ra->RA_window_cnt >= 0 && rnti == ra->ra_rnti) || (rnti == ra->t_crnti) ) {
|
||||
if (mac->scc == NULL) {
|
||||
dlsch_config_pdu_1_0->BWPSize = NRRIV2BW(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
dlsch_config_pdu_1_0->BWPStart = NRRIV2PRBOFFSET(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
if (mac->scc == NULL) { // use coreset0
|
||||
dlsch_config_pdu_1_0->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs;
|
||||
dlsch_config_pdu_1_0->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb;
|
||||
is_common=1;
|
||||
}
|
||||
else {
|
||||
dlsch_config_pdu_1_0->BWPSize = NRRIV2BW(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
@@ -734,7 +783,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
if (!get_softmodem_params()->sa) { // NSA mode is not using the Initial BWP
|
||||
dlsch_config_pdu_1_0->BWPStart = NRRIV2PRBOFFSET(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
pdsch_config = mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup;
|
||||
BWPSize = dlsch_config_pdu_1_0->BWPSize;
|
||||
}
|
||||
} else if (mac->DLbwp[0]) {
|
||||
dlsch_config_pdu_1_0->BWPSize = NRRIV2BW(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
@@ -751,15 +799,11 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
|
||||
/* IDENTIFIER_DCI_FORMATS */
|
||||
/* FREQ_DOM_RESOURCE_ASSIGNMENT_DL */
|
||||
if (nr_ue_process_dci_freq_dom_resource_assignment(NULL,dlsch_config_pdu_1_0,0,BWPSize,dci->frequency_domain_assignment.val) < 0) {
|
||||
if (nr_ue_process_dci_freq_dom_resource_assignment(NULL,dlsch_config_pdu_1_0,0,dlsch_config_pdu_1_0->BWPSize,dci->frequency_domain_assignment.val) < 0) {
|
||||
LOG_W(MAC, "[%d.%d] Invalid frequency_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot);
|
||||
return -1;
|
||||
}
|
||||
/* TIME_DOM_RESOURCE_ASSIGNMENT */
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,dlsch_config_pdu_1_0,dci->time_domain_assignment.val,default_abc,rnti==SI_RNTI) < 0) {
|
||||
LOG_W(MAC, "[%d.%d] Invalid time_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList = NULL;
|
||||
if (mac->DLbwp[0] &&
|
||||
@@ -772,6 +816,11 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
else if (mac->scc_SIB && mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup)
|
||||
pdsch_TimeDomainAllocationList = mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
|
||||
/* TIME_DOM_RESOURCE_ASSIGNMENT */
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,pdsch_TimeDomainAllocationList,NULL,dlsch_config_pdu_1_0,dci->time_domain_assignment.val,default_abc,rnti==SI_RNTI) < 0) {
|
||||
LOG_W(MAC, "[%d.%d] Invalid time_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot);
|
||||
return -1;
|
||||
}
|
||||
int mappingtype = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType : ((dlsch_config_pdu_1_0->start_symbol <= 3)? typeA: typeB);
|
||||
|
||||
/* dmrs symbol positions*/
|
||||
@@ -858,7 +907,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
dlsch_config_pdu_1_0->accumulated_delta_PUCCH,
|
||||
1+dci->pdsch_to_harq_feedback_timing_indicator.val,
|
||||
dci->dai[0].val,
|
||||
dci_ind->n_CCE,dci_ind->N_CCE,
|
||||
dci_ind->n_CCE,dci_ind->N_CCE,is_common,
|
||||
frame,slot);
|
||||
|
||||
LOG_D(MAC,"(nr_ue_procedures.c) rnti = %x dl_config->number_pdus = %d\n",
|
||||
@@ -924,22 +973,29 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
* 47 DMRS_SEQ_INI:
|
||||
*/
|
||||
|
||||
if (dci->bwp_indicator.val != 1) {
|
||||
LOG_W(MAC, "[%d.%d] bwp_indicator != 1! Possibly due to false DCI. Ignoring DCI!\n", frame, slot);
|
||||
if (dci->bwp_indicator.val > 1) {
|
||||
LOG_W(NR_MAC,"[%d.%d] bwp_indicator %d > 1 Possibly due to false DCI. Ignoring DCI!\n", frame, slot,dci->bwp_indicator.val);
|
||||
return -1;
|
||||
}
|
||||
config_bwp_ue(mac, &dci->bwp_indicator.val, &dci_format);
|
||||
NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id;
|
||||
NR_PDSCH_Config_t *pdsch_config=mac->DLbwp[dl_bwp_id-1]->bwp_Dedicated->pdsch_Config->choice.setup;
|
||||
NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id;
|
||||
NR_PDSCH_Config_t *pdsch_Config=NULL;
|
||||
NR_BWP_DownlinkDedicated_t *bwpd=NULL;
|
||||
NR_BWP_DownlinkCommon_t *bwpc=NULL;
|
||||
NR_BWP_UplinkDedicated_t *ubwpd=NULL;
|
||||
NR_BWP_UplinkCommon_t *ubwpc=NULL;
|
||||
get_bwp_info(mac,dl_bwp_id,ul_bwp_id,&bwpd,&bwpc,&ubwpd,&ubwpc);
|
||||
|
||||
pdsch_Config = bwpd->pdsch_Config->choice.setup;
|
||||
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_DLSCH;
|
||||
dl_config->dl_config_list[dl_config->number_pdus].dlsch_config_pdu.rnti = rnti;
|
||||
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu_1_1 = &dl_config->dl_config_list[dl_config->number_pdus].dlsch_config_pdu.dlsch_config_rel15;
|
||||
|
||||
dlsch_config_pdu_1_1->BWPSize = NRRIV2BW(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
dlsch_config_pdu_1_1->BWPStart = NRRIV2PRBOFFSET(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
dlsch_config_pdu_1_1->SubcarrierSpacing = mac->DLbwp[0]->bwp_Common->genericParameters.subcarrierSpacing;
|
||||
dlsch_config_pdu_1_1->BWPSize = NRRIV2BW(bwpc->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
dlsch_config_pdu_1_1->BWPStart = NRRIV2PRBOFFSET(bwpc->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
dlsch_config_pdu_1_1->SubcarrierSpacing = bwpc->genericParameters.subcarrierSpacing;
|
||||
|
||||
/* IDENTIFIER_DCI_FORMATS */
|
||||
/* CARRIER_IND */
|
||||
@@ -951,38 +1007,28 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
return -1;
|
||||
}
|
||||
/* TIME_DOM_RESOURCE_ASSIGNMENT */
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,dlsch_config_pdu_1_1,dci->time_domain_assignment.val,0,false) < 0) {
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList = choose_dl_tda_list(pdsch_Config,bwpc->pdsch_ConfigCommon->choice.setup);
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,pdsch_TimeDomainAllocationList,NULL,dlsch_config_pdu_1_1,dci->time_domain_assignment.val,0,false) < 0) {
|
||||
LOG_W(MAC, "[%d.%d] Invalid time_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot);
|
||||
return -1;
|
||||
}
|
||||
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList = NULL;
|
||||
if (mac->DLbwp[0] &&
|
||||
mac->DLbwp[0]->bwp_Dedicated &&
|
||||
mac->DLbwp[0]->bwp_Dedicated->pdsch_Config &&
|
||||
mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList)
|
||||
pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList->choice.setup;
|
||||
else if (mac->DLbwp[0] && mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList)
|
||||
pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
else if (mac->scc_SIB && mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup)
|
||||
pdsch_TimeDomainAllocationList = mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
|
||||
int mappingtype = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType : ((dlsch_config_pdu_1_1->start_symbol <= 3)? typeA: typeB);
|
||||
|
||||
/* dmrs symbol positions*/
|
||||
dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config,
|
||||
mac->scc->dmrs_TypeA_Position,
|
||||
dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_Config,
|
||||
mac->scc? mac->scc->dmrs_TypeA_Position:mac->mib->dmrs_TypeA_Position,
|
||||
dlsch_config_pdu_1_1->number_symbols,
|
||||
dlsch_config_pdu_1_1->start_symbol,
|
||||
mappingtype);
|
||||
|
||||
dlsch_config_pdu_1_1->dmrsConfigType = mac->DLbwp[dl_bwp_id-1]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? NFAPI_NR_DMRS_TYPE1 : NFAPI_NR_DMRS_TYPE2;
|
||||
dlsch_config_pdu_1_1->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? NFAPI_NR_DMRS_TYPE1 : NFAPI_NR_DMRS_TYPE2;
|
||||
|
||||
/* TODO: fix number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214,
|
||||
using tables 7.3.1.2.2-1, 7.3.1.2.2-2, 7.3.1.2.2-3, 7.3.1.2.2-4 of 3GPP TS 38.212 */
|
||||
dlsch_config_pdu_1_1->n_dmrs_cdm_groups = 1;
|
||||
/* VRB_TO_PRB_MAPPING */
|
||||
if ((pdsch_config->resourceAllocation == 1) && (pdsch_config->vrb_ToPRB_Interleaver != NULL))
|
||||
if ((pdsch_Config->resourceAllocation == 1) && (pdsch_Config->vrb_ToPRB_Interleaver != NULL))
|
||||
dlsch_config_pdu_1_1->vrb_to_prb_mapping = (dci->vrb_to_prb_mapping.val == 0) ? vrb_to_prb_mapping_non_interleaved:vrb_to_prb_mapping_interleaved;
|
||||
/* PRB_BUNDLING_SIZE_IND */
|
||||
dlsch_config_pdu_1_1->prb_bundling_size_ind = dci->prb_bundling_size_indicator.val;
|
||||
@@ -1023,9 +1069,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
|
||||
// Sanity check for pucch_resource_indicator value received to check for false DCI.
|
||||
valid = 0;
|
||||
pucch_res_set_cnt = mac->ULbwp[0]->bwp_Dedicated->pucch_Config->choice.setup->resourceSetToAddModList->list.count;
|
||||
pucch_res_set_cnt = ubwpd->pucch_Config->choice.setup->resourceSetToAddModList->list.count;
|
||||
for (int id = 0; id < pucch_res_set_cnt; id++) {
|
||||
if (dci->pucch_resource_indicator < mac->ULbwp[0]->bwp_Dedicated->pucch_Config->choice.setup->resourceSetToAddModList->list.array[id]->resourceList.list.count) {
|
||||
if (dci->pucch_resource_indicator < ubwpd->pucch_Config->choice.setup->resourceSetToAddModList->list.array[id]->resourceList.list.count) {
|
||||
valid = 1;
|
||||
break;
|
||||
}
|
||||
@@ -1039,13 +1085,13 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
uint8_t n_codewords = 1; // FIXME!!!
|
||||
long *max_length = NULL;
|
||||
long *dmrs_type = NULL;
|
||||
if (pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA) {
|
||||
max_length = pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->maxLength;
|
||||
dmrs_type = pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type;
|
||||
if (pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA) {
|
||||
max_length = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->maxLength;
|
||||
dmrs_type = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type;
|
||||
}
|
||||
if (pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeB) {
|
||||
max_length = pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->maxLength;
|
||||
dmrs_type = pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->dmrs_Type;
|
||||
if (pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB) {
|
||||
max_length = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->maxLength;
|
||||
dmrs_type = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->dmrs_Type;
|
||||
}
|
||||
if ((dmrs_type == NULL) && (max_length == NULL)){
|
||||
// Table 7.3.1.2.2-1: Antenna port(s) (1000 + DMRS port), dmrs-Type=1, maxLength=1
|
||||
@@ -1140,9 +1186,8 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
|
||||
/* PDSCH_TO_HARQ_FEEDBACK_TIME_IND */
|
||||
// according to TS 38.213 Table 9.2.3-1
|
||||
NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id;
|
||||
uint8_t feedback_ti =
|
||||
mac->ULbwp[ul_bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[dci->pdsch_to_harq_feedback_timing_indicator.val][0];
|
||||
ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[dci->pdsch_to_harq_feedback_timing_indicator.val][0];
|
||||
|
||||
// set the harq status at MAC for feedback
|
||||
set_harq_status(mac,dci->pucch_resource_indicator,
|
||||
@@ -1150,7 +1195,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
dlsch_config_pdu_1_1->accumulated_delta_PUCCH,
|
||||
feedback_ti,
|
||||
dci->dai[0].val,
|
||||
dci_ind->n_CCE,dci_ind->N_CCE,
|
||||
dci_ind->n_CCE,dci_ind->N_CCE,0,
|
||||
frame,slot);
|
||||
|
||||
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_DLSCH;
|
||||
@@ -1158,10 +1203,10 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
|
||||
dl_config->number_pdus = dl_config->number_pdus + 1;
|
||||
/* TODO same calculation for MCS table as done in UL */
|
||||
dlsch_config_pdu_1_1->mcs_table = (pdsch_config->mcs_Table) ? (*pdsch_config->mcs_Table + 1) : 0;
|
||||
dlsch_config_pdu_1_1->mcs_table = (pdsch_Config->mcs_Table) ? (*pdsch_Config->mcs_Table + 1) : 0;
|
||||
/*PTRS configuration */
|
||||
if(mac->DLbwp[dl_bwp_id-1]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS != NULL) {
|
||||
valid_ptrs_setup = set_dl_ptrs_values(mac->DLbwp[dl_bwp_id-1]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup,
|
||||
if(pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS != NULL) {
|
||||
valid_ptrs_setup = set_dl_ptrs_values(pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup,
|
||||
dlsch_config_pdu_1_1->number_rbs, dlsch_config_pdu_1_1->mcs, dlsch_config_pdu_1_1->mcs_table,
|
||||
&dlsch_config_pdu_1_1->PTRSFreqDensity,&dlsch_config_pdu_1_1->PTRSTimeDensity,
|
||||
&dlsch_config_pdu_1_1->PTRSPortIndex,&dlsch_config_pdu_1_1->nEpreRatioOfPDSCHToPTRS,
|
||||
@@ -1220,6 +1265,7 @@ void set_harq_status(NR_UE_MAC_INST_t *mac,
|
||||
uint8_t dai,
|
||||
int n_CCE,
|
||||
int N_CCE,
|
||||
int is_common,
|
||||
frame_t frame,
|
||||
int slot) {
|
||||
|
||||
@@ -1229,6 +1275,7 @@ void set_harq_status(NR_UE_MAC_INST_t *mac,
|
||||
current_harq->ack_received = false;
|
||||
current_harq->pucch_resource_indicator = pucch_id;
|
||||
current_harq->feedback_to_ul = data_toul_fb;
|
||||
current_harq->is_common = is_common;
|
||||
current_harq->dai = dai;
|
||||
current_harq->n_CCE = n_CCE;
|
||||
current_harq->N_CCE = N_CCE;
|
||||
@@ -1237,6 +1284,7 @@ void set_harq_status(NR_UE_MAC_INST_t *mac,
|
||||
current_harq->dl_frame = frame;
|
||||
current_harq->dl_slot = slot;
|
||||
|
||||
LOG_D(PHY,"Setting harq_status for harq_id %d, dl %d.%d\n",harq_id,frame,slot);
|
||||
}
|
||||
|
||||
|
||||
@@ -1249,6 +1297,8 @@ void update_harq_status(nr_downlink_indication_t *dl_info, int pdu_id) {
|
||||
if (current_harq->active) {
|
||||
current_harq->ack = dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.ack_nack;
|
||||
current_harq->ack_received = true;
|
||||
LOG_D(PHY,"Updating harq_status for harq_id %d,ack/nak %d\n",harq_pid,current_harq->ack);
|
||||
|
||||
}
|
||||
else {
|
||||
//shouldn't get here
|
||||
@@ -1290,6 +1340,7 @@ void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac,
|
||||
|
||||
pucch_pdu->rnti = rnti;
|
||||
|
||||
LOG_D(NR_MAC,"initial_pucch_id %d, pucch_resource %p\n",pucch->initial_pucch_id,pucch->pucch_resource);
|
||||
// configure pucch from Table 9.2.1-1
|
||||
if (pucch->initial_pucch_id > -1 &&
|
||||
pucch->pucch_resource == NULL) {
|
||||
@@ -1395,33 +1446,6 @@ void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac,
|
||||
}
|
||||
else AssertFatal(1==0,"no pucch_Config\n");
|
||||
|
||||
NR_PUCCH_ConfigCommon_t *pucch_ConfigCommon;
|
||||
if (mac->scc) pucch_ConfigCommon = mac->scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup;
|
||||
else pucch_ConfigCommon = mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pucch_ConfigCommon->choice.setup;
|
||||
if (pucch_ConfigCommon->hoppingId != NULL)
|
||||
pucch_pdu->hopping_id = *pucch_ConfigCommon->hoppingId;
|
||||
else
|
||||
pucch_pdu->hopping_id = mac->physCellId;
|
||||
|
||||
switch (pucch_ConfigCommon->pucch_GroupHopping){
|
||||
case 0 :
|
||||
// if neither, both disabled
|
||||
pucch_pdu->group_hop_flag = 0;
|
||||
pucch_pdu->sequence_hop_flag = 0;
|
||||
break;
|
||||
case 1 :
|
||||
// if enable, group enabled
|
||||
pucch_pdu->group_hop_flag = 1;
|
||||
pucch_pdu->sequence_hop_flag = 0;
|
||||
break;
|
||||
case 2 :
|
||||
// if disable, sequence disabled
|
||||
pucch_pdu->group_hop_flag = 0;
|
||||
pucch_pdu->sequence_hop_flag = 1;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Group hopping flag undefined (0,1,2) \n");
|
||||
}
|
||||
|
||||
pucch_pdu->prb_start = pucchres->startingPRB;
|
||||
pucch_pdu->freq_hop_flag = pucchres->intraSlotFrequencyHopping!= NULL ? 1 : 0;
|
||||
@@ -1523,6 +1547,7 @@ void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac,
|
||||
default :
|
||||
AssertFatal(1==0,"Undefined PUCCH format \n");
|
||||
}
|
||||
|
||||
pucch_pdu->pucch_tx_power = get_pucch_tx_power_ue(mac,
|
||||
pucch_Config,
|
||||
pucch,
|
||||
@@ -1530,11 +1555,47 @@ void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac,
|
||||
pucch_pdu->prb_size,
|
||||
pucch_pdu->freq_hop_flag,
|
||||
pucch_pdu->add_dmrs_flag,
|
||||
pucch_pdu->nr_of_symbols,
|
||||
subframe_number,
|
||||
O_ACK, O_SR,
|
||||
O_CSI, O_CRC);
|
||||
pucch_pdu->nr_of_symbols,
|
||||
subframe_number,
|
||||
O_ACK, O_SR,
|
||||
O_CSI, O_CRC);
|
||||
}
|
||||
else AssertFatal(1==0,"problem with pucch configuration\n");
|
||||
|
||||
NR_PUCCH_ConfigCommon_t *pucch_ConfigCommon;
|
||||
if (bwp_id>0 &&
|
||||
mac->ULbwp[bwp_id-1] &&
|
||||
mac->ULbwp[bwp_id-1]->bwp_Common &&
|
||||
mac->ULbwp[bwp_id-1]->bwp_Common->pucch_ConfigCommon)
|
||||
pucch_ConfigCommon = mac->ULbwp[bwp_id-1]->bwp_Common->pucch_ConfigCommon->choice.setup;
|
||||
else if (mac->scc) pucch_ConfigCommon = mac->scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup;
|
||||
else pucch_ConfigCommon = mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pucch_ConfigCommon->choice.setup;
|
||||
if (pucch_ConfigCommon->hoppingId != NULL)
|
||||
pucch_pdu->hopping_id = *pucch_ConfigCommon->hoppingId;
|
||||
else
|
||||
pucch_pdu->hopping_id = mac->physCellId;
|
||||
|
||||
switch (pucch_ConfigCommon->pucch_GroupHopping){
|
||||
case 0 :
|
||||
// if neither, both disabled
|
||||
pucch_pdu->group_hop_flag = 0;
|
||||
pucch_pdu->sequence_hop_flag = 0;
|
||||
break;
|
||||
case 1 :
|
||||
// if enable, group enabled
|
||||
pucch_pdu->group_hop_flag = 1;
|
||||
pucch_pdu->sequence_hop_flag = 0;
|
||||
break;
|
||||
case 2 :
|
||||
// if disable, sequence disabled
|
||||
pucch_pdu->group_hop_flag = 0;
|
||||
pucch_pdu->sequence_hop_flag = 1;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Group hopping flag undefined (0,1,2) \n");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1768,7 +1829,8 @@ void select_pucch_resource(NR_UE_MAC_INST_t *mac,
|
||||
NR_BWP_Id_t bwp_id = mac->UL_BWP_Id;
|
||||
int n_list;
|
||||
|
||||
if ((bwp_id == 0 &&
|
||||
if (pucch->is_common == 1 ||
|
||||
(bwp_id == 0 &&
|
||||
mac->cg == NULL) ||
|
||||
(bwp_id == 0 &&
|
||||
mac->cg &&
|
||||
@@ -1888,33 +1950,26 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
|
||||
int V_DAI_m_DL = 0;
|
||||
NR_UE_HARQ_STATUS_t *current_harq;
|
||||
int sched_frame,sched_slot;
|
||||
NR_BWP_UplinkCommon_t *initialUplinkBWP;
|
||||
if (mac->scc) initialUplinkBWP = mac->scc->uplinkConfigCommon->initialUplinkBWP;
|
||||
else initialUplinkBWP = &mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP;
|
||||
int slots_per_frame,scs;
|
||||
|
||||
if (mac->DLbwp[0] &&
|
||||
mac->DLbwp[0]->bwp_Dedicated &&
|
||||
mac->DLbwp[0]->bwp_Dedicated->pdsch_Config &&
|
||||
mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup &&
|
||||
mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI[0] == 2) {
|
||||
NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id;
|
||||
NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id;
|
||||
NR_BWP_DownlinkDedicated_t *bwpd=NULL;
|
||||
NR_BWP_DownlinkCommon_t *bwpc=NULL;
|
||||
NR_BWP_UplinkDedicated_t *ubwpd=NULL;
|
||||
NR_BWP_UplinkCommon_t *ubwpc=NULL;
|
||||
get_bwp_info(mac,dl_bwp_id,ul_bwp_id,&bwpd,&bwpc,&ubwpd,&ubwpc);
|
||||
|
||||
if (bwpd &&
|
||||
bwpd->pdsch_Config &&
|
||||
bwpd->pdsch_Config->choice.setup &&
|
||||
bwpd->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI &&
|
||||
bwpd->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI[0] == 2) {
|
||||
two_transport_blocks = TRUE;
|
||||
number_of_code_word = 2;
|
||||
}
|
||||
else {
|
||||
number_of_code_word = 1;
|
||||
}
|
||||
|
||||
NR_BWP_Uplink_t *ubwp = mac->ULbwp[0];
|
||||
if (mac->cg && ubwp &&
|
||||
mac->cg->spCellConfig &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP) {
|
||||
scs = ubwp->bwp_Common->genericParameters.subcarrierSpacing;
|
||||
}
|
||||
else
|
||||
scs = initialUplinkBWP->genericParameters.subcarrierSpacing;
|
||||
scs = ubwpc->genericParameters.subcarrierSpacing;
|
||||
|
||||
slots_per_frame = nr_slots_per_frame[scs];
|
||||
|
||||
@@ -1933,7 +1988,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
|
||||
sched_slot %= slots_per_frame;
|
||||
sched_frame++;
|
||||
}
|
||||
|
||||
LOG_D(PHY,"HARQ pid %d is active for %d.%d (dl_slot %d, feedback_to_ul %d, is_common %d\n",dl_harq_pid, sched_frame,sched_slot,current_harq->dl_slot,current_harq->feedback_to_ul,current_harq->is_common);
|
||||
/* check if current tx slot should transmit downlink acknowlegment */
|
||||
if (sched_frame == frame && sched_slot == slot) {
|
||||
|
||||
@@ -1966,6 +2021,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
|
||||
pucch->n_CCE = current_harq->n_CCE;
|
||||
pucch->N_CCE = current_harq->N_CCE;
|
||||
pucch->delta_pucch = current_harq->delta_pucch;
|
||||
pucch->is_common = current_harq->is_common;
|
||||
current_harq->active = false;
|
||||
current_harq->ack_received = false;
|
||||
}
|
||||
@@ -1993,7 +2049,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
|
||||
if (mac->cg != NULL &&
|
||||
mac->cg->physicalCellGroupConfig != NULL &&
|
||||
mac->cg->physicalCellGroupConfig->harq_ACK_SpatialBundlingPUCCH != NULL) {
|
||||
int N_TB_max_DL = mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI[0];
|
||||
int N_TB_max_DL = bwpd->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI[0];
|
||||
pucch->n_HARQ_ACK = (((V_DAI_m_DL - U_DAI_c)%4) * N_TB_max_DL) + N_m_c_rx + N_SPS_c;
|
||||
NR_TST_PHY_PRINTF("PUCCH power n(%d) = ( V(%d) - U(%d) )mod4 * N_TB(%d) + N(%d) \n", pucch->n_HARQ_ACK, V_DAI_m_DL, U_DAI_c, N_TB_max_DL, N_m_c_rx);
|
||||
}
|
||||
@@ -2118,7 +2174,9 @@ bool trigger_periodic_scheduling_request(NR_UE_MAC_INST_t *mac,
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup) {
|
||||
pucch_Config = mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup;
|
||||
}
|
||||
if(!pucch_Config || pucch_Config->schedulingRequestResourceToAddModList->list.count==0)
|
||||
if(!pucch_Config ||
|
||||
!pucch_Config->schedulingRequestResourceToAddModList ||
|
||||
pucch_Config->schedulingRequestResourceToAddModList->list.count==0)
|
||||
return false; // SR not configured
|
||||
|
||||
for (int SR_resource_id =0; SR_resource_id < pucch_Config->schedulingRequestResourceToAddModList->list.count;SR_resource_id++) {
|
||||
@@ -2460,7 +2518,7 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
|
||||
switch(rnti_type) {
|
||||
case NR_RNTI_RA:
|
||||
if(mac->scc_SIB) {
|
||||
N_RB = NRRIV2BW(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
N_RB = mac->type0_PDCCH_CSS_config.num_rbs;
|
||||
} else {
|
||||
N_RB = get_n_rb(mac, rnti_type);
|
||||
}
|
||||
@@ -2698,7 +2756,8 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
|
||||
|
||||
// check BWP id
|
||||
if (mac->DLbwp[0]) N_RB=NRRIV2BW(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
else N_RB=NRRIV2BW(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
else N_RB=mac->type0_PDCCH_CSS_config.num_rbs;
|
||||
;
|
||||
|
||||
// indicating a DL DCI format 1bit
|
||||
pos++;
|
||||
@@ -3319,7 +3378,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
|
||||
#endif
|
||||
*/
|
||||
|
||||
LOG_D(MAC, "[%d.%d] Received TA_COMMAND %u TAGID %u CC_id %d\n", frameP, slot, ul_time_alignment->ta_command, ul_time_alignment->tag_id, CC_id);
|
||||
LOG_I(NR_MAC, "[%d.%d] Received TA_COMMAND %u TAGID %u CC_id %d\n", frameP, slot, ul_time_alignment->ta_command, ul_time_alignment->tag_id, CC_id);
|
||||
|
||||
break;
|
||||
case DL_SCH_LCID_CON_RES_ID:
|
||||
|
||||
@@ -306,10 +306,20 @@ void ul_layers_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_con
|
||||
void ul_ports_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, dci_pdu_rel15_t *dci) {
|
||||
|
||||
/* ANTENNA_PORTS */
|
||||
uint8_t rank = 0; // We need to initialize rank FIXME!!!
|
||||
uint8_t rank = 1; // We need to initialize rank FIXME!!!
|
||||
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
NR_PUSCH_Config_t *pusch_Config = mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup;
|
||||
NR_BWP_UplinkDedicated_t *ubwpd=NULL;
|
||||
|
||||
if (mac->cg &&
|
||||
mac->cg->spCellConfig &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP)
|
||||
ubwpd = mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP;
|
||||
|
||||
NR_PUSCH_Config_t *pusch_Config = mac->ULbwp[0] ? mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup : (ubwpd?ubwpd->pusch_Config->choice.setup:NULL);
|
||||
AssertFatal(pusch_Config!=NULL,"pusch_Config shouldn't be null\n");
|
||||
|
||||
long transformPrecoder;
|
||||
if (pusch_Config->transformPrecoder)
|
||||
@@ -322,6 +332,8 @@ void ul_ports_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_conf
|
||||
}
|
||||
long *max_length = NULL;
|
||||
long *dmrs_type = NULL;
|
||||
LOG_D(NR_MAC,"transformPrecoder %s\n",transformPrecoder==NR_PUSCH_Config__transformPrecoder_disabled?"disabled":"enabled");
|
||||
|
||||
if (pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA) {
|
||||
max_length = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup->maxLength;
|
||||
dmrs_type = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup->dmrs_Type;
|
||||
@@ -331,7 +343,7 @@ void ul_ports_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_conf
|
||||
dmrs_type = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->dmrs_Type;
|
||||
}
|
||||
|
||||
|
||||
LOG_D(NR_MAC,"MappingType%s max_length %s, dmrs_type %s, antenna_ports %d\n",pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA?"A":"B",max_length?"len2":"len1",dmrs_type?"type2":"type1",dci->antenna_ports.val);
|
||||
if ((transformPrecoder == NR_PUSCH_Config__transformPrecoder_enabled) &&
|
||||
(dmrs_type == NULL) && (max_length == NULL)) { // tables 7.3.1.1.2-6
|
||||
pusch_config_pdu->num_dmrs_cdm_grps_no_data = 2; //TBC
|
||||
@@ -486,6 +498,7 @@ void ul_ports_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_conf
|
||||
//pusch_config_pdu->n_front_load_symb = table_7_3_1_1_2_23[dci->antenna_ports.val][5]; //FIXME
|
||||
}
|
||||
}
|
||||
LOG_D(NR_MAC,"num_dmrs_cdm_grps_no_data %d, dmrs_ports %d\n",pusch_config_pdu->num_dmrs_cdm_grps_no_data,pusch_config_pdu->dmrs_ports);
|
||||
}
|
||||
|
||||
// Configuration of Msg3 PDU according to clauses:
|
||||
@@ -631,22 +644,23 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
pusch_config_pdu->pusch_data.num_cb = 0;
|
||||
|
||||
} else if (dci) {
|
||||
NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id;
|
||||
NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id;
|
||||
NR_BWP_DownlinkDedicated_t *bwpd=NULL;
|
||||
NR_BWP_DownlinkCommon_t *bwpc=NULL;
|
||||
NR_BWP_UplinkDedicated_t *ubwpd=NULL;
|
||||
NR_BWP_UplinkCommon_t *ubwpc=NULL;
|
||||
get_bwp_info(mac,dl_bwp_id,ul_bwp_id,&bwpd,&bwpc,&ubwpd,&ubwpc);
|
||||
|
||||
int target_ss;
|
||||
bool valid_ptrs_setup = 0;
|
||||
uint16_t n_RB_ULBWP;
|
||||
if (mac->ULbwp[0] && mac->ULbwp[0]->bwp_Common) {
|
||||
n_RB_ULBWP = NRRIV2BW(mac->ULbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
pusch_config_pdu->bwp_start = NRRIV2PRBOFFSET(mac->ULbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
}
|
||||
else {
|
||||
pusch_config_pdu->bwp_start = NRRIV2PRBOFFSET(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
n_RB_ULBWP = NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
}
|
||||
|
||||
n_RB_ULBWP = NRRIV2BW(ubwpc->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
pusch_config_pdu->bwp_start = NRRIV2PRBOFFSET(ubwpc->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
pusch_config_pdu->bwp_size = n_RB_ULBWP;
|
||||
|
||||
NR_PUSCH_Config_t *pusch_Config = mac->ULbwp[0] ? mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup : NULL;
|
||||
AssertFatal(ubwpd->pusch_Config != NULL,"pusch_Config shouldn't be null\n");
|
||||
NR_PUSCH_Config_t *pusch_Config = ubwpd->pusch_Config->choice.setup;
|
||||
|
||||
// Basic sanity check for MCS value to check for a false or erroneous DCI
|
||||
if (dci->mcs > 28) {
|
||||
@@ -666,12 +680,9 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
|
||||
} else if (*dci_format == NR_UL_DCI_FORMAT_0_1) {
|
||||
|
||||
/* BANDWIDTH_PART_IND */
|
||||
if (dci->bwp_indicator.val != 1) {
|
||||
LOG_W(NR_MAC, "bwp_indicator != 1! Possibly due to false DCI. Ignoring DCI!\n");
|
||||
return -1;
|
||||
}
|
||||
config_bwp_ue(mac, &dci->bwp_indicator.val, dci_format);
|
||||
get_bwp_info(mac,dl_bwp_id,ul_bwp_id,&bwpd,&bwpc,&ubwpd,&ubwpc);
|
||||
|
||||
target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
|
||||
ul_layers_config(mac, pusch_config_pdu, dci);
|
||||
ul_ports_config(mac, pusch_config_pdu, dci);
|
||||
@@ -682,21 +693,8 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = NULL;
|
||||
if (pusch_Config && pusch_Config->pusch_TimeDomainAllocationList) {
|
||||
pusch_TimeDomainAllocationList = pusch_Config->pusch_TimeDomainAllocationList->choice.setup;
|
||||
}
|
||||
else if (mac->ULbwp[0] &&
|
||||
mac->ULbwp[0]->bwp_Common&&
|
||||
mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon&&
|
||||
mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup &&
|
||||
mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList) {
|
||||
pusch_TimeDomainAllocationList = mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
}
|
||||
else if (mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList)
|
||||
pusch_TimeDomainAllocationList=mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
else AssertFatal(1==0,"need to fall back to default PUSCH time-domain allocations\n");
|
||||
NR_PUSCH_ConfigCommon_t *pusch_ConfigCommon = ubwpc->pusch_ConfigCommon->choice.setup;
|
||||
NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = choose_ul_tda_list(pusch_Config,pusch_ConfigCommon);
|
||||
|
||||
int mappingtype = pusch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType;
|
||||
|
||||
@@ -740,7 +738,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
return -1;
|
||||
}
|
||||
/* TIME_DOM_RESOURCE_ASSIGNMENT */
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac, pusch_config_pdu, NULL, dci->time_domain_assignment.val,0,false) < 0) {
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac, pusch_TimeDomainAllocationList, NULL, pusch_config_pdu, NULL, dci->time_domain_assignment.val,0,false) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -949,11 +947,11 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
||||
if (ulcfg_pdu->pdu_type == FAPI_NR_UL_CONFIG_TYPE_PUSCH) {
|
||||
|
||||
uint16_t TBS_bytes = ulcfg_pdu->pusch_config_pdu.pusch_data.tb_size;
|
||||
LOG_D(NR_MAC,"harq_id %d, NDI %d NDI_DCI %d, TBS_bytes %d\n",
|
||||
LOG_D(NR_MAC,"harq_id %d, NDI %d NDI_DCI %d, TBS_bytes %d (ra_state %d)\n",
|
||||
ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id,
|
||||
mac->UL_ndi[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id],
|
||||
ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator,
|
||||
TBS_bytes);
|
||||
TBS_bytes,ra->ra_state);
|
||||
if (ra->ra_state == WAIT_RAR && !ra->cfra){
|
||||
memcpy(ulsch_input_buffer, mac->ulsch_pdu.payload, TBS_bytes);
|
||||
LOG_D(NR_MAC,"[RAPROC] Msg3 to be transmitted:\n");
|
||||
@@ -972,7 +970,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
||||
(ra->ra_state == WAIT_RAR && ra->cfra))){
|
||||
|
||||
// Getting IP traffic to be transmitted
|
||||
nr_ue_get_sdu(mod_id, frame_tx, slot_tx, gNB_index, ulsch_input_buffer, TBS_bytes);
|
||||
nr_ue_get_sdu(mod_id, cc_id,frame_tx, slot_tx, gNB_index, ulsch_input_buffer, TBS_bytes);
|
||||
}
|
||||
|
||||
LOG_D(NR_MAC,"Flipping NDI for harq_id %d\n",ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator);
|
||||
@@ -1075,6 +1073,7 @@ int nr_ue_pusch_scheduler(NR_UE_MAC_INST_t *mac,
|
||||
// Get slot offset K2 which will be used to calculate TX slot
|
||||
k2 = get_k2(mac, tda_id);
|
||||
if (k2 < 0) { // This can happen when a false DCI is received
|
||||
LOG_W(PHY,"%d.%d. Received k2 %d, tda_id %d\n",current_frame,current_slot,k2,tda_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1825,6 +1824,7 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
|
||||
pucch,
|
||||
pucch_pdu,
|
||||
O_SR, O_ACK, O_CSI);
|
||||
LOG_D(NR_MAC,"Configuring pucch, is_common = %d\n",pucch->is_common);
|
||||
fill_ul_config(ul_config, frameP, slotP, FAPI_NR_UL_CONFIG_TYPE_PUCCH);
|
||||
nr_scheduled_response_t scheduled_response;
|
||||
fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id);
|
||||
@@ -2057,6 +2057,7 @@ void nr_ue_sib1_scheduler(module_id_t module_idP,
|
||||
to generate the complete MAC PDU with sub-headers and MAC CEs according to ULSCH MAC PDU generation (6.1.2 TS 38.321)
|
||||
the selected sub-header for the payload sub-PDUs is NR_MAC_SUBHEADER_LONG
|
||||
* @module_idP Module ID
|
||||
* @CC_id Component Carrier index
|
||||
* @frameP current UL frame
|
||||
* @subframe current UL slot
|
||||
* @gNB_index gNB index
|
||||
@@ -2064,6 +2065,7 @@ void nr_ue_sib1_scheduler(module_id_t module_idP,
|
||||
* @buflen TBS
|
||||
*/
|
||||
uint8_t nr_ue_get_sdu(module_id_t module_idP,
|
||||
int CC_id,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframe,
|
||||
uint8_t gNB_index,
|
||||
|
||||
@@ -318,7 +318,17 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
|
||||
scs_scaling = scs_scaling>>2;
|
||||
uint32_t absolute_diff = (*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
|
||||
uint16_t sco = absolute_diff%(12*scs_scaling);
|
||||
AssertFatal(sco==0,"absoluteFrequencySSB has a subcarrier offset of %d while it should be alligned with CRBs\n",sco);
|
||||
|
||||
if (get_softmodem_params()->phy_test || get_softmodem_params()->do_ra || get_softmodem_params()->sa) {
|
||||
AssertFatal(sco==(scs_scaling * ssb_SubcarrierOffset),"absoluteFrequencySSB has a subcarrier offset of %d while it should be %d\n",sco/scs_scaling,ssb_SubcarrierOffset);
|
||||
} else {
|
||||
if(frequency_range == FR1) {
|
||||
AssertFatal(ssb_SubcarrierOffset>=24,"ssb_SubcarrierOffset must be equal or higher than 24\n");
|
||||
} else {
|
||||
AssertFatal(ssb_SubcarrierOffset>=12,"ssb_SubcarrierOffset must be equal or higher than 12\n");
|
||||
}
|
||||
}
|
||||
|
||||
cfg->ssb_table.ssb_offset_point_a.value = absolute_diff/(12*scs_scaling) - 10; //absoluteFrequencySSB is the central frequency of SSB which is made by 20RBs in total
|
||||
cfg->ssb_table.ssb_offset_point_a.tl.tag = NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG;
|
||||
cfg->num_tlv++;
|
||||
@@ -421,9 +431,10 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int pusch_AntennaPorts,
|
||||
int sib1_tda,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
int add_ue,
|
||||
NR_BCCH_BCH_Message_t *mib,
|
||||
int add_ue,
|
||||
uint32_t rnti,
|
||||
NR_CellGroupConfig_t *CellGroup) {
|
||||
NR_CellGroupConfig_t *CellGroup) {
|
||||
|
||||
if (scc != NULL ) {
|
||||
AssertFatal((scc->ssb_PositionsInBurst->present > 0) && (scc->ssb_PositionsInBurst->present < 4), "SSB Bitmap type %d is not valid\n",scc->ssb_PositionsInBurst->present);
|
||||
@@ -458,7 +469,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
ssb_SubcarrierOffset,
|
||||
pdsch_AntennaPorts,
|
||||
pusch_AntennaPorts,
|
||||
scc);
|
||||
scc);
|
||||
LOG_D(NR_MAC, "%s() %s:%d RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req);
|
||||
|
||||
// if in nFAPI mode
|
||||
@@ -519,7 +530,9 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mib) RC.nrmac[Mod_idP]->common_channels[0].mib = mib;
|
||||
|
||||
if (CellGroup) {
|
||||
|
||||
const NR_ServingCellConfig_t *servingCellConfig = CellGroup->spCellConfig->spCellConfigDedicated;
|
||||
@@ -592,9 +605,26 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
LOG_I(NR_MAC,"Added new RA process for UE RNTI %04x with initial CellGroup\n", rnti);
|
||||
} else { // CellGroup has been updated
|
||||
const int UE_id = find_nr_UE_id(Mod_idP,rnti);
|
||||
int target_ss;
|
||||
UE_info->CellGroup[UE_id] = CellGroup;
|
||||
LOG_I(NR_MAC,"Modified UE_id %d/%x with CellGroup\n",UE_id,rnti);
|
||||
process_CellGroup(CellGroup,&UE_info->UE_sched_ctrl[UE_id]);
|
||||
// update coreset/searchspace
|
||||
void *bwpd = NULL;
|
||||
target_ss = NR_SearchSpace__searchSpaceType_PR_common;
|
||||
if ((UE_info->UE_sched_ctrl[UE_id].active_bwp)) {
|
||||
target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
|
||||
bwpd = (void*)UE_info->UE_sched_ctrl[UE_id].active_bwp->bwp_Dedicated;
|
||||
}
|
||||
else if (CellGroup->spCellConfig &&
|
||||
CellGroup->spCellConfig->spCellConfigDedicated &&
|
||||
(CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP)) {
|
||||
target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
|
||||
bwpd = (void*)CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP;
|
||||
}
|
||||
UE_info->UE_sched_ctrl[UE_id].search_space = get_searchspace(scc, bwpd, target_ss);
|
||||
UE_info->UE_sched_ctrl[UE_id].coreset = get_coreset(scc, bwpd, UE_info->UE_sched_ctrl[UE_id].search_space, target_ss);
|
||||
UE_info->UE_sched_ctrl[UE_id].maxL = 2;
|
||||
}
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT);
|
||||
|
||||
@@ -76,26 +76,34 @@ void dump_mac_stats(gNB_MAC_INST *gNB)
|
||||
memset(output,0,MACSTATSSTRLEN);
|
||||
int stroff=0;
|
||||
for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) {
|
||||
stroff = sprintf(output,"UE ID %d RNTI %04x (%d/%d)\n", UE_id, UE_info->rnti[UE_id], num++, UE_info->num_UEs);
|
||||
LOG_I(NR_MAC, "UE ID %d RNTI %04x (%d/%d) PH %d dB PCMAX %d dBm\n",
|
||||
|
||||
stroff+=sprintf(output+stroff,"UE ID %d RNTI %04x (%d/%d) PH %d dB PCMAX %d dBm\n",
|
||||
UE_id,
|
||||
UE_info->rnti[UE_id],
|
||||
num++,
|
||||
UE_info->num_UEs,
|
||||
UE_info->UE_sched_ctrl[UE_id].ph,
|
||||
UE_info->UE_sched_ctrl[UE_id].pcmax);
|
||||
|
||||
LOG_I(NR_MAC, "UE ID %d RNTI %04x (%d/%d) PH %d dB PCMAX %d dBm\n",
|
||||
UE_id,
|
||||
UE_info->rnti[UE_id],
|
||||
num++,
|
||||
UE_info->num_UEs,
|
||||
UE_info->UE_sched_ctrl[UE_id].ph,
|
||||
UE_info->UE_sched_ctrl[UE_id].pcmax);
|
||||
|
||||
NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id];
|
||||
const int avg_rsrp = stats->num_rsrp_meas > 0 ? stats->cumul_rsrp / stats->num_rsrp_meas : 0;
|
||||
stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, average RSRP %d (%d meas)\n",
|
||||
stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, pucch0_DTX %d average RSRP %d (%d meas)\n",
|
||||
UE_id,
|
||||
stats->dlsch_rounds[0], stats->dlsch_rounds[1],
|
||||
stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors,
|
||||
stats->pucch0_DTX,
|
||||
avg_rsrp, stats->num_rsrp_meas);
|
||||
LOG_I(NR_MAC, "UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, average RSRP %d (%d meas)\n",
|
||||
UE_id,
|
||||
stats->dlsch_rounds[0], stats->dlsch_rounds[1],
|
||||
stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors,
|
||||
avg_rsrp, stats->num_rsrp_meas);
|
||||
LOG_I(NR_MAC, "UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, pucch0_DTX %d\n",
|
||||
UE_id, stats->dlsch_rounds[0], stats->dlsch_rounds[1], stats->dlsch_rounds[2], stats->dlsch_rounds[3],
|
||||
stats->dlsch_errors, stats->pucch0_DTX);
|
||||
stats->num_rsrp_meas = 0;
|
||||
stats->cumul_rsrp = 0 ;
|
||||
stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes);
|
||||
@@ -110,14 +118,11 @@ void dump_mac_stats(gNB_MAC_INST *gNB)
|
||||
UE_id,
|
||||
stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx);
|
||||
LOG_I(NR_MAC, "UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes);
|
||||
LOG_I(NR_MAC, "UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_DTX %d, ulsch_errors %d\n",
|
||||
UE_id,
|
||||
stats->ulsch_rounds[0], stats->ulsch_rounds[1],
|
||||
stats->ulsch_rounds[2], stats->ulsch_rounds[3],
|
||||
stats->ulsch_DTX,
|
||||
stats->ulsch_errors);
|
||||
LOG_I(NR_MAC, "UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_errors %d, ulsch_DTX %d\n",
|
||||
UE_id, stats->ulsch_rounds[0], stats->ulsch_rounds[1], stats->ulsch_rounds[2], stats->ulsch_rounds[3],
|
||||
stats->ulsch_errors, stats->ulsch_DTX);
|
||||
LOG_I(NR_MAC,
|
||||
"UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n",
|
||||
"UE %d: ulsch_total_bytes (scheduled/received): %d / %d\n",
|
||||
UE_id,
|
||||
stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx);
|
||||
for (int lc_id = 0; lc_id < 63; lc_id++) {
|
||||
@@ -385,6 +390,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
}
|
||||
|
||||
memset(RC.nrmac[module_idP]->cce_list[0][0],0,MAX_NUM_CCE*sizeof(int)); // coreset0
|
||||
memset(RC.nrmac[module_idP]->cce_list[0][1],0,MAX_NUM_CCE*sizeof(int)); // coreset1 on initialBWP
|
||||
memset(RC.nrmac[module_idP]->cce_list[bwp_id][1],0,MAX_NUM_CCE*sizeof(int)); // coresetid 1
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[module_idP]->UE_info;
|
||||
for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id])
|
||||
|
||||
@@ -705,20 +705,22 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t
|
||||
NR_COMMON_channels_t *cc = &nr_mac->common_channels[CC_id];
|
||||
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
|
||||
|
||||
NR_BWP_Uplink_t *ubwp = ra->CellGroup ?
|
||||
ra->CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[ra->bwp_id-1] :
|
||||
NULL;
|
||||
|
||||
NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList= ubwp ?
|
||||
ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList:
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
|
||||
int mu = ubwp ?
|
||||
ubwp->bwp_Common->genericParameters.subcarrierSpacing :
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing;
|
||||
NR_BWP_Uplink_t *ubwp = NULL;
|
||||
NR_BWP_UplinkDedicated_t *ubwpd = NULL;
|
||||
NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = NULL;
|
||||
NR_BWP_t *genericParameters = NULL;
|
||||
if(ra->CellGroup) {
|
||||
ubwp = ra->CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[ra->bwp_id-1];
|
||||
ubwpd = ra->CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP;
|
||||
genericParameters = &ubwp->bwp_Common->genericParameters;
|
||||
pusch_TimeDomainAllocationList = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
} else {
|
||||
genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
|
||||
pusch_TimeDomainAllocationList = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
}
|
||||
|
||||
int mu = genericParameters->subcarrierSpacing;
|
||||
uint8_t K2 = *pusch_TimeDomainAllocationList->list.array[ra->Msg3_tda_id]->k2;
|
||||
|
||||
const int sched_frame = frame + (slot + K2 >= nr_slots_per_frame[mu]);
|
||||
const int sched_slot = (slot + K2) % nr_slots_per_frame[mu];
|
||||
|
||||
@@ -736,36 +738,23 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t
|
||||
tdd_beam_association[num_tdd_period] = ra->beam_id;
|
||||
}
|
||||
|
||||
int bwpSize = NRRIV2BW(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
int bwpStart = NRRIV2PRBOFFSET(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
int scs = scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing;
|
||||
int fh = 0;
|
||||
int startSymbolAndLength = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[ra->Msg3_tda_id]->startSymbolAndLength;
|
||||
int mappingtype = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[ra->Msg3_tda_id]->mappingType;
|
||||
|
||||
if (ra->CellGroup) {
|
||||
AssertFatal(ra->CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count == 1,
|
||||
"downlinkBWP_ToAddModList has %d BWP!\n", ra->CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count);
|
||||
int act_bwp_start = NRRIV2PRBOFFSET(ubwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
int act_bwp_size = NRRIV2BW(ubwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
startSymbolAndLength = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[ra->Msg3_tda_id]->startSymbolAndLength;
|
||||
mappingtype = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[ra->Msg3_tda_id]->mappingType;
|
||||
scs = ubwp->bwp_Common->genericParameters.subcarrierSpacing;
|
||||
fh = ubwp->bwp_Dedicated->pusch_Config->choice.setup->frequencyHopping ? 1 : 0;
|
||||
if ((bwpStart < act_bwp_start) || (bwpSize > act_bwp_size))
|
||||
bwpStart = act_bwp_start;
|
||||
}
|
||||
uint16_t *vrb_map_UL =
|
||||
&RC.nrmac[module_idP]->common_channels[CC_id].vrb_map_UL[sched_slot * MAX_BWP_SIZE];
|
||||
uint16_t *vrb_map_UL = &RC.nrmac[module_idP]->common_channels[CC_id].vrb_map_UL[sched_slot * MAX_BWP_SIZE];
|
||||
|
||||
int BWPStart = nr_mac->type0_PDCCH_CSS_config[ra->beam_id].cset_start_rb;
|
||||
int BWPSize = nr_mac->type0_PDCCH_CSS_config[ra->beam_id].num_rbs;
|
||||
int rbStart = 0;
|
||||
for (int i = 0; (i < ra->msg3_nb_rb) && (rbStart <= (bwpSize - ra->msg3_nb_rb)); i++) {
|
||||
if (vrb_map_UL[rbStart + bwpStart + i]) {
|
||||
for (int i = 0; (i < ra->msg3_nb_rb) && (rbStart <= (BWPSize - ra->msg3_nb_rb)); i++) {
|
||||
if (vrb_map_UL[rbStart + BWPStart + i]) {
|
||||
rbStart += i;
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
if (rbStart > (bwpSize - ra->msg3_nb_rb)) {
|
||||
if (rbStart > (BWPSize - ra->msg3_nb_rb)) {
|
||||
// cannot find free vrb_map for msg3 retransmission in this slot
|
||||
return;
|
||||
}
|
||||
@@ -790,33 +779,17 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t
|
||||
ra->msg3_round,
|
||||
startSymbolAndLength,
|
||||
ra->rnti, scs,
|
||||
bwpSize, bwpStart,
|
||||
BWPSize, BWPStart,
|
||||
mappingtype, fh,
|
||||
rbStart, ra->msg3_nb_rb);
|
||||
future_ul_tti_req->n_pdus += 1;
|
||||
|
||||
// generation of DCI 0_0 to schedule msg3 retransmission
|
||||
NR_SearchSpace_t *ss = ra->ra_ss;
|
||||
NR_BWP_Downlink_t *bwp = NULL;
|
||||
NR_ControlResourceSet_t *coreset = NULL;
|
||||
NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config = *ss->controlResourceSetId==0 ? &nr_mac->type0_PDCCH_CSS_config[ra->beam_id] : NULL;
|
||||
|
||||
NR_BWP_t *genericParameters = NULL;
|
||||
if (ra->CellGroup &&
|
||||
ra->CellGroup->spCellConfig &&
|
||||
ra->CellGroup->spCellConfig->spCellConfigDedicated &&
|
||||
ra->CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList &&
|
||||
ra->CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[ra->bwp_id-1]) {
|
||||
bwp = ra->CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[ra->bwp_id-1];
|
||||
genericParameters = &bwp->bwp_Common->genericParameters;
|
||||
}
|
||||
else {
|
||||
genericParameters= &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
|
||||
}
|
||||
|
||||
if (*ss->controlResourceSetId == 0)
|
||||
coreset = nr_mac->sched_ctrlCommon->coreset; // this is coreset 0
|
||||
else
|
||||
coreset = get_coreset(scc, bwp, ss, NR_SearchSpace__searchSpaceType_PR_common);
|
||||
coreset = nr_mac->sched_ctrlCommon->coreset; // this is coreset 0
|
||||
AssertFatal(coreset!=NULL,"Coreset cannot be null for RA-Msg3 retransmission\n");
|
||||
|
||||
nfapi_nr_ul_dci_request_t *ul_dci_req = &nr_mac->UL_dci_req[CC_id];
|
||||
@@ -830,14 +803,14 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t
|
||||
ul_dci_request_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu));
|
||||
pdcch_pdu_rel15 = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15;
|
||||
ul_dci_req->numPdus += 1;
|
||||
nr_configure_pdcch(pdcch_pdu_rel15, ss, coreset, scc, genericParameters, NULL);
|
||||
nr_configure_pdcch(pdcch_pdu_rel15, ss, coreset, scc, genericParameters, type0_PDCCH_CSS_config);
|
||||
nr_mac->pdcch_pdu_idx[CC_id][ra->bwp_id][coresetid] = pdcch_pdu_rel15;
|
||||
}
|
||||
|
||||
uint8_t aggregation_level;
|
||||
uint8_t nr_of_candidates;
|
||||
find_aggregation_candidates(&aggregation_level, &nr_of_candidates, ss);
|
||||
int CCEIndex = allocate_nr_CCEs(nr_mac, bwp, coreset, aggregation_level, 0, 0, nr_of_candidates);
|
||||
find_aggregation_candidates(&aggregation_level, &nr_of_candidates, ss, 4);
|
||||
int CCEIndex = allocate_nr_CCEs(nr_mac, NULL, coreset, aggregation_level, 0, 0, nr_of_candidates);
|
||||
if (CCEIndex < 0) {
|
||||
LOG_E(NR_MAC, "%s(): cannot find free CCE for RA RNTI %04x!\n", __func__, ra->rnti);
|
||||
return;
|
||||
@@ -858,6 +831,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t
|
||||
memset(&uldci_payload, 0, sizeof(uldci_payload));
|
||||
|
||||
config_uldci(ubwp,
|
||||
ubwpd,
|
||||
scc,
|
||||
pusch_pdu,
|
||||
&uldci_payload,
|
||||
@@ -878,7 +852,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t
|
||||
|
||||
// Mark the corresponding RBs as used
|
||||
for (int rb = 0; rb < ra->msg3_nb_rb; rb++) {
|
||||
vrb_map_UL[rbStart + bwpStart + rb] = 1;
|
||||
vrb_map_UL[rbStart + BWPStart + rb] = 1;
|
||||
}
|
||||
|
||||
// reset state to wait msg3
|
||||
@@ -1150,13 +1124,10 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
|
||||
NR_SearchSpace_t *ss = ra->ra_ss;
|
||||
|
||||
long BWPSize = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
|
||||
NR_BWP_Downlink_t *bwp = NULL;
|
||||
NR_ControlResourceSet_t *coreset = NULL;
|
||||
NR_BWP_t *genericParameters = NULL;
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList=NULL;
|
||||
long BWPStart = 0;
|
||||
|
||||
if (ra->CellGroup &&
|
||||
ra->CellGroup->spCellConfig &&
|
||||
@@ -1171,7 +1142,18 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
genericParameters= &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
|
||||
pdsch_TimeDomainAllocationList = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
}
|
||||
BWPStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
|
||||
long BWPStart = 0;
|
||||
long BWPSize = 0;
|
||||
NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config = NULL;
|
||||
if(*ss->controlResourceSetId!=0) {
|
||||
BWPStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
BWPSize = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
} else {
|
||||
type0_PDCCH_CSS_config = &nr_mac->type0_PDCCH_CSS_config[ra->beam_id];
|
||||
BWPStart = type0_PDCCH_CSS_config->cset_start_rb;
|
||||
BWPSize = type0_PDCCH_CSS_config->num_rbs;
|
||||
}
|
||||
|
||||
if (*ss->controlResourceSetId == 0)
|
||||
coreset = nr_mac->sched_ctrlCommon->coreset; // this is coreset 0
|
||||
@@ -1202,7 +1184,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
|
||||
uint8_t aggregation_level;
|
||||
uint8_t nr_of_candidates;
|
||||
find_aggregation_candidates(&aggregation_level, &nr_of_candidates, ss);
|
||||
find_aggregation_candidates(&aggregation_level, &nr_of_candidates, ss,4);
|
||||
int CCEIndex = allocate_nr_CCEs(nr_mac, bwp, coreset, aggregation_level,0,0,nr_of_candidates);
|
||||
if (CCEIndex < 0) {
|
||||
LOG_E(NR_MAC, "%s(): cannot find free CCE for RA RNTI %04x!\n", __func__, ra->rnti);
|
||||
@@ -1215,7 +1197,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols);
|
||||
AssertFatal(startSymbolIndex >= 0, "StartSymbolIndex is negative\n");
|
||||
|
||||
LOG_D(MAC,"Msg2 startSymbolIndex.nrOfSymbols %d.%d\n",startSymbolIndex,nrOfSymbols);
|
||||
LOG_D(NR_MAC,"Msg2 startSymbolIndex.nrOfSymbols %d.%d\n",startSymbolIndex,nrOfSymbols);
|
||||
|
||||
int mappingtype = pdsch_TimeDomainAllocationList->list.array[time_domain_assignment]->mappingType;
|
||||
|
||||
@@ -1231,7 +1213,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2 + sizeof(nfapi_nr_dl_tti_pdcch_pdu));
|
||||
dl_req->nPDUs += 1;
|
||||
pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15;
|
||||
nr_configure_pdcch(pdcch_pdu_rel15, ss, coreset, scc, genericParameters, NULL);
|
||||
nr_configure_pdcch(pdcch_pdu_rel15, ss, coreset, scc, genericParameters, type0_PDCCH_CSS_config);
|
||||
nr_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid] = pdcch_pdu_rel15;
|
||||
}
|
||||
|
||||
@@ -1242,8 +1224,8 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
dl_req->nPDUs+=1;
|
||||
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdsch_pdu->pdsch_pdu.pdsch_pdu_rel15;
|
||||
|
||||
LOG_I(NR_MAC,"[gNB %d][RAPROC] CC_id %d Frame %d, slotP %d: Generating RA-Msg2 DCI, rnti 0x%x, state %d\n",
|
||||
module_idP, CC_id, frameP, slotP, ra->RA_rnti, ra->state);
|
||||
LOG_I(NR_MAC,"[gNB %d][RAPROC] CC_id %d Frame %d, slotP %d: Generating RA-Msg2 DCI, rnti 0x%x, state %d, CoreSetType %d\n",
|
||||
module_idP, CC_id, frameP, slotP, ra->RA_rnti, ra->state,pdcch_pdu_rel15->CoreSetType);
|
||||
|
||||
// SCF222: PDU index incremented for each PDSCH PDU sent in TX control message. This is used to associate control
|
||||
// information to data and is reset every slot.
|
||||
@@ -1322,9 +1304,14 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
dci_pdu->powerControlOffsetSS = 1;
|
||||
|
||||
dci_pdu_rel15_t dci_payload;
|
||||
int effective_BWPSize = get_softmodem_params()->sa == 1 ? (pdcch_pdu_rel15->FreqDomainResource[0]==0xFF ? 48 : 24) : pdsch_pdu_rel15->BWPSize;
|
||||
dci_payload.frequency_domain_assignment.val = PRBalloc_to_locationandbandwidth0(pdsch_pdu_rel15->rbSize,
|
||||
pdsch_pdu_rel15->rbStart,
|
||||
pdsch_pdu_rel15->BWPSize);
|
||||
effective_BWPSize);
|
||||
|
||||
LOG_D(NR_MAC,"Msg2 rbSize.rbStart.BWPsize %d.%d.%d\n",pdsch_pdu_rel15->rbSize,
|
||||
pdsch_pdu_rel15->rbStart,
|
||||
effective_BWPSize);
|
||||
|
||||
dci_payload.time_domain_assignment.val = time_domain_assignment;
|
||||
dci_payload.vrb_to_prb_mapping.val = 0;
|
||||
@@ -1336,7 +1323,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
dci_payload.frequency_domain_assignment.val,
|
||||
pdsch_pdu_rel15->rbStart,
|
||||
pdsch_pdu_rel15->rbSize,
|
||||
pdsch_pdu_rel15->BWPSize,
|
||||
effective_BWPSize,
|
||||
dci_payload.time_domain_assignment.val,
|
||||
dci_payload.vrb_to_prb_mapping.val,
|
||||
dci_payload.mcs,
|
||||
@@ -1347,7 +1334,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
pdcch_pdu_rel15->dci_pdu[0].RNTI,
|
||||
NR_RNTI_RA,
|
||||
NR_DL_DCI_FORMAT_1_0,
|
||||
(unsigned long long)pdcch_pdu_rel15->FreqDomainResource,
|
||||
*(unsigned long long *)pdcch_pdu_rel15->FreqDomainResource,
|
||||
pdcch_pdu_rel15->StartSymbolIndex,
|
||||
pdcch_pdu_rel15->DurationSymbols);
|
||||
|
||||
@@ -1357,7 +1344,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
&dci_payload,
|
||||
NR_DL_DCI_FORMAT_1_0,
|
||||
NR_RNTI_RA,
|
||||
pdsch_pdu_rel15->BWPSize,
|
||||
effective_BWPSize,
|
||||
bwpid);
|
||||
|
||||
// DL TX request
|
||||
@@ -1391,7 +1378,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
}
|
||||
|
||||
ra->state = WAIT_Msg3;
|
||||
LOG_I(NR_MAC,"[gNB %d][RAPROC] Frame %d, Subframe %d: RA state %d\n", module_idP, frameP, slotP, ra->state);
|
||||
LOG_D(NR_MAC,"[gNB %d][RAPROC] Frame %d, Subframe %d: RA state %d\n", module_idP, frameP, slotP, ra->state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1410,7 +1397,6 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
|
||||
NR_BWP_Downlink_t *bwp = NULL;
|
||||
NR_ControlResourceSet_t *coreset = NULL;
|
||||
NR_BWP_t *genericParameters = NULL;
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList=NULL;
|
||||
|
||||
if (ra->CellGroup &&
|
||||
@@ -1419,11 +1405,9 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
ra->CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList &&
|
||||
ra->CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[ra->bwp_id-1]) {
|
||||
bwp = ra->CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[ra->bwp_id-1];
|
||||
genericParameters = &bwp->bwp_Common->genericParameters;
|
||||
pdsch_TimeDomainAllocationList = bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
}
|
||||
else {
|
||||
genericParameters= &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
|
||||
pdsch_TimeDomainAllocationList = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
}
|
||||
|
||||
@@ -1438,8 +1422,19 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
NR_UE_info_t *UE_info = &nr_mac->UE_info;
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
|
||||
long BWPSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
long BWPStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
NR_BWP_t *genericParameters = bwp ? & bwp->bwp_Common->genericParameters : &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
|
||||
|
||||
long BWPStart = 0;
|
||||
long BWPSize = 0;
|
||||
NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config = NULL;
|
||||
if(*ss->controlResourceSetId!=0) {
|
||||
BWPStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
BWPSize = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
} else {
|
||||
type0_PDCCH_CSS_config = &nr_mac->type0_PDCCH_CSS_config[ra->beam_id];
|
||||
BWPStart = type0_PDCCH_CSS_config->cset_start_rb;
|
||||
BWPSize = type0_PDCCH_CSS_config->num_rbs;
|
||||
}
|
||||
|
||||
/* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */
|
||||
int current_harq_pid = sched_ctrl->retrans_dl_harq.head;
|
||||
@@ -1459,7 +1454,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
// get CCEindex, needed also for PUCCH and then later for PDCCH
|
||||
uint8_t aggregation_level;
|
||||
uint8_t nr_of_candidates;
|
||||
find_aggregation_candidates(&aggregation_level, &nr_of_candidates, ss);
|
||||
find_aggregation_candidates(&aggregation_level, &nr_of_candidates, ss,4);
|
||||
int CCEIndex = allocate_nr_CCEs(nr_mac, bwp, coreset, aggregation_level,0,0,nr_of_candidates);
|
||||
if (CCEIndex < 0) {
|
||||
LOG_E(NR_MAC, "%s(): cannot find free CCE for RA RNTI %04x!\n", __func__, ra->rnti);
|
||||
@@ -1476,7 +1471,8 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
const int delta_PRI=0;
|
||||
int r_pucch = ((CCEIndex<<1)/N_cce)+(delta_PRI<<1);
|
||||
|
||||
int alloc = nr_acknack_scheduling(module_idP, UE_id, frameP, slotP, r_pucch);
|
||||
LOG_D(NR_MAC,"[RAPROC] Msg4 r_pucch %d (CCEIndex %d, N_cce %d, nb_of_candidates %d,delta_PRI %d)\n",r_pucch,CCEIndex,N_cce,nr_of_candidates,delta_PRI);
|
||||
int alloc = nr_acknack_scheduling(module_idP, UE_id, frameP, slotP, r_pucch, 1);
|
||||
AssertFatal(alloc>=0,"Couldn't find a pucch allocation for ack nack (msg4)\n");
|
||||
NR_sched_pucch_t *pucch = &sched_ctrl->sched_pucch[alloc];
|
||||
harq->feedback_slot = pucch->ul_slot;
|
||||
@@ -1592,7 +1588,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2 + sizeof(nfapi_nr_dl_tti_pdcch_pdu));
|
||||
dl_req->nPDUs += 1;
|
||||
pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15;
|
||||
nr_configure_pdcch(pdcch_pdu_rel15, ss, coreset, scc, genericParameters, NULL);
|
||||
nr_configure_pdcch(pdcch_pdu_rel15, ss, coreset, scc, genericParameters, type0_PDCCH_CSS_config);
|
||||
nr_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid] = pdcch_pdu_rel15;
|
||||
}
|
||||
|
||||
@@ -1662,7 +1658,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
dci_pdu_rel15_t dci_payload;
|
||||
dci_payload.frequency_domain_assignment.val = PRBalloc_to_locationandbandwidth0(pdsch_pdu_rel15->rbSize,
|
||||
pdsch_pdu_rel15->rbStart,
|
||||
pdsch_pdu_rel15->BWPSize);
|
||||
BWPSize);
|
||||
|
||||
dci_payload.format_indicator = 1;
|
||||
dci_payload.time_domain_assignment.val = time_domain_assignment;
|
||||
@@ -1678,7 +1674,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
dci_payload.pdsch_to_harq_feedback_timing_indicator.val = pucch->timing_indicator;
|
||||
|
||||
LOG_D(NR_MAC,
|
||||
"[RAPROC] DCI type 1 payload: freq_alloc %d (%d,%d,%d), time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d pucchres %d harqtiming %d\n",
|
||||
"[RAPROC] DCI 1_0 payload: freq_alloc %d (%d,%d,%d), time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d pucchres %d harqtiming %d\n",
|
||||
dci_payload.frequency_domain_assignment.val,
|
||||
pdsch_pdu_rel15->rbStart,
|
||||
pdsch_pdu_rel15->rbSize,
|
||||
@@ -1691,13 +1687,14 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
dci_payload.pdsch_to_harq_feedback_timing_indicator.val);
|
||||
|
||||
LOG_D(NR_MAC,
|
||||
"[RAPROC] DCI params: rnti 0x%x, rnti_type %d, dci_format %d coreset params: FreqDomainResource %llx, start_symbol %d n_symb %d\n",
|
||||
"[RAPROC] DCI params: rnti 0x%x, rnti_type %d, dci_format %d coreset params: FreqDomainResource %llx, start_symbol %d n_symb %d, BWPsize %d\n",
|
||||
pdcch_pdu_rel15->dci_pdu[0].RNTI,
|
||||
NR_RNTI_TC,
|
||||
NR_DL_DCI_FORMAT_1_0,
|
||||
(unsigned long long)pdcch_pdu_rel15->FreqDomainResource,
|
||||
pdcch_pdu_rel15->StartSymbolIndex,
|
||||
pdcch_pdu_rel15->DurationSymbols);
|
||||
pdcch_pdu_rel15->DurationSymbols,
|
||||
pdsch_pdu_rel15->BWPSize);
|
||||
|
||||
fill_dci_pdu_rel15(scc,
|
||||
ra->CellGroup,
|
||||
@@ -1753,7 +1750,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
LOG_D(NR_MAC,"numDlDci: %i\n", pdcch_pdu_rel15->numDlDci);
|
||||
|
||||
ra->state = WAIT_Msg4_ACK;
|
||||
LOG_I(NR_MAC,"[gNB %d][RAPROC] Frame %d, Slot %d: RA state %d\n", module_idP, frameP, slotP, ra->state);
|
||||
LOG_D(NR_MAC,"[gNB %d][RAPROC] Frame %d, Subframe %d: RA state %d\n", module_idP, frameP, slotP, ra->state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1943,7 +1940,7 @@ void nr_fill_rar(uint8_t Mod_idP,
|
||||
// TC-RNTI
|
||||
int t_crnti = rar->TCRNTI_2 + (rar->TCRNTI_1 << 8);
|
||||
|
||||
LOG_I(NR_MAC, "In %s: Transmitted RAR with t_alloc %d f_alloc %d ta_command %d mcs %d freq_hopping %d tpc_command %d csi_req %d t_crnti %x \n",
|
||||
LOG_D(NR_MAC, "In %s: Transmitted RAR with t_alloc %d f_alloc %d ta_command %d mcs %d freq_hopping %d tpc_command %d csi_req %d t_crnti %x \n",
|
||||
__FUNCTION__,
|
||||
Msg3_t_alloc,
|
||||
Msg3_f_alloc,
|
||||
|
||||
@@ -349,8 +349,8 @@ uint32_t schedule_control_sib1(module_id_t module_id,
|
||||
gNB_mac->sched_ctrlCommon->num_total_bytes = num_total_bytes;
|
||||
|
||||
uint8_t nr_of_candidates;
|
||||
find_aggregation_candidates(&gNB_mac->sched_ctrlCommon->aggregation_level, &nr_of_candidates, gNB_mac->sched_ctrlCommon->search_space);
|
||||
|
||||
find_aggregation_candidates(&gNB_mac->sched_ctrlCommon->aggregation_level, &nr_of_candidates, gNB_mac->sched_ctrlCommon->search_space,4);
|
||||
AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n");
|
||||
gNB_mac->sched_ctrlCommon->cce_index = allocate_nr_CCEs(RC.nrmac[module_id],
|
||||
NULL,
|
||||
gNB_mac->sched_ctrlCommon->coreset,
|
||||
|
||||
@@ -56,7 +56,6 @@
|
||||
#define HALFWORD 16
|
||||
#define WORD 32
|
||||
//#define SIZE_OF_POINTER sizeof (void *)
|
||||
static int loop_dcch_dtch = DL_SCH_LCID_DTCH;
|
||||
|
||||
void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp)
|
||||
{
|
||||
@@ -71,9 +70,15 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *
|
||||
scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
|
||||
const int symb_dlMixed = tdd ? (1 << tdd->nrofDownlinkSymbols) - 1 : 0;
|
||||
|
||||
const int target_ss = bwp ? NR_SearchSpace__searchSpaceType_PR_ue_Specific : NR_SearchSpace__searchSpaceType_PR_common;
|
||||
int target_ss;
|
||||
if (bwp) {
|
||||
target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
|
||||
}
|
||||
else {
|
||||
target_ss = NR_SearchSpace__searchSpaceType_PR_common;
|
||||
}
|
||||
NR_SearchSpace_t *search_space = get_searchspace(scc, bwp ? bwp->bwp_Dedicated : NULL, target_ss);
|
||||
const NR_ControlResourceSet_t *coreset = get_coreset(scc, (NR_BWP_Downlink_t*)bwp, search_space, target_ss);
|
||||
const NR_ControlResourceSet_t *coreset = get_coreset(scc, bwp ? bwp->bwp_Dedicated : NULL, search_space, target_ss);
|
||||
|
||||
// get coreset symbol "map"
|
||||
const uint16_t symb_coreset = (1 << coreset->duration) - 1;
|
||||
@@ -131,7 +136,7 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *
|
||||
nrmac->preferred_dl_tda[bwp_id][i] = 0;
|
||||
else if (tdd && nr_mix_slots && i % nr_slots_period == tdd->nrofDownlinkSlots)
|
||||
nrmac->preferred_dl_tda[bwp_id][i] = tdaMi;
|
||||
LOG_I(MAC, "slot %d preferred_dl_tda %d\n", i, nrmac->preferred_dl_tda[bwp_id][i]);
|
||||
LOG_D(MAC, "slot %d preferred_dl_tda %d\n", i, nrmac->preferred_dl_tda[bwp_id][i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,33 +397,57 @@ void nr_store_dlsch_buffer(module_id_t module_id,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
|
||||
sched_ctrl->num_total_bytes = 0;
|
||||
if ((sched_ctrl->lcid_mask&(1<<4)) > 0 && loop_dcch_dtch == DL_SCH_LCID_DCCH1)
|
||||
loop_dcch_dtch = DL_SCH_LCID_DTCH;
|
||||
else if ((sched_ctrl->lcid_mask&(1<<1)) > 0 && loop_dcch_dtch == DL_SCH_LCID_DTCH)
|
||||
loop_dcch_dtch = DL_SCH_LCID_DCCH;
|
||||
else if ((sched_ctrl->lcid_mask&(1<<2)) > 0 && loop_dcch_dtch == DL_SCH_LCID_DCCH)
|
||||
loop_dcch_dtch = DL_SCH_LCID_DCCH1;
|
||||
|
||||
const int lcid = loop_dcch_dtch;
|
||||
// const int lcid = DL_SCH_LCID_DTCH;
|
||||
int lcid;
|
||||
const uint16_t rnti = UE_info->rnti[UE_id];
|
||||
sched_ctrl->rlc_status[lcid] = mac_rlc_status_ind(module_id,
|
||||
rnti,
|
||||
module_id,
|
||||
frame,
|
||||
slot,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
0,
|
||||
0);
|
||||
LOG_D(NR_MAC,"UE %d/%x : lcid_mask %x\n",UE_id,rnti,sched_ctrl->lcid_mask);
|
||||
if ((sched_ctrl->lcid_mask&(1<<2)) > 0)
|
||||
sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1] = mac_rlc_status_ind(module_id,
|
||||
rnti,
|
||||
module_id,
|
||||
frame,
|
||||
slot,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
DL_SCH_LCID_DCCH1,
|
||||
0,
|
||||
0);
|
||||
if ((sched_ctrl->lcid_mask&(1<<1)) > 0)
|
||||
sched_ctrl->rlc_status[DL_SCH_LCID_DCCH] = mac_rlc_status_ind(module_id,
|
||||
rnti,
|
||||
module_id,
|
||||
frame,
|
||||
slot,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
DL_SCH_LCID_DCCH,
|
||||
0,
|
||||
0);
|
||||
if ((sched_ctrl->lcid_mask&(1<<4)) > 0)
|
||||
sched_ctrl->rlc_status[DL_SCH_LCID_DTCH] = mac_rlc_status_ind(module_id,
|
||||
rnti,
|
||||
module_id,
|
||||
frame,
|
||||
slot,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
DL_SCH_LCID_DTCH,
|
||||
0,
|
||||
0);
|
||||
|
||||
if(sched_ctrl->rlc_status[DL_SCH_LCID_DCCH].bytes_in_buffer > 0){
|
||||
lcid = DL_SCH_LCID_DCCH;
|
||||
}
|
||||
else if (sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1].bytes_in_buffer > 0)
|
||||
{
|
||||
lcid = DL_SCH_LCID_DCCH1;
|
||||
}else{
|
||||
lcid = DL_SCH_LCID_DTCH;
|
||||
}
|
||||
|
||||
sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer;
|
||||
LOG_D(NR_MAC,
|
||||
"%d.%d, LCID%d:->DLSCH, RLC status %d bytes. \n",
|
||||
frame,
|
||||
slot,
|
||||
lcid,
|
||||
sched_ctrl->num_total_bytes);
|
||||
//later multiplex here. Just select DCCH/SRB before DTCH/DRB
|
||||
sched_ctrl->lcid_to_schedule = lcid;
|
||||
|
||||
if (sched_ctrl->num_total_bytes == 0
|
||||
&& !sched_ctrl->ta_apply) /* If TA should be applied, give at least one RB */
|
||||
@@ -448,6 +477,10 @@ bool allocate_dl_retransmission(module_id_t module_id,
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info;
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
NR_sched_pdsch_t *retInfo = &sched_ctrl->harq_processes[current_harq_pid].sched_pdsch;
|
||||
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
|
||||
NR_BWP_DownlinkDedicated_t *bwpd= cg ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP:NULL;
|
||||
|
||||
|
||||
NR_BWP_t *genericParameters = sched_ctrl->active_bwp ?
|
||||
&sched_ctrl->active_bwp->bwp_Common->genericParameters :
|
||||
&RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
|
||||
@@ -456,9 +489,13 @@ bool allocate_dl_retransmission(module_id_t module_id,
|
||||
int rbStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
|
||||
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
|
||||
const long f = sched_ctrl->active_bwp ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0;
|
||||
const long f = (sched_ctrl->active_bwp ||bwpd) ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0;
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_bwp ||bwpd) ? (f ? 1 : (ps->nrOfSymbols == 2 ? 1 : 2)) : (ps->nrOfSymbols == 2 ? 1 : 2);
|
||||
int rbSize = 0;
|
||||
const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1;
|
||||
bool is_mixed_slot = is_xlsch_in_slot(RC.nrmac[module_id]->dlsch_slot_bitmap[slot / 64], slot) &&
|
||||
is_xlsch_in_slot(RC.nrmac[module_id]->ulsch_slot_bitmap[slot / 64], slot);
|
||||
|
||||
const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : (0+(is_mixed_slot?1:0));
|
||||
if (tda == retInfo->time_domain_allocation) {
|
||||
/* Check that there are enough resources for retransmission */
|
||||
while (rbSize < retInfo->rbSize) {
|
||||
@@ -475,8 +512,8 @@ bool allocate_dl_retransmission(module_id_t module_id,
|
||||
}
|
||||
/* check whether we need to switch the TDA allocation since the last
|
||||
* (re-)transmission */
|
||||
if (ps->time_domain_allocation != tda)
|
||||
nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, f, ps);
|
||||
if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data)
|
||||
nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, ps);
|
||||
} else {
|
||||
/* the retransmission will use a different time domain allocation, check
|
||||
* that we have enough resources */
|
||||
@@ -486,7 +523,7 @@ bool allocate_dl_retransmission(module_id_t module_id,
|
||||
rbSize++;
|
||||
NR_pdsch_semi_static_t temp_ps;
|
||||
temp_ps.nrOfLayers = 1;
|
||||
nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, f, &temp_ps);
|
||||
nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, &temp_ps);
|
||||
uint32_t new_tbs;
|
||||
uint16_t new_rbSize;
|
||||
bool success = nr_find_nb_rb(retInfo->Qm,
|
||||
@@ -519,7 +556,7 @@ bool allocate_dl_retransmission(module_id_t module_id,
|
||||
|
||||
/* Find PUCCH occasion: if it fails, undo CCE allocation (undoing PUCCH
|
||||
* allocation after CCE alloc fail would be more complex) */
|
||||
const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, -1);
|
||||
const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, -1, 0);
|
||||
if (alloc<0) {
|
||||
LOG_D(MAC,
|
||||
"%s(): could not find PUCCH for UE %d/%04x@%d.%d\n",
|
||||
@@ -530,7 +567,7 @@ bool allocate_dl_retransmission(module_id_t module_id,
|
||||
slot);
|
||||
int cid = sched_ctrl->coreset->controlResourceSetId;
|
||||
UE_info->num_pdcch_cand[UE_id][cid]--;
|
||||
int *cce_list = RC.nrmac[module_id]->cce_list[sched_ctrl->active_bwp->bwp_Id][cid];
|
||||
int *cce_list = RC.nrmac[module_id]->cce_list[sched_ctrl->active_bwp?sched_ctrl->active_bwp->bwp_Id:0][cid];
|
||||
for (int i = 0; i < sched_ctrl->aggregation_level; i++)
|
||||
cce_list[sched_ctrl->cce_index + i] = 0;
|
||||
return false;
|
||||
@@ -631,6 +668,8 @@ void pf_dl(module_id_t module_id,
|
||||
p = &UE_sched.next[*max];
|
||||
*max = UE_sched.next[*max];
|
||||
*p = -1;
|
||||
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
|
||||
NR_BWP_DownlinkDedicated_t *bwpd= cg ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP:NULL;
|
||||
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
int bwp_Id = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0;
|
||||
@@ -654,7 +693,7 @@ void pf_dl(module_id_t module_id,
|
||||
|
||||
/* Find PUCCH occasion: if it fails, undo CCE allocation (undoing PUCCH
|
||||
* allocation after CCE alloc fail would be more complex) */
|
||||
const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, -1);
|
||||
const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, -1,0);
|
||||
if (alloc<0) {
|
||||
LOG_D(NR_MAC,
|
||||
"%s(): could not find PUCCH for UE %d/%04x@%d.%d\n",
|
||||
@@ -679,12 +718,17 @@ void pf_dl(module_id_t module_id,
|
||||
max_rbSize++;
|
||||
|
||||
/* MCS has been set above */
|
||||
const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1;
|
||||
|
||||
bool is_mixed_slot = is_xlsch_in_slot(RC.nrmac[module_id]->dlsch_slot_bitmap[slot / 64], slot) &&
|
||||
is_xlsch_in_slot(RC.nrmac[module_id]->ulsch_slot_bitmap[slot / 64], slot);
|
||||
|
||||
const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : (0+(is_mixed_slot?1:0));
|
||||
NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch;
|
||||
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
|
||||
const long f = sched_ctrl->active_bwp ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0;
|
||||
if (ps->time_domain_allocation != tda)
|
||||
nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, f, ps);
|
||||
const long f = (sched_ctrl->active_bwp || bwpd) ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0;
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_bwp || bwpd) ? (f ? 1 : (ps->nrOfSymbols == 2 ? 1 : 2)) : (ps->nrOfSymbols == 2 ? 1 : 2);
|
||||
if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data)
|
||||
nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, f, ps);
|
||||
sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx);
|
||||
sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx);
|
||||
sched_pdsch->pucch_allocation = alloc;
|
||||
@@ -713,14 +757,12 @@ void pf_dl(module_id_t module_id,
|
||||
void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
{
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info;
|
||||
NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon;
|
||||
|
||||
if (UE_info->num_UEs == 0)
|
||||
return;
|
||||
|
||||
NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon;
|
||||
const int CC_id = 0;
|
||||
|
||||
|
||||
/* Get bwpSize from the first UE */
|
||||
int UE_id = UE_info->list.head;
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
@@ -803,6 +845,8 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
if (sched_ctrl->ul_failure==1 && get_softmodem_params()->phy_test==0) continue;
|
||||
NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch;
|
||||
UE_info->mac_stats[UE_id].dlsch_current_bytes = 0;
|
||||
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
|
||||
NR_BWP_DownlinkDedicated_t *bwpd= cg ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP:NULL;
|
||||
|
||||
/* update TA and set ta_apply every 10 frames.
|
||||
* Possible improvement: take the periodicity from input file.
|
||||
@@ -857,19 +901,27 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++;
|
||||
|
||||
LOG_D(NR_MAC,
|
||||
"%4d.%2d RNTI %04x start %3d RBs %3d startSymbol %2d nb_symbol %2d MCS %2d TBS %4d HARQ PID %2d round %d NDI %d\n",
|
||||
"%4d.%2d [DLSCH/PDSCH/PUCCH] UE %d RNTI %04x DCI L %d start %3d RBs %3d startSymbol %2d nb_symbol %2d dmrspos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d dl_data_to_ULACK %d (%d.%d) TPC %d\n",
|
||||
frame,
|
||||
slot,
|
||||
UE_id,
|
||||
rnti,
|
||||
sched_ctrl->aggregation_level,
|
||||
sched_pdsch->rbStart,
|
||||
sched_pdsch->rbSize,
|
||||
ps->startSymbolIndex,
|
||||
ps->nrOfSymbols,
|
||||
ps->dl_dmrs_symb_pos,
|
||||
sched_pdsch->mcs,
|
||||
TBS,
|
||||
current_harq_pid,
|
||||
harq->round,
|
||||
harq->ndi);
|
||||
nr_rv_round_map[harq->round],
|
||||
harq->ndi,
|
||||
pucch->timing_indicator,
|
||||
pucch->frame,
|
||||
pucch->ul_slot,
|
||||
sched_ctrl->tpc1);
|
||||
|
||||
NR_BWP_Downlink_t *bwp = sched_ctrl->active_bwp;
|
||||
|
||||
@@ -880,7 +932,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
NR_BWP_t *genericParameters = bwp ? &bwp->bwp_Common->genericParameters : &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
|
||||
|
||||
const int bwpid = bwp ? bwp->bwp_Id : 0;
|
||||
const int coresetid = bwp ? sched_ctrl->coreset->controlResourceSetId : gNB_mac->sched_ctrlCommon->coreset->controlResourceSetId;
|
||||
const int coresetid = (bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : gNB_mac->sched_ctrlCommon->coreset->controlResourceSetId;
|
||||
nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = gNB_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid];
|
||||
if (!pdcch_pdu) {
|
||||
LOG_I(NR_MAC, "creating pdcch pdu, pdcch_pdu = NULL. \n");
|
||||
@@ -890,9 +942,9 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu));
|
||||
dl_req->nPDUs += 1;
|
||||
pdcch_pdu = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15;
|
||||
LOG_D(NR_MAC,"Trying to configure DL pdcch for bwp %d, cs %d\n",bwpid,coresetid);
|
||||
NR_SearchSpace_t *ss = bwp ? sched_ctrl->search_space:gNB_mac->sched_ctrlCommon->search_space;
|
||||
NR_ControlResourceSet_t *coreset = bwp? sched_ctrl->coreset:gNB_mac->sched_ctrlCommon->coreset;
|
||||
LOG_D(NR_MAC,"Trying to configure DL pdcch for UE %d, bwp %d, cs %d\n",UE_id,bwpid,coresetid);
|
||||
NR_SearchSpace_t *ss = (bwp||bwpd) ? sched_ctrl->search_space:gNB_mac->sched_ctrlCommon->search_space;
|
||||
NR_ControlResourceSet_t *coreset = (bwp||bwpd)? sched_ctrl->coreset:gNB_mac->sched_ctrlCommon->coreset;
|
||||
nr_configure_pdcch(pdcch_pdu, ss, coreset, scc, genericParameters, NULL);
|
||||
gNB_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid] = pdcch_pdu;
|
||||
}
|
||||
@@ -1026,7 +1078,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
dci_payload.dmrs_sequence_initialization.val = pdsch_pdu->SCID;
|
||||
LOG_D(NR_MAC,
|
||||
"%4d.%2d DCI type 1 payload: freq_alloc %d (%d,%d,%d), "
|
||||
"time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d ndi %d rv %d tpc %d\n",
|
||||
"time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d ndi %d rv %d tpc %d ti %d\n",
|
||||
frame,
|
||||
slot,
|
||||
dci_payload.frequency_domain_assignment.val,
|
||||
@@ -1039,10 +1091,17 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
dci_payload.tb_scaling,
|
||||
dci_payload.ndi,
|
||||
dci_payload.rv,
|
||||
dci_payload.tpc);
|
||||
dci_payload.tpc,
|
||||
pucch->timing_indicator);
|
||||
|
||||
const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats;
|
||||
const int dci_format = bwp ? (f ? NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0) : NR_DL_DCI_FORMAT_1_0;
|
||||
int dci_format;
|
||||
if (sched_ctrl->search_space) {
|
||||
dci_format = f ? NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0;
|
||||
}
|
||||
else {
|
||||
dci_format = NR_DL_DCI_FORMAT_1_0;
|
||||
}
|
||||
const int rnti_type = NR_RNTI_C;
|
||||
|
||||
fill_dci_pdu_rel15(scc,
|
||||
@@ -1097,7 +1156,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
/* next, get RLC data */
|
||||
|
||||
// const int lcid = DL_SCH_LCID_DTCH;
|
||||
const int lcid = loop_dcch_dtch;
|
||||
const int lcid = sched_ctrl->lcid_to_schedule;
|
||||
int dlsch_total_bytes = 0;
|
||||
if (sched_ctrl->num_total_bytes > 0) {
|
||||
tbs_size_t len = 0;
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
//#define UL_HARQ_PRINT
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
const uint8_t nr_rv_round_map[4] = {0, 2, 1, 3};
|
||||
const uint8_t nr_rv_round_map[4] = {0, 2, 3, 1};
|
||||
//#define ENABLE_MAC_PAYLOAD_DEBUG 1
|
||||
|
||||
//uint8_t mac_pdu[MAX_NR_DLSCH_PAYLOAD_BYTES];
|
||||
@@ -264,6 +264,7 @@ extern uint8_t getN_PRB_DMRS(NR_BWP_Downlink_t *bwp, int numDmrsCdmGrpsNoData);
|
||||
uint32_t target_dl_mcs = 9;
|
||||
uint32_t target_dl_Nl = 1;
|
||||
uint32_t target_dl_bw = 50;
|
||||
int dl_maxL = 4;
|
||||
uint64_t dlsch_slot_bitmap = (1<<1);
|
||||
/* schedules whole bandwidth for first user, all the time */
|
||||
void nr_preprocessor_phytest(module_id_t module_id,
|
||||
@@ -322,11 +323,14 @@ void nr_preprocessor_phytest(module_id_t module_id,
|
||||
0,
|
||||
0);
|
||||
sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer;
|
||||
sched_ctrl->lcid_to_schedule = lcid;
|
||||
|
||||
sched_ctrl->maxL = dl_maxL;
|
||||
uint8_t nr_of_candidates;
|
||||
find_aggregation_candidates(&sched_ctrl->aggregation_level,
|
||||
&nr_of_candidates,
|
||||
sched_ctrl->search_space);
|
||||
sched_ctrl->search_space,
|
||||
sched_ctrl->maxL);
|
||||
const int cid = sched_ctrl->coreset->controlResourceSetId;
|
||||
const uint16_t Y = UE_info->Y[UE_id][cid][slot];
|
||||
const int m = UE_info->num_pdcch_cand[UE_id][cid];
|
||||
@@ -342,7 +346,7 @@ void nr_preprocessor_phytest(module_id_t module_id,
|
||||
__func__,
|
||||
UE_id);
|
||||
|
||||
const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, -1);
|
||||
const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, -1,0);
|
||||
if (alloc < 0) {
|
||||
LOG_D(MAC,
|
||||
"%s(): could not find PUCCH for UE %d/%04x@%d.%d\n",
|
||||
@@ -369,10 +373,11 @@ void nr_preprocessor_phytest(module_id_t module_id,
|
||||
sched_pdsch->rbSize = rbSize;
|
||||
const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1;
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = 1;
|
||||
const long f = 1;
|
||||
ps->nrOfLayers = target_dl_Nl;
|
||||
if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data)
|
||||
nr_set_pdsch_semi_static(
|
||||
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, f, ps);
|
||||
|
||||
|
||||
sched_pdsch->mcs = target_dl_mcs;
|
||||
@@ -400,6 +405,7 @@ void nr_preprocessor_phytest(module_id_t module_id,
|
||||
|
||||
uint32_t target_ul_mcs = 9;
|
||||
uint32_t target_ul_bw = 50;
|
||||
int ul_maxL = 4;
|
||||
uint64_t ulsch_slot_bitmap = (1 << 8);
|
||||
bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
{
|
||||
@@ -449,7 +455,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_
|
||||
if (ps->time_domain_allocation != tda
|
||||
|| ps->dci_format != dci_format
|
||||
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
|
||||
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, NULL,dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
|
||||
uint16_t rbStart = 0;
|
||||
uint16_t rbSize;
|
||||
@@ -482,9 +488,11 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_
|
||||
sched_ctrl->sched_pusch.frame = sched_frame;
|
||||
|
||||
uint8_t nr_of_candidates;
|
||||
sched_ctrl->maxL = ul_maxL;
|
||||
find_aggregation_candidates(&sched_ctrl->aggregation_level,
|
||||
&nr_of_candidates,
|
||||
sched_ctrl->search_space);
|
||||
sched_ctrl->search_space,
|
||||
sched_ctrl->maxL);
|
||||
const int cid = sched_ctrl->coreset->controlResourceSetId;
|
||||
const uint16_t Y = UE_info->Y[UE_id][cid][slot];
|
||||
const int m = UE_info->num_pdcch_cand[UE_id][cid];
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
*/
|
||||
|
||||
#include <softmodem-common.h>
|
||||
#include "assertions.h"
|
||||
|
||||
#include "NR_MAC_gNB/nr_mac_gNB.h"
|
||||
@@ -153,13 +154,13 @@ void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) {
|
||||
}
|
||||
|
||||
NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc,
|
||||
NR_BWP_Downlink_t *bwp,
|
||||
void *bwp,
|
||||
NR_SearchSpace_t *ss,
|
||||
NR_SearchSpace__searchSpaceType_PR ss_type) {
|
||||
NR_ControlResourceSetId_t coreset_id = *ss->controlResourceSetId;
|
||||
if (ss_type == NR_SearchSpace__searchSpaceType_PR_common) { // common search space
|
||||
NR_ControlResourceSet_t *coreset;
|
||||
if (bwp) coreset = bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->commonControlResourceSet;
|
||||
if (bwp) coreset = ((NR_BWP_Downlink_t*)bwp)->bwp_Common->pdcch_ConfigCommon->choice.setup->commonControlResourceSet;
|
||||
else if (scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonControlResourceSet)
|
||||
coreset = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonControlResourceSet;
|
||||
else coreset = NULL;
|
||||
@@ -169,10 +170,10 @@ NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc,
|
||||
"search space\n");
|
||||
return coreset;
|
||||
} else {
|
||||
const int n = bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list.count;
|
||||
const int n = ((NR_BWP_DownlinkDedicated_t*)bwp)->pdcch_Config->choice.setup->controlResourceSetToAddModList->list.count;
|
||||
for (int i = 0; i < n; i++) {
|
||||
NR_ControlResourceSet_t *coreset =
|
||||
bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list.array[i];
|
||||
((NR_BWP_DownlinkDedicated_t*)bwp)->pdcch_Config->choice.setup->controlResourceSetToAddModList->list.array[i];
|
||||
if (coreset_id == coreset->controlResourceSetId) {
|
||||
return coreset;
|
||||
}
|
||||
@@ -212,8 +213,8 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
|
||||
int coreset_id = coreset->controlResourceSetId;
|
||||
|
||||
int *cce_list;
|
||||
if(bwp == NULL || bwp->bwp_Id == 0) {
|
||||
cce_list = nr_mac->cce_list[0][0];
|
||||
if(bwp == NULL) {
|
||||
cce_list = nr_mac->cce_list[0][coreset_id];
|
||||
} else {
|
||||
cce_list = nr_mac->cce_list[bwp->bwp_Id][coreset_id];
|
||||
}
|
||||
@@ -231,6 +232,8 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
|
||||
const uint16_t N_cce = N_reg / NR_NB_REG_PER_CCE;
|
||||
const uint16_t M_s_max = nr_of_candidates;
|
||||
|
||||
LOG_D(PHY,"allocate_NR_CCes : bwp_id %d, coreset_id %d : N_cce %d, m %d, nr_of_candidates %d, Y %d\n",
|
||||
(int)(bwp ? bwp->bwp_Id : 0),coreset_id,N_cce,m,nr_of_candidates, Y);
|
||||
//PDCCH candidate index m in CORESET exceeds the maximum number of PDCCH candidates
|
||||
if(m >= nr_of_candidates)
|
||||
return -1;
|
||||
@@ -266,7 +269,7 @@ bool nr_find_nb_rb(uint16_t Qm,
|
||||
return true;
|
||||
|
||||
/* is the minimum enough? */
|
||||
*nb_rb = 1;
|
||||
*nb_rb = 5;
|
||||
*tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3;
|
||||
if (bytes <= *tbs)
|
||||
return true;
|
||||
@@ -295,6 +298,7 @@ bool nr_find_nb_rb(uint16_t Qm,
|
||||
void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_CellGroupConfig_t *secondaryCellGroup,
|
||||
const NR_BWP_Downlink_t *bwp,
|
||||
const NR_BWP_DownlinkDedicated_t *bwpd0,
|
||||
int tda,
|
||||
const long dci_format,
|
||||
NR_pdsch_semi_static_t *ps)
|
||||
@@ -308,14 +312,19 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
const int mapping_type = tdaList->list.array[tda]->mappingType;
|
||||
const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength;
|
||||
SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols);
|
||||
NR_BWP_DownlinkDedicated_t *bwpd;
|
||||
|
||||
if (bwp && bwp->bwp_Dedicated) {
|
||||
bwpd = bwp->bwp_Dedicated;
|
||||
} else {
|
||||
bwpd = (NR_BWP_DownlinkDedicated_t*)bwpd0;
|
||||
}
|
||||
|
||||
ps->mcsTableIdx = 0;
|
||||
if (bwp &&
|
||||
bwp->bwp_Dedicated &&
|
||||
bwp->bwp_Dedicated->pdsch_Config &&
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup &&
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table) {
|
||||
if (*bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table == 0)
|
||||
if (bwpd->pdsch_Config &&
|
||||
bwpd->pdsch_Config->choice.setup &&
|
||||
bwpd->pdsch_Config->choice.setup->mcs_Table) {
|
||||
if (*bwpd->pdsch_Config->choice.setup->mcs_Table == 0)
|
||||
ps->mcsTableIdx = 1;
|
||||
else
|
||||
ps->mcsTableIdx = 2;
|
||||
@@ -329,12 +338,14 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
ps->dmrsConfigType = bwp!=NULL ? (bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0;
|
||||
|
||||
ps->N_PRB_DMRS = ps->numDmrsCdmGrpsNoData * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4);
|
||||
ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwp ? bwp->bwp_Dedicated->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, mapping_type);
|
||||
ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwpd ? bwpd->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, mapping_type);
|
||||
ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos);
|
||||
LOG_D(NR_MAC,"bwpd0 %p, bwpd %p : Filling dmrs info, ps->N_PRB_DMRS %d, ps->dl_dmrs_symb_pos %x, ps->N_DMRS_SLOT %d\n",bwpd0,bwpd,ps->N_PRB_DMRS,ps->dl_dmrs_symb_pos,ps->N_DMRS_SLOT);
|
||||
}
|
||||
|
||||
void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_BWP_Uplink_t *ubwp,
|
||||
const NR_BWP_UplinkDedicated_t *ubwpd,
|
||||
long dci_format,
|
||||
int tda,
|
||||
uint8_t num_dmrs_cdm_grps_no_data,
|
||||
@@ -352,7 +363,7 @@ void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
&ps->startSymbolIndex,
|
||||
&ps->nrOfSymbols);
|
||||
|
||||
ps->pusch_Config = ubwp?ubwp->bwp_Dedicated->pusch_Config->choice.setup:NULL;
|
||||
ps->pusch_Config = ubwp?ubwp->bwp_Dedicated->pusch_Config->choice.setup:(ubwpd ? ubwpd->pusch_Config->choice.setup : NULL);
|
||||
if (ps->pusch_Config == NULL || !ps->pusch_Config->transformPrecoder)
|
||||
ps->transform_precoding = !scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder;
|
||||
else
|
||||
@@ -627,6 +638,7 @@ void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu,
|
||||
}
|
||||
|
||||
void config_uldci(const NR_BWP_Uplink_t *ubwp,
|
||||
const NR_BWP_UplinkDedicated_t *ubwpd,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
const nfapi_nr_pusch_pdu_t *pusch_pdu,
|
||||
dci_pdu_rel15_t *dci_pdu_rel15,
|
||||
@@ -649,23 +661,25 @@ void config_uldci(const NR_BWP_Uplink_t *ubwp,
|
||||
dci_pdu_rel15->rv = pusch_pdu->pusch_data.rv_index;
|
||||
dci_pdu_rel15->harq_pid = pusch_pdu->pusch_data.harq_process_id;
|
||||
dci_pdu_rel15->tpc = tpc;
|
||||
if (ubwp) AssertFatal(ubwp->bwp_Dedicated->pusch_Config->choice.setup->resourceAllocation == NR_PUSCH_Config__resourceAllocation_resourceAllocationType1,
|
||||
const NR_BWP_UplinkDedicated_t *ubwpd2 = (ubwp) ? ubwp->bwp_Dedicated : ubwpd;
|
||||
|
||||
if (ubwpd2) AssertFatal(ubwpd2->pusch_Config->choice.setup->resourceAllocation == NR_PUSCH_Config__resourceAllocation_resourceAllocationType1,
|
||||
"Only frequency resource allocation type 1 is currently supported\n");
|
||||
switch (dci_format) {
|
||||
case NR_UL_DCI_FORMAT_0_0:
|
||||
dci_pdu_rel15->format_indicator = 0;
|
||||
break;
|
||||
case NR_UL_DCI_FORMAT_0_1:
|
||||
LOG_D(NR_MAC,"Configuring DCI Format 0_1\n");
|
||||
dci_pdu_rel15->dai[0].val = 0; //TODO
|
||||
// bwp indicator as per table 7.3.1.1.2-1 in 38.212
|
||||
dci_pdu_rel15->bwp_indicator.val = n_ubwp < 4 ? bwp_id : bwp_id - 1;
|
||||
// SRS resource indicator
|
||||
if (ubwp &&
|
||||
ubwp->bwp_Dedicated &&
|
||||
ubwp->bwp_Dedicated->pusch_Config &&
|
||||
ubwp->bwp_Dedicated->pusch_Config->choice.setup &&
|
||||
ubwp->bwp_Dedicated->pusch_Config->choice.setup->txConfig != NULL) {
|
||||
AssertFatal(*ubwp->bwp_Dedicated->pusch_Config->choice.setup->txConfig == NR_PUSCH_Config__txConfig_codebook,
|
||||
if (ubwpd2 &&
|
||||
ubwpd2->pusch_Config &&
|
||||
ubwpd2->pusch_Config->choice.setup &&
|
||||
ubwpd2->pusch_Config->choice.setup->txConfig != NULL) {
|
||||
AssertFatal(*ubwpd2->pusch_Config->choice.setup->txConfig == NR_PUSCH_Config__txConfig_codebook,
|
||||
"Non Codebook configuration non supported\n");
|
||||
dci_pdu_rel15->srs_resource_indicator.val = 0; // taking resource 0 for SRS
|
||||
}
|
||||
@@ -711,7 +725,7 @@ void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu,
|
||||
NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config) {
|
||||
|
||||
int sps;
|
||||
if (bwp) { // This is not for SIB1
|
||||
if (bwp && *ss->controlResourceSetId!=0) { // This is not for coreset0
|
||||
pdcch_pdu->BWPSize = NRRIV2BW(bwp->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
pdcch_pdu->BWPStart = NRRIV2PRBOFFSET(bwp->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
pdcch_pdu->SubcarrierSpacing = bwp->subcarrierSpacing;
|
||||
@@ -721,6 +735,7 @@ void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu,
|
||||
sps = bwp->cyclicPrefix == NULL ? 14 : 12;
|
||||
}
|
||||
else {
|
||||
AssertFatal(type0_PDCCH_CSS_config!=NULL,"type0_PDCCH_CSS_config is null,bwp %p\n",bwp);
|
||||
pdcch_pdu->BWPSize = type0_PDCCH_CSS_config->num_rbs;
|
||||
pdcch_pdu->BWPStart = type0_PDCCH_CSS_config->cset_start_rb;
|
||||
pdcch_pdu->SubcarrierSpacing = type0_PDCCH_CSS_config->scs_pdcch;
|
||||
@@ -747,6 +762,7 @@ void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu,
|
||||
for (int i=0;i<6;i++)
|
||||
pdcch_pdu->FreqDomainResource[i] = coreset->frequencyDomainResources.buf[i];
|
||||
|
||||
LOG_D(MAC,"Coreset : BWPstart %d, BWPsize %d, SCS %d, freq %x, , duration %d, \n",pdcch_pdu->BWPStart,pdcch_pdu->BWPSize,(int)pdcch_pdu->SubcarrierSpacing,(int)coreset->frequencyDomainResources.buf[0],(int)coreset->duration);
|
||||
|
||||
//cce-REG-MappingType
|
||||
pdcch_pdu->CceRegMappingType = coreset->cce_REG_MappingType.present == NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved?
|
||||
@@ -785,6 +801,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
NR_CellGroupConfig_t *CellGroup,
|
||||
NR_BWP_Uplink_t *bwp,
|
||||
NR_BWP_UplinkDedicated_t *bwpd,
|
||||
uint16_t rnti,
|
||||
uint8_t pucch_resource,
|
||||
uint16_t O_csi,
|
||||
@@ -808,12 +825,12 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
|
||||
|
||||
uint16_t O_uci = O_csi + O_ack;
|
||||
|
||||
NR_PUSCH_Config_t *pusch_Config = bwp ? bwp->bwp_Dedicated->pusch_Config->choice.setup : NULL;
|
||||
long *pusch_id = bwp ? pusch_Config->dataScramblingIdentityPUSCH : NULL;
|
||||
NR_PUSCH_Config_t *pusch_Config = bwp ? bwp->bwp_Dedicated->pusch_Config->choice.setup : bwpd->pusch_Config->choice.setup;
|
||||
long *pusch_id = pusch_Config ? pusch_Config->dataScramblingIdentityPUSCH : NULL;
|
||||
|
||||
if (bwp && pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA != NULL)
|
||||
if (pusch_Config && pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA != NULL)
|
||||
id0 = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup->transformPrecodingDisabled->scramblingID0;
|
||||
else if (bwp && pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB != NULL)
|
||||
else if (pusch_Config && pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB != NULL)
|
||||
id0 = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->transformPrecodingDisabled->scramblingID0;
|
||||
else id0 = scc->physCellId;
|
||||
|
||||
@@ -838,7 +855,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
|
||||
pucch_pdu->sequence_hop_flag = 1;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Group hopping flag %ld undefined (0,1,2) \n", bwp->bwp_Common->pucch_ConfigCommon->choice.setup->pucch_GroupHopping);
|
||||
AssertFatal(1==0,"Group hopping flag %ld undefined (0,1,2) \n", pucch_ConfigCommon->pucch_GroupHopping);
|
||||
}
|
||||
|
||||
if (pucch_ConfigCommon->hoppingId != NULL)
|
||||
@@ -852,34 +869,36 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
|
||||
pucch_pdu->bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE);
|
||||
pucch_pdu->subcarrier_spacing = genericParameters->subcarrierSpacing;
|
||||
pucch_pdu->cyclic_prefix = (genericParameters->cyclicPrefix==NULL) ? 0 : *genericParameters->cyclicPrefix;
|
||||
if (r_pucch<0 || bwp){
|
||||
// we have either a dedicated BWP or Dedicated PUCCH configuration on InitialBWP
|
||||
pucch_Config = bwp ?
|
||||
bwp->bwp_Dedicated->pucch_Config->choice.setup:
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup;
|
||||
if (r_pucch<0 || bwp ){
|
||||
LOG_D(NR_MAC,"pucch_acknak: Filling dedicated configuration for PUCCH\n");
|
||||
// we have either a dedicated BWP or Dedicated PUCCH configuration on InitialBWP
|
||||
AssertFatal(bwp!=NULL || bwpd!=NULL,"We need one dedicated configuration for a BWP (neither additional or initial BWP has a dedicated configuration)\n");
|
||||
pucch_Config = bwp ?
|
||||
bwp->bwp_Dedicated->pucch_Config->choice.setup:
|
||||
bwpd->pucch_Config->choice.setup;
|
||||
|
||||
AssertFatal(pucch_Config->resourceSetToAddModList!=NULL,
|
||||
"PUCCH resourceSetToAddModList is null\n");
|
||||
AssertFatal(pucch_Config->resourceSetToAddModList!=NULL,
|
||||
"PUCCH resourceSetToAddModList is null\n");
|
||||
|
||||
n_set = pucch_Config->resourceSetToAddModList->list.count;
|
||||
AssertFatal(n_set>0,"PUCCH resourceSetToAddModList is empty\n");
|
||||
n_set = pucch_Config->resourceSetToAddModList->list.count;
|
||||
AssertFatal(n_set>0,"PUCCH resourceSetToAddModList is empty\n");
|
||||
|
||||
LOG_D(NR_MAC, "UCI n_set= %d\n", n_set);
|
||||
LOG_D(NR_MAC, "UCI n_set= %d\n", n_set);
|
||||
|
||||
N2 = 2;
|
||||
// procedure to select pucch resource id from resource sets according to
|
||||
// number of uci bits and pucch resource indicator pucch_resource
|
||||
// ( see table 9.2.3.2 in 38.213)
|
||||
for (int i=0; i<n_set; i++) {
|
||||
pucchresset = pucch_Config->resourceSetToAddModList->list.array[i];
|
||||
n_list = pucchresset->resourceList.list.count;
|
||||
if (pucchresset->pucch_ResourceSetId == 0 && O_uci<3) {
|
||||
if (pucch_resource < n_list)
|
||||
resource_id = pucchresset->resourceList.list.array[pucch_resource];
|
||||
else
|
||||
AssertFatal(1==0,"Couldn't fine pucch resource indicator %d in PUCCH resource set %d for %d UCI bits",pucch_resource,i,O_uci);
|
||||
}
|
||||
if (pucchresset->pucch_ResourceSetId == 1 && O_uci>2) {
|
||||
N2 = 2;
|
||||
// procedure to select pucch resource id from resource sets according to
|
||||
// number of uci bits and pucch resource indicator pucch_resource
|
||||
// ( see table 9.2.3.2 in 38.213)
|
||||
for (int i=0; i<n_set; i++) {
|
||||
pucchresset = pucch_Config->resourceSetToAddModList->list.array[i];
|
||||
n_list = pucchresset->resourceList.list.count;
|
||||
if (pucchresset->pucch_ResourceSetId == 0 && O_uci<3) {
|
||||
if (pucch_resource < n_list)
|
||||
resource_id = pucchresset->resourceList.list.array[pucch_resource];
|
||||
else
|
||||
AssertFatal(1==0,"Couldn't fine pucch resource indicator %d in PUCCH resource set %d for %d UCI bits",pucch_resource,i,O_uci);
|
||||
}
|
||||
if (pucchresset->pucch_ResourceSetId == 1 && O_uci>2) {
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(16, 0, 0))
|
||||
N3 = pucchresset->maxPayloadSize!= NULL ? *pucchresset->maxPayloadSize : 1706;
|
||||
#else
|
||||
@@ -921,6 +940,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
|
||||
pucch_pdu->nr_of_symbols = pucchres->format.choice.format0->nrofSymbols;
|
||||
pucch_pdu->start_symbol_index = pucchres->format.choice.format0->startingSymbolIndex;
|
||||
pucch_pdu->sr_flag = O_sr;
|
||||
pucch_pdu->prb_size = 1;
|
||||
break;
|
||||
case NR_PUCCH_Resource__format_PR_format1 :
|
||||
pucch_pdu->format_type = 1;
|
||||
@@ -929,6 +949,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
|
||||
pucch_pdu->start_symbol_index = pucchres->format.choice.format1->startingSymbolIndex;
|
||||
pucch_pdu->time_domain_occ_idx = pucchres->format.choice.format1->timeDomainOCC;
|
||||
pucch_pdu->sr_flag = O_sr;
|
||||
pucch_pdu->prb_size = 1;
|
||||
break;
|
||||
case NR_PUCCH_Resource__format_PR_format2 :
|
||||
pucch_pdu->format_type = 2;
|
||||
@@ -995,6 +1016,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
|
||||
AssertFatal(res_found==1,"No PUCCH resource found corresponding to id %ld\n",*resource_id);
|
||||
}
|
||||
else { // this is the default PUCCH configuration, PUCCH format 0 or 1
|
||||
LOG_D(NR_MAC,"pucch_acknak: Filling default PUCCH configuration from Tables (r_pucch %d, bwp %p)\n",r_pucch,bwp);
|
||||
int rsetindex = *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon;
|
||||
int prboffset = r_pucch/default_pucch_csset[rsetindex];
|
||||
int prboffsetm8 = (r_pucch-8)/default_pucch_csset[rsetindex];
|
||||
@@ -1015,6 +1037,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
|
||||
pucch_pdu->start_symbol_index = default_pucch_firstsymb[rsetindex];
|
||||
if (pucch_pdu->format_type == 1) pucch_pdu->time_domain_occ_idx = 0; // check this!!
|
||||
pucch_pdu->sr_flag = O_sr;
|
||||
pucch_pdu->prb_size=1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1024,7 +1047,21 @@ void prepare_dci(const NR_CellGroupConfig_t *CellGroup,
|
||||
nr_dci_format_t format,
|
||||
int bwp_id) {
|
||||
|
||||
NR_BWP_Downlink_t *bwp=CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id-1];
|
||||
AssertFatal(CellGroup!=NULL,"CellGroup shouldn't be null here\n");
|
||||
|
||||
const NR_BWP_DownlinkDedicated_t *bwpd = NULL;
|
||||
const NR_PDSCH_Config_t *pdsch_Config = NULL;
|
||||
const NR_PDCCH_Config_t *pdcch_Config = NULL;
|
||||
|
||||
if (bwp_id>0) {
|
||||
bwpd=CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id-1]->bwp_Dedicated;
|
||||
}
|
||||
else {
|
||||
bwpd=CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP;
|
||||
}
|
||||
pdsch_Config = (bwpd->pdsch_Config) ? bwpd->pdsch_Config->choice.setup : NULL;
|
||||
pdcch_Config = (bwpd->pdcch_Config) ? bwpd->pdcch_Config->choice.setup : NULL;
|
||||
|
||||
|
||||
switch(format) {
|
||||
case NR_UL_DCI_FORMAT_0_1:
|
||||
@@ -1047,22 +1084,22 @@ void prepare_dci(const NR_CellGroupConfig_t *CellGroup,
|
||||
if (CellGroup->spCellConfig->spCellConfigDedicated->crossCarrierSchedulingConfig != NULL)
|
||||
AssertFatal(1==0,"Cross Carrier Scheduling Config currently not supported\n");
|
||||
//vrb to prb mapping
|
||||
if (bwp->bwp_Dedicated->pdsch_Config->choice.setup->vrb_ToPRB_Interleaver==NULL)
|
||||
if (pdsch_Config->vrb_ToPRB_Interleaver==NULL)
|
||||
dci_pdu_rel15->vrb_to_prb_mapping.val = 0;
|
||||
else
|
||||
dci_pdu_rel15->vrb_to_prb_mapping.val = 1;
|
||||
//bundling size indicator
|
||||
if (bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present == NR_PDSCH_Config__prb_BundlingType_PR_dynamicBundling)
|
||||
if (pdsch_Config->prb_BundlingType.present == NR_PDSCH_Config__prb_BundlingType_PR_dynamicBundling)
|
||||
AssertFatal(1==0,"Dynamic PRB bundling type currently not supported\n");
|
||||
//rate matching indicator
|
||||
uint16_t msb = (bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup1==NULL)?0:1;
|
||||
uint16_t lsb = (bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup2==NULL)?0:1;
|
||||
uint16_t msb = (pdsch_Config->rateMatchPatternGroup1==NULL)?0:1;
|
||||
uint16_t lsb = (pdsch_Config->rateMatchPatternGroup2==NULL)?0:1;
|
||||
dci_pdu_rel15->rate_matching_indicator.val = lsb | (msb<<1);
|
||||
// aperiodic ZP CSI-RS trigger
|
||||
if (bwp->bwp_Dedicated->pdsch_Config->choice.setup->aperiodic_ZP_CSI_RS_ResourceSetsToAddModList != NULL)
|
||||
if (pdsch_Config->aperiodic_ZP_CSI_RS_ResourceSetsToAddModList != NULL)
|
||||
AssertFatal(1==0,"Aperiodic ZP CSI-RS currently not supported\n");
|
||||
// transmission configuration indication
|
||||
if (bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list.array[bwp_id-1]->tci_PresentInDCI != NULL)
|
||||
if (pdcch_Config->controlResourceSetToAddModList->list.array[0]->tci_PresentInDCI != NULL)
|
||||
AssertFatal(1==0,"TCI in DCI currently not supported\n");
|
||||
//srs resource set
|
||||
if (CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->carrierSwitching!=NULL) {
|
||||
@@ -1086,7 +1123,9 @@ void prepare_dci(const NR_CellGroupConfig_t *CellGroup,
|
||||
else
|
||||
dci_pdu_rel15->srs_request.val = 0;
|
||||
// CBGTI and CBGFI
|
||||
if (CellGroup->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL)
|
||||
if (CellGroup->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig &&
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup &&
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL)
|
||||
AssertFatal(1==0,"CBG transmission currently not supported\n");
|
||||
break;
|
||||
default :
|
||||
@@ -1106,10 +1145,10 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
|
||||
uint8_t fsize = 0, pos = 0;
|
||||
|
||||
uint64_t *dci_pdu = (uint64_t *)pdcch_dci_pdu->Payload;
|
||||
int dci_size = nr_dci_size(scc->uplinkConfigCommon->initialUplinkBWP, CellGroup, dci_pdu_rel15, dci_format, rnti_type, N_RB, bwp_id);
|
||||
*dci_pdu=0;
|
||||
int dci_size = nr_dci_size(scc->downlinkConfigCommon->initialDownlinkBWP,scc->uplinkConfigCommon->initialUplinkBWP, CellGroup, dci_pdu_rel15, dci_format, rnti_type, N_RB, bwp_id);
|
||||
pdcch_dci_pdu->PayloadSizeBits = dci_size;
|
||||
AssertFatal(dci_size <= 64, "DCI sizes above 64 bits not yet supported");
|
||||
|
||||
if (dci_format == NR_DL_DCI_FORMAT_1_1 || dci_format == NR_UL_DCI_FORMAT_0_1)
|
||||
prepare_dci(CellGroup, dci_pdu_rel15, dci_format, bwp_id);
|
||||
|
||||
@@ -1123,8 +1162,8 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
|
||||
pos = fsize;
|
||||
*dci_pdu |= (((uint64_t)dci_pdu_rel15->frequency_domain_assignment.val & ((1 << fsize) - 1)) << (dci_size - pos));
|
||||
LOG_D(NR_MAC,
|
||||
"frequency-domain assignment %d (%d bits) N_RB_BWP %d=> %d (0x%lx)\n",
|
||||
dci_pdu_rel15->frequency_domain_assignment.val,
|
||||
"RA_RNTI, size %d frequency-domain assignment %d (%d bits) N_RB_BWP %d=> %d (0x%lx)\n",
|
||||
dci_size,dci_pdu_rel15->frequency_domain_assignment.val,
|
||||
fsize,
|
||||
N_RB,
|
||||
dci_size - pos,
|
||||
@@ -1133,7 +1172,7 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
|
||||
pos += 4;
|
||||
*dci_pdu |= (((uint64_t)dci_pdu_rel15->time_domain_assignment.val & 0xf) << (dci_size - pos));
|
||||
LOG_D(NR_MAC,
|
||||
"time-domain assignment %d (3 bits)=> %d (0x%lx)\n",
|
||||
"time-domain assignment %d (4 bits)=> %d (0x%lx)\n",
|
||||
dci_pdu_rel15->time_domain_assignment.val,
|
||||
dci_size - pos,
|
||||
*dci_pdu);
|
||||
@@ -1148,23 +1187,20 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
|
||||
// MCS
|
||||
pos += 5;
|
||||
*dci_pdu |= ((uint64_t)dci_pdu_rel15->mcs & 0x1f) << (dci_size - pos);
|
||||
#ifdef DEBUG_FILL_DCI
|
||||
LOG_I(NR_MAC, "mcs %d (5 bits)=> %d (0x%lx)\n", dci_pdu_rel15->mcs, dci_size - pos, *dci_pdu);
|
||||
#endif
|
||||
LOG_D(NR_MAC, "mcs %d (5 bits)=> %d (0x%lx)\n", dci_pdu_rel15->mcs, dci_size - pos, *dci_pdu);
|
||||
// TB scaling
|
||||
pos += 2;
|
||||
*dci_pdu |= ((uint64_t)dci_pdu_rel15->tb_scaling & 0x3) << (dci_size - pos);
|
||||
#ifdef DEBUG_FILL_DCI
|
||||
LOG_I(NR_MAC, "tb_scaling %d (2 bits)=> %d (0x%lx)\n", dci_pdu_rel15->tb_scaling, dci_size - pos, *dci_pdu);
|
||||
#endif
|
||||
LOG_D(NR_MAC, "tb_scaling %d (2 bits)=> %d (0x%lx)\n", dci_pdu_rel15->tb_scaling, dci_size - pos, *dci_pdu);
|
||||
break;
|
||||
|
||||
case NR_RNTI_C:
|
||||
// indicating a DL DCI format 1bit
|
||||
pos++;
|
||||
*dci_pdu |= ((uint64_t)1) << (dci_size - pos);
|
||||
LOG_D(NR_MAC,
|
||||
"Format indicator %d (%d bits) N_RB_BWP %d => %d (0x%lx)\n",
|
||||
LOG_I(NR_MAC,
|
||||
"DCI1_0 (size %d): Format indicator %d (%d bits) N_RB_BWP %d => %d (0x%lx)\n",
|
||||
dci_size,
|
||||
dci_pdu_rel15->format_indicator,
|
||||
1,
|
||||
N_RB,
|
||||
@@ -1374,6 +1410,7 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
|
||||
case NR_UL_DCI_FORMAT_0_0:
|
||||
switch (rnti_type) {
|
||||
case NR_RNTI_C:
|
||||
LOG_D(NR_MAC,"Filling format 0_0 DCI for CRNTI (size %d bits, format ind %d)\n",dci_size,dci_pdu_rel15->format_indicator);
|
||||
// indicating a UL DCI format 1bit
|
||||
pos=1;
|
||||
*dci_pdu |= ((uint64_t)dci_pdu_rel15->format_indicator & 1) << (dci_size - pos);
|
||||
@@ -1481,6 +1518,7 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
|
||||
case NR_UL_DCI_FORMAT_0_1:
|
||||
switch (rnti_type) {
|
||||
case NR_RNTI_C:
|
||||
LOG_D(NR_MAC,"Filling NR_UL_DCI_FORMAT_0_1 size %d format indicator %d\n",dci_size,dci_pdu_rel15->format_indicator);
|
||||
// Indicating a DL DCI format 1bit
|
||||
pos = 1;
|
||||
*dci_pdu |= ((uint64_t)dci_pdu_rel15->format_indicator & 0x1) << (dci_size - pos);
|
||||
@@ -1559,6 +1597,7 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
|
||||
|
||||
case NR_DL_DCI_FORMAT_1_1:
|
||||
// Indicating a DL DCI format 1bit
|
||||
LOG_D(NR_MAC,"Filling Format 1_1 DCI of size %d\n",dci_size);
|
||||
pos = 1;
|
||||
*dci_pdu |= ((uint64_t)dci_pdu_rel15->format_indicator & 0x1) << (dci_size - pos);
|
||||
// Carrier indicator
|
||||
@@ -1895,10 +1934,14 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
memset(sched_ctrl, 0, sizeof(*sched_ctrl));
|
||||
sched_ctrl->lcid_mask = 0;
|
||||
if (!get_softmodem_params()->phy_test && !get_softmodem_params()->do_ra && !get_softmodem_params()->sa) {
|
||||
sched_ctrl->lcid_mask = 1<<DL_SCH_LCID_DTCH;
|
||||
}
|
||||
sched_ctrl->ta_frame = 0;
|
||||
sched_ctrl->ta_update = 31;
|
||||
sched_ctrl->ta_apply = false;
|
||||
sched_ctrl->ul_rssi = 0;
|
||||
sched_ctrl->maxL = 4;
|
||||
sched_ctrl->pucch_consecutive_dtx_cnt = 0;
|
||||
sched_ctrl->pusch_consecutive_dtx_cnt = 0;
|
||||
sched_ctrl->ul_failure = 0;
|
||||
@@ -1915,11 +1958,15 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG
|
||||
const int bwp_id = 1;
|
||||
sched_ctrl->active_bwp = bwpList ? bwpList->list.array[bwp_id - 1] : NULL;
|
||||
const int target_ss = sched_ctrl->active_bwp ? NR_SearchSpace__searchSpaceType_PR_ue_Specific : NR_SearchSpace__searchSpaceType_PR_common;
|
||||
sched_ctrl->search_space = get_searchspace(scc, sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL, target_ss);
|
||||
sched_ctrl->search_space = get_searchspace(scc,
|
||||
sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL,
|
||||
target_ss);
|
||||
if (*sched_ctrl->search_space->controlResourceSetId == 0)
|
||||
sched_ctrl->coreset = RC.nrmac[mod_idP]->sched_ctrlCommon->coreset; // this is coreset 0
|
||||
else
|
||||
sched_ctrl->coreset = get_coreset(scc, sched_ctrl->active_bwp, sched_ctrl->search_space, target_ss);
|
||||
sched_ctrl->coreset = get_coreset(scc,
|
||||
sched_ctrl->active_bwp ? (void*)sched_ctrl->active_bwp->bwp_Dedicated : NULL,
|
||||
sched_ctrl->search_space, target_ss);
|
||||
const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList = servingCellConfig ? servingCellConfig->uplinkConfig->uplinkBWP_ToAddModList : NULL;
|
||||
if (ubwpList) AssertFatal(ubwpList->list.count == 1,
|
||||
"uplinkBWP_ToAddModList has %d BWP!\n",
|
||||
@@ -1946,7 +1993,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG
|
||||
add_tail_nr_list(&sched_ctrl->available_ul_harq, harq);
|
||||
create_nr_list(&sched_ctrl->feedback_ul_harq, 16);
|
||||
create_nr_list(&sched_ctrl->retrans_ul_harq, 16);
|
||||
LOG_I(NR_MAC, "[gNB %d] Add NR UE_id %d : rnti %x\n",
|
||||
LOG_D(NR_MAC, "[gNB %d] Add NR UE_id %d : rnti %x\n",
|
||||
mod_idP,
|
||||
UE_id,
|
||||
rntiP);
|
||||
@@ -2045,34 +2092,61 @@ uint8_t nr_get_tpc(int target, uint8_t cqi, int incr) {
|
||||
|
||||
void get_pdsch_to_harq_feedback(int Mod_idP,
|
||||
int UE_id,
|
||||
int bwp_id,
|
||||
NR_SearchSpace__searchSpaceType_PR ss_type,
|
||||
int *max_fb_time,
|
||||
uint8_t *pdsch_to_harq_feedback) {
|
||||
|
||||
int bwp_id=1;
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info;
|
||||
NR_CellGroupConfig_t *CellGroup = UE_info->CellGroup[UE_id];
|
||||
NR_BWP_Downlink_t *bwp=NULL;
|
||||
NR_BWP_Uplink_t *ubwp=NULL;
|
||||
NR_BWP_DownlinkDedicated_t *bwpd=NULL;
|
||||
NR_BWP_UplinkDedicated_t *ubwpd=NULL;
|
||||
|
||||
if (CellGroup && CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList)
|
||||
bwp = CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id-1];
|
||||
if (CellGroup && CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList)
|
||||
ubwp = CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[bwp_id-1];
|
||||
if (ss_type == NR_SearchSpace__searchSpaceType_PR_ue_Specific) {
|
||||
AssertFatal(CellGroup!=NULL,"Cellgroup is not defined for UE_id %d\n",UE_id);
|
||||
AssertFatal(CellGroup->spCellConfig!=NULL,"Cellgroup->spCellConfig is null\n");
|
||||
AssertFatal(CellGroup->spCellConfig->spCellConfigDedicated!=NULL,"CellGroup->spCellConfig->spCellConfigDedicated is null\n");
|
||||
}
|
||||
if (bwp_id>0) {
|
||||
AssertFatal(CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList!=NULL,
|
||||
"CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList is null\n");
|
||||
AssertFatal(CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList!=NULL,
|
||||
"CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList is null\n");
|
||||
AssertFatal(CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count >= bwp_id,
|
||||
"CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count %d < bwp_id %d\n",
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count,bwp_id);
|
||||
AssertFatal(CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count >= bwp_id,
|
||||
"CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count %d < bwp_id %d\n",
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count,bwp_id);
|
||||
|
||||
bwpd = CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id-1]->bwp_Dedicated;
|
||||
ubwpd = CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[bwp_id-1]->bwp_Dedicated;
|
||||
}
|
||||
else if (CellGroup) { // this is an initialBWP
|
||||
AssertFatal((bwpd=CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP)!=NULL,
|
||||
"CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP is null\n");
|
||||
AssertFatal((ubwpd=CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP)!=NULL,
|
||||
"CellGroup->spCellConfig->spCellConfigDedicated->uplnikConfig->initialUplinkBWP is null\n");
|
||||
}
|
||||
NR_SearchSpace_t *ss=NULL;
|
||||
|
||||
// common search type uses DCI format 1_0
|
||||
if (ss_type == NR_SearchSpace__searchSpaceType_PR_common) {
|
||||
for (int i=0; i<8; i++)
|
||||
for (int i=0; i<8; i++) {
|
||||
pdsch_to_harq_feedback[i] = i+1;
|
||||
if(pdsch_to_harq_feedback[i]>*max_fb_time)
|
||||
*max_fb_time = pdsch_to_harq_feedback[i];
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
// searching for a ue specific search space
|
||||
int found=0;
|
||||
|
||||
for (int i=0;i<bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.count;i++) {
|
||||
ss=bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.array[i];
|
||||
AssertFatal(bwpd->pdcch_Config!=NULL,"bwpd->pdcch_Config is null\n");
|
||||
AssertFatal(bwpd->pdcch_Config->choice.setup->searchSpacesToAddModList!=NULL,
|
||||
"bwpd->pdcch_Config->choice.setup->searchSpacesToAddModList is null\n");
|
||||
for (int i=0;i<bwpd->pdcch_Config->choice.setup->searchSpacesToAddModList->list.count;i++) {
|
||||
ss=bwpd->pdcch_Config->choice.setup->searchSpacesToAddModList->list.array[i];
|
||||
AssertFatal(ss->controlResourceSetId != NULL,"ss->controlResourceSetId is null\n");
|
||||
AssertFatal(ss->searchSpaceType != NULL,"ss->searchSpaceType is null\n");
|
||||
if (ss->searchSpaceType->present == ss_type) {
|
||||
@@ -2084,13 +2158,20 @@ void get_pdsch_to_harq_feedback(int Mod_idP,
|
||||
|
||||
|
||||
if (ss->searchSpaceType->choice.ue_Specific->dci_Formats == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0) {
|
||||
for (int i=0; i<8; i++)
|
||||
for (int i=0; i<8; i++) {
|
||||
pdsch_to_harq_feedback[i] = i+1;
|
||||
if(pdsch_to_harq_feedback[i]>*max_fb_time)
|
||||
*max_fb_time = pdsch_to_harq_feedback[i];
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(ubwp->bwp_Dedicated->pucch_Config->choice.setup->dl_DataToUL_ACK != NULL) {
|
||||
for (int i=0; i<8; i++)
|
||||
pdsch_to_harq_feedback[i] = *ubwp->bwp_Dedicated->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[i];
|
||||
AssertFatal(ubwpd!=NULL,"ubwpd shouldn't be null here\n");
|
||||
if(ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK != NULL) {
|
||||
for (int i=0; i<8; i++) {
|
||||
pdsch_to_harq_feedback[i] = *ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[i];
|
||||
if(pdsch_to_harq_feedback[i]>*max_fb_time)
|
||||
*max_fb_time = pdsch_to_harq_feedback[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
AssertFatal(0==1,"There is no allocated dl_DataToUL_ACK for pdsch to harq feedback\n");
|
||||
@@ -2306,10 +2387,12 @@ bool find_free_CCE(module_id_t module_id,
|
||||
uint8_t nr_of_candidates;
|
||||
find_aggregation_candidates(&sched_ctrl->aggregation_level,
|
||||
&nr_of_candidates,
|
||||
sched_ctrl->search_space);
|
||||
sched_ctrl->search_space,
|
||||
sched_ctrl->maxL);
|
||||
const int cid = sched_ctrl->coreset->controlResourceSetId;
|
||||
const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid][slot];
|
||||
const int m = RC.nrmac[module_id]->UE_info.num_pdcch_cand[UE_id][cid];
|
||||
if (UE_id >= 0) LOG_D(NR_MAC,"calling allocate_nr_CCEs with L %d, nr_of_candidates %d, Y %x\n",sched_ctrl->aggregation_level,nr_of_candidates,Y);
|
||||
sched_ctrl->cce_index = allocate_nr_CCEs(RC.nrmac[module_id],
|
||||
sched_ctrl->active_bwp,
|
||||
sched_ctrl->coreset,
|
||||
|
||||
@@ -60,8 +60,9 @@ void nr_fill_nfapi_pucch(module_id_t mod_id,
|
||||
memset(pucch_pdu, 0, sizeof(nfapi_nr_pucch_pdu_t));
|
||||
future_ul_tti_req->n_pdus += 1;
|
||||
|
||||
LOG_D(MAC,
|
||||
"%4d.%2d Scheduling pucch reception in %4d.%2d: bits SR %d, ACK %d, CSI %d on res %d\n",
|
||||
LOG_D(NR_MAC,
|
||||
"%s %4d.%2d Scheduling pucch reception in %4d.%2d: bits SR %d, DAI %d, CSI %d on res %d\n",
|
||||
pucch->dai_c>0 ? "pucch_acknak" : "",
|
||||
frame,
|
||||
slot,
|
||||
pucch->frame,
|
||||
@@ -72,10 +73,17 @@ void nr_fill_nfapi_pucch(module_id_t mod_id,
|
||||
pucch->resource_indicator);
|
||||
|
||||
NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon;
|
||||
NR_CellGroupConfig_t *cg=UE_info->CellGroup[UE_id];
|
||||
|
||||
NR_BWP_UplinkDedicated_t *ubwpd;
|
||||
ubwpd = cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL;
|
||||
|
||||
LOG_D(NR_MAC,"pucch_acknak: %d.%d Calling nr_configure_pucch (ubwpd %p,r_pucch %d) pucch in %d.%d\n",frame,slot,ubwpd,pucch->r_pucch,pucch->frame,pucch->ul_slot);
|
||||
nr_configure_pucch(pucch_pdu,
|
||||
scc,
|
||||
UE_info->CellGroup[UE_id],
|
||||
UE_info->UE_sched_ctrl[UE_id].active_ubwp,
|
||||
ubwpd,
|
||||
UE_info->rnti[UE_id],
|
||||
pucch->resource_indicator,
|
||||
pucch->csi_bits,
|
||||
@@ -380,13 +388,11 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in
|
||||
|
||||
// setting the CSI or SSB index list
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == csi_report->reportQuantity_type) {
|
||||
AssertFatal(csi_MeasConfig->csi_SSB_ResourceSetToAddModList != NULL,
|
||||
"Wrong settings! Report quantity is SSB-RSRP but csi_MeasConfig->csi_SSB_ResourceSetToAddModList is NULL\n");
|
||||
for (int csi_idx = 0; csi_idx < csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.count; csi_idx++) {
|
||||
if (csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_idx]->csi_SSB_ResourceSetId ==
|
||||
*(csi_resourceconfig->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list.array[0])){
|
||||
//We can configure only one SSB resource set from spec 38.331 IE CSI-ResourceConfig
|
||||
nb_resources = csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_idx]->csi_SSB_ResourceList.list.count;
|
||||
nb_resources= csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_idx]->csi_SSB_ResourceList.list.count;
|
||||
csi_report->SSB_Index_list = csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_idx]->csi_SSB_ResourceList.list.array;
|
||||
csi_report->CSI_Index_list = NULL;
|
||||
break;
|
||||
@@ -487,7 +493,7 @@ void nr_csi_meas_reporting(int Mod_idP,
|
||||
// preparation is done in first slot of tdd period
|
||||
if (frame % (period / n_slots_frame) != offset / n_slots_frame)
|
||||
continue;
|
||||
LOG_D(MAC, "CSI reporting in frame %d slot %d\n", frame, sched_slot);
|
||||
LOG_D(NR_MAC, "CSI reporting in frame %d slot %d\n", frame, sched_slot);
|
||||
|
||||
const NR_PUCCH_CSI_Resource_t *pucchcsires = csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list.array[0];
|
||||
const NR_PUCCH_ResourceSet_t *pucchresset = pucch_Config->resourceSetToAddModList->list.array[1]; // set with formats >1
|
||||
@@ -571,7 +577,7 @@ static void handle_dl_harq(module_id_t mod_id,
|
||||
harq->ndi ^= 1;
|
||||
NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id];
|
||||
stats->dlsch_errors++;
|
||||
LOG_D(MAC, "retransmission error for UE %d (total %d)\n", UE_id, stats->dlsch_errors);
|
||||
LOG_D(NR_MAC, "retransmission error for UE %d (total %d)\n", UE_id, stats->dlsch_errors);
|
||||
} else {
|
||||
add_tail_nr_list(&UE_info->UE_sched_ctrl[UE_id].retrans_dl_harq, harq_pid);
|
||||
harq->round++;
|
||||
@@ -597,7 +603,7 @@ int checkTargetSSBInFirst64TCIStates_pdschConfig(int ssb_index_t, int Mod_idP, i
|
||||
else if(tci->qcl_Type2 != NULL && tci->qcl_Type2->referenceSignal.present == NR_QCL_Info__referenceSignal_PR_ssb) {
|
||||
if(tci->qcl_Type2->referenceSignal.choice.ssb == ssb_index_t)
|
||||
return tci->tci_StateId; // returned TCI state ID
|
||||
} else LOG_I(MAC,"SSB index is not found in first 64 TCI states of TCI_statestoAddModList[%d]", i);
|
||||
} else LOG_I(NR_MAC,"SSB index is not found in first 64 TCI states of TCI_statestoAddModList[%d]", i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -721,7 +727,7 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) {
|
||||
stats->cumul_rsrp += strongest_ssb_rsrp;
|
||||
stats->num_rsrp_meas++;
|
||||
ssb_rsrp[idx * nb_of_csi_ssb_report] = strongest_ssb_rsrp;
|
||||
LOG_D(MAC,"ssb_rsrp = %d\n",strongest_ssb_rsrp);
|
||||
LOG_D(NR_MAC,"ssb_rsrp = %d\n",strongest_ssb_rsrp);
|
||||
|
||||
//if current ssb rsrp is greater than better rsrp
|
||||
if(ssb_rsrp[idx * nb_of_csi_ssb_report] > better_rsrp_reported) {
|
||||
@@ -744,7 +750,7 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) {
|
||||
if(ssb_index[target_ssb_beam_index] != ssb_index[curr_ssb_beam_index] && ssb_rsrp[target_ssb_beam_index] > ssb_rsrp[curr_ssb_beam_index]) {
|
||||
if( ssb_rsrp[target_ssb_beam_index] - ssb_rsrp[curr_ssb_beam_index] > L1_RSRP_HYSTERIS) {
|
||||
is_triggering_ssb_beam_switch = 1;
|
||||
LOG_D(MAC, "Triggering ssb beam switching using tci\n");
|
||||
LOG_D(NR_MAC, "Triggering ssb beam switching using tci\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1032,7 +1038,7 @@ static NR_UE_harq_t *find_harq(module_id_t mod_id, frame_t frame, sub_frame_t sl
|
||||
/* old feedbacks we missed: mark for retransmission */
|
||||
while (harq->feedback_frame != frame
|
||||
|| (harq->feedback_frame == frame && harq->feedback_slot < slot)) {
|
||||
LOG_W(MAC,
|
||||
LOG_W(NR_MAC,
|
||||
"expected HARQ pid %d feedback at %d.%d, but is at %d.%d instead (HARQ feedback is in the past)\n",
|
||||
pid,
|
||||
harq->feedback_frame,
|
||||
@@ -1048,7 +1054,7 @@ static NR_UE_harq_t *find_harq(module_id_t mod_id, frame_t frame, sub_frame_t sl
|
||||
}
|
||||
/* feedbacks that we wait for in the future: don't do anything */
|
||||
if (harq->feedback_slot > slot) {
|
||||
LOG_W(MAC,
|
||||
LOG_W(NR_MAC,
|
||||
"expected HARQ pid %d feedback at %d.%d, but is at %d.%d instead (HARQ feedback is in the future)\n",
|
||||
pid,
|
||||
harq->feedback_frame,
|
||||
@@ -1067,7 +1073,7 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id,
|
||||
{
|
||||
int UE_id = find_nr_UE_id(mod_id, uci_01->rnti);
|
||||
if (UE_id < 0) {
|
||||
LOG_E(MAC, "%s(): unknown RNTI %04x in PUCCH UCI\n", __func__, uci_01->rnti);
|
||||
LOG_E(NR_MAC, "%s(): unknown RNTI %04x in PUCCH UCI\n", __func__, uci_01->rnti);
|
||||
return;
|
||||
}
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[mod_id]->UE_info;
|
||||
@@ -1089,6 +1095,7 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id,
|
||||
/* Melissa: according to nfapi_nr_interface_scf.h, harq_value = 0 is a pass
|
||||
(check below was for harq_value == 1 in develop branch) */
|
||||
handle_dl_harq(mod_id, UE_id, pid, harq_value == 0 && harq_confidence == 0);
|
||||
if (harq_confidence == 1) UE_info->mac_stats[UE_id].pucch0_DTX++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1096,13 +1103,14 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id,
|
||||
if (uci_01->pduBitmap & 0x1 && uci_01->sr->sr_indication && uci_01->sr->sr_confidence_level == 0 && uci_01->ul_cqi >= 148) {
|
||||
// SR detected with SNR >= 10dB
|
||||
sched_ctrl->SR |= true;
|
||||
LOG_D(MAC, "SR UE %04x ul_cqi %d\n", uci_01->rnti, uci_01->ul_cqi);
|
||||
LOG_D(NR_MAC, "SR UE %04x ul_cqi %d\n", uci_01->rnti, uci_01->ul_cqi);
|
||||
}
|
||||
|
||||
// tpc (power control) only if we received AckNack or positive SR. For a
|
||||
// negative SR, the UE won't have sent anything, and the SNR is not valid
|
||||
if (((uci_01->pduBitmap >> 1) & 0x1) || sched_ctrl->SR) {
|
||||
sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10, uci_01->ul_cqi, 30);
|
||||
if (uci_01->harq->harq_confidence_level==0) sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10, uci_01->ul_cqi, 30);
|
||||
else sched_ctrl->tpc1 = 3;
|
||||
sched_ctrl->pucch_snrx10 = uci_01->ul_cqi * 5 - 640;
|
||||
}
|
||||
}
|
||||
@@ -1114,7 +1122,7 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
|
||||
{
|
||||
int UE_id = find_nr_UE_id(mod_id, uci_234->rnti);
|
||||
if (UE_id < 0) {
|
||||
LOG_E(MAC, "%s(): unknown RNTI %04x in PUCCH UCI\n", __func__, uci_234->rnti);
|
||||
LOG_E(NR_MAC, "%s(): unknown RNTI %04x in PUCCH UCI\n", __func__, uci_234->rnti);
|
||||
return;
|
||||
}
|
||||
AssertFatal(RC.nrmac[mod_id]->UE_info.CellGroup[UE_id],"Cellgroup is null for UE %d/%x\n",UE_id,uci_234->rnti);
|
||||
@@ -1165,15 +1173,16 @@ int nr_acknack_scheduling(int mod_id,
|
||||
int UE_id,
|
||||
frame_t frame,
|
||||
sub_frame_t slot,
|
||||
int r_pucch)
|
||||
{
|
||||
int r_pucch,
|
||||
int is_common) {
|
||||
|
||||
const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon;
|
||||
const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
|
||||
const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1;
|
||||
const int nr_ulmix_slots = tdd->nrofUplinkSlots + (tdd->nrofUplinkSymbols != 0);
|
||||
const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0;
|
||||
const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots;
|
||||
const int first_ul_slot_tdd = tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period);
|
||||
const int first_ul_slot_period = first_ul_slot_tdd%nr_slots_period;
|
||||
const int CC_id = 0;
|
||||
NR_sched_pucch_t *csi_pucch;
|
||||
|
||||
@@ -1191,6 +1200,7 @@ int nr_acknack_scheduling(int mod_id,
|
||||
* * each UE has dedicated PUCCH Format 0 resources, and we use index 0! */
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &RC.nrmac[mod_id]->UE_info.UE_sched_ctrl[UE_id];
|
||||
NR_sched_pucch_t *pucch = &sched_ctrl->sched_pucch[0];
|
||||
LOG_D(NR_MAC,"pucch_acknak %d.%d Trying to allocate pucch, current DAI %d\n",frame,slot,pucch->dai_c);
|
||||
pucch->r_pucch=r_pucch;
|
||||
AssertFatal(pucch->csi_bits == 0,
|
||||
"%s(): csi_bits %d in sched_pucch[0]\n",
|
||||
@@ -1202,10 +1212,14 @@ int nr_acknack_scheduling(int mod_id,
|
||||
* the same slot again */
|
||||
const int f = pucch->frame;
|
||||
const int s = pucch->ul_slot;
|
||||
LOG_D(NR_MAC,"pucch_acknak : %d.%d DAI = 2 pucch currently in %d.%d, advancing by 1 slot\n",frame,slot,f,s);
|
||||
nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id);
|
||||
memset(pucch, 0, sizeof(*pucch));
|
||||
pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f;
|
||||
pucch->ul_slot = (s + 1) % n_slots_frame;
|
||||
if(((s + 1)%nr_slots_period) == 0)
|
||||
pucch->ul_slot = (s + 1 + first_ul_slot_period) % n_slots_frame;
|
||||
else
|
||||
pucch->ul_slot = (s + 1) % n_slots_frame;
|
||||
// we assume that only two indices over the array sched_pucch exist
|
||||
csi_pucch = &sched_ctrl->sched_pucch[1];
|
||||
// skip the CSI PUCCH if it is present and if in the next frame/slot
|
||||
@@ -1217,30 +1231,40 @@ int nr_acknack_scheduling(int mod_id,
|
||||
&& !csi_pucch->simultaneous_harqcsi) {
|
||||
nr_fill_nfapi_pucch(mod_id, frame, slot, csi_pucch, UE_id);
|
||||
memset(csi_pucch, 0, sizeof(*csi_pucch));
|
||||
pucch->frame = s >= n_slots_frame - 2 ? (f + 1) % 1024 : f;
|
||||
pucch->ul_slot = (s + 2) % n_slots_frame;
|
||||
pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f;
|
||||
if(((s + 1)%nr_slots_period) == 0)
|
||||
pucch->ul_slot = (s + 1 + first_ul_slot_period) % n_slots_frame;
|
||||
else
|
||||
pucch->ul_slot = (s + 1) % n_slots_frame;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(MAC,"1. DL slot %d, UL_ACK %d\n",slot,pucch->ul_slot);
|
||||
/* if the UE's next PUCCH occasion is after the possible UL slots (within the
|
||||
* same frame) or wrapped around to the next frame, then we assume there is
|
||||
* no possible PUCCH allocation anymore */
|
||||
if ((pucch->frame == frame
|
||||
&& (pucch->ul_slot >= first_ul_slot_tdd + nr_ulmix_slots))
|
||||
|| (pucch->frame == frame + 1))
|
||||
return -1;
|
||||
LOG_D(NR_MAC,"pucch_acknak 1. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c);
|
||||
|
||||
// this is hardcoded for now as ue specific only if we are not on the initialBWP (to be fixed to allow ue_Specific also on initialBWP
|
||||
NR_SearchSpace__searchSpaceType_PR ss_type = sched_ctrl->active_bwp ? NR_SearchSpace__searchSpaceType_PR_ue_Specific: NR_SearchSpace__searchSpaceType_PR_common;
|
||||
uint8_t pdsch_to_harq_feedback[8];
|
||||
get_pdsch_to_harq_feedback(mod_id, UE_id, ss_type, pdsch_to_harq_feedback);
|
||||
NR_CellGroupConfig_t *cg = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id];
|
||||
NR_BWP_UplinkDedicated_t *ubwpd=NULL;
|
||||
|
||||
if (cg &&
|
||||
cg->spCellConfig &&
|
||||
cg->spCellConfig->spCellConfigDedicated &&
|
||||
cg->spCellConfig->spCellConfigDedicated->uplinkConfig &&
|
||||
cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP)
|
||||
ubwpd = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP;
|
||||
|
||||
NR_SearchSpace__searchSpaceType_PR ss_type = (is_common==0 && (sched_ctrl->active_bwp || ubwpd)) ? NR_SearchSpace__searchSpaceType_PR_ue_Specific: NR_SearchSpace__searchSpaceType_PR_common;
|
||||
uint8_t pdsch_to_harq_feedback[8];
|
||||
int bwp_Id = 0;
|
||||
if (sched_ctrl->active_ubwp) bwp_Id = sched_ctrl->active_ubwp->bwp_Id;
|
||||
|
||||
int max_fb_time = 0;
|
||||
get_pdsch_to_harq_feedback(mod_id, UE_id, bwp_Id, ss_type, &max_fb_time, pdsch_to_harq_feedback);
|
||||
int max_absslot = frame*n_slots_frame + slot + max_fb_time;
|
||||
|
||||
LOG_D(NR_MAC,"pucch_acknak 1b. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c);
|
||||
/* there is a HARQ. Check whether we can use it for this ACKNACK */
|
||||
if (pucch->dai_c > 0) {
|
||||
/* this UE already has a PUCCH occasion */
|
||||
DevAssert(pucch->frame == frame);
|
||||
|
||||
// Find the right timing_indicator value.
|
||||
int i = 0;
|
||||
while (i < 8) {
|
||||
@@ -1253,59 +1277,63 @@ int nr_acknack_scheduling(int mod_id,
|
||||
const int f = pucch->frame;
|
||||
const int s = pucch->ul_slot;
|
||||
const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
|
||||
LOG_D(NR_MAC,"pucch_acknak : %d.%d DAI > 0, cannot reach timing for pucch in %d.%d, advancing slot by 1 and trying again\n",frame,slot,f,s);
|
||||
nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id);
|
||||
memset(pucch, 0, sizeof(*pucch));
|
||||
pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f;
|
||||
pucch->ul_slot = (s + 1) % n_slots_frame;
|
||||
return nr_acknack_scheduling(mod_id, UE_id, frame, slot, pucch->r_pucch);
|
||||
if(((s + 1)%nr_slots_period) == 0)
|
||||
pucch->ul_slot = (s + 1 + first_ul_slot_period) % n_slots_frame;
|
||||
else
|
||||
pucch->ul_slot = (s + 1) % n_slots_frame;
|
||||
return nr_acknack_scheduling(mod_id, UE_id, frame, slot, r_pucch,is_common);
|
||||
}
|
||||
|
||||
pucch->timing_indicator = i;
|
||||
pucch->dai_c++;
|
||||
// retain old resource indicator, and we are good
|
||||
LOG_D(NR_MAC,"pucch_acknak : %d.%d. DAI > 0, pucch allocated for %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator);
|
||||
return 0;
|
||||
}
|
||||
|
||||
LOG_D(NR_MAC,"pucch_acknak : %d.%d DAI = 0, looking for new pucch occasion\n",frame,slot);
|
||||
/* we need to find a new PUCCH occasion */
|
||||
|
||||
/* if time information is outdated (e.g., last PUCCH occasion in last frame),
|
||||
* set to first possible UL occasion in this frame. Note that if such UE is
|
||||
* scheduled a lot and used all AckNacks, pucch->frame might have been
|
||||
* wrapped around to next frame */
|
||||
if (frame != pucch->frame || pucch->ul_slot < first_ul_slot_tdd) {
|
||||
|
||||
/*Inizialization of timing information*/
|
||||
if (pucch->frame == 0 && pucch->ul_slot == 0) {
|
||||
AssertFatal(pucch->sr_flag + pucch->dai_c == 0,
|
||||
"expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n",
|
||||
UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot);
|
||||
AssertFatal(frame + 1 != pucch->frame,
|
||||
"frame wrap around not handled in %s() yet\n",
|
||||
__func__);
|
||||
pucch->frame = frame;
|
||||
pucch->ul_slot = first_ul_slot_tdd;
|
||||
}
|
||||
|
||||
// advance ul_slot if it is not reachable by UE
|
||||
pucch->ul_slot = max(pucch->ul_slot, slot + pdsch_to_harq_feedback[0]);
|
||||
/* We are not sure sure what is happening with this max() above.
|
||||
It seems that the ul_slot will be updated to be
|
||||
max(current ul_slot, curernt dl_slot + sf_ahead). Is this
|
||||
the intention/correct? */
|
||||
if (pucch->ul_slot > 19) {
|
||||
pucch->ul_slot = pucch->ul_slot % 20;
|
||||
pucch->frame = (pucch->frame + 1) % 1024;
|
||||
}
|
||||
|
||||
// Find the right timing_indicator value.
|
||||
int i = 0;
|
||||
while (i < 8) {
|
||||
LOG_D(MAC,"pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n",
|
||||
i,pdsch_to_harq_feedback[i],pucch->ul_slot,slot);
|
||||
if (pdsch_to_harq_feedback[i] == pucch->ul_slot - slot)
|
||||
int ind_found = -1;
|
||||
// while we are within the feedback limits and it has not been
|
||||
while ((pucch->frame*n_slots_frame + pucch->ul_slot) <= max_absslot) {
|
||||
int i = 0;
|
||||
while (i < 8) {
|
||||
LOG_D(NR_MAC,"pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n",
|
||||
i,pdsch_to_harq_feedback[i],pucch->ul_slot,slot);
|
||||
if (pdsch_to_harq_feedback[i] == pucch->ul_slot - slot) {
|
||||
ind_found = i;
|
||||
break;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
if (ind_found!=-1)
|
||||
break;
|
||||
++i;
|
||||
// advance to the next ul slot
|
||||
const int f = pucch->frame;
|
||||
const int s = pucch->ul_slot;
|
||||
pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f;
|
||||
if(((s + 1)%nr_slots_period) == 0)
|
||||
pucch->ul_slot = (s + 1 + first_ul_slot_period) % n_slots_frame;
|
||||
else
|
||||
pucch->ul_slot = (s + 1) % n_slots_frame;
|
||||
}
|
||||
if (i >= 8) {
|
||||
LOG_W(MAC,
|
||||
if (ind_found==-1) {
|
||||
LOG_W(NR_MAC,
|
||||
"%4d.%2d could not find pdsch_to_harq_feedback for UE %d: earliest "
|
||||
"ack slot %d\n",
|
||||
frame,
|
||||
@@ -1317,9 +1345,10 @@ int nr_acknack_scheduling(int mod_id,
|
||||
|
||||
// is there already CSI in this slot?
|
||||
csi_pucch = &sched_ctrl->sched_pucch[1];
|
||||
if (csi_pucch->csi_bits > 0
|
||||
&& csi_pucch->frame == pucch->frame
|
||||
&& csi_pucch->ul_slot == pucch->ul_slot) {
|
||||
if (csi_pucch &&
|
||||
csi_pucch->csi_bits > 0 &&
|
||||
csi_pucch->frame == pucch->frame &&
|
||||
csi_pucch->ul_slot == pucch->ul_slot) {
|
||||
// skip the CSI PUCCH if it is present and if in the next frame/slot
|
||||
// and if we don't multiplex
|
||||
// FIXME currently we support at most 11 bits in pucch2 so skip also in that case
|
||||
@@ -1333,24 +1362,27 @@ int nr_acknack_scheduling(int mod_id,
|
||||
const int s = pucch->ul_slot;
|
||||
memset(pucch, 0, sizeof(*pucch));
|
||||
pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f;
|
||||
pucch->ul_slot = (s + 1) % n_slots_frame;
|
||||
return nr_acknack_scheduling(mod_id, UE_id, frame, slot, -1);
|
||||
if(((s + 1)%nr_slots_period) == 0)
|
||||
pucch->ul_slot = (s + 1 + first_ul_slot_period) % n_slots_frame;
|
||||
else
|
||||
pucch->ul_slot = (s + 1) % n_slots_frame;
|
||||
return nr_acknack_scheduling(mod_id, UE_id, frame, slot, r_pucch,is_common);
|
||||
}
|
||||
// multiplexing harq and csi in a pucch
|
||||
else {
|
||||
csi_pucch->timing_indicator = i;
|
||||
csi_pucch->timing_indicator = ind_found;
|
||||
csi_pucch->dai_c++;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
pucch->timing_indicator = i; // index in the list of timing indicators
|
||||
pucch->timing_indicator = ind_found; // index in the list of timing indicators
|
||||
|
||||
LOG_D(MAC,"2. DL slot %d, UL_ACK %d (index %d)\n",slot,pucch->ul_slot,i);
|
||||
LOG_D(NR_MAC,"pucch_acknak 2. DAI 0 DL %d.%d, UL_ACK %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator);
|
||||
|
||||
pucch->dai_c++;
|
||||
pucch->resource_indicator = 0; // each UE has dedicated PUCCH resources
|
||||
|
||||
pucch->r_pucch=r_pucch;
|
||||
NR_PUCCH_Config_t *pucch_Config = NULL;
|
||||
if (sched_ctrl->active_ubwp) {
|
||||
pucch_Config = sched_ctrl->active_ubwp->bwp_Dedicated->pucch_Config->choice.setup;
|
||||
@@ -1366,14 +1398,16 @@ int nr_acknack_scheduling(int mod_id,
|
||||
/* verify that at that slot and symbol, resources are free. We only do this
|
||||
* for initialCyclicShift 0 (we assume it always has that one), so other
|
||||
* initialCyclicShifts can overlap with ICS 0!*/
|
||||
const NR_PUCCH_Resource_t *resource = pucch_Config->resourceToAddModList->list.array[pucch->resource_indicator];
|
||||
DevAssert(resource->format.present == NR_PUCCH_Resource__format_PR_format0);
|
||||
if (resource->format.choice.format0->initialCyclicShift == 0) {
|
||||
uint16_t *vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch->ul_slot * MAX_BWP_SIZE];
|
||||
const uint16_t symb = 1 << resource->format.choice.format0->startingSymbolIndex;
|
||||
if ((vrb_map_UL[resource->startingPRB] & symb) != 0)
|
||||
LOG_W(MAC, "symbol 0x%x is not free for PUCCH alloc in vrb_map_UL at RB %ld and slot %d.%d\n", symb, resource->startingPRB, pucch->frame, pucch->ul_slot);
|
||||
vrb_map_UL[resource->startingPRB] |= symb;
|
||||
if (pucch_Config) {
|
||||
const NR_PUCCH_Resource_t *resource = pucch_Config->resourceToAddModList->list.array[pucch->resource_indicator];
|
||||
DevAssert(resource->format.present == NR_PUCCH_Resource__format_PR_format0);
|
||||
if (resource->format.choice.format0->initialCyclicShift == 0) {
|
||||
uint16_t *vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch->ul_slot * MAX_BWP_SIZE];
|
||||
const uint16_t symb = 1 << resource->format.choice.format0->startingSymbolIndex;
|
||||
if ((vrb_map_UL[resource->startingPRB] & symb) != 0)
|
||||
LOG_W(NR_MAC, "symbol 0x%x is not free for PUCCH alloc in vrb_map_UL at RB %ld and slot %d.%d\n", symb, resource->startingPRB, pucch->frame, pucch->ul_slot);
|
||||
vrb_map_UL[resource->startingPRB] |= symb;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1391,6 +1425,7 @@ void nr_sr_reporting(int Mod_idP, frame_t SFN, sub_frame_t slot)
|
||||
for (int UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) {
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
|
||||
if (sched_ctrl->ul_failure==1) continue;
|
||||
NR_PUCCH_Config_t *pucch_Config = NULL;
|
||||
if (sched_ctrl->active_ubwp) {
|
||||
pucch_Config = sched_ctrl->active_ubwp->bwp_Dedicated->pucch_Config->choice.setup;
|
||||
@@ -1402,7 +1437,8 @@ void nr_sr_reporting(int Mod_idP, frame_t SFN, sub_frame_t slot)
|
||||
RC.nrmac[Mod_idP]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup) {
|
||||
pucch_Config = RC.nrmac[Mod_idP]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup;
|
||||
}
|
||||
|
||||
else continue;
|
||||
if (!pucch_Config->schedulingRequestResourceToAddModList) continue;
|
||||
AssertFatal(pucch_Config->schedulingRequestResourceToAddModList->list.count>0,"NO SR configuration available");
|
||||
|
||||
for (int SR_resource_id =0; SR_resource_id < pucch_Config->schedulingRequestResourceToAddModList->list.count;SR_resource_id++) {
|
||||
@@ -1413,9 +1449,10 @@ void nr_sr_reporting(int Mod_idP, frame_t SFN, sub_frame_t slot)
|
||||
find_period_offest_SR(SchedulingRequestResourceConfig,&SR_period,&SR_offset);
|
||||
// convert to int to avoid underflow of uint
|
||||
int sfn_sf = SFN * n_slots_frame + slot;
|
||||
LOG_D(NR_MAC,"SR_resource_id %d: SR_period %d, SR_offset %d\n",SR_resource_id,SR_period,SR_offset);
|
||||
if ((sfn_sf - SR_offset) % SR_period != 0)
|
||||
continue;
|
||||
LOG_D(MAC, "%4d.%2d Scheduling Request identified\n", SFN, slot);
|
||||
LOG_D(NR_MAC, "%4d.%2d Scheduling Request identified\n", SFN, slot);
|
||||
NR_PUCCH_ResourceId_t *PucchResourceId = SchedulingRequestResourceConfig->resource;
|
||||
|
||||
int found = -1;
|
||||
@@ -1447,7 +1484,7 @@ void nr_sr_reporting(int Mod_idP, frame_t SFN, sub_frame_t slot)
|
||||
&& pdu->initial_cyclic_shift == pucch_res->format.choice.format0->initialCyclicShift
|
||||
&& pdu->nr_of_symbols == pucch_res->format.choice.format0->nrofSymbols
|
||||
&& pdu->start_symbol_index == pucch_res->format.choice.format0->startingSymbolIndex) {
|
||||
LOG_D(MAC,"%4d.%2d adding SR_flag 1 to PUCCH nFAPI SR for RNTI %04x\n", SFN, slot, pdu->rnti);
|
||||
LOG_D(NR_MAC,"%4d.%2d adding SR_flag 1 to PUCCH nFAPI SR for RNTI %04x\n", SFN, slot, pdu->rnti);
|
||||
pdu->sr_flag = 1;
|
||||
nfapi_allocated = true;
|
||||
break;
|
||||
@@ -1462,7 +1499,7 @@ void nr_sr_reporting(int Mod_idP, frame_t SFN, sub_frame_t slot)
|
||||
NR_sched_pucch_t *curr_pucch = &sched_ctrl->sched_pucch[0];
|
||||
if (curr_pucch->frame == SFN && curr_pucch->ul_slot == slot) {
|
||||
if (curr_pucch->resource_indicator != found) {
|
||||
LOG_W(MAC, "%4d.%2d expected PUCCH in this slot to have resource indicator of SR (%d), skipping SR\n", SFN, slot, found);
|
||||
LOG_W(NR_MAC, "%4d.%2d expected PUCCH in this slot to have resource indicator of SR (%d), skipping SR\n", SFN, slot, found);
|
||||
continue;
|
||||
}
|
||||
curr_pucch->sr_flag = true;
|
||||
|
||||
@@ -64,6 +64,20 @@ const uint32_t NR_LONG_BSR_TABLE[256] ={
|
||||
35910462, 38241455, 40723756, 43367187, 46182206, 49179951, 52372284, 55771835, 59392055, 63247269, 67352729, 71724679, 76380419, 81338368, 162676736, 4294967295
|
||||
};
|
||||
|
||||
int get_dci_format(NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
|
||||
const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats;
|
||||
int dci_format;
|
||||
if (sched_ctrl->search_space) {
|
||||
dci_format = f ? NR_UL_DCI_FORMAT_0_1 : NR_UL_DCI_FORMAT_0_0;
|
||||
}
|
||||
else {
|
||||
dci_format = NR_UL_DCI_FORMAT_0_0;
|
||||
}
|
||||
|
||||
return(dci_format);
|
||||
}
|
||||
|
||||
void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp)
|
||||
{
|
||||
gNB_MAC_INST *nrmac = RC.nrmac[module_id];
|
||||
@@ -165,7 +179,7 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub
|
||||
nrmac->preferred_ul_tda[bwp_id][slot] = 0;
|
||||
else if (tdd && nr_mix_slots && sched_slot % nr_slots_period == tdd->nrofDownlinkSlots)
|
||||
nrmac->preferred_ul_tda[bwp_id][slot] = tdaMi;
|
||||
LOG_I(MAC, "DL slot %d UL slot %d preferred_ul_tda %d\n", slot, sched_slot, nrmac->preferred_ul_tda[bwp_id][slot]);
|
||||
LOG_D(MAC, "DL slot %d UL slot %d preferred_ul_tda %d\n", slot, sched_slot, nrmac->preferred_ul_tda[bwp_id][slot]);
|
||||
}
|
||||
|
||||
if (k2 < tdd->nrofUplinkSlots)
|
||||
@@ -199,7 +213,7 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub
|
||||
// F: length of L is 0:8 or 1:16 bits wide
|
||||
// R: Reserved bit, set to zero.
|
||||
|
||||
void nr_process_mac_pdu(module_id_t module_idP,
|
||||
int nr_process_mac_pdu(module_id_t module_idP,
|
||||
int UE_id,
|
||||
uint8_t CC_id,
|
||||
frame_t frameP,
|
||||
@@ -379,18 +393,22 @@ void nr_process_mac_pdu(module_id_t module_idP,
|
||||
mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L;
|
||||
mac_subheader_len = 2;
|
||||
}
|
||||
LOG_D(NR_MAC, "[UE %d] Frame %d : ULSCH -> UL-DCCH %d (gNB %d, %d bytes), rnti: %d \n", module_idP, frameP, rx_lcid, module_idP, mac_sdu_len, UE_info->rnti[UE_id]);
|
||||
mac_rlc_data_ind(module_idP,
|
||||
UE_info->rnti[UE_id],
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
rx_lcid,
|
||||
(char *) (pduP + mac_subheader_len),
|
||||
mac_sdu_len,
|
||||
1,
|
||||
NULL);
|
||||
if (UE_info->CellGroup[UE_id]) {
|
||||
LOG_D(NR_MAC, "[UE %d] Frame %d : ULSCH -> UL-DCCH %d (gNB %d, %d bytes), rnti: %d \n", module_idP, frameP, rx_lcid, module_idP, mac_sdu_len, UE_info->rnti[UE_id]);
|
||||
mac_rlc_data_ind(module_idP,
|
||||
UE_info->rnti[UE_id],
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
rx_lcid,
|
||||
(char *) (pduP + mac_subheader_len),
|
||||
mac_sdu_len,
|
||||
1,
|
||||
NULL);
|
||||
} else {
|
||||
AssertFatal(1==0,"[UE %d] Frame/Slot %d.%d : Received LCID %d which is not configured, dropping packet\n",UE_id,frameP,slot,rx_lcid);
|
||||
}
|
||||
break;
|
||||
case UL_SCH_LCID_SRB3:
|
||||
// todo
|
||||
@@ -479,7 +497,7 @@ void nr_process_mac_pdu(module_id_t module_idP,
|
||||
|
||||
default:
|
||||
LOG_E(NR_MAC, "Received unknown MAC header (LCID = 0x%02x)\n", rx_lcid);
|
||||
return;
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -504,9 +522,10 @@ void nr_process_mac_pdu(module_id_t module_idP,
|
||||
for (int i = 0; i < 20; i++) // Only printf 1st - 20nd bytes
|
||||
printf("%02x ", pduP[i]);
|
||||
printf("\n");
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void abort_nr_ul_harq(module_id_t mod_id, int UE_id, int8_t harq_pid)
|
||||
@@ -629,7 +648,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
T_BUFFER(sduP, sdu_lenP));
|
||||
|
||||
UE_info->mac_stats[UE_id].ulsch_total_bytes_rx += sdu_lenP;
|
||||
LOG_D(NR_MAC, "[gNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu from PHY (rnti %x, UE_id %d) ul_cqi %d TA %d sduP %p\n",
|
||||
LOG_D(NR_MAC, "[gNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu from PHY (rnti %x, UE_id %d) ul_cqi %d TA %d sduP %p, rssi %d\n",
|
||||
gnb_mod_idP,
|
||||
harq_pid,
|
||||
CC_idP,
|
||||
@@ -639,10 +658,11 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
UE_id,
|
||||
ul_cqi,
|
||||
timing_advance,
|
||||
sduP);
|
||||
sduP,
|
||||
rssi);
|
||||
|
||||
// if not missed detection (10dB threshold for now)
|
||||
if (UE_scheduling_control->raw_rssi < 100 + rssi) {
|
||||
if (rssi>0) {
|
||||
UE_scheduling_control->tpc0 = nr_get_tpc(target_snrx10,ul_cqi,30);
|
||||
if (timing_advance != 0xffff)
|
||||
UE_scheduling_control->ta_update = timing_advance;
|
||||
@@ -651,7 +671,8 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
LOG_D(NR_MAC, "[UE %d] PUSCH TPC %d and TA %d\n",UE_id,UE_scheduling_control->tpc0,UE_scheduling_control->ta_update);
|
||||
}
|
||||
else{
|
||||
UE_scheduling_control->tpc0 = 1;
|
||||
LOG_D(NR_MAC,"[UE %d] Detected DTX : increasing UE TX power\n",UE_id);
|
||||
UE_scheduling_control->tpc0 = 3;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
@@ -759,7 +780,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
// re-initialize ta update variables after RA procedure completion
|
||||
UE_info->UE_sched_ctrl[UE_id].ta_frame = frameP;
|
||||
|
||||
LOG_I(NR_MAC,
|
||||
LOG_D(NR_MAC,
|
||||
"reset RA state information for RA-RNTI %04x/index %d\n",
|
||||
ra->rnti,
|
||||
i);
|
||||
@@ -772,6 +793,14 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
UE_id,
|
||||
ra->rnti);
|
||||
|
||||
NR_UE_sched_ctrl_t *UE_scheduling_control = &UE_info->UE_sched_ctrl[UE_id];
|
||||
|
||||
UE_scheduling_control->tpc0 = nr_get_tpc(target_snrx10,ul_cqi,30);
|
||||
if (timing_advance != 0xffff)
|
||||
UE_scheduling_control->ta_update = timing_advance;
|
||||
UE_scheduling_control->raw_rssi = rssi;
|
||||
UE_scheduling_control->pusch_snrx10 = ul_cqi * 5 - 640;
|
||||
LOG_D(NR_MAC, "[UE %d] PUSCH TPC %d and TA %d\n",UE_id,UE_scheduling_control->tpc0,UE_scheduling_control->ta_update);
|
||||
if(ra->cfra) {
|
||||
|
||||
LOG_A(NR_MAC, "(ue %i, rnti 0x%04x) CFRA procedure succeeded!\n", UE_id, ra->rnti);
|
||||
@@ -792,13 +821,16 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
// First byte corresponds to R/LCID MAC sub-header
|
||||
memcpy(ra->cont_res_id, &sduP[1], sizeof(uint8_t) * 6);
|
||||
|
||||
nr_process_mac_pdu(gnb_mod_idP, UE_id, CC_idP, frameP, slotP, sduP, sdu_lenP);
|
||||
|
||||
ra->state = Msg4;
|
||||
ra->Msg4_frame = (frameP + 2) % 1024;
|
||||
ra->Msg4_slot = 1;
|
||||
LOG_I(NR_MAC, "Scheduling RA-Msg4 for TC_RNTI %04x (state %d, frame %d, slot %d)\n", ra->rnti, ra->state, ra->Msg4_frame, ra->Msg4_slot);
|
||||
|
||||
if (nr_process_mac_pdu(gnb_mod_idP, UE_id, CC_idP, frameP, slotP, sduP, sdu_lenP) == 0) {
|
||||
ra->state = Msg4;
|
||||
ra->Msg4_frame = (frameP + 2) % 1024;
|
||||
ra->Msg4_slot = 1;
|
||||
LOG_I(NR_MAC, "Scheduling RA-Msg4 for TC_RNTI %04x (state %d, frame %d, slot %d)\n", ra->rnti, ra->state, ra->Msg4_frame, ra->Msg4_slot);
|
||||
}
|
||||
else {
|
||||
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti);
|
||||
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -812,6 +844,14 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
if( (frameP!=ra->Msg3_frame) || (slotP!=ra->Msg3_slot))
|
||||
continue;
|
||||
|
||||
// for CFRA (NSA) do not schedule retransmission of msg3
|
||||
if (ra->cfra) {
|
||||
LOG_W(NR_MAC, "Random Access %i failed at state %i (NSA msg3 reception failed)\n", i, ra->state);
|
||||
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti);
|
||||
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ra->msg3_round >= MAX_HARQ_ROUNDS - 1) {
|
||||
LOG_W(NR_MAC, "Random Access %i failed at state %i (Reached msg3 max harq rounds)\n", i, ra->state);
|
||||
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti);
|
||||
@@ -889,14 +929,16 @@ bool allocate_ul_retransmission(module_id_t module_id,
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info;
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
NR_sched_pusch_t *retInfo = &sched_ctrl->ul_harq_processes[harq_pid].sched_pusch;
|
||||
|
||||
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
|
||||
NR_BWP_UplinkDedicated_t *ubwpd= cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL;
|
||||
NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? &sched_ctrl->active_ubwp->bwp_Common->genericParameters : &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
|
||||
int rbStart = sched_ctrl->active_ubwp ? NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE) : 0;
|
||||
const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = sched_ctrl->active_bwp ? 1 : 2;
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_bwp || ubwpd) ? 1 : 2;
|
||||
const int tda = sched_ctrl->active_ubwp ? RC.nrmac[module_id]->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0;
|
||||
LOG_D(NR_MAC,"retInfo->time_domain_allocation = %d, tda = %d\n", retInfo->time_domain_allocation, tda);
|
||||
LOG_D(NR_MAC,"num_dmrs_cdm_grps_no_data %d, tbs %d\n",num_dmrs_cdm_grps_no_data, retInfo->tb_size);
|
||||
if (tda == retInfo->time_domain_allocation) {
|
||||
/* Check the resource is enough for retransmission */
|
||||
while (rbStart < bwpSize && !rballoc_mask[rbStart])
|
||||
@@ -908,12 +950,13 @@ bool allocate_ul_retransmission(module_id_t module_id,
|
||||
/* check whether we need to switch the TDA allocation since tha last
|
||||
* (re-)transmission */
|
||||
NR_pusch_semi_static_t *ps = &sched_ctrl->pusch_semi_static;
|
||||
const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats;
|
||||
const int dci_format = sched_ctrl->active_ubwp ? (f ? NR_UL_DCI_FORMAT_0_1 : NR_UL_DCI_FORMAT_0_0) : NR_UL_DCI_FORMAT_0_0;
|
||||
|
||||
int dci_format = get_dci_format(sched_ctrl);
|
||||
|
||||
if (ps->time_domain_allocation != tda
|
||||
|| ps->dci_format != dci_format
|
||||
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
|
||||
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
LOG_D(NR_MAC, "%s(): retransmission keeping TDA %d and TBS %d\n", __func__, tda, retInfo->tb_size);
|
||||
} else {
|
||||
/* the retransmission will use a different time domain allocation, check
|
||||
@@ -924,9 +967,8 @@ bool allocate_ul_retransmission(module_id_t module_id,
|
||||
while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize])
|
||||
rbSize++;
|
||||
NR_pusch_semi_static_t temp_ps;
|
||||
const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats;
|
||||
const int dci_format = sched_ctrl->active_ubwp ? (f ? NR_UL_DCI_FORMAT_0_1 : NR_UL_DCI_FORMAT_0_0) : NR_UL_DCI_FORMAT_0_0;
|
||||
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, dci_format, tda, num_dmrs_cdm_grps_no_data, &temp_ps);
|
||||
int dci_format = get_dci_format(sched_ctrl);
|
||||
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp,ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, &temp_ps);
|
||||
uint32_t new_tbs;
|
||||
uint16_t new_rbSize;
|
||||
bool success = nr_find_nb_rb(retInfo->Qm,
|
||||
@@ -1023,8 +1065,12 @@ void pf_ul(module_id_t module_id,
|
||||
|
||||
if (UE_info->Msg4_ACKed[UE_id] != true) continue;
|
||||
|
||||
LOG_D(NR_MAC,"pf_ul: preparing UL scheduling for UE %d\n",UE_id);
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? &sched_ctrl->active_ubwp->bwp_Common->genericParameters : &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
|
||||
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
|
||||
NR_BWP_UplinkDedicated_t *ubwpd= cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL;
|
||||
|
||||
int rbStart = sched_ctrl->active_ubwp ? NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE) : 0;
|
||||
const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch;
|
||||
@@ -1037,6 +1083,7 @@ void pf_ul(module_id_t module_id,
|
||||
|
||||
/* Check if retransmission is necessary */
|
||||
sched_pusch->ul_harq_pid = sched_ctrl->retrans_ul_harq.head;
|
||||
LOG_D(NR_MAC,"pf_ul: UE %d harq_pid %d\n",UE_id,sched_pusch->ul_harq_pid);
|
||||
if (sched_pusch->ul_harq_pid >= 0) {
|
||||
/* Allocate retransmission*/
|
||||
bool r = allocate_ul_retransmission(
|
||||
@@ -1045,6 +1092,8 @@ void pf_ul(module_id_t module_id,
|
||||
LOG_D(NR_MAC, "%4d.%2d UL retransmission UE RNTI %04x can NOT be allocated\n", frame, slot, UE_info->rnti[UE_id]);
|
||||
continue;
|
||||
}
|
||||
else LOG_D(NR_MAC,"%4d.%2d UL Retransmission UE RNTI %04x to be allocated, max_num_ue %d\n",frame,slot,UE_info->rnti[UE_id],max_num_ue);
|
||||
|
||||
/* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE */
|
||||
max_num_ue--;
|
||||
if (max_num_ue < 0)
|
||||
@@ -1056,6 +1105,7 @@ void pf_ul(module_id_t module_id,
|
||||
/* preprocessor computed sched_frame/sched_slot */
|
||||
const bool do_sched = nr_UE_is_to_be_scheduled(module_id, 0, UE_id, sched_pusch->frame, sched_pusch->slot);
|
||||
|
||||
LOG_D(NR_MAC,"pf_ul: do_sched UE %d => %s\n",UE_id,do_sched ? "yes" : "no");
|
||||
if (B == 0 && !do_sched)
|
||||
continue;
|
||||
|
||||
@@ -1085,14 +1135,13 @@ void pf_ul(module_id_t module_id,
|
||||
/* we want to avoid a lengthy deduction of DMRS and other parameters in
|
||||
* every TTI if we can save it, so check whether dci_format, TDA, or
|
||||
* num_dmrs_cdm_grps_no_data has changed and only then recompute */
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = sched_ctrl->active_ubwp ? 1 : 2;
|
||||
const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats;
|
||||
const int dci_format = sched_ctrl->active_ubwp ? (f ? NR_UL_DCI_FORMAT_0_1 : NR_UL_DCI_FORMAT_0_0) : NR_UL_DCI_FORMAT_0_0;
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_ubwp || ubwpd) ? 1 : 2;
|
||||
int dci_format = get_dci_format(sched_ctrl);
|
||||
const int tda = sched_ctrl->active_ubwp ? nrmac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0;
|
||||
if (ps->time_domain_allocation != tda
|
||||
|| ps->dci_format != dci_format
|
||||
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
|
||||
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch;
|
||||
sched_pusch->mcs = 9;
|
||||
update_ul_ue_R_Qm(sched_pusch, ps);
|
||||
@@ -1152,6 +1201,7 @@ void pf_ul(module_id_t module_id,
|
||||
LOG_D(NR_MAC, "%4d.%2d no free CCE for UL DCI UE %04x\n", frame, slot, UE_info->rnti[UE_id]);
|
||||
continue;
|
||||
}
|
||||
else LOG_D(NR_MAC, "%4d.%2d free CCE for UL DCI UE %04x\n",frame,slot, UE_info->rnti[UE_id]);
|
||||
|
||||
/* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE */
|
||||
max_num_ue--;
|
||||
@@ -1159,6 +1209,8 @@ void pf_ul(module_id_t module_id,
|
||||
return;
|
||||
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
|
||||
NR_BWP_UplinkDedicated_t *ubwpd= cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL;
|
||||
NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? &sched_ctrl->active_ubwp->bwp_Common->genericParameters : &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
|
||||
int rbStart = sched_ctrl->active_ubwp ? NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE) : 0;
|
||||
const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
@@ -1176,19 +1228,19 @@ void pf_ul(module_id_t module_id,
|
||||
UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize);
|
||||
return;
|
||||
}
|
||||
else LOG_D(NR_MAC,"allocating UL data for UE %d/RNTI %04x (rbStsart %d, min_rb %d, bwpSize %d\n",UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize);
|
||||
|
||||
/* Save PUSCH field */
|
||||
/* we want to avoid a lengthy deduction of DMRS and other parameters in
|
||||
* every TTI if we can save it, so check whether dci_format, TDA, or
|
||||
* num_dmrs_cdm_grps_no_data has changed and only then recompute */
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = sched_ctrl->active_ubwp ? 1 : 2;
|
||||
const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats;
|
||||
const int dci_format = sched_ctrl->active_ubwp ? (f ? NR_UL_DCI_FORMAT_0_1 : NR_UL_DCI_FORMAT_0_0) : NR_UL_DCI_FORMAT_0_0;
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_ubwp || ubwpd) ? 1 : 2;
|
||||
int dci_format = get_dci_format(sched_ctrl);
|
||||
const int tda = sched_ctrl->active_ubwp ? nrmac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0;
|
||||
if (ps->time_domain_allocation != tda
|
||||
|| ps->dci_format != dci_format
|
||||
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
|
||||
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
update_ul_ue_R_Qm(sched_pusch, ps);
|
||||
|
||||
/* Calculate the current scheduling bytes and the necessary RBs */
|
||||
@@ -1205,8 +1257,8 @@ void pf_ul(module_id_t module_id,
|
||||
&rbSize);
|
||||
sched_pusch->rbSize = rbSize;
|
||||
sched_pusch->tb_size = TBS;
|
||||
LOG_D(NR_MAC,"rbSize %d, TBS %d, est buf %d, sched_ul %d, B %d\n",
|
||||
rbSize, sched_pusch->tb_size, sched_ctrl->estimated_ul_buffer, sched_ctrl->sched_ul_bytes, B);
|
||||
LOG_D(NR_MAC,"rbSize %d, TBS %d, est buf %d, sched_ul %d, B %d, CCE %d, num_dmrs_symb %d, N_PRB_DMRS %d\n",
|
||||
rbSize, sched_pusch->tb_size, sched_ctrl->estimated_ul_buffer, sched_ctrl->sched_ul_bytes, B,sched_ctrl->cce_index,ps->num_dmrs_symb,ps->N_PRB_DMRS);
|
||||
|
||||
/* Mark the corresponding RBs as used */
|
||||
n_rb_sched -= sched_pusch->rbSize;
|
||||
@@ -1367,6 +1419,9 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
for (int UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) {
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
if (sched_ctrl->ul_failure == 1 && get_softmodem_params()->phy_test==0) continue;
|
||||
|
||||
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
|
||||
NR_BWP_UplinkDedicated_t *ubwpd= cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL;
|
||||
UE_info->mac_stats[UE_id].ulsch_current_bytes = 0;
|
||||
|
||||
/* dynamic PUSCH values (RB alloc, MCS, hence R, Qm, TBS) that change in
|
||||
@@ -1439,24 +1494,28 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
sched_ctrl->last_ul_slot = sched_pusch->slot;
|
||||
|
||||
LOG_D(NR_MAC,
|
||||
"%4d.%2d RNTI %04x UL sched %4d.%2d start %2d RBS %3d startSymbol %2d nb_symbol %2d MCS %2d TBS %4d HARQ PID %2d round %d NDI %d est %6d sched %6d est BSR %6d\n",
|
||||
"ULSCH/PUSCH: %4d.%2d RNTI %04x UL sched %4d.%2d DCI L %d start %2d RBS %3d startSymbol %2d nb_symbol %2d dmrs_pos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d est %6d sched %6d est BSR %6d TPC %d\n",
|
||||
frame,
|
||||
slot,
|
||||
rnti,
|
||||
sched_pusch->frame,
|
||||
sched_pusch->slot,
|
||||
sched_ctrl->aggregation_level,
|
||||
sched_pusch->rbStart,
|
||||
sched_pusch->rbSize,
|
||||
ps->startSymbolIndex,
|
||||
ps->nrOfSymbols,
|
||||
ps->ul_dmrs_symb_pos,
|
||||
sched_pusch->mcs,
|
||||
sched_pusch->tb_size,
|
||||
harq_id,
|
||||
cur_harq->round,
|
||||
nr_rv_round_map[cur_harq->round],
|
||||
cur_harq->ndi,
|
||||
sched_ctrl->estimated_ul_buffer,
|
||||
sched_ctrl->sched_ul_bytes,
|
||||
sched_ctrl->estimated_ul_buffer - sched_ctrl->sched_ul_bytes);
|
||||
sched_ctrl->estimated_ul_buffer - sched_ctrl->sched_ul_bytes,
|
||||
sched_ctrl->tpc0);
|
||||
|
||||
/* PUSCH in a later slot, but corresponding DCI now! */
|
||||
nfapi_nr_ul_tti_request_t *future_ul_tti_req = &RC.nrmac[module_id]->UL_tti_req_ahead[0][sched_pusch->slot];
|
||||
@@ -1494,8 +1553,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
pusch_pdu->mcs_index = sched_pusch->mcs;
|
||||
pusch_pdu->mcs_table = ps->mcs_table;
|
||||
pusch_pdu->transform_precoding = ps->transform_precoding;
|
||||
if (ps->pusch_Config &&
|
||||
ps->pusch_Config->dataScramblingIdentityPUSCH)
|
||||
if (ps->pusch_Config && ps->pusch_Config->dataScramblingIdentityPUSCH)
|
||||
pusch_pdu->data_scrambling_id = *ps->pusch_Config->dataScramblingIdentityPUSCH;
|
||||
else
|
||||
pusch_pdu->data_scrambling_id = *scc->physCellId;
|
||||
@@ -1548,6 +1606,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
pusch_pdu->pusch_data.tb_size = sched_pusch->tb_size;
|
||||
pusch_pdu->pusch_data.num_cb = 0; //CBG not supported
|
||||
|
||||
LOG_D(NR_MAC,"PUSCH PDU : data_scrambling_identity %x, dmrs_scrambling_id %x\n",pusch_pdu->data_scrambling_id,pusch_pdu->ul_dmrs_scrambling_id);
|
||||
/* TRANSFORM PRECODING --------------------------------------------------------*/
|
||||
|
||||
if (pusch_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_enabled){
|
||||
@@ -1587,8 +1646,8 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
/* look up the PDCCH PDU for this BWP and CORESET. If it does not exist,
|
||||
* create it */
|
||||
const int bwpid = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0;
|
||||
NR_SearchSpace_t *ss = sched_ctrl->active_bwp ? sched_ctrl->search_space: RC.nrmac[module_id]->sched_ctrlCommon->search_space;
|
||||
NR_ControlResourceSet_t *coreset = sched_ctrl->active_bwp? sched_ctrl->coreset: RC.nrmac[module_id]->sched_ctrlCommon->coreset;
|
||||
NR_SearchSpace_t *ss = (sched_ctrl->active_bwp || ubwpd) ? sched_ctrl->search_space: RC.nrmac[module_id]->sched_ctrlCommon->search_space;
|
||||
NR_ControlResourceSet_t *coreset = (sched_ctrl->active_bwp || ubwpd) ? sched_ctrl->coreset: RC.nrmac[module_id]->sched_ctrlCommon->coreset;
|
||||
const int coresetid = coreset->controlResourceSetId;
|
||||
nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = pdcch_pdu_bwp_coreset[bwpid][coresetid];
|
||||
if (!pdcch_pdu) {
|
||||
@@ -1602,7 +1661,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
pdcch_pdu_bwp_coreset[bwpid][coresetid] = pdcch_pdu;
|
||||
}
|
||||
|
||||
LOG_D(NR_MAC,"Configuring ULDCI/PDCCH in %d.%d\n", frame,slot);
|
||||
LOG_D(NR_MAC,"Configuring ULDCI/PDCCH in %d.%d at CCE %d, rnti %x\n", frame,slot,sched_ctrl->cce_index,rnti);
|
||||
|
||||
/* Fill PDCCH DL DCI PDU */
|
||||
nfapi_nr_dl_dci_pdu_t *dci_pdu = &pdcch_pdu->dci_pdu[pdcch_pdu->numDlDci];
|
||||
@@ -1623,14 +1682,12 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
|
||||
dci_pdu_rel15_t uldci_payload;
|
||||
memset(&uldci_payload, 0, sizeof(uldci_payload));
|
||||
NR_CellGroupConfig_t *CellGroup = UE_info->CellGroup[UE_id];
|
||||
int n_ubwp=1;
|
||||
if (CellGroup && CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated &&
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig &&
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList)
|
||||
n_ubwp = CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count;
|
||||
if (cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList)
|
||||
n_ubwp = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count;
|
||||
|
||||
config_uldci(sched_ctrl->active_ubwp,
|
||||
ubwpd,
|
||||
scc,
|
||||
pusch_pdu,
|
||||
&uldci_payload,
|
||||
@@ -1640,7 +1697,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
n_ubwp,
|
||||
bwpid);
|
||||
fill_dci_pdu_rel15(scc,
|
||||
CellGroup,
|
||||
cg,
|
||||
dci_pdu,
|
||||
&uldci_payload,
|
||||
ps->dci_format,
|
||||
|
||||
@@ -53,10 +53,10 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int pusch_AntennaPorts,
|
||||
int sib1_tda,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
int nsa_flag,
|
||||
NR_BCCH_BCH_Message_t *mib,
|
||||
int add_ue,
|
||||
uint32_t rnti,
|
||||
NR_CellGroupConfig_t *CellGroup
|
||||
);
|
||||
NR_CellGroupConfig_t *CellGroup);
|
||||
|
||||
void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
|
||||
int CC_idP,
|
||||
@@ -178,7 +178,8 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
|
||||
|
||||
|
||||
void config_uldci(const NR_BWP_Uplink_t *ubwp,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_BWP_UplinkDedicated_t *ubwpd,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
const nfapi_nr_pusch_pdu_t *pusch_pdu,
|
||||
dci_pdu_rel15_t *dci_pdu_rel15,
|
||||
int dci_format,
|
||||
@@ -204,11 +205,14 @@ int nr_acknack_scheduling(int Mod_idP,
|
||||
int UE_id,
|
||||
frame_t frameP,
|
||||
sub_frame_t slotP,
|
||||
int r_pucch);
|
||||
int r_pucch,
|
||||
int do_common);
|
||||
|
||||
void get_pdsch_to_harq_feedback(int Mod_idP,
|
||||
int UE_id,
|
||||
int bwp_id,
|
||||
NR_SearchSpace__searchSpaceType_PR ss_type,
|
||||
int *max_fb_time,
|
||||
uint8_t *pdsch_to_harq_feedback);
|
||||
|
||||
void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu,
|
||||
@@ -234,6 +238,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
NR_CellGroupConfig_t *CellGroup,
|
||||
NR_BWP_Uplink_t *bwp,
|
||||
NR_BWP_UplinkDedicated_t *bwpd,
|
||||
uint16_t rnti,
|
||||
uint8_t pucch_resource,
|
||||
uint16_t O_csi,
|
||||
@@ -268,7 +273,7 @@ void prepare_dci(const NR_CellGroupConfig_t *CellGroup,
|
||||
|
||||
/* find coreset within the search space */
|
||||
NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc,
|
||||
NR_BWP_Downlink_t *bwp,
|
||||
void *bwp,
|
||||
NR_SearchSpace_t *ss,
|
||||
NR_SearchSpace__searchSpaceType_PR ss_type);
|
||||
|
||||
@@ -282,12 +287,14 @@ long get_K2(NR_ServingCellConfigCommon_t *scc, NR_BWP_Uplink_t *ubwp, int time_d
|
||||
void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_CellGroupConfig_t *secondaryCellGroup,
|
||||
const NR_BWP_Downlink_t *bwp,
|
||||
const NR_BWP_DownlinkDedicated_t *bwpd0,
|
||||
int tda,
|
||||
const long dci_format,
|
||||
NR_pdsch_semi_static_t *ps);
|
||||
|
||||
void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_BWP_Uplink_t *ubwp,
|
||||
const NR_BWP_UplinkDedicated_t *ubwpd,
|
||||
long dci_format,
|
||||
int tda,
|
||||
uint8_t num_dmrs_cdm_grps_no_data,
|
||||
|
||||
@@ -529,7 +529,8 @@ typedef struct {
|
||||
/// corresponding to the sched_pusch/sched_pdsch structures below
|
||||
int cce_index;
|
||||
uint8_t aggregation_level;
|
||||
|
||||
/// maximum aggregation level for UE, can be used to select level
|
||||
int maxL;
|
||||
/// PUCCH scheduling information. Array of two: HARQ+SR in the first field,
|
||||
/// CSI in second. This order is important for nr_acknack_scheduling()!
|
||||
NR_sched_pucch_t sched_pucch[2];
|
||||
@@ -563,6 +564,7 @@ typedef struct {
|
||||
mac_rlc_status_resp_t rlc_status[MAX_NUM_LCID];
|
||||
|
||||
int lcid_mask;
|
||||
int lcid_to_schedule;
|
||||
uint16_t ta_frame;
|
||||
int16_t ta_update;
|
||||
bool ta_apply;
|
||||
@@ -616,6 +618,7 @@ typedef struct {
|
||||
int ulsch_total_bytes_scheduled;
|
||||
int ulsch_total_bytes_rx;
|
||||
int ulsch_current_bytes;
|
||||
int pucch0_DTX;
|
||||
int cumul_rsrp;
|
||||
uint8_t num_rsrp_meas;
|
||||
} NR_mac_stats_t;
|
||||
|
||||
@@ -102,6 +102,7 @@ static void nr_pdcp_entity_recv_pdu(nr_pdcp_entity_t *entity,
|
||||
entity->rb_id, rcvd_count, entity->is_gnb ? 0 : 1);
|
||||
if (memcmp(integrity, buffer + size - integrity_size, 4) != 0) {
|
||||
LOG_E(PDCP, "discard NR PDU, integrity failed\n");
|
||||
// return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include "nr_pdcp_entity_srb.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "assertions.h"
|
||||
|
||||
void nr_pdcp_entity_srb_recv_pdu(nr_pdcp_entity_t *_entity, char *buffer, int size)
|
||||
{
|
||||
nr_pdcp_entity_srb_t *entity = (nr_pdcp_entity_srb_t *)_entity;
|
||||
|
||||
if (size < 2) abort();
|
||||
entity->common.deliver_sdu(entity->common.deliver_sdu_data,
|
||||
(nr_pdcp_entity_t *)entity, buffer+2, size-6);
|
||||
}
|
||||
|
||||
void nr_pdcp_entity_srb_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int size,
|
||||
int sdu_id)
|
||||
{
|
||||
nr_pdcp_entity_srb_t *entity = (nr_pdcp_entity_srb_t *)_entity;
|
||||
int sn;
|
||||
char buf[size+6];
|
||||
char buf_mel[1024];
|
||||
hexdump(buffer, size, buf_mel, sizeof(buf_mel));
|
||||
LOG_I(PDCP, "Melissa Elkadi in %s, this is hexdump of pdu %s recevied in PDCP layer directly\n",
|
||||
__FUNCTION__, buf_mel);
|
||||
sn = entity->common.next_nr_pdcp_tx_sn;
|
||||
|
||||
entity->common.next_nr_pdcp_tx_sn++;
|
||||
if (entity->common.next_nr_pdcp_tx_sn > entity->common.maximum_nr_pdcp_sn) {
|
||||
entity->common.next_nr_pdcp_tx_sn = 0;
|
||||
entity->common.tx_hfn++;
|
||||
}
|
||||
|
||||
buf[0] = (sn >> 8) & 0x0f;
|
||||
buf[1] = sn & 0xff;
|
||||
memcpy(buf+2, buffer, size);
|
||||
|
||||
/* For now use padding for the MAC-I bytes (normally carrying message authentication code)
|
||||
* which come after the data payload bytes (38.323, section 6.2.2.1) */
|
||||
for (int i=size+2; i<size+6; i++)
|
||||
buf[i] = 0x11*(i-size-1);
|
||||
|
||||
entity->common.deliver_pdu(entity->common.deliver_pdu_data,
|
||||
(nr_pdcp_entity_t *)entity, buf, size+6, sdu_id);
|
||||
char buf_meli[1024];
|
||||
hexdump(buf, size + 3, buf_meli, sizeof(buf_meli));
|
||||
LOG_I(PDCP, "Melissa Elkadi in %s, this is hexdump of pdu %s After delivering to RLC\n",
|
||||
__FUNCTION__, buf_meli);
|
||||
}
|
||||
|
||||
void nr_pdcp_entity_srb_set_integrity_key(nr_pdcp_entity_t *_entity, char *key)
|
||||
{
|
||||
/* nothing to do */
|
||||
}
|
||||
|
||||
void nr_pdcp_entity_srb_delete(nr_pdcp_entity_t *_entity)
|
||||
{
|
||||
nr_pdcp_entity_srb_t *entity = (nr_pdcp_entity_srb_t *)_entity;
|
||||
free(entity);
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef _NR_PDCP_ENTITY_SRB_H_
|
||||
#define _NR_PDCP_ENTITY_SRB_H_
|
||||
|
||||
#include "nr_pdcp_entity.h"
|
||||
|
||||
typedef struct {
|
||||
nr_pdcp_entity_t common;
|
||||
int srb_id;
|
||||
} nr_pdcp_entity_srb_t;
|
||||
|
||||
void nr_pdcp_entity_srb_recv_pdu(nr_pdcp_entity_t *_entity, char *buffer, int size);
|
||||
void nr_pdcp_entity_srb_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int size, int sdu_id);
|
||||
void nr_pdcp_entity_srb_set_integrity_key(nr_pdcp_entity_t *_entity, char *key);
|
||||
void nr_pdcp_entity_srb_delete(nr_pdcp_entity_t *_entity);
|
||||
|
||||
|
||||
#endif /* _NR_PDCP_ENTITY_SRB_H_ */
|
||||
@@ -488,7 +488,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
|
||||
GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX;
|
||||
GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).rnti = ue->rnti;
|
||||
GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).pdusession_id = entity->pdusession_id;
|
||||
if (offset==1) LOG_I(PDCP, "%s() (drb %d) SDAP header %2x\n",__func__, rb_id, buf[0]);
|
||||
if (offset==1) LOG_D(PDCP, "%s() (drb %d) SDAP header %2x\n",__func__, rb_id, buf[0]);
|
||||
LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n", __func__, rb_id, size-offset);
|
||||
itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p);
|
||||
}
|
||||
@@ -745,7 +745,11 @@ void pdcp_run(const protocol_ctxt_t *const ctxt_pP)
|
||||
}
|
||||
}
|
||||
|
||||
static void add_srb(int is_gnb, int rnti, struct NR_SRB_ToAddMod *s)
|
||||
static void add_srb(int is_gnb, int rnti, struct NR_SRB_ToAddMod *s,
|
||||
int ciphering_algorithm,
|
||||
int integrity_algorithm,
|
||||
unsigned char *ciphering_key,
|
||||
unsigned char *integrity_key)
|
||||
{
|
||||
nr_pdcp_entity_t *pdcp_srb;
|
||||
nr_pdcp_ue_t *ue;
|
||||
@@ -766,8 +770,10 @@ static void add_srb(int is_gnb, int rnti, struct NR_SRB_ToAddMod *s)
|
||||
0, 0, 0, 0, // sdap parameters
|
||||
deliver_sdu_srb, ue, deliver_pdu_srb, ue,
|
||||
12, t_Reordering, -1,
|
||||
0, 0,
|
||||
NULL, NULL);
|
||||
ciphering_algorithm,
|
||||
integrity_algorithm,
|
||||
ciphering_key,
|
||||
integrity_key);
|
||||
nr_pdcp_ue_add_srb_pdcp_entity(ue, srb_id, pdcp_srb);
|
||||
|
||||
LOG_D(PDCP, "%s:%d:%s: added srb %d to ue rnti %x\n", __FILE__, __LINE__, __FUNCTION__, srb_id, rnti);
|
||||
@@ -789,12 +795,27 @@ static void add_drb_am(int is_gnb, int rnti, struct NR_DRB_ToAddMod *s,
|
||||
int sn_size_dl = decode_sn_size_dl(*s->pdcp_Config->drb->pdcp_SN_SizeDL);
|
||||
int discard_timer = decode_discard_timer(*s->pdcp_Config->drb->discardTimer);
|
||||
|
||||
int has_integrity;
|
||||
int has_ciphering;
|
||||
|
||||
/* if pdcp_Config->t_Reordering is not present, it means infinity (-1) */
|
||||
int t_reordering = -1;
|
||||
if (s->pdcp_Config->t_Reordering != NULL) {
|
||||
t_reordering = decode_t_reordering(*s->pdcp_Config->t_Reordering);
|
||||
}
|
||||
|
||||
if (s->pdcp_Config->drb != NULL
|
||||
&& s->pdcp_Config->drb->integrityProtection != NULL)
|
||||
has_integrity = 1;
|
||||
else
|
||||
has_integrity = 0;
|
||||
|
||||
if (s->pdcp_Config->ext1 != NULL
|
||||
&& s->pdcp_Config->ext1->cipheringDisabled != NULL)
|
||||
has_ciphering = 0;
|
||||
else
|
||||
has_ciphering = 1;
|
||||
|
||||
if ((!s->cnAssociation) || s->cnAssociation->present == NR_DRB_ToAddMod__cnAssociation_PR_NOTHING) {
|
||||
LOG_E(PDCP,"%s:%d:%s: fatal, cnAssociation is missing or present is NR_DRB_ToAddMod__cnAssociation_PR_NOTHING\n",__FILE__,__LINE__,__FUNCTION__);
|
||||
exit(-1);
|
||||
@@ -836,7 +857,7 @@ static void add_drb_am(int is_gnb, int rnti, struct NR_DRB_ToAddMod *s,
|
||||
nr_pdcp_manager_lock(nr_pdcp_ue_manager);
|
||||
ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, rnti);
|
||||
if (ue->drb[drb_id-1] != NULL) {
|
||||
LOG_I(PDCP, "Melissa Elkadi %s:%d:%s: warning DRB %d already exist for ue %d, do nothing\n",
|
||||
LOG_W(PDCP, "%s:%d:%s: warning DRB %d already exist for ue %d, do nothing\n",
|
||||
__FILE__, __LINE__, __FUNCTION__, drb_id, rnti);
|
||||
} else {
|
||||
LOG_I(PDCP, "%s:%d:%s: Melissa Elkadi, we will call deliver_sdu_drb\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
@@ -844,8 +865,10 @@ static void add_drb_am(int is_gnb, int rnti, struct NR_DRB_ToAddMod *s,
|
||||
has_sdapULheader,has_sdapDLheader,
|
||||
deliver_sdu_drb, ue, deliver_pdu_drb, ue,
|
||||
sn_size_dl, t_reordering, discard_timer,
|
||||
ciphering_algorithm, integrity_algorithm,
|
||||
ciphering_key, integrity_key);
|
||||
has_ciphering ? ciphering_algorithm : 0,
|
||||
has_integrity ? integrity_algorithm : 0,
|
||||
has_ciphering ? ciphering_key : NULL,
|
||||
has_integrity ? integrity_key : NULL);
|
||||
nr_pdcp_ue_add_drb_pdcp_entity(ue, drb_id, pdcp_drb);
|
||||
|
||||
LOG_D(PDCP, "%s:%d:%s: added drb %d to ue rnti %x\n", __FILE__, __LINE__, __FUNCTION__, drb_id, rnti);
|
||||
@@ -919,7 +942,9 @@ boolean_t nr_rrc_pdcp_config_asn1_req(
|
||||
|
||||
if (srb2add_list != NULL) {
|
||||
for (i = 0; i < srb2add_list->list.count; i++) {
|
||||
add_srb(ctxt_pP->enb_flag,rnti, srb2add_list->list.array[i]);
|
||||
add_srb(ctxt_pP->enb_flag,rnti, srb2add_list->list.array[i],
|
||||
security_modeP & 0x0f, (security_modeP >> 4) & 0x0f,
|
||||
kRRCenc, kRRCint);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -403,15 +403,22 @@ int rlc_module_init(int enb_flag)
|
||||
{
|
||||
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static int inited = 0;
|
||||
static int inited_ue = 0;
|
||||
|
||||
if (pthread_mutex_lock(&lock)) abort();
|
||||
|
||||
if (inited) {
|
||||
LOG_E(RLC, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
if (enb_flag == 1 && inited) {
|
||||
LOG_E(RLC, "%s:%d:%s: fatal, inited already 1\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
inited = 1;
|
||||
if (enb_flag == 0 && inited_ue) {
|
||||
LOG_E(RLC, "%s:%d:%s: fatal, inited_ue already 1\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (enb_flag == 1) inited = 1;
|
||||
if (enb_flag == 0) inited_ue = 1;
|
||||
|
||||
nr_rlc_ue_manager = new_nr_rlc_ue_manager(enb_flag);
|
||||
|
||||
@@ -457,7 +464,7 @@ static void deliver_sdu(void *_ue, nr_rlc_entity_t *entity, char *buf, int size)
|
||||
exit(1);
|
||||
|
||||
rb_found:
|
||||
LOG_D(RLC, "%s:%d:%s: delivering SDU (rnti %d is_srb %d rb_id %d) size %d",
|
||||
LOG_D(RLC, "%s:%d:%s: delivering SDU (rnti %d is_srb %d rb_id %d) size %d\n",
|
||||
__FILE__, __LINE__, __FUNCTION__, ue->rnti, is_srb, rb_id, size);
|
||||
|
||||
memblock = get_free_mem_block(size, __func__);
|
||||
|
||||
@@ -285,7 +285,7 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
|
||||
|
||||
LOG_D(NR_RRC,"[gNB %d] Frame %d CCCH request (Srb_id %ld)\n", Mod_idP, frameP, Srb_id);
|
||||
|
||||
AssertFatal(ue_context_p!=NULL,"failed to get ue_context\n");
|
||||
AssertFatal(ue_context_p!=NULL,"failed to get ue_context, rnti %x\n",rnti);
|
||||
char payload_size = ue_context_p->ue_context.Srb0.Tx_buffer.payload_size;
|
||||
|
||||
// check if data is there for MAC
|
||||
@@ -325,7 +325,7 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP,
|
||||
NR_ServingCellConfigCommon_t *scc=RC.nrrrc[module_idP]->carrier.servingcellconfigcommon;
|
||||
uint8_t sdu2[100];
|
||||
memset(&cellGroupConfig,0,sizeof(cellGroupConfig));
|
||||
fill_initial_cellGroupConfig(rntiP,&cellGroupConfig,scc);
|
||||
fill_initial_cellGroupConfig(rntiP,&cellGroupConfig,scc,&RC.nrrrc[module_idP]->carrier);
|
||||
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
|
||||
NULL,
|
||||
(void *)&cellGroupConfig,
|
||||
|
||||
@@ -459,7 +459,7 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
ss1->monitoringSlotPeriodicityAndOffset->present = NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
|
||||
ss1->monitoringSymbolsWithinSlot = calloc(1,sizeof(*ss1->monitoringSymbolsWithinSlot));
|
||||
ss1->monitoringSymbolsWithinSlot->buf = calloc(1,2);
|
||||
// should be '1100 0000 0000 00'B (LSB first!), first two symols in slot, adjust if needed
|
||||
// should be '1000 0000 0000 00'B (LSB first!), first symbol in slot, adjust if needed
|
||||
ss1->monitoringSymbolsWithinSlot->buf[1] = 0;
|
||||
ss1->monitoringSymbolsWithinSlot->buf[0] = (1<<7);
|
||||
ss1->monitoringSymbolsWithinSlot->size = 2;
|
||||
@@ -467,7 +467,7 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
ss1->nrofCandidates = calloc(1,sizeof(*ss1->nrofCandidates));
|
||||
ss1->nrofCandidates->aggregationLevel1 = NR_SearchSpace__nrofCandidates__aggregationLevel1_n0;
|
||||
ss1->nrofCandidates->aggregationLevel2 = NR_SearchSpace__nrofCandidates__aggregationLevel2_n0;
|
||||
ss1->nrofCandidates->aggregationLevel4 = NR_SearchSpace__nrofCandidates__aggregationLevel4_n4;
|
||||
ss1->nrofCandidates->aggregationLevel4 = NR_SearchSpace__nrofCandidates__aggregationLevel4_n2;
|
||||
ss1->nrofCandidates->aggregationLevel8 = NR_SearchSpace__nrofCandidates__aggregationLevel8_n0;
|
||||
ss1->nrofCandidates->aggregationLevel16 = NR_SearchSpace__nrofCandidates__aggregationLevel16_n0;
|
||||
ss1->searchSpaceType = calloc(1,sizeof(*ss1->searchSpaceType));
|
||||
@@ -1001,7 +1001,9 @@ uint8_t do_RRCReject(uint8_t Mod_id,
|
||||
|
||||
void fill_initial_SpCellConfig(rnti_t rnti,
|
||||
NR_SpCellConfig_t *SpCellConfig,
|
||||
NR_ServingCellConfigCommon_t *scc) {
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
rrc_gNB_carrier_data_t *carrier) {
|
||||
|
||||
int curr_bwp = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
|
||||
SpCellConfig->servCellIndex = NULL;
|
||||
SpCellConfig->reconfigurationWithSync = NULL;
|
||||
@@ -1042,28 +1044,168 @@ void fill_initial_SpCellConfig(rnti_t rnti,
|
||||
pucchres0->format.choice.format0->nrofSymbols=1;
|
||||
pucchres0->format.choice.format0->startingSymbolIndex=13;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres0);
|
||||
|
||||
initialUplinkBWP->pusch_Config = calloc(1,sizeof(*initialUplinkBWP->pusch_Config));
|
||||
initialUplinkBWP->pusch_Config->present = NR_SetupRelease_PUSCH_Config_PR_setup;
|
||||
NR_PUSCH_Config_t *pusch_Config = calloc(1,sizeof(*pusch_Config));
|
||||
initialUplinkBWP->pusch_Config->choice.setup = pusch_Config;
|
||||
pusch_Config->dataScramblingIdentityPUSCH = NULL;
|
||||
pusch_Config->txConfig=calloc(1,sizeof(*pusch_Config->txConfig));
|
||||
*pusch_Config->txConfig= NR_PUSCH_Config__txConfig_codebook;
|
||||
pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA = NULL;
|
||||
pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB = calloc(1,sizeof(*pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB));
|
||||
pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->present = NR_SetupRelease_DMRS_UplinkConfig_PR_setup;
|
||||
pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup = calloc(1,sizeof(*pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup));
|
||||
NR_DMRS_UplinkConfig_t *NR_DMRS_UplinkConfig = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup;
|
||||
NR_DMRS_UplinkConfig->dmrs_Type = NULL;
|
||||
NR_DMRS_UplinkConfig->dmrs_AdditionalPosition = NULL; /*calloc(1,sizeof(*NR_DMRS_UplinkConfig->dmrs_AdditionalPosition));
|
||||
*NR_DMRS_UplinkConfig->dmrs_AdditionalPosition = NR_DMRS_UplinkConfig__dmrs_AdditionalPosition_pos0;*/
|
||||
NR_DMRS_UplinkConfig->phaseTrackingRS=NULL;
|
||||
NR_DMRS_UplinkConfig->maxLength=NULL;
|
||||
NR_DMRS_UplinkConfig->transformPrecodingDisabled = calloc(1,sizeof(*NR_DMRS_UplinkConfig->transformPrecodingDisabled));
|
||||
NR_DMRS_UplinkConfig->transformPrecodingDisabled->scramblingID0 = NULL;
|
||||
NR_DMRS_UplinkConfig->transformPrecodingDisabled->scramblingID1 = NULL;
|
||||
NR_DMRS_UplinkConfig->transformPrecodingEnabled = NULL;
|
||||
pusch_Config->pusch_PowerControl = calloc(1,sizeof(*pusch_Config->pusch_PowerControl));
|
||||
pusch_Config->pusch_PowerControl->tpc_Accumulation = NULL;
|
||||
pusch_Config->pusch_PowerControl->msg3_Alpha = calloc(1,sizeof(*pusch_Config->pusch_PowerControl->msg3_Alpha));
|
||||
*pusch_Config->pusch_PowerControl->msg3_Alpha = NR_Alpha_alpha1;
|
||||
pusch_Config->pusch_PowerControl->p0_NominalWithoutGrant = calloc(1,sizeof(*pusch_Config->pusch_PowerControl->p0_NominalWithoutGrant));
|
||||
*pusch_Config->pusch_PowerControl->p0_NominalWithoutGrant = -76;
|
||||
pusch_Config->pusch_PowerControl->p0_AlphaSets = calloc(1,sizeof(*pusch_Config->pusch_PowerControl->p0_AlphaSets));
|
||||
NR_P0_PUSCH_AlphaSet_t *aset = calloc(1,sizeof(*aset));
|
||||
aset->p0_PUSCH_AlphaSetId=0;
|
||||
aset->p0=calloc(1,sizeof(*aset->p0));
|
||||
*aset->p0 = 0;
|
||||
aset->alpha=calloc(1,sizeof(*aset->alpha));
|
||||
*aset->alpha=NR_Alpha_alpha1;
|
||||
ASN_SEQUENCE_ADD(&pusch_Config->pusch_PowerControl->p0_AlphaSets->list,aset);
|
||||
pusch_Config->pusch_PowerControl->pathlossReferenceRSToAddModList = calloc(1,sizeof(*pusch_Config->pusch_PowerControl->pathlossReferenceRSToAddModList));
|
||||
NR_PUSCH_PathlossReferenceRS_t *plrefRS = calloc(1,sizeof(*plrefRS));
|
||||
plrefRS->pusch_PathlossReferenceRS_Id=0;
|
||||
plrefRS->referenceSignal.present = NR_PathlossReferenceRS_Config_PR_ssb_Index;
|
||||
plrefRS->referenceSignal.choice.ssb_Index = 0;
|
||||
ASN_SEQUENCE_ADD(&pusch_Config->pusch_PowerControl->pathlossReferenceRSToAddModList->list,plrefRS);
|
||||
pusch_Config->pusch_PowerControl->pathlossReferenceRSToReleaseList = NULL;
|
||||
pusch_Config->pusch_PowerControl->twoPUSCH_PC_AdjustmentStates = NULL;
|
||||
pusch_Config->pusch_PowerControl->deltaMCS = NULL;
|
||||
pusch_Config->pusch_PowerControl->sri_PUSCH_MappingToAddModList = calloc(1,sizeof(*pusch_Config->pusch_PowerControl->sri_PUSCH_MappingToAddModList));
|
||||
NR_SRI_PUSCH_PowerControl_t *sriPUSCHPC=calloc(1,sizeof(*sriPUSCHPC));
|
||||
sriPUSCHPC->sri_PUSCH_PowerControlId=0;
|
||||
sriPUSCHPC->sri_PUSCH_PathlossReferenceRS_Id=0;
|
||||
sriPUSCHPC->sri_P0_PUSCH_AlphaSetId=0;
|
||||
sriPUSCHPC->sri_PUSCH_ClosedLoopIndex=NR_SRI_PUSCH_PowerControl__sri_PUSCH_ClosedLoopIndex_i0;
|
||||
ASN_SEQUENCE_ADD(&pusch_Config->pusch_PowerControl->sri_PUSCH_MappingToAddModList->list,sriPUSCHPC);
|
||||
pusch_Config->pusch_PowerControl->sri_PUSCH_MappingToReleaseList = NULL;
|
||||
pusch_Config->frequencyHopping=NULL;
|
||||
pusch_Config->frequencyHoppingOffsetLists=NULL;
|
||||
pusch_Config->resourceAllocation = NR_PUSCH_Config__resourceAllocation_resourceAllocationType1;
|
||||
pusch_Config->pusch_TimeDomainAllocationList = NULL;
|
||||
pusch_Config->pusch_AggregationFactor=NULL;
|
||||
pusch_Config->mcs_Table=NULL;
|
||||
pusch_Config->mcs_TableTransformPrecoder=NULL;
|
||||
pusch_Config->transformPrecoder= NULL;
|
||||
if (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL) {
|
||||
pusch_Config->transformPrecoder=calloc(1,sizeof(*pusch_Config->transformPrecoder));
|
||||
*pusch_Config->transformPrecoder = NR_PUSCH_Config__transformPrecoder_disabled;
|
||||
}
|
||||
pusch_Config->codebookSubset=calloc(1,sizeof(*pusch_Config->codebookSubset));
|
||||
*pusch_Config->codebookSubset = NR_PUSCH_Config__codebookSubset_nonCoherent;
|
||||
pusch_Config->maxRank=calloc(1,sizeof(*pusch_Config->maxRank));
|
||||
*pusch_Config->maxRank= 1;
|
||||
pusch_Config->rbg_Size=NULL;
|
||||
pusch_Config->uci_OnPUSCH=NULL;
|
||||
pusch_Config->tp_pi2BPSK=NULL;
|
||||
|
||||
initialUplinkBWP->srs_Config = calloc(1,sizeof(*initialUplinkBWP->srs_Config));
|
||||
initialUplinkBWP->srs_Config->present = NR_SetupRelease_SRS_Config_PR_setup;
|
||||
NR_SRS_Config_t *srs_Config = calloc(1,sizeof(*srs_Config));
|
||||
initialUplinkBWP->srs_Config->choice.setup=srs_Config;
|
||||
srs_Config->srs_ResourceSetToReleaseList=NULL;
|
||||
srs_Config->srs_ResourceSetToAddModList=calloc(1,sizeof(*srs_Config->srs_ResourceSetToAddModList));
|
||||
NR_SRS_ResourceSet_t *srs_resset0=calloc(1,sizeof(*srs_resset0));
|
||||
srs_resset0->srs_ResourceSetId = 0;
|
||||
srs_resset0->srs_ResourceIdList=calloc(1,sizeof(*srs_resset0->srs_ResourceIdList));
|
||||
NR_SRS_ResourceId_t *srs_resset0_id=calloc(1,sizeof(*srs_resset0_id));
|
||||
*srs_resset0_id=0;
|
||||
ASN_SEQUENCE_ADD(&srs_resset0->srs_ResourceIdList->list,srs_resset0_id);
|
||||
srs_Config->srs_ResourceToReleaseList=NULL;
|
||||
srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_aperiodic;
|
||||
srs_resset0->resourceType.choice.aperiodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic));
|
||||
srs_resset0->resourceType.choice.aperiodic->aperiodicSRS_ResourceTrigger=1;
|
||||
srs_resset0->resourceType.choice.aperiodic->csi_RS=NULL;
|
||||
srs_resset0->resourceType.choice.aperiodic->slotOffset= calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic->slotOffset));
|
||||
*srs_resset0->resourceType.choice.aperiodic->slotOffset=2;
|
||||
srs_resset0->resourceType.choice.aperiodic->ext1=NULL;
|
||||
srs_resset0->usage=NR_SRS_ResourceSet__usage_codebook;
|
||||
srs_resset0->alpha = calloc(1,sizeof(*srs_resset0->alpha));
|
||||
*srs_resset0->alpha = NR_Alpha_alpha1;
|
||||
srs_resset0->p0=calloc(1,sizeof(*srs_resset0->p0));
|
||||
*srs_resset0->p0=-80;
|
||||
srs_resset0->pathlossReferenceRS=NULL;
|
||||
srs_resset0->srs_PowerControlAdjustmentStates=NULL;
|
||||
ASN_SEQUENCE_ADD(&srs_Config->srs_ResourceSetToAddModList->list,srs_resset0);
|
||||
srs_Config->srs_ResourceToReleaseList=NULL;
|
||||
srs_Config->srs_ResourceToAddModList=calloc(1,sizeof(*srs_Config->srs_ResourceToAddModList));
|
||||
NR_SRS_Resource_t *srs_res0=calloc(1,sizeof(*srs_res0));
|
||||
srs_res0->srs_ResourceId=0;
|
||||
srs_res0->nrofSRS_Ports=NR_SRS_Resource__nrofSRS_Ports_port1;
|
||||
srs_res0->ptrs_PortIndex=NULL;
|
||||
srs_res0->transmissionComb.present=NR_SRS_Resource__transmissionComb_PR_n2;
|
||||
srs_res0->transmissionComb.choice.n2=calloc(1,sizeof(*srs_res0->transmissionComb.choice.n2));
|
||||
srs_res0->transmissionComb.choice.n2->combOffset_n2=0;
|
||||
srs_res0->transmissionComb.choice.n2->cyclicShift_n2=0;
|
||||
srs_res0->resourceMapping.startPosition=2;
|
||||
srs_res0->resourceMapping.nrofSymbols=NR_SRS_Resource__resourceMapping__nrofSymbols_n1;
|
||||
srs_res0->resourceMapping.repetitionFactor=NR_SRS_Resource__resourceMapping__repetitionFactor_n1;
|
||||
srs_res0->freqDomainPosition=0;
|
||||
srs_res0->freqDomainShift=0;
|
||||
srs_res0->freqHopping.c_SRS = 0;
|
||||
srs_res0->freqHopping.b_SRS=0;
|
||||
srs_res0->freqHopping.b_hop=0;
|
||||
srs_res0->groupOrSequenceHopping=NR_SRS_Resource__groupOrSequenceHopping_neither;
|
||||
srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_aperiodic;
|
||||
srs_res0->resourceType.choice.aperiodic=calloc(1,sizeof(*srs_res0->resourceType.choice.aperiodic));
|
||||
srs_res0->sequenceId=40;
|
||||
srs_res0->spatialRelationInfo=calloc(1,sizeof(*srs_res0->spatialRelationInfo));
|
||||
srs_res0->spatialRelationInfo->servingCellId=NULL;
|
||||
srs_res0->spatialRelationInfo->referenceSignal.present=NR_SRS_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index;
|
||||
srs_res0->spatialRelationInfo->referenceSignal.choice.csi_RS_Index=0;
|
||||
ASN_SEQUENCE_ADD(&srs_Config->srs_ResourceToAddModList->list,srs_res0);
|
||||
|
||||
|
||||
|
||||
if (0) {
|
||||
// configure Scheduling request
|
||||
// 40 slot period
|
||||
pucch_Config->schedulingRequestResourceToAddModList = calloc(1,sizeof(*pucch_Config->schedulingRequestResourceToAddModList));
|
||||
NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig = calloc(1,sizeof(*schedulingRequestResourceConfig));
|
||||
schedulingRequestResourceConfig->schedulingRequestResourceId = 1;
|
||||
schedulingRequestResourceConfig->schedulingRequestID= 0;
|
||||
schedulingRequestResourceConfig->periodicityAndOffset = calloc(1,sizeof(*schedulingRequestResourceConfig->periodicityAndOffset));
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl40;
|
||||
// note: make sure that there is no issue here. Later choose the RNTI accordingly.
|
||||
// Here we would be limited to 8 UEs on this resource (2 Frames 30 kHz SCS, 5 ms TDD periodicity => slots 8,9,18,19,28,29,38,39).
|
||||
// This should be a temporary resource until the first RRCReconfiguration gives new pucch resources.
|
||||
// Check for above configuration and exit for now if it is not the case
|
||||
AssertFatal(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing==NR_SubcarrierSpacing_kHz30,
|
||||
"SCS != 30kHz\n");
|
||||
AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity==NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5,
|
||||
"TDD period != 5ms : %ld\n",scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity);
|
||||
pucch_Config->schedulingRequestResourceToAddModList = calloc(1,sizeof(*pucch_Config->schedulingRequestResourceToAddModList));
|
||||
NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig = calloc(1,sizeof(*schedulingRequestResourceConfig));
|
||||
schedulingRequestResourceConfig->schedulingRequestResourceId = 1;
|
||||
schedulingRequestResourceConfig->schedulingRequestID= 0;
|
||||
schedulingRequestResourceConfig->periodicityAndOffset = calloc(1,sizeof(*schedulingRequestResourceConfig->periodicityAndOffset));
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl40;
|
||||
// note: make sure that there is no issue here. Later choose the RNTI accordingly.
|
||||
// Here we would be limited to 3 UEs on this resource (1 1/2 Frames 30 kHz SCS, 5 ms TDD periodicity => slots 7,8,9).
|
||||
// This should be a temporary resource until the first RRCReconfiguration gives new pucch resources.
|
||||
// Check for above configuration and exit for now if it is not the case
|
||||
AssertFatal(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing==NR_SubcarrierSpacing_kHz30,
|
||||
"SCS != 30kHz\n");
|
||||
AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity==NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5,
|
||||
"TDD period != 5ms : %ld\n",scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity);
|
||||
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl40 = 10*((rnti>>1)&3) + (rnti&2);
|
||||
schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource));
|
||||
*schedulingRequestResourceConfig->resource = 0;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->schedulingRequestResourceToAddModList->list,schedulingRequestResourceConfig);
|
||||
schedulingRequestResourceConfig->periodicityAndOffset->choice.sl40 = 8+(10*((rnti>>1)&3)) + (rnti&1);
|
||||
schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource));
|
||||
*schedulingRequestResourceConfig->resource = 0;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->schedulingRequestResourceToAddModList->list,schedulingRequestResourceConfig);
|
||||
}
|
||||
pucch_Config->dl_DataToUL_ACK = calloc(1,sizeof(*pucch_Config->dl_DataToUL_ACK));
|
||||
long *delay[8];
|
||||
for (int i=0;i<8;i++) {
|
||||
delay[i] = calloc(1,sizeof(*delay[i]));
|
||||
AssertFatal(carrier->minRXTXTIMEpdsch >=2 && carrier->minRXTXTIMEpdsch <7,
|
||||
"check minRXTXTIMEpdsch %d\n",carrier->minRXTXTIMEpdsch);
|
||||
*delay[i] = (i+carrier->minRXTXTIMEpdsch);
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]);
|
||||
}
|
||||
|
||||
SpCellConfig->spCellConfigDedicated->initialDownlinkBWP = calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->initialDownlinkBWP));
|
||||
NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP;
|
||||
@@ -1072,6 +1214,47 @@ void fill_initial_SpCellConfig(rnti_t rnti,
|
||||
bwp_Dedicated->pdcch_Config->choice.setup = calloc(1,sizeof(*bwp_Dedicated->pdcch_Config->choice.setup));
|
||||
|
||||
bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList = calloc(1,sizeof(*bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList));
|
||||
|
||||
bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList = calloc(1,sizeof(*bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList));
|
||||
|
||||
NR_ControlResourceSet_t *coreset = calloc(1,sizeof(*coreset));
|
||||
coreset->controlResourceSetId=1;
|
||||
// frequency domain resources depends on BWP size
|
||||
// options are 24, 48 or 96
|
||||
coreset->frequencyDomainResources.buf = calloc(1,6);
|
||||
if (0) {
|
||||
int curr_bwp = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
|
||||
if (curr_bwp < 48)
|
||||
coreset->frequencyDomainResources.buf[0] = 0xf0;
|
||||
else
|
||||
coreset->frequencyDomainResources.buf[0] = 0xff;
|
||||
if (curr_bwp < 96)
|
||||
coreset->frequencyDomainResources.buf[1] = 0;
|
||||
else
|
||||
coreset->frequencyDomainResources.buf[1] = 0xff;
|
||||
} else {
|
||||
coreset->frequencyDomainResources.buf[0] = 0xf0;
|
||||
coreset->frequencyDomainResources.buf[1] = 0;
|
||||
}
|
||||
coreset->frequencyDomainResources.buf[2] = 0;
|
||||
coreset->frequencyDomainResources.buf[3] = 0;
|
||||
coreset->frequencyDomainResources.buf[4] = 0;
|
||||
coreset->frequencyDomainResources.buf[5] = 0;
|
||||
coreset->frequencyDomainResources.size = 6;
|
||||
coreset->frequencyDomainResources.bits_unused = 3;
|
||||
coreset->duration=1;
|
||||
coreset->cce_REG_MappingType.present = NR_ControlResourceSet__cce_REG_MappingType_PR_nonInterleaved;
|
||||
coreset->precoderGranularity = NR_ControlResourceSet__precoderGranularity_sameAsREG_bundle;
|
||||
|
||||
coreset->tci_StatesPDCCH_ToAddList=NULL;
|
||||
coreset->tci_StatesPDCCH_ToReleaseList = NULL;
|
||||
coreset->tci_PresentInDCI = NULL;
|
||||
coreset->pdcch_DMRS_ScramblingID = NULL;
|
||||
|
||||
ASN_SEQUENCE_ADD(&bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list,
|
||||
coreset);
|
||||
|
||||
bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList = calloc(1,sizeof(*bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList));
|
||||
|
||||
NR_SearchSpace_t *ss2 = calloc(1,sizeof(*ss2));
|
||||
|
||||
@@ -1090,7 +1273,7 @@ void fill_initial_SpCellConfig(rnti_t rnti,
|
||||
ss2->monitoringSymbolsWithinSlot->buf[1]=0x0;
|
||||
ss2->nrofCandidates=calloc(1,sizeof(*ss2->nrofCandidates));
|
||||
ss2->nrofCandidates->aggregationLevel1 = NR_SearchSpace__nrofCandidates__aggregationLevel1_n0;
|
||||
ss2->nrofCandidates->aggregationLevel2 = NR_SearchSpace__nrofCandidates__aggregationLevel2_n0;
|
||||
ss2->nrofCandidates->aggregationLevel2 = NR_SearchSpace__nrofCandidates__aggregationLevel2_n2;
|
||||
ss2->nrofCandidates->aggregationLevel4 = NR_SearchSpace__nrofCandidates__aggregationLevel4_n1;
|
||||
ss2->nrofCandidates->aggregationLevel8 = NR_SearchSpace__nrofCandidates__aggregationLevel8_n0;
|
||||
ss2->nrofCandidates->aggregationLevel16 = NR_SearchSpace__nrofCandidates__aggregationLevel16_n0;
|
||||
@@ -1101,8 +1284,53 @@ void fill_initial_SpCellConfig(rnti_t rnti,
|
||||
|
||||
ASN_SEQUENCE_ADD(&bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list,
|
||||
ss2);
|
||||
|
||||
bwp_Dedicated->pdsch_Config=calloc(1,sizeof(*bwp_Dedicated->pdsch_Config));
|
||||
bwp_Dedicated->pdsch_Config->present = NR_SetupRelease_PDSCH_Config_PR_setup;
|
||||
bwp_Dedicated->pdsch_Config->choice.setup = calloc(1,sizeof(*bwp_Dedicated->pdsch_Config->choice.setup));
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->dataScramblingIdentityPDSCH = NULL;
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA = calloc(1,sizeof(*bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA));
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->present= NR_SetupRelease_DMRS_DownlinkConfig_PR_setup;
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup = calloc(1,sizeof(*bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup));
|
||||
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type=NULL;
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->maxLength=NULL;
|
||||
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = calloc(1,sizeof(*bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition));
|
||||
*bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos1;
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->resourceAllocation = NR_PDSCH_Config__resourceAllocation_resourceAllocationType1;
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling;
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling = calloc(1,sizeof(*bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling));
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize =
|
||||
calloc(1,sizeof(*bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize));
|
||||
*bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize = NR_PDSCH_Config__prb_BundlingType__staticBundling__bundleSize_wideband;
|
||||
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList=calloc(1,sizeof(*bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList));
|
||||
NR_TCI_State_t *tcic;
|
||||
|
||||
tcic=calloc(1,sizeof(*tcic));
|
||||
tcic->tci_StateId=0;
|
||||
tcic->qcl_Type1.cell=NULL;
|
||||
tcic->qcl_Type1.bwp_Id=NULL;
|
||||
tcic->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
|
||||
tcic->qcl_Type1.referenceSignal.choice.ssb = 0;
|
||||
tcic->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeD;
|
||||
|
||||
ASN_SEQUENCE_ADD(&bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcic);
|
||||
|
||||
SpCellConfig->spCellConfigDedicated->tag_Id=0;
|
||||
SpCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig=calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig));
|
||||
NR_PDSCH_ServingCellConfig_t *pdsch_servingcellconfig = calloc(1,sizeof(*pdsch_servingcellconfig));
|
||||
SpCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->present = NR_SetupRelease_PDSCH_ServingCellConfig_PR_setup;
|
||||
SpCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup = pdsch_servingcellconfig;
|
||||
pdsch_servingcellconfig->codeBlockGroupTransmission = NULL;
|
||||
pdsch_servingcellconfig->xOverhead = NULL;
|
||||
pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = calloc(1, sizeof(*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH));
|
||||
*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = NR_PDSCH_ServingCellConfig__nrofHARQ_ProcessesForPDSCH_n16;
|
||||
pdsch_servingcellconfig->pucch_Cell= NULL;
|
||||
pdsch_servingcellconfig->ext1=calloc(1,sizeof(*pdsch_servingcellconfig->ext1));
|
||||
pdsch_servingcellconfig->ext1->maxMIMO_Layers = calloc(1,sizeof(*pdsch_servingcellconfig->ext1->maxMIMO_Layers));
|
||||
*pdsch_servingcellconfig->ext1->maxMIMO_Layers = 2;
|
||||
|
||||
}
|
||||
|
||||
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup) {
|
||||
@@ -1176,7 +1404,7 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr
|
||||
rlc_Config_drb->choice.am->ul_AM_RLC.t_PollRetransmit = NR_T_PollRetransmit_ms80;
|
||||
rlc_Config_drb->choice.am->ul_AM_RLC.pollPDU = NR_PollPDU_p64;
|
||||
rlc_Config_drb->choice.am->ul_AM_RLC.pollByte = NR_PollByte_kB125;
|
||||
rlc_Config_drb->choice.am->ul_AM_RLC.maxRetxThreshold = NR_UL_AM_RLC__maxRetxThreshold_t4;
|
||||
rlc_Config_drb->choice.am->ul_AM_RLC.maxRetxThreshold = NR_UL_AM_RLC__maxRetxThreshold_t8;
|
||||
rlc_BearerConfig_drb->rlc_Config = rlc_Config_drb;
|
||||
logicalChannelConfig_drb = calloc(1, sizeof(NR_LogicalChannelConfig_t));
|
||||
logicalChannelConfig_drb->ul_SpecificParameters = calloc(1, sizeof(*logicalChannelConfig_drb->ul_SpecificParameters));
|
||||
@@ -1196,8 +1424,9 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr
|
||||
}
|
||||
|
||||
void fill_initial_cellGroupConfig(rnti_t rnti,
|
||||
NR_CellGroupConfig_t *cellGroupConfig,
|
||||
NR_ServingCellConfigCommon_t *scc) {
|
||||
NR_CellGroupConfig_t *cellGroupConfig,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
rrc_gNB_carrier_data_t *carrier) {
|
||||
|
||||
NR_RLC_BearerConfig_t *rlc_BearerConfig = NULL;
|
||||
NR_RLC_Config_t *rlc_Config = NULL;
|
||||
@@ -1250,15 +1479,17 @@ void fill_initial_cellGroupConfig(rnti_t rnti,
|
||||
/* mac CellGroup Config */
|
||||
if (1) {
|
||||
mac_CellGroupConfig = calloc(1, sizeof(*mac_CellGroupConfig));
|
||||
mac_CellGroupConfig->schedulingRequestConfig = calloc(1, sizeof(*mac_CellGroupConfig->schedulingRequestConfig));
|
||||
mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList = CALLOC(1,sizeof(*mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList));
|
||||
struct NR_SchedulingRequestToAddMod *schedulingrequestlist;
|
||||
schedulingrequestlist = CALLOC(1,sizeof(*schedulingrequestlist));
|
||||
schedulingrequestlist->schedulingRequestId = 0;
|
||||
schedulingrequestlist->sr_ProhibitTimer = CALLOC(1,sizeof(*schedulingrequestlist->sr_ProhibitTimer));
|
||||
*(schedulingrequestlist->sr_ProhibitTimer) = 0;
|
||||
schedulingrequestlist->sr_TransMax = 0;
|
||||
ASN_SEQUENCE_ADD(&(mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList->list),schedulingrequestlist);
|
||||
if (1) {
|
||||
mac_CellGroupConfig->schedulingRequestConfig = calloc(1, sizeof(*mac_CellGroupConfig->schedulingRequestConfig));
|
||||
mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList = CALLOC(1,sizeof(*mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList));
|
||||
struct NR_SchedulingRequestToAddMod *schedulingrequestlist;
|
||||
schedulingrequestlist = CALLOC(1,sizeof(*schedulingrequestlist));
|
||||
schedulingrequestlist->schedulingRequestId = 0;
|
||||
schedulingrequestlist->sr_ProhibitTimer = CALLOC(1,sizeof(*schedulingrequestlist->sr_ProhibitTimer));
|
||||
*(schedulingrequestlist->sr_ProhibitTimer) = 0;
|
||||
schedulingrequestlist->sr_TransMax = NR_SchedulingRequestToAddMod__sr_TransMax_n64;
|
||||
ASN_SEQUENCE_ADD(&(mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList->list),schedulingrequestlist);
|
||||
}
|
||||
mac_CellGroupConfig->bsr_Config = calloc(1, sizeof(*mac_CellGroupConfig->bsr_Config));
|
||||
mac_CellGroupConfig->bsr_Config->periodicBSR_Timer = NR_BSR_Config__periodicBSR_Timer_sf10;
|
||||
mac_CellGroupConfig->bsr_Config->retxBSR_Timer = NR_BSR_Config__retxBSR_Timer_sf80;
|
||||
@@ -1280,13 +1511,13 @@ void fill_initial_cellGroupConfig(rnti_t rnti,
|
||||
|
||||
physicalCellGroupConfig = calloc(1,sizeof(*physicalCellGroupConfig));
|
||||
physicalCellGroupConfig->p_NR_FR1 = calloc(1,sizeof(*physicalCellGroupConfig->p_NR_FR1));
|
||||
*physicalCellGroupConfig->p_NR_FR1 = 20;
|
||||
*physicalCellGroupConfig->p_NR_FR1 = 10;
|
||||
physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook = NR_PhysicalCellGroupConfig__pdsch_HARQ_ACK_Codebook_dynamic;
|
||||
cellGroupConfig->physicalCellGroupConfig = physicalCellGroupConfig;
|
||||
|
||||
cellGroupConfig->spCellConfig = calloc(1,sizeof(*cellGroupConfig->spCellConfig));
|
||||
|
||||
fill_initial_SpCellConfig(rnti,cellGroupConfig->spCellConfig,scc);
|
||||
fill_initial_SpCellConfig(rnti,cellGroupConfig->spCellConfig,scc,carrier);
|
||||
|
||||
cellGroupConfig->sCellToAddModList = NULL;
|
||||
cellGroupConfig->sCellToReleaseList = NULL;
|
||||
@@ -1296,8 +1527,9 @@ void fill_initial_cellGroupConfig(rnti_t rnti,
|
||||
uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
|
||||
uint8_t *const buffer,
|
||||
const uint8_t transaction_id,
|
||||
OCTET_STRING_t *masterCellGroup_from_DU,
|
||||
NR_ServingCellConfigCommon_t *scc)
|
||||
OCTET_STRING_t *masterCellGroup_from_DU,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
rrc_gNB_carrier_data_t *carrier)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
asn_enc_rval_t enc_rval;
|
||||
@@ -1364,7 +1596,7 @@ uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
|
||||
}
|
||||
else {
|
||||
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
|
||||
fill_initial_cellGroupConfig(ue_context_pP->ue_context.rnti,cellGroupConfig,scc);
|
||||
fill_initial_cellGroupConfig(ue_context_pP->ue_context.rnti,cellGroupConfig,scc,carrier);
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
|
||||
NULL,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user