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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 return; | 155 return; |
156 } | 156 } |
157 | 157 |
158 void | 158 void |
159 TdMtFfMacScheduler::DoCschedUeConfigReq (const struct FfMacCschedSapProvider::Cs
chedUeConfigReqParameters& params) | 159 TdMtFfMacScheduler::DoCschedUeConfigReq (const struct FfMacCschedSapProvider::Cs
chedUeConfigReqParameters& params) |
160 { | 160 { |
161 NS_LOG_FUNCTION (this << " RNTI " << params.m_rnti << " txMode " << (uint16_t)
params.m_transmissionMode); | 161 NS_LOG_FUNCTION (this << " RNTI " << params.m_rnti << " txMode " << (uint16_t)
params.m_transmissionMode); |
162 std::map <uint16_t,uint8_t>::iterator it = m_uesTxMode.find (params.m_rnti); | 162 std::map <uint16_t,uint8_t>::iterator it = m_uesTxMode.find (params.m_rnti); |
163 if (it == m_uesTxMode.end ()) | 163 if (it == m_uesTxMode.end ()) |
164 { | 164 { |
165 m_uesTxMode.insert (std::pair <uint16_t, double> (params.m_rnti, params.m_
transmissionMode)); | 165 m_uesTxMode.insert (std::pair <uint16_t, uint8_t> (params.m_rnti, params.m
_transmissionMode)); |
166 // generate HARQ buffers | 166 // generate HARQ buffers |
167 m_dlHarqCurrentProcessId.insert (std::pair <uint16_t,uint8_t > (params.m_r
nti, 0)); | 167 m_dlHarqCurrentProcessId.insert (std::pair <uint16_t,uint8_t > (params.m_r
nti, 0)); |
168 DlHarqProcessesStatus_t dlHarqPrcStatus; | 168 DlHarqProcessesStatus_t dlHarqPrcStatus; |
169 dlHarqPrcStatus.resize (8,0); | 169 dlHarqPrcStatus.resize (8,0); |
170 m_dlHarqProcessesStatus.insert (std::pair <uint16_t, DlHarqProcessesStatus
_t> (params.m_rnti, dlHarqPrcStatus)); | 170 m_dlHarqProcessesStatus.insert (std::pair <uint16_t, DlHarqProcessesStatus
_t> (params.m_rnti, dlHarqPrcStatus)); |
171 DlHarqProcessesTimer_t dlHarqProcessesTimer; | 171 DlHarqProcessesTimer_t dlHarqProcessesTimer; |
172 dlHarqProcessesTimer.resize (8,0); | 172 dlHarqProcessesTimer.resize (8,0); |
173 m_dlHarqProcessesTimer.insert (std::pair <uint16_t, DlHarqProcessesTimer_t
> (params.m_rnti, dlHarqProcessesTimer)); | 173 m_dlHarqProcessesTimer.insert (std::pair <uint16_t, DlHarqProcessesTimer_t
> (params.m_rnti, dlHarqProcessesTimer)); |
174 DlHarqProcessesDciBuffer_t dlHarqdci; | 174 DlHarqProcessesDciBuffer_t dlHarqdci; |
175 dlHarqdci.resize (8); | 175 dlHarqdci.resize (8); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 } | 302 } |
303 | 303 |
304 return; | 304 return; |
305 } | 305 } |
306 | 306 |
307 void | 307 void |
308 TdMtFfMacScheduler::DoSchedDlPagingBufferReq (const struct FfMacSchedSapProvider
::SchedDlPagingBufferReqParameters& params) | 308 TdMtFfMacScheduler::DoSchedDlPagingBufferReq (const struct FfMacSchedSapProvider
::SchedDlPagingBufferReqParameters& params) |
309 { | 309 { |
310 NS_LOG_FUNCTION (this); | 310 NS_LOG_FUNCTION (this); |
311 NS_FATAL_ERROR ("method not implemented"); | 311 NS_FATAL_ERROR ("method not implemented"); |
| 312 NS_UNUSED(params); |
312 return; | 313 return; |
313 } | 314 } |
314 | 315 |
315 void | 316 void |
316 TdMtFfMacScheduler::DoSchedDlMacBufferReq (const struct FfMacSchedSapProvider::S
chedDlMacBufferReqParameters& params) | 317 TdMtFfMacScheduler::DoSchedDlMacBufferReq (const struct FfMacSchedSapProvider::S
chedDlMacBufferReqParameters& params) |
317 { | 318 { |
318 NS_LOG_FUNCTION (this); | 319 NS_LOG_FUNCTION (this); |
319 NS_FATAL_ERROR ("method not implemented"); | 320 NS_FATAL_ERROR ("method not implemented"); |
| 321 NS_UNUSED(params); |
320 return; | 322 return; |
321 } | 323 } |
322 | 324 |
323 int | 325 int |
324 TdMtFfMacScheduler::GetRbgSize (int dlbandwidth) | 326 TdMtFfMacScheduler::GetRbgSize (int dlbandwidth) |
325 { | 327 { |
326 for (int i = 0; i < 4; i++) | 328 for (int i = 0; i < 4; i++) |
327 { | 329 { |
328 if (dlbandwidth < TdMtType0AllocationRbg[i]) | 330 if (dlbandwidth < TdMtType0AllocationRbg[i]) |
329 { | 331 { |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 int rbgSize = GetRbgSize (m_cschedCellConfig.m_dlBandwidth); | 483 int rbgSize = GetRbgSize (m_cschedCellConfig.m_dlBandwidth); |
482 int rbgNum = m_cschedCellConfig.m_dlBandwidth / rbgSize; | 484 int rbgNum = m_cschedCellConfig.m_dlBandwidth / rbgSize; |
483 std::map <uint16_t, std::vector <uint16_t> > allocationMap; // RBs map per RNT
I | 485 std::map <uint16_t, std::vector <uint16_t> > allocationMap; // RBs map per RNT
I |
484 std::vector <bool> rbgMap; // global RBGs map | 486 std::vector <bool> rbgMap; // global RBGs map |
485 uint16_t rbgAllocatedNum = 0; | 487 uint16_t rbgAllocatedNum = 0; |
486 std::set <uint16_t> rntiAllocated; | 488 std::set <uint16_t> rntiAllocated; |
487 rbgMap.resize (m_cschedCellConfig.m_dlBandwidth / rbgSize, false); | 489 rbgMap.resize (m_cschedCellConfig.m_dlBandwidth / rbgSize, false); |
488 FfMacSchedSapUser::SchedDlConfigIndParameters ret; | 490 FfMacSchedSapUser::SchedDlConfigIndParameters ret; |
489 | 491 |
490 // update UL HARQ proc id | 492 // update UL HARQ proc id |
491 std::map <uint16_t, uint8_t>::iterator itProcId; | 493 for (std::map <uint16_t, uint8_t>::iterator itProcId = m_ulHarqCurrentProcessI
d.begin (); itProcId != m_ulHarqCurrentProcessId.end (); itProcId++) |
492 for (itProcId = m_ulHarqCurrentProcessId.begin (); itProcId != m_ulHarqCurrent
ProcessId.end (); itProcId++) | |
493 { | 494 { |
494 (*itProcId).second = ((*itProcId).second + 1) % HARQ_PROC_NUM; | 495 (*itProcId).second = ((*itProcId).second + 1) % HARQ_PROC_NUM; |
495 } | 496 } |
496 | 497 |
497 // RACH Allocation | 498 // RACH Allocation |
498 m_rachAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0); | 499 m_rachAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0); |
499 uint16_t rbStart = 0; | 500 uint8_t rbStart = 0; |
500 std::vector <struct RachListElement_s>::iterator itRach; | 501 std::vector <struct RachListElement_s>::iterator itRach; |
501 for (itRach = m_rachList.begin (); itRach != m_rachList.end (); itRach++) | 502 for (itRach = m_rachList.begin (); itRach != m_rachList.end (); itRach++) |
502 { | 503 { |
503 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"); | 504 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"); |
504 BuildRarListElement_s newRar; | 505 BuildRarListElement_s newRar; |
505 newRar.m_rnti = (*itRach).m_rnti; | 506 newRar.m_rnti = (*itRach).m_rnti; |
506 // DL-RACH Allocation | 507 // DL-RACH Allocation |
507 // Ideal: no needs of configuring m_dci | 508 // Ideal: no needs of configuring m_dci |
508 // UL-RACH Allocation | 509 // UL-RACH Allocation |
509 newRar.m_grant.m_rnti = newRar.m_rnti; | 510 newRar.m_grant.m_rnti = newRar.m_rnti; |
510 newRar.m_grant.m_mcs = m_ulGrantMcs; | 511 newRar.m_grant.m_mcs = m_ulGrantMcs; |
511 uint16_t rbLen = 1; | 512 uint8_t rbLen = 1; |
512 uint16_t tbSizeBits = 0; | 513 uint16_t tbSizeBits = 0; |
513 // find lowest TB size that fits UL grant estimated size | 514 // find lowest TB size that fits UL grant estimated size |
514 while ((tbSizeBits < (*itRach).m_estimatedSize) && (rbStart + rbLen < m_cs
chedCellConfig.m_ulBandwidth)) | 515 while ((tbSizeBits < (*itRach).m_estimatedSize) && (rbStart + rbLen < m_cs
chedCellConfig.m_ulBandwidth)) |
515 { | 516 { |
516 rbLen++; | 517 rbLen++; |
517 tbSizeBits = m_amc->GetUlTbSizeFromMcs (m_ulGrantMcs, rbLen); | 518 tbSizeBits = m_amc->GetUlTbSizeFromMcs (m_ulGrantMcs, rbLen); |
518 } | 519 } |
519 if (tbSizeBits < (*itRach).m_estimatedSize) | 520 if (tbSizeBits < (*itRach).m_estimatedSize) |
520 { | 521 { |
521 // no more allocation space: finish allocation | 522 // no more allocation space: finish allocation |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 } | 604 } |
604 std::vector <struct DlInfoListElement_s> dlInfoListUntxed; | 605 std::vector <struct DlInfoListElement_s> dlInfoListUntxed; |
605 for (uint16_t i = 0; i < m_dlInfoListBuffered.size (); i++) | 606 for (uint16_t i = 0; i < m_dlInfoListBuffered.size (); i++) |
606 { | 607 { |
607 std::set <uint16_t>::iterator itRnti = rntiAllocated.find (m_dlInfoListBuf
fered.at (i).m_rnti); | 608 std::set <uint16_t>::iterator itRnti = rntiAllocated.find (m_dlInfoListBuf
fered.at (i).m_rnti); |
608 if (itRnti != rntiAllocated.end ()) | 609 if (itRnti != rntiAllocated.end ()) |
609 { | 610 { |
610 // RNTI already allocated for retx | 611 // RNTI already allocated for retx |
611 continue; | 612 continue; |
612 } | 613 } |
613 uint8_t nLayers = m_dlInfoListBuffered.at (i).m_harqStatus.size (); | 614 uint8_t nLayers = static_cast<uint8_t>(m_dlInfoListBuffered.at (i).m_harqS
tatus.size ()); |
614 std::vector <bool> retx; | 615 std::vector <bool> retx; |
615 NS_LOG_INFO (this << " Processing DLHARQ feedback"); | 616 NS_LOG_INFO (this << " Processing DLHARQ feedback"); |
616 if (nLayers == 1) | 617 if (nLayers == 1) |
617 { | 618 { |
618 retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlI
nfoListElement_s::NACK); | 619 retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlI
nfoListElement_s::NACK); |
619 retx.push_back (false); | 620 retx.push_back (false); |
620 } | 621 } |
621 else | 622 else |
622 { | 623 { |
623 retx.push_back (m_dlInfoListBuffered.at (i).m_harqStatus.at (0) == DlI
nfoListElement_s::NACK); | 624 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... |
700 NS_LOG_INFO ("RBG " << dciRbg.at (j) << " assigned"); | 701 NS_LOG_INFO ("RBG " << dciRbg.at (j) << " assigned"); |
701 rbgAllocatedNum++; | 702 rbgAllocatedNum++; |
702 } | 703 } |
703 | 704 |
704 NS_LOG_INFO (this << " Send retx in the same RBGs"); | 705 NS_LOG_INFO (this << " Send retx in the same RBGs"); |
705 } | 706 } |
706 else | 707 else |
707 { | 708 { |
708 // find RBGs for sending HARQ retx | 709 // find RBGs for sending HARQ retx |
709 uint8_t j = 0; | 710 uint8_t j = 0; |
710 uint8_t rbgId = (dciRbg.at (dciRbg.size () - 1) + 1) % rbgNum; | 711 uint8_t rbgId = static_cast<uint8_t>(dciRbg.at (dciRbg.size () - 1
) + 1) % rbgNum; |
711 uint8_t startRbg = dciRbg.at (dciRbg.size () - 1); | 712 uint8_t startRbg = static_cast<uint8_t>(dciRbg.at (dciRbg.size ()
- 1)); |
712 std::vector <bool> rbgMapCopy = rbgMap; | 713 std::vector <bool> rbgMapCopy = rbgMap; |
713 while ((j < dciRbg.size ())&&(startRbg != rbgId)) | 714 while ((j < dciRbg.size ())&&(startRbg != rbgId)) |
714 { | 715 { |
715 if (rbgMapCopy.at (rbgId) == false) | 716 if (rbgMapCopy.at (rbgId) == false) |
716 { | 717 { |
717 rbgMapCopy.at (rbgId) = true; | 718 rbgMapCopy.at (rbgId) = true; |
718 dciRbg.at (j) = rbgId; | 719 dciRbg.at (j) = rbgId; |
719 j++; | 720 j++; |
720 } | 721 } |
721 rbgId = (rbgId + 1) % rbgNum; | 722 rbgId = (rbgId + 1) % rbgNum; |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 | 925 |
925 if (itMax == m_flowStatsDl.end ()) | 926 if (itMax == m_flowStatsDl.end ()) |
926 { | 927 { |
927 // no UE available for downlink· | 928 // no UE available for downlink· |
928 NS_LOG_INFO (this << " any UE found"); | 929 NS_LOG_INFO (this << " any UE found"); |
929 } | 930 } |
930 else | 931 else |
931 { | 932 { |
932 // assign all free RBGs to this UE | 933 // assign all free RBGs to this UE |
933 std::vector <uint16_t> tempMap; | 934 std::vector <uint16_t> tempMap; |
934 for (int i = 0; i < rbgNum; i++) | 935 for (uint16_t i = 0; i < rbgNum; i++) |
935 { | 936 { |
936 NS_LOG_INFO (this << " ALLOCATION for RBG " << i << " of " << rbgNum); | 937 NS_LOG_INFO (this << " ALLOCATION for RBG " << i << " of " << rbgNum); |
937 NS_LOG_DEBUG (this << " ALLOCATION for RBG " << i << " of " << rbgNum)
; | 938 NS_LOG_DEBUG (this << " ALLOCATION for RBG " << i << " of " << rbgNum)
; |
938 if (rbgMap.at (i) == false) | 939 if (rbgMap.at (i) == false) |
939 { | 940 { |
940 rbgMap.at (i) = true; | 941 rbgMap.at (i) = true; |
941 tempMap.push_back (i); | 942 tempMap.push_back (i); |
942 } // end for RBG free | 943 } // end for RBG free |
943 | 944 |
944 } // end for RBGs | 945 } // end for RBGs |
945 | 946 |
946 allocationMap.insert (std::pair <uint16_t, std::vector <uint16_t> > ((*itM
ax), tempMap)); | 947 allocationMap.insert (std::pair <uint16_t, std::vector <uint16_t> > ((*itM
ax), tempMap)); |
947 } | 948 } |
948 | 949 |
949 // generate the transmission opportunities by grouping the RBGs of the same RN
TI and | 950 // generate the transmission opportunities by grouping the RBGs of the same RN
TI and |
950 // creating the correspondent DCIs | 951 // creating the correspondent DCIs |
951 std::map <uint16_t, std::vector <uint16_t> >::iterator itMap = allocationMap.b
egin (); | 952 std::map <uint16_t, std::vector <uint16_t> >::iterator itMap = allocationMap.b
egin (); |
952 while (itMap != allocationMap.end ()) | 953 while (itMap != allocationMap.end ()) |
953 { | 954 { |
954 // create new BuildDataListElement_s for this LC | 955 // create new BuildDataListElement_s for this LC |
955 BuildDataListElement_s newEl; | 956 BuildDataListElement_s newEl; |
956 newEl.m_rnti = (*itMap).first; | 957 newEl.m_rnti = (*itMap).first; |
957 // create the DlDciListElement_s | 958 // create the DlDciListElement_s |
958 DlDciListElement_s newDci; | 959 DlDciListElement_s newDci; |
959 newDci.m_rnti = (*itMap).first; | 960 newDci.m_rnti = (*itMap).first; |
960 newDci.m_harqProcess = UpdateHarqProcessId ((*itMap).first); | 961 newDci.m_harqProcess = UpdateHarqProcessId ((*itMap).first); |
961 | 962 |
962 uint16_t lcActives = LcActivePerFlow ((*itMap).first); | 963 uint16_t lcActives = static_cast<uint16_t>(LcActivePerFlow ((*itMap).first
)); |
963 NS_LOG_INFO (this << "Allocate user " << newEl.m_rnti << " rbg " << lcActi
ves); | 964 NS_LOG_INFO (this << "Allocate user " << newEl.m_rnti << " rbg " << lcActi
ves); |
964 if (lcActives == 0) | 965 if (lcActives == 0) |
965 { | 966 { |
966 // Set to max value, to avoid divide by 0 below | 967 // Set to max value, to avoid divide by 0 below |
967 lcActives = (uint16_t)65535; // UINT16_MAX; | 968 lcActives = (uint16_t)65535; // UINT16_MAX; |
968 } | 969 } |
969 uint16_t RgbPerRnti = (*itMap).second.size (); | 970 uint16_t RgbPerRnti = static_cast<uint16_t>((*itMap).second.size ()); |
970 std::map <uint16_t,uint8_t>::iterator itCqi; | 971 std::map <uint16_t,uint8_t>::iterator itCqi; |
971 itCqi = m_p10CqiRxed.find ((*itMap).first); | 972 itCqi = m_p10CqiRxed.find ((*itMap).first); |
972 std::map <uint16_t,uint8_t>::iterator itTxMode; | 973 std::map <uint16_t,uint8_t>::iterator itTxMode; |
973 itTxMode = m_uesTxMode.find ((*itMap).first); | 974 itTxMode = m_uesTxMode.find ((*itMap).first); |
974 if (itTxMode == m_uesTxMode.end ()) | 975 if (itTxMode == m_uesTxMode.end ()) |
975 { | 976 { |
976 NS_FATAL_ERROR ("No Transmission Mode info on user " << (*itMap).first
); | 977 NS_FATAL_ERROR ("No Transmission Mode info on user " << (*itMap).first
); |
977 } | 978 } |
978 int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second)
; | 979 int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second)
; |
979 for (uint8_t j = 0; j < nLayer; j++) | 980 for (uint8_t j = 0; j < nLayer; j++) |
980 { | 981 { |
981 if (itCqi == m_p10CqiRxed.end ()) | 982 if (itCqi == m_p10CqiRxed.end ()) |
982 { | 983 { |
983 newDci.m_mcs.push_back (0); // no info on this user -> lowest MCS | 984 newDci.m_mcs.push_back (0); // no info on this user -> lowest MCS |
984 } | 985 } |
985 else | 986 else |
986 { | 987 { |
987 newDci.m_mcs.push_back ( m_amc->GetMcsFromCqi ((*itCqi).second) ); | 988 newDci.m_mcs.push_back ( m_amc->GetMcsFromCqi ((*itCqi).second) ); |
988 } | 989 } |
989 | 990 |
990 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) | 991 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) |
991 newDci.m_tbsSize.push_back (tbSize); | 992 newDci.m_tbsSize.push_back (static_cast<uint16_t>(tbSize)); |
992 } | 993 } |
993 | 994 |
994 newDci.m_resAlloc = 0; // only allocation type 0 at this stage | 995 newDci.m_resAlloc = 0; // only allocation type 0 at this stage |
995 newDci.m_rbBitmap = 0; // TBD (32 bit bitmap see 7.1.6 of 36.213) | 996 newDci.m_rbBitmap = 0; // TBD (32 bit bitmap see 7.1.6 of 36.213) |
996 uint32_t rbgMask = 0; | 997 uint32_t rbgMask = 0; |
997 for (uint16_t k = 0; k < (*itMap).second.size (); k++) | 998 for (uint16_t k = 0; k < (*itMap).second.size (); k++) |
998 { | 999 { |
999 rbgMask = rbgMask + (0x1 << (*itMap).second.at (k)); | 1000 rbgMask = rbgMask + (0x1 << (*itMap).second.at (k)); |
1000 NS_LOG_INFO (this << " Allocated RBG " << (*itMap).second.at (k)); | 1001 NS_LOG_INFO (this << " Allocated RBG " << (*itMap).second.at (k)); |
1001 } | 1002 } |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 rntiAllocated.insert (dci.m_rnti); | 1281 rntiAllocated.insert (dci.m_rnti); |
1281 } | 1282 } |
1282 else | 1283 else |
1283 { | 1284 { |
1284 NS_LOG_INFO (this << " HARQ-ACK feedback from RNTI " << params.m_u
lInfoList.at (i).m_rnti); | 1285 NS_LOG_INFO (this << " HARQ-ACK feedback from RNTI " << params.m_u
lInfoList.at (i).m_rnti); |
1285 } | 1286 } |
1286 } | 1287 } |
1287 } | 1288 } |
1288 | 1289 |
1289 std::map <uint16_t,uint32_t>::iterator it; | 1290 std::map <uint16_t,uint32_t>::iterator it; |
1290 int nflows = 0; | 1291 uint16_t nflows = 0; |
1291 | 1292 |
1292 for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) | 1293 for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) |
1293 { | 1294 { |
1294 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first); | 1295 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first); |
1295 // select UEs with queues not empty and not yet allocated for HARQ | 1296 // select UEs with queues not empty and not yet allocated for HARQ |
1296 if (((*it).second > 0)&&(itRnti == rntiAllocated.end ())) | 1297 if (((*it).second > 0)&&(itRnti == rntiAllocated.end ())) |
1297 { | 1298 { |
1298 nflows++; | 1299 nflows++; |
1299 } | 1300 } |
1300 } | 1301 } |
1301 | 1302 |
1302 if (nflows == 0) | 1303 if (nflows == 0) |
1303 { | 1304 { |
1304 if (ret.m_dciList.size () > 0) | 1305 if (ret.m_dciList.size () > 0) |
1305 { | 1306 { |
1306 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> >
(params.m_sfnSf, rbgAllocationMap)); | 1307 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> >
(params.m_sfnSf, rbgAllocationMap)); |
1307 m_schedSapUser->SchedUlConfigInd (ret); | 1308 m_schedSapUser->SchedUlConfigInd (ret); |
1308 } | 1309 } |
1309 ········ | 1310 ········ |
1310 return; // no flows to be scheduled | 1311 return; // no flows to be scheduled |
1311 } | 1312 } |
1312 | 1313 |
1313 | 1314 |
1314 // Divide the remaining resources equally among the active users starting from
the subsequent one served last scheduling trigger | 1315 // Divide the remaining resources equally among the active users starting from
the subsequent one served last scheduling trigger |
1315 uint16_t rbPerFlow = (m_cschedCellConfig.m_ulBandwidth) / (nflows + rntiAlloca
ted.size ()); | 1316 uint16_t rbPerFlow = (m_cschedCellConfig.m_ulBandwidth) / (nflows + static_cas
t<uint16_t>(rntiAllocated.size ())); |
1316 if (rbPerFlow < 3) | 1317 if (rbPerFlow < 3) |
1317 { | 1318 { |
1318 rbPerFlow = 3; // at least 3 rbg per flow (till available resource) to en
sure TxOpportunity >= 7 bytes | 1319 rbPerFlow = 3; // at least 3 rbg per flow (till available resource) to en
sure TxOpportunity >= 7 bytes |
1319 } | 1320 } |
1320 int rbAllocated = 0; | 1321 uint16_t rbAllocated = 0; |
1321 | 1322 |
1322 if (m_nextRntiUl != 0) | 1323 if (m_nextRntiUl != 0) |
1323 { | 1324 { |
1324 for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) | 1325 for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) |
1325 { | 1326 { |
1326 if ((*it).first == m_nextRntiUl) | 1327 if ((*it).first == m_nextRntiUl) |
1327 { | 1328 { |
1328 break; | 1329 break; |
1329 } | 1330 } |
1330 } | 1331 } |
(...skipping 29 matching lines...) Expand all Loading... |
1360 // at least 3 rbg per flow to ensure TxOpportunity >= 7 bytes | 1361 // at least 3 rbg per flow to ensure TxOpportunity >= 7 bytes |
1361 if (rbPerFlow < 3) | 1362 if (rbPerFlow < 3) |
1362 { | 1363 { |
1363 // terminate allocation | 1364 // terminate allocation |
1364 rbPerFlow = 0;······ | 1365 rbPerFlow = 0;······ |
1365 } | 1366 } |
1366 } | 1367 } |
1367 | 1368 |
1368 UlDciListElement_s uldci; | 1369 UlDciListElement_s uldci; |
1369 uldci.m_rnti = (*it).first; | 1370 uldci.m_rnti = (*it).first; |
1370 uldci.m_rbLen = rbPerFlow; | 1371 uldci.m_rbLen = static_cast<uint8_t>(rbPerFlow); |
| 1372 uldci.m_rbStart = 0; |
1371 bool allocated = false; | 1373 bool allocated = false; |
1372 NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << r
bPerFlow << " flows " << nflows); | 1374 NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << r
bPerFlow << " flows " << nflows); |
1373 while ((!allocated)&&((rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBa
ndwidth) < 1) && (rbPerFlow != 0)) | 1375 while ((!allocated)&&((rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBa
ndwidth) < 1) && (rbPerFlow != 0)) |
1374 { | 1376 { |
1375 // check availability | 1377 // check availability |
1376 bool free = true; | 1378 bool free = true; |
1377 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) | 1379 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) |
1378 { | 1380 { |
1379 if (rbMap.at (j) == true) | 1381 if (rbMap.at (j) == true) |
1380 { | 1382 { |
1381 free = false; | 1383 free = false; |
1382 break; | 1384 break; |
1383 } | 1385 } |
1384 } | 1386 } |
1385 if (free) | 1387 if (free) |
1386 { | 1388 { |
1387 uldci.m_rbStart = rbAllocated; | 1389 uldci.m_rbStart = static_cast<uint8_t>(rbAllocated); |
1388 | 1390 |
1389 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) | 1391 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) |
1390 { | 1392 { |
1391 rbMap.at (j) = true; | 1393 rbMap.at (j) = true; |
1392 // store info on allocation for managing ul-cqi interpretation | 1394 // store info on allocation for managing ul-cqi interpretation |
1393 rbgAllocationMap.at (j) = (*it).first; | 1395 rbgAllocationMap.at (j) = (*it).first; |
1394 } | 1396 } |
1395 rbAllocated += rbPerFlow; | 1397 rbAllocated += rbPerFlow; |
1396 allocated = true; | 1398 allocated = true; |
1397 break; | 1399 break; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params
.m_sfnSf, rbgAllocationMap)); | 1540 m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params
.m_sfnSf, rbgAllocationMap)); |
1539 m_schedSapUser->SchedUlConfigInd (ret); | 1541 m_schedSapUser->SchedUlConfigInd (ret); |
1540 | 1542 |
1541 return; | 1543 return; |
1542 } | 1544 } |
1543 | 1545 |
1544 void | 1546 void |
1545 TdMtFfMacScheduler::DoSchedUlNoiseInterferenceReq (const struct FfMacSchedSapPro
vider::SchedUlNoiseInterferenceReqParameters& params) | 1547 TdMtFfMacScheduler::DoSchedUlNoiseInterferenceReq (const struct FfMacSchedSapPro
vider::SchedUlNoiseInterferenceReqParameters& params) |
1546 { | 1548 { |
1547 NS_LOG_FUNCTION (this); | 1549 NS_LOG_FUNCTION (this); |
| 1550 NS_UNUSED(params); |
1548 return; | 1551 return; |
1549 } | 1552 } |
1550 | 1553 |
1551 void | 1554 void |
1552 TdMtFfMacScheduler::DoSchedUlSrInfoReq (const struct FfMacSchedSapProvider::Sche
dUlSrInfoReqParameters& params) | 1555 TdMtFfMacScheduler::DoSchedUlSrInfoReq (const struct FfMacSchedSapProvider::Sche
dUlSrInfoReqParameters& params) |
1553 { | 1556 { |
1554 NS_LOG_FUNCTION (this); | 1557 NS_LOG_FUNCTION (this); |
| 1558 NS_UNUSED(params); |
1555 return; | 1559 return; |
1556 } | 1560 } |
1557 | 1561 |
1558 void | 1562 void |
1559 TdMtFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider:
:SchedUlMacCtrlInfoReqParameters& params) | 1563 TdMtFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider:
:SchedUlMacCtrlInfoReqParameters& params) |
1560 { | 1564 { |
1561 NS_LOG_FUNCTION (this); | 1565 NS_LOG_FUNCTION (this); |
1562 | 1566 |
1563 std::map <uint16_t,uint32_t>::iterator it; | 1567 std::map <uint16_t,uint32_t>::iterator it; |
1564 | 1568 |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1912 { | 1916 { |
1913 NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode); | 1917 NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode); |
1914 FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params; | 1918 FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params; |
1915 params.m_rnti = rnti; | 1919 params.m_rnti = rnti; |
1916 params.m_transmissionMode = txMode; | 1920 params.m_transmissionMode = txMode; |
1917 m_cschedSapUser->CschedUeConfigUpdateInd (params); | 1921 m_cschedSapUser->CschedUeConfigUpdateInd (params); |
1918 } | 1922 } |
1919 | 1923 |
1920 | 1924 |
1921 } | 1925 } |
OLD | NEW |