Commit 0d6e8ea0 authored by Guido Casati's avatar Guido Casati Committed by Thomas Schlichter
Browse files

Interface MAC-PHY for RA: passing FAPI PRACH PDU params to PHY

parent 8ed99c28
......@@ -344,14 +344,6 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
fp->ssb_start_subcarrier = (12 * config->ssb_table.ssb_offset_point_a + sco);
// WIP temporary hardcoded
fp->prach_config_common.rootSequenceIndex = 22; // 0
fp->prach_config_common.prach_Config_enabled = 1;
fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig = 1; // 13
fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex = 0; // 98
fp->prach_config_common.prach_ConfigInfo.highSpeedFlag = 0;
fp->prach_config_common.prach_ConfigInfo.msg1_frequencystart = 0;
// definition of Lmax according to ts 38.213 section 4.1
if (fp->dl_CarrierFreq < 6e9) {
if(fp->frame_type && (fp->ssb_type==2))
......
......@@ -65,9 +65,9 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t subframe)
//uint8_t tdd_config = ue->frame_parms.tdd_config;
NR_DL_FRAME_PARMS *fp=&ue->frame_parms;
uint16_t rootSequenceIndex = fp->prach_config_common.rootSequenceIndex;
uint8_t prach_ConfigIndex = fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
uint8_t Ncs_config = fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig;
uint8_t restricted_set = fp->prach_config_common.prach_ConfigInfo.highSpeedFlag;
uint16_t prach_fmt = ue->prach_resources[gNB_id]->prach_format;
uint8_t preamble_index = ue->prach_resources[gNB_id]->ra_PreambleIndex;
//uint8_t tdd_mapindex = ue->prach_resources[gNB_id]->ra_TDD_map_index;
int16_t *prachF = ue->prach_vars[gNB_id]->prachF;
......@@ -82,7 +82,6 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t subframe)
uint16_t preamble_index0,n_shift_ra,n_shift_ra_bar;
uint16_t d_start,numshift;
uint16_t prach_fmt = get_nr_prach_fmt(prach_ConfigIndex,fp->frame_type,fp->freq_range);
//uint8_t Nsp=2;
//uint8_t f_ra,t1_ra;
uint16_t N_ZC = (prach_fmt<4)?839:139;
......@@ -224,9 +223,15 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t subframe)
#ifdef NR_PRACH_DEBUG
if (NCS>0)
LOG_I(PHY,"Generate PRACH for RootSeqIndex %d, Preamble Index %d, PRACH Format %x, prach_ConfigIndex %d, NCS %d (NCS_config %d, N_ZC/NCS %d): Preamble_offset %d, Preamble_shift %d\n",
rootSequenceIndex,preamble_index,prach_fmt,prach_ConfigIndex,NCS,Ncs_config,N_ZC/NCS,
preamble_offset,preamble_shift);
LOG_I(PHY,"Generate PRACH for RootSeqIndex %d, Preamble Index %d, PRACH Format %x, NCS %d (NCS_config %d, N_ZC/NCS %d): Preamble_offset %d, Preamble_shift %d\n",
rootSequenceIndex,
preamble_index,
prach_fmt,
NCS,
Ncs_config,
N_ZC/NCS,
preamble_offset,
preamble_shift);
#endif
......
......@@ -54,8 +54,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
NR_UE_PDCCH *pdcch_vars = PHY_vars_UE_g[module_id][cc_id]->pdcch_vars[thread_id][0];
NR_UE_DLSCH_t *dlsch0 = PHY_vars_UE_g[module_id][cc_id]->dlsch[thread_id][0][0];
NR_UE_ULSCH_t *ulsch0 = PHY_vars_UE_g[module_id][cc_id]->ulsch[thread_id][0][0];
//NR_DL_FRAME_PARMS frame_parms = PHY_vars_UE_g[module_id][cc_id]->frame_parms;
//NR_PRACH_RESOURCES_t *prach_resources = PHY_vars_UE_g[module_id][cc_id]->prach_resources[0];
if(scheduled_response->dl_config != NULL){
fapi_nr_dl_config_request_t *dl_config = scheduled_response->dl_config;
......@@ -112,10 +110,16 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
for (i = 0; i < ul_config->number_pdus; ++i){
uint8_t pdu_type = ul_config->ul_config_list[i].pdu_type, pucch_resource_id, current_harq_pid, format;
uint8_t pdu_type = ul_config->ul_config_list[i].pdu_type, pucch_resource_id, current_harq_pid, format, gNB_id = 0;
/* PRACH */
NR_DL_FRAME_PARMS *fp;
NR_PRACH_RESOURCES_t *prach_resources;
NR_PRACH_CONFIG_COMMON *prach_config_common;
fapi_nr_ul_config_prach_pdu *prach_config_pdu;
/* PUSCH */
fapi_nr_ul_config_pusch_pdu_rel15_t *pusch_config_pdu;
/* PUCCH */
fapi_nr_ul_config_pucch_pdu *pucch_config_pdu;
fapi_nr_ul_config_prach_pdu *prach_config_pdu;
PUCCH_ConfigCommon_nr_t *pucch_config_common_nr;
PUCCH_Config_t *pucch_config_dedicated_nr;
PUCCH_format_t *format_params;
......@@ -183,13 +187,19 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
case (FAPI_NR_UL_CONFIG_TYPE_PRACH):
// prach config pdu
fp = &PHY_vars_UE_g[module_id][cc_id]->frame_parms;
prach_resources = &PHY_vars_UE_g[module_id][cc_id]->prach_resources[gNB_id];
prach_config_common = &fp->prach_config_common;
prach_config_pdu = &ul_config->ul_config_list[i].prach_config_pdu;
/*frame_parms.prach_config_common.rootSequenceIndex = prach_config_pdu->root_sequence_index;
frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex = prach_config_pdu->prach_configuration_index;
frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig = prach_config_pdu->zero_correlation_zone_config;
frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag = prach_config_pdu->restrictedset_config;
frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset = prach_config_pdu->prach_freq_offset;*/
////prach_resources->ra_PreambleIndex = prach_config_pdu->preamble_index;
prach_config_common->prach_Config_enabled = 1;
prach_config_common->rootSequenceIndex = prach_config_pdu->root_seq_id;
prach_config_common->prach_ConfigInfo.zeroCorrelationZoneConfig = prach_config_pdu->num_cs;
prach_config_common->prach_ConfigInfo.highSpeedFlag = prach_config_pdu->restricted_set;
prach_config_common->prach_ConfigInfo.msg1_frequencystart = prach_config_pdu->freq_msg1;
prach_resources->prach_format = prach_config_pdu->prach_format;
break;
default:
......
......@@ -2273,11 +2273,7 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
/* RACH */
if ((ue->UE_mode[gNB_id] == PRACH) && (ue->frame_parms.prach_config_common.prach_Config_enabled == 1)) {
// check if we have PRACH opportunity
if (is_nr_prach_subframe(&ue->frame_parms, frame_tx, slot_tx)) {
nr_ue_prach_procedures(ue, proc, gNB_id, mode);
}
}
else {
ue->generate_nr_prach = 0;
......
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