author | Nicola Baldo <nbaldo@cttc.es> |
Tue, 20 Nov 2012 18:18:01 +0100 | |
changeset 9413 | 20f1c6678ee2 |
parent 9406 | 7f0f9d8f8e20 |
child 9414 | 7b0db3dbf19b |
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 <marco.miozzo@cttc.es> |
20 |
* Nicola Baldo <nbaldo@cttc.es> |
|
6705 | 21 |
*/ |
22 |
||
23 |
#include <ns3/object-factory.h> |
|
24 |
#include <ns3/log.h> |
|
25 |
#include <math.h> |
|
26 |
#include <ns3/simulator.h> |
|
7949 | 27 |
#include <ns3/double.h> |
7887 | 28 |
#include "lte-ue-phy.h" |
29 |
#include "lte-enb-phy.h" |
|
6705 | 30 |
#include "lte-net-device.h" |
7887 | 31 |
#include "lte-ue-net-device.h" |
32 |
#include "lte-enb-net-device.h" |
|
6705 | 33 |
#include "lte-spectrum-value-helper.h" |
7887 | 34 |
#include "lte-amc.h" |
7886 | 35 |
#include "lte-ue-mac.h" |
36 |
#include "ff-mac-common.h" |
|
37 |
#include "lte-sinr-chunk-processor.h" |
|
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
|
38 |
#include <ns3/lte-common.h> |
7886 | 39 |
|
6705 | 40 |
|
7887 | 41 |
NS_LOG_COMPONENT_DEFINE ("LteUePhy"); |
6705 | 42 |
|
43 |
namespace ns3 { |
|
44 |
||
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
45 |
|
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
46 |
|
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
47 |
|
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
48 |
// duration of data portion of UL subframe |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
49 |
// = TTI - 1 symbol for SRS - 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
|
50 |
// (symbol duration in nanoseconds = TTI / 14 (rounded)) |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
51 |
// in other words, duration of data portion of UL subframe = TTI*(13/14) -1ns |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
52 |
static const Time UL_DATA_DURATION = NanoSeconds (1e6 - 71429 - 1); |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
53 |
|
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
54 |
// delay from subframe start to transmission of SRS |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
55 |
// = TTI - 1 symbol for SRS |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
56 |
static const Time UL_SRS_DELAY_FROM_SUBFRAME_START = NanoSeconds (1e6 - 71429); |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
57 |
|
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
58 |
|
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
59 |
|
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 |
||
7887 | 66 |
class UeMemberLteUePhySapProvider : public LteUePhySapProvider |
7886 | 67 |
{ |
68 |
public: |
|
7887 | 69 |
UeMemberLteUePhySapProvider (LteUePhy* phy); |
7886 | 70 |
|
71 |
// inherited from LtePhySapProvider |
|
72 |
virtual void SendMacPdu (Ptr<Packet> p); |
|
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:
8737
diff
changeset
|
73 |
virtual void SendLteControlMessage (Ptr<LteControlMessage> msg); |
9406 | 74 |
virtual void SendRachPreamble (uint32_t prachId); |
7886 | 75 |
|
76 |
private: |
|
7887 | 77 |
LteUePhy* m_phy; |
7886 | 78 |
}; |
79 |
||
7887 | 80 |
UeMemberLteUePhySapProvider::UeMemberLteUePhySapProvider (LteUePhy* phy) : m_phy (phy) |
7886 | 81 |
{ |
82 |
||
83 |
} |
|
84 |
||
85 |
void |
|
7887 | 86 |
UeMemberLteUePhySapProvider::SendMacPdu (Ptr<Packet> p) |
7886 | 87 |
{ |
88 |
m_phy->DoSendMacPdu (p); |
|
89 |
} |
|
90 |
||
91 |
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:
8737
diff
changeset
|
92 |
UeMemberLteUePhySapProvider::SendLteControlMessage (Ptr<LteControlMessage> msg) |
7886 | 93 |
{ |
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:
8737
diff
changeset
|
94 |
m_phy->DoSendLteControlMessage (msg); |
7886 | 95 |
} |
96 |
||
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
97 |
void |
9406 | 98 |
UeMemberLteUePhySapProvider::SendRachPreamble (uint32_t prachId) |
9036 | 99 |
{ |
9406 | 100 |
m_phy->DoSendRachPreamble (prachId); |
9036 | 101 |
} |
7886 | 102 |
|
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
103 |
|
7886 | 104 |
//////////////////////////////////////// |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
105 |
// LteUePhy methods |
7886 | 106 |
//////////////////////////////////////// |
107 |
||
6705 | 108 |
|
7887 | 109 |
NS_OBJECT_ENSURE_REGISTERED (LteUePhy); |
6705 | 110 |
|
111 |
||
7887 | 112 |
LteUePhy::LteUePhy () |
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
113 |
{ |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
114 |
NS_LOG_FUNCTION (this); |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
115 |
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:
7949
diff
changeset
|
116 |
} |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
117 |
|
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
118 |
LteUePhy::LteUePhy (Ptr<LteSpectrumPhy> dlPhy, Ptr<LteSpectrumPhy> ulPhy) |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
119 |
: LtePhy (dlPhy, ulPhy), |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
120 |
m_p10CqiPeriocity (MilliSeconds (1)), |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
121 |
// ideal behavior |
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
122 |
m_p10CqiLast (MilliSeconds (0)), |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
123 |
m_a30CqiPeriocity (MilliSeconds (1)), |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
124 |
// ideal behavior |
9036 | 125 |
m_a30CqiLast (MilliSeconds (0)), |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
126 |
m_uePhySapUser (0), |
9346 | 127 |
m_ueCphySapUser (0), |
9036 | 128 |
m_rnti (0), |
9406 | 129 |
m_transmissionMode (0), |
130 |
m_srsPeriodicity (0), |
|
131 |
m_srsConfigured (false), |
|
132 |
m_dlConfigured (false), |
|
133 |
m_ulConfigured (false), |
|
134 |
m_addedToDlChannel (false) |
|
6705 | 135 |
{ |
8522
795ea37db2ff
Change LteAmc* to Ptr<LteAmc> in LteUePhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8517
diff
changeset
|
136 |
m_amc = CreateObject <LteAmc> (); |
7887 | 137 |
m_uePhySapProvider = new UeMemberLteUePhySapProvider (this); |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
138 |
m_ueCphySapProvider = new MemberLteUeCphySapProvider<LteUePhy> (this); |
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:
8737
diff
changeset
|
139 |
m_macChTtiDelay = UL_PUSCH_TTIS_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
|
140 |
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
|
141 |
{ |
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
|
142 |
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
|
143 |
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:
8737
diff
changeset
|
144 |
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
|
145 |
m_controlMessagesQueue.push_back (l); |
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
|
146 |
} |
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
|
147 |
std::vector <int> ulRb; |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
148 |
m_subChannelsForTransmissionQueue.resize (m_macChTtiDelay, ulRb); |
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
149 |
|
9054
16f693a95855
added assert for correct scheduling of LteUePhy::SubframeIndication
Nicola Baldo <nbaldo@cttc.es>
parents:
9053
diff
changeset
|
150 |
NS_ASSERT_MSG (Simulator::Now ().GetNanoSeconds () == 0, |
16f693a95855
added assert for correct scheduling of LteUePhy::SubframeIndication
Nicola Baldo <nbaldo@cttc.es>
parents:
9053
diff
changeset
|
151 |
"Cannot create UE devices after simulation started"); |
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
152 |
Simulator::ScheduleNow (&LteUePhy::SubframeIndication, this, 1, 1); |
6705 | 153 |
} |
154 |
||
155 |
||
7887 | 156 |
LteUePhy::~LteUePhy () |
6705 | 157 |
{ |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
158 |
m_txModeGain.clear (); |
6705 | 159 |
} |
160 |
||
7886 | 161 |
void |
7887 | 162 |
LteUePhy::DoDispose () |
7886 | 163 |
{ |
7913
ed3a9f8a76d7
added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents:
7895
diff
changeset
|
164 |
NS_LOG_FUNCTION (this); |
7930
ccb40542ae88
fixed memory leak in PHY SAP usage
Nicola Baldo <nbaldo@cttc.es>
parents:
7928
diff
changeset
|
165 |
delete m_uePhySapProvider; |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
166 |
delete m_ueCphySapProvider; |
7913
ed3a9f8a76d7
added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents:
7895
diff
changeset
|
167 |
LtePhy::DoDispose (); |
7886 | 168 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
169 |
|
7886 | 170 |
|
6705 | 171 |
|
172 |
TypeId |
|
7887 | 173 |
LteUePhy::GetTypeId (void) |
6705 | 174 |
{ |
7887 | 175 |
static TypeId tid = TypeId ("ns3::LteUePhy") |
6707
2ac68a0381ca
improved module after Tom's review
Giuseppe Piro <g.piro@poliba.it>
parents:
6705
diff
changeset
|
176 |
.SetParent<LtePhy> () |
7887 | 177 |
.AddConstructor<LteUePhy> () |
7949 | 178 |
.AddAttribute ("TxPower", |
179 |
"Transmission power in dBm", |
|
180 |
DoubleValue (10.0), |
|
181 |
MakeDoubleAccessor (&LteUePhy::SetTxPower, |
|
182 |
&LteUePhy::GetTxPower), |
|
183 |
MakeDoubleChecker<double> ()) |
|
7981 | 184 |
.AddAttribute ("NoiseFigure", |
185 |
"Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver." |
|
186 |
" According to Wikipedia (http://en.wikipedia.org/wiki/Noise_figure), this is " |
|
187 |
"\"the difference in decibels (dB) between" |
|
188 |
" the noise output of the actual receiver to the noise output of an " |
|
189 |
" ideal receiver with the same overall gain and bandwidth when the receivers " |
|
190 |
" are connected to sources at the standard noise temperature T0.\" " |
|
191 |
"In this model, we consider T0 = 290K.", |
|
192 |
DoubleValue (9.0), |
|
193 |
MakeDoubleAccessor (&LteUePhy::SetNoiseFigure, |
|
194 |
&LteUePhy::GetNoiseFigure), |
|
195 |
MakeDoubleChecker<double> ()) |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
196 |
.AddAttribute ("TxMode1Gain", |
8737
5ad20527f3f6
JIRA 235 Address typo in lte-ue-phy.cc (dBm instead of dB)
mmiozzo
parents:
8729
diff
changeset
|
197 |
"Transmission mode 1 gain in dB", |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
198 |
DoubleValue (0.0), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
199 |
MakeDoubleAccessor (&LteUePhy::SetTxMode1Gain ), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
200 |
MakeDoubleChecker<double> ()) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
201 |
.AddAttribute ("TxMode2Gain", |
8737
5ad20527f3f6
JIRA 235 Address typo in lte-ue-phy.cc (dBm instead of dB)
mmiozzo
parents:
8729
diff
changeset
|
202 |
"Transmission mode 2 gain in dB", |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
203 |
DoubleValue (4.2), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
204 |
MakeDoubleAccessor (&LteUePhy::SetTxMode2Gain ), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
205 |
MakeDoubleChecker<double> ()) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
206 |
.AddAttribute ("TxMode3Gain", |
8737
5ad20527f3f6
JIRA 235 Address typo in lte-ue-phy.cc (dBm instead of dB)
mmiozzo
parents:
8729
diff
changeset
|
207 |
"Transmission mode 3 gain in dB", |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
208 |
DoubleValue (-2.8), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
209 |
MakeDoubleAccessor (&LteUePhy::SetTxMode3Gain ), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
210 |
MakeDoubleChecker<double> ()) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
211 |
.AddAttribute ("TxMode4Gain", |
8737
5ad20527f3f6
JIRA 235 Address typo in lte-ue-phy.cc (dBm instead of dB)
mmiozzo
parents:
8729
diff
changeset
|
212 |
"Transmission mode 4 gain in dB", |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
213 |
DoubleValue (0.0), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
214 |
MakeDoubleAccessor (&LteUePhy::SetTxMode4Gain ), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
215 |
MakeDoubleChecker<double> ()) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
216 |
.AddAttribute ("TxMode5Gain", |
8737
5ad20527f3f6
JIRA 235 Address typo in lte-ue-phy.cc (dBm instead of dB)
mmiozzo
parents:
8729
diff
changeset
|
217 |
"Transmission mode 5 gain in dB", |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
218 |
DoubleValue (0.0), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
219 |
MakeDoubleAccessor (&LteUePhy::SetTxMode5Gain ), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
220 |
MakeDoubleChecker<double> ()) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
221 |
.AddAttribute ("TxMode6Gain", |
8737
5ad20527f3f6
JIRA 235 Address typo in lte-ue-phy.cc (dBm instead of dB)
mmiozzo
parents:
8729
diff
changeset
|
222 |
"Transmission mode 6 gain in dB", |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
223 |
DoubleValue (0.0), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
224 |
MakeDoubleAccessor (&LteUePhy::SetTxMode6Gain ), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
225 |
MakeDoubleChecker<double> ()) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
226 |
.AddAttribute ("TxMode7Gain", |
8737
5ad20527f3f6
JIRA 235 Address typo in lte-ue-phy.cc (dBm instead of dB)
mmiozzo
parents:
8729
diff
changeset
|
227 |
"Transmission mode 7 gain in dB", |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
228 |
DoubleValue (0.0), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
229 |
MakeDoubleAccessor (&LteUePhy::SetTxMode7Gain ), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
230 |
MakeDoubleChecker<double> ()) |
6705 | 231 |
; |
232 |
return tid; |
|
233 |
} |
|
234 |
||
8015 | 235 |
void |
236 |
LteUePhy::DoStart () |
|
237 |
{ |
|
238 |
NS_LOG_FUNCTION (this); |
|
239 |
LtePhy::DoStart (); |
|
240 |
} |
|
6705 | 241 |
|
7886 | 242 |
void |
7887 | 243 |
LteUePhy::SetLteUePhySapUser (LteUePhySapUser* s) |
6705 | 244 |
{ |
7913
ed3a9f8a76d7
added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents:
7895
diff
changeset
|
245 |
NS_LOG_FUNCTION (this); |
7886 | 246 |
m_uePhySapUser = s; |
247 |
} |
|
248 |
||
249 |
LteUePhySapProvider* |
|
7887 | 250 |
LteUePhy::GetLteUePhySapProvider () |
7886 | 251 |
{ |
7913
ed3a9f8a76d7
added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents:
7895
diff
changeset
|
252 |
NS_LOG_FUNCTION (this); |
7886 | 253 |
return (m_uePhySapProvider); |
6705 | 254 |
} |
255 |
||
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
256 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
257 |
void |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
258 |
LteUePhy::SetLteUeCphySapUser (LteUeCphySapUser* s) |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
259 |
{ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
260 |
NS_LOG_FUNCTION (this); |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
261 |
m_ueCphySapUser = s; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
262 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
263 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
264 |
LteUeCphySapProvider* |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
265 |
LteUePhy::GetLteUeCphySapProvider () |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
266 |
{ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
267 |
NS_LOG_FUNCTION (this); |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
268 |
return (m_ueCphySapProvider); |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
269 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
270 |
|
7949 | 271 |
void |
7981 | 272 |
LteUePhy::SetNoiseFigure (double nf) |
273 |
{ |
|
274 |
NS_LOG_FUNCTION (this << nf); |
|
275 |
m_noiseFigure = nf; |
|
276 |
} |
|
277 |
||
278 |
double |
|
279 |
LteUePhy::GetNoiseFigure () const |
|
280 |
{ |
|
281 |
NS_LOG_FUNCTION (this); |
|
282 |
return m_noiseFigure; |
|
283 |
} |
|
284 |
||
285 |
void |
|
7949 | 286 |
LteUePhy::SetTxPower (double pow) |
287 |
{ |
|
288 |
NS_LOG_FUNCTION (this << pow); |
|
289 |
m_txPower = pow; |
|
290 |
} |
|
291 |
||
292 |
double |
|
293 |
LteUePhy::GetTxPower () const |
|
294 |
{ |
|
295 |
NS_LOG_FUNCTION (this); |
|
296 |
return m_txPower; |
|
297 |
} |
|
6705 | 298 |
|
8670
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
299 |
|
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
300 |
uint8_t |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
301 |
LteUePhy::GetMacChDelay (void) const |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
302 |
{ |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
303 |
return (m_macChTtiDelay); |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
304 |
} |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
305 |
|
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
306 |
void |
7887 | 307 |
LteUePhy::DoSendMacPdu (Ptr<Packet> p) |
6705 | 308 |
{ |
309 |
NS_LOG_FUNCTION (this); |
|
7886 | 310 |
|
311 |
SetMacPdu (p); |
|
6705 | 312 |
} |
313 |
||
314 |
||
315 |
void |
|
7887 | 316 |
LteUePhy::PhyPduReceived (Ptr<Packet> p) |
7886 | 317 |
{ |
318 |
m_uePhySapUser->ReceivePhyPdu (p); |
|
319 |
} |
|
320 |
||
321 |
void |
|
7887 | 322 |
LteUePhy::SetSubChannelsForTransmission (std::vector <int> mask) |
6705 | 323 |
{ |
324 |
NS_LOG_FUNCTION (this); |
|
325 |
||
326 |
m_subChannelsForTransmission = mask; |
|
327 |
||
328 |
Ptr<SpectrumValue> txPsd = CreateTxPowerSpectralDensity (); |
|
7928
b736f63e9bdf
removed LtePhy::Get{Up,Down}linkSpectrumPhy methods which are evil
Nicola Baldo <nbaldo@cttc.es>
parents:
7913
diff
changeset
|
329 |
m_uplinkSpectrumPhy->SetTxPowerSpectralDensity (txPsd); |
6705 | 330 |
} |
331 |
||
332 |
||
333 |
void |
|
7887 | 334 |
LteUePhy::SetSubChannelsForReception (std::vector <int> mask) |
6705 | 335 |
{ |
336 |
NS_LOG_FUNCTION (this); |
|
337 |
m_subChannelsForReception = mask; |
|
338 |
} |
|
339 |
||
340 |
||
341 |
std::vector <int> |
|
7887 | 342 |
LteUePhy::GetSubChannelsForTransmission () |
6705 | 343 |
{ |
344 |
NS_LOG_FUNCTION (this); |
|
345 |
return m_subChannelsForTransmission; |
|
346 |
} |
|
347 |
||
348 |
||
349 |
std::vector <int> |
|
7887 | 350 |
LteUePhy::GetSubChannelsForReception () |
6705 | 351 |
{ |
352 |
NS_LOG_FUNCTION (this); |
|
353 |
return m_subChannelsForReception; |
|
354 |
} |
|
355 |
||
356 |
||
357 |
Ptr<SpectrumValue> |
|
7887 | 358 |
LteUePhy::CreateTxPowerSpectralDensity () |
6705 | 359 |
{ |
360 |
NS_LOG_FUNCTION (this); |
|
361 |
LteSpectrumValueHelper psdHelper; |
|
8015 | 362 |
Ptr<SpectrumValue> psd = psdHelper.CreateTxPowerSpectralDensity (m_ulEarfcn, m_ulBandwidth, m_txPower, GetSubChannelsForTransmission ()); |
6705 | 363 |
|
364 |
return psd; |
|
365 |
} |
|
366 |
||
367 |
void |
|
9036 | 368 |
LteUePhy::GenerateCtrlCqiReport (const SpectrumValue& sinr) |
7886 | 369 |
{ |
370 |
NS_LOG_FUNCTION (this); |
|
9406 | 371 |
|
372 |
if (!(m_dlConfigured && m_ulConfigured)) |
|
373 |
{ |
|
374 |
return; |
|
375 |
} |
|
376 |
||
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
377 |
// check periodic wideband CQI |
7886 | 378 |
if (Simulator::Now () > m_p10CqiLast + m_p10CqiPeriocity) |
379 |
{ |
|
7887 | 380 |
Ptr<LteUeNetDevice> thisDevice = GetDevice ()->GetObject<LteUeNetDevice> (); |
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:
8737
diff
changeset
|
381 |
Ptr<DlCqiLteControlMessage> msg = CreateDlCqiFeedbackMessage (sinr); |
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:
8737
diff
changeset
|
382 |
DoSendLteControlMessage (msg); |
7886 | 383 |
m_p10CqiLast = Simulator::Now (); |
384 |
} |
|
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
385 |
// check aperiodic high-layer configured subband CQI |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
386 |
if (Simulator::Now () > m_a30CqiLast + m_a30CqiPeriocity) |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
387 |
{ |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
388 |
Ptr<LteUeNetDevice> thisDevice = GetDevice ()->GetObject<LteUeNetDevice> (); |
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:
8737
diff
changeset
|
389 |
Ptr<DlCqiLteControlMessage> msg = CreateDlCqiFeedbackMessage (sinr); |
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:
8737
diff
changeset
|
390 |
DoSendLteControlMessage (msg); |
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
391 |
m_a30CqiLast = Simulator::Now (); |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
392 |
} |
7886 | 393 |
} |
394 |
||
9036 | 395 |
void |
396 |
LteUePhy::GenerateDataCqiReport (const SpectrumValue& sinr) |
|
397 |
{ |
|
398 |
// Not used by UE, CQI are based only on RS |
|
399 |
} |
|
400 |
||
7886 | 401 |
|
402 |
||
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:
8737
diff
changeset
|
403 |
Ptr<DlCqiLteControlMessage> |
7887 | 404 |
LteUePhy::CreateDlCqiFeedbackMessage (const SpectrumValue& sinr) |
6705 | 405 |
{ |
406 |
NS_LOG_FUNCTION (this); |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
407 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
408 |
// apply transmission mode gain |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
409 |
NS_ASSERT (m_transmissionMode < m_txModeGain.size ()); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
410 |
SpectrumValue newSinr = sinr; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
411 |
newSinr *= m_txModeGain.at (m_transmissionMode); |
8726
f6f0e2531457
merge with ns-3-lena-pem changeset 8419:e8df5f68c35e (MIMO model)
mmiozzo
diff
changeset
|
412 |
// std::vector<int> cqi = m_amc->CreateCqiFeedbacks (newSinr); |
7886 | 413 |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
414 |
|
7886 | 415 |
|
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:
8737
diff
changeset
|
416 |
// CREATE DlCqiLteControlMessage |
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:
8737
diff
changeset
|
417 |
Ptr<DlCqiLteControlMessage> msg = Create<DlCqiLteControlMessage> (); |
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
418 |
CqiListElement_s dlcqi; |
8647
f6fad6b36154
Update LteUePhy for generating wideband and subband CQIs with LteAmc::MiErrorModel
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8646
diff
changeset
|
419 |
std::vector<int> cqi; |
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
420 |
if (Simulator::Now () > m_p10CqiLast + m_p10CqiPeriocity) |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
421 |
{ |
8726
f6f0e2531457
merge with ns-3-lena-pem changeset 8419:e8df5f68c35e (MIMO model)
mmiozzo
diff
changeset
|
422 |
cqi = m_amc->CreateCqiFeedbacks (newSinr, m_dlBandwidth); |
f6f0e2531457
merge with ns-3-lena-pem changeset 8419:e8df5f68c35e (MIMO model)
mmiozzo
diff
changeset
|
423 |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
424 |
int nLayer = TransmissionModesLayers::TxMode2LayerNum (m_transmissionMode); |
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
425 |
int nbSubChannels = cqi.size (); |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
426 |
double cqiSum = 0.0; |
8019
3f88f08f0e55
LENA-93 DL CQI averaged over active RBs only in UE PHY
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7981
diff
changeset
|
427 |
int activeSubChannels = 0; |
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
428 |
// average the CQIs of the different RBs |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
429 |
for (int i = 0; i < nbSubChannels; i++) |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
430 |
{ |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
431 |
if (cqi.at (i) != -1) |
8019
3f88f08f0e55
LENA-93 DL CQI averaged over active RBs only in UE PHY
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7981
diff
changeset
|
432 |
{ |
3f88f08f0e55
LENA-93 DL CQI averaged over active RBs only in UE PHY
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7981
diff
changeset
|
433 |
cqiSum += cqi.at (i); |
3f88f08f0e55
LENA-93 DL CQI averaged over active RBs only in UE PHY
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7981
diff
changeset
|
434 |
activeSubChannels++; |
3f88f08f0e55
LENA-93 DL CQI averaged over active RBs only in UE PHY
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7981
diff
changeset
|
435 |
} |
8042
874d9e7e652b
LteUePhy::CreateDlCqiFeedbackMessage fix bug on computation of CQI (no control on activeSubChannels!=0)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8022
diff
changeset
|
436 |
NS_LOG_DEBUG (this << " subch " << i << " cqi " << cqi.at (i)); |
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
437 |
} |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
438 |
dlcqi.m_rnti = m_rnti; |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
439 |
dlcqi.m_ri = 1; // not yet used |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
440 |
dlcqi.m_cqiType = CqiListElement_s::P10; // Peridic CQI using PUCCH wideband |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
441 |
NS_ASSERT_MSG (nLayer > 0, " nLayer negative"); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
442 |
NS_ASSERT_MSG (nLayer < 3, " nLayer limit is 2s"); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
443 |
for (int i = 0; i < nLayer; i++) |
8042
874d9e7e652b
LteUePhy::CreateDlCqiFeedbackMessage fix bug on computation of CQI (no control on activeSubChannels!=0)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8022
diff
changeset
|
444 |
{ |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
445 |
if (activeSubChannels > 0) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
446 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
447 |
dlcqi.m_wbCqi.push_back ((uint16_t) cqiSum / activeSubChannels); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
448 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
449 |
else |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
450 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
451 |
// approximate with the worst case -> CQI = 1 |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
452 |
dlcqi.m_wbCqi.push_back (1); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
453 |
} |
8042
874d9e7e652b
LteUePhy::CreateDlCqiFeedbackMessage fix bug on computation of CQI (no control on activeSubChannels!=0)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8022
diff
changeset
|
454 |
} |
8019
3f88f08f0e55
LENA-93 DL CQI averaged over active RBs only in UE PHY
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7981
diff
changeset
|
455 |
//NS_LOG_DEBUG (this << " Generate P10 CQI feedback " << (uint16_t) cqiSum / activeSubChannels); |
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
456 |
dlcqi.m_wbPmi = 0; // not yet used |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
457 |
// dl.cqi.m_sbMeasResult others CQI report modes: not yet implemented |
7886 | 458 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
459 |
else if (Simulator::Now () > m_a30CqiLast + m_a30CqiPeriocity) |
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
460 |
{ |
8726
f6f0e2531457
merge with ns-3-lena-pem changeset 8419:e8df5f68c35e (MIMO model)
mmiozzo
diff
changeset
|
461 |
cqi = m_amc->CreateCqiFeedbacks (newSinr, GetRbgSize ()); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
462 |
int nLayer = TransmissionModesLayers::TxMode2LayerNum (m_transmissionMode); |
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
463 |
int nbSubChannels = cqi.size (); |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
464 |
int rbgSize = GetRbgSize (); |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
465 |
double cqiSum = 0.0; |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
466 |
int cqiNum = 0; |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
467 |
SbMeasResult_s rbgMeas; |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
468 |
//NS_LOG_DEBUG (this << " Create A30 CQI feedback, RBG " << rbgSize << " cqiNum " << nbSubChannels << " band " << (uint16_t)m_dlBandwidth); |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
469 |
for (int i = 0; i < nbSubChannels; i++) |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
470 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
471 |
if (cqi.at (i) != -1) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
472 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
473 |
cqiSum += cqi.at (i); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
474 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
475 |
// else "nothing" no CQI is treated as CQI = 0 (worst case scenario) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
476 |
cqiNum++; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
477 |
if (cqiNum == rbgSize) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
478 |
{ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
479 |
// average the CQIs of the different RBGs |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
480 |
//NS_LOG_DEBUG (this << " RBG CQI " << (uint16_t) cqiSum / rbgSize); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
481 |
HigherLayerSelected_s hlCqi; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
482 |
hlCqi.m_sbPmi = 0; // not yet used |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
483 |
for (int i = 0; i < nLayer; i++) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
484 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
485 |
hlCqi.m_sbCqi.push_back ((uint16_t) cqiSum / rbgSize); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
486 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
487 |
rbgMeas.m_higherLayerSelected.push_back (hlCqi); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
488 |
cqiSum = 0.0; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
489 |
cqiNum = 0; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
490 |
} |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
491 |
} |
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
492 |
dlcqi.m_rnti = m_rnti; |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
493 |
dlcqi.m_ri = 1; // not yet used |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
494 |
dlcqi.m_cqiType = CqiListElement_s::A30; // Aperidic CQI using PUSCH |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
495 |
//dlcqi.m_wbCqi.push_back ((uint16_t) cqiSum / nbSubChannels); |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
496 |
dlcqi.m_wbPmi = 0; // not yet used |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
497 |
dlcqi.m_sbMeasResult = rbgMeas; |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
498 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8042
diff
changeset
|
499 |
|
7886 | 500 |
msg->SetDlCqi (dlcqi); |
501 |
return msg; |
|
6705 | 502 |
} |
503 |
||
7886 | 504 |
|
505 |
||
6705 | 506 |
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:
8737
diff
changeset
|
507 |
LteUePhy::DoSendLteControlMessage (Ptr<LteControlMessage> msg) |
6705 | 508 |
{ |
509 |
NS_LOG_FUNCTION (this << msg); |
|
9346 | 510 |
|
7886 | 511 |
SetControlMessages (msg); |
6705 | 512 |
} |
513 |
||
9406 | 514 |
void |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
515 |
LteUePhy::DoSendRachPreamble (uint32_t raPreambleId) |
9406 | 516 |
{ |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
517 |
NS_LOG_FUNCTION (this << raPreambleId); |
9406 | 518 |
|
519 |
// unlike other control messages, RACH preamble is sent ASAP |
|
520 |
Ptr<RachPreambleLteControlMessage> msg = Create<RachPreambleLteControlMessage> (); |
|
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
521 |
msg->SetRapId (raPreambleId); |
9406 | 522 |
m_controlMessagesQueue.at (0).push_back (msg); |
523 |
} |
|
524 |
||
6705 | 525 |
|
526 |
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:
8737
diff
changeset
|
527 |
LteUePhy::ReceiveLteControlMessageList (std::list<Ptr<LteControlMessage> > msgList) |
6705 | 528 |
{ |
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:
8737
diff
changeset
|
529 |
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:
8737
diff
changeset
|
530 |
|
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:
8737
diff
changeset
|
531 |
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:
8737
diff
changeset
|
532 |
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:
8737
diff
changeset
|
533 |
{ |
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:
8737
diff
changeset
|
534 |
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:
8737
diff
changeset
|
535 |
|
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:
8737
diff
changeset
|
536 |
if (msg->GetMessageType () == LteControlMessage::DL_DCI) |
6705 | 537 |
{ |
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:
8737
diff
changeset
|
538 |
Ptr<DlDciLteControlMessage> msg2 = DynamicCast<DlDciLteControlMessage> (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:
8737
diff
changeset
|
539 |
|
7886 | 540 |
DlDciListElement_s dci = msg2->GetDci (); |
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:
8737
diff
changeset
|
541 |
if (dci.m_rnti != m_rnti) |
6705 | 542 |
{ |
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:
8737
diff
changeset
|
543 |
// DCI not for me |
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:
8737
diff
changeset
|
544 |
continue; |
7886 | 545 |
} |
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:
8737
diff
changeset
|
546 |
|
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:
8737
diff
changeset
|
547 |
if (dci.m_resAlloc != 0) |
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:
8737
diff
changeset
|
548 |
{ |
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:
8737
diff
changeset
|
549 |
NS_FATAL_ERROR ("Resource Allocation type not implemented"); |
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:
8737
diff
changeset
|
550 |
} |
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:
8737
diff
changeset
|
551 |
|
7886 | 552 |
std::vector <int> dlRb; |
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:
8737
diff
changeset
|
553 |
|
7886 | 554 |
// translate the DCI to Spectrum framework |
555 |
uint32_t mask = 0x1; |
|
556 |
for (int i = 0; i < 32; i++) |
|
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:
8737
diff
changeset
|
557 |
{ |
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:
8737
diff
changeset
|
558 |
if (((dci.m_rbBitmap & mask) >> i) == 1) |
7886 | 559 |
{ |
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:
8737
diff
changeset
|
560 |
for (int k = 0; k < GetRbgSize (); k++) |
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:
8737
diff
changeset
|
561 |
{ |
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:
8737
diff
changeset
|
562 |
dlRb.push_back ((i * GetRbgSize ()) + k); |
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:
8737
diff
changeset
|
563 |
//NS_LOG_DEBUG(this << "DL-DCI allocated PRB " << (i*GetRbgSize()) + k); |
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:
8737
diff
changeset
|
564 |
} |
6705 | 565 |
} |
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:
8737
diff
changeset
|
566 |
mask = (mask << 1); |
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:
8737
diff
changeset
|
567 |
} |
8511
46046bbb2a5c
Add info in LteSpectrumPhy on TB from DCI elaborated by LteEnbPhy and LteUePhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8253
diff
changeset
|
568 |
|
46046bbb2a5c
Add info in LteSpectrumPhy on TB from DCI elaborated by LteEnbPhy and LteUePhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8253
diff
changeset
|
569 |
// send TB info to LteSpectrumPhy |
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:
8737
diff
changeset
|
570 |
NS_LOG_DEBUG (this << " UE " << m_rnti << " DL-DCI " << dci.m_rnti << " bitmap " << dci.m_rbBitmap); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
571 |
for (uint8_t i = 0; i < dci.m_tbsSize.size (); i++) |
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:
8737
diff
changeset
|
572 |
{ |
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:
8737
diff
changeset
|
573 |
m_downlinkSpectrumPhy->AddExpectedTb (dci.m_rnti, dci.m_tbsSize.at (i), dci.m_mcs.at (i), dlRb, 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:
8737
diff
changeset
|
574 |
} |
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:
8737
diff
changeset
|
575 |
|
7886 | 576 |
SetSubChannelsForReception (dlRb); |
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:
8737
diff
changeset
|
577 |
|
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:
8737
diff
changeset
|
578 |
|
6705 | 579 |
} |
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:
8737
diff
changeset
|
580 |
else if (msg->GetMessageType () == LteControlMessage::UL_DCI) |
7886 | 581 |
{ |
582 |
// set the uplink bandwidht according to the UL-CQI |
|
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
|
583 |
NS_LOG_DEBUG (this << " UL DCI"); |
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:
8737
diff
changeset
|
584 |
Ptr<UlDciLteControlMessage> msg2 = DynamicCast<UlDciLteControlMessage> (msg); |
7886 | 585 |
UlDciListElement_s dci = msg2->GetDci (); |
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:
8737
diff
changeset
|
586 |
if (dci.m_rnti != 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:
8737
diff
changeset
|
587 |
{ |
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:
8737
diff
changeset
|
588 |
// DCI not for me |
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:
8737
diff
changeset
|
589 |
continue; |
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:
8737
diff
changeset
|
590 |
} |
7886 | 591 |
std::vector <int> ulRb; |
592 |
for (int i = 0; i < dci.m_rbLen; i++) |
|
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:
8737
diff
changeset
|
593 |
{ |
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:
8737
diff
changeset
|
594 |
ulRb.push_back (i + dci.m_rbStart); |
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:
8737
diff
changeset
|
595 |
//NS_LOG_DEBUG (this << " UE RB " << i + dci.m_rbStart); |
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:
8737
diff
changeset
|
596 |
} |
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:
8737
diff
changeset
|
597 |
|
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
|
598 |
QueueSubChannelsForTransmission (ulRb); |
7886 | 599 |
// pass the info to the MAC |
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:
8737
diff
changeset
|
600 |
m_uePhySapUser->ReceiveLteControlMessage (msg); |
7886 | 601 |
} |
9406 | 602 |
else if (msg->GetMessageType () == LteControlMessage::MIB) |
603 |
{ |
|
604 |
NS_LOG_INFO ("received MIB"); |
|
605 |
Ptr<MibLteControlMessage> msg2 = DynamicCast<MibLteControlMessage> (msg); |
|
606 |
m_ueCphySapUser->RecvMasterInformationBlock (msg2->GetMib ()); |
|
607 |
} |
|
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:
8737
diff
changeset
|
608 |
else |
6705 | 609 |
{ |
7886 | 610 |
// pass the message to UE-MAC |
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:
8737
diff
changeset
|
611 |
m_uePhySapUser->ReceiveLteControlMessage (msg); |
6705 | 612 |
} |
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:
8737
diff
changeset
|
613 |
|
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:
8737
diff
changeset
|
614 |
} |
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:
8737
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:
8737
diff
changeset
|
616 |
|
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:
8737
diff
changeset
|
617 |
} |
6705 | 618 |
|
619 |
||
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
|
620 |
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
|
621 |
LteUePhy::QueueSubChannelsForTransmission (std::vector <int> rbMap) |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
622 |
{ |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
623 |
m_subChannelsForTransmissionQueue.at (m_macChTtiDelay - 1) = rbMap; |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
624 |
} |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
625 |
|
6705 | 626 |
|
7886 | 627 |
void |
7887 | 628 |
LteUePhy::SubframeIndication (uint32_t frameNo, uint32_t subframeNo) |
7886 | 629 |
{ |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
630 |
NS_LOG_FUNCTION (this << frameNo << subframeNo); |
9406 | 631 |
|
632 |
NS_ASSERT_MSG (frameNo > 0, "the SRS index check code assumes that frameNo starts at 1"); |
|
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
|
633 |
|
9406 | 634 |
if (m_ulConfigured) |
7886 | 635 |
{ |
9406 | 636 |
// update uplink transmission mask according to previous UL-CQIs |
637 |
SetSubChannelsForTransmission (m_subChannelsForTransmissionQueue.at (0)); |
|
638 |
||
639 |
// shift the queue |
|
640 |
for (uint8_t i = 1; i < m_macChTtiDelay; i++) |
|
641 |
{ |
|
642 |
m_subChannelsForTransmissionQueue.at (i-1) = m_subChannelsForTransmissionQueue.at (i); |
|
643 |
} |
|
644 |
m_subChannelsForTransmissionQueue.at (m_macChTtiDelay-1).clear (); |
|
645 |
||
646 |
if (m_srsConfigured) |
|
647 |
{ |
|
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:
8737
diff
changeset
|
648 |
|
9406 | 649 |
NS_ASSERT_MSG (subframeNo > 0 && subframeNo <= 10, "the SRS index check code assumes that subframeNo starts at 1"); |
650 |
if ((((frameNo-1)*10 + (subframeNo-1)) % m_srsPeriodicity) == m_srsSubframeOffset) |
|
651 |
{ |
|
652 |
NS_LOG_INFO ("frame " << frameNo << " subframe " << subframeNo << " sending SRS (offset=" << m_srsSubframeOffset << ", period=" << m_srsPeriodicity << ")"); |
|
653 |
Simulator::Schedule (UL_SRS_DELAY_FROM_SUBFRAME_START, |
|
654 |
&LteUePhy::SendSrs, |
|
655 |
this); |
|
656 |
} |
|
657 |
} |
|
658 |
||
659 |
std::list<Ptr<LteControlMessage> > ctrlMsg = GetControlMessages (); |
|
660 |
// send packets in queue |
|
661 |
// send the current burts of packets |
|
662 |
Ptr<PacketBurst> pb = GetPacketBurst (); |
|
663 |
if (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:
8737
diff
changeset
|
664 |
{ |
9406 | 665 |
NS_LOG_LOGIC (this << " UE - start TX PUSCH + PUCCH"); |
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
666 |
m_uplinkSpectrumPhy->StartTxDataFrame (pb, ctrlMsg, UL_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:
8737
diff
changeset
|
667 |
} |
9406 | 668 |
else |
669 |
{ |
|
670 |
// send only PUCCH (ideal: fake full bandwidth signal) |
|
671 |
if (ctrlMsg.size ()>0) |
|
672 |
{ |
|
673 |
std::vector <int> dlRb; |
|
674 |
for (uint8_t i = 0; i < m_ulBandwidth; i++) |
|
675 |
{ |
|
676 |
dlRb.push_back (i); |
|
677 |
} |
|
678 |
SetSubChannelsForTransmission (dlRb); |
|
679 |
m_uplinkSpectrumPhy->StartTxDataFrame (pb, ctrlMsg, UL_DATA_DURATION); |
|
680 |
} |
|
681 |
} |
|
682 |
} // m_configured |
|
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:
8737
diff
changeset
|
683 |
|
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8253
diff
changeset
|
684 |
// trigger the MAC |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8253
diff
changeset
|
685 |
m_uePhySapUser->SubframeIndication (frameNo, subframeNo); |
9406 | 686 |
|
687 |
||
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
688 |
++subframeNo; |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
689 |
if (subframeNo > 10) |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
690 |
{ |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
691 |
++frameNo; |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
692 |
subframeNo = 1; |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
693 |
} |
9406 | 694 |
|
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
695 |
// schedule next subframe indication |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9048
diff
changeset
|
696 |
Simulator::Schedule (Seconds (GetTti ()), &LteUePhy::SubframeIndication, this, frameNo, subframeNo); |
7886 | 697 |
} |
9406 | 698 |
|
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:
8737
diff
changeset
|
699 |
void |
9406 | 700 |
LteUePhy::SendSrs () |
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:
8737
diff
changeset
|
701 |
{ |
9036 | 702 |
NS_LOG_FUNCTION (this << " UE " << m_rnti << " start tx SRS, cell Id " << m_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:
8737
diff
changeset
|
703 |
// 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:
8737
diff
changeset
|
704 |
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:
8737
diff
changeset
|
705 |
for (uint8_t i = 0; i < m_ulBandwidth; 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:
8737
diff
changeset
|
706 |
{ |
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:
8737
diff
changeset
|
707 |
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:
8737
diff
changeset
|
708 |
} |
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:
8737
diff
changeset
|
709 |
SetSubChannelsForTransmission (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:
8737
diff
changeset
|
710 |
m_uplinkSpectrumPhy->StartTxUlSrsFrame (); |
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:
8737
diff
changeset
|
711 |
} |
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:
8737
diff
changeset
|
712 |
|
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:
8737
diff
changeset
|
713 |
|
7886 | 714 |
|
715 |
void |
|
9406 | 716 |
LteUePhy::DoSyncronizeWithEnb (uint16_t cellId, uint16_t dlEarfcn) |
7886 | 717 |
{ |
9406 | 718 |
NS_LOG_FUNCTION (this << cellId); |
719 |
m_enbCellId = cellId; |
|
720 |
m_dlEarfcn = dlEarfcn; |
|
721 |
m_downlinkSpectrumPhy->SetCellId (cellId); |
|
722 |
m_uplinkSpectrumPhy->SetCellId (cellId); |
|
723 |
||
724 |
// configure DL for receing the BCH with the minimum bandwith |
|
725 |
const uint8_t minDlBandwidth = 6; |
|
726 |
Ptr<SpectrumValue> noisePsd = LteSpectrumValueHelper::CreateNoisePowerSpectralDensity (m_dlEarfcn, minDlBandwidth, m_noiseFigure); |
|
727 |
m_downlinkSpectrumPhy->SetNoisePowerSpectralDensity (noisePsd); |
|
728 |
m_downlinkSpectrumPhy->GetChannel ()->AddRx (m_downlinkSpectrumPhy); |
|
729 |
||
730 |
m_dlConfigured = false; |
|
731 |
m_ulConfigured = false; |
|
7886 | 732 |
} |
733 |
||
9406 | 734 |
void |
735 |
LteUePhy::DoSetDlBandwidth (uint8_t dlBandwidth) |
|
736 |
{ |
|
7886 | 737 |
|
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
738 |
m_dlBandwidth = dlBandwidth; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
739 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
740 |
int Type0AllocationRbg[4] = { |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
741 |
10, // RGB size 1 |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
742 |
26, // RGB size 2 |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
743 |
63, // RGB size 3 |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
744 |
110 // RGB size 4 |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
745 |
}; // 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:
8737
diff
changeset
|
746 |
for (int i = 0; i < 4; i++) |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
747 |
{ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
748 |
if (dlBandwidth < Type0AllocationRbg[i]) |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
749 |
{ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
750 |
m_rbgSize = i + 1; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
751 |
break; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
752 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
753 |
} |
9406 | 754 |
|
755 |
Ptr<SpectrumValue> noisePsd = LteSpectrumValueHelper::CreateNoisePowerSpectralDensity (m_dlEarfcn, m_dlBandwidth, m_noiseFigure); |
|
756 |
m_downlinkSpectrumPhy->SetNoisePowerSpectralDensity (noisePsd); |
|
757 |
m_downlinkSpectrumPhy->GetChannel ()->AddRx (m_downlinkSpectrumPhy); |
|
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
758 |
|
9406 | 759 |
m_dlConfigured = true; |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
760 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
761 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
762 |
|
9406 | 763 |
void |
764 |
LteUePhy::DoConfigureUplink (uint16_t ulEarfcn, uint8_t ulBandwidth) |
|
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
765 |
{ |
9406 | 766 |
m_ulEarfcn = ulEarfcn; |
767 |
m_ulBandwidth = ulBandwidth; |
|
768 |
m_ulConfigured = true; |
|
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
769 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
770 |
|
9406 | 771 |
|
772 |
void |
|
773 |
LteUePhy::DoSetRnti (uint16_t rnti) |
|
774 |
{ |
|
775 |
NS_LOG_FUNCTION (this << rnti); |
|
776 |
m_rnti = rnti; |
|
777 |
} |
|
778 |
||
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8737
diff
changeset
|
779 |
void |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
780 |
LteUePhy::DoSetTransmissionMode (uint8_t txMode) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
781 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
782 |
NS_LOG_FUNCTION (this << (uint16_t)txMode); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
783 |
m_transmissionMode = txMode; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
784 |
m_downlinkSpectrumPhy->SetTransmissionMode (txMode); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
785 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
786 |
|
9036 | 787 |
void |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
788 |
LteUePhy::DoSetSrsConfigurationIndex (uint16_t srcCi) |
9036 | 789 |
{ |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
790 |
NS_LOG_FUNCTION (this << srcCi); |
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
791 |
m_srsPeriodicity = GetSrsPeriodicity (srcCi); |
9406 | 792 |
m_srsSubframeOffset = GetSrsSubframeOffset (srcCi); |
793 |
m_srsConfigured = true; |
|
794 |
NS_LOG_DEBUG (this << " UE SRS P " << m_srsPeriodicity << " RNTI " << m_rnti << " offset " << m_srsSubframeOffset << " cellId " << m_cellId << " CI " << srcCi); |
|
9036 | 795 |
} |
796 |
||
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
797 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
798 |
void |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
799 |
LteUePhy::SetTxMode1Gain (double gain) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
800 |
{ |
8725
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
801 |
SetTxModeGain (1, gain); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
802 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
803 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
804 |
void |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
805 |
LteUePhy::SetTxMode2Gain (double gain) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
806 |
{ |
8725
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
807 |
SetTxModeGain (2, gain); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
808 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
809 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
810 |
void |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
811 |
LteUePhy::SetTxMode3Gain (double gain) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
812 |
{ |
8725
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
813 |
SetTxModeGain (3, gain); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
814 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
815 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
816 |
void |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
817 |
LteUePhy::SetTxMode4Gain (double gain) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
818 |
{ |
8725
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
819 |
SetTxModeGain (4, gain); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
820 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
821 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
822 |
void |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
823 |
LteUePhy::SetTxMode5Gain (double gain) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
824 |
{ |
8725
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
825 |
SetTxModeGain (5, gain); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
826 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
827 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
828 |
void |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
829 |
LteUePhy::SetTxMode6Gain (double gain) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
830 |
{ |
8725
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
831 |
SetTxModeGain (6, gain); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
832 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
833 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
834 |
void |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
835 |
LteUePhy::SetTxMode7Gain (double gain) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
836 |
{ |
8725
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
837 |
SetTxModeGain (7, gain); |
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
838 |
} |
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
839 |
|
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
840 |
|
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
841 |
void |
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
842 |
LteUePhy::SetTxModeGain (uint8_t txMode, double gain) |
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
843 |
{ |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
844 |
NS_LOG_FUNCTION (this << gain); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
845 |
// convert to linear |
8715
736f0318fc8a
Bug-fix tx mode gain exchange from LteUePhy and LteSpectrumPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8714
diff
changeset
|
846 |
double gainLin = pow (10.0, (gain / 10.0)); |
8725
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
847 |
if (m_txModeGain.size () < txMode) |
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
848 |
{ |
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
849 |
m_txModeGain.resize (txMode); |
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
850 |
} |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
851 |
std::vector <double> temp; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
852 |
temp = m_txModeGain; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
853 |
m_txModeGain.clear (); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
854 |
for (uint8_t i = 0; i < temp.size (); i++) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
855 |
{ |
8725
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
856 |
if (i==txMode-1) |
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
857 |
{ |
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
858 |
m_txModeGain.push_back (gainLin); |
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
859 |
} |
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
860 |
else |
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
861 |
{ |
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
862 |
m_txModeGain.push_back (temp.at (i)); |
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
863 |
} |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
864 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
865 |
// forward the info to DL LteSpectrumPhy |
8725
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8720
diff
changeset
|
866 |
m_downlinkSpectrumPhy->SetTxModeGain (txMode, gain); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
867 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
868 |
|
7886 | 869 |
|
6705 | 870 |
} // namespace ns3 |