develop&-nr current as of 22.7.19 & OAI fully ready for testing
This commit is contained in:
+40
-34
@@ -37,32 +37,33 @@
|
||||
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
||||
#include "PHY/NR_REFSIG/nr_refsig.h"
|
||||
#include "SCHED_NR/fapi_nr_l1.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
|
||||
/*
|
||||
extern uint32_t from_nrarfcn(int nr_bandP,uint32_t dl_nrarfcn);
|
||||
extern int32_t get_uldl_offset(int nr_bandP);
|
||||
extern int32_t get_nr_uldl_offset(int nr_bandP);*/
|
||||
extern openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
|
||||
int l1_north_init_gNB() {
|
||||
int i,j;
|
||||
|
||||
int l1_north_init_gNB()
|
||||
{
|
||||
if (RC.nb_nr_L1_inst > 0 && RC.nb_nr_L1_CC != NULL && RC.gNB != NULL) {
|
||||
AssertFatal(RC.nb_nr_L1_inst>0,"nb_nr_L1_inst=%d\n",RC.nb_nr_L1_inst);
|
||||
AssertFatal(RC.nb_nr_L1_CC!=NULL,"nb_nr_L1_CC is null\n");
|
||||
AssertFatal(RC.gNB!=NULL,"RC.gNB is null\n");
|
||||
LOG_I(PHY,"%s() RC.nb_nr_L1_inst:%d\n", __FUNCTION__, RC.nb_nr_L1_inst);
|
||||
|
||||
for (i=0; i<RC.nb_nr_L1_inst; i++) {
|
||||
for (int i=0; i<RC.nb_nr_L1_inst; i++) {
|
||||
AssertFatal(RC.gNB[i]!=NULL,"RC.gNB[%d] is null\n",i);
|
||||
AssertFatal(RC.nb_nr_L1_CC[i]>0,"RC.nb_nr_L1_CC[%d]=%d\n",i,RC.nb_nr_L1_CC[i]);
|
||||
LOG_I(PHY,"%s() RC.nb_nr_L1_CC[%d]:%d\n", __FUNCTION__, i, RC.nb_nr_L1_CC[i]);
|
||||
|
||||
for (j=0; j<RC.nb_nr_L1_CC[i]; j++) {
|
||||
for (int j=0; j<RC.nb_nr_L1_CC[i]; j++) {
|
||||
AssertFatal(RC.gNB[i][j]!=NULL,"RC.gNB[%d][%d] is null\n",i,j);
|
||||
|
||||
if ((RC.gNB[i][j]->if_inst = NR_IF_Module_init(i))<0) return(-1);
|
||||
|
||||
LOG_I(PHY,"%s() RC.gNB[%d][%d] installing callbacks\n", __FUNCTION__, i, j);
|
||||
RC.gNB[i][j]->if_inst->NR_PHY_config_req = nr_phy_config_request;
|
||||
RC.gNB[i][j]->if_inst->NR_PHY_config_req = nr_phy_config_request;
|
||||
RC.gNB[i][j]->if_inst->NR_Schedule_response = nr_schedule_response;
|
||||
}
|
||||
}
|
||||
@@ -356,41 +357,46 @@ void install_schedule_handlers(IF_Module_t *if_inst)
|
||||
/// 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,uint64_t position_in_burst) {
|
||||
|
||||
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||
nfapi_nr_config_request_t *gNB_config = &gNB->gNB_config;
|
||||
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;
|
||||
nfapi_nr_config_request_t *gNB_config = &gNB->gNB_config;
|
||||
//overwrite for new NR parameters
|
||||
gNB_config->nfapi_config.rf_bands.rf_band[0] = 78;
|
||||
gNB_config->nfapi_config.nrarfcn.value = 620000;
|
||||
gNB_config->subframe_config.numerology_index_mu.value = mu;
|
||||
gNB_config->subframe_config.duplex_mode.value = TDD;
|
||||
gNB_config->rf_config.dl_carrier_bandwidth.value = N_RB_DL;
|
||||
gNB_config->rf_config.ul_carrier_bandwidth.value = N_RB_UL;
|
||||
gNB_config->sch_config.half_frame_index.value = 0;
|
||||
gNB_config->sch_config.ssb_subcarrier_offset.value = 0;
|
||||
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.physical_cell_id.value=Nid_cell;
|
||||
gNB_config->sch_config.ssb_scg_position_in_burst.value=position_in_burst;
|
||||
gNB_config->nfapi_config.rf_bands.rf_band[0] = 78;
|
||||
gNB_config->nfapi_config.nrarfcn.value = 620000;
|
||||
gNB_config->subframe_config.numerology_index_mu.value = mu;
|
||||
gNB_config->subframe_config.duplex_mode.value = TDD;
|
||||
gNB_config->rf_config.dl_carrier_bandwidth.value = N_RB_DL;
|
||||
gNB_config->rf_config.ul_carrier_bandwidth.value = N_RB_UL;
|
||||
gNB_config->sch_config.half_frame_index.value = 0;
|
||||
gNB_config->sch_config.ssb_subcarrier_offset.value = 0;
|
||||
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.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->mac_enabled = 1;
|
||||
gNB->mac_enabled = 1;
|
||||
fp->dl_CarrierFreq = 3500000000;//from_nrarfcn(gNB_config->nfapi_config.rf_bands.rf_band[0],gNB_config->nfapi_config.nrarfcn.value);
|
||||
fp->ul_CarrierFreq = 3500000000;//fp->dl_CarrierFreq - (get_uldl_offset(gNB_config->nfapi_config.rf_bands.rf_band[0])*100000);
|
||||
fp->threequarter_fs = 0;
|
||||
fp->threequarter_fs= 0;
|
||||
nr_init_frame_parms(gNB_config, fp);
|
||||
gNB->configured = 1;
|
||||
gNB->configured = 1;
|
||||
LOG_I(PHY,"gNB configured\n");
|
||||
|
||||
}
|
||||
|
||||
|
||||
void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
|
||||
uint8_t Mod_id = phy_config->Mod_id;
|
||||
int CC_id = phy_config->CC_id;
|
||||
NR_DL_FRAME_PARMS *fp = &RC.gNB[Mod_id][CC_id]->frame_parms;
|
||||
nfapi_nr_config_request_t *gNB_config = &RC.gNB[Mod_id][CC_id]->gNB_config;
|
||||
void nr_phy_config_request(NR_PHY_Config_t *phy_config)
|
||||
{
|
||||
uint8_t Mod_id = phy_config->Mod_id;
|
||||
int CC_id = phy_config->CC_id;
|
||||
NR_DL_FRAME_PARMS *fp = &RC.gNB[Mod_id][CC_id]->frame_parms;
|
||||
nfapi_nr_config_request_t *gNB_config = &RC.gNB[Mod_id][CC_id]->gNB_config;
|
||||
gNB_config->nfapi_config.rf_bands.rf_band[0] = phy_config->cfg->nfapi_config.rf_bands.rf_band[0]; //22
|
||||
gNB_config->nfapi_config.nrarfcn.value = phy_config->cfg->nfapi_config.nrarfcn.value; //6600
|
||||
gNB_config->subframe_config.numerology_index_mu.value = phy_config->cfg->subframe_config.numerology_index_mu.value;//1
|
||||
@@ -401,7 +407,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
|
||||
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.ssb_scg_position_in_burst.value= phy_config->cfg->sch_config.ssb_scg_position_in_burst.value;
|
||||
gNB_config->sch_config.ssb_periodicity.value = phy_config->cfg->sch_config.ssb_periodicity.value;
|
||||
gNB_config->sch_config.ssb_periodicity.value = phy_config->cfg->sch_config.ssb_periodicity.value;
|
||||
|
||||
if (phy_config->cfg->subframe_config.duplex_mode.value == 0) {
|
||||
gNB_config->subframe_config.duplex_mode.value = TDD;
|
||||
@@ -411,7 +417,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
|
||||
|
||||
RC.gNB[Mod_id][CC_id]->mac_enabled = 1;
|
||||
fp->dl_CarrierFreq = from_nrarfcn(gNB_config->nfapi_config.rf_bands.rf_band[0],gNB_config->nfapi_config.nrarfcn.value);
|
||||
fp->ul_CarrierFreq = fp->dl_CarrierFreq - (get_uldl_offset(gNB_config->nfapi_config.rf_bands.rf_band[0])*100000);
|
||||
fp->ul_CarrierFreq = fp->dl_CarrierFreq - (get_nr_uldl_offset(gNB_config->nfapi_config.rf_bands.rf_band[0])*100000);
|
||||
fp->threequarter_fs = openair0_cfg[0].threequarter_fs;
|
||||
LOG_I(PHY,"Configuring MIB for instance %d, CCid %d : (band %d,N_RB_DL %d, N_RB_UL %d, Nid_cell %d,DL freq %u)\n",
|
||||
Mod_id,
|
||||
|
||||
@@ -293,6 +293,8 @@ typedef struct RU_proc_t_s {
|
||||
pthread_cond_t cond_eNBs;
|
||||
/// condition variable for gNB signal
|
||||
pthread_cond_t cond_gNBs;
|
||||
/// condition variable for ru_thread
|
||||
pthread_cond_t cond_ru_thread;
|
||||
/// mutex for RU FH
|
||||
pthread_mutex_t mutex_FH;
|
||||
pthread_mutex_t mutex_FH1;
|
||||
@@ -419,6 +421,8 @@ typedef struct RU_t_s{
|
||||
int north_out_cnt;
|
||||
/// flag to indicate the RU is a slave to another source
|
||||
int is_slave;
|
||||
/// flag to indicate if the RU has to perform OTA sync
|
||||
int ota_sync_enable;
|
||||
/// flag to indicate that the RU should generate the DMRS sequence in slot 2 (subframe 1) for OTA synchronization and calibration
|
||||
int generate_dmrs_sync;
|
||||
/// flag to indicate if the RU has a control channel
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
@param *phy_vars_rn pointer to RN variables
|
||||
*/
|
||||
void phy_procedures_UE_lte(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode,relaying_type_t r_type);
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
/*! \brief Top-level entry routine for relay node procedures actinf as UE. This proc will make us of the existing UE procs.
|
||||
@param last_slot Index of last slot (0-19)
|
||||
@param next_slot Index of next_slot (0-19)
|
||||
|
||||
@@ -81,9 +81,8 @@ int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
uint32_t from_nrarfcn(int nr_bandP, uint32_t dl_earfcn) {
|
||||
return (0);
|
||||
}
|
||||
//uint32_t from_nrarfcn(int nr_bandP, uint32_t dl_earfcn) { return (0); }
|
||||
|
||||
int32_t get_uldl_offset(int eutra_bandP) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0
|
||||
|
||||
int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) {return(0);}
|
||||
|
||||
uint32_t from_nrarfcn(int nr_bandP,uint32_t dl_nrarfcn) {return(0);}
|
||||
//uint32_t from_nrarfcn(int nr_bandP,uint32_t dl_nrarfcn) {return(0);}
|
||||
int32_t get_uldl_offset(int nr_bandP) {return(0);}
|
||||
|
||||
NR_IF_Module_t *NR_IF_Module_init(int Mod_id){return(NULL);}
|
||||
|
||||
@@ -60,14 +60,10 @@ double cpuf;
|
||||
int nfapi_mode=0;
|
||||
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return(0);}
|
||||
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); }
|
||||
|
||||
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); }
|
||||
|
||||
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); }
|
||||
|
||||
int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) {return(0);}
|
||||
|
||||
uint32_t from_nrarfcn(int nr_bandP,uint32_t dl_nrarfcn) {return(0);}
|
||||
//uint32_t from_nrarfcn(int nr_bandP,uint32_t dl_nrarfcn) {return(0);}
|
||||
int32_t get_uldl_offset(int nr_bandP) {return(0);}
|
||||
|
||||
NR_IF_Module_t *NR_IF_Module_init(int Mod_id){return(NULL);}
|
||||
|
||||
@@ -69,7 +69,7 @@ int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return (0); }
|
||||
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return (0); }
|
||||
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return (0); }
|
||||
int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) { return (0); }
|
||||
uint32_t from_nrarfcn(int nr_bandP, uint32_t dl_earfcn) { return (0); }
|
||||
//uint32_t from_nrarfcn(int nr_bandP, uint32_t dl_earfcn) { return (0); }
|
||||
int32_t get_uldl_offset(int eutra_bandP) { return (0); }
|
||||
NR_IF_Module_t * NR_IF_Module_init(int Mod_id) { return (NULL); }
|
||||
|
||||
|
||||
@@ -73,36 +73,16 @@ double cpuf;
|
||||
|
||||
// dummy functions
|
||||
int nfapi_mode = 0;
|
||||
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) {
|
||||
return (0);
|
||||
}
|
||||
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
uint32_t from_nrarfcn(int nr_bandP, uint32_t dl_earfcn) {
|
||||
return (0);
|
||||
}
|
||||
int32_t get_uldl_offset(int eutra_bandP) {
|
||||
return (0);
|
||||
}
|
||||
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return (0); }
|
||||
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return (0); }
|
||||
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return (0); }
|
||||
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return (0); }
|
||||
int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) { return (0); }
|
||||
//uint32_t from_nrarfcn(int nr_bandP, uint32_t dl_earfcn) { return (0); }
|
||||
int32_t get_uldl_offset(int eutra_bandP) { return (0); }
|
||||
|
||||
NR_IF_Module_t *
|
||||
NR_IF_Module_init(int Mod_id) {
|
||||
return (NULL);
|
||||
}
|
||||
NR_IF_Module_init(int Mod_id) { return (NULL); }
|
||||
|
||||
void exit_function(const char *file, const char *function, const int line, const char *s) {
|
||||
const char *msg = s == NULL ? "no comment" : s;
|
||||
@@ -477,17 +457,17 @@ int main(int argc, char **argv) {
|
||||
rel15_ul->ulsch_pdu_rel15.n_layers = precod_nbr_layers;
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
fapi_nr_ul_config_request_t ul_config;
|
||||
/*fapi_nr_ul_config_request_t ul_config;
|
||||
//fapi_nr_tx_request_t tx_request;
|
||||
|
||||
/*nr_scheduled_response_t scheduled_response;
|
||||
nr_scheduled_response_t scheduled_response;
|
||||
scheduled_response.module_id = 0;
|
||||
scheduled_response.CC_id = 0;
|
||||
scheduled_response.frame = frame;
|
||||
scheduled_response.slot = slot;
|
||||
scheduled_response.dl_config = NULL;
|
||||
scheduled_response.ul_config = &ul_config;
|
||||
scheduled_response.dl_config = NULL;*/
|
||||
scheduled_response.dl_config = NULL;
|
||||
|
||||
|
||||
ul_config.sfn_slot = slot;
|
||||
@@ -501,7 +481,7 @@ int main(int argc, char **argv) {
|
||||
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.mcs = Imcs;
|
||||
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.ndi = 0;
|
||||
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.rv = 0;
|
||||
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.n_layers = precod_nbr_layers;
|
||||
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.n_layers = precod_nbr_layers;*/
|
||||
//there are plenty of other parameters that we don't seem to be using for now. e.g.
|
||||
//ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.absolute_delta_PUSCH = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user