Commit 4aba771c authored by Guy De Souza's avatar Guy De Souza

CP length/ warnings fix

parent 64db7233
......@@ -372,9 +372,11 @@ 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_init_frame_parms(nfapi_config_request_t* config,
NR_DL_FRAME_PARMS *frame_parms);
int nr_init_frame_parms(nfapi_config_request_t* config, 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);
void nr_phy_config_request(PHY_VARS_gNB *gNB);
void phy_free_nr_gNB(PHY_VARS_gNB *gNB);
/** @} */
#endif
......
......@@ -339,7 +339,8 @@ void nr_phy_config_request(PHY_VARS_gNB *gNB)
//overwrite for new NR parameters
gNB_config->subframe_config.numerology_index_mu.value = 1;
gNB_config->subframe_config.duplex_mode.value = 1;//FDD
gNB_config->subframe_config.duplex_mode.value = FDD;
gNB_config->rf_config.tx_antenna_ports.value = 1;
gNB_config->rf_config.dl_channel_bandwidth.value = 106;
gNB_config->rf_config.ul_channel_bandwidth.value = 106;
gNB_config->sch_config.half_frame_index = 0;
......
......@@ -40,7 +40,7 @@ int nr_init_frame_parms(nfapi_config_request_t* config,
LOG_I(PHY,"Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",mu, N_RB, Ncp);
#endif
if (Ncp == 1) //EXTENDED, to be modified after lte defs are properly linked
if (Ncp == EXTENDED)
AssertFatal(mu == NR_MU_2,"Invalid cyclic prefix %d for numerology index %d\n", Ncp, mu);
switch(mu) {
......@@ -63,11 +63,18 @@ int nr_init_frame_parms(nfapi_config_request_t* config,
case 65:
case 106: //40 MHz
if (frame_parms->threequarter_fs) {
frame_parms->ofdm_symbol_size = 1536;
frame_parms->first_carrier_offset = 900; //1536 - 636
frame_parms->nb_prefix_samples0 = 132;
frame_parms->nb_prefix_samples = 108;
}
else {
frame_parms->ofdm_symbol_size = 2048;
//frame_parms->samples_per_tti = 30720;
frame_parms->first_carrier_offset = 1412; //2048 - 636
frame_parms->nb_prefix_samples0 = 160;
frame_parms->nb_prefix_samples0 = 176;
frame_parms->nb_prefix_samples = 144;
}
break;
case 133:
......@@ -77,16 +84,14 @@ int nr_init_frame_parms(nfapi_config_request_t* config,
case 217: //80 MHz
if (frame_parms->threequarter_fs) {
frame_parms->ofdm_symbol_size = 3072;
//frame_parms->samples_per_tti = 46080;
frame_parms->first_carrier_offset = 1770; //3072 - 1302
frame_parms->nb_prefix_samples0 = 240;
frame_parms->nb_prefix_samples0 = 264;
frame_parms->nb_prefix_samples = 216;
}
else {
frame_parms->ofdm_symbol_size = 4096;
//frame_parms->samples_per_tti = 61440;
frame_parms->first_carrier_offset = 2794; //4096 - 1302
frame_parms->nb_prefix_samples0 = 320;
frame_parms->nb_prefix_samples0 = 352;
frame_parms->nb_prefix_samples = 288;
}
break;
......@@ -134,7 +139,7 @@ int nr_init_frame_parms(nfapi_config_request_t* config,
AssertFatal(1==0,"Invalid numerology index %d", mu);
}
frame_parms->symbols_per_slot = ((Ncp == 0)? 14 : 12); // to redefine for different slot formats
frame_parms->symbols_per_slot = ((Ncp == NORMAL)? 14 : 12); // to redefine for different slot formats
frame_parms->samples_per_subframe_wCP = frame_parms->ofdm_symbol_size * frame_parms->symbols_per_slot * frame_parms->slots_per_subframe;
frame_parms->samples_per_frame_wCP = 10 * frame_parms->samples_per_subframe_wCP;
frame_parms->samples_per_subframe = frame_parms->samples_per_subframe_wCP + (frame_parms->nb_prefix_samples0 * frame_parms->slots_per_subframe) +
......
......@@ -163,14 +163,15 @@ void phy_procedures_UE_S_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abst
*/
void phy_procedures_UE_S_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag, relaying_type_t r_type);
/*! \brief Scheduling for eNB TX procedures in normal subframes.
@param phy_vars_eNB Pointer to eNB variables on which to act
/*! \brief Scheduling for eNB/gNB TX procedures in normal subframes.
@param phy_vars_eNB/phy_vars_gNB Pointer to eNB/gNB variables on which to act
@param abstraction_flag Indicator of PHY abstraction
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
@param phy_vars_rn pointer to the RN variables
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying -- LTE only
@param phy_vars_rn pointer to the RN variables --LTE only
@param do_meas Do inline timing measurement
*/
void phy_procedures_eNB_TX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn,int do_meas);
void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, gNB_rxtx_proc_t *proc, int do_meas);
/*! \brief Scheduling for eNB RX UE-specific procedures in normal subframes.
@param phy_vars_eNB Pointer to eNB variables on which to act
......
......@@ -573,7 +573,8 @@ void init_gNB_proc(int inst) {
PHY_VARS_gNB *gNB;
gNB_proc_t *proc;
gNB_rxtx_proc_t *proc_rxtx;
pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_prach=NULL;
pthread_attr_t *attr0=NULL,*attr1=NULL;
//*attr_prach=NULL;
LOG_I(PHY,"%s(inst:%d) RC.nb_CC[inst]:%d \n",__FUNCTION__,inst,RC.nb_CC[inst]);
......
......@@ -496,7 +496,7 @@ void fh_if4p5_south_asynch_in(RU_t *ru,int *frame,int *subframe) {
uint16_t packet_type;
uint32_t symbol_number,symbol_mask,prach_rx;
uint32_t got_prach_info=0;
// uint32_t got_prach_info=0;
symbol_number = 0;
symbol_mask = (1<<(fp->symbols_per_slot * fp->slots_per_subframe))-1;
......@@ -505,10 +505,10 @@ void fh_if4p5_south_asynch_in(RU_t *ru,int *frame,int *subframe) {
do { // Blocking, we need a timeout on this !!!!!!!!!!!!!!!!!!!!!!!
recv_IF4p5(ru, &proc->frame_rx, &proc->subframe_rx, &packet_type, &symbol_number);
// grab first prach information for this new subframe
if (got_prach_info==0) {
/*if (got_prach_info==0) {
prach_rx = is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx);
got_prach_info = 1;
}
}*/
if (proc->first_rx != 0) {
*frame = proc->frame_rx;
*subframe = proc->subframe_rx;
......@@ -781,9 +781,9 @@ void tx_rf(RU_t *ru) {
T(T_ENB_PHY_OUTPUT_SIGNAL, T_INT(0), T_INT(0), T_INT(proc->frame_tx), T_INT(proc->subframe_tx),
T_INT(0), T_BUFFER(&ru->common.txdata[0][proc->subframe_tx * fp->samples_per_subframe], fp->samples_per_subframe * 4));
lte_subframe_t SF_type = nr_subframe_select(cfg,proc->subframe_tx%10);
lte_subframe_t prevSF_type = nr_subframe_select(cfg,(proc->subframe_tx+9)%10);
lte_subframe_t nextSF_type = nr_subframe_select(cfg,(proc->subframe_tx+1)%10);
nr_subframe_t SF_type = nr_subframe_select(cfg,proc->subframe_tx%10);
/*nr_subframe_t prevSF_type = nr_subframe_select(cfg,(proc->subframe_tx+9)%10);
nr_subframe_t nextSF_type = nr_subframe_select(cfg,(proc->subframe_tx+1)%10);*/
int sf_extension = 0;
if ((SF_type == SF_DL) ||
......@@ -966,7 +966,7 @@ static void* ru_thread_prach( void* param ) {
if (oai_exit) break;
if (wait_on_condition(&proc->mutex_prach,&proc->cond_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 1 );
if (ru->gNB_list[0]){
/*if (ru->gNB_list[0]){
prach_procedures(
ru->gNB_list[0]
#ifdef Rel14
......@@ -987,7 +987,7 @@ static void* ru_thread_prach( void* param ) {
#endif
);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 0 );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 0 ); */
if (release_thread(&proc->mutex_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break;
}
......@@ -1441,7 +1441,7 @@ static void* ru_thread( void* param ) {
proc->frame_tx,proc->subframe_tx,
RC.gNB[0][0]->proc.frame_rx,RC.gNB[0][0]->proc.subframe_rx,
RC.gNB[0][0]->proc.frame_tx);
/*
LOG_D(PHY,"RU thread (do_prach %d, is_prach_subframe %d), received frame %d, subframe %d\n",
ru->do_prach,
is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx),
......@@ -1449,7 +1449,7 @@ static void* ru_thread( void* param ) {
if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)==1)) {
wakeup_prach_ru(ru);
}
}*/
// adjust for timing offset between RU
if (ru->idx!=0) proc->frame_tx = (proc->frame_tx+proc->frame_offset)&1023;
......@@ -1597,10 +1597,10 @@ void init_RU_proc(RU_t *ru) {
int i=0;
RU_proc_t *proc;
pthread_attr_t *attr_FH=NULL,*attr_prach=NULL,*attr_asynch=NULL,*attr_synch=NULL;
pthread_attr_t *attr_FH=NULL,*attr_prach=NULL,*attr_asynch=NULL;// *attr_synch=NULL;
//pthread_attr_t *attr_fep=NULL;
#ifdef Rel14
pthread_attr_t *attr_prach_br=NULL;
//pthread_attr_t *attr_prach_br=NULL;
#endif
char name[100];
......@@ -1645,7 +1645,7 @@ void init_RU_proc(RU_t *ru) {
#ifndef DEADLINE_SCHEDULER
attr_FH = &proc->attr_FH;
attr_prach = &proc->attr_prach;
attr_synch = &proc->attr_synch;
//attr_synch = &proc->attr_synch;
attr_asynch = &proc->attr_asynch_rxtx;
#endif
......
......@@ -19,36 +19,6 @@
* contact@openairinterface.org
*/
#if 0
//Temporary main function
int main( int argc, char **argv )
{
nfapi_config_request_t config;
NR_DL_FRAME_PARMS* frame_parms = malloc(sizeof(NR_DL_FRAME_PARMS));
int16_t amp;
int16_t** txdataF = (int16_t **)malloc(2048*2*14*2*2* sizeof(int16_t));
int16_t* d_pss = malloc(NR_PSS_LENGTH * sizeof(int16_t));
int16_t *d_sss = malloc(NR_SSS_LENGTH * sizeof(int16_t));
//logInit();
phy_init_nr_gNB(&config);
nr_init_frame_parms(config, frame_parms);
nr_dump_frame_parms(frame_parms);
amp = 32767; //1_Q_15
nr_generate_pss(d_pss, txdataF, amp, 0, 0, config, frame_parms);
nr_generate_sss(d_sss, txdataF, amp, 0, 0, config, frame_parms);
free(txdataF);
free(d_pss);
free(d_sss);
return 0;
}
#endif
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <sched.h>
......@@ -215,7 +185,7 @@ int otg_enabled;
//int number_of_cards = 1;
static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
//static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
static nfapi_config_request_t *config[MAX_NUM_CCs];
uint32_t target_dl_mcs = 28; //maximum allowed mcs
uint32_t target_ul_mcs = 20;
......@@ -910,7 +880,7 @@ int main( int argc, char **argv )
{
int i;
#if defined (XFORMS)
void *status;
//void *status;
#endif
int CC_id;
......
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