5G-LENA  nr-v3.0-29-g83cc959
The 5G/NR module for the ns-3 simulator
ns3::SfnSf Class Reference

The SfnSf class. More...

#include "sfnsf.h"

+ Inheritance diagram for ns3::SfnSf:
+ Collaboration diagram for ns3::SfnSf:

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. More...
 
void Add (uint32_t slotN)
 Add to this SfnSf a number of slot indicated by the first parameter. More...
 
void FromEncoding (uint64_t sfn)
 Fill the private fields with the value extracted from the parameter. More...
 
uint64_t GetEncoding () const
 Get encoding for this SfnSf. More...
 
uint64_t GetEncodingWithSymStartRnti (uint8_t symStart, uint16_t rnti) const
 Get an encoding of frame & slot number, plus starting OFDM symbol and RNTI. More...
 
uint32_t GetFrame () const
 GetFrame. More...
 
SfnSf GetFutureSfnSf (uint32_t slotN)
 Get a Future SfnSf. More...
 
uint8_t GetNumerology () const
 GetNumerology. More...
 
uint8_t GetSlot () const
 GetSlot. More...
 
uint32_t GetSlotPerSubframe () const
 Get SlotPerSubframe. More...
 
uint8_t GetSubframe () const
 GetSubframe. More...
 
uint64_t Normalize () const
 Normalize the SfnSf in slot number. More...
 
bool operator< (const SfnSf &rhs) const
 operator < (less than) More...
 
bool operator== (const SfnSf &o) const
 operator ==, compares frame, subframe, and slot More...
 

Static Public Member Functions

static SfnSf Decode (uint64_t sfn)
 Decode the parameter and return a SfnSf. More...
 
static uint64_t Encode (const SfnSf &p)
 Encode the parameter in a uint64_t. More...
 
static uint32_t GetSubframesPerFrame ()
 

Detailed Description

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.

Usage

To create a SfnSf with numerology 2 (for example), please do:

auto sfn = SfnSf (1, 0, 0, 2);
See also
Normalize

Definition at line 33 of file sfnsf.h.

Constructor & Destructor Documentation

◆ SfnSf()

ns3::SfnSf::SfnSf ( uint32_t  frameNum,
uint8_t  sfNum,
uint8_t  slotNum,
uint8_t  numerology 
)

SfnSf constructor Numerology must be <= 5.

Parameters
frameNumFrame number (32-bit)
sfNumSubframe Number (8-bit)
slotNumSlot number (8-bit)
numerologyNumerology (will be always associated with this SfnSf) (8-bit)

Definition at line 14 of file sfnsf.cc.

Member Function Documentation

◆ Add()

void ns3::SfnSf::Add ( uint32_t  slotN)

Add to this SfnSf a number of slot indicated by the first parameter.

Parameters
slotNNumber of slot to add

Definition at line 119 of file sfnsf.cc.

References GetSlotPerSubframe(), and GetSubframesPerFrame().

Referenced by GetFutureSfnSf(), ns3::NrUePhy::PhyCtrlMessagesReceived(), and ns3::NrPhy::PushFrontSlotAllocInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Decode()

SfnSf ns3::SfnSf::Decode ( uint64_t  sfn)
static

Decode the parameter and return a SfnSf.

Parameters
sfnthe encoded value
Returns
an object which contains the values extracted from the encoding

Definition at line 93 of file sfnsf.cc.

References FromEncoding().

Referenced by ns3::NrPhy::PushFrontSlotAllocInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Encode()

uint64_t ns3::SfnSf::Encode ( const SfnSf p)
static

Encode the parameter in a uint64_t.

Parameters
pthe SfnSf to encode
Returns
an uint64_t that can represent this SfnSf
See also
Decode

Definition at line 87 of file sfnsf.cc.

References GetEncoding().

+ Here is the call graph for this function:

◆ FromEncoding()

void ns3::SfnSf::FromEncoding ( uint64_t  sfn)

Fill the private fields with the value extracted from the parameter.

Parameters
sfnEncoding from which extract the value
See also
GetEncoding

Definition at line 65 of file sfnsf.cc.

Referenced by Decode().

+ Here is the caller graph for this function:

◆ GetEncoding()

uint64_t ns3::SfnSf::GetEncoding ( ) const

Get encoding for this SfnSf.

Returns
an uint64_t that is able to represent fully this SfnSf
See also
FromEncoding

Definition at line 26 of file sfnsf.cc.

Referenced by ns3::NrMacSchedulerNs3::DoSchedUlCqiInfoReq(), and Encode().

+ Here is the caller graph for this function:

◆ GetEncodingWithSymStartRnti()

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.

Parameters
symStartthe symbol start value to include
rntithe RNTI of the UE
Returns
an uint64_t that can uniquely represent this SfnSf plus symStart and rnti

Definition at line 44 of file sfnsf.cc.

Referenced by ns3::NrPhy::GetPacketBurst(), ns3::NrPhy::PushFrontSlotAllocInfo(), and ns3::NrPhy::SetMacPdu().

+ Here is the caller graph for this function:

◆ GetFrame()

◆ GetFutureSfnSf()

SfnSf ns3::SfnSf::GetFutureSfnSf ( uint32_t  slotN)

Get a Future SfnSf.

Parameters
slotNslot to sum
Returns
the SfnSf that results from the operation (*this) + slotN

Definition at line 111 of file sfnsf.cc.

References Add().

+ Here is the call graph for this function:

◆ GetNumerology()

uint8_t ns3::SfnSf::GetNumerology ( ) const

GetNumerology.

Returns
the numerology installed

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 179 of file sfnsf.cc.

Referenced by ns3::NrPhy::GetPacketBurst(), ns3::NrPhy::PeekSlotAllocInfo(), ns3::NrPhy::RetrieveSlotAllocInfo(), ns3::NrPhy::SetMacPdu(), and ns3::NrPhy::SlotAllocInfoExists().

+ Here is the caller graph for this function:

◆ GetSlot()

◆ GetSlotPerSubframe()

uint32_t ns3::SfnSf::GetSlotPerSubframe ( ) const

Get SlotPerSubframe.

Returns
the number of slot per subframe; depends on the numerology installed

Definition at line 81 of file sfnsf.cc.

Referenced by Add(), and Normalize().

+ Here is the caller graph for this function:

◆ GetSubframe()

◆ GetSubframesPerFrame()

uint32_t ns3::SfnSf::GetSubframesPerFrame ( )
static
Returns
the number of subframes per frame (ten for every numerology)

Definition at line 75 of file sfnsf.cc.

Referenced by Add(), and Normalize().

+ Here is the caller graph for this function:

◆ 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

Returns
The number of total slots passed

Definition at line 101 of file sfnsf.cc.

References GetSlotPerSubframe(), and GetSubframesPerFrame().

+ Here is the call graph for this function:

◆ operator<()

bool ns3::SfnSf::operator< ( const SfnSf rhs) const

operator < (less than)

Parameters
rhsother SfnSf to compare
Returns
true if this SfnSf is less than rhs

The comparison is done on m_frameNum, m_subframeNum, and m_slotNum The program will assert if numerologies do not match (and asserts are enabled)

Definition at line 129 of file sfnsf.cc.

◆ operator==()

bool ns3::SfnSf::operator== ( const SfnSf o) const

operator ==, compares frame, subframe, and slot

Parameters
oother instance to compare
Returns
true if this instance and the other have the same frame, subframe, and slot The program will assert if numerologies do not match (and asserts are enabled)

Definition at line 153 of file sfnsf.cc.


The documentation for this class was generated from the following files: