Merge branch 'develop-nr' into bug-fix-channel-est

This commit is contained in:
Sakthivel Velumani
2019-12-02 13:45:05 +01:00
14 changed files with 742 additions and 409 deletions
+24 -15
View File
@@ -79,30 +79,39 @@ int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp, uint8_t i_ssb, uint8_t half_f
return symbol;
}
int nr_is_ssb_slot(nfapi_nr_config_request_t *cfg, int slot)
int nr_is_ssb_slot(nfapi_nr_config_request_t *cfg, int slot, int frame)
{
uint8_t n_hf;
uint16_t p,mu,hf_slots;
uint64_t ssb_map;
int rel_slot;
mu = cfg->subframe_config.numerology_index_mu.value;
ssb_map = cfg->sch_config.ssb_scg_position_in_burst.value;
p = cfg->sch_config.ssb_periodicity.value;
n_hf = cfg->sch_config.half_frame_index.value;
// if SSB periodicity is 5ms, they are transmitted in both half frames
if ( cfg->sch_config.ssb_periodicity.value == 5) {
if (slot<10)
n_hf=0;
else
n_hf=1;
}
// to set a effective slot number between 0 to 9 in the half frame where the SSB is supposed to be
rel_slot = (n_hf)? (slot-10) : slot;
if(rel_slot<10 && rel_slot>=0)
return 1;
else
// checking if the ssb is transmitted in given frame according to periodicity
if ( (p>10) && (frame%(p/10)) )
return 0;
else {
hf_slots = (10<<mu)>>1; // number of slots per half frame
// if SSB periodicity is 5ms, they are transmitted in both half frames
if ( p == 5) {
if (slot<hf_slots)
n_hf=0;
else
n_hf=1;
}
// to set a effective slot number between 0 to hf_slots-1 in the half frame where the SSB is supposed to be
rel_slot = (n_hf)? (slot-hf_slots) : slot;
// there are two potential SSB per slot
return ( ((ssb_map >> rel_slot*2) & 0x01) || ((ssb_map >> (1+rel_slot*2)) & 0x01) );
}
}
+1 -1
View File
@@ -378,7 +378,7 @@ void phy_config_request(PHY_Config_t *phy_config);
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp, uint8_t i_ssb, uint8_t half_frame_index);
int nr_is_ssb_slot(nfapi_nr_config_request_t *cfg, int slot);
int nr_is_ssb_slot(nfapi_nr_config_request_t *cfg, int slot, int frame);
int nr_init_frame_parms(nfapi_nr_config_request_t *config, NR_DL_FRAME_PARMS *frame_parms);
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms,int mu,int Ncp,int N_RB_DL,int n_ssb_crb,int ssb_subcarrier_offset);
int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB,uint8_t abstraction_flag);
+4 -4
View File
@@ -123,7 +123,7 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) {
start_meas(&ru->ofdm_mod_stats);
if (nr_slot_select(cfg,slot) == SF_UL) return;
if (nr_slot_select(cfg,slot,frame_tx) == SF_UL) return;
// this copy should be done in the precoding thread (currently inactive)
for (int aa=0;aa<ru->nb_tx;aa++)
@@ -133,7 +133,7 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
if (nr_slot_select(cfg,slot)==SF_DL) {
if (nr_slot_select(cfg,slot,frame_tx)==SF_DL) {
// If this is not an S-tti
if (pthread_mutex_timedlock(&proc->mutex_feptx,&wait) != 0) {
printf("[RU] ERROR pthread_mutex_lock for feptx thread (IC %d)\n", proc->instance_cnt_feptx);
@@ -232,8 +232,8 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) {
memcpy((void*)ru->common.txdataF_BF[aa],
(void*)ru->gNB_list[0]->common_vars.txdataF[aa], fp->samples_per_slot_wCP*sizeof(int32_t));
if ((nr_slot_select(cfg,slot)==SF_DL)||
((nr_slot_select(cfg,slot)==SF_S))) {
if ((nr_slot_select(cfg,slot,frame_tx)==SF_DL)||
((nr_slot_select(cfg,slot,frame_tx)==SF_S))) {
// LOG_D(HW,"Frame %d: Generating slot %d\n",frame,next_slot);
nr_feptx0(ru,slot,0,fp->symbols_per_slot);
+2 -3
View File
@@ -33,10 +33,9 @@
#include "sched_nr.h"
#include "PHY/INIT/phy_init.h"
nr_subframe_t nr_slot_select(nfapi_nr_config_request_t *cfg,
unsigned char slot)
nr_subframe_t nr_slot_select(nfapi_nr_config_request_t *cfg, unsigned char slot, int frame)
{
if (cfg->subframe_config.duplex_mode.value == FDD || slot == NR_DOWNLINK_SLOT)
if (cfg->subframe_config.duplex_mode.value == FDD || slot == NR_DOWNLINK_SLOT || nr_is_ssb_slot(cfg,slot,frame)==1)
return(SF_DL);
else if (slot == NR_UPLINK_SLOT)
return (SF_UL);
+5 -4
View File
@@ -96,23 +96,24 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) {
uint8_t *pbch_pdu=&gNB->pbch_pdu[0];
uint8_t ssb_index, n_hf;
int ssb_start_symbol, rel_slot;
uint16_t slots_per_hf = fp->slots_per_frame / 2;
n_hf = cfg->sch_config.half_frame_index.value;
// if SSB periodicity is 5ms, they are transmitted in both half frames
if ( cfg->sch_config.ssb_periodicity.value == 5) {
if (slot<10)
if (slot<slots_per_hf)
n_hf=0;
else
n_hf=1;
}
// to set a effective slot number between 0 to 9 in the half frame where the SSB is supposed to be
rel_slot = (n_hf)? (slot-10) : slot;
rel_slot = (n_hf)? (slot-slots_per_hf) : slot;
LOG_D(PHY,"common_signal_procedures: frame %d, slot %d\n",frame,slot);
if(rel_slot<10 && rel_slot>=0) {
if(rel_slot<slots_per_hf && rel_slot>=0) {
for (int i=0; i<2; i++) { // max two SSB per frame
ssb_index = i + 2*rel_slot; // computing the ssb_index
@@ -160,7 +161,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
else
ssb_frame_periodicity = (cfg->sch_config.ssb_periodicity.value)/10 ; // 10ms is the frame length
if ((cfg->subframe_config.duplex_mode.value == TDD) && (nr_slot_select(cfg,slot)==SF_UL)) return;
if ((cfg->subframe_config.duplex_mode.value == TDD) && (nr_slot_select(cfg,slot,frame)==SF_UL)) return;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+offset,1);
+1 -1
View File
@@ -34,7 +34,7 @@
#include "PHY/NR_TRANSPORT/nr_dci.h"
nr_slot_t nr_slot_select (nfapi_nr_config_request_t *cfg, unsigned char slot);
nr_slot_t nr_slot_select (nfapi_nr_config_request_t *cfg, unsigned char slot, int frame);
void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *fp);
void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, int frame_tx, int slot_tx, int do_meas);
void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx);