RLC SDU is unavailable in processing loop of nrTDDsymbo​lbasedsche​duling project of 5G toolbox

2 views (last 30 days)
hi,
I am unable to locate num RLC SDU's in processing loop of nrTDDsymbolbasedscheduling new 5G toolbox of matlab 2020b. this feature was available in matlab 2019b.
I need to calculate latency in terms of numRLCSDU's.
Why is this RLCSDU removed from processing loop : For step in only macentity is available.
for symbolNum = 1 : tickGranularity : numSymbolsSim
UEMetrics(:) = 0;
HARQProcessStatus(:) = 0;
symbolType = currentSymbolType(gNB); % Get current symbol type: DL/UL/Guard
if mod(symbolNum - 1, 14) == 0
slotNum = slotNum + 1;
disp('slot number is');
disp(slotNum);
end
% where is RLC block why is it missing ?
% Run MAC and PHY layers of gNB
run(gNB.MACEntity);
run(gNB.PhyEntity);
% Run MAC and PHY layers of UEs
for ueIdx = 1:simParameters.NumUEs
% Read the last received NDI flags for HARQ processes for
% logging (Reading it before it gets overwritten by run function of MAC)
if symbolType == 0 % DL
HARQProcessStatus(ueIdx, :) = getLastNDIFlagHarq(UEs{ueIdx}.MACEntity, 0); % 0 for DL
else
HARQProcessStatus(ueIdx, :) = getLastNDIFlagHarq(UEs{ueIdx}.MACEntity, 1); % 1 for UL
end
run(UEs{ueIdx}.MACEntity);
run(UEs{ueIdx}.PhyEntity);
end
% RLC logging (only at slot boundary)
if mod(symbolNum - 1, 14) == 0 %
for ueIdx = 1:simParameters.NumUEs % For all UEs
% Get RLC statistics
ueRLCStats{ueIdx} = getRLCStatistics(UEs{ueIdx}, ueIdx);
gNBRLCStats{ueIdx} = getRLCStatistics(gNB, ueIdx);
end
logRLCStats(simRLCLogger, ueRLCStats, gNBRLCStats); % Update RLC statistics logs
end
flag=zeros(4,4);
% MAC logging
% Read UL and DL assignments done by gNB MAC scheduler
% at current time. Resource assignments returned by a scheduler (either
% UL or DL) is empty, if either scheduler was not scheduled to run at
% the current time or no resources got scheduled
[resourceAssignmentsUL, resourceAssignmentsDL] = getCurrentSchedulingAssignments(gNB.MACEntity);
% Read throughput and goodput bytes sent for each UE
if symbolType == 0 % DL
[UEMetrics(:, 1), UEMetrics(:, 2)] = getTTIBytes(gNB);
[UEMetrics(:, 3), flag] = getBufferStatus(gNB); % Read pending buffer (in bytes) on gNB, for all the UEs
%flag is set when the downlink buffer for logical channel is zero
%flag correction for non exixtent logical channels
for ueIdx = 2:simParameters.NumUEs
for lcIdx = (simParameters.NumLogicalChannels(ueIdx)+1):1:4
flag(ueIdx,lcIdx)=0;
end
end
end
for ueIdx = 1:simParameters.NumUEs
if symbolType == 0 % DL
% Read the DL channel quality for the UE
channelQuality(ueIdx,:) = getChannelQuality(gNB, 0, ueIdx); % 0 for DL
else
% Read the UL channel quality for the UE
channelQuality(ueIdx,:) = getChannelQuality(gNB, 1, ueIdx); % 1 for UL
% Read throughput and goodput bytes transmitted by the UE in the current TTI
[UEMetrics(ueIdx, 1), UEMetrics(ueIdx, 2)] = getTTIBytes(UEs{ueIdx});
UEMetrics(ueIdx, 3) = getBufferStatus(UEs{ueIdx}); % Read pending buffer (in bytes) on UE
end
end
% Update logs based on the current symbol run of UEs and gNB
logScheduling(simSchedulingLogger, symbolNum, [resourceAssignmentsUL resourceAssignmentsDL], UEMetrics, channelQuality, HARQProcessStatus, symbolType);
% Visualization
% RB assignment visualization (if enabled)
if simParameters.RBVisualization
if symbolNum > 1 && (simParameters.SchedulingType == 1 && (mod(symbolNum, 14) == 0)) || (simParameters.SchedulingType == 0 && (mod(slotNum, rbAssignmentPlotPeriodicity) == 0))
% Plot at slot boundary, if the update periodicity is
% reached
plotRBGrids(simSchedulingLogger);
end
end
% CQI grid visualization (if enabled)
if simParameters.CQIVisualization
if symbolNum > 1 && mod(symbolNum-1, 14) == 0 && mod(slotNum, numSlotsFrame) == 0 % Plot at frame boundary
plotCQIRBGrids(simSchedulingLogger);
end
end
% Plot scheduler metrics and RLC metrics visualization at slot
% boundary, if the update periodicity is reached
if symbolNum > 1 && mod(symbolNum-1, 14) == 0 && mod(slotNum, simParameters.MetricsStepSize) == 0
plotMetrics(simSchedulingLogger);
plotMetrics(simRLCLogger);
end
% Advance timer ticks for gNB and UEs by 'tickGranularity' symbols
end.

Answers (1)

Praveen Koppula
Praveen Koppula on 10 Mar 2021
Starting with 2020b, the application layer pumps data to the RLC. Earlier, in absence of application layer, we used to feed data directly to RLC from the example script. Now, RLC is mostly driven by application and MAC as mentioned below:
  • The generated application packet is delivered to RLC layer immediately using a registered callback
  • When MAC has an opportunity to send data, MAC requests RLC using a registered callback.

Categories

Find more on System-Level Simulation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!