Commit 09efb985 authored by Matthieu Kanj's avatar Matthieu Kanj

seperation for file: openair1/PHY/LTE_TRANSPORT/dlsch_coding_NB_IoT.c

+ creation of new file openair1/PHY/LTE_TRANSPORT/extern_NB_IoT.h
parent 34edb293
...@@ -993,6 +993,7 @@ set(PHY_SRC ...@@ -993,6 +993,7 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pilots.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pilots.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pilots_mbsfn.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pilots_mbsfn.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_coding.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_coding.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_coding_NB_IoT.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_modulation.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_modulation.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_demodulation.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_demodulation.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_llr_computation.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_llr_computation.c
......
...@@ -184,4 +184,9 @@ This function takes the w-sequence and generates the d-sequence. The nu-sequenc ...@@ -184,4 +184,9 @@ This function takes the w-sequence and generates the d-sequence. The nu-sequenc
// uint8_t r, // uint8_t r,
// uint32_t *E_out); // uint32_t *E_out);
void ccode_encode_npdsch_NB_IoT (int32_t numbits,
uint8_t *inPtr,
uint8_t *outPtr,
uint32_t crc);
#endif /* OPENAIR1_PHY_CODING_DEFS_NB_IOT_H_ */ #endif /* OPENAIR1_PHY_CODING_DEFS_NB_IOT_H_ */
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
*/ */
//#include "PHY/defs.h" //#include "PHY/defs.h"
#include "PHY/extern_NB_IoT.h" #include "PHY/extern_NB_IoT.h"
#include "PHY/LTE_TRANSPORT/extern_NB_IoT.h"
#include "SCHED/defs_nb_iot.h" #include "SCHED/defs_nb_iot.h"
#ifdef DEBUG_DCI_TOOLS #ifdef DEBUG_DCI_TOOLS
#include "PHY/vars_NB_IoT.h" #include "PHY/vars_NB_IoT.h"
......
This diff is collapsed.
...@@ -14,17 +14,19 @@ ...@@ -14,17 +14,19 @@
//#include "PHY/defs.h" //#include "PHY/defs.h"
#include "PHY/defs_nb_iot.h" #include "PHY/defs_nb_iot.h"
#include "PHY/extern.h" #include "PHY/extern_NB_IoT.h"
#include "PHY/CODING/defs_nb_iot.h" #include "PHY/CODING/defs_nb_iot.h"
//#include "PHY/CODING/extern.h" //#include "PHY/CODING/extern.h"
//#include "PHY/CODING/lte_interleaver_inline.h" //#include "PHY/CODING/lte_interleaver_inline.h"
#include "PHY/LTE_TRANSPORT/defs.h" #include "PHY/LTE_TRANSPORT/defs_nb_iot.h"
#include "PHY/LTE_TRANSPORT/proto.h" #include "PHY/LTE_TRANSPORT/proto_nb_iot.h"
#include "SCHED/defs_nb_iot.h" #include "SCHED/defs_nb_iot.h"
#include "defs_nb_iot.h" //#include "defs_nb_iot.h"
//#include "UTIL/LOG/vcd_signal_dumper.h" //#include "UTIL/LOG/vcd_signal_dumper.h"
#include "PHY/LTE_TRANSPORT/defs_NB_IoT.h" // newly added for NB_IoT //#include "PHY/LTE_TRANSPORT/defs_nb_iot.h" // newly added for NB_IoT
unsigned char ccodelte_table2_NB_IoT[128];
void ccode_encode_npdsch_NB_IoT (int32_t numbits, void ccode_encode_npdsch_NB_IoT (int32_t numbits,
uint8_t *inPtr, uint8_t *inPtr,
...@@ -54,7 +56,7 @@ void ccode_encode_npdsch_NB_IoT (int32_t numbits, ...@@ -54,7 +56,7 @@ void ccode_encode_npdsch_NB_IoT (int32_t numbits,
if ((c&(1<<shiftbit)) != 0) { if ((c&(1<<shiftbit)) != 0) {
state |= 64; state |= 64;
} }
out = ccodelte_table_NB_IoT[state]; out = ccodelte_table2_NB_IoT[state];
*outPtr++ = out & 1; *outPtr++ = out & 1;
*outPtr++ = (out>>1)&1; *outPtr++ = (out>>1)&1;
...@@ -76,33 +78,33 @@ int dlsch_encoding_NB_IoT(unsigned char *a, ...@@ -76,33 +78,33 @@ int dlsch_encoding_NB_IoT(unsigned char *a,
//unsigned char harq_pid = dlsch->current_harq_pid; // to check during implementation if harq_pid is required in the NB_IoT_eNB_DLSCH_t structure in defs_NB_IoT.h //unsigned char harq_pid = dlsch->current_harq_pid; // to check during implementation if harq_pid is required in the NB_IoT_eNB_DLSCH_t structure in defs_NB_IoT.h
unsigned int A; unsigned int A;
uint8_t RCC; uint8_t RCC;
A = dlsch->harq_processe->TBS; // 680 A = dlsch->harq_process.TBS; // 680
dlsch->harq_processe->length_e = G*Nsf // G*Nsf (number_of_subframes) = total number of bits to transmit dlsch->harq_process.length_e = G*Nsf; // G*Nsf (number_of_subframes) = total number of bits to transmit
int32_t numbits = A+24; int32_t numbits = A+24;
if (dlsch->harq_processe->round == 0) { // This is a new packet if (dlsch->harq_process.round == 0) { // This is a new packet
crc = crc24a(a,A)>>8; // CRC calculation (24 bits CRC) crc = crc24a_NB_IoT(a,A)>>8; // CRC calculation (24 bits CRC)
// CRC attachment to payload // CRC attachment to payload
a[A>>3] = ((uint8_t*)&crc)[2]; a[A>>3] = ((uint8_t*)&crc)[2];
a[1+(A>>3)] = ((uint8_t*)&crc)[1]; a[1+(A>>3)] = ((uint8_t*)&crc)[1];
a[2+(A>>3)] = ((uint8_t*)&crc)[0]; a[2+(A>>3)] = ((uint8_t*)&crc)[0];
dlsch->harq_processe->B = numbits; // The length of table b in bits dlsch->harq_process.B = numbits; // The length of table b in bits
memcpy(dlsch->harq_processe->b,a,numbits/8); memcpy(dlsch->harq_process.b,a,numbits/8);
memset(dlsch->harq_processe->d,LTE_NULL,96); memset(dlsch->harq_process.d,LTE_NULL_NB_IoT,96);
start_meas(te_stats); start_meas(te_stats);
ccode_encode_npdsch_NB_IoT(numbits, dlsch->harq_processe->b, dlsch->harq_processe->d+96, crc); // step 1 Tail-biting convolutional coding ccode_encode_npdsch_NB_IoT(numbits, dlsch->harq_process.b, dlsch->harq_process.d+96, crc); // step 1 Tail-biting convolutional coding
stop_meas(te_stats); stop_meas(te_stats);
start_meas(i_stats); start_meas(i_stats);
RCC = sub_block_interleaving_cc_NB_IoT(numbits,dlsch->harq_processe->d+96,dlsch->harq_processe->w); // step 2 interleaving RCC = sub_block_interleaving_cc_NB_IoT(numbits,dlsch->harq_process.d+96,dlsch->harq_process.w); // step 2 interleaving
stop_meas(i_stats); stop_meas(i_stats);
start_meas(rm_stats); start_meas(rm_stats);
lte_rate_matching_cc_NB_IoT(RCC,dlsch->harq_processe->length_e,dlsch->harq_processe->w,dlsch->harq_processe->e); // step 3 Rate Matching lte_rate_matching_cc_NB_IoT(RCC,dlsch->harq_process.length_e,dlsch->harq_process.w,dlsch->harq_process.e); // step 3 Rate Matching
stop_meas(rm_stats); stop_meas(rm_stats);
} }
return(0); return(0);
......
/*
* 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
*/
//NB-Iot
extern unsigned int TBStable_NB_IoT[14][8];
...@@ -159,4 +159,38 @@ NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB_IoT(//unsigned char Kmimo, ...@@ -159,4 +159,38 @@ NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB_IoT(//unsigned char Kmimo,
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);
/** \fn dlsch_encoding(PHY_VARS_eNB *eNB,
uint8_t *input_buffer,
LTE_DL_FRAME_PARMS *frame_parms,
uint8_t num_pdcch_symbols,
LTE_eNB_DLSCH_t *dlsch,
int frame,
uint8_t subframe)
\brief This function performs a subset of the bit-coding functions for LTE as described in 36-212, Release 8.Support is limited to turbo-coded channels (DLSCH/ULSCH). The implemented functions are:
- CRC computation and addition
- Code block segmentation and sub-block CRC addition
- Channel coding (Turbo coding)
- Rate matching (sub-block interleaving, bit collection, selection and transmission
- Code block concatenation
@param eNB Pointer to eNB PHY context
@param input_buffer Pointer to input buffer for sub-frame
@param frame_parms Pointer to frame descriptor structure
@param num_pdcch_symbols Number of PDCCH symbols in this subframe
@param dlsch Pointer to dlsch to be encoded
@param frame Frame number
@param subframe Subframe number
@param rm_stats Time statistics for rate-matching
@param te_stats Time statistics for turbo-encoding
@param i_stats Time statistics for interleaving
@returns status
*/
int32_t dlsch_encoding_NB_IoT(unsigned char *a,
NB_IoT_eNB_DLSCH_t *dlsch,
uint8_t Nsf, // number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table)
unsigned int G, // G (number of available RE) is implicitly multiplied by 2 (since only QPSK modulation)
time_stats_t *rm_stats,
time_stats_t *te_stats,
time_stats_t *i_stats);
#endif #endif
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
//#include "PHY/defs.h" //#include "PHY/defs.h"
#include "PHY/defs_nb_iot.h" #include "PHY/defs_nb_iot.h"
#include "PHY_INTERFACE/defs.h" //#include "PHY_INTERFACE/defs.h"
#include "PHY_INTERFACE/IF_Module_nb_iot.h" //#include "PHY_INTERFACE/IF_Module_nb_iot.h"
/* /*
extern char* namepointer_chMag ; extern char* namepointer_chMag ;
extern char* namepointer_log2; extern char* namepointer_log2;
...@@ -34,11 +34,11 @@ extern char fmageren_name2[512]; ...@@ -34,11 +34,11 @@ extern char fmageren_name2[512];
extern unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX]; extern unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX];
extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX]; extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX];
*/ */
#include "PHY/LTE_TRANSPORT/extern.h" //#include "PHY/LTE_TRANSPORT/extern.h"
#include "SIMULATION/ETH_TRANSPORT/extern.h" //#include "SIMULATION/ETH_TRANSPORT/extern.h"
extern unsigned int DAQ_MBOX; extern unsigned int DAQ_MBOX_NB_IoT;
extern int number_of_cards; extern int number_of_cards_NB_IoT;
//extern PHY_CONFIG *PHY_config; //extern PHY_CONFIG *PHY_config;
//extern PHY_VARS *PHY_vars; //extern PHY_VARS *PHY_vars;
......
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