diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 32e190679d..a723ee9b9e 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -194,6 +194,23 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, nr_init_csi_rs(gNB, cfg->cell_config.phy_cell_id.value); + //PRS init + gNB->nr_gold_prs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **)); + uint32_t ***prs = gNB->nr_gold_prs; + AssertFatal(prs!=NULL, "NR init: positioning reference signal malloc failed\n"); + + for (int slot=0; slotslots_per_frame; slot++) { + prs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *)); + AssertFatal(prs[slot]!=NULL, "NR init: positioning reference signal for slot %d - malloc failed\n", slot); + + for (int symb=0; symbsymbols_per_slot; symb++) { + prs[slot][symb] = (uint32_t *)malloc16(NR_MAX_PRS_INIT_LENGTH_DWORD*sizeof(uint32_t)); + AssertFatal(prs[slot][symb]!=NULL, "NR init: positioning reference signal for slot %d symbol %d - malloc failed\n", slot, symb); + } + } + + nr_init_prs(...); + /* Generate low PAPR type 1 sequences for PUSCH DMRS, these are used if transform precoding is enabled. */ generate_lowpapr_typ1_refsig_sequences(SHRT_MAX); diff --git a/openair1/PHY/NR_REFSIG/nr_gold.c b/openair1/PHY/NR_REFSIG/nr_gold.c index 11e28a3046..cb2bff6625 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold.c +++ b/openair1/PHY/NR_REFSIG/nr_gold.c @@ -153,3 +153,5 @@ void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid) } } + +void nr_init_prs(PHY_VARS_gNB* gNB, uint32_t Nid, ...) diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 778724218f..577fbfa1d9 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -811,6 +811,9 @@ typedef struct PHY_VARS_gNB_s { /// CSI RS sequence uint32_t ***nr_gold_csi_rs; + /// PRS sequence + uint32_t ***nr_gold_prs; + /// Indicator set to 0 after first SR uint8_t first_sr[NUMBER_OF_NR_SR_MAX]; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index c385d323e3..7b914db921 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -80,6 +80,9 @@ #define NR_MAX_CSI_RS_LENGTH 4400 //275*8(max allocation per RB)*2(QPSK) #define NR_MAX_CSI_RS_INIT_LENGTH_DWORD 138 // ceil(NR_MAX_CSI_RS_LENGTH/32) +#define NR_MAX_PRS_LENGTH 3264 //272*6(max allocation per RB)*2(QPSK) +#define NR_MAX_PRS_INIT_LENGTH_DWORD 102 // ceil(NR_MAX_CSI_RS_LENGTH/32) + #define NR_MAX_PUSCH_DMRS_LENGTH NR_MAX_PDSCH_DMRS_LENGTH #define NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 0a87a08a56..ad50e31c85 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -206,6 +206,9 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, } } + //TODO: nr_generate_prs + // check if we have prs to transmit in this frame and slot + if (do_meas==1) stop_meas(&gNB->phy_proc_tx); if ((frame&127) == 0) dump_pdsch_stats(gNB); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 5df03a903b..8e6fdecb8f 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -960,6 +960,7 @@ int main(int argc, char **argv) //NR_COMMON_channels_t *cc = RC.nrmac[0]->common_channels; snrRun = 0; + //TODO: configure parameters for PRS for (SNR = snr0; SNR < snr1; SNR += .2) {