Commit 88b1b593 authored by Guy De Souza's avatar Guy De Souza

DMRS mapping update for precoder granularity same as reg bundle

parent b464e1ad
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
void nr_init_pbch_dmrs(PHY_VARS_gNB* gNB) 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 Nid, i_ssb, i_ssb2;
unsigned char Lmax, l, n_hf, N_hf; unsigned char Lmax, l, n_hf, N_hf;
nfapi_nr_config_request_t *cfg = &gNB->gNB_config; 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) ...@@ -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 slot=0; fp->slots_per_frame; slot++) {
for (uint8_t symb=0; fp->symbols_per_slot; symb++) { 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<NR_MAX_PDCCH_DMRS_LENGTH_DWORD; n++) { for (uint32_t n=0; n<NR_MAX_PDCCH_DMRS_LENGTH_DWORD; n++) {
pdcch_dmrs[slot][symb][n] = lte_gold_generic(&x1, &x2, reset); pdcch_dmrs[slot][symb][n] = lte_gold_generic(&x1, &x2, reset);
......
...@@ -166,7 +166,7 @@ uint8_t nr_generate_dci_top(NR_gNB_DCI_ALLOC_t dci_alloc, ...@@ -166,7 +166,7 @@ uint8_t nr_generate_dci_top(NR_gNB_DCI_ALLOC_t dci_alloc,
uint16_t mod_dmrs[NR_MAX_PDCCH_DMRS_LENGTH<<1]; uint16_t mod_dmrs[NR_MAX_PDCCH_DMRS_LENGTH<<1];
uint8_t idx=0; uint8_t idx=0;
uint16_t a; uint16_t a;
int k,l; int k,l,k_prime,dci_idx, dmrs_idx;
nr_cce_t cce; nr_cce_t cce;
/// DMRS QPSK modulation /// DMRS QPSK modulation
...@@ -214,19 +214,43 @@ uint8_t nr_generate_dci_top(NR_gNB_DCI_ALLOC_t dci_alloc, ...@@ -214,19 +214,43 @@ uint8_t nr_generate_dci_top(NR_gNB_DCI_ALLOC_t dci_alloc,
if (cset_start_sc >= frame_parms.ofdm_symbol_size) if (cset_start_sc >= frame_parms.ofdm_symbol_size)
cset_start_sc -= frame_parms.ofdm_symbol_size; cset_start_sc -= frame_parms.ofdm_symbol_size;
for (int cce_idx=0; cce_idx<dci_alloc.L; cce_idx++){ if (pdcch_vars.coreset_params.precoder_granularity == nr_cset_same_as_reg_bundle) {
cce = pdcch_vars.cce_list[cce_idx];
k = cset_start_sc + cce.start_sc_idx; dci_idx = 0;
l = cset_start_symb + cce.symb_idx; dmrs_idx = 0;
for (int m=0; m<NR_NB_SC_PER_RB; m++) {
((int16_t*)txdataF[aa])[(l*frame_parms.ofdm_symbol_size + k)<<1] = (a * mod_dci[m<<1]) >> 15; for (int cce_idx=0; cce_idx<dci_alloc.L; cce_idx++){
((int16_t*)txdataF[aa])[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = (a * mod_dci[(m<<1) + 1]) >> 15; cce = pdcch_vars.cce_list[cce_idx];
k++; for (int reg_idx=0; reg_idx<NR_NB_REG_PER_CCE; reg_idx++) {
if (k >= frame_parms.ofdm_symbol_size) if (pdcch_vars.coreset_params.config_type == nr_cset_config_mib_sib1)
k -= frame_parms.ofdm_symbol_size; k = cset_start_sc + cce.reg_list[reg_idx].start_sc_idx;
else
k = frame_parms.first_carrier_offset; // Not clear, to review
l = cset_start_symb + cce.reg_list[reg_idx].symb_idx;
k_prime = 0;
for (int m=0; m<NR_NB_SC_PER_RB; m++) {
if ( m == (k_prime<<2)+1) { // DMRS
((int16_t*)txdataF[aa])[(l*frame_parms.ofdm_symbol_size + k)<<1] = (a * mod_dmrs[dmrs_idx<<1]) >> 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; return 0;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define __PHY_NR_TRANSPORT_DCI__H #define __PHY_NR_TRANSPORT_DCI__H
#include "PHY/defs_gNB.h" #include "PHY/defs_gNB.h"
#include "PHY/NR_REFSIG/nr_refsig.h"
typedef enum { typedef enum {
nr_dci_format_0_0=0, nr_dci_format_0_0=0,
...@@ -66,6 +66,16 @@ typedef enum { ...@@ -66,6 +66,16 @@ typedef enum {
nr_cce_reg_mapping_non_interleaved nr_cce_reg_mapping_non_interleaved
} nr_cce_reg_mapping_type_e; } 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 { typedef struct {
uint8_t param_O; uint8_t param_O;
uint8_t param_M; uint8_t param_M;
...@@ -80,11 +90,19 @@ typedef struct { ...@@ -80,11 +90,19 @@ typedef struct {
uint8_t rb_offset; uint8_t rb_offset;
nr_cce_reg_mapping_type_e cr_mapping_type; nr_cce_reg_mapping_type_e cr_mapping_type;
nr_ssb_and_cset_mux_pattern_type_e mux_pattern; 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; } nr_pdcch_coreset_params_t;
typedef struct { typedef struct {
uint8_t reg_idx;
uint8_t start_sc_idx; uint8_t start_sc_idx;
uint8_t symb_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; } nr_cce_t;
typedef struct { typedef struct {
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "CODING/nrPolar_tools/nr_polar_pbch_defs.h" #include "CODING/nrPolar_tools/nr_polar_pbch_defs.h"
#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h" #include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h"
typedef struct { typedef struct {
uint8_t pbch_a[NR_POLAR_PBCH_PAYLOAD_BITS>>3]; uint8_t pbch_a[NR_POLAR_PBCH_PAYLOAD_BITS>>3];
uint8_t pbch_a_interleaved[NR_POLAR_PBCH_PAYLOAD_BITS>>3]; uint8_t pbch_a_interleaved[NR_POLAR_PBCH_PAYLOAD_BITS>>3];
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#define MAX_NUM_SUBCARRIER_SPACING 5 #define MAX_NUM_SUBCARRIER_SPACING 5
#define NR_NB_SC_PER_RB 12 #define NR_NB_SC_PER_RB 12
#define NR_NB_REG_PER_CCE 6
#define NR_SYMBOLS_PER_SLOT 14 #define NR_SYMBOLS_PER_SLOT 14
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment