Commit 688830e8 authored by Francesco Mani's avatar Francesco Mani

SSB pattern now hardcoded in rrc, to be taken from config file in the next commit

parent 5c2f5736
...@@ -28,12 +28,12 @@ typedef struct { ...@@ -28,12 +28,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 {
...@@ -175,8 +175,8 @@ typedef struct { ...@@ -175,8 +175,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; nfapi_uint16_tlv_t ssb_sib1_position_in_burst; // in sib1
nfapi_uint16_tlv_t ssb_scg_position_in_burst; nfapi_uint64_tlv_t ssb_scg_position_in_burst; // in servingcellconfigcommon
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;
......
...@@ -438,6 +438,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) ...@@ -438,6 +438,7 @@ 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;
......
...@@ -46,7 +46,6 @@ int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp, ...@@ -46,7 +46,6 @@ int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp,
fp->numerology_index = mu; fp->numerology_index = mu;
fp->Ncp = Ncp; fp->Ncp = Ncp;
fp->N_RB_DL = N_RB_DL; fp->N_RB_DL = N_RB_DL;
fp->L_ssb = 255; // TODO get the number of SSB value from higher layers (and config file finally)
switch(mu) { switch(mu) {
...@@ -197,6 +196,7 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config, ...@@ -197,6 +196,7 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config,
fp->eutra_band = config->nfapi_config.rf_bands.rf_band[0]; fp->eutra_band = config->nfapi_config.rf_bands.rf_band[0];
fp->frame_type = !(config->subframe_config.duplex_mode.value); 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,
......
...@@ -308,7 +308,7 @@ typedef struct NR_DL_FRAME_PARMS { ...@@ -308,7 +308,7 @@ 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;
/// Number of SSB /// SS block pattern (max 64 ssb, each bit is on/off ssb)
uint64_t L_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;
......
...@@ -101,7 +101,9 @@ int rrc_init_nr_global_param(void){return(0);} ...@@ -101,7 +101,9 @@ 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
); );
...@@ -151,6 +153,8 @@ int main(int argc, char **argv) ...@@ -151,6 +153,8 @@ 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;
...@@ -496,7 +500,7 @@ int main(int argc, char **argv) ...@@ -496,7 +500,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,78,(uint64_t)3640000000L,N_RB_DL); config_common(0,0,Nid_cell,78,ssb_pattern,(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();
......
...@@ -186,7 +186,8 @@ void config_common(int Mod_idP, ...@@ -186,7 +186,8 @@ void config_common(int Mod_idP,
int CC_idP, int CC_idP,
int cellid, int cellid,
int nr_bandP, int nr_bandP,
uint64_t dl_CarrierFreqP, uint64_t ssb_pattern,
uint64_t dl_CarrierFreqP,
uint32_t dl_BandwidthP uint32_t dl_BandwidthP
){ ){
...@@ -195,6 +196,7 @@ void config_common(int Mod_idP, ...@@ -195,6 +196,7 @@ void config_common(int Mod_idP,
int mu = 1; int mu = 1;
cfg->sch_config.physical_cell_id.value = cellid; 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;
...@@ -238,6 +240,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ...@@ -238,6 +240,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
int cellid, 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,
...@@ -262,11 +265,15 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ...@@ -262,11 +265,15 @@ 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, cellid,
nr_bandP, nr_bandP,
ssb_pattern,
dl_CarrierFreqP, dl_CarrierFreqP,
dl_BandwidthP dl_BandwidthP
); );
......
...@@ -38,9 +38,10 @@ void mac_top_init_gNB(void); ...@@ -38,9 +38,10 @@ 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 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,
......
...@@ -261,12 +261,13 @@ static void init_NR_SI(const protocol_ctxt_t* const ctxt_pP, ...@@ -261,12 +261,13 @@ static void init_NR_SI(const protocol_ctxt_t* const ctxt_pP,
LOG_I(NR_RRC,"Done init_NR_SI\n"); LOG_I(NR_RRC,"Done init_NR_SI\n");
uint64_t ssb_pattern = 255;
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].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],
ssb_pattern,
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,
......
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