remove L1 nr_band dependence in frame parameters
This commit is contained in:
@@ -110,6 +110,12 @@ int nrue_get_cell_count(void)
|
|||||||
return nrue_cell_count;
|
return nrue_cell_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int nrue_get_band(const PHY_VARS_NR_UE *UE)
|
||||||
|
{
|
||||||
|
int cell_id = nrue_rus[UE->rf_map.card].used_by_cell;
|
||||||
|
return nrue_cells[cell_id].band;
|
||||||
|
}
|
||||||
|
|
||||||
const nrUE_cell_params_t *nrue_get_cell(int cell_id)
|
const nrUE_cell_params_t *nrue_get_cell(int cell_id)
|
||||||
{
|
{
|
||||||
AssertFatal(cell_id >= 0 && cell_id < nrue_cell_count, "Invalid cell ID %d! Cell count = %d\n", cell_id, nrue_cell_count);
|
AssertFatal(cell_id >= 0 && cell_id < nrue_cell_count, "Invalid cell ID %d! Cell count = %d\n", cell_id, nrue_cell_count);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ const nrUE_cell_params_t *nrue_get_cell(int cell_id);
|
|||||||
NR_DL_FRAME_PARMS *nrue_get_cell_fp(int cell_id);
|
NR_DL_FRAME_PARMS *nrue_get_cell_fp(int cell_id);
|
||||||
void nrue_set_cell(int cell_id, const nrUE_cell_params_t *cell);
|
void nrue_set_cell(int cell_id, const nrUE_cell_params_t *cell);
|
||||||
void nrue_set_cell_params(configmodule_interface_t *cfg);
|
void nrue_set_cell_params(configmodule_interface_t *cfg);
|
||||||
|
int nrue_get_band(const PHY_VARS_NR_UE *UE);
|
||||||
int nrue_get_ru_count(void);
|
int nrue_get_ru_count(void);
|
||||||
const nrUE_RU_params_t *nrue_get_ru(int ru_id);
|
const nrUE_RU_params_t *nrue_get_ru(int ru_id);
|
||||||
void nrue_set_ru_cell_id(int ru_id, int cell_id);
|
void nrue_set_ru_cell_id(int ru_id, int cell_id);
|
||||||
|
|||||||
+1
-1
@@ -837,7 +837,7 @@ void *UE_thread(void *arg)
|
|||||||
// Get list of GSCN in this band for UE's bandwidth and center frequency.
|
// Get list of GSCN in this band for UE's bandwidth and center frequency.
|
||||||
LOG_W(PHY, "UE set to scan all GSCN in current bandwidth\n");
|
LOG_W(PHY, "UE set to scan all GSCN in current bandwidth\n");
|
||||||
syncMsg->numGscn =
|
syncMsg->numGscn =
|
||||||
get_scan_ssb_first_sc(fp->dl_CarrierFreq, fp->N_RB_DL, fp->nr_band, fp->numerology_index, syncMsg->gscnInfo);
|
get_scan_ssb_first_sc(fp->dl_CarrierFreq, fp->N_RB_DL, nrue_get_band(UE), fp->numerology_index, syncMsg->gscnInfo);
|
||||||
} else {
|
} else {
|
||||||
LOG_W(PHY, "SSB position provided\n");
|
LOG_W(PHY, "SSB position provided\n");
|
||||||
syncMsg->gscnInfo[0] = (nr_gscn_info_t){.ssbFirstSC = fp->ssb_start_subcarrier};
|
syncMsg->gscnInfo[0] = (nr_gscn_info_t){.ssbFirstSC = fp->ssb_start_subcarrier};
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ int main(int argc, char **argv)
|
|||||||
fapi_nr_config_request_t *nrUE_config = &UE_CC->nrUE_config;
|
fapi_nr_config_request_t *nrUE_config = &UE_CC->nrUE_config;
|
||||||
nr_init_frame_parms_ue(fp, nrUE_config, mac->nr_band);
|
nr_init_frame_parms_ue(fp, nrUE_config, mac->nr_band);
|
||||||
|
|
||||||
cell.band = fp->nr_band;
|
cell.band = mac->nr_band;
|
||||||
cell.rf_frequency = fp->dl_CarrierFreq;
|
cell.rf_frequency = fp->dl_CarrierFreq;
|
||||||
cell.rf_freq_offset = fp->ul_CarrierFreq - fp->dl_CarrierFreq;
|
cell.rf_freq_offset = fp->ul_CarrierFreq - fp->dl_CarrierFreq;
|
||||||
cell.numerology = fp->numerology_index;
|
cell.numerology = fp->numerology_index;
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ typedef struct
|
|||||||
//Indicates presence of +/-5Khz shift wrt FREF for V2X reference frequencies.
|
//Indicates presence of +/-5Khz shift wrt FREF for V2X reference frequencies.
|
||||||
//Possible values: {-1,0,1}
|
//Possible values: {-1,0,1}
|
||||||
int8_t sl_value_N;
|
int8_t sl_value_N;
|
||||||
|
uint32_t band;
|
||||||
} sl_nr_carrier_config_t;
|
} sl_nr_carrier_config_t;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -313,31 +313,32 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
|
|||||||
gNB_config->carrier_config.num_tx_ant.value = fp->nb_antennas_tx;
|
gNB_config->carrier_config.num_tx_ant.value = fp->nb_antennas_tx;
|
||||||
gNB_config->carrier_config.num_rx_ant.value = fp->nb_antennas_rx;
|
gNB_config->carrier_config.num_rx_ant.value = fp->nb_antennas_rx;
|
||||||
|
|
||||||
|
int nr_band = 78;
|
||||||
switch (mu) {
|
switch (mu) {
|
||||||
case 0:
|
case 0:
|
||||||
gNB->gNB_config.tdd_table.tdd_period.value = 7;
|
gNB->gNB_config.tdd_table.tdd_period.value = 7;
|
||||||
fp->dl_CarrierFreq = 2600000000;
|
fp->dl_CarrierFreq = 2600000000;
|
||||||
fp->ul_CarrierFreq = 2600000000;
|
fp->ul_CarrierFreq = 2600000000;
|
||||||
fp->nr_band = 38;
|
nr_band = 38;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
gNB->gNB_config.tdd_table.tdd_period.value = 6;
|
gNB->gNB_config.tdd_table.tdd_period.value = 6;
|
||||||
fp->dl_CarrierFreq = 3600000000;
|
fp->dl_CarrierFreq = 3600000000;
|
||||||
fp->ul_CarrierFreq = 3600000000;
|
fp->ul_CarrierFreq = 3600000000;
|
||||||
fp->nr_band = 78;
|
nr_band = 78;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
gNB->gNB_config.tdd_table.tdd_period.value = 3;
|
gNB->gNB_config.tdd_table.tdd_period.value = 3;
|
||||||
fp->dl_CarrierFreq = 27524520000;
|
fp->dl_CarrierFreq = 27524520000;
|
||||||
fp->ul_CarrierFreq = 27524520000;
|
fp->ul_CarrierFreq = 27524520000;
|
||||||
fp->nr_band = 261;
|
nr_band = 261;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printf("unsupported numerology %d\n", mu);
|
printf("unsupported numerology %d\n", mu);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
frequency_range_t frequency_range = get_freq_range_from_band(fp->nr_band);
|
frequency_range_t frequency_range = get_freq_range_from_band(nr_band);
|
||||||
int bw_index = get_supported_band_index(mu, frequency_range, N_RB_DL);
|
int bw_index = get_supported_band_index(mu, frequency_range, N_RB_DL);
|
||||||
gNB_config->carrier_config.dl_bandwidth.value = get_supported_bw_mhz(frequency_range, bw_index);
|
gNB_config->carrier_config.dl_bandwidth.value = get_supported_bw_mhz(frequency_range, bw_index);
|
||||||
|
|
||||||
|
|||||||
@@ -364,7 +364,6 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp, fapi_nr_config_request_t* conf
|
|||||||
fp->nb_antenna_ports_gNB = nb_ant_ports_gNB;
|
fp->nb_antenna_ports_gNB = nb_ant_ports_gNB;
|
||||||
fp->tdd_config = tdd_cfg;
|
fp->tdd_config = tdd_cfg;
|
||||||
fp->Nid_cell = Nid_cell;
|
fp->Nid_cell = Nid_cell;
|
||||||
fp->nr_band = nr_band;
|
|
||||||
|
|
||||||
LOG_I(PHY, "Initializing frame parms: set nb_antenna_ports_gNB %d, tdd_config, %d, Nid_cell %d\n", fp->nb_antenna_ports_gNB, fp->tdd_config, fp->Nid_cell);
|
LOG_I(PHY, "Initializing frame parms: set nb_antenna_ports_gNB %d, tdd_config, %d, Nid_cell %d\n", fp->nb_antenna_ports_gNB, fp->tdd_config, fp->Nid_cell);
|
||||||
|
|
||||||
@@ -382,13 +381,21 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp, fapi_nr_config_request_t* conf
|
|||||||
fp->N_RB_DL = config->carrier_config.dl_grid_size[fp->numerology_index];
|
fp->N_RB_DL = config->carrier_config.dl_grid_size[fp->numerology_index];
|
||||||
fp->N_RB_SL = config->carrier_config.sl_grid_size[fp->numerology_index];
|
fp->N_RB_SL = config->carrier_config.sl_grid_size[fp->numerology_index];
|
||||||
|
|
||||||
fp->frame_type = get_frame_type(fp->nr_band, fp->numerology_index);
|
fp->frame_type = get_frame_type(nr_band, fp->numerology_index);
|
||||||
int64_t uplink_frequency_offset = fp->ul_CarrierFreq - fp->dl_CarrierFreq;
|
int64_t uplink_frequency_offset = fp->ul_CarrierFreq - fp->dl_CarrierFreq;
|
||||||
uplink_frequency_offset *= 1000;
|
uplink_frequency_offset *= 1000;
|
||||||
|
|
||||||
LOG_I(PHY, "Initializing frame parms: DL frequency %lu Hz, UL frequency %lu Hz: band %d, uldl offset %ld Hz\n", fp->dl_CarrierFreq, fp->ul_CarrierFreq, fp->nr_band, uplink_frequency_offset);
|
LOG_I(PHY,
|
||||||
|
"Initializing frame parms: DL frequency %lu Hz, UL frequency %lu Hz: band %d, uldl offset %ld Hz\n",
|
||||||
|
fp->dl_CarrierFreq,
|
||||||
|
fp->ul_CarrierFreq,
|
||||||
|
nr_band,
|
||||||
|
uplink_frequency_offset);
|
||||||
|
|
||||||
AssertFatal(fp->frame_type==config->cell_config.frame_duplex_type, "Invalid duplex type (frame_type %d,cell_config.frame_duplex_type %d) in config request file for band %d\n", fp->frame_type,config->cell_config.frame_duplex_type,fp->nr_band);
|
AssertFatal(fp->frame_type == config->cell_config.frame_duplex_type,
|
||||||
|
"Invalid duplex type (frame_type %d,cell_config.frame_duplex_type %d) in config request file for band %d\n",
|
||||||
|
fp->frame_type,config->cell_config.frame_duplex_type,
|
||||||
|
nr_band);
|
||||||
|
|
||||||
LOG_I(PHY,"Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",fp->numerology_index, fp->N_RB_DL, Ncp);
|
LOG_I(PHY,"Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",fp->numerology_index, fp->N_RB_DL, Ncp);
|
||||||
|
|
||||||
@@ -459,8 +466,7 @@ void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, const nrUE_cell_p
|
|||||||
frame_parms->N_RB_DL = N_RB_DL;
|
frame_parms->N_RB_DL = N_RB_DL;
|
||||||
frame_parms->N_RB_UL = frame_parms->N_RB_DL;
|
frame_parms->N_RB_UL = frame_parms->N_RB_DL;
|
||||||
|
|
||||||
frame_parms->nr_band = nr_band;
|
frame_parms->frame_type = get_frame_type(nr_band, frame_parms->numerology_index);
|
||||||
frame_parms->frame_type = get_frame_type(frame_parms->nr_band, frame_parms->numerology_index);
|
|
||||||
|
|
||||||
frame_parms->Ncp = NORMAL;
|
frame_parms->Ncp = NORMAL;
|
||||||
set_scs_parameters(frame_parms, frame_parms->numerology_index, frame_parms->N_RB_DL, set_ssb_case(mu, nr_band));
|
set_scs_parameters(frame_parms, frame_parms->numerology_index, frame_parms->N_RB_DL, set_ssb_case(mu, nr_band));
|
||||||
@@ -506,7 +512,6 @@ void nr_dump_frame_parms(NR_DL_FRAME_PARMS *fp)
|
|||||||
LOG_I(PHY, "fp->Ncp=%d\n", fp->Ncp);
|
LOG_I(PHY, "fp->Ncp=%d\n", fp->Ncp);
|
||||||
LOG_I(PHY, "fp->N_RB_DL=%d\n", fp->N_RB_DL);
|
LOG_I(PHY, "fp->N_RB_DL=%d\n", fp->N_RB_DL);
|
||||||
LOG_I(PHY, "fp->numerology_index=%d\n", fp->numerology_index);
|
LOG_I(PHY, "fp->numerology_index=%d\n", fp->numerology_index);
|
||||||
LOG_I(PHY, "fp->nr_band=%d\n", fp->nr_band);
|
|
||||||
LOG_I(PHY, "fp->ofdm_offset_divisor=%d\n", fp->ofdm_offset_divisor);
|
LOG_I(PHY, "fp->ofdm_offset_divisor=%d\n", fp->ofdm_offset_divisor);
|
||||||
LOG_I(PHY, "fp->threequarter_fs=%d\n", fp->threequarter_fs);
|
LOG_I(PHY, "fp->threequarter_fs=%d\n", fp->threequarter_fs);
|
||||||
LOG_I(PHY, "fp->sl_CarrierFreq=%lu\n", fp->sl_CarrierFreq);
|
LOG_I(PHY, "fp->sl_CarrierFreq=%lu\n", fp->sl_CarrierFreq);
|
||||||
@@ -522,8 +527,6 @@ int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp,
|
|||||||
fp->ofdm_offset_divisor = ofdm_offset_divisor;
|
fp->ofdm_offset_divisor = ofdm_offset_divisor;
|
||||||
fp->threequarter_fs = threequarter_fs;
|
fp->threequarter_fs = threequarter_fs;
|
||||||
|
|
||||||
fp->nr_band = get_band(config->sl_carrier_config.sl_frequency, 0, 0, 0);
|
|
||||||
|
|
||||||
fp->att_rx = 0;
|
fp->att_rx = 0;
|
||||||
fp->att_tx = 0;
|
fp->att_tx = 0;
|
||||||
fp->nb_antennas_rx = config->sl_carrier_config.sl_num_rx_ant;
|
fp->nb_antennas_rx = config->sl_carrier_config.sl_num_rx_ant;
|
||||||
@@ -535,7 +538,7 @@ int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp,
|
|||||||
fp->N_RB_UL = fp->N_RB_SL;
|
fp->N_RB_UL = fp->N_RB_SL;
|
||||||
fp->Ncp = config->sl_bwp_config.sl_cyclic_prefix;
|
fp->Ncp = config->sl_bwp_config.sl_cyclic_prefix;
|
||||||
|
|
||||||
fp->frame_type = get_frame_type(fp->nr_band, fp->numerology_index);
|
fp->frame_type = get_frame_type(config->sl_carrier_config.band, fp->numerology_index);
|
||||||
|
|
||||||
uint64_t bw_khz = (12 * config->sl_carrier_config.sl_grid_size) * (15 << config->sl_bwp_config.sl_scs);
|
uint64_t bw_khz = (12 * config->sl_carrier_config.sl_grid_size) * (15 << config->sl_bwp_config.sl_scs);
|
||||||
// REfer to section 3GPP spec 38.101 5.4E.2.1
|
// REfer to section 3GPP spec 38.101 5.4E.2.1
|
||||||
@@ -555,7 +558,7 @@ int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp,
|
|||||||
fp->dl_CarrierFreq,
|
fp->dl_CarrierFreq,
|
||||||
fp->ul_CarrierFreq,
|
fp->ul_CarrierFreq,
|
||||||
fp->sl_CarrierFreq,
|
fp->sl_CarrierFreq,
|
||||||
fp->nr_band);
|
config->sl_carrier_config.band);
|
||||||
|
|
||||||
AssertFatal(fp->frame_type == TDD, "Sidelink bands only support TDD");
|
AssertFatal(fp->frame_type == TDD, "Sidelink bands only support TDD");
|
||||||
|
|
||||||
|
|||||||
@@ -126,9 +126,9 @@ static void sl_prepare_phy_config(int module_id,
|
|||||||
|
|
||||||
AssertFatal(SSB_ARFCN, "sl_AbsoluteFrequencySSB cannot be 0\n");
|
AssertFatal(SSB_ARFCN, "sl_AbsoluteFrequencySSB cannot be 0\n");
|
||||||
|
|
||||||
LOG_I(NR_MAC, "SIDELINK CONFIGs: AbsFreqSSB:%d, AbsFreqPointA:%d, SL band:%d\n",
|
LOG_I(NR_MAC, "SIDELINK CONFIGs: AbsFreqSSB:%d, AbsFreqPointA:%d, SL band:%d\n", SSB_ARFCN, pointA_ARFCN, sl_band);
|
||||||
SSB_ARFCN,pointA_ARFCN, sl_band);
|
|
||||||
|
|
||||||
|
phycfg->sl_carrier_config.band = sl_band;
|
||||||
//FREQSHIFT_7P5KHZ is DISABLED
|
//FREQSHIFT_7P5KHZ is DISABLED
|
||||||
phycfg->sl_carrier_config.sl_frequency_shift_7p5khz = 0;
|
phycfg->sl_carrier_config.sl_frequency_shift_7p5khz = 0;
|
||||||
phycfg->sl_carrier_config.sl_value_N = freqcfg->valueN_r16;
|
phycfg->sl_carrier_config.sl_value_N = freqcfg->valueN_r16;
|
||||||
@@ -141,8 +141,7 @@ static void sl_prepare_phy_config(int module_id,
|
|||||||
int bw_index = get_supported_band_index(carriercfg->subcarrierSpacing, FR1, carriercfg->carrierBandwidth);
|
int bw_index = get_supported_band_index(carriercfg->subcarrierSpacing, FR1, carriercfg->carrierBandwidth);
|
||||||
phycfg->sl_carrier_config.sl_bandwidth = get_supported_bw_mhz(FR1, bw_index);
|
phycfg->sl_carrier_config.sl_bandwidth = get_supported_bw_mhz(FR1, bw_index);
|
||||||
|
|
||||||
phycfg->sl_carrier_config.sl_frequency =
|
phycfg->sl_carrier_config.sl_frequency = from_nrarfcn(sl_band, carriercfg->subcarrierSpacing, pointA_ARFCN); // freq in kHz
|
||||||
from_nrarfcn(sl_band,carriercfg->subcarrierSpacing,pointA_ARFCN); // freq in kHz
|
|
||||||
|
|
||||||
phycfg->sl_carrier_config.sl_grid_size = carriercfg->carrierBandwidth;
|
phycfg->sl_carrier_config.sl_grid_size = carriercfg->carrierBandwidth;
|
||||||
//For sidelink offset to carrier is 0. hence not used
|
//For sidelink offset to carrier is 0. hence not used
|
||||||
|
|||||||
Reference in New Issue
Block a user