From c9439857d7d5390e2ab618721c3ddccf71f2e0dd Mon Sep 17 00:00:00 2001 From: ahadi Date: Tue, 26 Oct 2021 15:52:22 +0000 Subject: [PATCH 1/7] Update nr_gold.c --- openair1/PHY/NR_REFSIG/nr_gold.c | 40 +++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/NR_REFSIG/nr_gold.c b/openair1/PHY/NR_REFSIG/nr_gold.c index cb2bff6625..7e3fb8ecf0 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold.c +++ b/openair1/PHY/NR_REFSIG/nr_gold.c @@ -154,4 +154,42 @@ void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid) } -void nr_init_prs(PHY_VARS_gNB* gNB, uint32_t Nid, ...) +void nr_init_prs(PHY_VARS_gNB* gNB, uint32_t Nid, uint32_t slotnum, uint32_t symNum) +{ + unsigned int x1, x2; + uint16_t Nid, i_ssb, i_ssb2; + unsigned char Lmax, l, n_hf, N_hf; + nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; + NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; + uint8_t reset; + + Nid = cfg->cell_config.phy_cell_id.value; + + Lmax = fp->Lmax; + N_hf = (Lmax == 4)? 2:1; + + for (n_hf = 0; n_hf < N_hf; n_hf++) { + for (l = 0; l < Lmax ; l++) { + i_ssb = l & (Lmax-1); + i_ssb2 = i_ssb + (n_hf<<2); + + reset = 1; + // initial x2 for prs as 38.211 + uint32_t c_init1, c_init2, c_init3; + uint32_t pow22=1<<22; + uint32_t pow10=1<<10; + c_init1 = pow22*ceil(Nid/1024); + c_init2 = pow10*(slotnum+symNum+1)*(2*(Nid%1024)+1); + c_init3 = Nid%1024; + x2 = c_init1 + c_init2 + c_init3; + + + for (uint8_t n=0; nnr_gold_prs[n_hf][l][n] = lte_gold_generic(&x1, &x2, reset); + reset = 0; + } + + } + } + +} From 98994a0ba6a10a8b975b9af3180c9de22145eac3 Mon Sep 17 00:00:00 2001 From: ahadi Date: Tue, 26 Oct 2021 16:01:16 +0000 Subject: [PATCH 2/7] Update nr_init.c --- openair1/PHY/INIT/nr_init.c | 41 ++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index a723ee9b9e..ec286ea451 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -209,7 +209,46 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, } } - nr_init_prs(...); + void nr_init_prs(PHY_VARS_gNB* gNB, uint32_t Nid, uint32_t slotnum, uint32_t symNum) +{ + unsigned int x1, x2; + uint16_t Nid, i_ssb, i_ssb2; + unsigned char Lmax, l, n_hf, N_hf; + nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; + NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; + uint8_t reset; + + Nid = cfg->cell_config.phy_cell_id.value; + + Lmax = fp->Lmax; + N_hf = (Lmax == 4)? 2:1; + + for (n_hf = 0; n_hf < N_hf; n_hf++) { + for (l = 0; l < Lmax ; l++) { + i_ssb = l & (Lmax-1); + i_ssb2 = i_ssb + (n_hf<<2); + + reset = 1; + // initial x2 for prs as 38.211 + uint32_t c_init1, c_init2, c_init3; + uint32_t pow22=1<<22; + uint32_t pow10=1<<10; + c_init1 = pow22*ceil(Nid/1024); + c_init2 = pow10*(slotnum+symNum+1)*(2*(Nid%1024)+1); + c_init3 = Nid%1024; + x2 = c_init1 + c_init2 + c_init3; + + + for (uint8_t n=0; nnr_gold_prs[n_hf][l][n] = lte_gold_generic(&x1, &x2, reset); + reset = 0; + } + + } + } + +} + /* Generate low PAPR type 1 sequences for PUSCH DMRS, these are used if transform precoding is enabled. */ generate_lowpapr_typ1_refsig_sequences(SHRT_MAX); From 1f86c34f0aab258ba8bbb22e10d87082e495cfd8 Mon Sep 17 00:00:00 2001 From: Mohsen Ahadi Date: Wed, 27 Oct 2021 14:15:43 +0000 Subject: [PATCH 3/7] Update nr_init.c --- openair1/PHY/INIT/nr_init.c | 40 +------------------------------------ 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index ec286ea451..c3e3807d4d 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -209,45 +209,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, } } - void nr_init_prs(PHY_VARS_gNB* gNB, uint32_t Nid, uint32_t slotnum, uint32_t symNum) -{ - unsigned int x1, x2; - uint16_t Nid, i_ssb, i_ssb2; - unsigned char Lmax, l, n_hf, N_hf; - nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; - NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; - uint8_t reset; - - Nid = cfg->cell_config.phy_cell_id.value; - - Lmax = fp->Lmax; - N_hf = (Lmax == 4)? 2:1; - - for (n_hf = 0; n_hf < N_hf; n_hf++) { - for (l = 0; l < Lmax ; l++) { - i_ssb = l & (Lmax-1); - i_ssb2 = i_ssb + (n_hf<<2); - - reset = 1; - // initial x2 for prs as 38.211 - uint32_t c_init1, c_init2, c_init3; - uint32_t pow22=1<<22; - uint32_t pow10=1<<10; - c_init1 = pow22*ceil(Nid/1024); - c_init2 = pow10*(slotnum+symNum+1)*(2*(Nid%1024)+1); - c_init3 = Nid%1024; - x2 = c_init1 + c_init2 + c_init3; - - - for (uint8_t n=0; nnr_gold_prs[n_hf][l][n] = lte_gold_generic(&x1, &x2, reset); - reset = 0; - } - - } - } - -} + nr_init_prs(gNB); /* Generate low PAPR type 1 sequences for PUSCH DMRS, these are used if transform precoding is enabled. */ From 7715db28f0e64ec4cc487797eedf0eaef9b356a1 Mon Sep 17 00:00:00 2001 From: Mohsen Ahadi Date: Wed, 27 Oct 2021 15:20:33 +0000 Subject: [PATCH 4/7] Update nr_gold.c --- openair1/PHY/NR_REFSIG/nr_gold.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/nr_gold.c b/openair1/PHY/NR_REFSIG/nr_gold.c index 7e3fb8ecf0..4dbd09138b 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold.c +++ b/openair1/PHY/NR_REFSIG/nr_gold.c @@ -154,24 +154,25 @@ void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid) } -void nr_init_prs(PHY_VARS_gNB* gNB, uint32_t Nid, uint32_t slotnum, uint32_t symNum) +void nr_init_prs(PHY_VARS_gNB* gNB, uint32_t symNum) { unsigned int x1, x2; uint16_t 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_scf_t *cfg = &gNB->gNB_config; NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; uint8_t reset; + uint8_t slotNum, symNum; Nid = cfg->cell_config.phy_cell_id.value; - Lmax = fp->Lmax; - N_hf = (Lmax == 4)? 2:1; + //Lmax = fp->Lmax; + //N_hf = (Lmax == 4)? 2:1; - for (n_hf = 0; n_hf < N_hf; n_hf++) { - for (l = 0; l < Lmax ; l++) { - i_ssb = l & (Lmax-1); - i_ssb2 = i_ssb + (n_hf<<2); + for (slotNum = 0; slotNum < fp->slots_per_frame-1; slotNum++) { + for (symNum = 0; symNum < fp->symbols_per_slot-1 ; symNum++) { + i_ssb = sumNum & (symbols_per_slot-1); + i_ssb2 = i_ssb + (slot<<2); reset = 1; // initial x2 for prs as 38.211 @@ -184,8 +185,8 @@ void nr_init_prs(PHY_VARS_gNB* gNB, uint32_t Nid, uint32_t slotnum, uint32_t sym x2 = c_init1 + c_init2 + c_init3; - for (uint8_t n=0; nnr_gold_prs[n_hf][l][n] = lte_gold_generic(&x1, &x2, reset); + for (uint8_t n=0; nnr_gold_prs[slotNum][symNum][n] = lte_gold_generic(&x1, &x2, reset); reset = 0; } From 37c218103413dbb7f8dc1b020f025022ad07257c Mon Sep 17 00:00:00 2001 From: Mohsen Ahadi Date: Wed, 27 Oct 2021 15:21:11 +0000 Subject: [PATCH 5/7] Update nr_gold.c --- openair1/PHY/NR_REFSIG/nr_gold.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/NR_REFSIG/nr_gold.c b/openair1/PHY/NR_REFSIG/nr_gold.c index 4dbd09138b..16b8a453a3 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold.c +++ b/openair1/PHY/NR_REFSIG/nr_gold.c @@ -154,7 +154,7 @@ void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid) } -void nr_init_prs(PHY_VARS_gNB* gNB, uint32_t symNum) +void nr_init_prs(PHY_VARS_gNB* gNB) { unsigned int x1, x2; uint16_t Nid, i_ssb, i_ssb2; From 85aac0f5c4e8d489b3e3b22348fb90566a56cb6b Mon Sep 17 00:00:00 2001 From: Mohsen Ahadi Date: Thu, 28 Oct 2021 14:30:52 +0000 Subject: [PATCH 6/7] Update nr_gold.c --- openair1/PHY/NR_REFSIG/nr_gold.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/nr_gold.c b/openair1/PHY/NR_REFSIG/nr_gold.c index 16b8a453a3..94a450905e 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold.c +++ b/openair1/PHY/NR_REFSIG/nr_gold.c @@ -157,7 +157,7 @@ void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid) void nr_init_prs(PHY_VARS_gNB* gNB) { unsigned int x1, x2; - uint16_t Nid, i_ssb, i_ssb2; + uint16_t Nid; //unsigned char Lmax, l, n_hf, N_hf; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; @@ -166,14 +166,8 @@ void nr_init_prs(PHY_VARS_gNB* gNB) Nid = cfg->cell_config.phy_cell_id.value; - //Lmax = fp->Lmax; - //N_hf = (Lmax == 4)? 2:1; - - for (slotNum = 0; slotNum < fp->slots_per_frame-1; slotNum++) { - for (symNum = 0; symNum < fp->symbols_per_slot-1 ; symNum++) { - i_ssb = sumNum & (symbols_per_slot-1); - i_ssb2 = i_ssb + (slot<<2); - + for (slotNum = 0; slotNum < fp->slots_per_frame; slotNum++) { + for (symNum = 0; symNum < fp->symbols_per_slot ; symNum++) { reset = 1; // initial x2 for prs as 38.211 uint32_t c_init1, c_init2, c_init3; @@ -183,8 +177,6 @@ void nr_init_prs(PHY_VARS_gNB* gNB) c_init2 = pow10*(slotnum+symNum+1)*(2*(Nid%1024)+1); c_init3 = Nid%1024; x2 = c_init1 + c_init2 + c_init3; - - for (uint8_t n=0; nnr_gold_prs[slotNum][symNum][n] = lte_gold_generic(&x1, &x2, reset); reset = 0; From 3e6ad5f0ee1bb1bfe4261c9c7d3e9bd5fda2008e Mon Sep 17 00:00:00 2001 From: Mohsen Ahadi Date: Thu, 28 Oct 2021 14:38:17 +0000 Subject: [PATCH 7/7] Update nr_gold.c --- openair1/PHY/NR_REFSIG/nr_gold.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/NR_REFSIG/nr_gold.c b/openair1/PHY/NR_REFSIG/nr_gold.c index 94a450905e..dc860a5f67 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold.c +++ b/openair1/PHY/NR_REFSIG/nr_gold.c @@ -174,7 +174,7 @@ void nr_init_prs(PHY_VARS_gNB* gNB) uint32_t pow22=1<<22; uint32_t pow10=1<<10; c_init1 = pow22*ceil(Nid/1024); - c_init2 = pow10*(slotnum+symNum+1)*(2*(Nid%1024)+1); + c_init2 = pow10*(slotNum+symNum+1)*(2*(Nid%1024)+1); c_init3 = Nid%1024; x2 = c_init1 + c_init2 + c_init3; for (uint8_t n=0; n