Commit a1896982 authored by Guy De Souza's avatar Guy De Souza

nfapi nr extension update

parent d7ab43ce
......@@ -2157,7 +2157,7 @@ target_link_libraries (nr-softmodem
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY_NR LFDS GTPV1U SECU_CN SECU_OSA
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB}
#RRC_LIB S1AP_LIB S1AP_ENB L2
#NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl)
target_link_libraries (nr-softmodem ${LIBXML2_LIBRARIES})
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -21,18 +21,17 @@
#include "../defs_NR.h"
int phy_init_nr_gNB(nfapi_param_t* nfapi_params)
int phy_init_nr_gNB(nfapi_config_request_t *config)
{
nfapi_params->pnf_phy_rel15.number_of_phys = 1;
nfapi_params->pnf_phy_rel15.phy[0].mu =1;
nfapi_params->subframe_config.duplex_mode.value = 1; //FDD
nfapi_params->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL
nfapi_params->rf_config.dl_channel_bandwidth.value = 106;
nfapi_params->rf_config.ul_channel_bandwidth.value = 106;
nfapi_params->rf_config.tx_antenna_ports.value = 1;
config->subframe_config.numerology_index_mu.value =1;
config->subframe_config.duplex_mode.value = 1; //FDD
config->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL
config->rf_config.dl_channel_bandwidth.value = 106;
config->rf_config.ul_channel_bandwidth.value = 106;
config->rf_config.tx_antenna_ports.value = 1;
nfapi_params->sch_config.physical_cell_id.value = 0;
config->sch_config.physical_cell_id.value = 0;
return 0;
}
......@@ -25,13 +25,13 @@
/// Subcarrier spacings in Hz indexed by numerology index
uint32_t nr_subcarrier_spacing[MAX_NUM_SUBCARRIER_SPACING] = {15e3, 30e3, 60e3, 120e3, 240e3};
int nr_init_frame_parms(nfapi_param_t nfapi_params,
int nr_init_frame_parms(nfapi_config_request_t config,
NR_DL_FRAME_PARMS *frame_parms)
{
int N_RB = nfapi_params.rf_config.dl_channel_bandwidth.value;
int Ncp = nfapi_params.subframe_config.dl_cyclic_prefix_type.value;
int mu = nfapi_params.pnf_phy_rel15.phy[0].mu;
int N_RB = config.rf_config.dl_channel_bandwidth.value;
int Ncp = config.subframe_config.dl_cyclic_prefix_type.value;
int mu = config.subframe_config.numerology_index_mu.value;
#if DISABLE_LOG_X
printf("Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",mu, N_RB, Ncp);
......
......@@ -30,7 +30,7 @@ int nr_generate_pss( int16_t *d_pss,
int16_t amp,
int16_t ssb_first_subcarrier,
uint8_t slot_offset,
nfapi_param_t nfapi_params,
nfapi_config_request_t config,
NR_DL_FRAME_PARMS *frame_parms)
{
int i,n,m,k;
......@@ -39,8 +39,8 @@ int nr_generate_pss( int16_t *d_pss,
int16_t pss_mod[2* NR_PSS_LENGTH];
const int x_initial[7] = {0, 1, 1 , 0, 1, 1, 1};
uint8_t Nid2 = nfapi_params.sch_config.physical_cell_id.value % 3;
uint8_t Nsymb = (nfapi_params.subframe_config.dl_cyclic_prefix_type.value == 0)? 14 : 12;
uint8_t Nid2 = config.sch_config.physical_cell_id.value % 3;
uint8_t Nsymb = (config.subframe_config.dl_cyclic_prefix_type.value == 0)? 14 : 12;
// Binary sequence generation
for (i=0; i < 7; i++)
......@@ -56,14 +56,14 @@ int nr_generate_pss( int16_t *d_pss,
}
// BPSK modulation and resource mapping
a = (nfapi_params.rf_config.tx_antenna_ports.value == 1) ? amp : (amp*ONE_OVER_SQRT2_Q15)>>15;
a = (config.rf_config.tx_antenna_ports.value == 1) ? amp : (amp*ONE_OVER_SQRT2_Q15)>>15;
for (i = 0; i < NR_PSS_LENGTH; i++)
{
pss_mod[2*i] = nr_mod_table[ 2 * (MOD_TABLE_BPSK_OFFSET + d_pss[i]) ];
pss_mod[2*i + 1] = nr_mod_table[ 2 * (MOD_TABLE_BPSK_OFFSET + d_pss[i]) + 1];
}
for (aa = 0; aa < nfapi_params.rf_config.tx_antenna_ports.value; aa++)
for (aa = 0; aa < config.rf_config.tx_antenna_ports.value; aa++)
{
// PSS occupies a predefined position (symbol 0, subcarriers 56-182) within the SSB block starting from
......
......@@ -30,7 +30,7 @@ int nr_generate_sss( int16_t *d_sss,
int16_t amp,
int16_t ssb_first_subcarrier,
uint8_t slot_offset,
nfapi_param_t nfapi_params,
nfapi_config_request_t config,
NR_DL_FRAME_PARMS *frame_parms)
{
int i,m,k;
......@@ -42,10 +42,10 @@ int nr_generate_sss( int16_t *d_sss,
const int x0_initial[7] = { 1, 0, 0, 0, 0, 0, 0 };
const int x1_initial[7] = { 1, 0, 0, 0, 0, 0, 0 };
uint8_t Nsymb = (nfapi_params.subframe_config.dl_cyclic_prefix_type.value == 0)? 14 : 12;
uint8_t Nsymb = (config.subframe_config.dl_cyclic_prefix_type.value == 0)? 14 : 12;
// Binary sequence generation
Nid = nfapi_params.sch_config.physical_cell_id.value;
Nid = config.sch_config.physical_cell_id.value;
Nid2 = Nid % 3;
Nid1 = (Nid - Nid2)/3;
......@@ -69,14 +69,14 @@ int nr_generate_sss( int16_t *d_sss,
}
// BPSK modulation and resource mapping
a = (nfapi_params.rf_config.tx_antenna_ports.value == 1) ? amp : (amp*ONE_OVER_SQRT2_Q15)>>15;
a = (config.rf_config.tx_antenna_ports.value == 1) ? amp : (amp*ONE_OVER_SQRT2_Q15)>>15;
for (i = 0; i < NR_SSS_LENGTH; i++)
{
sss_mod[2*i] = nr_mod_table[ 2 * (MOD_TABLE_BPSK_OFFSET + d_sss[i]) ];
sss_mod[2*i + 1] = nr_mod_table[ 2 * (MOD_TABLE_BPSK_OFFSET + d_sss[i]) + 1];
}
for (aa = 0; aa < nfapi_params.rf_config.tx_antenna_ports.value; aa++)
for (aa = 0; aa < config.rf_config.tx_antenna_ports.value; aa++)
{
// SSS occupies a predefined position (symbol 2, subcarriers 56-182) within the SSB block starting from
......
......@@ -49,7 +49,7 @@ void exit_fun(const char* s)
int main( int argc, char **argv )
{
nfapi_param_t nfapi_params;
nfapi_config_request_t config;
NR_DL_FRAME_PARMS* frame_parms = malloc(sizeof(NR_DL_FRAME_PARMS));
int16_t amp;
//malloc to move
......@@ -59,13 +59,13 @@ int main( int argc, char **argv )
//logInit();
phy_init_nr_gNB(&nfapi_params);
nr_init_frame_parms(nfapi_params, frame_parms);
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, nfapi_params, frame_parms);
nr_generate_sss(d_sss, txdataF, amp, 0, 0, nfapi_params, frame_parms);
//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);
......
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