Commit 3681d24f authored by Michele Paffetti's avatar Michele Paffetti

adding NPDCCH structure for UE specific and Common Search space. To be...

adding NPDCCH structure for UE specific and Common Search space. To be implemented NPDCCH repetitions.Code Copile. 145 Warnings
parent 0fffe1a3
......@@ -369,16 +369,17 @@ void NB_phy_config_dedicated_eNB(uint8_t Mod_id,
}
//configure UE specific parameters for NPDCCH Search Space
//
if (eNB->npdcch[UE_id]) {
npdcch = eNB->npdcch[UE_id];
npdcch->rnti = rnti;
npdcch->npdcch_NumRepetitions = extra_parms->npdcch_NumRepetitions;
npdcch->npdcch_Offset_USS = extra_parms->npdcch_Offset_USS;
npdcch->npdcch_StartSF_USS = extra_parms->npdcch_StartSF_USS;
npdcch->npdcch_NumRepetitions = extra_parms->npdcch_NumRepetitions; //Rmax maybe is the only one needed
// npdcch->npdcch_Offset_USS = extra_parms->npdcch_Offset_USS;
// npdcch->npdcch_StartSF_USS = extra_parms->npdcch_StartSF_USS;
LOG_I(PHY,"NB_phy_config_dedicated_eNB: npdcch_NumRepetitions = %d, npdcch_Offset_USS = %d, npdcch_StartSF_USS = %d\n",
npdcch->npdcch_NumRepetitions, npdcch->npdcch_Offset_USS, npdcch->npdcch_StartSF_USS);
LOG_I(PHY,"NB_phy_config_dedicated_eNB: npdcch_NumRepetitions = %d\n",
npdcch->npdcch_NumRepetitions);
} else {
LOG_E(PHY,"[eNB %d] Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, UE_id);
......
......@@ -820,7 +820,6 @@ typedef enum
typedef struct {
rnti_t rnti;
//array containing the pdus of DCI
uint8_t *a[2];
......@@ -829,13 +828,31 @@ typedef struct {
//UE specific parameters
uint16_t npdcch_NumRepetitions;
uint16_t npdcch_Offset_USS;
uint16_t npdcch_StartSF_USS;
uint16_t repetition_number;
//indicate the corresponding subframe within the repetition (set to 0 when a new NPDCCH pdu is received)
uint16_t repetition_idx;
// uint16_t npdcch_Offset_USS;
// uint16_t npdcch_StartSF_USS;
}NB_IoT_eNB_NPDCCH_t;
typedef struct{
//Number of repetitions (R) for common search space (RAR and PAGING)
uint16_t number_repetition_RA;
uint16_t number_repetition_PAg;
//index of the current subframe among the repetition (set to 0 when we receive the new NPDCCH)
uint16_t repetition_idx_RA;
uint16_t repetition_idx_Pag;
}NB_IoT_eNB_COMMON_NPDCCH_t;
typedef struct {
......@@ -1080,7 +1097,7 @@ typedef struct {
uint8_t npbch_e[1600];
///pdu of the npbch message
uint8_t*pdu;
} NB_IoT_eNB_NPBCH;
} NB_IoT_eNB_NPBCH_t;
//---------------------------------------------------------------------------------------
......
......@@ -117,7 +117,7 @@ int allocate_npbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
}
/**********************************************************
**********************************************************/
int generate_npbch(NB_IoT_eNB_NPBCH *eNB_npbch,
int generate_npbch(NB_IoT_eNB_NPBCH_t *eNB_npbch,
int32_t **txdataF,
int amp,
LTE_DL_FRAME_PARMS *frame_parms,
......
......@@ -75,7 +75,7 @@ int allocate_npbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
unsigned short id_offset,
uint32_t *re_allocated);
int generate_npbch(NB_IoT_eNB_NPBCH *eNB_npbch,
int generate_npbch(NB_IoT_eNB_NPBCH_t *eNB_npbch,
int32_t **txdataF,
int amp,
LTE_DL_FRAME_PARMS *frame_parms,
......
......@@ -702,8 +702,9 @@ typedef struct PHY_VARS_eNB_s {
*
*/
NB_IoT_eNB_NPBCH *npbch;
NB_IoT_eNB_NPDCCH_t *npdcch[NUMBER_OF_UE_MAX_NB_IoT]; //check if should be an array and the max size of this array
//TODO: check what should be NUMBER_OF_UE_MAX_NB_IoT value
NB_IoT_eNB_NPBCH_t *npbch;
NB_IoT_eNB_NPDCCH_t *npdcch[NUMBER_OF_UE_MAX_NB_IoT];
NB_IoT_eNB_NDLSCH_t *ndlsch[NUMBER_OF_UE_MAX_NB_IoT];
NB_IoT_eNB_NULSCH_t *nulsch[NUMBER_OF_UE_MAX_NB_IoT+1]; //nulsch[0] contains the RAR
NB_IoT_eNB_NDLSCH_t *ndlsch_SI,*ndlsch_ra, *ndlsch_SIB1;
......
......@@ -63,7 +63,7 @@ typedef struct NPRACH_Parameters_NB{
uint16_t maxNumPreambleAttemptCE;
/// Number of NPRACH repetitions per attempt for each NPRACH resource
uint16_t numRepetitionsPerPreambleAttempt;
/// The number of the repetition for DCI use in RAR/MSG3/MSG4 from 1 - 2048
/// The number of the repetition for DCI use in RAR/MSG3/MSG4 from 1 - 2048 (Rmax)
uint16_t npdcch_NumRepetitions_RA;
/// Starting subframe for NPDCCH Common searching space for (RAR/MSG3/MSG4)
uint16_t npdcch_StartSF_CSS_RA;
......@@ -90,6 +90,7 @@ typedef struct {
struct rsrp_ThresholdsNPrachInfoList *rsrp_ThresholdsPrachInfoList;
/// NPRACH Parameters List
NPRACH_List_NB_t nprach_ParametersList;
} NPRACH_CONFIG_COMMON;
/// NPDSCH-ConfigCommon from 36.331 RRC spec
......@@ -264,7 +265,6 @@ typedef struct {
uint16_t eutra_NumCRS_ports;
} NB_DL_FRAME_PARMS;
......
......@@ -169,7 +169,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
//XXX check if correct to take eNB like this
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][Sched_INFO->CC_id];
eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];
NB_IoT_eNB_NPBCH *npbch;
NB_IoT_eNB_NPBCH_t *npbch;
int i;
......
......@@ -96,6 +96,9 @@ extern int rx_sig_fifo;
/* For NB-IoT, we put NPBCH in later part, since it would be scheduled by MAC scheduler
* It generates NRS/NPSS/NSSS
*
......@@ -486,6 +489,7 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,nfapi
DCI_CONTENT *DCI_Content;
DCI_format_NB_t DCI_format;
NB_IoT_eNB_NDLSCH_t *ndlsch;
NB_IoT_eNB_NPDCCH_t *npdcch;
DCI_Content = (DCI_CONTENT*) malloc(sizeof(DCI_CONTENT));
......@@ -512,8 +516,10 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,nfapi
DCI_Content->DCIN1_RAR.HARQackRes = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.harq_ack_resource;
DCI_Content->DCIN1_RAR.DCIRep = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.dci_subframe_repetition_number;
//TODO calculate the number of common repetitions
//fp->nprach_config_common.number_repetition_RA = see TS 36.213 Table 16.1-3
// fill the dlsch_ra_NB sructure for RAR, and packed the DCI PDU
// fill the dlsch_ra_NB structure for RAR, and packed the DCI PDU
ndlsch= eNB->ndlsch_ra;
ndlsch->ndlsch_type = RAR;
......@@ -541,7 +547,7 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,nfapi
AssertFatal(UE_id != -1, "no ndlsch context available or no ndlsch context corresponding to that rnti\n");
//mapping the fapi parameters to the oai parameters
//mapping the fapi parameters to the oai parameters
DCI_format = DCIFormatN1;
......@@ -556,6 +562,20 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,nfapi
DCI_Content->DCIN1.HARQackRes = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.harq_ack_resource;
DCI_Content->DCIN1.DCIRep = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.dci_subframe_repetition_number;
//set the NPDCCH UE-specific structure (calculate R)
npdcch=eNB->npdcch[(uint8_t)UE_id];
AssertFatal(npdcch != NULL, "NPDCCH structure for UE specific is not exist\n");
npdcch->repetition_idx = 0; //this is used for the encoding mechanism to understand that is the first transmission
if(dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.aggregation_level) //whenever aggregation level is =1 we have only 1 repetition for USS
npdcch->repetition_number = 1;
else
{
//see TS 36.213 Table 16.1-1
}
//fill the ndlsch structure for UE and packed the DCI PD
ndlsch = eNB->ndlsch[(uint8_t)UE_id]; //in the old implementation they also consider UE_id = 1;
......@@ -659,7 +679,7 @@ void npdsch_procedures(PHY_VARS_eNB *eNB,
{
int frame=proc->frame_tx;
int subframe=proc->subframe_tx;
LTE_DL_eNB_HARQ_t *ndlsch_harq=ndlsch->harq_process;
NB_IoT_DL_eNB_HARQ_t *ndlsch_harq =ndlsch->harq_process;
int input_buffer_length = ndlsch_harq->TBS/8; // get in byte //the TBS is set in generate_dlsch_param
NB_DL_FRAME_PARMS *fp=&eNB->frame_parms_nb_iot;
int G;
......@@ -967,7 +987,7 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
*
*/
generate_npbch(&eNB->npbch,
generate_npbch(eNB->npbch,
txdataF,
AMP,
fp,
......@@ -1004,7 +1024,7 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
{
//check if current frame is for SIB1-NB transmission (if yes get the starting frame of SIB1-NB) and set the flag for the encoding
sib1_startFrame = is_SIB1_NB(frame,
eNB->ndlsch_SIB1->harq_process->repetition_number,
(long)eNB->ndlsch_SIB1->harq_process->repetition_number,
fp->Nid_cell,
eNB->ndlsch_SIB1 //set the flags
);
......@@ -1122,6 +1142,7 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
}
//check for UE specific transmission
/*
* Delays between DCI transmission and NDLSCH transmission are taken in consideration by the MAC scheduler by sending in the proper subframe the scheduler_response
* (TS 36.213 ch 16.4.1: DCI format N1, N2, ending in subframe n intended for the UE, the UE shall decode, starting from subframe n+5 DL subframe,
......@@ -1148,7 +1169,7 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
{
if(frame%2 == 0)//condition on NSSS (subframe 9 not available)
{
if(eNB->ndlsch_SI != NULL && subframe!= 0 && subframe != 5 && subframe != 9)
if( subframe!= 0 && subframe != 5 && subframe != 9)
{
npdsch_procedures(eNB,
proc,
......@@ -1159,7 +1180,7 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
}
else //this frame not foresee the transmission of NSSS (subframe 9 is available)
{
if(eNB->ndlsch_SI != NULL && subframe!= 0 && subframe != 5)
if( subframe!= 0 && subframe != 5)
{
npdsch_procedures(eNB,
proc,
......@@ -1171,7 +1192,7 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
}
}
//we don't care about subframe TX for the PUCCH since not defined by NB-IoT
}
......@@ -1181,39 +1202,79 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
/*If we have DCI to generate do it now
*
* DCI in NB-IoT are transmitted over NPDCCH search spaces as described in TS 36.213 ch 16.6
* 1)distinction of NPDCCH SS is implicit with type of DCI? (assume yes)
* 2)NPDCCH rep. number (R) is obtained by different tables and by the higher layer parms:
* -npdcch-NumRepetitions (UE-specific)
*
* Don-t care about the concept of search space since will be managed by the MAC.
* MAC also evaluate the starting position of NPDCCH transmission and will send the corresponding scheduling_response
*
*
* The PHY layer should evaluate R (repetitions of DCI) based on:
* -L (aggregation level) --> inside the NPDCCH PDU
* -Rmax
* -DCI subframe repetition number (2 bits) --> inside the NPDCCH PDU
* -TS 36.213 Table 16.6/1/2/3
*
*
* The higher layer parms (Rmax):
* -npdcch-NumRepetitions (UE-specific) [inside the NPDCCH UE-specific strucuture] --> configured through phyconfigDedicated
* -npdcch-NumRepetitionPaging (common)
* -npdcch-NumRepetitions-rA (common)
* PROBLEM: in FAPI specs seems there is no way to trasnmit them to the PHY
* -npdcch-NumRepetitions-RA (common) [inside the NB_DL_FRAME_PARMS-> nprach_ParametersList] --> configured in phy_config_sib2
*
* We need
* - a flag for telling us if it is a new repetition or not (means when the MAC transmit the scedule response for the DCI
* -Add a check for understanding if the current subframe is at the beginning of the search space or not
* -among the R repetition which number is the current one
* PROBLEM: in FAPI specs seems there is no way to trasnmit Rmax to the PHY (waiting for answers)
*
* ***whenever we have aggretation level = 1 for UE-specific the R is always = 1 (see table 16.6-1)
* *Rmax is also needed for evaluate the scheduling delay for NDLSCH (see scheduling delay field in NPDCCH PDU FAPI)
*
*s
* *Scrambling re-initialization is needed at the beginning of the Search Space or every 4th NPDCCH subframe (See TS 36.211)
* (this is taken in cosideration by the NPDCCH parameter "scrambling re-initialization batch index" in FAPI specs (Table 4-45)
*
****whenever we have aggregation level = 1 for UE-specific the R is always = 1 (see table 16.6-1)
****DCI DL transmission should not happen in case of reference signals or SI messages (this function should be triggered every subframe)
*
* */
//XXX we should check which npdcch structure we have to pass
//assume that the [0] is used for common search space
// for(int i = UE_id; i < NUMBER_OF_UE_MAX_NB_IoT; UE_id++)
// {
// if(eNB->npdcch[(uint8_t)UE_id] != NULL && eNB->npdcch[(uint8_t)UE_id]->rnti == dci_pdu->dci_alloc )
// }
generate_dci_top_NB(
eNB->npdcch,
dci_pdu->Num_dci,
dci_pdu->dci_alloc,
AMP,
fp,
eNB->common_vars.txdataF[0],
subframe,
dci_pdu->npdcch_start_symbol); //this parameter depends by eutraControlRegionSize (see TS36.213 16.6.1)
for(int i = UE_id; i < NUMBER_OF_UE_MAX_NB_IoT; UE_id++)
{
if(eNB->npdcch[(uint8_t)UE_id] != NULL && eNB->npdcch[(uint8_t)UE_id]->rnti == dci_pdu->dci_alloc->rnti && (eNB->ndlsch_SIB1->harq_process->status != ACTIVE || subframe != 4))
{
if(frame%2 == 0)//condition on NSSS (subframe 9 not available)
{
if( subframe!= 0 && subframe != 5 && subframe != 9)
{
generate_dci_top_NB(
eNB->npdcch[(uint8_t)UE_id],
dci_pdu->Num_dci,
dci_pdu->dci_alloc,
AMP,
fp,
eNB->common_vars.txdataF[0],
subframe,
dci_pdu->npdcch_start_symbol); //this parameter depends by eutraControlRegionSize (see TS36.213 16.6.1)
eNB->npdcch[(uint8_t)UE_id]->repetition_idx++; //can do also inside also the management
break;
}
}
else //this frame not foresee the transmission of NSSS (subframe 9 is available)
{
if( subframe!= 0 && subframe != 5)
{
generate_dci_top_NB(
eNB->npdcch[(uint8_t)UE_id],
dci_pdu->Num_dci,
dci_pdu->dci_alloc,
AMP,
fp,
eNB->common_vars.txdataF[0],
subframe,
dci_pdu->npdcch_start_symbol); //this parameter depends by eutraControlRegionSize (see TS36.213 16.6.1)
eNB->npdcch[(uint8_t)UE_id]->repetition_idx++; //can do also inside also the management
break;
}
}
}
}
}
......@@ -36,7 +36,7 @@ typedef struct{
uint16_t nprach_config_0_max_num_preamble_attempt_CE;
uint16_t nprach_config_1_max_num_preamble_attempt_CE;
uint16_t nprach_config_2_max_num_preamble_attempt_CE;
uint16_t nprach_config_0_npdcch_num_repetitions_RA; //Rmax (see TS 36.213 ch 16.6)
uint16_t nprach_config_0_npdcch_num_repetitions_RA; //Rmax (see TS 36.213 ch 16.6) -->only this is managed at PHY layer
uint16_t nprach_config_1_npdcch_num_repetitions_RA;
uint16_t nprach_config_2_npdcch_num_repetitions_RA;
uint16_t nprach_config_0_npdcch_startSF_CSS_RA; //G (see TS 36.213 ch 16.6)
......@@ -48,7 +48,7 @@ typedef struct{
//configured through the phy_config_dedicated
//Higher layer parameter for NPDCCH UE-spec search space
uint16_t npdcch_NumRepetitions;//Rmax (see TS 36.213 ch 16.6)
uint16_t npdcch_NumRepetitions;//Rmax (see TS 36.213 ch 16.6) -->only this is managed at PHY layer
uint16_t npdcch_StartSF_USS; //G (see TS 36.213 ch 16.6)
uint16_t npdcch_Offset_USS; //Alfa_offset (see TS 36.213 ch 16.6)
......
......@@ -376,7 +376,7 @@ void config_sib2_NB_fapi(
//MP: missed configuration for FAPI-style structure (I have added on my own byt maybe are not needed)
config_INFO->extra_phy_parms.nprach_config_0_subcarrier_MSG3_range_start = nprach_parameter->nprach_SubcarrierMSG3_RangeStart_r13;
config_INFO->extra_phy_parms.nprach_config_0_max_num_preamble_attempt_CE = nprach_parameter->maxNumPreambleAttemptCE_r13;
config_INFO->extra_phy_parms.nprach_config_0_npdcch_num_repetitions_RA = nprach_parameter->npdcch_NumRepetitions_RA_r13;
config_INFO->extra_phy_parms.nprach_config_0_npdcch_num_repetitions_RA = nprach_parameter->npdcch_NumRepetitions_RA_r13; //Rmax
config_INFO->extra_phy_parms.nprach_config_0_npdcch_startSF_CSS_RA = nprach_parameter->npdcch_StartSF_CSS_RA_r13;
config_INFO->extra_phy_parms.nprach_config_0_npdcch_offset_RA = nprach_parameter->npdcch_Offset_RA_r13;
//rsrp_ThresholdsPrachInfoList_r13 /*OPTIONAL*/
......@@ -706,11 +706,10 @@ int NB_rrc_mac_config_req_eNB(
config_INFO->get_DEDICATED = 1;
//XXX this parameters seems to be not defined by FAPi specs
//this are UE specific information that should be transmitted to the PHY layer
//Possible implementation is to use UE-specific structure at phy layer where to store this information (NPDCCH structure) this structure will be scrambled based on the rnti
//use UE-specific structure at phy layer where to store this information (NPDCCH structure) this structure will be scrambled based on the rnti
config_INFO->rnti = UE_RNTI(Mod_idP, UE_id);
config_INFO->extra_phy_parms.npdcch_NumRepetitions = physicalConfigDedicated->npdcch_ConfigDedicated_r13->npdcch_NumRepetitions_r13;
config_INFO->extra_phy_parms.npdcch_NumRepetitions = physicalConfigDedicated->npdcch_ConfigDedicated_r13->npdcch_NumRepetitions_r13; //Rmax
config_INFO->extra_phy_parms.npdcch_Offset_USS = physicalConfigDedicated->npdcch_ConfigDedicated_r13->npdcch_Offset_USS_r13;
config_INFO->extra_phy_parms.npdcch_StartSF_USS = physicalConfigDedicated->npdcch_ConfigDedicated_r13->npdcch_StartSF_USS_r13;
......
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