Commit 7fb14ab3 authored by Florian Kaltenberger's avatar Florian Kaltenberger

adding MAC part of 5G FAPI interface for PUSCH. Since the previous version was...

adding MAC part of 5G FAPI interface for PUSCH. Since the previous version was incomplete anyway I merged in the new SCF specs and used those (only for PUSCH). Todo: implement PHY part.
parent fa040160
......@@ -17,6 +17,12 @@
#define NFAPI_NR_MAX_NB_CORESETS 12
#define NFAPI_NR_MAX_NB_SEARCH_SPACES 40
#define NFAPI_MAX_NUM_UL_UE_PER_GROUP 6
#define NFAPI_MAX_NUM_UL_PDU 8
#define NFAPI_MAX_NUM_GROUPS 8
#define NFAPI_MAX_NUM_CB 8
/*
// Extension to the generic structures for single tlv values
typedef struct {
nfapi_tl_t tl;
......@@ -27,6 +33,7 @@ typedef struct {
nfapi_tl_t tl;
uint32_t value;
} nfapi_uint32_tlv_t;
*/
// 2019.8
// SCF222_5G-FAPI_PHY_SPI_Specificayion.pdf Section 3.2
......@@ -259,7 +266,7 @@ typedef struct {
typedef struct {
uint8_t number_of_tlvs;
nfapi_nr_config_tlv_t tlv;
} nfapi_nr_config_request_t;
} nfapi_nr_config_request_scf_t;
typedef enum {
NFAPI_NR_CONFIG_MSG_OK = 0,
......@@ -830,8 +837,7 @@ typedef struct
uint8_t new_data_indicator;
uint32_t tb_size;
uint16_t num_cb;
// fixme:
uint8_t *cb_present_and_position;//uint8_t cb_present_and_position[ceil (num_cb / 8)]
uint8_t cb_present_and_position[(NFAPI_MAX_NUM_CB+7) / 8];
} nfapi_nr_pusch_data_t;
//for nfapi_nr_pusch_uci_t
......@@ -875,9 +881,14 @@ typedef struct
} nfapi_nr_dfts_ofdm_t;
#define PUSCH_PDU_BITMAP_PUSCH_DATA 0x1
#define PUSCH_PDU_BITMAP_PUSCH_UCI 0x2
#define PUSCH_PDU_BITMAP_PUSCH_PTRS 0x4
#define PUSCH_PDU_BITMAP_DFTS_OFDM 0x8
typedef struct
{
uint16_t pdu_bit_map;//
uint16_t pdu_bit_map;//Bitmap indicating presence of optional PDUs (see above)
uint16_t rnti;
uint32_t handle;//An opaque handling returned in the RxData.indication and/or UCI.indication message
//BWP
......@@ -892,6 +903,7 @@ typedef struct
uint8_t mcs_table;
uint8_t transform_precoding;
uint16_t data_scrambling_id;
uint8_t nrOfLayers;
//DMRS
uint8_t ul_dmrs_symb_pos;
uint8_t dmrs_config_type;
......@@ -1002,19 +1014,25 @@ typedef struct
} nfapi_nr_srs_pdu_t;
//
typedef struct
{
nfapi_nr_prach_pdu_t* prach_pdu;
nfapi_nr_pusch_pdu_t* pusch_pdu;
nfapi_nr_pucch_pdu_t* pucch_pdu;
nfapi_nr_srs_pdu_t* srs_pdu;
} nfapi_nr_ul_pdu_configuration_t;
typedef enum {
NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE=0,
NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE,
NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE,
NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE,
} nfapi_nr_ul_config_pdu_type_e;
typedef struct
{
uint16_t pdu_type;//0: PRACH PDU, 1: PUSCH PDU, 2: PUCCH PDU, 3: SRS PDU
uint16_t pdu_size;//Value: 0 -> 65535
nfapi_nr_ul_pdu_configuration_t* ul_pdu_configuration;
union
{
nfapi_nr_prach_pdu_t prach_pdu;
nfapi_nr_pusch_pdu_t pusch_pdu;
nfapi_nr_pucch_pdu_t pucch_pdu;
nfapi_nr_srs_pdu_t srs_pdu;
};
} nfapi_nr_ul_tti_request_number_of_pdus_t;
......@@ -1027,7 +1045,7 @@ typedef struct
typedef struct
{
uint8_t n_ue;//Number of UE in this group For SU-MIMO, one group includes one UE only. For MU-MIMO, one group includes up to 12 UEs. Value 1 -> 6
nfapi_nr_ul_tti_request_number_of_ue_t* ue_list;
nfapi_nr_ul_tti_request_number_of_ue_t ue_list[NFAPI_MAX_NUM_UL_UE_PER_GROUP];
} nfapi_nr_ul_tti_request_number_of_groups_t;
......@@ -1039,8 +1057,8 @@ typedef struct {
uint8_t n_ulsch;//Number of ULSCH PDUs that are included in this message.
uint8_t n_ulcch;//Number of ULCCH PDUs
uint8_t n_group;//Number of UE Groups included in this message. Value 0 -> 8
nfapi_nr_ul_tti_request_number_of_pdus_t* pdus_list;
nfapi_nr_ul_tti_request_number_of_groups_t* groups_list;
nfapi_nr_ul_tti_request_number_of_pdus_t pdus_list[NFAPI_MAX_NUM_UL_PDU];
nfapi_nr_ul_tti_request_number_of_groups_t groups_list[NFAPI_MAX_NUM_GROUPS];
} nfapi_nr_ul_tti_request_t;
......
......@@ -986,7 +986,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
first_symbol_flag = 1;
}
if (symbol == 2){ // [hna] here it is assumed that symbol 2 carries 6 DMRS REs (dmrs-type 1)
if (symbol == rel15_ul->start_symbol){ // [hna] here it is assumed that first carries 6 DMRS REs (dmrs-type 1)
nb_re_pusch = rel15_ul->number_rbs * 6;
pilots = 1;
} else {
......
......@@ -76,7 +76,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
sub_frame_t slotP){
nfapi_nr_dl_config_request_t *DL_req = &gNB->DL_req[0];
nfapi_ul_config_request_t *UL_req = &gNB->UL_req[0];
nfapi_nr_ul_tti_request_t *UL_tti_req = &gNB->UL_tti_req[0];
nfapi_hi_dci0_request_t * HI_DCI0_req = &gNB->HI_DCI0_req[0];
nfapi_tx_request_t *TX_req = &gNB->TX_req[0];
......@@ -93,9 +93,10 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
HI_DCI0_req[CC_idP].hi_dci0_request_body.number_of_dci = 0;
UL_req[CC_idP].ul_config_request_body.number_of_pdus = 0;
UL_req[CC_idP].ul_config_request_body.rach_prach_frequency_resources = 0; // ignored, handled by PHY for now
UL_req[CC_idP].ul_config_request_body.srs_present = 0; // ignored, handled by PHY for now
UL_tti_req[CC_idP].n_pdus = 0;
UL_tti_req[CC_idP].n_ulsch = 0;
UL_tti_req[CC_idP].n_ulcch = 0;
UL_tti_req[CC_idP].n_group = 0;
TX_req[CC_idP].tx_request_body.number_of_pdus = 0;
......@@ -261,6 +262,8 @@ void schedule_nr_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subfram
}
}
*/
/*
void copy_nr_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
{
int CC_id;
......@@ -289,6 +292,7 @@ void copy_nr_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
ul_req->ul_config_request_body.number_of_pdus*sizeof(nfapi_ul_config_request_pdu_t));
}
}
*/
void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
frame_t frameP,
......@@ -401,6 +405,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
}
}
/*
for(int j = 0; j < 10; j++){
nfapi_ul_config_request_body_t *ul_req_tmp = NULL;
ul_req_tmp = &RC.nrmac[module_idP]->UL_req_tmp[CC_id][j].ul_config_request_body;
......@@ -418,6 +423,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
}
}
rrc_mac_remove_ue(module_idP,rnti);
*/
}
} //END if (RC.nrmac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer > 0)
} //END if (UE_list->active[i])
......
......@@ -105,10 +105,12 @@ void mac_top_init_gNB(void)
for (j = 0; j < MAX_NUM_CCs; j++) {
RC.nrmac[i]->DL_req[j].dl_config_request_body.dl_config_pdu_list = RC.nrmac[i]->dl_config_pdu_list[j];
RC.nrmac[i]->UL_req[j].ul_config_request_body.ul_config_pdu_list = RC.nrmac[i]->ul_config_pdu_list[j];
for (int k = 0; k < 10; k++)
RC.nrmac[i]->UL_req_tmp[j][k].ul_config_request_body.ul_config_pdu_list =RC.nrmac[i]->ul_config_pdu_list_tmp[j][k];
//FK changed UL_req to UL_tti_req, which does not contain a pointer to the pdu_list
//RC.nrmac[i]->UL_req[j].ul_config_request_body.ul_config_pdu_list = RC.nrmac[i]->ul_config_pdu_list[j];
//for (int k = 0; k < 10; k++)
// RC.nrmac[i]->UL_req_tmp[j][k].ul_config_request_body.ul_config_pdu_list =RC.nrmac[i]->ul_config_pdu_list_tmp[j][k];
RC.nrmac[i]->HI_DCI0_req[j].hi_dci0_request_body.hi_dci0_pdu_list = RC.nrmac[i]->hi_dci0_pdu_list[j];
RC.nrmac[i]->TX_req[j].tx_request_body.tx_pdu_list = RC.nrmac[i]->tx_request_pdu[j];
......
......@@ -48,6 +48,7 @@
#include "NR_MeasConfig.h"
#include "nfapi_nr_interface.h"
#include "nfapi_nr_interface_scf.h"
#include "NR_PHY_INTERFACE/NR_IF_Module.h"
#include "COMMON/platform_constants.h"
......@@ -118,16 +119,10 @@ typedef struct gNB_MAC_INST_s {
nfapi_nr_config_request_t config[NFAPI_CC_MAX];
/// NFAPI DL Config Request Structure
nfapi_nr_dl_config_request_t DL_req[NFAPI_CC_MAX];
/// NFAPI UL Config Request Structure, send to L1 4 subframes before processing takes place
nfapi_ul_config_request_t UL_req[NFAPI_CC_MAX];
/// NFAPI UL TTI Request Structure (this is from the new SCF specs)
nfapi_nr_ul_tti_request_t UL_tti_req[NFAPI_CC_MAX];
/// Preallocated DL pdu list
nfapi_nr_dl_config_request_pdu_t dl_config_pdu_list[NFAPI_CC_MAX][MAX_NUM_DL_PDU];
/// Preallocated UL pdu list
nfapi_ul_config_request_pdu_t ul_config_pdu_list[NFAPI_CC_MAX][MAX_NUM_UL_PDU];
/// Preallocated UL pdu list for ULSCH (n+k delay)
nfapi_ul_config_request_pdu_t ul_config_pdu_list_tmp[NFAPI_CC_MAX][10][MAX_NUM_UL_PDU];
/// NFAPI "Temporary" UL Config Request Structure, holds future UL_config requests
nfapi_ul_config_request_t UL_req_tmp[NFAPI_CC_MAX][10];
/// Preallocated HI_DCI0 pdu list
nfapi_hi_dci0_request_pdu_t hi_dci0_pdu_list[NFAPI_CC_MAX][MAX_NUM_HI_DCI0_PDU];
/// NFAPI HI/DCI0 Config Request Structure
......
......@@ -325,9 +325,9 @@ void NR_UL_indication(NR_UL_IND_t *UL_info)
sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id];
if ((mac->common_channels[CC_id].tdd_Config==NULL) ||
(is_nr_UL_slot(&mac->common_channels[CC_id],(sched_info->slot+sf_ahead)%spf)>0))
sched_info->UL_req = &mac->UL_req[CC_id];
sched_info->UL_tti_req = &mac->UL_tti_req[CC_id];
else
sched_info->UL_req = NULL;
sched_info->UL_tti_req = NULL;
sched_info->TX_req = &mac->TX_req[CC_id];
......
......@@ -35,6 +35,7 @@
#include <stdint.h>
#include "nfapi_nr_interface.h"
#include "nfapi_nr_interface_scf.h"
#include "platform_constants.h"
#include "platform_types.h"
......@@ -103,7 +104,7 @@ typedef struct{
/// nFAPI DL Config Request
nfapi_nr_dl_config_request_t *DL_req;
/// nFAPI UL Config Request
nfapi_ul_config_request_t *UL_req;
nfapi_nr_ul_tti_request_t *UL_tti_req;
/// nFAPI HI_DCI Request
nfapi_hi_dci0_request_t *HI_DCI0_req;
/// Pointers to DL SDUs
......
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