nr_dci.h 3.67 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/*
 * 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
 */
yilmazt's avatar
yilmazt committed
21

22 23 24
#ifndef __PHY_NR_TRANSPORT_DCI__H
#define __PHY_NR_TRANSPORT_DCI__H

25
#include "PHY/defs_gNB.h"
26 27 28 29 30 31 32 33


typedef enum {
  nr_dci_format_0_0=0,
  nr_dci_format_0_1,
  nr_dci_format_2_0,
  nr_dci_format_2_1,
  nr_dci_format_2_2,
Guy De Souza's avatar
Guy De Souza committed
34 35 36
  nr_dci_format_2_3,
  nr_dci_format_1_0,
  nr_dci_format_1_1,
37 38 39 40 41 42 43 44 45 46 47
} nr_dci_format_e;

typedef enum {
  nr_rnti_type_SI_RNTI=0,
  nr_rnti_type_RA_RNTI,
  nr_rnti_type_C_RNTI,
  nr_rnti_type_TC_RNTI,
  nr_rnti_type_CS_RNTI,
  nr_rnti_type_P_RNTI
} nr_rnti_type_e;

48 49 50 51 52 53 54 55 56 57 58
// PDCCH search space types css: common, uss: ue specific
typedef enum {
  nr_pdcch_css_type_0=0,
  nr_pdcch_css_type_0_A,
  nr_pdcch_css_type_1,
  nr_pdcch_css_type_2,
  nr_pdcch_css_type_3,
  nr_pdcch_uss_type
} nr_pdcch_ss_type_e;

typedef enum {
59 60 61 62
  nr_ssb_and_cset_mux_pattern_type_1=0,
  nr_ssb_and_cset_mux_pattern_type_2,
  nr_ssb_and_cset_mux_pattern_type_3
} nr_ssb_and_cset_mux_pattern_type_e;
63

64 65 66 67 68
typedef enum {
  nr_cce_reg_mapping_interleaved=0,
  nr_cce_reg_mapping_non_interleaved
} nr_cce_reg_mapping_type_e;

69 70 71 72 73 74 75 76 77 78 79 80
typedef struct {
  uint8_t param_O;
  uint8_t param_M;
  uint8_t nb_ss_sets_per_slot;
  uint8_t first_symbol_idx;
  nr_pdcch_ss_type_e ss_type;
} nr_pdcch_ss_params_t;

typedef struct {
  uint8_t n_rb;
  uint8_t n_symb;
  uint8_t rb_offset;
81
  nr_ssb_and_cset_mux_pattern_type_e mux_pattern;
82 83 84
} nr_pdcch_coreset_params_t;

typedef struct {
85 86 87
  uint8_t first_slot;
  uint8_t nb_slots;
  uint8_t sfn_mod2;
88 89
  uint32_t dmrs_scrambling_id;
  nr_cce_reg_mapping_type_e cr_mapping_type;
90 91
  nr_pdcch_ss_params_t ss_params;
  nr_pdcch_coreset_params_t coreset_params;
92
} nr_pdcch_vars_t;
93 94 95 96 97 98

typedef struct {
  /// Length of DCI in bits
  uint8_t size;
  /// Aggregation level
  uint8_t L;
99
  /// rnti type
100 101
  nr_rnti_type_e rnti;
  /// Format
102 103 104
  nr_dci_format_e format;
  /// type
  nr_pdcch_ss_type_e ss_type;
105
  /// DCI pdu
106
  uint32_t dci_pdu[4];
Guy De Souza's avatar
Guy De Souza committed
107
} NR_gNB_DCI_ALLOC_t;
108

yilmazt's avatar
yilmazt committed
109
typedef unsigned __int128 uint128_t;
110 111

uint8_t nr_get_dci_size(nr_dci_format_e format,
112
                        nr_rnti_type_e rnti_type,
113
                        NR_BWP_PARMS* bwp,
Guy De Souza's avatar
Guy De Souza committed
114
                        nfapi_nr_config_request_t* config);
115

Guy De Souza's avatar
Guy De Souza committed
116
uint8_t nr_generate_dci_top(NR_gNB_DCI_ALLOC_t dci_alloc,
117
                            uint32_t *gold_pdcch_dmrs,
Guy De Souza's avatar
Guy De Souza committed
118 119
                            int32_t** txdataF,
                            int16_t amp,
120 121 122 123 124 125 126 127
                            NR_DL_FRAME_PARMS frame_parms,
                            nfapi_nr_config_request_t config,
                            nr_pdcch_vars_t pdcch_vars);

void nr_pdcch_scrambling(NR_gNB_DCI_ALLOC_t dci_alloc,
                         nr_pdcch_vars_t pdcch_vars,
                         nfapi_nr_config_request_t config,
                         uint32_t* out);
128 129

#endif //__PHY_NR_TRANSPORT_DCI__H