src/lte/model/lte-ue-phy.cc
author Vedran Miletić <rivanvx@gmail.com>
Fri, 19 Apr 2013 22:39:55 +0200
changeset 9703 681f35b212ff
parent 9688 17f49271f94f
child 9802 5dea58a3b261
child 10063 6b30859ebd37
permissions -rw-r--r--
Rename Start and DoStart methods to Initialize and DoInitialize The goal of this patch is to allows us to differentiate the Start/Stop functionality present in some classes from Initialize/Dispose functionality.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents: 6852
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     2
/*
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     3
 * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     4
 *
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     8
 *
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    12
 * GNU General Public License for more details.
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    13
 *
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    17
 *
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    18
 * Author: Giuseppe Piro  <g.piro@poliba.it>
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    19
 *         Marco Miozzo <marco.miozzo@cttc.es>
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    20
 *         Nicola Baldo <nbaldo@cttc.es>
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    21
 */
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    22
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    23
#include <ns3/object-factory.h>
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    24
#include <ns3/log.h>
9063
32755d0516f4 Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents: 9054
diff changeset
    25
#include <cmath>
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    26
#include <ns3/simulator.h>
7949
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
    27
#include <ns3/double.h>
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    28
#include "lte-ue-phy.h"
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    29
#include "lte-enb-phy.h"
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    30
#include "lte-net-device.h"
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    31
#include "lte-ue-net-device.h"
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    32
#include "lte-enb-net-device.h"
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    33
#include "lte-spectrum-value-helper.h"
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    34
#include "lte-amc.h"
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    35
#include "lte-ue-mac.h"
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    36
#include "ff-mac-common.h"
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    37
#include "lte-sinr-chunk-processor.h"
8729
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
    38
#include <ns3/lte-common.h>
9519
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
    39
#include <ns3/pointer.h>
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    40
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    41
NS_LOG_COMPONENT_DEFINE ("LteUePhy");
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    42
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    43
namespace ns3 {
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    44
9053
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    45
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    46
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    47
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    48
// duration of data portion of UL subframe
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    49
// = TTI - 1 symbol for SRS - 1ns as margin to avoid overlapping simulator events
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    50
// (symbol duration in nanoseconds = TTI / 14 (rounded))
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    51
// in other words, duration of data portion of UL subframe = TTI*(13/14) -1ns
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    52
static const Time UL_DATA_DURATION = NanoSeconds (1e6 - 71429 - 1); 
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    53
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    54
// delay from subframe start to transmission of SRS 
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    55
// = TTI - 1 symbol for SRS 
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    56
static const Time UL_SRS_DELAY_FROM_SUBFRAME_START = NanoSeconds (1e6 - 71429); 
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    57
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    58
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    59
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    60
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    61
////////////////////////////////////////
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    62
// member SAP forwarders
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    63
////////////////////////////////////////
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    64
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    65
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    66
class UeMemberLteUePhySapProvider : public LteUePhySapProvider
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    67
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    68
public:
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    69
  UeMemberLteUePhySapProvider (LteUePhy* phy);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    70
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    71
  // inherited from LtePhySapProvider
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    72
  virtual void SendMacPdu (Ptr<Packet> p);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
    73
  virtual void SendLteControlMessage (Ptr<LteControlMessage> msg);
9460
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
    74
  virtual void SendRachPreamble (uint32_t prachId, uint32_t raRnti);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    75
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    76
private:
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    77
  LteUePhy* m_phy;
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    78
};
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    79
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    80
UeMemberLteUePhySapProvider::UeMemberLteUePhySapProvider (LteUePhy* phy) : m_phy (phy)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    81
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    82
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    83
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    84
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    85
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    86
UeMemberLteUePhySapProvider::SendMacPdu (Ptr<Packet> p)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    87
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    88
  m_phy->DoSendMacPdu (p);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    89
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    90
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    91
void
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
    92
UeMemberLteUePhySapProvider::SendLteControlMessage (Ptr<LteControlMessage> msg)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    93
{
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
    94
  m_phy->DoSendLteControlMessage (msg);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    95
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    96
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
    97
void
9460
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
    98
UeMemberLteUePhySapProvider::SendRachPreamble (uint32_t prachId, uint32_t raRnti)
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
    99
{
9460
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   100
  m_phy->DoSendRachPreamble (prachId, raRnti);
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   101
}
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   102
9053
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   103
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   104
////////////////////////////////////////
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   105
// LteUePhy methods
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   106
////////////////////////////////////////
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   107
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   108
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   109
NS_OBJECT_ENSURE_REGISTERED (LteUePhy);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   110
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   111
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   112
LteUePhy::LteUePhy ()
7980
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7949
diff changeset
   113
{
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7949
diff changeset
   114
  NS_LOG_FUNCTION (this);
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7949
diff changeset
   115
  NS_FATAL_ERROR ("This constructor should not be called");
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7949
diff changeset
   116
}
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7949
diff changeset
   117
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7949
diff changeset
   118
LteUePhy::LteUePhy (Ptr<LteSpectrumPhy> dlPhy, Ptr<LteSpectrumPhy> ulPhy)
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7949
diff changeset
   119
  : LtePhy (dlPhy, ulPhy),
9485
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   120
    m_p10CqiPeriocity (MilliSeconds (1)),  // ideal behavior  
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   121
    m_a30CqiPeriocity (MilliSeconds (1)),  // ideal behavior
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   122
    m_uePhySapUser (0),
9346
00e674a0d567 merge lena-dev and lena-epc
Nicola Baldo <nbaldo@cttc.es>
parents: 9337 9053
diff changeset
   123
    m_ueCphySapUser (0),
9389
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   124
    m_rsReceivedPowerUpdated (false),
9390
d51829659a57 Change RSRQ stats for average SINR ones
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9389
diff changeset
   125
    m_rsrpSinrSampleCounter (0)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   126
{
8522
795ea37db2ff Change LteAmc* to Ptr<LteAmc> in LteUePhy
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8517
diff changeset
   127
  m_amc = CreateObject <LteAmc> ();
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   128
  m_uePhySapProvider = new UeMemberLteUePhySapProvider (this);
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   129
  m_ueCphySapProvider = new MemberLteUeCphySapProvider<LteUePhy> (this);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   130
  m_macChTtiDelay = UL_PUSCH_TTIS_DELAY;
9485
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   131
  
9054
16f693a95855 added assert for correct scheduling of LteUePhy::SubframeIndication
Nicola Baldo <nbaldo@cttc.es>
parents: 9053
diff changeset
   132
  NS_ASSERT_MSG (Simulator::Now ().GetNanoSeconds () == 0,
16f693a95855 added assert for correct scheduling of LteUePhy::SubframeIndication
Nicola Baldo <nbaldo@cttc.es>
parents: 9053
diff changeset
   133
                 "Cannot create UE devices after simulation started");
9053
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   134
  Simulator::ScheduleNow (&LteUePhy::SubframeIndication, this, 1, 1);
9485
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   135
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   136
  DoReset ();
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   137
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   138
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   139
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   140
LteUePhy::~LteUePhy ()
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   141
{
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   142
  m_txModeGain.clear ();
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   143
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   144
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   145
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   146
LteUePhy::DoDispose ()
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   147
{
7913
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7895
diff changeset
   148
  NS_LOG_FUNCTION (this);
7930
ccb40542ae88 fixed memory leak in PHY SAP usage
Nicola Baldo <nbaldo@cttc.es>
parents: 7928
diff changeset
   149
  delete m_uePhySapProvider;
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   150
  delete m_ueCphySapProvider;
7913
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7895
diff changeset
   151
  LtePhy::DoDispose ();
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   152
}
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   153
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   154
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   155
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   156
TypeId
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   157
LteUePhy::GetTypeId (void)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   158
{
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   159
  static TypeId tid = TypeId ("ns3::LteUePhy")
6707
2ac68a0381ca improved module after Tom's review
Giuseppe Piro <g.piro@poliba.it>
parents: 6705
diff changeset
   160
    .SetParent<LtePhy> ()
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   161
    .AddConstructor<LteUePhy> ()
7949
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   162
    .AddAttribute ("TxPower",
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   163
                   "Transmission power in dBm",
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   164
                   DoubleValue (10.0),
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   165
                   MakeDoubleAccessor (&LteUePhy::SetTxPower, 
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   166
                                       &LteUePhy::GetTxPower),
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   167
                   MakeDoubleChecker<double> ())
7981
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   168
    .AddAttribute ("NoiseFigure",
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   169
                   "Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver."
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   170
                   " According to Wikipedia (http://en.wikipedia.org/wiki/Noise_figure), this is "
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   171
                   "\"the difference in decibels (dB) between"
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   172
                   " the noise output of the actual receiver to the noise output of an "
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   173
                   " ideal receiver with the same overall gain and bandwidth when the receivers "
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   174
                   " are connected to sources at the standard noise temperature T0.\" "
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   175
                   "In this model, we consider T0 = 290K.",
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   176
                   DoubleValue (9.0),
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   177
                   MakeDoubleAccessor (&LteUePhy::SetNoiseFigure, 
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   178
                                       &LteUePhy::GetNoiseFigure),
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   179
                   MakeDoubleChecker<double> ())
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   180
    .AddAttribute ("TxMode1Gain",
8737
5ad20527f3f6 JIRA 235 Address typo in lte-ue-phy.cc (dBm instead of dB)
mmiozzo
parents: 8729
diff changeset
   181
                  "Transmission mode 1 gain in dB",
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   182
                  DoubleValue (0.0),
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   183
                   MakeDoubleAccessor (&LteUePhy::SetTxMode1Gain                       ),
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   184
                  MakeDoubleChecker<double> ())
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   185
    .AddAttribute ("TxMode2Gain",
8737
5ad20527f3f6 JIRA 235 Address typo in lte-ue-phy.cc (dBm instead of dB)
mmiozzo
parents: 8729
diff changeset
   186
                    "Transmission mode 2 gain in dB",
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   187
                    DoubleValue (4.2),
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   188
                   MakeDoubleAccessor (&LteUePhy::SetTxMode2Gain                       ),
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   189
                    MakeDoubleChecker<double> ())
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   190
    .AddAttribute ("TxMode3Gain",
8737
5ad20527f3f6 JIRA 235 Address typo in lte-ue-phy.cc (dBm instead of dB)
mmiozzo
parents: 8729
diff changeset
   191
                    "Transmission mode 3 gain in dB",
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   192
                    DoubleValue (-2.8),
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   193
                   MakeDoubleAccessor (&LteUePhy::SetTxMode3Gain                       ),
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   194
                    MakeDoubleChecker<double> ())
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   195
    .AddAttribute ("TxMode4Gain",
8737
5ad20527f3f6 JIRA 235 Address typo in lte-ue-phy.cc (dBm instead of dB)
mmiozzo
parents: 8729
diff changeset
   196
                    "Transmission mode 4 gain in dB",
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   197
                    DoubleValue (0.0),
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   198
                   MakeDoubleAccessor (&LteUePhy::SetTxMode4Gain                       ),
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   199
                    MakeDoubleChecker<double> ())
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   200
    .AddAttribute ("TxMode5Gain",
8737
5ad20527f3f6 JIRA 235 Address typo in lte-ue-phy.cc (dBm instead of dB)
mmiozzo
parents: 8729
diff changeset
   201
                  "Transmission mode 5 gain in dB",
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   202
                  DoubleValue (0.0),
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   203
                   MakeDoubleAccessor (&LteUePhy::SetTxMode5Gain                       ),
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   204
                  MakeDoubleChecker<double> ())
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   205
    .AddAttribute ("TxMode6Gain",
8737
5ad20527f3f6 JIRA 235 Address typo in lte-ue-phy.cc (dBm instead of dB)
mmiozzo
parents: 8729
diff changeset
   206
                    "Transmission mode 6 gain in dB",
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   207
                    DoubleValue (0.0),
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   208
                   MakeDoubleAccessor (&LteUePhy::SetTxMode6Gain                       ),
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   209
                    MakeDoubleChecker<double> ())
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   210
    .AddAttribute ("TxMode7Gain",
8737
5ad20527f3f6 JIRA 235 Address typo in lte-ue-phy.cc (dBm instead of dB)
mmiozzo
parents: 8729
diff changeset
   211
                  "Transmission mode 7 gain in dB",
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   212
                  DoubleValue (0.0),
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   213
                   MakeDoubleAccessor (&LteUePhy::SetTxMode7Gain                       ),
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   214
                  MakeDoubleChecker<double> ())
9390
d51829659a57 Change RSRQ stats for average SINR ones
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9389
diff changeset
   215
    .AddTraceSource ("ReportCurrentCellRsrpSinr",
d51829659a57 Change RSRQ stats for average SINR ones
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9389
diff changeset
   216
                     "RSRP and SINR statistics.",
d51829659a57 Change RSRQ stats for average SINR ones
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9389
diff changeset
   217
                     MakeTraceSourceAccessor (&LteUePhy::m_reportCurrentCellRsrpSinrTrace))
d51829659a57 Change RSRQ stats for average SINR ones
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9389
diff changeset
   218
    .AddAttribute ("RsrpSinrSamplePeriod",
d51829659a57 Change RSRQ stats for average SINR ones
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9389
diff changeset
   219
                   "The sampling period for reporting RSRP-SINR stats (default value 1)",
9357
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   220
                   UintegerValue (1),
9390
d51829659a57 Change RSRQ stats for average SINR ones
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9389
diff changeset
   221
                   MakeUintegerAccessor (&LteUePhy::m_rsrpSinrSamplePeriod),
9357
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   222
                   MakeUintegerChecker<uint16_t> ())
9519
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   223
    .AddTraceSource ("UlPhyTransmission",
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   224
                     "DL transmission PHY layer statistics.",
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   225
                     MakeTraceSourceAccessor (&LteUePhy::m_ulPhyTransmission))
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   226
    .AddAttribute ("DlSpectrumPhy",
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   227
                   "The downlink LteSpectrumPhy associated to this LtePhy",
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   228
                   TypeId::ATTR_GET,
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   229
                   PointerValue (),
9636
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9579
diff changeset
   230
                   MakePointerAccessor (&LteUePhy::GetDlSpectrumPhy),
9519
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   231
                   MakePointerChecker <LteSpectrumPhy> ())
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   232
    .AddAttribute ("UlSpectrumPhy",
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   233
                   "The uplink LteSpectrumPhy associated to this LtePhy",
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   234
                   TypeId::ATTR_GET,
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   235
                   PointerValue (),
9636
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9579
diff changeset
   236
                   MakePointerAccessor (&LteUePhy::GetUlSpectrumPhy),
9519
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   237
                   MakePointerChecker <LteSpectrumPhy> ())
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   238
  ;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   239
  return tid;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   240
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   241
8015
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   242
void
9703
681f35b212ff Rename Start and DoStart methods to Initialize and DoInitialize
Vedran Miletić <rivanvx@gmail.com>
parents: 9688
diff changeset
   243
LteUePhy::DoInitialize ()
8015
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   244
{
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   245
  NS_LOG_FUNCTION (this);
9703
681f35b212ff Rename Start and DoStart methods to Initialize and DoInitialize
Vedran Miletić <rivanvx@gmail.com>
parents: 9688
diff changeset
   246
  LtePhy::DoInitialize ();
8015
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   247
}
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   248
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   249
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   250
LteUePhy::SetLteUePhySapUser (LteUePhySapUser* s)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   251
{
7913
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7895
diff changeset
   252
  NS_LOG_FUNCTION (this);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   253
  m_uePhySapUser = s;
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   254
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   255
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   256
LteUePhySapProvider*
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   257
LteUePhy::GetLteUePhySapProvider ()
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   258
{
7913
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7895
diff changeset
   259
  NS_LOG_FUNCTION (this);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   260
  return (m_uePhySapProvider);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   261
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   262
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   263
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   264
void
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   265
LteUePhy::SetLteUeCphySapUser (LteUeCphySapUser* s)
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   266
{
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   267
  NS_LOG_FUNCTION (this);
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   268
  m_ueCphySapUser = s;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   269
}
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   270
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   271
LteUeCphySapProvider*
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   272
LteUePhy::GetLteUeCphySapProvider ()
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   273
{
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   274
  NS_LOG_FUNCTION (this);
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   275
  return (m_ueCphySapProvider);
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   276
}
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   277
7949
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   278
void
7981
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   279
LteUePhy::SetNoiseFigure (double nf)
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   280
{
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   281
  NS_LOG_FUNCTION (this << nf);
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   282
  m_noiseFigure = nf;
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   283
}
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   284
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   285
double
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   286
LteUePhy::GetNoiseFigure () const
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   287
{
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   288
  NS_LOG_FUNCTION (this);
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   289
  return m_noiseFigure;
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   290
}
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   291
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   292
void
7949
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   293
LteUePhy::SetTxPower (double pow)
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   294
{
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   295
  NS_LOG_FUNCTION (this << pow);
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   296
  m_txPower = pow;
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   297
}
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   298
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   299
double
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   300
LteUePhy::GetTxPower () const
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   301
{
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   302
  NS_LOG_FUNCTION (this);
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   303
  return m_txPower;
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7930
diff changeset
   304
}
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   305
8670
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   306
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   307
uint8_t
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   308
LteUePhy::GetMacChDelay (void) const
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   309
{
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   310
  return (m_macChTtiDelay);
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   311
}
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   312
9636
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9579
diff changeset
   313
Ptr<LteSpectrumPhy>
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9579
diff changeset
   314
LteUePhy::GetDlSpectrumPhy () const
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9579
diff changeset
   315
{
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9579
diff changeset
   316
  return m_downlinkSpectrumPhy;
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9579
diff changeset
   317
}
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9579
diff changeset
   318
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9579
diff changeset
   319
Ptr<LteSpectrumPhy>
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9579
diff changeset
   320
LteUePhy::GetUlSpectrumPhy () const
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9579
diff changeset
   321
{
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9579
diff changeset
   322
  return m_uplinkSpectrumPhy;
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9579
diff changeset
   323
}
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9579
diff changeset
   324
8670
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   325
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   326
LteUePhy::DoSendMacPdu (Ptr<Packet> p)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   327
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   328
  NS_LOG_FUNCTION (this);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   329
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   330
  SetMacPdu (p);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   331
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   332
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   333
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   334
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   335
LteUePhy::PhyPduReceived (Ptr<Packet> p)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   336
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   337
  m_uePhySapUser->ReceivePhyPdu (p);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   338
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   339
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   340
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   341
LteUePhy::SetSubChannelsForTransmission (std::vector <int> mask)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   342
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   343
  NS_LOG_FUNCTION (this);
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   344
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   345
  m_subChannelsForTransmission = mask;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   346
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   347
  Ptr<SpectrumValue> txPsd = CreateTxPowerSpectralDensity ();
7928
b736f63e9bdf removed LtePhy::Get{Up,Down}linkSpectrumPhy methods which are evil
Nicola Baldo <nbaldo@cttc.es>
parents: 7913
diff changeset
   348
  m_uplinkSpectrumPhy->SetTxPowerSpectralDensity (txPsd);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   349
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   350
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   351
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   352
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   353
LteUePhy::SetSubChannelsForReception (std::vector <int> mask)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   354
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   355
  NS_LOG_FUNCTION (this);
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   356
  m_subChannelsForReception = mask;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   357
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   358
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   359
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   360
std::vector <int>
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   361
LteUePhy::GetSubChannelsForTransmission ()
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   362
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   363
  NS_LOG_FUNCTION (this);
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   364
  return m_subChannelsForTransmission;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   365
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   366
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   367
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   368
std::vector <int>
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   369
LteUePhy::GetSubChannelsForReception ()
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   370
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   371
  NS_LOG_FUNCTION (this);
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   372
  return m_subChannelsForReception;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   373
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   374
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   375
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   376
Ptr<SpectrumValue>
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   377
LteUePhy::CreateTxPowerSpectralDensity ()
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   378
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   379
  NS_LOG_FUNCTION (this);
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   380
  LteSpectrumValueHelper psdHelper;
8015
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   381
  Ptr<SpectrumValue> psd = psdHelper.CreateTxPowerSpectralDensity (m_ulEarfcn, m_ulBandwidth, m_txPower, GetSubChannelsForTransmission ());
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   382
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   383
  return psd;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   384
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   385
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   386
void
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   387
LteUePhy::GenerateCtrlCqiReport (const SpectrumValue& sinr)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   388
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   389
  NS_LOG_FUNCTION (this);
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   390
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   391
  if (!(m_dlConfigured && m_ulConfigured))
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   392
    {
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   393
      return;
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   394
    }
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   395
7895
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   396
  // check periodic wideband CQI
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   397
  if (Simulator::Now () > m_p10CqiLast + m_p10CqiPeriocity)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   398
    {
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   399
      Ptr<LteUeNetDevice> thisDevice = GetDevice ()->GetObject<LteUeNetDevice> ();
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   400
      Ptr<DlCqiLteControlMessage> msg = CreateDlCqiFeedbackMessage (sinr);
9642
18322d968b54 Avoid generation of DL-CQI with RNTI = 0 when UEs are not connected
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9636
diff changeset
   401
      if (msg)
18322d968b54 Avoid generation of DL-CQI with RNTI = 0 when UEs are not connected
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9636
diff changeset
   402
        {
18322d968b54 Avoid generation of DL-CQI with RNTI = 0 when UEs are not connected
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9636
diff changeset
   403
          DoSendLteControlMessage (msg);
18322d968b54 Avoid generation of DL-CQI with RNTI = 0 when UEs are not connected
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9636
diff changeset
   404
        }
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   405
      m_p10CqiLast = Simulator::Now ();
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   406
    }
7895
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   407
  // check aperiodic high-layer configured subband CQI
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   408
  if  (Simulator::Now () > m_a30CqiLast + m_a30CqiPeriocity)
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   409
    {
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   410
      Ptr<LteUeNetDevice> thisDevice = GetDevice ()->GetObject<LteUeNetDevice> ();
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   411
      Ptr<DlCqiLteControlMessage> msg = CreateDlCqiFeedbackMessage (sinr);
9642
18322d968b54 Avoid generation of DL-CQI with RNTI = 0 when UEs are not connected
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9636
diff changeset
   412
      if (msg)
18322d968b54 Avoid generation of DL-CQI with RNTI = 0 when UEs are not connected
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9636
diff changeset
   413
        {
18322d968b54 Avoid generation of DL-CQI with RNTI = 0 when UEs are not connected
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9636
diff changeset
   414
          DoSendLteControlMessage (msg);
18322d968b54 Avoid generation of DL-CQI with RNTI = 0 when UEs are not connected
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9636
diff changeset
   415
        }
7895
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   416
      m_a30CqiLast = Simulator::Now ();
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   417
    }
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   418
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   419
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   420
void
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   421
LteUePhy::GenerateDataCqiReport (const SpectrumValue& sinr)
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   422
{
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   423
  // Not used by UE, CQI are based only on RS
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   424
}
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   425
9357
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   426
void
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   427
LteUePhy::ReportInterference (const SpectrumValue& interf)
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   428
{
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   429
  // Currently not used by UE
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   430
}
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   431
9389
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   432
void
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   433
LteUePhy::ReportRsReceivedPower (const SpectrumValue& power)
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   434
{
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   435
  NS_LOG_FUNCTION (this << power);
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   436
  m_rsReceivedPowerUpdated = true;
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   437
  m_rsReceivedPower = power;  
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   438
}
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   439
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   440
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   441
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   442
Ptr<DlCqiLteControlMessage>
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   443
LteUePhy::CreateDlCqiFeedbackMessage (const SpectrumValue& sinr)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   444
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   445
  NS_LOG_FUNCTION (this);
9642
18322d968b54 Avoid generation of DL-CQI with RNTI = 0 when UEs are not connected
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9636
diff changeset
   446
18322d968b54 Avoid generation of DL-CQI with RNTI = 0 when UEs are not connected
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9636
diff changeset
   447
  if (m_rnti == 0)
18322d968b54 Avoid generation of DL-CQI with RNTI = 0 when UEs are not connected
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9636
diff changeset
   448
    {
18322d968b54 Avoid generation of DL-CQI with RNTI = 0 when UEs are not connected
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9636
diff changeset
   449
      // abort method, the UE is still not registered
18322d968b54 Avoid generation of DL-CQI with RNTI = 0 when UEs are not connected
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9636
diff changeset
   450
      return (0);
18322d968b54 Avoid generation of DL-CQI with RNTI = 0 when UEs are not connected
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9636
diff changeset
   451
    }
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   452
  
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   453
  // apply transmission mode gain
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   454
  NS_ASSERT (m_transmissionMode < m_txModeGain.size ());
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   455
  SpectrumValue newSinr = sinr;
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   456
  newSinr *= m_txModeGain.at (m_transmissionMode);
9357
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   457
9390
d51829659a57 Change RSRQ stats for average SINR ones
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9389
diff changeset
   458
  m_rsrpSinrSampleCounter++;
d51829659a57 Change RSRQ stats for average SINR ones
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9389
diff changeset
   459
  if (m_rsrpSinrSampleCounter==m_rsrpSinrSamplePeriod)
9357
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   460
    {
9389
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   461
      NS_ASSERT_MSG (m_rsReceivedPowerUpdated, " RS received power info obsolete");
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   462
      // RSRP evaluated as averaged received power among RBs
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   463
      double sum = 0.0;
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   464
      uint8_t rbNum = 0;
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   465
      Values::const_iterator it;
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   466
      for (it = m_rsReceivedPower.ConstValuesBegin (); it != m_rsReceivedPower.ConstValuesEnd (); it++)
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   467
        {
9686
1bc9e60169cc Bug-fix: missing conversion from PSD to linear power of RS in RSRP PHY traces evaluation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9685
diff changeset
   468
          // convert PSD [W/Hz] to linear power [W] for the single RE
1bc9e60169cc Bug-fix: missing conversion from PSD to linear power of RS in RSRP PHY traces evaluation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9685
diff changeset
   469
          // we consider only one RE for the RS since the channel is
1bc9e60169cc Bug-fix: missing conversion from PSD to linear power of RS in RSRP PHY traces evaluation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9685
diff changeset
   470
          // flat within the same RB
1bc9e60169cc Bug-fix: missing conversion from PSD to linear power of RS in RSRP PHY traces evaluation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9685
diff changeset
   471
          double powerTxW = ((*it) * 180000.0) / 12.0;
1bc9e60169cc Bug-fix: missing conversion from PSD to linear power of RS in RSRP PHY traces evaluation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9685
diff changeset
   472
          sum += powerTxW;
9389
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   473
          rbNum++;
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   474
        }
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   475
      double rsrp = sum / (double)rbNum;
9390
d51829659a57 Change RSRQ stats for average SINR ones
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9389
diff changeset
   476
      // averaged SINR among RBs
9685
e2d696385b5e Bug-fix: initialization missing for evaluating SINR in PHY Traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9642
diff changeset
   477
      sum = 0.0;
e2d696385b5e Bug-fix: initialization missing for evaluating SINR in PHY Traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9642
diff changeset
   478
      rbNum = 0;
9389
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   479
      for (it = sinr.ConstValuesBegin (); it != sinr.ConstValuesEnd (); it++)
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   480
        {
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   481
          sum += (*it);
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   482
          rbNum++;
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   483
        }
9390
d51829659a57 Change RSRQ stats for average SINR ones
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9389
diff changeset
   484
      double avSinr = sum / (double)rbNum;
d51829659a57 Change RSRQ stats for average SINR ones
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9389
diff changeset
   485
      NS_LOG_INFO (this << " cellId " << m_cellId << " rnti " << m_rnti << " RSRP " << rsrp << " SINR " << avSinr);
9389
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   486
 
9390
d51829659a57 Change RSRQ stats for average SINR ones
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9389
diff changeset
   487
      m_reportCurrentCellRsrpSinrTrace (m_cellId, m_rnti, rsrp, avSinr);
d51829659a57 Change RSRQ stats for average SINR ones
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9389
diff changeset
   488
      m_rsrpSinrSampleCounter = 0;
9357
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   489
    }
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   490
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   491
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   492
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   493
  // CREATE DlCqiLteControlMessage
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   494
  Ptr<DlCqiLteControlMessage> msg = Create<DlCqiLteControlMessage> ();
7895
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   495
  CqiListElement_s dlcqi;
8647
f6fad6b36154 Update LteUePhy for generating wideband and subband CQIs with LteAmc::MiErrorModel
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8646
diff changeset
   496
  std::vector<int> cqi;
7895
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   497
  if (Simulator::Now () > m_p10CqiLast + m_p10CqiPeriocity)
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   498
    {
8726
f6f0e2531457 merge with ns-3-lena-pem changeset 8419:e8df5f68c35e (MIMO model)
mmiozzo
parents: 8670 8725
diff changeset
   499
      cqi = m_amc->CreateCqiFeedbacks (newSinr, m_dlBandwidth);
f6f0e2531457 merge with ns-3-lena-pem changeset 8419:e8df5f68c35e (MIMO model)
mmiozzo
parents: 8670 8725
diff changeset
   500
      
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   501
      int nLayer = TransmissionModesLayers::TxMode2LayerNum (m_transmissionMode);
7895
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   502
      int nbSubChannels = cqi.size ();
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   503
      double cqiSum = 0.0;
8019
3f88f08f0e55 LENA-93 DL CQI averaged over active RBs only in UE PHY
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7981
diff changeset
   504
      int activeSubChannels = 0;
7895
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   505
      // average the CQIs of the different RBs
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   506
      for (int i = 0; i < nbSubChannels; i++)
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   507
        {
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   508
          if (cqi.at (i) != -1)
8019
3f88f08f0e55 LENA-93 DL CQI averaged over active RBs only in UE PHY
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7981
diff changeset
   509
            {
3f88f08f0e55 LENA-93 DL CQI averaged over active RBs only in UE PHY
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7981
diff changeset
   510
              cqiSum += cqi.at (i);
3f88f08f0e55 LENA-93 DL CQI averaged over active RBs only in UE PHY
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7981
diff changeset
   511
              activeSubChannels++;
3f88f08f0e55 LENA-93 DL CQI averaged over active RBs only in UE PHY
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7981
diff changeset
   512
            }
8042
874d9e7e652b LteUePhy::CreateDlCqiFeedbackMessage fix bug on computation of CQI (no control on activeSubChannels!=0)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8022
diff changeset
   513
          NS_LOG_DEBUG (this << " subch " << i << " cqi " <<  cqi.at (i));
7895
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   514
        }
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   515
      dlcqi.m_rnti = m_rnti;
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   516
      dlcqi.m_ri = 1; // not yet used
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   517
      dlcqi.m_cqiType = CqiListElement_s::P10; // Peridic CQI using PUCCH wideband
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   518
      NS_ASSERT_MSG (nLayer > 0, " nLayer negative");
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   519
      NS_ASSERT_MSG (nLayer < 3, " nLayer limit is 2s");
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   520
      for (int i = 0; i < nLayer; i++)
8042
874d9e7e652b LteUePhy::CreateDlCqiFeedbackMessage fix bug on computation of CQI (no control on activeSubChannels!=0)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8022
diff changeset
   521
        {
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   522
          if (activeSubChannels > 0)
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   523
            {
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   524
              dlcqi.m_wbCqi.push_back ((uint16_t) cqiSum / activeSubChannels);
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   525
            }
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   526
          else
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   527
            {
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   528
              // approximate with the worst case -> CQI = 1
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   529
              dlcqi.m_wbCqi.push_back (1);
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   530
            }
8042
874d9e7e652b LteUePhy::CreateDlCqiFeedbackMessage fix bug on computation of CQI (no control on activeSubChannels!=0)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8022
diff changeset
   531
        }
8019
3f88f08f0e55 LENA-93 DL CQI averaged over active RBs only in UE PHY
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7981
diff changeset
   532
      //NS_LOG_DEBUG (this << " Generate P10 CQI feedback " << (uint16_t) cqiSum / activeSubChannels);
7895
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   533
      dlcqi.m_wbPmi = 0; // not yet used
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   534
      // dl.cqi.m_sbMeasResult others CQI report modes: not yet implemented
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   535
    }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   536
  else if (Simulator::Now () > m_a30CqiLast + m_a30CqiPeriocity)
7895
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   537
    {
8726
f6f0e2531457 merge with ns-3-lena-pem changeset 8419:e8df5f68c35e (MIMO model)
mmiozzo
parents: 8670 8725
diff changeset
   538
      cqi = m_amc->CreateCqiFeedbacks (newSinr, GetRbgSize ());
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   539
      int nLayer = TransmissionModesLayers::TxMode2LayerNum (m_transmissionMode);
7895
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   540
      int nbSubChannels = cqi.size ();
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   541
      int rbgSize = GetRbgSize ();
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   542
      double cqiSum = 0.0;
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   543
      int cqiNum = 0;
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   544
      SbMeasResult_s rbgMeas;
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   545
      //NS_LOG_DEBUG (this << " Create A30 CQI feedback, RBG " << rbgSize << " cqiNum " << nbSubChannels << " band "  << (uint16_t)m_dlBandwidth);
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   546
      for (int i = 0; i < nbSubChannels; i++)
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   547
        {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   548
          if (cqi.at (i) != -1)
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   549
            {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   550
              cqiSum += cqi.at (i);
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   551
            }
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   552
          // else "nothing" no CQI is treated as CQI = 0 (worst case scenario)
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   553
          cqiNum++;
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   554
          if (cqiNum == rbgSize)
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   555
            {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   556
              // average the CQIs of the different RBGs
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   557
              //NS_LOG_DEBUG (this << " RBG CQI "  << (uint16_t) cqiSum / rbgSize);
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   558
              HigherLayerSelected_s hlCqi;
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   559
              hlCqi.m_sbPmi = 0; // not yet used
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   560
              for (int i = 0; i < nLayer; i++)
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   561
                {
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   562
                  hlCqi.m_sbCqi.push_back ((uint16_t) cqiSum / rbgSize);
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   563
                }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   564
              rbgMeas.m_higherLayerSelected.push_back (hlCqi);
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   565
              cqiSum = 0.0;
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   566
              cqiNum = 0;
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   567
            }
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   568
        }
7895
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   569
      dlcqi.m_rnti = m_rnti;
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   570
      dlcqi.m_ri = 1; // not yet used
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   571
      dlcqi.m_cqiType = CqiListElement_s::A30; // Aperidic CQI using PUSCH
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   572
      //dlcqi.m_wbCqi.push_back ((uint16_t) cqiSum / nbSubChannels);
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   573
      dlcqi.m_wbPmi = 0; // not yet used
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   574
      dlcqi.m_sbMeasResult = rbgMeas;
f20bb71f9b71 Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7893
diff changeset
   575
    }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8042
diff changeset
   576
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   577
  msg->SetDlCqi (dlcqi);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   578
  return msg;
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   579
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   580
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   581
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   582
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   583
void
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   584
LteUePhy::DoSendLteControlMessage (Ptr<LteControlMessage> msg)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   585
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   586
  NS_LOG_FUNCTION (this << msg);
9346
00e674a0d567 merge lena-dev and lena-epc
Nicola Baldo <nbaldo@cttc.es>
parents: 9337 9053
diff changeset
   587
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   588
  SetControlMessages (msg);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   589
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   590
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   591
void 
9460
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   592
LteUePhy::DoSendRachPreamble (uint32_t raPreambleId, uint32_t raRnti)
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   593
{
9413
20f1c6678ee2 improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents: 9406
diff changeset
   594
  NS_LOG_FUNCTION (this << raPreambleId);
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   595
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   596
  // unlike other control messages, RACH preamble is sent ASAP
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   597
  Ptr<RachPreambleLteControlMessage> msg = Create<RachPreambleLteControlMessage> ();
9413
20f1c6678ee2 improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents: 9406
diff changeset
   598
  msg->SetRapId (raPreambleId);
9460
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   599
  m_raPreambleId = raPreambleId;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   600
  m_raRnti = raRnti;
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   601
  m_controlMessagesQueue.at (0).push_back (msg);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   602
}
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   603
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   604
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   605
void
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   606
LteUePhy::ReceiveLteControlMessageList (std::list<Ptr<LteControlMessage> > msgList)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   607
{
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   608
  NS_LOG_FUNCTION (this);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   609
  
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   610
  std::list<Ptr<LteControlMessage> >::iterator it;
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   611
  for (it = msgList.begin (); it != msgList.end(); it++)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   612
  {
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   613
    Ptr<LteControlMessage> msg = (*it);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   614
  
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   615
    if (msg->GetMessageType () == LteControlMessage::DL_DCI)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   616
    {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   617
      Ptr<DlDciLteControlMessage> msg2 = DynamicCast<DlDciLteControlMessage> (msg);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   618
      
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   619
      DlDciListElement_s dci = msg2->GetDci ();
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   620
      if (dci.m_rnti != m_rnti)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   621
        {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   622
          // DCI not for me
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   623
          continue;
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   624
        }
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   625
      
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   626
      if (dci.m_resAlloc != 0)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   627
      {
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   628
        NS_FATAL_ERROR ("Resource Allocation type not implemented");
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   629
      }
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   630
      
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   631
      std::vector <int> dlRb;
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   632
      
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   633
      // translate the DCI to Spectrum framework
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   634
      uint32_t mask = 0x1;
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   635
      for (int i = 0; i < 32; i++)
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   636
      {
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   637
        if (((dci.m_rbBitmap & mask) >> i) == 1)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   638
        {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   639
          for (int k = 0; k < GetRbgSize (); k++)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   640
          {
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   641
            dlRb.push_back ((i * GetRbgSize ()) + k);
9351
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
   642
//             NS_LOG_DEBUG(this << " RNTI " << m_rnti << " RBG " << i << " DL-DCI allocated PRB " << (i*GetRbgSize()) + k);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   643
          }
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   644
        }
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   645
        mask = (mask << 1);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   646
      }
8511
46046bbb2a5c Add info in LteSpectrumPhy on TB from DCI elaborated by LteEnbPhy and LteUePhy
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
   647
      
46046bbb2a5c Add info in LteSpectrumPhy on TB from DCI elaborated by LteEnbPhy and LteUePhy
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
   648
      // send TB info to LteSpectrumPhy
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   649
      NS_LOG_DEBUG (this << " UE " << m_rnti << " DL-DCI " << dci.m_rnti << " bitmap "  << dci.m_rbBitmap);
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   650
      for (uint8_t i = 0; i < dci.m_tbsSize.size (); i++)
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   651
      {
9519
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   652
        m_downlinkSpectrumPhy->AddExpectedTb (dci.m_rnti, dci.m_ndi.at (i), dci.m_tbsSize.at (i), dci.m_mcs.at (i), dlRb, i, dci.m_harqProcess, dci.m_rv.at (i), true /* DL */);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   653
      }
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   654
      
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   655
      SetSubChannelsForReception (dlRb);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   656
      
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   657
      
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   658
    }
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   659
    else if (msg->GetMessageType () == LteControlMessage::UL_DCI) 
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   660
    {
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   661
      // set the uplink bandwidht according to the UL-CQI
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   662
      Ptr<UlDciLteControlMessage> msg2 = DynamicCast<UlDciLteControlMessage> (msg);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   663
      UlDciListElement_s dci = msg2->GetDci ();
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   664
      if (dci.m_rnti != m_rnti)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   665
        {
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   666
          // DCI not for me
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   667
          continue;
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   668
        }
9460
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   669
      NS_LOG_INFO (this << " UL DCI");
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   670
      std::vector <int> ulRb;
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   671
      for (int i = 0; i < dci.m_rbLen; i++)
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   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: 8737
diff changeset
   673
        ulRb.push_back (i + dci.m_rbStart);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   674
        //NS_LOG_DEBUG (this << " UE RB " << i + dci.m_rbStart);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   675
      }
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   676
      QueueSubChannelsForTransmission (ulRb);
9519
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   677
      // fire trace of UL Tx PHY stats
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   678
      HarqProcessInfoList_t harqInfoList = m_harqPhyModule->GetHarqProcessInfoUl (m_rnti, 0);
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   679
      PhyTransmissionStatParameters params;
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   680
      params.m_cellId = m_cellId;
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   681
      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: 9461
diff changeset
   682
      params.m_timestamp = Simulator::Now ().GetMilliSeconds () + UL_PUSCH_TTIS_DELAY;
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   683
      params.m_rnti = m_rnti;
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   684
      params.m_txMode = 0; // always SISO for UE
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   685
      params.m_layer = 0;
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   686
      params.m_mcs = dci.m_mcs;
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   687
      params.m_size = dci.m_tbSize;
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   688
      params.m_rv = harqInfoList.size ();
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   689
      params.m_ndi = dci.m_ndi;
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9461
diff changeset
   690
      m_ulPhyTransmission (params);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   691
      // pass the info to the MAC
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   692
      m_uePhySapUser->ReceiveLteControlMessage (msg);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   693
    }
9460
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   694
    else if (msg->GetMessageType () == LteControlMessage::RAR)
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   695
      {
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   696
        Ptr<RarLteControlMessage> rarMsg = DynamicCast<RarLteControlMessage> (msg);
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   697
        if (rarMsg->GetRaRnti () == m_raRnti)
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   698
          {
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   699
            for (std::list<RarLteControlMessage::Rar>::const_iterator it = rarMsg->RarListBegin (); it != rarMsg->RarListEnd (); ++it)
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   700
              {
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   701
                if (it->rapId != m_raPreambleId)
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   702
                  {
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   703
                    // UL grant not for me
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   704
                    continue;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   705
                  }
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   706
                else
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   707
                  {
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   708
                    NS_LOG_INFO ("received RAR RNTI " << m_raRnti);
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   709
                    // set the uplink bandwidht according to the UL grant
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   710
                    std::vector <int> ulRb;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   711
                    for (int i = 0; i < it->rarPayload.m_grant.m_rbLen; i++)
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   712
                    {
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   713
                      ulRb.push_back (i + it->rarPayload.m_grant.m_rbStart);
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   714
                    }
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   715
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   716
                    QueueSubChannelsForTransmission (ulRb);
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   717
                    // pass the info to the MAC
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   718
                    m_uePhySapUser->ReceiveLteControlMessage (msg);
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   719
                    // reset RACH variables with out of range values
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   720
                    m_raPreambleId = 255;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   721
                    m_raRnti = 11;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   722
                  }
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   723
              }
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   724
          }
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   725
      }
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   726
    else if (msg->GetMessageType () == LteControlMessage::MIB) 
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   727
      {
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   728
        NS_LOG_INFO ("received MIB");
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   729
        Ptr<MibLteControlMessage> msg2 = DynamicCast<MibLteControlMessage> (msg);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   730
        m_ueCphySapUser->RecvMasterInformationBlock (msg2->GetMib ());
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   731
      }
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   732
    else
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   733
    {
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   734
      // pass the message to UE-MAC
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   735
      m_uePhySapUser->ReceiveLteControlMessage (msg);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   736
    }
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   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: 8737
diff changeset
   738
  }
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   739
  
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   740
  
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   741
}
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   742
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   743
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   744
void
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   745
LteUePhy::QueueSubChannelsForTransmission (std::vector <int> rbMap)
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   746
{
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   747
  m_subChannelsForTransmissionQueue.at (m_macChTtiDelay - 1) = rbMap;
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   748
}
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   749
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   750
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   751
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   752
LteUePhy::SubframeIndication (uint32_t frameNo, uint32_t subframeNo)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   753
{
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   754
  NS_LOG_FUNCTION (this << frameNo << subframeNo);
9389
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   755
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   756
  NS_ASSERT_MSG (frameNo > 0, "the SRS index check code assumes that frameNo starts at 1");
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   757
  
9389
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   758
  // refresh internal variables
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   759
  m_rsReceivedPowerUpdated = false;
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   760
  
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   761
  if (m_ulConfigured)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   762
    {
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   763
      // update uplink transmission mask according to previous UL-CQIs
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   764
      SetSubChannelsForTransmission (m_subChannelsForTransmissionQueue.at (0));
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   765
   
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   766
      // shift the queue
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   767
      for (uint8_t i = 1; i < m_macChTtiDelay; i++)
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   768
        {
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   769
          m_subChannelsForTransmissionQueue.at (i-1) = m_subChannelsForTransmissionQueue.at (i);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   770
        }
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   771
      m_subChannelsForTransmissionQueue.at (m_macChTtiDelay-1).clear ();
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   772
  
9469
28a7b04a0b11 removed spurious LteUePhy::m_enbCellId; fixed bug in LteEnbRrc::GetNewSrsConfigurationIndex ()
Nicola Baldo <nbaldo@cttc.es>
parents: 9461
diff changeset
   773
      if (m_srsConfigured && (m_srsStartTime <= Simulator::Now ()))
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   774
        {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   775
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   776
          NS_ASSERT_MSG (subframeNo > 0 && subframeNo <= 10, "the SRS index check code assumes that subframeNo starts at 1");
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   777
          if ((((frameNo-1)*10 + (subframeNo-1)) % m_srsPeriodicity) == m_srsSubframeOffset)
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   778
            {
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   779
              NS_LOG_INFO ("frame " << frameNo << " subframe " << subframeNo << " sending SRS (offset=" << m_srsSubframeOffset << ", period=" << m_srsPeriodicity << ")");
9485
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   780
              m_sendSrsEvent = Simulator::Schedule (UL_SRS_DELAY_FROM_SUBFRAME_START, 
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   781
                                                    &LteUePhy::SendSrs,
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   782
                                                    this);
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   783
            }
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   784
        }
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   785
      
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   786
      std::list<Ptr<LteControlMessage> > ctrlMsg = GetControlMessages ();
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   787
      // send packets in queue
9579
1f1a0bd0c009 added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents: 9569
diff changeset
   788
      NS_LOG_LOGIC (this << " UE - start slot for PUSCH + PUCCH - RNTI " << m_rnti << " CELLID " << m_cellId);
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   789
      // send the current burts of packets
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   790
      Ptr<PacketBurst> pb = GetPacketBurst ();
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   791
      if (pb)
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   792
        {
9053
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   793
          m_uplinkSpectrumPhy->StartTxDataFrame (pb, ctrlMsg, UL_DATA_DURATION);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   794
        }
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   795
      else
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   796
        {
9414
7b0db3dbf19b merged lena-dev and lena-epc
Nicola Baldo <nbaldo@cttc.es>
parents: 9413 9368
diff changeset
   797
      // send only PUCCH (ideal: fake null bandwidth signal)
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   798
          if (ctrlMsg.size ()>0)
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   799
            {
9460
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   800
              NS_LOG_LOGIC (this << " UE - start TX PUCCH (NO PUSCH)");
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   801
              std::vector <int> dlRb;
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   802
              SetSubChannelsForTransmission (dlRb);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   803
              m_uplinkSpectrumPhy->StartTxDataFrame (pb, ctrlMsg, UL_DATA_DURATION);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   804
            }
9460
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   805
          else
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   806
            {
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   807
              NS_LOG_LOGIC (this << " UE - UL NOTHING TO SEND");
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9420
diff changeset
   808
            }
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   809
        }
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   810
    }  // m_configured
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   811
  
8415
e9a27a8c6331 Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents: 8253
diff changeset
   812
  // trigger the MAC
e9a27a8c6331 Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents: 8253
diff changeset
   813
  m_uePhySapUser->SubframeIndication (frameNo, subframeNo);
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   814
  
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   815
  
9053
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   816
  ++subframeNo;
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   817
  if (subframeNo > 10)
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   818
    {
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   819
      ++frameNo;
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   820
      subframeNo = 1;
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   821
    }
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   822
  
9053
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   823
  // schedule next subframe indication
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   824
  Simulator::Schedule (Seconds (GetTti ()), &LteUePhy::SubframeIndication, this, frameNo, subframeNo);  
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   825
}
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   826
  
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   827
void
9038
e1d67c8aa95b Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9036
diff changeset
   828
LteUePhy::SendSrs ()
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   829
{
9469
28a7b04a0b11 removed spurious LteUePhy::m_enbCellId; fixed bug in LteEnbRrc::GetNewSrsConfigurationIndex ()
Nicola Baldo <nbaldo@cttc.es>
parents: 9461
diff changeset
   830
  NS_LOG_FUNCTION (this << " UE " << m_rnti << " start tx SRS, cell Id " << (uint32_t) m_cellId);
28a7b04a0b11 removed spurious LteUePhy::m_enbCellId; fixed bug in LteEnbRrc::GetNewSrsConfigurationIndex ()
Nicola Baldo <nbaldo@cttc.es>
parents: 9461
diff changeset
   831
  NS_ASSERT (m_cellId > 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: 8737
diff changeset
   832
  // set the current tx power spectral density (full bandwidth)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   833
  std::vector <int> dlRb;
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   834
  for (uint8_t i = 0; i < m_ulBandwidth; i++)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   835
    {
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   836
      dlRb.push_back (i);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   837
    }
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   838
  SetSubChannelsForTransmission (dlRb);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   839
  m_uplinkSpectrumPhy->StartTxUlSrsFrame ();
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   840
}
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   841
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8737
diff changeset
   842
9485
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   843
void
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   844
LteUePhy::DoReset ()
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   845
{
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   846
  NS_LOG_FUNCTION (this);
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   847
  
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   848
  m_rnti = 0;
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   849
  m_transmissionMode = 0;
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   850
  m_srsPeriodicity = 0;
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   851
  m_srsConfigured = false;
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   852
  m_dlConfigured = false;
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   853
  m_ulConfigured = false;
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   854
  m_raPreambleId = 255; // value out of range
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   855
  m_raRnti = 11; // value out of range
9562
Nicola Baldo <nbaldo@cttc.es>
parents: 9525 9390
diff changeset
   856
  m_rsrpSinrSampleCounter = 0;
9485
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   857
  m_p10CqiLast = Simulator::Now ();
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   858
  m_a30CqiLast = Simulator::Now ();
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   859
9485
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   860
  m_packetBurstQueue.clear ();
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   861
  m_controlMessagesQueue.clear ();
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   862
  m_subChannelsForTransmissionQueue.clear ();
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   863
  for (int i = 0; i < m_macChTtiDelay; i++)
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   864
    {
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   865
      Ptr<PacketBurst> pb = CreateObject <PacketBurst> ();
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   866
      m_packetBurstQueue.push_back (pb);
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   867
      std::list<Ptr<LteControlMessage> > l;
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   868
      m_controlMessagesQueue.push_back (l);
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   869
    }
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   870
  std::vector <int> ulRb;
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   871
  m_subChannelsForTransmissionQueue.resize (m_macChTtiDelay, ulRb);
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   872
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   873
  m_sendSrsEvent.Cancel ();
9579
1f1a0bd0c009 added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents: 9569
diff changeset
   874
  m_downlinkSpectrumPhy->Reset ();
1f1a0bd0c009 added method LteSpectrumPhy::Reset ()
Nicola Baldo <nbaldo@cttc.es>
parents: 9569
diff changeset
   875
  m_uplinkSpectrumPhy->Reset ();
9485
938edff6f281 reset LteUePhy upon handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9469
diff changeset
   876
}
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   877
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   878
void
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   879
LteUePhy::DoSyncronizeWithEnb (uint16_t cellId, uint16_t dlEarfcn)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   880
{
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   881
  NS_LOG_FUNCTION (this << cellId);
9469
28a7b04a0b11 removed spurious LteUePhy::m_enbCellId; fixed bug in LteEnbRrc::GetNewSrsConfigurationIndex ()
Nicola Baldo <nbaldo@cttc.es>
parents: 9461
diff changeset
   882
  m_cellId = cellId;
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   883
  m_dlEarfcn = dlEarfcn;
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   884
  m_downlinkSpectrumPhy->SetCellId (cellId);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   885
  m_uplinkSpectrumPhy->SetCellId (cellId);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   886
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   887
  // configure DL for receing the BCH with the minimum bandwith
9439
5107601b7a75 added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9420
diff changeset
   888
  m_dlBandwidth = 6;
5107601b7a75 added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9420
diff changeset
   889
  Ptr<SpectrumValue> noisePsd = LteSpectrumValueHelper::CreateNoisePowerSpectralDensity (m_dlEarfcn, m_dlBandwidth, m_noiseFigure);
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   890
  m_downlinkSpectrumPhy->SetNoisePowerSpectralDensity (noisePsd);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   891
  m_downlinkSpectrumPhy->GetChannel ()->AddRx (m_downlinkSpectrumPhy);  
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   892
  
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   893
  m_dlConfigured = false;
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   894
  m_ulConfigured = false;
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   895
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   896
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   897
void
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   898
LteUePhy::DoSetDlBandwidth (uint8_t dlBandwidth)
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   899
{
9420
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   900
  NS_LOG_FUNCTION (this << (uint32_t) dlBandwidth);
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   901
  if (m_dlBandwidth != dlBandwidth)
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   902
    {
9420
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   903
      m_dlBandwidth = dlBandwidth;
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   904
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   905
      int Type0AllocationRbg[4] = {
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   906
        10,     // RGB size 1
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   907
        26,     // RGB size 2
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   908
        63,     // RGB size 3
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   909
        110     // RGB size 4
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   910
      };  // see table 7.1.6.1-1 of 36.213
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   911
      for (int i = 0; i < 4; i++)
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   912
        {
9420
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   913
          if (dlBandwidth < Type0AllocationRbg[i])
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   914
            {
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   915
              m_rbgSize = i + 1;
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   916
              break;
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   917
            }
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   918
        }
9420
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   919
  
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   920
      Ptr<SpectrumValue> noisePsd = LteSpectrumValueHelper::CreateNoisePowerSpectralDensity (m_dlEarfcn, m_dlBandwidth, m_noiseFigure);
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   921
      m_downlinkSpectrumPhy->SetNoisePowerSpectralDensity (noisePsd);
cd49c7790894 X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   922
      m_downlinkSpectrumPhy->GetChannel ()->AddRx (m_downlinkSpectrumPhy);  
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   923
    }
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   924
  m_dlConfigured = true;
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   925
}
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   926
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   927
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   928
void 
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   929
LteUePhy::DoConfigureUplink (uint16_t ulEarfcn, uint8_t ulBandwidth)
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   930
{
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   931
  m_ulEarfcn = ulEarfcn;
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   932
  m_ulBandwidth = ulBandwidth;
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   933
  m_ulConfigured = true;
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   934
}
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   935
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   936
 
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   937
void
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   938
LteUePhy::DoSetRnti (uint16_t rnti)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   939
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   940
  NS_LOG_FUNCTION (this << rnti);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   941
  m_rnti = rnti;
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   942
}
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   943
 
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8737
diff changeset
   944
void
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   945
LteUePhy::DoSetTransmissionMode (uint8_t txMode)
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   946
{
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   947
  NS_LOG_FUNCTION (this << (uint16_t)txMode);
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   948
  m_transmissionMode = txMode;
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   949
  m_downlinkSpectrumPhy->SetTransmissionMode (txMode);
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   950
}
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   951
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   952
void
9038
e1d67c8aa95b Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9036
diff changeset
   953
LteUePhy::DoSetSrsConfigurationIndex (uint16_t srcCi)
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   954
{
9038
e1d67c8aa95b Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9036
diff changeset
   955
  NS_LOG_FUNCTION (this << srcCi);
e1d67c8aa95b Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9036
diff changeset
   956
  m_srsPeriodicity = GetSrsPeriodicity (srcCi);
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   957
  m_srsSubframeOffset = GetSrsSubframeOffset (srcCi);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   958
  m_srsConfigured = true;
9469
28a7b04a0b11 removed spurious LteUePhy::m_enbCellId; fixed bug in LteEnbRrc::GetNewSrsConfigurationIndex ()
Nicola Baldo <nbaldo@cttc.es>
parents: 9461
diff changeset
   959
9569
6593186d50dd zero SRS guard time since we use static SRS periodicity now
Nicola Baldo <nbaldo@cttc.es>
parents: 9562
diff changeset
   960
  // a guard time is needed for the case where the SRS periodicity is changed dynamically at run time
6593186d50dd zero SRS guard time since we use static SRS periodicity now
Nicola Baldo <nbaldo@cttc.es>
parents: 9562
diff changeset
   961
  // if we use a static one, we can have a 0ms guard time
6593186d50dd zero SRS guard time since we use static SRS periodicity now
Nicola Baldo <nbaldo@cttc.es>
parents: 9562
diff changeset
   962
  m_srsStartTime = Simulator::Now () + MilliSeconds (0);
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9347
diff changeset
   963
  NS_LOG_DEBUG (this << " UE SRS P " << m_srsPeriodicity << " RNTI " << m_rnti << " offset " << m_srsSubframeOffset << " cellId " << m_cellId << " CI " << srcCi);
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   964
}
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   965
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   966
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   967
void 
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   968
LteUePhy::SetTxMode1Gain (double gain)
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   969
{
8725
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
   970
  SetTxModeGain (1, gain);
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   971
}
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   972
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   973
void 
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   974
LteUePhy::SetTxMode2Gain (double gain)
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   975
{
8725
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
   976
  SetTxModeGain (2, gain);
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   977
}
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   978
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   979
void 
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   980
LteUePhy::SetTxMode3Gain (double gain)
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   981
{
8725
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
   982
  SetTxModeGain (3, gain);
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   983
}
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   984
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   985
void 
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   986
LteUePhy::SetTxMode4Gain (double gain)
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   987
{
8725
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
   988
  SetTxModeGain (4, gain);
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   989
}
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   990
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   991
void 
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   992
LteUePhy::SetTxMode5Gain (double gain)
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   993
{
8725
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
   994
  SetTxModeGain (5, gain);
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   995
}
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   996
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   997
void 
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   998
LteUePhy::SetTxMode6Gain (double gain)
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   999
{
8725
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1000
  SetTxModeGain (6, gain);
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1001
}
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1002
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1003
void 
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1004
LteUePhy::SetTxMode7Gain (double gain)
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1005
{
8725
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1006
  SetTxModeGain (7, gain);
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1007
}
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1008
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1009
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1010
void
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1011
LteUePhy::SetTxModeGain (uint8_t txMode, double gain)
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1012
{
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1013
  NS_LOG_FUNCTION (this << gain);
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1014
  // convert to linear
9063
32755d0516f4 Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents: 9054
diff changeset
  1015
  double gainLin = std::pow (10.0, (gain / 10.0));
8725
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1016
  if (m_txModeGain.size () < txMode)
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1017
    {
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1018
      m_txModeGain.resize (txMode);
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1019
    }
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1020
  std::vector <double> temp;
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1021
  temp = m_txModeGain;
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1022
  m_txModeGain.clear ();
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1023
  for (uint8_t i = 0; i < temp.size (); i++)
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1024
    {
8725
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1025
      if (i==txMode-1)
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1026
        {
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1027
          m_txModeGain.push_back (gainLin);
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1028
        }
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1029
      else
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1030
        {
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1031
          m_txModeGain.push_back (temp.at (i));
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1032
        }
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1033
    }
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1034
  // forward the info to DL LteSpectrumPhy
8725
e8df5f68c35e Update SetTxModeXGain for reducing the copy-and-paste code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8720
diff changeset
  1035
  m_downlinkSpectrumPhy->SetTxModeGain (txMode, gain);
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1036
}
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1037
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
  1038
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
  1039
9351
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1040
void
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1041
LteUePhy::ReceiveLteDlHarqFeedback (DlInfoListElement_s m)
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1042
{
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1043
  NS_LOG_FUNCTION (this);
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1044
  // generate feedback to eNB and send it through ideal PUCCH
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1045
  Ptr<DlHarqFeedbackLteControlMessage> msg = Create<DlHarqFeedbackLteControlMessage> ();
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1046
  msg->SetDlHarqFeedback (m);
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1047
  SetControlMessages (msg);
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1048
}
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1049
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1050
void
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1051
LteUePhy::SetHarqPhyModule (Ptr<LteHarqPhy> harq)
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1052
{
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1053
  m_harqPhyModule = harq;
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1054
}
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1055
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9347
diff changeset
  1056
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
  1057
} // namespace ns3