1. Refactor PDCCH PHY functions to take rxdataF of one OFDM symbol and produce LLR for each search space. The modified functions take rxdataF in a different format than that produced by nr_slot_fep(). So for now a memcpy is used to change the array structure. Once nr_slot_fep() is modified, this memcpy will no longer be needed and will be removed. 2. Modify DCI functions to decode DCI in the last PDCCH symbol and inidcate to MAC once. 3. Fix PDCCH monitoring for start symbol > 0. 4. Fix multiple PDCCH monitoring within slot. Co-authored-by: Sakthivel Velumani <mail@sakthi.me>
188 lines
7.0 KiB
C
188 lines
7.0 KiB
C
/*
|
|
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
* this work for additional information regarding copyright ownership.
|
|
* The OpenAirInterface Software Alliance licenses this file to You under
|
|
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
|
* except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.openairinterface.org/?page_id=698
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*-------------------------------------------------------------------------------
|
|
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
|
* contact@openairinterface.org
|
|
*/
|
|
|
|
/*
|
|
\brief NR UE PHY functions prototypes
|
|
\author R. Knopp, F. Kaltenberger
|
|
\company EURECOM
|
|
\email knopp@eurecom.fr
|
|
*/
|
|
|
|
#ifndef __openair_SCHED_H__
|
|
#define __openair_SCHED_H__
|
|
|
|
#include "PHY/defs_nr_UE.h"
|
|
|
|
|
|
/*enum THREAD_INDEX { OPENAIR_THREAD_INDEX = 0,
|
|
TOP_LEVEL_SCHEDULER_THREAD_INDEX,
|
|
DLC_SCHED_THREAD_INDEX,
|
|
openair_SCHED_NB_THREADS
|
|
};*/ // do not modify this line
|
|
|
|
|
|
#define OPENAIR_THREAD_PRIORITY 255
|
|
|
|
|
|
#define OPENAIR_THREAD_STACK_SIZE PTHREAD_STACK_MIN //4096 //RTL_PTHREAD_STACK_MIN*6
|
|
//#define DLC_THREAD_STACK_SIZE 4096 //DLC stack size
|
|
//#define UE_SLOT_PARALLELISATION
|
|
//#define UE_DLSCH_PARALLELISATION
|
|
|
|
/*enum openair_SCHED_STATUS {
|
|
openair_SCHED_STOPPED=1,
|
|
openair_SCHED_STARTING,
|
|
openair_SCHED_STARTED,
|
|
openair_SCHED_STOPPING
|
|
};*/
|
|
|
|
/*enum openair_ERROR {
|
|
// HARDWARE CAUSES
|
|
openair_ERROR_HARDWARE_CLOCK_STOPPED= 1,
|
|
|
|
// SCHEDULER CAUSE
|
|
openair_ERROR_OPENAIR_RUNNING_LATE,
|
|
openair_ERROR_OPENAIR_SCHEDULING_FAILED,
|
|
|
|
// OTHERS
|
|
openair_ERROR_OPENAIR_TIMING_OFFSET_OUT_OF_BOUNDS,
|
|
};*/
|
|
|
|
/*enum openair_SYNCH_STATUS {
|
|
openair_NOT_SYNCHED=1,
|
|
openair_SYNCHED,
|
|
openair_SCHED_EXIT
|
|
};*/
|
|
|
|
/*enum openair_HARQ_TYPE {
|
|
openair_harq_DL = 0,
|
|
openair_harq_UL,
|
|
openair_harq_RA
|
|
};*/
|
|
|
|
#define DAQ_AGC_ON 1
|
|
#define DAQ_AGC_OFF 0
|
|
|
|
/** @addtogroup _PHY_PROCEDURES_
|
|
* @{
|
|
*/
|
|
|
|
/*! \brief Scheduling for UE TX procedures in normal subframes.
|
|
@param ue Pointer to UE variables on which to act
|
|
@param proc Pointer to RXn-TXnp4 proc information
|
|
@param phy_data
|
|
*/
|
|
void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_data_tx_t *phy_data, c16_t **txp);
|
|
|
|
int pbch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_data_t *phy_data);
|
|
void pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_data_t *phy_data);
|
|
|
|
void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_data_t *phy_data);
|
|
|
|
void processSlotTX(void *arg);
|
|
|
|
int8_t nr_find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
|
|
|
|
/*! \brief UL time alignment procedures for TA application
|
|
@param ue
|
|
@param slot_tx
|
|
@param frame_tx
|
|
*/
|
|
void ue_ta_procedures(PHY_VARS_NR_UE *ue, int slot_tx, int frame_tx);
|
|
|
|
void set_tx_harq_id(NR_UE_ULSCH_t *ulsch, int harq_pid, int slot_tx);
|
|
int get_tx_harq_id(NR_UE_ULSCH_t *ulsch, int slot_tx);
|
|
|
|
int is_pbch_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL_FRAME_PARMS *fp);
|
|
int is_ssb_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL_FRAME_PARMS *fp);
|
|
bool is_csi_rs_in_symbol(fapi_nr_dl_config_csirs_pdu_rel15_t csirs_config_pdu, int symbol);
|
|
|
|
/*! \brief This function prepares the dl indication to pass to the MAC
|
|
*/
|
|
void nr_fill_dl_indication(nr_downlink_indication_t *dl_ind,
|
|
fapi_nr_dci_indication_t *dci_ind,
|
|
fapi_nr_rx_indication_t *rx_ind,
|
|
const UE_nr_rxtx_proc_t *proc,
|
|
PHY_VARS_NR_UE *ue,
|
|
void *phy_data);
|
|
|
|
/*@}*/
|
|
|
|
/*! \brief This function prepares the dl rx indication
|
|
*/
|
|
void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
|
|
uint8_t pdu_type,
|
|
PHY_VARS_NR_UE *ue,
|
|
NR_UE_DLSCH_t *dlsch0,
|
|
NR_UE_DLSCH_t *dlsch1,
|
|
uint16_t n_pdus,
|
|
const UE_nr_rxtx_proc_t *proc,
|
|
void *typeSpecific,
|
|
uint8_t *b);
|
|
|
|
void nr_pdcch_generate_llr(PHY_VARS_NR_UE *ue,
|
|
const UE_nr_rxtx_proc_t *proc,
|
|
int symbol,
|
|
nr_phy_data_t *phy_data,
|
|
int llr_size_symbol,
|
|
int num_monitoring_occ,
|
|
int max_symb,
|
|
c16_t rxdataF[ue->frame_parms.nb_antennas_rx][ue->frame_parms.ofdm_symbol_size],
|
|
c16_t pdcch_llr[phy_data->phy_pdcch_config.nb_search_space][num_monitoring_occ][max_symb * llr_size_symbol]);
|
|
|
|
void nr_pdcch_dci_indication(const UE_nr_rxtx_proc_t *proc,
|
|
int llr_size,
|
|
int max_monOcc,
|
|
PHY_VARS_NR_UE *ue,
|
|
nr_phy_data_t *phy_data,
|
|
c16_t llr[phy_data->phy_pdcch_config.nb_search_space][max_monOcc][llr_size]);
|
|
|
|
void nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue,
|
|
const UE_nr_rxtx_proc_t *proc,
|
|
const c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP],
|
|
const fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu);
|
|
|
|
void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue,
|
|
const UE_nr_rxtx_proc_t *proc,
|
|
const c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP],
|
|
fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu);
|
|
|
|
int psbch_pscch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_data_t *phy_data);
|
|
void phy_procedures_nrUE_SL_TX(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_data_tx_t *phy_data, c16_t **txp);
|
|
/*! \brief This function prepares the sl indication to pass to the MAC
|
|
*/
|
|
void nr_fill_sl_indication(nr_sidelink_indication_t *sl_ind,
|
|
sl_nr_rx_indication_t *rx_ind,
|
|
sl_nr_sci_indication_t *sci_ind,
|
|
const UE_nr_rxtx_proc_t *proc,
|
|
PHY_VARS_NR_UE *ue,
|
|
void *phy_data);
|
|
void nr_fill_sl_rx_indication(sl_nr_rx_indication_t *rx_ind,
|
|
uint8_t pdu_type,
|
|
PHY_VARS_NR_UE *ue,
|
|
uint16_t n_pdus,
|
|
const UE_nr_rxtx_proc_t *proc,
|
|
void *typeSpecific,
|
|
uint16_t rx_slss_id);
|
|
|
|
#endif
|
|
/** @}*/
|