Commit 27dd07ea authored by Nick Ho's avatar Nick Ho

Complete the new way packing DCI and Configure PHY at the same time

parent af9833ff
...@@ -984,6 +984,7 @@ set(PHY_SRC ...@@ -984,6 +984,7 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_decoding.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_decoding.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_scrambling.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_scrambling.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools_nb_iot.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/uci_tools.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/uci_tools.c
${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
......
...@@ -68,7 +68,6 @@ struct DCIFormatN0{ ...@@ -68,7 +68,6 @@ struct DCIFormatN0{
}; };
typedef struct DCIFormatN0 DCIFormatN0_t; typedef struct DCIFormatN0 DCIFormatN0_t;
#define sizeof_DDCIFormatN0_t 23
/// DCI Format Type N1 for User data /// DCI Format Type N1 for User data
struct DCIFormatN1{ struct DCIFormatN1{
...@@ -94,7 +93,6 @@ struct DCIFormatN1{ ...@@ -94,7 +93,6 @@ struct DCIFormatN1{
typedef struct DCIFormatN1 DCIFormatN1_t; typedef struct DCIFormatN1 DCIFormatN1_t;
#define sizeof_DCIFormatN1_t 23
/// DCI Format Type N1 for initial RA /// DCI Format Type N1 for initial RA
struct DCIFormatN1_RA{ struct DCIFormatN1_RA{
...@@ -111,7 +109,6 @@ struct DCIFormatN1_RA{ ...@@ -111,7 +109,6 @@ struct DCIFormatN1_RA{
}; };
typedef struct DCIFormatN1_RA DCIFormatN1_RA_t; typedef struct DCIFormatN1_RA DCIFormatN1_RA_t;
#define sizeof_DCIFormatN1_RA_t 23
/// DCI Format Type N1 for RAR /// DCI Format Type N1 for RAR
struct DCIFormatN1_RAR{ struct DCIFormatN1_RAR{
...@@ -134,7 +131,6 @@ struct DCIFormatN1_RAR{ ...@@ -134,7 +131,6 @@ struct DCIFormatN1_RAR{
}; };
typedef struct DCIFormatN1_RAR DCIFormatN1_RAR_t; typedef struct DCIFormatN1_RAR DCIFormatN1_RAR_t;
#define sizeof_DCIFormatN1_RAR_t 23
// DCI Format Type N2 for direct indication, 15 bits // DCI Format Type N2 for direct indication, 15 bits
struct DCIFormatN2_Ind{ struct DCIFormatN2_Ind{
...@@ -147,7 +143,6 @@ struct DCIFormatN2_Ind{ ...@@ -147,7 +143,6 @@ struct DCIFormatN2_Ind{
}; };
typedef struct DCIFormatN2_Ind DCIFormatN2_Ind_t; typedef struct DCIFormatN2_Ind DCIFormatN2_Ind_t;
#define sizeof_DCIFormatN2_Ind_t 15
// DCI Format Type N2 for Paging, 15 bits // DCI Format Type N2 for Paging, 15 bits
struct DCIFormatN2_Pag{ struct DCIFormatN2_Pag{
...@@ -164,9 +159,8 @@ struct DCIFormatN2_Pag{ ...@@ -164,9 +159,8 @@ struct DCIFormatN2_Pag{
}; };
typedef struct DCIFormatN2_Pag DCIFormatN2_Pag_t; typedef struct DCIFormatN2_Pag DCIFormatN2_Pag_t;
#define sizeof_DCIFormatN2_Pag_t 15
typedef union DCI_CONTENT { typedef union DCI_CONTENT {
// //
DCIFormatN0_t DCIN0; DCIFormatN0_t DCIN0;
// //
...@@ -180,4 +174,106 @@ typedef struct DCIFormatN2_Pag DCIFormatN2_Pag_t; ...@@ -180,4 +174,106 @@ typedef struct DCIFormatN2_Pag DCIFormatN2_Pag_t;
// //
DCIFormatN2_Pag_t DCIN2_Pag; DCIFormatN2_Pag_t DCIN2_Pag;
}DCI_CONTENT; }DCI_CONTENT;
\ No newline at end of file
/*Structure for packing*/
struct DCIN0{
/// DCI subframe repetition Number, 2 bits
uint8_t DCIRep:2;
/// New Data Indicator, 1 bits
uint8_t ndi:1;
/// Repetition Number, 3 bits
uint8_t RepNum:3;
/// Redundancy version for HARQ (only use 0 and 2), 1 bits
uint8_t rv:1;
/// Modulation and Coding Scheme, 4 bits
uint8_t mcs:4;
/// Scheduling Delay, 2 bits
uint8_t Scheddly:2;
/// Resourse Assignment (RU Assignment), 3 bits
uint8_t ResAssign:3;
/// Subcarrier indication, 6 bits
uint8_t scind:6;
/// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits
uint8_t type:1;
} __attribute__ ((__packed__));
typedef struct DCIN0 DCIN0_t;
#define sizeof_DCIN0_t 23
struct DCIN1_RAR{
// Reserved 5 bits like payload
uint8_t Reserved:5;
// DCI subframe repetition Number, 2 bits
uint8_t DCIRep:2;
// Repetition Number, 4 bits
uint8_t RepNum:4;
// Modulation and Coding Scheme, 4 bits
uint8_t mcs:4;
// Resourse Assignment (RU Assignment), 3 bits
uint8_t ResAssign:3;
// Scheduling Delay, 3 bits
uint8_t Scheddly:3;
//NPDCCH order indicator (set to 0),1 bits
uint8_t orderIndicator:1;
/// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits
uint8_t type:1;
} __attribute__ ((__packed__));
typedef struct DCIN1_RAR DCIN1_RAR_t;
#define sizeof_DCIN1_RAR_t 23
struct DCIN1{
// DCI subframe repetition Number, 2 bits
uint8_t DCIRep:2;
// HARQ-ACK resource,4 bits
uint8_t HARQackRes:4;
// New Data Indicator,1 bits
uint8_t ndi:1;
// Repetition Number, 4 bits
uint8_t RepNum:4;
// Modulation and Coding Scheme, 4 bits
uint8_t mcs:4;
// Resourse Assignment (RU Assignment), 3 bits
uint8_t ResAssign:3;
// Scheduling Delay, 3 bits
uint8_t Scheddly:3;
//NPDCCH order indicator (set to 0),1 bits
uint8_t orderIndicator:1;
/// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits
uint8_t type:1;
} __attribute__ ((__packed__));
typedef struct DCIN1 DCIN1_t;
#define sizeof_DCIN1_t 23
// DCI Format Type N2 for direct indication, 15 bits
struct DCIN2_Ind{
// Reserved information bits, 6 bits
uint8_t resInfoBits:6;
//Direct indication information, 8 bits
uint8_t directIndInf:8;
//Flag for paging(1)/direct indication(0), set to 0,1 bits
uint8_t type:1;
} __attribute__ ((__packed__));;
typedef struct DCIN2_Ind DCIN2_Ind_t;
#define sizeof_DCIN2_Ind_t 15
// DCI Format Type N2 for Paging, 15 bits
struct DCIN2_Pag{
// Reserved 3 bits
uint8_t DCIRep:3;
// Repetition Number, 4 bits
uint8_t RepNum:4;
// Modulation and Coding Scheme, 4 bits
uint8_t mcs:4;
// Resourse Assignment (RU Assignment), 3 bits
uint8_t ResAssign:3;
//Flag for paging(1)/direct indication(0), set to 1,1 bits
uint8_t type:1;
} __attribute__ ((__packed__));;
typedef struct DCIN2_Pag DCIN2_Pag_t;
#define sizeof_DCIN2_Pag_t 15
\ No newline at end of file
...@@ -50,11 +50,17 @@ typedef struct { ...@@ -50,11 +50,17 @@ typedef struct {
/// rnti /// rnti
rnti_t rnti; rnti_t rnti;
/// Format /// Format
DCI_format_t format; DCI_format_NB_t format;
/// DCI pdu /// DCI pdu
uint8_t dci_pdu[8]; uint8_t dci_pdu[8];
} DCI_ALLOC_NB_t; } 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;
/**@}*/ /**@}*/
#endif #endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file PHY/LTE_TRANSPORT/proto.h
* \brief Function prototypes for PHY physical/transport channel processing and generation V8.6 2009-03
* \author R. Knopp, F. Kaltenberger
* \date 2011
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr
* \note
* \warning
*/
#ifndef __LTE_TRANSPORT_PROTO_NB_IOT__H__
#define __LTE_TRANSPORT_PROTO_NB_IOT__H__
#include "PHY/defs_nb_iot.h"
#include <math.h>
// 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);
/*Use the UL DCI Information to configure PHY and also Packed*/
int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB_NB *eNB,
eNB_rxtx_proc_NB_t *proc,
DCI_CONTENT *DCI_Content,
uint16_t rnti,
DCI_format_NB_t dci_format,
uint8_t UE_id,
uint8_t aggregation,
uint8_t Num_dci
);
/*Use the DL DCI Information to configure PHY and also Packed*/
int NB_generate_eNB_dlsch_params_from_dci(int frame,
uint8_t subframe,
DCI_CONTENT *DCI_Content,
uint16_t rnti,
DCI_format_NB_t dci_format,
LTE_eNB_DLSCH_t **dlsch,
NB_DL_FRAME_PARMS *frame_parms,
uint8_t aggregation,
uint8_t Num_dci
);
#endif
...@@ -314,6 +314,7 @@ typedef struct PHY_VARS_eNB_NB_s { ...@@ -314,6 +314,7 @@ typedef struct PHY_VARS_eNB_NB_s {
#include "PHY/LTE_REFSIG/defs.h" #include "PHY/LTE_REFSIG/defs.h"
#include "PHY/MODULATION/defs.h" #include "PHY/MODULATION/defs.h"
#include "PHY/LTE_TRANSPORT/proto.h" #include "PHY/LTE_TRANSPORT/proto.h"
#include "PHY/LTE_TRANSPORT/proto_nb_iot.h"
#include "PHY/LTE_ESTIMATION/defs.h" #include "PHY/LTE_ESTIMATION/defs.h"
#include "SIMULATION/ETH_TRANSPORT/defs.h" #include "SIMULATION/ETH_TRANSPORT/defs.h"
......
...@@ -77,27 +77,6 @@ ...@@ -77,27 +77,6 @@
#define PUCCH 1 #define PUCCH 1
void exit_fun(const char* s);
extern int exit_openair;
struct timespec start_fh, start_fh_prev;
int start_fh_sf, start_fh_prev_sf;
// Fix per CC openair rf/if device update
// extern openair0_device openair0;
unsigned char dlsch_input_buffer[2700] __attribute__ ((aligned(32)));
int eNB_sync_buffer0[640*6] __attribute__ ((aligned(32)));
int eNB_sync_buffer1[640*6] __attribute__ ((aligned(32)));
int *eNB_sync_buffer[2] = {eNB_sync_buffer0, eNB_sync_buffer1};
extern uint16_t hundred_times_log10_NPRB[100];
unsigned int max_peak_val;
int max_sync_pos;
int harq_pid_updated[NUMBER_OF_UE_MAX][8] = {{0}};
int harq_pid_round[NUMBER_OF_UE_MAX][8] = {{0}};
//DCI_ALLOC_t dci_alloc[8]; //DCI_ALLOC_t dci_alloc[8];
#ifdef EMOS #ifdef EMOS
...@@ -115,8 +94,6 @@ extern int rx_sig_fifo; ...@@ -115,8 +94,6 @@ extern int rx_sig_fifo;
#endif #endif
void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const relaying_type_t r_type) void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const relaying_type_t r_type)
{ {
//RX processing for ue-specific resources (i //RX processing for ue-specific resources (i
...@@ -708,7 +685,7 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched ...@@ -708,7 +685,7 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched
// 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(); //NB_generate_eNB_dlsch_params_from_dci();
//eNB->dlsch_ra->nCCE[subframe] = dci_alloc->firstCCE; //eNB->dlsch_ra->nCCE[subframe] = dci_alloc->firstCCE;
/*Log for common DCI*/ /*Log for common DCI*/
...@@ -718,7 +695,7 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched ...@@ -718,7 +695,7 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched
if (UE_id>=0) if (UE_id>=0)
{ {
LOG_D(PHY,"Generating dlsch params for RNTI %x\n",Sched_Rsp->rntiP); LOG_D(PHY,"Generating dlsch params for RNTI %x\n",Sched_Rsp->rntiP);
NB_generate_eNB_dlsch_params_from_dci(); //NB_generate_eNB_dlsch_params_from_dci();
/*Log for remaining DCI*/ /*Log for remaining DCI*/
...@@ -741,7 +718,7 @@ void NB_generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,Sched_ ...@@ -741,7 +718,7 @@ void NB_generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,Sched_
/*Log for generate ULSCH DCI*/ /*Log for generate ULSCH DCI*/
NB_generate_eNB_ulsch_params_from_dci(); //NB_generate_eNB_ulsch_params_from_dci();
//LOG for ULSCH DCI Resource allocation //LOG for ULSCH DCI Resource allocation
......
...@@ -415,11 +415,6 @@ typedef struct { ...@@ -415,11 +415,6 @@ typedef struct {
uint8_t R:2; uint8_t R:2;
} __attribute__((__packed__))POWER_HEADROOM_CMD_NB; } __attribute__((__packed__))POWER_HEADROOM_CMD_NB;
typedef struct {
//delete the count for the DCI numbers,NUM_DCI_MAX should set to 1
uint32_t num_npdcch_symbols;
DCI_ALLOC_t dci_alloc[NUM_DCI_MAX] ;
} DCI_PDU_NB;
typedef struct { typedef struct {
uint8_t payload[BCCH_PAYLOAD_SIZE_MAX] ; uint8_t payload[BCCH_PAYLOAD_SIZE_MAX] ;
} __attribute__((__packed__))BCCH_PDU_NB; } __attribute__((__packed__))BCCH_PDU_NB;
......
...@@ -81,6 +81,8 @@ typedef struct{ ...@@ -81,6 +81,8 @@ typedef struct{
/*DCI start*/ /*DCI start*/
// Format of DCI // Format of DCI
uint8_t aggregation;
uint8_t Num_dci;
DCI_format_NB_t DCI_Format; DCI_format_NB_t DCI_Format;
// Content of DCI // Content of DCI
DCI_CONTENT *DCI_Content; DCI_CONTENT *DCI_Content;
......
...@@ -73,7 +73,10 @@ Comment: merge with RRC branch, start the TX part implementation ...@@ -73,7 +73,10 @@ Comment: merge with RRC branch, start the TX part implementation
Modified: openair2/LAYER2/MAC/phy_procedures_lte_eNB_nb_iot.c Modified: openair2/LAYER2/MAC/phy_procedures_lte_eNB_nb_iot.c
Comment: Complete the TX part, add the NB_generate_eNB_dlsch_params and NB_generate_eNB_ulsch_params Comment: Complete the TX part, add the NB_generate_eNB_dlsch_params and NB_generate_eNB_ulsch_params
Since original OAI packed the DCI in MAC, and unpack at PHY to apply the physical layer configuration. Since original OAI packed the DCI in MAC, and unpack at PHY to apply the physical layer configuration.
so we'll apply the configuration and pack the DCI at the same time. so we'll apply the configuration and pack the DCI at the same time.
5/31
Comment: Complete the dci_tools the part configuring the PHY and do the pack of dci at the same times.
Add DCI packed format in dci_nb_iot.h
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