Commit 656f16bb authored by Florian Kaltenberger's avatar Florian Kaltenberger

Revert "Merge branch 'nr-multiple-ssb' into 'develop-nr'"

This reverts merge request !519
parent b604b69e
...@@ -313,7 +313,7 @@ pipeline { ...@@ -313,7 +313,7 @@ pipeline {
stage ("Test physical simulators") { stage ("Test physical simulators") {
steps { steps {
gitlabCommitStatus(name: "Test phy-sim") { gitlabCommitStatus(name: "Test phy-sim") {
timeout (time: 60, unit: 'MINUTES') { timeout (time: 45, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}" sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
} }
} }
......
...@@ -31,12 +31,12 @@ typedef struct { ...@@ -31,12 +31,12 @@ typedef struct {
/*typedef struct { /*typedef struct {
nfapi_tl_t tl; nfapi_tl_t tl;
int64_t value; int64_t value;
} nfapi_int64_tlv_t;*/ } nfapi_int64_tlv_t;
typedef struct { typedef struct {
nfapi_tl_t tl; nfapi_tl_t tl;
uint64_t value; uint64_t value;
} nfapi_uint64_tlv_t; } nfapi_uint64_tlv_t;*/
// nFAPI enums // nFAPI enums
typedef enum { typedef enum {
...@@ -178,8 +178,8 @@ typedef struct { ...@@ -178,8 +178,8 @@ typedef struct {
nfapi_uint16_tlv_t physical_cell_id; nfapi_uint16_tlv_t physical_cell_id;
nfapi_uint16_tlv_t half_frame_index; nfapi_uint16_tlv_t half_frame_index;
nfapi_uint16_tlv_t ssb_subcarrier_offset; nfapi_uint16_tlv_t ssb_subcarrier_offset;
nfapi_uint16_tlv_t ssb_sib1_position_in_burst; // in sib1 nfapi_uint16_tlv_t ssb_sib1_position_in_burst;
nfapi_uint64_tlv_t ssb_scg_position_in_burst; // in servingcellconfigcommon nfapi_uint16_tlv_t ssb_scg_position_in_burst;
nfapi_uint16_tlv_t ssb_periodicity; nfapi_uint16_tlv_t ssb_periodicity;
nfapi_uint16_tlv_t ss_pbch_block_power; nfapi_uint16_tlv_t ss_pbch_block_power;
nfapi_uint16_tlv_t n_ssb_crb; nfapi_uint16_tlv_t n_ssb_crb;
......
...@@ -357,13 +357,11 @@ void install_schedule_handlers(IF_Module_t *if_inst) ...@@ -357,13 +357,11 @@ void install_schedule_handlers(IF_Module_t *if_inst)
/// this function is a temporary addition for NR configuration /// this function is a temporary addition for NR configuration
void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,int Nid_cell) {
void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,int Nid_cell,uint64_t position_in_burst) {
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
nfapi_nr_config_request_t *gNB_config = &gNB->gNB_config; nfapi_nr_config_request_t *gNB_config = &gNB->gNB_config;
//overwrite for new NR parameters //overwrite for new NR parameters
gNB_config->nfapi_config.rf_bands.rf_band[0] = 5; gNB_config->nfapi_config.rf_bands.rf_band[0] = 78;
gNB_config->nfapi_config.nrarfcn.value = 620000; gNB_config->nfapi_config.nrarfcn.value = 620000;
gNB_config->subframe_config.numerology_index_mu.value = mu; gNB_config->subframe_config.numerology_index_mu.value = mu;
gNB_config->subframe_config.duplex_mode.value = TDD; gNB_config->subframe_config.duplex_mode.value = TDD;
...@@ -374,7 +372,6 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu, ...@@ -374,7 +372,6 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,
gNB_config->sch_config.n_ssb_crb.value = (N_RB_DL-20); gNB_config->sch_config.n_ssb_crb.value = (N_RB_DL-20);
gNB_config->sch_config.ssb_subcarrier_offset.value = 0; gNB_config->sch_config.ssb_subcarrier_offset.value = 0;
gNB_config->sch_config.physical_cell_id.value=Nid_cell; gNB_config->sch_config.physical_cell_id.value=Nid_cell;
gNB_config->sch_config.ssb_scg_position_in_burst.value=position_in_burst;
gNB_config->subframe_config.dl_cyclic_prefix_type.value = (fp->Ncp == NORMAL) ? NFAPI_CP_NORMAL : NFAPI_CP_EXTENDED; gNB_config->subframe_config.dl_cyclic_prefix_type.value = (fp->Ncp == NORMAL) ? NFAPI_CP_NORMAL : NFAPI_CP_EXTENDED;
gNB->mac_enabled = 1; gNB->mac_enabled = 1;
...@@ -401,7 +398,6 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) { ...@@ -401,7 +398,6 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
gNB_config->sch_config.ssb_subcarrier_offset.value = phy_config->cfg->sch_config.ssb_subcarrier_offset.value;//0; gNB_config->sch_config.ssb_subcarrier_offset.value = phy_config->cfg->sch_config.ssb_subcarrier_offset.value;//0;
gNB_config->sch_config.n_ssb_crb.value = (phy_config->cfg->rf_config.dl_carrier_bandwidth.value-20); gNB_config->sch_config.n_ssb_crb.value = (phy_config->cfg->rf_config.dl_carrier_bandwidth.value-20);
gNB_config->sch_config.physical_cell_id.value = phy_config->cfg->sch_config.physical_cell_id.value; gNB_config->sch_config.physical_cell_id.value = phy_config->cfg->sch_config.physical_cell_id.value;
gNB_config->sch_config.ssb_scg_position_in_burst.value= phy_config->cfg->sch_config.ssb_scg_position_in_burst.value;
if (phy_config->cfg->subframe_config.duplex_mode.value == 0) { if (phy_config->cfg->subframe_config.duplex_mode.value == 0) {
gNB_config->subframe_config.duplex_mode.value = TDD; gNB_config->subframe_config.duplex_mode.value = TDD;
......
...@@ -52,23 +52,12 @@ int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp, ...@@ -52,23 +52,12 @@ int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp,
case NR_MU_0: //15kHz scs case NR_MU_0: //15kHz scs
fp->subcarrier_spacing = nr_subcarrier_spacing[NR_MU_0]; fp->subcarrier_spacing = nr_subcarrier_spacing[NR_MU_0];
fp->slots_per_subframe = nr_slots_per_subframe[NR_MU_0]; fp->slots_per_subframe = nr_slots_per_subframe[NR_MU_0];
fp->ssb_type = nr_ssb_type_A;
break; break;
case NR_MU_1: //30kHz scs case NR_MU_1: //30kHz scs
fp->subcarrier_spacing = nr_subcarrier_spacing[NR_MU_1]; fp->subcarrier_spacing = nr_subcarrier_spacing[NR_MU_1];
fp->slots_per_subframe = nr_slots_per_subframe[NR_MU_1]; fp->slots_per_subframe = nr_slots_per_subframe[NR_MU_1];
// selection of SS block pattern according to TS 38101-1 Table 5.4.3.3-1 for SCS 30kHz
if (fp->eutra_band == 5 || fp->eutra_band == 66)
fp->ssb_type = nr_ssb_type_B;
else{
if (fp->eutra_band == 41 || ( fp->eutra_band > 76 && fp->eutra_band < 80) )
fp->ssb_type = nr_ssb_type_C;
else
AssertFatal(1==0,"NR Operating Band n%d not available for SS block SCS with mu=%d\n", fp->eutra_band, mu);
}
switch(N_RB_DL){ switch(N_RB_DL){
case 11: case 11:
case 24: case 24:
...@@ -155,13 +144,11 @@ int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp, ...@@ -155,13 +144,11 @@ int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp,
case NR_MU_3: case NR_MU_3:
fp->subcarrier_spacing = nr_subcarrier_spacing[NR_MU_3]; fp->subcarrier_spacing = nr_subcarrier_spacing[NR_MU_3];
fp->slots_per_subframe = nr_slots_per_subframe[NR_MU_3]; fp->slots_per_subframe = nr_slots_per_subframe[NR_MU_3];
fp->ssb_type = nr_ssb_type_D;
break; break;
case NR_MU_4: case NR_MU_4:
fp->subcarrier_spacing = nr_subcarrier_spacing[NR_MU_4]; fp->subcarrier_spacing = nr_subcarrier_spacing[NR_MU_4];
fp->slots_per_subframe = nr_slots_per_subframe[NR_MU_4]; fp->slots_per_subframe = nr_slots_per_subframe[NR_MU_4];
fp->ssb_type = nr_ssb_type_E;
break; break;
default: default:
...@@ -182,16 +169,6 @@ int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp, ...@@ -182,16 +169,6 @@ int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp,
fp->samples_per_frame = 10 * fp->samples_per_subframe; fp->samples_per_frame = 10 * fp->samples_per_subframe;
fp->freq_range = (fp->dl_CarrierFreq < 6e9)? nr_FR1 : nr_FR2; fp->freq_range = (fp->dl_CarrierFreq < 6e9)? nr_FR1 : nr_FR2;
// definition of Lmax according to ts 38.213 section 4.1
if (fp->dl_CarrierFreq < 6e9){
if(fp->frame_type && (fp->ssb_type==2))
fp->Lmax = (fp->dl_CarrierFreq < 2.4e9)? 4 : 8;
else
fp->Lmax = (fp->dl_CarrierFreq < 3e9)? 4 : 8;
}
else
fp->Lmax = 64;
// Initial bandwidth part configuration -- full carrier bandwidth // Initial bandwidth part configuration -- full carrier bandwidth
fp->initial_bwp_dl.bwp_id = 0; fp->initial_bwp_dl.bwp_id = 0;
fp->initial_bwp_dl.scs = fp->subcarrier_spacing; fp->initial_bwp_dl.scs = fp->subcarrier_spacing;
...@@ -207,9 +184,7 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config, ...@@ -207,9 +184,7 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config,
NR_DL_FRAME_PARMS *fp) NR_DL_FRAME_PARMS *fp)
{ {
fp->eutra_band = config->nfapi_config.rf_bands.rf_band[0];
fp->frame_type = !(config->subframe_config.duplex_mode.value);
fp->L_ssb = config->sch_config.ssb_scg_position_in_burst.value;
return nr_init_frame_parms0(fp, return nr_init_frame_parms0(fp,
config->subframe_config.numerology_index_mu.value, config->subframe_config.numerology_index_mu.value,
config->subframe_config.dl_cyclic_prefix_type.value, config->subframe_config.dl_cyclic_prefix_type.value,
......
...@@ -383,7 +383,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag); ...@@ -383,7 +383,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag);
void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms);
int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char abstraction_flag); int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char abstraction_flag);
void nr_phy_config_request(NR_PHY_Config_t *gNB); void nr_phy_config_request(NR_PHY_Config_t *gNB);
void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,int Nid_cell,uint64_t position_in_burst); void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,int Nid_cell);
void phy_free_nr_gNB(PHY_VARS_gNB *gNB); void phy_free_nr_gNB(PHY_VARS_gNB *gNB);
int l1_north_init_gNB(void); int l1_north_init_gNB(void);
void init_nr_transport(PHY_VARS_gNB *gNB); void init_nr_transport(PHY_VARS_gNB *gNB);
......
...@@ -32,13 +32,13 @@ void nr_init_pbch_dmrs(PHY_VARS_gNB* gNB) ...@@ -32,13 +32,13 @@ void nr_init_pbch_dmrs(PHY_VARS_gNB* gNB)
Nid = cfg->sch_config.physical_cell_id.value; Nid = cfg->sch_config.physical_cell_id.value;
Lmax = fp->Lmax; Lmax = (fp->dl_CarrierFreq < 3e9)? 4:8;
N_hf = (Lmax == 4)? 2:1; N_hf = (Lmax == 4)? 2:1;
for (n_hf = 0; n_hf < N_hf; n_hf++) { for (n_hf = 0; n_hf < N_hf; n_hf++) {
for (l = 0; l < Lmax ; l++) { for (l = 0; l < Lmax ; l++) {
i_ssb = l & (Lmax-1); i_ssb = l & (Lmax-1);
i_ssb2 = i_ssb + (n_hf<<2); i_ssb2 = (i_ssb<<2) + n_hf;
reset = 1; reset = 1;
x2 = (1<<11) * (i_ssb2 + 1) * ((Nid>>2) + 1) + (1<<6) * (i_ssb2 + 1) + (Nid&3); x2 = (1<<11) * (i_ssb2 + 1) * ((Nid>>2) + 1) + (1<<6) * (i_ssb2 + 1) + (Nid&3);
......
...@@ -29,14 +29,15 @@ void nr_gold_pbch(PHY_VARS_NR_UE* ue) ...@@ -29,14 +29,15 @@ void nr_gold_pbch(PHY_VARS_NR_UE* ue)
unsigned char Lmax, l, n_hf, N_hf; unsigned char Lmax, l, n_hf, N_hf;
Nid = ue->frame_parms.Nid_cell; Nid = ue->frame_parms.Nid_cell;
Lmax = ue->frame_parms.Lmax;
Lmax = 8; //(fp->dl_CarrierFreq < 3e9)? 4:8;
N_hf = (Lmax == 4)? 2:1; N_hf = (Lmax == 4)? 2:1;
for (n_hf = 0; n_hf < N_hf; n_hf++) { for (n_hf = 0; n_hf < N_hf; n_hf++) {
for (l = 0; l < Lmax ; l++) { for (l = 0; l < Lmax ; l++) {
i_ssb = l & (Lmax-1); i_ssb = l & (Lmax-1);
i_ssb2 = i_ssb + (n_hf<<2); i_ssb2 = (i_ssb<<2) + n_hf;
x1 = 1 + (1<<31); x1 = 1 + (1<<31);
x2 = (1<<11) * (i_ssb2 + 1) * ((Nid>>2) + 1) + (1<<6) * (i_ssb2 + 1) + (Nid&3); x2 = (1<<11) * (i_ssb2 + 1) * ((Nid>>2) + 1) + (1<<6) * (i_ssb2 + 1) + (Nid&3);
......
...@@ -425,11 +425,9 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch, ...@@ -425,11 +425,9 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
m++; m++;
} }
if (k >= frame_parms->ofdm_symbol_size) if (k >= frame_parms->ofdm_symbol_size)
k-=frame_parms->ofdm_symbol_size; k-=frame_parms->ofdm_symbol_size;
} }
return 0; return 0;
} }
...@@ -59,6 +59,7 @@ int nr_generate_pss( int16_t *d_pss, ...@@ -59,6 +59,7 @@ int nr_generate_pss( int16_t *d_pss,
/// Resource mapping /// Resource mapping
a = amp; a = amp;
// PSS occupies a predefined position (subcarriers 56-182, symbol 0) within the SSB block starting from // PSS occupies a predefined position (subcarriers 56-182, symbol 0) within the SSB block starting from
k = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier + 56; //and k = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier + 56; //and
if (k>= frame_parms->ofdm_symbol_size) k-=frame_parms->ofdm_symbol_size; if (k>= frame_parms->ofdm_symbol_size) k-=frame_parms->ofdm_symbol_size;
......
...@@ -425,7 +425,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, ...@@ -425,7 +425,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
uint8_t *decoded_output = nr_ue_pbch_vars->decoded_output; uint8_t *decoded_output = nr_ue_pbch_vars->decoded_output;
uint8_t nushift; uint8_t nushift;
uint16_t M; uint16_t M;
uint8_t Lmax=frame_parms->Lmax; uint8_t Lmax=8; //to update
uint8_t ssb_index=0; uint8_t ssb_index=0;
//uint16_t crc; //uint16_t crc;
//unsigned short idx_demod =0; //unsigned short idx_demod =0;
......
...@@ -308,10 +308,6 @@ typedef struct NR_DL_FRAME_PARMS { ...@@ -308,10 +308,6 @@ typedef struct NR_DL_FRAME_PARMS {
uint16_t ssb_start_subcarrier; uint16_t ssb_start_subcarrier;
/// SSB type /// SSB type
nr_ssb_type_e ssb_type; nr_ssb_type_e ssb_type;
/// Max number of SSB in frame
uint8_t Lmax;
/// SS block pattern (max 64 ssb, each bit is on/off ssb)
uint64_t L_ssb;
/// PBCH polar encoder params /// PBCH polar encoder params
t_nrPolar_params pbch_polar_params; t_nrPolar_params pbch_polar_params;
...@@ -321,4 +317,5 @@ typedef struct NR_DL_FRAME_PARMS { ...@@ -321,4 +317,5 @@ typedef struct NR_DL_FRAME_PARMS {
} NR_DL_FRAME_PARMS; } NR_DL_FRAME_PARMS;
#endif #endif
...@@ -76,52 +76,28 @@ int return_ssb_type(nfapi_config_request_t *cfg) ...@@ -76,52 +76,28 @@ int return_ssb_type(nfapi_config_request_t *cfg)
}*/ }*/
// First SSB starting symbol candidate is used and type B is chosen for 30kHz SCS // First SSB starting symbol candidate is used and type B is chosen for 30kHz SCS
int nr_get_ssb_start_symbol(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *fp) {
int nr_get_ssb_start_symbol(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *fp, uint8_t i_ssb)
{
int mu = cfg->subframe_config.numerology_index_mu.value; int mu = cfg->subframe_config.numerology_index_mu.value;
int symbol = 0; int symbol = 0;
uint8_t n, n_temp;
nr_ssb_type_e type = fp->ssb_type;
int case_AC[2] = {2,8};
int case_BD[4] = {4,8,16,20};
int case_E[8] = {8, 12, 16, 20, 32, 36, 40, 44};
switch(mu) { switch(mu) {
case NR_MU_0:
case NR_MU_0: // case A symbol = 2;
n = i_ssb >> 1;
symbol = case_AC[i_ssb % 2] + 14*n;
break; break;
case NR_MU_1: case NR_MU_1: // case B
if (type == 1){ // case B symbol = 4;
n = i_ssb >> 2;
symbol = case_BD[i_ssb % 4] + 28*n;
}
if (type == 2){ // case C
n = i_ssb >> 1;
symbol = case_AC[i_ssb % 2] + 14*n;
}
break; break;
case NR_MU_3: // case D case NR_MU_3:
n_temp = i_ssb >> 2; symbol = 4;
n = n_temp + (n_temp >> 2);
symbol = case_BD[i_ssb % 4] + 28*n;
break; break;
case NR_MU_4: // case E case NR_MU_4:
n_temp = i_ssb >> 3; symbol = 8;
n = n_temp + (n_temp >> 2);
symbol = case_E[i_ssb % 8] + 56*n;
break; break;
default: default:
AssertFatal(0==1, "Invalid numerology index %d for the synchronization block\n", mu); AssertFatal(0==1, "Invalid numerology index %d for the synchronization block\n", mu);
} }
...@@ -142,44 +118,37 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) { ...@@ -142,44 +118,37 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) {
nfapi_nr_config_request_t *cfg = &gNB->gNB_config; nfapi_nr_config_request_t *cfg = &gNB->gNB_config;
int **txdataF = gNB->common_vars.txdataF; int **txdataF = gNB->common_vars.txdataF;
uint8_t *pbch_pdu=&gNB->pbch_pdu[0]; uint8_t *pbch_pdu=&gNB->pbch_pdu[0];
uint8_t ssb_index, n_hf; int ss_slot = (cfg->sch_config.half_frame_index.value)? 10 : 0;
int ssb_start_symbol, rel_slot; uint8_t Lmax, ssb_index=0, n_hf=0;
n_hf = cfg->sch_config.half_frame_index.value;
// 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;
LOG_D(PHY,"common_signal_procedures: frame %d, slot %d\n",frame,slot); LOG_D(PHY,"common_signal_procedures: frame %d, slot %d\n",frame,slot);
int ssb_start_symbol = nr_get_ssb_start_symbol(cfg, fp);
nr_set_ssb_first_subcarrier(cfg, fp);
Lmax = (fp->dl_CarrierFreq < 3e9)? 4:8;
if(rel_slot<10 && rel_slot>=0) { if (slot == ss_slot) {
for (int i=0; i<2; i++) { // max two SSB per frame // Current implementation is based on SSB in first half frame, first candidate
ssb_index = i + 2*rel_slot; // computing the ssb_index
if ((fp->L_ssb >> ssb_index) & 0x01) { // generating the ssb only if the bit of L_ssb at current ssb index is 1
int ssb_start_symbol_abs = nr_get_ssb_start_symbol(cfg, fp, ssb_index); // computing the starting symbol for current ssb
ssb_start_symbol = ssb_start_symbol_abs % 14; // start symbol wrt slot
nr_set_ssb_first_subcarrier(cfg, fp); // setting the first subcarrier
LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol); LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol);
nr_generate_pss(gNB->d_pss, txdataF[0], AMP, ssb_start_symbol, cfg, fp); nr_generate_pss(gNB->d_pss, txdataF[0], AMP, ssb_start_symbol, cfg, fp);
nr_generate_sss(gNB->d_sss, txdataF[0], AMP, ssb_start_symbol, cfg, fp); nr_generate_sss(gNB->d_sss, txdataF[0], AMP, ssb_start_symbol, cfg, fp);
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index],txdataF[0], AMP, ssb_start_symbol, cfg, fp); if (!(frame&7)) {
LOG_D(PHY,"%d.%d : pbch_configured %d\n",frame,slot,gNB->pbch_configured);
if (gNB->pbch_configured != 1)return;
gNB->pbch_configured = 0;
}
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index],txdataF[0], AMP, ssb_start_symbol, cfg, fp);
nr_generate_pbch(&gNB->pbch, nr_generate_pbch(&gNB->pbch,
pbch_pdu, pbch_pdu,
gNB->nr_pbch_interleaver, gNB->nr_pbch_interleaver,
txdataF[0], txdataF[0],
AMP, AMP,
ssb_start_symbol, ssb_start_symbol,
n_hf,fp->Lmax,ssb_index, n_hf,Lmax,ssb_index,
frame, cfg, fp); frame, cfg, fp);
} }
}
}
} }
void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
......
...@@ -160,7 +160,7 @@ int main(int argc, char **argv) { ...@@ -160,7 +160,7 @@ int main(int argc, char **argv) {
//int run_initial_sync=0; //int run_initial_sync=0;
int loglvl = OAILOG_WARNING; int loglvl = OAILOG_WARNING;
float target_error_rate = 0.01; float target_error_rate = 0.01;
uint64_t SSB_positions=0x01;
uint16_t nb_symb_sch = 12; uint16_t nb_symb_sch = 12;
uint16_t nb_rb = 50; uint16_t nb_rb = 50;
uint8_t Imcs = 9; uint8_t Imcs = 9;
...@@ -174,7 +174,7 @@ int main(int argc, char **argv) { ...@@ -174,7 +174,7 @@ int main(int argc, char **argv) {
//logInit(); //logInit();
randominit(0); randominit(0);
while ((c = getopt(argc, argv, "df:hpg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:")) != -1) { while ((c = getopt(argc, argv, "df:hpg:i:j:n:l:m:r:s:S:y:z:N:F:R:P:")) != -1) {
switch (c) { switch (c) {
case 'f': case 'f':
write_output_file = 1; write_output_file = 1;
...@@ -285,10 +285,6 @@ int main(int argc, char **argv) { ...@@ -285,10 +285,6 @@ int main(int argc, char **argv) {
break; break;
case 'M':
SSB_positions = atoi(optarg);
break;
case 'N': case 'N':
Nid_cell = atoi(optarg); Nid_cell = atoi(optarg);
break; break;
...@@ -347,7 +343,6 @@ int main(int argc, char **argv) { ...@@ -347,7 +343,6 @@ int main(int argc, char **argv) {
printf("-z Number of RX antennas used in UE\n"); printf("-z Number of RX antennas used in UE\n");
printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n"); printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n");
printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n"); printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n");
printf("-M Multiple SSB positions in burst\n");
printf("-N Nid_cell\n"); printf("-N Nid_cell\n");
printf("-R N_RB_DL\n"); printf("-R N_RB_DL\n");
printf("-O oversampling factor (1,2,4,8,16)\n"); printf("-O oversampling factor (1,2,4,8,16)\n");
...@@ -388,7 +383,7 @@ int main(int argc, char **argv) { ...@@ -388,7 +383,7 @@ int main(int argc, char **argv) {
frame_parms->N_RB_DL = N_RB_DL; frame_parms->N_RB_DL = N_RB_DL;
frame_parms->Ncp = extended_prefix_flag ? EXTENDED : NORMAL; frame_parms->Ncp = extended_prefix_flag ? EXTENDED : NORMAL;
crcTableInit(); crcTableInit();
nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_DL, mu, Nid_cell,SSB_positions); nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_DL, mu, Nid_cell);
phy_init_nr_gNB(gNB, 0, 0); phy_init_nr_gNB(gNB, 0, 0);
//init_eNB_afterRU(); //init_eNB_afterRU();
frame_length_complex_samples = frame_parms->samples_per_subframe; frame_length_complex_samples = frame_parms->samples_per_subframe;
......
...@@ -101,9 +101,7 @@ int rrc_init_nr_global_param(void){return(0);} ...@@ -101,9 +101,7 @@ int rrc_init_nr_global_param(void){return(0);}
void config_common(int Mod_idP, void config_common(int Mod_idP,
int CC_idP, int CC_idP,
int Nid_cell,
int nr_bandP, int nr_bandP,
uint64_t ssb_pattern,
uint64_t dl_CarrierFreqP, uint64_t dl_CarrierFreqP,
uint32_t dl_BandwidthP uint32_t dl_BandwidthP
); );
...@@ -136,7 +134,6 @@ int main(int argc, char **argv) ...@@ -136,7 +134,6 @@ int main(int argc, char **argv)
int trial,n_trials=1,n_errors,n_errors2,n_alamouti; int trial,n_trials=1,n_errors,n_errors2,n_alamouti;
uint8_t transmission_mode = 1,n_tx=1,n_rx=1; uint8_t transmission_mode = 1,n_tx=1,n_rx=1;
uint16_t Nid_cell=0; uint16_t Nid_cell=0;
uint64_t SSB_positions=0x01;
channel_desc_t *gNB2UE; channel_desc_t *gNB2UE;
uint32_t nsymb,tx_lev,tx_lev1 = 0,tx_lev2 = 0; uint32_t nsymb,tx_lev,tx_lev1 = 0,tx_lev2 = 0;
...@@ -154,8 +151,6 @@ int main(int argc, char **argv) ...@@ -154,8 +151,6 @@ int main(int argc, char **argv)
int pbch_tx_ant; int pbch_tx_ant;
int N_RB_DL=273,mu=1; int N_RB_DL=273,mu=1;
uint64_t ssb_pattern = 0;
unsigned char frame_type = 0; unsigned char frame_type = 0;
unsigned char pbch_phase = 0; unsigned char pbch_phase = 0;
...@@ -187,7 +182,7 @@ int main(int argc, char **argv) ...@@ -187,7 +182,7 @@ int main(int argc, char **argv)
randominit(0); randominit(0);
while ((c = getopt (argc, argv, "f:hA:pf:g:i:j:n:s:S:t:x:y:z:M:N:F:GR:dP:IL:")) != -1) { while ((c = getopt (argc, argv, "f:hA:pf:g:i:j:n:s:S:t:x:y:z:N:F:GR:dP:IL:")) != -1) {
switch (c) { switch (c) {
case 'f': case 'f':
write_output_file=1; write_output_file=1;
...@@ -314,10 +309,6 @@ int main(int argc, char **argv) ...@@ -314,10 +309,6 @@ int main(int argc, char **argv)
break; break;
case 'M':
SSB_positions = atoi(optarg);
break;
case 'N': case 'N':
Nid_cell = atoi(optarg); Nid_cell = atoi(optarg);
break; break;
...@@ -370,7 +361,6 @@ int main(int argc, char **argv) ...@@ -370,7 +361,6 @@ int main(int argc, char **argv)
printf("-z Number of RX antennas used in UE\n"); printf("-z Number of RX antennas used in UE\n");
printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n"); printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n");
printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n"); printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n");
printf("-M Multiple SSB positions in burst\n");
printf("-N Nid_cell\n"); printf("-N Nid_cell\n");
printf("-R N_RB_DL\n"); printf("-R N_RB_DL\n");
printf("-O oversampling factor (1,2,4,8,16)\n"); printf("-O oversampling factor (1,2,4,8,16)\n");
...@@ -406,7 +396,7 @@ int main(int argc, char **argv) ...@@ -406,7 +396,7 @@ int main(int argc, char **argv)
frame_parms->N_RB_UL = N_RB_DL; frame_parms->N_RB_UL = N_RB_DL;
// stub to configure frame_parms // stub to configure frame_parms
nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,Nid_cell,SSB_positions); nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,Nid_cell);
// call MAC to configure common parameters // call MAC to configure common parameters
phy_init_nr_gNB(gNB,0,0); phy_init_nr_gNB(gNB,0,0);
...@@ -509,7 +499,7 @@ int main(int argc, char **argv) ...@@ -509,7 +499,7 @@ int main(int argc, char **argv)
mac_top_init_gNB(); mac_top_init_gNB();
gNB_mac = RC.nrmac[0]; gNB_mac = RC.nrmac[0];
config_common(0,0,Nid_cell,78,ssb_pattern,(uint64_t)3640000000L,N_RB_DL); config_common(0,0,78,(uint64_t)3640000000L,N_RB_DL);
config_nr_mib(0,0,1,kHz30,0,0,0,0); config_nr_mib(0,0,1,kHz30,0,0,0,0);
nr_l2_init_ue(); nr_l2_init_ue();
......
...@@ -105,7 +105,6 @@ int main(int argc, char **argv) ...@@ -105,7 +105,6 @@ int main(int argc, char **argv)
int trial,n_trials=1,n_errors=0,n_errors_payload=0; int trial,n_trials=1,n_errors=0,n_errors_payload=0;
uint8_t transmission_mode = 1,n_tx=1,n_rx=1; uint8_t transmission_mode = 1,n_tx=1,n_rx=1;
uint16_t Nid_cell=0; uint16_t Nid_cell=0;
uint64_t SSB_positions=0x01;
channel_desc_t *gNB2UE; channel_desc_t *gNB2UE;
...@@ -149,7 +148,7 @@ int main(int argc, char **argv) ...@@ -149,7 +148,7 @@ int main(int argc, char **argv)
randominit(0); randominit(0);
while ((c = getopt (argc, argv, "f:hA:pf:g:i:j:n:o:s:S:t:x:y:z:M:N:F:GR:dP:IL:")) != -1) { while ((c = getopt (argc, argv, "f:hA:pf:g:i:j:n:o:s:S:t:x:y:z:N:F:GR:dP:IL:")) != -1) {
switch (c) { switch (c) {
case 'f': case 'f':
write_output_file=1; write_output_file=1;
...@@ -281,10 +280,6 @@ int main(int argc, char **argv) ...@@ -281,10 +280,6 @@ int main(int argc, char **argv)
break; break;
case 'M':
SSB_positions = atoi(optarg);
break;
case 'N': case 'N':
Nid_cell = atoi(optarg); Nid_cell = atoi(optarg);
break; break;
...@@ -338,7 +333,6 @@ int main(int argc, char **argv) ...@@ -338,7 +333,6 @@ int main(int argc, char **argv)
printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n"); printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n");
printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n"); printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n");
printf("-o Carrier frequency offset in Hz\n"); printf("-o Carrier frequency offset in Hz\n");
printf("-M Multiple SSB positions in burst\n");
printf("-N Nid_cell\n"); printf("-N Nid_cell\n");
printf("-R N_RB_DL\n"); printf("-R N_RB_DL\n");
printf("-O oversampling factor (1,2,4,8,16)\n"); printf("-O oversampling factor (1,2,4,8,16)\n");
...@@ -372,34 +366,32 @@ int main(int argc, char **argv) ...@@ -372,34 +366,32 @@ int main(int argc, char **argv)
frame_parms->N_RB_UL = N_RB_DL; frame_parms->N_RB_UL = N_RB_DL;
frame_parms->Nid_cell = Nid_cell; frame_parms->Nid_cell = Nid_cell;
nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,Nid_cell,SSB_positions); nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,Nid_cell);
phy_init_nr_gNB(gNB,0,0); phy_init_nr_gNB(gNB,0,0);
double fs,bw,scs,eps; double fs,bw,scs,eps;
switch (mu) { if (mu == 1 && N_RB_DL == 217) {
case 1:
scs = 30000;
if (N_RB_DL == 217) {
fs = 122.88e6; fs = 122.88e6;
bw = 80e6; bw = 80e6;
scs = 30000;
} }
else if (N_RB_DL == 245) { else if (mu == 1 && N_RB_DL == 245) {
fs = 122.88e6; fs = 122.88e6;
bw = 90e6; bw = 90e6;
scs = 30000;
} }
else if (N_RB_DL == 273) { else if (mu == 1 && N_RB_DL == 273) {
fs = 122.88e6; fs = 122.88e6;
bw = 100e6; bw = 100e6;
scs = 30000;
} }
else if (N_RB_DL == 106) { else if (mu == 1 && N_RB_DL == 106) {
fs = 61.44e6; fs = 61.44e6;
bw = 40e6; bw = 40e6;
scs = 30000;
} }
else AssertFatal(1==0,"Unsupported numerology for mu %d, N_RB %d\n",mu, N_RB_DL); else AssertFatal(1==0,"Unsupported numerology for mu %d, N_RB %d\n",mu, N_RB_DL);
break;
}
// cfo with respect to sub-carrier spacing // cfo with respect to sub-carrier spacing
eps = cfo/scs; eps = cfo/scs;
...@@ -484,7 +476,6 @@ int main(int argc, char **argv) ...@@ -484,7 +476,6 @@ int main(int argc, char **argv)
if (input_fd==NULL) { if (input_fd==NULL) {
gNB->pbch_configured = 1; gNB->pbch_configured = 1;
for (int i=0;i<4;i++) gNB->pbch_pdu[i]=i+1; for (int i=0;i<4;i++) gNB->pbch_pdu[i]=i+1;
nr_common_signal_procedures (gNB,frame,subframe); nr_common_signal_procedures (gNB,frame,subframe);
LOG_M("txsigF0.m","txsF0", gNB->common_vars.txdataF[0],frame_length_complex_samples_no_prefix,1,1); LOG_M("txsigF0.m","txsF0", gNB->common_vars.txdataF[0],frame_length_complex_samples_no_prefix,1,1);
......
...@@ -361,7 +361,7 @@ typedef struct NRRrcConfigurationReq_s { ...@@ -361,7 +361,7 @@ typedef struct NRRrcConfigurationReq_s {
lte_prefix_type_t UL_BWP_prefix_type[MAX_NUM_CCs]; lte_prefix_type_t UL_BWP_prefix_type[MAX_NUM_CCs];
long UL_timeAlignmentTimerCommon[MAX_NUM_CCs]; long UL_timeAlignmentTimerCommon[MAX_NUM_CCs];
long ServingCellConfigCommon_n_TimingAdvanceOffset[MAX_NUM_CCs]; long ServingCellConfigCommon_n_TimingAdvanceOffset[MAX_NUM_CCs];
uint64_t ServingCellConfigCommon_ssb_PositionsInBurst_PR[MAX_NUM_CCs]; long ServingCellConfigCommon_ssb_PositionsInBurst_PR[MAX_NUM_CCs];
long ServingCellConfigCommon_ssb_periodicityServingCell[MAX_NUM_CCs]; //ServingCellConfigCommon long ServingCellConfigCommon_ssb_periodicityServingCell[MAX_NUM_CCs]; //ServingCellConfigCommon
long ServingCellConfigCommon_dmrs_TypeA_Position[MAX_NUM_CCs]; //ServingCellConfigCommon long ServingCellConfigCommon_dmrs_TypeA_Position[MAX_NUM_CCs]; //ServingCellConfigCommon
long NIA_SubcarrierSpacing[MAX_NUM_CCs]; //ServingCellConfigCommon Used only for non-initial access long NIA_SubcarrierSpacing[MAX_NUM_CCs]; //ServingCellConfigCommon Used only for non-initial access
......
...@@ -103,6 +103,7 @@ void RCconfig_nr_flexran() ...@@ -103,6 +103,7 @@ void RCconfig_nr_flexran()
*UL_frequencyShift7p5khz, *UL_SCS_SubcarrierSpacing, *UL_BWP_SubcarrierSpacing, *UL_frequencyShift7p5khz, *UL_SCS_SubcarrierSpacing, *UL_BWP_SubcarrierSpacing,
*UL_BWP_prefix_type, *UL_timeAlignmentTimerCommon, *UL_BWP_prefix_type, *UL_timeAlignmentTimerCommon,
*ServingCellConfigCommon_n_TimingAdvanceOffset, *ServingCellConfigCommon_n_TimingAdvanceOffset,
*ServingCellConfigCommon_ssb_PositionsInBurst_PR,
*NIA_SubcarrierSpacing, *referenceSubcarrierSpacing, *dl_UL_TransmissionPeriodicity, *NIA_SubcarrierSpacing, *referenceSubcarrierSpacing, *dl_UL_TransmissionPeriodicity,
*rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice, *rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice,
*rach_groupBconfigured, *rach_messagePowerOffsetGroupB, *rach_groupBconfigured, *rach_messagePowerOffsetGroupB,
...@@ -117,7 +118,7 @@ void RCconfig_nr_flexran() ...@@ -117,7 +118,7 @@ void RCconfig_nr_flexran()
*SearchSpace_searchSpaceType, *ue_Specific__dci_Formats, *SearchSpace_searchSpaceType, *ue_Specific__dci_Formats,
*RateMatchPatternLTE_CRS_subframeAllocation_choice; *RateMatchPatternLTE_CRS_subframeAllocation_choice;
uint64_t downlink_frequency, ServingCellConfigCommon_ssb_PositionsInBurst_PR; uint64_t downlink_frequency;
int32_t nr_band, uplink_frequency_offset, N_RB_DL, nb_antenna_ports, int32_t nr_band, uplink_frequency_offset, N_RB_DL, nb_antenna_ports,
MIB_subCarrierSpacingCommon, MIB_ssb_SubcarrierOffset, MIB_dmrs_TypeA_Position, MIB_subCarrierSpacingCommon, MIB_ssb_SubcarrierOffset, MIB_dmrs_TypeA_Position,
...@@ -483,7 +484,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { ...@@ -483,7 +484,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
char* UL_timeAlignmentTimerCommon = 0; char* UL_timeAlignmentTimerCommon = 0;
char* ServingCellConfigCommon_n_TimingAdvanceOffset = 0; char* ServingCellConfigCommon_n_TimingAdvanceOffset = 0;
uint64_t ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0; char* ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0;
int32_t ServingCellConfigCommon_ssb_periodicityServingCell = 0; int32_t ServingCellConfigCommon_ssb_periodicityServingCell = 0;
int32_t ServingCellConfigCommon_dmrs_TypeA_Position = 0; int32_t ServingCellConfigCommon_dmrs_TypeA_Position = 0;
char* NIA_SubcarrierSpacing = 0; char* NIA_SubcarrierSpacing = 0;
...@@ -1124,24 +1125,20 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { ...@@ -1124,24 +1125,20 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
RC.config_file_name, i, ServingCellConfigCommon_n_TimingAdvanceOffset); RC.config_file_name, i, ServingCellConfigCommon_n_TimingAdvanceOffset);
} }
if (strcmp(ServingCellConfigCommon_ssb_PositionsInBurst_PR,"shortBitmap")==0) {
uint64_t t_freq; NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_shortBitmap;
if(nr_band == 41 || (nr_band > 76 && nr_band < 80)) }else if (strcmp(ServingCellConfigCommon_ssb_PositionsInBurst_PR,"mediumBitmap")==0) {
t_freq = 2400000000; NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap;
else }else if (strcmp(ServingCellConfigCommon_ssb_PositionsInBurst_PR,"longBitmap")==0) {
t_freq = 3000000000; NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_longBitmap;
}else if (strcmp(ServingCellConfigCommon_ssb_PositionsInBurst_PR,"NOTHING")==0) {
if (downlink_frequency<t_freq && (ServingCellConfigCommon_ssb_PositionsInBurst_PR > 15)) NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_NOTHING;
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unvalid value \"%ld\" for ssb_PositionsInBurst at DL frequency %ld !\n", }else {
RC.config_file_name, i, ServingCellConfigCommon_ssb_PositionsInBurst_PR, downlink_frequency); AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for ServingCellConfigCommon_ssb_PositionsInBurst_PR choice !\n",
else { RC.config_file_name, i, ServingCellConfigCommon_ssb_PositionsInBurst_PR);
if(downlink_frequency<6000000000 && (ServingCellConfigCommon_ssb_PositionsInBurst_PR > 255))
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unvalid value \"%ld\" for ssb_PositionsInBurst at DL frequency %ld !\n",
RC.config_file_name, i, ServingCellConfigCommon_ssb_PositionsInBurst_PR, downlink_frequency);
else
NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = ServingCellConfigCommon_ssb_PositionsInBurst_PR;
} }
switch (ServingCellConfigCommon_ssb_periodicityServingCell) { switch (ServingCellConfigCommon_ssb_periodicityServingCell) {
case 5: case 5:
NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_periodicityServingCell[j] = NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms5; NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_periodicityServingCell[j] = NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms5;
......
...@@ -640,7 +640,7 @@ typedef enum { ...@@ -640,7 +640,7 @@ typedef enum {
{GNB_CONFIG_STRING_UL_BWP_PREFIX_TYPE, NULL, 0, strptr:&UL_BWP_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \ {GNB_CONFIG_STRING_UL_BWP_PREFIX_TYPE, NULL, 0, strptr:&UL_BWP_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_UL_TIMEALIGNMENTTIMERCOMMON, NULL, 0, strptr:&UL_timeAlignmentTimerCommon, defstrval:"infinity", TYPE_STRING, 0}, \ {GNB_CONFIG_STRING_UL_TIMEALIGNMENTTIMERCOMMON, NULL, 0, strptr:&UL_timeAlignmentTimerCommon, defstrval:"infinity", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_N_TIMINGADVANCEOFFSET, NULL, 0, strptr:&ServingCellConfigCommon_n_TimingAdvanceOffset, defstrval:"n0", TYPE_STRING, 0}, \ {GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_N_TIMINGADVANCEOFFSET, NULL, 0, strptr:&ServingCellConfigCommon_n_TimingAdvanceOffset, defstrval:"n0", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR, NULL, 0, i64ptr:(int64_t *)&ServingCellConfigCommon_ssb_PositionsInBurst_PR, defint64val:0, TYPE_UINT64, 0}, \ {GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR, NULL, 0, strptr:&ServingCellConfigCommon_ssb_PositionsInBurst_PR, defstrval:"shortBitmap", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL, NULL, 0, iptr:&ServingCellConfigCommon_ssb_periodicityServingCell, defintval:10, TYPE_UINT, 0}, \ {GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL, NULL, 0, iptr:&ServingCellConfigCommon_ssb_periodicityServingCell, defintval:10, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION, NULL, 0, iptr:&ServingCellConfigCommon_dmrs_TypeA_Position, defintval:0, TYPE_UINT, 0}, \ {GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION, NULL, 0, iptr:&ServingCellConfigCommon_dmrs_TypeA_Position, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_NIA_SUBCARRIERSPACING, NULL, 0, strptr:&NIA_SubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \ {GNB_CONFIG_STRING_NIA_SUBCARRIERSPACING, NULL, 0, strptr:&NIA_SubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \
......
...@@ -184,9 +184,7 @@ void config_nr_mib(int Mod_idP, ...@@ -184,9 +184,7 @@ void config_nr_mib(int Mod_idP,
void config_common(int Mod_idP, void config_common(int Mod_idP,
int CC_idP, int CC_idP,
int cellid,
int nr_bandP, int nr_bandP,
uint64_t ssb_pattern,
uint64_t dl_CarrierFreqP, uint64_t dl_CarrierFreqP,
uint32_t dl_BandwidthP uint32_t dl_BandwidthP
){ ){
...@@ -195,9 +193,6 @@ void config_common(int Mod_idP, ...@@ -195,9 +193,6 @@ void config_common(int Mod_idP,
int mu = 1; int mu = 1;
cfg->sch_config.physical_cell_id.value = cellid;
cfg->sch_config.ssb_scg_position_in_burst.value = ssb_pattern;
// FDD // FDD
cfg->subframe_config.duplex_mode.value = 1; cfg->subframe_config.duplex_mode.value = 1;
cfg->subframe_config.duplex_mode.tl.tag = NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG; cfg->subframe_config.duplex_mode.tl.tag = NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG;
...@@ -237,10 +232,8 @@ void config_common(int Mod_idP, ...@@ -237,10 +232,8 @@ void config_common(int Mod_idP,
int rrc_mac_config_req_gNB(module_id_t Mod_idP, int rrc_mac_config_req_gNB(module_id_t Mod_idP,
int CC_idP, int CC_idP,
int cellid,
int p_gNB, int p_gNB,
int nr_bandP, int nr_bandP,
uint64_t ssb_pattern,
uint64_t dl_CarrierFreqP, uint64_t dl_CarrierFreqP,
int dl_BandwidthP, int dl_BandwidthP,
NR_BCCH_BCH_Message_t *mib, NR_BCCH_BCH_Message_t *mib,
...@@ -265,13 +258,10 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ...@@ -265,13 +258,10 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
); );
}// END if( mib != NULL ) }// END if( mib != NULL )
if( servingcellconfigcommon != NULL ){ if( servingcellconfigcommon != NULL ){
config_common(Mod_idP, config_common(Mod_idP,
CC_idP, CC_idP,
cellid,
nr_bandP, nr_bandP,
ssb_pattern,
dl_CarrierFreqP, dl_CarrierFreqP,
dl_BandwidthP dl_BandwidthP
); );
......
...@@ -38,10 +38,8 @@ void mac_top_init_gNB(void); ...@@ -38,10 +38,8 @@ void mac_top_init_gNB(void);
int rrc_mac_config_req_gNB(module_id_t Mod_idP, int rrc_mac_config_req_gNB(module_id_t Mod_idP,
int CC_id, int CC_id,
int cellid,
int p_gNB, int p_gNB,
int nr_bandP, int nr_bandP,
uint64_t ssb_pattern,
uint64_t dl_CarrierFreqP, uint64_t dl_CarrierFreqP,
int dl_BandwidthP, int dl_BandwidthP,
NR_BCCH_BCH_Message_t *mib, NR_BCCH_BCH_Message_t *mib,
......
...@@ -747,21 +747,15 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, ...@@ -747,21 +747,15 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
//ssb_PositionsInBurst //ssb_PositionsInBurst
(*servingcellconfigcommon)->ssb_PositionsInBurst->present = configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id]; (*servingcellconfigcommon)->ssb_PositionsInBurst->present = configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id];
uint64_t t_freq; if((*servingcellconfigcommon)->ssb_PositionsInBurst->present == NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_shortBitmap){
if(configuration->nr_band[CC_id] == 41 || (configuration->nr_band[CC_id] > 76 && configuration->nr_band[CC_id] < 80))
t_freq = 2400000000;
else
t_freq = 3000000000;
if(configuration->downlink_frequency[CC_id]<t_freq){
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.size = 1; (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.size = 1;
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.bits_unused = 4; (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.bits_unused = 4;
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.buf[0] = configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id]; (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.buf[0] = 0x0f;
}else if(configuration->downlink_frequency[CC_id]<6000000000){ }else if((*servingcellconfigcommon)->ssb_PositionsInBurst->present == NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap){
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.size = 1; (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.size = 1;
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.bits_unused = 0; (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.bits_unused = 0;
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.buf[0] = configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id]; (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.buf[0] = 0xff;
}else { }else if((*servingcellconfigcommon)->ssb_PositionsInBurst->present == NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_longBitmap){
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.size = 8; (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.size = 8;
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.bits_unused = 0; (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.bits_unused = 0;
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[0] = 0xff; (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[0] = 0xff;
...@@ -774,7 +768,6 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, ...@@ -774,7 +768,6 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[7] = 0xff; (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[7] = 0xff;
} }
//ssb_periodicityServingCell //ssb_periodicityServingCell
*(*servingcellconfigcommon)->ssb_periodicityServingCell = configuration->ServingCellConfigCommon_ssb_periodicityServingCell[CC_id]; *(*servingcellconfigcommon)->ssb_periodicityServingCell = configuration->ServingCellConfigCommon_ssb_periodicityServingCell[CC_id];
//dmrs_TypeA_Position //dmrs_TypeA_Position
......
...@@ -264,10 +264,8 @@ static void init_NR_SI(const protocol_ctxt_t* const ctxt_pP, ...@@ -264,10 +264,8 @@ static void init_NR_SI(const protocol_ctxt_t* const ctxt_pP,
rrc_mac_config_req_gNB(ctxt_pP->module_id, rrc_mac_config_req_gNB(ctxt_pP->module_id,
CC_id, CC_id,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].physCellId,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_gNB, RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_gNB,
configuration->nr_band[CC_id], configuration->nr_band[CC_id],
configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id],
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq, RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq,
configuration->N_RB_DL[CC_id], configuration->N_RB_DL[CC_id],
(NR_BCCH_BCH_Message_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].mib, (NR_BCCH_BCH_Message_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].mib,
......
...@@ -26,10 +26,10 @@ gNBs = ...@@ -26,10 +26,10 @@ gNBs =
node_function = "3GPP_gNODEB"; node_function = "3GPP_gNODEB";
node_timing = "synch_to_ext_device"; node_timing = "synch_to_ext_device";
node_synch_ref = 0; node_synch_ref = 0;
frame_type = "TDD"; frame_type = "FDD";
DL_prefix_type = "NORMAL"; DL_prefix_type = "NORMAL";
UL_prefix_type = "NORMAL"; UL_prefix_type = "NORMAL";
eutra_band = 78; eutra_band = 22;
downlink_frequency = 3510000000L; downlink_frequency = 3510000000L;
uplink_frequency_offset = -120000000; uplink_frequency_offset = -120000000;
Nid_cell = 0; Nid_cell = 0;
...@@ -70,7 +70,7 @@ gNBs = ...@@ -70,7 +70,7 @@ gNBs =
UL_BWP_prefix_type = "NORMAL"; UL_BWP_prefix_type = "NORMAL";
UL_timeAlignmentTimerCommon = "infinity"; UL_timeAlignmentTimerCommon = "infinity";
ServingCellConfigCommon_n_TimingAdvanceOffset = "n0" ServingCellConfigCommon_n_TimingAdvanceOffset = "n0"
ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x01; ServingCellConfigCommon_ssb_PositionsInBurst_PR = "shortBitmap";
ServingCellConfigCommon_ssb_periodicityServingCell = 10; ServingCellConfigCommon_ssb_periodicityServingCell = 10;
ServingCellConfigCommon_dmrs_TypeA_Position = 2; ServingCellConfigCommon_dmrs_TypeA_Position = 2;
NIA_SubcarrierSpacing = "kHz15"; NIA_SubcarrierSpacing = "kHz15";
......
...@@ -26,10 +26,10 @@ gNBs = ...@@ -26,10 +26,10 @@ gNBs =
node_function = "3GPP_gNODEB"; node_function = "3GPP_gNODEB";
node_timing = "synch_to_ext_device"; node_timing = "synch_to_ext_device";
node_synch_ref = 0; node_synch_ref = 0;
frame_type = "TDD"; frame_type = "FDD";
DL_prefix_type = "NORMAL"; DL_prefix_type = "NORMAL";
UL_prefix_type = "NORMAL"; UL_prefix_type = "NORMAL";
eutra_band = 78; eutra_band = 22;
downlink_frequency = 3510000000L; downlink_frequency = 3510000000L;
uplink_frequency_offset = -120000000; uplink_frequency_offset = -120000000;
Nid_cell = 0; Nid_cell = 0;
...@@ -70,7 +70,7 @@ gNBs = ...@@ -70,7 +70,7 @@ gNBs =
UL_BWP_prefix_type = "NORMAL"; UL_BWP_prefix_type = "NORMAL";
UL_timeAlignmentTimerCommon = "infinity"; UL_timeAlignmentTimerCommon = "infinity";
ServingCellConfigCommon_n_TimingAdvanceOffset = "n0" ServingCellConfigCommon_n_TimingAdvanceOffset = "n0"
ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x01; ServingCellConfigCommon_ssb_PositionsInBurst_PR = "shortBitmap";
ServingCellConfigCommon_ssb_periodicityServingCell = 10; ServingCellConfigCommon_ssb_periodicityServingCell = 10;
ServingCellConfigCommon_dmrs_TypeA_Position = 2; ServingCellConfigCommon_dmrs_TypeA_Position = 2;
NIA_SubcarrierSpacing = "kHz15"; NIA_SubcarrierSpacing = "kHz15";
......
...@@ -26,10 +26,10 @@ gNBs = ...@@ -26,10 +26,10 @@ gNBs =
node_function = "3GPP_gNODEB"; node_function = "3GPP_gNODEB";
node_timing = "synch_to_ext_device"; node_timing = "synch_to_ext_device";
node_synch_ref = 0; node_synch_ref = 0;
frame_type = "TDD"; frame_type = "FDD";
DL_prefix_type = "NORMAL"; DL_prefix_type = "NORMAL";
UL_prefix_type = "NORMAL"; UL_prefix_type = "NORMAL";
eutra_band = 78; eutra_band = 22;
downlink_frequency = 3510000000L; downlink_frequency = 3510000000L;
uplink_frequency_offset = -120000000; uplink_frequency_offset = -120000000;
Nid_cell = 0; Nid_cell = 0;
...@@ -70,7 +70,7 @@ gNBs = ...@@ -70,7 +70,7 @@ gNBs =
UL_BWP_prefix_type = "NORMAL"; UL_BWP_prefix_type = "NORMAL";
UL_timeAlignmentTimerCommon = "infinity"; UL_timeAlignmentTimerCommon = "infinity";
ServingCellConfigCommon_n_TimingAdvanceOffset = "n0" ServingCellConfigCommon_n_TimingAdvanceOffset = "n0"
ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x01; ServingCellConfigCommon_ssb_PositionsInBurst_PR = "shortBitmap";
ServingCellConfigCommon_ssb_periodicityServingCell = 10; ServingCellConfigCommon_ssb_periodicityServingCell = 10;
ServingCellConfigCommon_dmrs_TypeA_Position = 2; ServingCellConfigCommon_dmrs_TypeA_Position = 2;
NIA_SubcarrierSpacing = "kHz15"; NIA_SubcarrierSpacing = "kHz15";
......
...@@ -26,10 +26,10 @@ gNBs = ...@@ -26,10 +26,10 @@ gNBs =
node_function = "3GPP_gNODEB"; node_function = "3GPP_gNODEB";
node_timing = "synch_to_ext_device"; node_timing = "synch_to_ext_device";
node_synch_ref = 0; node_synch_ref = 0;
frame_type = "TDD"; frame_type = "FDD";
DL_prefix_type = "NORMAL"; DL_prefix_type = "NORMAL";
UL_prefix_type = "NORMAL"; UL_prefix_type = "NORMAL";
eutra_band = 78; eutra_band = 22;
downlink_frequency = 3510000000L; downlink_frequency = 3510000000L;
uplink_frequency_offset = -120000000; uplink_frequency_offset = -120000000;
Nid_cell = 0; Nid_cell = 0;
...@@ -70,7 +70,7 @@ gNBs = ...@@ -70,7 +70,7 @@ gNBs =
UL_BWP_prefix_type = "NORMAL"; UL_BWP_prefix_type = "NORMAL";
UL_timeAlignmentTimerCommon = "infinity"; UL_timeAlignmentTimerCommon = "infinity";
ServingCellConfigCommon_n_TimingAdvanceOffset = "n0" ServingCellConfigCommon_n_TimingAdvanceOffset = "n0"
ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x01; ServingCellConfigCommon_ssb_PositionsInBurst_PR = "shortBitmap";
ServingCellConfigCommon_ssb_periodicityServingCell = 10; ServingCellConfigCommon_ssb_periodicityServingCell = 10;
ServingCellConfigCommon_dmrs_TypeA_Position = 2; ServingCellConfigCommon_dmrs_TypeA_Position = 2;
NIA_SubcarrierSpacing = "kHz15"; NIA_SubcarrierSpacing = "kHz15";
......
...@@ -175,38 +175,35 @@ typedef struct band_info_s { ...@@ -175,38 +175,35 @@ typedef struct band_info_s {
band_info_t bands_to_scan; band_info_t bands_to_scan;
static const eutra_band_t eutra_bands[] = { static const eutra_band_t eutra_bands[] = {
{1, 1920000, 1980000, 2110000, 2170000, FDD}, { 1, 1920 * MHz, 1980 * MHz, 2110 * MHz, 2170 * MHz, FDD},
{2, 1850000, 1910000, 1930000, 1990000, FDD}, { 2, 1850 * MHz, 1910 * MHz, 1930 * MHz, 1990 * MHz, FDD},
{3, 1710000, 1785000, 1805000, 1880000, FDD}, { 3, 1710 * MHz, 1785 * MHz, 1805 * MHz, 1880 * MHz, FDD},
{5, 824000, 849000, 869000, 894000, FDD}, { 4, 1710 * MHz, 1755 * MHz, 2110 * MHz, 2155 * MHz, FDD},
{7, 2500000, 2570000, 2620000, 2690000, FDD}, { 5, 824 * MHz, 849 * MHz, 869 * MHz, 894 * MHz, FDD},
{8, 880000, 915000, 925000, 960000, FDD}, { 6, 830 * MHz, 840 * MHz, 875 * MHz, 885 * MHz, FDD},
{12, 698000, 716000, 728000, 746000, FDD}, { 7, 2500 * MHz, 2570 * MHz, 2620 * MHz, 2690 * MHz, FDD},
{20, 832000, 862000, 791000, 821000, FDD}, { 8, 880 * MHz, 915 * MHz, 925 * MHz, 960 * MHz, FDD},
{25, 1850000, 1915000, 1930000, 1995000, FDD}, { 9, 1749900 * KHz, 1784900 * KHz, 1844900 * KHz, 1879900 * KHz, FDD},
{28, 703000, 758000, 758000, 813000, FDD}, {10, 1710 * MHz, 1770 * MHz, 2110 * MHz, 2170 * MHz, FDD},
{34, 2010000, 2025000, 2010000, 2025000, TDD}, {11, 1427900 * KHz, 1452900 * KHz, 1475900 * KHz, 1500900 * KHz, FDD},
{38, 2570000, 2620000, 2570000, 2630000, TDD}, {12, 698 * MHz, 716 * MHz, 728 * MHz, 746 * MHz, FDD},
{39, 1880000, 1920000, 1880000, 1920000, TDD}, {13, 777 * MHz, 787 * MHz, 746 * MHz, 756 * MHz, FDD},
{40, 2300000, 2400000, 2300000, 2400000, TDD}, {14, 788 * MHz, 798 * MHz, 758 * MHz, 768 * MHz, FDD},
{41, 2496000, 2690000, 2496000, 2690000, TDD}, {17, 704 * MHz, 716 * MHz, 734 * MHz, 746 * MHz, FDD},
{50, 1432000, 1517000, 1432000, 1517000, TDD}, {20, 832 * MHz, 862 * MHz, 791 * MHz, 821 * MHz, FDD},
{51, 1427000, 1432000, 1427000, 1432000, TDD}, {22, 3510 * MHz, 3590 * MHz, 3410 * MHz, 3490 * MHz, FDD},
{66, 1710000, 1780000, 2110000, 2200000, FDD}, {33, 1900 * MHz, 1920 * MHz, 1900 * MHz, 1920 * MHz, TDD},
{70, 1695000, 1710000, 1995000, 2020000, FDD}, {34, 2010 * MHz, 2025 * MHz, 2010 * MHz, 2025 * MHz, TDD},
{71, 663000, 698000, 617000, 652000, FDD}, {35, 1850 * MHz, 1910 * MHz, 1850 * MHz, 1910 * MHz, TDD},
{74, 1427000, 1470000, 1475000, 1518000, FDD}, {36, 1930 * MHz, 1990 * MHz, 1930 * MHz, 1990 * MHz, TDD},
{75, 000, 000, 1432000, 1517000, FDD}, {37, 1910 * MHz, 1930 * MHz, 1910 * MHz, 1930 * MHz, TDD},
{76, 000, 000, 1427000, 1432000, FDD}, {38, 2570 * MHz, 2620 * MHz, 2570 * MHz, 2630 * MHz, TDD},
{77, 3300000, 4200000, 3300000, 4200000, TDD}, {39, 1880 * MHz, 1920 * MHz, 1880 * MHz, 1920 * MHz, TDD},
{78, 3300000, 3800000, 3300000, 3800000, TDD}, {40, 2300 * MHz, 2400 * MHz, 2300 * MHz, 2400 * MHz, TDD},
{79, 4400000, 5000000, 4400000, 5000000, TDD}, {41, 2496 * MHz, 2690 * MHz, 2496 * MHz, 2690 * MHz, TDD},
{80, 1710000, 1785000, 000, 000, FDD}, {42, 3400 * MHz, 3600 * MHz, 3400 * MHz, 3600 * MHz, TDD},
{81, 860000, 915000, 000, 000, FDD}, {43, 3600 * MHz, 3800 * MHz, 3600 * MHz, 3800 * MHz, TDD},
{82, 832000, 862000, 000, 000, FDD}, {44, 703 * MHz, 803 * MHz, 703 * MHz, 803 * MHz, TDD},
{83, 703000, 748000, 000, 000, FDD},
{84, 1920000, 1980000, 000, 000, FDD},
{86, 1710000, 1785000, 000, 000, FDD}
}; };
PHY_VARS_NR_UE *init_nr_ue_vars(NR_DL_FRAME_PARMS *frame_parms, PHY_VARS_NR_UE *init_nr_ue_vars(NR_DL_FRAME_PARMS *frame_parms,
...@@ -332,13 +329,11 @@ void init_UE(int nb_inst) { ...@@ -332,13 +329,11 @@ void init_UE(int nb_inst) {
* \returns a pointer to an int. The storage is not on the heap and must not be freed. * \returns a pointer to an int. The storage is not on the heap and must not be freed.
*/ */
static void *UE_thread_synch(void *arg) { static void *UE_thread_synch(void *arg) {
static int __thread UE_thread_synch_retval; static int __thread UE_thread_synch_retval;
int i, hw_slot_offset; int i, hw_slot_offset;
PHY_VARS_NR_UE *UE = (PHY_VARS_NR_UE *) arg; PHY_VARS_NR_UE *UE = (PHY_VARS_NR_UE *) arg;
int current_band = 0; int current_band = 0;
int current_offset = 0; int current_offset = 0;
lte_frame_type_t current_type;
sync_mode_t sync_mode = pbch; sync_mode_t sync_mode = pbch;
int CC_id = UE->CC_id; int CC_id = UE->CC_id;
int freq_offset=0; int freq_offset=0;
...@@ -356,28 +351,22 @@ static void *UE_thread_synch(void *arg) { ...@@ -356,28 +351,22 @@ static void *UE_thread_synch(void *arg) {
if (UE->UE_scan == 0) { if (UE->UE_scan == 0) {
int ind; int ind;
int64_t dl_freq_khz = downlink_frequency[0][0]/1000;
for ( ind=0; for ( ind=0;
ind < sizeof(eutra_bands) / sizeof(eutra_bands[0]); ind < sizeof(eutra_bands) / sizeof(eutra_bands[0]);
ind++) { ind++) {
current_band = eutra_bands[ind].band; current_band = eutra_bands[ind].band;
current_type = eutra_bands[ind].frame_type;
LOG_D(PHY, "Scanning band %d, dl_min %"PRIu32", ul_min %"PRIu32"\n", current_band, eutra_bands[ind].dl_min,eutra_bands[ind].ul_min); LOG_D(PHY, "Scanning band %d, dl_min %"PRIu32", ul_min %"PRIu32"\n", current_band, eutra_bands[ind].dl_min,eutra_bands[ind].ul_min);
if ( eutra_bands[ind].dl_min <= dl_freq_khz && eutra_bands[ind].dl_max >= dl_freq_khz ) { if ( eutra_bands[ind].dl_min <= downlink_frequency[0][0] && eutra_bands[ind].dl_max >= downlink_frequency[0][0] ) {
for (i=0; i<4; i++) for (i=0; i<4; i++)
uplink_frequency_offset[CC_id][i] = (eutra_bands[ind].ul_min - eutra_bands[ind].dl_min)*1000; uplink_frequency_offset[CC_id][i] = eutra_bands[ind].ul_min - eutra_bands[ind].dl_min;
break; break;
} }
} }
AssertFatal( ind < sizeof(eutra_bands) / sizeof(eutra_bands[0]), "Can't find EUTRA band for frequency"); AssertFatal( ind < sizeof(eutra_bands) / sizeof(eutra_bands[0]), "Can't find EUTRA band for frequency");
UE->frame_parms.eutra_band = current_band;
UE->frame_parms.frame_type = current_type;
LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %"PRIu32", UL %"PRIu32" (oai_exit %d, rx_num_channels %d)\n", LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %"PRIu32", UL %"PRIu32" (oai_exit %d, rx_num_channels %d)\n",
downlink_frequency[0][0], downlink_frequency[0][0]+uplink_frequency_offset[0][0], downlink_frequency[0][0], downlink_frequency[0][0]+uplink_frequency_offset[0][0],
oai_exit, openair0_cfg[0].rx_num_channels); oai_exit, openair0_cfg[0].rx_num_channels);
......
...@@ -661,7 +661,7 @@ void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) { ...@@ -661,7 +661,7 @@ void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
config[CC_id]->rf_config.dl_carrier_bandwidth.value = 106; config[CC_id]->rf_config.dl_carrier_bandwidth.value = 106;
config[CC_id]->rf_config.ul_carrier_bandwidth.value = 106; config[CC_id]->rf_config.ul_carrier_bandwidth.value = 106;
config[CC_id]->sch_config.physical_cell_id.value = 0; config[CC_id]->sch_config.physical_cell_id.value = 0;
frame_parms[CC_id]->eutra_band = 78;
frame_parms[CC_id]->frame_type = FDD; frame_parms[CC_id]->frame_type = FDD;
frame_parms[CC_id]->tdd_config = 3; frame_parms[CC_id]->tdd_config = 3;
//frame_parms[CC_id]->tdd_config_S = 0; //frame_parms[CC_id]->tdd_config_S = 0;
......
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