7#include "nr-phy-mac-common.h"
9#include "ns3/attribute-accessor-helper.h"
17NS_LOG_COMPONENT_DEFINE(
"NrPhyMacCommon");
22 NS_LOG_FUNCTION(
this);
45 NS_LOG_FUNCTION(
this);
59 NS_LOG_FUNCTION(
this);
75 NS_LOG_FUNCTION(
this);
89 NS_LOG_FUNCTION(
this);
126operator<<(std::ostream& os,
const DlHarqInfo& item)
128 if (item.IsReceivedOk())
130 os <<
"ACK feedback ";
134 os <<
"NACK feedback ";
136 os <<
"for ProcessID: " <<
static_cast<uint32_t
>(item.m_harqProcessId) <<
" of UE "
137 <<
static_cast<uint32_t
>(item.m_rnti)
138 <<
" Num Retx: " <<
static_cast<uint32_t
>(item.m_numRetx)
139 <<
" BWP index: " <<
static_cast<uint32_t
>(item.m_bwpIndex);
144operator<<(std::ostream& os,
const UlHarqInfo& item)
146 if (item.IsReceivedOk())
148 os <<
"ACK feedback ";
152 os <<
"NACK feedback ";
154 os <<
"for ProcessID: " <<
static_cast<uint32_t
>(item.m_harqProcessId) <<
" of UE "
155 <<
static_cast<uint32_t
>(item.m_rnti)
156 <<
" Num Retx: " <<
static_cast<uint32_t
>(item.m_numRetx);
162operator<<(std::ostream& os,
const SfnSf& item)
164 os <<
"FrameNum: " <<
static_cast<uint32_t
>(item.GetFrame())
165 <<
" SubFrameNum: " <<
static_cast<uint32_t
>(item.GetSubframe())
166 <<
" SlotNum: " <<
static_cast<uint32_t
>(item.GetSlot());
171operator<<(std::ostream& os,
const SlotAllocInfo& item)
173 os <<
"Allocation for slot " << item.m_sfnSf
174 <<
" total symbols allocated: " << item.m_numSymAlloc <<
" of type " << item.m_type
175 <<
", tti: " << item.m_varTtiAllocInfo.size()
176 <<
" composed by the following allocations: " << std::endl;
177 for (
const auto& alloc : item.m_varTtiAllocInfo)
179 std::string direction;
206 os <<
"[Allocation from sym " <<
static_cast<uint32_t
>(alloc.m_dci->m_symStart)
207 <<
" to sym " <<
static_cast<uint32_t
>(alloc.m_dci->m_numSym + alloc.m_dci->m_symStart)
208 <<
" direction " << direction <<
" type " << type <<
"]" << std::endl;
236operator<<(std::ostream& os,
const DciInfoElementTdma& item)
238 os <<
"RNTI=" << item.m_rnti <<
"|" << item.m_format <<
"|SYM=" << +item.m_symStart
239 <<
"|NSYM=" << +item.m_numSym <<
"|MCS=" << +item.m_mcs <<
"|TBS=" << item.m_tbSize
240 <<
"|NDI=" << +item.m_ndi <<
"|RV=" << +item.m_rv <<
"|TYPE=" << item.m_type
241 <<
"|BWP=" << +item.m_bwpIndex <<
"|HARQP=" << +item.m_harqProcess <<
"|RBG=";
243 uint16_t start = 65000;
245 bool canPrint =
false;
246 for (uint32_t i = 0; i < item.m_rbgBitmask.size(); ++i)
248 if (item.m_rbgBitmask[i] == 1)
253 if (item.m_rbgBitmask[i] == 1 && end < i)
257 if (item.m_rbgBitmask[i] == 1 && start > i)
262 if (item.m_rbgBitmask[i] == 0 && canPrint)
264 os <<
"[" << +start <<
";" << +end <<
"]";
273 os <<
"[" << +start <<
";" << +end <<
"]";
@ CTRL
Used for DL/UL CTRL.
@ DATA
Used for DL/UL DATA.
@ SRS
Used for SRS (it would be like DCI format 2_3)
DciFormat
Format of the DCI.
The SlotAllocInfo struct.
SfnSf m_sfnSf
SfnSf of this allocation.
bool operator<(const SlotAllocInfo &rhs) const
operator < (less than)
AllocationType m_type
Allocations type.
bool ContainsDlCtrlAllocation() const
void Merge(const SlotAllocInfo &other)
Merge the input parameter to this SlotAllocInfo.
uint32_t m_numSymAlloc
Number of allocated symbols.
bool ContainsUlCtrlAllocation() const
bool ContainsDataAllocation() const
Check if we have data allocations.
AllocationType
Enum which indicates the allocations that are inside the allocation info.
@ BOTH
DL and UL allocations.
bool ContainsUlMsg3Allocation() const
Check if we have UL MSG3 allocations.
std::deque< VarTtiAllocInfo > m_varTtiAllocInfo
queue of allocations