5G-LENA nr-v3.3-81-g75c7590d
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
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.
 
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 ()
 

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 31 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 12 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 117 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 91 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 85 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 63 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 24 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 42 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) const

Get a Future SfnSf.

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

Definition at line 109 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 182 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 79 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 73 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 99 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 127 of file sfnsf.cc.

◆ operator<=()

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

operator <= (less than or equal to)

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

The comparison is done on m_frameNum, m_subframeNum, and m_slotNum: not on varTti

Definition at line 143 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 156 of file sfnsf.cc.


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