NetSim Source Code Help v14.4
All 13 Components
 
Loading...
Searching...
No Matches
LTENR_MAC.h
1#pragma once
2/************************************************************************************
3* Copyright (C) 2023 *
4* TETCOS, Bangalore. India *
5* *
6* Tetcos owns the intellectual property rights in the Product and its content. *
7* The copying, redistribution, reselling or publication of any or all of the *
8* Product or its content without express prior written consent of Tetcos is *
9* prohibited. Ownership and / or any other right relating to the software and all *
10* intellectual property rights therein shall remain at all times with Tetcos. *
11* *
12* This source code is licensed per the NetSim license agreement. *
13* *
14* No portion of this source code may be used as the basis for a derivative work, *
15* or used, for any purpose other than its intended use per the NetSim license *
16* agreement. *
17* *
18* This source code and the algorithms contained within it are confidential trade *
19* secrets of TETCOS and may not be used as the basis for any other software, *
20* hardware, product or service. *
21* *
22* Author: Shashi Kant Suman *
23* *
24* ----------------------------------------------------------------------------------*/
25#ifndef _NETSIM_LTENR_MAC_H_
26#define _NETSIM_LTENR_MAC_H_
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#pragma region HEADER_FILES
32#include "LTENR_PHY.h"
33#pragma endregion
34
35#define MIN_RESOURCE_SHARE 0
36#define MAX_RESOURCE_SHARE 1
37
38#pragma region SCHEDULING_TYPE
39 typedef enum enum_LTENR_MAC_GnbSchedulingType {
40 LTENR_MAC_SCHEDULING_ROUNDROBIN,
41 LTENR_MAC_SCHEDULING_PROPORTIONALFAIR,
42 LTENR_MAC_SCHEDULING_MAXTHROUGHTPUT,
43 LTENR_MAC_SCHEDULING_FAIR_SCHEDULING,
44 LTENR_MAC_SCHEDULING_PF_WITH_RG,
45 }LTENR_GnbSchedulingType;
46#pragma endregion
47
48#pragma region UE_SCHEDULER_INFO
50 {
51 __IN__ NETSIM_ID ueId;
52 __IN__ NETSIM_ID ueIf;
53 __IN__ UINT bufferSize;
54 __IN__ UINT64 bitsPerPRB;
55 __IN__ UINT64 bitsPerPRBLayer[MAX_LAYER_COUNT];
56 __IN__ UINT64 TBSLayer[MAX_LAYER_COUNT];
57 __IN__ double initRank;
58 __IN__ double rank;
59 __IN__ double var2; // Store past throughput performance for proportional fair
60
61 //PFS_RG
62 __IN__ double a;
63 __IN__ double b;
64 __IN__ double rateGuarantee; //mbps //nu*_L
65 __IN__ double slice_lower_bound;
66 __IN__ double slice_upper_bound;
67 __OUT__ double lambda_L;
68 __OUT__ double lambda_U;
69
70 __OUT__ double CurrentRate;
71 __OUT__ bool isInitialized;
72 double nu_i;
73 double dPhi;
74 double dThetaAverage;
75 double T;
76
77
78 //Network Slicing
79 __IN__ double averageThroughput;
80
81 __IN__ bool NDI;
82 __IN__ UINT PRBReqdForHARQRetransmission;
83
84 __OUT__ UINT allocatedPRBCount;
85 struct stru_LTENR_UESchedulerInfo* next;
86 }LTENR_UESCHEDULERINFO, * ptrLTENR_UESCHEDULERINFO;
87#pragma endregion
88
89#pragma region SCHEDULER_INFO
91 {
92 __IN__ NETSIM_ID gnbId;
93 __IN__ NETSIM_ID gnbIf;
94
95 __IN__ UINT PRBCount;
96 __IN__ double OH_UL;
97 __IN__ double OH_DL;
98 __IN__ BOOL isPRBRankInit;
99 __IN__ BOOL isUERRCSetUpCompleted;
100 __IN__ LTENR_GnbSchedulingType schedulingType;
101 __IN__ double alpha;
102 __IN__ __OUT__ LTENR_SLOTTYPE slotType;
103 __IN__ UINT TotalPRBReqdForHARQRetransmission;
104
105 __IN__ ptrLTENR_UESCHEDULERINFO uplinkInfo;
106 __IN__ ptrLTENR_UESCHEDULERINFO downlinkInfo;
107 }LTENR_SCHEDULERINFO, * ptrLTENR_SCHEDULERINFO;
108#pragma endregion
109
110#pragma region GNB_MAC
111 typedef struct stru_LTENR_GnbMac
112 {
113 NETSIM_ID gnbId;
114 NETSIM_ID gnbIf;
115
116 NETSIM_ID epcId;
117 NETSIM_ID epcIf;
118
119 ptrLTENR_SCHEDULERINFO schedulerInfo[MAX_CA_COUNT];
120 }LTENR_GNBMAC, * ptrLTENR_GNBMAC;
121#pragma endregion
122
123#pragma region BWP_SWITCH
124 typedef struct stru_LTENR_BwpSwitch
125 {
126 UINT prb_count;
127 UINT ca_new;
128 bool bwp_active;
129 }LTENR_BwpSwitch, * ptrLTENR_BwpSwitch;
130#pragma endregion
131
132#pragma region VARIABLE_AND_FUN_DEF
133 double initTotalPRBAvailable;
134 void LTENR_PRB_Scheduler(ptrLTENR_SCHEDULERINFO schedulerInfo);
135 void PFS_RG_AllocatePRB(ptrLTENR_UESCHEDULERINFO *list, ptrLTENR_SCHEDULERINFO schedulerInfo, UINT sliceId);
136 ptrLTENR_UESCHEDULERINFO LTENR_MACScheduler_FindInfoForUE(ptrLTENR_SCHEDULERINFO si,
137 NETSIM_ID d, NETSIM_ID in,
138 bool isUplink);
139 //BWP-PRB
140 ptrLTENR_BwpSwitch LTENR_BWP_Switch(ptrLTENR_SCHEDULERINFO schedulerInfo, ptrLTENR_UESCHEDULERINFO curr, UINT PRB_needed);
141#pragma endregion
142
143#ifdef __cplusplus
144}
145#endif
146#endif /* _NETSIM_LTENR_MAC_H_ */