OLD | NEW |
(Empty) | |
| 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
| 4 * |
| 5 * This program is free software; you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 2 as |
| 7 * published by the Free Software Foundation; |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software |
| 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 * |
| 18 * Author: Marco Miozzo <marco.miozzo@cttc.es> |
| 19 * Modified by: NIST |
| 20 */ |
| 21 |
| 22 |
| 23 #ifndef NIST_LTE_HARQ_PHY_MODULE_H |
| 24 #define NIST_LTE_HARQ_PHY_MODULE_H |
| 25 |
| 26 |
| 27 |
| 28 #include <ns3/log.h> |
| 29 #include <ns3/assert.h> |
| 30 #include <math.h> |
| 31 #include <vector> |
| 32 #include <map> |
| 33 #include <ns3/simple-ref-count.h> |
| 34 |
| 35 |
| 36 namespace ns3 { |
| 37 |
| 38 |
| 39 |
| 40 struct NistHarqProcessInfoElement_t |
| 41 { |
| 42 double m_mi; |
| 43 uint8_t m_rv; |
| 44 uint16_t m_infoBits; |
| 45 uint16_t m_codeBits; |
| 46 double m_sinr; //effective mean SINR for the transmission |
| 47 }; |
| 48 |
| 49 typedef std::vector <NistHarqProcessInfoElement_t> HarqProcessInfoList_t; |
| 50 |
| 51 /** |
| 52 * \ingroup lte |
| 53 * \brief The NistLteHarqPhy class implements the HARQ functionalities related t
o PHY layer |
| 54 *(i.e., decodification buffers for incremental redundancy managment) |
| 55 * |
| 56 */ |
| 57 class NistLteHarqPhy : public SimpleRefCount<NistLteHarqPhy> |
| 58 { |
| 59 public: |
| 60 NistLteHarqPhy (); |
| 61 ~NistLteHarqPhy (); |
| 62 ·· |
| 63 void SetDiscNumRetx (uint8_t retx); |
| 64 |
| 65 void SubframeIndication (uint32_t frameNo, uint32_t subframeNo); |
| 66 |
| 67 /** |
| 68 * \brief Return the cumulated MI of the HARQ procId in case of retranmissions |
| 69 * for DL (asynchronous) |
| 70 * \param harqProcId the HARQ proc id |
| 71 * \param layer layer no. (for MIMO spatial multiplexing) |
| 72 * \return the MI accumulated |
| 73 */ |
| 74 double GetAccumulatedMiDl (uint8_t harqProcId, uint8_t layer); |
| 75 |
| 76 /** |
| 77 * \brief Return the info of the HARQ procId in case of retranmissions |
| 78 * for DL (asynchronous) |
| 79 * \param harqProcId the HARQ proc id |
| 80 * \param layer layer no. (for MIMO spatail multiplexing) |
| 81 * \return the vector of the info related to HARQ proc Id |
| 82 */ |
| 83 HarqProcessInfoList_t GetHarqProcessInfoDl (uint8_t harqProcId, uint8_t layer)
; |
| 84 |
| 85 /** |
| 86 * \brief Return the cumulated MI of the HARQ procId in case of retranmissions |
| 87 * for UL (synchronous) |
| 88 * \return the MI accumulated |
| 89 */ |
| 90 double GetAccumulatedMiUl (uint16_t rnti); |
| 91 |
| 92 /** |
| 93 * \brief Return the info of the HARQ procId in case of retranmissions |
| 94 * for UL (asynchronous) |
| 95 * \param rnti the RNTI of the transmitter |
| 96 * \param harqProcId the HARQ proc id |
| 97 * \return the vector of the info related to HARQ proc Id |
| 98 */ |
| 99 HarqProcessInfoList_t GetHarqProcessInfoUl (uint16_t rnti, uint8_t harqProcId)
; |
| 100 |
| 101 /** |
| 102 * \brief Update the Info associated to the decodification of an HARQ process |
| 103 * for DL (asynchronous) |
| 104 * \param id the HARQ proc id |
| 105 * \param layer layer no. (for MIMO spatail multiplexing) |
| 106 * \param mi the new MI |
| 107 * \param infoBytes the no. of bytes of info |
| 108 * \param mi the total no. of bytes txed |
| 109 */ |
| 110 void UpdateDlHarqProcessNistStatus (uint8_t id, uint8_t layer, double mi, uint
16_t infoBytes, uint16_t codeBytes); |
| 111 |
| 112 /** |
| 113 * \brief Update the Info associated to the decodification of an HARQ process |
| 114 * for DL (asynchronous) |
| 115 * \param id the HARQ proc id |
| 116 * \param layer layer no. (for MIMO spatail multiplexing) |
| 117 * \param sinr the new SINR |
| 118 */ |
| 119 void UpdateDlHarqProcessNistStatus (uint8_t id, uint8_t layer, double sinr); |
| 120 |
| 121 /** |
| 122 * \brief Reset the info associated to the decodification of an HARQ process |
| 123 * for DL (asynchronous) |
| 124 * \param id the HARQ proc id |
| 125 */ |
| 126 void ResetDlHarqProcessNistStatus(uint8_t id); |
| 127 |
| 128 /** |
| 129 * \brief Update the MI value associated to the decodification of an HARQ proce
ss |
| 130 * for UL· |
| 131 * \param rnti the RNTI of the transmitter |
| 132 * \param mi the new MI |
| 133 * \param infoBytes the no. of bytes of info |
| 134 * \param mi the total no. of bytes txed |
| 135 */ |
| 136 void UpdateUlHarqProcessNistStatus (uint16_t rnti, double mi, uint16_t infoByt
es, uint16_t codeBytes); |
| 137 |
| 138 /** |
| 139 * \brief Update the mean SINR value associated to the decodification of an HAR
Q process |
| 140 * for UL |
| 141 * \param rnti the RNTI of the transmitter |
| 142 * \param sinr the new SINR |
| 143 */ |
| 144 void UpdateUlHarqProcessNistStatus (uint16_t rnti, double sinr); |
| 145 |
| 146 /** |
| 147 * \brief Reset the info associated to the decodification of an HARQ process |
| 148 * for DL (asynchronous) |
| 149 * \param id the HARQ proc id |
| 150 */ |
| 151 void ResetUlHarqProcessNistStatus(uint16_t rnti, uint8_t id); |
| 152 ·· |
| 153 ·· |
| 154 /** |
| 155 * \brief Return the cumulated MI of the HARQ procId in case of retranmissions |
| 156 * for SL |
| 157 * \param rnti The UE identifier |
| 158 * \param l1dst The layer 1 destination ID· |
| 159 * \return the MI accumulated |
| 160 */ |
| 161 double GetAccumulatedMiSl (uint16_t rnti, uint8_t l1dst); |
| 162 |
| 163 /** |
| 164 * \brief Return the info of the HARQ procId in case of retranmissions |
| 165 * for SL· |
| 166 * \param rnti the RNTI of the transmitter |
| 167 * \param l1dst The layer 1 destination ID· |
| 168 * \return the vector of the info related to HARQ proc Id |
| 169 */ |
| 170 HarqProcessInfoList_t GetHarqProcessInfoSl (uint16_t rnti, uint8_t l1dst); |
| 171 · |
| 172 /** |
| 173 * \brief Return the info of the HARQ procId in case of retranmissions |
| 174 * for d2d discovery |
| 175 * \param rnti the RNTI of the transmitter |
| 176 * \param resPsdch The resource used |
| 177 * \return the vector of the info related to HARQ proc Id |
| 178 */ |
| 179 HarqProcessInfoList_t GetHarqProcessInfoDisc (uint16_t rnti, uint8_t resPsdch)
; |
| 180 |
| 181 /** |
| 182 * \brief Update the MI value associated to the decodification of an HARQ proce
ss |
| 183 * for SL· |
| 184 * \param rnti the RNTI of the transmitter |
| 185 * \param l1dst the layer 1 destination ID |
| 186 * \param mi the new MI |
| 187 * \param infoBytes the no. of bytes of info |
| 188 * \param mi the total no. of bytes txed |
| 189 */ |
| 190 void UpdateSlHarqProcessNistStatus (uint16_t rnti, uint8_t l1dst, double mi, u
int16_t infoBytes, uint16_t codeBytes); |
| 191 |
| 192 /** |
| 193 * \brief Update the SINR value associated to the decodification of an HARQ pro
cess |
| 194 * for SL· |
| 195 * \param rnti the RNTI of the transmitter |
| 196 * \param l1dst the layer 1 destination ID |
| 197 * \param sinr the new SINR |
| 198 */ |
| 199 void UpdateSlHarqProcessNistStatus (uint16_t rnti, uint8_t l1dst, double sinr)
; |
| 200 |
| 201 /** |
| 202 * \brief Update the MI value associated to the decodification of an HARQ proce
ss |
| 203 * for DL (asynchronous) |
| 204 * \param rnti the RNTI of the transmitter |
| 205 * \param resPsdch resource used |
| 206 * \param sinr the new SINR |
| 207 */ |
| 208 void UpdateDiscHarqProcessNistStatus (uint16_t rnti, uint8_t resPsdch, double
sinr); |
| 209 |
| 210 /** |
| 211 * \brief Reset the info associated to the decodification of an HARQ process |
| 212 * for SL· |
| 213 * \param id the HARQ proc id |
| 214 * \param l1dst the layer 1 destination ID |
| 215 */ |
| 216 void ResetSlHarqProcessNistStatus(uint16_t rnti, uint8_t ls1dst); |
| 217 ·· |
| 218 /** |
| 219 * \brief Reset the info associated to the decodification of an HARQ process |
| 220 * \param rnti rnti of the transmitter |
| 221 * \param resPsdch resource used |
| 222 */ |
| 223 void ResetDiscHarqProcessNistStatus(uint16_t rnti, uint8_t resPsdch); |
| 224 |
| 225 private: |
| 226 |
| 227 std::vector <std::vector <HarqProcessInfoList_t> > m_miDlHarqProcessesInfoMap; |
| 228 std::map <uint16_t, std::vector <HarqProcessInfoList_t> > m_miUlHarqProcessesI
nfoMap; |
| 229 std::map <uint16_t, std::map <uint8_t , HarqProcessInfoList_t> > m_miSlHarqPro
cessesInfoMap; |
| 230 std::map <uint16_t, std::map <uint8_t , HarqProcessInfoList_t> > m_miDiscHarqP
rocessesInfoMap;·· |
| 231 ···· |
| 232 uint8_t m_discNumRetx; |
| 233 |
| 234 }; |
| 235 |
| 236 |
| 237 } |
| 238 |
| 239 #endif /* NIST_LTE_HARQ_PHY_MODULE_H */ |
OLD | NEW |