nr_dlsch.h 3.86 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 34
/*
 * 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/LTE_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
*/

#include "PHY/defs_gNB.h"

35
extern short nr_mod_table[NR_MOD_TABLE_SIZE_SHORT];
36

37
void nr_get_time_domain_allocation_type(nfapi_nr_config_request_t config,
Guy De Souza's avatar
Guy De Souza committed
38 39
                                        nfapi_nr_dl_config_dci_dl_pdu dci_pdu,
                                        nfapi_nr_dl_config_dlsch_pdu *dlsch_pdu);
40 41 42

void nr_check_time_alloc(uint8_t S, uint8_t L, nfapi_nr_config_request_t config);

Guy De Souza's avatar
Guy De Souza committed
43 44 45 46
uint16_t get_RIV(uint16_t rb_start, uint16_t L, uint16_t N_RB);

uint16_t get_SLIV(uint8_t S, uint8_t L);

Guy De Souza's avatar
Guy De Souza committed
47 48 49 50 51
uint8_t nr_get_S(uint8_t row_idx, uint8_t CP, uint8_t time_alloc_type, uint8_t dmrs_typeA_position);

void nr_get_rbg_parms(NR_BWP_PARMS* bwp, uint8_t config_type);

void nr_get_rbg_list(uint32_t bitmap, uint8_t n_rbg, uint8_t* rbg_list);
Guy De Souza's avatar
Guy De Souza committed
52 53

void nr_get_PRG_parms(NR_BWP_PARMS* bwp, NR_gNB_DCI_ALLOC_t dci_alloc, uint8_t prb_bundling_type);
54 55 56 57

uint8_t nr_get_Qm(uint8_t Imcs, uint8_t table_idx);

uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx);
58

Guy De Souza's avatar
Guy De Souza committed
59
void nr_get_tbs(nfapi_nr_dl_config_dlsch_pdu *dlsch_pdu,
60
                nfapi_nr_dl_config_dci_dl_pdu dci_pdu,
Guy De Souza's avatar
Guy De Souza committed
61
                nfapi_nr_config_request_t config);
Guy De Souza's avatar
Guy De Souza committed
62

Guy De Souza's avatar
Guy De Souza committed
63
void nr_pdsch_codeword_scrambling(uint8_t *in,
Guy De Souza's avatar
Guy De Souza committed
64
                         uint16_t size,
65 66 67 68 69 70 71 72
                         uint8_t q,
                         uint32_t Nid,
                         uint32_t n_RNTI,
                         uint32_t* out);

void nr_pdsch_codeword_modulation(uint32_t *in,
                         uint8_t  Qm,
                         uint32_t length,
Guy De Souza's avatar
Guy De Souza committed
73
                         int16_t *out);
74

Guy De Souza's avatar
Guy De Souza committed
75
void nr_pdsch_layer_mapping(int16_t **mod_symbs,
76
                         uint8_t n_layers,
Guy De Souza's avatar
Guy De Souza committed
77
                         uint16_t n_symbs,
Guy De Souza's avatar
Guy De Souza committed
78
                         int16_t **tx_layers);
Guy De Souza's avatar
Guy De Souza committed
79

Guy De Souza's avatar
Guy De Souza committed
80 81
uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t dlsch,
                          NR_gNB_DCI_ALLOC_t dci_alloc,
Guy De Souza's avatar
Guy De Souza committed
82
                          uint32_t ***pdsch_dmrs,
Guy De Souza's avatar
Guy De Souza committed
83 84 85 86 87 88
                          int32_t** txdataF,
                          int16_t amp,
                          uint8_t subframe,
                          NR_DL_FRAME_PARMS frame_parms,
                          nfapi_nr_config_request_t config);

89 90
/** \brief Computes available bits G.
    @param nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs */
91 92
uint32_t nr_get_G(uint16_t nb_rb, uint16_t nb_symb_sch,uint8_t nb_re_dmrs,uint16_t length_dmrs,uint8_t Qm, uint8_t Nl);

Guy De Souza's avatar
Guy De Souza committed
93
int nr_dlsch_encoding(unsigned char *a,
Guy De Souza's avatar
Guy De Souza committed
94
                     uint8_t subframe,
Guy De Souza's avatar
Guy De Souza committed
95 96
                     NR_gNB_DLSCH_t *dlsch,
                     NR_DL_FRAME_PARMS* frame_parms);
97

98 99
void nr_emulate_dlsch_payload(uint8_t* payload, uint16_t size);