diff --git a/openair1/PHY/NR_REFSIG/nr_gold.c b/openair1/PHY/NR_REFSIG/nr_gold.c index cad245ec84..cb2738b72a 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold.c +++ b/openair1/PHY/NR_REFSIG/nr_gold.c @@ -23,7 +23,7 @@ void nr_init_pbch_dmrs(PHY_VARS_gNB* gNB) { - unsigned int n, x1, x2; + unsigned int x1, x2; unsigned char Nid, i_ssb, i_ssb2; unsigned char Lmax, l, n_hf, N_hf; nfapi_nr_config_request_t *cfg = &gNB->gNB_config; @@ -63,7 +63,7 @@ void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid) for (uint8_t slot=0; fp->slots_per_frame; slot++) { for (uint8_t symb=0; fp->symbols_per_slot; symb++) { - x2 = ((1<<17) * (14*slot+symb+1) * ((Nid<<1)+1) + (Nid<<1))%(1<<31); + x2 = ((1<<17) * (14*slot+symb+1) * ((Nid<<1)+1) + (Nid<<1))&(((uint32_t)1<<31)-1); for (uint32_t n=0; n= frame_parms.ofdm_symbol_size) cset_start_sc -= frame_parms.ofdm_symbol_size; - for (int cce_idx=0; cce_idx> 15; - ((int16_t*)txdataF[aa])[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = (a * mod_dci[(m<<1) + 1]) >> 15; - k++; - if (k >= frame_parms.ofdm_symbol_size) - k -= frame_parms.ofdm_symbol_size; + if (pdcch_vars.coreset_params.precoder_granularity == nr_cset_same_as_reg_bundle) { + + dci_idx = 0; + dmrs_idx = 0; + + for (int cce_idx=0; cce_idx> 15; + ((int16_t*)txdataF[aa])[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = (a * mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; + k_prime++; + dmrs_idx++; + } + else { // DCI payload + ((int16_t*)txdataF[aa])[(l*frame_parms.ofdm_symbol_size + k)<<1] = (a * mod_dci[dci_idx<<1]) >> 15; + ((int16_t*)txdataF[aa])[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = (a * mod_dci[(dci_idx<<1) + 1]) >> 15; + dci_idx++; + } + k++; + if (k >= frame_parms.ofdm_symbol_size) + k -= frame_parms.ofdm_symbol_size; + } + } } } + else { //nr_cset_all_contiguous_rbs + } + } return 0; diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.h b/openair1/PHY/NR_TRANSPORT/nr_dci.h index ab7cb5023a..2ab116c0a9 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.h @@ -23,7 +23,7 @@ #define __PHY_NR_TRANSPORT_DCI__H #include "PHY/defs_gNB.h" - +#include "PHY/NR_REFSIG/nr_refsig.h" typedef enum { nr_dci_format_0_0=0, @@ -66,6 +66,16 @@ typedef enum { nr_cce_reg_mapping_non_interleaved } nr_cce_reg_mapping_type_e; +typedef enum { + nr_cset_config_mib_sib1=0, + nr_cset_config_pdcch_config +} nr_coreset_config_type_e; + +typedef enum { + nr_cset_same_as_reg_bundle=0, + nr_cset_all_contiguous_rbs +} nr_coreset_precoder_granularity_type_e; + typedef struct { uint8_t param_O; uint8_t param_M; @@ -80,11 +90,19 @@ typedef struct { uint8_t rb_offset; nr_cce_reg_mapping_type_e cr_mapping_type; nr_ssb_and_cset_mux_pattern_type_e mux_pattern; + nr_coreset_precoder_granularity_type_e precoder_granularity; + nr_coreset_config_type_e config_type; } nr_pdcch_coreset_params_t; typedef struct { + uint8_t reg_idx; uint8_t start_sc_idx; uint8_t symb_idx; +} nr_reg_t; + +typedef struct { + uint8_t cce_idx; + nr_reg_t reg_list[NR_NB_REG_PER_CCE]; } nr_cce_t; typedef struct { diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index c4969ef672..40186d8765 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -37,6 +37,7 @@ #include "CODING/nrPolar_tools/nr_polar_pbch_defs.h" #include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h" + typedef struct { uint8_t pbch_a[NR_POLAR_PBCH_PAYLOAD_BITS>>3]; uint8_t pbch_a_interleaved[NR_POLAR_PBCH_PAYLOAD_BITS>>3]; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index b30ed9e4a3..1bb4160f42 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -43,6 +43,7 @@ #define MAX_NUM_SUBCARRIER_SPACING 5 #define NR_NB_SC_PER_RB 12 +#define NR_NB_REG_PER_CCE 6 #define NR_SYMBOLS_PER_SLOT 14