From 63b8be329687761044496a47a43a070d2fe9f29f Mon Sep 17 00:00:00 2001 From: Guy De Souza Date: Tue, 6 Nov 2018 15:38:04 +0100 Subject: [PATCH] DMRS sequence generation --- openair1/PHY/INIT/nr_init.c | 12 ++++++++---- openair1/PHY/NR_REFSIG/nr_gold.c | 22 ++++++++++++---------- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 4 ++-- openair1/PHY/NR_TRANSPORT/nr_dlsch.h | 2 +- openair1/PHY/defs_gNB.h | 2 +- openair1/PHY/defs_nr_common.h | 4 ++-- 6 files changed, 26 insertions(+), 20 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 6765d8b865..307935068f 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -147,14 +147,18 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, //PDSCH DMRS init - gNB->nr_gold_pdsch_dmrs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t**)); - uint32_t ***pdsch_dmrs = gNB->nr_gold_pdsch_dmrs; + gNB->nr_gold_pdsch_dmrs = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t***)); + uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs; for (int slot=0; slotslots_per_frame; slot++) { - pdsch_dmrs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t*)); + pdsch_dmrs[slot] = (uint32_t ***)malloc16(fp->symbols_per_slot*sizeof(uint32_t**)); AssertFatal(pdsch_dmrs[slot]!=NULL, "NR init: pdsch_dmrs for slot %d - malloc failed\n", slot); for (int symb=0; symbsymbols_per_slot; symb++){ - pdsch_dmrs[slot][symb] = (uint32_t *)malloc16(NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t)); + pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_MAX_NB_CODEWORDS*sizeof(uint32_t*)); AssertFatal(pdsch_dmrs[slot][symb]!=NULL, "NR init: pdsch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb); + for (int q=0; qsymbols_per_slot; symb++) { reset = 1; - x2 = ((1<<17) * (14*slot+symb+1) * ((Nid<<1)+1) + (Nid<<1))&(((uint32_t)1<<31)-1); + x2 = ((1<<17) * (14*slot+symb+1) * ((Nid<<1)+1) + (Nid<<1)); for (uint32_t n=0; nframe_parms; - uint32_t ***pdsch_dmrs = gNB->nr_gold_pdsch_dmrs; - //x2 compute by 38.211 7.4.1.1.1 - Nscid = 0; + uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs; + + uint16_t N_n_scid[NR_MAX_NB_CODEWORDS]={Nid, Nid}; // Not correct, appropriate scrambling IDs have to be updated to support DCI 1_1 + uint8_t n_scid=0; // again works only for 1_0 for (uint8_t slot=0; slotslots_per_frame; slot++) { for (uint8_t symb=0; symbsymbols_per_slot; symb++) { + for (uint8_t q=0; qsymbols_per_slot*slot+symb+1) * ((N_n_scid[n_scid]<<1)+1) +((N_n_scid[n_scid]<<1)+n_scid)); + for (uint32_t n=0; nnb_layers; l++) int16_t mod_dmrs[n_dmrs<<1]; uint8_t dmrs_type = config.pdsch_config.dmrs_type.value; l0 = get_l0(dmrs_type, 2);//config.pdsch_config.dmrs_typeA_position.value); - nr_modulation(pdsch_dmrs[l0], n_dmrs, MOD_QPSK, mod_dmrs); + nr_modulation(pdsch_dmrs[l0][0], n_dmrs, MOD_QPSK, mod_dmrs); // currently only codeword 0 is modulated #ifdef DEBUG_DLSCH printf("DMRS modulation (single symbol %d, %d symbols, type %d):\n", l0, n_dmrs, dmrs_type); for (int i=0; i>3; i++) { diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h index 375d2d0fef..95af0fa9f5 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h @@ -79,7 +79,7 @@ void nr_pdsch_layer_mapping(int16_t **mod_symbs, uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t dlsch, NR_gNB_DCI_ALLOC_t dci_alloc, - uint32_t **pdsch_dmrs, + uint32_t ***pdsch_dmrs, int32_t** txdataF, int16_t amp, uint8_t subframe, diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 2b859256ed..dac25651b3 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -405,7 +405,7 @@ typedef struct PHY_VARS_gNB_s { uint32_t ***nr_gold_pdcch_dmrs; /// PDSCH DMRS sequence - uint32_t ***nr_gold_pdsch_dmrs; + uint32_t ****nr_gold_pdsch_dmrs; /// Indicator set to 0 after first SR uint8_t first_sr[NUMBER_OF_UE_MAX]; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 17e0267712..742c3fa3c0 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -73,8 +73,8 @@ /*used for the resource mapping*/ #define NR_MAX_PDCCH_DMRS_LENGTH 576 // 16(L)*2(QPSK)*3(3 DMRS symbs per REG)*6(REG per CCE) -#define NR_MAX_PDSCH_DMRS_LENGTH 1100 //275*2(k)*2(QPSK) -#define NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD 35 // ceil(NR_MAX_PDSCH_DMRS_LENGTH/32) +#define NR_MAX_PDSCH_DMRS_LENGTH 3300 //275*6(k)*2(QPSK) +#define NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD 104 // ceil(NR_MAX_PDSCH_DMRS_LENGTH/32) #define NR_MAX_DCI_PAYLOAD_SIZE 64 #define NR_MAX_DCI_SIZE 1728 //16(L)*2(QPSK)*9(12 RE per REG - 3(DMRS))*6(REG per CCE)