Commit bacab651 authored by Raymond Knopp's avatar Raymond Knopp

NR band information

BWP information in NFAPI gNB/UE
dci encoding / decoding integrated
DCI decoding still fails
parent 6868e745
...@@ -72,7 +72,7 @@ typedef struct ...@@ -72,7 +72,7 @@ typedef struct
// These TLVs are used by the VNF to configure the RF in the PNF // These TLVs are used by the VNF to configure the RF in the PNF
// nfapi_uint16_tlv_t max_transmit_power; // nfapi_uint16_tlv_t max_transmit_power;
nfapi_uint16_tlv_t earfcn; nfapi_uint16_tlv_t nrarfcn;
// nfapi_nmm_frequency_bands_t nmm_gsm_frequency_bands; // nfapi_nmm_frequency_bands_t nmm_gsm_frequency_bands;
// nfapi_nmm_frequency_bands_t nmm_umts_frequency_bands; // nfapi_nmm_frequency_bands_t nmm_umts_frequency_bands;
...@@ -95,7 +95,7 @@ typedef struct ...@@ -95,7 +95,7 @@ typedef struct
#define NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG 0x511F #define NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG 0x511F
#define NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG 0x5120 #define NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG 0x5120
#define NFAPI_NR_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG 0x5128 #define NFAPI_NR_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG 0x5128
#define NFAPI_NR_NFAPI_EARFCN_TAG 0x5129 #define NFAPI_NR_NFAPI_NRARFCN_TAG 0x5129
#define NFAPI_NR_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG 0x5130 #define NFAPI_NR_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG 0x5130
#define NFAPI_NR_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG 0x5131 #define NFAPI_NR_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG 0x5131
#define NFAPI_NR_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG 0x5132 #define NFAPI_NR_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG 0x5132
......
...@@ -51,10 +51,12 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams, ...@@ -51,10 +51,12 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams,
//Parse the list. If the node is already created, return without initialization. //Parse the list. If the node is already created, return without initialization.
while (currentPtr != NULL) { while (currentPtr != NULL) {
printf("currentPtr->idx %d, (%d,%d,%d)\n",currentPtr->idx,messageType,messageLength,aggregation_prime);
if (currentPtr->idx == (messageType * messageLength * aggregation_prime)) return; if (currentPtr->idx == (messageType * messageLength * aggregation_prime)) return;
else currentPtr = currentPtr->nextPtr; else currentPtr = currentPtr->nextPtr;
} }
printf("currentPtr %p (polarParams %p)\n",currentPtr,polarParams);
//Else, initialize and add node to the end of the linked list. //Else, initialize and add node to the end of the linked list.
t_nrPolar_paramsPtr newPolarInitNode = malloc(sizeof(t_nrPolar_params)); t_nrPolar_paramsPtr newPolarInitNode = malloc(sizeof(t_nrPolar_params));
...@@ -175,6 +177,7 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams, ...@@ -175,6 +177,7 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams,
if (currentPtr == NULL) if (currentPtr == NULL)
{ {
*polarParams = newPolarInitNode; *polarParams = newPolarInitNode;
printf("Creating first polarParams entry index %d, %p\n",newPolarInitNode->idx,*polarParams);
return; return;
} }
//Else, add node to the end of the linked list. //Else, add node to the end of the linked list.
...@@ -182,6 +185,10 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams, ...@@ -182,6 +185,10 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams,
currentPtr = currentPtr->nextPtr; currentPtr = currentPtr->nextPtr;
} }
currentPtr->nextPtr= newPolarInitNode; currentPtr->nextPtr= newPolarInitNode;
printf("Adding new polarParams entry to list index %d,%p\n",
newPolarInitNode->idx,
currentPtr->nextPtr);
return; return;
} }
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
#include "PHY/LTE_REFSIG/lte_refsig.h" #include "PHY/LTE_REFSIG/lte_refsig.h"
#include "SCHED_NR/fapi_nr_l1.h" #include "SCHED_NR/fapi_nr_l1.h"
extern uint32_t from_earfcn(int eutra_bandP,uint32_t dl_earfcn); extern uint32_t from_nrarfcn(int nr_bandP,uint32_t dl_nrarfcn);
extern int32_t get_uldl_offset(int eutra_bandP); extern int32_t get_uldl_offset(int nr_bandP);
int l1_north_init_gNB() { int l1_north_init_gNB() {
...@@ -376,8 +376,8 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu) ...@@ -376,8 +376,8 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu)
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] = 22; gNB_config->nfapi_config.rf_bands.rf_band[0] = 78;
gNB_config->nfapi_config.earfcn.value = 6600; 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;
gNB_config->rf_config.tx_antenna_ports.value = 1; gNB_config->rf_config.tx_antenna_ports.value = 1;
...@@ -391,7 +391,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu) ...@@ -391,7 +391,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu)
gNB->mac_enabled = 1; gNB->mac_enabled = 1;
fp->dl_CarrierFreq = from_earfcn(gNB_config->nfapi_config.rf_bands.rf_band[0],gNB_config->nfapi_config.earfcn.value); 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_uldl_offset(gNB_config->nfapi_config.rf_bands.rf_band[0])*100000);
fp->threequarter_fs = 0; fp->threequarter_fs = 0;
...@@ -413,7 +413,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) ...@@ -413,7 +413,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_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.rf_bands.rf_band[0] = phy_config->cfg->nfapi_config.rf_bands.rf_band[0]; //22
gNB_config->nfapi_config.earfcn.value = phy_config->cfg->nfapi_config.earfcn.value; //6600 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 gNB_config->subframe_config.numerology_index_mu.value = phy_config->cfg->subframe_config.numerology_index_mu.value;//1
gNB_config->rf_config.tx_antenna_ports.value = phy_config->cfg->rf_config.tx_antenna_ports.value; //1 gNB_config->rf_config.tx_antenna_ports.value = phy_config->cfg->rf_config.tx_antenna_ports.value; //1
gNB_config->rf_config.dl_carrier_bandwidth.value = phy_config->cfg->rf_config.dl_carrier_bandwidth.value;//106; gNB_config->rf_config.dl_carrier_bandwidth.value = phy_config->cfg->rf_config.dl_carrier_bandwidth.value;//106;
...@@ -432,7 +432,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) ...@@ -432,7 +432,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config)
RC.gNB[Mod_id][CC_id]->mac_enabled = 1; RC.gNB[Mod_id][CC_id]->mac_enabled = 1;
fp->dl_CarrierFreq = from_earfcn(gNB_config->nfapi_config.rf_bands.rf_band[0],gNB_config->nfapi_config.earfcn.value); 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_uldl_offset(gNB_config->nfapi_config.rf_bands.rf_band[0])*100000);
fp->threequarter_fs = 0; fp->threequarter_fs = 0;
......
...@@ -956,11 +956,6 @@ void phy_init_nr_top(PHY_VARS_NR_UE *ue) ...@@ -956,11 +956,6 @@ void phy_init_nr_top(PHY_VARS_NR_UE *ue)
// Polar encoder init for PBCH // Polar encoder init for PBCH
ue->nrPolar_params = NULL;
nr_polar_init(&ue->nrPolar_params,
NR_POLAR_PBCH_MESSAGE_TYPE,
NR_POLAR_PBCH_PAYLOAD_BITS,
NR_POLAR_PBCH_AGGREGATION_LEVEL);
//lte_sync_time_init(frame_parms); //lte_sync_time_init(frame_parms);
//generate_ul_ref_sigs(); //generate_ul_ref_sigs();
......
...@@ -1167,7 +1167,6 @@ void nr_dci_decoding_procedure0(int s, ...@@ -1167,7 +1167,6 @@ void nr_dci_decoding_procedure0(int s,
int16_t eNB_id, int16_t eNB_id,
uint8_t current_thread_id, uint8_t current_thread_id,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
t_nrPolar_paramsPtr *nrPolar_params,
//uint8_t mi, //uint8_t mi,
uint16_t crc_scrambled_values[TOTAL_NBR_SCRAMBLED_VALUES], uint16_t crc_scrambled_values[TOTAL_NBR_SCRAMBLED_VALUES],
uint8_t L, uint8_t L,
...@@ -1200,6 +1199,8 @@ void nr_dci_decoding_procedure0(int s, ...@@ -1200,6 +1199,8 @@ void nr_dci_decoding_procedure0(int s,
int coreset_nbr_cce_per_symbol=0; int coreset_nbr_cce_per_symbol=0;
t_nrPolar_paramsPtr nrPolar_params = pdcch_vars[eNB_id]->nrPolar_params;
#ifdef NR_PDCCH_DCI_DEBUG #ifdef NR_PDCCH_DCI_DEBUG
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> format_found is %d \n", *format_found); printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> format_found is %d \n", *format_found);
#endif #endif
...@@ -1426,8 +1427,9 @@ void nr_dci_decoding_procedure0(int s, ...@@ -1426,8 +1427,9 @@ void nr_dci_decoding_procedure0(int s,
uint32_t dci_estimation[4]={0}; uint32_t dci_estimation[4]={0};
t_nrPolar_paramsPtr nrPolar_params = pdcch_vars[eNB_id]->nrPolar_params; printf("nrPolar_params %p\n",nrPolar_params);
nr_polar_init(&nrPolar_params, 1, sizeof_bits, L2); nr_polar_init(&nrPolar_params, 1, sizeof_bits, L2);
printf("nrPolar_params %p\n",nrPolar_params);
t_nrPolar_paramsPtr currentPtrDCI=nr_polar_params(nrPolar_params, 1, sizeof_bits, L2); t_nrPolar_paramsPtr currentPtrDCI=nr_polar_params(nrPolar_params, 1, sizeof_bits, L2);
decoderState = polar_decoder_int16((int16_t*)&pdcch_vars[eNB_id]->e_rx[CCEind*9*6*2], decoderState = polar_decoder_int16((int16_t*)&pdcch_vars[eNB_id]->e_rx[CCEind*9*6*2],
dci_estimation, dci_estimation,
...@@ -2651,7 +2653,6 @@ uint8_t nr_dci_decoding_procedure(int s, ...@@ -2651,7 +2653,6 @@ uint8_t nr_dci_decoding_procedure(int s,
coreset_nbr_rb = 6 * coreset_nbr_rb; coreset_nbr_rb = 6 * coreset_nbr_rb;
// coreset_time_dur,coreset_nbr_rb, // coreset_time_dur,coreset_nbr_rb,
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
t_nrPolar_paramsPtr *nrPolar_params = &ue->nrPolar_params;
//uint8_t mi;// = get_mi(&ue->frame_parms, nr_tti_rx); //uint8_t mi;// = get_mi(&ue->frame_parms, nr_tti_rx);
//uint8_t tmode = ue->transmission_mode[eNB_id]; //uint8_t tmode = ue->transmission_mode[eNB_id];
...@@ -2746,7 +2747,7 @@ uint8_t nr_dci_decoding_procedure(int s, ...@@ -2746,7 +2747,7 @@ uint8_t nr_dci_decoding_procedure(int s,
css_dci_format,(1<<aggregationLevel)); css_dci_format,(1<<aggregationLevel));
#endif #endif
old_dci_cnt = dci_cnt; old_dci_cnt = dci_cnt;
nr_dci_decoding_procedure0(s,p,coreset_time_dur,coreset_nbr_rb,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, nrPolar_params, nr_dci_decoding_procedure0(s,p,coreset_time_dur,coreset_nbr_rb,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms,
crc_scrambled_values, aggregationLevel, crc_scrambled_values, aggregationLevel,
cformat0_0_and_1_0, uformat0_0_and_1_0, cformat0_0_and_1_0, uformat0_0_and_1_0,
format_0_0_1_0_size_bits, format_0_0_1_0_size_bytes, &dci_cnt, format_0_0_1_0_size_bits, format_0_0_1_0_size_bytes, &dci_cnt,
...@@ -2780,7 +2781,7 @@ uint8_t nr_dci_decoding_procedure(int s, ...@@ -2780,7 +2781,7 @@ uint8_t nr_dci_decoding_procedure(int s,
#endif #endif
// for aggregation level 'aggregationLevelSFI'. The number of candidates (nrofCandidates-SFI) will be calculated in function nr_dci_decoding_procedure0 // for aggregation level 'aggregationLevelSFI'. The number of candidates (nrofCandidates-SFI) will be calculated in function nr_dci_decoding_procedure0
old_dci_cnt = dci_cnt; old_dci_cnt = dci_cnt;
nr_dci_decoding_procedure0(s,p,coreset_time_dur,coreset_nbr_rb,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, nrPolar_params, nr_dci_decoding_procedure0(s,p,coreset_time_dur,coreset_nbr_rb,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms,
crc_scrambled_values, aggregationLevelSFI, crc_scrambled_values, aggregationLevelSFI,
cformat2_0, uformat0_0_and_1_0, cformat2_0, uformat0_0_and_1_0,
format_2_0_size_bits, format_2_0_size_bytes, &dci_cnt, format_2_0_size_bits, format_2_0_size_bytes, &dci_cnt,
...@@ -2810,7 +2811,7 @@ uint8_t nr_dci_decoding_procedure(int s, ...@@ -2810,7 +2811,7 @@ uint8_t nr_dci_decoding_procedure(int s,
#endif #endif
// for aggregation level 'aggregationLevelSFI'. The number of candidates (nrofCandidates-SFI) will be calculated in function nr_dci_decoding_procedure0 // for aggregation level 'aggregationLevelSFI'. The number of candidates (nrofCandidates-SFI) will be calculated in function nr_dci_decoding_procedure0
old_dci_cnt = dci_cnt; old_dci_cnt = dci_cnt;
nr_dci_decoding_procedure0(s,p,coreset_time_dur,coreset_nbr_rb,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, nrPolar_params, nr_dci_decoding_procedure0(s,p,coreset_time_dur,coreset_nbr_rb,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms,
crc_scrambled_values, aggregationLevel, crc_scrambled_values, aggregationLevel,
cformat2_1, uformat0_0_and_1_0, cformat2_1, uformat0_0_and_1_0,
format_2_1_size_bits, format_2_1_size_bytes, &dci_cnt, format_2_1_size_bits, format_2_1_size_bytes, &dci_cnt,
...@@ -2840,7 +2841,7 @@ uint8_t nr_dci_decoding_procedure(int s, ...@@ -2840,7 +2841,7 @@ uint8_t nr_dci_decoding_procedure(int s,
#endif #endif
// for aggregation level 'aggregationLevelSFI'. The number of candidates (nrofCandidates-SFI) will be calculated in function nr_dci_decoding_procedure0 // for aggregation level 'aggregationLevelSFI'. The number of candidates (nrofCandidates-SFI) will be calculated in function nr_dci_decoding_procedure0
old_dci_cnt = dci_cnt; old_dci_cnt = dci_cnt;
nr_dci_decoding_procedure0(s,p,coreset_time_dur,coreset_nbr_rb,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, nrPolar_params, nr_dci_decoding_procedure0(s,p,coreset_time_dur,coreset_nbr_rb,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms,
crc_scrambled_values, aggregationLevel, crc_scrambled_values, aggregationLevel,
cformat2_2, uformat0_0_and_1_0, cformat2_2, uformat0_0_and_1_0,
format_2_2_size_bits, format_2_2_size_bytes, &dci_cnt, format_2_2_size_bits, format_2_2_size_bytes, &dci_cnt,
...@@ -2870,7 +2871,7 @@ uint8_t nr_dci_decoding_procedure(int s, ...@@ -2870,7 +2871,7 @@ uint8_t nr_dci_decoding_procedure(int s,
#endif #endif
// for aggregation level 'aggregationLevelSFI'. The number of candidates (nrofCandidates-SFI) will be calculated in function nr_dci_decoding_procedure0 // for aggregation level 'aggregationLevelSFI'. The number of candidates (nrofCandidates-SFI) will be calculated in function nr_dci_decoding_procedure0
old_dci_cnt = dci_cnt; old_dci_cnt = dci_cnt;
nr_dci_decoding_procedure0(s,p,coreset_time_dur,coreset_nbr_rb,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, nrPolar_params, nr_dci_decoding_procedure0(s,p,coreset_time_dur,coreset_nbr_rb,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms,
crc_scrambled_values, aggregationLevel, crc_scrambled_values, aggregationLevel,
cformat2_3, uformat0_0_and_1_0, cformat2_3, uformat0_0_and_1_0,
format_2_3_size_bits, format_2_3_size_bytes, &dci_cnt, format_2_3_size_bits, format_2_3_size_bytes, &dci_cnt,
...@@ -2905,7 +2906,7 @@ uint8_t nr_dci_decoding_procedure(int s, ...@@ -2905,7 +2906,7 @@ uint8_t nr_dci_decoding_procedure(int s,
css_dci_format,(1<<aggregationLevel)); css_dci_format,(1<<aggregationLevel));
#endif #endif
old_dci_cnt = dci_cnt; old_dci_cnt = dci_cnt;
nr_dci_decoding_procedure0(s,p,coreset_time_dur,coreset_nbr_rb,pdcch_vars, 0, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms,nrPolar_params, nr_dci_decoding_procedure0(s,p,coreset_time_dur,coreset_nbr_rb,pdcch_vars, 0, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms,
crc_scrambled_values, aggregationLevel, crc_scrambled_values, aggregationLevel,
cformat0_0_and_1_0, uformat0_0_and_1_0, cformat0_0_and_1_0, uformat0_0_and_1_0,
format_0_0_1_0_size_bits, format_0_0_1_0_size_bytes, &dci_cnt, format_0_0_1_0_size_bits, format_0_0_1_0_size_bytes, &dci_cnt,
...@@ -2937,7 +2938,7 @@ uint8_t nr_dci_decoding_procedure(int s, ...@@ -2937,7 +2938,7 @@ uint8_t nr_dci_decoding_procedure(int s,
css_dci_format,(1<<aggregationLevel)); css_dci_format,(1<<aggregationLevel));
#endif #endif
old_dci_cnt = dci_cnt; old_dci_cnt = dci_cnt;
nr_dci_decoding_procedure0(s,p,coreset_time_dur,coreset_nbr_rb,pdcch_vars, 0, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms,nrPolar_params, nr_dci_decoding_procedure0(s,p,coreset_time_dur,coreset_nbr_rb,pdcch_vars, 0, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms,
crc_scrambled_values, aggregationLevel, crc_scrambled_values, aggregationLevel,
cformat0_0_and_1_0, uformat0_1_and_1_1, cformat0_0_and_1_0, uformat0_1_and_1_1,
format_0_1_1_1_size_bits, format_0_1_1_1_size_bytes, &dci_cnt, format_0_1_1_1_size_bits, format_0_1_1_1_size_bytes, &dci_cnt,
......
...@@ -653,10 +653,15 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, ...@@ -653,10 +653,15 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
//polar decoding de-rate matching //polar decoding de-rate matching
nr_ue_pbch_vars->nrPolar_params = NULL;
nr_polar_init(&nr_ue_pbch_vars->nrPolar_params,
NR_POLAR_PBCH_MESSAGE_TYPE,
NR_POLAR_PBCH_PAYLOAD_BITS,
NR_POLAR_PBCH_AGGREGATION_LEVEL);
AssertFatal(ue->nrPolar_params != NULL,"ue->nrPolar_params is null\n"); AssertFatal(nr_ue_pbch_vars->nrPolar_params != NULL,"nr_ue_pbch_vars->nrPolar_params is null\n");
t_nrPolar_params *currentPtr = nr_polar_params(ue->nrPolar_params, NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL); t_nrPolar_params *currentPtr = nr_polar_params(nr_ue_pbch_vars->nrPolar_params, NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL);
decoderState = polar_decoder_int16(pbch_e_rx,(uint8_t*)&nr_ue_pbch_vars->pbch_a_prime,currentPtr); decoderState = polar_decoder_int16(pbch_e_rx,(uint8_t*)&nr_ue_pbch_vars->pbch_a_prime,currentPtr);
......
...@@ -297,7 +297,6 @@ typedef struct PHY_VARS_gNB_s { ...@@ -297,7 +297,6 @@ typedef struct PHY_VARS_gNB_s {
NR_gNB_PDCCH pdcch_vars; NR_gNB_PDCCH pdcch_vars;
NR_gNB_PBCH pbch; NR_gNB_PBCH pbch;
t_nrPolar_paramsPtr nrPolar_params; t_nrPolar_paramsPtr nrPolar_params;
nfapi_nr_dl_config_pdcch_parameters_rel15_t pdcch_type0_params;
LTE_eNB_PHICH phich_vars[2]; LTE_eNB_PHICH phich_vars[2];
NR_gNB_COMMON common_vars; NR_gNB_COMMON common_vars;
......
...@@ -902,6 +902,7 @@ typedef struct { ...@@ -902,6 +902,7 @@ typedef struct {
// Each SearchSpace is associated with one ControlResourceSet // Each SearchSpace is associated with one ControlResourceSet
NR_UE_PDCCH_SEARCHSPACE searchSpace[NR_NBR_SEARCHSPACE_ACT_BWP]; NR_UE_PDCCH_SEARCHSPACE searchSpace[NR_NBR_SEARCHSPACE_ACT_BWP];
int n_RB_BWP[NR_NBR_SEARCHSPACE_ACT_BWP];
uint32_t nb_search_space; uint32_t nb_search_space;
#endif #endif
} NR_UE_PDCCH; } NR_UE_PDCCH;
...@@ -933,6 +934,8 @@ typedef struct { ...@@ -933,6 +934,8 @@ typedef struct {
/// \brief Pointer to PBCH decoded output. /// \brief Pointer to PBCH decoded output.
/// - first index: ? [0..63] (hard coded) /// - first index: ? [0..63] (hard coded)
uint8_t *decoded_output; uint8_t *decoded_output;
/// polar decoder parameters
t_nrPolar_paramsPtr nrPolar_params;
/// \brief Total number of PDU errors. /// \brief Total number of PDU errors.
uint32_t pdu_errors; uint32_t pdu_errors;
/// \brief Total number of PDU errors 128 frames ago. /// \brief Total number of PDU errors 128 frames ago.
...@@ -1068,7 +1071,7 @@ typedef struct { ...@@ -1068,7 +1071,7 @@ typedef struct {
uint32_t dmrs_pbch_bitmap_nr[DMRS_PBCH_I_SSB][DMRS_PBCH_N_HF][DMRS_BITMAP_SIZE]; uint32_t dmrs_pbch_bitmap_nr[DMRS_PBCH_I_SSB][DMRS_PBCH_N_HF][DMRS_BITMAP_SIZE];
#endif #endif
t_nrPolar_params *nrPolar_params;
/// PBCH DMRS sequence /// PBCH DMRS sequence
uint32_t nr_gold_pbch[2][64][NR_PBCH_DMRS_LENGTH_DWORD]; uint32_t nr_gold_pbch[2][64][NR_PBCH_DMRS_LENGTH_DWORD];
......
...@@ -105,7 +105,8 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ ...@@ -105,7 +105,8 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
for (i=0;i<number_dl_pdu;i++) { for (i=0;i<number_dl_pdu;i++) {
dl_config_pdu = &DL_req->dl_config_request_body.dl_config_pdu_list[i]; dl_config_pdu = &DL_req->dl_config_request_body.dl_config_pdu_list[i];
//LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type); LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type);
printf("NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type);
switch (dl_config_pdu->pdu_type) { switch (dl_config_pdu->pdu_type) {
case NFAPI_NR_DL_CONFIG_BCH_PDU_TYPE: case NFAPI_NR_DL_CONFIG_BCH_PDU_TYPE:
AssertFatal(dl_config_pdu->bch_pdu_rel15.pdu_index < TX_req->tx_request_body.number_of_pdus, AssertFatal(dl_config_pdu->bch_pdu_rel15.pdu_index < TX_req->tx_request_body.number_of_pdus,
......
...@@ -33,23 +33,6 @@ ...@@ -33,23 +33,6 @@
#include "sched_nr.h" #include "sched_nr.h"
/// LUT for the number of symbols in the coreset indexed by coreset index (4 MSB rmsi_pdcch_config)
uint8_t nr_coreset_nsymb_pdcch_type_0_b40Mhz[16] = {2,2,2,2,2,3,3,3,3,3,1,1,1,2,2,2}; // below 40Mhz bw
uint8_t nr_coreset_nsymb_pdcch_type_0_a40Mhz[10] = {2,2,3,3,1,1,2,2,3,3}; // above 40Mhz bw
/// LUT for the number of RBs in the coreset indexed by coreset index
uint8_t nr_coreset_rb_offset_pdcch_type_0_b40Mhz[16] = {0,1,2,3,4,0,1,2,3,4,12,14,16,12,14,16};
uint8_t nr_coreset_rb_offset_pdcch_type_0_a40Mhz[10] = {0,4,0,4,0,28,0,28,0,28};
/// LUT for monitoring occasions param O indexed by ss index (4 LSB rmsi_pdcch_config)
uint8_t nr_ss_param_O_type_0_mux1_FR1[16] = {0,0,2,2,5,5,7,7,0,5,0,0,2,2,5,5};
uint8_t nr_ss_param_O_type_0_mux1_FR2[14] = {0,0,2.5,2.5,5,5,0,2.5,5,7.5,7.5,7.5,0,5};
/// LUT for number of SS sets per slot indexed by ss index
uint8_t nr_ss_sets_per_slot_type_0_FR1[16] = {1,2,1,2,1,2,1,2,1,1,1,1,1,1,1,1};
uint8_t nr_ss_sets_per_slot_type_0_FR2[14] = {1,2,1,2,1,2,2,2,2,1,2,2,1,1};
/// LUT for monitoring occasions param M indexed by ss index
uint8_t nr_ss_param_M_type_0_mux1_FR1[16] = {1,0.5,1,0.5,1,0.5,1,0.5,2,2,1,1,1,1,1,1};
uint8_t nr_ss_param_M_type_0_mux1_FR2[14] = {1,0.5,1,0.5,1,0.5,0.5,0.5,0.5,1,0.5,0.5,2,2};
/// LUT for SS first symbol index indexed by ss index
uint8_t nr_ss_first_symb_idx_type_0_mux1_FR1[8] = {0,0,1,2,1,2,1,2};
...@@ -60,121 +43,4 @@ nr_subframe_t nr_subframe_select(nfapi_nr_config_request_t *cfg,unsigned char su ...@@ -60,121 +43,4 @@ nr_subframe_t nr_subframe_select(nfapi_nr_config_request_t *cfg,unsigned char su
} }
void nr_configure_css_dci_from_mib(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params,
nr_scs_e scs_common,
nr_scs_e pdcch_scs,
nr_frequency_range_e freq_range,
uint8_t rmsi_pdcch_config,
uint8_t ssb_idx,
uint16_t nb_slots_per_frame,
uint16_t N_RB)
{
uint8_t O, M;
uint8_t ss_idx = rmsi_pdcch_config&0xf;
uint8_t cset_idx = (rmsi_pdcch_config>>4)&0xf;
uint8_t mu;
/// Coreset params
switch(scs_common) {
case kHz15:
mu = 0;
break;
case kHz30:
mu = 1;
if (N_RB < 106) { // Minimum 40Mhz bandwidth not satisfied
switch(pdcch_scs) {
case kHz15:
break;
case kHz30:
pdcch_params->mux_pattern = NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE1;
pdcch_params->n_rb = (cset_idx < 10)? 24 : 48;
pdcch_params->n_symb = nr_coreset_nsymb_pdcch_type_0_b40Mhz[cset_idx];
pdcch_params->rb_offset = nr_coreset_rb_offset_pdcch_type_0_b40Mhz[cset_idx];
break;
default:
AssertFatal(1==0,"Invalid scs_common/pdcch_scs combination %d/%d \n", scs_common, pdcch_scs);
}
}
else {
AssertFatal(ss_idx<10 ,"Invalid scs_common/pdcch_scs combination %d/%d \n", scs_common, pdcch_scs);
switch(pdcch_scs) {
case kHz15:
break;
case kHz30:
pdcch_params->mux_pattern = NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE1;
pdcch_params->n_rb = (cset_idx < 4)? 24 : 48;
pdcch_params->n_symb = nr_coreset_nsymb_pdcch_type_0_b40Mhz[cset_idx];
pdcch_params->rb_offset = nr_coreset_rb_offset_pdcch_type_0_b40Mhz[cset_idx];
break;
default:
AssertFatal(1==0,"Invalid scs_common/pdcch_scs combination %d/%d \n", scs_common, pdcch_scs);
}
}
case kHz60:
mu = 2;
break;
case kHz120:
mu = 3;
break;
default:
AssertFatal(1==0,"Invalid common subcarrier spacing %d\n", scs_common);
}
/// Search space params
switch(pdcch_params->mux_pattern) {
case NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE1:
if (freq_range == nr_FR1) {
O = nr_ss_param_O_type_0_mux1_FR1[ss_idx];
pdcch_params->nb_ss_sets_per_slot = nr_ss_sets_per_slot_type_0_FR1[ss_idx];
M = nr_ss_param_M_type_0_mux1_FR1[ss_idx];
pdcch_params->first_symbol = (ss_idx < 8)? ( (ss_idx&1)? pdcch_params->n_symb : 0 ) : nr_ss_first_symb_idx_type_0_mux1_FR1[ss_idx - 8];
}
else {
AssertFatal(ss_idx<14 ,"Invalid search space index for multiplexing type 1 and FR2 %d\n", ss_idx);
O = nr_ss_param_O_type_0_mux1_FR2[ss_idx];
pdcch_params->nb_ss_sets_per_slot = nr_ss_sets_per_slot_type_0_FR2[ss_idx];
M = nr_ss_param_M_type_0_mux1_FR2[ss_idx];
pdcch_params->first_symbol = (ss_idx < 12)? ( (ss_idx&1)? 7 : 0 ) : 0;
}
pdcch_params->nb_slots = 2;
pdcch_params->sfn_mod2 = ((uint8_t)(floor( (O*pow(2, mu) + floor(ssb_idx*M)) / nb_slots_per_frame )) & 1)? 1 : 0;
pdcch_params->first_slot = (uint8_t)(O*pow(2, mu) + floor(ssb_idx*M)) % nb_slots_per_frame;
break;
case NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE2:
break;
case NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE3:
break;
default:
AssertFatal(1==0, "Invalid SSB and coreset multiplexing pattern %d\n", pdcch_params->mux_pattern);
}
pdcch_params->config_type = NFAPI_NR_CSET_CONFIG_MIB_SIB1;
pdcch_params->cr_mapping_type = NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED;
pdcch_params->precoder_granularity = NFAPI_NR_CSET_SAME_AS_REG_BUNDLE;
pdcch_params->reg_bundle_size = 6;
pdcch_params->interleaver_size = 2;
}
void nr_configure_css_dci_from_pdcch_config(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params,
nfapi_nr_coreset_t* coreset,
nfapi_nr_search_space_t* search_space) {
}
...@@ -61,6 +61,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ ...@@ -61,6 +61,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
pdcch_vars2->nb_search_space = pdcch_vars2->nb_search_space + 1; pdcch_vars2->nb_search_space = pdcch_vars2->nb_search_space + 1;
fapi_nr_dl_config_dci_dl_pdu_rel15_t *dci_config = &dl_config->dl_config_list[i].dci_config_pdu.dci_config_rel15; fapi_nr_dl_config_dci_dl_pdu_rel15_t *dci_config = &dl_config->dl_config_list[i].dci_config_pdu.dci_config_rel15;
pdcch_vars2->n_RB_BWP[i] = dci_config->N_RB_BWP;
pdcch_vars2->searchSpace[i].monitoringSymbolWithinSlot = dci_config->monitoring_symbols_within_slot; pdcch_vars2->searchSpace[i].monitoringSymbolWithinSlot = dci_config->monitoring_symbols_within_slot;
pdcch_vars2->searchSpace[i].nrofCandidates_aggrlevel1 = dci_config->number_of_candidates[0]; pdcch_vars2->searchSpace[i].nrofCandidates_aggrlevel1 = dci_config->number_of_candidates[0];
......
...@@ -3541,9 +3541,9 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * ...@@ -3541,9 +3541,9 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *
// this table contains 56 (NBR_NR_DCI_FIELDS) elements for each dci field and format described in TS 38.212. Each element represents the size in bits for each dci field // this table contains 56 (NBR_NR_DCI_FIELDS) elements for each dci field and format described in TS 38.212. Each element represents the size in bits for each dci field
//uint8_t dci_fields_sizes[NBR_NR_DCI_FIELDS][NBR_NR_FORMATS] = {0}; //uint8_t dci_fields_sizes[NBR_NR_DCI_FIELDS][NBR_NR_FORMATS] = {0};
// this is the UL bandwidth part. FIXME! To be defined where this value comes from // this is the UL bandwidth part. FIXME! To be defined where this value comes from
uint16_t n_RB_ULBWP = 106; // uint16_t n_RB_ULBWP = 106;
// this is the DL bandwidth part. FIXME! To be defined where this value comes from // this is the DL bandwidth part. FIXME! To be defined where this value comes from
uint16_t n_RB_DLBWP = 106; //uint16_t n_RB_DLBWP = 106;
//#ifdef NR_PDCCH_SCHED_DEBUG //#ifdef NR_PDCCH_SCHED_DEBUG
// printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> n_RB_ULBWP=%d n_RB_DLBWP=%d\n", // printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> n_RB_ULBWP=%d n_RB_DLBWP=%d\n",
// n_RB_ULBWP, // n_RB_ULBWP,
...@@ -3735,15 +3735,15 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * ...@@ -3735,15 +3735,15 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *
#ifdef NR_PDCCH_SCHED_DEBUG #ifdef NR_PDCCH_SCHED_DEBUG
if (searchSpaceType == common) { // search all possible dci's for COMMON SEARCH SPACES according to the current SEARCHSPACE configuration if (searchSpaceType == common) { // search all possible dci's for COMMON SEARCH SPACES according to the current SEARCHSPACE configuration
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Entering function nr_dci_decoding_procedure with eNB_id=%d (n_RB_ULBWP=%d, n_RB_DLBWP=%d, searchSpaceType=%d, nb_searchspace_active=%d, nb_coreset_active=%d) -> dci_cnt=%d\n", printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Entering function nr_dci_decoding_procedure with eNB_id=%d (n_RB_BWP=%d, searchSpaceType=%d, nb_searchspace_active=%d, nb_coreset_active=%d) -> dci_cnt=%d\n",
eNB_id,n_RB_ULBWP,n_RB_DLBWP,searchSpaceType, eNB_id,pdcch_vars2->n_RB_BWP[nb_searchspace_active],searchSpaceType,
nb_searchspace_active, nb_searchspace_active,
nb_coreset_active, nb_coreset_active,
dci_cnt); dci_cnt);
} }
if (searchSpaceType == ue_specific){// search all possible dci's for UE-SPECIFIC SEARCH SPACES according to the current SEARCHSPACE configuration if (searchSpaceType == ue_specific){// search all possible dci's for UE-SPECIFIC SEARCH SPACES according to the current SEARCHSPACE configuration
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Entering function nr_dci_decoding_procedure with eNB_id=%d (n_RB_ULBWP=%d, n_RB_DLBWP=%d, searchSpaceType=%d, nb_searchspace_active=%d, nb_coreset_active=%d) -> dci_cnt=%d\n", printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Entering function nr_dci_decoding_procedure with eNB_id=%d (n_RB_BWP=%d, searchSpaceType=%d, nb_searchspace_active=%d, nb_coreset_active=%d) -> dci_cnt=%d\n",
eNB_id,n_RB_ULBWP,n_RB_DLBWP,searchSpaceType, eNB_id,pdcch_vars2->n_RB_BWP[nb_searchspace_active],searchSpaceType,
nb_searchspace_active, nb_searchspace_active,
nb_coreset_active, nb_coreset_active,
dci_cnt); dci_cnt);
...@@ -3759,8 +3759,8 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * ...@@ -3759,8 +3759,8 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *
eNB_id, eNB_id,
nr_tti_rx, nr_tti_rx,
dci_fields_sizes_cnt, dci_fields_sizes_cnt,
n_RB_ULBWP, pdcch_vars2->n_RB_BWP[nb_searchspace_active],
n_RB_DLBWP, pdcch_vars2->n_RB_BWP[nb_searchspace_active],
&crc_scrambled, &crc_scrambled,
&format_found, &format_found,
crc_scrambled_values); crc_scrambled_values);
...@@ -3900,8 +3900,8 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * ...@@ -3900,8 +3900,8 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *
ue->pdsch_config_dedicated, ue->pdsch_config_dedicated,
ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id],
dci_fields_sizes_cnt[i], dci_fields_sizes_cnt[i],
n_RB_ULBWP, pdcch_vars2->n_RB_BWP[nb_searchspace_active],
n_RB_DLBWP, pdcch_vars2->n_RB_BWP[nb_searchspace_active],
crc_scrambled_values, crc_scrambled_values,
ptr_nr_dci_info_extracted);//&nr_dci_info_extracted); ptr_nr_dci_info_extracted);//&nr_dci_info_extracted);
......
...@@ -71,8 +71,8 @@ int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0 ...@@ -71,8 +71,8 @@ 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);} int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) {return(0);}
uint32_t from_earfcn(int eutra_bandP,uint32_t dl_earfcn) {return(0);} uint32_t from_nrarfcn(int nr_bandP,uint32_t dl_nrarfcn) {return(0);}
int32_t get_uldl_offset(int eutra_bandP) {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);} NR_IF_Module_t *NR_IF_Module_init(int Mod_id){return(NULL);}
...@@ -96,7 +96,12 @@ int rlc_module_init (void) {return(0);} ...@@ -96,7 +96,12 @@ int rlc_module_init (void) {return(0);}
void pdcp_layer_init(void) {} void pdcp_layer_init(void) {}
int rrc_init_nr_global_param(void){return(0);} int rrc_init_nr_global_param(void){return(0);}
void config_common(int Mod_idP,
int CC_idP,
int nr_bandP,
uint64_t dl_CarrierFreqP,
uint32_t dl_BandwidthP
);
// needed for some functions // needed for some functions
PHY_VARS_NR_UE ***PHY_vars_UE_g; PHY_VARS_NR_UE ***PHY_vars_UE_g;
...@@ -385,9 +390,14 @@ int main(int argc, char **argv) ...@@ -385,9 +390,14 @@ int main(int argc, char **argv)
frame_parms->N_RB_DL = N_RB_DL; frame_parms->N_RB_DL = N_RB_DL;
frame_parms->N_RB_UL = N_RB_DL; frame_parms->N_RB_UL = N_RB_DL;
// stub to configure frame_parms
nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu); nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu);
// call MAC to configure common parameters
phy_init_nr_gNB(gNB,0,0); phy_init_nr_gNB(gNB,0,0);
double fs,bw; double fs,bw;
if (mu == 1 && N_RB_DL == 217) { if (mu == 1 && N_RB_DL == 217) {
...@@ -479,6 +489,8 @@ int main(int argc, char **argv) ...@@ -479,6 +489,8 @@ 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*180000*(mu+1));
nr_l2_init_ue(); nr_l2_init_ue();
UE_mac = get_mac_inst(0); UE_mac = get_mac_inst(0);
...@@ -608,6 +620,7 @@ int main(int argc, char **argv) ...@@ -608,6 +620,7 @@ int main(int argc, char **argv)
dl_config.dl_config_list[0].dci_config_pdu.dci_config_rel15.duration = search_space_duration; dl_config.dl_config_list[0].dci_config_pdu.dci_config_rel15.duration = search_space_duration;
dl_config.dl_config_list[0].dci_config_pdu.dci_config_rel15.monitoring_symbols_within_slot = (0x3fff << first_symbol_index) & (0x3fff >> (14-coreset_duration-first_symbol_index)) & 0x3fff; dl_config.dl_config_list[0].dci_config_pdu.dci_config_rel15.monitoring_symbols_within_slot = (0x3fff << first_symbol_index) & (0x3fff >> (14-coreset_duration-first_symbol_index)) & 0x3fff;
dl_config.dl_config_list[0].dci_config_pdu.dci_config_rel15.N_RB_BWP = N_RB_DL;
for (SNR=snr0; SNR<snr1; SNR+=.2) { for (SNR=snr0; SNR<snr1; SNR+=.2) {
......
...@@ -65,8 +65,8 @@ int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0 ...@@ -65,8 +65,8 @@ 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);} int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) {return(0);}
uint32_t from_earfcn(int eutra_bandP,uint32_t dl_earfcn) {return(0);} uint32_t from_nrarfcn(int nr_bandP,uint32_t dl_nrarfcn) {return(0);}
int32_t get_uldl_offset(int eutra_bandP) {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);} NR_IF_Module_t *NR_IF_Module_init(int Mod_id){return(NULL);}
......
...@@ -119,9 +119,9 @@ void dl_phy_sync_success(module_id_t module_idP, ...@@ -119,9 +119,9 @@ void dl_phy_sync_success(module_id_t module_idP,
frame_t frameP, frame_t frameP,
unsigned char eNB_index, uint8_t first_sync){} unsigned char eNB_index, uint8_t first_sync){}
uint32_t from_earfcn(int eutra_bandP, uint32_t dl_earfcn) { return(0);} uint32_t from_nrarfcn(int nr_bandP, uint32_t dl_nrarfcn) { return(0);}
int32_t get_uldl_offset(int eutra_bandP) { return(0);} int32_t get_uldl_offset(int nr_bandP) { return(0);}
IF_Module_t *IF_Module_init(int Mod_id) { return(NULL);} IF_Module_t *IF_Module_init(int Mod_id) { return(NULL);}
......
...@@ -52,96 +52,87 @@ extern uint8_t nfapi_mode; ...@@ -52,96 +52,87 @@ extern uint8_t nfapi_mode;
int32_t **rxdata; int32_t **rxdata;
int32_t **txdata; int32_t **txdata;
typedef struct eutra_bandentry_s { typedef struct nr_bandentry_s {
int16_t band; int16_t band;
uint32_t ul_min; uint64_t ul_min;
uint32_t ul_max; uint64_t ul_max;
uint32_t dl_min; uint64_t dl_min;
uint32_t dl_max; uint64_t dl_max;
uint32_t N_OFFs_DL; uint64_t N_OFFs_DL;
} eutra_bandentry_t; uint64_t step_size;
} nr_bandentry_t;
typedef struct band_info_s { typedef struct band_info_s {
int nbands; int nbands;
eutra_bandentry_t band_info[100]; nr_bandentry_t band_info[100];
} band_info_t; } nr_band_info_t;
static const eutra_bandentry_t eutra_bandtable[] = { static const nr_bandentry_t nr_bandtable[] = {
{1, 19200, 19800, 21100, 21700, 0}, {1, 1920000, 1980000, 2110000, 2170000, 20, 422000},
{2, 18500, 19100, 19300, 19900, 6000}, {2, 1850000, 1910000, 1930000, 1990000, 20, 386000},
{3, 17100, 17850, 18050, 18800, 12000}, {3, 1710000, 1785000, 1805000, 1880000, 20, 361000},
{4, 17100, 17550, 21100, 21550, 19500}, {5, 824000, 849000, 869000, 894000, 20, 173800},
{5, 8240, 8490, 8690, 8940, 24000}, {7, 2500000, 2570000, 2620000, 2690000, 20, 524000},
{6, 8300, 8400, 8750, 8850, 26500}, {8, 880000, 915000, 925000, 960000, 20, 185000},
{7, 25000, 25700, 26200, 26900, 27500}, {12, 698000, 716000, 728000, 746000, 20, 145800},
{8, 8800, 9150, 9250, 9600, 34500}, {20, 832000, 862000, 791000, 821000, 20, 158200},
{9, 17499, 17849, 18449, 18799, 38000}, {25, 1850000, 1915000, 1930000, 1995000, 20, 386000},
{10, 17100, 17700, 21100, 21700, 41500}, {28, 703000, 758000, 758000, 813000, 20, 151600},
{11, 14279, 14529, 14759, 15009, 47500}, {34, 2010000, 2025000, 2010000, 2025000, 20, 402000},
{12, 6980, 7160, 7280, 7460, 50100}, {38, 2570000, 2620000, 2570000, 2630000, 20, 514000},
{13, 7770, 7870, 7460, 7560, 51800}, {39, 1880000, 1920000, 1880000, 1920000, 20, 376000},
{14, 7880, 7980, 7580, 7680, 52800}, {40, 2300000, 2400000, 2300000, 2400000, 20, 460000},
{17, 7040, 7160, 7340, 7460, 57300}, {41, 2496000, 2690000, 2496000, 2690000, 3, 499200},
{18, 8150, 9650, 8600, 10100, 58500}, {50, 1432000, 1517000, 1432000, 1517000, 20, 286400},
{19, 8300, 8450, 8750, 8900, 60000}, {51, 1427000, 1432000, 1427000, 1432000, 20, 285400},
{20, 8320, 8620, 7910, 8210, 61500}, {66, 1710000, 1780000, 2110000, 2200000, 20, 422000},
{21, 14479, 14629, 14959, 15109, 64500}, {70, 1695000, 1710000, 1995000, 2020000, 20, 399000},
{22, 34100, 34900, 35100, 35900, 66000}, {71, 663000, 698000, 617000, 652000, 20, 123400},
{23, 20000, 20200, 21800, 22000, 75000}, {74, 1427000, 1470000, 1475000, 1518000, 20, 295000},
{24, 16126, 16605, 15250, 15590, 77000}, {75, 000, 000, 1432000, 1517000, 20, 286400},
{25, 18500, 19150, 19300, 19950, 80400}, {76, 000, 000, 1427000, 1432000, 20, 285400},
{26, 8140, 8490, 8590, 8940, 86900}, {77, 3300000, 4200000, 3300000, 4200000, 1, 620000},
{27, 8070, 8240, 8520, 8690, 90400}, {78, 3300000, 3800000, 3300000, 3800000, 1, 620000},
{28, 7030, 7580, 7580, 8130, 92100}, {79, 4400000, 5000000, 4400000, 5000000, 2, 693334},
{29, 0, 0, 7170, 7280, 96600}, {80, 1710000, 1785000, 000, 000, 20, 342000},
{30, 23050, 23250, 23500, 23600, 97700}, {81, 860000, 915000, 000, 000, 20, 176000},
{31, 45250, 34900, 46250, 35900, 98700}, {82, 832000, 862000, 000, 000, 20, 166400},
{32, 0, 0, 14520, 14960, 99200}, {83, 703000, 748000, 000, 000, 20, 140600},
{33, 19000, 19200, 19000, 19200, 36000}, {84, 1920000, 1980000, 000, 000, 20, 384000},
{34, 20100, 20250, 20100, 20250, 36200}, {86, 1710000, 1785000, 000, 000, 20, 342000}
{35, 18500, 19100, 18500, 19100, 36350},
{36, 19300, 19900, 19300, 19900, 36950},
{37, 19100, 19300, 19100, 19300, 37550},
{38, 25700, 26200, 25700, 26300, 37750},
{39, 18800, 19200, 18800, 19200, 38250},
{40, 23000, 24000, 23000, 24000, 38650},
{41, 24960, 26900, 24960, 26900, 39650},
{42, 34000, 36000, 34000, 36000, 41590},
{43, 36000, 38000, 36000, 38000, 43590},
{44, 7030, 8030, 7030, 8030, 45590},
{45, 14470, 14670, 14470, 14670, 46590},
{46, 51500, 59250, 51500, 59250, 46790},
{65, 19200, 20100, 21100, 22000, 65536},
{66, 17100, 18000, 21100, 22000, 66436},
{67, 0, 0, 7380, 7580, 67336},
{68, 6980, 7280, 7530, 7830, 67536}
}; };
uint32_t nr_to_earfcn(int eutra_bandP, uint32_t dl_CarrierFreq, uint32_t bw) uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint32_t bw)
{ {
uint32_t dl_CarrierFreq_by_100k = dl_CarrierFreq / 100000; uint64_t dl_CarrierFreq_by_1k = dl_CarrierFreq / 1000;
int bw_by_100 = bw / 100; int bw_kHz = bw / 1000;
int i; int i;
AssertFatal(eutra_bandP < 69, "eutra_band %d > 68\n", eutra_bandP); AssertFatal(nr_bandP < 86, "nr_band %d > 86\n", nr_bandP);
for (i = 0; i < 69 && eutra_bandtable[i].band != eutra_bandP; i++); for (i = 0; i < 30 && nr_bandtable[i].band != nr_bandP; i++);
AssertFatal(dl_CarrierFreq_by_100k >= eutra_bandtable[i].dl_min, AssertFatal(dl_CarrierFreq_by_1k >= nr_bandtable[i].dl_min,
"Band %d, bw %u : DL carrier frequency %u Hz < %u\n", "Band %d, bw %u : DL carrier frequency %llu kHz < %llu\n",
eutra_bandP, bw, dl_CarrierFreq, nr_bandP, bw, (long long unsigned int)dl_CarrierFreq_by_1k,
eutra_bandtable[i].dl_min); (long long unsigned int)nr_bandtable[i].dl_min);
AssertFatal(dl_CarrierFreq_by_100k <= AssertFatal(dl_CarrierFreq_by_1k <=
(eutra_bandtable[i].dl_max - bw_by_100), (nr_bandtable[i].dl_max - bw_kHz),
"Band %d, bw %u: DL carrier frequency %u Hz > %d\n", "Band %d, dl_CarrierFreq %llu bw %u: DL carrier frequency %llu kHz > %llu\n",
eutra_bandP, bw, dl_CarrierFreq, nr_bandP, (long long unsigned int)dl_CarrierFreq,bw, (long long unsigned int)dl_CarrierFreq_by_1k,
eutra_bandtable[i].dl_max - bw_by_100); (long long unsigned int)(nr_bandtable[i].dl_max - bw_kHz));
int deltaFglobal;
return (dl_CarrierFreq_by_100k - eutra_bandtable[i].dl_min + if (dl_CarrierFreq < 3e9) deltaFglobal = 5;
(eutra_bandtable[i].N_OFFs_DL / 10)); else deltaFglobal = 15;
// This is equation before Table 5.4.2.1-1 in 38101-1-f30
// F_REF=F_REF_Offs + deltaF_Global(N_REF-NREF_REF_Offs)
return (((dl_CarrierFreq_by_1k - nr_bandtable[i].dl_min)/deltaFglobal) +
nr_bandtable[i].N_OFFs_DL);
} }
...@@ -170,9 +161,9 @@ void config_nr_mib(int Mod_idP, ...@@ -170,9 +161,9 @@ 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 eutra_bandP, int nr_bandP,
int dl_CarrierFreqP, uint64_t dl_CarrierFreqP,
int dl_BandwidthP uint32_t dl_BandwidthP
){ ){
nfapi_nr_config_request_t *cfg = &RC.nrmac[Mod_idP]->config[CC_idP]; nfapi_nr_config_request_t *cfg = &RC.nrmac[Mod_idP]->config[CC_idP];
...@@ -184,12 +175,12 @@ void config_common(int Mod_idP, ...@@ -184,12 +175,12 @@ void config_common(int Mod_idP,
/// In NR DL and UL will be different band /// In NR DL and UL will be different band
cfg->nfapi_config.rf_bands.number_rf_bands = 1; cfg->nfapi_config.rf_bands.number_rf_bands = 1;
cfg->nfapi_config.rf_bands.rf_band[0] = eutra_bandP; cfg->nfapi_config.rf_bands.rf_band[0] = nr_bandP;
cfg->nfapi_config.rf_bands.tl.tag = NFAPI_PHY_RF_BANDS_TAG; cfg->nfapi_config.rf_bands.tl.tag = NFAPI_PHY_RF_BANDS_TAG;
cfg->num_tlv++; cfg->num_tlv++;
cfg->nfapi_config.earfcn.value = nr_to_earfcn(eutra_bandP,dl_CarrierFreqP,dl_BandwidthP*180/100); cfg->nfapi_config.nrarfcn.value = to_nrarfcn(nr_bandP,dl_CarrierFreqP,dl_BandwidthP);
cfg->nfapi_config.earfcn.tl.tag = NFAPI_NFAPI_EARFCN_TAG; cfg->nfapi_config.nrarfcn.tl.tag = NFAPI_NR_NFAPI_NRARFCN_TAG;
cfg->num_tlv++; cfg->num_tlv++;
cfg->subframe_config.numerology_index_mu.value = 1; cfg->subframe_config.numerology_index_mu.value = 1;
...@@ -217,7 +208,7 @@ void config_common(int Mod_idP, ...@@ -217,7 +208,7 @@ 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 p_gNB, int p_gNB,
int eutra_bandP, int nr_bandP,
int dl_CarrierFreqP, int dl_CarrierFreqP,
int dl_BandwidthP, int dl_BandwidthP,
NR_BCCH_BCH_Message_t *mib, NR_BCCH_BCH_Message_t *mib,
...@@ -245,7 +236,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ...@@ -245,7 +236,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
if( servingcellconfigcommon != NULL ){ if( servingcellconfigcommon != NULL ){
config_common(Mod_idP, config_common(Mod_idP,
CC_idP, CC_idP,
eutra_bandP, nr_bandP,
dl_CarrierFreqP, dl_CarrierFreqP,
dl_BandwidthP dl_BandwidthP
); );
......
...@@ -46,14 +46,20 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP, ...@@ -46,14 +46,20 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
nfapi_nr_dl_config_request_body_t *dl_req; nfapi_nr_dl_config_request_body_t *dl_req;
nfapi_nr_dl_config_request_pdu_t *dl_config_pdu; nfapi_nr_dl_config_request_pdu_t *dl_config_pdu;
nfapi_tx_request_pdu_t *TX_req; nfapi_tx_request_pdu_t *TX_req;
nfapi_nr_config_request_t *cfg = &nr_mac->config[0];
uint16_t sfn_sf = frameP << 4 | subframeP; uint16_t sfn_sf = frameP << 4 | subframeP;
int dl_carrier_bandwidth = cfg->rf_config.dl_carrier_bandwidth.value;
// everything here is hard-coded to 30 kHz
int scs = kHz30;
int mu = 1;
int slots_per_frame = 10 * (1<<mu);
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
LOG_I(MAC, "Scheduling common search space DCI type 1 for CC_id %d\n",CC_id); LOG_I(MAC, "Scheduling common search space DCI type 1 for CC_id %d\n",CC_id);
PHY_VARS_gNB *gNB = RC.gNB[module_idP][CC_id];
nfapi_nr_config_request_t *cfg = &gNB->gNB_config;
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
dl_req = &nr_mac->DL_req[CC_id].dl_config_request_body; dl_req = &nr_mac->DL_req[CC_id].dl_config_request_body;
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
...@@ -64,11 +70,10 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP, ...@@ -64,11 +70,10 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
nfapi_nr_dl_config_dci_dl_pdu_rel15_t *pdu_rel15 = &dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel15; nfapi_nr_dl_config_dci_dl_pdu_rel15_t *pdu_rel15 = &dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel15;
nfapi_nr_dl_config_pdcch_parameters_rel15_t *params_rel15 = &dl_config_pdu->dci_dl_pdu.pdcch_params_rel15; nfapi_nr_dl_config_pdcch_parameters_rel15_t *params_rel15 = &dl_config_pdu->dci_dl_pdu.pdcch_params_rel15;
nr_configure_css_dci_from_mib(&gNB->pdcch_type0_params, nr_configure_css_dci_from_mib(params_rel15,
kHz30, kHz30, nr_FR1, 0, 0, scs, scs, nr_FR1, 0, 0,
fp->slots_per_frame, slots_per_frame,
cfg->rf_config.dl_carrier_bandwidth.value); dl_carrier_bandwidth);
memcpy((void*)params_rel15, (void*)&gNB->pdcch_type0_params, sizeof(nfapi_nr_dl_config_pdcch_parameters_rel15_t));
pdu_rel15->frequency_domain_assignment = 5; pdu_rel15->frequency_domain_assignment = 5;
pdu_rel15->time_domain_assignment = 2; pdu_rel15->time_domain_assignment = 2;
......
...@@ -65,6 +65,24 @@ extern RAN_CONTEXT_t RC; ...@@ -65,6 +65,24 @@ extern RAN_CONTEXT_t RC;
extern int n_active_slices; extern int n_active_slices;
/// LUT for the number of symbols in the coreset indexed by coreset index (4 MSB rmsi_pdcch_config)
uint8_t nr_coreset_nsymb_pdcch_type_0_b40Mhz[16] = {2,2,2,2,2,3,3,3,3,3,1,1,1,2,2,2}; // below 40Mhz bw
uint8_t nr_coreset_nsymb_pdcch_type_0_a40Mhz[10] = {2,2,3,3,1,1,2,2,3,3}; // above 40Mhz bw
/// LUT for the number of RBs in the coreset indexed by coreset index
uint8_t nr_coreset_rb_offset_pdcch_type_0_b40Mhz[16] = {0,1,2,3,4,0,1,2,3,4,12,14,16,12,14,16};
uint8_t nr_coreset_rb_offset_pdcch_type_0_a40Mhz[10] = {0,4,0,4,0,28,0,28,0,28};
/// LUT for monitoring occasions param O indexed by ss index (4 LSB rmsi_pdcch_config)
uint8_t nr_ss_param_O_type_0_mux1_FR1[16] = {0,0,2,2,5,5,7,7,0,5,0,0,2,2,5,5};
uint8_t nr_ss_param_O_type_0_mux1_FR2[14] = {0,0,2.5,2.5,5,5,0,2.5,5,7.5,7.5,7.5,0,5};
/// LUT for number of SS sets per slot indexed by ss index
uint8_t nr_ss_sets_per_slot_type_0_FR1[16] = {1,2,1,2,1,2,1,2,1,1,1,1,1,1,1,1};
uint8_t nr_ss_sets_per_slot_type_0_FR2[14] = {1,2,1,2,1,2,2,2,2,1,2,2,1,1};
/// LUT for monitoring occasions param M indexed by ss index
uint8_t nr_ss_param_M_type_0_mux1_FR1[16] = {1,0.5,1,0.5,1,0.5,1,0.5,2,2,1,1,1,1,1,1};
uint8_t nr_ss_param_M_type_0_mux1_FR2[14] = {1,0.5,1,0.5,1,0.5,0.5,0.5,0.5,1,0.5,0.5,2,2};
/// LUT for SS first symbol index indexed by ss index
uint8_t nr_ss_first_symb_idx_type_0_mux1_FR1[8] = {0,0,1,2,1,2,1,2};
int is_nr_UL_sf(NR_COMMON_channels_t * ccP, sub_frame_t subframeP){ int is_nr_UL_sf(NR_COMMON_channels_t * ccP, sub_frame_t subframeP){
// if FDD return dummy value // if FDD return dummy value
if (ccP->tdd_Config == NULL) if (ccP->tdd_Config == NULL)
...@@ -121,3 +139,122 @@ int is_nr_UL_sf(NR_COMMON_channels_t * ccP, sub_frame_t subframeP){ ...@@ -121,3 +139,122 @@ int is_nr_UL_sf(NR_COMMON_channels_t * ccP, sub_frame_t subframeP){
break; break;
} }
} }
void nr_configure_css_dci_from_mib(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params,
nr_scs_e scs_common,
nr_scs_e pdcch_scs,
nr_frequency_range_e freq_range,
uint8_t rmsi_pdcch_config,
uint8_t ssb_idx,
uint16_t nb_slots_per_frame,
uint16_t N_RB)
{
uint8_t O, M;
uint8_t ss_idx = rmsi_pdcch_config&0xf;
uint8_t cset_idx = (rmsi_pdcch_config>>4)&0xf;
uint8_t mu;
/// Coreset params
switch(scs_common) {
case kHz15:
mu = 0;
break;
case kHz30:
mu = 1;
if (N_RB < 106) { // Minimum 40Mhz bandwidth not satisfied
switch(pdcch_scs) {
case kHz15:
break;
case kHz30:
pdcch_params->mux_pattern = NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE1;
pdcch_params->n_rb = (cset_idx < 10)? 24 : 48;
pdcch_params->n_symb = nr_coreset_nsymb_pdcch_type_0_b40Mhz[cset_idx];
pdcch_params->rb_offset = nr_coreset_rb_offset_pdcch_type_0_b40Mhz[cset_idx];
break;
default:
AssertFatal(1==0,"Invalid scs_common/pdcch_scs combination %d/%d \n", scs_common, pdcch_scs);
}
}
else {
AssertFatal(ss_idx<10 ,"Invalid scs_common/pdcch_scs combination %d/%d \n", scs_common, pdcch_scs);
switch(pdcch_scs) {
case kHz15:
break;
case kHz30:
pdcch_params->mux_pattern = NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE1;
pdcch_params->n_rb = (cset_idx < 4)? 24 : 48;
pdcch_params->n_symb = nr_coreset_nsymb_pdcch_type_0_b40Mhz[cset_idx];
pdcch_params->rb_offset = nr_coreset_rb_offset_pdcch_type_0_b40Mhz[cset_idx];
break;
default:
AssertFatal(1==0,"Invalid scs_common/pdcch_scs combination %d/%d \n", scs_common, pdcch_scs);
}
}
case kHz60:
mu = 2;
break;
case kHz120:
mu = 3;
break;
default:
AssertFatal(1==0,"Invalid common subcarrier spacing %d\n", scs_common);
}
/// Search space params
switch(pdcch_params->mux_pattern) {
case NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE1:
if (freq_range == nr_FR1) {
O = nr_ss_param_O_type_0_mux1_FR1[ss_idx];
pdcch_params->nb_ss_sets_per_slot = nr_ss_sets_per_slot_type_0_FR1[ss_idx];
M = nr_ss_param_M_type_0_mux1_FR1[ss_idx];
pdcch_params->first_symbol = (ss_idx < 8)? ( (ss_idx&1)? pdcch_params->n_symb : 0 ) : nr_ss_first_symb_idx_type_0_mux1_FR1[ss_idx - 8];
}
else {
AssertFatal(ss_idx<14 ,"Invalid search space index for multiplexing type 1 and FR2 %d\n", ss_idx);
O = nr_ss_param_O_type_0_mux1_FR2[ss_idx];
pdcch_params->nb_ss_sets_per_slot = nr_ss_sets_per_slot_type_0_FR2[ss_idx];
M = nr_ss_param_M_type_0_mux1_FR2[ss_idx];
pdcch_params->first_symbol = (ss_idx < 12)? ( (ss_idx&1)? 7 : 0 ) : 0;
}
pdcch_params->nb_slots = 2;
pdcch_params->sfn_mod2 = ((uint8_t)(floor( (O*pow(2, mu) + floor(ssb_idx*M)) / nb_slots_per_frame )) & 1)? 1 : 0;
pdcch_params->first_slot = (uint8_t)(O*pow(2, mu) + floor(ssb_idx*M)) % nb_slots_per_frame;
break;
case NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE2:
break;
case NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE3:
break;
default:
AssertFatal(1==0, "Invalid SSB and coreset multiplexing pattern %d\n", pdcch_params->mux_pattern);
}
pdcch_params->config_type = NFAPI_NR_CSET_CONFIG_MIB_SIB1;
pdcch_params->cr_mapping_type = NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED;
pdcch_params->precoder_granularity = NFAPI_NR_CSET_SAME_AS_REG_BUNDLE;
pdcch_params->reg_bundle_size = 6;
pdcch_params->interleaver_size = 2;
}
void nr_configure_css_dci_from_pdcch_config(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params,
nfapi_nr_coreset_t* coreset,
nfapi_nr_search_space_t* search_space) {
}
...@@ -59,4 +59,25 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -59,4 +59,25 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP); void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP);
void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
frame_t frameP,
sub_frame_t subframeP);
void nr_configure_css_dci_from_mib(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params,
nr_scs_e scs_common,
nr_scs_e pdcch_scs,
nr_frequency_range_e freq_range,
uint8_t rmsi_pdcch_config,
uint8_t ssb_idx,
uint16_t nb_slots_per_frame,
uint16_t N_RB);
void nr_configure_css_dci_from_pdcch_config(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params,
nfapi_nr_coreset_t* coreset,
nfapi_nr_search_space_t* search_space);
#endif /*__LAYER2_NR_MAC_PROTO_H__*/ #endif /*__LAYER2_NR_MAC_PROTO_H__*/
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