![]() |
5G-LENA nr-v3.3-81-g75c7590d
The 5G/NR module for the ns-3 simulator
|
#include "sfnsf.h"
Public Member Functions | |
SfnSf ()=default | |
constructor | |
SfnSf (uint32_t frameNum, uint8_t sfNum, uint8_t slotNum, uint8_t numerology) | |
SfnSf constructor Numerology must be <= 5. | |
void | Add (uint32_t slotN) |
Add to this SfnSf a number of slot indicated by the first parameter. | |
void | FromEncoding (uint64_t sfn) |
Fill the private fields with the value extracted from the parameter. | |
uint64_t | GetEncoding () const |
Get encoding for this SfnSf. | |
uint64_t | GetEncodingWithSymStartRnti (uint8_t symStart, uint16_t rnti) const |
Get an encoding of frame & slot number, plus starting OFDM symbol and RNTI. | |
uint32_t | GetFrame () const |
GetFrame. | |
SfnSf | GetFutureSfnSf (uint32_t slotN) const |
Get a Future SfnSf. | |
uint8_t | GetNumerology () const |
GetNumerology. | |
uint8_t | GetSlot () const |
GetSlot. | |
uint32_t | GetSlotPerSubframe () const |
Get SlotPerSubframe. | |
uint8_t | GetSubframe () const |
GetSubframe. | |
uint64_t | Normalize () const |
Normalize the SfnSf in slot number. | |
bool | operator< (const SfnSf &rhs) const |
operator < (less than) | |
bool | operator<= (const SfnSf &rhs) const |
operator <= (less than or equal to) | |
bool | operator== (const SfnSf &o) const |
operator ==, compares frame, subframe, and slot | |
Static Public Member Functions | |
static SfnSf | Decode (uint64_t sfn) |
Decode the parameter and return a SfnSf. | |
static uint64_t | Encode (const SfnSf &p) |
Encode the parameter in a uint64_t. | |
static uint32_t | GetSubframesPerFrame () |
The SfnSf class.
Keep track of the frame, subframe, slot number. The value can be normalized in the number of slot. Please keep in mind that a SfnSf is valid only when there is an associated numerology, and that a particular value is not normalized the same in two different numerologies.
To create a SfnSf with numerology 2 (for example), please do:
auto sfn = SfnSf (1, 0, 0, 2);
ns3::SfnSf::SfnSf | ( | uint32_t | frameNum, |
uint8_t | sfNum, | ||
uint8_t | slotNum, | ||
uint8_t | numerology | ||
) |
void ns3::SfnSf::Add | ( | uint32_t | slotN | ) |
Add to this SfnSf a number of slot indicated by the first parameter.
slotN | Number of slot to add |
Definition at line 117 of file sfnsf.cc.
References GetSlotPerSubframe(), and GetSubframesPerFrame().
Referenced by GetFutureSfnSf(), ns3::NrUePhy::PhyCtrlMessagesReceived(), and ns3::NrPhy::PushFrontSlotAllocInfo().
|
static |
Decode the parameter and return a SfnSf.
sfn | the encoded value |
Definition at line 91 of file sfnsf.cc.
References FromEncoding().
Referenced by ns3::NrPhy::PushFrontSlotAllocInfo().
|
static |
void ns3::SfnSf::FromEncoding | ( | uint64_t | sfn | ) |
Fill the private fields with the value extracted from the parameter.
sfn | Encoding from which extract the value |
Definition at line 63 of file sfnsf.cc.
Referenced by Decode().
uint64_t ns3::SfnSf::GetEncoding | ( | ) | const |
Get encoding for this SfnSf.
Definition at line 24 of file sfnsf.cc.
Referenced by ns3::NrMacSchedulerNs3::DoSchedUlCqiInfoReq(), and Encode().
uint64_t ns3::SfnSf::GetEncodingWithSymStartRnti | ( | uint8_t | symStart, |
uint16_t | rnti | ||
) | const |
Get an encoding of frame & slot number, plus starting OFDM symbol and RNTI.
symStart | the symbol start value to include |
rnti | the RNTI of the UE |
Definition at line 42 of file sfnsf.cc.
Referenced by ns3::NrPhy::GetPacketBurst(), ns3::NrPhy::PushFrontSlotAllocInfo(), and ns3::NrPhy::SetMacPdu().
uint32_t ns3::SfnSf::GetFrame | ( | ) | const |
GetFrame.
Definition at line 164 of file sfnsf.cc.
Referenced by ns3::NrMacRxTrace::RxedGnbMacCtrlMsgsCallback(), ns3::NrPhyRxTrace::RxedGnbPhyCtrlMsgsCallback(), ns3::NrMacRxTrace::RxedUeMacCtrlMsgsCallback(), ns3::NrPhyRxTrace::RxedUePhyCtrlMsgsCallback(), ns3::NrPhyRxTrace::RxedUePhyDlDciCallback(), ns3::PowerOutputStats::SavePower(), ns3::NrMacRxTrace::TxedGnbMacCtrlMsgsCallback(), ns3::NrPhyRxTrace::TxedGnbPhyCtrlMsgsCallback(), ns3::NrMacRxTrace::TxedUeMacCtrlMsgsCallback(), ns3::NrPhyRxTrace::TxedUePhyCtrlMsgsCallback(), and ns3::NrPhyRxTrace::TxedUePhyHarqFeedbackCallback().
SfnSf ns3::SfnSf::GetFutureSfnSf | ( | uint32_t | slotN | ) | const |
uint8_t ns3::SfnSf::GetNumerology | ( | ) | const |
GetNumerology.
Please note that if you invoke this method without passing a numerology to the constructor or without constructing the object from an encoded value with a valid numerology, the program will fail.
Definition at line 182 of file sfnsf.cc.
Referenced by ns3::NrPhy::GetPacketBurst(), ns3::NrPhy::PeekSlotAllocInfo(), ns3::NrPhy::RetrieveSlotAllocInfo(), ns3::NrPhy::SetMacPdu(), and ns3::NrPhy::SlotAllocInfoExists().
uint8_t ns3::SfnSf::GetSlot | ( | ) | const |
GetSlot.
Definition at line 176 of file sfnsf.cc.
Referenced by ns3::NrMacRxTrace::RxedGnbMacCtrlMsgsCallback(), ns3::NrPhyRxTrace::RxedGnbPhyCtrlMsgsCallback(), ns3::NrMacRxTrace::RxedUeMacCtrlMsgsCallback(), ns3::NrPhyRxTrace::RxedUePhyCtrlMsgsCallback(), ns3::NrPhyRxTrace::RxedUePhyDlDciCallback(), ns3::PowerOutputStats::SavePower(), ns3::NrMacRxTrace::TxedGnbMacCtrlMsgsCallback(), ns3::NrPhyRxTrace::TxedGnbPhyCtrlMsgsCallback(), ns3::NrMacRxTrace::TxedUeMacCtrlMsgsCallback(), ns3::NrPhyRxTrace::TxedUePhyCtrlMsgsCallback(), and ns3::NrPhyRxTrace::TxedUePhyHarqFeedbackCallback().
uint32_t ns3::SfnSf::GetSlotPerSubframe | ( | ) | const |
Get SlotPerSubframe.
Definition at line 79 of file sfnsf.cc.
Referenced by Add(), and Normalize().
uint8_t ns3::SfnSf::GetSubframe | ( | ) | const |
GetSubframe.
Definition at line 170 of file sfnsf.cc.
Referenced by ns3::NrMacRxTrace::RxedGnbMacCtrlMsgsCallback(), ns3::NrPhyRxTrace::RxedGnbPhyCtrlMsgsCallback(), ns3::NrMacRxTrace::RxedUeMacCtrlMsgsCallback(), ns3::NrPhyRxTrace::RxedUePhyCtrlMsgsCallback(), ns3::NrPhyRxTrace::RxedUePhyDlDciCallback(), ns3::PowerOutputStats::SavePower(), ns3::NrMacRxTrace::TxedGnbMacCtrlMsgsCallback(), ns3::NrPhyRxTrace::TxedGnbPhyCtrlMsgsCallback(), ns3::NrMacRxTrace::TxedUeMacCtrlMsgsCallback(), ns3::NrPhyRxTrace::TxedUePhyCtrlMsgsCallback(), and ns3::NrPhyRxTrace::TxedUePhyHarqFeedbackCallback().
|
static |
Definition at line 73 of file sfnsf.cc.
Referenced by Add(), and Normalize().
uint64_t ns3::SfnSf::Normalize | ( | ) | const |
Normalize the SfnSf in slot number.
This value will wrap if the frame count (32-bit unsigned integer) wraps
Definition at line 99 of file sfnsf.cc.
References GetSlotPerSubframe(), and GetSubframesPerFrame().
bool ns3::SfnSf::operator< | ( | const SfnSf & | rhs | ) | const |
bool ns3::SfnSf::operator<= | ( | const SfnSf & | rhs | ) | const |
bool ns3::SfnSf::operator== | ( | const SfnSf & | o | ) | const |