Changes in prs config parsing function, added help string

This commit is contained in:
Sagar Parsawar
2022-08-25 23:01:30 +02:00
parent 7bc69f505a
commit a292f1a251
13 changed files with 268 additions and 572 deletions
+1 -1
View File
@@ -136,7 +136,7 @@ void nr_init_prs(PHY_VARS_gNB* gNB)
for (rsc_id = 0; rsc_id < gNB->prs_vars.NumPRSResources; rsc_id++) {
Nid = gNB->prs_vars.prs_cfg[rsc_id].NPRSID; // seed value
LOG_I(PHY, "Initiaized NR-PRS sequence with PRS_ID %d\n", Nid);
LOG_I(PHY, "Initiaized NR-PRS sequence with PRS_ID %3d for resource %d\n", Nid, rsc_id);
for (slotNum = 0; slotNum < fp->slots_per_frame; slotNum++) {
for (symNum = 0; symNum < fp->symbols_per_slot ; symNum++) {
reset = 1;
+1 -1
View File
@@ -137,7 +137,7 @@ void init_nr_gold_prs(PHY_VARS_NR_UE* ue)
for(gnb = 0; gnb < ue->prs_active_gNBs; gnb++) {
for(rsc = 0; rsc < ue->prs_vars[gnb]->NumPRSResources; rsc++) {
Nid = ue->prs_vars[gnb]->prs_resource[rsc].prs_cfg.NPRSID; // seed value
LOG_I(PHY,"Initialised NR-PRS sequence with PRS_ID %d\n",Nid);
LOG_I(PHY,"Initialised NR-PRS sequence with PRS_ID %3d for resource %d\n",Nid, rsc);
for (slotNum = 0; slotNum < fp->slots_per_frame; slotNum++) {
for (symNum = 0; symNum < fp->symbols_per_slot ; symNum++) {
reset = 1;
+11 -11
View File
@@ -12,7 +12,7 @@ extern short nr_qpsk_mod_table[8];
int nr_generate_prs(uint32_t **nr_gold_prs,
int32_t *txdataF,
int16_t amp,
prs_data_t *prs_data,
prs_config_t *prs_cfg,
nfapi_nr_config_request_scf_t *config,
NR_DL_FRAME_PARMS *frame_parms)
{
@@ -23,26 +23,26 @@ int nr_generate_prs(uint32_t **nr_gold_prs,
// PRS resource mapping with combsize=k which means PRS symbols exist in every k-th subcarrier in frequency domain
// According to ts138.211 sec.7.4.1.7.2
for (int l = prs_data->SymbolStart; l < prs_data->SymbolStart + prs_data->NumPRSSymbols; l++) {
for (int l = prs_cfg->SymbolStart; l < prs_cfg->SymbolStart + prs_cfg->NumPRSSymbols; l++) {
int symInd = l-prs_data->SymbolStart;
if (prs_data->CombSize == 2) {
int symInd = l-prs_cfg->SymbolStart;
if (prs_cfg->CombSize == 2) {
k_prime = k_prime_table[0][symInd];
}
else if (prs_data->CombSize == 4){
else if (prs_cfg->CombSize == 4){
k_prime = k_prime_table[1][symInd];
}
else if (prs_data->CombSize == 6){
else if (prs_cfg->CombSize == 6){
k_prime = k_prime_table[2][symInd];
}
else if (prs_data->CombSize == 12){
else if (prs_cfg->CombSize == 12){
k_prime = k_prime_table[3][symInd];
}
k = (prs_data->REOffset+k_prime) % prs_data->CombSize + prs_data->RBOffset*12 + frame_parms->first_carrier_offset;
k = (prs_cfg->REOffset+k_prime) % prs_cfg->CombSize + prs_cfg->RBOffset*12 + frame_parms->first_carrier_offset;
// QPSK modulation
for (int m = 0; m < (12/prs_data->CombSize) * prs_data->NumRB; m++) {
for (int m = 0; m < (12/prs_cfg->CombSize) * prs_cfg->NumRB; m++) {
idx = (((nr_gold_prs[l][(m<<1)>>5])>>((m<<1)&0x1f))&3);
mod_prs[m<<1] = nr_qpsk_mod_table[idx<<1];
mod_prs[(m<<1)+1] = nr_qpsk_mod_table[(idx<<1) + 1];
@@ -64,14 +64,14 @@ int nr_generate_prs(uint32_t **nr_gold_prs,
((int16_t *)txdataF)[((l*frame_parms->ofdm_symbol_size + k)<<1)+1]);
#endif
k = k + prs_data->CombSize;
k = k + prs_cfg->CombSize;
if (k >= frame_parms->ofdm_symbol_size)
k-=frame_parms->ofdm_symbol_size;
}
}
#ifdef DEBUG_PRS_MAP
LOG_M("nr_prs.m", "prs",(int16_t *)&txdataF[prs_data->SymbolStart*frame_parms->ofdm_symbol_size],prs_data->NumPRSSymbols*frame_parms->ofdm_symbol_size, 1, 1);
LOG_M("nr_prs.m", "prs",(int16_t *)&txdataF[prs_cfg->SymbolStart*frame_parms->ofdm_symbol_size],prs_cfg->NumPRSSymbols*frame_parms->ofdm_symbol_size, 1, 1);
#endif
return 0;
}
@@ -42,7 +42,7 @@
int nr_generate_prs(uint32_t **nr_gold_prs,
int32_t *txdataF,
int16_t amp,
prs_data_t *prs_data,
prs_config_t *prs_cfg,
nfapi_nr_config_request_scf_t *config,
NR_DL_FRAME_PARMS *frame_parms);
@@ -53,7 +53,7 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
NR_DL_FRAME_PARMS *frame_params)
{
int32_t **rxdataF = ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF;
prs_data_t *prs_cfg = &ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg;
prs_config_t *prs_cfg = &ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg;
prs_meas_t **prs_meas = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_meas;
int32_t **prs_chestF = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_ch_estimates;
int32_t **prs_chestT = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_ch_estimates_time;
+1 -1
View File
@@ -226,7 +226,7 @@ typedef struct {
typedef struct {
uint8_t NumPRSResources;
prs_data_t prs_cfg[NR_MAX_PRS_RESOURCES_PER_SET];
prs_config_t prs_cfg[NR_MAX_PRS_RESOURCES_PER_SET];
} NR_gNB_PRS;
typedef struct {
+1 -1
View File
@@ -348,7 +348,7 @@ typedef struct {
#define NR_PRS_IDFT_OVERSAMP_FACTOR 1 // IDFT oversampling factor for NR PRS channel estimates in time domain, ALLOWED value 16x, and 1x is default(ie. IDFT size is frame_params->ofdm_symbol_size)
typedef struct {
prs_data_t prs_cfg;
prs_config_t prs_cfg;
int32_t **prs_ch_estimates;
int32_t **prs_ch_estimates_time;
int32_t reserved;
+11 -11
View File
@@ -389,23 +389,23 @@ struct NR_DL_FRAME_PARMS {
uint32_t ofdm_offset_divisor;
};
// PRS structures prototype
// PRS config structures
typedef struct {
uint16_t PRSResourceSetPeriod[2]; // [slot period, slot offset]
uint16_t PRSResourceOffset; // array if more than one resource sets.slot offset (0...511) (default 0)
uint8_t PRSResourceRepetition; // slot offset (1 (default), 2, 4, 6, 8, 16, 32)
uint8_t PRSResourceTimeGap; // slot offset (1 (default), 2, 4, 6, 8, 16, 32)
uint16_t NumRB; // number of RBs in freq domain a scalar =< 275 RB
uint8_t NumPRSSymbols; // number of PRS symbols in time domain
uint8_t SymbolStart; // starting OFDM symbol of PRS resource in time domain
uint16_t PRSResourceSetPeriod[2]; // [slot period, slot offset] of a PRS resource set
uint16_t PRSResourceOffset; // Slot offset of each PRS resource defined relative to the slot offset of the PRS resource set (0...511)
uint8_t PRSResourceRepetition; // Repetition factor for all PRS resources in resource set (1 /*default*/, 2, 4, 6, 8, 16, 32)
uint8_t PRSResourceTimeGap; // Slot offset between two consecutive repetition indices of all PRS resources in a PRS resource set (1 /*default*/, 2, 4, 6, 8, 16, 32)
uint16_t NumRB; // Number of PRBs allocated to all PRS resources in a PRS resource set (<= 272 and multiples of 4)
uint8_t NumPRSSymbols; // Number of OFDM symbols in a slot allocated to each PRS resource in a PRS resource set
uint8_t SymbolStart; // Starting OFDM symbol of each PRS resource in a PRS resource set
uint16_t RBOffset; // Starting PRB index of all PRS resources in a PRS resource set
uint8_t CombSize; // RE density of all PRS resources in a PRS resource set. i∈{2,4,6,12}
uint8_t CombSize; // RE density of all PRS resources in a PRS resource set (2, 4, 6, 12)
uint8_t REOffset; // Starting RE offset in the first OFDM symbol of each PRS resource in a PRS resource set
uint32_t MutingPattern1[32]; // Muting bit pattern option-1, specified as [] or a binary-valued vector of length 2, 4, 6, 8, 16, or 32
uint32_t MutingPattern2[32]; // Muting bit pattern option-2, specified as [] or a binary-valued vector of length 2, 4, 6, 8, 16, or 32
uint8_t MutingBitRepetition; // Muting bit repetition factor, specified as 1, 2, 4, or 8
uint16_t NPRSID; // Sequence identity of each PRS resource specified as a scalar or a vector of integers in the range [0, 4095]
} prs_data_t;
uint16_t NPRSID; // Sequence identity of each PRS resource in a PRS resource set, specified in the range [0, 4095]
} prs_config_t;
typedef struct {
int8_t gNB_id;