author | Tom Henderson <tomh@tomh.org> |
Mon, 04 Jan 2016 14:11:51 -0800 | |
changeset 11800 | bd9c9abd5d6e |
parent 11577 | 0210ca11dad1 |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Mileti? <rivanvx@gmail.com>
parents:
7177
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
6705 | 2 |
/* |
7886 | 3 |
* Copyright (c) 2009, 2011 CTTC |
6705 | 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: Nicola Baldo <nbaldo@cttc.es> |
|
19 |
* Giuseppe Piro <g.piro@poliba.it> |
|
8521
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
20 |
* Marco Miozzo <marco.miozzo@cttc.es> (add physical error model) |
6705 | 21 |
*/ |
22 |
||
23 |
||
24 |
#include <ns3/object-factory.h> |
|
25 |
#include <ns3/log.h> |
|
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Mileti? <rivanvx@gmail.com>
parents:
9057
diff
changeset
|
26 |
#include <cmath> |
6705 | 27 |
#include <ns3/simulator.h> |
28 |
#include <ns3/trace-source-accessor.h> |
|
7836
9cf68ee51869
integrated AntennaModel with spectrum
Nicola Baldo <nbaldo@cttc.es>
parents:
7581
diff
changeset
|
29 |
#include <ns3/antenna-model.h> |
6705 | 30 |
#include "lte-spectrum-phy.h" |
7581 | 31 |
#include "lte-spectrum-signal-parameters.h" |
6705 | 32 |
#include "lte-net-device.h" |
8462
cf6a48994db5
renamed LteMacTag --> LteRadioBearerTag
Nicola Baldo <nbaldo@cttc.es>
parents:
8339
diff
changeset
|
33 |
#include "lte-radio-bearer-tag.h" |
10892
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
10680
diff
changeset
|
34 |
#include "lte-chunk-processor.h" |
7891
382a429bdc69
added PHY synchronization model
Nicola Baldo <nicola@baldo.biz>
parents:
7886
diff
changeset
|
35 |
#include "lte-phy-tag.h" |
8521
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
36 |
#include <ns3/lte-mi-error-model.h> |
8538 | 37 |
#include <ns3/lte-radio-bearer-tag.h> |
8534
8187224a4598
Add LteSpectrumPhy::PemEnabled atribute for enable/disable the phy error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8521
diff
changeset
|
38 |
#include <ns3/boolean.h> |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
39 |
#include <ns3/double.h> |
9519
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
40 |
#include <ns3/config.h> |
6705 | 41 |
|
42 |
namespace ns3 { |
|
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
43 |
|
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10892
diff
changeset
|
44 |
NS_LOG_COMPONENT_DEFINE ("LteSpectrumPhy"); |
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
45 |
|
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
46 |
|
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
47 |
// duration of SRS portion of UL subframe |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
48 |
// = 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:
9043
diff
changeset
|
49 |
static const Time UL_SRS_DURATION = NanoSeconds (71429 -1); |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
50 |
|
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
51 |
// duration of the control portion of a subframe |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
52 |
// = 0.001 / 14 * 3 (ctrl fixed to 3 symbols) -1ns as margin to avoid overlapping simulator events |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
53 |
static const Time DL_CTRL_DURATION = NanoSeconds (214286 -1); |
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
54 |
|
10680
ace43d9baa17
make various implementation-specific tables static const.
Andrey Mazo <ahippo@yandex.com>
parents:
10652
diff
changeset
|
55 |
static const double EffectiveCodingRate[29] = { |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
56 |
0.08, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
57 |
0.1, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
58 |
0.11, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
59 |
0.15, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
60 |
0.19, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
61 |
0.24, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
62 |
0.3, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
63 |
0.37, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
64 |
0.44, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
65 |
0.51, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
66 |
0.3, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
67 |
0.33, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
68 |
0.37, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
69 |
0.42, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
70 |
0.48, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
71 |
0.54, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
72 |
0.6, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
73 |
0.43, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
74 |
0.45, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
75 |
0.5, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
76 |
0.55, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
77 |
0.6, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
78 |
0.65, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
79 |
0.7, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
80 |
0.75, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
81 |
0.8, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
82 |
0.85, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
83 |
0.89, |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
84 |
0.92 |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
85 |
}; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
86 |
|
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
87 |
|
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
88 |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
89 |
|
8718
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
90 |
TbId_t::TbId_t () |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
91 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
92 |
} |
6705 | 93 |
|
8718
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
94 |
TbId_t::TbId_t (const uint16_t a, const uint8_t b) |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
95 |
: m_rnti (a), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
96 |
m_layer (b) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
97 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
98 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
99 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
100 |
bool |
8718
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
101 |
operator == (const TbId_t &a, const TbId_t &b) |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
102 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
103 |
return ( (a.m_rnti == b.m_rnti) && (a.m_layer == b.m_layer) ); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
104 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
105 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
106 |
bool |
8718
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
107 |
operator < (const TbId_t& a, const TbId_t& b) |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
108 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
109 |
return ( (a.m_rnti < b.m_rnti) || ( (a.m_rnti == b.m_rnti) && (a.m_layer < b.m_layer) ) ); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
110 |
} |
6705 | 111 |
|
10652
dc18deba4502
[doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10410
diff
changeset
|
112 |
NS_OBJECT_ENSURE_REGISTERED (LteSpectrumPhy); |
6705 | 113 |
|
114 |
LteSpectrumPhy::LteSpectrumPhy () |
|
8521
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
115 |
: m_state (IDLE), |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10063
diff
changeset
|
116 |
m_cellId (0), |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
117 |
m_transmissionMode (0), |
9519
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
118 |
m_layersNum (1) |
6705 | 119 |
{ |
7913
ed3a9f8a76d7
added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents:
7911
diff
changeset
|
120 |
NS_LOG_FUNCTION (this); |
8987
03b1accee8d1
Replace src/lte usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8726
diff
changeset
|
121 |
m_random = CreateObject<UniformRandomVariable> (); |
03b1accee8d1
Replace src/lte usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8726
diff
changeset
|
122 |
m_random->SetAttribute ("Min", DoubleValue (0.0)); |
03b1accee8d1
Replace src/lte usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8726
diff
changeset
|
123 |
m_random->SetAttribute ("Max", DoubleValue (1.0)); |
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:
8726
diff
changeset
|
124 |
m_interferenceData = CreateObject<LteInterference> (); |
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:
8726
diff
changeset
|
125 |
m_interferenceCtrl = CreateObject<LteInterference> (); |
9057 | 126 |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
127 |
for (uint8_t i = 0; i < 7; i++) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
128 |
{ |
8724
b92bff65c4fd
Udate default values of txMode gain to 1.0 (linear of 0 dB)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8718
diff
changeset
|
129 |
m_txModeGain.push_back (1.0); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
130 |
} |
6705 | 131 |
} |
132 |
||
133 |
||
134 |
LteSpectrumPhy::~LteSpectrumPhy () |
|
135 |
{ |
|
7924
3a44452d0dad
made LteInterference an Object and fixed more disposals
Nicola Baldo <nbaldo@cttc.es>
parents:
7913
diff
changeset
|
136 |
NS_LOG_FUNCTION (this); |
8511
46046bbb2a5c
Add info in LteSpectrumPhy on TB from DCI elaborated by LteEnbPhy and LteUePhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8339
diff
changeset
|
137 |
m_expectedTbs.clear (); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
138 |
m_txModeGain.clear (); |
6705 | 139 |
} |
140 |
||
7911 | 141 |
void LteSpectrumPhy::DoDispose () |
142 |
{ |
|
7913
ed3a9f8a76d7
added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents:
7911
diff
changeset
|
143 |
NS_LOG_FUNCTION (this); |
7911 | 144 |
m_channel = 0; |
145 |
m_mobility = 0; |
|
146 |
m_device = 0; |
|
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:
8726
diff
changeset
|
147 |
m_interferenceData->Dispose (); |
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:
8726
diff
changeset
|
148 |
m_interferenceData = 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:
8726
diff
changeset
|
149 |
m_interferenceCtrl->Dispose (); |
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:
8726
diff
changeset
|
150 |
m_interferenceCtrl = 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:
8726
diff
changeset
|
151 |
m_ltePhyRxDataEndErrorCallback = MakeNullCallback< void > (); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8726
diff
changeset
|
152 |
m_ltePhyRxDataEndOkCallback = MakeNullCallback< void, Ptr<Packet> > (); |
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:
8726
diff
changeset
|
153 |
m_ltePhyRxCtrlEndOkCallback = MakeNullCallback< void, std::list<Ptr<LteControlMessage> > > (); |
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:
8726
diff
changeset
|
154 |
m_ltePhyRxCtrlEndErrorCallback = MakeNullCallback< void > (); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
155 |
m_ltePhyDlHarqFeedbackCallback = MakeNullCallback< void, DlInfoListElement_s > (); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
156 |
m_ltePhyUlHarqFeedbackCallback = MakeNullCallback< void, UlInfoListElement_s > (); |
9996
62697fe2165d
Bug-fix LteUePhy UE Measurements PSS storage by introducing PssElement struct
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9983
diff
changeset
|
157 |
m_ltePhyRxPssCallback = MakeNullCallback< void, uint16_t, Ptr<SpectrumValue> > (); |
7913
ed3a9f8a76d7
added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents:
7911
diff
changeset
|
158 |
SpectrumPhy::DoDispose (); |
7911 | 159 |
} |
6705 | 160 |
|
161 |
std::ostream& operator<< (std::ostream& os, LteSpectrumPhy::State s) |
|
162 |
{ |
|
163 |
switch (s) |
|
164 |
{ |
|
165 |
case LteSpectrumPhy::IDLE: |
|
166 |
os << "IDLE"; |
|
167 |
break; |
|
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
168 |
case LteSpectrumPhy::RX_DATA: |
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
169 |
os << "RX_DATA"; |
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
170 |
break; |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
171 |
case LteSpectrumPhy::RX_DL_CTRL: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
172 |
os << "RX_DL_CTRL"; |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
173 |
break; |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
174 |
case LteSpectrumPhy::TX_DATA: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
175 |
os << "TX_DATA"; |
6705 | 176 |
break; |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
177 |
case LteSpectrumPhy::TX_DL_CTRL: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
178 |
os << "TX_DL_CTRL"; |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
179 |
break; |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
180 |
case LteSpectrumPhy::TX_UL_SRS: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
181 |
os << "TX_UL_SRS"; |
6705 | 182 |
break; |
183 |
default: |
|
184 |
os << "UNKNOWN"; |
|
185 |
break; |
|
186 |
} |
|
187 |
return os; |
|
188 |
} |
|
189 |
||
190 |
TypeId |
|
191 |
LteSpectrumPhy::GetTypeId (void) |
|
192 |
{ |
|
193 |
static TypeId tid = TypeId ("ns3::LteSpectrumPhy") |
|
194 |
.SetParent<SpectrumPhy> () |
|
11274
609de51c9b88
SetGroupName for lte module
Mohit Goyal <mohit.bits2011@gmail.com>
parents:
11272
diff
changeset
|
195 |
.SetGroupName("Lte") |
6705 | 196 |
.AddTraceSource ("TxStart", |
197 |
"Trace fired when a new transmission is started", |
|
11085
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10968
diff
changeset
|
198 |
MakeTraceSourceAccessor (&LteSpectrumPhy::m_phyTxStartTrace), |
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10968
diff
changeset
|
199 |
"ns3::PacketBurst::TracedCallback") |
6705 | 200 |
.AddTraceSource ("TxEnd", |
201 |
"Trace fired when a previosuly started transmission is finished", |
|
11085
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10968
diff
changeset
|
202 |
MakeTraceSourceAccessor (&LteSpectrumPhy::m_phyTxEndTrace), |
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10968
diff
changeset
|
203 |
"ns3::PacketBurst::TracedCallback") |
6705 | 204 |
.AddTraceSource ("RxStart", |
205 |
"Trace fired when the start of a signal is detected", |
|
11085
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10968
diff
changeset
|
206 |
MakeTraceSourceAccessor (&LteSpectrumPhy::m_phyRxStartTrace), |
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10968
diff
changeset
|
207 |
"ns3::PacketBurst::TracedCallback") |
6705 | 208 |
.AddTraceSource ("RxEndOk", |
209 |
"Trace fired when a previosuly started RX terminates successfully", |
|
11085
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10968
diff
changeset
|
210 |
MakeTraceSourceAccessor (&LteSpectrumPhy::m_phyRxEndOkTrace), |
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10968
diff
changeset
|
211 |
"ns3::Packet::TracedCallback") |
6705 | 212 |
.AddTraceSource ("RxEndError", |
7961
535d5448b8f1
meaningful trace sources for LteSpectrumPhy
Nicola Baldo <nbaldo@cttc.es>
parents:
7928
diff
changeset
|
213 |
"Trace fired when a previosuly started RX terminates with an error", |
11085
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10968
diff
changeset
|
214 |
MakeTraceSourceAccessor (&LteSpectrumPhy::m_phyRxEndErrorTrace), |
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10968
diff
changeset
|
215 |
"ns3::Packet::TracedCallback") |
9043
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
216 |
.AddAttribute ("DataErrorModelEnabled", |
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
217 |
"Activate/Deactivate the error model of data (TBs of PDSCH and PUSCH) [by default is active].", |
8534
8187224a4598
Add LteSpectrumPhy::PemEnabled atribute for enable/disable the phy error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8521
diff
changeset
|
218 |
BooleanValue (true), |
9043
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
219 |
MakeBooleanAccessor (&LteSpectrumPhy::m_dataErrorModelEnabled), |
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
220 |
MakeBooleanChecker ()) |
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
221 |
.AddAttribute ("CtrlErrorModelEnabled", |
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
222 |
"Activate/Deactivate the error model of control (PCFICH-PDCCH decodification) [by default is active].", |
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
223 |
BooleanValue (true), |
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
224 |
MakeBooleanAccessor (&LteSpectrumPhy::m_ctrlErrorModelEnabled), |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
225 |
MakeBooleanChecker ()) |
9519
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
226 |
.AddTraceSource ("DlPhyReception", |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
227 |
"DL reception PHY layer statistics.", |
11085
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10968
diff
changeset
|
228 |
MakeTraceSourceAccessor (&LteSpectrumPhy::m_dlPhyReception), |
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10968
diff
changeset
|
229 |
"ns3::PhyReceptionStatParameters::TracedCallback") |
9519
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
230 |
.AddTraceSource ("UlPhyReception", |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
231 |
"DL reception PHY layer statistics.", |
11085
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10968
diff
changeset
|
232 |
MakeTraceSourceAccessor (&LteSpectrumPhy::m_ulPhyReception), |
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10968
diff
changeset
|
233 |
"ns3::PhyReceptionStatParameters::TracedCallback") |
6705 | 234 |
; |
235 |
return tid; |
|
236 |
} |
|
237 |
||
238 |
||
239 |
||
7553
2b93d333dea6
Bug 1271 - stronger type checking in SpectrumPhy
Nicola Baldo <nbaldo@cttc.es>
parents:
7385
diff
changeset
|
240 |
Ptr<NetDevice> |
11577
0210ca11dad1
GetDevice() should be const.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11399
diff
changeset
|
241 |
LteSpectrumPhy::GetDevice () const |
6705 | 242 |
{ |
243 |
NS_LOG_FUNCTION (this); |
|
244 |
return m_device; |
|
245 |
} |
|
246 |
||
247 |
||
7553
2b93d333dea6
Bug 1271 - stronger type checking in SpectrumPhy
Nicola Baldo <nbaldo@cttc.es>
parents:
7385
diff
changeset
|
248 |
Ptr<MobilityModel> |
6705 | 249 |
LteSpectrumPhy::GetMobility () |
250 |
{ |
|
251 |
NS_LOG_FUNCTION (this); |
|
252 |
return m_mobility; |
|
253 |
} |
|
254 |
||
255 |
||
256 |
void |
|
7553
2b93d333dea6
Bug 1271 - stronger type checking in SpectrumPhy
Nicola Baldo <nbaldo@cttc.es>
parents:
7385
diff
changeset
|
257 |
LteSpectrumPhy::SetDevice (Ptr<NetDevice> d) |
6705 | 258 |
{ |
259 |
NS_LOG_FUNCTION (this << d); |
|
260 |
m_device = d; |
|
261 |
} |
|
262 |
||
263 |
||
264 |
void |
|
7553
2b93d333dea6
Bug 1271 - stronger type checking in SpectrumPhy
Nicola Baldo <nbaldo@cttc.es>
parents:
7385
diff
changeset
|
265 |
LteSpectrumPhy::SetMobility (Ptr<MobilityModel> m) |
6705 | 266 |
{ |
267 |
NS_LOG_FUNCTION (this << m); |
|
268 |
m_mobility = m; |
|
269 |
} |
|
270 |
||
271 |
||
272 |
void |
|
273 |
LteSpectrumPhy::SetChannel (Ptr<SpectrumChannel> c) |
|
274 |
{ |
|
275 |
NS_LOG_FUNCTION (this << c); |
|
276 |
m_channel = c; |
|
277 |
} |
|
278 |
||
9406 | 279 |
Ptr<SpectrumChannel> |
280 |
LteSpectrumPhy::GetChannel () |
|
281 |
{ |
|
282 |
return m_channel; |
|
283 |
} |
|
284 |
||
6705 | 285 |
Ptr<const SpectrumModel> |
286 |
LteSpectrumPhy::GetRxSpectrumModel () const |
|
287 |
{ |
|
8693
478733ab87b7
MultiModelSpectrumChannel working with LTE
Nicola Baldo <nbaldo@cttc.es>
parents:
8538
diff
changeset
|
288 |
return m_rxSpectrumModel; |
6705 | 289 |
} |
290 |
||
291 |
||
292 |
void |
|
293 |
LteSpectrumPhy::SetTxPowerSpectralDensity (Ptr<SpectrumValue> txPsd) |
|
294 |
{ |
|
295 |
NS_LOG_FUNCTION (this << txPsd); |
|
296 |
NS_ASSERT (txPsd); |
|
297 |
m_txPsd = txPsd; |
|
298 |
} |
|
299 |
||
300 |
||
301 |
void |
|
302 |
LteSpectrumPhy::SetNoisePowerSpectralDensity (Ptr<const SpectrumValue> noisePsd) |
|
303 |
{ |
|
304 |
NS_LOG_FUNCTION (this << noisePsd); |
|
305 |
NS_ASSERT (noisePsd); |
|
8693
478733ab87b7
MultiModelSpectrumChannel working with LTE
Nicola Baldo <nbaldo@cttc.es>
parents:
8538
diff
changeset
|
306 |
m_rxSpectrumModel = noisePsd->GetSpectrumModel (); |
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:
8726
diff
changeset
|
307 |
m_interferenceData->SetNoisePowerSpectralDensity (noisePsd); |
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:
8726
diff
changeset
|
308 |
m_interferenceCtrl->SetNoisePowerSpectralDensity (noisePsd); |
6705 | 309 |
} |
310 |
||
9579
1f1a0bd0c009
added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
311 |
|
1f1a0bd0c009
added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
312 |
void |
1f1a0bd0c009
added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
313 |
LteSpectrumPhy::Reset () |
1f1a0bd0c009
added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
314 |
{ |
1f1a0bd0c009
added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
315 |
NS_LOG_FUNCTION (this); |
1f1a0bd0c009
added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
316 |
m_cellId = 0; |
1f1a0bd0c009
added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
317 |
m_state = IDLE; |
1f1a0bd0c009
added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
318 |
m_transmissionMode = 0; |
1f1a0bd0c009
added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
319 |
m_layersNum = 1; |
1f1a0bd0c009
added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
320 |
m_endTxEvent.Cancel (); |
1f1a0bd0c009
added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
321 |
m_endRxDataEvent.Cancel (); |
1f1a0bd0c009
added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
322 |
m_endRxDlCtrlEvent.Cancel (); |
1f1a0bd0c009
added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
323 |
m_endRxUlSrsEvent.Cancel (); |
9581
d1ad2deb4a04
added missing reinitializations to LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9579
diff
changeset
|
324 |
m_rxControlMessageList.clear (); |
d1ad2deb4a04
added missing reinitializations to LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9579
diff
changeset
|
325 |
m_expectedTbs.clear (); |
d1ad2deb4a04
added missing reinitializations to LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9579
diff
changeset
|
326 |
m_txControlMessageList.clear (); |
d1ad2deb4a04
added missing reinitializations to LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9579
diff
changeset
|
327 |
m_rxPacketBurstList.clear (); |
d1ad2deb4a04
added missing reinitializations to LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9579
diff
changeset
|
328 |
m_txPacketBurst = 0; |
d1ad2deb4a04
added missing reinitializations to LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9579
diff
changeset
|
329 |
m_rxSpectrumModel = 0; |
9579
1f1a0bd0c009
added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
330 |
} |
1f1a0bd0c009
added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
331 |
|
6705 | 332 |
|
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:
8726
diff
changeset
|
333 |
void |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8726
diff
changeset
|
334 |
LteSpectrumPhy::SetLtePhyRxDataEndErrorCallback (LtePhyRxDataEndErrorCallback c) |
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:
8726
diff
changeset
|
335 |
{ |
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:
8726
diff
changeset
|
336 |
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:
8726
diff
changeset
|
337 |
m_ltePhyRxDataEndErrorCallback = c; |
6705 | 338 |
} |
339 |
||
340 |
||
341 |
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:
8726
diff
changeset
|
342 |
LteSpectrumPhy::SetLtePhyRxDataEndOkCallback (LtePhyRxDataEndOkCallback c) |
6705 | 343 |
{ |
344 |
NS_LOG_FUNCTION (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:
8726
diff
changeset
|
345 |
m_ltePhyRxDataEndOkCallback = c; |
6705 | 346 |
} |
347 |
||
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:
8726
diff
changeset
|
348 |
void |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8726
diff
changeset
|
349 |
LteSpectrumPhy::SetLtePhyRxCtrlEndOkCallback (LtePhyRxCtrlEndOkCallback c) |
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:
8726
diff
changeset
|
350 |
{ |
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:
8726
diff
changeset
|
351 |
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:
8726
diff
changeset
|
352 |
m_ltePhyRxCtrlEndOkCallback = c; |
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:
8726
diff
changeset
|
353 |
} |
6705 | 354 |
|
355 |
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:
8726
diff
changeset
|
356 |
LteSpectrumPhy::SetLtePhyRxCtrlEndErrorCallback (LtePhyRxCtrlEndErrorCallback c) |
6705 | 357 |
{ |
358 |
NS_LOG_FUNCTION (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:
8726
diff
changeset
|
359 |
m_ltePhyRxCtrlEndErrorCallback = c; |
6705 | 360 |
} |
361 |
||
9983
0091ab7a897c
Add RSRP-RSRQ UE measurement and correspondent c-phy primitive for reporting them to LteUeRrr
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9617
diff
changeset
|
362 |
|
0091ab7a897c
Add RSRP-RSRQ UE measurement and correspondent c-phy primitive for reporting them to LteUeRrr
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9617
diff
changeset
|
363 |
void |
0091ab7a897c
Add RSRP-RSRQ UE measurement and correspondent c-phy primitive for reporting them to LteUeRrr
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9617
diff
changeset
|
364 |
LteSpectrumPhy::SetLtePhyRxPssCallback (LtePhyRxPssCallback c) |
0091ab7a897c
Add RSRP-RSRQ UE measurement and correspondent c-phy primitive for reporting them to LteUeRrr
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9617
diff
changeset
|
365 |
{ |
0091ab7a897c
Add RSRP-RSRQ UE measurement and correspondent c-phy primitive for reporting them to LteUeRrr
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9617
diff
changeset
|
366 |
NS_LOG_FUNCTION (this); |
0091ab7a897c
Add RSRP-RSRQ UE measurement and correspondent c-phy primitive for reporting them to LteUeRrr
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9617
diff
changeset
|
367 |
m_ltePhyRxPssCallback = c; |
0091ab7a897c
Add RSRP-RSRQ UE measurement and correspondent c-phy primitive for reporting them to LteUeRrr
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9617
diff
changeset
|
368 |
} |
0091ab7a897c
Add RSRP-RSRQ UE measurement and correspondent c-phy primitive for reporting them to LteUeRrr
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9617
diff
changeset
|
369 |
|
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
370 |
void |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
371 |
LteSpectrumPhy::SetLtePhyDlHarqFeedbackCallback (LtePhyDlHarqFeedbackCallback c) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
372 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
373 |
NS_LOG_FUNCTION (this); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
374 |
m_ltePhyDlHarqFeedbackCallback = c; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
375 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
376 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
377 |
void |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
378 |
LteSpectrumPhy::SetLtePhyUlHarqFeedbackCallback (LtePhyUlHarqFeedbackCallback c) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
379 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
380 |
NS_LOG_FUNCTION (this); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
381 |
m_ltePhyUlHarqFeedbackCallback = c; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
382 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
383 |
|
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:
8726
diff
changeset
|
384 |
|
7836
9cf68ee51869
integrated AntennaModel with spectrum
Nicola Baldo <nbaldo@cttc.es>
parents:
7581
diff
changeset
|
385 |
Ptr<AntennaModel> |
9cf68ee51869
integrated AntennaModel with spectrum
Nicola Baldo <nbaldo@cttc.es>
parents:
7581
diff
changeset
|
386 |
LteSpectrumPhy::GetRxAntenna () |
9cf68ee51869
integrated AntennaModel with spectrum
Nicola Baldo <nbaldo@cttc.es>
parents:
7581
diff
changeset
|
387 |
{ |
9cf68ee51869
integrated AntennaModel with spectrum
Nicola Baldo <nbaldo@cttc.es>
parents:
7581
diff
changeset
|
388 |
return m_antenna; |
9cf68ee51869
integrated AntennaModel with spectrum
Nicola Baldo <nbaldo@cttc.es>
parents:
7581
diff
changeset
|
389 |
} |
9cf68ee51869
integrated AntennaModel with spectrum
Nicola Baldo <nbaldo@cttc.es>
parents:
7581
diff
changeset
|
390 |
|
9cf68ee51869
integrated AntennaModel with spectrum
Nicola Baldo <nbaldo@cttc.es>
parents:
7581
diff
changeset
|
391 |
void |
9cf68ee51869
integrated AntennaModel with spectrum
Nicola Baldo <nbaldo@cttc.es>
parents:
7581
diff
changeset
|
392 |
LteSpectrumPhy::SetAntenna (Ptr<AntennaModel> a) |
9cf68ee51869
integrated AntennaModel with spectrum
Nicola Baldo <nbaldo@cttc.es>
parents:
7581
diff
changeset
|
393 |
{ |
9cf68ee51869
integrated AntennaModel with spectrum
Nicola Baldo <nbaldo@cttc.es>
parents:
7581
diff
changeset
|
394 |
NS_LOG_FUNCTION (this << a); |
9cf68ee51869
integrated AntennaModel with spectrum
Nicola Baldo <nbaldo@cttc.es>
parents:
7581
diff
changeset
|
395 |
m_antenna = a; |
9cf68ee51869
integrated AntennaModel with spectrum
Nicola Baldo <nbaldo@cttc.es>
parents:
7581
diff
changeset
|
396 |
} |
6705 | 397 |
|
398 |
void |
|
399 |
LteSpectrumPhy::SetState (State newState) |
|
400 |
{ |
|
401 |
ChangeState (newState); |
|
402 |
} |
|
403 |
||
404 |
||
405 |
void |
|
406 |
LteSpectrumPhy::ChangeState (State newState) |
|
407 |
{ |
|
408 |
NS_LOG_LOGIC (this << " state: " << m_state << " -> " << newState); |
|
409 |
m_state = newState; |
|
410 |
} |
|
411 |
||
412 |
||
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
413 |
void |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
414 |
LteSpectrumPhy::SetHarqPhyModule (Ptr<LteHarqPhy> harq) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
415 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
416 |
m_harqPhyModule = harq; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
417 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
418 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
419 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
420 |
|
6705 | 421 |
|
422 |
bool |
|
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
423 |
LteSpectrumPhy::StartTxDataFrame (Ptr<PacketBurst> pb, std::list<Ptr<LteControlMessage> > ctrlMsgList, Time duration) |
6705 | 424 |
{ |
425 |
NS_LOG_FUNCTION (this << pb); |
|
7893 | 426 |
NS_LOG_LOGIC (this << " state: " << m_state); |
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:
8726
diff
changeset
|
427 |
|
7961
535d5448b8f1
meaningful trace sources for LteSpectrumPhy
Nicola Baldo <nbaldo@cttc.es>
parents:
7928
diff
changeset
|
428 |
m_phyTxStartTrace (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:
8726
diff
changeset
|
429 |
|
7891
382a429bdc69
added PHY synchronization model
Nicola Baldo <nicola@baldo.biz>
parents:
7886
diff
changeset
|
430 |
switch (m_state) |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
431 |
{ |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
432 |
case RX_DATA: |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
433 |
case RX_DL_CTRL: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
434 |
case RX_UL_SRS: |
7891
382a429bdc69
added PHY synchronization model
Nicola Baldo <nicola@baldo.biz>
parents:
7886
diff
changeset
|
435 |
NS_FATAL_ERROR ("cannot TX while RX: according to FDD channel acces, the physical layer for transmission cannot be used for reception"); |
382a429bdc69
added PHY synchronization model
Nicola Baldo <nicola@baldo.biz>
parents:
7886
diff
changeset
|
436 |
break; |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
437 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
438 |
case TX_DATA: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
439 |
case TX_DL_CTRL: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
440 |
case TX_UL_SRS: |
7891
382a429bdc69
added PHY synchronization model
Nicola Baldo <nicola@baldo.biz>
parents:
7886
diff
changeset
|
441 |
NS_FATAL_ERROR ("cannot TX while already TX: the MAC should avoid this"); |
382a429bdc69
added PHY synchronization model
Nicola Baldo <nicola@baldo.biz>
parents:
7886
diff
changeset
|
442 |
break; |
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:
8726
diff
changeset
|
443 |
|
7891
382a429bdc69
added PHY synchronization model
Nicola Baldo <nicola@baldo.biz>
parents:
7886
diff
changeset
|
444 |
case IDLE: |
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:
8726
diff
changeset
|
445 |
{ |
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:
8726
diff
changeset
|
446 |
/* |
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:
8726
diff
changeset
|
447 |
m_txPsd must be setted by the device, according to |
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:
8726
diff
changeset
|
448 |
(i) the available subchannel for transmission |
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:
8726
diff
changeset
|
449 |
(ii) the power transmission |
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:
8726
diff
changeset
|
450 |
*/ |
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:
8726
diff
changeset
|
451 |
NS_ASSERT (m_txPsd); |
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:
8726
diff
changeset
|
452 |
m_txPacketBurst = pb; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8726
diff
changeset
|
453 |
|
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:
8726
diff
changeset
|
454 |
// we need to convey some PHY meta information to the receiver |
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:
8726
diff
changeset
|
455 |
// to be used for simulation purposes (e.g., the CellId). 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:
8726
diff
changeset
|
456 |
// is done by setting the ctrlMsgList parameter of |
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:
8726
diff
changeset
|
457 |
// LteSpectrumSignalParametersDataFrame |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
458 |
ChangeState (TX_DATA); |
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:
8726
diff
changeset
|
459 |
NS_ASSERT (m_channel); |
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:
8726
diff
changeset
|
460 |
Ptr<LteSpectrumSignalParametersDataFrame> txParams = Create<LteSpectrumSignalParametersDataFrame> (); |
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
461 |
txParams->duration = duration; |
7581 | 462 |
txParams->txPhy = GetObject<SpectrumPhy> (); |
8506
f9616c9094a5
integrated AntennaModel with LTE, including system test
Nicola Baldo <nbaldo@cttc.es>
parents:
8505
diff
changeset
|
463 |
txParams->txAntenna = m_antenna; |
7581 | 464 |
txParams->psd = m_txPsd; |
465 |
txParams->packetBurst = 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:
8726
diff
changeset
|
466 |
txParams->ctrlMsgList = ctrlMsgList; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8726
diff
changeset
|
467 |
txParams->cellId = m_cellId; |
7581 | 468 |
m_channel->StartTx (txParams); |
11269
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
469 |
m_endTxEvent = Simulator::Schedule (duration, &LteSpectrumPhy::EndTxData, 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:
8726
diff
changeset
|
470 |
} |
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:
8726
diff
changeset
|
471 |
return false; |
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:
8726
diff
changeset
|
472 |
break; |
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:
8726
diff
changeset
|
473 |
|
7891
382a429bdc69
added PHY synchronization model
Nicola Baldo <nicola@baldo.biz>
parents:
7886
diff
changeset
|
474 |
default: |
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:
8726
diff
changeset
|
475 |
NS_FATAL_ERROR ("unknown state"); |
6705 | 476 |
return true; |
7891
382a429bdc69
added PHY synchronization model
Nicola Baldo <nicola@baldo.biz>
parents:
7886
diff
changeset
|
477 |
break; |
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:
8726
diff
changeset
|
478 |
} |
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:
8726
diff
changeset
|
479 |
} |
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:
8726
diff
changeset
|
480 |
|
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:
8726
diff
changeset
|
481 |
bool |
10292
d8c887780c32
Reverted changes from parent revision 9974
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10287
diff
changeset
|
482 |
LteSpectrumPhy::StartTxDlCtrlFrame (std::list<Ptr<LteControlMessage> > ctrlMsgList, bool pss) |
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:
8726
diff
changeset
|
483 |
{ |
10292
d8c887780c32
Reverted changes from parent revision 9974
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10287
diff
changeset
|
484 |
NS_LOG_FUNCTION (this << " PSS " << (uint16_t)pss); |
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:
8726
diff
changeset
|
485 |
NS_LOG_LOGIC (this << " state: " << m_state); |
10292
d8c887780c32
Reverted changes from parent revision 9974
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10287
diff
changeset
|
486 |
|
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:
8726
diff
changeset
|
487 |
switch (m_state) |
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:
8726
diff
changeset
|
488 |
{ |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
489 |
case RX_DATA: |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
490 |
case RX_DL_CTRL: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
491 |
case RX_UL_SRS: |
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:
8726
diff
changeset
|
492 |
NS_FATAL_ERROR ("cannot TX while RX: according to FDD channel acces, the physical layer for transmission cannot be used for reception"); |
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:
8726
diff
changeset
|
493 |
break; |
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:
8726
diff
changeset
|
494 |
|
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
495 |
case TX_DATA: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
496 |
case TX_DL_CTRL: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
497 |
case TX_UL_SRS: |
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:
8726
diff
changeset
|
498 |
NS_FATAL_ERROR ("cannot TX while already TX: the MAC should avoid 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:
8726
diff
changeset
|
499 |
break; |
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:
8726
diff
changeset
|
500 |
|
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:
8726
diff
changeset
|
501 |
case IDLE: |
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:
8726
diff
changeset
|
502 |
{ |
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:
8726
diff
changeset
|
503 |
/* |
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:
8726
diff
changeset
|
504 |
m_txPsd must be setted by the device, according to |
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:
8726
diff
changeset
|
505 |
(i) the available subchannel for transmission |
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:
8726
diff
changeset
|
506 |
(ii) the power transmission |
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:
8726
diff
changeset
|
507 |
*/ |
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:
8726
diff
changeset
|
508 |
NS_ASSERT (m_txPsd); |
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:
8726
diff
changeset
|
509 |
|
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:
8726
diff
changeset
|
510 |
// we need to convey some PHY meta information to the receiver |
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:
8726
diff
changeset
|
511 |
// to be used for simulation purposes (e.g., the CellId). 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:
8726
diff
changeset
|
512 |
// is done by setting the cellId parameter of |
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:
8726
diff
changeset
|
513 |
// LteSpectrumSignalParametersDlCtrlFrame |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
514 |
ChangeState (TX_DL_CTRL); |
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:
8726
diff
changeset
|
515 |
NS_ASSERT (m_channel); |
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
516 |
|
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:
8726
diff
changeset
|
517 |
Ptr<LteSpectrumSignalParametersDlCtrlFrame> txParams = Create<LteSpectrumSignalParametersDlCtrlFrame> (); |
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
518 |
txParams->duration = DL_CTRL_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:
8726
diff
changeset
|
519 |
txParams->txPhy = GetObject<SpectrumPhy> (); |
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:
8726
diff
changeset
|
520 |
txParams->txAntenna = m_antenna; |
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:
8726
diff
changeset
|
521 |
txParams->psd = m_txPsd; |
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:
8726
diff
changeset
|
522 |
txParams->cellId = m_cellId; |
9983
0091ab7a897c
Add RSRP-RSRQ UE measurement and correspondent c-phy primitive for reporting them to LteUeRrr
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9617
diff
changeset
|
523 |
txParams->pss = pss; |
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:
8726
diff
changeset
|
524 |
txParams->ctrlMsgList = ctrlMsgList; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8726
diff
changeset
|
525 |
m_channel->StartTx (txParams); |
11269
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
526 |
m_endTxEvent = Simulator::Schedule (DL_CTRL_DURATION, &LteSpectrumPhy::EndTxDlCtrl, this); |
6705 | 527 |
} |
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:
8726
diff
changeset
|
528 |
return false; |
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:
8726
diff
changeset
|
529 |
break; |
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:
8726
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:
8726
diff
changeset
|
531 |
default: |
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:
8726
diff
changeset
|
532 |
NS_FATAL_ERROR ("unknown state"); |
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:
8726
diff
changeset
|
533 |
return true; |
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:
8726
diff
changeset
|
534 |
break; |
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:
8726
diff
changeset
|
535 |
} |
6705 | 536 |
} |
537 |
||
538 |
||
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8726
diff
changeset
|
539 |
bool |
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:
8726
diff
changeset
|
540 |
LteSpectrumPhy::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:
8726
diff
changeset
|
541 |
{ |
9250 | 542 |
NS_LOG_FUNCTION (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:
8726
diff
changeset
|
543 |
NS_LOG_LOGIC (this << " state: " << m_state); |
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:
8726
diff
changeset
|
544 |
|
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:
8726
diff
changeset
|
545 |
switch (m_state) |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
546 |
{ |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
547 |
case RX_DATA: |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
548 |
case RX_DL_CTRL: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
549 |
case RX_UL_SRS: |
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:
8726
diff
changeset
|
550 |
NS_FATAL_ERROR ("cannot TX while RX: according to FDD channel acces, the physical layer for transmission cannot be used for reception"); |
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:
8726
diff
changeset
|
551 |
break; |
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:
8726
diff
changeset
|
552 |
|
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
553 |
case TX_DL_CTRL: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
554 |
case TX_DATA: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
555 |
case TX_UL_SRS: |
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:
8726
diff
changeset
|
556 |
NS_FATAL_ERROR ("cannot TX while already TX: the MAC should avoid 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:
8726
diff
changeset
|
557 |
break; |
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:
8726
diff
changeset
|
558 |
|
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:
8726
diff
changeset
|
559 |
case IDLE: |
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:
8726
diff
changeset
|
560 |
{ |
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:
8726
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:
8726
diff
changeset
|
562 |
m_txPsd must be setted by the device, according to |
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:
8726
diff
changeset
|
563 |
(i) the available subchannel for transmission |
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:
8726
diff
changeset
|
564 |
(ii) the power transmission |
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:
8726
diff
changeset
|
565 |
*/ |
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:
8726
diff
changeset
|
566 |
NS_ASSERT (m_txPsd); |
9406 | 567 |
NS_LOG_LOGIC (this << " m_txPsd: " << *m_txPsd); |
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:
8726
diff
changeset
|
568 |
|
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:
8726
diff
changeset
|
569 |
// we need to convey some PHY meta information to the receiver |
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:
8726
diff
changeset
|
570 |
// to be used for simulation purposes (e.g., the CellId). 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:
8726
diff
changeset
|
571 |
// is done by setting the cellId parameter of |
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:
8726
diff
changeset
|
572 |
// LteSpectrumSignalParametersDlCtrlFrame |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
573 |
ChangeState (TX_UL_SRS); |
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:
8726
diff
changeset
|
574 |
NS_ASSERT (m_channel); |
9036 | 575 |
Ptr<LteSpectrumSignalParametersUlSrsFrame> txParams = Create<LteSpectrumSignalParametersUlSrsFrame> (); |
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
576 |
txParams->duration = UL_SRS_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:
8726
diff
changeset
|
577 |
txParams->txPhy = GetObject<SpectrumPhy> (); |
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:
8726
diff
changeset
|
578 |
txParams->txAntenna = m_antenna; |
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:
8726
diff
changeset
|
579 |
txParams->psd = m_txPsd; |
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:
8726
diff
changeset
|
580 |
txParams->cellId = m_cellId; |
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:
8726
diff
changeset
|
581 |
m_channel->StartTx (txParams); |
11269
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
582 |
m_endTxEvent = Simulator::Schedule (UL_SRS_DURATION, &LteSpectrumPhy::EndTxUlSrs, 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:
8726
diff
changeset
|
583 |
} |
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:
8726
diff
changeset
|
584 |
return false; |
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:
8726
diff
changeset
|
585 |
break; |
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:
8726
diff
changeset
|
586 |
|
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:
8726
diff
changeset
|
587 |
default: |
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:
8726
diff
changeset
|
588 |
NS_FATAL_ERROR ("unknown state"); |
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:
8726
diff
changeset
|
589 |
return true; |
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:
8726
diff
changeset
|
590 |
break; |
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:
8726
diff
changeset
|
591 |
} |
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:
8726
diff
changeset
|
592 |
} |
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:
8726
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:
8726
diff
changeset
|
594 |
|
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:
8726
diff
changeset
|
595 |
|
6705 | 596 |
void |
11269
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
597 |
LteSpectrumPhy::EndTxData () |
6705 | 598 |
{ |
599 |
NS_LOG_FUNCTION (this); |
|
7893 | 600 |
NS_LOG_LOGIC (this << " state: " << m_state); |
6705 | 601 |
|
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
602 |
NS_ASSERT (m_state == TX_DATA); |
7961
535d5448b8f1
meaningful trace sources for LteSpectrumPhy
Nicola Baldo <nbaldo@cttc.es>
parents:
7928
diff
changeset
|
603 |
m_phyTxEndTrace (m_txPacketBurst); |
7886 | 604 |
m_txPacketBurst = 0; |
6705 | 605 |
ChangeState (IDLE); |
606 |
} |
|
607 |
||
11269
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
608 |
void |
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
609 |
LteSpectrumPhy::EndTxDlCtrl () |
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
610 |
{ |
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
611 |
NS_LOG_FUNCTION (this); |
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
612 |
NS_LOG_LOGIC (this << " state: " << m_state); |
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
613 |
|
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
614 |
NS_ASSERT (m_state == TX_DL_CTRL); |
11269
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
615 |
NS_ASSERT (m_txPacketBurst == 0); |
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
616 |
ChangeState (IDLE); |
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
617 |
} |
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
618 |
|
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
619 |
void |
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
620 |
LteSpectrumPhy::EndTxUlSrs () |
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
621 |
{ |
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
622 |
NS_LOG_FUNCTION (this); |
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
623 |
NS_LOG_LOGIC (this << " state: " << m_state); |
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
624 |
|
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
625 |
NS_ASSERT (m_state == TX_UL_SRS); |
11269
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
626 |
NS_ASSERT (m_txPacketBurst == 0); |
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
627 |
ChangeState (IDLE); |
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
628 |
} |
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
629 |
|
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
630 |
|
db337450b114
split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs
Nicola Baldo <nbaldo@cttc.es>
parents:
11085
diff
changeset
|
631 |
|
6705 | 632 |
|
633 |
void |
|
7581 | 634 |
LteSpectrumPhy::StartRx (Ptr<SpectrumSignalParameters> spectrumRxParams) |
6705 | 635 |
{ |
7581 | 636 |
NS_LOG_FUNCTION (this << spectrumRxParams); |
7893 | 637 |
NS_LOG_LOGIC (this << " state: " << m_state); |
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:
8726
diff
changeset
|
638 |
|
8339 | 639 |
Ptr <const SpectrumValue> rxPsd = spectrumRxParams->psd; |
640 |
Time duration = spectrumRxParams->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:
8726
diff
changeset
|
641 |
|
7891
382a429bdc69
added PHY synchronization model
Nicola Baldo <nicola@baldo.biz>
parents:
7886
diff
changeset
|
642 |
// the device might start RX only if the signal is of a type |
382a429bdc69
added PHY synchronization model
Nicola Baldo <nicola@baldo.biz>
parents:
7886
diff
changeset
|
643 |
// understood by this device - in this case, an LTE signal. |
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:
8726
diff
changeset
|
644 |
Ptr<LteSpectrumSignalParametersDataFrame> lteDataRxParams = DynamicCast<LteSpectrumSignalParametersDataFrame> (spectrumRxParams); |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
645 |
Ptr<LteSpectrumSignalParametersDlCtrlFrame> lteDlCtrlRxParams = DynamicCast<LteSpectrumSignalParametersDlCtrlFrame> (spectrumRxParams); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
646 |
Ptr<LteSpectrumSignalParametersUlSrsFrame> lteUlSrsRxParams = DynamicCast<LteSpectrumSignalParametersUlSrsFrame> (spectrumRxParams); |
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:
8726
diff
changeset
|
647 |
if (lteDataRxParams != 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:
8726
diff
changeset
|
648 |
{ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8726
diff
changeset
|
649 |
m_interferenceData->AddSignal (rxPsd, duration); |
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:
8726
diff
changeset
|
650 |
StartRxData (lteDataRxParams); |
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:
8726
diff
changeset
|
651 |
} |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
652 |
else if (lteDlCtrlRxParams!=0) |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
653 |
{ |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
654 |
m_interferenceCtrl->AddSignal (rxPsd, duration); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
655 |
StartRxDlCtrl (lteDlCtrlRxParams); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
656 |
} |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
657 |
else if (lteUlSrsRxParams!=0) |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
658 |
{ |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
659 |
m_interferenceCtrl->AddSignal (rxPsd, duration); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
660 |
StartRxUlSrs (lteUlSrsRxParams); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
661 |
} |
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:
8726
diff
changeset
|
662 |
else |
6705 | 663 |
{ |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
664 |
// other type of signal (could be 3G, GSM, whatever) -> interference |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
665 |
m_interferenceData->AddSignal (rxPsd, duration); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
666 |
m_interferenceCtrl->AddSignal (rxPsd, duration); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
667 |
} |
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:
8726
diff
changeset
|
668 |
} |
6705 | 669 |
|
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:
8726
diff
changeset
|
670 |
void |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8726
diff
changeset
|
671 |
LteSpectrumPhy::StartRxData (Ptr<LteSpectrumSignalParametersDataFrame> params) |
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:
8726
diff
changeset
|
672 |
{ |
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:
8726
diff
changeset
|
673 |
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:
8726
diff
changeset
|
674 |
switch (m_state) |
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:
8726
diff
changeset
|
675 |
{ |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
676 |
case TX_DATA: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
677 |
case TX_DL_CTRL: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
678 |
case TX_UL_SRS: |
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:
8726
diff
changeset
|
679 |
NS_FATAL_ERROR ("cannot RX while TX: according to FDD channel access, the physical layer for transmission cannot be used for reception"); |
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:
8726
diff
changeset
|
680 |
break; |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
681 |
case RX_DL_CTRL: |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
682 |
NS_FATAL_ERROR ("cannot RX Data while receiving control"); |
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
683 |
break; |
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:
8726
diff
changeset
|
684 |
case IDLE: |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
685 |
case RX_DATA: |
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:
8726
diff
changeset
|
686 |
// the behavior is similar when |
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:
8726
diff
changeset
|
687 |
// we're IDLE or RX because we can receive more signals |
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:
8726
diff
changeset
|
688 |
// simultaneously (e.g., at the eNB). |
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:
8726
diff
changeset
|
689 |
{ |
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:
8726
diff
changeset
|
690 |
// To check if we're synchronized to this signal, we check |
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:
8726
diff
changeset
|
691 |
// for the CellId which is reported in the |
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:
8726
diff
changeset
|
692 |
// LteSpectrumSignalParametersDataFrame |
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:
8726
diff
changeset
|
693 |
if (params->cellId == m_cellId) |
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:
8726
diff
changeset
|
694 |
{ |
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:
8726
diff
changeset
|
695 |
NS_LOG_LOGIC (this << " synchronized with this signal (cellId=" << params->cellId << ")"); |
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:
8726
diff
changeset
|
696 |
if ((m_rxPacketBurstList.empty ())&&(m_rxControlMessageList.empty ())) |
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:
8726
diff
changeset
|
697 |
{ |
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:
8726
diff
changeset
|
698 |
NS_ASSERT (m_state == IDLE); |
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:
8726
diff
changeset
|
699 |
// first transmission, i.e., we're IDLE and we |
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:
8726
diff
changeset
|
700 |
// start RX |
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:
8726
diff
changeset
|
701 |
m_firstRxStart = Simulator::Now (); |
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:
8726
diff
changeset
|
702 |
m_firstRxDuration = params->duration; |
9053
974762654b12
subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents:
9043
diff
changeset
|
703 |
NS_LOG_LOGIC (this << " scheduling EndRx with delay " << params->duration.GetSeconds () << "s"); |
9579
1f1a0bd0c009
added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9562
diff
changeset
|
704 |
m_endRxDataEvent = Simulator::Schedule (params->duration, &LteSpectrumPhy::EndRxData, 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:
8726
diff
changeset
|
705 |
} |
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:
8726
diff
changeset
|
706 |
else |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8726
diff
changeset
|
707 |
{ |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
708 |
NS_ASSERT (m_state == RX_DATA); |
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:
8726
diff
changeset
|
709 |
// sanity check: if there are multiple RX events, they |
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:
8726
diff
changeset
|
710 |
// should occur at the same time and have the same |
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:
8726
diff
changeset
|
711 |
// duration, otherwise the interference calculation |
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:
8726
diff
changeset
|
712 |
// won't be correct |
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:
8726
diff
changeset
|
713 |
NS_ASSERT ((m_firstRxStart == Simulator::Now ()) |
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:
8726
diff
changeset
|
714 |
&& (m_firstRxDuration == params->duration)); |
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:
8726
diff
changeset
|
715 |
} |
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:
8726
diff
changeset
|
716 |
|
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
717 |
ChangeState (RX_DATA); |
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:
8726
diff
changeset
|
718 |
if (params->packetBurst) |
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:
8726
diff
changeset
|
719 |
{ |
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:
8726
diff
changeset
|
720 |
m_rxPacketBurstList.push_back (params->packetBurst); |
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:
8726
diff
changeset
|
721 |
m_interferenceData->StartRx (params->psd); |
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:
8726
diff
changeset
|
722 |
|
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:
8726
diff
changeset
|
723 |
m_phyRxStartTrace (params->packetBurst); |
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:
8726
diff
changeset
|
724 |
} |
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:
8726
diff
changeset
|
725 |
NS_LOG_DEBUG (this << " insert msgs " << params->ctrlMsgList.size ()); |
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:
8726
diff
changeset
|
726 |
m_rxControlMessageList.insert (m_rxControlMessageList.end (), params->ctrlMsgList.begin (), params->ctrlMsgList.end ()); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8726
diff
changeset
|
727 |
|
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:
8726
diff
changeset
|
728 |
NS_LOG_LOGIC (this << " numSimultaneousRxEvents = " << m_rxPacketBurstList.size ()); |
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:
8726
diff
changeset
|
729 |
} |
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:
8726
diff
changeset
|
730 |
else |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8726
diff
changeset
|
731 |
{ |
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:
8726
diff
changeset
|
732 |
NS_LOG_LOGIC (this << " not in sync with this signal (cellId=" |
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:
8726
diff
changeset
|
733 |
<< params->cellId << ", m_cellId=" << m_cellId << ")"); |
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:
8726
diff
changeset
|
734 |
} |
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:
8726
diff
changeset
|
735 |
} |
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:
8726
diff
changeset
|
736 |
break; |
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:
8726
diff
changeset
|
737 |
|
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:
8726
diff
changeset
|
738 |
default: |
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:
8726
diff
changeset
|
739 |
NS_FATAL_ERROR ("unknown state"); |
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:
8726
diff
changeset
|
740 |
break; |
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:
8726
diff
changeset
|
741 |
} |
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:
8726
diff
changeset
|
742 |
|
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:
8726
diff
changeset
|
743 |
NS_LOG_LOGIC (this << " state: " << m_state); |
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:
8726
diff
changeset
|
744 |
} |
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:
8726
diff
changeset
|
745 |
|
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:
8726
diff
changeset
|
746 |
|
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:
8726
diff
changeset
|
747 |
|
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:
8726
diff
changeset
|
748 |
void |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
749 |
LteSpectrumPhy::StartRxDlCtrl (Ptr<LteSpectrumSignalParametersDlCtrlFrame> lteDlCtrlRxParams) |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
750 |
{ |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
751 |
NS_LOG_FUNCTION (this); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
752 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
753 |
// To check if we're synchronized to this signal, we check |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
754 |
// for the CellId which is reported in the |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
755 |
// LteSpectrumSignalParametersDlCtrlFrame |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
756 |
uint16_t cellId; |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
757 |
NS_ASSERT (lteDlCtrlRxParams != 0); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
758 |
cellId = lteDlCtrlRxParams->cellId; |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
759 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
760 |
switch (m_state) |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
761 |
{ |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
762 |
case TX_DATA: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
763 |
case TX_DL_CTRL: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
764 |
case TX_UL_SRS: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
765 |
case RX_DATA: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
766 |
case RX_UL_SRS: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
767 |
NS_FATAL_ERROR ("unexpected event in state " << m_state); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
768 |
break; |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
769 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
770 |
case RX_DL_CTRL: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
771 |
case IDLE: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
772 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
773 |
// common code for the two states |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
774 |
// check presence of PSS for UE measuerements |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
775 |
if (lteDlCtrlRxParams->pss == true) |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
776 |
{ |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
777 |
if (!m_ltePhyRxPssCallback.IsNull ()) |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
778 |
{ |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
779 |
m_ltePhyRxPssCallback (cellId, lteDlCtrlRxParams->psd); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
780 |
} |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
781 |
} |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
782 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
783 |
// differentiated code for the two states |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
784 |
switch (m_state) |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
785 |
{ |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
786 |
case RX_DL_CTRL: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
787 |
NS_ASSERT_MSG (m_cellId != cellId, "any other DlCtrl should be from a different cell"); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
788 |
NS_LOG_LOGIC (this << " ignoring other DlCtrl (cellId=" |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
789 |
<< cellId << ", m_cellId=" << m_cellId << ")"); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
790 |
break; |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
791 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
792 |
case IDLE: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
793 |
if (cellId == m_cellId) |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
794 |
{ |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
795 |
NS_LOG_LOGIC (this << " synchronized with this signal (cellId=" << cellId << ")"); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
796 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
797 |
NS_ASSERT (m_rxControlMessageList.empty ()); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
798 |
m_firstRxStart = Simulator::Now (); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
799 |
m_firstRxDuration = lteDlCtrlRxParams->duration; |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
800 |
NS_LOG_LOGIC (this << " scheduling EndRx with delay " << lteDlCtrlRxParams->duration); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
801 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
802 |
// store the DCIs |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
803 |
m_rxControlMessageList = lteDlCtrlRxParams->ctrlMsgList; |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
804 |
m_endRxDlCtrlEvent = Simulator::Schedule (lteDlCtrlRxParams->duration, &LteSpectrumPhy::EndRxDlCtrl, this); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
805 |
ChangeState (RX_DL_CTRL); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
806 |
m_interferenceCtrl->StartRx (lteDlCtrlRxParams->psd); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
807 |
} |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
808 |
else |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
809 |
{ |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
810 |
NS_LOG_LOGIC (this << " not synchronizing with this signal (cellId=" |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
811 |
<< cellId << ", m_cellId=" << m_cellId << ")"); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
812 |
} |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
813 |
break; |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
814 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
815 |
default: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
816 |
NS_FATAL_ERROR ("unexpected event in state " << m_state); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
817 |
break; |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
818 |
} |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
819 |
break; // case RX_DL_CTRL or IDLE |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
820 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
821 |
default: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
822 |
NS_FATAL_ERROR ("unknown state"); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
823 |
break; |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
824 |
} |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
825 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
826 |
NS_LOG_LOGIC (this << " state: " << m_state); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
827 |
} |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
828 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
829 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
830 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
831 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
832 |
void |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
833 |
LteSpectrumPhy::StartRxUlSrs (Ptr<LteSpectrumSignalParametersUlSrsFrame> lteUlSrsRxParams) |
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:
8726
diff
changeset
|
834 |
{ |
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:
8726
diff
changeset
|
835 |
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:
8726
diff
changeset
|
836 |
switch (m_state) |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
837 |
{ |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
838 |
case TX_DATA: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
839 |
case TX_DL_CTRL: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
840 |
case TX_UL_SRS: |
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:
8726
diff
changeset
|
841 |
NS_FATAL_ERROR ("cannot RX while TX: according to FDD channel access, the physical layer for transmission cannot be used for reception"); |
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:
8726
diff
changeset
|
842 |
break; |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
843 |
|
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
844 |
case RX_DATA: |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
845 |
case RX_DL_CTRL: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
846 |
NS_FATAL_ERROR ("cannot RX SRS while receiving something else"); |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
847 |
break; |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
848 |
|
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:
8726
diff
changeset
|
849 |
case IDLE: |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
850 |
case RX_UL_SRS: |
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:
8726
diff
changeset
|
851 |
// the behavior is similar when |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
852 |
// we're IDLE or RX_UL_SRS because we can receive more signals |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
853 |
// simultaneously at the eNB |
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:
8726
diff
changeset
|
854 |
{ |
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:
8726
diff
changeset
|
855 |
// To check if we're synchronized to this signal, we check |
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:
8726
diff
changeset
|
856 |
// for the CellId which is reported in the |
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:
8726
diff
changeset
|
857 |
// LteSpectrumSignalParametersDlCtrlFrame |
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:
8726
diff
changeset
|
858 |
uint16_t cellId; |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
859 |
cellId = lteUlSrsRxParams->cellId; |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
860 |
if (cellId == m_cellId) |
7893 | 861 |
{ |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
862 |
NS_LOG_LOGIC (this << " synchronized with this signal (cellId=" << cellId << ")"); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
863 |
if (m_state == IDLE) |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
864 |
{ |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
865 |
// first transmission, i.e., we're IDLE and we |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
866 |
// start RX |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
867 |
NS_ASSERT (m_rxControlMessageList.empty ()); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
868 |
m_firstRxStart = Simulator::Now (); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
869 |
m_firstRxDuration = lteUlSrsRxParams->duration; |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
870 |
NS_LOG_LOGIC (this << " scheduling EndRx with delay " << lteUlSrsRxParams->duration); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
871 |
|
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
872 |
m_endRxUlSrsEvent = Simulator::Schedule (lteUlSrsRxParams->duration, &LteSpectrumPhy::EndRxUlSrs, this); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
873 |
} |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
874 |
else if (m_state == RX_UL_SRS) |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
875 |
{ |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
876 |
// sanity check: if there are multiple RX events, they |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
877 |
// should occur at the same time and have the same |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
878 |
// duration, otherwise the interference calculation |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
879 |
// won't be correct |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
880 |
NS_ASSERT ((m_firstRxStart == Simulator::Now ()) |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
881 |
&& (m_firstRxDuration == lteUlSrsRxParams->duration)); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
882 |
} |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
883 |
ChangeState (RX_UL_SRS); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
884 |
m_interferenceCtrl->StartRx (lteUlSrsRxParams->psd); |
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:
8726
diff
changeset
|
885 |
} |
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:
8726
diff
changeset
|
886 |
else |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8726
diff
changeset
|
887 |
{ |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
888 |
NS_LOG_LOGIC (this << " not in sync with this signal (cellId=" |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
889 |
<< cellId << ", m_cellId=" << 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:
8726
diff
changeset
|
890 |
} |
10292
d8c887780c32
Reverted changes from parent revision 9974
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10287
diff
changeset
|
891 |
} |
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:
8726
diff
changeset
|
892 |
break; |
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:
8726
diff
changeset
|
893 |
|
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
894 |
default: |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
895 |
NS_FATAL_ERROR ("unknown state"); |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
896 |
break; |
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
897 |
} |
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:
8726
diff
changeset
|
898 |
|
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:
8726
diff
changeset
|
899 |
NS_LOG_LOGIC (this << " state: " << m_state); |
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:
8726
diff
changeset
|
900 |
} |
6705 | 901 |
|
902 |
||
8514
6480a3cc31f2
Add LtePemSinrChunkProcessor and connect it to LteSpectrumPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8512
diff
changeset
|
903 |
void |
6480a3cc31f2
Add LtePemSinrChunkProcessor and connect it to LteSpectrumPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8512
diff
changeset
|
904 |
LteSpectrumPhy::UpdateSinrPerceived (const SpectrumValue& sinr) |
6480a3cc31f2
Add LtePemSinrChunkProcessor and connect it to LteSpectrumPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8512
diff
changeset
|
905 |
{ |
6480a3cc31f2
Add LtePemSinrChunkProcessor and connect it to LteSpectrumPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8512
diff
changeset
|
906 |
NS_LOG_FUNCTION (this << sinr); |
6480a3cc31f2
Add LtePemSinrChunkProcessor and connect it to LteSpectrumPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8512
diff
changeset
|
907 |
m_sinrPerceived = sinr; |
6480a3cc31f2
Add LtePemSinrChunkProcessor and connect it to LteSpectrumPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8512
diff
changeset
|
908 |
} |
6480a3cc31f2
Add LtePemSinrChunkProcessor and connect it to LteSpectrumPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8512
diff
changeset
|
909 |
|
8512
3b33e0855d77
commit debug stuff for merge with ns-3-lena-dev
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8511
diff
changeset
|
910 |
|
3b33e0855d77
commit debug stuff for merge with ns-3-lena-dev
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8511
diff
changeset
|
911 |
void |
9519
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
912 |
LteSpectrumPhy::AddExpectedTb (uint16_t rnti, uint8_t ndi, uint16_t size, uint8_t mcs, std::vector<int> map, uint8_t layer, uint8_t harqId,uint8_t rv, bool downlink) |
8512
3b33e0855d77
commit debug stuff for merge with ns-3-lena-dev
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8511
diff
changeset
|
913 |
{ |
9519
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
914 |
NS_LOG_FUNCTION (this << " rnti: " << rnti << " NDI " << (uint16_t)ndi << " size " << size << " mcs " << (uint16_t)mcs << " layer " << (uint16_t)layer << " rv " << (uint16_t)rv); |
8718
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
915 |
TbId_t tbId; |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
916 |
tbId.m_rnti = rnti; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
917 |
tbId.m_layer = layer; |
8512
3b33e0855d77
commit debug stuff for merge with ns-3-lena-dev
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8511
diff
changeset
|
918 |
expectedTbs_t::iterator it; |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
919 |
it = m_expectedTbs.find (tbId); |
8521
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
920 |
if (it != m_expectedTbs.end ()) |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
921 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
922 |
// migth be a TB of an unreceived packet (due to high progpalosses) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
923 |
m_expectedTbs.erase (it); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
924 |
} |
8521
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
925 |
// insert new entry |
9587
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
926 |
tbInfo_t tbInfo = {ndi, size, mcs, map, harqId, rv, 0.0, downlink, false, false}; |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
927 |
m_expectedTbs.insert (std::pair<TbId_t, tbInfo_t> (tbId,tbInfo)); |
8512
3b33e0855d77
commit debug stuff for merge with ns-3-lena-dev
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8511
diff
changeset
|
928 |
} |
3b33e0855d77
commit debug stuff for merge with ns-3-lena-dev
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8511
diff
changeset
|
929 |
|
3b33e0855d77
commit debug stuff for merge with ns-3-lena-dev
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8511
diff
changeset
|
930 |
|
6705 | 931 |
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:
8726
diff
changeset
|
932 |
LteSpectrumPhy::EndRxData () |
6705 | 933 |
{ |
934 |
NS_LOG_FUNCTION (this); |
|
7893 | 935 |
NS_LOG_LOGIC (this << " state: " << m_state); |
6705 | 936 |
|
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
937 |
NS_ASSERT (m_state == RX_DATA); |
6705 | 938 |
|
7886 | 939 |
// this will trigger CQI calculation and Error Model evaluation |
7961
535d5448b8f1
meaningful trace sources for LteSpectrumPhy
Nicola Baldo <nbaldo@cttc.es>
parents:
7928
diff
changeset
|
940 |
// as a side effect, the error model should update the error status of all TBs |
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:
8726
diff
changeset
|
941 |
m_interferenceData->EndRx (); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
942 |
NS_LOG_DEBUG (this << " No. of burts " << m_rxPacketBurstList.size ()); |
8511
46046bbb2a5c
Add info in LteSpectrumPhy on TB from DCI elaborated by LteEnbPhy and LteUePhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8339
diff
changeset
|
943 |
NS_LOG_DEBUG (this << " Expected TBs " << m_expectedTbs.size ()); |
46046bbb2a5c
Add info in LteSpectrumPhy on TB from DCI elaborated by LteEnbPhy and LteUePhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8339
diff
changeset
|
944 |
expectedTbs_t::iterator itTb = m_expectedTbs.begin (); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
945 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
946 |
// apply transmission mode gain |
8724
b92bff65c4fd
Udate default values of txMode gain to 1.0 (linear of 0 dB)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8718
diff
changeset
|
947 |
NS_LOG_DEBUG (this << " txMode " << (uint16_t)m_transmissionMode << " gain " << m_txModeGain.at (m_transmissionMode)); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
948 |
NS_ASSERT (m_transmissionMode < m_txModeGain.size ()); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
949 |
m_sinrPerceived *= m_txModeGain.at (m_transmissionMode); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
950 |
|
8511
46046bbb2a5c
Add info in LteSpectrumPhy on TB from DCI elaborated by LteEnbPhy and LteUePhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8339
diff
changeset
|
951 |
while (itTb!=m_expectedTbs.end ()) |
46046bbb2a5c
Add info in LteSpectrumPhy on TB from DCI elaborated by LteEnbPhy and LteUePhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8339
diff
changeset
|
952 |
{ |
9202
e3645afbe360
Bug-fix inhibit Error Model when receiving data frame with only control messages in LteSpectrumPhy::EndRxData
mmiozzo
parents:
9063
diff
changeset
|
953 |
if ((m_dataErrorModelEnabled)&&(m_rxPacketBurstList.size ()>0)) // avoid to check for errors when there is no actual data transmitted |
8534
8187224a4598
Add LteSpectrumPhy::PemEnabled atribute for enable/disable the phy error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8521
diff
changeset
|
954 |
{ |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
955 |
// retrieve HARQ info |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
956 |
HarqProcessInfoList_t harqInfoList; |
9353
41d2e7b4ff68
Update LteMiErrorModel with BLER curves for HARQ retx ( MCS0 rv2 and rv3 still lacks)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9351
diff
changeset
|
957 |
if ((*itTb).second.ndi == 0) |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
958 |
{ |
9353
41d2e7b4ff68
Update LteMiErrorModel with BLER curves for HARQ retx ( MCS0 rv2 and rv3 still lacks)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9351
diff
changeset
|
959 |
// TB retxed: retrieve HARQ history |
41d2e7b4ff68
Update LteMiErrorModel with BLER curves for HARQ retx ( MCS0 rv2 and rv3 still lacks)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9351
diff
changeset
|
960 |
uint16_t ulHarqId = 0; |
41d2e7b4ff68
Update LteMiErrorModel with BLER curves for HARQ retx ( MCS0 rv2 and rv3 still lacks)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9351
diff
changeset
|
961 |
if ((*itTb).second.downlink) |
41d2e7b4ff68
Update LteMiErrorModel with BLER curves for HARQ retx ( MCS0 rv2 and rv3 still lacks)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9351
diff
changeset
|
962 |
{ |
41d2e7b4ff68
Update LteMiErrorModel with BLER curves for HARQ retx ( MCS0 rv2 and rv3 still lacks)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9351
diff
changeset
|
963 |
harqInfoList = m_harqPhyModule->GetHarqProcessInfoDl ((*itTb).second.harqProcessId, (*itTb).first.m_layer); |
41d2e7b4ff68
Update LteMiErrorModel with BLER curves for HARQ retx ( MCS0 rv2 and rv3 still lacks)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9351
diff
changeset
|
964 |
} |
41d2e7b4ff68
Update LteMiErrorModel with BLER curves for HARQ retx ( MCS0 rv2 and rv3 still lacks)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9351
diff
changeset
|
965 |
else |
41d2e7b4ff68
Update LteMiErrorModel with BLER curves for HARQ retx ( MCS0 rv2 and rv3 still lacks)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9351
diff
changeset
|
966 |
{ |
41d2e7b4ff68
Update LteMiErrorModel with BLER curves for HARQ retx ( MCS0 rv2 and rv3 still lacks)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9351
diff
changeset
|
967 |
harqInfoList = m_harqPhyModule->GetHarqProcessInfoUl ((*itTb).first.m_rnti, ulHarqId); |
41d2e7b4ff68
Update LteMiErrorModel with BLER curves for HARQ retx ( MCS0 rv2 and rv3 still lacks)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9351
diff
changeset
|
968 |
} |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
969 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
970 |
TbStats_t tbStats = LteMiErrorModel::GetTbDecodificationStats (m_sinrPerceived, (*itTb).second.rbBitmap, (*itTb).second.size, (*itTb).second.mcs, harqInfoList); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
971 |
(*itTb).second.mi = tbStats.mi; |
9353
41d2e7b4ff68
Update LteMiErrorModel with BLER curves for HARQ retx ( MCS0 rv2 and rv3 still lacks)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9351
diff
changeset
|
972 |
(*itTb).second.corrupt = m_random->GetValue () > tbStats.tbler ? false : true; |
41d2e7b4ff68
Update LteMiErrorModel with BLER curves for HARQ retx ( MCS0 rv2 and rv3 still lacks)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9351
diff
changeset
|
973 |
NS_LOG_DEBUG (this << "RNTI " << (*itTb).first.m_rnti << " size " << (*itTb).second.size << " mcs " << (uint32_t)(*itTb).second.mcs << " bitmap " << (*itTb).second.rbBitmap.size () << " layer " << (uint16_t)(*itTb).first.m_layer << " TBLER " << tbStats.tbler << " corrupted " << (*itTb).second.corrupt); |
9519
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
974 |
// fire traces on DL/UL reception PHY stats |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
975 |
PhyReceptionStatParameters params; |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
976 |
params.m_timestamp = Simulator::Now ().GetMilliSeconds (); |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
977 |
params.m_cellId = m_cellId; |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
978 |
params.m_imsi = 0; // it will be set by DlPhyTransmissionCallback in LteHelper |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
979 |
params.m_rnti = (*itTb).first.m_rnti; |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
980 |
params.m_txMode = m_transmissionMode; |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
981 |
params.m_layer = (*itTb).first.m_layer; |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
982 |
params.m_mcs = (*itTb).second.mcs; |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
983 |
params.m_size = (*itTb).second.size; |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
984 |
params.m_rv = (*itTb).second.rv; |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
985 |
params.m_ndi = (*itTb).second.ndi; |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
986 |
params.m_correctness = (uint8_t)!(*itTb).second.corrupt; |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
987 |
if ((*itTb).second.downlink) |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
988 |
{ |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
989 |
// DL |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
990 |
m_dlPhyReception (params); |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
991 |
} |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
992 |
else |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
993 |
{ |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
994 |
// UL |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
995 |
params.m_rv = harqInfoList.size (); |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
996 |
m_ulPhyReception (params); |
fc6e45584ef4
Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
997 |
} |
8534
8187224a4598
Add LteSpectrumPhy::PemEnabled atribute for enable/disable the phy error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8521
diff
changeset
|
998 |
} |
8521
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
999 |
|
8511
46046bbb2a5c
Add info in LteSpectrumPhy on TB from DCI elaborated by LteEnbPhy and LteUePhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8339
diff
changeset
|
1000 |
itTb++; |
46046bbb2a5c
Add info in LteSpectrumPhy on TB from DCI elaborated by LteEnbPhy and LteUePhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8339
diff
changeset
|
1001 |
} |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1002 |
std::map <uint16_t, DlInfoListElement_s> harqDlInfoMap; |
8521
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1003 |
for (std::list<Ptr<PacketBurst> >::const_iterator i = m_rxPacketBurstList.begin (); |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1004 |
i != m_rxPacketBurstList.end (); ++i) |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1005 |
{ |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1006 |
for (std::list<Ptr<Packet> >::const_iterator j = (*i)->Begin (); j != (*i)->End (); ++j) |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1007 |
{ |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1008 |
// retrieve TB info of this packet |
8538 | 1009 |
LteRadioBearerTag tag; |
1010 |
(*j)->PeekPacketTag (tag); |
|
8718
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
1011 |
TbId_t tbId; |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1012 |
tbId.m_rnti = tag.GetRnti (); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1013 |
tbId.m_layer = tag.GetLayer (); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1014 |
itTb = m_expectedTbs.find (tbId); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1015 |
NS_LOG_INFO (this << " Packet of " << tbId.m_rnti << " layer " << (uint16_t) tag.GetLayer ()); |
8521
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1016 |
if (itTb!=m_expectedTbs.end ()) |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1017 |
{ |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1018 |
if (!(*itTb).second.corrupt) |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1019 |
{ |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1020 |
m_phyRxEndOkTrace (*j); |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1021 |
|
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:
8726
diff
changeset
|
1022 |
if (!m_ltePhyRxDataEndOkCallback.IsNull ()) |
8521
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1023 |
{ |
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:
8726
diff
changeset
|
1024 |
m_ltePhyRxDataEndOkCallback (*j); |
8521
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1025 |
} |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1026 |
} |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1027 |
else |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1028 |
{ |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1029 |
// TB received with errors |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1030 |
m_phyRxEndErrorTrace (*j); |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1031 |
} |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1032 |
|
9587
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1033 |
// send HARQ feedback (if not already done for this TB) |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1034 |
if (!(*itTb).second.harqFeedbackSent) |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1035 |
{ |
9587
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1036 |
(*itTb).second.harqFeedbackSent = true; |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1037 |
if (!(*itTb).second.downlink) |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1038 |
{ |
9587
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1039 |
UlInfoListElement_s harqUlInfo; |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1040 |
harqUlInfo.m_rnti = tbId.m_rnti; |
9617
9e8cc31936f8
fix compilation warnings in optimized mode
Nicola Baldo <nbaldo@cttc.es>
parents:
9588
diff
changeset
|
1041 |
harqUlInfo.m_tpc = 0; |
9587
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1042 |
if ((*itTb).second.corrupt) |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1043 |
{ |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1044 |
harqUlInfo.m_receptionStatus = UlInfoListElement_s::NotOk; |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1045 |
NS_LOG_DEBUG (this << " RNTI " << tbId.m_rnti << " send UL-HARQ-NACK"); |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1046 |
m_harqPhyModule->UpdateUlHarqProcessStatus (tbId.m_rnti, (*itTb).second.mi, (*itTb).second.size, (*itTb).second.size / EffectiveCodingRate [(*itTb).second.mcs]); |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1047 |
} |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1048 |
else |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1049 |
{ |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1050 |
harqUlInfo.m_receptionStatus = UlInfoListElement_s::Ok; |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1051 |
NS_LOG_DEBUG (this << " RNTI " << tbId.m_rnti << " send UL-HARQ-ACK"); |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1052 |
m_harqPhyModule->ResetUlHarqProcessStatus (tbId.m_rnti, (*itTb).second.harqProcessId); |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1053 |
} |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1054 |
if (!m_ltePhyUlHarqFeedbackCallback.IsNull ()) |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1055 |
{ |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1056 |
m_ltePhyUlHarqFeedbackCallback (harqUlInfo); |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1057 |
} |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1058 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1059 |
else |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1060 |
{ |
9587
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1061 |
std::map <uint16_t, DlInfoListElement_s>::iterator itHarq = harqDlInfoMap.find (tbId.m_rnti); |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1062 |
if (itHarq==harqDlInfoMap.end ()) |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1063 |
{ |
9587
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1064 |
DlInfoListElement_s harqDlInfo; |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1065 |
harqDlInfo.m_harqStatus.resize (m_layersNum, DlInfoListElement_s::NACK); |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1066 |
harqDlInfo.m_rnti = tbId.m_rnti; |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1067 |
harqDlInfo.m_harqProcessId = (*itTb).second.harqProcessId; |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1068 |
if ((*itTb).second.corrupt) |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1069 |
{ |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1070 |
harqDlInfo.m_harqStatus.at (tbId.m_layer) = DlInfoListElement_s::NACK; |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1071 |
NS_LOG_DEBUG (this << " RNTI " << tbId.m_rnti << " harqId " << (uint16_t)(*itTb).second.harqProcessId << " layer " <<(uint16_t)tbId.m_layer << " send DL-HARQ-NACK"); |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1072 |
m_harqPhyModule->UpdateDlHarqProcessStatus ((*itTb).second.harqProcessId, tbId.m_layer, (*itTb).second.mi, (*itTb).second.size, (*itTb).second.size / EffectiveCodingRate [(*itTb).second.mcs]); |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1073 |
} |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1074 |
else |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1075 |
{ |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1076 |
|
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1077 |
harqDlInfo.m_harqStatus.at (tbId.m_layer) = DlInfoListElement_s::ACK; |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1078 |
NS_LOG_DEBUG (this << " RNTI " << tbId.m_rnti << " harqId " << (uint16_t)(*itTb).second.harqProcessId << " layer " <<(uint16_t)tbId.m_layer << " size " << (*itTb).second.size << " send DL-HARQ-ACK"); |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1079 |
m_harqPhyModule->ResetDlHarqProcessStatus ((*itTb).second.harqProcessId); |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1080 |
} |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1081 |
harqDlInfoMap.insert (std::pair <uint16_t, DlInfoListElement_s> (tbId.m_rnti, harqDlInfo)); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1082 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1083 |
else |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1084 |
{ |
9587
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1085 |
if ((*itTb).second.corrupt) |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1086 |
{ |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1087 |
(*itHarq).second.m_harqStatus.at (tbId.m_layer) = DlInfoListElement_s::NACK; |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1088 |
NS_LOG_DEBUG (this << " RNTI " << tbId.m_rnti << " harqId " << (uint16_t)(*itTb).second.harqProcessId << " layer " <<(uint16_t)tbId.m_layer << " size " << (*itHarq).second.m_harqStatus.size () << " send DL-HARQ-NACK"); |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1089 |
m_harqPhyModule->UpdateDlHarqProcessStatus ((*itTb).second.harqProcessId, tbId.m_layer, (*itTb).second.mi, (*itTb).second.size, (*itTb).second.size / EffectiveCodingRate [(*itTb).second.mcs]); |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1090 |
} |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1091 |
else |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1092 |
{ |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1093 |
NS_ASSERT_MSG (tbId.m_layer < (*itHarq).second.m_harqStatus.size (), " layer " << (uint16_t)tbId.m_layer); |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1094 |
(*itHarq).second.m_harqStatus.at (tbId.m_layer) = DlInfoListElement_s::ACK; |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1095 |
NS_LOG_DEBUG (this << " RNTI " << tbId.m_rnti << " harqId " << (uint16_t)(*itTb).second.harqProcessId << " layer " << (uint16_t)tbId.m_layer << " size " << (*itHarq).second.m_harqStatus.size () << " send DL-HARQ-ACK"); |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1096 |
m_harqPhyModule->ResetDlHarqProcessStatus ((*itTb).second.harqProcessId); |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1097 |
} |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1098 |
} |
9587
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1099 |
} // end if ((*itTb).second.downlink) HARQ |
8f669a9d4719
Bug-fix LteSpectrumPhy send HARQ feedback per TB basis
mmiozzo
parents:
9562
diff
changeset
|
1100 |
} // end if (!(*itTb).second.harqFeedbackSent) |
8521
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1101 |
} |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1102 |
} |
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1103 |
} |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1104 |
|
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1105 |
// send DL HARQ feedback to LtePhy |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1106 |
std::map <uint16_t, DlInfoListElement_s>::iterator itHarq; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1107 |
for (itHarq = harqDlInfoMap.begin (); itHarq != harqDlInfoMap.end (); itHarq++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1108 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1109 |
if (!m_ltePhyDlHarqFeedbackCallback.IsNull ()) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1110 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1111 |
m_ltePhyDlHarqFeedbackCallback ((*itHarq).second); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1112 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1113 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1114 |
// forward control messages of this frame to LtePhy |
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:
8726
diff
changeset
|
1115 |
if (!m_rxControlMessageList.empty ()) |
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:
8726
diff
changeset
|
1116 |
{ |
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:
8726
diff
changeset
|
1117 |
if (!m_ltePhyRxCtrlEndOkCallback.IsNull ()) |
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:
8726
diff
changeset
|
1118 |
{ |
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:
8726
diff
changeset
|
1119 |
m_ltePhyRxCtrlEndOkCallback (m_rxControlMessageList); |
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:
8726
diff
changeset
|
1120 |
} |
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:
8726
diff
changeset
|
1121 |
} |
6705 | 1122 |
ChangeState (IDLE); |
7927
c8d380a263ec
fixed uplink RX and interference calculation
Nicola Baldo <nbaldo@cttc.es>
parents:
7926
diff
changeset
|
1123 |
m_rxPacketBurstList.clear (); |
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:
8726
diff
changeset
|
1124 |
m_rxControlMessageList.clear (); |
8521
05b373fc3061
Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8514
diff
changeset
|
1125 |
m_expectedTbs.clear (); |
6705 | 1126 |
} |
1127 |
||
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:
8726
diff
changeset
|
1128 |
|
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:
8726
diff
changeset
|
1129 |
void |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8726
diff
changeset
|
1130 |
LteSpectrumPhy::EndRxDlCtrl () |
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:
8726
diff
changeset
|
1131 |
{ |
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:
8726
diff
changeset
|
1132 |
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:
8726
diff
changeset
|
1133 |
NS_LOG_LOGIC (this << " state: " << m_state); |
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:
8726
diff
changeset
|
1134 |
|
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
1135 |
NS_ASSERT (m_state == RX_DL_CTRL); |
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:
8726
diff
changeset
|
1136 |
|
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:
8726
diff
changeset
|
1137 |
// this will trigger CQI calculation and Error Model evaluation |
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:
8726
diff
changeset
|
1138 |
// as a side effect, the error model should update the error status of all TBs |
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:
8726
diff
changeset
|
1139 |
m_interferenceCtrl->EndRx (); |
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:
8726
diff
changeset
|
1140 |
// apply transmission mode gain |
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:
8726
diff
changeset
|
1141 |
NS_LOG_DEBUG (this << " txMode " << (uint16_t)m_transmissionMode << " gain " << m_txModeGain.at (m_transmissionMode)); |
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:
8726
diff
changeset
|
1142 |
NS_ASSERT (m_transmissionMode < m_txModeGain.size ()); |
9043
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
1143 |
if (m_transmissionMode>0) |
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
1144 |
{ |
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
1145 |
// in case of MIMO, ctrl is always txed as TX diversity |
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
1146 |
m_sinrPerceived *= m_txModeGain.at (1); |
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
1147 |
} |
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
1148 |
// m_sinrPerceived *= m_txModeGain.at (m_transmissionMode); |
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:
8726
diff
changeset
|
1149 |
bool error = false; |
9043
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
1150 |
if (m_ctrlErrorModelEnabled) |
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
1151 |
{ |
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
1152 |
double errorRate = LteMiErrorModel::GetPcfichPdcchError (m_sinrPerceived); |
9057 | 1153 |
error = m_random->GetValue () > errorRate ? false : true; |
9043
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
1154 |
NS_LOG_DEBUG (this << " PCFICH-PDCCH Decodification, errorRate " << errorRate << " error " << error); |
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
1155 |
} |
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9040
diff
changeset
|
1156 |
|
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:
8726
diff
changeset
|
1157 |
if (!error) |
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:
8726
diff
changeset
|
1158 |
{ |
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:
8726
diff
changeset
|
1159 |
if (!m_ltePhyRxCtrlEndOkCallback.IsNull ()) |
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:
8726
diff
changeset
|
1160 |
{ |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1161 |
NS_LOG_DEBUG (this << " PCFICH-PDCCH Rxed OK"); |
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:
8726
diff
changeset
|
1162 |
m_ltePhyRxCtrlEndOkCallback (m_rxControlMessageList); |
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:
8726
diff
changeset
|
1163 |
} |
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:
8726
diff
changeset
|
1164 |
} |
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:
8726
diff
changeset
|
1165 |
else |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8726
diff
changeset
|
1166 |
{ |
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:
8726
diff
changeset
|
1167 |
if (!m_ltePhyRxCtrlEndErrorCallback.IsNull ()) |
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:
8726
diff
changeset
|
1168 |
{ |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1169 |
NS_LOG_DEBUG (this << " PCFICH-PDCCH Error"); |
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:
8726
diff
changeset
|
1170 |
m_ltePhyRxCtrlEndErrorCallback (); |
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:
8726
diff
changeset
|
1171 |
} |
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:
8726
diff
changeset
|
1172 |
} |
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:
8726
diff
changeset
|
1173 |
ChangeState (IDLE); |
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:
8726
diff
changeset
|
1174 |
m_rxControlMessageList.clear (); |
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:
8726
diff
changeset
|
1175 |
} |
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:
8726
diff
changeset
|
1176 |
|
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:
8726
diff
changeset
|
1177 |
void |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8726
diff
changeset
|
1178 |
LteSpectrumPhy::EndRxUlSrs () |
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:
8726
diff
changeset
|
1179 |
{ |
11272
1117aab0eb5c
refactoring of the LteSpectrumPhy state machine
Nicola Baldo <nbaldo@cttc.es>
parents:
11271
diff
changeset
|
1180 |
NS_ASSERT (m_state == RX_UL_SRS); |
9036 | 1181 |
ChangeState (IDLE); |
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:
8726
diff
changeset
|
1182 |
m_interferenceCtrl->EndRx (); |
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:
8726
diff
changeset
|
1183 |
// nothing to do (used only for SRS at this stage) |
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:
8726
diff
changeset
|
1184 |
} |
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:
8726
diff
changeset
|
1185 |
|
7886 | 1186 |
void |
1187 |
LteSpectrumPhy::SetCellId (uint16_t cellId) |
|
1188 |
{ |
|
1189 |
m_cellId = cellId; |
|
1190 |
} |
|
6705 | 1191 |
|
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:
8726
diff
changeset
|
1192 |
|
7886 | 1193 |
void |
10892
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
10680
diff
changeset
|
1194 |
LteSpectrumPhy::AddRsPowerChunkProcessor (Ptr<LteChunkProcessor> p) |
9389
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9368
diff
changeset
|
1195 |
{ |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9368
diff
changeset
|
1196 |
m_interferenceCtrl->AddRsPowerChunkProcessor (p); |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9368
diff
changeset
|
1197 |
} |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9368
diff
changeset
|
1198 |
|
10892
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
10680
diff
changeset
|
1199 |
void |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
10680
diff
changeset
|
1200 |
LteSpectrumPhy::AddDataPowerChunkProcessor (Ptr<LteChunkProcessor> p) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
10680
diff
changeset
|
1201 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
10680
diff
changeset
|
1202 |
m_interferenceData->AddRsPowerChunkProcessor (p); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
10680
diff
changeset
|
1203 |
} |
9389
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9368
diff
changeset
|
1204 |
|
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9368
diff
changeset
|
1205 |
void |
10892
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
10680
diff
changeset
|
1206 |
LteSpectrumPhy::AddDataSinrChunkProcessor (Ptr<LteChunkProcessor> p) |
7886 | 1207 |
{ |
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:
8726
diff
changeset
|
1208 |
m_interferenceData->AddSinrChunkProcessor (p); |
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:
8726
diff
changeset
|
1209 |
} |
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:
8726
diff
changeset
|
1210 |
|
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:
8726
diff
changeset
|
1211 |
void |
10892
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
10680
diff
changeset
|
1212 |
LteSpectrumPhy::AddInterferenceCtrlChunkProcessor (Ptr<LteChunkProcessor> p) |
9983
0091ab7a897c
Add RSRP-RSRQ UE measurement and correspondent c-phy primitive for reporting them to LteUeRrr
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9617
diff
changeset
|
1213 |
{ |
0091ab7a897c
Add RSRP-RSRQ UE measurement and correspondent c-phy primitive for reporting them to LteUeRrr
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9617
diff
changeset
|
1214 |
m_interferenceCtrl->AddInterferenceChunkProcessor (p); |
0091ab7a897c
Add RSRP-RSRQ UE measurement and correspondent c-phy primitive for reporting them to LteUeRrr
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9617
diff
changeset
|
1215 |
} |
0091ab7a897c
Add RSRP-RSRQ UE measurement and correspondent c-phy primitive for reporting them to LteUeRrr
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9617
diff
changeset
|
1216 |
|
0091ab7a897c
Add RSRP-RSRQ UE measurement and correspondent c-phy primitive for reporting them to LteUeRrr
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9617
diff
changeset
|
1217 |
void |
10892
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
10680
diff
changeset
|
1218 |
LteSpectrumPhy::AddInterferenceDataChunkProcessor (Ptr<LteChunkProcessor> p) |
9357
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9354
diff
changeset
|
1219 |
{ |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9354
diff
changeset
|
1220 |
m_interferenceData->AddInterferenceChunkProcessor (p); |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9354
diff
changeset
|
1221 |
} |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9354
diff
changeset
|
1222 |
|
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9354
diff
changeset
|
1223 |
void |
10892
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
10680
diff
changeset
|
1224 |
LteSpectrumPhy::AddCtrlSinrChunkProcessor (Ptr<LteChunkProcessor> 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:
8726
diff
changeset
|
1225 |
{ |
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:
8726
diff
changeset
|
1226 |
m_interferenceCtrl->AddSinrChunkProcessor (p); |
6705 | 1227 |
} |
1228 |
||
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1229 |
void |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1230 |
LteSpectrumPhy::SetTransmissionMode (uint8_t txMode) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1231 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1232 |
NS_LOG_FUNCTION (this << (uint16_t) txMode); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1233 |
NS_ASSERT_MSG (txMode < m_txModeGain.size (), "TransmissionMode not available: 1.." << m_txModeGain.size ()); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1234 |
m_transmissionMode = txMode; |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9057
diff
changeset
|
1235 |
m_layersNum = TransmissionModesLayers::TxMode2LayerNum (txMode); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1236 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1237 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1238 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1239 |
void |
8718
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
1240 |
LteSpectrumPhy::SetTxModeGain (uint8_t txMode, double gain) |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1241 |
{ |
8724
b92bff65c4fd
Udate default values of txMode gain to 1.0 (linear of 0 dB)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8718
diff
changeset
|
1242 |
NS_LOG_FUNCTION (this << " txmode " << (uint16_t)txMode << " gain " << gain); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1243 |
// convert to linear |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Mileti? <rivanvx@gmail.com>
parents:
9057
diff
changeset
|
1244 |
gain = std::pow (10.0, (gain / 10.0)); |
8718
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
1245 |
if (m_txModeGain.size () < txMode) |
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
1246 |
{ |
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
1247 |
m_txModeGain.resize (txMode); |
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
1248 |
} |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1249 |
std::vector <double> temp; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1250 |
temp = m_txModeGain; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1251 |
m_txModeGain.clear (); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1252 |
for (uint8_t i = 0; i < temp.size (); i++) |
8718
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
1253 |
{ |
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
1254 |
if (i==txMode-1) |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1255 |
{ |
8718
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
1256 |
m_txModeGain.push_back (gain); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1257 |
} |
8718
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
1258 |
else |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1259 |
{ |
8718
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
1260 |
m_txModeGain.push_back (temp.at (i)); |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1261 |
} |
8718
26110c369b1c
Update tbId_t struct to TbId_t (coding style) and group SetTxModeGain methods
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8715
diff
changeset
|
1262 |
} |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1263 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1264 |
|
8987
03b1accee8d1
Replace src/lte usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8726
diff
changeset
|
1265 |
int64_t |
03b1accee8d1
Replace src/lte usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8726
diff
changeset
|
1266 |
LteSpectrumPhy::AssignStreams (int64_t stream) |
03b1accee8d1
Replace src/lte usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8726
diff
changeset
|
1267 |
{ |
03b1accee8d1
Replace src/lte usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8726
diff
changeset
|
1268 |
NS_LOG_FUNCTION (this << stream); |
03b1accee8d1
Replace src/lte usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8726
diff
changeset
|
1269 |
m_random->SetStream (stream); |
03b1accee8d1
Replace src/lte usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8726
diff
changeset
|
1270 |
return 1; |
03b1accee8d1
Replace src/lte usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8726
diff
changeset
|
1271 |
} |
03b1accee8d1
Replace src/lte usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8726
diff
changeset
|
1272 |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8538
diff
changeset
|
1273 |
|
6705 | 1274 |
|
1275 |
} // namespace ns3 |