12SfnSf::SfnSf(uint32_t frameNum, uint8_t sfNum, uint8_t slotNum, uint8_t numerology)
13 : m_frameNum(frameNum),
16 m_numerology(numerology)
20 NS_ABORT_MSG_IF(numerology > 5,
"Numerology > 5 unsupported");
27 NS_ASSERT(m_numerology < 7);
30 NS_ASSERT(m_slotNum < 64);
32 NS_ASSERT(m_subframeNum < 10);
34 NS_ASSERT(m_frameNum < 16777215);
36 ret = (
static_cast<uint64_t
>(m_frameNum) << 24) | (
static_cast<uint64_t
>(m_subframeNum) << 16) |
37 (
static_cast<uint64_t
>(m_slotNum) << 8) | (
static_cast<uint64_t
>(m_numerology) << 5);
45 NS_ASSERT(symStart < 14);
47 NS_ASSERT(m_numerology < 7);
50 NS_ASSERT(m_slotNum < 64);
52 NS_ASSERT(m_subframeNum < 10);
54 NS_ASSERT(m_frameNum < 16777215);
56 ret = (
static_cast<uint64_t
>(rnti) << 48) | (
static_cast<uint64_t
>(m_frameNum) << 24) |
57 (
static_cast<uint64_t
>(m_subframeNum) << 16) | (
static_cast<uint64_t
>(m_slotNum) << 8) |
58 (
static_cast<uint64_t
>(m_numerology) << 5) | (
static_cast<uint64_t
>(symStart));
65 m_frameNum = (sfn & 0x0000FFFFFF000000) >> 24;
66 m_subframeNum = (sfn & 0x0000000000FF0000) >> 16;
67 m_slotNum = (sfn & 0x000000000000FF00) >> 8;
68 m_numerology = (sfn & 0x00000000000000E0) >> 5;
81 return 1 << m_numerology;
119 NS_ASSERT_MSG(m_numerology <= 5,
"Numerology " << m_numerology <<
" invalid");
130 NS_ASSERT_MSG(rhs.m_numerology == m_numerology,
"Numerology does not match");
131 if (m_frameNum < rhs.m_frameNum)
135 if ((m_frameNum == rhs.m_frameNum) && (m_subframeNum < rhs.m_subframeNum))
139 return (((m_frameNum == rhs.m_frameNum) && (m_subframeNum == rhs.m_subframeNum)) &&
140 (m_slotNum < rhs.m_slotNum));
146 NS_ASSERT_MSG(o.m_numerology == m_numerology,
"Numerology does not match");
147 return (m_frameNum == o.m_frameNum) && (m_subframeNum == o.m_subframeNum) &&
148 (m_slotNum == o.m_slotNum);
160 return m_subframeNum;
172 NS_ASSERT_MSG(m_numerology <= 5,
"Numerology " << m_numerology <<
" invalid");
static SfnSf Decode(uint64_t sfn)
Decode the parameter and return a SfnSf.
uint8_t GetNumerology() const
GetNumerology.
uint8_t GetSubframe() const
GetSubframe.
uint64_t Normalize() const
Normalize the SfnSf in slot number.
uint32_t GetSlotPerSubframe() const
Get SlotPerSubframe.
SfnSf GetFutureSfnSf(uint32_t slotN)
Get a Future SfnSf.
static uint64_t Encode(const SfnSf &p)
Encode the parameter in a uint64_t.
uint64_t GetEncoding() const
Get encoding for this SfnSf.
void Add(uint32_t slotN)
Add to this SfnSf a number of slot indicated by the first parameter.
uint64_t GetEncodingWithSymStartRnti(uint8_t symStart, uint16_t rnti) const
Get an encoding of frame & slot number, plus starting OFDM symbol and RNTI.
bool operator<(const SfnSf &rhs) const
operator < (less than)
uint8_t GetSlot() const
GetSlot.
SfnSf()=default
constructor
bool operator==(const SfnSf &o) const
operator ==, compares frame, subframe, and slot
void FromEncoding(uint64_t sfn)
Fill the private fields with the value extracted from the parameter.
static uint32_t GetSubframesPerFrame()
uint32_t GetFrame() const
GetFrame.