Commit 4ae67730 authored by Matthieu Kanj's avatar Matthieu Kanj

mapping PHY and MAC parameters

parent 6988893a
......@@ -421,11 +421,25 @@ typedef struct {
/// The only HARQ process for the DLSCH
NB_IoT_DL_eNB_HARQ_t *harq_process;
// NB_IoT_DL_eNB_SIB1_t harq_process_sib1;
// NB_IoT_DL_eNB_SIB1_t harq_process_sib1;
SCH_status_NB_IoT_t status;
SCH_status_NB_IoT_t status;
/// Number of soft channel bits
///////////////////////////////////
uint32_t rnti_type;
uint32_t resource_assignment; // for NDLSCH // this value point to --> number of subframes needed
uint32_t repetition_number;
uint32_t modulation;
uint32_t number_of_subframes_for_resource_assignment; // for NDLSCH //table 16.4.1.3-1 // TS 36.213
uint32_t counter_repetition_number;
uint32_t counter_current_sf_repetition;
uint32_t pointer_to_subframe;
///////////////////////////////////
uint32_t repetition_number_SIB1; //4 8 16
uint32_t resource_assignment_SIB1; // always 8
/// Number of soft channel bits
uint32_t G;
///NB-IoT
......@@ -665,14 +679,34 @@ typedef struct {
typedef struct {
//the 2 LSB of the hsfn (the MSB are indicated by the SIB1-NB)
rnti_t rnti[2];
////////////////////////////////////////////////////////
uint32_t length[2];
uint32_t ncce_index[2];
uint32_t aggregation_level[2];
uint32_t rnti_type[2];
uint32_t dci_format[2];
uint32_t scheduling_delay[2];
uint32_t resource_assignment[2];
// uint32_t repetition_number[2];
uint32_t mcs[2];
uint32_t new_data_indicator[2];
uint32_t harq_ack_resource[2];
uint32_t npdcch_order_indication[2];
uint32_t dci_subframe_repetition_number[2];
////////////////////////////////////////////////////////
//UE specific parameters
uint16_t npdcch_NumRepetitions[2];
uint16_t npdcch_NumRepetitions[2];
uint16_t repetition_number[2];
uint16_t repetition_number[2];
//indicate the corresponding subframe within the repetition (set to 0 when a new NPDCCH pdu is received)
uint16_t repetition_idx[2];
uint16_t repetition_idx[2];
//////////////////////////////////////
uint32_t counter_repetition_number[2];
// uint32_t counter_current_sf_repetition[2];
// uint32_t pointer_to_subframe[2];
//////////////////////////////////////
uint16_t h_sfn_lsb;
uint8_t npdcch_d[2][96+(3*(16+NPDCCH_A))];
......
......@@ -137,7 +137,7 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF,
int16_t amp,
LTE_DL_FRAME_PARMS *frame_parms,
uint8_t control_region_size, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
NB_IoT_eNB_NDLSCH_t *dlsch0, //NB_IoT_eNB_NDLSCH_t
NB_IoT_eNB_NDLSCH_t *dlsch0, //NB_IoT_eNB_NDLSCH_t
int G, // number of bits per subframe
unsigned int npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
unsigned int subframe,
......
......@@ -51,6 +51,6 @@ unsigned int TBStable_NB_IoT[14][8] ={ //[ITBS][ISF]
//TBS table for the case containing S1B1-NB, Table 16.4.1.5.2-1 in TS 36.213 v14.2 (Itbs = 12 ~ 15 is reserved field
//mapping ITBS to SIB1-NB
unsigned int TBStable_NB_IoT_SIB1[16] = {208,208,208,328,328,328,440,440,440,680,680,680};
unsigned int TBStable_NB_IoT_SIB1[16] = {208,208,208,328,328,328,440,440,440,680,680,680,0,0,0,0};
#endif
\ No newline at end of file
......@@ -25,6 +25,7 @@
extern unsigned int TBStable_NB_IoT[14][8];
extern unsigned int TBStable_NB_IoT_SIB1[16];
extern unsigned char cs_ri_normal_NB_IoT[4];
extern unsigned char cs_ri_extended_NB_IoT[4];
......
......@@ -647,6 +647,8 @@ typedef struct {
uint8_t nb_antennas_tx_NB_IoT; // to replace with NB_IoT_frame_params
NPUSCH_CONFIG_COMMONx npusch_config_common;
uint8_t RB_ID_NB_IoT; // to be used
/////////////////////////////////////////////////////////////////////
} LTE_DL_FRAME_PARMS;
......
......@@ -29,6 +29,8 @@
*/
//#include "PHY/LTE_TRANSPORT/dlsch_tbs_full_NB_IoT.h"
#include "openair2/PHY_INTERFACE/IF_Module_NB_IoT.h"
#include "../SCHED/IF_Module_L1_primitives_NB_IoT.h"
//#include "../SCHED/defs.h"
......@@ -39,6 +41,7 @@
//#include "PHY/extern.h"
#include "PHY/extern_NB_IoT.h"
#include "PHY/extern.h"
//#include "PHY/vars.h"
#include "PHY/INIT/defs_NB_IoT.h"
......@@ -67,7 +70,7 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
//is SIB1-NB
if(rel13->rnti_type == 0 && rel13->rnti == 65535)
{
/*
* the configuration of the NDLSCH PDU for the SIB1-NB shoudl be the following:
* -RNTI type = 0; (BCCH)
......@@ -81,10 +84,12 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
*
*/
//LOG_I(PHY,"B NB-handle_nfapi_dlsch_pdu_NB_IoT SIB1\n");
ndlsch_harq = ndlsch->harq_process;
ndlsch->ndlsch_type = SIB1;
ndlsch->npdsch_start_symbol = rel13->start_symbol; //start symbol for the ndlsch transmission
ndlsch_harq = ndlsch->harq_process;
//ndlsch_harq->pdu = sdu;
//LOG_I(PHY,"B content_sib1:%d\n",sdu);
......@@ -94,10 +99,12 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
//should be from 1 to 8
ndlsch_harq->resource_assignment = rel13->number_of_subframes_for_resource_assignment;//maybe we don't care about it since a fixed schedule
ndlsch_harq->repetition_number = rel13->repetition_number; //is the schedulingInfoSIB1 (value 1-15) of MIB that is mapped into value 4-8-16 (see NDLSCH fapi specs Table 4-47)
ndlsch_harq->modulation = rel13->modulation;
ndlsch_harq->status = ACTIVE_NB_IoT;
ndlsch->resource_assignment_SIB1 = rel13->number_of_subframes_for_resource_assignment;//maybe we don't care about it since a fixed schedule
ndlsch->repetition_number_SIB1 = rel13->repetition_number; //is the schedulingInfoSIB1 (value 1-15) of MIB that is mapped into value 4-8-16 (see NDLSCH fapi specs Table 4-47)
ndlsch->modulation = rel13->modulation;
ndlsch->status = ACTIVE_NB_IoT;
//ndlsch->
//SI information in reality have no feedback (so there is no retransmission from the HARQ view point since no ack and nack)
// ndlsch_harq->frame = frame;
......@@ -107,6 +114,7 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
ndlsch->scrambling_sequence_intialization = rel13->scrambling_sequence_initialization_cinit;
//LOG_I(PHY,"A NB-handle_nfapi_dlsch_pdu_NB_IoT SIB1\n");
ndlsch_harq->TBS = TBStable_NB_IoT_SIB1[rel13->repetition_number];
......@@ -176,9 +184,23 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
//check if the PDU is for RAR
if(eNB->ndlsch_RAR != NULL && rel13->rnti == eNB->ndlsch_RAR->rnti) //rnti for the RAR should have been set priviously by the DCI
{
eNB->ndlsch_RAR->harq_process->pdu = sdu;
eNB->ndlsch_RAR->npdsch_start_symbol = rel13->start_symbol;
eNB->ndlsch_RAR->active = 1;
eNB->ndlsch_RAR->harq_process->pdu = sdu;
eNB->ndlsch_RAR->npdsch_start_symbol = rel13->start_symbol;
eNB->ndlsch_RAR->active = 1;
eNB->ndlsch_RAR->rnti = rel13->rnti; // how this value is tested in line 177 ???? i am missing something ????
eNB->ndlsch_RAR->rnti_type = rel13->rnti_type;
eNB->ndlsch_RAR->resource_assignment = rel13->resource_assignment ; // for NDLSCH // this value point to --> number of subframes needed
eNB->ndlsch_RAR->repetition_number = rel13->repetition_number;
eNB->ndlsch_RAR->modulation = rel13->modulation;
eNB->ndlsch_RAR->number_of_subframes_for_resource_assignment = rel13->number_of_subframes_for_resource_assignment; // for NDLSCH //table 16.4.1.3-1 // TS 36.213
eNB->ndlsch_RAR->counter_repetition_number = rel13->repetition_number;
eNB->ndlsch_RAR->counter_current_sf_repetition = 0;
eNB->ndlsch_RAR->pointer_to_subframe = 0;
}
else
{ //this for ue data
......@@ -198,6 +220,19 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
ndlsch_harq->pdu = sdu;
ndlsch->active = 1;
eNB->ndlsch_RAR->rnti = rel13->rnti; // how this value is tested in line 177 ???? i am missing something ????
eNB->ndlsch_RAR->rnti_type = rel13->rnti_type;
eNB->ndlsch_RAR->resource_assignment = rel13->resource_assignment ; // for NDLSCH // this value point to --> number of subframes needed
eNB->ndlsch_RAR->repetition_number = rel13->repetition_number;
eNB->ndlsch_RAR->modulation = rel13->modulation;
eNB->ndlsch_RAR->number_of_subframes_for_resource_assignment = rel13->number_of_subframes_for_resource_assignment; // for NDLSCH //table 16.4.1.3-1 // TS 36.213
eNB->ndlsch_RAR->counter_repetition_number = rel13->repetition_number;
eNB->ndlsch_RAR->counter_current_sf_repetition = 0;
eNB->ndlsch_RAR->pointer_to_subframe = 0;
}
}
......@@ -289,7 +324,7 @@ void schedule_response_NB_IoT(Sched_Rsp_NB_IoT_t *Sched_INFO)
case NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE:
//Remember: there is no DCI for SI information
//TODO: separate the ndlsch structure configuration from the DCI (here we will encode only the DCI)
//generate_eNB_dlsch_params_NB_IoT(eNB,proc,dl_config_pdu);
generate_eNB_dlsch_params_NB_IoT(eNB,proc,dl_config_pdu);
break;
case NFAPI_DL_CONFIG_NBCH_PDU_TYPE:
......
......@@ -695,19 +695,7 @@ if(proc->flag_msg4 == 1 && proc->counter_msg4 > 0)
}
proc->flag_scrambling =1;
printf("\n RAR sentttttt frame %d, subframe %d", frame, subframe);
/* if(proc->counter_msg4 == 3 || proc->counter_msg4 ==1)
{
dlsch_modulation_rar_NB_IoT(txdataF,
AMP,
fp,
3, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
rar,
236, // number of bits per subframe
frame, // unrequired
subframe,
22,
2);
} else {*/
dlsch_modulation_NB_IoT(txdataF,
AMP,
fp,
......@@ -717,7 +705,6 @@ if(proc->flag_msg4 == 1 && proc->counter_msg4 > 0)
frame, // unrequired
subframe,
22);
// }
proc->counter_msg4--;
proc->subframe_msg4 =subframe+1;
......
......@@ -224,8 +224,8 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
NB_IoT_eNB_NPBCH_t *broadcast_str = &eNB->npbch;
//NB_IoT_eNB_NDLSCH_t *sib1 = &eNB->ndlsch_SIB;
//NB_IoT_eNB_NDLSCH_t *ndlsch = &eNB->ndlsch_SIB1;
NB_IoT_DL_eNB_HARQ_t *sib1 = eNB->ndlsch_SIB1->harq_process;
NB_IoT_DL_eNB_HARQ_t *sib23 = eNB->ndlsch_SIB23->harq_process;
NB_IoT_eNB_NDLSCH_t *sib1 = eNB->ndlsch_SIB1;
NB_IoT_eNB_NDLSCH_t *sib23 = eNB->ndlsch_SIB23;
int **txdataF = eNB->common_vars.txdataF[0];
int subframe = proc->subframe_tx;
......@@ -292,17 +292,17 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
//uint8_t *npbch_pdu = get_NB_IoT_MIB();
uint8_t *npbch_pdu = broadcast_str->pdu;
//uint8_t *sib1_pdu = get_NB_IoT_SIB1();
uint8_t *sib1_pdu = sib1->pdu;
uint8_t *sib1_pdu = sib1->harq_process->pdu;
//uint8_t *sib23_pdu = get_NB_IoT_SIB23();
uint8_t *sib23_pdu = sib23->pdu;
uint8_t *sib23_pdu = sib23->harq_process->pdu;
if(subframe == 0)
{
LOG_I(PHY,"MIB NB-IoT content:\n");
for(int i = 0; i<6;i++)
/* for(int i = 0; i<6;i++)
printf("%02X",broadcast_str->pdu[i]);
printf("\n");
printf("\n");*/
generate_npbch(broadcast_str,
txdataF,
......@@ -319,12 +319,16 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
// cell_id help to find the start subframe for sib1.
// MAC_TBStable_NB_IoT_SIB1 to be used to get TBS value.
//
// sib1->repetition_number_SIB1; //0-15 sib1->resource_assignment_SIB1; // always 8
// fp->Nid_cell
// TBStable_NB_IoT_SIB1[repetition_number_SIB1] /// TBS
//
if((subframe == 4) && (frame%2==0) && (frame%32<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) )
{
LOG_I(PHY,"SIB1 NB-IoT content:\n");
for(int i = 0; i<6;i++)
/*for(int i = 0; i<6;i++)
printf("%02X",sib1->pdu[i]);
printf("\n");
printf("\n"); */
if( frame%32 == 0 )
{
......@@ -358,9 +362,9 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
if( (subframe >0) && (subframe !=5) && (With_NSSS == 0) && (frame%2==1) && (frame%64<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) )
{
LOG_I(PHY,"SIB2 NB-IoT content:\n");
for(int i = 0; i<6;i++)
/* for(int i = 0; i<6;i++)
printf("%02X",sib23->pdu[i]);
printf("\n");
printf("\n");*/
if( subframe == 1 )
{
......
......@@ -133,6 +133,9 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.rnti_type = 0;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.rnti = 0xFFFF; // SI-rnti
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.modulation = 2;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.repetition_number = 10; //value between 0-15, should be get from MIB // to fix later !!!!!!!!!!!!
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.number_of_subframes_for_resource_assignment = 8;
//SIB1_pdu = get_NB_IoT_SIB1();
//LOG_D(MAC,"A NB-IoT SIB1 pdu : %d \n",SIB1_pdu);
......
......@@ -573,7 +573,6 @@ uint8_t do_SIB1_NB_IoT_x(uint8_t Mod_id, int CC_id,
5; //if not configured we use band 5 (UL: 824 MHz - 849MHz / DL: 869 MHz - 894 MHz FDD mode)
#endif
// Now, follow the scheduler SIB configuration
// There is only one sib2+sib3 common setting
......@@ -581,7 +580,6 @@ uint8_t do_SIB1_NB_IoT_x(uint8_t Mod_id, int CC_id,
schedulingInfo_NB_IoT.si_RepetitionPattern_r13= SchedulingInfo_NB_r13__si_RepetitionPattern_r13_every2ndRF; //This Indicates the starting radio frames within the SI window used for SI message transmission.
schedulingInfo_NB_IoT.si_TB_r13= SchedulingInfo_NB_r13__si_TB_r13_b680;//208 bits
// This is for SIB2/3
/*SIB3 --> There is no mapping information of SIB2 since it is always present
* in the first SystemInformation message
......
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