author | Vedran Miletić <rivanvx@gmail.com> |
Fri, 19 Apr 2013 22:39:55 +0200 | |
changeset 9703 | 681f35b212ff |
parent 9653 | 382d27da8905 |
child 9802 | 5dea58a3b261 |
child 10063 | 6b30859ebd37 |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
6852
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
6705 | 2 |
/* |
3 |
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari |
|
4 |
* |
|
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 |
|
7 |
* published by the Free Software Foundation; |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
18 |
* Author: Giuseppe Piro <g.piro@poliba.it> |
|
7886 | 19 |
* Marco Miozzo <mmiozzo@cttc.es> |
6705 | 20 |
*/ |
21 |
||
22 |
#include <ns3/object-factory.h> |
|
23 |
#include <ns3/log.h> |
|
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
9053
diff
changeset
|
24 |
#include <cmath> |
6705 | 25 |
#include <ns3/simulator.h> |
7949 | 26 |
#include <ns3/attribute-accessor-helper.h> |
27 |
#include <ns3/double.h> |
|
28 |
||
29 |
||
7887 | 30 |
#include "lte-enb-phy.h" |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
31 |
#include "lte-ue-phy.h" |
6705 | 32 |
#include "lte-net-device.h" |
33 |
#include "lte-spectrum-value-helper.h" |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
34 |
#include "lte-control-messages.h" |
7887 | 35 |
#include "lte-enb-net-device.h" |
9345
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9337
diff
changeset
|
36 |
#include "lte-ue-rrc.h" |
7886 | 37 |
#include "lte-enb-mac.h" |
7947 | 38 |
#include <ns3/lte-common.h> |
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
39 |
#include <ns3/lte-vendor-specific-parameters.h> |
7886 | 40 |
|
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
41 |
// WILD HACK for the inizialization of direct eNB-UE ctrl messaging |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
42 |
#include <ns3/node-list.h> |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
43 |
#include <ns3/node.h> |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
44 |
#include <ns3/lte-ue-net-device.h> |
9519
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
45 |
#include <ns3/pointer.h> |
6705 | 46 |
|
7887 | 47 |
NS_LOG_COMPONENT_DEFINE ("LteEnbPhy"); |
6705 | 48 |
|
49 |
namespace ns3 { |
|
50 |
||
9386
24df31b77b25
PhyStats calculator implementation. All code needed added to LteHelper. Prototype order changed in order to respect cellId,IMSI, rnti
Jaume Nin
parents:
9357
diff
changeset
|
51 |
NS_OBJECT_ENSURE_REGISTERED (LteEnbPhy); |
6705 | 52 |
|
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
53 |
// duration of the data part of a subframe in DL |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
54 |
// = 0.001 / 14 * 11 (fixed to 11 symbols) -1ns as margin to avoid overlapping simulator events |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
55 |
static const Time DL_DATA_DURATION = NanoSeconds (785714 -1); |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
56 |
|
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
57 |
// delay from subframe start to transmission of the data in DL |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
58 |
// = 0.001 / 14 * 3 (ctrl fixed to 3 symbols) |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
59 |
static const Time DL_CTRL_DELAY_FROM_SUBFRAME_START = NanoSeconds (214286); |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
60 |
|
7886 | 61 |
//////////////////////////////////////// |
62 |
// member SAP forwarders |
|
63 |
//////////////////////////////////////// |
|
64 |
||
65 |
||
66 |
class EnbMemberLteEnbPhySapProvider : public LteEnbPhySapProvider |
|
67 |
{ |
|
68 |
public: |
|
7887 | 69 |
EnbMemberLteEnbPhySapProvider (LteEnbPhy* phy); |
7886 | 70 |
|
71 |
// inherited from LteEnbPhySapProvider |
|
72 |
virtual void SendMacPdu (Ptr<Packet> p); |
|
73 |
virtual void SetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth); |
|
74 |
virtual void SetCellId (uint16_t cellId); |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
75 |
virtual void SendLteControlMessage (Ptr<LteControlMessage> msg); |
8729
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
76 |
virtual uint8_t GetMacChTtiDelay (); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
77 |
|
7886 | 78 |
|
79 |
private: |
|
7887 | 80 |
LteEnbPhy* m_phy; |
7886 | 81 |
}; |
82 |
||
7887 | 83 |
EnbMemberLteEnbPhySapProvider::EnbMemberLteEnbPhySapProvider (LteEnbPhy* phy) : m_phy (phy) |
7886 | 84 |
{ |
85 |
||
86 |
} |
|
87 |
||
88 |
void |
|
89 |
EnbMemberLteEnbPhySapProvider::SendMacPdu (Ptr<Packet> p) |
|
90 |
{ |
|
91 |
m_phy->DoSendMacPdu (p); |
|
92 |
} |
|
93 |
||
94 |
void |
|
95 |
EnbMemberLteEnbPhySapProvider::SetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth) |
|
96 |
{ |
|
97 |
m_phy->DoSetBandwidth (ulBandwidth, dlBandwidth); |
|
98 |
} |
|
99 |
||
100 |
void |
|
101 |
EnbMemberLteEnbPhySapProvider::SetCellId (uint16_t cellId) |
|
102 |
{ |
|
103 |
m_phy->DoSetCellId (cellId); |
|
104 |
} |
|
105 |
||
106 |
void |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
107 |
EnbMemberLteEnbPhySapProvider::SendLteControlMessage (Ptr<LteControlMessage> msg) |
7886 | 108 |
{ |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
109 |
m_phy->DoSendLteControlMessage (msg); |
7886 | 110 |
} |
111 |
||
8729
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
112 |
uint8_t |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
113 |
EnbMemberLteEnbPhySapProvider::GetMacChTtiDelay () |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
114 |
{ |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
115 |
return (m_phy->DoGetMacChTtiDelay ()); |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
116 |
} |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
117 |
|
7886 | 118 |
|
119 |
//////////////////////////////////////// |
|
7887 | 120 |
// generic LteEnbPhy methods |
7886 | 121 |
//////////////////////////////////////// |
122 |
||
123 |
||
124 |
||
7887 | 125 |
LteEnbPhy::LteEnbPhy () |
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7977
diff
changeset
|
126 |
{ |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7977
diff
changeset
|
127 |
NS_LOG_FUNCTION (this); |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7977
diff
changeset
|
128 |
NS_FATAL_ERROR ("This constructor should not be called"); |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7977
diff
changeset
|
129 |
} |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7977
diff
changeset
|
130 |
|
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7977
diff
changeset
|
131 |
LteEnbPhy::LteEnbPhy (Ptr<LteSpectrumPhy> dlPhy, Ptr<LteSpectrumPhy> ulPhy) |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7977
diff
changeset
|
132 |
: LtePhy (dlPhy, ulPhy), |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
133 |
m_enbPhySapUser (0), |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
134 |
m_enbCphySapUser (0), |
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7977
diff
changeset
|
135 |
m_nrFrames (0), |
9036 | 136 |
m_nrSubFrames (0), |
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
137 |
m_srsPeriodicity (0), |
9409 | 138 |
m_srsStartTime (Seconds (0)), |
9357
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
139 |
m_currentSrsOffset (0), |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
140 |
m_interferenceSampleCounter (0) |
6705 | 141 |
{ |
7886 | 142 |
m_enbPhySapProvider = new EnbMemberLteEnbPhySapProvider (this); |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
143 |
m_enbCphySapProvider = new MemberLteEnbCphySapProvider<LteEnbPhy> (this); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
144 |
m_harqPhyModule = Create <LteHarqPhy> (); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
145 |
m_downlinkSpectrumPhy->SetHarqPhyModule (m_harqPhyModule); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
146 |
m_uplinkSpectrumPhy->SetHarqPhyModule (m_harqPhyModule); |
7944
f7e5e0540487
connection of SAPs moved from EnbNetDevice to LenaHelper
Nicola Baldo <nicola@baldo.biz>
parents:
7943
diff
changeset
|
147 |
Simulator::ScheduleNow (&LteEnbPhy::StartFrame, this); |
6705 | 148 |
} |
149 |
||
150 |
TypeId |
|
7887 | 151 |
LteEnbPhy::GetTypeId (void) |
6705 | 152 |
{ |
7887 | 153 |
static TypeId tid = TypeId ("ns3::LteEnbPhy") |
6707
2ac68a0381ca
improved module after Tom's review
Giuseppe Piro <g.piro@poliba.it>
parents:
6705
diff
changeset
|
154 |
.SetParent<LtePhy> () |
7887 | 155 |
.AddConstructor<LteEnbPhy> () |
7949 | 156 |
.AddAttribute ("TxPower", |
157 |
"Transmission power in dBm", |
|
158 |
DoubleValue (30.0), |
|
159 |
MakeDoubleAccessor (&LteEnbPhy::SetTxPower, |
|
160 |
&LteEnbPhy::GetTxPower), |
|
161 |
MakeDoubleChecker<double> ()) |
|
7981 | 162 |
.AddAttribute ("NoiseFigure", |
163 |
"Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver." |
|
164 |
" According to Wikipedia (http://en.wikipedia.org/wiki/Noise_figure), this is " |
|
165 |
"\"the difference in decibels (dB) between" |
|
166 |
" the noise output of the actual receiver to the noise output of an " |
|
167 |
" ideal receiver with the same overall gain and bandwidth when the receivers " |
|
168 |
" are connected to sources at the standard noise temperature T0.\" " |
|
169 |
"In this model, we consider T0 = 290K.", |
|
170 |
DoubleValue (5.0), |
|
171 |
MakeDoubleAccessor (&LteEnbPhy::SetNoiseFigure, |
|
172 |
&LteEnbPhy::GetNoiseFigure), |
|
173 |
MakeDoubleChecker<double> ()) |
|
8664
ab4c821fc251
revision after Giuseppe's comments http://codereview.appspot.com/4626069/#msg1
Nicola Baldo <nbaldo@cttc.es>
parents:
8538
diff
changeset
|
174 |
.AddAttribute ("MacToChannelDelay", |
ab4c821fc251
revision after Giuseppe's comments http://codereview.appspot.com/4626069/#msg1
Nicola Baldo <nbaldo@cttc.es>
parents:
8538
diff
changeset
|
175 |
"The delay in TTI units that occurs between a scheduling decision in the MAC and the actual start of the transmission by the PHY. This is intended to be used to model the latency of real PHY and MAC implementations.", |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
176 |
UintegerValue (2), |
8670
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
177 |
MakeUintegerAccessor (&LteEnbPhy::SetMacChDelay, |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
178 |
&LteEnbPhy::GetMacChDelay), |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
179 |
MakeUintegerChecker<uint8_t> ()) |
9357
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
180 |
.AddTraceSource ("ReportUeSinr", |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
181 |
"Report UEs' averaged linear SINR", |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
182 |
MakeTraceSourceAccessor (&LteEnbPhy::m_reportUeSinr)) |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
183 |
.AddAttribute ("UeSinrSamplePeriod", |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
184 |
"The sampling period for reporting UEs' SINR stats (default value 1)", |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
185 |
UintegerValue (1), |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
186 |
MakeUintegerAccessor (&LteEnbPhy::m_srsSamplePeriod), |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
187 |
MakeUintegerChecker<uint16_t> ()) |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
188 |
.AddTraceSource ("ReportInterference", |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
189 |
"Report linear interference power per PHY RB", |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
190 |
MakeTraceSourceAccessor (&LteEnbPhy::m_reportInterferenceTrace)) |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
191 |
.AddAttribute ("InterferenceSamplePeriod", |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
192 |
"The sampling period for reporting interference stats (default value 1)", |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
193 |
UintegerValue (1), |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
194 |
MakeUintegerAccessor (&LteEnbPhy::m_interferenceSamplePeriod), |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
195 |
MakeUintegerChecker<uint16_t> ()) |
9519
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
196 |
.AddTraceSource ("DlPhyTransmission", |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
197 |
"DL transmission PHY layer statistics.", |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
198 |
MakeTraceSourceAccessor (&LteEnbPhy::m_dlPhyTransmission)) |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
199 |
.AddAttribute ("DlSpectrumPhy", |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
200 |
"The downlink LteSpectrumPhy associated to this LtePhy", |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
201 |
TypeId::ATTR_GET, |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
202 |
PointerValue (), |
9636
91e31f0e569c
make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents:
9569
diff
changeset
|
203 |
MakePointerAccessor (&LteEnbPhy::GetDlSpectrumPhy), |
9519
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
204 |
MakePointerChecker <LteSpectrumPhy> ()) |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
205 |
.AddAttribute ("UlSpectrumPhy", |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
206 |
"The uplink LteSpectrumPhy associated to this LtePhy", |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
207 |
TypeId::ATTR_GET, |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
208 |
PointerValue (), |
9636
91e31f0e569c
make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents:
9569
diff
changeset
|
209 |
MakePointerAccessor (&LteEnbPhy::GetUlSpectrumPhy), |
9519
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
210 |
MakePointerChecker <LteSpectrumPhy> ()) |
6705 | 211 |
; |
212 |
return tid; |
|
213 |
} |
|
214 |
||
215 |
||
7887 | 216 |
LteEnbPhy::~LteEnbPhy () |
6705 | 217 |
{ |
218 |
} |
|
219 |
||
7886 | 220 |
void |
7913
ed3a9f8a76d7
added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents:
7887
diff
changeset
|
221 |
LteEnbPhy::DoDispose () |
ed3a9f8a76d7
added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents:
7887
diff
changeset
|
222 |
{ |
ed3a9f8a76d7
added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents:
7887
diff
changeset
|
223 |
NS_LOG_FUNCTION (this); |
7921 | 224 |
m_ueAttached.clear (); |
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
225 |
m_srsUeOffset.clear (); |
7930
ccb40542ae88
fixed memory leak in PHY SAP usage
Nicola Baldo <nbaldo@cttc.es>
parents:
7928
diff
changeset
|
226 |
delete m_enbPhySapProvider; |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
227 |
delete m_enbCphySapProvider; |
7913
ed3a9f8a76d7
added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents:
7887
diff
changeset
|
228 |
LtePhy::DoDispose (); |
ed3a9f8a76d7
added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents:
7887
diff
changeset
|
229 |
} |
ed3a9f8a76d7
added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents:
7887
diff
changeset
|
230 |
|
ed3a9f8a76d7
added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents:
7887
diff
changeset
|
231 |
void |
9703
681f35b212ff
Rename Start and DoStart methods to Initialize and DoInitialize
Vedran Miletić <rivanvx@gmail.com>
parents:
9653
diff
changeset
|
232 |
LteEnbPhy::DoInitialize () |
8015 | 233 |
{ |
234 |
NS_LOG_FUNCTION (this); |
|
235 |
Ptr<SpectrumValue> noisePsd = LteSpectrumValueHelper::CreateNoisePowerSpectralDensity (m_ulEarfcn, m_ulBandwidth, m_noiseFigure); |
|
236 |
m_uplinkSpectrumPhy->SetNoisePowerSpectralDensity (noisePsd); |
|
9703
681f35b212ff
Rename Start and DoStart methods to Initialize and DoInitialize
Vedran Miletić <rivanvx@gmail.com>
parents:
9653
diff
changeset
|
237 |
LtePhy::DoInitialize (); |
8015 | 238 |
} |
239 |
||
240 |
||
241 |
void |
|
7887 | 242 |
LteEnbPhy::SetLteEnbPhySapUser (LteEnbPhySapUser* s) |
7886 | 243 |
{ |
244 |
m_enbPhySapUser = s; |
|
245 |
} |
|
246 |
||
247 |
LteEnbPhySapProvider* |
|
7887 | 248 |
LteEnbPhy::GetLteEnbPhySapProvider () |
7886 | 249 |
{ |
250 |
return (m_enbPhySapProvider); |
|
251 |
} |
|
252 |
||
7949 | 253 |
void |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
254 |
LteEnbPhy::SetLteEnbCphySapUser (LteEnbCphySapUser* s) |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
255 |
{ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
256 |
NS_LOG_FUNCTION (this); |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
257 |
m_enbCphySapUser = s; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
258 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
259 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
260 |
LteEnbCphySapProvider* |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
261 |
LteEnbPhy::GetLteEnbCphySapProvider () |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
262 |
{ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
263 |
NS_LOG_FUNCTION (this); |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
264 |
return (m_enbCphySapProvider); |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
265 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
266 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
267 |
void |
7949 | 268 |
LteEnbPhy::SetTxPower (double pow) |
269 |
{ |
|
270 |
NS_LOG_FUNCTION (this << pow); |
|
271 |
m_txPower = pow; |
|
272 |
} |
|
7886 | 273 |
|
7949 | 274 |
double |
275 |
LteEnbPhy::GetTxPower () const |
|
276 |
{ |
|
277 |
NS_LOG_FUNCTION (this); |
|
278 |
return m_txPower; |
|
279 |
} |
|
7886 | 280 |
|
7981 | 281 |
void |
282 |
LteEnbPhy::SetNoiseFigure (double nf) |
|
283 |
{ |
|
284 |
NS_LOG_FUNCTION (this << nf); |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8015
diff
changeset
|
285 |
m_noiseFigure = nf; |
7981 | 286 |
} |
287 |
||
288 |
double |
|
289 |
LteEnbPhy::GetNoiseFigure () const |
|
290 |
{ |
|
291 |
NS_LOG_FUNCTION (this); |
|
292 |
return m_noiseFigure; |
|
293 |
} |
|
294 |
||
8670
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
295 |
void |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
296 |
LteEnbPhy::SetMacChDelay (uint8_t delay) |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
297 |
{ |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
298 |
NS_LOG_FUNCTION (this); |
8670
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
299 |
m_macChTtiDelay = delay; |
8729
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
300 |
for (int i = 0; i < m_macChTtiDelay; i++) |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
301 |
{ |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
302 |
Ptr<PacketBurst> pb = CreateObject <PacketBurst> (); |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
303 |
m_packetBurstQueue.push_back (pb); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
304 |
std::list<Ptr<LteControlMessage> > l; |
8729
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
305 |
m_controlMessagesQueue.push_back (l); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
306 |
std::list<UlDciLteControlMessage> l1; |
8729
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
307 |
m_ulDciQueue.push_back (l1); |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
308 |
} |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
309 |
for (int i = 0; i < UL_PUSCH_TTIS_DELAY; i++) |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
310 |
{ |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
311 |
std::list<UlDciLteControlMessage> l1; |
8729
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
312 |
m_ulDciQueue.push_back (l1); |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
313 |
} |
8670
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
314 |
} |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
315 |
|
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
316 |
uint8_t |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
317 |
LteEnbPhy::GetMacChDelay (void) const |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
318 |
{ |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
319 |
return (m_macChTtiDelay); |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
320 |
} |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
321 |
|
9636
91e31f0e569c
make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents:
9569
diff
changeset
|
322 |
Ptr<LteSpectrumPhy> |
91e31f0e569c
make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents:
9569
diff
changeset
|
323 |
LteEnbPhy::GetDlSpectrumPhy () const |
91e31f0e569c
make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents:
9569
diff
changeset
|
324 |
{ |
91e31f0e569c
make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents:
9569
diff
changeset
|
325 |
return m_downlinkSpectrumPhy; |
91e31f0e569c
make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents:
9569
diff
changeset
|
326 |
} |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
327 |
|
9636
91e31f0e569c
make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents:
9569
diff
changeset
|
328 |
Ptr<LteSpectrumPhy> |
91e31f0e569c
make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents:
9569
diff
changeset
|
329 |
LteEnbPhy::GetUlSpectrumPhy () const |
91e31f0e569c
make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents:
9569
diff
changeset
|
330 |
{ |
91e31f0e569c
make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents:
9569
diff
changeset
|
331 |
return m_uplinkSpectrumPhy; |
91e31f0e569c
make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents:
9569
diff
changeset
|
332 |
} |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
333 |
|
7886 | 334 |
bool |
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
335 |
LteEnbPhy::AddUePhy (uint16_t rnti) |
7886 | 336 |
{ |
9346 | 337 |
NS_LOG_FUNCTION (this << rnti); |
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
338 |
std::set <uint16_t>::iterator it; |
7886 | 339 |
it = m_ueAttached.find (rnti); |
340 |
if (it == m_ueAttached.end ()) |
|
341 |
{ |
|
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
342 |
m_ueAttached.insert (rnti); |
7886 | 343 |
return (true); |
344 |
} |
|
345 |
else |
|
346 |
{ |
|
347 |
NS_LOG_ERROR ("UE already attached"); |
|
348 |
return (false); |
|
349 |
} |
|
350 |
} |
|
6705 | 351 |
|
352 |
bool |
|
8180
5429db8b8c37
Fix Bug JIRA:LENA-145, RNTI as uint16_t in LteEnbPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8148
diff
changeset
|
353 |
LteEnbPhy::DeleteUePhy (uint16_t rnti) |
6705 | 354 |
{ |
9346 | 355 |
NS_LOG_FUNCTION (this << rnti); |
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
356 |
std::set <uint16_t>::iterator it; |
7886 | 357 |
it = m_ueAttached.find (rnti); |
358 |
if (it == m_ueAttached.end ()) |
|
359 |
{ |
|
360 |
NS_LOG_ERROR ("UE not attached"); |
|
361 |
return (false); |
|
362 |
} |
|
363 |
else |
|
364 |
{ |
|
365 |
m_ueAttached.erase (it); |
|
366 |
return (true); |
|
367 |
} |
|
368 |
} |
|
369 |
||
370 |
||
371 |
||
372 |
void |
|
7887 | 373 |
LteEnbPhy::DoSendMacPdu (Ptr<Packet> p) |
7886 | 374 |
{ |
375 |
NS_LOG_FUNCTION (this); |
|
376 |
SetMacPdu (p); |
|
377 |
} |
|
378 |
||
8729
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
379 |
uint8_t |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
380 |
LteEnbPhy::DoGetMacChTtiDelay () |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
381 |
{ |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
382 |
return (m_macChTtiDelay); |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
383 |
} |
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
384 |
|
7886 | 385 |
|
386 |
void |
|
7887 | 387 |
LteEnbPhy::PhyPduReceived (Ptr<Packet> p) |
7886 | 388 |
{ |
389 |
NS_LOG_FUNCTION (this); |
|
390 |
m_enbPhySapUser->ReceivePhyPdu (p); |
|
6705 | 391 |
} |
392 |
||
393 |
void |
|
9048
4aeb9111981b
removed useless LtePhy::{Get,Set}{Up,down}linkSubChannels
Nicola Baldo <nbaldo@cttc.es>
parents:
9047
diff
changeset
|
394 |
LteEnbPhy::SetDownlinkSubChannels (std::vector<int> mask) |
6705 | 395 |
{ |
396 |
NS_LOG_FUNCTION (this); |
|
9048
4aeb9111981b
removed useless LtePhy::{Get,Set}{Up,down}linkSubChannels
Nicola Baldo <nbaldo@cttc.es>
parents:
9047
diff
changeset
|
397 |
m_listOfDownlinkSubchannel = mask; |
6705 | 398 |
Ptr<SpectrumValue> txPsd = CreateTxPowerSpectralDensity (); |
7928
b736f63e9bdf
removed LtePhy::Get{Up,Down}linkSpectrumPhy methods which are evil
Nicola Baldo <nbaldo@cttc.es>
parents:
7921
diff
changeset
|
399 |
m_downlinkSpectrumPhy->SetTxPowerSpectralDensity (txPsd); |
6705 | 400 |
} |
401 |
||
9048
4aeb9111981b
removed useless LtePhy::{Get,Set}{Up,down}linkSubChannels
Nicola Baldo <nbaldo@cttc.es>
parents:
9047
diff
changeset
|
402 |
std::vector<int> |
4aeb9111981b
removed useless LtePhy::{Get,Set}{Up,down}linkSubChannels
Nicola Baldo <nbaldo@cttc.es>
parents:
9047
diff
changeset
|
403 |
LteEnbPhy::GetDownlinkSubChannels (void) |
4aeb9111981b
removed useless LtePhy::{Get,Set}{Up,down}linkSubChannels
Nicola Baldo <nbaldo@cttc.es>
parents:
9047
diff
changeset
|
404 |
{ |
4aeb9111981b
removed useless LtePhy::{Get,Set}{Up,down}linkSubChannels
Nicola Baldo <nbaldo@cttc.es>
parents:
9047
diff
changeset
|
405 |
NS_LOG_FUNCTION (this); |
4aeb9111981b
removed useless LtePhy::{Get,Set}{Up,down}linkSubChannels
Nicola Baldo <nbaldo@cttc.es>
parents:
9047
diff
changeset
|
406 |
return m_listOfDownlinkSubchannel; |
4aeb9111981b
removed useless LtePhy::{Get,Set}{Up,down}linkSubChannels
Nicola Baldo <nbaldo@cttc.es>
parents:
9047
diff
changeset
|
407 |
} |
6705 | 408 |
|
409 |
Ptr<SpectrumValue> |
|
7887 | 410 |
LteEnbPhy::CreateTxPowerSpectralDensity () |
6705 | 411 |
{ |
412 |
NS_LOG_FUNCTION (this); |
|
413 |
||
8015 | 414 |
Ptr<SpectrumValue> psd = LteSpectrumValueHelper::CreateTxPowerSpectralDensity (m_dlEarfcn, m_dlBandwidth, m_txPower, GetDownlinkSubChannels ()); |
6705 | 415 |
|
416 |
return psd; |
|
417 |
} |
|
418 |
||
419 |
||
420 |
void |
|
7887 | 421 |
LteEnbPhy::CalcChannelQualityForUe (std::vector <double> sinr, Ptr<LteSpectrumPhy> ue) |
6705 | 422 |
{ |
423 |
NS_LOG_FUNCTION (this); |
|
424 |
} |
|
425 |
||
7886 | 426 |
|
6705 | 427 |
void |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
428 |
LteEnbPhy::DoSendLteControlMessage (Ptr<LteControlMessage> msg) |
6705 | 429 |
{ |
430 |
NS_LOG_FUNCTION (this << msg); |
|
7886 | 431 |
// queues the message (wait for MAC-PHY delay) |
432 |
SetControlMessages (msg); |
|
6705 | 433 |
} |
434 |
||
435 |
||
7886 | 436 |
|
6705 | 437 |
void |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
438 |
LteEnbPhy::ReceiveLteControlMessage (Ptr<LteControlMessage> msg) |
6705 | 439 |
{ |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
440 |
NS_FATAL_ERROR ("Obsolete function"); |
6705 | 441 |
NS_LOG_FUNCTION (this << msg); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
442 |
m_enbPhySapUser->ReceiveLteControlMessage (msg); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
443 |
} |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
444 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
445 |
void |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
446 |
LteEnbPhy::ReceiveLteControlMessageList (std::list<Ptr<LteControlMessage> > msgList) |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
447 |
{ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
448 |
NS_LOG_FUNCTION (this); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
449 |
std::list<Ptr<LteControlMessage> >::iterator it; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
450 |
for (it = msgList.begin (); it != msgList.end(); it++) |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
451 |
{ |
9406 | 452 |
switch ((*it)->GetMessageType ()) |
453 |
{ |
|
454 |
case LteControlMessage::RACH_PREAMBLE: |
|
455 |
{ |
|
456 |
Ptr<RachPreambleLteControlMessage> rachPreamble = DynamicCast<RachPreambleLteControlMessage> (*it); |
|
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9409
diff
changeset
|
457 |
m_enbPhySapUser->ReceiveRachPreamble (rachPreamble->GetRapId ()); |
9406 | 458 |
} |
459 |
break; |
|
460 |
||
461 |
default: |
|
462 |
m_enbPhySapUser->ReceiveLteControlMessage (*it); |
|
463 |
break; |
|
464 |
} |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
465 |
} |
6705 | 466 |
} |
467 |
||
468 |
||
469 |
||
470 |
void |
|
7887 | 471 |
LteEnbPhy::StartFrame (void) |
6705 | 472 |
{ |
7886 | 473 |
NS_LOG_FUNCTION (this); |
6705 | 474 |
|
7886 | 475 |
++m_nrFrames; |
476 |
NS_LOG_INFO ("-----frame " << m_nrFrames << "-----"); |
|
477 |
m_nrSubFrames = 0; |
|
9406 | 478 |
|
479 |
// send MIB at beginning of every frame |
|
480 |
m_mib.systemFrameNumber = m_nrSubFrames; |
|
481 |
Ptr<MibLteControlMessage> mibMsg = Create<MibLteControlMessage> (); |
|
482 |
mibMsg->SetMib (m_mib); |
|
483 |
m_controlMessagesQueue.at (0).push_back (mibMsg); |
|
484 |
||
6705 | 485 |
StartSubFrame (); |
486 |
} |
|
487 |
||
488 |
||
489 |
void |
|
7887 | 490 |
LteEnbPhy::StartSubFrame (void) |
6705 | 491 |
{ |
7886 | 492 |
NS_LOG_FUNCTION (this); |
6705 | 493 |
|
7886 | 494 |
++m_nrSubFrames; |
9044
e8595c3ac95b
Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
495 |
if (m_srsPeriodicity>0) |
e8595c3ac95b
Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
496 |
{ |
e8595c3ac95b
Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
497 |
// might be 0 in case the eNB has no UEs attached |
9406 | 498 |
NS_ASSERT_MSG (m_nrFrames > 1, "the SRS index check code assumes that frameNo starts at 1"); |
499 |
NS_ASSERT_MSG (m_nrSubFrames > 0 && m_nrSubFrames <= 10, "the SRS index check code assumes that subframeNo starts at 1"); |
|
500 |
m_currentSrsOffset = (((m_nrFrames-1)*10 + (m_nrSubFrames-1)) % m_srsPeriodicity); |
|
9044
e8595c3ac95b
Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9039
diff
changeset
|
501 |
} |
7886 | 502 |
NS_LOG_INFO ("-----sub frame " << m_nrSubFrames << "-----"); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
503 |
m_harqPhyModule->SubframeIndication (m_nrFrames, m_nrSubFrames); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
504 |
|
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
505 |
// update info on TB to be received |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
506 |
std::list<UlDciLteControlMessage> uldcilist = DequeueUlDci (); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
507 |
std::list<UlDciLteControlMessage>::iterator dciIt = uldcilist.begin (); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
508 |
NS_LOG_DEBUG (this << " eNB Expected TBs " << uldcilist.size ()); |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
509 |
for (dciIt = uldcilist.begin (); dciIt!=uldcilist.end (); dciIt++) |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
510 |
{ |
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
511 |
std::set <uint16_t>::iterator it2; |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
512 |
it2 = m_ueAttached.find ((*dciIt).GetDci ().m_rnti); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
513 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
514 |
if (it2 == m_ueAttached.end ()) |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
515 |
{ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
516 |
NS_LOG_ERROR ("UE not attached"); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
517 |
} |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
518 |
else |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
519 |
{ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
520 |
// send info of TB to LteSpectrumPhy |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
521 |
// translate to allocation map |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
522 |
std::vector <int> rbMap; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
523 |
for (int i = (*dciIt).GetDci ().m_rbStart; i < (*dciIt).GetDci ().m_rbStart + (*dciIt).GetDci ().m_rbLen; i++) |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
524 |
{ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
525 |
rbMap.push_back (i); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
526 |
} |
9519
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
527 |
m_uplinkSpectrumPhy->AddExpectedTb ((*dciIt).GetDci ().m_rnti, (*dciIt).GetDci ().m_ndi, (*dciIt).GetDci ().m_tbSize, (*dciIt).GetDci ().m_mcs, rbMap, 0 /* always SISO*/, 0 /* no HARQ proc id in UL*/, 0 /*evaluated by LteSpectrumPhy*/, false /* UL*/); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
528 |
if ((*dciIt).GetDci ().m_ndi==1) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
529 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
530 |
NS_LOG_DEBUG (this << " RNTI " << (*dciIt).GetDci ().m_rnti << " NEW TB"); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
531 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
532 |
else |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
533 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
534 |
NS_LOG_DEBUG (this << " RNTI " << (*dciIt).GetDci ().m_rnti << " HARQ RETX"); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
535 |
} |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
536 |
} |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
537 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8015
diff
changeset
|
538 |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
539 |
// process the current burst of control messages |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
540 |
std::list<Ptr<LteControlMessage> > ctrlMsg = GetControlMessages (); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
541 |
m_dlDataRbMap.clear (); |
7886 | 542 |
if (ctrlMsg.size () > 0) |
543 |
{ |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
544 |
std::list<Ptr<LteControlMessage> >::iterator it; |
7886 | 545 |
it = ctrlMsg.begin (); |
546 |
while (it != ctrlMsg.end ()) |
|
547 |
{ |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
548 |
Ptr<LteControlMessage> msg = (*it); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
549 |
if (msg->GetMessageType () == LteControlMessage::DL_DCI) |
7886 | 550 |
{ |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
551 |
Ptr<DlDciLteControlMessage> dci = DynamicCast<DlDciLteControlMessage> (msg); |
9519
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
552 |
// get the tx power spectral density according to DL-DCI(s) |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
553 |
// translate the DCI to Spectrum framework |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
554 |
uint32_t mask = 0x1; |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
555 |
for (int i = 0; i < 32; i++) |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
556 |
{ |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
557 |
if (((dci->GetDci ().m_rbBitmap & mask) >> i) == 1) |
7886 | 558 |
{ |
9519
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
559 |
for (int k = 0; k < GetRbgSize (); k++) |
7886 | 560 |
{ |
9519
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
561 |
m_dlDataRbMap.push_back ((i * GetRbgSize ()) + k); |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
562 |
//NS_LOG_DEBUG(this << " [enb]DL-DCI allocated PRB " << (i*GetRbgSize()) + k); |
7886 | 563 |
} |
564 |
} |
|
9519
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
565 |
mask = (mask << 1); |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
566 |
} |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
567 |
// fire trace of DL Tx PHY stats |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
568 |
for (uint8_t i = 0; i < dci->GetDci ().m_mcs.size (); i++) |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
569 |
{ |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
570 |
PhyTransmissionStatParameters params; |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
571 |
params.m_cellId = m_cellId; |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
572 |
params.m_imsi = 0; // it will be set by DlPhyTransmissionCallback in LteHelper |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
573 |
params.m_timestamp = Simulator::Now ().GetMilliSeconds (); |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
574 |
params.m_rnti = dci->GetDci ().m_rnti; |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
575 |
params.m_txMode = 0; // TBD |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
576 |
params.m_layer = i; |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
577 |
params.m_mcs = dci->GetDci ().m_mcs.at (i); |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
578 |
params.m_size = dci->GetDci ().m_tbsSize.at (i); |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
579 |
params.m_rv = dci->GetDci ().m_rv.at (i); |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
580 |
params.m_ndi = dci->GetDci ().m_ndi.at (i); |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
581 |
m_dlPhyTransmission (params); |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
582 |
} |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9460
diff
changeset
|
583 |
|
7886 | 584 |
} |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
585 |
else if (msg->GetMessageType () == LteControlMessage::UL_DCI) |
7886 | 586 |
{ |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
587 |
Ptr<UlDciLteControlMessage> dci = DynamicCast<UlDciLteControlMessage> (msg); |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
588 |
QueueUlDci (*dci); |
9460
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
589 |
} |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
590 |
else if (msg->GetMessageType () == LteControlMessage::RAR) |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
591 |
{ |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
592 |
Ptr<RarLteControlMessage> rarMsg = DynamicCast<RarLteControlMessage> (msg); |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
593 |
for (std::list<RarLteControlMessage::Rar>::const_iterator it = rarMsg->RarListBegin (); it != rarMsg->RarListEnd (); ++it) |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
594 |
{ |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
595 |
if (it->rarPayload.m_grant.m_ulDelay == true) |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
596 |
{ |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
597 |
NS_FATAL_ERROR (" RAR delay is not yet implemented"); |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
598 |
} |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
599 |
UlGrant_s ulGrant = it->rarPayload.m_grant; |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
600 |
// translate the UL grant in a standard UL-DCI and queue it |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
601 |
UlDciListElement_s dci; |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
602 |
dci.m_rnti = ulGrant.m_rnti; |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
603 |
dci.m_rbStart = ulGrant.m_rbStart; |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
604 |
dci.m_rbLen = ulGrant.m_rbLen; |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
605 |
dci.m_tbSize = ulGrant.m_tbSize; |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
606 |
dci.m_mcs = ulGrant.m_mcs; |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
607 |
dci.m_hopping = ulGrant.m_hopping; |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
608 |
dci.m_tpc = ulGrant.m_tpc; |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
609 |
dci.m_cqiRequest = ulGrant.m_cqiRequest; |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
610 |
dci.m_ndi = 1; |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
611 |
UlDciLteControlMessage msg; |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
612 |
msg.SetDci (dci); |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
613 |
QueueUlDci (msg); |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
614 |
} |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
615 |
} |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
616 |
it++; |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8015
diff
changeset
|
617 |
|
7886 | 618 |
} |
619 |
} |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
620 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
621 |
SendControlChannels (ctrlMsg); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
622 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
623 |
// send data frame |
7886 | 624 |
Ptr<PacketBurst> pb = GetPacketBurst (); |
625 |
if (pb) |
|
626 |
{ |
|
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
627 |
Simulator::Schedule (DL_CTRL_DELAY_FROM_SUBFRAME_START, // ctrl frame fixed to 3 symbols |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
628 |
&LteEnbPhy::SendDataChannels, |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
629 |
this,pb); |
7886 | 630 |
} |
6705 | 631 |
|
7886 | 632 |
// trigger the MAC |
633 |
m_enbPhySapUser->SubframeIndication (m_nrFrames, m_nrSubFrames); |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8015
diff
changeset
|
634 |
|
6705 | 635 |
Simulator::Schedule (Seconds (GetTti ()), |
7887 | 636 |
&LteEnbPhy::EndSubFrame, |
6705 | 637 |
this); |
638 |
||
639 |
} |
|
640 |
||
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
641 |
void |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
642 |
LteEnbPhy::SendControlChannels (std::list<Ptr<LteControlMessage> > ctrlMsgList) |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
643 |
{ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
644 |
NS_LOG_FUNCTION (this << " eNB " << m_cellId << " start tx ctrl frame"); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
645 |
// set the current tx power spectral density (full bandwidth) |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
646 |
std::vector <int> dlRb; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
647 |
for (uint8_t i = 0; i < m_dlBandwidth; i++) |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
648 |
{ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
649 |
dlRb.push_back (i); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
650 |
} |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
651 |
SetDownlinkSubChannels (dlRb); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
652 |
NS_LOG_LOGIC (this << " eNB start TX CTRL"); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
653 |
m_downlinkSpectrumPhy->StartTxDlCtrlFrame (ctrlMsgList); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
654 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
655 |
} |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
656 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
657 |
void |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
658 |
LteEnbPhy::SendDataChannels (Ptr<PacketBurst> pb) |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
659 |
{ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
660 |
// set the current tx power spectral density |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
661 |
SetDownlinkSubChannels (m_dlDataRbMap); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
662 |
// send the current burts of packets |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
663 |
NS_LOG_LOGIC (this << " eNB start TX DATA"); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
664 |
std::list<Ptr<LteControlMessage> > ctrlMsgList; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
665 |
ctrlMsgList.clear (); |
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
666 |
m_downlinkSpectrumPhy->StartTxDataFrame (pb, ctrlMsgList, DL_DATA_DURATION); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
667 |
} |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
668 |
|
6705 | 669 |
|
670 |
void |
|
7887 | 671 |
LteEnbPhy::EndSubFrame (void) |
6705 | 672 |
{ |
673 |
NS_LOG_FUNCTION (this << Simulator::Now ().GetSeconds ()); |
|
7886 | 674 |
if (m_nrSubFrames == 10) |
6705 | 675 |
{ |
7887 | 676 |
Simulator::ScheduleNow (&LteEnbPhy::EndFrame, this); |
6705 | 677 |
} |
678 |
else |
|
679 |
{ |
|
7887 | 680 |
Simulator::ScheduleNow (&LteEnbPhy::StartSubFrame, this); |
6705 | 681 |
} |
682 |
} |
|
683 |
||
684 |
||
685 |
void |
|
7887 | 686 |
LteEnbPhy::EndFrame (void) |
6705 | 687 |
{ |
688 |
NS_LOG_FUNCTION (this << Simulator::Now ().GetSeconds ()); |
|
7887 | 689 |
Simulator::ScheduleNow (&LteEnbPhy::StartFrame, this); |
6705 | 690 |
} |
691 |
||
692 |
||
7886 | 693 |
void |
9036 | 694 |
LteEnbPhy::GenerateCtrlCqiReport (const SpectrumValue& sinr) |
7886 | 695 |
{ |
9409 | 696 |
NS_LOG_FUNCTION (this << sinr << Simulator::Now () << m_srsStartTime); |
697 |
// avoid processing SRSs sent with an old SRS configuration index |
|
698 |
if (Simulator::Now () > m_srsStartTime) |
|
699 |
{ |
|
700 |
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi = CreateSrsCqiReport (sinr); |
|
701 |
m_enbPhySapUser->UlCqiReport (ulcqi); |
|
702 |
} |
|
9036 | 703 |
} |
704 |
||
705 |
void |
|
706 |
LteEnbPhy::GenerateDataCqiReport (const SpectrumValue& sinr) |
|
707 |
{ |
|
708 |
NS_LOG_FUNCTION (this << sinr); |
|
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
709 |
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi = CreatePuschCqiReport (sinr); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
710 |
m_enbPhySapUser->UlCqiReport (ulcqi); |
7910 | 711 |
} |
712 |
||
9357
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
713 |
void |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
714 |
LteEnbPhy::ReportInterference (const SpectrumValue& interf) |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
715 |
{ |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
716 |
NS_LOG_FUNCTION (this << interf); |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
717 |
Ptr<SpectrumValue> interfCopy = Create<SpectrumValue> (interf); |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
718 |
m_interferenceSampleCounter++; |
9388 | 719 |
if (m_interferenceSampleCounter == m_interferenceSamplePeriod) |
9357
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
720 |
{ |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
721 |
m_reportInterferenceTrace (m_cellId, interfCopy); |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
722 |
m_interferenceSampleCounter = 0; |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
723 |
} |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
724 |
} |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
725 |
|
9389
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9388
diff
changeset
|
726 |
void |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9388
diff
changeset
|
727 |
LteEnbPhy::ReportRsReceivedPower (const SpectrumValue& power) |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9388
diff
changeset
|
728 |
{ |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9388
diff
changeset
|
729 |
// not used by eNB |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9388
diff
changeset
|
730 |
} |
9357
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
731 |
|
7910 | 732 |
|
9036 | 733 |
|
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
734 |
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters |
9036 | 735 |
LteEnbPhy::CreatePuschCqiReport (const SpectrumValue& sinr) |
7910 | 736 |
{ |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8015
diff
changeset
|
737 |
NS_LOG_FUNCTION (this << sinr); |
7910 | 738 |
Values::const_iterator it; |
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
739 |
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi; |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
740 |
ulcqi.m_ulCqi.m_type = UlCqi_s::PUSCH; |
7910 | 741 |
int i = 0; |
742 |
for (it = sinr.ConstValuesBegin (); it != sinr.ConstValuesEnd (); it++) |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8015
diff
changeset
|
743 |
{ |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
9053
diff
changeset
|
744 |
double sinrdb = 10 * std::log10 ((*it)); |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
745 |
// NS_LOG_DEBUG ("ULCQI RB " << i << " value " << sinrdb); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8015
diff
changeset
|
746 |
// convert from double to fixed point notation Sxxxxxxxxxxx.xxx |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8015
diff
changeset
|
747 |
int16_t sinrFp = LteFfConverter::double2fpS11dot3 (sinrdb); |
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
748 |
ulcqi.m_ulCqi.m_sinr.push_back (sinrFp); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8015
diff
changeset
|
749 |
i++; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8015
diff
changeset
|
750 |
} |
7934
0f09fc707a8c
Convert UL-CQI from IdealControlMessage to PhySap Primitive
mmiozzo
parents:
7930
diff
changeset
|
751 |
return (ulcqi); |
7910 | 752 |
|
7886 | 753 |
} |
6705 | 754 |
|
9036 | 755 |
|
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
756 |
void |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
757 |
LteEnbPhy::DoSetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth) |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
758 |
{ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
759 |
NS_LOG_FUNCTION (this << (uint32_t) ulBandwidth << (uint32_t) dlBandwidth); |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
760 |
m_ulBandwidth = ulBandwidth; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
761 |
m_dlBandwidth = dlBandwidth; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
762 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
763 |
int Type0AllocationRbg[4] = { |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
764 |
10, // RGB size 1 |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
765 |
26, // RGB size 2 |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
766 |
63, // RGB size 3 |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
767 |
110 // RGB size 4 |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
768 |
}; // see table 7.1.6.1-1 of 36.213 |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
769 |
for (int i = 0; i < 4; i++) |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
770 |
{ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
771 |
if (dlBandwidth < Type0AllocationRbg[i]) |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
772 |
{ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
773 |
m_rbgSize = i + 1; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
774 |
break; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
775 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
776 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
777 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
778 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
779 |
void |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
780 |
LteEnbPhy::DoSetEarfcn (uint16_t ulEarfcn, uint16_t dlEarfcn) |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
781 |
{ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
782 |
NS_LOG_FUNCTION (this << ulEarfcn << dlEarfcn); |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
783 |
m_ulEarfcn = ulEarfcn; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
784 |
m_dlEarfcn = dlEarfcn; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
785 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
786 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
787 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
788 |
void |
9345
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9337
diff
changeset
|
789 |
LteEnbPhy::DoAddUe (uint16_t rnti) |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
790 |
{ |
9345
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9337
diff
changeset
|
791 |
NS_LOG_FUNCTION (this << rnti); |
9346 | 792 |
|
793 |
bool success = AddUePhy (rnti); |
|
794 |
NS_ASSERT_MSG (success, "AddUePhy() failed"); |
|
795 |
} |
|
796 |
||
9406 | 797 |
void |
798 |
LteEnbPhy::DoRemoveUe (uint16_t rnti) |
|
799 |
{ |
|
800 |
NS_LOG_FUNCTION (this << rnti); |
|
801 |
||
802 |
bool success = DeleteUePhy (rnti); |
|
803 |
NS_ASSERT_MSG (success, "DeleteUePhy() failed"); |
|
804 |
} |
|
805 |
||
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8851
diff
changeset
|
806 |
|
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
807 |
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters |
9036 | 808 |
LteEnbPhy::CreateSrsCqiReport (const SpectrumValue& sinr) |
809 |
{ |
|
810 |
NS_LOG_FUNCTION (this << sinr); |
|
811 |
Values::const_iterator it; |
|
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
812 |
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi; |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
813 |
ulcqi.m_ulCqi.m_type = UlCqi_s::SRS; |
9036 | 814 |
int i = 0; |
9357
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
815 |
double srsSum = 0.0; |
9036 | 816 |
for (it = sinr.ConstValuesBegin (); it != sinr.ConstValuesEnd (); it++) |
817 |
{ |
|
818 |
double sinrdb = 10 * log10 ((*it)); |
|
819 |
// NS_LOG_DEBUG ("ULCQI RB " << i << " value " << sinrdb); |
|
820 |
// convert from double to fixed point notation Sxxxxxxxxxxx.xxx |
|
821 |
int16_t sinrFp = LteFfConverter::double2fpS11dot3 (sinrdb); |
|
9357
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
822 |
srsSum += (*it); |
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
823 |
ulcqi.m_ulCqi.m_sinr.push_back (sinrFp); |
9036 | 824 |
i++; |
825 |
} |
|
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
826 |
// Insert the user generated the srs as a vendor specific parameter |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
827 |
NS_LOG_DEBUG (this << " ENB RX UL-CQI of " << m_srsUeOffset.at (m_currentSrsOffset)); |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
828 |
VendorSpecificListElement_s vsp; |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
829 |
vsp.m_type = SRS_CQI_RNTI_VSP; |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
830 |
vsp.m_length = sizeof(SrsCqiRntiVsp); |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
831 |
Ptr<SrsCqiRntiVsp> rnti = Create <SrsCqiRntiVsp> (m_srsUeOffset.at (m_currentSrsOffset)); |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
832 |
vsp.m_value = rnti; |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
833 |
ulcqi.m_vendorSpecificList.push_back (vsp); |
9357
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
834 |
// call SRS tracing method |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
835 |
CreateSrsReport (m_srsUeOffset.at (m_currentSrsOffset), srsSum / i); |
9036 | 836 |
return (ulcqi); |
837 |
||
838 |
} |
|
839 |
||
9357
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
840 |
|
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
841 |
void |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
842 |
LteEnbPhy::CreateSrsReport(uint16_t rnti, double srs) |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
843 |
{ |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
844 |
NS_LOG_FUNCTION (this << rnti << srs); |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
845 |
std::map <uint16_t,uint16_t>::iterator it = m_srsSampleCounterMap.find (rnti); |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
846 |
if (it==m_srsSampleCounterMap.end ()) |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
847 |
{ |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
848 |
// create new entry |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
849 |
m_srsSampleCounterMap.insert (std::pair <uint16_t,uint16_t> (rnti, 0)); |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
850 |
it = m_srsSampleCounterMap.find (rnti); |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
851 |
} |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
852 |
(*it).second++; |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
853 |
if ((*it).second == m_srsSamplePeriod) |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
854 |
{ |
9386
24df31b77b25
PhyStats calculator implementation. All code needed added to LteHelper. Prototype order changed in order to respect cellId,IMSI, rnti
Jaume Nin
parents:
9357
diff
changeset
|
855 |
m_reportUeSinr (m_cellId, rnti, srs); |
9357
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
856 |
(*it).second = 0; |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
857 |
} |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
858 |
} |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9353
diff
changeset
|
859 |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
860 |
void |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
861 |
LteEnbPhy::DoSetTransmissionMode (uint16_t rnti, uint8_t txMode) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
862 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
863 |
NS_LOG_FUNCTION (this << rnti << (uint16_t)txMode); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
864 |
// UL supports only SISO MODE |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
865 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
866 |
|
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
867 |
void |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
868 |
LteEnbPhy::QueueUlDci (UlDciLteControlMessage m) |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
869 |
{ |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
870 |
NS_LOG_FUNCTION (this); |
8729
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
871 |
m_ulDciQueue.at (UL_PUSCH_TTIS_DELAY - 1).push_back (m); |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
872 |
} |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
873 |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
874 |
std::list<UlDciLteControlMessage> |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
875 |
LteEnbPhy::DequeueUlDci (void) |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
876 |
{ |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
877 |
NS_LOG_FUNCTION (this); |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
878 |
if (m_ulDciQueue.at (0).size ()>0) |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
879 |
{ |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
880 |
std::list<UlDciLteControlMessage> ret = m_ulDciQueue.at (0); |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
881 |
m_ulDciQueue.erase (m_ulDciQueue.begin ()); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
882 |
std::list<UlDciLteControlMessage> l; |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
883 |
m_ulDciQueue.push_back (l); |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
884 |
return (ret); |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
885 |
} |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
886 |
else |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
887 |
{ |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
888 |
m_ulDciQueue.erase (m_ulDciQueue.begin ()); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
889 |
std::list<UlDciLteControlMessage> l; |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
890 |
m_ulDciQueue.push_back (l); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8729
diff
changeset
|
891 |
std::list<UlDciLteControlMessage> emptylist; |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
892 |
return (emptylist); |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
893 |
} |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
894 |
} |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
895 |
|
9036 | 896 |
void |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
897 |
LteEnbPhy::DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi) |
9036 | 898 |
{ |
899 |
NS_LOG_FUNCTION (this); |
|
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
900 |
uint16_t p = GetSrsPeriodicity (srcCi); |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
901 |
if (p!=m_srsPeriodicity) |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
902 |
{ |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
903 |
// resize the array of offset -> re-initialize variables |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
904 |
m_srsUeOffset.clear (); |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
905 |
m_srsUeOffset.resize (p, 0); |
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
906 |
m_srsPeriodicity = p; |
9469
28a7b04a0b11
removed spurious LteUePhy::m_enbCellId; fixed bug in LteEnbRrc::GetNewSrsConfigurationIndex ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9460
diff
changeset
|
907 |
// inhibit SRS until RRC Connection Reconfiguration propagates |
28a7b04a0b11
removed spurious LteUePhy::m_enbCellId; fixed bug in LteEnbRrc::GetNewSrsConfigurationIndex ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9460
diff
changeset
|
908 |
// to UEs, otherwise we might be wrong in determining the UE who |
28a7b04a0b11
removed spurious LteUePhy::m_enbCellId; fixed bug in LteEnbRrc::GetNewSrsConfigurationIndex ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9460
diff
changeset
|
909 |
// actually sent the SRS (if the UE was using a stale SRS config) |
9569
6593186d50dd
zero SRS guard time since we use static SRS periodicity now
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
910 |
// if we use a static SRS configuration index, we can have a 0ms guard time |
6593186d50dd
zero SRS guard time since we use static SRS periodicity now
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
911 |
m_srsStartTime = Simulator::Now () + MilliSeconds (m_macChTtiDelay) + MilliSeconds (0); |
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
912 |
} |
9409 | 913 |
|
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
914 |
NS_LOG_DEBUG (this << " ENB SRS P " << m_srsPeriodicity << " RNTI " << rnti << " offset " << GetSrsSubframeOffset (srcCi) << " CI " << srcCi); |
9036 | 915 |
std::map <uint16_t,uint16_t>::iterator it = m_srsCounter.find (rnti); |
916 |
if (it != m_srsCounter.end ()) |
|
917 |
{ |
|
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
918 |
(*it).second = GetSrsSubframeOffset (srcCi) + 1; |
9036 | 919 |
} |
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
920 |
else |
9036 | 921 |
{ |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
922 |
m_srsCounter.insert (std::pair<uint16_t, uint16_t> (rnti, GetSrsSubframeOffset (srcCi) + 1)); |
9036 | 923 |
} |
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9038
diff
changeset
|
924 |
m_srsUeOffset.at (GetSrsSubframeOffset (srcCi)) = rnti; |
9409 | 925 |
|
9036 | 926 |
} |
927 |
||
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
928 |
|
9406 | 929 |
void |
930 |
LteEnbPhy::DoSetMasterInformationBlock (LteRrcSap::MasterInformationBlock mib) |
|
931 |
{ |
|
932 |
NS_LOG_FUNCTION (this); |
|
933 |
m_mib = mib; |
|
9036 | 934 |
} |
935 |
||
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
936 |
|
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
937 |
void |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
938 |
LteEnbPhy::SetHarqPhyModule (Ptr<LteHarqPhy> harq) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
939 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
940 |
m_harqPhyModule = harq; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
941 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
942 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
943 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
944 |
void |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
945 |
LteEnbPhy::ReceiveLteUlHarqFeedback (UlInfoListElement_s mes) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
946 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
947 |
NS_LOG_FUNCTION (this); |
9535
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9525
diff
changeset
|
948 |
// forward to scheduler |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
949 |
m_enbPhySapUser->UlInfoListElementHarqFeeback (mes); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
950 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
951 |
|
6705 | 952 |
}; |