Commit 2b1c1482 authored by Michele Paffetti's avatar Michele Paffetti

almost complete the ndlsch and npdcch path. missed the coding, modulation and...

almost complete the ndlsch and npdcch path. missed the coding, modulation and scrambling function.Code compile. 140 warnings
parent 993570c2
......@@ -1045,11 +1045,13 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_dl_cell_spec_NB_IoT.c
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_dl_uespec.c
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_gold.c
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_gold_NB_IoT.c
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_gold_mbsfn.c
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_dl_mbsfn.c
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_ul_ref.c
${OPENAIR1_DIR}/PHY/CODING/lte_segmentation.c
${OPENAIR1_DIR}/PHY/CODING/ccoding_byte.c
${OPENAIR1_DIR}/PHY/CODING/ccoding_byte_NB_IoT.c
${OPENAIR1_DIR}/PHY/CODING/ccoding_byte_lte.c
${OPENAIR1_DIR}/PHY/CODING/3gpplte_sse.c
${OPENAIR1_DIR}/PHY/CODING/crc_byte.c
......@@ -1057,6 +1059,7 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c
${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c
${OPENAIR1_DIR}/PHY/CODING/lte_rate_matching.c
${OPENAIR1_DIR}/PHY/CODING/lte_rate_matching_NB_IoT.c
${OPENAIR1_DIR}/PHY/CODING/rate_matching.c
${OPENAIR1_DIR}/PHY/CODING/viterbi.c
${OPENAIR1_DIR}/PHY/CODING/viterbi_lte.c
......
......@@ -14,9 +14,10 @@
#include "defs.h"
#include "defs_NB_IoT.h"
#include "defs_nb_iot.h"
unsigned char ccodelte_table_NB_IoT[128]; // for transmitter
unsigned short glte_NB[] = { 0133, 0171, 0165 }; // {A,B} //renaimed but is exactly the same as the one in the old implementation
//unsigned char ccodelte_table_rev[128]; // for receiver
/*************************************************************************
......@@ -128,7 +129,7 @@ void ccodelte_init_NB_IoT(void)
sum = 0;
for (k = 0; k < 7; k++)
if ((i & glte[j]) & (1 << k))
if ((i & glte_NB[j]) & (1 << k))
sum++;
/* Write the sum modulo 2 in bit j */
......
......@@ -19,7 +19,7 @@
#include "PHY/defs.h"
#include "assertions.h"
#include "PHY/defs_NB_IoT.h"
#include "PHY/LTE_REFSIG/defs_NB_IoT.h"
static uint32_t bitrev_cc[32] = {1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31,0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30};
......
......@@ -60,7 +60,7 @@ void NB_phy_config_mib_eNB(
uint16_t eutra_NumCRS_ports)
{
/*Not sure if phy parameters should be initial here or not*/
/*Not sure if phy parameters should be initial here or not (RAYMOND version)*/
/*the phy_config_mib_eNB as the entry point to allocate the context for L1. The RC contains the context for L1,L2. If RC.eNB is NULL, it hasn't been allocated earlier so we allocate it there.*/
/*if (RC.eNB == NULL) {
RC.eNB = (PHY_VARS_eNB ***)malloc((1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB***));
......
......@@ -44,25 +44,26 @@
#include "T.h"
uint8_t generate_dci_top_NB(uint8_t Num_dci,
DCI_ALLOC_t *dci_alloc,
uint32_t n_rnti,
DCI_ALLOC_NB_t *dci_alloc,
int16_t amp,
LTE_DL_FRAME_PARMS *frame_parms,
NB_DL_FRAME_PARMS *fp,
//NB_IoT_eNB_NPDCCH_t npdcch,
int32_t **txdataF,
uint32_t subframe)
{
int i,L;
/*
int i,L, G;
int npdcch_start_index;
/* PARAMETERS may not needed
**e_ptr : store the encoding result, and as a input to modulation
*num_pdcch_symbols : to calculate the resource allocation for pdcch
*L = aggregation level (there is 2 (at most) in NB-IoT) (Note this is not the real value but the index)
*lprime,kprime,kprime_mod12,mprime,nsymb,symbol_offset,tti_offset,re_offset : used in the REG allocation
*gain_lin_QPSK,yseq0[Msymb],yseq1[Msymb],*y[2] : used in the modulation
*mi = used in interleaving
*e = used to store the taus sequence (taus sequence is used to generate the first sequence for DCI)
*e = used to store the taus sequence (taus sequence is used to generate the first sequence for DCI) Turbo coding
*wbar used in the interleaving and also REG allocation
*/
......@@ -70,11 +71,13 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci,
// 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
// there is only 2 aggregation (0 = 1, 1 = 2)
for (L=1; L>=0; L--) {
// MAC is assumed to have ordered the UE spec DCI according to the RNTI-based randomization???
// Value of aggregation level (FAPI/NFAPI specs v.9.0 pag 221 value 1,2)
for (L=2; L>=1; L--) {
for (i=0; i<Num_dci; i++) {
//XXX should be checked how the scheduler store the aggregation level for NB-IoT (value 1-2 or 0-1)
if (dci_alloc[i].L == (uint8_t)L) {
if (dci_alloc[i].firstCCE>=0) {
......@@ -89,66 +92,93 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci,
//rm_stats, te_stats, i_stats
);*/
}
}
}
}
// Scrambling
//pdcch_scrambling(frame_parms,subframe,e,8*get_nquad(num_pdcch_symbols, frame_parms, mi));
//NB-IoT--------------------------
//NB-IoT scrambling
/*
* switch(npdcch_start_index) (see mail)
*
* case 0
* G = 304
* case 1
* G = 240
* case 2
* G = 224
* case 3
* G = 200
* TS 36.213 ch 16.6.1
* npdcch_start_index indicate the starting OFDM symbol for NPDCCH in the first slot of a subframe k ad is determined as follow:
* - if eutracontrolregionsize is present (defined for in-band operating mode (mode 0,1 for FAPI specs))
* npdcch_start_index = eutracontrolregionsize (value 1,2,3) [units in number of OFDM symbol]
* -otherwise
* npdcch_start_index = 0
*
*Depending on npddch_start_index then we define different values for G
*/
/*
// NB-IoT scrambling
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
);
//XXX the setting of this npdcch_start_index parameter should be done in the MAC
// if(fp->operating_mode == 0 || fp->operating_mode == 1) //in-band operating mode
// {
// npdcch_start_index = fp->control_region_size;
// }
// else
// {
// npdcch_start_index = 0;
// }
for(int i = 0; i <Num_dci; i++)
{
switch(dci_alloc[i].npdcch_start_symbol) //mail Bcom matthieu
{
case 0:
G = 304;
break;
case 1:
G = 240;
break;
case 2:
G = 224;
break;
case 3:
G =200;
break;
default:
LOG_E (PHY,"npdcch_start_index has unwanted value\n");
break;
}
// // NB-IoT scrambling
// 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
// );
}
//NB-IoT modulation
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)
);*/
// //NB-IoT modulation
// 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)
// );
// 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);
//in NB-IoT the interleaving is done directly with the encoding procedure
//there is no interleaving because we don't apply turbo coding
// This is the REG allocation algorithm from 36-211, second part of Section 6.8.5
// there is a function to do the resource mapping function
//already done in the modulation in our NB-IoT implementaiton
// This is the REG allocation algorithm from 36-211
//already done in the modulation in our NB-IoT implementaiton??
return 0;
}
......@@ -42,19 +42,20 @@
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/defs.h"
#include "PHY/defs_nb_iot.h"
//#define DEBUG_DCI
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, uint8_t npdcch_start_symbol)
{
//put the pdu
memcpy(&DCI_pdu->dci_alloc[DCI_pdu->Num_dci].dci_pdu[0],pdu,dci_size_bytes);
//configure the dci alloc
DCI_pdu->dci_alloc[DCI_pdu->Num_dci].dci_length = dci_size_bits;
DCI_pdu->dci_alloc[DCI_pdu->Num_dci].L = aggregation;
DCI_pdu->dci_alloc[DCI_pdu->Num_dci].rnti = rnti;
DCI_pdu->dci_alloc[DCI_pdu->Num_dci].format = dci_fmt;
DCI_pdu->dci_alloc[DCI_pdu->Num_dci].npdcch_start_symbol = npdcch_start_symbol;
DCI_pdu->Num_dci++;
......@@ -68,7 +69,8 @@ int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
uint16_t rnti,
DCI_format_NB_t dci_format,
uint8_t UE_id,
uint8_t aggregation
uint8_t aggregation,
uint8_t npdcch_start_symbol
)
{
......@@ -121,7 +123,7 @@ int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
eNB->DCI_pdu->Num_dci++;
NB_add_dci(eNB->DCI_pdu,ULSCH_DCI_NB,rnti,sizeof(DCIN0_t),aggregation,sizeof_DCIN0_t,DCIFormatN0);
NB_add_dci(eNB->DCI_pdu,ULSCH_DCI_NB,rnti,sizeof(DCIN0_t),aggregation,sizeof_DCIN0_t,DCIFormatN0, npdcch_start_symbol);
// use this value to configure PHY both harq_processes and resource mapping.
......@@ -147,7 +149,8 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
DCI_format_NB_t dci_format,
NB_IoT_eNB_NDLSCH_t *ndlsch,
NB_DL_FRAME_PARMS *frame_parms,
uint8_t aggregation
uint8_t aggregation,
uint8_t npdcch_start_symbol
)
{
......@@ -156,7 +159,6 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
eNB->DCI_pdu = (DCI_PDU_NB*) malloc(sizeof(DCI_PDU_NB));
//N1 parameters
/// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits
......@@ -196,10 +198,8 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
case DCIFormatN1_RAR: // This is DLSCH allocation for control traffic (no NDI and no ACK/NACK resource for RAR DCI)
ndlsch->subframe_tx[subframe] = 1; // check if it's OK
ndlsch->rnti = rnti;
ndlsch->active = 1;
/*Packed DCI here-------------------------------------------*/
type = DCI_Content->DCIN1_RAR.type;
orderIndicator = DCI_Content->DCIN1_RAR.orderIndicator;
Sched_delay = DCI_Content->DCIN1_RAR.Scheddly;
......@@ -210,7 +210,7 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
HARQackRes = DCI_Content->DCIN1_RAR.HARQackRes;
DCIRep = DCI_Content->DCIN1_RAR.DCIRep;
/*Packed DCI here*/
//DCI pdu content
((DCIN1_RAR_t *)DLSCH_DCI_NB)->type =type;
((DCIN1_RAR_t *)DLSCH_DCI_NB)->orderIndicator =orderIndicator;
((DCIN1_RAR_t *)DLSCH_DCI_NB)->Scheddly =Sched_delay;
......@@ -221,9 +221,15 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
((DCIN1_RAR_t *)DLSCH_DCI_NB)->HARQackRes =HARQackRes;
((DCIN1_RAR_t *)DLSCH_DCI_NB)->DCIRep =DCIRep;
eNB->DCI_pdu->Num_dci++;
NB_add_dci(eNB->DCI_pdu,DLSCH_DCI_NB,rnti,sizeof(DCIN1_RAR_t),aggregation,sizeof_DCIN1_RAR_t,DCIFormatN1_RAR);
NB_add_dci(eNB->DCI_pdu,DLSCH_DCI_NB,rnti,sizeof(DCIN1_RAR_t),aggregation,sizeof_DCIN1_RAR_t,DCIFormatN1_RAR, npdcch_start_symbol);
/*Now configure the ndlsch structure*/
ndlsch->subframe_tx[subframe] = 1; // check if it's OK
ndlsch->rnti = rnti;
ndlsch->active = 1;
// use this value to configure PHY both harq_processes and resource mapping.
ndlsch_harq->scheduling_delay = Sched_delay;
......@@ -257,7 +263,6 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
case DCIFormatN1: // for user data
ndlsch->subframe_tx[subframe] = 1; // check if it's OK
type = DCI_Content->DCIN1.type;
orderIndicator = DCI_Content->DCIN1.orderIndicator;
......@@ -280,11 +285,12 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
((DCIN1_t *)DLSCH_DCI_NB)->HARQackRes =HARQackRes;
((DCIN1_t *)DLSCH_DCI_NB)->DCIRep =DCIRep;
//eNB->DCI_pdu->Num_dci = Num_dci;
NB_add_dci(eNB->DCI_pdu,DLSCH_DCI_NB,rnti,sizeof(DCIN1_t),aggregation,sizeof_DCIN1_t,DCIFormatN1);
NB_add_dci(eNB->DCI_pdu,DLSCH_DCI_NB,rnti,sizeof(DCIN1_t),aggregation,sizeof_DCIN1_t,DCIFormatN1,npdcch_start_symbol);
// use this value to configure PHY both harq_processes and resource mapping.
/*Now configure the ndlsch structure*/
ndlsch->subframe_tx[subframe] = 1; // check if it's OK
// use this value to configure PHY both harq_processes and resource mapping.
ndlsch_harq->scheduling_delay = Sched_delay;
......@@ -315,9 +321,8 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
((DCIN2_Ind_t *)DLSCH_DCI_NB)->directIndInf =directIndInf;
((DCIN2_Ind_t *)DLSCH_DCI_NB)->resInfoBits =resInfoBits;
eNB->DCI_pdu->Num_dci++;
NB_add_dci(eNB->DCI_pdu,DLSCH_DCI_NB,rnti,sizeof(DCIN2_Ind_t),aggregation,sizeof_DCIN2_Ind_t,DCIFormatN2_Ind);
NB_add_dci(eNB->DCI_pdu,DLSCH_DCI_NB,rnti,sizeof(DCIN2_Ind_t),aggregation,sizeof_DCIN2_Ind_t,DCIFormatN2_Ind,npdcch_start_symbol);
// use this value to configure PHY both harq_processes and resource mapping.
break;
......@@ -338,9 +343,8 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
((DCIN2_Pag_t *)DLSCH_DCI_NB)->RepNum =RepNum;
((DCIN2_Pag_t *)DLSCH_DCI_NB)->DCIRep =DCIRep;
eNB->DCI_pdu->Num_dci++;
NB_add_dci(eNB->DCI_pdu,DLSCH_DCI_NB,rnti,sizeof(DCIN2_Pag_t),aggregation,sizeof_DCIN2_Pag_t,DCIFormatN2_Pag);
NB_add_dci(eNB->DCI_pdu,DLSCH_DCI_NB,rnti,sizeof(DCIN2_Pag_t),aggregation,sizeof_DCIN2_Pag_t,DCIFormatN2_Pag,npdcch_start_symbol);
// use this value to configure PHY both harq_processes and resource mapping.
break;
......@@ -352,9 +356,6 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
break;
}
// compute DL power control parameters
......
......@@ -38,6 +38,8 @@
#include "UTIL/LISTS/list.h"
#endif
#include "dci_nb_iot.h"
#define MOD_TABLE_QPSK_OFFSET 1
#define MOD_TABLE_16QAM_OFFSET 5
#define MOD_TABLE_64QAM_OFFSET 21
......@@ -806,59 +808,41 @@ 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];
/// 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)
int32_t **calib_dl_ch_estimates;
/// Allocated RNTI (0 means DLSCH_t is not currently used)
uint16_t rnti;
/// Active flag for baseband transmitter processing
uint8_t active;
/// Indicator of TX activation per subframe. Used during PUCCH detection for ACK/NAK.
uint8_t subframe_tx[10];
/// First CCE of last PDSCH scheduling per subframe. Again used during PUCCH detection for ACK/NAK.
uint8_t nCCE[10];
/// 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
uint8_t ra_window_size;
/// First-round error threshold for fine-grain rate adaptation
uint8_t error_threshold;
/// Pointers to 8 HARQ processes for the DLSCH
LTE_DL_eNB_HARQ_t *harq_processes[8];
/// Number of soft channel bits
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
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
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_eNB_NPDCCH_t;
///indicates the starting OFDM symbol in the first slot of a subframe k for the NPDCCH transmission
/// see FAPI/NFAPI specs Table 4-121
uint8_t npdcch_start_symbol;
/// 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 2
uint32_t num_npdcch_symbols;
uint8_t Num_dci;
DCI_ALLOC_NB_t dci_alloc[2] ;
} DCI_PDU_NB;
typedef struct {
/// NB-IoT
/// The scheduling the NPDCCH and the NPDSCH transmission TS 36.213 Table 16.4.1-1
uint8_t scheduling_delay;
/// The number of the subframe to transmit the NPDSCH TB TS 36.213 Table 16.4.1.3-1
/// The number of the subframe to transmit the NPDSCH TB TS 36.213 Table 16.4.1.3-1 (Nsf
/// 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;
......@@ -933,6 +917,11 @@ typedef struct {
*/
uint16_t sf_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_t npdsch_start_symbol;
} NB_IoT_eNB_NDLSCH_t;
......@@ -1042,6 +1031,19 @@ typedef struct {
} NB_IoT_eNB_NULSCH_t;
#define NPBCH_A 34
typedef struct {
uint8_t npbch_d[96+(3*(16+NPBCH_A))];
uint8_t npbch_w[3*3*(16+NPBCH_A)];
uint8_t npbch_e[1600];
///pdu of the npbch message
uint8_t*pdu;
} NB_IoT_eNB_NPBCH;
//---------------------------------------------------------------------------------------
......
......@@ -21,6 +21,9 @@
#include "PHY/extern.h"
#include "PHY/sse_intrin.h"
#include "PHY/CODING/defs_nb_iot.h"
#include "PHY/LTE_REFSIG/defs_NB_IoT.h"
#ifdef PHY_ABSTRACTION
#include "SIMULATION/TOOLS/defs.h"
#endif
......
......@@ -90,7 +90,7 @@ void npbch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
// Functions below implement 36-211 and 36-212
/*Function to pack the DCI*/
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, uint8_t npdcch_start_symbol);
/*Use the UL DCI Information to configure PHY and also Packed*/
int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
......@@ -99,18 +99,20 @@ int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
uint16_t rnti,
DCI_format_NB_t dci_format,
uint8_t UE_id,
uint8_t aggregation
uint8_t aggregation,
uint8_t npdcch_start_symbol
);
/*Use the DL DCI Information to configure PHY and also Packed*/
int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
int frame,
int frame,
uint8_t subframe,
DCI_CONTENT *DCI_Content,
uint16_t rnti,
DCI_format_NB_t dci_format,
NB_IoT_eNB_NDLSCH_t *ndlsch,
NB_DL_FRAME_PARMS *frame_parms,
uint8_t aggregation
uint8_t aggregation,
uint8_t npdcch_start_symbol
);
......
......@@ -435,29 +435,6 @@ typedef struct {
UE_rxtx_proc_t proc_rxtx[2];
} 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 2
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
......@@ -725,8 +702,8 @@ typedef struct PHY_VARS_eNB_s {
*
*/
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_NPBCH *npbch;
//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_NULSCH_t *nulsch[NUMBER_OF_UE_MAX_NB_IoT+1]; //nulsch[0] contains the RAR
NB_IoT_eNB_NDLSCH_t *ndlsch_SI,*ndlsch_ra;
......
......@@ -262,13 +262,5 @@ typedef struct {
} NB_DL_FRAME_PARMS;
#define NPBCH_A 34
typedef struct {
uint8_t npbch_d[96+(3*(16+NPBCH_A))];
uint8_t npbch_w[3*3*(16+NPBCH_A)];
uint8_t npbch_e[1600];
} NB_IoT_eNB_NPBCH;
#endif
#include "../SCHED/IF_Module_L1_primitives_nb_iot.h"
#include "../SCHED/defs.h"
#include "../SCHED/defs_nb_iot.h"
#include "common/utils/itti/assertions.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/vars.h"
#include "PHY/INIT/defs_nb_iot.h"
handle_nfapi_dlsch_pdu_NB(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
void handle_nfapi_dlsch_pdu_NB(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
nfapi_dl_config_request_pdu_t *dl_config_pdu,
uint8_t *sdu,
uint8_t rnti_type) {
uint8_t *sdu)
{
NB_IoT_eNB_NDLSCH_t *ndlsch;
NB_IoT_DL_eNB_HARQ_t *ndlsch_harq;
nfapi_dl_config_ndlsch_pdu_rel13_t *rel13 = &dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13;
int UE_id= -1;
//Check for SI PDU since in NB-IoT there is no DCI for that
//SIB (type 0), other DLSCH data (type 1)
if(rnti_type == 0)
if(rel13->rnti_type == 0)
{
ndlsch = eNB->ndlsch_SI;
ndlsch->npdsch_start_symbol = rel13->start_symbol; //start symbol for the ndlsch transmission
ndlsch_harq = ndlsch->harq_process;
ndlsch_harq->pdu = sdu;
......@@ -36,16 +43,31 @@ handle_nfapi_dlsch_pdu_NB(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
}
else
{
//TODO
{ //ue specific data or RAR
//check if the PDU is for RAR
if(eNB->ndlsch_ra != NULL && rel13->rnti == eNB->ndlsch_ra->rnti)
{
eNB->ndlsch_ra->harq_process->pdu = sdu;
eNB->ndlsch_ra->npdsch_start_symbol = rel13->start_symbol;
}
else
{ //this for ue data
//TODO
//program addition DLSCH parameters not from DCI (for the moment we only pass the pdu)
//int UE_id = find_dlsch(rel13->rnti,eNB,SEARCH_EXIST);
// program addition DLSCH parameters not from DCI
//int UE_id = find_dlsch(rel13->rnti,eNB,SEARCH_EXIST);
//AssertFatal(UE_id==-1,"no existing dlsch_context\n");
UE_id = find_ue_NB(rel13->rnti,eNB);
AssertFatal(UE_id==-1,"no existing ue specific dlsch_context\n");
//ndlsch_harq = eNB->ndlsch[UE_id]->harq_processes;
//AssertFatal(dlsch_harq!=NULL,"dlsch_harq is null\n");
//dlsch_harq->pdu = sdu;
ndlsch_harq = eNB->ndlsch[(uint8_t)UE_id]->harq_process;
AssertFatal(ndlsch_harq!=NULL,"dlsch_harq for ue specific is null\n");
ndlsch = eNB->ndlsch[(uint8_t)UE_id];
ndlsch->npdsch_start_symbol = rel13->start_symbol;
ndlsch_harq->pdu = sdu;
}
}
......@@ -63,16 +85,15 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
//XXX check if correct to take eNB like this
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][Sched_INFO->CC_id];
eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];
NB_IoT_DL_eNB_HARQ_t* ndlsch_harq;
NB_IoT_eNB_NDLSCH_t *ndlsch_SI;
NB_IoT_eNB_NPBCH *npbch;
int i;
module_id_t Mod_id = Sched_INFO->module_id;
uint8_t CC_id = Sched_INFO->CC_id;
nfapi_dl_config_request_body_t *DL_req = &Sched_INFO->DL_req;
nfapi_ul_config_request_t *UL_req = &Sched_INFO->UL_req;
nfapi_hi_dci0_request_body_t *HI_DCI0_req = &Sched_INFO->HI_DCI0_req;
nfapi_dl_config_request_body_t *DL_req = Sched_INFO->DL_req;
nfapi_ul_config_request_t *UL_req = Sched_INFO->UL_req;
nfapi_hi_dci0_request_body_t *HI_DCI0_req = Sched_INFO->HI_DCI0_req;
frame_t frame = Sched_INFO->frame;
sub_frame_t subframe = Sched_INFO->subframe;
......@@ -102,11 +123,15 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
break;
case NFAPI_DL_CONFIG_NBCH_PDU_TYPE:
//TODO
//XXX for the moment we don't care about the n-bch pdu content since we need only the sdu if tx.request
npbch = eNB->npbch;
npbch->pdu = Sched_INFO->sdu[i];
break;
case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE:
handle_nfapi_dlsch_pdu_NB(eNB, proc,dl_config_pdu,Sched_INFO->sdu[i],dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.rnti_type);
handle_nfapi_dlsch_pdu_NB(eNB, proc,dl_config_pdu,Sched_INFO->sdu[i]);
break;
default:
......@@ -133,16 +158,24 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
}
for(i = 0; i , number_ul_pdu; i++)
for(i = 0; i< number_ul_pdu; i++)
{
ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i];
switch(ul_config_pdu->pdu_type)
{
case NFAPI_UL_CONFIG_NULSCH_PDU_TYPE:
//TODO
//TODO should distinguish between data and between data (npusch format)
/*NB: for reception of Msg3 generally not exist a DCI (because scheduling information are implicitly given by the RAR)
* but in case of FAPI specs we should receive an UL_config (containing the NULSCH pdu) for configuring the PHY for Msg3 reception from the MAC
* (this UL_config most probably will be created by the MAC when fill the RAR)
* (most probably we don't have the DL_config (for the RAR transmission) and the UL_CONFIG (for the Msg3 reception) at the same time (same subrame)
* since we are working in HD-FDD mode so for sure the UE will transmit the Msg3 in another subframe so make sense to have a UL_CONFIG in subframe
* diferent from the DL_CONFIG one)
*
*/
break;
case NFAPI_UL_CONFIG_NRACH_PDU_TYPE:
//TODO
//TODO just for update the nprach configuration (given at the beginning through phy_config_sib2)
break;
}
}
......@@ -156,6 +189,7 @@ void PHY_config_req(PHY_Config_t* config_INFO){
if(config_INFO->get_MIB != 0){
//MIB-NB configuration
NB_phy_config_mib_eNB(config_INFO->mod_id,
config_INFO->CC_id,
......@@ -165,7 +199,11 @@ void PHY_config_req(PHY_Config_t* config_INFO){
config_INFO->cfg->subframe_config.ul_cyclic_prefix_type.value,
config_INFO->cfg->rf_config.tx_antenna_ports.value,
config_INFO->dl_CarrierFreq,
config_INFO->ul_CarrierFreq);
config_INFO->ul_CarrierFreq,
config_INFO->cfg->nb_iot_config.prb_index.value,
config_INFO->cfg->nb_iot_config.operating_mode.value,
config_INFO->cfg->nb_iot_config.control_region_size.value,
config_INFO->cfg->nb_iot_config.assumed_crs_aps.value); //defined only in in-band different PCI
}
if(config_INFO->get_COMMON != 0)
......
......@@ -13,5 +13,9 @@ void schedule_response(Sched_Rsp_t *Sched_INFO);
* Trigger the phy_config_xxx functions using parameters from the shared PHY_Config structure
* */
void PHY_config_req(PHY_Config_t* config_INFO);
void handle_nfapi_dlsch_pdu_NB(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
nfapi_dl_config_request_pdu_t *dl_config_pdu,
uint8_t *sdu);
#endif
......@@ -764,7 +764,8 @@ void generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC
#endif
LOG_D(PHY,"Generating dlsch params for RNTI %x\n",dci_alloc->rnti);
LOG_D(PHY,"Generating dlsch params for RNTI %x\n",dci_alloc->rnti);
//fill the dlsch structures
generate_eNB_dlsch_params_from_dci(frame,
subframe,
&dci_alloc->dci_pdu[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