//delete the count for the DCI numbers,NUM_DCI_MAX should set to 2
uint32_tnum_npdcch_symbols;
uint32_tnum_npdcch_symbols;
///indicates the starting OFDM symbol in the first slot of a subframe k for the NPDCCH transmission
/// see FAPI/NFAPI specs Table 4-45
uint8_tnpdcch_start_symbol;
uint8_tNum_dci;
DCI_ALLOC_NB_IoT_tdci_alloc[2];
uint8_tnpdcch_start_symbol;
uint8_tNum_dci;
DCI_ALLOC_NB_IoT_tdci_alloc[2];
}DCI_PDU_NB_IoT;
...
...
@@ -530,255 +536,241 @@ typedef struct {
typedefstruct{
/// TX buffers for UE-spec transmission (antenna ports 5 or 7..14, prior to precoding)
int32_t*txdataF[8];
int32_t*txdataF[8];
/// dl channel estimates (estimated from ul channel estimates)
int32_t**calib_dl_ch_estimates;
int32_t**calib_dl_ch_estimates;
/// Allocated RNTI (0 means DLSCH_t is not currently used)
uint16_trnti;
uint16_trnti;
/// Active flag for baseband transmitter processing
uint8_tactive;
uint8_tactive;
/// Indicator of TX activation per subframe. Used during PUCCH detection for ACK/NAK.
uint8_tsubframe_tx[10];
uint8_tsubframe_tx[10];
/// First CCE of last PDSCH scheduling per subframe. Again used during PUCCH detection for ACK/NAK.
uint8_tnCCE[10];
uint8_tnCCE[10];
/*in NB-IoT there is only 1 HARQ process for each UE therefore no pid is required*/
/// The only HARQ process for the DLSCH
NB_IoT_DL_eNB_HARQ_t*harq_process;
NB_IoT_DL_eNB_HARQ_t*harq_process;
/// Number of soft channel bits
uint32_tG;
uint32_tG;
/// Maximum number of HARQ rounds
uint8_tMlimit;
uint8_tMlimit;
/// Nsoft parameter related to UE Category
uint32_tNsoft;
uint32_tNsoft;
/// amplitude of PDSCH (compared to RS) in symbols without pilots
int16_tsqrt_rho_a;
int16_tsqrt_rho_a;
/// amplitude of PDSCH (compared to RS) in symbols containing pilots
int16_tsqrt_rho_b;
int16_tsqrt_rho_b;
///NB-IoT
/// may use in the npdsch_procedures
uint16_tscrambling_sequence_intialization;
uint16_tscrambling_sequence_intialization;
/// number of cell specific TX antenna ports assumed by the UE
uint8_tnrs_antenna_ports;
uint8_tnrs_antenna_ports;
//This indicate the current subframe within the subframe interval between the NPDSCH transmission (Nsf*Nrep)
uint16_tsf_index;
uint16_tsf_index;
///indicates the starting OFDM symbol in the first slot of a subframe k for the NPDSCH transmission
/// see FAPI/NFAPI specs Table 4-47
uint8_tnpdsch_start_symbol;
uint8_tnpdsch_start_symbol;
/*SIB1-NB related parameters*/
///flag for indicate if the current frame is the start of a new SIB1-NB repetition within the SIB1-NB period (0 = FALSE, 1 = TRUE)
uint8_tsib1_rep_start;
uint8_tsib1_rep_start;
///the number of the frame within the 16 continuous frame in which sib1-NB is transmitted (1-8 = 1st, 2nd ecc..) (0 = not foresees a transmission)
uint8_trelative_sib1_frame;
uint8_trelative_sib1_frame;
//Flag used to discern among different NDLSCH structures (SIB1,SI,RA,UE-spec)
//(used inside the ndlsch procedure for distinguish the different type of data to manage also in term of repetitions and transmission over more subframes
ndlsch_flag_tndlsch_type;
ndlsch_flag_tndlsch_type;
}NB_IoT_eNB_NDLSCH_t;
typedefstruct{
/// Length of CQI data under RI=1 assumption(bits)
uint8_tOr1;
uint8_tOr1;
/// Rank information
uint8_to_RI[2];
uint8_to_RI[2];
/// Format of CQI data
UCI_format_NB_IoT_tuci_format;
UCI_format_NB_IoT_tuci_format;
/// The value of DAI in DCI format 0
uint8_tV_UL_DAI;
uint8_tV_UL_DAI;
/// Pointer to CQI data
uint8_to[MAX_CQI_BYTES_NB_IoT];
uint8_to[MAX_CQI_BYTES_NB_IoT];
/// CQI CRC status
uint8_tcqi_crc_status;
uint8_tcqi_crc_status;
/// PHICH active flag
uint8_tphich_active;
uint8_tphich_active;
/// PHICH ACK
uint8_tphich_ACK;
uint8_tphich_ACK;
/// Length of rank information (bits)
uint8_tO_RI;
uint8_tO_RI;
/// First Allocated RB
uint16_tfirst_rb;
uint16_tfirst_rb;
/// Current Number of RBs
uint16_tnb_rb;
uint16_tnb_rb;
/// Determined the subcarrier allocation for the NPUSCH.(15, 3.75 KHz)
uint8_tsubcarrier_indication;
uint8_tsubcarrier_indication;
/// Determined the number of resource unit for the NPUSCH
uint8_tresource_assignment;
uint8_tresource_assignment;
/// Determined the scheduling delay for NPUSCH
uint8_tscheduling_delay;
uint8_tscheduling_delay;
/// The number of the repetition number for NPUSCH Transport block
uint8_trepetition_number;
uint8_trepetition_number;
/// Determined the repetition number value 0-3
uint8_tdci_subframe_repetitions;
uint8_tdci_subframe_repetitions;
/// Flag indicating that this ULSCH has been allocated by a DCI (otherwise it is a retransmission based on PHICH NAK)
uint8_tdci_alloc;
uint8_tdci_alloc;
/// Flag indicating that this ULSCH has been allocated by a RAR (otherwise it is a retransmission based on PHICH NAK or DCI)
uint8_trar_alloc;
uint8_trar_alloc;
/// Status Flag indicating for this ULSCH (idle,active,disabled)
@@ -74,19 +73,21 @@ int dlsch_encoding_NB_IoT(unsigned char *a,
time_stats_t_NB_IoT*te_stats,
time_stats_t_NB_IoT*i_stats)
{
unsignedintcrc=1;
unsignedintcrc=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
unsignedintA;
uint8_tRCC;
A=dlsch->harq_process.TBS;// 680
dlsch->harq_process.length_e=G*Nsf;// G*Nsf (number_of_subframes) = total number of bits to transmit
unsignedintA;
uint8_tRCC;
A=dlsch->harq_process.TBS;// 680
dlsch->harq_process.length_e=G*Nsf;// G*Nsf (number_of_subframes) = total number of bits to transmit
int32_tnumbits=A+24;
if(dlsch->harq_process.round==0){// This is a new packet
#include "PHY/defs_NB_IoT.h" // not can be replaced by impl_defs_lte_NB_IoT & impl_defs_top_NB_IoT if "msg" function is not used
//#include "defs.h"
//#include "PHY/extern_NB_IoT.h"
//#include "PHY/impl_defs_lte_NB_IoT.h"
//#include "PHY/impl_defs_top_NB_IoT.h"
#include "nsss_NB_IoT.h"
intgenerate_sss_NB_IoT(int32_t**txdataF,
int16_tamp,
NB_IoT_DL_FRAME_PARMS*frame_parms,
uint16_tsymbol_offset,// symbol_offset = 3 for NB-IoT
uint16_tslot_offset,
unsignedshortframe_number,// new attribute (Get value from higher layer), it does not exist for LTE
unsignedshortRB_IoT_ID)// new attribute (values are between 0.. Max_RB_number-1), it does not exist for LTE
intgenerate_sss_NB_IoT(int32_t**txdataF,
int16_tamp,
NB_IoT_DL_FRAME_PARMS*frame_parms,
uint16_tsymbol_offset,// symbol_offset = 3 for NB-IoT
uint16_tslot_offset,
unsignedshortframe_number,// new attribute (Get value from higher layer), it does not exist for LTE
unsignedshortRB_IoT_ID)// new attribute (values are between 0.. Max_RB_number-1), it does not exist for LTE
{
uint8_taa,Nid_NB_IoT,Nid2,f,q,s,c,u;
int16_t*d;
uint16_tn_f;
unsignedshorta;
uint16_tslot_id;// slot_id = 17 in NB_IoT
unsignedshortbandwidth_even_odd;
unsignedshortNB_IoT_start;
uint8_taa,Nid_NB_IoT,Nid2,f,q,s,c,u;
int16_t*d;
uint16_tn_f;
unsignedshorta;
uint16_tslot_id;// slot_id = 17 in NB_IoT
unsignedshortbandwidth_even_odd;
unsignedshortNB_IoT_start;
n_f=frame_number;
n_f=frame_number;
Nid_NB_IoT=frame_parms->Nid_cell;// supposing Cell_Id of LTE = Cell_Id of NB-IoT // if different , NB_IOT_DL_FRAME_PARMS should be includes as attribute