author | mmiozzo |
Mon, 05 Nov 2012 17:05:30 +0100 | |
changeset 9368 | f5eaecb7acc2 |
parent 9300 | 44803c2ce8d1 |
parent 9367 | b4fcfc26791f |
child 9369 | eac9f11f4ced |
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 |
||
8812 | 21 |
#ifdef __FreeBSD__ |
22 |
#define log2(x) (log(x) / M_LN2) |
|
23 |
#endif /* __FreeBSD__ */ |
|
24 |
||
7886 | 25 |
#include <ns3/log.h> |
26 |
#include <ns3/pointer.h> |
|
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
27 |
#include <set> |
7886 | 28 |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
29 |
#include <ns3/lte-amc.h> |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
30 |
#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
|
31 |
#include <ns3/simulator.h> |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
32 |
#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
|
33 |
#include <ns3/lte-vendor-specific-parameters.h> |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
34 |
#include <ns3/boolean.h> |
7886 | 35 |
|
7906
d58de34e41d3
MAC, RRC and Scheduler created by LenaHelper
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7897
diff
changeset
|
36 |
NS_LOG_COMPONENT_DEFINE ("RrFfMacScheduler"); |
7886 | 37 |
|
38 |
namespace ns3 { |
|
39 |
||
40 |
int Type0AllocationRbg[4] = { |
|
41 |
10, // RGB size 1 |
|
42 |
26, // RGB size 2 |
|
43 |
63, // RGB size 3 |
|
44 |
110 // RGB size 4 |
|
45 |
}; // see table 7.1.6.1-1 of 36.213 |
|
46 |
||
47 |
||
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
48 |
|
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
49 |
|
7906
d58de34e41d3
MAC, RRC and Scheduler created by LenaHelper
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7897
diff
changeset
|
50 |
NS_OBJECT_ENSURE_REGISTERED (RrFfMacScheduler); |
7886 | 51 |
|
52 |
||
7888 | 53 |
class RrSchedulerMemberCschedSapProvider : public FfMacCschedSapProvider |
7886 | 54 |
{ |
55 |
public: |
|
7888 | 56 |
RrSchedulerMemberCschedSapProvider (RrFfMacScheduler* scheduler); |
7886 | 57 |
|
58 |
// inherited from FfMacCschedSapProvider |
|
59 |
virtual void CschedCellConfigReq (const struct CschedCellConfigReqParameters& params); |
|
60 |
virtual void CschedUeConfigReq (const struct CschedUeConfigReqParameters& params); |
|
61 |
virtual void CschedLcConfigReq (const struct CschedLcConfigReqParameters& params); |
|
62 |
virtual void CschedLcReleaseReq (const struct CschedLcReleaseReqParameters& params); |
|
63 |
virtual void CschedUeReleaseReq (const struct CschedUeReleaseReqParameters& params); |
|
64 |
||
65 |
private: |
|
7888 | 66 |
RrSchedulerMemberCschedSapProvider (); |
7886 | 67 |
RrFfMacScheduler* m_scheduler; |
68 |
}; |
|
69 |
||
7888 | 70 |
RrSchedulerMemberCschedSapProvider::RrSchedulerMemberCschedSapProvider () |
7886 | 71 |
{ |
72 |
} |
|
73 |
||
7888 | 74 |
RrSchedulerMemberCschedSapProvider::RrSchedulerMemberCschedSapProvider (RrFfMacScheduler* scheduler) : m_scheduler (scheduler) |
7886 | 75 |
{ |
76 |
} |
|
77 |
||
78 |
||
79 |
void |
|
7888 | 80 |
RrSchedulerMemberCschedSapProvider::CschedCellConfigReq (const struct CschedCellConfigReqParameters& params) |
7886 | 81 |
{ |
82 |
m_scheduler->DoCschedCellConfigReq (params); |
|
83 |
} |
|
84 |
||
85 |
void |
|
7888 | 86 |
RrSchedulerMemberCschedSapProvider::CschedUeConfigReq (const struct CschedUeConfigReqParameters& params) |
7886 | 87 |
{ |
88 |
m_scheduler->DoCschedUeConfigReq (params); |
|
89 |
} |
|
90 |
||
91 |
||
92 |
void |
|
7888 | 93 |
RrSchedulerMemberCschedSapProvider::CschedLcConfigReq (const struct CschedLcConfigReqParameters& params) |
7886 | 94 |
{ |
95 |
m_scheduler->DoCschedLcConfigReq (params); |
|
96 |
} |
|
97 |
||
98 |
void |
|
7888 | 99 |
RrSchedulerMemberCschedSapProvider::CschedLcReleaseReq (const struct CschedLcReleaseReqParameters& params) |
7886 | 100 |
{ |
101 |
m_scheduler->DoCschedLcReleaseReq (params); |
|
102 |
} |
|
103 |
||
104 |
void |
|
7888 | 105 |
RrSchedulerMemberCschedSapProvider::CschedUeReleaseReq (const struct CschedUeReleaseReqParameters& params) |
7886 | 106 |
{ |
107 |
m_scheduler->DoCschedUeReleaseReq (params); |
|
108 |
} |
|
109 |
||
110 |
||
111 |
||
112 |
||
7888 | 113 |
class RrSchedulerMemberSchedSapProvider : public FfMacSchedSapProvider |
7886 | 114 |
{ |
115 |
public: |
|
7888 | 116 |
RrSchedulerMemberSchedSapProvider (RrFfMacScheduler* scheduler); |
7886 | 117 |
|
118 |
// inherited from FfMacSchedSapProvider |
|
119 |
virtual void SchedDlRlcBufferReq (const struct SchedDlRlcBufferReqParameters& params); |
|
120 |
virtual void SchedDlPagingBufferReq (const struct SchedDlPagingBufferReqParameters& params); |
|
121 |
virtual void SchedDlMacBufferReq (const struct SchedDlMacBufferReqParameters& params); |
|
122 |
virtual void SchedDlTriggerReq (const struct SchedDlTriggerReqParameters& params); |
|
123 |
virtual void SchedDlRachInfoReq (const struct SchedDlRachInfoReqParameters& params); |
|
124 |
virtual void SchedDlCqiInfoReq (const struct SchedDlCqiInfoReqParameters& params); |
|
125 |
virtual void SchedUlTriggerReq (const struct SchedUlTriggerReqParameters& params); |
|
126 |
virtual void SchedUlNoiseInterferenceReq (const struct SchedUlNoiseInterferenceReqParameters& params); |
|
127 |
virtual void SchedUlSrInfoReq (const struct SchedUlSrInfoReqParameters& params); |
|
128 |
virtual void SchedUlMacCtrlInfoReq (const struct SchedUlMacCtrlInfoReqParameters& params); |
|
129 |
virtual void SchedUlCqiInfoReq (const struct SchedUlCqiInfoReqParameters& params); |
|
130 |
||
131 |
||
132 |
private: |
|
7888 | 133 |
RrSchedulerMemberSchedSapProvider (); |
7886 | 134 |
RrFfMacScheduler* m_scheduler; |
135 |
}; |
|
136 |
||
137 |
||
138 |
||
7888 | 139 |
RrSchedulerMemberSchedSapProvider::RrSchedulerMemberSchedSapProvider () |
7886 | 140 |
{ |
141 |
} |
|
142 |
||
143 |
||
7888 | 144 |
RrSchedulerMemberSchedSapProvider::RrSchedulerMemberSchedSapProvider (RrFfMacScheduler* scheduler) |
7886 | 145 |
: m_scheduler (scheduler) |
146 |
{ |
|
147 |
} |
|
148 |
||
149 |
void |
|
7888 | 150 |
RrSchedulerMemberSchedSapProvider::SchedDlRlcBufferReq (const struct SchedDlRlcBufferReqParameters& params) |
7886 | 151 |
{ |
152 |
m_scheduler->DoSchedDlRlcBufferReq (params); |
|
153 |
} |
|
154 |
||
155 |
void |
|
7888 | 156 |
RrSchedulerMemberSchedSapProvider::SchedDlPagingBufferReq (const struct SchedDlPagingBufferReqParameters& params) |
7886 | 157 |
{ |
158 |
m_scheduler->DoSchedDlPagingBufferReq (params); |
|
159 |
} |
|
160 |
||
161 |
void |
|
7888 | 162 |
RrSchedulerMemberSchedSapProvider::SchedDlMacBufferReq (const struct SchedDlMacBufferReqParameters& params) |
7886 | 163 |
{ |
164 |
m_scheduler->DoSchedDlMacBufferReq (params); |
|
165 |
} |
|
166 |
||
167 |
void |
|
7888 | 168 |
RrSchedulerMemberSchedSapProvider::SchedDlTriggerReq (const struct SchedDlTriggerReqParameters& params) |
7886 | 169 |
{ |
170 |
m_scheduler->DoSchedDlTriggerReq (params); |
|
171 |
} |
|
172 |
||
173 |
void |
|
7888 | 174 |
RrSchedulerMemberSchedSapProvider::SchedDlRachInfoReq (const struct SchedDlRachInfoReqParameters& params) |
7886 | 175 |
{ |
176 |
m_scheduler->DoSchedDlRachInfoReq (params); |
|
177 |
} |
|
178 |
||
179 |
void |
|
7888 | 180 |
RrSchedulerMemberSchedSapProvider::SchedDlCqiInfoReq (const struct SchedDlCqiInfoReqParameters& params) |
7886 | 181 |
{ |
182 |
m_scheduler->DoSchedDlCqiInfoReq (params); |
|
183 |
} |
|
184 |
||
185 |
void |
|
7888 | 186 |
RrSchedulerMemberSchedSapProvider::SchedUlTriggerReq (const struct SchedUlTriggerReqParameters& params) |
7886 | 187 |
{ |
188 |
m_scheduler->DoSchedUlTriggerReq (params); |
|
189 |
} |
|
190 |
||
191 |
void |
|
7888 | 192 |
RrSchedulerMemberSchedSapProvider::SchedUlNoiseInterferenceReq (const struct SchedUlNoiseInterferenceReqParameters& params) |
7886 | 193 |
{ |
194 |
m_scheduler->DoSchedUlNoiseInterferenceReq (params); |
|
195 |
} |
|
196 |
||
197 |
void |
|
7888 | 198 |
RrSchedulerMemberSchedSapProvider::SchedUlSrInfoReq (const struct SchedUlSrInfoReqParameters& params) |
7886 | 199 |
{ |
200 |
m_scheduler->DoSchedUlSrInfoReq (params); |
|
201 |
} |
|
202 |
||
203 |
void |
|
7888 | 204 |
RrSchedulerMemberSchedSapProvider::SchedUlMacCtrlInfoReq (const struct SchedUlMacCtrlInfoReqParameters& params) |
7886 | 205 |
{ |
206 |
m_scheduler->DoSchedUlMacCtrlInfoReq (params); |
|
207 |
} |
|
208 |
||
209 |
void |
|
7888 | 210 |
RrSchedulerMemberSchedSapProvider::SchedUlCqiInfoReq (const struct SchedUlCqiInfoReqParameters& params) |
7886 | 211 |
{ |
212 |
m_scheduler->DoSchedUlCqiInfoReq (params); |
|
213 |
} |
|
214 |
||
215 |
||
216 |
||
217 |
||
218 |
||
219 |
RrFfMacScheduler::RrFfMacScheduler () |
|
220 |
: m_cschedSapUser (0), |
|
7948 | 221 |
m_schedSapUser (0), |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
222 |
m_nextRntiDl (0), |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
223 |
m_nextRntiUl (0) |
7886 | 224 |
{ |
8525
23d9706114f8
Change LteAmc* to Ptr<LteAmc> in RR scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8516
diff
changeset
|
225 |
m_amc = CreateObject <LteAmc> (); |
7888 | 226 |
m_cschedSapProvider = new RrSchedulerMemberCschedSapProvider (this); |
227 |
m_schedSapProvider = new RrSchedulerMemberSchedSapProvider (this); |
|
7886 | 228 |
} |
229 |
||
230 |
RrFfMacScheduler::~RrFfMacScheduler () |
|
231 |
{ |
|
232 |
NS_LOG_FUNCTION (this); |
|
233 |
} |
|
234 |
||
235 |
void |
|
236 |
RrFfMacScheduler::DoDispose () |
|
237 |
{ |
|
238 |
NS_LOG_FUNCTION (this); |
|
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
239 |
m_dlHarqProcessesDciBuffer.clear (); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
240 |
m_dlHarqProcessesRlcPduListBuffer.clear (); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
241 |
m_dlInfoListBuffered.clear (); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
242 |
m_ulHarqCurrentProcessId.clear (); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
243 |
m_ulHarqProcessesStatus.clear (); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
244 |
m_ulHarqProcessesDciBuffer.clear (); |
7886 | 245 |
delete m_cschedSapProvider; |
246 |
delete m_schedSapProvider; |
|
247 |
} |
|
248 |
||
249 |
TypeId |
|
250 |
RrFfMacScheduler::GetTypeId (void) |
|
251 |
{ |
|
7983
b91d5a39aabc
scheduler and propagation model configurable through ConfigStore
Nicola Baldo <nbaldo@cttc.es>
parents:
7977
diff
changeset
|
252 |
static TypeId tid = TypeId ("ns3::RrFfMacScheduler") |
7886 | 253 |
.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
|
254 |
.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
|
255 |
.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
|
256 |
"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
|
257 |
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
|
258 |
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
|
259 |
MakeUintegerChecker<uint32_t> ()) |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
260 |
.AddAttribute ("HarqEnabled", |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
261 |
"Activate/Deactivate the HARQ [by default is active].", |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
262 |
BooleanValue (true), |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
263 |
MakeBooleanAccessor (&RrFfMacScheduler::m_harqOn), |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
264 |
MakeBooleanChecker ()) |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
265 |
; |
7886 | 266 |
return tid; |
267 |
} |
|
268 |
||
269 |
||
270 |
||
271 |
void |
|
272 |
RrFfMacScheduler::SetFfMacCschedSapUser (FfMacCschedSapUser* s) |
|
273 |
{ |
|
274 |
m_cschedSapUser = s; |
|
275 |
} |
|
276 |
||
277 |
void |
|
278 |
RrFfMacScheduler::SetFfMacSchedSapUser (FfMacSchedSapUser* s) |
|
279 |
{ |
|
280 |
m_schedSapUser = s; |
|
281 |
} |
|
282 |
||
283 |
FfMacCschedSapProvider* |
|
284 |
RrFfMacScheduler::GetFfMacCschedSapProvider () |
|
285 |
{ |
|
286 |
return m_cschedSapProvider; |
|
287 |
} |
|
288 |
||
289 |
FfMacSchedSapProvider* |
|
290 |
RrFfMacScheduler::GetFfMacSchedSapProvider () |
|
291 |
{ |
|
292 |
return m_schedSapProvider; |
|
293 |
} |
|
294 |
||
295 |
void |
|
296 |
RrFfMacScheduler::DoCschedCellConfigReq (const struct FfMacCschedSapProvider::CschedCellConfigReqParameters& params) |
|
297 |
{ |
|
298 |
NS_LOG_FUNCTION (this); |
|
299 |
// Read the subset of parameters used |
|
300 |
m_cschedCellConfig = params; |
|
301 |
FfMacCschedSapUser::CschedUeConfigCnfParameters cnf; |
|
302 |
cnf.m_result = SUCCESS; |
|
303 |
m_cschedSapUser->CschedUeConfigCnf (cnf); |
|
304 |
return; |
|
305 |
} |
|
306 |
||
307 |
void |
|
308 |
RrFfMacScheduler::DoCschedUeConfigReq (const struct FfMacCschedSapProvider::CschedUeConfigReqParameters& params) |
|
309 |
{ |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
310 |
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
|
311 |
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
|
312 |
if (it==m_uesTxMode.end ()) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
313 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
314 |
m_uesTxMode.insert (std::pair <uint16_t, double> (params.m_rnti, params.m_transmissionMode)); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
315 |
// generate HARQ buffers |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
316 |
m_dlHarqCurrentProcessId.insert (std::pair <uint16_t,uint8_t > (params.m_rnti, 0)); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
317 |
DlHarqProcessesStatus_t dlHarqPrcStatus; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
318 |
dlHarqPrcStatus.resize (8,0); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
319 |
m_dlHarqProcessesStatus.insert (std::pair <uint16_t, DlHarqProcessesStatus_t> (params.m_rnti, dlHarqPrcStatus)); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
320 |
DlHarqProcessesDciBuffer_t dlHarqdci; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
321 |
dlHarqdci.resize (8); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
322 |
m_dlHarqProcessesDciBuffer.insert (std::pair <uint16_t, DlHarqProcessesDciBuffer_t> (params.m_rnti, dlHarqdci)); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
323 |
DlHarqRlcPduListBuffer_t dlHarqRlcPdu; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
324 |
dlHarqRlcPdu.resize (2); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
325 |
dlHarqRlcPdu.at (0).resize (8); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
326 |
dlHarqRlcPdu.at (1).resize (8); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
327 |
m_dlHarqProcessesRlcPduListBuffer.insert (std::pair <uint16_t, DlHarqRlcPduListBuffer_t> (params.m_rnti, dlHarqRlcPdu)); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
328 |
m_ulHarqCurrentProcessId.insert (std::pair <uint16_t,uint8_t > (params.m_rnti, 0)); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
329 |
UlHarqProcessesStatus_t ulHarqPrcStatus; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
330 |
ulHarqPrcStatus.resize (8,0); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
331 |
m_ulHarqProcessesStatus.insert (std::pair <uint16_t, UlHarqProcessesStatus_t> (params.m_rnti, ulHarqPrcStatus)); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
332 |
UlHarqProcessesDciBuffer_t ulHarqdci; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
333 |
ulHarqdci.resize (8); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
334 |
m_ulHarqProcessesDciBuffer.insert (std::pair <uint16_t, UlHarqProcessesDciBuffer_t> (params.m_rnti, ulHarqdci)); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
335 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
336 |
else |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
337 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
338 |
(*it).second = params.m_transmissionMode; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
339 |
} |
7886 | 340 |
return; |
341 |
} |
|
342 |
||
343 |
void |
|
344 |
RrFfMacScheduler::DoCschedLcConfigReq (const struct FfMacCschedSapProvider::CschedLcConfigReqParameters& params) |
|
345 |
{ |
|
346 |
NS_LOG_FUNCTION (this); |
|
347 |
// Not used at this stage |
|
348 |
return; |
|
349 |
} |
|
350 |
||
351 |
void |
|
352 |
RrFfMacScheduler::DoCschedLcReleaseReq (const struct FfMacCschedSapProvider::CschedLcReleaseReqParameters& params) |
|
353 |
{ |
|
354 |
NS_LOG_FUNCTION (this); |
|
355 |
// TODO: Implementation of the API |
|
356 |
return; |
|
357 |
} |
|
358 |
||
359 |
void |
|
360 |
RrFfMacScheduler::DoCschedUeReleaseReq (const struct FfMacCschedSapProvider::CschedUeReleaseReqParameters& params) |
|
361 |
{ |
|
362 |
NS_LOG_FUNCTION (this); |
|
363 |
// TODO: Implementation of the API |
|
364 |
return; |
|
365 |
} |
|
366 |
||
367 |
||
368 |
void |
|
369 |
RrFfMacScheduler::DoSchedDlRlcBufferReq (const struct FfMacSchedSapProvider::SchedDlRlcBufferReqParameters& params) |
|
370 |
{ |
|
371 |
NS_LOG_FUNCTION (this << params.m_rnti << (uint32_t) params.m_logicalChannelIdentity); |
|
372 |
// 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
|
373 |
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
|
374 |
bool newLc = true; |
8413
3387abb7a77c
better fix for RR scheduler buffer status report bug
Nicola Baldo <nbaldo@cttc.es>
parents:
8412
diff
changeset
|
375 |
while (it != m_rlcBufferReq.end ()) |
7886 | 376 |
{ |
377 |
// remove old entries of this UE-LC |
|
378 |
if (((*it).m_rnti == params.m_rnti)&&((*it).m_logicalChannelIdentity == params.m_logicalChannelIdentity)) |
|
379 |
{ |
|
8412
018034c10dec
fixed RR scheduler buffer status report bug
Nicola Baldo <nbaldo@cttc.es>
parents:
8342
diff
changeset
|
380 |
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
|
381 |
newLc = false; |
7886 | 382 |
} |
8413
3387abb7a77c
better fix for RR scheduler buffer status report bug
Nicola Baldo <nbaldo@cttc.es>
parents:
8412
diff
changeset
|
383 |
else |
3387abb7a77c
better fix for RR scheduler buffer status report bug
Nicola Baldo <nbaldo@cttc.es>
parents:
8412
diff
changeset
|
384 |
{ |
3387abb7a77c
better fix for RR scheduler buffer status report bug
Nicola Baldo <nbaldo@cttc.es>
parents:
8412
diff
changeset
|
385 |
++it; |
3387abb7a77c
better fix for RR scheduler buffer status report bug
Nicola Baldo <nbaldo@cttc.es>
parents:
8412
diff
changeset
|
386 |
} |
7886 | 387 |
} |
7972
6d24eb482e41
LENA-80 RrFfMacScheduler::DoSchedDlTriggerReq solved issue on nFlows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7966
diff
changeset
|
388 |
// add the new parameters |
7886 | 389 |
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
|
390 |
// 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
|
391 |
if (newLc == true) |
6d24eb482e41
LENA-80 RrFfMacScheduler::DoSchedDlTriggerReq solved issue on nFlows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7966
diff
changeset
|
392 |
{ |
6d24eb482e41
LENA-80 RrFfMacScheduler::DoSchedDlTriggerReq solved issue on nFlows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7966
diff
changeset
|
393 |
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
|
394 |
// 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
|
395 |
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
|
396 |
} |
7886 | 397 |
|
398 |
return; |
|
399 |
} |
|
400 |
||
401 |
void |
|
402 |
RrFfMacScheduler::DoSchedDlPagingBufferReq (const struct FfMacSchedSapProvider::SchedDlPagingBufferReqParameters& params) |
|
403 |
{ |
|
404 |
NS_LOG_FUNCTION (this); |
|
405 |
// TODO: Implementation of the API |
|
406 |
return; |
|
407 |
} |
|
408 |
||
409 |
void |
|
410 |
RrFfMacScheduler::DoSchedDlMacBufferReq (const struct FfMacSchedSapProvider::SchedDlMacBufferReqParameters& params) |
|
411 |
{ |
|
412 |
NS_LOG_FUNCTION (this); |
|
413 |
// TODO: Implementation of the API |
|
414 |
return; |
|
415 |
} |
|
416 |
||
417 |
int |
|
418 |
RrFfMacScheduler::GetRbgSize (int dlbandwidth) |
|
419 |
{ |
|
420 |
for (int i = 0; i < 4; i++) |
|
421 |
{ |
|
422 |
if (dlbandwidth < Type0AllocationRbg[i]) |
|
423 |
{ |
|
424 |
return (i + 1); |
|
425 |
} |
|
426 |
} |
|
427 |
||
428 |
return (-1); |
|
429 |
} |
|
430 |
||
8320
756e0218720d
Bug-fix in RrFfMacScheduler::DoSchedDlTriggerReq when scheduling multiple LCs per UE
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8319
diff
changeset
|
431 |
bool |
756e0218720d
Bug-fix in RrFfMacScheduler::DoSchedDlTriggerReq when scheduling multiple LCs per UE
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8319
diff
changeset
|
432 |
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
|
433 |
{ |
756e0218720d
Bug-fix in RrFfMacScheduler::DoSchedDlTriggerReq when scheduling multiple LCs per UE
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8319
diff
changeset
|
434 |
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
|
435 |
} |
756e0218720d
Bug-fix in RrFfMacScheduler::DoSchedDlTriggerReq when scheduling multiple LCs per UE
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8319
diff
changeset
|
436 |
|
7886 | 437 |
|
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
438 |
uint8_t |
9359
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
439 |
RrFfMacScheduler::HarqProcessAvailability (uint16_t rnti) |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
440 |
{ |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
441 |
NS_LOG_FUNCTION (this << rnti); |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
442 |
|
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
443 |
std::map <uint16_t, uint8_t>::iterator it = m_dlHarqCurrentProcessId.find (rnti); |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
444 |
if (it==m_dlHarqCurrentProcessId.end ()) |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
445 |
{ |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
446 |
NS_FATAL_ERROR ("No Process Id found for this RNTI " << rnti); |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
447 |
} |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
448 |
std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = m_dlHarqProcessesStatus.find (rnti); |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
449 |
if (itStat==m_dlHarqProcessesStatus.end ()) |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
450 |
{ |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
451 |
NS_FATAL_ERROR ("No Process Id Statusfound for this RNTI " << rnti); |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
452 |
} |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
453 |
uint8_t i = (*it).second; |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
454 |
do |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
455 |
{ |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
456 |
i = (i + 1) % HARQ_PROC_NUM; |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
457 |
// NS_LOG_DEBUG (this << " check i " << (uint16_t)i << " stat " << (uint16_t)(*itStat).second.at (i)); |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
458 |
} while ( ((*itStat).second.at (i)!=0)&&(i!=(*it).second)); |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
459 |
if ((*itStat).second.at (i)==0) |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
460 |
{ |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
461 |
return (true); |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
462 |
} |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
463 |
else |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
464 |
{ |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
465 |
return (false); // return a not valid harq proc id |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
466 |
} |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
467 |
} |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
468 |
|
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
469 |
|
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
470 |
|
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
471 |
uint8_t |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
472 |
RrFfMacScheduler::UpdateHarqProcessId (uint16_t rnti) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
473 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
474 |
NS_LOG_FUNCTION (this << rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
475 |
|
9359
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
476 |
|
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
477 |
if (m_harqOn == false) |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
478 |
{ |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
479 |
return (0); |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
480 |
} |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
481 |
|
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
482 |
std::map <uint16_t, uint8_t>::iterator it = m_dlHarqCurrentProcessId.find (rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
483 |
if (it==m_dlHarqCurrentProcessId.end ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
484 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
485 |
NS_FATAL_ERROR ("No Process Id found for this RNTI " << rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
486 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
487 |
std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = m_dlHarqProcessesStatus.find (rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
488 |
if (itStat==m_dlHarqProcessesStatus.end ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
489 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
490 |
NS_FATAL_ERROR ("No Process Id Statusfound for this RNTI " << rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
491 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
492 |
uint8_t i = (*it).second; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
493 |
do |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
494 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
495 |
i = (i + 1) % HARQ_PROC_NUM; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
496 |
// NS_LOG_DEBUG (this << " check i " << (uint16_t)i << " stat " << (uint16_t)(*itStat).second.at (i)); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
497 |
} while ( ((*itStat).second.at (i)!=0)&&(i!=(*it).second)); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
498 |
if ((*itStat).second.at (i)==0) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
499 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
500 |
(*it).second = i; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
501 |
(*itStat).second.at (i) = 1; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
502 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
503 |
else |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
504 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
505 |
return (9); // return a not valid harq proc id |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
506 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
507 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
508 |
return ((*it).second); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
509 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
510 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
511 |
|
7886 | 512 |
void |
513 |
RrFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::SchedDlTriggerReqParameters& params) |
|
514 |
{ |
|
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
|
515 |
NS_LOG_FUNCTION (this << " DL Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf)); |
7886 | 516 |
// 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
|
517 |
|
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
518 |
RefreshDlCqiMaps (); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
519 |
int rbgSize = GetRbgSize (m_cschedCellConfig.m_dlBandwidth); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
520 |
int rbgNum = m_cschedCellConfig.m_dlBandwidth / rbgSize; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
521 |
FfMacSchedSapUser::SchedDlConfigIndParameters ret; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
522 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
523 |
// Generate RBGs map |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
524 |
std::vector <bool> rbgMap; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
525 |
uint16_t rbgAllocatedNum = 0; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
526 |
std::set <uint16_t> rntiAllocated; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
527 |
rbgMap.resize (m_cschedCellConfig.m_dlBandwidth/rbgSize, false); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
528 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
529 |
// Process DL HARQ feedback |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
530 |
// retrieve past HARQ retx buffered |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
531 |
if (m_dlInfoListBuffered.size ()>0) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
532 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
533 |
if (params.m_dlInfoList.size ()>0) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
534 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
535 |
NS_LOG_DEBUG (this << " RECEIVED DL-HARQ"); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
536 |
m_dlInfoListBuffered.insert (m_dlInfoListBuffered.end (), params.m_dlInfoList.begin (), params.m_dlInfoList.end ()); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
537 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
538 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
539 |
else |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
540 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
541 |
if (params.m_dlInfoList.size ()>0) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
542 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
543 |
m_dlInfoListBuffered = params.m_dlInfoList; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
544 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
545 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
546 |
if (m_harqOn == false) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
547 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
548 |
// Ignore HARQ feedbacks |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
549 |
m_dlInfoListBuffered.clear (); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
550 |
NS_LOG_DEBUG (this << " HARQ OFF"); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
551 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
552 |
std::vector <struct DlInfoListElement_s> dlInfoListUntxed; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
553 |
for (uint8_t i = 0; i < m_dlInfoListBuffered.size (); i++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
554 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
555 |
uint8_t nLayers = m_dlInfoListBuffered.at (i).m_harqStatus.size (); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
556 |
std::vector <bool> retx; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
557 |
NS_LOG_DEBUG (this << " Processing DLHARQ-FEEDBACK"); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
558 |
if (nLayers == 1) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
559 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
560 |
retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlInfoListElement_s::NACK); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
561 |
retx.push_back (false); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
562 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
563 |
else |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
564 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
565 |
retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlInfoListElement_s::NACK); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
566 |
retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (1) == DlInfoListElement_s::NACK); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
567 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
568 |
if (retx.at (0) || retx.at (1)) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
569 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
570 |
// retrieve HARQ process information |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
571 |
uint16_t rnti = m_dlInfoListBuffered.at (i).m_rnti; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
572 |
uint8_t harqId = m_dlInfoListBuffered.at (i).m_harqProcessId; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
573 |
NS_LOG_DEBUG (this << " HARQ retx RNTI " << rnti << " harqId " << (uint16_t)harqId); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
574 |
std::map <uint16_t, DlHarqProcessesDciBuffer_t>::iterator itHarq = m_dlHarqProcessesDciBuffer.find (rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
575 |
if (itHarq==m_dlHarqProcessesDciBuffer.end ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
576 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
577 |
NS_FATAL_ERROR ("No info find in HARQ buffer for UE " << rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
578 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
579 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
580 |
DlDciListElement_s dci = (*itHarq).second.at (harqId); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
581 |
int rv = 0; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
582 |
if (dci.m_rv.size ()==1) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
583 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
584 |
rv = dci.m_rv.at (0); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
585 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
586 |
else |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
587 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
588 |
rv = (dci.m_rv.at (0) > dci.m_rv.at (1) ? dci.m_rv.at (0) : dci.m_rv.at (1)); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
589 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
590 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
591 |
if (rv == 3) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
592 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
593 |
// maximum number of retx reached -> drop process |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
594 |
NS_LOG_DEBUG ("Max number of retransmissions reached -> drop process"); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
595 |
std::map <uint16_t, DlHarqProcessesStatus_t>::iterator it = m_dlHarqProcessesStatus.find (rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
596 |
if (it==m_dlHarqProcessesStatus.end ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
597 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
598 |
NS_FATAL_ERROR ("No info find in HARQ buffer for UE " << m_dlInfoListBuffered.at (i).m_rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
599 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
600 |
(*it).second.at (harqId) = 0; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
601 |
std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find (rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
602 |
if (itRlcPdu==m_dlHarqProcessesRlcPduListBuffer.end ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
603 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
604 |
NS_FATAL_ERROR ("Unable to find RlcPdcList in HARQ buffer for RNTI " << m_dlInfoListBuffered.at (i).m_rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
605 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
606 |
for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
607 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
608 |
(*itRlcPdu).second.at (k).at (harqId).clear (); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
609 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
610 |
continue; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
611 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
612 |
// check the feasibility of retransmitting on the same RBGs |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
613 |
// translate the DCI to Spectrum framework |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
614 |
std::vector <int> dciRbg; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
615 |
uint32_t mask = 0x1; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
616 |
NS_LOG_DEBUG ("Original RBGs " << dci.m_rbBitmap << " rnti " << dci.m_rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
617 |
for (int j = 0; j < 32; j++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
618 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
619 |
if (((dci.m_rbBitmap & mask) >> j) == 1) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
620 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
621 |
dciRbg.push_back (j); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
622 |
NS_LOG_DEBUG ("\t"<<j); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
623 |
// for (int k = 0; k < rbgSize; k++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
624 |
// { |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
625 |
// dciRb.push_back ((j * rbgSize) + k); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
626 |
// //NS_LOG_DEBUG(this << "DL-DCI allocated PRB " << (i*GetRbgSize()) + k); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
627 |
// } |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
628 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
629 |
mask = (mask << 1); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
630 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
631 |
bool free = true; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
632 |
for (uint8_t j = 0; j < dciRbg.size (); j++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
633 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
634 |
if (rbgMap.at (dciRbg.at (j))==true) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
635 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
636 |
free = false; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
637 |
break; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
638 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
639 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
640 |
if (free) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
641 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
642 |
// use the same RBGs for the retx |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
643 |
// reserve RBGs |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
644 |
for (uint8_t j = 0; j < dciRbg.size (); j++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
645 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
646 |
rbgMap.at (dciRbg.at (j)) = true; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
647 |
NS_LOG_DEBUG ("RBG " << dciRbg.at (j) << " assigned"); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
648 |
rbgAllocatedNum++; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
649 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
650 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
651 |
NS_LOG_DEBUG (this << " Send retx in the same RBGs"); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
652 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
653 |
else |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
654 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
655 |
// find RBGs for sending HARQ retx |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
656 |
uint8_t j = 0; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
657 |
uint8_t rbgId = (dciRbg.at (dciRbg.size () - 1) + 1) % rbgNum; |
9358
7545f5294223
Bug-fix DoSchedDlTriggerReq:startRbg both in RR and PR erroneous initialization
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9352
diff
changeset
|
658 |
uint8_t startRbg = dciRbg.at (dciRbg.size () - 1); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
659 |
std::vector <bool> rbgMapCopy = rbgMap; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
660 |
while ((j < dciRbg.size ())&&(startRbg!=rbgId)) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
661 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
662 |
if (rbgMapCopy.at (rbgId) == false) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
663 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
664 |
rbgMapCopy.at (rbgId) = true; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
665 |
dciRbg.at (j) = rbgId; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
666 |
j++; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
667 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
668 |
rbgId++; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
669 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
670 |
if (j == dciRbg.size ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
671 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
672 |
// find new RBGs -> update DCI map |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
673 |
uint32_t rbgMask = 0; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
674 |
for (uint16_t k = 0; k < dciRbg.size (); k++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
675 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
676 |
rbgMask = rbgMask + (0x1 << dciRbg.at (k)); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
677 |
// NS_LOG_DEBUG (this << " Allocated PRB " << (*itMap).second.at (k)); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
678 |
rbgAllocatedNum++; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
679 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
680 |
dci.m_rbBitmap = rbgMask; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
681 |
rbgMap = rbgMapCopy; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
682 |
NS_LOG_DEBUG (this << " Move retx in RBGs " << dciRbg.size ()); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
683 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
684 |
else |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
685 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
686 |
// HARQ retx cannot be performed on this TTI -> store it |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
687 |
dlInfoListUntxed.push_back (params.m_dlInfoList.at (i)); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
688 |
NS_LOG_DEBUG (this << " No resource for this retx -> buffer it"); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
689 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
690 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
691 |
// retrieve RLC PDU list for retx TBsize and update DCI |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
692 |
BuildDataListElement_s newEl; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
693 |
std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find (rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
694 |
if (itRlcPdu==m_dlHarqProcessesRlcPduListBuffer.end ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
695 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
696 |
NS_FATAL_ERROR ("Unable to find RlcPdcList in HARQ buffer for RNTI " << rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
697 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
698 |
for (uint8_t j = 0; j < nLayers; j++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
699 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
700 |
if (retx.at (j)) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
701 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
702 |
if (j >= dci.m_ndi.size ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
703 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
704 |
// for avoiding errors in MIMO transient phases |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
705 |
dci.m_ndi.push_back (0); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
706 |
dci.m_rv.push_back (0); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
707 |
dci.m_mcs.push_back (0); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
708 |
dci.m_tbsSize.push_back (0); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
709 |
NS_LOG_DEBUG (this << " layer " << (uint16_t)j << " no txed (MIMO transition)"); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
710 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
711 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
712 |
else |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
713 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
714 |
dci.m_ndi.at (j) = 0; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
715 |
dci.m_rv.at (j) ++; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
716 |
(*itHarq).second.at (harqId).m_rv.at (j)++; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
717 |
NS_LOG_DEBUG (this << " layer " << (uint16_t)j << " RV " << (uint16_t)dci.m_rv.at (j)); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
718 |
newEl.m_rlcPduList.push_back ((*itRlcPdu).second.at (j).at (dci.m_harqProcess)); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
719 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
720 |
// NS_ASSERT_MSG ((*itRlcPdu).second.size () >dci.m_harqProcess, " size " << (*itRlcPdu).second.size ()); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
721 |
// NS_ASSERT ((*itRlcPdu).second.at (j).size () > dci.m_harqProcess); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
722 |
// newEl.m_rlcPduList.push_back ((*itRlcPdu).second.at (j).at (dci.m_harqProcess)); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
723 |
// NS_LOG_DEBUG (this << " size 1 " << (*itRlcPdu).second.size () << " size 2 " << (*itRlcPdu).second.at (j).size ()); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
724 |
// NS_ASSERT_MSG ((*itRlcPdu).second.at (j).at (dci.m_harqProcess).size () <= 1, " MIMO ERRROR 1"); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
725 |
// for (uint16_t k = 0; k < (*itRlcPdu).second.at (j).at (dci.m_harqProcess).size (); k++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
726 |
// { |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
727 |
// NS_LOG_DEBUG (this << " k " << k); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
728 |
// } |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
729 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
730 |
else |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
731 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
732 |
// empty TB of layer j |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
733 |
dci.m_ndi.at (j) = 0; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
734 |
dci.m_rv.at (j) = 0; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
735 |
dci.m_mcs.at (j) = 0; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
736 |
dci.m_tbsSize.at (j) = 0; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
737 |
NS_LOG_DEBUG (this << " layer " << (uint16_t)j << " no retx"); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
738 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
739 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
740 |
newEl.m_rnti = rnti; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
741 |
newEl.m_dci = dci; |
9360
197c71f20845
Bug-fix in RR and PF: update RV field in different harq retx
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9359
diff
changeset
|
742 |
(*itHarq).second.at (harqId).m_rv = dci.m_rv; |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
743 |
ret.m_buildDataList.push_back (newEl); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
744 |
rntiAllocated.insert (rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
745 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
746 |
else |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
747 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
748 |
// update HARQ process status |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
749 |
NS_LOG_DEBUG (this << " RR HARQ ACK UE " << m_dlInfoListBuffered.at (i).m_rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
750 |
std::map <uint16_t, DlHarqProcessesStatus_t>::iterator it = m_dlHarqProcessesStatus.find (m_dlInfoListBuffered.at (i).m_rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
751 |
if (it==m_dlHarqProcessesStatus.end ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
752 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
753 |
NS_FATAL_ERROR ("No info find in HARQ buffer for UE " << m_dlInfoListBuffered.at (i).m_rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
754 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
755 |
(*it).second.at (m_dlInfoListBuffered.at (i).m_harqProcessId) = 0; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
756 |
std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find (m_dlInfoListBuffered.at (i).m_rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
757 |
if (itRlcPdu==m_dlHarqProcessesRlcPduListBuffer.end ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
758 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
759 |
NS_FATAL_ERROR ("Unable to find RlcPdcList in HARQ buffer for RNTI " << m_dlInfoListBuffered.at (i).m_rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
760 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
761 |
for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
762 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
763 |
(*itRlcPdu).second.at (k).at (m_dlInfoListBuffered.at (i).m_harqProcessId).clear (); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
764 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
765 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
766 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
767 |
m_dlInfoListBuffered.clear (); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
768 |
m_dlInfoListBuffered = dlInfoListUntxed; |
7886 | 769 |
|
770 |
// 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
|
771 |
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
|
772 |
m_rlcBufferReq.sort (SortRlcBufferReq); |
7886 | 773 |
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
|
774 |
int nTbs = 0; |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
775 |
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
|
776 |
std::map <uint16_t,uint8_t>::iterator itLcRnti; |
7886 | 777 |
for (it = m_rlcBufferReq.begin (); it != m_rlcBufferReq.end (); it++) |
778 |
{ |
|
8342
ae80a024c11e
Bug-fix RrFfMacScheduler::DoSchedDlTriggerReq DCI TB size per multiple LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8321
diff
changeset
|
779 |
// NS_LOG_INFO (this << " User " << (*it).m_rnti << " LC " << (uint16_t)(*it).m_logicalChannelIdentity); |
7886 | 780 |
// remove old entries of this UE-LC |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
781 |
std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).m_rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
782 |
if ( (((*it).m_rlcTransmissionQueueSize > 0) |
7886 | 783 |
|| ((*it).m_rlcRetransmissionQueueSize > 0) |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
784 |
|| ((*it).m_rlcStatusPduSize > 0)) |
9359
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
785 |
&& (itRnti == rntiAllocated.end ()) // UE must not be allocated for HARQ retx |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
786 |
&& (HarqProcessAvailability ((*it).m_rnti)) ) // UE needs HARQ proc free |
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
787 |
|
7886 | 788 |
{ |
7966
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
789 |
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
|
790 |
uint8_t cqi = 0; |
7966
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
791 |
if (itCqi != m_p10CqiRxed.end ()) |
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
792 |
{ |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
793 |
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
|
794 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
795 |
else |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
796 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
797 |
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
|
798 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
799 |
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
|
800 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
801 |
// 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
|
802 |
nflows++; |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
803 |
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
|
804 |
if (itLcRnti != lcActivesPerRnti.end ()) |
7966
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
805 |
{ |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
806 |
(*itLcRnti).second++; |
7966
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
807 |
} |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
808 |
else |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
809 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
810 |
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
|
811 |
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
|
812 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
813 |
|
7966
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
814 |
} |
7886 | 815 |
} |
816 |
} |
|
8342
ae80a024c11e
Bug-fix RrFfMacScheduler::DoSchedDlTriggerReq DCI TB size per multiple LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8321
diff
changeset
|
817 |
|
7886 | 818 |
if (nflows == 0) |
819 |
{ |
|
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
820 |
if (ret.m_buildDataList.size ()>0) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
821 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
822 |
m_schedSapUser->SchedDlConfigInd (ret); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
823 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
824 |
return; |
7886 | 825 |
} |
826 |
// Divide the resource equally among the active users according to |
|
827 |
// Resource allocation type 0 (see sec 7.1.6.1 of 36.213) |
|
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
828 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
829 |
int rbgPerTb = (rbgNum - rbgAllocatedNum) / nTbs; |
8342
ae80a024c11e
Bug-fix RrFfMacScheduler::DoSchedDlTriggerReq DCI TB size per multiple LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8321
diff
changeset
|
830 |
if (rbgPerTb == 0) |
7886 | 831 |
{ |
8342
ae80a024c11e
Bug-fix RrFfMacScheduler::DoSchedDlTriggerReq DCI TB size per multiple LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8321
diff
changeset
|
832 |
rbgPerTb = 1; // at least 1 rbg per TB (till available resource) |
7886 | 833 |
} |
834 |
int rbgAllocated = 0; |
|
835 |
||
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
836 |
// round robin assignment to all UEs registered starting from the subsequent of the one |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
837 |
// served last scheduling trigger event |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
838 |
if (m_nextRntiDl != 0) |
8020
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
839 |
{ |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
840 |
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
|
841 |
{ |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
842 |
if ((*it).m_rnti == m_nextRntiDl) |
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 |
break; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
845 |
} |
8020
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
846 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
847 |
|
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
848 |
if (it == m_rlcBufferReq.end ()) |
8020
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
849 |
{ |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
850 |
NS_LOG_ERROR (this << " no user found"); |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
851 |
} |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
852 |
} |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
853 |
else |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
854 |
{ |
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
855 |
it = m_rlcBufferReq.begin (); |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
856 |
m_nextRntiDl = (*it).m_rnti; |
8020
fc705bc87348
Round Robin circular scheduling upgrade
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7983
diff
changeset
|
857 |
} |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
858 |
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
|
859 |
do |
7886 | 860 |
{ |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
861 |
itLcRnti = lcActivesPerRnti.find ((*it).m_rnti); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
862 |
std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).m_rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
863 |
if ((itLcRnti == lcActivesPerRnti.end ())||(itRnti!=rntiAllocated.end ())) |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
864 |
{ |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
865 |
// skip this entry (no active queue or yet allocated for HARQ) |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
866 |
it++; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
867 |
if (it == m_rlcBufferReq.end ()) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
868 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
869 |
// restart from the first |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
870 |
it = m_rlcBufferReq.begin (); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
871 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
872 |
continue; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
873 |
} |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
874 |
itTxMode = m_uesTxMode.find ((*it).m_rnti); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
875 |
if (itTxMode == m_uesTxMode.end()) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
876 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
877 |
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
|
878 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
879 |
int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
880 |
NS_LOG_DEBUG (this << " NLAYERS " << nLayer); |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
881 |
int lcNum = (*itLcRnti).second; |
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
882 |
// create new BuildDataListElement_s for this RNTI |
7886 | 883 |
BuildDataListElement_s newEl; |
884 |
newEl.m_rnti = (*it).m_rnti; |
|
885 |
// create the DlDciListElement_s |
|
886 |
DlDciListElement_s newDci; |
|
887 |
newDci.m_rnti = (*it).m_rnti; |
|
9359
55dee31410ac
Update RR and PF schedulers for avoiding the allocation of UEs that do not have HARQ processes available for transmitting
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9358
diff
changeset
|
888 |
newDci.m_harqProcess = UpdateHarqProcessId ((*it).m_rnti); |
7886 | 889 |
newDci.m_resAlloc = 0; |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
890 |
newDci.m_rbBitmap = 0; |
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
891 |
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
|
892 |
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
|
893 |
{ |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
894 |
if (itCqi == m_p10CqiRxed.end ()) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
895 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
896 |
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
|
897 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
898 |
else |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
899 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
900 |
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
|
901 |
} |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
902 |
} |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
903 |
int tbSize = (m_amc->GetTbSizeFromMcs (newDci.m_mcs.at (0), rbgPerTb * rbgSize) / 8); |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
904 |
uint16_t rlcPduSize = tbSize / lcNum; |
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
905 |
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
|
906 |
{ |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
907 |
std::vector <struct RlcPduListElement_s> newRlcPduLe; |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
908 |
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
|
909 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
910 |
RlcPduListElement_s newRlcEl; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
911 |
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
|
912 |
// 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
|
913 |
newRlcEl.m_size = rlcPduSize; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
914 |
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
|
915 |
newRlcPduLe.push_back (newRlcEl); |
9352 | 916 |
if (m_harqOn == true) |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
917 |
{ |
9352 | 918 |
// store RLC PDU list for HARQ |
919 |
std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu = m_dlHarqProcessesRlcPduListBuffer.find ((*it).m_rnti); |
|
920 |
if (itRlcPdu==m_dlHarqProcessesRlcPduListBuffer.end ()) |
|
921 |
{ |
|
922 |
NS_FATAL_ERROR ("Unable to find RlcPdcList in HARQ buffer for RNTI " << (*it).m_rnti); |
|
923 |
} |
|
924 |
// NS_ASSERT_MSG ((*itRlcPdu).second.at (j).at (newDci.m_harqProcess).size () <= 1, " MIMO ERR 4" <<(*itRlcPdu).second.at (j).at (newDci.m_harqProcess).size () ); |
|
925 |
(*itRlcPdu).second.at (j).at (newDci.m_harqProcess).push_back (newRlcEl); |
|
926 |
// NS_ASSERT_MSG ((*itRlcPdu).second.at (j).at (newDci.m_harqProcess).size () <= 1, " MIMO ERR 3" <<(*itRlcPdu).second.at (j).at (newDci.m_harqProcess).size () ); |
|
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
927 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
928 |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
929 |
} |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
930 |
newEl.m_rlcPduList.push_back (newRlcPduLe); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
931 |
it++; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
932 |
if (it == m_rlcBufferReq.end ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
933 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
934 |
// restart from the first |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
935 |
it = m_rlcBufferReq.begin (); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
936 |
} |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
937 |
} |
7886 | 938 |
uint32_t rbgMask = 0; |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
939 |
uint16_t i = 0; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
940 |
NS_LOG_DEBUG (this << " DL - Allocate user " << newEl.m_rnti << " LCs " << (uint16_t)(*itLcRnti).second << " bytes " << tbSize << " mcs " << (uint16_t) newDci.m_mcs.at (0) << " harqId " << (uint16_t)newDci.m_harqProcess << " layers " << nLayer); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
941 |
NS_LOG_DEBUG ("RBG:"); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
942 |
while (i < rbgPerTb) |
7886 | 943 |
{ |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
944 |
if (rbgMap.at (rbgAllocated)==false) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
945 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
946 |
rbgMask = rbgMask + (0x1 << rbgAllocated); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
947 |
NS_LOG_DEBUG ("\t " << rbgAllocated); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
948 |
i++; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
949 |
rbgMap.at (rbgAllocated) = true; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
950 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
951 |
rbgAllocated++; |
7886 | 952 |
} |
953 |
newDci.m_rbBitmap = rbgMask; // (32 bit bitmap see 7.1.6 of 36.213) |
|
954 |
||
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
955 |
for (int i = 0; i < nLayer; i++) |
7886 | 956 |
{ |
7977
9a44dfd0056d
LENA-68 RrFfMacScheduler 1 TB per RNTI
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7972
diff
changeset
|
957 |
newDci.m_tbsSize.push_back (tbSize); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
958 |
newDci.m_ndi.push_back (1); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
959 |
newDci.m_rv.push_back (0); |
7886 | 960 |
} |
961 |
newEl.m_dci = newDci; |
|
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
962 |
if (m_harqOn == true) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
963 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
964 |
// store DCI for HARQ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
965 |
std::map <uint16_t, DlHarqProcessesDciBuffer_t>::iterator itDci = m_dlHarqProcessesDciBuffer.find (newEl.m_rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
966 |
if (itDci==m_dlHarqProcessesDciBuffer.end ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
967 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
968 |
NS_FATAL_ERROR ("Unable to find RNTI entry in DCI HARQ buffer for RNTI " << (*it).m_rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
969 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
970 |
(*itDci).second.at (newDci.m_harqProcess) = newDci; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
971 |
} |
7897 | 972 |
// ...more parameters -> ignored in this version |
7886 | 973 |
|
974 |
ret.m_buildDataList.push_back (newEl); |
|
975 |
if (rbgAllocated == rbgNum) |
|
976 |
{ |
|
8035
d2e70680881a
LenaTestPfFfMacSchedulerSuite works with distance 0
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8020
diff
changeset
|
977 |
//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
|
978 |
m_nextRntiDl = (*it).m_rnti; // store last RNTI served |
7886 | 979 |
break; // no more RGB to be allocated |
980 |
} |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
981 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
982 |
while ((*it).m_rnti != m_nextRntiDl); |
7886 | 983 |
|
984 |
ret.m_nrOfPdcchOfdmSymbols = 1; // TODO: check correct value according the DCIs txed |
|
985 |
||
986 |
m_schedSapUser->SchedDlConfigInd (ret); |
|
987 |
return; |
|
988 |
} |
|
989 |
||
990 |
void |
|
991 |
RrFfMacScheduler::DoSchedDlRachInfoReq (const struct FfMacSchedSapProvider::SchedDlRachInfoReqParameters& params) |
|
992 |
{ |
|
993 |
NS_LOG_FUNCTION (this); |
|
994 |
// TODO: Implementation of the API |
|
995 |
return; |
|
996 |
} |
|
997 |
||
998 |
void |
|
999 |
RrFfMacScheduler::DoSchedDlCqiInfoReq (const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters& params) |
|
1000 |
{ |
|
1001 |
NS_LOG_FUNCTION (this); |
|
1002 |
||
1003 |
std::map <uint16_t,uint8_t>::iterator it; |
|
1004 |
for (unsigned int i = 0; i < params.m_cqiList.size (); i++) |
|
1005 |
{ |
|
1006 |
if ( params.m_cqiList.at (i).m_cqiType == CqiListElement_s::P10 ) |
|
1007 |
{ |
|
1008 |
// wideband CQI reporting |
|
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7888
diff
changeset
|
1009 |
std::map <uint16_t,uint8_t>::iterator it; |
7886 | 1010 |
uint16_t rnti = params.m_cqiList.at (i).m_rnti; |
1011 |
it = m_p10CqiRxed.find (rnti); |
|
1012 |
if (it == m_p10CqiRxed.end ()) |
|
1013 |
{ |
|
1014 |
// create the new entry |
|
1015 |
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
|
1016 |
// 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
|
1017 |
m_p10CqiTimers.insert ( std::pair<uint16_t, uint32_t > (rnti, m_cqiTimersThreshold)); |
7886 | 1018 |
} |
1019 |
else |
|
1020 |
{ |
|
1021 |
// update the CQI value |
|
1022 |
(*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
|
1023 |
// 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
|
1024 |
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
|
1025 |
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
|
1026 |
(*itTimers).second = m_cqiTimersThreshold; |
7886 | 1027 |
} |
1028 |
} |
|
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7888
diff
changeset
|
1029 |
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
|
1030 |
{ |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7888
diff
changeset
|
1031 |
// 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
|
1032 |
// 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
|
1033 |
} |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7888
diff
changeset
|
1034 |
else |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7888
diff
changeset
|
1035 |
{ |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7888
diff
changeset
|
1036 |
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
|
1037 |
} |
7886 | 1038 |
} |
1039 |
||
1040 |
return; |
|
1041 |
} |
|
1042 |
||
1043 |
void |
|
1044 |
RrFfMacScheduler::DoSchedUlTriggerReq (const struct FfMacSchedSapProvider::SchedUlTriggerReqParameters& params) |
|
1045 |
{ |
|
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
|
1046 |
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
|
1047 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1048 |
|
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1049 |
RefreshUlCqiMaps (); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1050 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1051 |
// Generate RBs map |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1052 |
FfMacSchedSapUser::SchedUlConfigIndParameters ret; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1053 |
std::vector <bool> rbMap; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1054 |
uint16_t rbAllocatedNum = 0; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1055 |
std::set <uint16_t> rntiAllocated; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1056 |
std::vector <uint16_t> rbgAllocationMap; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1057 |
rbgAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1058 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1059 |
rbMap.resize (m_cschedCellConfig.m_ulBandwidth, false); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1060 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1061 |
// Process UL HARQ feedback |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1062 |
// update UL HARQ proc id |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1063 |
std::map <uint16_t, uint8_t>::iterator itProcId; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1064 |
for (itProcId = m_ulHarqCurrentProcessId.begin (); itProcId!= m_ulHarqCurrentProcessId.end (); itProcId++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1065 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1066 |
(*itProcId).second = ((*itProcId).second + 1) % HARQ_PROC_NUM; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1067 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1068 |
for (uint8_t i = 0; i < params.m_ulInfoList.size (); i++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1069 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1070 |
if (params.m_ulInfoList.at (i).m_receptionStatus==UlInfoListElement_s::NotOk) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1071 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1072 |
// retx correspondent block: retrieve the UL-DCI |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1073 |
uint16_t rnti = params.m_ulInfoList.at (i).m_rnti; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1074 |
uint8_t harqId = (uint8_t)((*itProcId).second - HARQ_PERIOD) % HARQ_PROC_NUM; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1075 |
NS_LOG_DEBUG (this << " UL-HARQ retx RNTI " << rnti << " harqId " << (uint16_t)harqId); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1076 |
std::map <uint16_t, UlHarqProcessesDciBuffer_t>::iterator itHarq = m_ulHarqProcessesDciBuffer.find (rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1077 |
if (itHarq==m_ulHarqProcessesDciBuffer.end ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1078 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1079 |
NS_FATAL_ERROR ("No info find in UL-HARQ buffer for UE " << rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1080 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1081 |
itProcId = m_ulHarqCurrentProcessId.find (rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1082 |
if (itProcId==m_ulHarqCurrentProcessId.end ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1083 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1084 |
NS_FATAL_ERROR ("No info find in HARQ buffer for UE " << rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1085 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1086 |
UlDciListElement_s dci = (*itHarq).second.at (harqId); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1087 |
std::map <uint16_t, UlHarqProcessesStatus_t>::iterator itStat = m_ulHarqProcessesStatus.find (rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1088 |
if (itStat==m_ulHarqProcessesStatus.end ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1089 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1090 |
NS_FATAL_ERROR ("No info find in HARQ buffer for UE " << rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1091 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1092 |
if ((*itStat).second.at (harqId)>3) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1093 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1094 |
NS_LOG_DEBUG ("Max number of retransmissions reached (UL)-> drop process"); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1095 |
continue; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1096 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1097 |
bool free = true; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1098 |
for (int j = dci.m_rbStart; j < dci.m_rbStart + dci.m_rbLen; j++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1099 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1100 |
if (rbMap.at (j)==true) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1101 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1102 |
free = false; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1103 |
NS_LOG_DEBUG (this << " BUSY " << j); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1104 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1105 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1106 |
if (free) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1107 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1108 |
// retx on the same RBs |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1109 |
for (int j = dci.m_rbStart; j < dci.m_rbStart + dci.m_rbLen; j++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1110 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1111 |
rbMap.at (j) = true; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1112 |
rbgAllocationMap.at (j) = dci.m_rnti; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1113 |
NS_LOG_DEBUG ("\t" << j); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1114 |
rbAllocatedNum++; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1115 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1116 |
NS_LOG_DEBUG (this << " Send retx in the same RBGs " << (uint16_t)dci.m_rbStart << " to " << dci.m_rbStart + dci.m_rbLen); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1117 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1118 |
else |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1119 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1120 |
NS_FATAL_ERROR ("Cannot allocare retx for UE " << rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1121 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1122 |
dci.m_ndi = 0; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1123 |
ret.m_dciList.push_back (dci); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1124 |
rntiAllocated.insert (dci.m_rnti); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1125 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1126 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1127 |
} |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1128 |
|
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1129 |
std::map <uint16_t,uint32_t>::iterator it; |
7886 | 1130 |
int nflows = 0; |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1131 |
|
7886 | 1132 |
for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) |
1133 |
{ |
|
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1134 |
std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1135 |
// select UEs with queues not empty and not yet allocated for HARQ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1136 |
if (((*it).second > 0)&&(itRnti == rntiAllocated.end ())) |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1137 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1138 |
nflows++; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1139 |
} |
7886 | 1140 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1141 |
|
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1142 |
if (nflows == 0) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1143 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1144 |
return ; // no flows to be scheduled |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1145 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1146 |
|
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1147 |
|
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1148 |
// Divide the remaining resources equally among the active users starting from the subsequent one served last scheduling trigger |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1149 |
//uint16_t rbPerFlow = (m_cschedCellConfig.m_ulBandwidth - rbAllocatedNum) / nflows; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1150 |
uint16_t rbPerFlow = (m_cschedCellConfig.m_ulBandwidth) / (nflows + rntiAllocated.size ()); |
7886 | 1151 |
if (rbPerFlow == 0) |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1152 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1153 |
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
|
1154 |
} |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1155 |
uint16_t rbAllocated = 0; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1156 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1157 |
if (m_nextRntiUl != 0) |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1158 |
{ |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1159 |
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
|
1160 |
{ |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1161 |
if ((*it).first == m_nextRntiUl) |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1162 |
{ |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1163 |
break; |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1164 |
} |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1165 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1166 |
if (it == m_ceBsrRxed.end ()) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1167 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1168 |
NS_LOG_ERROR (this << " no user found"); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1169 |
} |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1170 |
} |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1171 |
else |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1172 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1173 |
it = m_ceBsrRxed.begin (); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1174 |
m_nextRntiUl = (*it).first; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1175 |
} |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1176 |
NS_LOG_DEBUG (this << " rbPerFlow " << rbPerFlow); |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1177 |
do |
7886 | 1178 |
{ |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1179 |
std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first); |
9365
e556a9fef964
Bug-fix: Update DoSchedUlTriggerReq of both RR and PF for avoiding allocation of resources to UEs with no data to send
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9360
diff
changeset
|
1180 |
if ((itRnti!=rntiAllocated.end ())||((*it).second == 0)) |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1181 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1182 |
// UE already allocated for UL-HARQ -> skip it |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1183 |
it++; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1184 |
if (it == m_ceBsrRxed.end ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1185 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1186 |
// restart from the first |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1187 |
it = m_ceBsrRxed.begin (); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1188 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1189 |
continue; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1190 |
} |
7886 | 1191 |
if (rbAllocated + rbPerFlow > m_cschedCellConfig.m_ulBandwidth) |
1192 |
{ |
|
1193 |
// limit to physical resources last resource assignment |
|
1194 |
rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated; |
|
1195 |
} |
|
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
|
1196 |
|
7886 | 1197 |
UlDciListElement_s uldci; |
1198 |
uldci.m_rnti = (*it).first; |
|
1199 |
uldci.m_rbLen = rbPerFlow; |
|
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1200 |
bool allocated = false; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1201 |
while ((!allocated)&&(rbAllocated<m_cschedCellConfig.m_ulBandwidth)) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1202 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1203 |
// check availability |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1204 |
bool free = true; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1205 |
for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1206 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1207 |
if (rbMap.at (j) == true) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1208 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1209 |
free = false; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1210 |
break; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1211 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1212 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1213 |
if (free) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1214 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1215 |
uldci.m_rbStart = rbAllocated; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1216 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1217 |
for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1218 |
{ |
9367
b4fcfc26791f
Add lte-harq test suite and polishing of code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9365
diff
changeset
|
1219 |
rbMap.at (j) = true; |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1220 |
// store info on allocation for managing ul-cqi interpretation |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1221 |
rbgAllocationMap.at (j) = (*it).first; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1222 |
NS_LOG_DEBUG ("\t " << j); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1223 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1224 |
rbAllocated += rbPerFlow; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1225 |
allocated = true; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1226 |
break; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1227 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1228 |
rbAllocated++; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1229 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1230 |
if (!allocated) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1231 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1232 |
// unable to allocate new resource: finish scheduling |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1233 |
if (ret.m_dciList.size ()>0) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1234 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1235 |
m_schedSapUser->SchedUlConfigInd (ret); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1236 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1237 |
m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params.m_sfnSf, rbgAllocationMap)); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1238 |
return; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1239 |
} |
7948 | 1240 |
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
|
1241 |
int cqi = 0; |
7948 | 1242 |
if (itCqi == m_ueCqi.end ()) |
1243 |
{ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1244 |
// no cqi info about this UE |
7948 | 1245 |
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
|
1246 |
NS_LOG_DEBUG (this << " UE does not have ULCQI " << (*it).first ); |
7948 | 1247 |
} |
1248 |
else |
|
1249 |
{ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1250 |
// take the lowest CQI value (worst RB) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1251 |
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
|
1252 |
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
|
1253 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1254 |
if ((*itCqi).second.at (i) < minSinr) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1255 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1256 |
minSinr = (*itCqi).second.at (i); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1257 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1258 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1259 |
// 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
|
1260 |
double s = log2 ( 1 + ( |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1261 |
pow (10, minSinr / 10 ) / |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1262 |
( (-log (5.0 * 0.00005 )) / 1.5) )); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1263 |
|
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1264 |
|
8516
db748e56aea2
Update RR and PF scheduler for working wiht new LteAmc object
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8513
diff
changeset
|
1265 |
cqi = m_amc->GetCqiFromSpectralEfficiency (s); |
7966
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
1266 |
if (cqi == 0) |
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
1267 |
{ |
8080
62d2fccef672
Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8077
diff
changeset
|
1268 |
it++; |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1269 |
if (it == m_ceBsrRxed.end ()) |
8080
62d2fccef672
Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8077
diff
changeset
|
1270 |
{ |
62d2fccef672
Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8077
diff
changeset
|
1271 |
// restart from the first |
62d2fccef672
Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8077
diff
changeset
|
1272 |
it = m_ceBsrRxed.begin (); |
62d2fccef672
Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8077
diff
changeset
|
1273 |
} |
7966
c2cfb1a64d66
LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7953
diff
changeset
|
1274 |
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
|
1275 |
} |
8516
db748e56aea2
Update RR and PF scheduler for working wiht new LteAmc object
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8513
diff
changeset
|
1276 |
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
|
1277 |
// 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
|
1278 |
|
7948 | 1279 |
} |
8516
db748e56aea2
Update RR and PF scheduler for working wiht new LteAmc object
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8513
diff
changeset
|
1280 |
uldci.m_tbSize = (m_amc->GetTbSizeFromMcs (uldci.m_mcs, rbPerFlow) / 8); // MCS 0 -> UL-AMC TBD |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1281 |
|
8675
e65859f03e99
Bug-fix: update m_ceBsrRxed each UL scheduling trigger event
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1282 |
UpdateUlRlcBufferInfo (uldci.m_rnti, uldci.m_tbSize); |
7886 | 1283 |
uldci.m_ndi = 1; |
1284 |
uldci.m_cceIndex = 0; |
|
1285 |
uldci.m_aggrLevel = 1; |
|
1286 |
uldci.m_ueTxAntennaSelection = 3; // antenna selection OFF |
|
1287 |
uldci.m_hopping = false; |
|
1288 |
uldci.m_n2Dmrs = 0; |
|
1289 |
uldci.m_tpc = 0; // no power control |
|
1290 |
uldci.m_cqiRequest = false; // only period CQI at this stage |
|
1291 |
uldci.m_ulIndex = 0; // TDD parameter |
|
1292 |
uldci.m_dai = 1; // TDD parameter |
|
1293 |
uldci.m_freqHopping = 0; |
|
1294 |
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
|
1295 |
ret.m_dciList.push_back (uldci); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1296 |
// store DCI for HARQ_PERIOD |
9352 | 1297 |
uint8_t harqId = 0; |
1298 |
if (m_harqOn==true) |
|
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1299 |
{ |
9352 | 1300 |
itProcId = m_ulHarqCurrentProcessId.find (uldci.m_rnti); |
1301 |
if (itProcId==m_ulHarqCurrentProcessId.end ()) |
|
1302 |
{ |
|
1303 |
NS_FATAL_ERROR ("No info find in HARQ buffer for UE " << uldci.m_rnti); |
|
1304 |
} |
|
1305 |
harqId = (*itProcId).second; |
|
1306 |
std::map <uint16_t, UlHarqProcessesDciBuffer_t>::iterator itDci = m_ulHarqProcessesDciBuffer.find (uldci.m_rnti); |
|
1307 |
if (itDci==m_ulHarqProcessesDciBuffer.end ()) |
|
1308 |
{ |
|
1309 |
NS_FATAL_ERROR ("Unable to find RNTI entry in UL DCI HARQ buffer for RNTI " << uldci.m_rnti); |
|
1310 |
} |
|
1311 |
(*itDci).second.at (harqId) = uldci; |
|
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1312 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1313 |
NS_LOG_DEBUG (this << " UL Allocation - 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 << " harqId " << (uint16_t)harqId); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9350
diff
changeset
|
1314 |
|
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1315 |
it++; |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1316 |
if (it == m_ceBsrRxed.end ()) |
8077
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1317 |
{ |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1318 |
// restart from the first |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1319 |
it = m_ceBsrRxed.begin (); |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1320 |
} |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1321 |
if (rbAllocated == m_cschedCellConfig.m_ulBandwidth) |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1322 |
{ |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1323 |
// Stop allocation: no more PRBs |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1324 |
m_nextRntiUl = (*it).first; |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1325 |
break; |
6416d09febbf
RrFfMacScheduler updated to circular allocation in uplink
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8067
diff
changeset
|
1326 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1327 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1328 |
while ((*it).first != m_nextRntiUl); |
7948 | 1329 |
m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params.m_sfnSf, rbgAllocationMap)); |
7886 | 1330 |
m_schedSapUser->SchedUlConfigInd (ret); |
1331 |
return; |
|
1332 |
} |
|
1333 |
||
1334 |
void |
|
1335 |
RrFfMacScheduler::DoSchedUlNoiseInterferenceReq (const struct FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters& params) |
|
1336 |
{ |
|
1337 |
NS_LOG_FUNCTION (this); |
|
1338 |
// TODO: Implementation of the API |
|
1339 |
return; |
|
1340 |
} |
|
1341 |
||
1342 |
void |
|
1343 |
RrFfMacScheduler::DoSchedUlSrInfoReq (const struct FfMacSchedSapProvider::SchedUlSrInfoReqParameters& params) |
|
1344 |
{ |
|
1345 |
NS_LOG_FUNCTION (this); |
|
1346 |
// TODO: Implementation of the API |
|
1347 |
return; |
|
1348 |
} |
|
1349 |
||
1350 |
void |
|
1351 |
RrFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters& params) |
|
1352 |
{ |
|
1353 |
NS_LOG_FUNCTION (this); |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1354 |
|
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1355 |
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
|
1356 |
|
7886 | 1357 |
for (unsigned int i = 0; i < params.m_macCeList.size (); i++) |
1358 |
{ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1359 |
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
|
1360 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1361 |
// buffer status report |
8887
90cbd09c8ff6
fixed bug with multiple LCs in UL BSR
Nicola Baldo <nbaldo@cttc.es>
parents:
8859
diff
changeset
|
1362 |
// 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
|
1363 |
// 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
|
1364 |
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
|
1365 |
it = m_ceBsrRxed.find (rnti); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1366 |
if (it == m_ceBsrRxed.end ()) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1367 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1368 |
// create the new entry |
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1369 |
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
|
1370 |
int buffer = BufferSizeLevelBsr::BsrId2BufferSize (bsrId); |
8887
90cbd09c8ff6
fixed bug with multiple LCs in UL BSR
Nicola Baldo <nbaldo@cttc.es>
parents:
8859
diff
changeset
|
1371 |
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
|
1372 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1373 |
else |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1374 |
{ |
8887
90cbd09c8ff6
fixed bug with multiple LCs in UL BSR
Nicola Baldo <nbaldo@cttc.es>
parents:
8859
diff
changeset
|
1375 |
// update the buffer size value |
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1376 |
(*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
|
1377 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1378 |
} |
7886 | 1379 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1380 |
|
7886 | 1381 |
return; |
1382 |
} |
|
1383 |
||
1384 |
void |
|
1385 |
RrFfMacScheduler::DoSchedUlCqiInfoReq (const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters& params) |
|
1386 |
{ |
|
1387 |
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
|
1388 |
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
|
1389 |
// 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
|
1390 |
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
|
1391 |
{ |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1392 |
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
|
1393 |
{ |
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
|
1394 |
// 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
|
1395 |
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
|
1396 |
{ |
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
|
1397 |
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
|
1398 |
} |
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
|
1399 |
} |
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
|
1400 |
break; |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1401 |
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
|
1402 |
{ |
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
|
1403 |
// 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
|
1404 |
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
|
1405 |
{ |
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
|
1406 |
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
|
1407 |
} |
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
|
1408 |
} |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1409 |
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
|
1410 |
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
|
1411 |
|
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
|
1412 |
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
|
1413 |
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
|
1414 |
} |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1415 |
switch (params.m_ulCqi.m_type) |
7948 | 1416 |
{ |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1417 |
case UlCqi_s::PUSCH: |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1418 |
{ |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1419 |
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
|
1420 |
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
|
1421 |
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
|
1422 |
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
|
1423 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1424 |
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
|
1425 |
return; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1426 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1427 |
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
|
1428 |
{ |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1429 |
// 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
|
1430 |
// 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
|
1431 |
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
|
1432 |
//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
|
1433 |
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
|
1434 |
if (itCqi == m_ueCqi.end ()) |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1435 |
{ |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1436 |
// create a new entry |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1437 |
std::vector <double> newCqi; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1438 |
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
|
1439 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1440 |
if (i == j) |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1441 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1442 |
newCqi.push_back (sinr); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1443 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1444 |
else |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1445 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1446 |
// 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
|
1447 |
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
|
1448 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1449 |
|
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1450 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1451 |
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
|
1452 |
// generate correspondent timer |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1453 |
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
|
1454 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1455 |
else |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1456 |
{ |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1457 |
// update the value |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1458 |
(*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
|
1459 |
// update correspondent timer |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1460 |
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
|
1461 |
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
|
1462 |
(*itTimers).second = m_cqiTimersThreshold; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1463 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1464 |
} |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1465 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1466 |
} |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1467 |
// 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
|
1468 |
m_allocationMaps.erase (itMap); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1469 |
} |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1470 |
break; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1471 |
case UlCqi_s::SRS: |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1472 |
{ |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1473 |
// get the RNTI from vendor specific parameters |
9059
47aa9789ed30
fix maybe-uninitialized warnings
Tom Henderson <tomh@tomh.org>
parents:
9047
diff
changeset
|
1474 |
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
|
1475 |
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
|
1476 |
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
|
1477 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1478 |
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
|
1479 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1480 |
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
|
1481 |
rnti = vsp->GetRnti (); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1482 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1483 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1484 |
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
|
1485 |
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
|
1486 |
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
|
1487 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1488 |
// create a new entry |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1489 |
std::vector <double> newCqi; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1490 |
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
|
1491 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1492 |
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
|
1493 |
newCqi.push_back (sinr); |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1494 |
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
|
1495 |
|
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1496 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1497 |
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
|
1498 |
// generate correspondent timer |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1499 |
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
|
1500 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1501 |
else |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1502 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1503 |
// update the values |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1504 |
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
|
1505 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1506 |
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
|
1507 |
(*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
|
1508 |
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
|
1509 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1510 |
// update correspondent timer |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1511 |
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
|
1512 |
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
|
1513 |
(*itTimers).second = m_cqiTimersThreshold; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1514 |
|
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1515 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1516 |
|
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1517 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8086
diff
changeset
|
1518 |
} |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1519 |
break; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1520 |
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
|
1521 |
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
|
1522 |
case UlCqi_s::PRACH: |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1523 |
{ |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1524 |
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
|
1525 |
} |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1526 |
break; |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1527 |
default: |
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
1528 |
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
|
1529 |
} |
7886 | 1530 |
return; |
1531 |
} |
|
1532 |
||
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1533 |
|
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1534 |
void |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1535 |
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
|
1536 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1537 |
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
|
1538 |
// 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
|
1539 |
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
|
1540 |
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
|
1541 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1542 |
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
|
1543 |
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
|
1544 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1545 |
// 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
|
1546 |
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
|
1547 |
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
|
1548 |
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
|
1549 |
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
|
1550 |
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
|
1551 |
itP10++; |
188a9d439fd8
Soved valgrind error on CQI updates in RR and PF schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1552 |
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
|
1553 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1554 |
else |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1555 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1556 |
(*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
|
1557 |
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
|
1558 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1559 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1560 |
|
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1561 |
return; |
7886 | 1562 |
} |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1563 |
|
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1564 |
|
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1565 |
void |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1566 |
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
|
1567 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1568 |
// 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
|
1569 |
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
|
1570 |
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
|
1571 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1572 |
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
|
1573 |
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
|
1574 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1575 |
// 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
|
1576 |
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
|
1577 |
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
|
1578 |
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
|
1579 |
(*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
|
1580 |
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
|
1581 |
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
|
1582 |
itUl++; |
188a9d439fd8
Soved valgrind error on CQI updates in RR and PF schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1583 |
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
|
1584 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1585 |
else |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1586 |
{ |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1587 |
(*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
|
1588 |
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
|
1589 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1590 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1591 |
|
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1592 |
return; |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1593 |
} |
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1594 |
|
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1595 |
void |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1596 |
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
|
1597 |
{ |
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
|
1598 |
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
|
1599 |
std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1600 |
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
|
1601 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1602 |
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
|
1603 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1604 |
// 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
|
1605 |
// 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
|
1606 |
// Update status queue |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1607 |
if ((*it).m_rlcStatusPduSize <= size) |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1608 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1609 |
size -= (*it).m_rlcStatusPduSize; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1610 |
(*it).m_rlcStatusPduSize = 0; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1611 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1612 |
else |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1613 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1614 |
(*it).m_rlcStatusPduSize -= size; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1615 |
return; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1616 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1617 |
// update retransmission queue |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1618 |
if ((*it).m_rlcRetransmissionQueueSize <= size) |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1619 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1620 |
size -= (*it).m_rlcRetransmissionQueueSize; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1621 |
(*it).m_rlcRetransmissionQueueSize = 0; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1622 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1623 |
else |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1624 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1625 |
(*it).m_rlcRetransmissionQueueSize -= size; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1626 |
return; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1627 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1628 |
// update transmission queue |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1629 |
if ((*it).m_rlcTransmissionQueueSize <= size) |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1630 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1631 |
size -= (*it).m_rlcTransmissionQueueSize; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1632 |
(*it).m_rlcTransmissionQueueSize = 0; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1633 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1634 |
else |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1635 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1636 |
(*it).m_rlcTransmissionQueueSize -= size; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1637 |
return; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1638 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1639 |
return; |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1640 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1641 |
} |
8311
ec257b681d85
Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8264
diff
changeset
|
1642 |
} |
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1643 |
|
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1644 |
void |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1645 |
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
|
1646 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1647 |
|
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
|
1648 |
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
|
1649 |
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
|
1650 |
if (it!=m_ceBsrRxed.end ()) |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1651 |
{ |
8497
b06cd67bc6ba
Update RR and PF scheduler for updating BSR queues avoiding overflows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
1652 |
// 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
|
1653 |
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
|
1654 |
{ |
b06cd67bc6ba
Update RR and PF scheduler for updating BSR queues avoiding overflows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
1655 |
(*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
|
1656 |
} |
b06cd67bc6ba
Update RR and PF scheduler for updating BSR queues avoiding overflows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
1657 |
else |
b06cd67bc6ba
Update RR and PF scheduler for updating BSR queues avoiding overflows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
1658 |
{ |
b06cd67bc6ba
Update RR and PF scheduler for updating BSR queues avoiding overflows
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8435
diff
changeset
|
1659 |
(*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
|
1660 |
} |
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1661 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1662 |
else |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1663 |
{ |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1664 |
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
|
1665 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1666 |
|
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1667 |
} |
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1668 |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1669 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1670 |
void |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1671 |
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
|
1672 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1673 |
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
|
1674 |
FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1675 |
params.m_rnti = rnti; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1676 |
params.m_transmissionMode = txMode; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1677 |
m_cschedSapUser->CschedUeConfigUpdateInd (params); |
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8413
diff
changeset
|
1678 |
} |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1679 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1680 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1681 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8584
diff
changeset
|
1682 |
} |