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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 return; | 156 return; |
157 } | 157 } |
158 | 158 |
159 void | 159 void |
160 FdBetFfMacScheduler::DoCschedUeConfigReq (const struct FfMacCschedSapProvider::C
schedUeConfigReqParameters& params) | 160 FdBetFfMacScheduler::DoCschedUeConfigReq (const struct FfMacCschedSapProvider::C
schedUeConfigReqParameters& params) |
161 { | 161 { |
162 NS_LOG_FUNCTION (this << " RNTI " << params.m_rnti << " txMode " << (uint16_t)
params.m_transmissionMode); | 162 NS_LOG_FUNCTION (this << " RNTI " << params.m_rnti << " txMode " << (uint16_t)
params.m_transmissionMode); |
163 std::map <uint16_t,uint8_t>::iterator it = m_uesTxMode.find (params.m_rnti); | 163 std::map <uint16_t,uint8_t>::iterator it = m_uesTxMode.find (params.m_rnti); |
164 if (it == m_uesTxMode.end ()) | 164 if (it == m_uesTxMode.end ()) |
165 { | 165 { |
166 m_uesTxMode.insert (std::pair <uint16_t, double> (params.m_rnti, params.m_
transmissionMode)); | 166 m_uesTxMode.insert (std::pair <uint16_t, uint8_t> (params.m_rnti, params.m
_transmissionMode)); |
167 // generate HARQ buffers | 167 // generate HARQ buffers |
168 m_dlHarqCurrentProcessId.insert (std::pair <uint16_t,uint8_t > (params.m_r
nti, 0)); | 168 m_dlHarqCurrentProcessId.insert (std::pair <uint16_t,uint8_t > (params.m_r
nti, 0)); |
169 DlHarqProcessesStatus_t dlHarqPrcStatus; | 169 DlHarqProcessesStatus_t dlHarqPrcStatus; |
170 dlHarqPrcStatus.resize (8,0); | 170 dlHarqPrcStatus.resize (8,0); |
171 m_dlHarqProcessesStatus.insert (std::pair <uint16_t, DlHarqProcessesStatus
_t> (params.m_rnti, dlHarqPrcStatus)); | 171 m_dlHarqProcessesStatus.insert (std::pair <uint16_t, DlHarqProcessesStatus
_t> (params.m_rnti, dlHarqPrcStatus)); |
172 DlHarqProcessesTimer_t dlHarqProcessesTimer; | 172 DlHarqProcessesTimer_t dlHarqProcessesTimer; |
173 dlHarqProcessesTimer.resize (8,0); | 173 dlHarqProcessesTimer.resize (8,0); |
174 m_dlHarqProcessesTimer.insert (std::pair <uint16_t, DlHarqProcessesTimer_t
> (params.m_rnti, dlHarqProcessesTimer)); | 174 m_dlHarqProcessesTimer.insert (std::pair <uint16_t, DlHarqProcessesTimer_t
> (params.m_rnti, dlHarqProcessesTimer)); |
175 DlHarqProcessesDciBuffer_t dlHarqdci; | 175 DlHarqProcessesDciBuffer_t dlHarqdci; |
176 dlHarqdci.resize (8); | 176 dlHarqdci.resize (8); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 } | 313 } |
314 | 314 |
315 return; | 315 return; |
316 } | 316 } |
317 | 317 |
318 void | 318 void |
319 FdBetFfMacScheduler::DoSchedDlPagingBufferReq (const struct FfMacSchedSapProvide
r::SchedDlPagingBufferReqParameters& params) | 319 FdBetFfMacScheduler::DoSchedDlPagingBufferReq (const struct FfMacSchedSapProvide
r::SchedDlPagingBufferReqParameters& params) |
320 { | 320 { |
321 NS_LOG_FUNCTION (this); | 321 NS_LOG_FUNCTION (this); |
322 NS_FATAL_ERROR ("method not implemented"); | 322 NS_FATAL_ERROR ("method not implemented"); |
| 323 NS_UNUSED(params); |
323 return; | 324 return; |
324 } | 325 } |
325 | 326 |
326 void | 327 void |
327 FdBetFfMacScheduler::DoSchedDlMacBufferReq (const struct FfMacSchedSapProvider::
SchedDlMacBufferReqParameters& params) | 328 FdBetFfMacScheduler::DoSchedDlMacBufferReq (const struct FfMacSchedSapProvider::
SchedDlMacBufferReqParameters& params) |
328 { | 329 { |
329 NS_LOG_FUNCTION (this); | 330 NS_LOG_FUNCTION (this); |
330 NS_FATAL_ERROR ("method not implemented"); | 331 NS_FATAL_ERROR ("method not implemented"); |
| 332 NS_UNUSED(params); |
331 return; | 333 return; |
332 } | 334 } |
333 | 335 |
334 int | 336 int |
335 FdBetFfMacScheduler::GetRbgSize (int dlbandwidth) | 337 FdBetFfMacScheduler::GetRbgSize (int dlbandwidth) |
336 { | 338 { |
337 for (int i = 0; i < 4; i++) | 339 for (int i = 0; i < 4; i++) |
338 { | 340 { |
339 if (dlbandwidth < FdBetType0AllocationRbg[i]) | 341 if (dlbandwidth < FdBetType0AllocationRbg[i]) |
340 { | 342 { |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 int rbgNum = m_cschedCellConfig.m_dlBandwidth / rbgSize; | 495 int rbgNum = m_cschedCellConfig.m_dlBandwidth / rbgSize; |
494 std::map <uint16_t, std::vector <uint16_t> > allocationMap; // RBs map per RNT
I | 496 std::map <uint16_t, std::vector <uint16_t> > allocationMap; // RBs map per RNT
I |
495 std::vector <bool> rbgMap; // global RBGs map | 497 std::vector <bool> rbgMap; // global RBGs map |
496 uint16_t rbgAllocatedNum = 0; | 498 uint16_t rbgAllocatedNum = 0; |
497 std::set <uint16_t> rntiAllocated; | 499 std::set <uint16_t> rntiAllocated; |
498 rbgMap.resize (m_cschedCellConfig.m_dlBandwidth / rbgSize, false); | 500 rbgMap.resize (m_cschedCellConfig.m_dlBandwidth / rbgSize, false); |
499 FfMacSchedSapUser::SchedDlConfigIndParameters ret; | 501 FfMacSchedSapUser::SchedDlConfigIndParameters ret; |
500 | 502 |
501 | 503 |
502 // update UL HARQ proc id | 504 // update UL HARQ proc id |
503 std::map <uint16_t, uint8_t>::iterator itProcId; | 505 for (std::map <uint16_t, uint8_t>::iterator itProcId = m_ulHarqCurrentProcessI
d.begin (); itProcId != m_ulHarqCurrentProcessId.end (); itProcId++) |
504 for (itProcId = m_ulHarqCurrentProcessId.begin (); itProcId != m_ulHarqCurrent
ProcessId.end (); itProcId++) | |
505 { | 506 { |
506 (*itProcId).second = ((*itProcId).second + 1) % HARQ_PROC_NUM; | 507 (*itProcId).second = ((*itProcId).second + 1) % HARQ_PROC_NUM; |
507 } | 508 } |
508 | 509 |
509 // RACH Allocation | 510 // RACH Allocation |
510 m_rachAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0); | 511 m_rachAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0); |
511 uint16_t rbStart = 0; | 512 uint8_t rbStart = 0; |
512 std::vector <struct RachListElement_s>::iterator itRach; | 513 std::vector <struct RachListElement_s>::iterator itRach; |
513 for (itRach = m_rachList.begin (); itRach != m_rachList.end (); itRach++) | 514 for (itRach = m_rachList.begin (); itRach != m_rachList.end (); itRach++) |
514 { | 515 { |
515 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"); | 516 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"); |
516 BuildRarListElement_s newRar; | 517 BuildRarListElement_s newRar; |
517 newRar.m_rnti = (*itRach).m_rnti; | 518 newRar.m_rnti = (*itRach).m_rnti; |
518 // DL-RACH Allocation | 519 // DL-RACH Allocation |
519 // Ideal: no needs of configuring m_dci | 520 // Ideal: no needs of configuring m_dci |
520 // UL-RACH Allocation | 521 // UL-RACH Allocation |
521 newRar.m_grant.m_rnti = newRar.m_rnti; | 522 newRar.m_grant.m_rnti = newRar.m_rnti; |
522 newRar.m_grant.m_mcs = m_ulGrantMcs; | 523 newRar.m_grant.m_mcs = m_ulGrantMcs; |
523 uint16_t rbLen = 1; | 524 uint8_t rbLen = 1; |
524 uint16_t tbSizeBits = 0; | 525 uint16_t tbSizeBits = 0; |
525 // find lowest TB size that fits UL grant estimated size | 526 // find lowest TB size that fits UL grant estimated size |
526 while ((tbSizeBits < (*itRach).m_estimatedSize) && (rbStart + rbLen < m_cs
chedCellConfig.m_ulBandwidth)) | 527 while ((tbSizeBits < (*itRach).m_estimatedSize) && (rbStart + rbLen < m_cs
chedCellConfig.m_ulBandwidth)) |
527 { | 528 { |
528 rbLen++; | 529 rbLen++; |
529 tbSizeBits = m_amc->GetUlTbSizeFromMcs (m_ulGrantMcs, rbLen); | 530 tbSizeBits = m_amc->GetUlTbSizeFromMcs (m_ulGrantMcs, rbLen); |
530 } | 531 } |
531 if (tbSizeBits < (*itRach).m_estimatedSize) | 532 if (tbSizeBits < (*itRach).m_estimatedSize) |
532 { | 533 { |
533 // no more allocation space: finish allocation | 534 // no more allocation space: finish allocation |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 } | 616 } |
616 std::vector <struct DlInfoListElement_s> dlInfoListUntxed; | 617 std::vector <struct DlInfoListElement_s> dlInfoListUntxed; |
617 for (uint16_t i = 0; i < m_dlInfoListBuffered.size (); i++) | 618 for (uint16_t i = 0; i < m_dlInfoListBuffered.size (); i++) |
618 { | 619 { |
619 std::set <uint16_t>::iterator itRnti = rntiAllocated.find (m_dlInfoListBuf
fered.at (i).m_rnti); | 620 std::set <uint16_t>::iterator itRnti = rntiAllocated.find (m_dlInfoListBuf
fered.at (i).m_rnti); |
620 if (itRnti != rntiAllocated.end ()) | 621 if (itRnti != rntiAllocated.end ()) |
621 { | 622 { |
622 // RNTI already allocated for retx | 623 // RNTI already allocated for retx |
623 continue; | 624 continue; |
624 } | 625 } |
625 uint8_t nLayers = m_dlInfoListBuffered.at (i).m_harqStatus.size (); | 626 uint8_t nLayers = static_cast<uint8_t>(m_dlInfoListBuffered.at (i).m_harqS
tatus.size ()); |
626 std::vector <bool> retx; | 627 std::vector <bool> retx; |
627 NS_LOG_INFO (this << " Processing DLHARQ feedback"); | 628 NS_LOG_INFO (this << " Processing DLHARQ feedback"); |
628 if (nLayers == 1) | 629 if (nLayers == 1) |
629 { | 630 { |
630 retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlI
nfoListElement_s::NACK); | 631 retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlI
nfoListElement_s::NACK); |
631 retx.push_back (false); | 632 retx.push_back (false); |
632 } | 633 } |
633 else | 634 else |
634 { | 635 { |
635 retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlI
nfoListElement_s::NACK); | 636 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... |
712 NS_LOG_INFO ("RBG " << dciRbg.at (j) << " assigned"); | 713 NS_LOG_INFO ("RBG " << dciRbg.at (j) << " assigned"); |
713 rbgAllocatedNum++; | 714 rbgAllocatedNum++; |
714 } | 715 } |
715 | 716 |
716 NS_LOG_INFO (this << " Send retx in the same RBGs"); | 717 NS_LOG_INFO (this << " Send retx in the same RBGs"); |
717 } | 718 } |
718 else | 719 else |
719 { | 720 { |
720 // find RBGs for sending HARQ retx | 721 // find RBGs for sending HARQ retx |
721 uint8_t j = 0; | 722 uint8_t j = 0; |
722 uint8_t rbgId = (dciRbg.at (dciRbg.size () - 1) + 1) % rbgNum; | 723 uint8_t rbgId = static_cast<uint8_t>((dciRbg.at (dciRbg.size () -
1) + 1) % rbgNum); |
723 uint8_t startRbg = dciRbg.at (dciRbg.size () - 1); | 724 uint8_t startRbg = static_cast<uint8_t>(dciRbg.at (dciRbg.size ()
- 1)); |
724 std::vector <bool> rbgMapCopy = rbgMap; | 725 std::vector <bool> rbgMapCopy = rbgMap; |
725 while ((j < dciRbg.size ())&&(startRbg != rbgId)) | 726 while ((j < dciRbg.size ())&&(startRbg != rbgId)) |
726 { | 727 { |
727 if (rbgMapCopy.at (rbgId) == false) | 728 if (rbgMapCopy.at (rbgId) == false) |
728 { | 729 { |
729 rbgMapCopy.at (rbgId) = true; | 730 rbgMapCopy.at (rbgId) = true; |
730 dciRbg.at (j) = rbgId; | 731 dciRbg.at (j) = rbgId; |
731 j++; | 732 j++; |
732 } | 733 } |
733 rbgId = (rbgId + 1) % rbgNum; | 734 rbgId = (rbgId + 1) % rbgNum; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
930 if (metric > metricMax) | 931 if (metric > metricMax) |
931 { | 932 { |
932 metricMax = metric; | 933 metricMax = metric; |
933 itMax = it; | 934 itMax = it; |
934 } | 935 } |
935 rbgPerRntiLog.insert (std::pair<uint16_t, int> ((*it).first, 1)); | 936 rbgPerRntiLog.insert (std::pair<uint16_t, int> ((*it).first, 1)); |
936 } | 937 } |
937 | 938 |
938 | 939 |
939 // The scheduler tries the best to achieve the equal throughput among all
UEs | 940 // The scheduler tries the best to achieve the equal throughput among all
UEs |
940 int i = 0; | 941 uint16_t i = 0; |
941 do· | 942 do· |
942 { | 943 { |
943 NS_LOG_INFO (this << " ALLOCATION for RBG " << i << " of " << rbgNum); | 944 NS_LOG_INFO (this << " ALLOCATION for RBG " << i << " of " << rbgNum); |
944 if (rbgMap.at (i) == false) | 945 if (rbgMap.at (i) == false) |
945 { | 946 { |
946 // allocate one RBG to current UE | 947 // allocate one RBG to current UE |
947 std::map <uint16_t, std::vector <uint16_t> >::iterator itMap; | 948 std::map <uint16_t, std::vector <uint16_t> >::iterator itMap; |
948 std::vector <uint16_t> tempMap; | 949 std::vector <uint16_t> tempMap; |
949 itMap = allocationMap.find ((*itMax).first); | 950 itMap = allocationMap.find ((*itMax).first); |
950 if (itMap == allocationMap.end ()) | 951 if (itMap == allocationMap.end ()) |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 while (itMap != allocationMap.end ()) | 1034 while (itMap != allocationMap.end ()) |
1034 { | 1035 { |
1035 // create new BuildDataListElement_s for this LC | 1036 // create new BuildDataListElement_s for this LC |
1036 BuildDataListElement_s newEl; | 1037 BuildDataListElement_s newEl; |
1037 newEl.m_rnti = (*itMap).first; | 1038 newEl.m_rnti = (*itMap).first; |
1038 // create the DlDciListElement_s | 1039 // create the DlDciListElement_s |
1039 DlDciListElement_s newDci; | 1040 DlDciListElement_s newDci; |
1040 newDci.m_rnti = (*itMap).first; | 1041 newDci.m_rnti = (*itMap).first; |
1041 newDci.m_harqProcess = UpdateHarqProcessId ((*itMap).first); | 1042 newDci.m_harqProcess = UpdateHarqProcessId ((*itMap).first); |
1042 | 1043 |
1043 uint16_t lcActives = LcActivePerFlow ((*itMap).first); | 1044 uint16_t lcActives = static_cast<uint16_t>(LcActivePerFlow ((*itMap).first
)); |
1044 NS_LOG_INFO (this << "Allocate user " << newEl.m_rnti << " rbg " << lcActi
ves); | 1045 NS_LOG_INFO (this << "Allocate user " << newEl.m_rnti << " rbg " << lcActi
ves); |
1045 if (lcActives == 0) | 1046 if (lcActives == 0) |
1046 { | 1047 { |
1047 // Set to max value, to avoid divide by 0 below | 1048 // Set to max value, to avoid divide by 0 below |
1048 lcActives = (uint16_t)65535; // UINT16_MAX; | 1049 lcActives = (uint16_t)65535; // UINT16_MAX; |
1049 } | 1050 } |
1050 uint16_t RgbPerRnti = (*itMap).second.size (); | 1051 uint16_t RgbPerRnti = static_cast<uint16_t>((*itMap).second.size ()); |
1051 std::map <uint16_t,uint8_t>::iterator itCqi; | 1052 std::map <uint16_t,uint8_t>::iterator itCqi; |
1052 itCqi = m_p10CqiRxed.find ((*itMap).first); | 1053 itCqi = m_p10CqiRxed.find ((*itMap).first); |
1053 std::map <uint16_t,uint8_t>::iterator itTxMode; | 1054 std::map <uint16_t,uint8_t>::iterator itTxMode; |
1054 itTxMode = m_uesTxMode.find ((*itMap).first); | 1055 itTxMode = m_uesTxMode.find ((*itMap).first); |
1055 if (itTxMode == m_uesTxMode.end ()) | 1056 if (itTxMode == m_uesTxMode.end ()) |
1056 { | 1057 { |
1057 NS_FATAL_ERROR ("No Transmission Mode info on user " << (*itMap).first
); | 1058 NS_FATAL_ERROR ("No Transmission Mode info on user " << (*itMap).first
); |
1058 } | 1059 } |
1059 int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second)
; | 1060 int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second)
; |
1060 | 1061 |
1061 uint32_t bytesTxed = 0; | 1062 uint32_t bytesTxed = 0; |
1062 for (uint8_t j = 0; j < nLayer; j++) | 1063 for (uint8_t j = 0; j < nLayer; j++) |
1063 { | 1064 { |
1064 if (itCqi == m_p10CqiRxed.end ()) | 1065 if (itCqi == m_p10CqiRxed.end ()) |
1065 { | 1066 { |
1066 newDci.m_mcs.push_back (0); // no info on this user -> lowest MCS | 1067 newDci.m_mcs.push_back (0); // no info on this user -> lowest MCS |
1067 } | 1068 } |
1068 else | 1069 else |
1069 { | 1070 { |
1070 newDci.m_mcs.push_back ( m_amc->GetMcsFromCqi ((*itCqi).second) ); | 1071 newDci.m_mcs.push_back ( m_amc->GetMcsFromCqi ((*itCqi).second) ); |
1071 } | 1072 } |
1072 | 1073 |
1073 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) | 1074 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) |
1074 newDci.m_tbsSize.push_back (tbSize); | 1075 newDci.m_tbsSize.push_back (static_cast<uint16_t>(tbSize)); |
1075 bytesTxed += tbSize; | 1076 bytesTxed += tbSize; |
1076 } | 1077 } |
1077 | 1078 |
1078 newDci.m_resAlloc = 0; // only allocation type 0 at this stage | 1079 newDci.m_resAlloc = 0; // only allocation type 0 at this stage |
1079 newDci.m_rbBitmap = 0; // TBD (32 bit bitmap see 7.1.6 of 36.213) | 1080 newDci.m_rbBitmap = 0; // TBD (32 bit bitmap see 7.1.6 of 36.213) |
1080 uint32_t rbgMask = 0; | 1081 uint32_t rbgMask = 0; |
1081 for (uint16_t k = 0; k < (*itMap).second.size (); k++) | 1082 for (uint16_t k = 0; k < (*itMap).second.size (); k++) |
1082 { | 1083 { |
1083 rbgMask = rbgMask + (0x1 << (*itMap).second.at (k)); | 1084 rbgMask = rbgMask + (0x1 << (*itMap).second.at (k)); |
1084 NS_LOG_INFO (this << " Allocated RBG " << (*itMap).second.at (k)); | 1085 NS_LOG_INFO (this << " Allocated RBG " << (*itMap).second.at (k)); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 { | 1147 { |
1147 NS_FATAL_ERROR ("Unable to find HARQ timer for RNTI " << (uint16_t
)newEl.m_rnti); | 1148 NS_FATAL_ERROR ("Unable to find HARQ timer for RNTI " << (uint16_t
)newEl.m_rnti); |
1148 } | 1149 } |
1149 (*itHarqTimer).second.at (newDci.m_harqProcess) = 0; | 1150 (*itHarqTimer).second.at (newDci.m_harqProcess) = 0; |
1150 } | 1151 } |
1151 | 1152 |
1152 // ...more parameters -> ingored in this version | 1153 // ...more parameters -> ingored in this version |
1153 | 1154 |
1154 ret.m_buildDataList.push_back (newEl); | 1155 ret.m_buildDataList.push_back (newEl); |
1155 // update UE stats | 1156 // update UE stats |
1156 std::map <uint16_t, fdbetsFlowPerf_t>::iterator it; | 1157 std::map <uint16_t, fdbetsFlowPerf_t>::iterator fit; |
1157 it = m_flowStatsDl.find ((*itMap).first); | 1158 fit = m_flowStatsDl.find ((*itMap).first); |
1158 if (it != m_flowStatsDl.end ()) | 1159 if (fit != m_flowStatsDl.end ()) |
1159 { | 1160 { |
1160 (*it).second.lastTtiBytesTrasmitted = bytesTxed; | 1161 (*fit).second.lastTtiBytesTrasmitted = bytesTxed; |
1161 NS_LOG_INFO (this << " UE total bytes txed " << (*it).second.lastTtiBy
tesTrasmitted); | 1162 NS_LOG_INFO (this << " UE total bytes txed " << (*fit).second.lastTtiB
ytesTrasmitted); |
1162 | |
1163 | |
1164 } | 1163 } |
1165 else | 1164 else |
1166 { | 1165 { |
1167 NS_FATAL_ERROR (this << " No Stats for this allocated UE"); | 1166 NS_FATAL_ERROR (this << " No Stats for this allocated UE"); |
1168 } | 1167 } |
1169 | 1168 |
1170 itMap++; | 1169 itMap++; |
1171 } // end while allocation | 1170 } // end while allocation |
1172 ret.m_nrOfPdcchOfdmSymbols = 1; /// \todo check correct value according the
DCIs txed | 1171 ret.m_nrOfPdcchOfdmSymbols = 1; /// \todo check correct value according the
DCIs txed |
1173 | 1172 |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1416 { | 1415 { |
1417 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> >
(params.m_sfnSf, rbgAllocationMap)); | 1416 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> >
(params.m_sfnSf, rbgAllocationMap)); |
1418 m_schedSapUser->SchedUlConfigInd (ret); | 1417 m_schedSapUser->SchedUlConfigInd (ret); |
1419 } | 1418 } |
1420 | 1419 |
1421 return; // no flows to be scheduled | 1420 return; // no flows to be scheduled |
1422 } | 1421 } |
1423 | 1422 |
1424 | 1423 |
1425 // Divide the remaining resources equally among the active users starting from
the subsequent one served last scheduling trigger | 1424 // Divide the remaining resources equally among the active users starting from
the subsequent one served last scheduling trigger |
1426 uint16_t rbPerFlow = (m_cschedCellConfig.m_ulBandwidth) / (nflows + rntiAlloca
ted.size ()); | 1425 uint16_t rbPerFlow = static_cast<uint16_t>((m_cschedCellConfig.m_ulBandwidth)
/ (nflows + rntiAllocated.size ())); |
1427 if (rbPerFlow < 3) | 1426 if (rbPerFlow < 3) |
1428 { | 1427 { |
1429 rbPerFlow = 3; // at least 3 rbg per flow (till available resource) to en
sure TxOpportunity >= 7 bytes | 1428 rbPerFlow = 3; // at least 3 rbg per flow (till available resource) to en
sure TxOpportunity >= 7 bytes |
1430 } | 1429 } |
1431 int rbAllocated = 0; | 1430 uint16_t rbAllocated = 0; |
1432 | 1431 |
1433 std::map <uint16_t, fdbetsFlowPerf_t>::iterator itStats; | 1432 std::map <uint16_t, fdbetsFlowPerf_t>::iterator itStats; |
1434 if (m_nextRntiUl != 0) | 1433 if (m_nextRntiUl != 0) |
1435 { | 1434 { |
1436 for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) | 1435 for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) |
1437 { | 1436 { |
1438 if ((*it).first == m_nextRntiUl) | 1437 if ((*it).first == m_nextRntiUl) |
1439 { | 1438 { |
1440 break; | 1439 break; |
1441 } | 1440 } |
(...skipping 30 matching lines...) Expand all Loading... |
1472 // at least 3 rbg per flow to ensure TxOpportunity >= 7 bytes | 1471 // at least 3 rbg per flow to ensure TxOpportunity >= 7 bytes |
1473 if (rbPerFlow < 3) | 1472 if (rbPerFlow < 3) |
1474 { | 1473 { |
1475 // terminate allocation | 1474 // terminate allocation |
1476 rbPerFlow = 0; | 1475 rbPerFlow = 0; |
1477 } | 1476 } |
1478 } | 1477 } |
1479 | 1478 |
1480 UlDciListElement_s uldci; | 1479 UlDciListElement_s uldci; |
1481 uldci.m_rnti = (*it).first; | 1480 uldci.m_rnti = (*it).first; |
1482 uldci.m_rbLen = rbPerFlow; | 1481 uldci.m_rbLen = static_cast<uint8_t>(rbPerFlow); |
| 1482 uldci.m_rbStart = 0; |
1483 bool allocated = false; | 1483 bool allocated = false; |
1484 NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << r
bPerFlow << " flows " << nflows); | 1484 NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << r
bPerFlow << " flows " << nflows); |
1485 while ((!allocated)&&((rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBa
ndwidth) < 1) && (rbPerFlow != 0)) | 1485 while ((!allocated)&&((rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBa
ndwidth) < 1) && (rbPerFlow != 0)) |
1486 { | 1486 { |
1487 // check availability | 1487 // check availability |
1488 bool free = true; | 1488 bool free = true; |
1489 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) | 1489 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) |
1490 { | 1490 { |
1491 if (rbMap.at (j) == true) | 1491 if (rbMap.at (j) == true) |
1492 { | 1492 { |
1493 free = false; | 1493 free = false; |
1494 break; | 1494 break; |
1495 } | 1495 } |
1496 } | 1496 } |
1497 if (free) | 1497 if (free) |
1498 { | 1498 { |
1499 uldci.m_rbStart = rbAllocated; | 1499 uldci.m_rbStart = static_cast<uint8_t>(rbAllocated); |
1500 | 1500 |
1501 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) | 1501 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) |
1502 { | 1502 { |
1503 rbMap.at (j) = true; | 1503 rbMap.at (j) = true; |
1504 // store info on allocation for managing ul-cqi interpretation | 1504 // store info on allocation for managing ul-cqi interpretation |
1505 rbgAllocationMap.at (j) = (*it).first; | 1505 rbgAllocationMap.at (j) = (*it).first; |
1506 } | 1506 } |
1507 rbAllocated += rbPerFlow; | 1507 rbAllocated += rbPerFlow; |
1508 allocated = true; | 1508 allocated = true; |
1509 break; | 1509 break; |
(...skipping 16 matching lines...) Expand all Loading... |
1526 // unable to allocate new resource: finish scheduling | 1526 // unable to allocate new resource: finish scheduling |
1527 m_nextRntiUl = (*it).first; | 1527 m_nextRntiUl = (*it).first; |
1528 if (ret.m_dciList.size () > 0) | 1528 if (ret.m_dciList.size () > 0) |
1529 { | 1529 { |
1530 m_schedSapUser->SchedUlConfigInd (ret); | 1530 m_schedSapUser->SchedUlConfigInd (ret); |
1531 } | 1531 } |
1532 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> >
(params.m_sfnSf, rbgAllocationMap)); | 1532 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> >
(params.m_sfnSf, rbgAllocationMap)); |
1533 return; | 1533 return; |
1534 } | 1534 } |
1535 | 1535 |
1536 | |
1537 | |
1538 std::map <uint16_t, std::vector <double> >::iterator itCqi = m_ueCqi.find
((*it).first); | 1536 std::map <uint16_t, std::vector <double> >::iterator itCqi = m_ueCqi.find
((*it).first); |
1539 int cqi = 0; | 1537 int cqi = 0; |
1540 if (itCqi == m_ueCqi.end ()) | 1538 if (itCqi == m_ueCqi.end ()) |
1541 { | 1539 { |
1542 // no cqi info about this UE | 1540 // no cqi info about this UE |
1543 uldci.m_mcs = 0; // MCS 0 -> UL-AMC TBD | 1541 uldci.m_mcs = 0; // MCS 0 -> UL-AMC TBD |
1544 } | 1542 } |
1545 else | 1543 else |
1546 { | 1544 { |
1547 // take the lowest CQI value (worst RB) | 1545 // take the lowest CQI value (worst RB) |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1672 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params
.m_sfnSf, rbgAllocationMap)); | 1670 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params
.m_sfnSf, rbgAllocationMap)); |
1673 m_schedSapUser->SchedUlConfigInd (ret); | 1671 m_schedSapUser->SchedUlConfigInd (ret); |
1674 | 1672 |
1675 return; | 1673 return; |
1676 } | 1674 } |
1677 | 1675 |
1678 void | 1676 void |
1679 FdBetFfMacScheduler::DoSchedUlNoiseInterferenceReq (const struct FfMacSchedSapPr
ovider::SchedUlNoiseInterferenceReqParameters& params) | 1677 FdBetFfMacScheduler::DoSchedUlNoiseInterferenceReq (const struct FfMacSchedSapPr
ovider::SchedUlNoiseInterferenceReqParameters& params) |
1680 { | 1678 { |
1681 NS_LOG_FUNCTION (this); | 1679 NS_LOG_FUNCTION (this); |
| 1680 NS_UNUSED(params); |
1682 return; | 1681 return; |
1683 } | 1682 } |
1684 | 1683 |
1685 void | 1684 void |
1686 FdBetFfMacScheduler::DoSchedUlSrInfoReq (const struct FfMacSchedSapProvider::Sch
edUlSrInfoReqParameters& params) | 1685 FdBetFfMacScheduler::DoSchedUlSrInfoReq (const struct FfMacSchedSapProvider::Sch
edUlSrInfoReqParameters& params) |
1687 { | 1686 { |
1688 NS_LOG_FUNCTION (this); | 1687 NS_LOG_FUNCTION (this); |
| 1688 NS_UNUSED(params); |
1689 return; | 1689 return; |
1690 } | 1690 } |
1691 | 1691 |
1692 void | 1692 void |
1693 FdBetFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider
::SchedUlMacCtrlInfoReqParameters& params) | 1693 FdBetFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider
::SchedUlMacCtrlInfoReqParameters& params) |
1694 { | 1694 { |
1695 NS_LOG_FUNCTION (this); | 1695 NS_LOG_FUNCTION (this); |
1696 | 1696 |
1697 std::map <uint16_t,uint32_t>::iterator it; | 1697 std::map <uint16_t,uint32_t>::iterator it; |
1698 | 1698 |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2046 { | 2046 { |
2047 NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode); | 2047 NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode); |
2048 FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params; | 2048 FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params; |
2049 params.m_rnti = rnti; | 2049 params.m_rnti = rnti; |
2050 params.m_transmissionMode = txMode; | 2050 params.m_transmissionMode = txMode; |
2051 m_cschedSapUser->CschedUeConfigUpdateInd (params); | 2051 m_cschedSapUser->CschedUeConfigUpdateInd (params); |
2052 } | 2052 } |
2053 | 2053 |
2054 | 2054 |
2055 } | 2055 } |
OLD | NEW |