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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 double noisePowerDbm = ktDbm + 10 * std::log10 (25 * 180000); // corresponds t
o kT*bandwidth in linear units | 116 double noisePowerDbm = ktDbm + 10 * std::log10 (25 * 180000); // corresponds t
o kT*bandwidth in linear units |
117 double receiverNoiseFigureDb = 9.0; // default UE noise figure | 117 double receiverNoiseFigureDb = 9.0; // default UE noise figure |
118 | 118 |
119 for ( int i = 0 ; i < numOfTests; i++ ) | 119 for ( int i = 0 ; i < numOfTests; i++ ) |
120 { | 120 { |
121 double lossDb = txPowerDbm - snrEfficiencyMcs[i].snrDb - noisePowerDbm - r
eceiverNoiseFigureDb; | 121 double lossDb = txPowerDbm - snrEfficiencyMcs[i].snrDb - noisePowerDbm - r
eceiverNoiseFigureDb; |
122 | 122 |
123 std::ostringstream name; | 123 std::ostringstream name; |
124 name << " snr= " << snrEfficiencyMcs[i].snrDb << " dB, " | 124 name << " snr= " << snrEfficiencyMcs[i].snrDb << " dB, " |
125 << " mcs= " << snrEfficiencyMcs[i].mcsIndex; | 125 << " mcs= " << snrEfficiencyMcs[i].mcsIndex; |
126 AddTestCase (new LteLinkAdaptationTestCase (name.str (), snrEfficiencyMcs
[i].snrDb, lossDb, (uint16_t)snrEfficiencyMcs[i].mcsIndex), TestCase::QUICK); | 126 AddTestCase (new LteLinkAdaptationTestCase (name.str (), snrEfficiencyMcs
[i].snrDb, lossDb, static_cast<uint16_t>(snrEfficiencyMcs[i].mcsIndex)), TestCas
e::QUICK); |
127 } | 127 } |
128 | 128 |
129 } | 129 } |
130 | 130 |
131 static LteLinkAdaptationTestSuite lteLinkAdaptationTestSuite; | 131 static LteLinkAdaptationTestSuite lteLinkAdaptationTestSuite; |
132 | 132 |
133 | 133 |
134 /** | 134 /** |
135 * TestCase | 135 * TestCase |
136 */ | 136 */ |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 lteHelper->ActivateDataRadioBearer (ueDevs, bearer); | 204 lteHelper->ActivateDataRadioBearer (ueDevs, bearer); |
205 | 205 |
206 // Use testing chunk processor in the PHY layer | 206 // Use testing chunk processor in the PHY layer |
207 // It will be used to test that the SNR is as intended | 207 // It will be used to test that the SNR is as intended |
208 Ptr<LtePhy> uePhy = ueDevs.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->G
etObject<LtePhy> (); | 208 Ptr<LtePhy> uePhy = ueDevs.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->G
etObject<LtePhy> (); |
209 Ptr<LteChunkProcessor> testSinr = Create<LteChunkProcessor> (); | 209 Ptr<LteChunkProcessor> testSinr = Create<LteChunkProcessor> (); |
210 LteSpectrumValueCatcher sinrCatcher; | 210 LteSpectrumValueCatcher sinrCatcher; |
211 testSinr->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &s
inrCatcher)); | 211 testSinr->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &s
inrCatcher)); |
212 uePhy->GetDownlinkSpectrumPhy ()->AddCtrlSinrChunkProcessor (testSinr); | 212 uePhy->GetDownlinkSpectrumPhy ()->AddCtrlSinrChunkProcessor (testSinr); |
213 | 213 |
214 Config::Connect ("/NodeList/0/DeviceList/0/LteEnbMac/DlScheduling", | 214 Config::Connect ("/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlS
cheduling", |
215 MakeBoundCallback (&LteTestDlSchedulingCallback, this)); | 215 MakeBoundCallback (&LteTestDlSchedulingCallback, this)); |
216 | 216 |
217 Simulator::Stop (Seconds (0.040)); | 217 Simulator::Stop (Seconds (0.040)); |
218 Simulator::Run (); | 218 Simulator::Run (); |
219 | 219 |
220 double calculatedSinrDb = 10.0 * std::log10 (sinrCatcher.GetValue ()->operator
[] (0)); | 220 double calculatedSinrDb = 10.0 * std::log10 (sinrCatcher.GetValue ()->operator
[] (0)); |
221 NS_TEST_ASSERT_MSG_EQ_TOL (calculatedSinrDb, m_snrDb, 0.0000001, "Wrong SINR !
"); | 221 NS_TEST_ASSERT_MSG_EQ_TOL (calculatedSinrDb, m_snrDb, 0.0000001, "Wrong SINR !
"); |
222 Simulator::Destroy (); | 222 Simulator::Destroy (); |
223 } | 223 } |
224 | 224 |
(...skipping 15 matching lines...) Expand all Loading... |
240 * RRC connection has been completed and | 240 * RRC connection has been completed and |
241 * CQI feedback is available at the eNB. | 241 * CQI feedback is available at the eNB. |
242 */ | 242 */ |
243 if (Simulator::Now ().GetSeconds () > 0.030) | 243 if (Simulator::Now ().GetSeconds () > 0.030) |
244 { | 244 { |
245 NS_LOG_INFO (m_snrDb << "\t" << m_mcsIndex << "\t" << (uint16_t)dlInfo.mcs
Tb1); | 245 NS_LOG_INFO (m_snrDb << "\t" << m_mcsIndex << "\t" << (uint16_t)dlInfo.mcs
Tb1); |
246 | 246 |
247 NS_TEST_ASSERT_MSG_EQ ((uint16_t)dlInfo.mcsTb1, m_mcsIndex, "Wrong MCS ind
ex"); | 247 NS_TEST_ASSERT_MSG_EQ ((uint16_t)dlInfo.mcsTb1, m_mcsIndex, "Wrong MCS ind
ex"); |
248 } | 248 } |
249 } | 249 } |
LEFT | RIGHT |