Commit d38501c9 authored by Matthieu Kanj's avatar Matthieu Kanj

test version

parent 008f825c
/*********************************************************************** /*
* 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_CODING/ccoding_byte_NB_IoT.c /*! \file PHY/LTE_CODING/ccoding_byte_NB_IoT.c
* \Fucntions for CRC attachment and tail-biting convolutional coding for NPBCH channel, TS 36-212, V13.4.0 2017-02 * \Fucntions for CRC attachment and tail-biting convolutional coding for NPBCH channel, TS 36-212, V13.4.0 2017-02
* \author M. KANJ * \author M. KANJ
......
...@@ -188,19 +188,18 @@ typedef struct { ...@@ -188,19 +188,18 @@ typedef struct {
uint8_t d[96+(3*(24+56))]; // new parameter uint8_t d[96+(3*(24+56))]; // new parameter
/// Sub-block interleaver outputs /// Sub-block interleaver outputs
uint8_t w[3*3*(56+24)]; // new parameter uint8_t w[3*3*(56+24)]; // new parameter
///////////////////////////////// /////////////////////////////////
uint16_t si_rnti_x; uint16_t si_rnti_x;
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18) /// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e_x[236]; uint8_t e_x[472];
/// data after scrambling /// data after scrambling
uint8_t s_e_x[236]; uint8_t s_e_x[472];
//length of the table e //length of the table e
uint16_t length_e_x; // new parameter uint16_t length_e_x; // new parameter
/// Tail-biting convolutional coding outputs /// Tail-biting convolutional coding outputs
uint8_t d_x[96+(3*(24+120))]; // new parameter uint8_t d_x[96+(3*(24+256))]; // new parameter
/// Sub-block interleaver outputs /// Sub-block interleaver outputs
uint8_t w_x[3*3*(120+24)]; // new parameter uint8_t w_x[3*3*(256+24)]; // new parameter
//////////////////////////////// ////////////////////////////////
/// Status Flag indicating for this DLSCH (idle,active,disabled) /// Status Flag indicating for this DLSCH (idle,active,disabled)
......
...@@ -163,14 +163,19 @@ int dlsch_encoding_rar_NB_IoT(unsigned char *a, ...@@ -163,14 +163,19 @@ int dlsch_encoding_rar_NB_IoT(unsigned char *a,
bzero(npbch_a,7); bzero(npbch_a,7);
bzero(npbch_a_crc,10); bzero(npbch_a_crc,10);
uint8_t npbch_a_x[15]; /*uint8_t npbch_a_x[15];
uint8_t npbch_a_crc_x[18]; uint8_t npbch_a_crc_x[18];
bzero(npbch_a_x,15); bzero(npbch_a_x,15);
bzero(npbch_a_crc_x,18); bzero(npbch_a_crc_x,18);*/
uint8_t npbch_a_x[32];
uint8_t npbch_a_crc_x[35];
bzero(npbch_a_x,32);
bzero(npbch_a_crc_x,35);
dlsch->length_e = G; // G*Nsf (number_of_subframes) = total number of bits to transmit G=236 dlsch->length_e = G*Nsf; // G*Nsf (number_of_subframes) = total number of bits to transmit G=236
...@@ -182,8 +187,8 @@ if(option ==1) ...@@ -182,8 +187,8 @@ if(option ==1)
npbch_a[i] = a[i]; npbch_a[i] = a[i];
} }
} else { } else {
A = 120; A = 256;
for (int i=0; i<15; i++) for (int i=0; i<32; i++)
{ {
npbch_a_x[i] = a[i]; npbch_a_x[i] = a[i];
} }
...@@ -218,14 +223,14 @@ if(option ==1) ...@@ -218,14 +223,14 @@ if(option ==1)
crc = crc24a_NB_IoT(npbch_a_x,A)>>8; crc = crc24a_NB_IoT(npbch_a_x,A)>>8;
for (int j=0; j<15; j++) for (int j=0; j<32; j++)
{ {
npbch_a_crc_x[j] = npbch_a_x[j]; npbch_a_crc_x[j] = npbch_a_x[j];
} }
npbch_a_crc_x[15] = ((uint8_t*)&crc)[2]; npbch_a_crc_x[32] = ((uint8_t*)&crc)[2];
npbch_a_crc_x[16] = ((uint8_t*)&crc)[1]; npbch_a_crc_x[33] = ((uint8_t*)&crc)[1];
npbch_a_crc_x[17] = ((uint8_t*)&crc)[0]; npbch_a_crc_x[34] = ((uint8_t*)&crc)[0];
dlsch->B = numbits; // The length of table b in bits dlsch->B = numbits; // The length of table b in bits
//memcpy(dlsch->b,a,numbits/8); // comment if option 2 //memcpy(dlsch->b,a,numbits/8); // comment if option 2
......
...@@ -207,7 +207,8 @@ int dlsch_modulation_rar_NB_IoT(int32_t **txdataF, ...@@ -207,7 +207,8 @@ int dlsch_modulation_rar_NB_IoT(int32_t **txdataF,
int G, // number of bits per subframe int G, // number of bits per subframe
unsigned int npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf unsigned int npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
unsigned int subframe, unsigned int subframe,
unsigned short NB_IoT_RB_ID) unsigned short NB_IoT_RB_ID,
uint8_t option)
{ {
//uint8_t harq_pid = dlsch0->current_harq_pid; //uint8_t harq_pid = dlsch0->current_harq_pid;
//NB_IoT_DL_eNB_HARQ_t *dlsch0_harq = dlsch0->harq_processes[harq_pid]; //NB_IoT_DL_eNB_HARQ_t *dlsch0_harq = dlsch0->harq_processes[harq_pid];
...@@ -245,8 +246,20 @@ int dlsch_modulation_rar_NB_IoT(int32_t **txdataF, ...@@ -245,8 +246,20 @@ int dlsch_modulation_rar_NB_IoT(int32_t **txdataF,
} }
symbol_offset = (14*subframe*frame_parms->ofdm_symbol_size) + frame_parms->ofdm_symbol_size*l + NB_IoT_start; // symbol_offset = 512 * L + NB_IOT_RB start symbol_offset = (14*subframe*frame_parms->ofdm_symbol_size) + frame_parms->ofdm_symbol_size*l + NB_IoT_start; // symbol_offset = 512 * L + NB_IOT_RB start
if(option ==2)
allocate_REs_in_RB_NB_IoT(frame_parms, {
allocate_REs_in_RB_NB_IoT(frame_parms,
txdataF,
&jj,
symbol_offset,
&dlsch0->s_e[236],
pilots,
amp,
id_offset,
pilot_shift,
&re_allocated);
} else {
allocate_REs_in_RB_NB_IoT(frame_parms,
txdataF, txdataF,
&jj, &jj,
symbol_offset, symbol_offset,
...@@ -256,6 +269,7 @@ int dlsch_modulation_rar_NB_IoT(int32_t **txdataF, ...@@ -256,6 +269,7 @@ int dlsch_modulation_rar_NB_IoT(int32_t **txdataF,
id_offset, id_offset,
pilot_shift, pilot_shift,
&re_allocated); &re_allocated);
}
} }
// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_MODULATION, VCD_FUNCTION_OUT); // VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_MODULATION, VCD_FUNCTION_OUT);
......
...@@ -303,7 +303,8 @@ int dlsch_modulation_rar_NB_IoT(int32_t **txdataF, ...@@ -303,7 +303,8 @@ int dlsch_modulation_rar_NB_IoT(int32_t **txdataF,
int G, // number of bits per subframe int G, // number of bits per subframe
unsigned int npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf unsigned int npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
unsigned int subframe, unsigned int subframe,
unsigned short NB_IoT_RB_ID); unsigned short NB_IoT_RB_ID,
uint8_t option);
int32_t dlsch_encoding_NB_IoT(unsigned char *a, int32_t dlsch_encoding_NB_IoT(unsigned char *a,
NB_IoT_DL_eNB_SIB_t *dlsch, // NB_IoT_eNB_NDLSCH_t NB_IoT_DL_eNB_SIB_t *dlsch, // NB_IoT_eNB_NDLSCH_t
......
...@@ -79,6 +79,9 @@ typedef struct { ...@@ -79,6 +79,9 @@ typedef struct {
uint32_t frame_dscr_msg3; uint32_t frame_dscr_msg3;
uint32_t subframe_dscr_msg3; uint32_t subframe_dscr_msg3;
uint32_t frame_msg5;
uint32_t subframe_msg5;
uint8_t rar_to_transmit; uint8_t rar_to_transmit;
uint8_t subframe_SP; uint8_t subframe_SP;
uint8_t subframe_SP2; uint8_t subframe_SP2;
...@@ -108,11 +111,13 @@ typedef struct { ...@@ -108,11 +111,13 @@ typedef struct {
uint32_t subframe_msg4; uint32_t subframe_msg4;
uint8_t guard; uint8_t guard;
uint8_t counter_msg5;
uint8_t remaining_dci; uint8_t remaining_dci;
uint8_t remaining_rar; uint8_t remaining_rar;
uint8_t flag_msg5;
} eNB_rxtx_proc_t; } eNB_rxtx_proc_t;
/// Context data structure for eNB subframe processing /// Context data structure for eNB subframe processing
......
This diff is collapsed.
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