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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 DlSchedulingCallbackInfo dlInfo) | 49 DlSchedulingCallbackInfo dlInfo) |
50 { | 50 { |
51 testcase->DlScheduling (dlInfo); | 51 testcase->DlScheduling (dlInfo); |
52 } | 52 } |
53 | 53 |
54 void | 54 void |
55 LteTestUlSchedulingCallback (LteInterferenceTestCase *testcase, std::string path
, | 55 LteTestUlSchedulingCallback (LteInterferenceTestCase *testcase, std::string path
, |
56 uint32_t frameNo, uint32_t subframeNo, uint16_t rnt
i, | 56 uint32_t frameNo, uint32_t subframeNo, uint16_t rnt
i, |
57 uint8_t mcs, uint16_t sizeTb, uint8_t ccId) | 57 uint8_t mcs, uint16_t sizeTb, uint8_t ccId) |
58 { | 58 { |
59 NS_UNUSED(ccId); | 59 NS_UNUSED (ccId); |
60 testcase->UlScheduling (frameNo, subframeNo, rnti, mcs, sizeTb); | 60 testcase->UlScheduling (frameNo, subframeNo, rnti, mcs, sizeTb); |
61 } | 61 } |
62 | 62 |
63 | 63 |
64 /** | 64 /** |
65 * TestSuite | 65 * TestSuite |
66 */ | 66 */ |
67 | 67 |
68 LteInterferenceTestSuite::LteInterferenceTestSuite () | 68 LteInterferenceTestSuite::LteInterferenceTestSuite () |
69 : TestSuite ("lte-interference", SYSTEM) | 69 : TestSuite ("lte-interference", SYSTEM) |
(...skipping 27 matching lines...) Expand all Loading... |
97 | 97 |
98 LteInterferenceTestCase::LteInterferenceTestCase (std::string name, double d1, d
ouble d2, double dlSinr, double ulSinr, double dlSe, double ulSe, uint16_t dlMcs
, uint16_t ulMcs) | 98 LteInterferenceTestCase::LteInterferenceTestCase (std::string name, double d1, d
ouble d2, double dlSinr, double ulSinr, double dlSe, double ulSe, uint16_t dlMcs
, uint16_t ulMcs) |
99 : TestCase (name), | 99 : TestCase (name), |
100 m_d1 (d1), | 100 m_d1 (d1), |
101 m_d2 (d2), | 101 m_d2 (d2), |
102 m_expectedDlSinrDb (10 * std::log10 (dlSinr)), | 102 m_expectedDlSinrDb (10 * std::log10 (dlSinr)), |
103 m_expectedUlSinrDb (10 * std::log10 (ulSinr)), | 103 m_expectedUlSinrDb (10 * std::log10 (ulSinr)), |
104 m_dlMcs (dlMcs), | 104 m_dlMcs (dlMcs), |
105 m_ulMcs (ulMcs) | 105 m_ulMcs (ulMcs) |
106 { | 106 { |
107 NS_UNUSED(dlSe); | 107 NS_UNUSED (dlSe); |
108 NS_UNUSED(ulSe); | 108 NS_UNUSED (ulSe); |
109 } | 109 } |
110 | 110 |
111 LteInterferenceTestCase::~LteInterferenceTestCase () | 111 LteInterferenceTestCase::~LteInterferenceTestCase () |
112 { | 112 { |
113 } | 113 } |
114 | 114 |
115 void | 115 void |
116 LteInterferenceTestCase::DoRun (void) | 116 LteInterferenceTestCase::DoRun (void) |
117 { | 117 { |
118 NS_LOG_INFO (this << GetName ()); | 118 NS_LOG_INFO (this << GetName ()); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 LteSpectrumValueCatcher dlSinr1Catcher; | 184 LteSpectrumValueCatcher dlSinr1Catcher; |
185 testDlSinr1->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue,
&dlSinr1Catcher)); | 185 testDlSinr1->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue,
&dlSinr1Catcher)); |
186 ue1Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr1); | 186 ue1Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr1); |
187 | 187 |
188 Ptr<LtePhy> enb1phy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy (
)->GetObject<LtePhy> (); | 188 Ptr<LtePhy> enb1phy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy (
)->GetObject<LtePhy> (); |
189 Ptr<LteChunkProcessor> testUlSinr1 = Create<LteChunkProcessor> (); | 189 Ptr<LteChunkProcessor> testUlSinr1 = Create<LteChunkProcessor> (); |
190 LteSpectrumValueCatcher ulSinr1Catcher; | 190 LteSpectrumValueCatcher ulSinr1Catcher; |
191 testUlSinr1->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue,
&ulSinr1Catcher)); | 191 testUlSinr1->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue,
&ulSinr1Catcher)); |
192 enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr1); | 192 enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr1); |
193 | 193 |
194 Config::Connect ("/NodeList/0/DeviceList/0/LteEnbMac/DlScheduling", | 194 Config::Connect ("/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlS
cheduling", |
195 MakeBoundCallback (&LteTestDlSchedulingCallback, this)); | 195 MakeBoundCallback (&LteTestDlSchedulingCallback, this)); |
196 | 196 |
197 Config::Connect ("/NodeList/0/DeviceList/0/LteEnbMac/UlScheduling", | 197 Config::Connect ("/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlS
cheduling", |
198 MakeBoundCallback (&LteTestUlSchedulingCallback, this)); | 198 MakeBoundCallback (&LteTestUlSchedulingCallback, this)); |
199 | 199 |
200 | 200 |
201 // same as above for eNB2 and UE2 | 201 // same as above for eNB2 and UE2 |
202 | 202 |
203 Ptr<LtePhy> ue2Phy = ueDevs2.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()-
>GetObject<LtePhy> (); | 203 Ptr<LtePhy> ue2Phy = ueDevs2.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()-
>GetObject<LtePhy> (); |
204 Ptr<LteChunkProcessor> testDlSinr2 = Create<LteChunkProcessor> (); | 204 Ptr<LteChunkProcessor> testDlSinr2 = Create<LteChunkProcessor> (); |
205 LteSpectrumValueCatcher dlSinr2Catcher; | 205 LteSpectrumValueCatcher dlSinr2Catcher; |
206 testDlSinr2->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue,
&dlSinr2Catcher)); | 206 testDlSinr2->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue,
&dlSinr2Catcher)); |
207 ue2Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr2); | 207 ue2Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr2); |
208 | 208 |
209 Ptr<LtePhy> enb2phy = enbDevs.Get (1)->GetObject<LteEnbNetDevice> ()->GetPhy (
)->GetObject<LtePhy> (); | 209 Ptr<LtePhy> enb2phy = enbDevs.Get (1)->GetObject<LteEnbNetDevice> ()->GetPhy (
)->GetObject<LtePhy> (); |
210 Ptr<LteChunkProcessor> testUlSinr2 = Create<LteChunkProcessor> (); | 210 Ptr<LteChunkProcessor> testUlSinr2 = Create<LteChunkProcessor> (); |
211 LteSpectrumValueCatcher ulSinr2Catcher; | 211 LteSpectrumValueCatcher ulSinr2Catcher; |
212 testUlSinr2->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue,
&ulSinr2Catcher)); | 212 testUlSinr2->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue,
&ulSinr2Catcher)); |
213 enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr2); | 213 enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr2); |
214 | 214 |
215 Config::Connect ("/NodeList/1/DeviceList/0/LteEnbMac/DlScheduling", | 215 Config::Connect ("/NodeList/1/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlS
cheduling", |
216 MakeBoundCallback (&LteTestDlSchedulingCallback, this)); | 216 MakeBoundCallback (&LteTestDlSchedulingCallback, this)); |
217 | 217 |
218 Config::Connect ("/NodeList/1/DeviceList/0/LteEnbMac/UlScheduling", | 218 Config::Connect ("/NodeList/1/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlS
cheduling", |
219 MakeBoundCallback (&LteTestUlSchedulingCallback, this)); | 219 MakeBoundCallback (&LteTestUlSchedulingCallback, this)); |
220 | 220 |
221 // need to allow for RRC connection establishment + SRS | 221 // need to allow for RRC connection establishment + SRS |
222 Simulator::Stop (Seconds (0.100)); | 222 Simulator::Stop (Seconds (0.100)); |
223 Simulator::Run (); | 223 Simulator::Run (); |
224 | 224 |
225 if (m_dlMcs > 0) | 225 if (m_dlMcs > 0) |
226 { | 226 { |
227 double dlSinr1Db = 10.0 * std::log10 (dlSinr1Catcher.GetValue ()->operator
[] (0)); | 227 double dlSinr1Db = 10.0 * std::log10 (dlSinr1Catcher.GetValue ()->operator
[] (0)); |
228 NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr1Db, m_expectedDlSinrDb, 0.01, "Wrong SIN
R in DL! (eNB1 --> UE1)"); | 228 NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr1Db, m_expectedDlSinrDb, 0.01, "Wrong SIN
R in DL! (eNB1 --> UE1)"); |
(...skipping 30 matching lines...) Expand all Loading... |
259 LteInterferenceTestCase::UlScheduling (uint32_t frameNo, uint32_t subframeNo, ui
nt16_t rnti, | 259 LteInterferenceTestCase::UlScheduling (uint32_t frameNo, uint32_t subframeNo, ui
nt16_t rnti, |
260 uint8_t mcs, uint16_t sizeTb) | 260 uint8_t mcs, uint16_t sizeTb) |
261 { | 261 { |
262 NS_LOG_FUNCTION (frameNo << subframeNo << rnti << (uint32_t) mcs << sizeTb); | 262 NS_LOG_FUNCTION (frameNo << subframeNo << rnti << (uint32_t) mcs << sizeTb); |
263 // need to allow for RRC connection establishment + SRS transmission | 263 // need to allow for RRC connection establishment + SRS transmission |
264 if (Simulator::Now () > MilliSeconds (50)) | 264 if (Simulator::Now () > MilliSeconds (50)) |
265 { | 265 { |
266 NS_TEST_ASSERT_MSG_EQ ((uint32_t)mcs, (uint32_t)m_ulMcs, "Wrong UL MCS"); | 266 NS_TEST_ASSERT_MSG_EQ ((uint32_t)mcs, (uint32_t)m_ulMcs, "Wrong UL MCS"); |
267 } | 267 } |
268 } | 268 } |
LEFT | RIGHT |