Commit c7d050c1 authored by Matthieu Kanj's avatar Matthieu Kanj

generalization of PHY TX

parent 5d09a92d
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
// //
#define MAX_NUM_DLSCH_SEGMENTS_NB_IoT 16 #define MAX_NUM_DLSCH_SEGMENTS_NB_IoT 16
#define MAX_NUM_ULSCH_SEGMENTS_NB_IoT MAX_NUM_DLSCH_SEGMENTS_NB_IoT #define MAX_NUM_ULSCH_SEGMENTS_NB_IoT MAX_NUM_DLSCH_SEGMENTS_NB_IoT
#define MAX_NUM_BITS_IN_DL_PER_SF_NB_IoT 284 // case one NB-IoT antenna && one LTE antenna
//#define MAX_DLSCH_PAYLOAD_BYTES (MAX_NUM_DLSCH_SEGMENTS*768) //#define MAX_DLSCH_PAYLOAD_BYTES (MAX_NUM_DLSCH_SEGMENTS*768)
//#define MAX_ULSCH_PAYLOAD_BYTES (MAX_NUM_ULSCH_SEGMENTS*768) //#define MAX_ULSCH_PAYLOAD_BYTES (MAX_NUM_ULSCH_SEGMENTS*768)
// //
...@@ -71,6 +73,8 @@ ...@@ -71,6 +73,8 @@
// //
//// for NB-IoT //// for NB-IoT
#define MAX_NUM_CHANNEL_BITS_NB_IoT 3360 //14 symbols * 12 sub-carriers * 10 SF * 2bits/RE // to check during real tests #define MAX_NUM_CHANNEL_BITS_NB_IoT 3360 //14 symbols * 12 sub-carriers * 10 SF * 2bits/RE // to check during real tests
#define MAX_NUM_DL_CHANNEL_BITS_NB_IoT 2840 //284* 10 SF // case In-band operation mode witn 1 NB-IoT antenna && 1 LTE antenna //
#define MAX_TBS_DL_SIZE_BITS_NB_IoT 680 // in release 13 // in release 14 = 2048 // ??? **** not sure #define MAX_TBS_DL_SIZE_BITS_NB_IoT 680 // in release 13 // in release 14 = 2048 // ??? **** not sure
////#define MAX_NUM_CHANNEL_BITS_NB_IOT 3*680 /// ??? ****not sure ////#define MAX_NUM_CHANNEL_BITS_NB_IOT 3*680 /// ??? ****not sure
// //
...@@ -148,16 +152,15 @@ typedef enum { ...@@ -148,16 +152,15 @@ typedef enum {
typedef struct { typedef struct {
uint16_t si_rnti; uint16_t si_rnti;
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18) /// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e[1888]; uint8_t e[MAX_NUM_DL_CHANNEL_BITS_NB_IoT];
/// data after scrambling /// data after scrambling
uint8_t s_e[1888]; uint8_t s_e[MAX_NUM_DL_CHANNEL_BITS_NB_IoT];
//length of the table e //length of the table e
uint16_t length_e; // new parameter uint16_t length_e; // new parameter
/// Tail-biting convolutional coding outputs /// Tail-biting convolutional coding outputs
uint8_t d[96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT))]; // new parameter uint8_t d[96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT))]; // new parameter
/// Sub-block interleaver outputs /// Sub-block interleaver outputs
uint8_t w[3*3*(MAX_TBS_DL_SIZE_BITS_NB_IoT+24)]; // new parameter uint8_t w[3*3*(MAX_TBS_DL_SIZE_BITS_NB_IoT+24)]; // new parameter
/// Status Flag indicating for this DLSCH (idle,active,disabled) /// Status Flag indicating for this DLSCH (idle,active,disabled)
//SCH_status_t status; //SCH_status_t status;
/// Transport block size /// Transport block size
...@@ -179,29 +182,28 @@ typedef struct { ...@@ -179,29 +182,28 @@ typedef struct {
typedef struct { typedef struct {
uint16_t si_rnti; uint16_t si_rnti;
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18) /// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e[236]; uint8_t e[MAX_NUM_DL_CHANNEL_BITS_NB_IoT];
/// data after scrambling /// data after scrambling
uint8_t s_e[236]; uint8_t s_e[MAX_NUM_DL_CHANNEL_BITS_NB_IoT];
//length of the table e //length of the table e
uint16_t length_e; // new parameter uint16_t length_e; // new parameter
/// Tail-biting convolutional coding outputs /// Tail-biting convolutional coding outputs
uint8_t d[96+(3*(24+56))]; // new parameter uint8_t d[96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT))]; // new parameter
/// Sub-block interleaver outputs /// Sub-block interleaver outputs
uint8_t w[3*3*(56+24)]; // new parameter uint8_t w[3*3*(MAX_TBS_DL_SIZE_BITS_NB_IoT+24)]; // new parameter
///////////////////////////////// /////////////////////////////////
uint16_t si_rnti_x; uint16_t si_rnti_x;
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18) /// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e_x[472]; uint8_t e_x[MAX_NUM_DL_CHANNEL_BITS_NB_IoT];
/// data after scrambling /// data after scrambling
uint8_t s_e_x[472]; uint8_t s_e_x[MAX_NUM_DL_CHANNEL_BITS_NB_IoT];
//length of the table e //length of the table e
uint16_t length_e_x; // new parameter uint16_t length_e_x; // new parameter
/// Tail-biting convolutional coding outputs /// Tail-biting convolutional coding outputs
uint8_t d_x[96+(3*(24+256))]; // new parameter uint8_t d_x[96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT))]; // new parameter
/// Sub-block interleaver outputs /// Sub-block interleaver outputs
uint8_t w_x[3*3*(256+24)]; // new parameter uint8_t w_x[3*3*(MAX_TBS_DL_SIZE_BITS_NB_IoT+24)]; // new parameter
//////////////////////////////// ////////////////////////////////
/// Status Flag indicating for this DLSCH (idle,active,disabled) /// Status Flag indicating for this DLSCH (idle,active,disabled)
//SCH_status_t status; //SCH_status_t status;
/// Transport block size /// Transport block size
...@@ -236,16 +238,15 @@ typedef struct { ...@@ -236,16 +238,15 @@ typedef struct {
/// modulation always QPSK Qm = 2 /// modulation always QPSK Qm = 2
uint8_t modulation; uint8_t modulation;
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18) /// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e[MAX_NUM_CHANNEL_BITS_NB_IoT]; uint8_t e[MAX_NUM_DL_CHANNEL_BITS_NB_IoT];
/// data after scrambling /// data after scrambling
uint8_t s_e[MAX_NUM_CHANNEL_BITS_NB_IoT]; uint8_t s_e[MAX_NUM_DL_CHANNEL_BITS_NB_IoT];
//length of the table e //length of the table e
uint16_t length_e; // new parameter uint16_t length_e; // new parameter
/// Tail-biting convolutional coding outputs /// Tail-biting convolutional coding outputs
uint8_t d[96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT))]; // new parameter uint8_t d[96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT))]; // new parameter
/// Sub-block interleaver outputs /// Sub-block interleaver outputs
uint8_t w[3*3*(MAX_TBS_DL_SIZE_BITS_NB_IoT+24)]; // new parameter uint8_t w[3*3*(MAX_TBS_DL_SIZE_BITS_NB_IoT+24)]; // new parameter
/// Status Flag indicating for this DLSCH (idle,active,disabled) /// Status Flag indicating for this DLSCH (idle,active,disabled)
//SCH_status_t status; //SCH_status_t status;
/// Transport block size /// Transport block size
...@@ -611,10 +612,7 @@ typedef struct { ...@@ -611,10 +612,7 @@ typedef struct {
typedef struct { typedef struct {
/// TX buffers for UE-spec transmission (antenna ports 5 or 7..14, prior to precoding)
int32_t *txdataF[8];
/// dl channel estimates (estimated from ul channel estimates)
int32_t **calib_dl_ch_estimates;
/// Allocated RNTI (0 means DLSCH_t is not currently used) /// Allocated RNTI (0 means DLSCH_t is not currently used)
uint16_t rnti; uint16_t rnti;
/// Active flag for baseband transmitter processing /// Active flag for baseband transmitter processing
...@@ -631,21 +629,16 @@ typedef struct { ...@@ -631,21 +629,16 @@ typedef struct {
SCH_status_NB_IoT_t status; SCH_status_NB_IoT_t status;
////////////////////////////////////////////////////////////////////// /* //////////////////////////////////////////////////////////////////////
NB_IoT_DL_eNB_SIB_t content_sib1; NB_IoT_DL_eNB_SIB_t content_sib1;
NB_IoT_DL_eNB_SIB_t content_sib23; NB_IoT_DL_eNB_SIB_t content_sib23;
NB_IoT_DL_eNB_RAR_t content_rar; NB_IoT_DL_eNB_RAR_t content_rar;
*/ //////////////////////////////////////////////////////////////////////
/// Number of soft channel bits /// Number of soft channel bits
uint32_t G; uint32_t G;
/// Maximum number of HARQ rounds
uint8_t Mlimit;
/// Nsoft parameter related to UE Category
uint32_t Nsoft;
/// amplitude of PDSCH (compared to RS) in symbols without pilots
int16_t sqrt_rho_a;
/// amplitude of PDSCH (compared to RS) in symbols containing pilots
int16_t sqrt_rho_b;
///NB-IoT ///NB-IoT
/// may use in the npdsch_procedures /// may use in the npdsch_procedures
uint16_t scrambling_sequence_intialization; uint16_t scrambling_sequence_intialization;
......
...@@ -30,14 +30,15 @@ ...@@ -30,14 +30,15 @@
* \warning * \warning
*/ */
#include <string.h> #include <string.h>
//#include "PHY/defs.h" //#include "PHY/impl_defs_lte.h"
//#include "PHY/defs_NB_IoT.h" //#include "openair2/COMMON/openair_defs.h"
#include "PHY/defs.h"
//#include "PHY/extern_NB_IoT.h" //#include "PHY/extern_NB_IoT.h"
#include "PHY/CODING/defs_NB_IoT.h" #include "PHY/CODING/defs_NB_IoT.h"
//#include "PHY/CODING/extern.h" //#include "PHY/CODING/extern.h"
//#include "PHY/CODING/lte_interleaver_inline.h" //#include "PHY/CODING/lte_interleaver_inline.h"
#include "PHY/LTE_TRANSPORT/defs_NB_IoT.h" #include "PHY/LTE_TRANSPORT/defs_NB_IoT.h"
//#include "PHY/LTE_TRANSPORT/proto_NB_IoT.h" #include "PHY/LTE_TRANSPORT/proto.h"
//#include "SCHED/defs_NB_IoT.h" //#include "SCHED/defs_NB_IoT.h"
//#include "defs_nb_iot.h" //#include "defs_nb_iot.h"
//#include "UTIL/LOG/vcd_signal_dumper.h" //#include "UTIL/LOG/vcd_signal_dumper.h"
...@@ -46,6 +47,44 @@ ...@@ -46,6 +47,44 @@
unsigned char ccodelte_table2_NB_IoT[128]; unsigned char ccodelte_table2_NB_IoT[128];
unsigned short glte2_NB_IoT[] = { 0133, 0171, 0165 }; unsigned short glte2_NB_IoT[] = { 0133, 0171, 0165 };
void free_eNB_dlsch_NB_IoT(NB_IoT_eNB_NDLSCH_t *dlsch)
{
if (dlsch) {
/*
#ifdef DEBUG_DLSCH_FREE
printf("Freeing dlsch %p\n",dlsch);
#endif*/
if (dlsch->harq_process) {
if (dlsch->harq_process->b) {
free16(dlsch->harq_process->b,300);
dlsch->harq_process->b = NULL;
}
if (dlsch->harq_process->d) {
free16(dlsch->harq_process->d,96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT)));
// dlsch->harq_process->d = NULL;
}
free16(dlsch->harq_process,sizeof(NB_IoT_DL_eNB_HARQ_t));
dlsch->harq_process = NULL;
}
free16(dlsch,sizeof(NB_IoT_eNB_NDLSCH_t));
dlsch = NULL;
}
}
void ccode_encode_npdsch_NB_IoT (int32_t numbits, void ccode_encode_npdsch_NB_IoT (int32_t numbits,
uint8_t *inPtr, uint8_t *inPtr,
uint8_t *outPtr, uint8_t *outPtr,
...@@ -83,8 +122,10 @@ void ccode_encode_npdsch_NB_IoT (int32_t numbits, ...@@ -83,8 +122,10 @@ void ccode_encode_npdsch_NB_IoT (int32_t numbits,
} }
} }
///////////////////////////////////////////////////////////////////////////////
int dlsch_encoding_NB_IoT(unsigned char *a, int dlsch_encoding_NB_IoT(unsigned char *a,
NB_IoT_DL_eNB_SIB_t *dlsch, //NB_IoT_eNB_NDLSCH_t NB_IoT_DL_eNB_HARQ_t *dlsch, //NB_IoT_eNB_NDLSCH_t
uint8_t Nsf, // number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table) uint8_t Nsf, // number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table)
unsigned int G, unsigned int G,
uint8_t option) // G (number of available RE) is implicitly multiplied by 2 (since only QPSK modulation) uint8_t option) // G (number of available RE) is implicitly multiplied by 2 (since only QPSK modulation)
...@@ -92,45 +133,37 @@ int dlsch_encoding_NB_IoT(unsigned char *a, ...@@ -92,45 +133,37 @@ int dlsch_encoding_NB_IoT(unsigned char *a,
uint32_t crc = 1; 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 //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; unsigned int A=0;
uint8_t RCC; A = dlsch->TBS / 8;
uint8_t npbch_a[85]; uint8_t RCC;
uint8_t npbch_a_crc[88];
bzero(npbch_a,85);
bzero(npbch_a_crc,88);
A = 680; uint8_t npbch_a[A];
uint8_t npbch_a_crc[A+3];
bzero(npbch_a,A);
bzero(npbch_a_crc,A+3);
dlsch->length_e = G*Nsf; // G*Nsf (number_of_subframes) = total number of bits to transmit G=236 dlsch->length_e = G*Nsf; // G*Nsf (number_of_subframes) = total number of bits to transmit G=236
int32_t numbits = A+24;
if(option ==1) for (int i=0; i<A; i++)
{
for (int i=0; i<19; i++)
{
npbch_a[i] = a[i];
}
} else {
for (int i=0; i<33; i++)
{ {
npbch_a[i] = a[i]; npbch_a[i] = a[i];
} }
}
int32_t numbits = (A*8)+24;
crc = crc24a_NB_IoT(npbch_a,A)>>8; crc = crc24a_NB_IoT(npbch_a,A)>>8;
for (int j=0; j<85; j++) for (int j=0; j<A; j++)
{ {
npbch_a_crc[j] = npbch_a[j]; npbch_a_crc[j] = npbch_a[j];
} }
npbch_a_crc[85] = ((uint8_t*)&crc)[2]; npbch_a_crc[A] = ((uint8_t*)&crc)[2];
npbch_a_crc[86] = ((uint8_t*)&crc)[1]; npbch_a_crc[A+1] = ((uint8_t*)&crc)[1];
npbch_a_crc[87] = ((uint8_t*)&crc)[0]; npbch_a_crc[A+2] = ((uint8_t*)&crc)[0];
dlsch->B = numbits; // The length of table b in bits dlsch->B = numbits; // The length of table b in bits
//memcpy(dlsch->b,a,numbits/8); // comment if option 2 //memcpy(dlsch->b,a,numbits/8); // comment if option 2
...@@ -139,111 +172,96 @@ if(option ==1) ...@@ -139,111 +172,96 @@ if(option ==1)
RCC = sub_block_interleaving_cc_NB_IoT(numbits,dlsch->d+96,dlsch->w); // step 2 interleaving RCC = sub_block_interleaving_cc_NB_IoT(numbits,dlsch->d+96,dlsch->w); // step 2 interleaving
lte_rate_matching_cc_NB_IoT(RCC,dlsch->length_e,dlsch->w,dlsch->e); // step 3 Rate Matching lte_rate_matching_cc_NB_IoT(RCC,dlsch->length_e,dlsch->w,dlsch->e); // step 3 Rate Matching
return(0); return(0);
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
////////////////////////////////temp function//////////////////////////////////////// NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB_IoT(uint8_t type, LTE_DL_FRAME_PARMS* frame_parms)
///////////////////////////////////////////////////////////////////////////////
int dlsch_encoding_rar_NB_IoT(unsigned char *a,
NB_IoT_DL_eNB_RAR_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,
uint8_t option) // 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;
unsigned int A;
uint8_t RCC;
uint8_t npbch_a[7];
uint8_t npbch_a_crc[10];
bzero(npbch_a,7);
bzero(npbch_a_crc,10);
/*uint8_t npbch_a_x[15];
uint8_t npbch_a_crc_x[18];
bzero(npbch_a_x,15);
bzero(npbch_a_crc_x,18);*/
uint8_t npbch_a_x[32]; NB_IoT_eNB_NDLSCH_t *dlsch;
uint8_t npbch_a_crc_x[35]; unsigned char exit_flag = 0,r;
bzero(npbch_a_x,32);
bzero(npbch_a_crc_x,35);
dlsch = (NB_IoT_eNB_NDLSCH_t *)malloc16(sizeof(NB_IoT_eNB_NDLSCH_t));
if (dlsch) {
dlsch->length_e = G*Nsf; // G*Nsf (number_of_subframes) = total number of bits to transmit G=236 bzero(dlsch,sizeof(NB_IoT_eNB_NDLSCH_t));
dlsch->harq_process = (NB_IoT_DL_eNB_HARQ_t *)malloc16(sizeof(NB_IoT_DL_eNB_HARQ_t));
if (dlsch->harq_process) {
bzero(dlsch->harq_process,sizeof(NB_IoT_DL_eNB_HARQ_t));
// dlsch->harq_processes[i]->first_tx=1;
dlsch->harq_process->b = (unsigned char*)malloc(300); // to set a new one that replace 300 , MAX_DLSCH_PAYLOAD_BYTES/bw_scaling
if(option ==1) if (dlsch->harq_process->b) {
{ bzero(dlsch->harq_process->b,300);
A = 56; } else {
for (int i=0; i<7; i++) printf("Can't get b\n");
{ exit_flag=1;
npbch_a[i] = a[i];
}
} else {
A = 256;
for (int i=0; i<32; i++)
{
npbch_a_x[i] = a[i];
} }
}
int32_t numbits = A+24; // if (abstraction_flag==0) {
// account for filler in first segment and CRCs for multiple segment case
// dlsch->harq_process->c[0] = (uint8_t*)malloc16(3*3*(MAX_TBS_DL_SIZE_BITS_NB_IoT+24));
// dlsch->harq_process->d[0] = (uint8_t*)malloc(96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT)));
/// dlsch->harq_process->e[0] = (uint8_t*)malloc(MAX_NUM_DL_CHANNEL_BITS_NB_IoT);
// dlsch->harq_process->s_e[0] = (uint8_t*)malloc(MAX_NUM_DL_CHANNEL_BITS_NB_IoT);
if(option==1) /* if (dlsch->harq_process->c[0]) {
{
crc = crc24a_NB_IoT(npbch_a,A)>>8;
bzero(dlsch->harq_process->c[0],3*3*(MAX_TBS_DL_SIZE_BITS_NB_IoT+24));
} else {
for (int j=0; j<7; j++) printf("Can't get c\n");
{ exit_flag=2;
npbch_a_crc[j] = npbch_a[j];
} }
*/
npbch_a_crc[7] = ((uint8_t*)&crc)[2]; if (dlsch->harq_process->d) {
npbch_a_crc[8] = ((uint8_t*)&crc)[1]; bzero((void *)dlsch->harq_process->d,96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT)));
npbch_a_crc[9] = ((uint8_t*)&crc)[0];
dlsch->B = numbits; // The length of table b in bits
//memcpy(dlsch->b,a,numbits/8); // comment if option 2
memset(dlsch->d,LTE_NULL_NB_IoT,96);
ccode_encode_npdsch_NB_IoT(numbits,npbch_a_crc,dlsch->d+96,crc);
RCC = sub_block_interleaving_cc_NB_IoT(numbits,dlsch->d+96,dlsch->w); // step 2 interleaving
lte_rate_matching_cc_NB_IoT(RCC,dlsch->length_e,dlsch->w,dlsch->e); // step 3 Rate Matching
} else { } else {
printf("Can't get d\n");
exit_flag=2;
}
crc = crc24a_NB_IoT(npbch_a_x,A)>>8; // }
} else {
for (int j=0; j<32; j++) exit_flag=3;
{
npbch_a_crc_x[j] = npbch_a_x[j];
} }
npbch_a_crc_x[32] = ((uint8_t*)&crc)[2];
npbch_a_crc_x[33] = ((uint8_t*)&crc)[1];
npbch_a_crc_x[34] = ((uint8_t*)&crc)[0];
dlsch->B = numbits; // The length of table b in bits if (exit_flag==0) {
//memcpy(dlsch->b,a,numbits/8); // comment if option 2
memset(dlsch->d_x,LTE_NULL_NB_IoT,96); dlsch->harq_process->round=0;
ccode_encode_npdsch_NB_IoT(numbits,npbch_a_crc_x,dlsch->d_x+96,crc);
RCC = sub_block_interleaving_cc_NB_IoT(numbits,dlsch->d_x+96,dlsch->w_x); // step 2 interleaving // for (r=0; r<(96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT))); r++) {
lte_rate_matching_cc_NB_IoT(RCC,dlsch->length_e_x,dlsch->w_x,dlsch->e_x); // step 3 Rate Matching //
// if (dlsch->harq_process->d)
// dlsch->harq_process->d[0]= LTE_NULL_NB_IoT;
// }
return(dlsch);
}
} }
/// LOG_D(PHY,"new_eNB_dlsch exit flag %d, size of %ld\n",
// exit_flag, sizeof(NB_IoT_eNB_NDLSCH_t));
free_eNB_dlsch_NB_IoT(dlsch);
return(NULL);
return(0);
} }
/************************************************************************* /*************************************************************************
Functions to initialize the code tables Functions to initialize the code tables
......
...@@ -137,7 +137,7 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF, ...@@ -137,7 +137,7 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF,
int16_t amp, int16_t amp,
LTE_DL_FRAME_PARMS *frame_parms, 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) 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_DL_eNB_SIB_t *dlsch0, //NB_IoT_eNB_NDLSCH_t NB_IoT_DL_eNB_HARQ_t *dlsch0, //NB_IoT_eNB_NDLSCH_t
int G, // number of bits per subframe 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 npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
unsigned int subframe, unsigned int subframe,
...@@ -196,82 +196,3 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF, ...@@ -196,82 +196,3 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF,
return (re_allocated); return (re_allocated);
} }
////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
////////////////////////////tmp functions /////////////////////////////////
int dlsch_modulation_rar_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_DL_eNB_RAR_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,
unsigned short NB_IoT_RB_ID,
uint8_t option)
{
//uint8_t harq_pid = dlsch0->current_harq_pid;
//NB_IoT_DL_eNB_HARQ_t *dlsch0_harq = dlsch0->harq_processes[harq_pid];
uint32_t jj = 0;
uint32_t re_allocated,symbol_offset;
uint16_t l;
uint8_t id_offset,pilot_shift,pilots = 0;
unsigned short bandwidth_even_odd;
unsigned short NB_IoT_start, RB_IoT_ID;
re_allocated = 0;
id_offset = 0;
pilot_shift = 0;
// testing if the total number of RBs is even or odd
bandwidth_even_odd = frame_parms->N_RB_DL % 2; // 0 even, 1 odd
RB_IoT_ID = NB_IoT_RB_ID;
// step 5, 6, 7 // modulation and mapping (slot 1, symbols 0..3)
for (l=control_region_size; l<14; l++) { // loop on OFDM symbols
if((l>=4 && l<=7) || (l>=11 && l<=13))
{
pilots = 1;
if(l==4 || l==6 || l==11 || l==13)
{
pilot_shift = 1;
}
} else {
pilots = 0;
}
id_offset = frame_parms->Nid_cell % 6; // Cell_ID_NB_IoT % 6
if(RB_IoT_ID < (frame_parms->N_RB_DL/2))
{
NB_IoT_start = frame_parms->ofdm_symbol_size - 12*(frame_parms->N_RB_DL/2) - (bandwidth_even_odd*6) + 12*(RB_IoT_ID % (int)(ceil(frame_parms->N_RB_DL/(float)2)));
} 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*subframe*frame_parms->ofdm_symbol_size) + frame_parms->ofdm_symbol_size*l + NB_IoT_start; // symbol_offset = 512 * L + NB_IOT_RB start
if(option ==2)
{
allocate_REs_in_RB_NB_IoT(frame_parms,
txdataF,
&jj,
symbol_offset,
&dlsch0->s_e[236],
pilots,
amp,
id_offset,
pilot_shift,
&re_allocated);
} else {
allocate_REs_in_RB_NB_IoT(frame_parms,
txdataF,
&jj,
symbol_offset,
&dlsch0->s_e[0],
pilots,
amp,
id_offset,
pilot_shift,
&re_allocated);
}
}
// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_MODULATION, VCD_FUNCTION_OUT);
return (re_allocated);
}
\ No newline at end of file
...@@ -77,7 +77,7 @@ void dlsch_sib_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -77,7 +77,7 @@ void dlsch_sib_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
} }
void dlsch_sib_scrambling_rar_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, void dlsch_sib_scrambling_rar_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
NB_IoT_DL_eNB_RAR_t *dlsch, NB_IoT_DL_eNB_HARQ_t *dlsch,
int tot_bits, // total number of bits to transmit int tot_bits, // total number of bits to transmit
uint16_t Nf, // Nf is the frame number (0..9) uint16_t Nf, // Nf is the frame number (0..9)
uint8_t Ns, uint8_t Ns,
...@@ -106,6 +106,37 @@ void dlsch_sib_scrambling_rar_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -106,6 +106,37 @@ void dlsch_sib_scrambling_rar_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
} }
void dlsch_scrambling_Gen_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
NB_IoT_eNB_NDLSCH_t *dlsch,
int tot_bits, // total number of bits to transmit
uint16_t Nf, // Nf is the frame number (0..9)
uint8_t Ns,
uint32_t rnti)
{
int i,j,k=0;
uint32_t x1,x2, s=0;
uint8_t *e = dlsch->harq_process->e; //uint8_t *e=dlsch->harq_processes[dlsch->current_harq_pid]->e;
//x2 = (dlsch->si_rnti<<15) + (frame_parms->Nid_cell + 1) * ( (Nf % 61) + 1 ) ;
x2 = (rnti<<14) + ((Nf%2)<<13) + ((Ns>>1)<<9) + frame_parms->Nid_cell;
// for NPDSCH not carriying SIBs
//x2 = (dlsch->harq_process_sib1.rnti<<14) + ((Nf%2)<<13) + ((Ns>>1)<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 10.2.3.1
s = lte_gold_generic_NB_IoT(&x1, &x2, 1);
for (i=0; i<(1+(tot_bits>>5)); i++) {
for (j=0; j<32; j++,k++) {
dlsch->harq_process->s_e[k] = (e[k]&1) ^ ((s>>j)&1);
}
s = lte_gold_generic_NB_IoT(&x1, &x2, 0);
}
}
void init_unscrambling_lut_NB_IoT() { void init_unscrambling_lut_NB_IoT() {
......
...@@ -31,6 +31,7 @@ extern unsigned char cs_ri_extended_NB_IoT[4]; ...@@ -31,6 +31,7 @@ extern unsigned char cs_ri_extended_NB_IoT[4];
extern unsigned char cs_ack_normal_NB_IoT[4]; extern unsigned char cs_ack_normal_NB_IoT[4];
extern unsigned char cs_ack_extended_NB_IoT[4]; extern unsigned char cs_ack_extended_NB_IoT[4];
extern int8_t wACK_RX_NB_IoT[5][4]; extern int8_t wACK_RX_NB_IoT[5][4];
extern int G_tab[18];
extern short conjugate[8],conjugate2[8]; extern short conjugate[8],conjugate2[8];
......
...@@ -32,7 +32,9 @@ ...@@ -32,7 +32,9 @@
//#include "PHY/defs.h" //#include "PHY/defs.h"
//#include "PHY/extern.h" //#include "PHY/extern.h"
#include "PHY/LTE_TRANSPORT/proto_NB_IoT.h" #include "PHY/LTE_TRANSPORT/proto_NB_IoT.h"
#include "PHY/LTE_TRANSPORT/extern_NB_IoT.h"
unsigned char get_Qm_ul_NB_IoT(unsigned char I_MCS, uint8_t N_sc_RU) unsigned char get_Qm_ul_NB_IoT(unsigned char I_MCS, uint8_t N_sc_RU)
{ {
...@@ -48,3 +50,50 @@ unsigned char get_Qm_ul_NB_IoT(unsigned char I_MCS, uint8_t N_sc_RU) ...@@ -48,3 +50,50 @@ unsigned char get_Qm_ul_NB_IoT(unsigned char I_MCS, uint8_t N_sc_RU)
} }
int get_G_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms)
{
uint16_t num_ctrl_symbols = frame_parms->control_region_size;
uint8_t nb_antennas_tx_LTE = frame_parms->nb_antennas_tx;
uint8_t nb_antennas_tx_NB_IoT = frame_parms->nb_antennas_tx_NB_IoT;
int G_value=0;
switch (nb_antennas_tx_NB_IoT + (2*nb_antennas_tx_LTE)) {
case 10 :
G_value = G_tab[(1*3)-num_ctrl_symbols];
break;
case 6:
G_value = G_tab[(2*3)-num_ctrl_symbols];
break;
case 4 :
G_value = G_tab[(3*3)-num_ctrl_symbols];
break;
case 9 :
G_value = G_tab[(4*3)-num_ctrl_symbols];
break;
case 5:
G_value = G_tab[(5*3)-num_ctrl_symbols];
break;
case 3 :
G_value = G_tab[(6*3)-num_ctrl_symbols];
break;
default:
printf("Error getting G");
}
return(G_value);
}
...@@ -38,9 +38,12 @@ ...@@ -38,9 +38,12 @@
#include "PHY/defs_NB_IoT.h" #include "PHY/defs_NB_IoT.h"
#include "PHY/impl_defs_lte.h" #include "PHY/impl_defs_lte.h"
#include "PHY/defs.h" #include "PHY/defs.h"
//#include "PHY/LTE_TRANSPORT/defs_NB_IoT.h"
//#include <math.h> //#include <math.h>
//NPSS //NPSS
void free_eNB_dlsch_NB_IoT(NB_IoT_eNB_NDLSCH_t *dlsch);
void init_unscrambling_lut_NB_IoT(void); void init_unscrambling_lut_NB_IoT(void);
int generate_npss_NB_IoT(int32_t **txdataF, int generate_npss_NB_IoT(int32_t **txdataF,
...@@ -124,11 +127,28 @@ void dlsch_sib_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -124,11 +127,28 @@ void dlsch_sib_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t Ns); uint8_t Ns);
void dlsch_sib_scrambling_rar_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, void dlsch_sib_scrambling_rar_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
NB_IoT_DL_eNB_RAR_t *dlsch, NB_IoT_DL_eNB_HARQ_t *dlsch,
int tot_bits, // total number of bits to transmit
uint16_t Nf, // Nf is the frame number (0..9)
uint8_t Ns,
uint32_t rnti);
void dlsch_scrambling_Gen_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
NB_IoT_eNB_NDLSCH_t *dlsch,
int tot_bits, // total number of bits to transmit int tot_bits, // total number of bits to transmit
uint16_t Nf, // Nf is the frame number (0..9) uint16_t Nf, // Nf is the frame number (0..9)
uint8_t Ns, uint8_t Ns,
uint32_t rnti); uint32_t rnti);
NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB_IoT(uint8_t length, LTE_DL_FRAME_PARMS* frame_parms);
/*void dlsch_scrambling_Gen_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
NB_IoT_eNB_NDLSCH_t *dlsch,
int tot_bits, // total number of bits to transmit
uint16_t Nf, // Nf is the frame number (0..9)
uint8_t Ns,
uint32_t rnti, /// for SIB1 the SI_RNTI should be get from the DL request
uint8_t type);*/
/* /*
int scrambling_npbch_REs_rel_14(LTE_DL_FRAME_PARMS *frame_parms, int scrambling_npbch_REs_rel_14(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **txdataF, int32_t **txdataF,
...@@ -208,14 +228,6 @@ unsigned int ulsch_decoding_NB_IoT(PHY_VARS_eNB *phy_vars_eNB, ...@@ -208,14 +228,6 @@ unsigned int ulsch_decoding_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
uint8_t Nbundled, uint8_t Nbundled,
uint8_t llr8_flag); uint8_t llr8_flag);
//NB-IoT version
NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB_IoT(//unsigned char Kmimo,
//unsigned char Mdlharq,
uint32_t Nsoft,
//unsigned char N_RB_DL,
uint8_t abstraction_flag,
NB_IoT_DL_FRAME_PARMS* frame_parms);
// NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB_IoT(uint8_t abstraction_flag); // NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB_IoT(uint8_t abstraction_flag);
...@@ -289,7 +301,7 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF, ...@@ -289,7 +301,7 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF,
int16_t amp, int16_t amp,
LTE_DL_FRAME_PARMS *frame_parms, 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) 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_DL_eNB_SIB_t *dlsch0, //NB_IoT_eNB_NDLSCH_t NB_IoT_DL_eNB_HARQ_t *dlsch0, //NB_IoT_eNB_NDLSCH_t
int G, // number of bits per subframe 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 npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
unsigned int subframe, unsigned int subframe,
...@@ -299,7 +311,7 @@ int dlsch_modulation_rar_NB_IoT(int32_t **txdataF, ...@@ -299,7 +311,7 @@ int dlsch_modulation_rar_NB_IoT(int32_t **txdataF,
int16_t amp, int16_t amp,
LTE_DL_FRAME_PARMS *frame_parms, 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) 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_DL_eNB_RAR_t *dlsch0, //NB_IoT_eNB_NDLSCH_t NB_IoT_DL_eNB_HARQ_t *dlsch0, //NB_IoT_eNB_NDLSCH_t
int G, // number of bits per subframe 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 npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
unsigned int subframe, unsigned int subframe,
...@@ -307,17 +319,12 @@ int dlsch_modulation_rar_NB_IoT(int32_t **txdataF, ...@@ -307,17 +319,12 @@ int dlsch_modulation_rar_NB_IoT(int32_t **txdataF,
uint8_t option); uint8_t option);
int32_t dlsch_encoding_NB_IoT(unsigned char *a, int32_t dlsch_encoding_NB_IoT(unsigned char *a,
NB_IoT_DL_eNB_SIB_t *dlsch, // NB_IoT_eNB_NDLSCH_t NB_IoT_DL_eNB_HARQ_t *dlsch, // NB_IoT_eNB_NDLSCH_t
uint8_t Nsf, // number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table) uint8_t Nsf, // number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table)
unsigned int G, unsigned int G,
uint8_t option); // G (number of available RE) is implicitly multiplied by 2 (since only QPSK modulation) uint8_t option); // G (number of available RE) is implicitly multiplied by 2 (since only QPSK modulation)
///////////////////////temp function ///////////////////////////////
int dlsch_encoding_rar_NB_IoT(unsigned char *a,
NB_IoT_DL_eNB_RAR_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,
uint8_t option);
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
void rx_ulsch_NB_IoT(PHY_VARS_eNB *phy_vars_eNB, void rx_ulsch_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
eNB_rxtx_proc_t *proc, eNB_rxtx_proc_t *proc,
...@@ -394,7 +401,6 @@ int16_t* sub_sampling_NB_IoT(int16_t *input_buffer, uint32_t length_input, uint3 ...@@ -394,7 +401,6 @@ int16_t* sub_sampling_NB_IoT(int16_t *input_buffer, uint32_t length_input, uint3
void filtering_signal(int16_t *input_buffer, int16_t *filtered_buffer, uint32_t FRAME_LENGTH_COMPLEX_SAMPLESx); void filtering_signal(int16_t *input_buffer, int16_t *filtered_buffer, uint32_t FRAME_LENGTH_COMPLEX_SAMPLESx);
//************************************************************// //************************************************************//
//*****************Vincent part for ULSCH demodulation ******************//
uint16_t get_UL_sc_start_NB_IoT(uint16_t I_sc); uint16_t get_UL_sc_start_NB_IoT(uint16_t I_sc);
void generate_grouphop_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms); void generate_grouphop_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms);
...@@ -442,8 +448,6 @@ void rotate_bpsk_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -442,8 +448,6 @@ void rotate_bpsk_NB_IoT(PHY_VARS_eNB *eNB,
uint8_t symbol); uint8_t symbol);
//************************************************************// //************************************************************//
//************************************************************//
//*****************Vincent part for DLSCH demodulation ******************//
int rx_npdsch_NB_IoT(PHY_VARS_UE_NB_IoT *ue, int rx_npdsch_NB_IoT(PHY_VARS_UE_NB_IoT *ue,
unsigned char eNB_id, unsigned char eNB_id,
...@@ -539,9 +543,10 @@ int ul_chequal_tmp_NB_IoT(int32_t **rxdataF_ext, ...@@ -539,9 +543,10 @@ int ul_chequal_tmp_NB_IoT(int32_t **rxdataF_ext,
////////////////////////////NB-IoT testing /////////////////////////////// ////////////////////////////NB-IoT testing ///////////////////////////////
void clean_eNb_ulsch_NB_IoT(NB_IoT_eNB_NULSCH_t *ulsch); void clean_eNb_ulsch_NB_IoT(NB_IoT_eNB_NULSCH_t *ulsch);
int get_G_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms);
NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB_IoT(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag); NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB_IoT(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag);
//************************************************************//
#endif #endif
...@@ -190,7 +190,7 @@ NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB_IoT(uint8_t max_turbo_iterations,uint8_t N ...@@ -190,7 +190,7 @@ NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB_IoT(uint8_t max_turbo_iterations,uint8_t N
void clean_eNb_ulsch_NB_IoT(NB_IoT_eNB_NULSCH_t *ulsch) void clean_eNb_ulsch_NB_IoT(NB_IoT_eNB_NULSCH_t *ulsch)
{ {
unsigned char i; // unsigned char i;
//ulsch = (LTE_eNB_ULSCH_t *)malloc16(sizeof(LTE_eNB_ULSCH_t)); //ulsch = (LTE_eNB_ULSCH_t *)malloc16(sizeof(LTE_eNB_ULSCH_t));
if (ulsch) { if (ulsch) {
......
...@@ -30,6 +30,7 @@ unsigned char cs_ri_extended_NB_IoT[4] = {0,3,5,8}; ...@@ -30,6 +30,7 @@ unsigned char cs_ri_extended_NB_IoT[4] = {0,3,5,8};
unsigned char cs_ack_normal_NB_IoT[4] = {2,3,8,9}; unsigned char cs_ack_normal_NB_IoT[4] = {2,3,8,9};
unsigned char cs_ack_extended_NB_IoT[4] = {1,2,6,7}; unsigned char cs_ack_extended_NB_IoT[4] = {1,2,6,7};
int G_tab[18] = {200,224,240,208,232,256,220,244,268,216,240,256,224,248,264,236,260,284};
int8_t wACK_RX_NB_IoT[5][4] = {{-1,-1,-1,-1},{-1,1,-1,1},{-1,-1,1,1},{-1,1,1,-1},{1,1,1,1}}; int8_t wACK_RX_NB_IoT[5][4] = {{-1,-1,-1,-1},{-1,1,-1,1},{-1,-1,1,1},{-1,1,1,-1},{1,1,1,1}};
......
...@@ -512,8 +512,10 @@ volatile uint16_t preamble_index_NB_IoT; ...@@ -512,8 +512,10 @@ volatile uint16_t preamble_index_NB_IoT;
NB_IoT_eNB_NPBCH_t npbch; NB_IoT_eNB_NPBCH_t npbch;
NB_IoT_eNB_NDLSCH_t *ndlsch[NUMBER_OF_UE_MAX]; NB_IoT_eNB_NDLSCH_t *ndlsch[NUMBER_OF_UE_MAX];
NB_IoT_eNB_NULSCH_t *nulsch[NUMBER_OF_UE_MAX+1]; //nulsch[0] contains the RAR NB_IoT_eNB_NULSCH_t *nulsch[NUMBER_OF_UE_MAX+1]; //nulsch[0] contains the RAR
NB_IoT_eNB_NDLSCH_t ndlsch_SIB,*ndlsch_ra; NB_IoT_eNB_NDLSCH_t *ndlsch_SIB1;
NB_IoT_eNB_NDLSCH_t ndlsch_rar; NB_IoT_eNB_NDLSCH_t *ndlsch_SIB23;
NB_IoT_eNB_NDLSCH_t *ndlsch_RAR;
//NB_IoT_eNB_NDLSCH_t ndlsch_rar;
NB_IoT_eNB_NPDCCH_temp_t npdcch_tmp; NB_IoT_eNB_NPDCCH_temp_t npdcch_tmp;
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];
......
...@@ -642,6 +642,10 @@ typedef struct { ...@@ -642,6 +642,10 @@ typedef struct {
////////////////////////// NB-IoT testing ////////////////////////////// ////////////////////////// NB-IoT testing //////////////////////////////
uint8_t subcarrier_spacing; uint8_t subcarrier_spacing;
uint16_t control_region_size;
uint8_t nb_antennas_tx_NB_IoT; // to replace with NB_IoT_frame_params
NPUSCH_CONFIG_COMMONx npusch_config_common; NPUSCH_CONFIG_COMMONx npusch_config_common;
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
......
...@@ -26,11 +26,11 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -26,11 +26,11 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
nfapi_dl_config_ndlsch_pdu_rel13_t *rel13 = &dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13; nfapi_dl_config_ndlsch_pdu_rel13_t *rel13 = &dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13;
int UE_id= -1; int UE_id= -1;
int flag_malloc = 0; int flag_malloc = 0;
ndlsch= &eNB->ndlsch_SIB; ndlsch= eNB->ndlsch_SIB1;
if(flag_malloc) free (ndlsch->harq_process); // if(flag_malloc) free (ndlsch->harq_process);
ndlsch->harq_process = (NB_IoT_DL_eNB_HARQ_t*) malloc (sizeof(NB_IoT_DL_eNB_HARQ_t)); // ndlsch->harq_process = (NB_IoT_DL_eNB_HARQ_t*) malloc (sizeof(NB_IoT_DL_eNB_HARQ_t));
flag_malloc = 1 ; flag_malloc = 1 ;
//Check for SI PDU since in NB-IoT there is no DCI for that //Check for SI PDU since in NB-IoT there is no DCI for that
//SIB1 (type 0), other DLSCH data (type 1) (include the SI messages) based on our ASSUMPTIONs //SIB1 (type 0), other DLSCH data (type 1) (include the SI messages) based on our ASSUMPTIONs
...@@ -59,7 +59,8 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -59,7 +59,8 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
//ndlsch_harq->pdu = sdu; //ndlsch_harq->pdu = sdu;
//LOG_I(PHY,"B content_sib1:%d\n",sdu); //LOG_I(PHY,"B content_sib1:%d\n",sdu);
ndlsch->content_sib1.pdu = sdu; /////ndlsch->content_sib1.pdu = sdu;
ndlsch_harq->pdu = sdu;
//LOG_I(PHY,"A content_sib1:%d\n",ndlsch->content_sib1.pdu); //LOG_I(PHY,"A content_sib1:%d\n",ndlsch->content_sib1.pdu);
//should be from 1 to 8 //should be from 1 to 8
...@@ -109,7 +110,7 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -109,7 +110,7 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
ndlsch->npdsch_start_symbol = rel13->start_symbol; //start OFDM symbol for the ndlsch transmission ndlsch->npdsch_start_symbol = rel13->start_symbol; //start OFDM symbol for the ndlsch transmission
//ndlsch_harq->pdu = sdu; //ndlsch_harq->pdu = sdu;
//LOG_I(PHY,"B content_sib23:%d\n",sdu); //LOG_I(PHY,"B content_sib23:%d\n",sdu);
ndlsch->content_sib23.pdu = sdu; ndlsch_harq->pdu = sdu;
ndlsch_harq->resource_assignment = rel13->number_of_subframes_for_resource_assignment;//value 2 or 8 ndlsch_harq->resource_assignment = rel13->number_of_subframes_for_resource_assignment;//value 2 or 8
ndlsch_harq->repetition_number = rel13->repetition_number;//should be always fix to 0 to be mapped in 1 ndlsch_harq->repetition_number = rel13->repetition_number;//should be always fix to 0 to be mapped in 1
ndlsch_harq->modulation = rel13->modulation; ndlsch_harq->modulation = rel13->modulation;
...@@ -128,7 +129,7 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -128,7 +129,7 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
//there is no need of repeating the configuration on the ndlsch //there is no need of repeating the configuration on the ndlsch
//ndlsch_harq->pdu = NULL; //ndlsch_harq->pdu = NULL;
//LOG_I(PHY,"sib23=NULL\n"); //LOG_I(PHY,"sib23=NULL\n");
ndlsch->content_sib23.pdu = NULL; ndlsch_harq->pdu = NULL;
} }
...@@ -144,11 +145,11 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -144,11 +145,11 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
{ {
//check if the PDU is for RAR //check if the PDU is for RAR
if(eNB->ndlsch_ra != NULL && rel13->rnti == eNB->ndlsch_ra->rnti) //rnti for the RAR should have been set priviously by the DCI 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_ra->harq_process->pdu = sdu; eNB->ndlsch_RAR->harq_process->pdu = sdu;
eNB->ndlsch_ra->npdsch_start_symbol = rel13->start_symbol; eNB->ndlsch_RAR->npdsch_start_symbol = rel13->start_symbol;
eNB->ndlsch_ra->active = 1; eNB->ndlsch_RAR->active = 1;
} }
else else
{ //this for ue data { //this for ue data
......
...@@ -541,7 +541,7 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ...@@ -541,7 +541,7 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
fclose(fich); fclose(fich);
exit(0); exit(0);
}*/ }*/
NB_IoT_eNB_NULSCH_t **ulsch_NB_IoT = &eNB->ulsch_NB_IoT;//[0][0]; NB_IoT_eNB_NULSCH_t **ulsch_NB_IoT = &eNB->ulsch_NB_IoT[0];//[0][0];
//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////// Decoding ACK //////////////////////////////// ////////////////////////////////////////// Decoding ACK ////////////////////////////////
...@@ -647,7 +647,7 @@ if(proc->flag_msg4 == 1 && proc->counter_msg4 > 0) ...@@ -647,7 +647,7 @@ if(proc->flag_msg4 == 1 && proc->counter_msg4 > 0)
if(frame == proc->frame_msg4 && subframe == proc->subframe_msg4) if(frame == proc->frame_msg4 && subframe == proc->subframe_msg4)
{ {
NB_IoT_DL_eNB_RAR_t *rar = &eNB->ndlsch_rar.content_rar; NB_IoT_DL_eNB_HARQ_t *rar = eNB->ndlsch_RAR->harq_process;
//uint8_t tab_rar[15]; //uint8_t tab_rar[15];
//uint8_t tab_rar[18]; //uint8_t tab_rar[18];
uint8_t tab_rar[7]; uint8_t tab_rar[7];
...@@ -711,7 +711,7 @@ if(proc->flag_msg4 == 1 && proc->counter_msg4 > 0) ...@@ -711,7 +711,7 @@ if(proc->flag_msg4 == 1 && proc->counter_msg4 > 0)
if(proc->flag_scrambling ==0) if(proc->flag_scrambling ==0)
{ {
dlsch_encoding_rar_NB_IoT(tab_rar, dlsch_encoding_NB_IoT(tab_rar,
rar, rar,
1, ///// number_of_subframes_required 1, ///// number_of_subframes_required
236, 236,
...@@ -740,7 +740,7 @@ if(proc->flag_msg4 == 1 && proc->counter_msg4 > 0) ...@@ -740,7 +740,7 @@ if(proc->flag_msg4 == 1 && proc->counter_msg4 > 0)
22, 22,
2); 2);
} else {*/ } else {*/
dlsch_modulation_rar_NB_IoT(txdataF, dlsch_modulation_NB_IoT(txdataF,
AMP, AMP,
fp, fp,
3, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band) 3, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
...@@ -748,8 +748,7 @@ if(proc->flag_msg4 == 1 && proc->counter_msg4 > 0) ...@@ -748,8 +748,7 @@ if(proc->flag_msg4 == 1 && proc->counter_msg4 > 0)
236, // number of bits per subframe 236, // number of bits per subframe
frame, // unrequired frame, // unrequired
subframe, subframe,
22, 22);
0);
// } // }
proc->counter_msg4--; proc->counter_msg4--;
...@@ -1229,7 +1228,7 @@ if(subframe !=5 && subframe !=0) ...@@ -1229,7 +1228,7 @@ if(subframe !=5 && subframe !=0)
{ {
if(proc->rar_to_transmit ==1 && proc->remaining_rar >0) if(proc->rar_to_transmit ==1 && proc->remaining_rar >0)
{ {
NB_IoT_DL_eNB_RAR_t *rar = &eNB->ndlsch_rar.content_rar; NB_IoT_DL_eNB_HARQ_t *rar = &eNB->ndlsch_RAR->harq_process;
uint8_t tab_rar[7]; uint8_t tab_rar[7];
// printf("xxxxx index verif %d XXXXXX",RA_template[0].preamble_index); // printf("xxxxx index verif %d XXXXXX",RA_template[0].preamble_index);
tab_rar[0]=64 + RA_template[0].preamble_index; tab_rar[0]=64 + RA_template[0].preamble_index;
...@@ -1262,7 +1261,7 @@ if(subframe !=5 && subframe !=0) ...@@ -1262,7 +1261,7 @@ if(subframe !=5 && subframe !=0)
if(proc->flag_scrambling ==0) if(proc->flag_scrambling ==0)
{ {
dlsch_encoding_rar_NB_IoT(tab_rar, dlsch_encoding_NB_IoT(tab_rar,
rar, rar,
8, ///// number_of_subframes_required 8, ///// number_of_subframes_required
236, 236,
...@@ -1278,7 +1277,7 @@ if(subframe !=5 && subframe !=0) ...@@ -1278,7 +1277,7 @@ if(subframe !=5 && subframe !=0)
} }
proc->flag_scrambling =1; proc->flag_scrambling =1;
printf("\n RAR sentttttt frame %d, subframe %d", frame, subframe); printf("\n RAR sentttttt frame %d, subframe %d", frame, subframe);
dlsch_modulation_rar_NB_IoT(txdataF, dlsch_modulation_NB_IoT(txdataF,
AMP, AMP,
fp, fp,
3, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band) 3, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
...@@ -1286,8 +1285,7 @@ if(subframe !=5 && subframe !=0) ...@@ -1286,8 +1285,7 @@ if(subframe !=5 && subframe !=0)
236, // number of bits per subframe 236, // number of bits per subframe
frame, // unrequired frame, // unrequired
subframe, subframe,
22, 22);
0);
proc->remaining_rar--; proc->remaining_rar--;
proc->next_subframe_tx =subframe+2; proc->next_subframe_tx =subframe+2;
...@@ -1311,7 +1309,7 @@ if(subframe !=5 && subframe !=0) ...@@ -1311,7 +1309,7 @@ if(subframe !=5 && subframe !=0)
if(proc->flag_scrambling ==0) if(proc->flag_scrambling ==0)
{ {
dlsch_encoding_rar_NB_IoT(tab_rar, dlsch_encoding_NB_IoT(tab_rar,
rar, rar,
8, ///// number_of_subframes_required 8, ///// number_of_subframes_required
236, 236,
...@@ -1328,7 +1326,7 @@ if(subframe !=5 && subframe !=0) ...@@ -1328,7 +1326,7 @@ if(subframe !=5 && subframe !=0)
proc->flag_scrambling =1; proc->flag_scrambling =1;
printf("\n RAR sentttttt frame %d, subframe %d", frame, subframe); printf("\n RAR sentttttt frame %d, subframe %d", frame, subframe);
dlsch_modulation_rar_NB_IoT(txdataF, dlsch_modulation_NB_IoT(txdataF,
AMP, AMP,
fp, fp,
3, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band) 3, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
...@@ -1336,8 +1334,7 @@ if(subframe !=5 && subframe !=0) ...@@ -1336,8 +1334,7 @@ if(subframe !=5 && subframe !=0)
236, // number of bits per subframe 236, // number of bits per subframe
frame, // unrequired frame, // unrequired
subframe, subframe,
22, 22);
0);
proc->remaining_rar--; proc->remaining_rar--;
proc->next_subframe_tx =subframe+1; proc->next_subframe_tx =subframe+1;
......
...@@ -223,9 +223,9 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -223,9 +223,9 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
NB_IoT_eNB_NPBCH_t *broadcast_str = &eNB->npbch; NB_IoT_eNB_NPBCH_t *broadcast_str = &eNB->npbch;
//NB_IoT_eNB_NDLSCH_t *sib1 = &eNB->ndlsch_SIB; //NB_IoT_eNB_NDLSCH_t *sib1 = &eNB->ndlsch_SIB;
NB_IoT_eNB_NDLSCH_t *ndlsch = &eNB->ndlsch_SIB; //NB_IoT_eNB_NDLSCH_t *ndlsch = &eNB->ndlsch_SIB1;
NB_IoT_DL_eNB_SIB_t *sib1 = &ndlsch->content_sib1; NB_IoT_DL_eNB_HARQ_t *sib1 = eNB->ndlsch_SIB1->harq_process;
NB_IoT_DL_eNB_SIB_t *sib23 = &ndlsch->content_sib23; NB_IoT_DL_eNB_HARQ_t *sib23 = eNB->ndlsch_SIB23->harq_process;
int **txdataF = eNB->common_vars.txdataF[0]; int **txdataF = eNB->common_vars.txdataF[0];
int subframe = proc->subframe_tx; int subframe = proc->subframe_tx;
...@@ -236,7 +236,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -236,7 +236,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
uint32_t hyper_frame=proc->HFN; uint32_t hyper_frame=proc->HFN;
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
/* /*
rrc_eNB_carrier_data_NB_IoT_t *carrier = &eNB_rrc_inst_NB_IoT->carrier[0]; rrc_eNB_carrier_data_NB_IoT_t *carrier = &eNB_rrc_inst_NB_IoT->carrier[0];
if(frame%64==0 && subframe ==0) if(frame%64==0 && subframe ==0)
...@@ -252,7 +252,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -252,7 +252,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
do_SIB1_NB_IoT_x(0,0,carrier,208,92,1,3584,28,2,hyper_frame); do_SIB1_NB_IoT_x(0,0,carrier,208,92,1,3584,28,2,hyper_frame);
} }
*/ */
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
//uint8_t *control_region_size = get_NB_IoT_SIB1_eutracontrolregionsize(); //uint8_t *control_region_size = get_NB_IoT_SIB1_eutracontrolregionsize();
//int G=0; //int G=0;
...@@ -316,6 +316,11 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -316,6 +316,11 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
///////////////////////////////////////////////////////// SIB1 //////////////////////////////////// ///////////////////////////////////////////////////////// SIB1 ////////////////////////////////////
// we need two parameter, NB-IoT cell_id and scheduling info for sib1 (can be found in the MIB)
// using scheduling_info parameter we can get the TBS size.
// cell_id help to find the start subframe for sib1.
// MAC_TBStable_NB_IoT_SIB1 to be used to get TBS value.
//
if((subframe == 4) && (frame%2==0) && (frame%32<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) ) if((subframe == 4) && (frame%2==0) && (frame%32<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) )
{ {
LOG_I(PHY,"SIB1 NB-IoT content:\n"); LOG_I(PHY,"SIB1 NB-IoT content:\n");
...@@ -329,7 +334,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -329,7 +334,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
dlsch_encoding_NB_IoT(sib1_pdu, dlsch_encoding_NB_IoT(sib1_pdu,
sib1, sib1,
8, ///// number_of_subframes_required 8, ///// number_of_subframes_required
236, get_G_NB_IoT(fp),
1); //////////// G*2 1); //////////// G*2
......
...@@ -18,8 +18,6 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_ ...@@ -18,8 +18,6 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_
uint8_t MIB_size = 0; uint8_t MIB_size = 0;
uint8_t SIB1_size = 0, i = 0; uint8_t SIB1_size = 0, i = 0;
rrc_eNB_carrier_data_NB_IoT_t *carrier = &eNB_rrc_inst_NB_IoT->carrier[0]; rrc_eNB_carrier_data_NB_IoT_t *carrier = &eNB_rrc_inst_NB_IoT->carrier[0];
uint8_t *MIB_pdu = get_NB_IoT_MIB(carrier,1,subframe,frame,hypersfn);
uint8_t *SIB1_pdu = get_NB_IoT_SIB1(0,0,carrier,208,92,1,3584,28,2,subframe,frame,hypersfn);
Sched_Rsp_NB_IoT_t *SCHED_info = &mac_inst->Sched_INFO; Sched_Rsp_NB_IoT_t *SCHED_info = &mac_inst->Sched_INFO;
...@@ -31,7 +29,6 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_ ...@@ -31,7 +29,6 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_
int flag_malloc = 0 ; int flag_malloc = 0 ;
// filled common part of schedule_resoponse // filled common part of schedule_resoponse
SCHED_info->module_id = module_id; SCHED_info->module_id = module_id;
SCHED_info->hypersfn = hypersfn; SCHED_info->hypersfn = hypersfn;
SCHED_info->frame = frame; SCHED_info->frame = frame;
...@@ -69,6 +66,7 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_ ...@@ -69,6 +66,7 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_
// process downlink data transmission, there will only be single DL_REQ in one subframe (e.g. 1ms), check common signal first // process downlink data transmission, there will only be single DL_REQ in one subframe (e.g. 1ms), check common signal first
if(subframe == 0 /*MIB_flag == 1*/) // TODO back to MIB_flag if(subframe == 0 /*MIB_flag == 1*/) // TODO back to MIB_flag
{ {
uint8_t *MIB_pdu = get_NB_IoT_MIB(carrier,1,subframe,frame,hypersfn);
//LOG_D(MAC,"[%d]MIB\n",current_time); //LOG_D(MAC,"[%d]MIB\n",current_time);
//MIB_size = mac_rrc_data_req_eNB_NB_IoT(*MIB); //MIB_size = mac_rrc_data_req_eNB_NB_IoT(*MIB);
//SCHED_info->DL_req = (nfapi_dl_config_request_t*) malloc (sizeof(nfapi_dl_config_request_t)); //SCHED_info->DL_req = (nfapi_dl_config_request_t*) malloc (sizeof(nfapi_dl_config_request_t));
...@@ -98,6 +96,7 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_ ...@@ -98,6 +96,7 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_
} }
else if((subframe == 4) && (frame%2==0) && (frame%32<16) /*SIB1_flag == 1*/) // TODO back to SIB1_flag else if((subframe == 4) && (frame%2==0) && (frame%32<16) /*SIB1_flag == 1*/) // TODO back to SIB1_flag
{ {
uint8_t *SIB1_pdu = get_NB_IoT_SIB1(0,0,carrier,208,92,1,3584,28,2,subframe,frame,hypersfn);
//SIB1_size = mac_rrc_data_req_eNB_NB_IoT(*SIB1); //SIB1_size = mac_rrc_data_req_eNB_NB_IoT(*SIB1);
//SCHED_info->DL_req = (nfapi_dl_config_request_t*) malloc (sizeof(nfapi_dl_config_request_t)); //SCHED_info->DL_req = (nfapi_dl_config_request_t*) malloc (sizeof(nfapi_dl_config_request_t));
//SCHED_info->DL_req->dl_config_request_body.number_pdu = 0; //SCHED_info->DL_req->dl_config_request_body.number_pdu = 0;
......
...@@ -126,7 +126,7 @@ const uint32_t MAC_TBStable_NB_IoT[14][8] ={ //[ITBS][ISF] ...@@ -126,7 +126,7 @@ const uint32_t MAC_TBStable_NB_IoT[14][8] ={ //[ITBS][ISF]
//TBS table for the case containing S1B1-NB_IoT, Table 16.4.1.5.2-1 in TS 36.213 v14.2 (Itbs = 12 ~ 15 is reserved field //TBS table for the case containing S1B1-NB_IoT, Table 16.4.1.5.2-1 in TS 36.213 v14.2 (Itbs = 12 ~ 15 is reserved field
//mapping ITBS to SIB1-NB_IoT //mapping ITBS to SIB1-NB_IoT
const unsigned int MAC_TBStable_NB_IoT_SIB1[16] = {208,208,208,328,328,328,440,440,440,680,680,680}; const unsigned int MAC_TBStable_NB_IoT_SIB1[16] = {208,208,208,328,328,328,440,440,440,680,680,680,0,0,0,0};
const int DV_table[16]={0,10,14,19,26,36,49,67,91,125,171,234,321,768,1500,1500}; const int DV_table[16]={0,10,14,19,26,36,49,67,91,125,171,234,321,768,1500,1500};
......
...@@ -44,7 +44,7 @@ uint8_t *get_NB_IoT_MIB( ...@@ -44,7 +44,7 @@ uint8_t *get_NB_IoT_MIB(
uint32_t frame, uint32_t frame,
uint32_t hyper_frame); uint32_t hyper_frame);
uint8_t *get_NB_IoT_MIB_size(void); uint8_t get_NB_IoT_MIB_size(void);
uint8_t *get_NB_IoT_SIB1(uint8_t Mod_id, int CC_id, uint8_t *get_NB_IoT_SIB1(uint8_t Mod_id, int CC_id,
rrc_eNB_carrier_data_NB_IoT_t *carrier, rrc_eNB_carrier_data_NB_IoT_t *carrier,
...@@ -57,11 +57,11 @@ uint8_t *get_NB_IoT_SIB1(uint8_t Mod_id, int CC_id, ...@@ -57,11 +57,11 @@ uint8_t *get_NB_IoT_SIB1(uint8_t Mod_id, int CC_id,
uint32_t subframe, uint32_t subframe,
uint32_t frame, uint32_t frame,
uint32_t hyper_frame); uint32_t hyper_frame);
uint8_t *get_NB_IoT_SIB1_size(void); uint8_t get_NB_IoT_SIB1_size(void);
uint8_t *get_NB_IoT_SIB23(void); uint8_t *get_NB_IoT_SIB23(void);
uint8_t *get_NB_IoT_SIB23_size(void); uint8_t get_NB_IoT_SIB23_size(void);
long *get_NB_IoT_SIB1_eutracontrolregionsize(void); long *get_NB_IoT_SIB1_eutracontrolregionsize(void);
......
...@@ -141,7 +141,7 @@ uint8_t *get_NB_IoT_MIB( ...@@ -141,7 +141,7 @@ uint8_t *get_NB_IoT_MIB(
} }
uint8_t *get_NB_IoT_MIB_size(void) uint8_t get_NB_IoT_MIB_size(void)
{ {
// CC_ID=0 // CC_ID=0
return eNB_rrc_inst_NB_IoT->carrier[0].sizeof_MIB_NB_IoT; return eNB_rrc_inst_NB_IoT->carrier[0].sizeof_MIB_NB_IoT;
...@@ -171,7 +171,7 @@ uint8_t *get_NB_IoT_SIB1(uint8_t Mod_id, int CC_id, ...@@ -171,7 +171,7 @@ uint8_t *get_NB_IoT_SIB1(uint8_t Mod_id, int CC_id,
return eNB_rrc_inst_NB_IoT->carrier[0].SIB1_NB_IoT; return eNB_rrc_inst_NB_IoT->carrier[0].SIB1_NB_IoT;
} }
uint8_t *get_NB_IoT_SIB1_size(void) uint8_t get_NB_IoT_SIB1_size(void)
{ {
return eNB_rrc_inst_NB_IoT->carrier[0].sizeof_SIB1_NB_IoT; return eNB_rrc_inst_NB_IoT->carrier[0].sizeof_SIB1_NB_IoT;
} }
...@@ -181,7 +181,7 @@ uint8_t *get_NB_IoT_SIB23(void) ...@@ -181,7 +181,7 @@ uint8_t *get_NB_IoT_SIB23(void)
return eNB_rrc_inst_NB_IoT->carrier[0].SIB23_NB_IoT; return eNB_rrc_inst_NB_IoT->carrier[0].SIB23_NB_IoT;
} }
uint8_t *get_NB_IoT_SIB23_size(void) uint8_t get_NB_IoT_SIB23_size(void)
{ {
return eNB_rrc_inst_NB_IoT->carrier[0].sizeof_SIB23_NB_IoT; return eNB_rrc_inst_NB_IoT->carrier[0].sizeof_SIB23_NB_IoT;
} }
......
...@@ -1173,9 +1173,12 @@ static void get_options (int argc, char **argv) { ...@@ -1173,9 +1173,12 @@ static void get_options (int argc, char **argv) {
frame_parms[CC_id]->mode1_flag = (frame_parms[CC_id]->nb_antenna_ports_eNB == 1) ? 1 : 0; frame_parms[CC_id]->mode1_flag = (frame_parms[CC_id]->nb_antenna_ports_eNB == 1) ? 1 : 0;
frame_parms[CC_id]->threequarter_fs = threequarter_fs; frame_parms[CC_id]->threequarter_fs = threequarter_fs;
frame_parms_NB_IoT[CC_id]->threequarter_fs = threequarter_fs; frame_parms_NB_IoT[CC_id]->threequarter_fs = threequarter_fs;
frame_parms[CC_id]->nb_antennas_tx_NB_IoT = enb_properties->properties[i]->nb_antennas_tx[CC_id];
frame_parms[CC_id]->control_region_size = 3;
//} // j //} // j
} }
...@@ -1298,6 +1301,9 @@ void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) { ...@@ -1298,6 +1301,9 @@ void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.highSpeedFlag=0; frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.highSpeedFlag=0;
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_FreqOffset=0; frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
frame_parms[CC_id]->nb_antennas_tx_NB_IoT = enb_properties->properties[i]->nb_antennas_tx[CC_id];
frame_parms[CC_id]->control_region_size = 3;
downlink_frequency[CC_id][0] = 2680000000; // Use float to avoid issue with frequency over 2^31. downlink_frequency[CC_id][0] = 2680000000; // Use float to avoid issue with frequency over 2^31.
downlink_frequency[CC_id][1] = downlink_frequency[CC_id][0]; downlink_frequency[CC_id][1] = downlink_frequency[CC_id][0];
downlink_frequency[CC_id][2] = downlink_frequency[CC_id][0]; downlink_frequency[CC_id][2] = downlink_frequency[CC_id][0];
......
...@@ -54,8 +54,8 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -54,8 +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.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; PHY_vars_eNB->frame_parms.nushift = PHY_vars_eNB->frame_parms.Nid_cell%6;
// for NB-IoT testing // for NB-IoT testing
PHY_vars_eNB->ndlsch_SIB.content_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_vars_eNB->ndlsch_SIB.content_sib23.si_rnti = 0xffff;
//////////////////////////// ////////////////////////////
phy_init_lte_eNB(PHY_vars_eNB,0,abstraction_flag); phy_init_lte_eNB(PHY_vars_eNB,0,abstraction_flag);
...@@ -142,6 +142,12 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -142,6 +142,12 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
PHY_vars_eNB->dlsch_MCH = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL, 0, frame_parms); PHY_vars_eNB->dlsch_MCH = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL, 0, frame_parms);
LOG_D(PHY,"eNB %d : MCH %p\n",eNB_id,PHY_vars_eNB->dlsch_MCH); LOG_D(PHY,"eNB %d : MCH %p\n",eNB_id,PHY_vars_eNB->dlsch_MCH);
///// NB-IoT ////////////
PHY_vars_eNB->ndlsch_SIB1 = new_eNB_dlsch_NB_IoT(1,frame_parms); // frame_parms is not used , to be removed is not used in futur
PHY_vars_eNB->ndlsch_SIB23 = new_eNB_dlsch_NB_IoT(1,frame_parms);
PHY_vars_eNB->ndlsch_RAR = new_eNB_dlsch_NB_IoT(1,frame_parms);
PHY_vars_eNB->rx_total_gain_dB=130; PHY_vars_eNB->rx_total_gain_dB=130;
...@@ -176,10 +182,17 @@ PHY_VARS_eNB_NB_IoT* init_lte_eNB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms, ...@@ -176,10 +182,17 @@ PHY_VARS_eNB_NB_IoT* init_lte_eNB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,
PHY_vars_eNB->Mod_id=eNB_id; PHY_vars_eNB->Mod_id=eNB_id;
PHY_vars_eNB->cooperation_flag=0;//cooperation_flag; PHY_vars_eNB->cooperation_flag=0;//cooperation_flag;
memcpy(&(PHY_vars_eNB->frame_parms), frame_parms, sizeof(NB_IoT_DL_FRAME_PARMS)); memcpy(&(PHY_vars_eNB->frame_parms), frame_parms, sizeof(NB_IoT_DL_FRAME_PARMS));
PHY_vars_eNB->frame_parms.Nid_cell = ((Nid_cell/3)*3)+((eNB_id+Nid_cell)%3); //PHY_vars_eNB->frame_parms.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;
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; PHY_vars_eNB->frame_parms.nushift = PHY_vars_eNB->frame_parms.Nid_cell%6;
phy_init_lte_eNB_NB_IoT(PHY_vars_eNB,0,abstraction_flag); phy_init_lte_eNB_NB_IoT(PHY_vars_eNB,0,abstraction_flag);
// for NB-IoT testing
// PHY_vars_eNB->ndlsch_SIB.content_sib1.si_rnti = 0xffff;
// PHY_vars_eNB->ndlsch_SIB.content_sib23.si_rnti = 0xffff;
////////////////////////////
/*LOG_I(PHY,"init eNB: Node Function %d\n",node_function); /*LOG_I(PHY,"init eNB: Node Function %d\n",node_function);
LOG_I(PHY,"init eNB: Nid_cell %d\n", frame_parms->Nid_cell); LOG_I(PHY,"init eNB: Nid_cell %d\n", frame_parms->Nid_cell);
LOG_I(PHY,"init eNB: frame_type %d,tdd_config %d\n", frame_parms->frame_type,frame_parms->tdd_config); LOG_I(PHY,"init eNB: frame_type %d,tdd_config %d\n", frame_parms->frame_type,frame_parms->tdd_config);
......
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