author | mmiozzo |
Mon, 23 Apr 2012 13:16:03 +0200 | |
changeset 8726 | f6f0e2531457 |
parent 8670 | 8f63d16fb2e8 |
parent 8725 | e8df5f68c35e |
child 8728 | 5a99218bfd1b |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7238
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 |
* Author: Marco Miozzo <mmiozzo@cttc.es> |
6705 | 20 |
*/ |
21 |
||
7887 | 22 |
#ifndef LTE_UE_PHY_H |
23 |
#define LTE_UE_PHY_H |
|
6705 | 24 |
|
25 |
||
7886 | 26 |
#include <ns3/lte-phy.h> |
27 |
#include <ns3/ff-mac-common.h> |
|
28 |
||
29 |
#include <ns3/ideal-control-messages.h> |
|
7887 | 30 |
#include <ns3/lte-amc.h> |
7886 | 31 |
#include <ns3/lte-ue-phy-sap.h> |
32 |
#include <ns3/ptr.h> |
|
8517
4446f1535b9e
Update LteUePhy for working with new LteAmc object
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8253
diff
changeset
|
33 |
#include <ns3/lte-amc.h> |
7886 | 34 |
|
6705 | 35 |
|
36 |
namespace ns3 { |
|
37 |
||
38 |
class PacketBurst; |
|
39 |
class LteNetDevice; |
|
7887 | 40 |
class LteEnbPhy; |
6705 | 41 |
|
42 |
/** |
|
7238
85a7e87bb4cc
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6852
diff
changeset
|
43 |
* \ingroup lte |
85a7e87bb4cc
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6852
diff
changeset
|
44 |
* |
6705 | 45 |
* The LteSpectrumPhy models the physical layer of LTE |
46 |
*/ |
|
7887 | 47 |
class LteUePhy : public LtePhy |
6705 | 48 |
{ |
49 |
||
7887 | 50 |
friend class UeMemberLteUePhySapProvider; |
7886 | 51 |
|
6705 | 52 |
public: |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
53 |
/** |
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
54 |
* @warning the default constructor should not be used |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
55 |
*/ |
7887 | 56 |
LteUePhy (); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
57 |
|
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
58 |
/** |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
59 |
* |
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
60 |
* \param dlPhy the downlink LteSpectrumPhy instance |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
61 |
* \param ulPhy the uplink LteSpectrumPhy instance |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
62 |
*/ |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
63 |
LteUePhy (Ptr<LteSpectrumPhy> dlPhy, Ptr<LteSpectrumPhy> ulPhy); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
64 |
|
7887 | 65 |
virtual ~LteUePhy (); |
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
66 |
|
8015 | 67 |
// inherited from Object |
7886 | 68 |
static TypeId GetTypeId (void); |
8015 | 69 |
virtual void DoStart (void); |
70 |
virtual void DoDispose (void); |
|
6705 | 71 |
|
72 |
/** |
|
7886 | 73 |
* \brief Get the PHY SAP provider |
74 |
* \return a pointer to the SAP Provider of the PHY |
|
6705 | 75 |
*/ |
7886 | 76 |
LteUePhySapProvider* GetLteUePhySapProvider (); |
6705 | 77 |
|
78 |
/** |
|
7886 | 79 |
* \brief Set the PHY SAP User |
80 |
* \param s a pointer to the PHY SAP user |
|
81 |
*/ |
|
82 |
void SetLteUePhySapUser (LteUePhySapUser* s); |
|
83 |
||
7949 | 84 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
85 |
/** |
7949 | 86 |
* \param pw the transmission power in dBm |
87 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
88 |
void SetTxPower (double pow); |
7949 | 89 |
|
90 |
/** |
|
91 |
* \return the transmission power in dBm |
|
92 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
93 |
double GetTxPower () const; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
94 |
/** |
7981 | 95 |
* \param pw the noise figure in dB |
96 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
97 |
void SetNoiseFigure (double pow); |
7981 | 98 |
|
99 |
/** |
|
100 |
* \return the noise figure in dB |
|
101 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
102 |
double GetNoiseFigure () const; |
7949 | 103 |
|
7886 | 104 |
/** |
8670
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
105 |
* \param delay the TTI delay between MAC and channel |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
106 |
*/ |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
107 |
void SetMacChDelay (uint8_t delay); |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
108 |
|
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
109 |
/** |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
110 |
* \returns the TTI delay between MAC and channel |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
111 |
*/ |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
112 |
uint8_t GetMacChDelay (void) const; |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
113 |
|
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
114 |
/** |
7886 | 115 |
* \brief Queue the MAC PDU to be sent |
116 |
* \param p the MAC PDU to sent |
|
6705 | 117 |
*/ |
7886 | 118 |
virtual void DoSendMacPdu (Ptr<Packet> p); |
6705 | 119 |
|
120 |
/** |
|
121 |
* \brief Create the PSD for the TX |
|
122 |
* \return the pointer to the PSD |
|
123 |
*/ |
|
124 |
virtual Ptr<SpectrumValue> CreateTxPowerSpectralDensity (); |
|
125 |
||
126 |
/** |
|
127 |
* \brief Update available channel for TX |
|
128 |
*/ |
|
129 |
virtual void DoSetUplinkSubChannels (); |
|
130 |
||
131 |
/** |
|
132 |
* \brief Set a list of sub channels to use in TX |
|
133 |
* \param mask a list of sub channels |
|
134 |
*/ |
|
135 |
void SetSubChannelsForTransmission (std::vector <int> mask); |
|
136 |
/** |
|
137 |
* \brief Get a list of sub channels to use in RX |
|
138 |
* \return a list of sub channels |
|
139 |
*/ |
|
140 |
std::vector <int> GetSubChannelsForTransmission (void); |
|
141 |
||
142 |
/** |
|
143 |
* \brief Get a list of sub channels to use in RX |
|
144 |
* \param mask list of sub channels |
|
145 |
*/ |
|
146 |
void SetSubChannelsForReception (std::vector <int> mask); |
|
147 |
/** |
|
148 |
* \brief Get a list of sub channels to use in RX |
|
149 |
* \return a list of sub channels |
|
150 |
*/ |
|
151 |
std::vector <int> GetSubChannelsForReception (void); |
|
152 |
||
153 |
||
154 |
/** |
|
7886 | 155 |
* \brief Create the DL CQI feedback from SINR values perceived at |
156 |
* the physical layer with the signal received from eNB |
|
157 |
* \param sinr SINR values vector |
|
158 |
*/ |
|
159 |
Ptr<DlCqiIdealControlMessage> CreateDlCqiFeedbackMessage (const SpectrumValue& sinr); |
|
160 |
||
161 |
||
162 |
||
163 |
// inherited from LtePhy |
|
8664
ab4c821fc251
revision after Giuseppe's comments http://codereview.appspot.com/4626069/#msg1
Nicola Baldo <nbaldo@cttc.es>
parents:
8522
diff
changeset
|
164 |
virtual void GenerateCqiReport (const SpectrumValue& sinr); |
7886 | 165 |
|
166 |
virtual void DoSendIdealControlMessage (Ptr<IdealControlMessage> msg); |
|
167 |
virtual void ReceiveIdealControlMessage (Ptr<IdealControlMessage> msg); |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
168 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
169 |
virtual void DoSetTransmissionMode (uint8_t txMode); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
170 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
171 |
|
7886 | 172 |
|
173 |
||
174 |
||
175 |
/** |
|
176 |
* \brief PhySpectrum received a new PHY-PDU |
|
6705 | 177 |
*/ |
7886 | 178 |
void PhyPduReceived (Ptr<Packet> p); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
179 |
|
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
180 |
|
7886 | 181 |
/** |
182 |
* \brief trigger from eNB the start from a new frame |
|
183 |
* |
|
184 |
* \param frameNo frame number |
|
185 |
* \param subframeNo subframe number |
|
186 |
*/ |
|
187 |
void SubframeIndication (uint32_t frameNo, uint32_t subframeNo); |
|
188 |
||
6705 | 189 |
|
7886 | 190 |
/** |
191 |
* \param rnti the rnti assigned to the UE |
|
192 |
*/ |
|
193 |
void SetRnti (uint16_t rnti); |
|
194 |
||
195 |
||
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
196 |
/** |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
197 |
* set the cellId of the eNb this PHY is synchronized with |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
198 |
* |
7886 | 199 |
* \param cellId the cell identifier of the eNB |
200 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
201 |
void SetEnbCellId (uint16_t cellId); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
202 |
|
7886 | 203 |
|
6705 | 204 |
|
205 |
private: |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
206 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
207 |
void SetTxMode1Gain (double gain); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
208 |
void SetTxMode2Gain (double gain); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
209 |
void SetTxMode3Gain (double gain); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
210 |
void SetTxMode4Gain (double gain); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
211 |
void SetTxMode5Gain (double gain); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
212 |
void SetTxMode6Gain (double gain); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
213 |
void SetTxMode7Gain (double gain); |
8725
e8df5f68c35e
Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8714
diff
changeset
|
214 |
void SetTxModeGain (uint8_t txMode, double gain); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
215 |
|
6705 | 216 |
std::vector <int> m_subChannelsForTransmission; |
217 |
std::vector <int> m_subChannelsForReception; |
|
8517
4446f1535b9e
Update LteUePhy for working with new LteAmc object
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8253
diff
changeset
|
218 |
|
8522
795ea37db2ff
Change LteAmc* to Ptr<LteAmc> in LteUePhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8517
diff
changeset
|
219 |
Ptr<LteAmc> m_amc; |
7886 | 220 |
|
221 |
Time m_p10CqiPeriocity; /**< Wideband Periodic CQI: 2, 5, 10, 16, 20, 32, 40, 64, 80 or 160 ms */ |
|
222 |
Time m_p10CqiLast; |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
223 |
|
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
224 |
/**< SubBand Aperiodic CQI: activated by DCI format 0 or Random Access Response Grant */ |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
225 |
// NOTE defines a periodicity for academic studies |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
226 |
Time m_a30CqiPeriocity; |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
227 |
Time m_a30CqiLast; |
7886 | 228 |
|
229 |
LteUePhySapProvider* m_uePhySapProvider; |
|
230 |
LteUePhySapUser* m_uePhySapUser; |
|
231 |
||
232 |
uint16_t m_rnti; |
|
233 |
||
7893 | 234 |
uint16_t m_enbCellId; |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
235 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
236 |
uint8_t m_transmissionMode; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8522
diff
changeset
|
237 |
std::vector <double> m_txModeGain; |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
238 |
|
6705 | 239 |
}; |
240 |
||
241 |
||
242 |
} |
|
243 |
||
7887 | 244 |
#endif /* LTE_UE_PHY_H */ |