src/lte/model/lte-enb-phy.cc
author Marco Miozzo <marco.miozzo@cttc.es>
Fri, 15 Jun 2012 16:49:51 +0200
changeset 9035 e40974228d94
parent 8729 74de12409ee5
child 9036 5e09b29d4af5
permissions -rw-r--r--
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
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 <mmiozzo@cttc.es>
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    20
 */
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
#include <ns3/object-factory.h>
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    23
#include <ns3/log.h>
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    24
#include <math.h>
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    25
#include <ns3/simulator.h>
7949
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
    26
#include <ns3/attribute-accessor-helper.h>
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
    27
#include <ns3/double.h>
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
    28
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
    29
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    30
#include "lte-enb-phy.h"
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    31
#include "lte-net-device.h"
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    32
#include "lte-spectrum-value-helper.h"
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
    33
#include "lte-control-messages.h"
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    34
#include "lte-enb-net-device.h"
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    35
#include "lte-enb-mac.h"
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7944
diff changeset
    36
#include <ns3/lte-common.h>
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    37
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    38
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    39
NS_LOG_COMPONENT_DEFINE ("LteEnbPhy");
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    40
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    41
namespace ns3 {
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
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    44
////////////////////////////////////////
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    45
// member SAP forwarders
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    46
////////////////////////////////////////
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    47
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    48
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    49
class EnbMemberLteEnbPhySapProvider : public LteEnbPhySapProvider
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    50
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    51
public:
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    52
  EnbMemberLteEnbPhySapProvider (LteEnbPhy* phy);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    53
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    54
  // inherited from LteEnbPhySapProvider
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    55
  virtual void SendMacPdu (Ptr<Packet> p);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    56
  virtual void SetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    57
  virtual void SetCellId (uint16_t cellId);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
    58
  virtual void SendLteControlMessage (Ptr<LteControlMessage> msg);
8729
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
    59
  virtual uint8_t GetMacChTtiDelay ();
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
    60
  virtual void SetTransmissionMode (uint16_t  rnti, uint8_t txMode);
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
    61
  
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    62
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    63
private:
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    64
  LteEnbPhy* m_phy;
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    65
};
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    66
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    67
EnbMemberLteEnbPhySapProvider::EnbMemberLteEnbPhySapProvider (LteEnbPhy* phy) : m_phy (phy)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    68
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    69
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    70
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    71
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    72
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    73
void
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    74
EnbMemberLteEnbPhySapProvider::SendMacPdu (Ptr<Packet> p)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    75
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    76
  m_phy->DoSendMacPdu (p);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    77
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    78
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    79
void
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    80
EnbMemberLteEnbPhySapProvider::SetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    81
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    82
  m_phy->DoSetBandwidth (ulBandwidth, dlBandwidth);
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
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    86
EnbMemberLteEnbPhySapProvider::SetCellId (uint16_t cellId)
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->DoSetCellId (cellId);
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: 8729
diff changeset
    92
EnbMemberLteEnbPhySapProvider::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: 8729
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
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
    97
uint8_t
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
    98
EnbMemberLteEnbPhySapProvider::GetMacChTtiDelay ()
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
    99
{
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
   100
  return (m_phy->DoGetMacChTtiDelay ());
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   101
}
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
   102
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   103
void
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   104
EnbMemberLteEnbPhySapProvider::SetTransmissionMode (uint16_t  rnti, uint8_t txMode)
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   105
{
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   106
  m_phy->DoSetTransmissionMode (rnti, txMode);
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   107
}
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   108
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   109
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   110
////////////////////////////////////////
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   111
// generic LteEnbPhy methods
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   112
////////////////////////////////////////
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   113
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   114
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   115
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   116
NS_OBJECT_ENSURE_REGISTERED (LteEnbPhy);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   117
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   118
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   119
LteEnbPhy::LteEnbPhy ()
7980
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7977
diff changeset
   120
{
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7977
diff changeset
   121
  NS_LOG_FUNCTION (this);
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7977
diff changeset
   122
  NS_FATAL_ERROR ("This constructor should not be called");
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7977
diff changeset
   123
}
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7977
diff changeset
   124
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7977
diff changeset
   125
LteEnbPhy::LteEnbPhy (Ptr<LteSpectrumPhy> dlPhy, Ptr<LteSpectrumPhy> ulPhy)
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7977
diff changeset
   126
  : LtePhy (dlPhy, ulPhy),
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7977
diff changeset
   127
    m_nrFrames (0),
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   128
    m_nrSubFrames (0)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   129
{
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   130
  m_enbPhySapProvider = new EnbMemberLteEnbPhySapProvider (this);
7944
f7e5e0540487 connection of SAPs moved from EnbNetDevice to LenaHelper
Nicola Baldo <nicola@baldo.biz>
parents: 7943
diff changeset
   131
  Simulator::ScheduleNow (&LteEnbPhy::StartFrame, this);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   132
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   133
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   134
TypeId
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   135
LteEnbPhy::GetTypeId (void)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   136
{
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   137
  static TypeId tid = TypeId ("ns3::LteEnbPhy")
6707
2ac68a0381ca improved module after Tom's review
Giuseppe Piro <g.piro@poliba.it>
parents: 6705
diff changeset
   138
    .SetParent<LtePhy> ()
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   139
    .AddConstructor<LteEnbPhy> ()
7949
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   140
    .AddAttribute ("TxPower",
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   141
                   "Transmission power in dBm",
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   142
                   DoubleValue (30.0),
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   143
                   MakeDoubleAccessor (&LteEnbPhy::SetTxPower, 
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   144
                                       &LteEnbPhy::GetTxPower),
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   145
                   MakeDoubleChecker<double> ())
7981
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   146
    .AddAttribute ("NoiseFigure",
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   147
                   "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
   148
                   " 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
   149
                   "\"the difference in decibels (dB) between"
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   150
                   " 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
   151
                   " 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
   152
                   " are connected to sources at the standard noise temperature T0.\" "
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   153
                   "In this model, we consider T0 = 290K.",
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   154
                   DoubleValue (5.0),
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   155
                   MakeDoubleAccessor (&LteEnbPhy::SetNoiseFigure, 
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   156
                                       &LteEnbPhy::GetNoiseFigure),
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   157
                   MakeDoubleChecker<double> ())
8664
ab4c821fc251 revision after Giuseppe's comments http://codereview.appspot.com/4626069/#msg1
Nicola Baldo <nbaldo@cttc.es>
parents: 8538
diff changeset
   158
    .AddAttribute ("MacToChannelDelay",
ab4c821fc251 revision after Giuseppe's comments http://codereview.appspot.com/4626069/#msg1
Nicola Baldo <nbaldo@cttc.es>
parents: 8538
diff changeset
   159
                   "The delay in TTI units that occurs between a scheduling decision in the MAC and the actual start of the transmission by the PHY. This is intended to be used to model the latency of real PHY and MAC implementations.",
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   160
                   UintegerValue (2),
8670
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   161
                   MakeUintegerAccessor (&LteEnbPhy::SetMacChDelay, 
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   162
                                         &LteEnbPhy::GetMacChDelay),
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   163
                   MakeUintegerChecker<uint8_t> ())
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   164
  ;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   165
  return tid;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   166
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   167
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   168
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   169
LteEnbPhy::~LteEnbPhy ()
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   170
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   171
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   172
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   173
void
7913
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7887
diff changeset
   174
LteEnbPhy::DoDispose ()
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7887
diff changeset
   175
{
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7887
diff changeset
   176
  NS_LOG_FUNCTION (this);
7921
0a504caf445d added more disposal stuff
Nicola Baldo <nbaldo@cttc.es>
parents: 7914
diff changeset
   177
  m_ueAttached.clear ();
7930
ccb40542ae88 fixed memory leak in PHY SAP usage
Nicola Baldo <nbaldo@cttc.es>
parents: 7928
diff changeset
   178
  delete m_enbPhySapProvider;
7913
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7887
diff changeset
   179
  LtePhy::DoDispose ();
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7887
diff changeset
   180
}
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7887
diff changeset
   181
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7887
diff changeset
   182
void
8015
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   183
LteEnbPhy::DoStart ()
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   184
{
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   185
  NS_LOG_FUNCTION (this);
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   186
  Ptr<SpectrumValue> noisePsd = LteSpectrumValueHelper::CreateNoisePowerSpectralDensity (m_ulEarfcn, m_ulBandwidth, m_noiseFigure);
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   187
  m_uplinkSpectrumPhy->SetNoisePowerSpectralDensity (noisePsd);
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   188
  LtePhy::DoStart ();
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   189
}
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   190
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   191
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   192
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   193
LteEnbPhy::SetLteEnbPhySapUser (LteEnbPhySapUser* s)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   194
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   195
  m_enbPhySapUser = s;
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   196
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   197
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   198
LteEnbPhySapProvider*
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   199
LteEnbPhy::GetLteEnbPhySapProvider ()
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   200
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   201
  return (m_enbPhySapProvider);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   202
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   203
7949
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   204
void
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   205
LteEnbPhy::SetTxPower (double pow)
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   206
{
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   207
  NS_LOG_FUNCTION (this << pow);
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   208
  m_txPower = pow;
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   209
}
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   210
7949
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   211
double
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   212
LteEnbPhy::GetTxPower () const
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   213
{
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   214
  NS_LOG_FUNCTION (this);
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   215
  return m_txPower;
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   216
}
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   217
7981
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   218
void
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   219
LteEnbPhy::SetNoiseFigure (double nf)
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   220
{
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   221
  NS_LOG_FUNCTION (this << nf);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   222
  m_noiseFigure = nf;
7981
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   223
}
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   224
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   225
double
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   226
LteEnbPhy::GetNoiseFigure () const
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   227
{
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   228
  NS_LOG_FUNCTION (this);
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   229
  return m_noiseFigure;
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   230
}
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   231
8670
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   232
void
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   233
LteEnbPhy::SetMacChDelay (uint8_t delay)
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   234
{
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   235
  m_macChTtiDelay = delay;
8729
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   236
  for (int i = 0; i < m_macChTtiDelay; i++)
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   237
    {
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
   238
      Ptr<PacketBurst> pb = CreateObject <PacketBurst> ();
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   239
      m_packetBurstQueue.push_back (pb);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   240
      std::list<Ptr<LteControlMessage> > l;
8729
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   241
      m_controlMessagesQueue.push_back (l);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   242
      std::list<UlDciLteControlMessage> l1;
8729
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   243
      m_ulDciQueue.push_back (l1);
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   244
    }
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
   245
  for (int i = 0; i < UL_PUSCH_TTIS_DELAY; i++)
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   246
    {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   247
      std::list<UlDciLteControlMessage> l1;
8729
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   248
      m_ulDciQueue.push_back (l1);
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   249
    }
8670
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   250
}
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   251
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   252
uint8_t
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   253
LteEnbPhy::GetMacChDelay (void) const
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   254
{
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   255
  return (m_macChTtiDelay);
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   256
}
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   257
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   258
bool
8180
5429db8b8c37 Fix Bug JIRA:LENA-145, RNTI as uint16_t in LteEnbPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8148
diff changeset
   259
LteEnbPhy::AddUePhy (uint16_t rnti, Ptr<LteUePhy> phy)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   260
{
8180
5429db8b8c37 Fix Bug JIRA:LENA-145, RNTI as uint16_t in LteEnbPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8148
diff changeset
   261
  std::map <uint16_t, Ptr<LteUePhy> >::iterator it;
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   262
  it = m_ueAttached.find (rnti);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   263
  if (it == m_ueAttached.end ())
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   264
    {
8180
5429db8b8c37 Fix Bug JIRA:LENA-145, RNTI as uint16_t in LteEnbPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8148
diff changeset
   265
      m_ueAttached.insert (std::pair<uint16_t, Ptr<LteUePhy> > (rnti, phy));
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   266
      return (true);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   267
    }
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   268
  else
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   269
    {
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   270
      NS_LOG_ERROR ("UE already attached");
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   271
      return (false);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   272
    }
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   273
}
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   274
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   275
bool
8180
5429db8b8c37 Fix Bug JIRA:LENA-145, RNTI as uint16_t in LteEnbPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8148
diff changeset
   276
LteEnbPhy::DeleteUePhy (uint16_t rnti)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   277
{
8180
5429db8b8c37 Fix Bug JIRA:LENA-145, RNTI as uint16_t in LteEnbPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8148
diff changeset
   278
  std::map <uint16_t, Ptr<LteUePhy> >::iterator it;
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   279
  it = m_ueAttached.find (rnti);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   280
  if (it == m_ueAttached.end ())
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   281
    {
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   282
      NS_LOG_ERROR ("UE not attached");
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   283
      return (false);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   284
    }
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   285
  else
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   286
    {
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   287
      m_ueAttached.erase (it);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   288
      return (true);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   289
    }
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   290
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   291
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   292
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   293
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   294
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   295
LteEnbPhy::DoSendMacPdu (Ptr<Packet> p)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   296
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   297
  NS_LOG_FUNCTION (this);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   298
  SetMacPdu (p);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   299
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   300
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
   301
uint8_t
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   302
LteEnbPhy::DoGetMacChTtiDelay ()
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   303
{
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
   304
  return (m_macChTtiDelay);
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   305
}
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
   306
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   307
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   308
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   309
LteEnbPhy::PhyPduReceived (Ptr<Packet> p)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   310
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   311
  NS_LOG_FUNCTION (this);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   312
  m_enbPhySapUser->ReceivePhyPdu (p);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   313
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   314
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   315
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   316
LteEnbPhy::DoSetDownlinkSubChannels ()
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   317
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   318
  NS_LOG_FUNCTION (this);
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   319
  Ptr<SpectrumValue> txPsd = CreateTxPowerSpectralDensity ();
7928
b736f63e9bdf removed LtePhy::Get{Up,Down}linkSpectrumPhy methods which are evil
Nicola Baldo <nbaldo@cttc.es>
parents: 7921
diff changeset
   320
  m_downlinkSpectrumPhy->SetTxPowerSpectralDensity (txPsd);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   321
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   322
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   323
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   324
Ptr<SpectrumValue>
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   325
LteEnbPhy::CreateTxPowerSpectralDensity ()
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   326
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   327
  NS_LOG_FUNCTION (this);
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   328
8015
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   329
  Ptr<SpectrumValue> psd = LteSpectrumValueHelper::CreateTxPowerSpectralDensity (m_dlEarfcn, m_dlBandwidth, m_txPower, GetDownlinkSubChannels ());
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   330
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   331
  return psd;
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
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   335
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   336
LteEnbPhy::CalcChannelQualityForUe (std::vector <double> sinr, Ptr<LteSpectrumPhy> ue)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   337
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   338
  NS_LOG_FUNCTION (this);
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   339
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   340
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   341
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   342
void
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   343
LteEnbPhy::DoSendLteControlMessage (Ptr<LteControlMessage> msg)
6705
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
  NS_LOG_FUNCTION (this << msg);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   346
  // queues the message (wait for MAC-PHY delay)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   347
  SetControlMessages (msg);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   348
}
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
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   351
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   352
void
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   353
LteEnbPhy::ReceiveLteControlMessage (Ptr<LteControlMessage> msg)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   354
{
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   355
  NS_FATAL_ERROR ("Obsolete function");
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   356
  NS_LOG_FUNCTION (this << msg);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   357
  m_enbPhySapUser->ReceiveLteControlMessage (msg);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   358
}
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   359
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   360
void
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   361
LteEnbPhy::ReceiveLteControlMessageList (std::list<Ptr<LteControlMessage> > msgList)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   362
{
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   363
  NS_LOG_FUNCTION (this);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   364
  std::list<Ptr<LteControlMessage> >::iterator it;
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   365
  for (it = msgList.begin (); it != msgList.end(); it++)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   366
    {
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   367
      m_enbPhySapUser->ReceiveLteControlMessage (*it);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   368
    }
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   369
    
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
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   372
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
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   375
LteEnbPhy::StartFrame (void)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   376
{
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   377
  NS_LOG_FUNCTION (this);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   378
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   379
  ++m_nrFrames;
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   380
  NS_LOG_INFO ("-----frame " << m_nrFrames << "-----");
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   381
  m_nrSubFrames = 0;
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   382
  StartSubFrame ();
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   383
}
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
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   387
LteEnbPhy::StartSubFrame (void)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   388
{
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   389
  NS_LOG_FUNCTION (this);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   390
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   391
  ++m_nrSubFrames;
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   392
  NS_LOG_INFO ("-----sub frame " << m_nrSubFrames << "-----");
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
   393
  
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   394
  
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
   395
  // update info on TB to be received
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   396
  std::list<UlDciLteControlMessage> uldcilist = DequeueUlDci ();
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   397
  std::list<UlDciLteControlMessage>::iterator dciIt = uldcilist.begin ();
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   398
  m_ulRntiRxed.clear ();
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   399
  NS_LOG_DEBUG (this << " eNB Expected TBs " << uldcilist.size ());
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   400
  for (dciIt = uldcilist.begin (); dciIt!=uldcilist.end (); dciIt++)
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   401
    {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   402
      std::map <uint16_t, Ptr<LteUePhy> >::iterator it2;
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   403
      it2 = m_ueAttached.find ((*dciIt).GetDci ().m_rnti);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   404
      
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   405
      if (it2 == m_ueAttached.end ())
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   406
        {
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   407
          NS_LOG_ERROR ("UE not attached");
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   408
        }
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   409
      else
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   410
        {
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   411
          // send info of TB to LteSpectrumPhy 
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   412
          // translate to allocation map
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   413
          std::vector <int> rbMap;
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   414
          for (int i = (*dciIt).GetDci ().m_rbStart; i < (*dciIt).GetDci ().m_rbStart + (*dciIt).GetDci ().m_rbLen; i++)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   415
            {
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   416
              rbMap.push_back (i);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   417
            }
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   418
          m_uplinkSpectrumPhy->AddExpectedTb ((*dciIt).GetDci ().m_rnti, (*dciIt).GetDci ().m_tbSize, (*dciIt).GetDci ().m_mcs, rbMap, 0 /* always SISO*/);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   419
          m_ulRntiRxed.push_back ((*dciIt).GetDci ().m_rnti);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   420
        }
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
   421
    }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   422
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   423
  // process the current burst of control messages
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   424
  std::list<Ptr<LteControlMessage> > ctrlMsg = GetControlMessages ();
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   425
  std::list<DlDciListElement_s> dlDci;
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   426
  std::list<UlDciListElement_s> ulDci;
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   427
//   std::vector <int> dlRb;
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   428
  m_dlDataRbMap.clear ();
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   429
  if (ctrlMsg.size () > 0)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   430
    {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   431
      std::list<Ptr<LteControlMessage> >::iterator it;
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   432
      it = ctrlMsg.begin ();
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   433
      while (it != ctrlMsg.end ())
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   434
        {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   435
          Ptr<LteControlMessage> msg = (*it);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   436
          if (msg->GetMessageType () == LteControlMessage::DL_DCI)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   437
            {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   438
              Ptr<DlDciLteControlMessage> dci = 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: 8729
diff changeset
   439
              dlDci.push_back (dci->GetDci ());
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   440
                  // get the tx power spectral density according to DL-DCI(s)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   441
                  // translate the DCI to Spectrum framework
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   442
                  uint32_t mask = 0x1;
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   443
                  for (int i = 0; i < 32; i++)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   444
                    {
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   445
                      if (((dci->GetDci ().m_rbBitmap & mask) >> i) == 1)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   446
                        {
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   447
                          for (int k = 0; k < GetRbgSize (); k++)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   448
                            {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   449
                              m_dlDataRbMap.push_back ((i * GetRbgSize ()) + k);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   450
                              //NS_LOG_DEBUG(this << " [enb]DL-DCI allocated PRB " << (i*GetRbgSize()) + k);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   451
                            }
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   452
                        }
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   453
                      mask = (mask << 1);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   454
                    }
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   455
            }
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   456
          else if (msg->GetMessageType () == LteControlMessage::UL_DCI)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   457
            {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   458
              Ptr<UlDciLteControlMessage> dci = DynamicCast<UlDciLteControlMessage> (msg);
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   459
              QueueUlDci (*dci);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   460
              ulDci.push_back (dci->GetDci ());
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   461
            }
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   462
          it++;
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   463
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   464
        }
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   465
    }
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   466
    
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   467
  SendControlChannels (ctrlMsg);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   468
  
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   469
  // send data frame
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   470
  Ptr<PacketBurst> pb = GetPacketBurst ();
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   471
  if (pb)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   472
    {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   473
      Simulator::Schedule (Seconds (0.000214286), // ctrl frame fixed to 3 symbols
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   474
                       &LteEnbPhy::SendDataChannels,
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   475
                       this,pb);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   476
    }
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   477
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   478
  // trigger the MAC
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   479
  m_enbPhySapUser->SubframeIndication (m_nrFrames, m_nrSubFrames);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   480
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   481
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   482
  // trigger the UE(s)
8180
5429db8b8c37 Fix Bug JIRA:LENA-145, RNTI as uint16_t in LteEnbPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8148
diff changeset
   483
  std::map <uint16_t, Ptr<LteUePhy> >::iterator it;
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   484
  for (it = m_ueAttached.begin (); it != m_ueAttached.end (); it++)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   485
    {
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   486
      (*it).second->SubframeIndication (m_nrFrames, m_nrSubFrames);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   487
    }
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   488
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   489
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   490
  Simulator::Schedule (Seconds (GetTti ()),
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   491
                       &LteEnbPhy::EndSubFrame,
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   492
                       this);
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   493
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   494
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   495
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   496
void
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   497
LteEnbPhy::SendControlChannels (std::list<Ptr<LteControlMessage> > ctrlMsgList)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   498
{
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   499
  NS_LOG_FUNCTION (this << " eNB " << m_cellId << " start tx ctrl frame");
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   500
  // set the current tx power spectral density (full bandwidth)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   501
  std::vector <int> dlRb;
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   502
  for (uint8_t i = 0; i < m_dlBandwidth; i++)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   503
    {
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   504
      dlRb.push_back (i);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   505
    }
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   506
  SetDownlinkSubChannels (dlRb);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   507
  NS_LOG_LOGIC (this << " eNB start TX CTRL");
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   508
  m_downlinkSpectrumPhy->StartTxDlCtrlFrame (ctrlMsgList);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   509
  
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   510
}
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   511
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   512
void
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   513
LteEnbPhy::SendDataChannels (Ptr<PacketBurst> pb)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   514
{
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   515
  // set the current tx power spectral density
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   516
  SetDownlinkSubChannels (m_dlDataRbMap);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   517
  // send the current burts of packets
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   518
  NS_LOG_LOGIC (this << " eNB start TX DATA");
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   519
  double dlDataFrame = 0.000785714; // 0.001 / 14 * 11 (fixed to 11 symbols)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   520
  std::list<Ptr<LteControlMessage> > ctrlMsgList;
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   521
  ctrlMsgList.clear ();
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   522
  m_downlinkSpectrumPhy->StartTxDataFrame (pb, ctrlMsgList, dlDataFrame);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   523
}
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   524
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   525
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   526
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   527
LteEnbPhy::EndSubFrame (void)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   528
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   529
  NS_LOG_FUNCTION (this << Simulator::Now ().GetSeconds ());
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   530
  if (m_nrSubFrames == 10)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   531
    {
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   532
      Simulator::ScheduleNow (&LteEnbPhy::EndFrame, this);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   533
    }
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   534
  else
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   535
    {
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   536
      Simulator::ScheduleNow (&LteEnbPhy::StartSubFrame, this);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   537
    }
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   538
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   539
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   540
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   541
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   542
LteEnbPhy::EndFrame (void)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   543
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   544
  NS_LOG_FUNCTION (this << Simulator::Now ().GetSeconds ());
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   545
  Simulator::ScheduleNow (&LteEnbPhy::StartFrame, this);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   546
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   547
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   548
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   549
void 
8664
ab4c821fc251 revision after Giuseppe's comments http://codereview.appspot.com/4626069/#msg1
Nicola Baldo <nbaldo@cttc.es>
parents: 8538
diff changeset
   550
LteEnbPhy::GenerateCqiReport (const SpectrumValue& sinr)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   551
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   552
  NS_LOG_FUNCTION (this << sinr);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   553
  UlCqi_s ulcqi = CreateUlCqiReport (sinr);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   554
  m_enbPhySapUser->UlCqiReport (ulcqi);
7910
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   555
}
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   556
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   557
7934
0f09fc707a8c Convert UL-CQI from IdealControlMessage to PhySap Primitive
mmiozzo
parents: 7930
diff changeset
   558
UlCqi_s
0f09fc707a8c Convert UL-CQI from IdealControlMessage to PhySap Primitive
mmiozzo
parents: 7930
diff changeset
   559
LteEnbPhy::CreateUlCqiReport (const SpectrumValue& sinr)
7910
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   560
{
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   561
  NS_LOG_FUNCTION (this << sinr);
7910
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   562
  Values::const_iterator it;
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   563
  UlCqi_s ulcqi;
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   564
  ulcqi.m_type = UlCqi_s::PUSCH;
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   565
  int i = 0;
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   566
  for (it = sinr.ConstValuesBegin (); it != sinr.ConstValuesEnd (); it++)
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   567
    {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   568
      double sinrdb = 10 * log10 ((*it));
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   569
//       NS_LOG_DEBUG ("ULCQI RB " << i << " value " << sinrdb);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   570
      // convert from double to fixed point notation Sxxxxxxxxxxx.xxx
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   571
      int16_t sinrFp = LteFfConverter::double2fpS11dot3 (sinrdb);
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   572
      ulcqi.m_sinr.push_back (sinrFp);
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   573
      i++;
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   574
    }
7934
0f09fc707a8c Convert UL-CQI from IdealControlMessage to PhySap Primitive
mmiozzo
parents: 7930
diff changeset
   575
  return (ulcqi);
7910
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   576
	
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   577
}
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   578
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   579
void
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   580
LteEnbPhy::DoSetTransmissionMode (uint16_t  rnti, uint8_t txMode)
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   581
{
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   582
  NS_LOG_FUNCTION (this << rnti << (uint16_t)txMode);
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   583
  // UL supports only SISO MODE
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   584
}
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   585
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
   586
void
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   587
LteEnbPhy::QueueUlDci (UlDciLteControlMessage m)
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   588
{
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   589
  NS_LOG_FUNCTION (this);
8729
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   590
  m_ulDciQueue.at (UL_PUSCH_TTIS_DELAY - 1).push_back (m);
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   591
}
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   592
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   593
std::list<UlDciLteControlMessage>
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   594
LteEnbPhy::DequeueUlDci (void)
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   595
{
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   596
  NS_LOG_FUNCTION (this);
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   597
  if (m_ulDciQueue.at (0).size ()>0)
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   598
    {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   599
      std::list<UlDciLteControlMessage> ret = m_ulDciQueue.at (0);
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   600
      m_ulDciQueue.erase (m_ulDciQueue.begin ());
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   601
      std::list<UlDciLteControlMessage> l;
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   602
      m_ulDciQueue.push_back (l);
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   603
      return (ret);
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   604
    }
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   605
  else
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   606
    {
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   607
      m_ulDciQueue.erase (m_ulDciQueue.begin ());
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   608
      std::list<UlDciLteControlMessage> l;
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   609
      m_ulDciQueue.push_back (l);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   610
      std::list<UlDciLteControlMessage> emptylist;
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   611
      return (emptylist);
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   612
    }
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   613
}
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   614
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   615
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   616
};