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 291 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 NS_UNUSED (params); |
313 return; | 313 return; |
314 } | 314 } |
315 | 315 |
316 void | 316 void |
317 TdMtFfMacScheduler::DoSchedDlMacBufferReq (const struct FfMacSchedSapProvider::S
chedDlMacBufferReqParameters& params) | 317 TdMtFfMacScheduler::DoSchedDlMacBufferReq (const struct FfMacSchedSapProvider::S
chedDlMacBufferReqParameters& params) |
318 { | 318 { |
319 NS_LOG_FUNCTION (this); | 319 NS_LOG_FUNCTION (this); |
320 NS_FATAL_ERROR ("method not implemented"); | 320 NS_FATAL_ERROR ("method not implemented"); |
321 NS_UNUSED(params); | 321 NS_UNUSED (params); |
322 return; | 322 return; |
323 } | 323 } |
324 | 324 |
325 int | 325 int |
326 TdMtFfMacScheduler::GetRbgSize (int dlbandwidth) | 326 TdMtFfMacScheduler::GetRbgSize (int dlbandwidth) |
327 { | 327 { |
328 for (int i = 0; i < 4; i++) | 328 for (int i = 0; i < 4; i++) |
329 { | 329 { |
330 if (dlbandwidth < TdMtType0AllocationRbg[i]) | 330 if (dlbandwidth < TdMtType0AllocationRbg[i]) |
331 { | 331 { |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 { | 494 { |
495 (*itProcId).second = ((*itProcId).second + 1) % HARQ_PROC_NUM; | 495 (*itProcId).second = ((*itProcId).second + 1) % HARQ_PROC_NUM; |
496 } | 496 } |
497 | 497 |
498 // RACH Allocation | 498 // RACH Allocation |
499 m_rachAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0); | 499 m_rachAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0); |
500 uint8_t rbStart = 0; | 500 uint8_t rbStart = 0; |
501 std::vector <struct RachListElement_s>::iterator itRach; | 501 std::vector <struct RachListElement_s>::iterator itRach; |
502 for (itRach = m_rachList.begin (); itRach != m_rachList.end (); itRach++) | 502 for (itRach = m_rachList.begin (); itRach != m_rachList.end (); itRach++) |
503 { | 503 { |
504 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"); | 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"); |
505 BuildRarListElement_s newRar; | 505 BuildRarListElement_s newRar; |
506 newRar.m_rnti = (*itRach).m_rnti; | 506 newRar.m_rnti = (*itRach).m_rnti; |
507 // DL-RACH Allocation | 507 // DL-RACH Allocation |
508 // Ideal: no needs of configuring m_dci | 508 // Ideal: no needs of configuring m_dci |
509 // UL-RACH Allocation | 509 // UL-RACH Allocation |
510 newRar.m_grant.m_rnti = newRar.m_rnti; | 510 newRar.m_grant.m_rnti = newRar.m_rnti; |
511 newRar.m_grant.m_mcs = m_ulGrantMcs; | 511 newRar.m_grant.m_mcs = m_ulGrantMcs; |
512 uint8_t rbLen = 1; | 512 uint8_t rbLen = 1; |
513 uint16_t tbSizeBits = 0; | 513 uint16_t tbSizeBits = 0; |
514 // find lowest TB size that fits UL grant estimated size | 514 // find lowest TB size that fits UL grant estimated size |
515 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)) |
516 { | 516 { |
517 rbLen++; | 517 rbLen++; |
518 tbSizeBits = m_amc->GetTbSizeFromMcs (m_ulGrantMcs, rbLen); | 518 tbSizeBits = m_amc->GetUlTbSizeFromMcs (m_ulGrantMcs, rbLen); |
519 } | 519 } |
520 if (tbSizeBits < (*itRach).m_estimatedSize) | 520 if (tbSizeBits < (*itRach).m_estimatedSize) |
521 { | 521 { |
522 // no more allocation space: finish allocation | 522 // no more allocation space: finish allocation |
523 break; | 523 break; |
524 } | 524 } |
525 newRar.m_grant.m_rbStart = rbStart; | 525 newRar.m_grant.m_rbStart = rbStart; |
526 newRar.m_grant.m_rbLen = rbLen; | 526 newRar.m_grant.m_rbLen = rbLen; |
527 newRar.m_grant.m_tbSize = tbSizeBits / 8; | 527 newRar.m_grant.m_tbSize = tbSizeBits / 8; |
528 newRar.m_grant.m_hopping = false; | 528 newRar.m_grant.m_hopping = false; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 } | 604 } |
605 std::vector <struct DlInfoListElement_s> dlInfoListUntxed; | 605 std::vector <struct DlInfoListElement_s> dlInfoListUntxed; |
606 for (uint16_t i = 0; i < m_dlInfoListBuffered.size (); i++) | 606 for (uint16_t i = 0; i < m_dlInfoListBuffered.size (); i++) |
607 { | 607 { |
608 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); |
609 if (itRnti != rntiAllocated.end ()) | 609 if (itRnti != rntiAllocated.end ()) |
610 { | 610 { |
611 // RNTI already allocated for retx | 611 // RNTI already allocated for retx |
612 continue; | 612 continue; |
613 } | 613 } |
614 uint8_t nLayers = static_cast<uint8_t>(m_dlInfoListBuffered.at (i).m_harqS
tatus.size ()); | 614 uint8_t nLayers = static_cast<uint8_t> (m_dlInfoListBuffered.at (i).m_harq
Status.size ()); |
615 std::vector <bool> retx; | 615 std::vector <bool> retx; |
616 NS_LOG_INFO (this << " Processing DLHARQ feedback"); | 616 NS_LOG_INFO (this << " Processing DLHARQ feedback"); |
617 if (nLayers == 1) | 617 if (nLayers == 1) |
618 { | 618 { |
619 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); |
620 retx.push_back (false); | 620 retx.push_back (false); |
621 } | 621 } |
622 else | 622 else |
623 { | 623 { |
624 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... |
701 NS_LOG_INFO ("RBG " << dciRbg.at (j) << " assigned"); | 701 NS_LOG_INFO ("RBG " << dciRbg.at (j) << " assigned"); |
702 rbgAllocatedNum++; | 702 rbgAllocatedNum++; |
703 } | 703 } |
704 | 704 |
705 NS_LOG_INFO (this << " Send retx in the same RBGs"); | 705 NS_LOG_INFO (this << " Send retx in the same RBGs"); |
706 } | 706 } |
707 else | 707 else |
708 { | 708 { |
709 // find RBGs for sending HARQ retx | 709 // find RBGs for sending HARQ retx |
710 uint8_t j = 0; | 710 uint8_t j = 0; |
711 uint8_t rbgId = static_cast<uint8_t>(dciRbg.at (dciRbg.size () - 1
) + 1) % rbgNum; | 711 uint8_t rbgId = static_cast<uint8_t> (dciRbg.at (dciRbg.size () -
1) + 1) % rbgNum; |
712 uint8_t startRbg = static_cast<uint8_t>(dciRbg.at (dciRbg.size ()
- 1)); | 712 uint8_t startRbg = static_cast<uint8_t> (dciRbg.at (dciRbg.size ()
- 1)); |
713 std::vector <bool> rbgMapCopy = rbgMap; | 713 std::vector <bool> rbgMapCopy = rbgMap; |
714 while ((j < dciRbg.size ())&&(startRbg != rbgId)) | 714 while ((j < dciRbg.size ())&&(startRbg != rbgId)) |
715 { | 715 { |
716 if (rbgMapCopy.at (rbgId) == false) | 716 if (rbgMapCopy.at (rbgId) == false) |
717 { | 717 { |
718 rbgMapCopy.at (rbgId) = true; | 718 rbgMapCopy.at (rbgId) = true; |
719 dciRbg.at (j) = rbgId; | 719 dciRbg.at (j) = rbgId; |
720 j++; | 720 j++; |
721 } | 721 } |
722 rbgId = (rbgId + 1) % rbgNum; | 722 rbgId = (rbgId + 1) % rbgNum; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 { | 898 { |
899 // CQI == 0 means "out of range" (see table 7.2.3-1 of 36.213) | 899 // CQI == 0 means "out of range" (see table 7.2.3-1 of 36.213) |
900 if (LcActivePerFlow (*it) > 0) | 900 if (LcActivePerFlow (*it) > 0) |
901 { | 901 { |
902 // this UE has data to transmit | 902 // this UE has data to transmit |
903 double achievableRate = 0.0; | 903 double achievableRate = 0.0; |
904 for (uint8_t k = 0; k < nLayer; k++)· | 904 for (uint8_t k = 0; k < nLayer; k++)· |
905 { | 905 { |
906 uint8_t mcs = 0;· | 906 uint8_t mcs = 0;· |
907 mcs = m_amc->GetMcsFromCqi (wbCqi); | 907 mcs = m_amc->GetMcsFromCqi (wbCqi); |
908 achievableRate += ((m_amc->GetTbSizeFromMcs (mcs, rbgSize) / 8
) / 0.001); // = TB size / TTI | 908 achievableRate += ((m_amc->GetDlTbSizeFromMcs (mcs, rbgSize) /
8) / 0.001); // = TB size / TTI |
909 | 909 |
910 NS_LOG_DEBUG (this << " RNTI " << (*it) << " MCS " << (uint32_
t)mcs << " achievableRate " << achievableRate ); | 910 NS_LOG_DEBUG (this << " RNTI " << (*it) << " MCS " << (uint32_
t)mcs << " achievableRate " << achievableRate ); |
911 } | 911 } |
912 | 912 |
913 double metric = achievableRate; | 913 double metric = achievableRate; |
914 | 914 |
915 if (metric > metricMax) | 915 if (metric > metricMax) |
916 { | 916 { |
917 metricMax = metric; | 917 metricMax = metric; |
918 itMax = it; | 918 itMax = it; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 while (itMap != allocationMap.end ()) | 953 while (itMap != allocationMap.end ()) |
954 { | 954 { |
955 // create new BuildDataListElement_s for this LC | 955 // create new BuildDataListElement_s for this LC |
956 BuildDataListElement_s newEl; | 956 BuildDataListElement_s newEl; |
957 newEl.m_rnti = (*itMap).first; | 957 newEl.m_rnti = (*itMap).first; |
958 // create the DlDciListElement_s | 958 // create the DlDciListElement_s |
959 DlDciListElement_s newDci; | 959 DlDciListElement_s newDci; |
960 newDci.m_rnti = (*itMap).first; | 960 newDci.m_rnti = (*itMap).first; |
961 newDci.m_harqProcess = UpdateHarqProcessId ((*itMap).first); | 961 newDci.m_harqProcess = UpdateHarqProcessId ((*itMap).first); |
962 | 962 |
963 uint16_t lcActives = static_cast<uint16_t>(LcActivePerFlow ((*itMap).first
)); | 963 uint16_t lcActives = static_cast<uint16_t> (LcActivePerFlow ((*itMap).firs
t)); |
964 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); |
965 if (lcActives == 0) | 965 if (lcActives == 0) |
966 { | 966 { |
967 // Set to max value, to avoid divide by 0 below | 967 // Set to max value, to avoid divide by 0 below |
968 lcActives = (uint16_t)65535; // UINT16_MAX; | 968 lcActives = (uint16_t)65535; // UINT16_MAX; |
969 } | 969 } |
970 uint16_t RgbPerRnti = static_cast<uint16_t>((*itMap).second.size ()); | 970 uint16_t RgbPerRnti = static_cast<uint16_t> ((*itMap).second.size ()); |
971 std::map <uint16_t,uint8_t>::iterator itCqi; | 971 std::map <uint16_t,uint8_t>::iterator itCqi; |
972 itCqi = m_p10CqiRxed.find ((*itMap).first); | 972 itCqi = m_p10CqiRxed.find ((*itMap).first); |
973 std::map <uint16_t,uint8_t>::iterator itTxMode; | 973 std::map <uint16_t,uint8_t>::iterator itTxMode; |
974 itTxMode = m_uesTxMode.find ((*itMap).first); | 974 itTxMode = m_uesTxMode.find ((*itMap).first); |
975 if (itTxMode == m_uesTxMode.end ()) | 975 if (itTxMode == m_uesTxMode.end ()) |
976 { | 976 { |
977 NS_FATAL_ERROR ("No Transmission Mode info on user " << (*itMap).first
); | 977 NS_FATAL_ERROR ("No Transmission Mode info on user " << (*itMap).first
); |
978 } | 978 } |
979 int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second)
; | 979 int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second)
; |
980 for (uint8_t j = 0; j < nLayer; j++) | 980 for (uint8_t j = 0; j < nLayer; j++) |
981 { | 981 { |
982 if (itCqi == m_p10CqiRxed.end ()) | 982 if (itCqi == m_p10CqiRxed.end ()) |
983 { | 983 { |
984 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 |
985 } | 985 } |
986 else | 986 else |
987 { | 987 { |
988 newDci.m_mcs.push_back ( m_amc->GetMcsFromCqi ((*itCqi).second) ); | 988 newDci.m_mcs.push_back ( m_amc->GetMcsFromCqi ((*itCqi).second) ); |
989 } | 989 } |
990 | 990 |
991 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) | 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) |
992 newDci.m_tbsSize.push_back (static_cast<uint16_t>(tbSize)); | 992 newDci.m_tbsSize.push_back (static_cast<uint16_t> (tbSize)); |
993 } | 993 } |
994 | 994 |
995 newDci.m_resAlloc = 0; // only allocation type 0 at this stage | 995 newDci.m_resAlloc = 0; // only allocation type 0 at this stage |
996 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) |
997 uint32_t rbgMask = 0; | 997 uint32_t rbgMask = 0; |
998 for (uint16_t k = 0; k < (*itMap).second.size (); k++) | 998 for (uint16_t k = 0; k < (*itMap).second.size (); k++) |
999 { | 999 { |
1000 rbgMask = rbgMask + (0x1 << (*itMap).second.at (k)); | 1000 rbgMask = rbgMask + (0x1 << (*itMap).second.at (k)); |
1001 NS_LOG_INFO (this << " Allocated RBG " << (*itMap).second.at (k)); | 1001 NS_LOG_INFO (this << " Allocated RBG " << (*itMap).second.at (k)); |
1002 } | 1002 } |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 rntiAllocated.insert (dci.m_rnti); | 1281 rntiAllocated.insert (dci.m_rnti); |
1282 } | 1282 } |
1283 else | 1283 else |
1284 { | 1284 { |
1285 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); |
1286 } | 1286 } |
1287 } | 1287 } |
1288 } | 1288 } |
1289 | 1289 |
1290 std::map <uint16_t,uint32_t>::iterator it; | 1290 std::map <uint16_t,uint32_t>::iterator it; |
1291 int nflows = 0; | 1291 uint16_t nflows = 0; |
1292 | 1292 |
1293 for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) | 1293 for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) |
1294 { | 1294 { |
1295 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first); | 1295 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first); |
1296 // 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 |
1297 if (((*it).second > 0)&&(itRnti == rntiAllocated.end ())) | 1297 if (((*it).second > 0)&&(itRnti == rntiAllocated.end ())) |
1298 { | 1298 { |
1299 nflows++; | 1299 nflows++; |
1300 } | 1300 } |
1301 } | 1301 } |
1302 | 1302 |
1303 if (nflows == 0) | 1303 if (nflows == 0) |
1304 { | 1304 { |
1305 if (ret.m_dciList.size () > 0) | 1305 if (ret.m_dciList.size () > 0) |
1306 { | 1306 { |
1307 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)); |
1308 m_schedSapUser->SchedUlConfigInd (ret); | 1308 m_schedSapUser->SchedUlConfigInd (ret); |
1309 } | 1309 } |
1310 ········ | 1310 ········ |
1311 return; // no flows to be scheduled | 1311 return; // no flows to be scheduled |
1312 } | 1312 } |
1313 | 1313 |
1314 | 1314 |
1315 // 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 |
1316 uint16_t rbPerFlow = static_cast<uint16_t>((m_cschedCellConfig.m_ulBandwidth)
/ (nflows + rntiAllocated.size ())); | 1316 uint16_t rbPerFlow = (m_cschedCellConfig.m_ulBandwidth) / (nflows + static_cas
t<uint16_t> (rntiAllocated.size ())); |
1317 if (rbPerFlow < 3) | 1317 if (rbPerFlow < 3) |
1318 { | 1318 { |
1319 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 |
1320 } | 1320 } |
1321 uint16_t rbAllocated = 0; | 1321 uint16_t rbAllocated = 0; |
1322 | 1322 |
1323 if (m_nextRntiUl != 0) | 1323 if (m_nextRntiUl != 0) |
1324 { | 1324 { |
1325 for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) | 1325 for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) |
1326 { | 1326 { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 // at least 3 rbg per flow to ensure TxOpportunity >= 7 bytes | 1361 // at least 3 rbg per flow to ensure TxOpportunity >= 7 bytes |
1362 if (rbPerFlow < 3) | 1362 if (rbPerFlow < 3) |
1363 { | 1363 { |
1364 // terminate allocation | 1364 // terminate allocation |
1365 rbPerFlow = 0;······ | 1365 rbPerFlow = 0;······ |
1366 } | 1366 } |
1367 } | 1367 } |
1368 | 1368 |
1369 UlDciListElement_s uldci; | 1369 UlDciListElement_s uldci; |
1370 uldci.m_rnti = (*it).first; | 1370 uldci.m_rnti = (*it).first; |
1371 uldci.m_rbLen = static_cast<uint8_t>(rbPerFlow); | 1371 uldci.m_rbLen = static_cast<uint8_t> (rbPerFlow); |
1372 uldci.m_rbStart = 0; | 1372 uldci.m_rbStart = 0; |
1373 bool allocated = false; | 1373 bool allocated = false; |
1374 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); |
1375 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)) |
1376 { | 1376 { |
1377 // check availability | 1377 // check availability |
1378 bool free = true; | 1378 bool free = true; |
1379 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) | 1379 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) |
1380 { | 1380 { |
1381 if (rbMap.at (j) == true) | 1381 if (rbMap.at (j) == true) |
1382 { | 1382 { |
1383 free = false; | 1383 free = false; |
1384 break; | 1384 break; |
1385 } | 1385 } |
1386 } | 1386 } |
1387 if (free) | 1387 if (free) |
1388 { | 1388 { |
1389 uldci.m_rbStart = static_cast<uint8_t>(rbAllocated); | 1389 uldci.m_rbStart = static_cast<uint8_t> (rbAllocated); |
1390 | 1390 |
1391 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) | 1391 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++) |
1392 { | 1392 { |
1393 rbMap.at (j) = true; | 1393 rbMap.at (j) = true; |
1394 // store info on allocation for managing ul-cqi interpretation | 1394 // store info on allocation for managing ul-cqi interpretation |
1395 rbgAllocationMap.at (j) = (*it).first; | 1395 rbgAllocationMap.at (j) = (*it).first; |
1396 } | 1396 } |
1397 rbAllocated += rbPerFlow; | 1397 rbAllocated += rbPerFlow; |
1398 allocated = true; | 1398 allocated = true; |
1399 break; | 1399 break; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1470 // remove UE from allocation map | 1470 // remove UE from allocation map |
1471 for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_r
bLen; i++) | 1471 for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_r
bLen; i++) |
1472 { | 1472 { |
1473 rbgAllocationMap.at (i) = 0; | 1473 rbgAllocationMap.at (i) = 0; |
1474 } | 1474 } |
1475 continue; // CQI == 0 means "out of range" (see table 7.2.3-1 of 3
6.213) | 1475 continue; // CQI == 0 means "out of range" (see table 7.2.3-1 of 3
6.213) |
1476 } | 1476 } |
1477 uldci.m_mcs = m_amc->GetMcsFromCqi (cqi); | 1477 uldci.m_mcs = m_amc->GetMcsFromCqi (cqi); |
1478 } | 1478 } |
1479 | 1479 |
1480 uldci.m_tbSize = m_amc->GetTbSizeFromMcs (uldci.m_mcs, rbPerFlow) / 8; | 1480 uldci.m_tbSize = (m_amc->GetUlTbSizeFromMcs (uldci.m_mcs, rbPerFlow) / 8); |
1481 UpdateUlRlcBufferInfo (uldci.m_rnti, uldci.m_tbSize); | 1481 UpdateUlRlcBufferInfo (uldci.m_rnti, uldci.m_tbSize); |
1482 uldci.m_ndi = 1; | 1482 uldci.m_ndi = 1; |
1483 uldci.m_cceIndex = 0; | 1483 uldci.m_cceIndex = 0; |
1484 uldci.m_aggrLevel = 1; | 1484 uldci.m_aggrLevel = 1; |
1485 uldci.m_ueTxAntennaSelection = 3; // antenna selection OFF | 1485 uldci.m_ueTxAntennaSelection = 3; // antenna selection OFF |
1486 uldci.m_hopping = false; | 1486 uldci.m_hopping = false; |
1487 uldci.m_n2Dmrs = 0; | 1487 uldci.m_n2Dmrs = 0; |
1488 uldci.m_tpc = 0; // no power control | 1488 uldci.m_tpc = 0; // no power control |
1489 uldci.m_cqiRequest = false; // only period CQI at this stage | 1489 uldci.m_cqiRequest = false; // only period CQI at this stage |
1490 uldci.m_ulIndex = 0; // TDD parameter | 1490 uldci.m_ulIndex = 0; // TDD parameter |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1540 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)); |
1541 m_schedSapUser->SchedUlConfigInd (ret); | 1541 m_schedSapUser->SchedUlConfigInd (ret); |
1542 | 1542 |
1543 return; | 1543 return; |
1544 } | 1544 } |
1545 | 1545 |
1546 void | 1546 void |
1547 TdMtFfMacScheduler::DoSchedUlNoiseInterferenceReq (const struct FfMacSchedSapPro
vider::SchedUlNoiseInterferenceReqParameters& params) | 1547 TdMtFfMacScheduler::DoSchedUlNoiseInterferenceReq (const struct FfMacSchedSapPro
vider::SchedUlNoiseInterferenceReqParameters& params) |
1548 { | 1548 { |
1549 NS_LOG_FUNCTION (this); | 1549 NS_LOG_FUNCTION (this); |
1550 NS_UNUSED(params); | 1550 NS_UNUSED (params); |
1551 return; | 1551 return; |
1552 } | 1552 } |
1553 | 1553 |
1554 void | 1554 void |
1555 TdMtFfMacScheduler::DoSchedUlSrInfoReq (const struct FfMacSchedSapProvider::Sche
dUlSrInfoReqParameters& params) | 1555 TdMtFfMacScheduler::DoSchedUlSrInfoReq (const struct FfMacSchedSapProvider::Sche
dUlSrInfoReqParameters& params) |
1556 { | 1556 { |
1557 NS_LOG_FUNCTION (this); | 1557 NS_LOG_FUNCTION (this); |
1558 NS_UNUSED(params); | 1558 NS_UNUSED (params); |
1559 return; | 1559 return; |
1560 } | 1560 } |
1561 | 1561 |
1562 void | 1562 void |
1563 TdMtFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider:
:SchedUlMacCtrlInfoReqParameters& params) | 1563 TdMtFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider:
:SchedUlMacCtrlInfoReqParameters& params) |
1564 { | 1564 { |
1565 NS_LOG_FUNCTION (this); | 1565 NS_LOG_FUNCTION (this); |
1566 | 1566 |
1567 std::map <uint16_t,uint32_t>::iterator it; | 1567 std::map <uint16_t,uint32_t>::iterator it; |
1568 | 1568 |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1916 { | 1916 { |
1917 NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode); | 1917 NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode); |
1918 FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params; | 1918 FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params; |
1919 params.m_rnti = rnti; | 1919 params.m_rnti = rnti; |
1920 params.m_transmissionMode = txMode; | 1920 params.m_transmissionMode = txMode; |
1921 m_cschedSapUser->CschedUeConfigUpdateInd (params); | 1921 m_cschedSapUser->CschedUeConfigUpdateInd (params); |
1922 } | 1922 } |
1923 | 1923 |
1924 | 1924 |
1925 } | 1925 } |
LEFT | RIGHT |