NetSim Source Code Help v14.4
All 13 Components
 
Loading...
Searching...
No Matches
LTENR_Spectrum.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_SPECTRUM_H_
26#define _NETSIM_LTENR_SPECTRUM_H_
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#pragma region SLOT_TYPE
32 typedef enum enum_SLOTTYPE
33 {
34 SLOT_UPLINK,
35 SLOT_DOWNLINK,
36 SLOT_MIXED,
37 }LTENR_SLOTTYPE;
38 static char strLTENR_SLOTTYPE[][50] = { "UPLink","Downlink","Mixed" };
39#pragma endregion
40
41#pragma region UE_LIST_CA
42 typedef struct stru_LTENR_CA_UE_LIST
43 {
44 NETSIM_ID ue_id;
45 NETSIM_ID ue_in;
46 struct stru_LTENR_CA_UE_LIST* next;
47 }LTENR_CA_UE_LIST, * ptrLTENR_CA_UE_LIST;
48#pragma endregion
49
50#pragma region CA
51 typedef struct stru_LTENR_CA {
52
53 char* frequencyRange;
54 char* operatingBand;
55
56 UINT Flow_MHZ;
57 UINT Fhigh_MHz;
58 long double original_channelBandwidth_mHz;
59 long double channelBandwidth_mHz;
60 double guardBand_kHz;
61 UINT PRBCount;
62 UINT PRBoffset;
63
64 UINT8 mu; //Subcarrier spacing configuration
65 UINT8 subCarrierSpacing_kHz;
66 UINT16 prbBandwidth_kHz;
67 char* cyclicPrefix;
68 UINT8 symbolPerSlot;
69 UINT8 slotPerFrame;
70 UINT8 slotPerSubframe;
71 double slotDuration_us;
72 double symbolDuration_us;
73
74 LTENR_SLOTTYPE configSlotType;
75 double dlSlotRatio;
76 UINT64 dlSlotCount;
77 UINT64 totalSlotCount;
78
79 //BWP
80 bool isBWPEnabled;
81 UINT bwp_count;
82 UINT bwp_id;
83
84 //Config parameter - PHY_OVERHEAD
85 double OverheadDL;
86 double OverheadUL;
87
88 ptrLTENR_CA_UE_LIST ue_list;
89 }LTENR_CA, * ptrLTENR_CA;
90#pragma endregion
91
92#pragma region SPECTRUM_CONFIG
94 {
95 char* duplexMode;
96
97 UINT frameDuration;
98 UINT subFrameDuration;
99 UINT subFramePerFrame;
100 UINT8 numSubcarrierPerPRB;
101
102 ptrLTENR_CA CA[MAX_CA_COUNT];
103 ptrLTENR_CA CA_original[MAX_CA_COUNT];
104
105 int Current_CA_ID;
106
107 int Series3GPP;
108 }LTENR_SPECTRUMCONFIG, * ptrLTENR_SPECTRUMCONFIG;
109#pragma endregion
110
111#pragma region PRB
112 typedef struct stru_LTENR_PRB
113 {
114 UINT prbId;
115 double lFrequency_MHz;
116 double uFrequency_MHz;
117 double centralFrequency_MHz;
118 double prbBandwidth_MHz;
119
120 }LTENR_PRB, * ptrLTENR_PRB;
121#pragma endregion
122
123#pragma region MACROS
124#define LTENR_MAX_CQI 15
125#define LTENR_MAX_MCS 32
126#define NUM_OF_RE_IN_DMRS 0
127#define LTENR_DEFAULT_SPECTRAL_EFFICIENCY 0.16
128#pragma endregion
129
130#pragma region CQI_TABLE
131 typedef struct stru_LTENR_CQITable
132 {
133 UINT CQIIndex;
134 PHY_MODULATION modulation;
135 UINT codeRate; //R
136 double efficiency;
137 }LTENR_CQITable, * ptrLTENR_CQITable;
138#define CQIINDEX_ISVALID(index) (((index)>0) && ((index)<=LTENR_MAX_CQI))
139#define CQITABLE_EFFICIENCY(table,index) (CQIINDEX_ISVALID(index)?(((table)[(index)]).efficiency):0)
140#pragma endregion
141
142#pragma region MCS_INDEX
144 {
145 int mcsIndex;
146 int modulationOrder; //Qm
147 PHY_MODULATION modulation;
148 double codeRate; //R*1024
149 double spectralEfficiency;
150 }LTENR_MCSINDEXTABLE, * ptrLTENR_MCSINDEXTABLE;
151#pragma endregion
152
153#pragma region TBS_SIZE
154 typedef struct stru_TBSTable
155 {
156 UINT index;
157 UINT TBS;
158 }LTENR_TBSTABLE, * ptrLTENR_TBSTABLE;
159#pragma endregion
160
161#pragma region AMC_INFO
162 typedef struct stru_AMCInfo
163 {
164 double SpectralEfficiency;
165
166 LTENR_CQITable cqiTable;
167
168 LTENR_MCSINDEXTABLE mcsTable;
169 UINT tbsSize;
170 UINT BG; // LDPC base Graph
171 UINT CBS; //Code Block Size
172 UINT CBS_; //value of K_
173 UINT nCodeBlock; //C, Number of Code Blocks
174 }LTENR_AMCINFO, * ptrLTENR_AMCINFO;
175#pragma endregion
176
177#pragma region FUN_DEF
178 //Function prototype
179 LTENR_CQITable LTENR_GetCQITableFromSpectralEfficiency(ptrLTENR_CQITable table, double efficiency);
180 LTENR_MCSINDEXTABLE LTENR_GetMCSIndexTableFromSpectralEfficiency(ptrLTENR_MCSINDEXTABLE table, double efficiency);
181 UINT64 LTENR_calculateTBSSize(void* gnbPhy,
182 UINT allocatedPRB,
183 LTENR_MCSINDEXTABLE mcsTable, int CA_ID);
184#pragma endregion
185
186#ifdef __cplusplus
187}
188#endif
189#endif /* _NETSIM_LTENR_SPECTRUM_H_ */