Commit c6b11be0 authored by Nick Ho's avatar Nick Ho

code compiled, phy modify

parent 6bc94248
...@@ -1003,6 +1003,7 @@ set(PHY_SRC ...@@ -1003,6 +1003,7 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pbch.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pbch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_nb_iot.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/phich.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/phich.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pcfich.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pcfich.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch.c
......
...@@ -2045,7 +2045,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, ...@@ -2045,7 +2045,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
uint32_t n_rnti, uint32_t n_rnti,
int16_t amp, int16_t amp,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
//NB_IoT_eNB_NPDCCH_t npdcch,
int32_t **txdataF, int32_t **txdataF,
uint32_t subframe) uint32_t subframe)
{ {
...@@ -2132,24 +2131,11 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, ...@@ -2132,24 +2131,11 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
#endif #endif
if (dci_alloc[i].firstCCE>=0) { if (dci_alloc[i].firstCCE>=0) {
//encoding
e_ptr = generate_dci0(dci_alloc[i].dci_pdu, e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
e+(72*dci_alloc[i].firstCCE), e+(72*dci_alloc[i].firstCCE),
dci_alloc[i].dci_length, dci_alloc[i].dci_length,
dci_alloc[i].L, dci_alloc[i].L,
dci_alloc[i].rnti); dci_alloc[i].rnti);
//new NB-IoT
npdcch_encoding_NB_IoT(
dci_alloc[i].dci_pdu,
frame_parms,
npdcch, //see when function dci_top is called
//no frame
subframe
//rm_stats, te_stats, i_stats
);
} }
} }
} }
...@@ -2171,9 +2157,9 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, ...@@ -2171,9 +2157,9 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
dci_alloc[i].L, dci_alloc[i].L,
dci_alloc[i].rnti); dci_alloc[i].rnti);
} }
else { else {
} }
} }
} }
} }
...@@ -2188,31 +2174,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, ...@@ -2188,31 +2174,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
//NB-IoT--------------------------
/*
* switch(npdcch_start_index)
* case 0
* G = 272
* case 1
* G = 248
* case 2
* G = 224
* case 3
* G = 200
*/
npdcch_scrambling_NB_IoT(
frame_parms,
npdcch,
//G,
//q = nf mod 2 (TS 36.211 ch 10.2.3.1) with nf = number of frame
//slot_id
);
// Now do modulation // Now do modulation
if (frame_parms->mode1_flag==1) if (frame_parms->mode1_flag==1)
...@@ -2274,18 +2235,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, ...@@ -2274,18 +2235,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
} }
//NB-IoT
npdcch_modulation_NB_IoT(
txdataF,
AMP,
frame_parms,
//no symbol
//npdcch0???
//RB_ID --> statically get from the higher layer (may included in the dl_frame params)
);
#ifdef DEBUG_DCI_ENCODING #ifdef DEBUG_DCI_ENCODING
printf(" PDCCH Interleaving\n"); printf(" PDCCH Interleaving\n");
#endif #endif
...@@ -2294,9 +2243,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, ...@@ -2294,9 +2243,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
// This is the interleaving procedure defined in 36-211, first part of Section 6.8.5 // This is the interleaving procedure defined in 36-211, first part of Section 6.8.5
pdcch_interleaving(frame_parms,&y[0],&wbar[0],num_pdcch_symbols,mi); pdcch_interleaving(frame_parms,&y[0],&wbar[0],num_pdcch_symbols,mi);
//in NB-IoT the interleaving is done directly with the encoding procedure
mprime=0; mprime=0;
nsymb = (frame_parms->Ncp==0) ? 14:12; nsymb = (frame_parms->Ncp==0) ? 14:12;
re_offset = frame_parms->first_carrier_offset; re_offset = frame_parms->first_carrier_offset;
...@@ -2422,7 +2368,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, ...@@ -2422,7 +2368,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
return(num_pdcch_symbols); return(num_pdcch_symbols);
} }
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB, uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t num_ue_spec_dci, uint8_t num_ue_spec_dci,
......
...@@ -53,22 +53,8 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci, ...@@ -53,22 +53,8 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci,
uint32_t subframe) uint32_t subframe)
{ {
uint8_t *e_ptr,num_pdcch_symbols;
int8_t L;
uint32_t i, lprime;
uint32_t gain_lin_QPSK,kprime,kprime_mod12,mprime,nsymb,symbol_offset,tti_offset;
int16_t re_offset;
uint8_t mi = get_mi(frame_parms,subframe);
static uint8_t e[DCI_BITS_MAX];
static int32_t yseq0[Msymb],yseq1[Msymb],wbar0[Msymb],wbar1[Msymb];
int32_t *y[2];
int32_t *wbar[2];
int nushiftmod3 = frame_parms->nushift%3;
int split_flag=0;
int i,L;
/* /*
**e_ptr : store the encoding result, and as a input to modulation **e_ptr : store the encoding result, and as a input to modulation
*num_pdcch_symbols : to calculate the resource allocation for pdcch *num_pdcch_symbols : to calculate the resource allocation for pdcch
...@@ -82,18 +68,6 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci, ...@@ -82,18 +68,6 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci,
//num_pdcch_symbols = get_num_pdcch_symbols(num_ue_spec_dci+num_common_dci,dci_alloc,frame_parms,subframe); //num_pdcch_symbols = get_num_pdcch_symbols(num_ue_spec_dci+num_common_dci,dci_alloc,frame_parms,subframe);
wbar[0] = &wbar0[0];
wbar[1] = &wbar1[0];
y[0] = &yseq0[0];
y[1] = &yseq1[0];
// reset all bits to <NIL>, here we set <NIL> elements as 2
// memset(e, 2, DCI_BITS_MAX);
// here we interpret NIL as a random QPSK sequence. That makes power estimation easier.
for (i=0; i<DCI_BITS_MAX; i++)
e[i]=taus()&1;
e_ptr = e;
// generate DCIs in order of decreasing aggregation level, then common/ue spec // generate DCIs in order of decreasing aggregation level, then common/ue spec
// MAC is assumed to have ordered the UE spec DCI according to the RNTI-based randomization // MAC is assumed to have ordered the UE spec DCI according to the RNTI-based randomization
...@@ -104,18 +78,15 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci, ...@@ -104,18 +78,15 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci,
if (dci_alloc[i].L == (uint8_t)L) { if (dci_alloc[i].L == (uint8_t)L) {
if (dci_alloc[i].firstCCE>=0) { if (dci_alloc[i].firstCCE>=0) {
//encoding
e_ptr = generate_dci0(dci_alloc[i].dci_pdu,e+(72*dci_alloc[i].firstCCE),dci_alloc[i].dci_length,dci_alloc[i].L,dci_alloc[i].rnti);
//new NB-IoT //NB-IoT encoding
npdcch_encoding_NB_IoT( /*npdcch_encoding_NB_IoT(dci_alloc[i].dci_pdu,
dci_alloc[i].dci_pdu, frame_parms,
frame_parms, npdcch, //see when function dci_top is called
npdcch, //see when function dci_top is called //no frame
//no frame subframe
subframe //rm_stats, te_stats, i_stats
//rm_stats, te_stats, i_stats );*/
);
} }
...@@ -142,7 +113,8 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci, ...@@ -142,7 +113,8 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci,
* G = 200 * G = 200
*/ */
/*
// NB-IoT scrambling
npdcch_scrambling_NB_IoT( npdcch_scrambling_NB_IoT(
frame_parms, frame_parms,
npdcch, npdcch,
...@@ -153,7 +125,7 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci, ...@@ -153,7 +125,7 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci,
//NB-IoT //NB-IoT modulation
npdcch_modulation_NB_IoT( npdcch_modulation_NB_IoT(
txdataF, txdataF,
AMP, AMP,
...@@ -161,7 +133,7 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci, ...@@ -161,7 +133,7 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci,
//no symbol //no symbol
//npdcch0??? //npdcch0???
//RB_ID --> statically get from the higher layer (may included in the dl_frame params) //RB_ID --> statically get from the higher layer (may included in the dl_frame params)
); );*/
......
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
* \note * \note
* \warning * \warning
*/ */
#ifndef __DCI_NB_IOT_H__
#define __DCI_NB_IOT_H__
#ifndef USER_MODE #ifndef USER_MODE
#include "PHY/types.h" #include "PHY/types.h"
#else #else
...@@ -281,3 +284,7 @@ struct DCIN2_Pag{ ...@@ -281,3 +284,7 @@ struct DCIN2_Pag{
typedef struct DCIN2_Pag DCIN2_Pag_t; typedef struct DCIN2_Pag DCIN2_Pag_t;
#define sizeof_DCIN2_Pag_t 15 #define sizeof_DCIN2_Pag_t 15
#define MAX_DCI_SIZE_BITS_NB_IOT 23
#endif
\ No newline at end of file
...@@ -62,8 +62,8 @@ void NB_add_dci(DCI_PDU_NB *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_size ...@@ -62,8 +62,8 @@ void NB_add_dci(DCI_PDU_NB *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_size
} }
int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB_NB *eNB, int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_NB_t *proc, eNB_rxtx_proc_t *proc,
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,
...@@ -137,7 +137,8 @@ int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB_NB *eNB, ...@@ -137,7 +137,8 @@ int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB_NB *eNB,
} }
} }
int NB_generate_eNB_dlsch_params_from_dci(int frame, int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
int frame,
uint8_t subframe, uint8_t subframe,
DCI_CONTENT *DCI_Content, DCI_CONTENT *DCI_Content,
uint16_t rnti, uint16_t rnti,
......
...@@ -901,7 +901,7 @@ typedef struct { ...@@ -901,7 +901,7 @@ 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; LTE_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 /// Maximum number of iterations used in eNB turbo decoder
//uint8_t max_turbo_iterations; //uint8_t max_turbo_iterations;
//boundling not exist in NB-IoT since we are not using TDD and only 1 HARQ process //boundling not exist in NB-IoT since we are not using TDD and only 1 HARQ process
......
...@@ -31,36 +31,13 @@ ...@@ -31,36 +31,13 @@
*/ */
#ifndef __LTE_TRANSPORT_DEFS_NB_IOT__H__ #ifndef __LTE_TRANSPORT_DEFS_NB_IOT__H__
#define __LTE_TRANSPORT_DEFS_NB_IOT__H__ #define __LTE_TRANSPORT_DEFS_NB_IOT__H__
#include "PHY/defs.h"
#include "dci_nb_iot.h" #include "dci_nb_iot.h"
#include "PHY/defs.h"
#ifndef STANDALONE_COMPILE #ifndef STANDALONE_COMPILE
#include "UTIL/LISTS/list.h" #include "UTIL/LISTS/list.h"
#endif #endif
typedef struct {
/// Length of DCI in bits
uint8_t dci_length;
/// Aggregation level only 0,1 in NB-IoT
uint8_t L;
/// Position of first CCE of the dci
int firstCCE;
/// flag to indicate that this is a RA response
boolean_t ra_flag;
/// rnti
rnti_t rnti;
/// Format
DCI_format_NB_t format;
/// DCI pdu
uint8_t dci_pdu[8];
} DCI_ALLOC_NB_t;
typedef struct {
//delete the count for the DCI numbers,NUM_DCI_MAX should set to 1
uint32_t num_npdcch_symbols;
uint8_t Num_dci;
DCI_ALLOC_NB_t dci_alloc[2] ;
} DCI_PDU_NB;
// to be created LTE_eNB_DLSCH_t --> is duplicated for each number of UE and then indexed in the table // to be created LTE_eNB_DLSCH_t --> is duplicated for each number of UE and then indexed in the table
......
...@@ -93,8 +93,8 @@ void npbch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -93,8 +93,8 @@ void npbch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
void NB_add_dci(DCI_PDU_NB *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_size_bytes,unsigned char aggregation,unsigned char dci_size_bits,unsigned char dci_fmt); void NB_add_dci(DCI_PDU_NB *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_size_bytes,unsigned char aggregation,unsigned char dci_size_bits,unsigned char dci_fmt);
/*Use the UL DCI Information to configure PHY and also Packed*/ /*Use the UL DCI Information to configure PHY and also Packed*/
int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB_NB *eNB, int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_NB_t *proc, eNB_rxtx_proc_t *proc,
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,
...@@ -103,7 +103,8 @@ int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB_NB *eNB, ...@@ -103,7 +103,8 @@ int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB_NB *eNB,
uint8_t Num_dci uint8_t Num_dci
); );
/*Use the DL DCI Information to configure PHY and also Packed*/ /*Use the DL DCI Information to configure PHY and also Packed*/
int NB_generate_eNB_dlsch_params_from_dci(int frame, int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
int frame,
uint8_t subframe, uint8_t subframe,
DCI_CONTENT *DCI_Content, DCI_CONTENT *DCI_Content,
uint16_t rnti, uint16_t rnti,
......
...@@ -216,6 +216,7 @@ typedef struct { ...@@ -216,6 +216,7 @@ typedef struct {
pthread_mutex_t mutex_rxtx; pthread_mutex_t mutex_rxtx;
/// scheduling parameters for RXn-TXnp4 thread /// scheduling parameters for RXn-TXnp4 thread
struct sched_param sched_param_rxtx; struct sched_param sched_param_rxtx;
} eNB_rxtx_proc_t; } eNB_rxtx_proc_t;
typedef struct { typedef struct {
...@@ -428,6 +429,30 @@ typedef struct { ...@@ -428,6 +429,30 @@ typedef struct {
UE_rxtx_proc_t proc_rxtx[2]; UE_rxtx_proc_t proc_rxtx[2];
} UE_proc_t; } UE_proc_t;
typedef struct {
/// Length of DCI in bits
uint8_t dci_length;
/// Aggregation level only 0,1 in NB-IoT
uint8_t L;
/// Position of first CCE of the dci
int firstCCE;
/// flag to indicate that this is a RA response
boolean_t ra_flag;
/// rnti
rnti_t rnti;
/// Format
DCI_format_NB_t format;
/// DCI pdu
uint8_t dci_pdu[8];
} DCI_ALLOC_NB_t;
typedef struct {
//delete the count for the DCI numbers,NUM_DCI_MAX should set to 1
uint32_t num_npdcch_symbols;
uint8_t Num_dci;
DCI_ALLOC_NB_t dci_alloc[2] ;
} DCI_PDU_NB;
/// Top-level PHY Data Structure for eNB /// Top-level PHY Data Structure for eNB
typedef struct PHY_VARS_eNB_s { typedef struct PHY_VARS_eNB_s {
...@@ -667,13 +692,13 @@ typedef struct PHY_VARS_eNB_s { ...@@ -667,13 +692,13 @@ typedef struct PHY_VARS_eNB_s {
NB_IoT_eNB_NPBCH npbch; NB_IoT_eNB_NPBCH npbch;
NB_IoT_eNB_NPDCCH_t *npdcch[NUMBER_OF_UE_MAX_NB_IoT]; //check the max size of this array NB_IoT_eNB_NPDCCH_t *npdcch[NUMBER_OF_UE_MAX_NB_IoT]; //check the max size of this array
NB_IoT_eNB_NDLSCH_t *ndlsch[NUMBER_OF_UE_MAX_NB_IoT]; NB_IoT_eNB_NDLSCH_t *ndlsch[NUMBER_OF_UE_MAX_NB_IoT];
NB_IoT_eNB_NULSCH_t *nulsch[NUMBER_OF_UE_MAX_NB_IoT+1] //nulsch[0] contains the RAR NB_IoT_eNB_NULSCH_t *nulsch[NUMBER_OF_UE_MAX_NB_IoT+1]; //nulsch[0] contains the RAR
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_PDU_NB DCI_pdu; DCI_PDU_NB *DCI_pdu;
...@@ -960,6 +985,7 @@ void exit_fun(const char* s); ...@@ -960,6 +985,7 @@ void exit_fun(const char* s);
static inline int wait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name) { static inline int wait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name) {
// lock the mutex, if lock successfully, it would return the 0, the other value means failed
if (pthread_mutex_lock(mutex) != 0) { if (pthread_mutex_lock(mutex) != 0) {
LOG_E( PHY, "[SCHED][eNB] error locking mutex for %s\n",name); LOG_E( PHY, "[SCHED][eNB] error locking mutex for %s\n",name);
exit_fun("nothing to add"); exit_fun("nothing to add");
......
...@@ -471,22 +471,23 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched ...@@ -471,22 +471,23 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched
switch (Sched_Rsp->NB_DL.NB_DCI.DCI_Format){ switch (Sched_Rsp->NB_DL.NB_DCI.DCI_Format){
case DCIFormatN1_RAR: case DCIFormatN1_RAR:
//DCI format N1 to RAR //DCI format N1 to RAR
DCI_Content[i]->DCIN1_RAR.type = 1; DCI_Content[i].DCIN1_RAR.type = 1;
//check if this work //check if this work
DCI_Content[i]->DCIN1_RAR.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_RAR.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_RAR.Scheddly = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.scheduling_delay; DCI_Content[i].DCIN1_RAR.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_RAR.ResAssign = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.resource_assignment; DCI_Content[i].DCIN1_RAR.ResAssign = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.resource_assignment;
DCI_Content[i]->DCIN1_RAR.mcs = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.mcs; DCI_Content[i].DCIN1_RAR.mcs = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.mcs;
DCI_Content[i]->DCIN1_RAR.ndi = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.new_data_indicator; DCI_Content[i].DCIN1_RAR.ndi = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.new_data_indicator;
DCI_Content[i]->DCIN1_RAR.HARQackRes = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.harq_ack_resource; DCI_Content[i].DCIN1_RAR.HARQackRes = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.harq_ack_resource;
DCI_Content[i]->DCIN1_RAR.DCIRep = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.dci_subframe_repetition_number; DCI_Content[i].DCIN1_RAR.DCIRep = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.dci_subframe_repetition_number;
// configure dlsch parameters and CCE index // configure dlsch parameters and CCE index
LOG_D(PHY,"Generating dlsch params for RA_RNTI\n"); LOG_D(PHY,"Generating dlsch params for RA_RNTI\n");
NB_generate_eNB_dlsch_params_from_dci(frame, NB_generate_eNB_dlsch_params_from_dci(eNB,
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, &eNB->dlsch_ra,
...@@ -497,18 +498,19 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched ...@@ -497,18 +498,19 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched
break; break;
case DCIFormatN1: case DCIFormatN1:
//DCI format N1 to DLSCH //DCI format N1 to DLSCH
DCI_Content[i]->DCIN1_RAR.type = 1; DCI_Content[i].DCIN1_RAR.type = 1;
DCI_Content[i]->DCIN1_RAR.orderIndicator = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.npdcch_order_indication; DCI_Content[i].DCIN1_RAR.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_RAR.Scheddly = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.scheduling_delay; DCI_Content[i].DCIN1_RAR.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_RAR.ResAssign = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.resource_assignment; DCI_Content[i].DCIN1_RAR.ResAssign = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.resource_assignment;
DCI_Content[i]->DCIN1_RAR.mcs = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.mcs; DCI_Content[i].DCIN1_RAR.mcs = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.mcs;
DCI_Content[i]->DCIN1_RAR.ndi = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.new_data_indicator; DCI_Content[i].DCIN1_RAR.ndi = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.new_data_indicator;
DCI_Content[i]->DCIN1_RAR.HARQackRes = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.harq_ack_resource; DCI_Content[i].DCIN1_RAR.HARQackRes = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.harq_ack_resource;
DCI_Content[i]->DCIN1_RAR.DCIRep = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.dci_subframe_repetition_number; DCI_Content[i].DCIN1_RAR.DCIRep = Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.dci_subframe_repetition_number;
NB_generate_eNB_dlsch_params_from_dci(frame, NB_generate_eNB_dlsch_params_from_dci(eNB,
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,
DCIFormatN0, DCIFormatN0,
eNB->dlsch[(uint8_t)UE_id], eNB->dlsch[(uint8_t)UE_id],
...@@ -541,22 +543,22 @@ void NB_generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,Sched_ ...@@ -541,22 +543,22 @@ void NB_generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,Sched_
{ {
//mapping the fapi parameters to the OAI parameters //mapping the fapi parameters to the OAI parameters
DCI_Content[i]->DCIN0.type = 0; DCI_Content[i].DCIN0.type = 0;
DCI_Content[i]->DCIN0.scind = Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list->npdcch_dci_pdu.npdcch_dci_pdu_rel13.subcarrier_indication; DCI_Content[i].DCIN0.scind = Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list[i].npdcch_dci_pdu.npdcch_dci_pdu_rel13.subcarrier_indication;
DCI_Content[i]->DCIN0.ResAssign = Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list->npdcch_dci_pdu.npdcch_dci_pdu_rel13.subcarrier_indication; DCI_Content[i].DCIN0.ResAssign = Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list[i].npdcch_dci_pdu.npdcch_dci_pdu_rel13.subcarrier_indication;
DCI_Content[i]->DCIN0.mcs = Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list->npdcch_dci_pdu.npdcch_dci_pdu_rel13.mcs; DCI_Content[i].DCIN0.mcs = Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list[i].npdcch_dci_pdu.npdcch_dci_pdu_rel13.mcs;
DCI_Content[i]->DCIN0.ndi = Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list->npdcch_dci_pdu.npdcch_dci_pdu_rel13.new_data_indicator; DCI_Content[i].DCIN0.ndi = Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list[i].npdcch_dci_pdu.npdcch_dci_pdu_rel13.new_data_indicator;
DCI_Content[i]->DCIN0.Scheddly = Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list->npdcch_dci_pdu.npdcch_dci_pdu_rel13.scheduling_delay; DCI_Content[i].DCIN0.Scheddly = Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list[i].npdcch_dci_pdu.npdcch_dci_pdu_rel13.scheduling_delay;
DCI_Content[i]->DCIN0.RepNum = Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list->npdcch_dci_pdu.npdcch_dci_pdu_rel13.repetition_number; DCI_Content[i].DCIN0.RepNum = Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list[i].npdcch_dci_pdu.npdcch_dci_pdu_rel13.repetition_number;
DCI_Content[i]->DCIN0.rv = Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list->npdcch_dci_pdu.npdcch_dci_pdu_rel13.redudancy_version; DCI_Content[i].DCIN0.rv = Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list[i].npdcch_dci_pdu.npdcch_dci_pdu_rel13.redudancy_version;
DCI_Content[i]->DCIN0.DCIRep = Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list->npdcch_dci_pdu.npdcch_dci_pdu_rel13.dci_subframe_repetition_number; DCI_Content[i].DCIN0.DCIRep = Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list[i].npdcch_dci_pdu.npdcch_dci_pdu_rel13.dci_subframe_repetition_number;
/*Log for generate ULSCH DCI*/ /*Log for generate ULSCH DCI*/
NB_generate_eNB_ulsch_params_from_dci(eNB, NB_generate_eNB_ulsch_params_from_dci(eNB,
proc, proc,
DCI_Content[i], &DCI_Content[i],
Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list->npdcch_dci_pdu.npdcch_dci_pdu_rel13.rnti, Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list->npdcch_dci_pdu.npdcch_dci_pdu_rel13.rnti,
DCIFormatN0, DCIFormatN0,
UE_id, UE_id,
...@@ -576,280 +578,6 @@ void NB_generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,Sched_ ...@@ -576,280 +578,6 @@ void NB_generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,Sched_
} }
} }
/*
* for NB-IoT
* this function is called by the PHy procedure TX in 3 possible occasion:
* 1) we manage BCCH pdu
* 2) we manage RA dlsch pdu (to be checked if needed in our case)
* 3) UE specific dlsch pdu
* ** we need to know if exist and which value has the eutracontrolRegionSize (TS 36.213 ch 16.4.1.4) whenever we are in In-band mode
* ** CQI and PMI are not present in NB-IoT
* ** redundancy version exist only in UL for NB-IoT and not in DL
*/
void pdsch_procedures_NB(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc, //Context data structure for RX/TX portion of subframe processing
NB_IoT_eNB_DLSCH_t *dlsch,
NB_IoT_eNB_DLSCH_t *dlsch1,//this is the second colum of the UE specific LTE_eNB_DLSCH_t (see the PHY/defs.h line 471)
LTE_eNB_UE_stats *ue_stats,
int ra_flag,// set to 1 only in case of RA
int num_pdcch_symbols,
uint32_t segment_length, //lenght of the DLSCH PDU from the Sched_rsp (FAPI nomenclature)
uint8_t* segment_data // the DLSCH PDU itself from the Sched_rsp (FAPI nomenclature)
)
{
int frame=proc->frame_tx;
int subframe=proc->subframe_tx;
//int harq_pid = dlsch->current_harq_pid;
LTE_DL_eNB_HARQ_t dlsch_harq=dlsch->harq_process; //TODO: review the HARQ process for NB_IoT
int input_buffer_length = dlsch_harq->TBS/8; // get in byte //to be changed for NB_IoT????
NB_DL_FRAME_PARMS *fp=&eNB->frame_parms_nb_iot;
uint8_t *DLSCH_pdu=NULL;
uint8_t DLSCH_pdu_tmp[input_buffer_length+4]; //[768*8];
uint8_t DLSCH_pdu_rar[256];
int i;
LOG_D(PHY,
"[eNB %"PRIu8"][PDSCH rnti%"PRIx16"/HARQ proc%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", G %d, nb_rb %"PRIu16", mcs %"PRIu8"(round %"PRIu8")\n",
eNB->Mod_id,
dlsch->rnti,
harq_pid,
frame, subframe, input_buffer_length,
get_G(fp,dlsch_harq->nb_rb,dlsch_harq->rb_alloc,get_Qm(dlsch_harq->mcs),dlsch_harq->Nl, num_pdcch_symbols, frame, subframe, dlsch_harq->mimo_mode==TM7?7:0),
dlsch_harq->nb_rb, //in NB_IoT we not need it???
dlsch_harq->mcs, //why MCS is inside the harq???
dlsch_harq->round);
#if defined(MESSAGE_CHART_GENERATOR_PHY)
MSC_LOG_TX_MESSAGE(
MSC_PHY_ENB,MSC_PHY_UE,
NULL,0,
"%05u:%02u PDSCH/DLSCH input size = %"PRIu16", G %d, nb_rb %"PRIu16", mcs %"PRIu8", pmi_alloc %"PRIx16", rv %"PRIu8" (round %"PRIu8")",
frame, subframe,
input_buffer_length,
get_G(fp,
dlsch_harq->nb_rb,
dlsch_harq->rb_alloc,
get_Qm(dlsch_harq->mcs),
dlsch_harq->Nl,
num_pdcch_symbols,
frame,
subframe,
dlsch_harq->mimo_mode==TM7?7:0),
dlsch_harq->nb_rb,
dlsch_harq->mcs,
pmi2hex_2Ar1(dlsch_harq->pmi_alloc),
dlsch_harq->rvidx,
dlsch_harq->round);
#endif
if (ue_stats) ue_stats->dlsch_sliding_cnt++;
if (dlsch_harq->round == 0) {
if (ue_stats)
ue_stats->dlsch_trials[harq_pid][0]++;
if (eNB->mac_enabled==1) { // set in lte-softmodem - main line 1646
if (ra_flag == 0) {
DLSCH_pdu =segment_data;
}
else { // XXX decide what should be done for NB-IoT
/*
* In FAPI style we don-t need to process the RAR because we have all the parameters for getting the MSG3 given by the
* UL_CONFIG.request
* 1) this data are given at the same time with the DLSCH PDU containing the RAR???
* 2) wee need to do a mapping of this parameters OAI->FAPI
*/
int16_t crnti = mac_xface->fill_rar(eNB->Mod_id,
eNB->CC_id,
frame,
DLSCH_pdu_rar,
fp->N_RB_UL,
input_buffer_length);
DLSCH_pdu = DLSCH_pdu_rar;
int UE_id;
if (crnti!=0)
UE_id = add_ue(crnti,eNB);
else
UE_id = -1;
if (UE_id==-1) {
LOG_W(PHY,"[eNB] Max user count reached.\n");
mac_xface->cancel_ra_proc(eNB->Mod_id,
eNB->CC_id,
frame,
crnti);
} else {
eNB->UE_stats[(uint32_t)UE_id].mode = RA_RESPONSE;
// Initialize indicator for first SR (to be cleared after ConnectionSetup is acknowledged)
eNB->first_sr[(uint32_t)UE_id] = 1;
generate_eNB_ulsch_params_from_rar(DLSCH_pdu,
frame,
subframe,
eNB->ulsch[(uint32_t)UE_id],
fp);
LOG_D(PHY,"[eNB][RAPROC] Frame %d subframe %d, Activated Msg3 demodulation for UE %"PRId8" in frame %"PRIu32", subframe %"PRIu8"\n",
frame,
subframe,
UE_id,
eNB->ulsch[(uint32_t)UE_id]->Msg3_frame,
eNB->ulsch[(uint32_t)UE_id]->Msg3_subframe);
/* TODO: get rid of this hack. The problem is that the eNodeB may
* sometimes wrongly generate PHICH because somewhere 'phich_active' was
* not reset to 0, due to an unidentified reason. When adding this
* resetting here the problem seems to disappear completely.
*/
LOG_D(PHY, "hack: set phich_active to 0 for UE %d fsf %d %d all HARQs\n", UE_id, frame, subframe);
for (i = 0; i < 8; i++)
eNB->ulsch[(uint32_t)UE_id]->harq_processes[i]->phich_active = 0;
mac_xface->set_msg3_subframe(eNB->Mod_id, eNB->CC_id, frame, subframe, (uint16_t)crnti,
eNB->ulsch[UE_id]->Msg3_frame, eNB->ulsch[UE_id]->Msg3_subframe);
T(T_ENB_PHY_MSG3_ALLOCATION, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe),
T_INT(UE_id), T_INT((uint16_t)crnti), T_INT(1 /* 1 is for initial transmission*/),
T_INT(eNB->ulsch[UE_id]->Msg3_frame), T_INT(eNB->ulsch[UE_id]->Msg3_subframe));
}
if (ue_stats) ue_stats->total_TBS_MAC += dlsch_harq->TBS;
}// ra_flag = 1
} //mac_eabled = 1
else { //XXX we should change taus function???
DLSCH_pdu = DLSCH_pdu_tmp;
for (i=0; i<input_buffer_length; i++)
DLSCH_pdu[i] = (unsigned char)(taus()&0xff);
}
#if defined(SMBV)
// Configures the data source of allocation (allocation is configured by DCI)
if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4)) {
LOG_D(PHY,"[SMBV] Frame %3d, Configuring PDSCH payload in SF %d alloc %"PRIu8"\n",frame,(smbv_frame_cnt*10) + (subframe),smbv_alloc_cnt);
// smbv_configure_datalist_for_user(smbv_fname, find_ue(dlsch->rnti,eNB)+1, DLSCH_pdu, input_buffer_length);
}
#endif
#ifdef DEBUG_PHY_PROC
#ifdef DEBUG_DLSCH
LOG_T(PHY,"eNB DLSCH SDU: \n");
//eNB->dlsch[(uint8_t)UE_id][0]->nCCE[subframe] = DCI_pdu->dci_alloc[i].firstCCE;
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for ue DCI (PDSCH %"PRIx16") => %"PRIu8"/%u\n",eNB->Mod_id,eNB->proc[sched_subframe].frame_tx,subframe,
DCI_pdu->dci_alloc[i].rnti,eNB->dlsch[(uint8_t)UE_id][0]->nCCE[subframe],DCI_pdu->dci_alloc[i].firstCCE);
for (i=0; i<dlsch_harq->TBS>>3; i++)
LOG_T(PHY,"%"PRIx8".",DLSCH_pdu[i]);
LOG_T(PHY,"\n");
#endif
#endif
} //harq round == 0
else {
//We are doing a retransmission
ue_stats->dlsch_trials[harq_pid][dlsch_harq->round]++;
#ifdef DEBUG_PHY_PROC
#ifdef DEBUG_DLSCH
LOG_D(PHY,"[eNB] This DLSCH is a retransmission\n");
#endif
#endif
}
if (eNB->abstraction_flag==0) { // used for simulation of the PHY??
LOG_D(PHY,"Generating NDLSCH/NPDSCH %d\n",ra_flag);
// 36-212
//encoding---------------------------
start_meas(&eNB->dlsch_encoding_stats);
LOG_I(PHY, "NB-IoT Encoding step\n");
eNB->te(eNB,
DLSCH_pdu,
num_pdcch_symbols,
dlsch,
frame,subframe,
&eNB->dlsch_rate_matching_stats,
&eNB->dlsch_turbo_encoding_stats,
&eNB->dlsch_interleaving_stats);
stop_meas(&eNB->dlsch_encoding_stats);
//scrambling-------------------------------------------
// 36-211
start_meas(&eNB->dlsch_scrambling_stats);
LOG_I(PHY, "NB-IoT Scrambling step\n");
dlsch_scrambling(fp,
0,
dlsch,
get_G(fp,
dlsch_harq->nb_rb,
dlsch_harq->rb_alloc,
get_Qm(dlsch_harq->mcs),
dlsch_harq->Nl,
num_pdcch_symbols,
frame,subframe,
0),
0,
subframe<<1);
stop_meas(&eNB->dlsch_scrambling_stats);
//modulation-------------------------------------------
start_meas(&eNB->dlsch_modulation_stats);
LOG_I(PHY, "NB-IoT Modulation step\n");
dlsch_modulation(eNB,
eNB->common_vars.txdataF[0],
AMP,
subframe,
num_pdcch_symbols,
dlsch,
dlsch1);
stop_meas(&eNB->dlsch_modulation_stats);
}
#ifdef PHY_ABSTRACTION
else {
start_meas(&eNB->dlsch_encoding_stats);
dlsch_encoding_emul(eNB,
DLSCH_pdu,
dlsch);
stop_meas(&eNB->dlsch_encoding_stats);
}
#endif
dlsch->active = 0;
}
extern int oai_exit; extern int oai_exit;
...@@ -950,7 +678,7 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -950,7 +678,7 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
if(Sched_Rsp->NB_DL.NB_DLSCH.ndlsch.rnti_type == 0) if(Sched_Rsp->NB_DL.NB_DLSCH.ndlsch.rnti_type == 0)
{ {
/*TODO: NPDSCH procedures for BCCH for NB-IoT*/ /*TODO: NPDSCH procedures for BCCH for NB-IoT*/
npdsch_procedures_NB(); //npdsch_procedures_NB();
} }
/*clear the DCI allocation maps for new subframe*/ /*clear the DCI allocation maps for new subframe*/
...@@ -970,7 +698,7 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -970,7 +698,7 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
eNB->dlsch[i][0]->subframe_tx[subframe]=0; eNB->dlsch[i][0]->subframe_tx[subframe]=0;
} }
if(Sched_Rsp->NB_DL.NB_DCI != NULL) if(Sched_Rsp->NB_DL.NB_DCI.DL_DCI.number_dci+Sched_Rsp->NB_DL.NB_DCI.UL_DCI.number_of_dci > 0)
{ {
/*Loop over all the dci to generate DLSCH allocation, there is only 1 or 2 DCIs for NB-IoT in the same time*/ /*Loop over all the dci to generate DLSCH allocation, there is only 1 or 2 DCIs for NB-IoT in the same time*/
...@@ -978,11 +706,11 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -978,11 +706,11 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
/*Also Packed the DCI here*/ /*Also Packed the DCI here*/
for(int i= 0; i< Sched_Rsp->NB_DL.NB_DCI.DL_DCI.number_dci; i++) for(int i= 0; i< Sched_Rsp->NB_DL.NB_DCI.DL_DCI.number_dci; i++)
{ {
if (Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list->npdcch_pdu.npdcch_pdu_rel13.rnti<= P_RNTI) if (Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.rnti<= P_RNTI)
{ {
//is not system iformation but cound be paging //is not system iformation but cound be paging
//in any case we generate dlsch for not system information //in any case we generate dlsch for not system information
UE_id = find_ue((int16_t)Sched_Rsp->NB_DL.NB_DCI.DL_DCI.npdcch_pdu_rel13.rnti,eNB); UE_id = find_ue((int16_t)Sched_Rsp->NB_DL.NB_DCI.DL_DCI.dl_config_pdu_list[i].npdcch_pdu.npdcch_pdu_rel13.rnti,eNB);
} }
else else
UE_id=0; UE_id=0;
...@@ -1001,7 +729,7 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -1001,7 +729,7 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
if (Sched_Rsp->NB_DL.NB_DCI.DCI_Format == DCIFormatN0) // this is a ULSCH allocation if (Sched_Rsp->NB_DL.NB_DCI.DCI_Format == DCIFormatN0) // this is a ULSCH allocation
{ {
UE_id = find_ue((int16_t)Sched_Rsp->NB_DL.NB_DCI.UL_DCI.npdcch_dci_pdu_rel13.rnti,eNB); UE_id = find_ue((int16_t)Sched_Rsp->NB_DL.NB_DCI.UL_DCI.hi_dci0_pdu_list[i].npdcch_dci_pdu.npdcch_dci_pdu_rel13.rnti,eNB);
NB_generate_eNB_ulsch_params(eNB,proc,Sched_Rsp,UE_id); NB_generate_eNB_ulsch_params(eNB,proc,Sched_Rsp,UE_id);
} }
...@@ -1009,7 +737,7 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -1009,7 +737,7 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
/*If we have DCI to generate do it now TODO : have a generate dci top for NB_IoT */ /*If we have DCI to generate do it now TODO : have a generate dci top for NB_IoT */
//to be modified but inside we have the nuew function for dci transmission //to be modified but inside we have the nuew function for dci transmission
generate_dci_top(); //generate_dci_top_NB();
} }
......
...@@ -172,7 +172,7 @@ typedef struct{ ...@@ -172,7 +172,7 @@ typedef struct{
}nulsch_t; }nulsch_t;
typedef union{ typedef struct{
npdcch_t NB_DCI; npdcch_t NB_DCI;
...@@ -182,7 +182,7 @@ typedef union{ ...@@ -182,7 +182,7 @@ typedef union{
nulsch_t NB_UL; nulsch_t NB_UL;
}NB_DL_u; }NB_DL_t;
typedef struct{ typedef struct{
...@@ -198,7 +198,7 @@ typedef struct{ ...@@ -198,7 +198,7 @@ typedef struct{
//subframe //subframe
sub_frame_t subframeP; sub_frame_t subframeP;
NB_DL_u NB_DL; NB_DL_t NB_DL;
}Sched_Rsp_t; }Sched_Rsp_t;
......
...@@ -575,7 +575,9 @@ int wait_CCs(eNB_rxtx_proc_t *proc) { ...@@ -575,7 +575,9 @@ int wait_CCs(eNB_rxtx_proc_t *proc) {
return(0); return(0);
} }
/*NB-IoT rxtx*/ /*NB-IoT implementation
*rxtx
*/
static inline int NB_rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) { static inline int NB_rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) {
UL_IND_t UL_INFO; //not here but temp UL_IND_t UL_INFO; //not here but temp
...@@ -588,9 +590,6 @@ static inline int NB_rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_ ...@@ -588,9 +590,6 @@ static inline int NB_rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_
if ((eNB->do_prach)&&((eNB->node_function != NGFI_RCC_IF4p5))) if ((eNB->do_prach)&&((eNB->node_function != NGFI_RCC_IF4p5)))
eNB->do_prach(eNB,proc->frame_rx,proc->subframe_rx); eNB->do_prach(eNB,proc->frame_rx,proc->subframe_rx);
// skip the comment for this moment
// phy_procedures_eNB_common_RX(eNB,proc);
// UE-specific RX processing for subframe n // UE-specific RX processing for subframe n
...@@ -619,6 +618,51 @@ static inline int NB_rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_ ...@@ -619,6 +618,51 @@ static inline int NB_rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_
return(0); return(0);
} }
/*!
* \brief The RX UE-specific and TX thread of NB-IoT eNB (NB-rxtx).
* \param param is a \ref eNB_proc_t structure which contains the info what to process.
* \returns a pointer to an int. The storage is not on the heap and must not be freed.
*/
static void* eNB_thread_NB_rxtx( void* param ) {
static int eNB_thread_rxtx_status;
eNB_rxtx_proc_t *proc = (eNB_rxtx_proc_t*)param;
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
char thread_name[100];
// set default return value
eNB_thread_rxtx_status = 0;
sprintf(thread_name,"RXn_TXnp4_%d\n",&eNB->proc.proc_rxtx[0] == proc ? 0 : 1);
thread_top_init(thread_name,1,850000L,1000000L,2000000L);
while (!oai_exit) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 );
if (oai_exit) break;
if (eNB->CC_id==0)
if (NB_rxtx(eNB,proc,thread_name) < 0) break;
} // while !oai_exit
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
printf( "Exiting eNB thread RXn_TXnp4\n");
eNB_thread_rxtx_status = 0;
return &eNB_thread_rxtx_status;
}
static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) { static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) {
start_meas(&softmodem_stats_rxtx_sf); start_meas(&softmodem_stats_rxtx_sf);
......
...@@ -171,7 +171,7 @@ void init_lte_eNB_NB( ...@@ -171,7 +171,7 @@ void init_lte_eNB_NB(
LOG_I(PHY,"init eNB NB_IoT: Nid_cell %d\n", frame_parms->Nid_cell); LOG_I(PHY,"init eNB NB_IoT: Nid_cell %d\n", frame_parms->Nid_cell);
LOG_I(PHY,"init eNB NB_IoT: number of ue max %d number of enb max %d \n", LOG_I(PHY,"init eNB NB_IoT: number of ue max %d number of enb max %d \n",
NUMBER_OF_UE_MAX, NUMBER_OF_eNB_MAX); NUMBER_OF_UE_MAX, NUMBER_OF_eNB_MAX);
LOG_I(PHY,"init eNB NB_IoT: N_RB_DL %d\n", frame_parms->N_RB_DL); //LOG_I(PHY,"init eNB NB_IoT: N_RB_DL %d\n", frame_parms->N_RB_DL);
//LOG_I(PHY,"init eNB NB_IoT: prach_config_index %d\n", frame_parms->nprach_config_common.prach_ConfigInfo.prach_ConfigIndex); //LOG_I(PHY,"init eNB NB_IoT: prach_config_index %d\n", frame_parms->nprach_config_common.prach_ConfigInfo.prach_ConfigIndex);
if (node_function >= NGFI_RRU_IF5) if (node_function >= NGFI_RRU_IF5)
...@@ -185,15 +185,15 @@ void init_lte_eNB_NB( ...@@ -185,15 +185,15 @@ 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 * 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_NB_IOT; 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);
if (!PHY_vars_eNB->ndlsch[i]) { if (!PHY_vars_eNB->ndlsch[i]) {
LOG_E(PHY,"Can't get eNB ndlsch structures for UE %d \n", i); LOG_E(PHY,"Can't get eNB ndlsch structures for UE %d \n", i);
exit(-1); exit(-1);
} else { } else {
LOG_D(PHY,"dlsch[%d] => %p\n",i,PHY_vars_eNB->dlsch[i]); LOG_D(PHY,"dlsch[%d] => %p\n",i,PHY_vars_eNB->ndlsch[i]);
PHY_vars_eNB->dlsch[i]->rnti=0; PHY_vars_eNB->ndlsch[i]->rnti=0;
} }
......
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