author | Vedran Miletić <rivanvx@gmail.com> |
Sat, 01 Sep 2012 20:57:21 +0200 | |
changeset 9063 | 32755d0516f4 |
parent 9059 | 47aa9789ed30 |
child 9155 | 3a2efbb0e7d9 |
permissions | -rw-r--r-- |
7886 | 1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License version 2 as |
|
7 |
* published by the Free Software Foundation; |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
18 |
* Author: Marco Miozzo <marco.miozzo@cttc.es> |
|
19 |
*/ |
|
20 |
||
21 |
#include <ns3/log.h> |
|
22 |
#include <ns3/pointer.h> |
|
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
9059
diff
changeset
|
23 |
#include <ns3/math.h> |
7886 | 24 |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
25 |
#include <ns3/lte-amc.h> |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
26 |
#include <ns3/rr-ff-mac-scheduler.h> |
8497
b06cd67bc6ba
Update RR and PF scheduler for updating BSR queues avoiding overflows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
27 |
#include <ns3/simulator.h> |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
28 |
#include <ns3/lte-common.h> |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
29 |
#include <ns3/lte-vendor-specific-parameters.h> |
7886 | 30 |
|
7906
d58de34e41d3
MAC, RRC and Scheduler created by LenaHelper
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7897
diff
changeset
|
31 |
NS_LOG_COMPONENT_DEFINE ("RrFfMacScheduler"); |
7886 | 32 |
|
33 |
namespace ns3 { |
|
34 |
||
35 |
int Type0AllocationRbg[4] = { |
|
36 |
10, // RGB size 1 |
|
37 |
26, // RGB size 2 |
|
38 |
63, // RGB size 3 |
|
39 |
110 // RGB size 4 |
|
40 |
}; // see table 7.1.6.1-1 of 36.213 |
|
41 |
||
42 |
||
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
43 |
|
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
44 |
|
7906
d58de34e41d3
MAC, RRC and Scheduler created by LenaHelper
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7897
diff
changeset
|
45 |
NS_OBJECT_ENSURE_REGISTERED (RrFfMacScheduler); |
7886 | 46 |
|
47 |
||
7888 | 48 |
class RrSchedulerMemberCschedSapProvider : public FfMacCschedSapProvider |
7886 | 49 |
{ |
50 |
public: |
|
7888 | 51 |
RrSchedulerMemberCschedSapProvider (RrFfMacScheduler* scheduler); |
7886 | 52 |
|
53 |
// inherited from FfMacCschedSapProvider |
|
54 |
virtual void CschedCellConfigReq (const struct CschedCellConfigReqParameters& params); |
|
55 |
virtual void CschedUeConfigReq (const struct CschedUeConfigReqParameters& params); |
|
56 |
virtual void CschedLcConfigReq (const struct CschedLcConfigReqParameters& params); |
|
57 |
virtual void CschedLcReleaseReq (const struct CschedLcReleaseReqParameters& params); |
|
58 |
virtual void CschedUeReleaseReq (const struct CschedUeReleaseReqParameters& params); |
|
59 |
||
60 |
private: |
|
7888 | 61 |
RrSchedulerMemberCschedSapProvider (); |
7886 | 62 |
RrFfMacScheduler* m_scheduler; |
63 |
}; |
|
64 |
||
7888 | 65 |
RrSchedulerMemberCschedSapProvider::RrSchedulerMemberCschedSapProvider () |
7886 | 66 |
{ |
67 |
} |
|
68 |
||
7888 | 69 |
RrSchedulerMemberCschedSapProvider::RrSchedulerMemberCschedSapProvider (RrFfMacScheduler* scheduler) : m_scheduler (scheduler) |
7886 | 70 |
{ |
71 |
} |
|
72 |
||
73 |
||
74 |
void |
|
7888 | 75 |
RrSchedulerMemberCschedSapProvider::CschedCellConfigReq (const struct CschedCellConfigReqParameters& params) |
7886 | 76 |
{ |
77 |
m_scheduler->DoCschedCellConfigReq (params); |
|
78 |
} |
|
79 |
||
80 |
void |
|
7888 | 81 |
RrSchedulerMemberCschedSapProvider::CschedUeConfigReq (const struct CschedUeConfigReqParameters& params) |
7886 | 82 |
{ |
83 |
m_scheduler->DoCschedUeConfigReq (params); |
|
84 |
} |
|
85 |
||
86 |
||
87 |
void |
|
7888 | 88 |
RrSchedulerMemberCschedSapProvider::CschedLcConfigReq (const struct CschedLcConfigReqParameters& params) |
7886 | 89 |
{ |
90 |
m_scheduler->DoCschedLcConfigReq (params); |
|
91 |
} |
|
92 |
||
93 |
void |
|
7888 | 94 |
RrSchedulerMemberCschedSapProvider::CschedLcReleaseReq (const struct CschedLcReleaseReqParameters& params) |
7886 | 95 |
{ |
96 |
m_scheduler->DoCschedLcReleaseReq (params); |
|
97 |
} |
|
98 |
||
99 |
void |
|
7888 | 100 |
RrSchedulerMemberCschedSapProvider::CschedUeReleaseReq (const struct CschedUeReleaseReqParameters& params) |
7886 | 101 |
{ |
102 |
m_scheduler->DoCschedUeReleaseReq (params); |
|
103 |
} |
|
104 |
||
105 |
||
106 |
||
107 |
||
7888 | 108 |
class RrSchedulerMemberSchedSapProvider : public FfMacSchedSapProvider |
7886 | 109 |
{ |
110 |
public: |
|
7888 | 111 |
RrSchedulerMemberSchedSapProvider (RrFfMacScheduler* scheduler); |
7886 | 112 |
|
113 |
// inherited from FfMacSchedSapProvider |
|
114 |
virtual void SchedDlRlcBufferReq (const struct SchedDlRlcBufferReqParameters& params); |
|
115 |
virtual void SchedDlPagingBufferReq (const struct SchedDlPagingBufferReqParameters& params); |
|
116 |
virtual void SchedDlMacBufferReq (const struct SchedDlMacBufferReqParameters& params); |
|
117 |
virtual void SchedDlTriggerReq (const struct SchedDlTriggerReqParameters& params); |
|
118 |
virtual void SchedDlRachInfoReq (const struct SchedDlRachInfoReqParameters& params); |
|
119 |
virtual void SchedDlCqiInfoReq (const struct SchedDlCqiInfoReqParameters& params); |
|
120 |
virtual void SchedUlTriggerReq (const struct SchedUlTriggerReqParameters& params); |
|
121 |
virtual void SchedUlNoiseInterferenceReq (const struct SchedUlNoiseInterferenceReqParameters& params); |
|
122 |
virtual void SchedUlSrInfoReq (const struct SchedUlSrInfoReqParameters& params); |
|
123 |
virtual void SchedUlMacCtrlInfoReq (const struct SchedUlMacCtrlInfoReqParameters& params); |
|
124 |
virtual void SchedUlCqiInfoReq (const struct SchedUlCqiInfoReqParameters& params); |
|
125 |
||
126 |
||
127 |
private: |
|
7888 | 128 |
RrSchedulerMemberSchedSapProvider (); |
7886 | 129 |
RrFfMacScheduler* m_scheduler; |
130 |
}; |
|
131 |
||
132 |
||
133 |
||
7888 | 134 |
RrSchedulerMemberSchedSapProvider::RrSchedulerMemberSchedSapProvider () |
7886 | 135 |
{ |
136 |
} |
|
137 |
||
138 |
||
7888 | 139 |
RrSchedulerMemberSchedSapProvider::RrSchedulerMemberSchedSapProvider (RrFfMacScheduler* scheduler) |
7886 | 140 |
: m_scheduler (scheduler) |
141 |
{ |
|
142 |
} |
|
143 |
||
144 |
void |
|
7888 | 145 |
RrSchedulerMemberSchedSapProvider::SchedDlRlcBufferReq (const struct SchedDlRlcBufferReqParameters& params) |
7886 | 146 |
{ |
147 |
m_scheduler->DoSchedDlRlcBufferReq (params); |
|
148 |
} |
|
149 |
||
150 |
void |
|
7888 | 151 |
RrSchedulerMemberSchedSapProvider::SchedDlPagingBufferReq (const struct SchedDlPagingBufferReqParameters& params) |
7886 | 152 |
{ |
153 |
m_scheduler->DoSchedDlPagingBufferReq (params); |
|
154 |
} |
|
155 |
||
156 |
void |
|
7888 | 157 |
RrSchedulerMemberSchedSapProvider::SchedDlMacBufferReq (const struct SchedDlMacBufferReqParameters& params) |
7886 | 158 |
{ |
159 |
m_scheduler->DoSchedDlMacBufferReq (params); |
|
160 |
} |
|
161 |
||
162 |
void |
|
7888 | 163 |
RrSchedulerMemberSchedSapProvider::SchedDlTriggerReq (const struct SchedDlTriggerReqParameters& params) |
7886 | 164 |
{ |
165 |
m_scheduler->DoSchedDlTriggerReq (params); |
|
166 |
} |
|
167 |
||
168 |
void |
|
7888 | 169 |
RrSchedulerMemberSchedSapProvider::SchedDlRachInfoReq (const struct SchedDlRachInfoReqParameters& params) |
7886 | 170 |
{ |
171 |
m_scheduler->DoSchedDlRachInfoReq (params); |
|
172 |
} |
|
173 |
||
174 |
void |
|
7888 | 175 |
RrSchedulerMemberSchedSapProvider::SchedDlCqiInfoReq (const struct SchedDlCqiInfoReqParameters& params) |
7886 | 176 |
{ |
177 |
m_scheduler->DoSchedDlCqiInfoReq (params); |
|
178 |
} |
|
179 |
||
180 |
void |
|
7888 | 181 |
RrSchedulerMemberSchedSapProvider::SchedUlTriggerReq (const struct SchedUlTriggerReqParameters& params) |
7886 | 182 |
{ |
183 |
m_scheduler->DoSchedUlTriggerReq (params); |
|
184 |
} |
|
185 |
||
186 |
void |
|
7888 | 187 |
RrSchedulerMemberSchedSapProvider::SchedUlNoiseInterferenceReq (const struct SchedUlNoiseInterferenceReqParameters& params) |
7886 | 188 |
{ |
189 |
m_scheduler->DoSchedUlNoiseInterferenceReq (params); |
|
190 |
} |
|
191 |
||
192 |
void |
|
7888 | 193 |
RrSchedulerMemberSchedSapProvider::SchedUlSrInfoReq (const struct SchedUlSrInfoReqParameters& params) |
7886 | 194 |
{ |
195 |
m_scheduler->DoSchedUlSrInfoReq (params); |
|
196 |
} |
|
197 |
||
198 |
void |
|
7888 | 199 |
RrSchedulerMemberSchedSapProvider::SchedUlMacCtrlInfoReq (const struct SchedUlMacCtrlInfoReqParameters& params) |
7886 | 200 |
{ |
201 |
m_scheduler->DoSchedUlMacCtrlInfoReq (params); |
|
202 |
} |
|
203 |
||
204 |
void |
|
7888 | 205 |
RrSchedulerMemberSchedSapProvider::SchedUlCqiInfoReq (const struct SchedUlCqiInfoReqParameters& params) |
7886 | 206 |
{ |
207 |
m_scheduler->DoSchedUlCqiInfoReq (params); |
|
208 |
} |
|
209 |
||
210 |
||
211 |
||
212 |
||
213 |
||
214 |
RrFfMacScheduler::RrFfMacScheduler () |
|
215 |
: m_cschedSapUser (0), |
|
7948 | 216 |
m_schedSapUser (0), |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
217 |
m_nextRntiDl (0), |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
218 |
m_nextRntiUl (0) |
7886 | 219 |
{ |
8525
23d9706114f8
Change LteAmc* to Ptr<LteAmc> in RR scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8516
diff
changeset
|
220 |
m_amc = CreateObject <LteAmc> (); |
7888 | 221 |
m_cschedSapProvider = new RrSchedulerMemberCschedSapProvider (this); |
222 |
m_schedSapProvider = new RrSchedulerMemberSchedSapProvider (this); |
|
7886 | 223 |
} |
224 |
||
225 |
RrFfMacScheduler::~RrFfMacScheduler () |
|
226 |
{ |
|
227 |
NS_LOG_FUNCTION (this); |
|
228 |
} |
|
229 |
||
230 |
void |
|
231 |
RrFfMacScheduler::DoDispose () |
|
232 |
{ |
|
233 |
NS_LOG_FUNCTION (this); |
|
234 |
delete m_cschedSapProvider; |
|
235 |
delete m_schedSapProvider; |
|
236 |
} |
|
237 |
||
238 |
TypeId |
|
239 |
RrFfMacScheduler::GetTypeId (void) |
|
240 |
{ |
|
7983
b91d5a39aabc
scheduler and propagation model configurable through ConfigStore
Nicola Baldo <nbaldo@cttc.es>
parents:
7977
diff
changeset
|
241 |
static TypeId tid = TypeId ("ns3::RrFfMacScheduler") |
7886 | 242 |
.SetParent<FfMacScheduler> () |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
243 |
.AddConstructor<RrFfMacScheduler> () |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
244 |
.AddAttribute ("CqiTimerThreshold", |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
245 |
"The number of TTIs a CQI is valid (default 1000 - 1 sec.)", |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
246 |
UintegerValue (1000), |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
247 |
MakeUintegerAccessor (&RrFfMacScheduler::m_cqiTimersThreshold), |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
248 |
MakeUintegerChecker<uint32_t> ()) |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
249 |
; |
7886 | 250 |
return tid; |
251 |
} |
|
252 |
||
253 |
||
254 |
||
255 |
void |
|
256 |
RrFfMacScheduler::SetFfMacCschedSapUser (FfMacCschedSapUser* s) |
|
257 |
{ |
|
258 |
m_cschedSapUser = s; |
|
259 |
} |
|
260 |
||
261 |
void |
|
262 |
RrFfMacScheduler::SetFfMacSchedSapUser (FfMacSchedSapUser* s) |
|
263 |
{ |
|
264 |
m_schedSapUser = s; |
|
265 |
} |
|
266 |
||
267 |
FfMacCschedSapProvider* |
|
268 |
RrFfMacScheduler::GetFfMacCschedSapProvider () |
|
269 |
{ |
|
270 |
return m_cschedSapProvider; |
|
271 |
} |
|
272 |
||
273 |
FfMacSchedSapProvider* |
|
274 |
RrFfMacScheduler::GetFfMacSchedSapProvider () |
|
275 |
{ |
|
276 |
return m_schedSapProvider; |
|
277 |
} |
|
278 |
||
279 |
void |
|
280 |
RrFfMacScheduler::DoCschedCellConfigReq (const struct FfMacCschedSapProvider::CschedCellConfigReqParameters& params) |
|
281 |
{ |
|
282 |
NS_LOG_FUNCTION (this); |
|
283 |
// Read the subset of parameters used |
|
284 |
m_cschedCellConfig = params; |
|
285 |
FfMacCschedSapUser::CschedUeConfigCnfParameters cnf; |
|
286 |
cnf.m_result = SUCCESS; |
|
287 |
m_cschedSapUser->CschedUeConfigCnf (cnf); |
|
288 |
return; |
|
289 |
} |
|
290 |
||
291 |
void |
|
292 |
RrFfMacScheduler::DoCschedUeConfigReq (const struct FfMacCschedSapProvider::CschedUeConfigReqParameters& params) |
|
293 |
{ |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
294 |
NS_LOG_FUNCTION (this << " RNTI " << params.m_rnti << " txMode " << (uint16_t)params.m_transmissionMode); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
295 |
std::map <uint16_t,uint8_t>::iterator it = m_uesTxMode.find (params.m_rnti); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
296 |
if (it==m_uesTxMode.end ()) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
297 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
298 |
m_uesTxMode.insert (std::pair <uint16_t, double> (params.m_rnti, params.m_transmissionMode)); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
299 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
300 |
else |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
301 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
302 |
(*it).second = params.m_transmissionMode; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
303 |
} |
7886 | 304 |
return; |
305 |
} |
|
306 |
||
307 |
void |
|
308 |
RrFfMacScheduler::DoCschedLcConfigReq (const struct FfMacCschedSapProvider::CschedLcConfigReqParameters& params) |
|
309 |
{ |
|
310 |
NS_LOG_FUNCTION (this); |
|
311 |
// Not used at this stage |
|
312 |
return; |
|
313 |
} |
|
314 |
||
315 |
void |
|
316 |
RrFfMacScheduler::DoCschedLcReleaseReq (const struct FfMacCschedSapProvider::CschedLcReleaseReqParameters& params) |
|
317 |
{ |
|
318 |
NS_LOG_FUNCTION (this); |
|
319 |
// TODO: Implementation of the API |
|
320 |
return; |
|
321 |
} |
|
322 |
||
323 |
void |
|
324 |
RrFfMacScheduler::DoCschedUeReleaseReq (const struct FfMacCschedSapProvider::CschedUeReleaseReqParameters& params) |
|
325 |
{ |
|
326 |
NS_LOG_FUNCTION (this); |
|
327 |
// TODO: Implementation of the API |
|
328 |
return; |
|
329 |
} |
|
330 |
||
331 |
||
332 |
void |
|
333 |
RrFfMacScheduler::DoSchedDlRlcBufferReq (const struct FfMacSchedSapProvider::SchedDlRlcBufferReqParameters& params) |
|
334 |
{ |
|
335 |
NS_LOG_FUNCTION (this << params.m_rnti << (uint32_t) params.m_logicalChannelIdentity); |
|
336 |
// API generated by RLC for updating RLC parameters on a LC (tx and retx queues) |
|
8413
3387abb7a77c
better fix for RR scheduler buffer status report bug
Nicola Baldo <nbaldo@cttc.es>
parents:
8412
diff
changeset
|
337 |
std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = m_rlcBufferReq.begin (); |
7972
6d24eb482e41
LENA-80 RrFfMacScheduler::DoSchedDlTriggerReq solved issue on nFlows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7966
diff
changeset
|
338 |
bool newLc = true; |
8413
3387abb7a77c
better fix for RR scheduler buffer status report bug
Nicola Baldo <nbaldo@cttc.es>
parents:
8412
diff
changeset
|
339 |
while (it != m_rlcBufferReq.end ()) |
7886 | 340 |
{ |
341 |
// remove old entries of this UE-LC |
|
342 |
if (((*it).m_rnti == params.m_rnti)&&((*it).m_logicalChannelIdentity == params.m_logicalChannelIdentity)) |
|
343 |
{ |
|
8412
018034c10dec
fixed RR scheduler buffer status report bug
Nicola Baldo <nbaldo@cttc.es>
parents:
8342
diff
changeset
|
344 |
it = m_rlcBufferReq.erase (it); |
7972
6d24eb482e41
LENA-80 RrFfMacScheduler::DoSchedDlTriggerReq solved issue on nFlows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7966
diff
changeset
|
345 |
newLc = false; |
7886 | 346 |
} |
8413
3387abb7a77c
better fix for RR scheduler buffer status report bug
Nicola Baldo <nbaldo@cttc.es>
parents:
8412
diff
changeset
|
347 |
else |
3387abb7a77c
better fix for RR scheduler buffer status report bug
Nicola Baldo <nbaldo@cttc.es>
parents:
8412
diff
changeset
|
348 |
{ |
3387abb7a77c
better fix for RR scheduler buffer status report bug
Nicola Baldo <nbaldo@cttc.es>
parents:
8412
diff
changeset
|
349 |
++it; |
3387abb7a77c
better fix for RR scheduler buffer status report bug
Nicola Baldo <nbaldo@cttc.es>
parents:
8412
diff
changeset
|
350 |
} |
7886 | 351 |
} |
7972
6d24eb482e41
LENA-80 RrFfMacScheduler::DoSchedDlTriggerReq solved issue on nFlows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7966
diff
changeset
|
352 |
// add the new parameters |
7886 | 353 |
m_rlcBufferReq.insert (it, params); |
7972
6d24eb482e41
LENA-80 RrFfMacScheduler::DoSchedDlTriggerReq solved issue on nFlows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7966
diff
changeset
|
354 |
// initialize statistics of the flow in case of new flows |
6d24eb482e41
LENA-80 RrFfMacScheduler::DoSchedDlTriggerReq solved issue on nFlows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7966
diff
changeset
|
355 |
if (newLc == true) |
6d24eb482e41
LENA-80 RrFfMacScheduler::DoSchedDlTriggerReq solved issue on nFlows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7966
diff
changeset
|
356 |
{ |
6d24eb482e41
LENA-80 RrFfMacScheduler::DoSchedDlTriggerReq solved issue on nFlows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7966
diff
changeset
|
357 |
m_p10CqiRxed.insert ( std::pair<uint16_t, uint8_t > (params.m_rnti, 1)); // only codeword 0 at this stage (SISO) |
6d24eb482e41
LENA-80 RrFfMacScheduler::DoSchedDlTriggerReq solved issue on nFlows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7966
diff
changeset
|
358 |
// initialized to 1 (i.e., the lowest value for transmitting a signal) |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
359 |
m_p10CqiTimers.insert ( std::pair<uint16_t, uint32_t > (params.m_rnti, m_cqiTimersThreshold)); |
7972
6d24eb482e41
LENA-80 RrFfMacScheduler::DoSchedDlTriggerReq solved issue on nFlows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7966
diff
changeset
|
360 |
} |
7886 | 361 |
|
362 |
return; |
|
363 |
} |
|
364 |
||
365 |
void |
|
366 |
RrFfMacScheduler::DoSchedDlPagingBufferReq (const struct FfMacSchedSapProvider::SchedDlPagingBufferReqParameters& params) |
|
367 |
{ |
|
368 |
NS_LOG_FUNCTION (this); |
|
369 |
// TODO: Implementation of the API |
|
370 |
return; |
|
371 |
} |
|
372 |
||
373 |
void |
|
374 |
RrFfMacScheduler::DoSchedDlMacBufferReq (const struct FfMacSchedSapProvider::SchedDlMacBufferReqParameters& params) |
|
375 |
{ |
|
376 |
NS_LOG_FUNCTION (this); |
|
377 |
// TODO: Implementation of the API |
|
378 |
return; |
|
379 |
} |
|
380 |
||
381 |
int |
|
382 |
RrFfMacScheduler::GetRbgSize (int dlbandwidth) |
|
383 |
{ |
|
384 |
for (int i = 0; i < 4; i++) |
|
385 |
{ |
|
386 |
if (dlbandwidth < Type0AllocationRbg[i]) |
|
387 |
{ |
|
388 |
return (i + 1); |
|
389 |
} |
|
390 |
} |
|
391 |
||
392 |
return (-1); |
|
393 |
} |
|
394 |
||
8320
756e0218720d
Bug-fix in RrFfMacScheduler::DoSchedDlTriggerReq when scheduling multiple LCs per UE
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8319
diff
changeset
|
395 |
bool |
756e0218720d
Bug-fix in RrFfMacScheduler::DoSchedDlTriggerReq when scheduling multiple LCs per UE
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8319
diff
changeset
|
396 |
RrFfMacScheduler::SortRlcBufferReq (FfMacSchedSapProvider::SchedDlRlcBufferReqParameters i,FfMacSchedSapProvider::SchedDlRlcBufferReqParameters j) |
756e0218720d
Bug-fix in RrFfMacScheduler::DoSchedDlTriggerReq when scheduling multiple LCs per UE
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8319
diff
changeset
|
397 |
{ |
756e0218720d
Bug-fix in RrFfMacScheduler::DoSchedDlTriggerReq when scheduling multiple LCs per UE
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8319
diff
changeset
|
398 |
return (i.m_rnti<j.m_rnti); |
756e0218720d
Bug-fix in RrFfMacScheduler::DoSchedDlTriggerReq when scheduling multiple LCs per UE
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8319
diff
changeset
|
399 |
} |
756e0218720d
Bug-fix in RrFfMacScheduler::DoSchedDlTriggerReq when scheduling multiple LCs per UE
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8319
diff
changeset
|
400 |
|
7886 | 401 |
|
402 |
void |
|
403 |
RrFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::SchedDlTriggerReqParameters& params) |
|
404 |
{ |
|
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
405 |
NS_LOG_FUNCTION (this << " DL Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf)); |
7886 | 406 |
// API generated by RLC for triggering the scheduling of a DL subframe |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
407 |
|
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
408 |
RefreshDlCqiMaps (); |
7886 | 409 |
|
410 |
// Get the actual active flows (queue!=0) |
|
8320
756e0218720d
Bug-fix in RrFfMacScheduler::DoSchedDlTriggerReq when scheduling multiple LCs per UE
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8319
diff
changeset
|
411 |
std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it; |
756e0218720d
Bug-fix in RrFfMacScheduler::DoSchedDlTriggerReq when scheduling multiple LCs per UE
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8319
diff
changeset
|
412 |
m_rlcBufferReq.sort (SortRlcBufferReq); |
7886 | 413 |
int nflows = 0; |
8342
ae80a024c11e
Bug-fix RrFfMacScheduler::DoSchedDlTriggerReq DCI TB size per multiple LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8321
diff
changeset
|
414 |
int nTbs = 0; |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
415 |
std::map <uint16_t,uint8_t> lcActivesPerRnti; |
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
416 |
std::map <uint16_t,uint8_t>::iterator itLcRnti; |
7886 | 417 |
for (it = m_rlcBufferReq.begin (); it != m_rlcBufferReq.end (); it++) |
418 |
{ |
|
8342
ae80a024c11e
Bug-fix RrFfMacScheduler::DoSchedDlTriggerReq DCI TB size per multiple LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8321
diff
changeset
|
419 |
// NS_LOG_INFO (this << " User " << (*it).m_rnti << " LC " << (uint16_t)(*it).m_logicalChannelIdentity); |
7886 | 420 |
// remove old entries of this UE-LC |
421 |
if ( ((*it).m_rlcTransmissionQueueSize > 0) |
|
422 |
|| ((*it).m_rlcRetransmissionQueueSize > 0) |
|
423 |
|| ((*it).m_rlcStatusPduSize > 0) ) |
|
424 |
{ |
|
7966
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
425 |
std::map <uint16_t,uint8_t>::iterator itCqi = m_p10CqiRxed.find ((*it).m_rnti); |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
426 |
uint8_t cqi = 0; |
7966
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
427 |
if (itCqi != m_p10CqiRxed.end ()) |
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
428 |
{ |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
429 |
cqi = (*itCqi).second; |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
430 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
431 |
else |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
432 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
433 |
cqi = 1; // lowest value fro trying a transmission |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
434 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
435 |
if (cqi != 0) |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
436 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
437 |
// CQI == 0 means "out of range" (see table 7.2.3-1 of 36.213) |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
438 |
nflows++; |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
439 |
itLcRnti = lcActivesPerRnti.find ((*it).m_rnti); |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
440 |
if (itLcRnti != lcActivesPerRnti.end ()) |
7966
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
441 |
{ |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
442 |
(*itLcRnti).second++; |
7966
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
443 |
} |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
444 |
else |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
445 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
446 |
lcActivesPerRnti.insert (std::pair<uint16_t, uint8_t > ((*it).m_rnti, 1)); |
8342
ae80a024c11e
Bug-fix RrFfMacScheduler::DoSchedDlTriggerReq DCI TB size per multiple LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8321
diff
changeset
|
447 |
nTbs++; |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
448 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
449 |
|
7966
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
450 |
} |
7886 | 451 |
} |
452 |
} |
|
8342
ae80a024c11e
Bug-fix RrFfMacScheduler::DoSchedDlTriggerReq DCI TB size per multiple LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8321
diff
changeset
|
453 |
|
7886 | 454 |
if (nflows == 0) |
455 |
{ |
|
456 |
return; |
|
457 |
} |
|
458 |
// Divide the resource equally among the active users according to |
|
459 |
// Resource allocation type 0 (see sec 7.1.6.1 of 36.213) |
|
460 |
int rbgSize = GetRbgSize (m_cschedCellConfig.m_dlBandwidth); |
|
461 |
int rbgNum = m_cschedCellConfig.m_dlBandwidth / rbgSize; |
|
8342
ae80a024c11e
Bug-fix RrFfMacScheduler::DoSchedDlTriggerReq DCI TB size per multiple LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8321
diff
changeset
|
462 |
int rbgPerTb = rbgNum / nTbs; |
ae80a024c11e
Bug-fix RrFfMacScheduler::DoSchedDlTriggerReq DCI TB size per multiple LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8321
diff
changeset
|
463 |
if (rbgPerTb == 0) |
7886 | 464 |
{ |
8342
ae80a024c11e
Bug-fix RrFfMacScheduler::DoSchedDlTriggerReq DCI TB size per multiple LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8321
diff
changeset
|
465 |
rbgPerTb = 1; // at least 1 rbg per TB (till available resource) |
7886 | 466 |
} |
467 |
int rbgAllocated = 0; |
|
468 |
||
469 |
FfMacSchedSapUser::SchedDlConfigIndParameters ret; |
|
8020
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
470 |
// round robin assignment to all UE-LC registered starting from the subsequent of the one |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
471 |
// served last scheduling trigger |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
472 |
//NS_LOG_DEBUG (this << " next to be served " << m_nextRntiDl << " nflows " << nflows); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
473 |
if (m_nextRntiDl != 0) |
8020
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
474 |
{ |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
475 |
for (it = m_rlcBufferReq.begin (); it != m_rlcBufferReq.end (); it++) |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
476 |
{ |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
477 |
if ((*it).m_rnti == m_nextRntiDl) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
478 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
479 |
break; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
480 |
} |
8020
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
481 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
482 |
|
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
483 |
if (it == m_rlcBufferReq.end ()) |
8020
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
484 |
{ |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
485 |
NS_LOG_ERROR (this << " no user found"); |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
486 |
} |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
487 |
} |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
488 |
else |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
489 |
{ |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
490 |
it = m_rlcBufferReq.begin (); |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
491 |
m_nextRntiDl = (*it).m_rnti; |
8020
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
492 |
} |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
493 |
std::map <uint16_t,uint8_t>::iterator itTxMode; |
8020
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
494 |
do |
7886 | 495 |
{ |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
496 |
itLcRnti = lcActivesPerRnti.find ((*it).m_rnti); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
497 |
if (itLcRnti == lcActivesPerRnti.end ()) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
498 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
499 |
// skip this entry |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
500 |
it++; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
501 |
if (it == m_rlcBufferReq.end ()) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
502 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
503 |
// restart from the first |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
504 |
it = m_rlcBufferReq.begin (); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
505 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
506 |
continue; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
507 |
} |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
508 |
itTxMode = m_uesTxMode.find ((*it).m_rnti); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
509 |
if (itTxMode == m_uesTxMode.end()) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
510 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
511 |
NS_FATAL_ERROR ("No Transmission Mode info on user " << (*it).m_rnti); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
512 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
513 |
int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second); |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
514 |
int lcNum = (*itLcRnti).second; |
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
515 |
// create new BuildDataListElement_s for this RNTI |
7886 | 516 |
BuildDataListElement_s newEl; |
517 |
newEl.m_rnti = (*it).m_rnti; |
|
518 |
// create the DlDciListElement_s |
|
519 |
DlDciListElement_s newDci; |
|
520 |
newDci.m_rnti = (*it).m_rnti; |
|
521 |
newDci.m_resAlloc = 0; |
|
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
522 |
newDci.m_rbBitmap = 0; |
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
523 |
std::map <uint16_t,uint8_t>::iterator itCqi = m_p10CqiRxed.find (newEl.m_rnti); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
524 |
for (uint8_t i = 0; i < nLayer; i++) |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
525 |
{ |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
526 |
if (itCqi == m_p10CqiRxed.end ()) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
527 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
528 |
newDci.m_mcs.push_back (0); // no info on this user -> lowest MCS |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
529 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
530 |
else |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
531 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
532 |
newDci.m_mcs.push_back ( m_amc->GetMcsFromCqi ((*itCqi).second) ); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
533 |
} |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
534 |
} |
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
535 |
// group the LCs of this RNTI |
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
536 |
std::vector <struct RlcPduListElement_s> newRlcPduLe; |
8342
ae80a024c11e
Bug-fix RrFfMacScheduler::DoSchedDlTriggerReq DCI TB size per multiple LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8321
diff
changeset
|
537 |
// int totRbg = lcNum * rbgPerFlow; |
ae80a024c11e
Bug-fix RrFfMacScheduler::DoSchedDlTriggerReq DCI TB size per multiple LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8321
diff
changeset
|
538 |
// totRbg = rbgNum / nTbs; |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
539 |
int tbSize = (m_amc->GetTbSizeFromMcs (newDci.m_mcs.at (0), rbgPerTb * rbgSize) / 8); |
9044
e8595c3ac95b
Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9042
diff
changeset
|
540 |
NS_LOG_DEBUG (this << " DL - Allocate user " << newEl.m_rnti << " LCs " << (uint16_t)(*itLcRnti).second << " bytes " << tbSize << " PRBs " << rbgAllocated * rbgSize << "..." << (rbgAllocated* rbgSize) + (rbgPerTb * rbgSize) - 1 << " mcs " << (uint16_t) newDci.m_mcs.at (0) << " layers " << nLayer); |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
541 |
uint16_t rlcPduSize = tbSize / lcNum; |
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
542 |
for (int i = 0; i < lcNum ; i++) |
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
543 |
{ |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
544 |
for (uint8_t j = 0; j < nLayer; j++) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
545 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
546 |
RlcPduListElement_s newRlcEl; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
547 |
newRlcEl.m_logicalChannelIdentity = (*it).m_logicalChannelIdentity; |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
548 |
// NS_LOG_DEBUG (this << "LCID " << (uint32_t) newRlcEl.m_logicalChannelIdentity << " size " << rlcPduSize << " ID " << (*it).m_rnti << " layer " << (uint16_t)j); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
549 |
newRlcEl.m_size = rlcPduSize; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
550 |
UpdateDlRlcBufferInfo ((*it).m_rnti, newRlcEl.m_logicalChannelIdentity, rlcPduSize); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
551 |
newRlcPduLe.push_back (newRlcEl); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
552 |
} |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
553 |
it++; |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
554 |
if (it == m_rlcBufferReq.end ()) |
8020
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
555 |
{ |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
556 |
// restart from the first |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
557 |
it = m_rlcBufferReq.begin (); |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
558 |
} |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
559 |
} |
7886 | 560 |
uint32_t rbgMask = 0; |
8342
ae80a024c11e
Bug-fix RrFfMacScheduler::DoSchedDlTriggerReq DCI TB size per multiple LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8321
diff
changeset
|
561 |
for (int i = 0; i < rbgPerTb; i++) |
7886 | 562 |
{ |
563 |
rbgMask = rbgMask + (0x1 << rbgAllocated); |
|
564 |
rbgAllocated++; |
|
565 |
} |
|
566 |
newDci.m_rbBitmap = rbgMask; // (32 bit bitmap see 7.1.6 of 36.213) |
|
567 |
||
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
568 |
for (int i = 0; i < nLayer; i++) |
7886 | 569 |
{ |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
570 |
newDci.m_tbsSize.push_back (tbSize); |
7886 | 571 |
newDci.m_ndi.push_back (1); // TBD (new data indicator) |
572 |
newDci.m_rv.push_back (0); // TBD (redundancy version) |
|
573 |
} |
|
574 |
newEl.m_dci = newDci; |
|
7897 | 575 |
// ...more parameters -> ignored in this version |
7886 | 576 |
|
577 |
||
7953 | 578 |
|
7886 | 579 |
|
580 |
newEl.m_rlcPduList.push_back (newRlcPduLe); |
|
581 |
ret.m_buildDataList.push_back (newEl); |
|
582 |
if (rbgAllocated == rbgNum) |
|
583 |
{ |
|
8035
d2e70680881a
LenaTestPfFfMacSchedulerSuite works with distance 0
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8020
diff
changeset
|
584 |
//NS_LOG_DEBUG (this << " FULL " << (*it).m_rnti); |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
585 |
m_nextRntiDl = (*it).m_rnti; // store last RNTI served |
7886 | 586 |
break; // no more RGB to be allocated |
587 |
} |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
588 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
589 |
while ((*it).m_rnti != m_nextRntiDl); |
7886 | 590 |
|
591 |
ret.m_nrOfPdcchOfdmSymbols = 1; // TODO: check correct value according the DCIs txed |
|
592 |
||
593 |
m_schedSapUser->SchedDlConfigInd (ret); |
|
594 |
return; |
|
595 |
} |
|
596 |
||
597 |
void |
|
598 |
RrFfMacScheduler::DoSchedDlRachInfoReq (const struct FfMacSchedSapProvider::SchedDlRachInfoReqParameters& params) |
|
599 |
{ |
|
600 |
NS_LOG_FUNCTION (this); |
|
601 |
// TODO: Implementation of the API |
|
602 |
return; |
|
603 |
} |
|
604 |
||
605 |
void |
|
606 |
RrFfMacScheduler::DoSchedDlCqiInfoReq (const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters& params) |
|
607 |
{ |
|
608 |
NS_LOG_FUNCTION (this); |
|
609 |
||
610 |
std::map <uint16_t,uint8_t>::iterator it; |
|
611 |
for (unsigned int i = 0; i < params.m_cqiList.size (); i++) |
|
612 |
{ |
|
613 |
if ( params.m_cqiList.at (i).m_cqiType == CqiListElement_s::P10 ) |
|
614 |
{ |
|
615 |
// wideband CQI reporting |
|
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7888
diff
changeset
|
616 |
std::map <uint16_t,uint8_t>::iterator it; |
7886 | 617 |
uint16_t rnti = params.m_cqiList.at (i).m_rnti; |
618 |
it = m_p10CqiRxed.find (rnti); |
|
619 |
if (it == m_p10CqiRxed.end ()) |
|
620 |
{ |
|
621 |
// create the new entry |
|
622 |
m_p10CqiRxed.insert ( std::pair<uint16_t, uint8_t > (rnti, params.m_cqiList.at (i).m_wbCqi.at (0)) ); // only codeword 0 at this stage (SISO) |
|
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
623 |
// generate correspondent timer |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
624 |
m_p10CqiTimers.insert ( std::pair<uint16_t, uint32_t > (rnti, m_cqiTimersThreshold)); |
7886 | 625 |
} |
626 |
else |
|
627 |
{ |
|
628 |
// update the CQI value |
|
629 |
(*it).second = params.m_cqiList.at (i).m_wbCqi.at (0); |
|
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
630 |
// update correspondent timer |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
631 |
std::map <uint16_t,uint32_t>::iterator itTimers; |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
632 |
itTimers = m_p10CqiTimers.find (rnti); |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
633 |
(*itTimers).second = m_cqiTimersThreshold; |
7886 | 634 |
} |
635 |
} |
|
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7888
diff
changeset
|
636 |
else if ( params.m_cqiList.at (i).m_cqiType == CqiListElement_s::A30 ) |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7888
diff
changeset
|
637 |
{ |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7888
diff
changeset
|
638 |
// subband CQI reporting high layer configured |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7888
diff
changeset
|
639 |
// Not used by RR Scheduler |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7888
diff
changeset
|
640 |
} |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7888
diff
changeset
|
641 |
else |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7888
diff
changeset
|
642 |
{ |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7888
diff
changeset
|
643 |
NS_LOG_ERROR (this << " CQI type unknown"); |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7888
diff
changeset
|
644 |
} |
7886 | 645 |
} |
646 |
||
647 |
return; |
|
648 |
} |
|
649 |
||
650 |
void |
|
651 |
RrFfMacScheduler::DoSchedUlTriggerReq (const struct FfMacSchedSapProvider::SchedUlTriggerReqParameters& params) |
|
652 |
{ |
|
8729
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
653 |
NS_LOG_FUNCTION (this << " Ul - Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf)); |
8080
62d2fccef672
Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8077
diff
changeset
|
654 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
655 |
|
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
656 |
RefreshUlCqiMaps (); |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
657 |
|
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
658 |
std::map <uint16_t,uint32_t>::iterator it; |
7886 | 659 |
int nflows = 0; |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
660 |
|
7886 | 661 |
for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) |
662 |
{ |
|
663 |
// remove old entries of this UE-LC |
|
664 |
if ((*it).second > 0) |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
665 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
666 |
nflows++; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
667 |
} |
7886 | 668 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
669 |
|
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
670 |
if (nflows == 0) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
671 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
672 |
return ; // no flows to be scheduled |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
673 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
674 |
|
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
675 |
|
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
676 |
// Divide the resource equally among the active users starting from the subsequent one served last scheduling trigger |
7886 | 677 |
int rbPerFlow = m_cschedCellConfig.m_ulBandwidth / nflows; |
678 |
if (rbPerFlow == 0) |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
679 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
680 |
rbPerFlow = 1; // at least 1 rbg per flow (till available resource) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
681 |
} |
7886 | 682 |
int rbAllocated = 0; |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
683 |
|
7886 | 684 |
FfMacSchedSapUser::SchedUlConfigIndParameters ret; |
7948 | 685 |
std::vector <uint16_t> rbgAllocationMap; |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
686 |
if (m_nextRntiUl != 0) |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
687 |
{ |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
688 |
for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
689 |
{ |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
690 |
if ((*it).first == m_nextRntiUl) |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
691 |
{ |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
692 |
break; |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
693 |
} |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
694 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
695 |
if (it == m_ceBsrRxed.end ()) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
696 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
697 |
NS_LOG_ERROR (this << " no user found"); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
698 |
} |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
699 |
} |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
700 |
else |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
701 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
702 |
it = m_ceBsrRxed.begin (); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
703 |
m_nextRntiUl = (*it).first; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
704 |
} |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
705 |
do |
7886 | 706 |
{ |
707 |
if (rbAllocated + rbPerFlow > m_cschedCellConfig.m_ulBandwidth) |
|
708 |
{ |
|
709 |
// limit to physical resources last resource assignment |
|
710 |
rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated; |
|
711 |
} |
|
8264
e3a90cfb6ac2
Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8148
diff
changeset
|
712 |
|
7886 | 713 |
UlDciListElement_s uldci; |
714 |
uldci.m_rnti = (*it).first; |
|
715 |
uldci.m_rbStart = rbAllocated; |
|
716 |
uldci.m_rbLen = rbPerFlow; |
|
7948 | 717 |
std::map <uint16_t, std::vector <double> >::iterator itCqi = m_ueCqi.find ((*it).first); |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
718 |
int cqi = 0; |
7948 | 719 |
if (itCqi == m_ueCqi.end ()) |
720 |
{ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
721 |
// no cqi info about this UE |
7948 | 722 |
uldci.m_mcs = 0; // MCS 0 -> UL-AMC TBD |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
723 |
NS_LOG_DEBUG (this << " UE does not have ULCQI " << (*it).first ); |
7948 | 724 |
} |
725 |
else |
|
726 |
{ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
727 |
// take the lowest CQI value (worst RB) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
728 |
double minSinr = (*itCqi).second.at (uldci.m_rbStart); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
729 |
for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_rbLen; i++) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
730 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
731 |
if ((*itCqi).second.at (i) < minSinr) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
732 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
733 |
minSinr = (*itCqi).second.at (i); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
734 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
735 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
736 |
// translate SINR -> cqi: WILD ACK: same as DL |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
737 |
double s = log2 ( 1 + ( |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
9059
diff
changeset
|
738 |
std::pow (10, minSinr / 10 ) / |
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
9059
diff
changeset
|
739 |
( (-std::log (5.0 * 0.00005 )) / 1.5) )); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
740 |
|
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
741 |
|
8516
db748e56aea2
Update RR and PF scheduler for working wiht new LteAmc object
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8513
diff
changeset
|
742 |
cqi = m_amc->GetCqiFromSpectralEfficiency (s); |
7966
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
743 |
if (cqi == 0) |
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
744 |
{ |
8080
62d2fccef672
Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8077
diff
changeset
|
745 |
it++; |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
746 |
if (it == m_ceBsrRxed.end ()) |
8080
62d2fccef672
Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8077
diff
changeset
|
747 |
{ |
62d2fccef672
Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8077
diff
changeset
|
748 |
// restart from the first |
62d2fccef672
Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8077
diff
changeset
|
749 |
it = m_ceBsrRxed.begin (); |
62d2fccef672
Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8077
diff
changeset
|
750 |
} |
7966
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
751 |
continue; // CQI == 0 means "out of range" (see table 7.2.3-1 of 36.213) |
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
752 |
} |
8516
db748e56aea2
Update RR and PF scheduler for working wiht new LteAmc object
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8513
diff
changeset
|
753 |
uldci.m_mcs = m_amc->GetMcsFromCqi (cqi); |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
754 |
// NS_LOG_DEBUG (this << " UE " << (*it).first << " minsinr " << minSinr << " -> mcs " << (uint16_t)uldci.m_mcs); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
755 |
|
7948 | 756 |
} |
8264
e3a90cfb6ac2
Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8148
diff
changeset
|
757 |
|
e3a90cfb6ac2
Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8148
diff
changeset
|
758 |
rbAllocated += rbPerFlow; |
e3a90cfb6ac2
Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8148
diff
changeset
|
759 |
// store info on allocation for managing ul-cqi interpretation |
e3a90cfb6ac2
Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8148
diff
changeset
|
760 |
for (int i = 0; i < rbPerFlow; i++) |
e3a90cfb6ac2
Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8148
diff
changeset
|
761 |
{ |
e3a90cfb6ac2
Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8148
diff
changeset
|
762 |
rbgAllocationMap.push_back ((*it).first); |
e3a90cfb6ac2
Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8148
diff
changeset
|
763 |
} |
e3a90cfb6ac2
Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8148
diff
changeset
|
764 |
|
8516
db748e56aea2
Update RR and PF scheduler for working wiht new LteAmc object
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8513
diff
changeset
|
765 |
uldci.m_tbSize = (m_amc->GetTbSizeFromMcs (uldci.m_mcs, rbPerFlow) / 8); // MCS 0 -> UL-AMC TBD |
8729
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
766 |
NS_LOG_DEBUG (this << " UL - UE " << (*it).first << " startPRB " << (uint32_t)uldci.m_rbStart << " nPRB " << (uint32_t)uldci.m_rbLen << " CQI " << cqi << " MCS " << (uint32_t)uldci.m_mcs << " TBsize " << uldci.m_tbSize); |
8675
e65859f03e99
Bug-fix: update m_ceBsrRxed each UL scheduling trigger event
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
767 |
UpdateUlRlcBufferInfo (uldci.m_rnti, uldci.m_tbSize); |
7886 | 768 |
uldci.m_ndi = 1; |
769 |
uldci.m_cceIndex = 0; |
|
770 |
uldci.m_aggrLevel = 1; |
|
771 |
uldci.m_ueTxAntennaSelection = 3; // antenna selection OFF |
|
772 |
uldci.m_hopping = false; |
|
773 |
uldci.m_n2Dmrs = 0; |
|
774 |
uldci.m_tpc = 0; // no power control |
|
775 |
uldci.m_cqiRequest = false; // only period CQI at this stage |
|
776 |
uldci.m_ulIndex = 0; // TDD parameter |
|
777 |
uldci.m_dai = 1; // TDD parameter |
|
778 |
uldci.m_freqHopping = 0; |
|
779 |
uldci.m_pdcchPowerOffset = 0; // not used |
|
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
780 |
ret.m_dciList.push_back (uldci); |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
781 |
it++; |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
782 |
if (it == m_ceBsrRxed.end ()) |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
783 |
{ |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
784 |
// restart from the first |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
785 |
it = m_ceBsrRxed.begin (); |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
786 |
} |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
787 |
if (rbAllocated == m_cschedCellConfig.m_ulBandwidth) |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
788 |
{ |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
789 |
// Stop allocation: no more PRBs |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
790 |
m_nextRntiUl = (*it).first; |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
791 |
break; |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
792 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
793 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
794 |
while ((*it).first != m_nextRntiUl); |
7948 | 795 |
m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params.m_sfnSf, rbgAllocationMap)); |
7886 | 796 |
m_schedSapUser->SchedUlConfigInd (ret); |
797 |
return; |
|
798 |
} |
|
799 |
||
800 |
void |
|
801 |
RrFfMacScheduler::DoSchedUlNoiseInterferenceReq (const struct FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters& params) |
|
802 |
{ |
|
803 |
NS_LOG_FUNCTION (this); |
|
804 |
// TODO: Implementation of the API |
|
805 |
return; |
|
806 |
} |
|
807 |
||
808 |
void |
|
809 |
RrFfMacScheduler::DoSchedUlSrInfoReq (const struct FfMacSchedSapProvider::SchedUlSrInfoReqParameters& params) |
|
810 |
{ |
|
811 |
NS_LOG_FUNCTION (this); |
|
812 |
// TODO: Implementation of the API |
|
813 |
return; |
|
814 |
} |
|
815 |
||
816 |
void |
|
817 |
RrFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters& params) |
|
818 |
{ |
|
819 |
NS_LOG_FUNCTION (this); |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
820 |
|
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
821 |
std::map <uint16_t,uint32_t>::iterator it; |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
822 |
|
7886 | 823 |
for (unsigned int i = 0; i < params.m_macCeList.size (); i++) |
824 |
{ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
825 |
if ( params.m_macCeList.at (i).m_macCeType == MacCeListElement_s::BSR ) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
826 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
827 |
// buffer status report |
8887
90cbd09c8ff6
fixed bug with multiple LCs in UL BSR
Nicola Baldo <nbaldo@cttc.es>
parents:
8859
diff
changeset
|
828 |
// note that we only consider LCG 0, the other three LCGs are neglected |
90cbd09c8ff6
fixed bug with multiple LCs in UL BSR
Nicola Baldo <nbaldo@cttc.es>
parents:
8859
diff
changeset
|
829 |
// this is consistent with the assumption in LteUeMac that the first LCG gathers all LCs |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
830 |
uint16_t rnti = params.m_macCeList.at (i).m_rnti; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
831 |
it = m_ceBsrRxed.find (rnti); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
832 |
if (it == m_ceBsrRxed.end ()) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
833 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
834 |
// create the new entry |
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
835 |
uint8_t bsrId = params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (0); |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
836 |
int buffer = BufferSizeLevelBsr::BsrId2BufferSize (bsrId); |
8887
90cbd09c8ff6
fixed bug with multiple LCs in UL BSR
Nicola Baldo <nbaldo@cttc.es>
parents:
8859
diff
changeset
|
837 |
m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer)); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
838 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
839 |
else |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
840 |
{ |
8887
90cbd09c8ff6
fixed bug with multiple LCs in UL BSR
Nicola Baldo <nbaldo@cttc.es>
parents:
8859
diff
changeset
|
841 |
// update the buffer size value |
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
842 |
(*it).second = BufferSizeLevelBsr::BsrId2BufferSize (params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (0)); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
843 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
844 |
} |
7886 | 845 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
846 |
|
7886 | 847 |
return; |
848 |
} |
|
849 |
||
850 |
void |
|
851 |
RrFfMacScheduler::DoSchedUlCqiInfoReq (const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters& params) |
|
852 |
{ |
|
853 |
NS_LOG_FUNCTION (this); |
|
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
854 |
NS_LOG_DEBUG (this << " RX SFNID " << params.m_sfnSf); |
8321
c674feef9d5f
Bug-fix UL Allocation Map storing for UL-CQI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8320
diff
changeset
|
855 |
// NS_LOG_DEBUG (this << " Actual sfn " << frameNo << " sbfn " << subframeNo << " sfnSf " << sfnSf); |
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
856 |
switch (m_ulCqiFilter) |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
857 |
{ |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
858 |
case FfMacScheduler::SRS_UL_CQI: |
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
859 |
{ |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
860 |
// filter all the CQIs that are not SRS based |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
861 |
if (params.m_ulCqi.m_type!=UlCqi_s::SRS) |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
862 |
{ |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
863 |
return; |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
864 |
} |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
865 |
} |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
866 |
break; |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
867 |
case FfMacScheduler::PUSCH_UL_CQI: |
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
868 |
{ |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
869 |
// filter all the CQIs that are not SRS based |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
870 |
if (params.m_ulCqi.m_type!=UlCqi_s::PUSCH) |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
871 |
{ |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
872 |
return; |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
873 |
} |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
874 |
} |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
875 |
case FfMacScheduler::ALL_UL_CQI: |
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
876 |
break; |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
877 |
|
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
878 |
default: |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
879 |
NS_FATAL_ERROR ("Unknown UL CQI type"); |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
880 |
} |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
881 |
switch (params.m_ulCqi.m_type) |
7948 | 882 |
{ |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
883 |
case UlCqi_s::PUSCH: |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
884 |
{ |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
885 |
std::map <uint16_t, std::vector <uint16_t> >::iterator itMap; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
886 |
std::map <uint16_t, std::vector <double> >::iterator itCqi; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
887 |
itMap = m_allocationMaps.find (params.m_sfnSf); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
888 |
if (itMap == m_allocationMaps.end ()) |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
889 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
890 |
NS_LOG_DEBUG (this << " Does not find info on allocation, size : " << m_allocationMaps.size ()); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
891 |
return; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
892 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
893 |
for (uint32_t i = 0; i < (*itMap).second.size (); i++) |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
894 |
{ |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
895 |
// convert from fixed point notation Sxxxxxxxxxxx.xxx to double |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
896 |
// NS_LOG_INFO (this << " i " << i << " size " << params.m_ulCqi.m_sinr.size () << " mapSIze " << (*itMap).second.size ()); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
897 |
double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (i)); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
898 |
//NS_LOG_DEBUG (this << " UE " << (*itMap).second.at (i) << " SINRfp " << params.m_ulCqi.m_sinr.at (i) << " sinrdb " << sinr); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
899 |
itCqi = m_ueCqi.find ((*itMap).second.at (i)); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
900 |
if (itCqi == m_ueCqi.end ()) |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
901 |
{ |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
902 |
// create a new entry |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
903 |
std::vector <double> newCqi; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
904 |
for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++) |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
905 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
906 |
if (i == j) |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
907 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
908 |
newCqi.push_back (sinr); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
909 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
910 |
else |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
911 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
912 |
// initialize with NO_SINR value. |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
913 |
newCqi.push_back (30.0); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
914 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
915 |
|
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
916 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
917 |
m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > ((*itMap).second.at (i), newCqi)); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
918 |
// generate correspondent timer |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
919 |
m_ueCqiTimers.insert (std::pair <uint16_t, uint32_t > ((*itMap).second.at (i), m_cqiTimersThreshold)); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
920 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
921 |
else |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
922 |
{ |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
923 |
// update the value |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
924 |
(*itCqi).second.at (i) = sinr; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
925 |
// update correspondent timer |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
926 |
std::map <uint16_t, uint32_t>::iterator itTimers; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
927 |
itTimers = m_ueCqiTimers.find ((*itMap).second.at (i)); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
928 |
(*itTimers).second = m_cqiTimersThreshold; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
929 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
930 |
} |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
931 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
932 |
} |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
933 |
// remove obsolete info on allocation |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
934 |
m_allocationMaps.erase (itMap); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
935 |
} |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
936 |
break; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
937 |
case UlCqi_s::SRS: |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
938 |
{ |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
939 |
// get the RNTI from vendor specific parameters |
9059
47aa9789ed30
fix maybe-uninitialized warnings
Tom Henderson <tomh@tomh.org>
parents:
9047
diff
changeset
|
940 |
uint16_t rnti = 0; |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
941 |
NS_ASSERT (params.m_vendorSpecificList.size () > 0); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
942 |
for (uint16_t i = 0; i < params.m_vendorSpecificList.size (); i++) |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
943 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
944 |
if (params.m_vendorSpecificList.at (i).m_type == SRS_CQI_RNTI_VSP) |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
945 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
946 |
Ptr<SrsCqiRntiVsp> vsp = DynamicCast<SrsCqiRntiVsp> (params.m_vendorSpecificList.at (i).m_value); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
947 |
rnti = vsp->GetRnti (); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
948 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
949 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
950 |
std::map <uint16_t, std::vector <double> >::iterator itCqi; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
951 |
itCqi = m_ueCqi.find (rnti); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
952 |
if (itCqi == m_ueCqi.end ()) |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
953 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
954 |
// create a new entry |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
955 |
std::vector <double> newCqi; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
956 |
for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++) |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
957 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
958 |
double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (j)); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
959 |
newCqi.push_back (sinr); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
960 |
NS_LOG_DEBUG (this << " RNTI " << rnti << " new SRS-CQI for RB " << j << " value " << sinr); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
961 |
|
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
962 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
963 |
m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > (rnti, newCqi)); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
964 |
// generate correspondent timer |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
965 |
m_ueCqiTimers.insert (std::pair <uint16_t, uint32_t > (rnti, m_cqiTimersThreshold)); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
966 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
967 |
else |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
968 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
969 |
// update the values |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
970 |
for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++) |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
971 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
972 |
double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (j)); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
973 |
(*itCqi).second.at (j) = sinr; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
974 |
NS_LOG_DEBUG (this << " RNTI " << rnti << " update SRS-CQI for RB " << j << " value " << sinr); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
975 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
976 |
// update correspondent timer |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
977 |
std::map <uint16_t, uint32_t>::iterator itTimers; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
978 |
itTimers = m_ueCqiTimers.find (rnti); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
979 |
(*itTimers).second = m_cqiTimersThreshold; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
980 |
|
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
981 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
982 |
|
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
983 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
984 |
} |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
985 |
break; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
986 |
case UlCqi_s::PUCCH_1: |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
987 |
case UlCqi_s::PUCCH_2: |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
988 |
case UlCqi_s::PRACH: |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
989 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
990 |
NS_FATAL_ERROR ("PfFfMacScheduler supports only PUSCH and SRS UL-CQIs"); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
991 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
992 |
break; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
993 |
default: |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
994 |
NS_FATAL_ERROR ("Unknown type of UL-CQI"); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
995 |
} |
7886 | 996 |
return; |
997 |
} |
|
998 |
||
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
999 |
|
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1000 |
void |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1001 |
RrFfMacScheduler::RefreshDlCqiMaps(void) |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1002 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1003 |
NS_LOG_FUNCTION (this << m_p10CqiTimers.size ()); |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1004 |
// refresh DL CQI P01 Map |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1005 |
std::map <uint16_t,uint32_t>::iterator itP10 = m_p10CqiTimers.begin (); |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1006 |
while (itP10!=m_p10CqiTimers.end ()) |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1007 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1008 |
NS_LOG_INFO (this << " P10-CQI for user " << (*itP10).first << " is " << (uint32_t)(*itP10).second << " thr " << (uint32_t)m_cqiTimersThreshold); |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1009 |
if ((*itP10).second == 0) |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1010 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1011 |
// delete correspondent entries |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1012 |
std::map <uint16_t,uint8_t>::iterator itMap = m_p10CqiRxed.find ((*itP10).first); |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1013 |
NS_ASSERT_MSG (itMap != m_p10CqiRxed.end (), " Does not find CQI report for user " << (*itP10).first); |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1014 |
NS_LOG_INFO (this << " P10-CQI exired for user " << (*itP10).first); |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1015 |
m_p10CqiRxed.erase (itMap); |
8584
188a9d439fd8
Soved valgrind error on CQI updates in RR and PF schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1016 |
std::map <uint16_t,uint32_t>::iterator temp = itP10; |
188a9d439fd8
Soved valgrind error on CQI updates in RR and PF schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1017 |
itP10++; |
188a9d439fd8
Soved valgrind error on CQI updates in RR and PF schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1018 |
m_p10CqiTimers.erase (temp); |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1019 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1020 |
else |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1021 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1022 |
(*itP10).second--; |
8584
188a9d439fd8
Soved valgrind error on CQI updates in RR and PF schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1023 |
itP10++; |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1024 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1025 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1026 |
|
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1027 |
return; |
7886 | 1028 |
} |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1029 |
|
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1030 |
|
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1031 |
void |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1032 |
RrFfMacScheduler::RefreshUlCqiMaps(void) |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1033 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1034 |
// refresh UL CQI Map |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1035 |
std::map <uint16_t,uint32_t>::iterator itUl = m_ueCqiTimers.begin (); |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1036 |
while (itUl!=m_ueCqiTimers.end ()) |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1037 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1038 |
NS_LOG_INFO (this << " UL-CQI for user " << (*itUl).first << " is " << (uint32_t)(*itUl).second << " thr " << (uint32_t)m_cqiTimersThreshold); |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1039 |
if ((*itUl).second == 0) |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1040 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1041 |
// delete correspondent entries |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1042 |
std::map <uint16_t, std::vector <double> >::iterator itMap = m_ueCqi.find ((*itUl).first); |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1043 |
NS_ASSERT_MSG (itMap != m_ueCqi.end (), " Does not find CQI report for user " << (*itUl).first); |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1044 |
NS_LOG_INFO (this << " UL-CQI exired for user " << (*itUl).first); |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1045 |
(*itMap).second.clear (); |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1046 |
m_ueCqi.erase (itMap); |
8584
188a9d439fd8
Soved valgrind error on CQI updates in RR and PF schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1047 |
std::map <uint16_t,uint32_t>::iterator temp = itUl; |
188a9d439fd8
Soved valgrind error on CQI updates in RR and PF schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1048 |
itUl++; |
188a9d439fd8
Soved valgrind error on CQI updates in RR and PF schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1049 |
m_ueCqiTimers.erase (temp); |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1050 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1051 |
else |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1052 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1053 |
(*itUl).second--; |
8584
188a9d439fd8
Soved valgrind error on CQI updates in RR and PF schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1054 |
itUl++; |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1055 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1056 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1057 |
|
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1058 |
return; |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1059 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1060 |
|
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1061 |
void |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1062 |
RrFfMacScheduler::UpdateDlRlcBufferInfo (uint16_t rnti, uint8_t lcid, uint16_t size) |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1063 |
{ |
8858
6336a6eabf99
Update Ul and Dl RlcBufferInfo methods of RR and PF scheduler for considering the minimum RLC overhead when decrementing queues
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
1064 |
size = size - 2; // remove the minimum RLC overhead |
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1065 |
std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1066 |
for (it = m_rlcBufferReq.begin (); it != m_rlcBufferReq.end (); it++) |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1067 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1068 |
if (((*it).m_rnti == rnti) && ((*it).m_logicalChannelIdentity)) |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1069 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1070 |
// NS_LOG_DEBUG (this << " UE " << rnti << " LC " << (uint16_t)lcid << " txqueue " << (*it).m_rlcTransmissionQueueSize << " retxqueue " << (*it).m_rlcRetransmissionQueueSize << " status " << (*it).m_rlcStatusPduSize << " decrease " << size); |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1071 |
// Update queues: RLC tx order Status, ReTx, Tx |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1072 |
// Update status queue |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1073 |
if ((*it).m_rlcStatusPduSize <= size) |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1074 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1075 |
size -= (*it).m_rlcStatusPduSize; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1076 |
(*it).m_rlcStatusPduSize = 0; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1077 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1078 |
else |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1079 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1080 |
(*it).m_rlcStatusPduSize -= size; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1081 |
return; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1082 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1083 |
// update retransmission queue |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1084 |
if ((*it).m_rlcRetransmissionQueueSize <= size) |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1085 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1086 |
size -= (*it).m_rlcRetransmissionQueueSize; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1087 |
(*it).m_rlcRetransmissionQueueSize = 0; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1088 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1089 |
else |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1090 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1091 |
(*it).m_rlcRetransmissionQueueSize -= size; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1092 |
return; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1093 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1094 |
// update transmission queue |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1095 |
if ((*it).m_rlcTransmissionQueueSize <= size) |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1096 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1097 |
size -= (*it).m_rlcTransmissionQueueSize; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1098 |
(*it).m_rlcTransmissionQueueSize = 0; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1099 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1100 |
else |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1101 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1102 |
(*it).m_rlcTransmissionQueueSize -= size; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1103 |
return; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1104 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1105 |
return; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1106 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1107 |
} |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1108 |
} |
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1109 |
|
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1110 |
void |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1111 |
RrFfMacScheduler::UpdateUlRlcBufferInfo (uint16_t rnti, uint16_t size) |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1112 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1113 |
|
8858
6336a6eabf99
Update Ul and Dl RlcBufferInfo methods of RR and PF scheduler for considering the minimum RLC overhead when decrementing queues
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
1114 |
size = size - 2; // remove the minimum RLC overhead |
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1115 |
std::map <uint16_t,uint32_t>::iterator it = m_ceBsrRxed.find (rnti); |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1116 |
if (it!=m_ceBsrRxed.end ()) |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1117 |
{ |
8497
b06cd67bc6ba
Update RR and PF scheduler for updating BSR queues avoiding overflows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
1118 |
// NS_LOG_DEBUG (this << " Update RLC BSR UE " << rnti << " size " << size << " BSR " << (*it).second); |
b06cd67bc6ba
Update RR and PF scheduler for updating BSR queues avoiding overflows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
1119 |
if ((*it).second >= size) |
b06cd67bc6ba
Update RR and PF scheduler for updating BSR queues avoiding overflows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
1120 |
{ |
b06cd67bc6ba
Update RR and PF scheduler for updating BSR queues avoiding overflows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
1121 |
(*it).second -= size; |
b06cd67bc6ba
Update RR and PF scheduler for updating BSR queues avoiding overflows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
1122 |
} |
b06cd67bc6ba
Update RR and PF scheduler for updating BSR queues avoiding overflows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
1123 |
else |
b06cd67bc6ba
Update RR and PF scheduler for updating BSR queues avoiding overflows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
1124 |
{ |
b06cd67bc6ba
Update RR and PF scheduler for updating BSR queues avoiding overflows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
1125 |
(*it).second = 0; |
b06cd67bc6ba
Update RR and PF scheduler for updating BSR queues avoiding overflows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
1126 |
} |
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1127 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1128 |
else |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1129 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1130 |
NS_LOG_ERROR (this << " Does not find BSR report info of UE " << rnti); |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1131 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1132 |
|
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1133 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1134 |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1135 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1136 |
void |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1137 |
RrFfMacScheduler::TransmissionModeConfigurationUpdate (uint16_t rnti, uint8_t txMode) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1138 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1139 |
NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1140 |
FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1141 |
params.m_rnti = rnti; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1142 |
params.m_transmissionMode = txMode; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1143 |
m_cschedSapUser->CschedUeConfigUpdateInd (params); |
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1144 |
} |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1145 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1146 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1147 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1148 |
} |