Commit abad0f86 authored by Nick Ho's avatar Nick Ho

NDLSCH/NULSCH structures in PHY_VARS_eNB (include HARQ strutcures) code compiled

parent 32aa59e0
...@@ -137,13 +137,15 @@ int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB, ...@@ -137,13 +137,15 @@ int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
} }
} }
int resource_to_subframe[8] = {1,2,3,4,5,6,8,10};
int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB, int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
int frame, int frame,
uint8_t subframe, uint8_t subframe,
DCI_CONTENT *DCI_Content, DCI_CONTENT *DCI_Content,
uint16_t rnti, uint16_t rnti,
DCI_format_NB_t dci_format, DCI_format_NB_t dci_format,
LTE_eNB_DLSCH_t *dlsch, NB_IoT_eNB_NDLSCH_t *ndlsch,
NB_DL_FRAME_PARMS *frame_parms, NB_DL_FRAME_PARMS *frame_parms,
uint8_t aggregation, uint8_t aggregation,
uint8_t Num_dci uint8_t Num_dci
...@@ -154,28 +156,29 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB, ...@@ -154,28 +156,29 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
eNB->DCI_pdu = (DCI_PDU_NB*) malloc(sizeof(DCI_PDU_NB)); eNB->DCI_pdu = (DCI_PDU_NB*) malloc(sizeof(DCI_PDU_NB));
//N1 start
//N1 parameters
/// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits /// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits
uint8_t type; uint8_t type = 0;
//NPDCCH order indicator (set to 0),1 bits //NPDCCH order indicator (set to 0),1 bits
uint8_t orderIndicator; uint8_t orderIndicator = 0;
// Scheduling Delay, 3 bits // Scheduling Delay, 3 bits
uint8_t Scheddly; uint8_t Scheddly = 0;
// Resourse Assignment (RU Assignment), 3 bits // Resourse Assignment (RU Assignment), 3 bits
uint8_t ResAssign; uint8_t ResAssign = 0;
// Modulation and Coding Scheme, 4 bits // Modulation and Coding Scheme, 4 bits
uint8_t mcs; uint8_t mcs = 0;
// Repetition Number, 4 bits // Repetition Number, 4 bits
uint8_t RepNum; uint8_t RepNum = 0;
// DCI subframe repetition Number, 2 bits // DCI subframe repetition Number, 2 bits
uint8_t DCIRep; uint8_t DCIRep = 0;
// New Data Indicator,1 bits // New Data Indicator,1 bits
uint8_t ndi; uint8_t ndi = 0;
// HARQ-ACK resource,4 bits // HARQ-ACK resource,4 bits
uint8_t HARQackRes; uint8_t HARQackRes = 0;
//N2 start //N2 parameters
//Direct indication information, 8 bits //Direct indication information, 8 bits
uint8_t directIndInf; uint8_t directIndInf;
...@@ -186,12 +189,17 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB, ...@@ -186,12 +189,17 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
switch (dci_format) { switch (dci_format) {
// Impossible to have a DCI N0, we have condition before
case DCIFormatN0: case DCIFormatN0:
return(-1); return(-1);
break; break;
case DCIFormatN1_RAR: // This is DLSCH allocation for control traffic case DCIFormatN1_RAR: // This is DLSCH allocation for control traffic
ndlsch->subframe_tx[subframe] = 1; // check if it's OK
ndlsch->rnti = rnti;
ndlsch->active = 1;
type = DCI_Content->DCIN1_RAR.type; type = DCI_Content->DCIN1_RAR.type;
orderIndicator = DCI_Content->DCIN1_RAR.orderIndicator; orderIndicator = DCI_Content->DCIN1_RAR.orderIndicator;
Scheddly = DCI_Content->DCIN1_RAR.Scheddly; Scheddly = DCI_Content->DCIN1_RAR.Scheddly;
...@@ -223,6 +231,8 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB, ...@@ -223,6 +231,8 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
case DCIFormatN1: // for user data case DCIFormatN1: // for user data
ndlsch->subframe_tx[subframe] = 1; // check if it's OK
type = DCI_Content->DCIN1.type; type = DCI_Content->DCIN1.type;
orderIndicator = DCI_Content->DCIN1.orderIndicator; orderIndicator = DCI_Content->DCIN1.orderIndicator;
......
...@@ -168,6 +168,7 @@ typedef struct { ...@@ -168,6 +168,7 @@ typedef struct {
uint8_t codeword; uint8_t codeword;
} LTE_DL_eNB_HARQ_t; } LTE_DL_eNB_HARQ_t;
typedef struct { typedef struct {
/// Indicator of first transmission /// Indicator of first transmission
uint8_t first_tx; uint8_t first_tx;
...@@ -286,7 +287,6 @@ typedef struct { ...@@ -286,7 +287,6 @@ typedef struct {
} LTE_eNB_DLSCH_t; } LTE_eNB_DLSCH_t;
#define PUSCH_x 2 #define PUSCH_x 2
#define PUSCH_y 3 #define PUSCH_y 3
...@@ -805,6 +805,8 @@ typedef struct { ...@@ -805,6 +805,8 @@ typedef struct {
// NB-IoT // NB-IoT
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
typedef struct typedef struct
{ {
/// TX buffers for UE-spec transmission (antenna ports 5 or 7..14, prior to precoding) /// TX buffers for UE-spec transmission (antenna ports 5 or 7..14, prior to precoding)
...@@ -850,11 +852,47 @@ typedef struct ...@@ -850,11 +852,47 @@ typedef struct
}NB_IoT_eNB_NPDCCH_t; }NB_IoT_eNB_NPDCCH_t;
typedef struct {
/// NB-IoT
/// The scheduling the NPDCCH and the NPDSCH transmission TS 36.213 Table 16.4.1-1
uint8_t schedling_delay;
/// The number of the subframe to transmit the NPDSCH TB TS 36.213 Table 16.4.1.3-1
/// FAPI spec P.181 for the NPDSCH containing BCCH value 1-8, while 36.331 P.190 value only 2 & 8
/// Nsf
uint8_t resource_assignment;
/// Determined the repeat number of NPDSCH TB TS 36.213 Table 16.4.1.3-2 (Nrep)
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
uint8_t dci_subframe_repetitions;
/// modulation always QPSK Qm = 2
uint8_t modulation;
/// 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;
/// Frame where current HARQ round was sent
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
} NB_IoT_DL_eNB_HARQ_t;
typedef struct { typedef struct {
/// TX buffers for UE-spec transmission (antenna ports 5 or 7..14, prior to precoding) /// TX buffers for UE-spec transmission (antenna ports 5 or 7..14, prior to precoding)
int32_t *txdataF[8]; int32_t *txdataF[8];
/// beamforming weights for UE-spec transmission (antenna ports 5 or 7..14), for each codeword, maximum 4 layers?
int32_t **ue_spec_bf_weights[4];
/// dl channel estimates (estimated from ul channel estimates) /// 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) /// Allocated RNTI (0 means DLSCH_t is not currently used)
...@@ -867,26 +905,19 @@ typedef struct { ...@@ -867,26 +905,19 @@ typedef struct {
uint8_t nCCE[10]; uint8_t nCCE[10];
/*in NB-IoT there is only 1 HARQ process for each UE therefore no pid is required*/ /*in NB-IoT there is only 1 HARQ process for each UE therefore no pid is required*/
/// Current HARQ process id
//uint8_t current_harq_pid;
/// Process ID's per subframe. Used to associate received ACKs on PUSCH/PUCCH to DLSCH harq process ids
//uint8_t harq_ids[10];
/// Window size (in outgoing transport blocks) for fine-grain rate adaptation /// Window size (in outgoing transport blocks) for fine-grain rate adaptation
uint8_t ra_window_size; uint8_t ra_window_size;
/// First-round error threshold for fine-grain rate adaptation /// First-round error threshold for fine-grain rate adaptation
uint8_t error_threshold; uint8_t error_threshold;
/// The only HARQ processes for the DLSCH /// The only HARQ process for the DLSCH
LTE_DL_eNB_HARQ_t *harq_process; NB_IoT_DL_eNB_HARQ_t *harq_process;
/// Number of soft channel bits /// Number of soft channel bits
uint32_t G; uint32_t G;
/// Codebook index for this dlsch (0,1,2,3)
uint8_t codebook_index;
/// Maximum number of HARQ processes (for definition see 36-212 V8.6 2009-03, p.17)
//uint8_t Mdlharq;
/// Maximum number of HARQ rounds /// Maximum number of HARQ rounds
uint8_t Mlimit; uint8_t Mlimit;
/// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
//uint8_t Kmimo;
/// Nsoft parameter related to UE Category /// Nsoft parameter related to UE Category
uint32_t Nsoft; uint32_t Nsoft;
/// amplitude of PDSCH (compared to RS) in symbols without pilots /// amplitude of PDSCH (compared to RS) in symbols without pilots
...@@ -894,25 +925,96 @@ typedef struct { ...@@ -894,25 +925,96 @@ typedef struct {
/// amplitude of PDSCH (compared to RS) in symbols containing pilots /// amplitude of PDSCH (compared to RS) in symbols containing pilots
int16_t sqrt_rho_b; int16_t sqrt_rho_b;
///NB-IoT
/// may use in the npdsch_procedures
uint16_t scrambling_sequence_intialization;
/// number of cell specific TX antenna ports assumed by the UE
uint8_t nrs_antenna_ports;
/*
* This indicate the current subframe within the subframe interval between the NPDSCH transmission (Nsf*Nrep)
*/
uint16_t sf_index;
} NB_IoT_eNB_NDLSCH_t; } NB_IoT_eNB_NDLSCH_t;
typedef struct {
/// Determined the subcarrier allocation for the NPUSCH.(15, 3.75 KHz)
uint8_t subcarrier_indication;
/// Determined the number of resource unit for the NPUSCH
uint8_t resource_assignment;
/// Determined the scheduling delay for NPUSCH
uint8_t scheduling_delay;
/// The number of the repetition number for NPUSCH Transport block
uint8_t repetition_number;
/// Determined the repetition number value 0-3
uint8_t dci_subframe_repetitions;
/// Flag indicating that this ULSCH has been allocated by a DCI (otherwise it is a retransmission based on PHICH NAK)
uint8_t dci_alloc;
/// Flag indicating that this ULSCH has been allocated by a RAR (otherwise it is a retransmission based on PHICH NAK or DCI)
uint8_t rar_alloc;
/// Status Flag indicating for this ULSCH (idle,active,disabled)
SCH_status_t status;
/// Subframe scheduling indicator (i.e. Transmission opportunity indicator)
uint8_t subframe_scheduling_flag;
/// Transport block size
uint32_t TBS;
/// The payload + CRC size in bits
uint32_t B;
/// Number of soft channel bits
uint32_t G;
/// Pointer to ACK
uint8_t o_ACK[4];
/// Length of ACK information (bits)
uint8_t O_ACK;
/// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled
uint8_t h[MAX_NUM_CHANNEL_BITS];
/// Pointer to the payload
uint8_t *b;
/// Current Number of Symbols
uint8_t Nsymb_pusch;
/// Index of current HARQ round for this ULSCH
uint8_t round;
/// MCS format for this ULSCH
uint8_t mcs;
/// Redundancy-version of the current sub-frame (value 0->RV0,value 1 ->RV2)
uint8_t rvidx;
/// Msc_initial, Initial number of subcarriers for ULSCH (36-212, v8.6 2009-03, p.26-27)
uint16_t Msc_initial;
/// Nsymb_initial, Initial number of symbols for ULSCH (36-212, v8.6 2009-03, p.26-27)
uint8_t Nsymb_initial;
/// n_DMRS for cyclic shift of DMRS (36.213 Table 9.1.2-2)
uint8_t n_DMRS;
/// n_DMRS for cyclic shift of DMRS (36.213 Table 9.1.2-2) - previous scheduling
/// This is needed for PHICH generation which
/// is done after a new scheduling
uint8_t previous_n_DMRS;
/// n_DMRS 2 for cyclic shift of DMRS (36.211 Table 5.5.1.1.-1)
uint8_t n_DMRS2;
/// Flag to indicate that this ULSCH is for calibration information sent from UE (i.e. no MAC SDU to pass up)
// int calibration_flag;
/// delta_TF for power control
int32_t delta_TF;
} NB_IoT_UL_eNB_HARQ_t;
typedef struct { typedef struct {
/// Pointers to 8 HARQ processes for the ULSCH /// Pointers to 8 HARQ processes for the ULSCH
LTE_UL_eNB_HARQ_t *harq_process; NB_IoT_UL_eNB_HARQ_t *harq_process;
/// Maximum number of HARQ rounds /// Maximum number of HARQ rounds
uint8_t Mlimit; uint8_t Mlimit;
/// Maximum number of iterations used in eNB turbo decoder
//uint8_t max_turbo_iterations; /// Value 0 = npush format 1 (data) value 1 = npusch format 2 (ACK/NAK)
//boundling not exist in NB-IoT since we are not using TDD and only 1 HARQ process uint8_t npusch_format;
/// ACK/NAK Bundling flag
//uint8_t bundling;
/// beta_offset_cqi times 8
uint16_t beta_offset_cqi_times8;
/// beta_offset_ri times 8
uint16_t beta_offset_ri_times8;
/// beta_offset_harqack times 8
uint16_t beta_offset_harqack_times8;
/// Flag to indicate that eNB awaits UE Msg3 /// Flag to indicate that eNB awaits UE Msg3
uint8_t Msg3_active; uint8_t Msg3_active;
/// Flag to indicate that eNB should decode UE Msg3 /// Flag to indicate that eNB should decode UE Msg3
...@@ -927,10 +1029,19 @@ typedef struct { ...@@ -927,10 +1029,19 @@ typedef struct {
uint8_t cyclicShift; uint8_t cyclicShift;
/// cooperation flag /// cooperation flag
uint8_t cooperation_flag; uint8_t cooperation_flag;
/// num active cba group /// (only in-band mode), indicate the resource block overlap the SRS configuration of LTE
//uint8_t num_active_cba_groups; uint8_t N_srs;
/// allocated CBA RNTI for this ulsch
//uint16_t cba_rnti[4];//NUM_MAX_CBA_GROUP]; uint8_t scrambling_re_intialization_batch_index;
/// number of cell specific TX antenna ports assumed by the UE
uint8_t nrs_antenna_ports;
uint16_t scrambling_sequence_intialization;
uint16_t sf_index;
/// Determined the ACK/NACK delay and the subcarrier allocation TS 36.213 Table 16.4.2
uint8_t HARQ_ACK_resource;
} NB_IoT_eNB_NULSCH_t; } NB_IoT_eNB_NULSCH_t;
......
...@@ -234,7 +234,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_ ...@@ -234,7 +234,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
} }
/*
NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB(//unsigned char Kmimo, NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB(//unsigned char Kmimo,
//unsigned char Mdlharq, //unsigned char Mdlharq,
uint32_t Nsoft, uint32_t Nsoft,
...@@ -295,9 +295,7 @@ NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB(//unsigned char Kmimo, ...@@ -295,9 +295,7 @@ NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB(//unsigned char Kmimo,
//In NB-IoT we have only 1 HARQ process for each User------------- //In NB-IoT we have only 1 HARQ process for each User-------------
/*
* for Nb-IoT we are using the same HARQ structure as for LTE (for the moment)
*/
dlsch->harq_process = (LTE_DL_eNB_HARQ_t *)malloc16(sizeof(LTE_DL_eNB_HARQ_t)); dlsch->harq_process = (LTE_DL_eNB_HARQ_t *)malloc16(sizeof(LTE_DL_eNB_HARQ_t));
LOG_T(PHY, "[NB-IoT] Required mem size %d (bw scaling %d), dlsch->harq_process %p\n", LOG_T(PHY, "[NB-IoT] Required mem size %d (bw scaling %d), dlsch->harq_process %p\n",
MAX_DLSCH_PAYLOAD_BYTES/bw_scaling,bw_scaling,dlsch->harq_process); MAX_DLSCH_PAYLOAD_BYTES/bw_scaling,bw_scaling,dlsch->harq_process);
...@@ -365,7 +363,7 @@ NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB(//unsigned char Kmimo, ...@@ -365,7 +363,7 @@ NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB(//unsigned char Kmimo,
} }
*/
void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch) void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch)
{ {
......
...@@ -109,7 +109,7 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB, ...@@ -109,7 +109,7 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
DCI_CONTENT *DCI_Content, DCI_CONTENT *DCI_Content,
uint16_t rnti, uint16_t rnti,
DCI_format_NB_t dci_format, DCI_format_NB_t dci_format,
LTE_eNB_DLSCH_t *dlsch, NB_IoT_eNB_NDLSCH_t *ndlsch,
NB_DL_FRAME_PARMS *frame_parms, NB_DL_FRAME_PARMS *frame_parms,
uint8_t aggregation, uint8_t aggregation,
uint8_t Num_dci uint8_t Num_dci
......
...@@ -164,7 +164,7 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uin ...@@ -164,7 +164,7 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uin
return(NULL); return(NULL);
} }
/*
NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB(uint8_t abstraction_flag) NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB(uint8_t abstraction_flag)
{ {
...@@ -197,10 +197,7 @@ NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB(uint8_t abstraction_flag) ...@@ -197,10 +197,7 @@ NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB(uint8_t abstraction_flag)
//MP: add some parameters in npusch structure for convolutional coding to be set //MP: add some parameters in npusch structure for convolutional coding to be set
ulsch->Mlimit = 4; ulsch->Mlimit = 4;
/*
* In NB-IoT we have only 1 HARQ process for each UE
* we use the same HARQ process structure as LTE
*/
ulsch->harq_process = (LTE_UL_eNB_HARQ_t *)malloc16(sizeof(LTE_UL_eNB_HARQ_t)); ulsch->harq_process = (LTE_UL_eNB_HARQ_t *)malloc16(sizeof(LTE_UL_eNB_HARQ_t));
if (ulsch->harq_process) { if (ulsch->harq_process) {
...@@ -245,7 +242,7 @@ NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB(uint8_t abstraction_flag) ...@@ -245,7 +242,7 @@ NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB(uint8_t abstraction_flag)
return(NULL); return(NULL);
} }
*/
void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch) void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch)
{ {
......
...@@ -217,6 +217,12 @@ typedef struct { ...@@ -217,6 +217,12 @@ typedef struct {
/// scheduling parameters for RXn-TXnp4 thread /// scheduling parameters for RXn-TXnp4 thread
struct sched_param sched_param_rxtx; struct sched_param sched_param_rxtx;
/// NB-IoT for IF_Module
pthread_t pthread_l2;
pthread_cond_t cond_l2;
pthread_mutex_t mutex_l2;
int instance_cnt_l2;
pthread_attr_t attr_l2;
} eNB_rxtx_proc_t; } eNB_rxtx_proc_t;
typedef struct { typedef struct {
...@@ -447,7 +453,7 @@ typedef struct { ...@@ -447,7 +453,7 @@ typedef struct {
} DCI_ALLOC_NB_t; } DCI_ALLOC_NB_t;
typedef struct { typedef struct {
//delete the count for the DCI numbers,NUM_DCI_MAX should set to 1 //delete the count for the DCI numbers,NUM_DCI_MAX should set to 2
uint32_t num_npdcch_symbols; uint32_t num_npdcch_symbols;
uint8_t Num_dci; uint8_t Num_dci;
DCI_ALLOC_NB_t dci_alloc[2] ; DCI_ALLOC_NB_t dci_alloc[2] ;
...@@ -726,6 +732,7 @@ typedef struct PHY_VARS_eNB_s { ...@@ -726,6 +732,7 @@ typedef struct PHY_VARS_eNB_s {
NB_IoT_eNB_NDLSCH_t *dlsch_SI_NB,*dlsch_ra_NB; NB_IoT_eNB_NDLSCH_t *dlsch_SI_NB,*dlsch_ra_NB;
NB_DL_FRAME_PARMS frame_parms_nb_iot; NB_DL_FRAME_PARMS frame_parms_nb_iot;
// DCI for at most 2 DCI pdus
DCI_PDU_NB *DCI_pdu; DCI_PDU_NB *DCI_pdu;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
void process_schedule_rsp(Sched_Rsp_t *sched_rsp, void process_schedule_rsp(Sched_Rsp_t *sched_rsp,
PHY_VARS_eNB *eNB, PHY_VARS_eNB *eNB,
eNB_rxtx_proc_NB_t *proc); eNB_rxtx_proc_t *proc);
/*Processing the ue-specific resources for uplink in NB-IoT*/ /*Processing the ue-specific resources for uplink in NB-IoT*/
void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, UL_IND_t *UL_INFO); void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, UL_IND_t *UL_INFO);
...@@ -24,7 +24,7 @@ void NB_generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,Sched_ ...@@ -24,7 +24,7 @@ void NB_generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,Sched_
void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched_Rsp_t *Sched_Rsp,const int UE_id); void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched_Rsp_t *Sched_Rsp,const int UE_id);
/*Process all the scheduling result from MAC and also common signals.*/ /*Process all the scheduling result from MAC and also common signals.*/
void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_NB_t *proc,int do_meas); void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int do_meas);
#endif #endif
...@@ -477,20 +477,29 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched ...@@ -477,20 +477,29 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched
// configure dlsch parameters and CCE index (fill the dlsch_ra structure???) // configure dlsch parameters and CCE index (fill the dlsch_ra structure???)
LOG_D(PHY,"Generating dlsch params for RA_RNTI\n"); LOG_D(PHY,"Generating dlsch params for RA_RNTI\n");
// fill the dlsch_ra_NB sructure for RAR, and packed the DCI PDU
NB_generate_eNB_dlsch_params_from_dci(eNB, NB_generate_eNB_dlsch_params_from_dci(eNB,
frame, frame,
subframe, subframe,
&DCI_Content[i], &DCI_Content[i],
Sched_Rsp->NB_DL.NB_DCI->DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.rnti, Sched_Rsp->NB_DL.NB_DCI->DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.rnti,
DCIFormatN1_RAR, DCIFormatN1_RAR,
&eNB->dlsch_ra_NB, &eNB->dlsch_ra_NB,
fp, fp,
Sched_Rsp->NB_DL.NB_DCI->DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.aggregation_level, Sched_Rsp->NB_DL.NB_DCI->DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.aggregation_level,
Sched_Rsp->NB_DL.NB_DCI->DL_DCI.number_dci Sched_Rsp->NB_DL.NB_DCI->DL_DCI.number_dci
); );
eNB->dlsch_ra_NB->nCCE[subframe] = eNB->DCI_pdu->dci_alloc[i].firstCCE;
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (RA) => %"PRIu8"\n",eNB->Mod_id,frame,subframe,
eNB->dlsch_ra_NB->nCCE[subframe]);
break; break;
case DCIFormatN1: case DCIFormatN1:
//DCI format N1 to DLSCH if(UE_id >= 0)
{
//DCI format N1 to DLSCH
DCI_Content[i].DCIN1.type = 1; DCI_Content[i].DCIN1.type = 1;
DCI_Content[i].DCIN1.orderIndicator = Sched_Rsp->NB_DL.NB_DCI->DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.npdcch_order_indication; DCI_Content[i].DCIN1.orderIndicator = Sched_Rsp->NB_DL.NB_DCI->DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.npdcch_order_indication;
DCI_Content[i].DCIN1.Scheddly = Sched_Rsp->NB_DL.NB_DCI->DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.scheduling_delay; DCI_Content[i].DCIN1.Scheddly = Sched_Rsp->NB_DL.NB_DCI->DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.scheduling_delay;
...@@ -501,7 +510,8 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched ...@@ -501,7 +510,8 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched
DCI_Content[i].DCIN1.DCIRep = Sched_Rsp->NB_DL.NB_DCI->DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.dci_subframe_repetition_number; DCI_Content[i].DCIN1.DCIRep = Sched_Rsp->NB_DL.NB_DCI->DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.dci_subframe_repetition_number;
//fill the dlsch[] structure??? //fill the ndlsch structure for UE
//parameters we don't consider pdsch config dedicated since not calling the phy config dedicated step2
NB_generate_eNB_dlsch_params_from_dci(eNB, NB_generate_eNB_dlsch_params_from_dci(eNB,
frame, frame,
subframe, subframe,
...@@ -512,8 +522,20 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched ...@@ -512,8 +522,20 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched
fp, fp,
Sched_Rsp->NB_DL.NB_DCI->DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.aggregation_level, Sched_Rsp->NB_DL.NB_DCI->DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.aggregation_level,
Sched_Rsp->NB_DL.NB_DCI->DL_DCI.number_dci Sched_Rsp->NB_DL.NB_DCI->DL_DCI.number_dci
); );
eNB->ndlsch[(uint8_t)UE_id]->nCCE[subframe] = eNB->DCI_pdu->dci_alloc[i].firstCCE;
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for ue DCI (PDSCH %"PRIx16") => %"PRIu8"\n",eNB->Mod_id,frame,subframe,
eNB->DCI_pdu->dci_alloc[i].rnti,eNB->ndlsch[(uint8_t)UE_id]->nCCE[subframe]);
}
else
{
LOG_D(PHY,"[eNB %"PRIu8"][NPDSCH] Frame %d : No UE_id with corresponding rnti %"PRIx16", dropping NDLSCH\n",
eNB->Mod_id,frame,eNB->DCI_pdu->dci_alloc[i].rnti);
}
break; break;
/*TODO reserve for the N2 DCI*/ /*TODO reserve for the N2 DCI*/
case DCIFormatN2_Pag: case DCIFormatN2_Pag:
LOG_I(PHY, "Paging is not implemented, DCIFormatN2_Pag cannot be elaborated\n"); LOG_I(PHY, "Paging is not implemented, DCIFormatN2_Pag cannot be elaborated\n");
...@@ -581,7 +603,7 @@ void NB_generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,Sched_ ...@@ -581,7 +603,7 @@ void NB_generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,Sched_
*/ */
void process_schedule_rsp(Sched_Rsp_t *sched_rsp, void process_schedule_rsp(Sched_Rsp_t *sched_rsp,
PHY_VARS_eNB *eNB, PHY_VARS_eNB *eNB,
eNB_rxtx_proc_NB_t *proc) eNB_rxtx_proc_t *proc)
{ {
...@@ -653,7 +675,7 @@ void process_schedule_rsp(Sched_Rsp_t *sched_rsp, ...@@ -653,7 +675,7 @@ void process_schedule_rsp(Sched_Rsp_t *sched_rsp,
//check for the SI (FAPI specs rnti_type = 1 Other or rnti_type = 0 BCCH information) //check for the SI (FAPI specs rnti_type = 1 Other or rnti_type = 0 BCCH information)
if(sched_rsp->NB_DL.NB_DLSCH->ndlsch.rnti_type == 0) if(sched_rsp->NB_DL.NB_DLSCH->ndlsch.rnti_type == 0)
{ {
//TODO fill the dlsch_SI //TODO fill the dlsch_SI, in NB-IoT you don't have the DCI to manage system information
} }
else else
{ {
...@@ -977,7 +999,7 @@ extern int oai_exit; ...@@ -977,7 +999,7 @@ extern int oai_exit;
r_type, rn is only used in PMCH procedure so I remove it. r_type, rn is only used in PMCH procedure so I remove it.
*/ */
void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_NB_t *proc, eNB_rxtx_proc_t *proc,
int do_meas) int do_meas)
{ {
int frame = proc->frame_tx; int frame = proc->frame_tx;
......
...@@ -1694,7 +1694,7 @@ int main( int argc, char **argv ) { ...@@ -1694,7 +1694,7 @@ int main( int argc, char **argv ) {
PHY_vars_eNB_g[0][CC_id] = init_lte_eNB(frame_parms[CC_id],0,frame_parms[CC_id]->Nid_cell,node_function[CC_id],abstraction_flag); PHY_vars_eNB_g[0][CC_id] = init_lte_eNB(frame_parms[CC_id],0,frame_parms[CC_id]->Nid_cell,node_function[CC_id],abstraction_flag);
//this is a complementary function for just initialize manage NB_ioT stuff inside the PHY_Vars //this is a complementary function for just initialize manage NB_ioT stuff inside the PHY_Vars
#ifdef NB_IOT #ifdef NB_IOT
init_lte_eNB_NB(PHY_vars_eNB_g[0][CC_id],frame_parms_nb_iot[CC_id], 0, frame_parms_nb_iot[CC_id]->Nid_cell,node_function[CC_id],abstraction_flag); //init_lte_eNB_NB(PHY_vars_eNB_g[0][CC_id],frame_parms_nb_iot[CC_id], 0, frame_parms_nb_iot[CC_id]->Nid_cell,node_function[CC_id],abstraction_flag);
#endif #endif
PHY_vars_eNB_g[0][CC_id]->ue_dl_rb_alloc=0x1fff; PHY_vars_eNB_g[0][CC_id]->ue_dl_rb_alloc=0x1fff;
......
...@@ -147,7 +147,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -147,7 +147,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
return (PHY_vars_eNB); return (PHY_vars_eNB);
} }
/*
void init_lte_eNB_NB( void init_lte_eNB_NB(
PHY_VARS_eNB *PHY_vars_eNB, PHY_VARS_eNB *PHY_vars_eNB,
NB_DL_FRAME_PARMS *frame_parms, NB_DL_FRAME_PARMS *frame_parms,
...@@ -181,10 +181,6 @@ void init_lte_eNB_NB( ...@@ -181,10 +181,6 @@ void init_lte_eNB_NB(
/*
* In NB-IoT we not transmit two dlsch pdu at the same time so the dlsch dimension in PHY_vars_eNB for NB-IoT is just an array
*/
for (i=0; i<NUMBER_OF_UE_MAX; i++) { for (i=0; i<NUMBER_OF_UE_MAX; i++) {
LOG_I(PHY,"[NB-IoT] Allocating Transport Channel Buffers for NDLSCH, UE %d\n",i); LOG_I(PHY,"[NB-IoT] Allocating Transport Channel Buffers for NDLSCH, UE %d\n",i);
PHY_vars_eNB->ndlsch[i] = new_eNB_dlsch_NB(NSOFT,abstraction_flag,frame_parms); PHY_vars_eNB->ndlsch[i] = new_eNB_dlsch_NB(NSOFT,abstraction_flag,frame_parms);
...@@ -238,7 +234,7 @@ void init_lte_eNB_NB( ...@@ -238,7 +234,7 @@ void init_lte_eNB_NB(
return; return;
} }
*/
PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms, PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t UE_id, uint8_t UE_id,
......
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