LEFT | RIGHT |
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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 } | 360 } |
361 | 361 |
362 return; | 362 return; |
363 } | 363 } |
364 | 364 |
365 void | 365 void |
366 TdTbfqFfMacScheduler::DoSchedDlPagingBufferReq (const struct FfMacSchedSapProvid
er::SchedDlPagingBufferReqParameters& params) | 366 TdTbfqFfMacScheduler::DoSchedDlPagingBufferReq (const struct FfMacSchedSapProvid
er::SchedDlPagingBufferReqParameters& params) |
367 { | 367 { |
368 NS_LOG_FUNCTION (this); | 368 NS_LOG_FUNCTION (this); |
369 NS_FATAL_ERROR ("method not implemented"); | 369 NS_FATAL_ERROR ("method not implemented"); |
370 NS_UNUSED(params); | 370 NS_UNUSED (params); |
371 return; | 371 return; |
372 } | 372 } |
373 | 373 |
374 void | 374 void |
375 TdTbfqFfMacScheduler::DoSchedDlMacBufferReq (const struct FfMacSchedSapProvider:
:SchedDlMacBufferReqParameters& params) | 375 TdTbfqFfMacScheduler::DoSchedDlMacBufferReq (const struct FfMacSchedSapProvider:
:SchedDlMacBufferReqParameters& params) |
376 { | 376 { |
377 NS_LOG_FUNCTION (this); | 377 NS_LOG_FUNCTION (this); |
378 NS_FATAL_ERROR ("method not implemented"); | 378 NS_FATAL_ERROR ("method not implemented"); |
379 NS_UNUSED(params); | 379 NS_UNUSED (params); |
380 return; | 380 return; |
381 } | 381 } |
382 | 382 |
383 int | 383 int |
384 TdTbfqFfMacScheduler::GetRbgSize (int dlbandwidth) | 384 TdTbfqFfMacScheduler::GetRbgSize (int dlbandwidth) |
385 { | 385 { |
386 for (int i = 0; i < 4; i++) | 386 for (int i = 0; i < 4; i++) |
387 { | 387 { |
388 if (dlbandwidth < TdTbfqType0AllocationRbg[i]) | 388 if (dlbandwidth < TdTbfqType0AllocationRbg[i]) |
389 { | 389 { |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 maxContinuousUlBandwidth = tmpMinBandwidth; | 602 maxContinuousUlBandwidth = tmpMinBandwidth; |
603 ffrRbStartOffset = tmpFfrRbStartOffset; | 603 ffrRbStartOffset = tmpFfrRbStartOffset; |
604 } | 604 } |
605 | 605 |
606 m_rachAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0); | 606 m_rachAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0); |
607 uint8_t rbStart = 0; | 607 uint8_t rbStart = 0; |
608 rbStart = ffrRbStartOffset; | 608 rbStart = ffrRbStartOffset; |
609 std::vector <struct RachListElement_s>::iterator itRach; | 609 std::vector <struct RachListElement_s>::iterator itRach; |
610 for (itRach = m_rachList.begin (); itRach != m_rachList.end (); itRach++) | 610 for (itRach = m_rachList.begin (); itRach != m_rachList.end (); itRach++) |
611 { | 611 { |
612 NS_ASSERT_MSG (m_amc->GetTbSizeFromMcs (m_ulGrantMcs, m_cschedCellConfig.m
_ulBandwidth) > (*itRach).m_estimatedSize, " Default UL Grant MCS does not allow
to send RACH messages"); | 612 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"); |
613 BuildRarListElement_s newRar; | 613 BuildRarListElement_s newRar; |
614 newRar.m_rnti = (*itRach).m_rnti; | 614 newRar.m_rnti = (*itRach).m_rnti; |
615 // DL-RACH Allocation | 615 // DL-RACH Allocation |
616 // Ideal: no needs of configuring m_dci | 616 // Ideal: no needs of configuring m_dci |
617 // UL-RACH Allocation | 617 // UL-RACH Allocation |
618 newRar.m_grant.m_rnti = newRar.m_rnti; | 618 newRar.m_grant.m_rnti = newRar.m_rnti; |
619 newRar.m_grant.m_mcs = m_ulGrantMcs; | 619 newRar.m_grant.m_mcs = m_ulGrantMcs; |
620 uint8_t rbLen = 1; | 620 uint8_t rbLen = 1; |
621 uint16_t tbSizeBits = 0; | 621 uint16_t tbSizeBits = 0; |
622 // find lowest TB size that fits UL grant estimated size | 622 // find lowest TB size that fits UL grant estimated size |
623 while ((tbSizeBits < (*itRach).m_estimatedSize) && (rbStart + rbLen < (ffr
RbStartOffset + maxContinuousUlBandwidth))) | 623 while ((tbSizeBits < (*itRach).m_estimatedSize) && (rbStart + rbLen < (ffr
RbStartOffset + maxContinuousUlBandwidth))) |
624 { | 624 { |
625 rbLen++; | 625 rbLen++; |
626 tbSizeBits = m_amc->GetTbSizeFromMcs (m_ulGrantMcs, rbLen); | 626 tbSizeBits = m_amc->GetUlTbSizeFromMcs (m_ulGrantMcs, rbLen); |
627 } | 627 } |
628 if (tbSizeBits < (*itRach).m_estimatedSize) | 628 if (tbSizeBits < (*itRach).m_estimatedSize) |
629 { | 629 { |
630 // no more allocation space: finish allocation | 630 // no more allocation space: finish allocation |
631 break; | 631 break; |
632 } | 632 } |
633 newRar.m_grant.m_rbStart = rbStart; | 633 newRar.m_grant.m_rbStart = rbStart; |
634 newRar.m_grant.m_rbLen = rbLen; | 634 newRar.m_grant.m_rbLen = rbLen; |
635 newRar.m_grant.m_tbSize = tbSizeBits / 8; | 635 newRar.m_grant.m_tbSize = tbSizeBits / 8; |
636 newRar.m_grant.m_hopping = false; | 636 newRar.m_grant.m_hopping = false; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 } | 712 } |
713 std::vector <struct DlInfoListElement_s> dlInfoListUntxed; | 713 std::vector <struct DlInfoListElement_s> dlInfoListUntxed; |
714 for (uint16_t i = 0; i < m_dlInfoListBuffered.size (); i++) | 714 for (uint16_t i = 0; i < m_dlInfoListBuffered.size (); i++) |
715 { | 715 { |
716 std::set <uint16_t>::iterator itRnti = rntiAllocated.find (m_dlInfoListBuf
fered.at (i).m_rnti); | 716 std::set <uint16_t>::iterator itRnti = rntiAllocated.find (m_dlInfoListBuf
fered.at (i).m_rnti); |
717 if (itRnti != rntiAllocated.end ()) | 717 if (itRnti != rntiAllocated.end ()) |
718 { | 718 { |
719 // RNTI already allocated for retx | 719 // RNTI already allocated for retx |
720 continue; | 720 continue; |
721 } | 721 } |
722 uint8_t nLayers = static_cast<uint8_t>(m_dlInfoListBuffered.at (i).m_harqS
tatus.size ()); | 722 uint8_t nLayers = static_cast<uint8_t> (m_dlInfoListBuffered.at (i).m_harq
Status.size ()); |
723 std::vector <bool> retx; | 723 std::vector <bool> retx; |
724 NS_LOG_INFO (this << " Processing DLHARQ feedback"); | 724 NS_LOG_INFO (this << " Processing DLHARQ feedback"); |
725 if (nLayers == 1) | 725 if (nLayers == 1) |
726 { | 726 { |
727 retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlI
nfoListElement_s::NACK); | 727 retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlI
nfoListElement_s::NACK); |
728 retx.push_back (false); | 728 retx.push_back (false); |
729 } | 729 } |
730 else | 730 else |
731 { | 731 { |
732 retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlI
nfoListElement_s::NACK); | 732 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... |
809 NS_LOG_INFO ("RBG " << dciRbg.at (j) << " assigned"); | 809 NS_LOG_INFO ("RBG " << dciRbg.at (j) << " assigned"); |
810 rbgAllocatedNum++; | 810 rbgAllocatedNum++; |
811 } | 811 } |
812 | 812 |
813 NS_LOG_INFO (this << " Send retx in the same RBGs"); | 813 NS_LOG_INFO (this << " Send retx in the same RBGs"); |
814 } | 814 } |
815 else | 815 else |
816 { | 816 { |
817 // find RBGs for sending HARQ retx | 817 // find RBGs for sending HARQ retx |
818 uint8_t j = 0; | 818 uint8_t j = 0; |
819 uint8_t rbgId = static_cast<uint8_t>((dciRbg.at (dciRbg.size () -
1) + 1) % rbgNum); | 819 uint8_t rbgId = static_cast<uint8_t> ((dciRbg.at (dciRbg.size () -
1) + 1) % rbgNum); |
820 uint8_t startRbg = static_cast<uint8_t>(dciRbg.at (dciRbg.size ()
- 1)); | 820 uint8_t startRbg = static_cast<uint8_t> (dciRbg.at (dciRbg.size ()
- 1)); |
821 std::vector <bool> rbgMapCopy = rbgMap; | 821 std::vector <bool> rbgMapCopy = rbgMap; |
822 while ((j < dciRbg.size ())&&(startRbg != rbgId)) | 822 while ((j < dciRbg.size ())&&(startRbg != rbgId)) |
823 { | 823 { |
824 if (rbgMapCopy.at (rbgId) == false) | 824 if (rbgMapCopy.at (rbgId) == false) |
825 { | 825 { |
826 rbgMapCopy.at (rbgId) = true; | 826 rbgMapCopy.at (rbgId) = true; |
827 dciRbg.at (j) = rbgId; | 827 dciRbg.at (j) = rbgId; |
828 j++; | 828 j++; |
829 } | 829 } |
830 rbgId = (rbgId + 1) % rbgNum; | 830 rbgId = (rbgId + 1) % rbgNum; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 return; | 962 return; |
963 } | 963 } |
964 | 964 |
965 | 965 |
966 // update token pool, counter and bank size | 966 // update token pool, counter and bank size |
967 std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator itStats; | 967 std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator itStats; |
968 for (itStats = m_flowStatsDl.begin (); itStats != m_flowStatsDl.end (); itStat
s++) | 968 for (itStats = m_flowStatsDl.begin (); itStats != m_flowStatsDl.end (); itStat
s++) |
969 { | 969 { |
970 if ( (*itStats).second.tokenGenerationRate / 1000 + (*itStats).second.tok
enPoolSize > (*itStats).second.maxTokenPoolSize )····· | 970 if ( (*itStats).second.tokenGenerationRate / 1000 + (*itStats).second.tok
enPoolSize > (*itStats).second.maxTokenPoolSize )····· |
971 { | 971 { |
972 (*itStats).second.counter += static_cast<int>((*itStats).second.tokenG
enerationRate / 1000 - ( (*itStats).second.maxTokenPoolSize - (*itStats).second
.tokenPoolSize )); | 972 (*itStats).second.counter += static_cast<int> ((*itStats).second.token
GenerationRate / 1000 - ( (*itStats).second.maxTokenPoolSize - (*itStats).secon
d.tokenPoolSize )); |
973 (*itStats).second.tokenPoolSize = (*itStats).second.maxTokenPoolSize; | 973 (*itStats).second.tokenPoolSize = (*itStats).second.maxTokenPoolSize; |
974 bankSize += (*itStats).second.tokenGenerationRate / 1000 - ( (*itStats
).second.maxTokenPoolSize - (*itStats).second.tokenPoolSize ); | 974 bankSize += (*itStats).second.tokenGenerationRate / 1000 - ( (*itStats
).second.maxTokenPoolSize - (*itStats).second.tokenPoolSize ); |
975 } | 975 } |
976 else | 976 else |
977 { | 977 { |
978 (*itStats).second.tokenPoolSize += static_cast<uint32_t>((*itStats).se
cond.tokenGenerationRate / 1000); | 978 (*itStats).second.tokenPoolSize += static_cast<uint32_t> ((*itStats).s
econd.tokenGenerationRate / 1000); |
979 } | 979 } |
980 } | 980 } |
981 | 981 |
982 | 982 |
983 // select UE with largest metric | 983 // select UE with largest metric |
984 std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator it; | 984 std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator it; |
985 std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator itMax = m_flowStatsDl.end (); | 985 std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator itMax = m_flowStatsDl.end (); |
986 double metricMax = 0.0; | 986 double metricMax = 0.0; |
987 bool firstRnti = true; | 987 bool firstRnti = true; |
988 for (it = m_flowStatsDl.begin (); it != m_flowStatsDl.end (); it++) | 988 for (it = m_flowStatsDl.begin (); it != m_flowStatsDl.end (); it++) |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 while (itMap != allocationMap.end ()) | 1091 while (itMap != allocationMap.end ()) |
1092 { | 1092 { |
1093 // create new BuildDataListElement_s for this LC | 1093 // create new BuildDataListElement_s for this LC |
1094 BuildDataListElement_s newEl; | 1094 BuildDataListElement_s newEl; |
1095 newEl.m_rnti = (*itMap).first; | 1095 newEl.m_rnti = (*itMap).first; |
1096 // create the DlDciListElement_s | 1096 // create the DlDciListElement_s |
1097 DlDciListElement_s newDci; | 1097 DlDciListElement_s newDci; |
1098 newDci.m_rnti = (*itMap).first; | 1098 newDci.m_rnti = (*itMap).first; |
1099 newDci.m_harqProcess = UpdateHarqProcessId ((*itMap).first); | 1099 newDci.m_harqProcess = UpdateHarqProcessId ((*itMap).first); |
1100 | 1100 |
1101 uint16_t lcActives = static_cast<uint16_t>(LcActivePerFlow ((*itMap).first
)); | 1101 uint16_t lcActives = static_cast<uint16_t> (LcActivePerFlow ((*itMap).firs
t)); |
1102 NS_LOG_INFO (this << "Allocate user " << newEl.m_rnti << " rbg " << lcActi
ves); | 1102 NS_LOG_INFO (this << "Allocate user " << newEl.m_rnti << " rbg " << lcActi
ves); |
1103 if (lcActives == 0) | 1103 if (lcActives == 0) |
1104 { | 1104 { |
1105 // Set to max value, to avoid divide by 0 below | 1105 // Set to max value, to avoid divide by 0 below |
1106 lcActives = (uint16_t)65535; // UINT16_MAX; | 1106 lcActives = (uint16_t)65535; // UINT16_MAX; |
1107 } | 1107 } |
1108 uint16_t RgbPerRnti = static_cast<uint16_t>((*itMap).second.size ()); | 1108 uint16_t RgbPerRnti = static_cast<uint16_t> ((*itMap).second.size ()); |
1109 std::map <uint16_t,SbMeasResult_s>::iterator itCqi; | 1109 std::map <uint16_t,SbMeasResult_s>::iterator itCqi; |
1110 itCqi = m_a30CqiRxed.find ((*itMap).first); | 1110 itCqi = m_a30CqiRxed.find ((*itMap).first); |
1111 std::map <uint16_t,uint8_t>::iterator itTxMode; | 1111 std::map <uint16_t,uint8_t>::iterator itTxMode; |
1112 itTxMode = m_uesTxMode.find ((*itMap).first); | 1112 itTxMode = m_uesTxMode.find ((*itMap).first); |
1113 if (itTxMode == m_uesTxMode.end ()) | 1113 if (itTxMode == m_uesTxMode.end ()) |
1114 { | 1114 { |
1115 NS_FATAL_ERROR ("No Transmission Mode info on user " << (*itMap).first
); | 1115 NS_FATAL_ERROR ("No Transmission Mode info on user " << (*itMap).first
); |
1116 } | 1116 } |
1117 int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second)
; | 1117 int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second)
; |
1118 std::vector <uint8_t> worstCqi (2, 15); | 1118 std::vector <uint8_t> worstCqi (2, 15); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 { | 1151 { |
1152 for (uint8_t j = 0; j < nLayer; j++) | 1152 for (uint8_t j = 0; j < nLayer; j++) |
1153 { | 1153 { |
1154 worstCqi.at (j) = 1; // try with lowest MCS in RBG with no info on
channel | 1154 worstCqi.at (j) = 1; // try with lowest MCS in RBG with no info on
channel |
1155 } | 1155 } |
1156 } | 1156 } |
1157 uint32_t bytesTxed = 0; | 1157 uint32_t bytesTxed = 0; |
1158 for (uint8_t j = 0; j < nLayer; j++) | 1158 for (uint8_t j = 0; j < nLayer; j++) |
1159 { | 1159 { |
1160 newDci.m_mcs.push_back (m_amc->GetMcsFromCqi (worstCqi.at (j))); | 1160 newDci.m_mcs.push_back (m_amc->GetMcsFromCqi (worstCqi.at (j))); |
1161 int tbSize = (m_amc->GetTbSizeFromMcs (newDci.m_mcs.at (j), RgbPerRnti
* rbgSize) / 8); // (size of TB in bytes according to table 7.1.7.2.1-1 of 36.2
13)· | 1161 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)· |
1162 newDci.m_tbsSize.push_back (static_cast<uint16_t>(tbSize)); | 1162 newDci.m_tbsSize.push_back (static_cast<uint16_t> (tbSize)); |
1163 bytesTxed += tbSize; | 1163 bytesTxed += tbSize; |
1164 } | 1164 } |
1165 | 1165 |
1166 newDci.m_resAlloc = 0; // only allocation type 0 at this stage | 1166 newDci.m_resAlloc = 0; // only allocation type 0 at this stage |
1167 newDci.m_rbBitmap = 0; // TBD (32 bit bitmap see 7.1.6 of 36.213) | 1167 newDci.m_rbBitmap = 0; // TBD (32 bit bitmap see 7.1.6 of 36.213) |
1168 uint32_t rbgMask = 0; | 1168 uint32_t rbgMask = 0; |
1169 for (uint16_t k = 0; k < (*itMap).second.size (); k++) | 1169 for (uint16_t k = 0; k < (*itMap).second.size (); k++) |
1170 { | 1170 { |
1171 rbgMask = rbgMask + (0x1 << (*itMap).second.at (k)); | 1171 rbgMask = rbgMask + (0x1 << (*itMap).second.at (k)); |
1172 NS_LOG_INFO (this << " Allocated RBG " << (*itMap).second.at (k)); | 1172 NS_LOG_INFO (this << " Allocated RBG " << (*itMap).second.at (k)); |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 | 1397 |
1398 for (std::vector<bool>::iterator it = rbMap.begin (); it != rbMap.end (); it++
) | 1398 for (std::vector<bool>::iterator it = rbMap.begin (); it != rbMap.end (); it++
) |
1399 { | 1399 { |
1400 if ((*it) == true ) | 1400 if ((*it) == true ) |
1401 { | 1401 { |
1402 rbAllocatedNum++; | 1402 rbAllocatedNum++; |
1403 } | 1403 } |
1404 } | 1404 } |
1405 | 1405 |
1406 uint8_t minContinuousUlBandwidth = m_ffrSapProvider->GetMinContinuousUlBandwid
th (); | 1406 uint8_t minContinuousUlBandwidth = m_ffrSapProvider->GetMinContinuousUlBandwid
th (); |
1407 uint8_t ffrUlBandwidth = static_cast<uint8_t>(m_cschedCellConfig.m_ulBandwidth
- rbAllocatedNum); | 1407 uint8_t ffrUlBandwidth = static_cast<uint8_t> (m_cschedCellConfig.m_ulBandwidt
h - rbAllocatedNum); |
1408 | 1408 |
1409 // remove RACH allocation | 1409 // remove RACH allocation |
1410 for (uint16_t i = 0; i < m_cschedCellConfig.m_ulBandwidth; i++) | 1410 for (uint16_t i = 0; i < m_cschedCellConfig.m_ulBandwidth; i++) |
1411 { | 1411 { |
1412 if (rbgAllocationMap.at (i) != 0) | 1412 if (rbgAllocationMap.at (i) != 0) |
1413 { | 1413 { |
1414 rbMap.at (i) = true; | 1414 rbMap.at (i) = true; |
1415 NS_LOG_DEBUG (this << " Allocated for RACH " << i); | 1415 NS_LOG_DEBUG (this << " Allocated for RACH " << i); |
1416 } | 1416 } |
1417 } | 1417 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 { | 1510 { |
1511 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> >
(params.m_sfnSf, rbgAllocationMap)); | 1511 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> >
(params.m_sfnSf, rbgAllocationMap)); |
1512 m_schedSapUser->SchedUlConfigInd (ret); | 1512 m_schedSapUser->SchedUlConfigInd (ret); |
1513 } | 1513 } |
1514 ········ | 1514 ········ |
1515 return; // no flows to be scheduled | 1515 return; // no flows to be scheduled |
1516 } | 1516 } |
1517 | 1517 |
1518 | 1518 |
1519 // Divide the remaining resources equally among the active users starting from
the subsequent one served last scheduling trigger | 1519 // Divide the remaining resources equally among the active users starting from
the subsequent one served last scheduling trigger |
1520 uint16_t tempRbPerFlow = static_cast<uint16_t>((ffrUlBandwidth) / (nflows + rn
tiAllocated.size ())); | 1520 uint16_t tempRbPerFlow = static_cast<uint16_t> ((ffrUlBandwidth) / (nflows + r
ntiAllocated.size ())); |
1521 uint16_t rbPerFlow = (minContinuousUlBandwidth < tempRbPerFlow) ? minContinuou
sUlBandwidth : tempRbPerFlow; | 1521 uint16_t rbPerFlow = (minContinuousUlBandwidth < tempRbPerFlow) ? minContinuou
sUlBandwidth : tempRbPerFlow; |
1522 | 1522 |
1523 if (rbPerFlow < 3) | 1523 if (rbPerFlow < 3) |
1524 { | 1524 { |
1525 rbPerFlow = 3; // at least 3 rbg per flow (till available resource) to en
sure TxOpportunity >= 7 bytes | 1525 rbPerFlow = 3; // at least 3 rbg per flow (till available resource) to en
sure TxOpportunity >= 7 bytes |
1526 } | 1526 } |
1527 uint16_t rbAllocated = 0; | 1527 uint16_t rbAllocated = 0; |
1528 | 1528 |
1529 std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator itStats; | 1529 std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator itStats; |
1530 if (m_nextRntiUl != 0) | 1530 if (m_nextRntiUl != 0) |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1569 if (rbPerFlow < 3) | 1569 if (rbPerFlow < 3) |
1570 { | 1570 { |
1571 // terminate allocation | 1571 // terminate allocation |
1572 rbPerFlow = 0;······ | 1572 rbPerFlow = 0;······ |
1573 } | 1573 } |
1574 } | 1574 } |
1575 | 1575 |
1576 rbAllocated = 0; | 1576 rbAllocated = 0; |
1577 UlDciListElement_s uldci; | 1577 UlDciListElement_s uldci; |
1578 uldci.m_rnti = (*it).first; | 1578 uldci.m_rnti = (*it).first; |
1579 uldci.m_rbLen = static_cast<uint8_t>(rbPerFlow); | 1579 uldci.m_rbLen = static_cast<uint8_t> (rbPerFlow); |
1580 uldci.m_rbStart = 0; | 1580 uldci.m_rbStart = 0; |
1581 bool allocated = false; | 1581 bool allocated = false; |
1582 NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << r
bPerFlow << " flows " << nflows); | 1582 NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << r
bPerFlow << " flows " << nflows); |
1583 while ((!allocated)&&((rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBa
ndwidth) < 1) && (rbPerFlow != 0)) | 1583 while ((!allocated)&&((rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBa
ndwidth) < 1) && (rbPerFlow != 0)) |
1584 { | 1584 { |
1585 // check availability | 1585 // check availability |
1586 bool free = true; | 1586 bool free = true; |
1587 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) | 1587 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) |
1588 { | 1588 { |
1589 if (rbMap.at (j) == true) | 1589 if (rbMap.at (j) == true) |
1590 { | 1590 { |
1591 free = false; | 1591 free = false; |
1592 break; | 1592 break; |
1593 } | 1593 } |
1594 if ((m_ffrSapProvider->IsUlRbgAvailableForUe (j, (*it).first)) ==
false) | 1594 if ((m_ffrSapProvider->IsUlRbgAvailableForUe (j, (*it).first)) ==
false) |
1595 { | 1595 { |
1596 free = false; | 1596 free = false; |
1597 break; | 1597 break; |
1598 } | 1598 } |
1599 } | 1599 } |
1600 if (free) | 1600 if (free) |
1601 { | 1601 { |
1602 NS_LOG_INFO (this << "RNTI: "<< (*it).first<< " RB Allocated "
<< rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows); | 1602 NS_LOG_INFO (this << "RNTI: "<< (*it).first<< " RB Allocated "
<< rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows); |
1603 uldci.m_rbStart = static_cast<uint8_t>(rbAllocated); | 1603 uldci.m_rbStart = static_cast<uint8_t> (rbAllocated); |
1604 | 1604 |
1605 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) | 1605 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) |
1606 { | 1606 { |
1607 rbMap.at (j) = true; | 1607 rbMap.at (j) = true; |
1608 // store info on allocation for managing ul-cqi interpretation | 1608 // store info on allocation for managing ul-cqi interpretation |
1609 rbgAllocationMap.at (j) = (*it).first; | 1609 rbgAllocationMap.at (j) = (*it).first; |
1610 } | 1610 } |
1611 rbAllocated += rbPerFlow; | 1611 rbAllocated += rbPerFlow; |
1612 allocated = true; | 1612 allocated = true; |
1613 break; | 1613 break; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1685 // remove UE from allocation map | 1685 // remove UE from allocation map |
1686 for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_r
bLen; i++) | 1686 for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_r
bLen; i++) |
1687 { | 1687 { |
1688 rbgAllocationMap.at (i) = 0; | 1688 rbgAllocationMap.at (i) = 0; |
1689 } | 1689 } |
1690 continue; // CQI == 0 means "out of range" (see table 7.2.3-1 of 3
6.213) | 1690 continue; // CQI == 0 means "out of range" (see table 7.2.3-1 of 3
6.213) |
1691 } | 1691 } |
1692 uldci.m_mcs = m_amc->GetMcsFromCqi (cqi); | 1692 uldci.m_mcs = m_amc->GetMcsFromCqi (cqi); |
1693 } | 1693 } |
1694 | 1694 |
1695 uldci.m_tbSize = m_amc->GetTbSizeFromMcs (uldci.m_mcs, rbPerFlow) / 8; | 1695 uldci.m_tbSize = (m_amc->GetUlTbSizeFromMcs (uldci.m_mcs, rbPerFlow) / 8); |
1696 UpdateUlRlcBufferInfo (uldci.m_rnti, uldci.m_tbSize); | 1696 UpdateUlRlcBufferInfo (uldci.m_rnti, uldci.m_tbSize); |
1697 uldci.m_ndi = 1; | 1697 uldci.m_ndi = 1; |
1698 uldci.m_cceIndex = 0; | 1698 uldci.m_cceIndex = 0; |
1699 uldci.m_aggrLevel = 1; | 1699 uldci.m_aggrLevel = 1; |
1700 uldci.m_ueTxAntennaSelection = 3; // antenna selection OFF | 1700 uldci.m_ueTxAntennaSelection = 3; // antenna selection OFF |
1701 uldci.m_hopping = false; | 1701 uldci.m_hopping = false; |
1702 uldci.m_n2Dmrs = 0; | 1702 uldci.m_n2Dmrs = 0; |
1703 uldci.m_tpc = 0; // no power control | 1703 uldci.m_tpc = 0; // no power control |
1704 uldci.m_cqiRequest = false; // only period CQI at this stage | 1704 uldci.m_cqiRequest = false; // only period CQI at this stage |
1705 uldci.m_ulIndex = 0; // TDD parameter | 1705 uldci.m_ulIndex = 0; // TDD parameter |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1754 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params
.m_sfnSf, rbgAllocationMap)); | 1754 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params
.m_sfnSf, rbgAllocationMap)); |
1755 m_schedSapUser->SchedUlConfigInd (ret); | 1755 m_schedSapUser->SchedUlConfigInd (ret); |
1756 | 1756 |
1757 return; | 1757 return; |
1758 } | 1758 } |
1759 | 1759 |
1760 void | 1760 void |
1761 TdTbfqFfMacScheduler::DoSchedUlNoiseInterferenceReq (const struct FfMacSchedSapP
rovider::SchedUlNoiseInterferenceReqParameters& params) | 1761 TdTbfqFfMacScheduler::DoSchedUlNoiseInterferenceReq (const struct FfMacSchedSapP
rovider::SchedUlNoiseInterferenceReqParameters& params) |
1762 { | 1762 { |
1763 NS_LOG_FUNCTION (this); | 1763 NS_LOG_FUNCTION (this); |
1764 NS_UNUSED(params); | 1764 NS_UNUSED (params); |
1765 return; | 1765 return; |
1766 } | 1766 } |
1767 | 1767 |
1768 void | 1768 void |
1769 TdTbfqFfMacScheduler::DoSchedUlSrInfoReq (const struct FfMacSchedSapProvider::Sc
hedUlSrInfoReqParameters& params) | 1769 TdTbfqFfMacScheduler::DoSchedUlSrInfoReq (const struct FfMacSchedSapProvider::Sc
hedUlSrInfoReqParameters& params) |
1770 { | 1770 { |
1771 NS_LOG_FUNCTION (this); | 1771 NS_LOG_FUNCTION (this); |
1772 NS_UNUSED(params); | 1772 NS_UNUSED (params); |
1773 return; | 1773 return; |
1774 } | 1774 } |
1775 | 1775 |
1776 void | 1776 void |
1777 TdTbfqFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvide
r::SchedUlMacCtrlInfoReqParameters& params) | 1777 TdTbfqFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvide
r::SchedUlMacCtrlInfoReqParameters& params) |
1778 { | 1778 { |
1779 NS_LOG_FUNCTION (this); | 1779 NS_LOG_FUNCTION (this); |
1780 | 1780 |
1781 std::map <uint16_t,uint32_t>::iterator it; | 1781 std::map <uint16_t,uint32_t>::iterator it; |
1782 | 1782 |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2130 { | 2130 { |
2131 NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode); | 2131 NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode); |
2132 FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params; | 2132 FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params; |
2133 params.m_rnti = rnti; | 2133 params.m_rnti = rnti; |
2134 params.m_transmissionMode = txMode; | 2134 params.m_transmissionMode = txMode; |
2135 m_cschedSapUser->CschedUeConfigUpdateInd (params); | 2135 m_cschedSapUser->CschedUeConfigUpdateInd (params); |
2136 } | 2136 } |
2137 | 2137 |
2138 | 2138 |
2139 } | 2139 } |
LEFT | RIGHT |