OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 return; | 172 return; |
173 } | 173 } |
174 | 174 |
175 void | 175 void |
176 PssFfMacScheduler::DoCschedUeConfigReq (const struct FfMacCschedSapProvider::Csc
hedUeConfigReqParameters& params) | 176 PssFfMacScheduler::DoCschedUeConfigReq (const struct FfMacCschedSapProvider::Csc
hedUeConfigReqParameters& params) |
177 { | 177 { |
178 NS_LOG_FUNCTION (this << " RNTI " << params.m_rnti << " txMode " << (uint16_t)
params.m_transmissionMode); | 178 NS_LOG_FUNCTION (this << " RNTI " << params.m_rnti << " txMode " << (uint16_t)
params.m_transmissionMode); |
179 std::map <uint16_t,uint8_t>::iterator it = m_uesTxMode.find (params.m_rnti); | 179 std::map <uint16_t,uint8_t>::iterator it = m_uesTxMode.find (params.m_rnti); |
180 if (it == m_uesTxMode.end ()) | 180 if (it == m_uesTxMode.end ()) |
181 { | 181 { |
182 m_uesTxMode.insert (std::pair <uint16_t, double> (params.m_rnti, params.m_
transmissionMode)); | 182 m_uesTxMode.insert (std::pair <uint16_t, uint8_t> (params.m_rnti, params.m
_transmissionMode)); |
183 // generate HARQ buffers | 183 // generate HARQ buffers |
184 m_dlHarqCurrentProcessId.insert (std::pair <uint16_t,uint8_t > (params.m_r
nti, 0)); | 184 m_dlHarqCurrentProcessId.insert (std::pair <uint16_t,uint8_t > (params.m_r
nti, 0)); |
185 DlHarqProcessesStatus_t dlHarqPrcStatus; | 185 DlHarqProcessesStatus_t dlHarqPrcStatus; |
186 dlHarqPrcStatus.resize (8,0); | 186 dlHarqPrcStatus.resize (8,0); |
187 m_dlHarqProcessesStatus.insert (std::pair <uint16_t, DlHarqProcessesStatus
_t> (params.m_rnti, dlHarqPrcStatus)); | 187 m_dlHarqProcessesStatus.insert (std::pair <uint16_t, DlHarqProcessesStatus
_t> (params.m_rnti, dlHarqPrcStatus)); |
188 DlHarqProcessesTimer_t dlHarqProcessesTimer; | 188 DlHarqProcessesTimer_t dlHarqProcessesTimer; |
189 dlHarqProcessesTimer.resize (8,0); | 189 dlHarqProcessesTimer.resize (8,0); |
190 m_dlHarqProcessesTimer.insert (std::pair <uint16_t, DlHarqProcessesTimer_t
> (params.m_rnti, dlHarqProcessesTimer)); | 190 m_dlHarqProcessesTimer.insert (std::pair <uint16_t, DlHarqProcessesTimer_t
> (params.m_rnti, dlHarqProcessesTimer)); |
191 DlHarqProcessesDciBuffer_t dlHarqdci; | 191 DlHarqProcessesDciBuffer_t dlHarqdci; |
192 dlHarqdci.resize (8); | 192 dlHarqdci.resize (8); |
(...skipping 23 matching lines...) Expand all Loading... |
216 { | 216 { |
217 NS_LOG_FUNCTION (this << " New LC, rnti: " << params.m_rnti); | 217 NS_LOG_FUNCTION (this << " New LC, rnti: " << params.m_rnti); |
218 | 218 |
219 std::map <uint16_t, pssFlowPerf_t>::iterator it; | 219 std::map <uint16_t, pssFlowPerf_t>::iterator it; |
220 for (uint16_t i = 0; i < params.m_logicalChannelConfigList.size (); i++) | 220 for (uint16_t i = 0; i < params.m_logicalChannelConfigList.size (); i++) |
221 { | 221 { |
222 it = m_flowStatsDl.find (params.m_rnti); | 222 it = m_flowStatsDl.find (params.m_rnti); |
223 | 223 |
224 if (it == m_flowStatsDl.end ()) | 224 if (it == m_flowStatsDl.end ()) |
225 { | 225 { |
226 double tbrDlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabG
uaranteedBitrateDl / 8; // byte/s | 226 double tbrDlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabG
uaranteedBitrateDl / 8.0; // byte/s |
227 double tbrUlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabG
uaranteedBitrateUl / 8; // byte/s | 227 double tbrUlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabG
uaranteedBitrateUl / 8.0; // byte/s |
228 | 228 |
229 pssFlowPerf_t flowStatsDl; | 229 pssFlowPerf_t flowStatsDl; |
230 flowStatsDl.flowStart = Simulator::Now (); | 230 flowStatsDl.flowStart = Simulator::Now (); |
231 flowStatsDl.totalBytesTransmitted = 0; | 231 flowStatsDl.totalBytesTransmitted = 0; |
232 flowStatsDl.lastTtiBytesTransmitted = 0; | 232 flowStatsDl.lastTtiBytesTransmitted = 0; |
233 flowStatsDl.lastAveragedThroughput = 1; | 233 flowStatsDl.lastAveragedThroughput = 1; |
234 flowStatsDl.secondLastAveragedThroughput = 1; | 234 flowStatsDl.secondLastAveragedThroughput = 1; |
235 flowStatsDl.targetThroughput = tbrDlInBytes; | 235 flowStatsDl.targetThroughput = tbrDlInBytes; |
236 m_flowStatsDl.insert (std::pair<uint16_t, pssFlowPerf_t> (params.m_rnt
i, flowStatsDl)); | 236 m_flowStatsDl.insert (std::pair<uint16_t, pssFlowPerf_t> (params.m_rnt
i, flowStatsDl)); |
237 pssFlowPerf_t flowStatsUl; | 237 pssFlowPerf_t flowStatsUl; |
238 flowStatsUl.flowStart = Simulator::Now (); | 238 flowStatsUl.flowStart = Simulator::Now (); |
239 flowStatsUl.totalBytesTransmitted = 0; | 239 flowStatsUl.totalBytesTransmitted = 0; |
240 flowStatsUl.lastTtiBytesTransmitted = 0; | 240 flowStatsUl.lastTtiBytesTransmitted = 0; |
241 flowStatsUl.lastAveragedThroughput = 1; | 241 flowStatsUl.lastAveragedThroughput = 1; |
242 flowStatsUl.secondLastAveragedThroughput = 1; | 242 flowStatsUl.secondLastAveragedThroughput = 1; |
243 flowStatsUl.targetThroughput = tbrUlInBytes; | 243 flowStatsUl.targetThroughput = tbrUlInBytes; |
244 m_flowStatsUl.insert (std::pair<uint16_t, pssFlowPerf_t> (params.m_rnt
i, flowStatsUl)); | 244 m_flowStatsUl.insert (std::pair<uint16_t, pssFlowPerf_t> (params.m_rnt
i, flowStatsUl)); |
245 } | 245 } |
246 else | 246 else |
247 { | 247 { |
248 // update GBR from UeManager::SetupDataRadioBearer () | 248 // update GBR from UeManager::SetupDataRadioBearer () |
249 double tbrDlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabG
uaranteedBitrateDl / 8; // byte/s | 249 double tbrDlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabG
uaranteedBitrateDl / 8.0; // byte/s |
250 double tbrUlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabG
uaranteedBitrateUl / 8; // byte/s | 250 double tbrUlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabG
uaranteedBitrateUl / 8.0; // byte/s |
251 m_flowStatsDl[(*it).first].targetThroughput = tbrDlInBytes; | 251 m_flowStatsDl[(*it).first].targetThroughput = tbrDlInBytes; |
252 m_flowStatsUl[(*it).first].targetThroughput = tbrUlInBytes; | 252 m_flowStatsUl[(*it).first].targetThroughput = tbrUlInBytes; |
253 } | 253 } |
254 } | 254 } |
255 | 255 |
256 return; | 256 return; |
257 } | 257 } |
258 | 258 |
259 void | 259 void |
260 PssFfMacScheduler::DoCschedLcReleaseReq (const struct FfMacCschedSapProvider::Cs
chedLcReleaseReqParameters& params) | 260 PssFfMacScheduler::DoCschedLcReleaseReq (const struct FfMacCschedSapProvider::Cs
chedLcReleaseReqParameters& params) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 } | 344 } |
345 | 345 |
346 return; | 346 return; |
347 } | 347 } |
348 | 348 |
349 void | 349 void |
350 PssFfMacScheduler::DoSchedDlPagingBufferReq (const struct FfMacSchedSapProvider:
:SchedDlPagingBufferReqParameters& params) | 350 PssFfMacScheduler::DoSchedDlPagingBufferReq (const struct FfMacSchedSapProvider:
:SchedDlPagingBufferReqParameters& params) |
351 { | 351 { |
352 NS_LOG_FUNCTION (this); | 352 NS_LOG_FUNCTION (this); |
353 NS_FATAL_ERROR ("method not implemented"); | 353 NS_FATAL_ERROR ("method not implemented"); |
| 354 NS_UNUSED(params); |
354 return; | 355 return; |
355 } | 356 } |
356 | 357 |
357 void | 358 void |
358 PssFfMacScheduler::DoSchedDlMacBufferReq (const struct FfMacSchedSapProvider::Sc
hedDlMacBufferReqParameters& params) | 359 PssFfMacScheduler::DoSchedDlMacBufferReq (const struct FfMacSchedSapProvider::Sc
hedDlMacBufferReqParameters& params) |
359 { | 360 { |
360 NS_LOG_FUNCTION (this); | 361 NS_LOG_FUNCTION (this); |
361 NS_FATAL_ERROR ("method not implemented"); | 362 NS_FATAL_ERROR ("method not implemented"); |
| 363 NS_UNUSED(params); |
362 return; | 364 return; |
363 } | 365 } |
364 | 366 |
365 int | 367 int |
366 PssFfMacScheduler::GetRbgSize (int dlbandwidth) | 368 PssFfMacScheduler::GetRbgSize (int dlbandwidth) |
367 { | 369 { |
368 for (int i = 0; i < 4; i++) | 370 for (int i = 0; i < 4; i++) |
369 { | 371 { |
370 if (dlbandwidth < PssType0AllocationRbg[i]) | 372 if (dlbandwidth < PssType0AllocationRbg[i]) |
371 { | 373 { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 { | 535 { |
534 if ((*it) == true ) | 536 if ((*it) == true ) |
535 { | 537 { |
536 rbgAllocatedNum++; | 538 rbgAllocatedNum++; |
537 } | 539 } |
538 } | 540 } |
539 | 541 |
540 FfMacSchedSapUser::SchedDlConfigIndParameters ret; | 542 FfMacSchedSapUser::SchedDlConfigIndParameters ret; |
541 | 543 |
542 // update UL HARQ proc id | 544 // update UL HARQ proc id |
543 std::map <uint16_t, uint8_t>::iterator itProcId; | 545 for (std::map <uint16_t, uint8_t>::iterator itProcId = m_ulHarqCurrentProcessI
d.begin (); itProcId != m_ulHarqCurrentProcessId.end (); itProcId++) |
544 for (itProcId = m_ulHarqCurrentProcessId.begin (); itProcId != m_ulHarqCurrent
ProcessId.end (); itProcId++) | |
545 { | 546 { |
546 (*itProcId).second = ((*itProcId).second + 1) % HARQ_PROC_NUM; | 547 (*itProcId).second = ((*itProcId).second + 1) % HARQ_PROC_NUM; |
547 } | 548 } |
548 | 549 |
549 // RACH Allocation | 550 // RACH Allocation |
550 uint16_t rbAllocatedNum = 0; | 551 uint16_t rbAllocatedNum = 0; |
551 std::vector <bool> ulRbMap; | 552 std::vector <bool> ulRbMap; |
552 ulRbMap.resize (m_cschedCellConfig.m_ulBandwidth, false); | 553 ulRbMap.resize (m_cschedCellConfig.m_ulBandwidth, false); |
553 ulRbMap = m_ffrSapProvider->GetAvailableUlRbg (); | 554 ulRbMap = m_ffrSapProvider->GetAvailableUlRbg (); |
554 uint8_t maxContinuousUlBandwidth = 0; | 555 uint8_t maxContinuousUlBandwidth = 0; |
555 uint8_t tmpMinBandwidth = 0; | 556 uint8_t tmpMinBandwidth = 0; |
556 uint16_t ffrRbStartOffset = 0; | 557 uint8_t ffrRbStartOffset = 0; |
557 uint16_t tmpFfrRbStartOffset = 0; | 558 uint8_t tmpFfrRbStartOffset = 0; |
558 uint16_t index = 0; | 559 uint8_t index = 0; |
559 | 560 |
560 for (std::vector<bool>::iterator it = ulRbMap.begin (); it != ulRbMap.end ();
it++) | 561 for (std::vector<bool>::iterator it = ulRbMap.begin (); it != ulRbMap.end ();
it++) |
561 { | 562 { |
562 if ((*it) == true ) | 563 if ((*it) == true ) |
563 { | 564 { |
564 rbAllocatedNum++; | 565 rbAllocatedNum++; |
565 if (tmpMinBandwidth > maxContinuousUlBandwidth) | 566 if (tmpMinBandwidth > maxContinuousUlBandwidth) |
566 { | 567 { |
567 maxContinuousUlBandwidth = tmpMinBandwidth; | 568 maxContinuousUlBandwidth = tmpMinBandwidth; |
568 ffrRbStartOffset = tmpFfrRbStartOffset; | 569 ffrRbStartOffset = tmpFfrRbStartOffset; |
(...skipping 11 matching lines...) Expand all Loading... |
580 index++; | 581 index++; |
581 } | 582 } |
582 | 583 |
583 if (tmpMinBandwidth > maxContinuousUlBandwidth) | 584 if (tmpMinBandwidth > maxContinuousUlBandwidth) |
584 { | 585 { |
585 maxContinuousUlBandwidth = tmpMinBandwidth; | 586 maxContinuousUlBandwidth = tmpMinBandwidth; |
586 ffrRbStartOffset = tmpFfrRbStartOffset; | 587 ffrRbStartOffset = tmpFfrRbStartOffset; |
587 } | 588 } |
588 | 589 |
589 m_rachAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0); | 590 m_rachAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0); |
590 uint16_t rbStart = 0; | 591 uint8_t rbStart = 0; |
591 rbStart = ffrRbStartOffset; | 592 rbStart = ffrRbStartOffset; |
592 std::vector <struct RachListElement_s>::iterator itRach; | 593 std::vector <struct RachListElement_s>::iterator itRach; |
593 for (itRach = m_rachList.begin (); itRach != m_rachList.end (); itRach++) | 594 for (itRach = m_rachList.begin (); itRach != m_rachList.end (); itRach++) |
594 { | 595 { |
595 NS_ASSERT_MSG (m_amc->GetUlTbSizeFromMcs (m_ulGrantMcs, m_cschedCellConfig
.m_ulBandwidth) > (*itRach).m_estimatedSize, " Default UL Grant MCS does not all
ow to send RACH messages"); | 596 NS_ASSERT_MSG (m_amc->GetUlTbSizeFromMcs (m_ulGrantMcs, m_cschedCellConfig
.m_ulBandwidth) > (*itRach).m_estimatedSize, " Default UL Grant MCS does not all
ow to send RACH messages"); |
596 BuildRarListElement_s newRar; | 597 BuildRarListElement_s newRar; |
597 newRar.m_rnti = (*itRach).m_rnti; | 598 newRar.m_rnti = (*itRach).m_rnti; |
598 // DL-RACH Allocation | 599 // DL-RACH Allocation |
599 // Ideal: no needs of configuring m_dci | 600 // Ideal: no needs of configuring m_dci |
600 // UL-RACH Allocation | 601 // UL-RACH Allocation |
601 newRar.m_grant.m_rnti = newRar.m_rnti; | 602 newRar.m_grant.m_rnti = newRar.m_rnti; |
602 newRar.m_grant.m_mcs = m_ulGrantMcs; | 603 newRar.m_grant.m_mcs = m_ulGrantMcs; |
603 uint16_t rbLen = 1; | 604 uint8_t rbLen = 1; |
604 uint16_t tbSizeBits = 0; | 605 uint16_t tbSizeBits = 0; |
605 // find lowest TB size that fits UL grant estimated size | 606 // find lowest TB size that fits UL grant estimated size |
606 while ((tbSizeBits < (*itRach).m_estimatedSize) && (rbStart + rbLen < (ffr
RbStartOffset + maxContinuousUlBandwidth))) | 607 while ((tbSizeBits < (*itRach).m_estimatedSize) && (rbStart + rbLen < (ffr
RbStartOffset + maxContinuousUlBandwidth))) |
607 { | 608 { |
608 rbLen++; | 609 rbLen++; |
609 tbSizeBits = m_amc->GetUlTbSizeFromMcs (m_ulGrantMcs, rbLen); | 610 tbSizeBits = m_amc->GetUlTbSizeFromMcs (m_ulGrantMcs, rbLen); |
610 } | 611 } |
611 if (tbSizeBits < (*itRach).m_estimatedSize) | 612 if (tbSizeBits < (*itRach).m_estimatedSize) |
612 { | 613 { |
613 // no more allocation space: finish allocation | 614 // no more allocation space: finish allocation |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 } | 696 } |
696 std::vector <struct DlInfoListElement_s> dlInfoListUntxed; | 697 std::vector <struct DlInfoListElement_s> dlInfoListUntxed; |
697 for (uint16_t i = 0; i < m_dlInfoListBuffered.size (); i++) | 698 for (uint16_t i = 0; i < m_dlInfoListBuffered.size (); i++) |
698 { | 699 { |
699 std::set <uint16_t>::iterator itRnti = rntiAllocated.find (m_dlInfoListBuf
fered.at (i).m_rnti); | 700 std::set <uint16_t>::iterator itRnti = rntiAllocated.find (m_dlInfoListBuf
fered.at (i).m_rnti); |
700 if (itRnti != rntiAllocated.end ()) | 701 if (itRnti != rntiAllocated.end ()) |
701 { | 702 { |
702 // RNTI already allocated for retx | 703 // RNTI already allocated for retx |
703 continue; | 704 continue; |
704 } | 705 } |
705 uint8_t nLayers = m_dlInfoListBuffered.at (i).m_harqStatus.size (); | 706 uint8_t nLayers = static_cast<uint8_t>(m_dlInfoListBuffered.at (i).m_harqS
tatus.size ()); |
706 std::vector <bool> retx; | 707 std::vector <bool> retx; |
707 NS_LOG_INFO (this << " Processing DLHARQ feedback"); | 708 NS_LOG_INFO (this << " Processing DLHARQ feedback"); |
708 if (nLayers == 1) | 709 if (nLayers == 1) |
709 { | 710 { |
710 retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlI
nfoListElement_s::NACK); | 711 retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlI
nfoListElement_s::NACK); |
711 retx.push_back (false); | 712 retx.push_back (false); |
712 } | 713 } |
713 else | 714 else |
714 { | 715 { |
715 retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlI
nfoListElement_s::NACK); | 716 retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlI
nfoListElement_s::NACK); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 NS_LOG_INFO ("RBG " << dciRbg.at (j) << " assigned"); | 793 NS_LOG_INFO ("RBG " << dciRbg.at (j) << " assigned"); |
793 rbgAllocatedNum++; | 794 rbgAllocatedNum++; |
794 } | 795 } |
795 | 796 |
796 NS_LOG_INFO (this << " Send retx in the same RBGs"); | 797 NS_LOG_INFO (this << " Send retx in the same RBGs"); |
797 } | 798 } |
798 else | 799 else |
799 { | 800 { |
800 // find RBGs for sending HARQ retx | 801 // find RBGs for sending HARQ retx |
801 uint8_t j = 0; | 802 uint8_t j = 0; |
802 uint8_t rbgId = (dciRbg.at (dciRbg.size () - 1) + 1) % rbgNum; | 803 uint8_t rbgId = static_cast<uint8_t>((dciRbg.at (dciRbg.size () -
1) + 1) % rbgNum); |
803 uint8_t startRbg = dciRbg.at (dciRbg.size () - 1); | 804 uint8_t startRbg = static_cast<uint8_t>(dciRbg.at (dciRbg.size ()
- 1)); |
804 std::vector <bool> rbgMapCopy = rbgMap; | 805 std::vector <bool> rbgMapCopy = rbgMap; |
805 while ((j < dciRbg.size ())&&(startRbg != rbgId)) | 806 while ((j < dciRbg.size ())&&(startRbg != rbgId)) |
806 { | 807 { |
807 if (rbgMapCopy.at (rbgId) == false) | 808 if (rbgMapCopy.at (rbgId) == false) |
808 { | 809 { |
809 rbgMapCopy.at (rbgId) = true; | 810 rbgMapCopy.at (rbgId) = true; |
810 dciRbg.at (j) = rbgId; | 811 dciRbg.at (j) = rbgId; |
811 j++; | 812 j++; |
812 } | 813 } |
813 rbgId = (rbgId + 1) % rbgNum; | 814 rbgId = (rbgId + 1) % rbgNum; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 { | 940 { |
940 // all the RBGs are already allocated -> exit | 941 // all the RBGs are already allocated -> exit |
941 if ((ret.m_buildDataList.size () > 0) || (ret.m_buildRarList.size () > 0)) | 942 if ((ret.m_buildDataList.size () > 0) || (ret.m_buildRarList.size () > 0)) |
942 { | 943 { |
943 m_schedSapUser->SchedDlConfigInd (ret); | 944 m_schedSapUser->SchedDlConfigInd (ret); |
944 } | 945 } |
945 return; | 946 return; |
946 } | 947 } |
947 | 948 |
948 | 949 |
949 std::map <uint16_t, pssFlowPerf_t>::iterator it; | |
950 std::map <uint16_t, pssFlowPerf_t> tdUeSet; // the result of TD scheduler | 950 std::map <uint16_t, pssFlowPerf_t> tdUeSet; // the result of TD scheduler |
951 | 951 |
952 // schedulability check | 952 // schedulability check |
953 std::map <uint16_t, pssFlowPerf_t> ueSet; | 953 std::map <uint16_t, pssFlowPerf_t> ueSet; |
954 for (it = m_flowStatsDl.begin (); it != m_flowStatsDl.end (); it++) | 954 for (std::map <uint16_t, pssFlowPerf_t>::iterator it = m_flowStatsDl.begin ();
it != m_flowStatsDl.end (); it++) |
955 { | 955 { |
956 if( LcActivePerFlow ((*it).first) > 0 ) | 956 if( LcActivePerFlow ((*it).first) > 0 ) |
957 { | 957 { |
958 ueSet.insert(std::pair <uint16_t, pssFlowPerf_t> ((*it).first, (*it).s
econd)); | 958 ueSet.insert(std::pair <uint16_t, pssFlowPerf_t> ((*it).first, (*it).s
econd)); |
959 } | 959 } |
960 } | 960 } |
961 | 961 |
962 if (ueSet.size() != 0) | 962 if (ueSet.size() != 0) |
963 { // has data in RLC buffer | 963 { // has data in RLC buffer |
964 | 964 |
965 // Time Domain scheduler | 965 // Time Domain scheduler |
966 std::vector <std::pair<double, uint16_t> > ueSet1; | 966 std::vector <std::pair<double, uint16_t> > ueSet1; |
967 std::vector <std::pair<double,uint16_t> > ueSet2; | 967 std::vector <std::pair<double,uint16_t> > ueSet2; |
968 for (it = ueSet.begin (); it != ueSet.end (); it++) | 968 for (std::map <uint16_t, pssFlowPerf_t>::iterator it = ueSet.begin (); it
!= ueSet.end (); it++) |
969 { | 969 { |
970 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first
); | 970 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first
); |
971 if ((itRnti != rntiAllocated.end ())||(!HarqProcessAvailability ((*it)
.first))) | 971 if ((itRnti != rntiAllocated.end ())||(!HarqProcessAvailability ((*it)
.first))) |
972 { | 972 { |
973 // UE already allocated for HARQ or without HARQ process available
-> drop it | 973 // UE already allocated for HARQ or without HARQ process available
-> drop it |
974 if (itRnti != rntiAllocated.end ()) | 974 if (itRnti != rntiAllocated.end ()) |
975 { | 975 { |
976 NS_LOG_DEBUG (this << " RNTI discared for HARQ tx" << (uint16_t)
(*it).first); | 976 NS_LOG_DEBUG (this << " RNTI discared for HARQ tx" << (uint16_t)
(*it).first); |
977 } | 977 } |
978 if (!HarqProcessAvailability ((*it).first)) | 978 if (!HarqProcessAvailability ((*it).first)) |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 } | 1039 } |
1040 ···· | 1040 ···· |
1041 if (wbCqi > 0) | 1041 if (wbCqi > 0) |
1042 { | 1042 { |
1043 if (LcActivePerFlow ((*it).first) > 0) | 1043 if (LcActivePerFlow ((*it).first) > 0) |
1044 { | 1044 { |
1045 // this UE has data to transmit | 1045 // this UE has data to transmit |
1046 double achievableRate = 0.0; | 1046 double achievableRate = 0.0; |
1047 for (uint8_t k = 0; k < nLayer; k++)· | 1047 for (uint8_t k = 0; k < nLayer; k++)· |
1048 { | 1048 { |
1049 uint8_t mcs = 0;· | 1049 uint8_t mcs = m_amc->GetMcsFromCqi (wbCqi); |
1050 mcs = m_amc->GetMcsFromCqi (wbCqi); | |
1051 achievableRate += ((m_amc->GetDlTbSizeFromMcs (mcs, rb
gSize) / 8) / 0.001); // = TB size / TTI | 1050 achievableRate += ((m_amc->GetDlTbSizeFromMcs (mcs, rb
gSize) / 8) / 0.001); // = TB size / TTI |
1052 } | 1051 } |
1053 ···· | 1052 ···· |
1054 metric = achievableRate / (*it).second.lastAveragedThrough
put; | 1053 metric = achievableRate / (*it).second.lastAveragedThrough
put; |
1055 } | 1054 } |
1056 ueSet2.push_back(std::pair<double, uint16_t> (metric, (*it).fi
rst)); | 1055 ueSet2.push_back(std::pair<double, uint16_t> (metric, (*it).fi
rst)); |
1057 } // end of wbCqi | 1056 } // end of wbCqi |
1058 } | 1057 } |
1059 }// end of ueSet | 1058 }// end of ueSet |
1060 ···· | 1059 ···· |
1061 ···· | 1060 ···· |
1062 if (ueSet1.size () != 0 || ueSet2.size () != 0) | 1061 if (ueSet1.size () != 0 || ueSet2.size () != 0) |
1063 { | 1062 { |
1064 // sorting UE in ueSet1 and ueSet1 in descending order based on their
metric value | 1063 // sorting UE in ueSet1 and ueSet1 in descending order based on their
metric value |
1065 std::sort (ueSet1.rbegin (), ueSet1.rend ()); | 1064 std::sort (ueSet1.rbegin (), ueSet1.rend ()); |
1066 std::sort (ueSet2.rbegin (), ueSet2.rend ()); | 1065 std::sort (ueSet2.rbegin (), ueSet2.rend ()); |
1067 · | 1066 · |
1068 // select UE set for frequency domain scheduler | 1067 // select UE set for frequency domain scheduler |
1069 uint32_t nMux; | 1068 uint32_t nMux; |
1070 if ( m_nMux > 0) | 1069 if ( m_nMux > 0) |
1071 nMux = m_nMux; | 1070 nMux = m_nMux; |
1072 else | 1071 else |
1073 { | 1072 { |
1074 // select half number of UE | 1073 // select half number of UE |
1075 if (ueSet1.size() + ueSet2.size() <=2 ) | 1074 if (ueSet1.size() + ueSet2.size() <=2 ) |
1076 nMux = 1; | 1075 nMux = 1; |
1077 else | 1076 else |
1078 nMux = (int)((ueSet1.size() + ueSet2.size()) / 2) ; // TD schedu
ler only transfers half selected UE per RTT to TD scheduler | 1077 nMux = (int)((ueSet1.size() + ueSet2.size()) / 2) ; // TD schedu
ler only transfers half selected UE per RTT to TD scheduler |
1079 } | 1078 } |
1080 for (it = m_flowStatsDl.begin (); it != m_flowStatsDl.end (); it--) | 1079 for (std::map <uint16_t, pssFlowPerf_t>::iterator it = m_flowStatsDl.b
egin (); it != m_flowStatsDl.end (); it--) |
1081 { | 1080 { |
1082 std::vector <std::pair<double, uint16_t> >::iterator itSet; | 1081 std::vector <std::pair<double, uint16_t> >::iterator itSet; |
1083 for (itSet = ueSet1.begin (); itSet != ueSet1.end () && nMux != 0;
itSet++) | 1082 for (itSet = ueSet1.begin (); itSet != ueSet1.end () && nMux != 0;
itSet++) |
1084 {·· | 1083 {·· |
1085 std::map <uint16_t, pssFlowPerf_t>::iterator itUe; | 1084 std::map <uint16_t, pssFlowPerf_t>::iterator itUe; |
1086 itUe = m_flowStatsDl.find((*itSet).second); | 1085 itUe = m_flowStatsDl.find((*itSet).second); |
1087 tdUeSet.insert(std::pair<uint16_t, pssFlowPerf_t> ( (*itUe).fir
st, (*itUe).second ) ); | 1086 tdUeSet.insert(std::pair<uint16_t, pssFlowPerf_t> ( (*itUe).fir
st, (*itUe).second ) ); |
1088 nMux--; | 1087 nMux--; |
1089 } | 1088 } |
1090 ··········· | 1089 ··········· |
(...skipping 11 matching lines...) Expand all Loading... |
1102 if (nMux == 0) | 1101 if (nMux == 0) |
1103 break; | 1102 break; |
1104 ········ | 1103 ········ |
1105 } // end of m_flowStatsDl | 1104 } // end of m_flowStatsDl |
1106 ········ | 1105 ········ |
1107 ········ | 1106 ········ |
1108 if ( m_fdSchedulerType.compare("CoItA") == 0) | 1107 if ( m_fdSchedulerType.compare("CoItA") == 0) |
1109 { | 1108 { |
1110 // FD scheduler: Carrier over Interference to Average (CoItA) | 1109 // FD scheduler: Carrier over Interference to Average (CoItA) |
1111 std::map < uint16_t, uint8_t > sbCqiSum; | 1110 std::map < uint16_t, uint8_t > sbCqiSum; |
1112 for (it = tdUeSet.begin (); it != tdUeSet.end (); it++) | 1111 for (std::map <uint16_t, pssFlowPerf_t>::iterator it = tdUeSet.beg
in (); it != tdUeSet.end (); it++) |
1113 { | 1112 { |
1114 uint8_t sum = 0; | 1113 uint8_t sum = 0; |
1115 for (int i = 0; i < rbgNum; i++) | 1114 for (int i = 0; i < rbgNum; i++) |
1116 { | 1115 { |
1117 std::map <uint16_t,SbMeasResult_s>::iterator itCqi; | 1116 std::map <uint16_t,SbMeasResult_s>::iterator itCqi; |
1118 itCqi = m_a30CqiRxed.find ((*it).first); | 1117 itCqi = m_a30CqiRxed.find ((*it).first); |
1119 std::map <uint16_t,uint8_t>::iterator itTxMode; | 1118 std::map <uint16_t,uint8_t>::iterator itTxMode; |
1120 itTxMode = m_uesTxMode.find ((*it).first); | 1119 itTxMode = m_uesTxMode.find ((*it).first); |
1121 if (itTxMode == m_uesTxMode.end ()) | 1120 if (itTxMode == m_uesTxMode.end ()) |
1122 { | 1121 { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 sbCqi = 0; | 1157 sbCqi = 0; |
1159 } | 1158 } |
1160 sum += sbCqi; | 1159 sum += sbCqi; |
1161 } | 1160 } |
1162 } // end if cqi | 1161 } // end if cqi |
1163 }// end of rbgNum | 1162 }// end of rbgNum |
1164 ·············· | 1163 ·············· |
1165 sbCqiSum.insert (std::pair<uint16_t, uint8_t> ((*it).first, su
m)); | 1164 sbCqiSum.insert (std::pair<uint16_t, uint8_t> ((*it).first, su
m)); |
1166 }// end tdUeSet | 1165 }// end tdUeSet |
1167 ········ | 1166 ········ |
1168 for (int i = 0; i < rbgNum; i++) | 1167 for (uint16_t i = 0; i < rbgNum; i++) |
1169 { | 1168 { |
1170 if (rbgMap.at (i) == true) | 1169 if (rbgMap.at (i) == true) |
1171 continue; | 1170 continue; |
1172 | 1171 |
1173 std::map <uint16_t, pssFlowPerf_t>::iterator itMax = tdUeSet.e
nd (); | 1172 std::map <uint16_t, pssFlowPerf_t>::iterator itMax = tdUeSet.e
nd (); |
1174 double metricMax = 0.0; | 1173 double metricMax = 0.0; |
1175 for (it = tdUeSet.begin (); it != tdUeSet.end (); it++) | 1174 for (std::map <uint16_t, pssFlowPerf_t>::iterator it = tdUeSet
.begin (); it != tdUeSet.end (); it++) |
1176 { | 1175 { |
1177 if ((m_ffrSapProvider->IsDlRbgAvailableForUe (i, (*it).fir
st)) == false) | 1176 if ((m_ffrSapProvider->IsDlRbgAvailableForUe (i, (*it).fir
st)) == false) |
1178 continue; | 1177 continue; |
1179 | 1178 |
1180 // calculate PF weigth· | 1179 // calculate PF weigth· |
1181 double weight = (*it).second.targetThroughput / (*it).seco
nd.lastAveragedThroughput; | 1180 double weight = (*it).second.targetThroughput / (*it).seco
nd.lastAveragedThroughput; |
1182 if (weight < 1.0) | 1181 if (weight < 1.0) |
1183 weight = 1.0; | 1182 weight = 1.0; |
1184 ········ | 1183 ········ |
1185 std::map < uint16_t, uint8_t>::iterator itSbCqiSum; | 1184 std::map < uint16_t, uint8_t>::iterator itSbCqiSum; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1256 rbgMap.at (i) = true; | 1255 rbgMap.at (i) = true; |
1257 } | 1256 } |
1258 }// end of rbgNum | 1257 }// end of rbgNum |
1259 ········ | 1258 ········ |
1260 }// end of CoIta | 1259 }// end of CoIta |
1261 ········ | 1260 ········ |
1262 ········ | 1261 ········ |
1263 if ( m_fdSchedulerType.compare("PFsch") == 0) | 1262 if ( m_fdSchedulerType.compare("PFsch") == 0) |
1264 { | 1263 { |
1265 // FD scheduler: Proportional Fair scheduled (PFsch) | 1264 // FD scheduler: Proportional Fair scheduled (PFsch) |
1266 for (int i = 0; i < rbgNum; i++) | 1265 for (uint8_t i = 0; i < rbgNum; i++) |
1267 { | 1266 { |
1268 if (rbgMap.at (i) == true) | 1267 if (rbgMap.at (i) == true) |
1269 continue; | 1268 continue; |
1270 | 1269 |
1271 std::map <uint16_t, pssFlowPerf_t>::iterator itMax = tdUeSet.e
nd (); | 1270 std::map <uint16_t, pssFlowPerf_t>::iterator itMax = tdUeSet.e
nd (); |
1272 double metricMax = 0.0; | 1271 double metricMax = 0.0; |
1273 for (it = tdUeSet.begin (); it != tdUeSet.end (); it++) | 1272 for (std::map <uint16_t, pssFlowPerf_t>::iterator it = tdUeSet
.begin (); it != tdUeSet.end (); it++) |
1274 { | 1273 { |
1275 if ((m_ffrSapProvider->IsDlRbgAvailableForUe (i, (*it).fir
st)) == false) | 1274 if ((m_ffrSapProvider->IsDlRbgAvailableForUe (i, (*it).fir
st)) == false) |
1276 continue; | 1275 continue; |
1277 // calculate PF weigth· | 1276 // calculate PF weigth· |
1278 double weight = (*it).second.targetThroughput / (*it).seco
nd.lastAveragedThroughput; | 1277 double weight = (*it).second.targetThroughput / (*it).seco
nd.lastAveragedThroughput; |
1279 if (weight < 1.0) | 1278 if (weight < 1.0) |
1280 weight = 1.0; | 1279 weight = 1.0; |
1281 ········ | 1280 ········ |
1282 std::map <uint16_t,SbMeasResult_s>::iterator itCqi; | 1281 std::map <uint16_t,SbMeasResult_s>::iterator itCqi; |
1283 itCqi = m_a30CqiRxed.find ((*it).first); | 1282 itCqi = m_a30CqiRxed.find ((*it).first); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 while (itMap != allocationMap.end ()) | 1371 while (itMap != allocationMap.end ()) |
1373 { | 1372 { |
1374 // create new BuildDataListElement_s for this LC | 1373 // create new BuildDataListElement_s for this LC |
1375 BuildDataListElement_s newEl; | 1374 BuildDataListElement_s newEl; |
1376 newEl.m_rnti = (*itMap).first; | 1375 newEl.m_rnti = (*itMap).first; |
1377 // create the DlDciListElement_s | 1376 // create the DlDciListElement_s |
1378 DlDciListElement_s newDci; | 1377 DlDciListElement_s newDci; |
1379 newDci.m_rnti = (*itMap).first; | 1378 newDci.m_rnti = (*itMap).first; |
1380 newDci.m_harqProcess = UpdateHarqProcessId ((*itMap).first); | 1379 newDci.m_harqProcess = UpdateHarqProcessId ((*itMap).first); |
1381 | 1380 |
1382 uint16_t lcActives = LcActivePerFlow ((*itMap).first); | 1381 uint16_t lcActives = static_cast<uint16_t>(LcActivePerFlow ((*itMap).first
)); |
1383 NS_LOG_INFO (this << "Allocate user " << newEl.m_rnti << " rbg " << lcActi
ves); | 1382 NS_LOG_INFO (this << "Allocate user " << newEl.m_rnti << " rbg " << lcActi
ves); |
1384 if (lcActives == 0) | 1383 if (lcActives == 0) |
1385 { | 1384 { |
1386 // Set to max value, to avoid divide by 0 below | 1385 // Set to max value, to avoid divide by 0 below |
1387 lcActives = (uint16_t)65535; // UINT16_MAX; | 1386 lcActives = (uint16_t)65535; // UINT16_MAX; |
1388 } | 1387 } |
1389 uint16_t RgbPerRnti = (*itMap).second.size (); | 1388 uint16_t RgbPerRnti = static_cast<uint16_t>((*itMap).second.size ()); |
1390 std::map <uint16_t,SbMeasResult_s>::iterator itCqi; | 1389 std::map <uint16_t,SbMeasResult_s>::iterator itCqi; |
1391 itCqi = m_a30CqiRxed.find ((*itMap).first); | 1390 itCqi = m_a30CqiRxed.find ((*itMap).first); |
1392 std::map <uint16_t,uint8_t>::iterator itTxMode; | 1391 std::map <uint16_t,uint8_t>::iterator itTxMode; |
1393 itTxMode = m_uesTxMode.find ((*itMap).first); | 1392 itTxMode = m_uesTxMode.find ((*itMap).first); |
1394 if (itTxMode == m_uesTxMode.end ()) | 1393 if (itTxMode == m_uesTxMode.end ()) |
1395 { | 1394 { |
1396 NS_FATAL_ERROR ("No Transmission Mode info on user " << (*itMap).first
); | 1395 NS_FATAL_ERROR ("No Transmission Mode info on user " << (*itMap).first
); |
1397 } | 1396 } |
1398 int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second)
; | 1397 int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second)
; |
1399 std::vector <uint8_t> worstCqi (2, 15); | 1398 std::vector <uint8_t> worstCqi (2, 15); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 } | 1437 } |
1439 for (uint8_t j = 0; j < nLayer; j++) | 1438 for (uint8_t j = 0; j < nLayer; j++) |
1440 { | 1439 { |
1441 NS_LOG_INFO (this << " Layer " << (uint16_t)j << " CQI selected " << (
uint16_t)worstCqi.at (j)); | 1440 NS_LOG_INFO (this << " Layer " << (uint16_t)j << " CQI selected " << (
uint16_t)worstCqi.at (j)); |
1442 } | 1441 } |
1443 uint32_t bytesTxed = 0; | 1442 uint32_t bytesTxed = 0; |
1444 for (uint8_t j = 0; j < nLayer; j++) | 1443 for (uint8_t j = 0; j < nLayer; j++) |
1445 { | 1444 { |
1446 newDci.m_mcs.push_back (m_amc->GetMcsFromCqi (worstCqi.at (j))); | 1445 newDci.m_mcs.push_back (m_amc->GetMcsFromCqi (worstCqi.at (j))); |
1447 int tbSize = (m_amc->GetDlTbSizeFromMcs (newDci.m_mcs.at (j), RgbPerRn
ti * rbgSize) / 8); // (size of TB in bytes according to table 7.1.7.2.1-1 of 36
.213) | 1446 int tbSize = (m_amc->GetDlTbSizeFromMcs (newDci.m_mcs.at (j), RgbPerRn
ti * rbgSize) / 8); // (size of TB in bytes according to table 7.1.7.2.1-1 of 36
.213) |
1448 newDci.m_tbsSize.push_back (tbSize); | 1447 newDci.m_tbsSize.push_back (static_cast<uint16_t>(tbSize)); |
1449 NS_LOG_INFO (this << " Layer " << (uint16_t)j << " MCS selected" << m_
amc->GetMcsFromCqi (worstCqi.at (j))); | 1448 NS_LOG_INFO (this << " Layer " << (uint16_t)j << " MCS selected" << m_
amc->GetMcsFromCqi (worstCqi.at (j))); |
1450 bytesTxed += tbSize; | 1449 bytesTxed += tbSize; |
1451 } | 1450 } |
1452 | 1451 |
1453 newDci.m_resAlloc = 0; // only allocation type 0 at this stage | 1452 newDci.m_resAlloc = 0; // only allocation type 0 at this stage |
1454 newDci.m_rbBitmap = 0; // TBD (32 bit bitmap see 7.1.6 of 36.213) | 1453 newDci.m_rbBitmap = 0; // TBD (32 bit bitmap see 7.1.6 of 36.213) |
1455 uint32_t rbgMask = 0; | 1454 uint32_t rbgMask = 0; |
1456 for (uint16_t k = 0; k < (*itMap).second.size (); k++) | 1455 for (uint16_t k = 0; k < (*itMap).second.size (); k++) |
1457 { | 1456 { |
1458 rbgMask = rbgMask + (0x1 << (*itMap).second.at (k)); | 1457 rbgMask = rbgMask + (0x1 << (*itMap).second.at (k)); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1527 // ...more parameters -> ingored in this version | 1526 // ...more parameters -> ingored in this version |
1528 | 1527 |
1529 ret.m_buildDataList.push_back (newEl); | 1528 ret.m_buildDataList.push_back (newEl); |
1530 // update UE stats | 1529 // update UE stats |
1531 std::map <uint16_t, pssFlowPerf_t>::iterator it; | 1530 std::map <uint16_t, pssFlowPerf_t>::iterator it; |
1532 it = m_flowStatsDl.find ((*itMap).first); | 1531 it = m_flowStatsDl.find ((*itMap).first); |
1533 if (it != m_flowStatsDl.end ()) | 1532 if (it != m_flowStatsDl.end ()) |
1534 { | 1533 { |
1535 (*it).second.lastTtiBytesTransmitted = bytesTxed; | 1534 (*it).second.lastTtiBytesTransmitted = bytesTxed; |
1536 NS_LOG_INFO (this << " UE total bytes txed " << (*it).second.lastTtiBy
tesTransmitted); | 1535 NS_LOG_INFO (this << " UE total bytes txed " << (*it).second.lastTtiBy
tesTransmitted); |
1537 | |
1538 | |
1539 } | 1536 } |
1540 else | 1537 else |
1541 { | 1538 { |
1542 NS_FATAL_ERROR (this << " No Stats for this allocated UE"); | 1539 NS_FATAL_ERROR (this << " No Stats for this allocated UE"); |
1543 } | 1540 } |
1544 | 1541 |
1545 itMap++; | 1542 itMap++; |
1546 } // end while allocation | 1543 } // end while allocation |
1547 ret.m_nrOfPdcchOfdmSymbols = 1; /// \todo check correct value according the
DCIs txed | 1544 ret.m_nrOfPdcchOfdmSymbols = 1; /// \todo check correct value according the
DCIs txed |
1548 | 1545 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1700 | 1697 |
1701 for (std::vector<bool>::iterator it = rbMap.begin (); it != rbMap.end (); it++
) | 1698 for (std::vector<bool>::iterator it = rbMap.begin (); it != rbMap.end (); it++
) |
1702 { | 1699 { |
1703 if ((*it) == true ) | 1700 if ((*it) == true ) |
1704 { | 1701 { |
1705 rbAllocatedNum++; | 1702 rbAllocatedNum++; |
1706 } | 1703 } |
1707 } | 1704 } |
1708 | 1705 |
1709 uint8_t minContinuousUlBandwidth = m_ffrSapProvider->GetMinContinuousUlBandwid
th (); | 1706 uint8_t minContinuousUlBandwidth = m_ffrSapProvider->GetMinContinuousUlBandwid
th (); |
1710 uint8_t ffrUlBandwidth = m_cschedCellConfig.m_ulBandwidth - rbAllocatedNum; | 1707 uint8_t ffrUlBandwidth = static_cast<uint8_t>(m_cschedCellConfig.m_ulBandwidth
- rbAllocatedNum); |
1711 | 1708 |
1712 | 1709 |
1713 // remove RACH allocation | 1710 // remove RACH allocation |
1714 for (uint16_t i = 0; i < m_cschedCellConfig.m_ulBandwidth; i++) | 1711 for (uint16_t i = 0; i < m_cschedCellConfig.m_ulBandwidth; i++) |
1715 { | 1712 { |
1716 if (rbgAllocationMap.at (i) != 0) | 1713 if (rbgAllocationMap.at (i) != 0) |
1717 { | 1714 { |
1718 rbMap.at (i) = true; | 1715 rbMap.at (i) = true; |
1719 NS_LOG_DEBUG (this << " Allocated for RACH " << i); | 1716 NS_LOG_DEBUG (this << " Allocated for RACH " << i); |
1720 } | 1717 } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1814 { | 1811 { |
1815 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> >
(params.m_sfnSf, rbgAllocationMap)); | 1812 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> >
(params.m_sfnSf, rbgAllocationMap)); |
1816 m_schedSapUser->SchedUlConfigInd (ret); | 1813 m_schedSapUser->SchedUlConfigInd (ret); |
1817 } | 1814 } |
1818 ········ | 1815 ········ |
1819 return; // no flows to be scheduled | 1816 return; // no flows to be scheduled |
1820 } | 1817 } |
1821 | 1818 |
1822 | 1819 |
1823 // Divide the remaining resources equally among the active users starting from
the subsequent one served last scheduling trigger | 1820 // Divide the remaining resources equally among the active users starting from
the subsequent one served last scheduling trigger |
1824 uint16_t tempRbPerFlow = (ffrUlBandwidth) / (nflows + rntiAllocated.size ()); | 1821 uint16_t tempRbPerFlow = static_cast<uint16_t>((ffrUlBandwidth) / (nflows + rn
tiAllocated.size ())); |
1825 uint16_t rbPerFlow = (minContinuousUlBandwidth < tempRbPerFlow) ? minContinuou
sUlBandwidth : tempRbPerFlow; | 1822 uint16_t rbPerFlow = (minContinuousUlBandwidth < tempRbPerFlow) ? minContinuou
sUlBandwidth : tempRbPerFlow; |
1826 | 1823 |
1827 if (rbPerFlow < 3) | 1824 if (rbPerFlow < 3) |
1828 { | 1825 { |
1829 rbPerFlow = 3; // at least 3 rbg per flow (till available resource) to en
sure TxOpportunity >= 7 bytes | 1826 rbPerFlow = 3; // at least 3 rbg per flow (till available resource) to en
sure TxOpportunity >= 7 bytes |
1830 } | 1827 } |
1831 int rbAllocated = 0; | 1828 uint16_t rbAllocated = 0; |
1832 | 1829 |
1833 std::map <uint16_t, pssFlowPerf_t>::iterator itStats; | 1830 std::map <uint16_t, pssFlowPerf_t>::iterator itStats; |
1834 if (m_nextRntiUl != 0) | 1831 if (m_nextRntiUl != 0) |
1835 { | 1832 { |
1836 for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) | 1833 for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) |
1837 { | 1834 { |
1838 if ((*it).first == m_nextRntiUl) | 1835 if ((*it).first == m_nextRntiUl) |
1839 { | 1836 { |
1840 break; | 1837 break; |
1841 } | 1838 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1873 if (rbPerFlow < 3) | 1870 if (rbPerFlow < 3) |
1874 { | 1871 { |
1875 // terminate allocation | 1872 // terminate allocation |
1876 rbPerFlow = 0;······ | 1873 rbPerFlow = 0;······ |
1877 } | 1874 } |
1878 } | 1875 } |
1879 | 1876 |
1880 rbAllocated = 0; | 1877 rbAllocated = 0; |
1881 UlDciListElement_s uldci; | 1878 UlDciListElement_s uldci; |
1882 uldci.m_rnti = (*it).first; | 1879 uldci.m_rnti = (*it).first; |
1883 uldci.m_rbLen = rbPerFlow; | 1880 uldci.m_rbLen = static_cast<uint8_t>(rbPerFlow); |
| 1881 uldci.m_rbStart = 0; |
1884 bool allocated = false; | 1882 bool allocated = false; |
1885 NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << r
bPerFlow << " flows " << nflows); | 1883 NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << r
bPerFlow << " flows " << nflows); |
1886 while ((!allocated)&&((rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBa
ndwidth) < 1) && (rbPerFlow != 0)) | 1884 while ((!allocated)&&((rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBa
ndwidth) < 1) && (rbPerFlow != 0)) |
1887 { | 1885 { |
1888 // check availability | 1886 // check availability |
1889 bool free = true; | 1887 bool free = true; |
1890 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) | 1888 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) |
1891 { | 1889 { |
1892 if (rbMap.at (j) == true) | 1890 if (rbMap.at (j) == true) |
1893 { | 1891 { |
1894 free = false; | 1892 free = false; |
1895 break; | 1893 break; |
1896 } | 1894 } |
1897 if ((m_ffrSapProvider->IsUlRbgAvailableForUe (j, (*it).first)) ==
false) | 1895 if ((m_ffrSapProvider->IsUlRbgAvailableForUe (j, (*it).first)) ==
false) |
1898 { | 1896 { |
1899 free = false; | 1897 free = false; |
1900 break; | 1898 break; |
1901 } | 1899 } |
1902 } | 1900 } |
1903 if (free) | 1901 if (free) |
1904 { | 1902 { |
1905 NS_LOG_INFO (this << "RNTI: "<< (*it).first<< " RB Allocated "
<< rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows); | 1903 NS_LOG_INFO (this << "RNTI: "<< (*it).first<< " RB Allocated "
<< rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows); |
1906 uldci.m_rbStart = rbAllocated; | 1904 uldci.m_rbStart = static_cast<uint8_t>(rbAllocated); |
1907 | 1905 |
1908 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) | 1906 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) |
1909 { | 1907 { |
1910 rbMap.at (j) = true; | 1908 rbMap.at (j) = true; |
1911 // store info on allocation for managing ul-cqi interpretation | 1909 // store info on allocation for managing ul-cqi interpretation |
1912 rbgAllocationMap.at (j) = (*it).first; | 1910 rbgAllocationMap.at (j) = (*it).first; |
1913 } | 1911 } |
1914 rbAllocated += rbPerFlow; | 1912 rbAllocated += rbPerFlow; |
1915 allocated = true; | 1913 allocated = true; |
1916 break; | 1914 break; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2056 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params
.m_sfnSf, rbgAllocationMap)); | 2054 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params
.m_sfnSf, rbgAllocationMap)); |
2057 m_schedSapUser->SchedUlConfigInd (ret); | 2055 m_schedSapUser->SchedUlConfigInd (ret); |
2058 | 2056 |
2059 return; | 2057 return; |
2060 } | 2058 } |
2061 | 2059 |
2062 void | 2060 void |
2063 PssFfMacScheduler::DoSchedUlNoiseInterferenceReq (const struct FfMacSchedSapProv
ider::SchedUlNoiseInterferenceReqParameters& params) | 2061 PssFfMacScheduler::DoSchedUlNoiseInterferenceReq (const struct FfMacSchedSapProv
ider::SchedUlNoiseInterferenceReqParameters& params) |
2064 { | 2062 { |
2065 NS_LOG_FUNCTION (this); | 2063 NS_LOG_FUNCTION (this); |
| 2064 NS_UNUSED(params); |
2066 return; | 2065 return; |
2067 } | 2066 } |
2068 | 2067 |
2069 void | 2068 void |
2070 PssFfMacScheduler::DoSchedUlSrInfoReq (const struct FfMacSchedSapProvider::Sched
UlSrInfoReqParameters& params) | 2069 PssFfMacScheduler::DoSchedUlSrInfoReq (const struct FfMacSchedSapProvider::Sched
UlSrInfoReqParameters& params) |
2071 { | 2070 { |
2072 NS_LOG_FUNCTION (this); | 2071 NS_LOG_FUNCTION (this); |
| 2072 NS_UNUSED(params); |
2073 return; | 2073 return; |
2074 } | 2074 } |
2075 | 2075 |
2076 void | 2076 void |
2077 PssFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider::
SchedUlMacCtrlInfoReqParameters& params) | 2077 PssFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider::
SchedUlMacCtrlInfoReqParameters& params) |
2078 { | 2078 { |
2079 NS_LOG_FUNCTION (this); | 2079 NS_LOG_FUNCTION (this); |
2080 | 2080 |
2081 std::map <uint16_t,uint32_t>::iterator it; | 2081 std::map <uint16_t,uint32_t>::iterator it; |
2082 | 2082 |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2430 { | 2430 { |
2431 NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode); | 2431 NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode); |
2432 FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params; | 2432 FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params; |
2433 params.m_rnti = rnti; | 2433 params.m_rnti = rnti; |
2434 params.m_transmissionMode = txMode; | 2434 params.m_transmissionMode = txMode; |
2435 m_cschedSapUser->CschedUeConfigUpdateInd (params); | 2435 m_cschedSapUser->CschedUeConfigUpdateInd (params); |
2436 } | 2436 } |
2437 | 2437 |
2438 | 2438 |
2439 } | 2439 } |
OLD | NEW |