Commit 23c08a47 authored by Matthieu Kanj's avatar Matthieu Kanj

SIB23

parent 2512f82d
......@@ -144,25 +144,9 @@ typedef enum {
} SCH_status_NB_IoT_t;
/*
typedef struct {
/// NB-IoT
/// Allocated RNTI (0 means DLSCH_t is not currently used)
uint16_t si_rnti; ///(=0xfff4)
SCH_status_NB_IoT_t status;
/// The scheduling the NPDCCH and the NPDSCH transmission TS 36.213 Table 16.4.1-1
uint8_t scheduling_delay;
/// The number of the subframe to transmit the NPDSCH Table TS 36.213 Table 16.4.1.3-1 (Nsf) (NB. in this case is not the index Isf)
uint8_t resource_assignment;
/// is the index that determined the repeat number of NPDSCH through table TS 36.213 Table 16.4.1.3-2 / for SIB1-NB Table 16.4.1.3-3
uint8_t repetition_number;
/// Determined the ACK/NACK delay and the subcarrier allocation TS 36.213 Table 16.4.2
uint8_t HARQ_ACK_resource;
/// Determined the repetition number value 0-3 (2 biut carried by the FAPI NPDCCH)
uint8_t dci_subframe_repetitions;
/// modulation always QPSK Qm = 2
uint8_t modulation;
typedef struct {
uint16_t si_rnti;
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e[1888];
/// data after scrambling
......@@ -170,9 +154,9 @@ typedef struct {
//length of the table e
uint16_t length_e; // new parameter
/// Tail-biting convolutional coding outputs
uint8_t d[96+(3*(24+152))]; // new parameter
uint8_t d[96+(3*(24+680))]; // new parameter
/// Sub-block interleaver outputs
uint8_t w[3*3*(152+24)]; // new parameter
uint8_t w[3*3*(680+24)]; // new parameter
/// Status Flag indicating for this DLSCH (idle,active,disabled)
//SCH_status_t status;
......@@ -188,17 +172,9 @@ typedef struct {
uint32_t frame;
/// Subframe where current HARQ round was sent
uint32_t subframe;
/// Index of current HARQ round for this DLSCH
uint8_t round;
/// MCS format for this NDLSCH , TS 36.213 Table 16.4.1.5
uint8_t mcs;
// we don't have code block segmentation / crc attachment / concatenation in NB-IoT R13 36.212 6.4.2
// we don't have beamforming in NB-IoT
//this index will be used mainly for SI message buffer
uint8_t pdu_buffer_index;
} NB_IoT_DL_eNB_SIB1_t;
*/
} NB_IoT_DL_eNB_SIB_t;
typedef struct {
/// NB-IoT
......@@ -590,8 +566,6 @@ typedef struct {
} DCI_PDU_NB_IoT;
typedef struct {
/// TX buffers for UE-spec transmission (antenna ports 5 or 7..14, prior to precoding)
int32_t *txdataF[8];
......@@ -611,33 +585,12 @@ typedef struct {
// NB_IoT_DL_eNB_SIB1_t harq_process_sib1;
//////////////////////////////////////////////////////////////////////
/// Allocated RNTI (0 means DLSCH_t is not currently used)
uint16_t si_rnti; ///(=0xfff4)
SCH_status_NB_IoT_t status;
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e[1888];
/// data after scrambling
uint8_t s_e[1888];
//length of the table e
uint16_t length_e; // new parameter
/// Tail-biting convolutional coding outputs
uint8_t d[96+(3*(24+680))]; // new parameter
/// Sub-block interleaver outputs
uint8_t w[3*3*(680+24)]; // new parameter
/// Status Flag indicating for this DLSCH (idle,active,disabled)
//SCH_status_t status;
/// Transport block size
uint32_t TBS;
/// The payload + CRC size in bits, "B" from 36-212
uint32_t B;
/// Pointer to the payload
uint8_t *b;
///pdu of the ndlsch message
uint8_t *pdu;
//this index will be used mainly for SI message buffer
uint8_t pdu_buffer_index;
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
NB_IoT_DL_eNB_SIB_t content_sib1;
NB_IoT_DL_eNB_SIB_t content_sib23;
/// Number of soft channel bits
uint32_t G;
......
......@@ -84,13 +84,13 @@ void ccode_encode_npdsch_NB_IoT (int32_t numbits,
}
int dlsch_encoding_NB_IoT(unsigned char *a,
NB_IoT_eNB_NDLSCH_t *dlsch,
uint8_t Nsf, // number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table)
unsigned int G) // G (number of available RE) is implicitly multiplied by 2 (since only QPSK modulation)
NB_IoT_DL_eNB_SIB_t *dlsch, //NB_IoT_eNB_NDLSCH_t
uint8_t Nsf, // number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table)
unsigned int G) // G (number of available RE) is implicitly multiplied by 2 (since only QPSK modulation)
{
uint32_t crc = 1;
//unsigned char harq_pid = dlsch->current_harq_pid; // to check during implementation if harq_pid is required in the NB_IoT_eNB_DLSCH_t structure in defs_NB_IoT.h
uint8_t option1,option2,option3,option4;
//uint8_t option1,option2,option3,option4;
unsigned int A;
uint8_t RCC;
......
......@@ -119,9 +119,10 @@ 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_DL_eNB_SIB_t *dlsch0, //NB_IoT_eNB_NDLSCH_t
int G, // number of bits per subframe
unsigned npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
unsigned subframe,
unsigned short NB_IoT_RB_ID)
{
//uint8_t harq_pid = dlsch0->current_harq_pid;
......@@ -158,14 +159,14 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF,
} else {
NB_IoT_start = 1 + (bandwidth_even_odd*6) + 12*(RB_IoT_ID % (int)(ceil(frame_parms->N_RB_DL/(float)2)));
}
symbol_offset = (14*4*frame_parms->ofdm_symbol_size) + frame_parms->ofdm_symbol_size*l + NB_IoT_start; // symbol_offset = 512 * L + NB_IOT_RB start
symbol_offset = (14*subframe*frame_parms->ofdm_symbol_size) + frame_parms->ofdm_symbol_size*l + NB_IoT_start; // symbol_offset = 512 * L + NB_IOT_RB start
allocate_REs_in_RB_NB_IoT(frame_parms,
txdataF,
&jj,
symbol_offset,
&dlsch0->e[G*npdsch_data_subframe],
&dlsch0->s_e[G*npdsch_data_subframe],
pilots,
amp,
id_offset,
......
......@@ -28,8 +28,8 @@
#include "PHY/impl_defs_lte.h"
#include "PHY/LTE_REFSIG/defs_NB_IoT.h"
void dlsch_sib1_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
NB_IoT_eNB_NDLSCH_t *dlsch,
void dlsch_sib_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
NB_IoT_DL_eNB_SIB_t *dlsch, //NB_IoT_eNB_NDLSCH_t
int tot_bits, // total number of bits to transmit
uint8_t Nf, // Nf is the frame number (0..9)
uint8_t Ns) // slot number (0..19)
......
......@@ -112,11 +112,12 @@ void npbch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t *npbch_e,
uint32_t length);
void dlsch_sib1_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
NB_IoT_eNB_NDLSCH_t *dlsch,
void dlsch_sib_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
NB_IoT_DL_eNB_SIB_t *dlsch, //NB_IoT_eNB_NDLSCH_t
int tot_bits,
uint8_t Nf,
uint8_t Nf,
uint8_t Ns);
/*
int scrambling_npbch_REs_rel_14(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **txdataF,
......@@ -247,13 +248,14 @@ 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_DL_eNB_SIB_t *dlsch0, //NB_IoT_eNB_NDLSCH_t
int G, // number of bits per subframe
unsigned npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
unsigned subframe,
unsigned short NB_IoT_RB_ID);
int32_t dlsch_encoding_NB_IoT(unsigned char *a,
NB_IoT_eNB_NDLSCH_t *dlsch,
NB_IoT_DL_eNB_SIB_t *dlsch, // NB_IoT_eNB_NDLSCH_t
uint8_t Nsf, // number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table)
unsigned int G); // G (number of available RE) is implicitly multiplied by 2 (since only QPSK modulation)
......
......@@ -511,7 +511,7 @@ typedef struct PHY_VARS_eNB_s {
NB_IoT_eNB_NPBCH_t npbch;
NB_IoT_eNB_NDLSCH_t *ndlsch[NUMBER_OF_UE_MAX];
NB_IoT_eNB_NDLSCH_t ndlsch_SIB1;
NB_IoT_eNB_NDLSCH_t ndlsch_SIB;
//////////////////// END /////////////////////////////////
......
......@@ -222,7 +222,9 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
//LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms_NB_IoT;
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
NB_IoT_eNB_NPBCH_t *broadcast_str = &eNB->npbch;
NB_IoT_eNB_NDLSCH_t *sib1 = &eNB->ndlsch_SIB1;
//NB_IoT_eNB_NDLSCH_t *sib1 = &eNB->ndlsch_SIB;
NB_IoT_DL_eNB_SIB_t *sib1 = &eNB->ndlsch_SIB.content_sib1;
NB_IoT_DL_eNB_SIB_t *sib23 = &eNB->ndlsch_SIB.content_sib23;
int **txdataF = eNB->common_vars.txdataF[0];
int subframe = proc->subframe_tx;
uint32_t frame = proc->frame_tx;
......@@ -243,9 +245,20 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
printf("%02X ",eNB_rrc_inst_NB_IoT->carrier[0].MIB_NB_IoT[i]);
printf("\n");*/
}
if(frame%64==1 && subframe ==0)
{//printf("dooooo MIB");
do_SIB1_NB_IoT_x(0,0,carrier,208,92,1,3584,7,2,hyper_frame);
/* for(int i = 0; i<5;i++)
printf("%02X ",eNB_rrc_inst_NB_IoT->carrier[0].MIB_NB_IoT[i]);
printf("\n");*/
}
/////////////////////////////////////////////////////////////////////////////////
//uint8_t *control_region_size = get_NB_IoT_SIB1_eutracontrolregionsize();
int G=0;
//int G=0;
//NSSS only happened in the even frame
......@@ -283,7 +296,7 @@ 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 *sib1_pdu = get_NB_IoT_SIB1();
uint8_t *sib23_pdu = get_NB_IoT_SIB23();
if(subframe == 0)
......@@ -299,7 +312,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
}
///////////////////////////////////////////////////////// SIB1 ////////////////////////////////////////////////////////
if((subframe == 4) && (frame%2==0) && (frame%32<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) )
{
if( frame%32 == 0 )
......@@ -310,11 +323,11 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
236); //////////// G*2
/* dlsch_sib1_scrambling_NB_IoT(fp, // is called only in subframe 4
dlsch_sib_scrambling_NB_IoT(fp, // is called only in subframe 4
sib1,
1888, ////// total_bits
frame,
subframe*2);*/
subframe*2);
}
dlsch_modulation_NB_IoT(txdataF,
......@@ -324,10 +337,59 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
sib1,
236, // number of bits per subframe
((frame%32)/2),///npdsch_data_subframe, data per subframe//subframe index of the data table of npdsch channel (G*Nsf) ((frame%32)/2),values are between 0..Nsf
4,
RB_IoT_ID);
}
///////////////////////////////////////////////////////// END ////////////////////////////////////////////////////////
//////////////////////////////////////////////////// SIB23 ////////////////////////////////////////////////////////////////////////
if( (subframe >0) && (subframe <5) && (subframe >5) && (With_NSSS == 0) && (frame%2==1) && (frame%64<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) )
{
if( subframe == 1 )
{
dlsch_encoding_NB_IoT(sib23_pdu,
sib23,
8, ///// number_of_subframes_required
236); //////////// G*2
dlsch_sib_scrambling_NB_IoT(fp, // is called only in subframe 4
sib23,
1888, ////// total_bits
frame,
subframe*2);
}
if( subframe < 5 )
{
dlsch_modulation_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)
sib23,
236, // number of bits per subframe
(subframe-1),///npdsch_data_subframe, data per subframe//subframe index of the data table of npdsch channel (G*Nsf) ((frame%32)/2),values are between 0..Nsf
subframe,
RB_IoT_ID);
} else {
dlsch_modulation_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)
sib1,
236, // number of bits per subframe
(subframe-2),///npdsch_data_subframe, data per subframe//subframe index of the data table of npdsch channel (G*Nsf) ((frame%32)/2),values are between 0..Nsf
subframe,
RB_IoT_ID);
}
}
//////////////////////////////////////////////////// END ////////////////////////////////////////////////////////////////////////
generate_pilots_NB_IoT(eNB,
txdataF,
AMP,
......
......@@ -84,6 +84,15 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id,
uint32_t frame
);
uint8_t do_SIB1_NB_IoT_x(uint8_t Mod_id, int CC_id,
rrc_eNB_carrier_data_NB_IoT_t *carrier,
uint16_t mcc, //208
uint16_t mnc, //92
uint16_t tac, //1
uint32_t cell_identity, //3584
uint16_t band, // 7
uint16_t mnc_digit_length,
uint32_t frame);
/**
\brief Generate a default configuration for SIB2/SIB3-NB in one System Information PDU (eNB).
@param Mod_id Index of eNB (used to derive some parameters)
......
......@@ -37,9 +37,11 @@
#include "LAYER2/MAC/defs_NB_IoT.h"
/*NOTE: no static function should be declared in this header file (e.g. init_SI_NB)*/
uint8_t *get_NB_IoT_MIB(void);
uint8_t *get_NB_IoT_SIB1(void);
uint8_t *get_NB_IoT_MIB(void);
uint8_t *get_NB_IoT_SIB23(void);
long *get_NB_IoT_SIB1_eutracontrolregionsize(void);
......
......@@ -130,6 +130,11 @@ uint8_t *get_NB_IoT_SIB1(void)
return eNB_rrc_inst_NB_IoT->carrier[0].SIB1_NB_IoT;
}
uint8_t *get_NB_IoT_SIB23(void)
{
return eNB_rrc_inst_NB_IoT->carrier[0].SIB23_NB_IoT;
}
long *get_NB_IoT_SIB1_eutracontrolregionsize(void)
{
return eNB_rrc_inst_NB_IoT->carrier[0].sib1_NB_IoT->eutraControlRegionSize_r13;
......
......@@ -54,7 +54,8 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
PHY_vars_eNB->frame_parms.Nid_cell = Nid_cell; ///////((Nid_cell/3)*3)+((eNB_id+Nid_cell)%3);
PHY_vars_eNB->frame_parms.nushift = PHY_vars_eNB->frame_parms.Nid_cell%6;
// for NB-IoT testing
PHY_vars_eNB->ndlsch_SIB1.si_rnti = 0xffff;
PHY_vars_eNB->ndlsch_SIB.content_sib1.si_rnti = 0xffff;
PHY_vars_eNB->ndlsch_SIB.content_sib23.si_rnti = 0xffff;
////////////////////////////
phy_init_lte_eNB(PHY_vars_eNB,0,abstraction_flag);
......
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