nr_transport_ue.h 5.14 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */

/*! \file PHY/NR_TRANSPORT/defs.h
* \brief data structures for PDSCH/DLSCH/PUSCH/ULSCH physical and transport channel descriptors (TX/RX)
* \author R. Knopp
* \date 2011
* \version 0.1
* \company Eurecom
* \email: raymond.knopp@eurecom.fr, florian.kaltenberger@eurecom.fr, oscar.tonelli@yahoo.it
* \note
* \warning
*/
#ifndef __NR_TRANSPORT_UE__H__
#define __NR_TRANSPORT_UE__H__
34 35
#include <limits.h>
#include "PHY/impl_defs_top.h"
Jacques's avatar
Jacques committed
36

37
#include "PHY/CODING/nrLDPC_decoder/nrLDPC_types.h"
francescomani's avatar
francescomani committed
38
#include "nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h"
Hongzhi Wang's avatar
Hongzhi Wang committed
39
#include "../NR_TRANSPORT/nr_transport_common_proto.h"
40

41

Jacques's avatar
Jacques committed
42 43 44 45 46
typedef enum {
 NEW_TRANSMISSION_HARQ,
 RETRANSMISSION_HARQ
} harq_result_t;

47 48 49
typedef struct {
  /// Indicator of first transmission
  uint8_t first_tx;
Jacques's avatar
Jacques committed
50 51
  /// HARQ tx status
  harq_result_t tx_status;
52 53 54 55 56 57 58 59 60 61
  /// Status Flag indicating for this ULSCH (idle,active,disabled)
  SCH_status_t status;
  /// Last TPC command
  uint8_t TPC;
  /// The payload + CRC size in bits, "B" from 36-212
  uint32_t B;
  /// Length of ACK information (bits)
  uint8_t O_ACK;
  /// Index of current HARQ round for this ULSCH
  uint8_t round;
Sakthivel Velumani's avatar
Sakthivel Velumani committed
62 63
  /// Last Ndi for this harq process
  uint8_t ndi;
64
  /// pointer to pdu from MAC interface (TS 36.212 V15.4.0, Sec 5.1 p. 8)
65
  unsigned char *a;
66 67 68
  /// Pointer to the payload + CRC 
  uint8_t *b;
  /// Pointers to transport block segments
francescomani's avatar
francescomani committed
69
  uint8_t **c;
70
  /// LDPC-code outputs
francescomani's avatar
francescomani committed
71
  uint8_t **d;
72
  /// LDPC-code outputs (TS 36.212 V15.4.0, Sec 5.3.2 p. 17)
73
  uint8_t *e;
74
  /// Rate matching (Interleaving) outputs (TS 36.212 V15.4.0, Sec 5.4.2.2 p. 30)
75
  uint8_t *f;
Hongzhi Wang's avatar
Hongzhi Wang committed
76
  /// Number of code segments
77
  uint32_t C;
Hongzhi Wang's avatar
Hongzhi Wang committed
78 79
  /// Number of bits in code segments
  uint32_t K;
80 81
  /// Total number of bits across all segments
  uint32_t sumKr;
Hongzhi Wang's avatar
Hongzhi Wang committed
82
  /// Number of "Filler" bits
83
  uint32_t F;
Hongzhi Wang's avatar
Hongzhi Wang committed
84
  /// n_DMRS  for cyclic shift of DMRS
85
  uint8_t n_DMRS;
Hongzhi Wang's avatar
Hongzhi Wang committed
86
  /// n_DMRS2 for cyclic shift of DMRS
87 88 89
  uint8_t n_DMRS2;
  /// Number of soft channel bits
  uint32_t G;
Khalid Ahmed's avatar
Khalid Ahmed committed
90
  // Number of modulated symbols carrying data
91
  uint32_t num_of_mod_symbols;
92 93
  // Encoder BG
  uint8_t BG;
94 95
  // LDPC lifting size
  uint32_t Z;
96 97 98
} NR_UL_UE_HARQ_t;

typedef struct {
99 100
  /// NDAPI struct for UE
  nfapi_nr_ue_pusch_pdu_t pusch_pdu;
101 102
  // UL number of harq processes
  uint8_t number_harq_processes_for_pusch;
Jacques's avatar
Jacques committed
103 104
  /// RNTI type
  uint8_t rnti_type;
105 106
  /// Cell ID
  int     Nid_cell;
adk's avatar
adk committed
107 108
  /// bit mask of PT-RS ofdm symbol indicies
  uint16_t ptrs_symbols;
109 110 111
} NR_UE_ULSCH_t;

typedef struct {
112 113
  /// Indicator of first reception
  uint8_t first_rx;
114
  /// Last Ndi received for this process on DCI (used for C-RNTI only)
115
  uint8_t Ndi;
116 117 118 119 120 121 122
  /// DLSCH status flag indicating
  SCH_status_t status;
  /// Transport block size
  uint32_t TBS;
  /// The payload + CRC size in bits
  uint32_t B;
  /// Pointers to transport block segments
123
  uint8_t **c;
francescomani's avatar
francescomani committed
124
  /// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
125
  /// Accumulates the soft bits for each round to increase decoding success (HARQ)
francescomani's avatar
francescomani committed
126
  int16_t **d;
127
  /// Index of current HARQ round for this DLSCH
128
  uint8_t DLround;
Hongzhi Wang's avatar
Hongzhi Wang committed
129
  /// Number of code segments 
130
  uint32_t C;
Hongzhi Wang's avatar
Hongzhi Wang committed
131 132 133
  /// Number of bits in code segments
  uint32_t K;
  /// Number of "Filler" bits 
134
  uint32_t F;
Hongzhi Wang's avatar
Hongzhi Wang committed
135 136
  /// LDPC lifting factor
  uint32_t Z;
137 138 139 140
  /// Number of soft channel bits
  uint32_t G;
  /// codeword this transport block is mapped to
  uint8_t codeword;
141
  /// HARQ-ACKs
142
  uint8_t ack;
143 144 145
  /// Last index of LLR buffer that contains information.
  /// Used for computing LDPC decoder R
  int llrLen;
146
  decode_abort_t abort_decode;
147 148 149 150 151
} NR_DL_UE_HARQ_t;

typedef struct {
  /// RNTI
  uint16_t rnti;
Jacques's avatar
Jacques committed
152 153
  /// RNTI type
  uint8_t rnti_type;
154
  /// Active flag for DLSCH demodulation
155 156 157 158 159
  bool active;
  /// Structure to hold dlsch config from MAC
  fapi_nr_dl_config_dlsch_pdu_rel15_t dlsch_config;
  /// Number of MIMO layers (streams) 
  uint8_t Nl;
Hongzhi Wang's avatar
Hongzhi Wang committed
160 161
  /// Maximum number of LDPC iterations
  uint8_t max_ldpc_iterations;
162
  /// number of iterations used in last turbo decoding
163
  uint8_t last_iteration_cnt;
164 165 166 167
  /// bit mask of PT-RS ofdm symbol indicies
  uint16_t ptrs_symbols;
  // PTRS symbol index, to be updated every PTRS symbol within a slot.
  uint8_t ptrs_symbol_index;
168 169 170 171 172
} NR_UE_DLSCH_t;


/**@}*/
#endif