diff --git a/src/lte/model/lte-common.h b/src/lte/model/lte-common.h index 1f0de62f9..a32daf7fa 100644 --- a/src/lte/model/lte-common.h +++ b/src/lte/model/lte-common.h @@ -56,11 +56,23 @@ public: friend bool operator < (const ImsiLcidPair_t &a, const ImsiLcidPair_t &b); }; +/** +* \brief Parameters for configuring the UE +*/ struct LteUeConfig_t { uint16_t m_rnti; + /** + * When false means that the message is inteded foro configuring a new UE + */ bool m_reconfigureFlag; + /** + * Transmission mode [1..7] (i.e., SISO, MIMO, etc.) + */ uint8_t m_transmissionMode; + /** + * Srs Configuration index for UE specific SRS, see section 8.2 of TS 36.213 + */ uint16_t m_srsConfigurationIndex; public: diff --git a/src/lte/model/lte-enb-cmac-sap.h b/src/lte/model/lte-enb-cmac-sap.h index 4f9caf906..a782d4135 100644 --- a/src/lte/model/lte-enb-cmac-sap.h +++ b/src/lte/model/lte-enb-cmac-sap.h @@ -26,7 +26,6 @@ #include #include #include -//#include namespace ns3 { diff --git a/src/lte/model/lte-enb-phy-sap.h b/src/lte/model/lte-enb-phy-sap.h index 217c3838f..e84ebcd52 100644 --- a/src/lte/model/lte-enb-phy-sap.h +++ b/src/lte/model/lte-enb-phy-sap.h @@ -64,7 +64,7 @@ public: * \param rnti the RNTI of the user * \param txMode the SRS Configuration Index of the user */ - virtual void SetSrsConfigurationIndex (uint16_t rnti, uint16_t srsCI) = 0; + virtual void SetSrsConfigurationIndex (uint16_t rnti, uint16_t srsCi) = 0; /** * diff --git a/src/lte/model/lte-enb-phy.cc b/src/lte/model/lte-enb-phy.cc index 26bcdc148..212c14461 100644 --- a/src/lte/model/lte-enb-phy.cc +++ b/src/lte/model/lte-enb-phy.cc @@ -58,7 +58,7 @@ public: virtual void SendLteControlMessage (Ptr msg); virtual uint8_t GetMacChTtiDelay (); virtual void SetTransmissionMode (uint16_t rnti, uint8_t txMode); - virtual void SetSrsConfigurationIndex (uint16_t rnti, uint16_t srsCI); + virtual void SetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi); private: @@ -108,9 +108,9 @@ EnbMemberLteEnbPhySapProvider::SetTransmissionMode (uint16_t rnti, uint8_t txMo } void -EnbMemberLteEnbPhySapProvider::SetSrsConfigurationIndex (uint16_t rnti, uint16_t srsCI) +EnbMemberLteEnbPhySapProvider::SetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi) { - m_phy->DoSetSrsConfigurationIndex (rnti, srsCI); + m_phy->DoSetSrsConfigurationIndex (rnti, srcCi); } @@ -652,19 +652,19 @@ LteEnbPhy::DequeueUlDci (void) } void -LteEnbPhy::DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srsCI) +LteEnbPhy::DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi) { NS_LOG_FUNCTION (this); - m_srsPeriodicity = GetSrsPeriodicity (srsCI); - NS_LOG_DEBUG (this << " ENB SRS P " << m_srsPeriodicity << " RNTI " << rnti << " offset " << GetSrsSubframeOffset (srsCI) << " CI " << srsCI); + m_srsPeriodicity = GetSrsPeriodicity (srcCi); + NS_LOG_DEBUG (this << " ENB SRS P " << m_srsPeriodicity << " RNTI " << rnti << " offset " << GetSrsSubframeOffset (srcCi) << " CI " << srcCi); std::map ::iterator it = m_srsCounter.find (rnti); if (it != m_srsCounter.end ()) { - (*it).second = GetSrsSubframeOffset (srsCI) + 1; + (*it).second = GetSrsSubframeOffset (srcCi) + 1; } else { - m_srsCounter.insert (std::pair (rnti, GetSrsSubframeOffset (srsCI) + 1)); + m_srsCounter.insert (std::pair (rnti, GetSrsSubframeOffset (srcCi) + 1)); } } diff --git a/src/lte/model/lte-enb-phy.h b/src/lte/model/lte-enb-phy.h index d999b93aa..5c0396351 100644 --- a/src/lte/model/lte-enb-phy.h +++ b/src/lte/model/lte-enb-phy.h @@ -114,7 +114,7 @@ public: virtual void DoSetTransmissionMode (uint16_t rnti, uint8_t txMode); - virtual void DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srsCI); + virtual void DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi); virtual uint8_t DoGetMacChTtiDelay (); @@ -133,11 +133,6 @@ public: */ void CalcChannelQualityForUe (std::vector sinr, Ptr ue); - /** - * \brief Send the control message - * \param msg the message to send - */ - // virtual void SendLteControlMessage (Ptr msg); // legacy /** * \brief Receive the control message * \param msg the received message @@ -164,8 +159,17 @@ public: bool AddUePhy (uint16_t rnti, Ptr phy); bool DeleteUePhy (uint16_t rnti); - + + /** + * \brief Send the PDCCH and PCFICH in the first 3 symbols + * \param ctrlMsgList the list of control messages of PDCCH + */ void SendControlChannels (std::list > ctrlMsgList); + + /** + * \brief Send the PDSCH + * \param pb the PacketBurst to be sent + */ void SendDataChannels (Ptr pb); /** diff --git a/src/lte/model/lte-enb-rrc.cc b/src/lte/model/lte-enb-rrc.cc index 0f231b5ce..dc41ccd29 100644 --- a/src/lte/model/lte-enb-rrc.cc +++ b/src/lte/model/lte-enb-rrc.cc @@ -506,9 +506,10 @@ LteEnbRrc::DoNotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success) // ///////////////////////////////////////// // from 3GPP TS 36.213 table 8.2-1 UE Specific SRS Periodicity -uint16_t SrsPeriodicity[9] = {0, 2, 5, 10, 20, 40, 80, 160, 320}; -uint16_t SrsCiLow[9] = {0, 0, 2, 7, 17, 37, 77, 157, 317}; -uint16_t SrsCiHigh[9] = {0, 1, 6, 16, 36, 76, 156, 316, 636}; +#define SRS_ENTRIES 9 +uint16_t g_srsPeriodicity[SRS_ENTRIES] = {0, 2, 5, 10, 20, 40, 80, 160, 320}; +uint16_t g_srsCiLow[SRS_ENTRIES] = {0, 0, 2, 7, 17, 37, 77, 157, 317}; +uint16_t g_srsCiHigh[SRS_ENTRIES] = {0, 1, 6, 16, 36, 76, 156, 316, 636}; void LteEnbRrc::SetCellId (uint16_t cellId) @@ -552,22 +553,24 @@ LteEnbRrc::GetNewSrsConfigurationIndex () return 0; } - NS_LOG_DEBUG (this << " SRS p " << SrsPeriodicity[m_srsCurrentPeriodicityId] << " set " << m_ueSrsConfigurationIndexSet.size ()); - if (m_ueSrsConfigurationIndexSet.size () == SrsPeriodicity[m_srsCurrentPeriodicityId]) + NS_ASSERT (m_srsCurrentPeriodicityId < SRS_ENTRIES); + NS_LOG_DEBUG (this << " SRS p " << g_srsPeriodicity[m_srsCurrentPeriodicityId] << " set " << m_ueSrsConfigurationIndexSet.size ()); + if (m_ueSrsConfigurationIndexSet.size () == g_srsPeriodicity[m_srsCurrentPeriodicityId]) { - NS_LOG_DEBUG (this << " SRS reconfigure CIs " << SrsPeriodicity[m_srsCurrentPeriodicityId] << " to " << SrsPeriodicity[m_srsCurrentPeriodicityId+1] << " at " << Simulator::Now ()); +// NS_LOG_DEBUG (this << " SRS reconfigure CIs " << g_srsPeriodicity[m_srsCurrentPeriodicityId] << " to " << g_srsPeriodicity[m_srsCurrentPeriodicityId+1] << " at " << Simulator::Now ()); // increase the current periocity for having enough CIs m_ueSrsConfigurationIndexSet.clear (); m_srsCurrentPeriodicityId++; + NS_ASSERT (m_srsCurrentPeriodicityId < SRS_ENTRIES); // update all the UE's CI - uint16_t srsCI = SrsCiLow[m_srsCurrentPeriodicityId]; + uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId]; std::map >::iterator it; for (it = m_ueMap.begin (); it != m_ueMap.end (); it++) { - (*it).second->SetSrsConfigurationIndex (srsCI); - m_ueSrsConfigurationIndexSet.insert (srsCI); - m_lastAllocatedConfigurationIndex = srsCI; - srsCI++; + (*it).second->SetSrsConfigurationIndex (srcCi); + m_ueSrsConfigurationIndexSet.insert (srcCi); + m_lastAllocatedConfigurationIndex = srcCi; + srcCi++; // send update to peer RRC LteUeConfig_t ueConfig; ueConfig.m_rnti = (*it).first; @@ -584,8 +587,8 @@ LteEnbRrc::GetNewSrsConfigurationIndex () { // find a CI from the available ones std::set::reverse_iterator rit = m_ueSrsConfigurationIndexSet.rbegin (); - NS_LOG_DEBUG (this << " lower bound " << (*rit) << " of " << SrsCiHigh[m_srsCurrentPeriodicityId]); - if ((*rit) <= SrsCiHigh[m_srsCurrentPeriodicityId]) + NS_LOG_DEBUG (this << " lower bound " << (*rit) << " of " << g_srsCiHigh[m_srsCurrentPeriodicityId]); + if ((*rit) <= g_srsCiHigh[m_srsCurrentPeriodicityId]) { // got it from the upper bound m_lastAllocatedConfigurationIndex = (*rit) + 1; @@ -594,13 +597,13 @@ LteEnbRrc::GetNewSrsConfigurationIndex () else { // look for released ones - for (uint16_t srsCI = SrsCiLow[m_srsCurrentPeriodicityId]; srsCI < SrsCiHigh[m_srsCurrentPeriodicityId]; srsCI++) + for (uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId]; srcCi < g_srsCiHigh[m_srsCurrentPeriodicityId]; srcCi++) { - std::set::iterator it = m_ueSrsConfigurationIndexSet.find (srsCI); + std::set::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi); if (it==m_ueSrsConfigurationIndexSet.end ()) { - m_lastAllocatedConfigurationIndex = srsCI; - m_ueSrsConfigurationIndexSet.insert (srsCI); + m_lastAllocatedConfigurationIndex = srcCi; + m_ueSrsConfigurationIndexSet.insert (srcCi); break; } } @@ -612,13 +615,14 @@ LteEnbRrc::GetNewSrsConfigurationIndex () void -LteEnbRrc::RemoveSrsConfigurationIndex (uint16_t srsCI) +LteEnbRrc::RemoveSrsConfigurationIndex (uint16_t srcCi) { - NS_LOG_FUNCTION (this << srsCI); - std::set::iterator it = m_ueSrsConfigurationIndexSet.find (srsCI); - NS_ASSERT_MSG (it != m_ueSrsConfigurationIndexSet.end (), "request to remove unkwown SRS CI " << srsCI); + NS_LOG_FUNCTION (this << srcCi); + std::set::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi); + NS_ASSERT_MSG (it != m_ueSrsConfigurationIndexSet.end (), "request to remove unkwown SRS CI " << srcCi); m_ueSrsConfigurationIndexSet.erase (it); - if (m_ueSrsConfigurationIndexSet.size () < SrsPeriodicity[m_srsCurrentPeriodicityId - 1]) + NS_ASSERT (m_srsCurrentPeriodicityId > 1); + if (m_ueSrsConfigurationIndexSet.size () < g_srsPeriodicity[m_srsCurrentPeriodicityId - 1]) { // reduce the periodicity m_ueSrsConfigurationIndexSet.clear (); @@ -631,14 +635,14 @@ LteEnbRrc::RemoveSrsConfigurationIndex (uint16_t srsCI) else { // update all the UE's CI - uint16_t srsCI = SrsCiLow[m_srsCurrentPeriodicityId]; + uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId]; std::map >::iterator it; for (it = m_ueMap.begin (); it != m_ueMap.end (); it++) { - (*it).second->SetSrsConfigurationIndex (srsCI); - m_ueSrsConfigurationIndexSet.insert (srsCI); - m_lastAllocatedConfigurationIndex = srsCI; - srsCI++; + (*it).second->SetSrsConfigurationIndex (srcCi); + m_ueSrsConfigurationIndexSet.insert (srcCi); + m_lastAllocatedConfigurationIndex = srcCi; + srcCi++; // send update to peer RRC LteUeConfig_t ueConfig; ueConfig.m_rnti = (*it).first; @@ -699,7 +703,6 @@ void LteEnbRrc::ConfigureNewUe (uint16_t rnti) { NS_LOG_FUNCTION (this); - // at this stage used only by the scheduler for updating txMode // retrieve UE info std::map >::iterator it; it = m_ueMap.find (rnti); diff --git a/src/lte/model/lte-enb-rrc.h b/src/lte/model/lte-enb-rrc.h index baf2bc1d8..15f95d8af 100644 --- a/src/lte/model/lte-enb-rrc.h +++ b/src/lte/model/lte-enb-rrc.h @@ -231,8 +231,11 @@ public: */ void SetForwardUpCallback (Callback > cb); -// void DoStart (); - + /** + * Configure the UE peer RRC with all the correspondet info + * + * \param rnti the RNTI of the UE to be configured + */ void ConfigureNewUe (uint16_t rnti); @@ -250,7 +253,7 @@ private: Ptr GetUeInfo (uint16_t rnti); void RemoveUeInfo (uint16_t rnti); uint16_t GetNewSrsConfigurationIndex (void); - void RemoveSrsConfigurationIndex (uint16_t srsCI); + void RemoveSrsConfigurationIndex (uint16_t srcCi); Callback > m_forwardUpCallback; diff --git a/src/lte/model/lte-phy.cc b/src/lte/model/lte-phy.cc index 053b1bf69..3903ffdfc 100644 --- a/src/lte/model/lte-phy.cc +++ b/src/lte/model/lte-phy.cc @@ -213,7 +213,7 @@ LtePhy::DoSetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth) uint16_t -LtePhy::GetSrsPeriodicity (uint16_t srsCI) const +LtePhy::GetSrsPeriodicity (uint16_t srcCi) const { // from 3GPP TS 36.213 table 8.2-1 UE Specific SRS Periodicity uint16_t SrsPeriodicity[9] = {0, 2, 5, 10, 20, 40, 80, 160, 320}; @@ -222,7 +222,7 @@ LtePhy::GetSrsPeriodicity (uint16_t srsCI) const uint8_t i; for (i = 8; i > 0; i --) { - if ((srsCI>=SrsCiLow[i])&&(srsCI<=SrsCiHigh[i])) + if ((srcCi>=SrsCiLow[i])&&(srcCi<=SrsCiHigh[i])) { break; } @@ -231,7 +231,7 @@ LtePhy::GetSrsPeriodicity (uint16_t srsCI) const } uint16_t -LtePhy::GetSrsSubframeOffset (uint16_t srsCI) const +LtePhy::GetSrsSubframeOffset (uint16_t srcCi) const { // from 3GPP TS 36.213 table 8.2-1 UE Specific SRS Periodicity uint16_t SrsSubframeOffset[9] = {0, 0, 2, 7, 17, 37, 77, 157, 317}; @@ -240,12 +240,12 @@ LtePhy::GetSrsSubframeOffset (uint16_t srsCI) const uint8_t i; for (i = 8; i > 0; i --) { - if ((srsCI>=SrsCiLow[i])&&(srsCI<=SrsCiHigh[i])) + if ((srcCi>=SrsCiLow[i])&&(srcCi<=SrsCiHigh[i])) { break; } } - return (srsCI - SrsSubframeOffset[i]); + return (srcCi - SrsSubframeOffset[i]); } void diff --git a/src/lte/model/lte-phy.h b/src/lte/model/lte-phy.h index 668b610ce..4a8916ca3 100644 --- a/src/lte/model/lte-phy.h +++ b/src/lte/model/lte-phy.h @@ -199,15 +199,15 @@ public: /** * \returns the SRS periodicity (see Table 8.2-1 of 36.213) - * \param srsCI the SRS Configuration Index + * \param srcCi the SRS Configuration Index */ - uint16_t GetSrsPeriodicity (uint16_t srsCI) const; + uint16_t GetSrsPeriodicity (uint16_t srcCi) const; /** * \returns the SRS Subframe offset (see Table 8.2-1 of 36.213) - * \param srsCI the SRS Configuration Index + * \param srcCi the SRS Configuration Index */ - uint16_t GetSrsSubframeOffset (uint16_t srsCI) const; + uint16_t GetSrsSubframeOffset (uint16_t srcCi) const; /** diff --git a/src/lte/model/lte-sinr-chunk-processor.h b/src/lte/model/lte-sinr-chunk-processor.h index 471431c83..4b8f48688 100644 --- a/src/lte/model/lte-sinr-chunk-processor.h +++ b/src/lte/model/lte-sinr-chunk-processor.h @@ -55,7 +55,9 @@ public: /** - * This SinrProcessor averages the calculated SINR over time. + * The LteCtrlSinrChunkProcessor averages the calculated SINR over time + * for the Ctrl frame and therefore in charge of generating the CQI starting + * from the reference signals. * */ class LteCtrlSinrChunkProcessor : public LteSinrChunkProcessor @@ -75,7 +77,10 @@ private: /** -* This SinrProcessor averages the calculated SINR over time for Phy error model +* The LteDataSinrChunkProcessor averages the calculated SINR over time for +* data frame and therefore in charge of generating the sinr values for +* evaluating the errors of data packets. Might be used also for generating +* CQI based on data in case any LtePhy is attached. * */ class LteDataSinrChunkProcessor : public LteSinrChunkProcessor diff --git a/src/lte/model/lte-spectrum-phy.cc b/src/lte/model/lte-spectrum-phy.cc index 364de70cc..c6796edbf 100644 --- a/src/lte/model/lte-spectrum-phy.cc +++ b/src/lte/model/lte-spectrum-phy.cc @@ -114,8 +114,11 @@ std::ostream& operator<< (std::ostream& os, LteSpectrumPhy::State s) case LteSpectrumPhy::IDLE: os << "IDLE"; break; - case LteSpectrumPhy::RX: - os << "RX"; + case LteSpectrumPhy::RX_DATA: + os << "RX_DATA"; + break; + case LteSpectrumPhy::RX_CTRL: + os << "RX_CTRL"; break; case LteSpectrumPhy::TX: os << "TX"; @@ -303,7 +306,8 @@ LteSpectrumPhy::StartTx (Ptr pb) switch (m_state) { - case RX: + case RX_DATA: + case RX_CTRL: NS_FATAL_ERROR ("cannot TX while RX: according to FDD channel acces, the physical layer for transmission cannot be used for reception"); break; @@ -363,7 +367,8 @@ LteSpectrumPhy::StartTxDataFrame (Ptr pb, std::list > ctrlMsgLi switch (m_state) { - case RX: + case RX_DATA: + case RX_CTRL: NS_FATAL_ERROR ("cannot TX while RX: according to FDD channel acces, the physical layer for transmission cannot be used for reception"); break; @@ -473,7 +479,8 @@ LteSpectrumPhy::StartTxUlSrsFrame () switch (m_state) { - case RX: + case RX_DATA: + case RX_CTRL: NS_FATAL_ERROR ("cannot TX while RX: according to FDD channel acces, the physical layer for transmission cannot be used for reception"); break; @@ -571,7 +578,7 @@ LteSpectrumPhy::StartRx (Ptr spectrumRxParams) } else { - // other type of signal (cuold be 3G, GSM, whatever) -> interference + // other type of signal (could be 3G, GSM, whatever) -> interference m_interferenceData->AddSignal (rxPsd, duration); m_interferenceCtrl->AddSignal (rxPsd, duration); } @@ -588,9 +595,11 @@ LteSpectrumPhy::StartRxData (Ptr params) case TX: NS_FATAL_ERROR ("cannot RX while TX: according to FDD channel access, the physical layer for transmission cannot be used for reception"); break; - + case RX_CTRL: + NS_FATAL_ERROR ("cannot RX Data while receiving control"); + break; case IDLE: - case RX: + case RX_DATA: // the behavior is similar when // we're IDLE or RX because we can receive more signals // simultaneously (e.g., at the eNB). @@ -613,7 +622,7 @@ LteSpectrumPhy::StartRxData (Ptr params) } else { - NS_ASSERT (m_state == RX); + NS_ASSERT (m_state == RX_DATA); // sanity check: if there are multiple RX events, they // should occur at the same time and have the same // duration, otherwise the interference calculation @@ -622,7 +631,7 @@ LteSpectrumPhy::StartRxData (Ptr params) && (m_firstRxDuration == params->duration)); } - ChangeState (RX); + ChangeState (RX_DATA); if (params->packetBurst) { m_rxPacketBurstList.push_back (params->packetBurst); @@ -662,9 +671,11 @@ LteSpectrumPhy::StartRxCtrl (Ptr params) case TX: NS_FATAL_ERROR ("cannot RX while TX: according to FDD channel access, the physical layer for transmission cannot be used for reception"); break; - + case RX_DATA: + NS_FATAL_ERROR ("cannot RX data while receing control"); + break; case IDLE: - case RX: + case RX_CTRL: // the behavior is similar when // we're IDLE or RX because we can receive more signals // simultaneously (e.g., at the eNB). @@ -708,7 +719,7 @@ LteSpectrumPhy::StartRxCtrl (Ptr params) Simulator::Schedule (params->duration, &LteSpectrumPhy::EndRxUlSrs, this); } } - else if (m_state == RX) + else if (m_state == RX_CTRL) { // sanity check: if there are multiple RX events, they // should occur at the same time and have the same @@ -718,7 +729,7 @@ LteSpectrumPhy::StartRxCtrl (Ptr params) && (m_firstRxDuration == params->duration)); } - ChangeState (RX); + ChangeState (RX_CTRL); m_interferenceCtrl->StartRx (params->psd); // NS_LOG_LOGIC (this << " numSimultaneousRxEvents = " << m_rxPacketBurstList.size ()); @@ -774,7 +785,7 @@ LteSpectrumPhy::EndRxData () NS_LOG_FUNCTION (this); NS_LOG_LOGIC (this << " state: " << m_state); - NS_ASSERT (m_state == RX); + NS_ASSERT (m_state == RX_DATA); // this will trigger CQI calculation and Error Model evaluation // as a side effect, the error model should update the error status of all TBs @@ -856,7 +867,7 @@ LteSpectrumPhy::EndRxDlCtrl () NS_LOG_FUNCTION (this); NS_LOG_LOGIC (this << " state: " << m_state); - NS_ASSERT (m_state == RX); + NS_ASSERT (m_state == RX_CTRL); // this will trigger CQI calculation and Error Model evaluation // as a side effect, the error model should update the error status of all TBs @@ -892,6 +903,7 @@ LteSpectrumPhy::EndRxDlCtrl () void LteSpectrumPhy::EndRxUlSrs () { + NS_ASSERT (m_state == RX_CTRL); ChangeState (IDLE); m_interferenceCtrl->EndRx (); // nothing to do (used only for SRS at this stage) diff --git a/src/lte/model/lte-spectrum-phy.h b/src/lte/model/lte-spectrum-phy.h index c5595701a..d1610dfab 100644 --- a/src/lte/model/lte-spectrum-phy.h +++ b/src/lte/model/lte-spectrum-phy.h @@ -135,7 +135,7 @@ public: */ enum State { - IDLE, TX, RX + IDLE, TX, RX_DATA, RX_CTRL }; // inherited from Object @@ -344,8 +344,6 @@ private: std::list > m_txControlMessageList; std::list > m_rxControlMessageList; -// std::list m_rxDlDciBurstList; -// std::list m_rxUlDciBurstList; State m_state; diff --git a/src/lte/model/lte-spectrum-signal-parameters.cc b/src/lte/model/lte-spectrum-signal-parameters.cc index 1d38cc49e..76f017e4c 100644 --- a/src/lte/model/lte-spectrum-signal-parameters.cc +++ b/src/lte/model/lte-spectrum-signal-parameters.cc @@ -16,6 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Nicola Baldo + * Modified by Marco Miozzo (add data and ctrl diversity) */ #include @@ -79,9 +80,9 @@ LteSpectrumSignalParametersDataFrame::Copy () { NS_LOG_FUNCTION (this); // Ideally we would use: - // return Copy (*this); + // return Copy (*this); // but for some reason it doesn't work. Another alternative is - // return Copy (this); + // return Copy (this); // but it causes a double creation of the object, hence it is less efficient. // The solution below is copied from the implementation of Copy<> (Ptr<>) in ptr.h Ptr lssp (new LteSpectrumSignalParametersDataFrame (*this), false); @@ -108,9 +109,9 @@ LteSpectrumSignalParametersDlCtrlFrame::Copy () { NS_LOG_FUNCTION (this); // Ideally we would use: - // return Copy (*this); + // return Copy (*this); // but for some reason it doesn't work. Another alternative is - // return Copy (this); + // return Copy (this); // but it causes a double creation of the object, hence it is less efficient. // The solution below is copied from the implementation of Copy<> (Ptr<>) in ptr.h Ptr lssp (new LteSpectrumSignalParametersDlCtrlFrame (*this), false); @@ -135,9 +136,9 @@ LteSpectrumSignalParametersUlSrsFrame::Copy () { NS_LOG_FUNCTION (this); // Ideally we would use: - // return Copy (*this); + // return Copy (*this); // but for some reason it doesn't work. Another alternative is - // return Copy (this); + // return Copy (this); // but it causes a double creation of the object, hence it is less efficient. // The solution below is copied from the implementation of Copy<> (Ptr<>) in ptr.h Ptr lssp (new LteSpectrumSignalParametersUlSrsFrame (*this), false); diff --git a/src/lte/model/lte-spectrum-signal-parameters.h b/src/lte/model/lte-spectrum-signal-parameters.h index f30e2333c..fa22784e9 100644 --- a/src/lte/model/lte-spectrum-signal-parameters.h +++ b/src/lte/model/lte-spectrum-signal-parameters.h @@ -16,6 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Nicola Baldo + * Modified by Marco Miozzo (add data and ctrl diversity) */ #ifndef LTE_SPECTRUM_SIGNAL_PARAMETERS_H @@ -23,7 +24,6 @@ #include -// #include namespace ns3 { diff --git a/src/lte/model/lte-ue-phy-sap.h b/src/lte/model/lte-ue-phy-sap.h index bececbdfa..7f1648e6a 100644 --- a/src/lte/model/lte-ue-phy-sap.h +++ b/src/lte/model/lte-ue-phy-sap.h @@ -61,7 +61,7 @@ public: /** * \param txMode the transmissionMode of the user */ - virtual void SetSrsConfigurationIndex (uint16_t srsCI) = 0; + virtual void SetSrsConfigurationIndex (uint16_t srcCi) = 0; /** * \brief Send SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel diff --git a/src/lte/model/lte-ue-phy.cc b/src/lte/model/lte-ue-phy.cc index 3c15c96c5..667919721 100644 --- a/src/lte/model/lte-ue-phy.cc +++ b/src/lte/model/lte-ue-phy.cc @@ -57,7 +57,7 @@ public: virtual void SetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth); virtual void SendLteControlMessage (Ptr msg); virtual void SetTransmissionMode (uint8_t txMode); - virtual void SetSrsConfigurationIndex (uint16_t srsCI); + virtual void SetSrsConfigurationIndex (uint16_t srcCi); private: LteUePhy* m_phy; @@ -94,9 +94,9 @@ UeMemberLteUePhySapProvider::SetTransmissionMode (uint8_t txMode) } void -UeMemberLteUePhySapProvider::SetSrsConfigurationIndex (uint16_t srsCI) +UeMemberLteUePhySapProvider::SetSrsConfigurationIndex (uint16_t srcCi) { - m_phy->DoSetSrsConfigurationIndex (srsCI); + m_phy->DoSetSrsConfigurationIndex (srcCi); } //////////////////////////////////////// @@ -616,7 +616,7 @@ LteUePhy::SubframeIndication (uint32_t frameNo, uint32_t subframeNo) if (srs) { Simulator::Schedule (Seconds (0.000928572), // (0.001/14) * 13 - &LteUePhy::SendSrsChannel, this); + &LteUePhy::SendSrs, this); } @@ -651,7 +651,7 @@ LteUePhy::SubframeIndication (uint32_t frameNo, uint32_t subframeNo) } void -LteUePhy::SendSrsChannel () +LteUePhy::SendSrs () { NS_LOG_FUNCTION (this << " UE " << m_rnti << " start tx SRS, cell Id " << m_cellId); // set the current tx power spectral density (full bandwidth) @@ -693,12 +693,12 @@ LteUePhy::DoSetTransmissionMode (uint8_t txMode) } void -LteUePhy::DoSetSrsConfigurationIndex (uint16_t srsCI) +LteUePhy::DoSetSrsConfigurationIndex (uint16_t srcCi) { - NS_LOG_FUNCTION (this << srsCI); - m_srsPeriodicity = GetSrsPeriodicity (srsCI); - m_srsCounter = GetSrsSubframeOffset (srsCI) + 1; - NS_LOG_DEBUG (this << " UE SRS P " << m_srsPeriodicity << " RNTI " << m_rnti << " offset " << GetSrsSubframeOffset (srsCI) << " cellId " << m_cellId << " CI " << srsCI); + NS_LOG_FUNCTION (this << srcCi); + m_srsPeriodicity = GetSrsPeriodicity (srcCi); + m_srsCounter = GetSrsSubframeOffset (srcCi) + 1; + NS_LOG_DEBUG (this << " UE SRS P " << m_srsPeriodicity << " RNTI " << m_rnti << " offset " << GetSrsSubframeOffset (srcCi) << " cellId " << m_cellId << " CI " << srcCi); } diff --git a/src/lte/model/lte-ue-phy.h b/src/lte/model/lte-ue-phy.h index a458b41f1..78caa271d 100644 --- a/src/lte/model/lte-ue-phy.h +++ b/src/lte/model/lte-ue-phy.h @@ -163,7 +163,7 @@ public: virtual void ReceiveLteControlMessageList (std::list >); virtual void DoSetTransmissionMode (uint8_t txMode); - virtual void DoSetSrsConfigurationIndex (uint16_t srsCI); + virtual void DoSetSrsConfigurationIndex (uint16_t srcCi); @@ -197,7 +197,10 @@ public: */ void SetEnbCellId (uint16_t cellId); - void SendSrsChannel (); + /** + * \brief Send the SRS signal in the last symbols of the frame + */ + void SendSrs (); diff --git a/src/lte/model/lte-ue-rrc.cc b/src/lte/model/lte-ue-rrc.cc index a94073d5e..27aef298c 100644 --- a/src/lte/model/lte-ue-rrc.cc +++ b/src/lte/model/lte-ue-rrc.cc @@ -99,7 +99,6 @@ NS_OBJECT_ENSURE_REGISTERED (LteUeRrc); LteUeRrc::LteUeRrc () : m_cmacSapProvider (0), m_macSapProvider (0), - m_rnti (0), m_cellId (0) { NS_LOG_FUNCTION (this);