Commit 20366125 authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/coarse-cleaning-pss-ss' into integration_2023_w23

parents af923d6e 5cb22784
......@@ -572,16 +572,17 @@ void nr_init_dl_harq_processes(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_DLSCH_HARQ_PR
harq_list[j][i].c = malloc16(a_segments*sizeof(uint8_t *));
harq_list[j][i].d = malloc16(a_segments*sizeof(int16_t *));
const int sz=5*8448*sizeof(int16_t);
for (int r=0; r<a_segments; r++) {
harq_list[j][i].c[r] = malloc16(1056);
harq_list[j][i].d[r] = malloc16(5*8448*sizeof(int16_t));
harq_list[j][i].d[r] = malloc16(sz);
if (harq_list[j][i].c[r])
memset(harq_list[j][i].c[r],0,1056);
else
AssertFatal(true, "Unable to reset harq memory \"c\"\n");
if (harq_list[j][i].d[r])
memset(harq_list[j][i].d[r],0,5*8448);
memset(harq_list[j][i].d[r], 0, sz);
else
AssertFatal(true, "Unable to reset harq memory \"d\"\n");
}
......
......@@ -37,12 +37,6 @@
#include "PHY/NR_REFSIG/ss_pbch_nr.h"
#ifdef DEFINE_VARIABLES_PSS_NR_H
#define EXTERN
#else
#define EXTERN extern
#endif
/************** CODE GENERATION ***********************************/
//#define PSS_DECIMATOR /* decimation of sample is done between time correlation */
......@@ -81,55 +75,10 @@
#define SYNC_TMP_SIZE (NB_ANTENNAS_RX*SYNCHRO_FFT_SIZE_MAX*IQ_SIZE) /* to be aligned with existing lte synchro */
#define SYNCF_TMP_SIZE (SYNCHRO_FFT_SIZE_MAX*IQ_SIZE)
/************* STRUCTURES *****************************************/
/************** VARIABLES *****************************************/
//#define STATIC_SYNC_BUFFER
#ifdef STATIC_SYNC_BUFFER
/* buffer defined in file lte_sync_time */
EXTERN int16_t synchro_tmp[SYNC_TMP_SIZE] __attribute__((aligned(32)));
EXTERN int16_t synchroF_tmp[SYNCF_TMP_SIZE] __attribute__((aligned(32)));
#else
EXTERN int16_t *synchro_tmp;
EXTERN int16_t *synchroF_tmp;
#endif
EXTERN int16_t *primary_synchro_nr[NUMBER_PSS_SEQUENCE]
#ifdef INIT_VARIABLES_PSS_NR_H
= { NULL, NULL, NULL}
#endif
;
EXTERN int16_t *primary_synchro_nr2[NUMBER_PSS_SEQUENCE]
#ifdef INIT_VARIABLES_PSS_NR_H
= { NULL, NULL, NULL}
#endif
;
EXTERN int16_t *primary_synchro_time_nr[NUMBER_PSS_SEQUENCE]
#ifdef INIT_VARIABLES_PSS_NR_H
= { NULL, NULL, NULL}
#endif
;
/* profiling structure */
EXTERN time_stats_t generic_time[TIME_LAST];
#ifndef DEFINE_HEADER_ONLY
/************** FUNCTION ******************************************/
void init_context_synchro_nr(NR_DL_FRAME_PARMS *frame_parms_ue);
void free_context_synchro_nr(void);
void init_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue);
void free_context_pss_nr(void);
int set_pss_nr(int ofdm_symbol_size);
int pss_synchro_nr(PHY_VARS_NR_UE *PHY_vars_UE, int is, int rate_change);
int pss_search_time_nr(c16_t **rxdata, PHY_VARS_NR_UE *ue, int fo_flag, int is);
#endif
#undef EXTERN
int16_t *get_primary_synchro_nr2(const int nid2);
#endif /* PSS_NR_H */
......
......@@ -67,7 +67,7 @@
#define NB_SYMBOLS_PBCH (3)
#define NR_N_SYMBOLS_SSB (4)
#define IQ_SIZE (sizeof(int16_t) * 2) /* I and Q are alternatively stored into buffers */
#define IQ_SIZE sizeof(c16_t) /* I and Q are alternatively stored into buffers */
#define N_SYMB_SLOT (14)
/* SS/PBCH parameters : see from TS 38.211 table 7.4.3.1-1: Resources within an SS/PBCH block for PSS... */
......
......@@ -38,13 +38,6 @@
#include "pss_nr.h"
#ifdef DEFINE_VARIABLES_SSS_NR_H
#define EXTERN
#define INIT_VARIABLES_SSS_NR_H
#else
#define EXTERN extern
#endif
/************** DEFINE ********************************************/
#define SAMPLES_IQ (sizeof(int16_t)*2)
......@@ -64,26 +57,7 @@
/************** VARIABLES *****************************************/
#define PHASE_HYPOTHESIS_NUMBER (16)
#define INDEX_NO_PHASE_DIFFERENCE (3) /* this is for no phase shift case */
EXTERN const int16_t phase_re_nr[PHASE_HYPOTHESIS_NUMBER]
#ifdef INIT_VARIABLES_SSS_NR_H
// -pi/3 ---- pi/3
= {16384,20173,23571,26509,28932,30791,32051,32687,32687,32051,30791,
28932,26509,23571,20173,16384}
#endif
;
EXTERN const int16_t phase_im_nr[PHASE_HYPOTHESIS_NUMBER]
#ifdef INIT_VARIABLES_SSS_NR_H
// -pi/3 ---- pi/3
= {-28377,-25821,-22762,-19260,-15383,-11207,-6813,-2286,2286,6813,11207,
15383,19260,22762,25821,28377}
#endif
;
EXTERN int16_t d_sss[N_ID_2_NUMBER][N_ID_1_NUMBER][LENGTH_SSS_NR];
#define INDEX_NO_PHASE_DIFFERENCE (3) /* this is for no phase shift case */
/************** FUNCTION ******************************************/
void init_context_sss_nr(int amp);
......@@ -92,14 +66,11 @@ void free_context_sss_nr(void);
void insert_sss_nr(int16_t *sss_time,
NR_DL_FRAME_PARMS *frame_parms);
int pss_ch_est_nr(PHY_VARS_NR_UE *ue,
int32_t pss_ext[NB_ANTENNAS_RX][LENGTH_PSS_NR],
int32_t sss_ext[NB_ANTENNAS_RX][LENGTH_SSS_NR]);
int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric, uint8_t *phase_max, int *freq_offset_sss, c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]);
#undef INIT_VARIABLES_SSS_NR_H
#undef EXTERN
int rx_sss_nr(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
int32_t *tot_metric,
uint8_t *phase_max,
int *freq_offset_sss,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]);
#endif /* SSS_NR_H */
......@@ -22,7 +22,8 @@
#include "nr_transport_common_proto.h"
#include "PHY/NR_REFSIG/nr_refsig.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#define DEBUG_SCRAMBLING(a)
//#define DEBUG_SCRAMBLING(a) a
void nr_codeword_scrambling(uint8_t *in,
uint32_t size,
uint8_t q,
......@@ -39,7 +40,7 @@ void nr_codeword_scrambling(uint8_t *in,
__m256i c = ((__m256i*)in)[i];
uint32_t in32 = simde_mm256_movemask_epi8(simde_mm256_slli_epi16(c,7));
out[i]=(in32^s);
LOG_D(PHY,"in[%d] %x => %x\n",i,in32,out[i]);
DEBUG_SCRAMBLING(LOG_D(PHY, "in[%d] %x => %x\n", i, in32, out[i]));
s=lte_gold_generic(&x1, &x2, 0);
}
}
......
......@@ -254,7 +254,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
ue->ssb_offset = sync_pos - fp->nb_prefix_samples;
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n", ue->Mod_id, sync_pos,ue->common_vars.eNb_id);
LOG_I(PHY, "[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n", ue->Mod_id, sync_pos, ue->common_vars.nid2);
LOG_I(PHY,"sync_pos %d ssb_offset %d \n",sync_pos,ue->ssb_offset);
#endif
......@@ -453,7 +453,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
} else {
#ifdef DEBUG_INITIAL_SYNC
LOG_I(PHY,"[UE%d] Initial sync : PBCH not ok\n",ue->Mod_id);
LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id);
LOG_I(PHY, "[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n", ue->Mod_id, sync_pos, ue->common_vars.nid2);
LOG_I(PHY,"[UE%d] Initial sync : Estimated Nid_cell %d, Frame_type %d\n",ue->Mod_id,
frame_parms->Nid_cell,frame_parms->frame_type);
#endif
......
This diff is collapsed.
This diff is collapsed.
......@@ -244,8 +244,8 @@ typedef struct {
int32_t *sync_corr;
/// estimated frequency offset (in radians) for all subcarriers
int32_t freq_offset;
/// eNb_id user is synched to
int32_t eNb_id;
/// nid2 is the PSS value, the PCI (physical cell id) will be: 3*NID1 (SSS value) + NID2 (PSS value)
int32_t nid2;
} NR_UE_COMMON;
#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)
......
......@@ -1014,13 +1014,20 @@ int8_t nr_rrc_ue_generate_ra_msg(module_id_t module_id, uint8_t gNB_index) {
return 0;
}
int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(module_id_t module_id,
const uint8_t gNB_index,
uint8_t *const Sdu,
const uint8_t Sdu_len,
const uint8_t rsrq,
const uint8_t rsrp) {
/**\brief decode NR BCCH-DLSCH (SI) messages
\param module_idP module id
\param gNB_index gNB index
\param sduP pointer to buffer of ASN message BCCH-DLSCH
\param sdu_len length of buffer
\param rsrq RSRQ
\param rsrp RSRP*/
static int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(module_id_t module_id,
const uint8_t gNB_index,
uint8_t *const Sdu,
const uint8_t Sdu_len,
const uint8_t rsrq,
const uint8_t rsrp)
{
NR_BCCH_DL_SCH_Message_t *bcch_message = NULL;
NR_UE_RRC_SI_INFO *SI_info = &NR_UE_rrc_inst[module_id].SInfo[gNB_index];
NR_SIB1_t *sib1 = SI_info->sib1;
......
......@@ -94,20 +94,6 @@ int8_t nr_rrc_ue_process_radio_bearer_config(NR_RadioBearerConfig_t *radio_beare
\param sdu_len length of buffer*/
int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message(const module_id_t module_id, const uint8_t gNB_index, uint8_t *const bufferP, const uint8_t buffer_len);
/**\brief decode NR BCCH-DLSCH (SI) messages
\param module_idP module id
\param gNB_index gNB index
\param sduP pointer to buffer of ASN message BCCH-DLSCH
\param sdu_len length of buffer
\param rsrq RSRQ
\param rsrp RSRP*/
int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(const module_id_t module_id, const uint8_t gNB_index, uint8_t *const bufferP, const uint8_t buffer_len, const uint8_t rsrq, const uint8_t rsrp);
/**\brief Decode NR DCCH from gNB, sent from lower layer through SRB3
\param module_id module id
\param gNB_index gNB index
\param buffer encoded DCCH bytes stream message
\param size length of buffer*/
int8_t nr_rrc_ue_decode_NR_DL_DCCH_Message(const module_id_t module_id, const uint8_t gNB_index, const uint8_t *buffer, const uint32_t size);
/**\brief interface between MAC and RRC thru SRB0 (RLC TM/no PDCP)
......
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