Commit 05306c4d authored by Matthieu Kanj's avatar Matthieu Kanj

adding nfapi params for NPUSCH

parent 879e2af3
......@@ -486,6 +486,10 @@ typedef struct {
uint16_t first_rb;
/// Current Number of RBs
uint16_t nb_rb;
uint8_t new_data_indication;
/// Determined the subcarrier spacing for NPUSCH (15 kHz or 3.75 KHz)
uint8_t subcarrier_spacing;
/// Determined the subcarrier allocation for the NPUSCH.(15, 3.75 KHz)
uint8_t subcarrier_indication;
/// Determined the number of resource unit for the NPUSCH
......@@ -530,9 +534,9 @@ typedef struct {
/// coded CQI bits
int8_t o_d[96+((MAX_CQI_BITS_NB_IoT+8)*3)];
/// soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
int16_t w[MAX_NUM_ULSCH_SEGMENTS_NB_IoT][3*(6144+64)];
int16_t w[MAX_NUM_ULSCH_SEGMENTS_NB_IoT][3*(6144+64)];
/// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
int16_t *d[MAX_NUM_ULSCH_SEGMENTS_NB_IoT];
int16_t *d[MAX_NUM_ULSCH_SEGMENTS_NB_IoT];
///
uint32_t C;
/// Number of "small" code segments (for definition see 36-212 V8.6 2009-03, p.10)
......@@ -624,9 +628,9 @@ typedef struct {
/// number of cell specific TX antenna ports assumed by the UE
uint8_t nrs_antenna_ports;
///
uint16_t scrambling_sequence_intialization;
uint16_t C_init;
///
uint16_t sf_index;
uint16_t SF_idx;
/// Determined the ACK/NACK delay and the subcarrier allocation TS 36.213 Table 16.4.2
uint8_t HARQ_ACK_resource;
......
......@@ -2066,7 +2066,7 @@ uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
uint32_t scrambling_frame_msg3, // first received frame
uint16_t nb_slot, // total number of occupied slots
uint16_t I_sc,
uint16_t Nsc_RU,
uint16_t Nsc_RU, // to remove and create function Nsc_RU = f(I_sc)
uint16_t Mcs,
unsigned int A, // A = TBS
uint16_t counter_msg,
......
......@@ -519,7 +519,8 @@ NB_IoT_eNB_NPDCCH_t *npdcch[NUMBER_OF_UE_MAX_NB_IoT];
//NB_IoT_eNB_NDLSCH_t ndlsch_rar;
NB_IoT_eNB_NPDCCH_t *npdcch_DCI;
NB_IoT_eNB_NULSCH_t *ulsch_NB_IoT[NUMBER_OF_UE_MAX+1];
NB_IoT_eNB_NULSCH_t *ulsch_NB_IoT[NUMBER_OF_UE_MAX+1];
NB_IoT_eNB_NULSCH_t *ulsch_msg3_NB_IoT;
////////////// For IF Module /////////////////////////////
IF_Module_NB_IoT_t *if_inst; // should be replaced by if_inst_NB_IoT; to avoid conflict during the merge with develop branch
......
......@@ -428,9 +428,19 @@ void schedule_response_NB_IoT(Sched_Rsp_NB_IoT_t *Sched_INFO)
for(i = 0; i< number_ul_pdu; i++)
{
ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i];
NB_IoT_eNB_NULSCH_t *nulsch;
NB_IoT_UL_eNB_HARQ_t *nulsch_harq;
nfapi_ul_config_nulsch_pdu_rel13_t *nfapi_parameters_rel13 = &ul_config_pdu->nulsch_pdu.nulsch_pdu_rel13;
switch(ul_config_pdu->pdu_type)
{
case NFAPI_UL_CONFIG_NULSCH_PDU_TYPE:
// new condition should be added to identify if this is msg3 3 since the TBS_table is not the same.
// the type of subcarrier spacing should be specified before the call of rx_ulsch since the parameter does not exist in nfapi parameters.
//TODO should distinguish between data and between data (npusch format)
/*NB: for reception of Msg3 generally not exist a DCI (because scheduling information are implicitly given by the RAR)
* but in case of FAPI specs we should receive an UL_config (containing the NULSCH pdu) for configuring the PHY for Msg3 reception from the MAC
......@@ -440,6 +450,31 @@ void schedule_response_NB_IoT(Sched_Rsp_NB_IoT_t *Sched_INFO)
* diferent from the DL_CONFIG one)
*
*/
///////////////////////////////////////////////////////////////////////////////////////////
nulsch = eNB->ulsch_NB_IoT[0];
nulsch_harq = nulsch->harq_process;
nulsch->Msg3_active = 1;
nulsch->Msg3_flag = 1;
nulsch->rnti = nfapi_parameters_rel13->rnti;
nulsch->npusch_format = nfapi_parameters_rel13->nulsch_format;
nulsch->N_srs = nfapi_parameters_rel13->n_srs;
nulsch->C_init = nfapi_parameters_rel13->scrambling_sequence_initialization_cinit;
nulsch->SF_idx = nfapi_parameters_rel13->sf_idx;
nulsch->HARQ_ACK_resource = nfapi_parameters_rel13->nb_harq_information.nb_harq_information_rel13_fdd.harq_ack_resource;
nulsch_harq->subcarrier_spacing = 0; // 0 for 15 KHz and 1 for 3.75 KHz// TODO : get the value from the DCI
nulsch_harq->subcarrier_indication = nfapi_parameters_rel13->subcarrier_indication; // Isc =0->18 , or 0->47 // format 2, 0->3 or 0->7
nulsch_harq->resource_assignment = nfapi_parameters_rel13->resource_assignment; // valid for format 1 // this should be set by DCI N0 // not used for msg3 // I_RU --> helps to get N_RU
nulsch_harq->mcs = nfapi_parameters_rel13->mcs; // I_mcs = 0->10 (single tone) and 0->12 (multi-tone)
nulsch_harq->rvidx = nfapi_parameters_rel13->redudancy_version; // values = 0 or 1
nulsch_harq->repetition_number = nfapi_parameters_rel13->repetition_number; // // N_rep values = 0->7 // new funciton to be created to compute the nb_slots = f(N_rep)
nulsch_harq->new_data_indication = nfapi_parameters_rel13->new_data_indication; // valid only for DCI N0
nulsch_harq->TBS = nfapi_parameters_rel13->size; /// check if needed *8 or /8 or nothing to do
////////////////////////////////////////////////////////////////////////////////////////
LOG_I(PHY,"IF module proceed UL config NULSCH pdu\n");
break;
case NFAPI_UL_CONFIG_NRACH_PDU_TYPE:
......
......@@ -396,7 +396,10 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc
eNB->rb_mask_ul[3] = 0;
////////////////////////////////////////////////////////////////////////////////////////
*/
uint8_t data_or_control=0;
uint8_t data_or_control=0; // get this info from UL_config_request
npusch_procedures(eNB,proc,data_or_control);
pthread_mutex_lock(&eNB->UL_INFO_mutex);
......@@ -406,7 +409,7 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
// if (nfapi_mode == 0 || nfapi_mode == 1) { // If PNF or monolithic
npusch_procedures(eNB,proc,data_or_control);
//}
......
......@@ -76,6 +76,8 @@ extern const uint32_t mapped_mcs[3][8];
//TBS table for NPUSCH transmission TS 36.213 v14.2 table Table 16.5.1.2-2:
extern const int UL_TBS_Table[14][8];
const int UL_TBS_Table_msg3[8];
extern const int rachperiod[8];
extern const int rachstart[8];
extern const int rachrepeat[8];
......
......@@ -270,7 +270,7 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_
}
while(schedule_result_list_UL->output_subframe == current_time)
{
if(schedule_result_list_UL->channel == NPUSCH)
if(schedule_result_list_UL->channel == NPUSCH) // condition should be added to switch between HI_DCI0 and Msg3
{
//LOG_D(MAC,"first UL \n");
LOG_D(MAC,"[hypersfn:%2d][frame:%2d][subframe:%2d]NB-IoT fill UL config\n",hypersfn,frame,subframe);
......@@ -287,9 +287,14 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_
DCI_pdu = schedule_result_list_UL->DCI_pdu;
// bug here
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.nulsch_format = 0;
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.size = UL_TBS_Table[((DCIFormatN0_t *)DCI_pdu)->mcs][((DCIFormatN0_t *)DCI_pdu)->ResAssign];
//contidition should be added to select either the UL_TBS_Table or t UL_TBS_table_msg3
//(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.size = UL_TBS_Table[((DCIFormatN0_t *)DCI_pdu)->mcs][((DCIFormatN0_t *)DCI_pdu)->ResAssign];
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.size = UL_TBS_Table_msg3[((DCIFormatN0_t *)DCI_pdu)->mcs]; // for the case of MSG3
//LOG_D(MAC,"test\n");
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.rnti = schedule_result_list_UL->rnti;
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.rnti = schedule_result_list_UL->rnti; //TODO : check if it is the right rnti // get from msg2
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.subcarrier_indication = ((DCIFormatN0_t *)DCI_pdu)->scind;
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.resource_assignment = ((DCIFormatN0_t *)DCI_pdu)->ResAssign;
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.mcs = ((DCIFormatN0_t *)DCI_pdu)->mcs;
......
......@@ -76,6 +76,9 @@ const int UL_TBS_Table[14][8]=
{224,488,744,1128,1256,1544,2024,2536}
};
const int UL_TBS_Table_msg3[8]={88,88,88,0,0,0,0,0};
const int rachperiod[8]={40,80,160,240,320,640,1280,2560};
const int rachstart[8]={8,16,32,64,128,256,512,1024};
const int rachrepeat[8]={1,2,4,8,16,32,64,128};
......
......@@ -73,15 +73,20 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
LOG_I(PHY,"Allocating Transport Channel Buffers for DLSCH, UE %d\n",i);
for (j=0; j<2; j++) {
PHY_vars_eNB->dlsch[i][j] = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL,abstraction_flag,frame_parms);
PHY_vars_eNB->dlsch[i][j] = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL,abstraction_flag,frame_parms);
if (!PHY_vars_eNB->dlsch[i][j]) {
LOG_E(PHY,"Can't get eNB dlsch structures for UE %d \n", i);
exit(-1);
LOG_E(PHY,"Can't get eNB dlsch structures for UE %d \n", i);
exit(-1);
} else {
LOG_D(PHY,"dlsch[%d][%d] => %p\n",i,j,PHY_vars_eNB->dlsch[i][j]);
PHY_vars_eNB->dlsch[i][j]->rnti=0;
LOG_D(PHY,"dlsch[%d][%d] => %p\n",i,j,PHY_vars_eNB->dlsch[i][j]);
PHY_vars_eNB->dlsch[i][j]->rnti=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