Commit 162066e4 authored by Matthieu Kanj's avatar Matthieu Kanj

Modifications for file separation in /LTE_TRANPORT

parent 09efb985
...@@ -995,11 +995,13 @@ set(PHY_SRC ...@@ -995,11 +995,13 @@ set(PHY_SRC
${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_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_modulation_NB_IoT.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
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/power_control.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/power_control.c
${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/dlsch_scrambling_NB_IoT.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/dci_tools_nb_iot.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/uci_tools.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/uci_tools.c
......
...@@ -42,7 +42,7 @@ void ccode_encode_NB_IoT (int32_t numbits, ...@@ -42,7 +42,7 @@ void ccode_encode_NB_IoT (int32_t numbits,
state = 0; state = 0;
if (add_crc == 2) { if (add_crc == 2) {
crc = crc16(inPtr,numbits); // crc is 2 bytes crc = crc16_NB_IoT(inPtr,numbits); // crc is 2 bytes
// scramble with RNTI // scramble with RNTI
crc ^= (((uint32_t)rnti)<<16); // XOR with crc crc ^= (((uint32_t)rnti)<<16); // XOR with crc
first_bit = 2; first_bit = 2;
......
...@@ -68,7 +68,7 @@ uint32_t lte_rate_matching_cc_NB_IoT(uint32_t RCC, // RRC = 2 ...@@ -68,7 +68,7 @@ uint32_t lte_rate_matching_cc_NB_IoT(uint32_t RCC, // RRC = 2
for (k=0; k<E; k++) { for (k=0; k<E; k++) {
while(w[ind] == LTE_NULL) { while(w[ind] == LTE_NULL_NB_IoT) {
ind++; ind++;
......
...@@ -226,10 +226,10 @@ int dci_allocate_REs_in_RB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms, ...@@ -226,10 +226,10 @@ int dci_allocate_REs_in_RB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,
*jj=*jj+1; *jj=*jj+1;
// normalization for 2 tx antennas // normalization for 2 tx antennas
((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
// fill in the rest of the ALAMOUTI precoding // fill in the rest of the ALAMOUTI precoding
if ( pilots != 1 || (re+1)%3 != id_offset) { if ( pilots != 1 || (re+1)%3 != id_offset) {
...@@ -289,10 +289,10 @@ int dci_allocate_REs_in_RB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms, ...@@ -289,10 +289,10 @@ int dci_allocate_REs_in_RB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,
*jj=*jj+1; *jj=*jj+1;
// normalization for 2 tx antennas // normalization for 2 tx antennas
((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
// fill in the rest of the ALAMOUTI precoding // fill in the rest of the ALAMOUTI precoding
if ( pilots != 1 || (re+1)%3 != id_offset) { if ( pilots != 1 || (re+1)%3 != id_offset) {
...@@ -359,15 +359,15 @@ int dci_allocate_REs_in_RB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms, ...@@ -359,15 +359,15 @@ int dci_allocate_REs_in_RB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,
*jj=*jj+1; *jj=*jj+1;
// normalization for 2 tx antennas // normalization for 2 tx antennas
((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[0][tti_offset+6])[0] += (int16_t)((((int16_t*)&tmp_sample3)[0]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[0][tti_offset+6])[0] += (int16_t)((((int16_t*)&tmp_sample3)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[0][tti_offset+6])[1] += (int16_t)((((int16_t*)&tmp_sample3)[1]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[0][tti_offset+6])[1] += (int16_t)((((int16_t*)&tmp_sample3)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[1][tti_offset+6])[0] += (int16_t)((((int16_t*)&tmp_sample4)[0]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[1][tti_offset+6])[0] += (int16_t)((((int16_t*)&tmp_sample4)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[1][tti_offset+6])[1] += (int16_t)((((int16_t*)&tmp_sample4)[1]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[1][tti_offset+6])[1] += (int16_t)((((int16_t*)&tmp_sample4)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
// fill in the rest of the ALAMOUTI precoding // fill in the rest of the ALAMOUTI precoding
if ( pilots != 1 || (re+1)%3 != id_offset) { if ( pilots != 1 || (re+1)%3 != id_offset) {
......
...@@ -70,9 +70,9 @@ int dlsch_encoding_NB_IoT(unsigned char *a, ...@@ -70,9 +70,9 @@ int dlsch_encoding_NB_IoT(unsigned char *a,
NB_IoT_eNB_DLSCH_t *dlsch, NB_IoT_eNB_DLSCH_t *dlsch,
uint8_t Nsf, // number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table) 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) 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_NB_IoT *rm_stats,
time_stats_t *te_stats, time_stats_t_NB_IoT *te_stats,
time_stats_t *i_stats) time_stats_t_NB_IoT *i_stats)
{ {
unsigned int crc=1; unsigned int crc=1;
//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
...@@ -95,17 +95,17 @@ int dlsch_encoding_NB_IoT(unsigned char *a, ...@@ -95,17 +95,17 @@ int dlsch_encoding_NB_IoT(unsigned char *a,
memcpy(dlsch->harq_process.b,a,numbits/8); memcpy(dlsch->harq_process.b,a,numbits/8);
memset(dlsch->harq_process.d,LTE_NULL_NB_IoT,96); memset(dlsch->harq_process.d,LTE_NULL_NB_IoT,96);
start_meas(te_stats); start_meas_NB_IoT(te_stats);
ccode_encode_npdsch_NB_IoT(numbits, dlsch->harq_process.b, dlsch->harq_process.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_NB_IoT(te_stats);
start_meas(i_stats); start_meas_NB_IoT(i_stats);
RCC = sub_block_interleaving_cc_NB_IoT(numbits,dlsch->harq_process.d+96,dlsch->harq_process.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_NB_IoT(i_stats);
start_meas(rm_stats); start_meas_NB_IoT(rm_stats);
lte_rate_matching_cc_NB_IoT(RCC,dlsch->harq_process.length_e,dlsch->harq_process.w,dlsch->harq_process.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_NB_IoT(rm_stats);
} }
return(0); return(0);
} }
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
//#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.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 "defs.h" //#include "defs.h"
#include "UTIL/LOG/vcd_signal_dumper.h" //#include "UTIL/LOG/vcd_signal_dumper.h"
int allocate_REs_in_RB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms, int allocate_REs_in_RB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,
int32_t **txdataF, int32_t **txdataF,
...@@ -34,7 +34,7 @@ int allocate_REs_in_RB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms, ...@@ -34,7 +34,7 @@ int allocate_REs_in_RB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,
{ {
MIMO_mode_NB_IoT_t mimo_mode = (frame_parms->mode1_flag==1)?SISO_NB_IoT:ALAMOUTI_NB_IoT; MIMO_mode_NB_IoT_t mimo_mode = (frame_parms->mode1_flag==1)?SISO_NB_IoT:ALAMOUTI_NB_IoT;
uint32_t tti_offset,aa; uint32_t tti_offset,aa;
uint8_t re, diff_re; uint8_t re;
int16_t gain_lin_QPSK; int16_t gain_lin_QPSK;
uint8_t first_re,last_re; uint8_t first_re,last_re;
int32_t tmp_sample1,tmp_sample2; int32_t tmp_sample1,tmp_sample2;
...@@ -48,7 +48,7 @@ int allocate_REs_in_RB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms, ...@@ -48,7 +48,7 @@ int allocate_REs_in_RB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,
if (pilots != 1 || re%3 != id_offset) // if re is not a pilot if (pilots != 1 || re%3 != id_offset) // if re is not a pilot
{ {
// diff_re = re%3 - id_offset;
if (mimo_mode == SISO_NB_IoT) { //SISO mapping if (mimo_mode == SISO_NB_IoT) { //SISO mapping
*re_allocated = *re_allocated + 1; // variable incremented but never used *re_allocated = *re_allocated + 1; // variable incremented but never used
...@@ -78,10 +78,10 @@ int allocate_REs_in_RB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms, ...@@ -78,10 +78,10 @@ int allocate_REs_in_RB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,
*jj=*jj+1; *jj=*jj+1;
// normalization for 2 tx antennas // normalization for 2 tx antennas
((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
// fill in the rest of the ALAMOUTI precoding // fill in the rest of the ALAMOUTI precoding
if ( pilots != 1 || (re+1)%3 != id_offset) { if ( pilots != 1 || (re+1)%3 != id_offset) {
...@@ -141,16 +141,16 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF, ...@@ -141,16 +141,16 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF,
id_offset = frame_parms->Nid_cell % 3; // Cell_ID_NB_IoT % 3 id_offset = frame_parms->Nid_cell % 3; // Cell_ID_NB_IoT % 3
if(RB_IoT_ID < (frame_parms->N_RB_DL/2)) if(RB_IoT_ID < (frame_parms->N_RB_DL/2))
{ {
NB_IoT_start = frame_parms->ofdm_symbol_size - 12*(frame_parms->N_RB_DL/2) - (bandwidth_even_odd*6) + 12*(RB_IoT_ID%(ceil(frame_parms->N_RB_DL/(float)2))); NB_IoT_start = frame_parms->ofdm_symbol_size - 12*(frame_parms->N_RB_DL/2) - (bandwidth_even_odd*6) + 12*(RB_IoT_ID % (int)(ceil(frame_parms->N_RB_DL/(float)2)));
} else { } else {
NB_IoT_start = (bandwidth_even_odd*6) + 12*(RB_IoT_ID%(ceil(frame_parms->N_RB_DL/(float)2))); NB_IoT_start = (bandwidth_even_odd*6) + 12*(RB_IoT_ID % (int)(ceil(frame_parms->N_RB_DL/(float)2)));
} }
symbol_offset = frame_parms->ofdm_symbol_size*l + NB_IoT_start; // symbol_offset = 512 * L + NB_IOT_RB start symbol_offset = frame_parms->ofdm_symbol_size*l + NB_IoT_start; // symbol_offset = 512 * L + NB_IOT_RB start
allocate_REs_in_RB_NB_IoT(frame_parms, allocate_REs_in_RB_NB_IoT(frame_parms,
txdataF, txdataF,
&jj, &jj,
symbol_offset, symbol_offset,
&dlsch0->harq_processes->s_e[G*npdsch_data_subframe], &dlsch0->harq_process.s_e[G*npdsch_data_subframe],
pilots, pilots,
amp, amp,
id_offset, id_offset,
......
...@@ -16,16 +16,16 @@ ...@@ -16,16 +16,16 @@
//#include "PHY/defs.h" //#include "PHY/defs.h"
#include "PHY/defs_nb_iot.h" #include "PHY/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 "defs.h" //#include "defs.h"
#include "extern.h" //#include "extern_NB_IoT.h"
#include "PHY/extern.h" //#include "PHY/extern_NB_IoT.h"
#include "UTIL/LOG/vcd_signal_dumper.h" //#include "UTIL/LOG/vcd_signal_dumper.h"
#include "defs_NB_IoT.h" #include "PHY/LTE_TRANSPORT/defs_nb_iot.h"
void dlsch_scrambling_NB_IoT(NB_IOT_DL_FRAME_PARMS *frame_parms, void dlsch_scrambling_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,
NB_IoT_eNB_DLSCH_t *dlsch, NB_IoT_eNB_DLSCH_t *dlsch,
int G, // total number of bits to transmit int G, // total number of bits to transmit
uint8_t Nf, // Nf is the frame number (0..9) uint8_t Nf, // Nf is the frame number (0..9)
...@@ -33,7 +33,7 @@ void dlsch_scrambling_NB_IoT(NB_IOT_DL_FRAME_PARMS *frame_parms, ...@@ -33,7 +33,7 @@ void dlsch_scrambling_NB_IoT(NB_IOT_DL_FRAME_PARMS *frame_parms,
{ {
int i,j,k=0; int i,j,k=0;
uint32_t x1, x2, s=0; uint32_t x1, x2, s=0;
uint8_t *e=dlsch->harq_processes->e; //uint8_t *e=dlsch->harq_processes[dlsch->current_harq_pid]->e; uint8_t *e=dlsch->harq_process.e; //uint8_t *e=dlsch->harq_processes[dlsch->current_harq_pid]->e;
x2 = (dlsch->rnti<<14) + ((Nf%2)<<13) + ((Ns>>1)<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 10.2.3.1 x2 = (dlsch->rnti<<14) + ((Nf%2)<<13) + ((Ns>>1)<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 10.2.3.1
...@@ -43,7 +43,7 @@ void dlsch_scrambling_NB_IoT(NB_IOT_DL_FRAME_PARMS *frame_parms, ...@@ -43,7 +43,7 @@ void dlsch_scrambling_NB_IoT(NB_IOT_DL_FRAME_PARMS *frame_parms,
for (j=0; j<32; j++,k++) { for (j=0; j<32; j++,k++) {
dlsch->s_e[k] = (e[k]&1) ^ ((s>>j)&1); dlsch->harq_process.s_e[k] = (e[k]&1) ^ ((s>>j)&1);
} }
s = lte_gold_generic_NB_IoT(&x1, &x2, 0); s = lte_gold_generic_NB_IoT(&x1, &x2, 0);
......
...@@ -14,23 +14,23 @@ ...@@ -14,23 +14,23 @@
//#include "PHY/defs.h" //#include "PHY/defs.h"
#include "PHY/defs_nb_iot.h" #include "PHY/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 "defs.h" #include "PHY/LTE_TRANSPORT/defs_nb_iot.h"
#include "extern.h" #include "extern_NB_IoT.h"
#include "PHY/extern.h" #include "PHY/extern_NB_IoT.h"
#include "PHY/sse_intrin.h" //#include "PHY/sse_intrin.h"
#include "PHY/CODING/defs_nb_iot.h" #include "PHY/CODING/defs_nb_iot.h"
#include "PHY/LTE_REFSIG/defs_NB_IoT.h" #include "PHY/LTE_REFSIG/defs_NB_IoT.h"
#ifdef PHY_ABSTRACTION //#ifdef PHY_ABSTRACTION
#include "SIMULATION/TOOLS/defs.h" //#include "SIMULATION/TOOLS/defs.h"
#endif //#endif
#ifdef OPENAIR2 //#ifdef OPENAIR2
#include "PHY_INTERFACE/defs.h" //#include "PHY_INTERFACE/defs.h"
#endif //#endif
#define NPBCH_A 34 // 34 for NB-IoT and 24 for LTE #define NPBCH_A 34 // 34 for NB-IoT and 24 for LTE
...@@ -44,13 +44,13 @@ int allocate_npbch_REs_in_RB(NB_IoT_DL_FRAME_PARMS *frame_parms, ...@@ -44,13 +44,13 @@ int allocate_npbch_REs_in_RB(NB_IoT_DL_FRAME_PARMS *frame_parms,
unsigned short id_offset, unsigned short id_offset,
uint32_t *re_allocated) // not used variable ??!! uint32_t *re_allocated) // not used variable ??!!
{ {
MIMO_mode_t mimo_mode = (frame_parms->mode1_flag==1)?SISO:ALAMOUTI; MIMO_mode_NB_IoT_t mimo_mode = (frame_parms->mode1_flag==1)?SISO_NB_IoT:ALAMOUTI_NB_IoT;
uint32_t tti_offset,aa; uint32_t tti_offset,aa;
uint8_t re; uint8_t re;
int16_t gain_lin_QPSK; int16_t gain_lin_QPSK;
uint8_t first_re,last_re; uint8_t first_re,last_re;
int32_t tmp_sample1,tmp_sample2; int32_t tmp_sample1,tmp_sample2;
gain_lin_QPSK = (int16_t)((amp*ONE_OVER_SQRT2_Q15)>>15); gain_lin_QPSK = (int16_t)((amp*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
first_re=0; first_re=0;
last_re=12; last_re=12;
...@@ -61,7 +61,7 @@ int allocate_npbch_REs_in_RB(NB_IoT_DL_FRAME_PARMS *frame_parms, ...@@ -61,7 +61,7 @@ int allocate_npbch_REs_in_RB(NB_IoT_DL_FRAME_PARMS *frame_parms,
if (pilots != 1 || re%3 != id_offset) // if re is not a pilot if (pilots != 1 || re%3 != id_offset) // if re is not a pilot
{ {
// diff_re = re%3 - id_offset; // diff_re = re%3 - id_offset;
if (mimo_mode == SISO) { //SISO mapping if (mimo_mode == SISO_NB_IoT) { //SISO mapping
*re_allocated = *re_allocated + 1; // variable incremented but never used *re_allocated = *re_allocated + 1; // variable incremented but never used
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
((int16_t*)&txdataF[aa][tti_offset])[0] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //I //b_i ((int16_t*)&txdataF[aa][tti_offset])[0] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //I //b_i
...@@ -71,7 +71,7 @@ int allocate_npbch_REs_in_RB(NB_IoT_DL_FRAME_PARMS *frame_parms, ...@@ -71,7 +71,7 @@ int allocate_npbch_REs_in_RB(NB_IoT_DL_FRAME_PARMS *frame_parms,
((int16_t*)&txdataF[aa][tti_offset])[1] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //Q //b_{i+1} ((int16_t*)&txdataF[aa][tti_offset])[1] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //Q //b_{i+1}
} }
*jj = *jj + 1; *jj = *jj + 1;
} else if (mimo_mode == ALAMOUTI) { } else if (mimo_mode == ALAMOUTI_NB_IoT) {
*re_allocated = *re_allocated + 1; *re_allocated = *re_allocated + 1;
((int16_t*)&tmp_sample1)[0] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; ((int16_t*)&tmp_sample1)[0] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
...@@ -87,10 +87,10 @@ int allocate_npbch_REs_in_RB(NB_IoT_DL_FRAME_PARMS *frame_parms, ...@@ -87,10 +87,10 @@ int allocate_npbch_REs_in_RB(NB_IoT_DL_FRAME_PARMS *frame_parms,
*jj=*jj+1; *jj=*jj+1;
// normalization for 2 tx antennas // normalization for 2 tx antennas
((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
// fill in the rest of the ALAMOUTI precoding // fill in the rest of the ALAMOUTI precoding
if ( pilots != 1 || (re+1)%3 != id_offset) { if ( pilots != 1 || (re+1)%3 != id_offset) {
...@@ -143,7 +143,7 @@ int generate_npbch(NB_IoT_eNB_NPBCH_t *eNB_npbch, ...@@ -143,7 +143,7 @@ int generate_npbch(NB_IoT_eNB_NPBCH_t *eNB_npbch,
if (frame_mod64==0) { if (frame_mod64==0) {
bzero(npbch_a,5); // initializing input data stream , filling with zeros bzero(npbch_a,5); // initializing input data stream , filling with zeros
bzero(eNB_npbch->npbch_e,npbch_E); // filling with "0" the table pbch_e[1600] bzero(eNB_npbch->npbch_e,npbch_E); // filling with "0" the table pbch_e[1600]
memset(eNB_npbch->npbch_d,LTE_NULL,96); // filling with "2" the first 96 elements of table pbch_d[216] memset(eNB_npbch->npbch_d,LTE_NULL_NB_IoT,96); // filling with "2" the first 96 elements of table pbch_d[216]
for (i=0; i<5; i++) // set input bits stream for (i=0; i<5; i++) // set input bits stream
{ {
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
//#include "PHY/defs.h" //#include "PHY/defs.h"
#include "PHY/defs_nb_iot.h" #include "PHY/defs_nb_iot.h"
#include "defs.h" //#include "defs.h"
#include "PHY/extern.h" #include "PHY/extern_NB_IoT.h"
#include "nsss_NB_IoT.h" #include "nsss_NB_IoT.h"
int generate_sss_NB_IoT(int32_t **txdataF, int generate_sss_NB_IoT(int32_t **txdataF,
...@@ -101,7 +101,7 @@ int generate_sss_NB_IoT(int32_t **txdataF, ...@@ -101,7 +101,7 @@ int generate_sss_NB_IoT(int32_t **txdataF,
slot_id = slot_offset; slot_id = slot_offset;
// Signal amplitude // Signal amplitude
a = (frame_parms->nb_antennas_tx == 1) ? amp: (amp*ONE_OVER_SQRT2_Q15)>>15; a = (frame_parms->nb_antennas_tx == 1) ? amp: (amp*ONE_OVER_SQRT2_Q15_NB_IoT)>>15;
// Testing if the total number of RBs is even or odd (i.e. Identification of the bandwidth: 1.4, 3, 5, 10, ... MHz) // Testing if the total number of RBs is even or odd (i.e. Identification of the bandwidth: 1.4, 3, 5, 10, ... MHz)
bandwidth_even_odd = frame_parms->N_RB_DL % 2; // 0 even, 1 odd bandwidth_even_odd = frame_parms->N_RB_DL % 2; // 0 even, 1 odd
......
...@@ -189,8 +189,8 @@ int32_t dlsch_encoding_NB_IoT(unsigned char *a, ...@@ -189,8 +189,8 @@ int32_t dlsch_encoding_NB_IoT(unsigned char *a,
NB_IoT_eNB_DLSCH_t *dlsch, NB_IoT_eNB_DLSCH_t *dlsch,
uint8_t Nsf, // number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table) 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) 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_NB_IoT *rm_stats,
time_stats_t *te_stats, time_stats_t_NB_IoT *te_stats,
time_stats_t *i_stats); time_stats_t_NB_IoT *i_stats);
#endif #endif
...@@ -32,11 +32,11 @@ ...@@ -32,11 +32,11 @@
//#include "defs.h" //#include "defs.h"
#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.h"
#include "PHY/CODING/extern.h" #include "PHY/CODING/extern.h"
#include "extern.h" #include "extern_NB_IoT.h"
#include "SCHED/extern.h" #include "SCHED/extern.h"
#ifdef OPENAIR2 #ifdef OPENAIR2
#include "LAYER2/MAC/defs.h" #include "LAYER2/MAC/defs.h"
...@@ -1133,7 +1133,7 @@ unsigned int ulsch_decoding_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -1133,7 +1133,7 @@ unsigned int ulsch_decoding_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
// Demultiplexing/Deinterleaving of PUSCH/ACK/RI/CQI // Demultiplexing/Deinterleaving of PUSCH/ACK/RI/CQI
start_meas(&eNB->ulsch_demultiplexing_stats); //start_meas_NB_IoT(&eNB->ulsch_demultiplexing_stats);
Hpp = Hprime + Qprime_RI; Hpp = Hprime + Qprime_RI;
Cmux = ulsch_harq->Nsymb_pusch; Cmux = ulsch_harq->Nsymb_pusch;
...@@ -1555,7 +1555,7 @@ unsigned int ulsch_decoding_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -1555,7 +1555,7 @@ unsigned int ulsch_decoding_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
} }
stop_meas(&eNB->ulsch_demultiplexing_stats); //stop_meas_NB_IoT(&eNB->ulsch_demultiplexing_stats);
// printf("after ACKNAK2 c[%d] = %p (iprime %d, G %d)\n",0,ulsch_harq->c[0],iprime,G); // printf("after ACKNAK2 c[%d] = %p (iprime %d, G %d)\n",0,ulsch_harq->c[0],iprime,G);
......
/*
* 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
*/
#include <stdio.h>
#include "time_meas_NB_IoT.h"
#include <math.h>
#include <unistd.h>
// global var for openair performance profiler
int opp_enabled = 0;
double get_cpu_freq_GHz(void) {
time_stats_t ts = {0};
reset_meas(&ts);
ts.trials++;
ts.in = rdtsc_oai();
sleep(1);
ts.diff = (rdtsc_oai()-ts.in);
cpu_freq_GHz = (double)ts.diff/1000000000;
printf("CPU Freq is %f \n", cpu_freq_GHz);
return cpu_freq_GHz;
}
void print_meas_now(time_stats_t *ts, const char* name, FILE* file_name){
if (opp_enabled) {
//static double cpu_freq_GHz = 3.2;
//if (cpu_freq_GHz == 0.0)
//cpu_freq_GHz = get_cpu_freq_GHz(); // super slow
if (ts->trials>0) {
//fprintf(file_name,"Name %25s: Processing %15.3f ms for SF %d, diff_now %15.3f \n", name,(ts->diff_now/(cpu_freq_GHz*1000000.0)),subframe,ts->diff_now);
fprintf(file_name,"%15.3f ms, diff_now %15.3f \n",(ts->diff_now/(cpu_freq_GHz*1000000.0)),(double)ts->diff_now);
}
}
}
void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_time, time_stats_t * sf_exec_time)
{
if (opp_enabled) {
static int first_time = 0;
static double cpu_freq_GHz = 0.0;
if (cpu_freq_GHz == 0.0)
cpu_freq_GHz = get_cpu_freq_GHz();
if (first_time == 0) {
first_time=1;
if ((total_exec_time == NULL) || (sf_exec_time== NULL))
fprintf(stderr, "%25s %25s %25s %25s %25s %6f\n","Name","Total","Per Trials", "Num Trials","CPU_F_GHz", cpu_freq_GHz);
else
fprintf(stderr, "%25s %25s %25s %20s %15s %6f\n","Name","Total","Average/Frame","Trials", "CPU_F_GHz", cpu_freq_GHz);
}
if (ts->trials>0) {
//printf("%20s: total: %10.3f ms, average: %10.3f us (%10d trials)\n", name, ts->diff/cpu_freq_GHz/1000000.0, ts->diff/ts->trials/cpu_freq_GHz/1000.0, ts->trials);
if ((total_exec_time == NULL) || (sf_exec_time== NULL)) {
fprintf(stderr, "%25s: %15.3f ms ; %15.3f us; %15d;\n",
name,
(ts->diff/cpu_freq_GHz/1000000.0),
(ts->diff/ts->trials/cpu_freq_GHz/1000.0),
ts->trials);
} else {
fprintf(stderr, "%25s: %15.3f ms (%5.2f%%); %15.3f us (%5.2f%%); %15d;\n",
name,
(ts->diff/cpu_freq_GHz/1000000.0),
((ts->diff/cpu_freq_GHz/1000000.0)/(total_exec_time->diff/cpu_freq_GHz/1000000.0))*100, // percentage
(ts->diff/ts->trials/cpu_freq_GHz/1000.0),
((ts->diff/ts->trials/cpu_freq_GHz/1000.0)/(sf_exec_time->diff/sf_exec_time->trials/cpu_freq_GHz/1000.0))*100, // percentage
ts->trials);
}
}
}
}
double get_time_meas_us(time_stats_t *ts)
{
static double cpu_freq_GHz = 0.0;
if (cpu_freq_GHz == 0.0)
cpu_freq_GHz = get_cpu_freq_GHz();
if (ts->trials>0)
return (ts->diff/ts->trials/cpu_freq_GHz/1000.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
*/
#ifndef __TIME_MEAS_DEFS_NB_IoT__H__
#define __TIME_MEAS_DEFS_NB_IoT__H__
#include <unistd.h>
#include <math.h>
#include <stdint.h>
#include <time.h>
#include <errno.h>
#include <stdio.h>
#include <pthread.h>
#include <linux/kernel.h>
#include <linux/types.h>
// global var to enable openair performance profiler
extern int opp_enabled_NB_IoT;
double cpu_freq_GHz;
#if defined(__x86_64__) || defined(__i386__)
typedef struct {
long long in;
long long diff;
long long diff_now;
long long p_time; /*!< \brief absolute process duration */
long long diff_square; /*!< \brief process duration square */
long long max;
int trials;
int meas_flag;
} time_stats_t_NB_IoT;
#elif defined(__arm__)
typedef struct {
uint32_t in;
uint32_t diff_now;
uint32_t diff;
uint32_t p_time; /*!< \brief absolute process duration */
uint32_t diff_square; /*!< \brief process duration square */
uint32_t max;
int trials;
} time_stats_t_NB_IoT;
#endif
static inline void start_meas_NB_IoT(time_stats_t_NB_IoT *ts) __attribute__((always_inline));
static inline void stop_meas_NB_IoT(time_stats_t_NB_IoT *ts) __attribute__((always_inline));
/*
void print_meas_now(time_stats_t *ts, const char* name, FILE* file_name);
void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_time, time_stats_t * sf_exec_time);
double get_time_meas_us(time_stats_t *ts);
double get_cpu_freq_GHz(void);
*/
#if defined(__i386__)
static inline unsigned long long rdtsc_oai_NB_IoT(void) __attribute__((always_inline));
static inline unsigned long long rdtsc_oai_NB_IoT(void)
{
unsigned long long int x;
__asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
return x;
}
#elif defined(__x86_64__)
static inline unsigned long long rdtsc_oai_NB_IoT(void) __attribute__((always_inline));
static inline unsigned long long rdtsc_oai_NB_IoT(void)
{
unsigned long long a, d;
__asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
return (d<<32) | a;
}
#elif defined(__arm__)
static inline uint32_t rdtsc_oai_NB_IoT(void) __attribute__((always_inline));
static inline uint32_t rdtsc_oai_NB_IoT(void)
{
uint32_t r = 0;
asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(r) );
return r;
}
#endif
static inline void start_meas_NB_IoT(time_stats_t_NB_IoT *ts)
{
if (opp_enabled_NB_IoT) {
if (ts->meas_flag==0) {
ts->trials++;
ts->in = rdtsc_oai_NB_IoT();
ts->meas_flag=1;
}
else {
ts->in = rdtsc_oai_NB_IoT();
}
}
}
static inline void stop_meas_NB_IoT(time_stats_t_NB_IoT *ts)
{
if (opp_enabled_NB_IoT) {
long long out = rdtsc_oai_NB_IoT();
ts->diff_now = (out-ts->in);
ts->diff_now = (out-ts->in);
ts->diff += (out-ts->in);
/// process duration is the difference between two clock points
ts->p_time = (out-ts->in);
ts->diff_square += (out-ts->in)*(out-ts->in);
if ((out-ts->in) > ts->max)
ts->max = out-ts->in;
ts->meas_flag=0;
}
}
static inline void reset_meas_NB_IoT(time_stats_t_NB_IoT *ts) {
ts->trials=0;
ts->diff=0;
ts->diff_now=0;
ts->p_time=0;
ts->diff_square=0;
ts->max=0;
ts->meas_flag=0;
}
static inline void copy_meas_NB_IoT(time_stats_t_NB_IoT *dst_ts,time_stats_t_NB_IoT *src_ts)
{
if (opp_enabled_NB_IoT) {
dst_ts->trials=src_ts->trials;
dst_ts->diff=src_ts->diff;
dst_ts->max=src_ts->max;
}
}
#endif
...@@ -121,15 +121,15 @@ static inline void* malloc16_clear( size_t size ) ...@@ -121,15 +121,15 @@ static inline void* malloc16_clear( size_t size )
#include "impl_defs_top_NB_IoT.h" #include "impl_defs_top_NB_IoT.h"
#include "impl_defs_top.h" //#include "impl_defs_top.h"
#include "impl_defs_lte.h" //#include "impl_defs_lte.h"
#include "PHY/impl_defs_lte_nb_iot.h" #include "PHY/impl_defs_lte_nb_iot.h"
#include "PHY/TOOLS/time_meas.h" #include "PHY/TOOLS/time_meas_NB_IoT.h"
#include "PHY/CODING/defs.h" //#include "PHY/CODING/defs.h"
#include "PHY/CODING/defs_nb_iot.h" #include "PHY/CODING/defs_nb_iot.h"
#include "PHY/TOOLS/defs.h" //#include "PHY/TOOLS/defs.h"
#include "platform_types.h" //#include "platform_types.h"
///#include "openair1/PHY/LTE_TRANSPORT/defs_nb_iot.h" ///#include "openair1/PHY/LTE_TRANSPORT/defs_nb_iot.h"
#ifdef OPENAIR_LTE #ifdef OPENAIR_LTE
...@@ -144,12 +144,13 @@ static inline void* malloc16_clear( size_t size ) ...@@ -144,12 +144,13 @@ static inline void* malloc16_clear( size_t size )
#define NUMBER_OF_eNB_SECTORS_MAX_NB_IoT 3 #define NUMBER_OF_eNB_SECTORS_MAX_NB_IoT 3
#define NB_BANDS_MAX_NB_IoT 8 #define NB_BANDS_MAX_NB_IoT 8
/*
#ifdef OCP_FRAMEWORK #ifdef OCP_FRAMEWORK
#include <enums.h> #include <enums.h>
#else #else
typedef enum {normal_txrx=0,rx_calib_ue=1,rx_calib_ue_med=2,rx_calib_ue_byp=3,debug_prach=4,no_L2_connect=5,calib_prach_tx=6,rx_dump_frame=7,loop_through_memory=8} runmode_t; typedef enum {normal_txrx_NB_IoT=0,rx_calib_ue_NB_IoT=1,rx_calib_ue_med_NB_IoT=2,rx_calib_ue_byp_NB_IoT=3,debug_prach_NB_IoT=4,no_L2_connect_NB_IoT=5,calib_prach_tx_NB_IoT=6,rx_dump_frame_NB_IoT=7,loop_through_memory_NB_IoT=8} runmode_NB_IoT_t;
#endif
/*
enum transmission_access_mode { enum transmission_access_mode {
NO_ACCESS=0, NO_ACCESS=0,
POSTPONED_ACCESS, POSTPONED_ACCESS,
...@@ -172,14 +173,14 @@ typedef enum { ...@@ -172,14 +173,14 @@ typedef enum {
synch_to_other // synch to another source (timer, other CC_id) synch_to_other // synch to another source (timer, other CC_id)
} eNB_timing_t; } eNB_timing_t;
#endif #endif
*/
typedef struct UE_SCAN_INFO_s { typedef struct UE_SCAN_INFO_NB_IoT_s {
/// 10 best amplitudes (linear) for each pss signals /// 10 best amplitudes (linear) for each pss signals
int32_t amp[3][10]; int32_t amp[3][10];
/// 10 frequency offsets (kHz) corresponding to best amplitudes, with respect do minimum DL frequency in the band /// 10 frequency offsets (kHz) corresponding to best amplitudes, with respect do minimum DL frequency in the band
int32_t freq_offset_Hz[3][10]; int32_t freq_offset_Hz[3][10];
} UE_SCAN_INFO_t; } UE_SCAN_INFO_NB_IoT_t;
*/
/// Top-level PHY Data Structure for RN /// Top-level PHY Data Structure for RN
typedef struct { typedef struct {
/// Module ID indicator for this instance /// Module ID indicator for this instance
...@@ -424,7 +425,7 @@ typedef struct eNB_proc_NB_IoT_t_s { ...@@ -424,7 +425,7 @@ typedef struct eNB_proc_NB_IoT_t_s {
} eNB_proc_NB_IoT_t; } eNB_proc_NB_IoT_t;
/*
/// Context data structure for RX/TX portion of subframe processing /// Context data structure for RX/TX portion of subframe processing
typedef struct { typedef struct {
/// index of the current UE RX/TX proc /// index of the current UE RX/TX proc
...@@ -457,7 +458,7 @@ typedef struct { ...@@ -457,7 +458,7 @@ typedef struct {
int sub_frame_start; int sub_frame_start;
int sub_frame_step; int sub_frame_step;
unsigned long long gotIQs; unsigned long long gotIQs;
} UE_rxtx_proc_t; } UE_rxtx_proc_NB_IoT_t;
/// Context data structure for eNB subframe processing /// Context data structure for eNB subframe processing
typedef struct { typedef struct {
...@@ -485,10 +486,10 @@ typedef struct { ...@@ -485,10 +486,10 @@ typedef struct {
/// mutex for UE synch thread /// mutex for UE synch thread
pthread_mutex_t mutex_synch; pthread_mutex_t mutex_synch;
/// set of scheduling variables RXn-TXnp4 threads /// set of scheduling variables RXn-TXnp4 threads
UE_rxtx_proc_t proc_rxtx[2]; UE_rxtx_proc_NB_IoT_t proc_rxtx[2];
} UE_proc_t; } UE_proc_NB_IoT_t;
*/
/// Top-level PHY Data Structure for eNB /// Top-level PHY Data Structure for eNB
typedef struct PHY_VARS_eNB_NB_IoT_s { typedef struct PHY_VARS_eNB_NB_IoT_s {
...@@ -512,9 +513,9 @@ typedef struct PHY_VARS_eNB_NB_IoT_s { ...@@ -512,9 +513,9 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
void (*do_prach)(struct PHY_VARS_eNB_NB_IoT_s *eNB,int frame,int subframe); void (*do_prach)(struct PHY_VARS_eNB_NB_IoT_s *eNB,int frame,int subframe);
void (*fep)(struct PHY_VARS_eNB_NB_IoT_s *eNB,eNB_rxtx_proc_NB_IoT_t *proc); void (*fep)(struct PHY_VARS_eNB_NB_IoT_s *eNB,eNB_rxtx_proc_NB_IoT_t *proc);
int (*td)(struct PHY_VARS_eNB_NB_IoT_s *eNB,int UE_id,int harq_pid,int llr8_flag); int (*td)(struct PHY_VARS_eNB_NB_IoT_s *eNB,int UE_id,int harq_pid,int llr8_flag);
int (*te)(struct PHY_VARS_eNB_NB_IoT_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *); int (*te)(struct PHY_VARS_eNB_NB_IoT_s *,uint8_t *,uint8_t,NB_IoT_eNB_DLSCH_t *,int,uint8_t,time_stats_t_NB_IoT *,time_stats_t_NB_IoT *,time_stats_t_NB_IoT *);
void (*proc_uespec_rx)(struct PHY_VARS_eNB_NB_IoT_s *eNB,eNB_rxtx_proc_NB_IoT_t *proc,const relaying_type_t r_type); void (*proc_uespec_rx)(struct PHY_VARS_eNB_NB_IoT_s *eNB,eNB_rxtx_proc_NB_IoT_t *proc,const relaying_type_t_NB_IoT r_type);
void (*proc_tx)(struct PHY_VARS_eNB_NB_IoT_s *eNB,eNB_rxtx_proc_NB_IoT_t *proc,relaying_type_t r_type,PHY_VARS_RN_NB_IoT *rn); void (*proc_tx)(struct PHY_VARS_eNB_NB_IoT_s *eNB,eNB_rxtx_proc_NB_IoT_t *proc,relaying_type_t_NB_IoT r_type,PHY_VARS_RN_NB_IoT *rn);
void (*tx_fh)(struct PHY_VARS_eNB_NB_IoT_s *eNB,eNB_rxtx_proc_NB_IoT_t *proc); void (*tx_fh)(struct PHY_VARS_eNB_NB_IoT_s *eNB,eNB_rxtx_proc_NB_IoT_t *proc);
void (*rx_fh)(struct PHY_VARS_eNB_NB_IoT_s *eNB,int *frame, int *subframe); void (*rx_fh)(struct PHY_VARS_eNB_NB_IoT_s *eNB,int *frame, int *subframe);
int (*start_rf)(struct PHY_VARS_eNB_NB_IoT_s *eNB); int (*start_rf)(struct PHY_VARS_eNB_NB_IoT_s *eNB);
...@@ -590,34 +591,34 @@ typedef struct PHY_VARS_eNB_NB_IoT_s { ...@@ -590,34 +591,34 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
/// For emulation only (used by UE abstraction to retrieve DCI) /// For emulation only (used by UE abstraction to retrieve DCI)
uint8_t num_common_dci[2]; // num_dci in even/odd subframes uint8_t num_common_dci[2]; // num_dci in even/odd subframes
uint8_t num_ue_spec_dci[2]; // num_dci in even/odd subframes uint8_t num_ue_spec_dci[2]; // num_dci in even/odd subframes
DCI_ALLOC_t dci_alloc[2][NUM_DCI_MAX_NB_IoT]; // dci_alloc from even/odd subframes DCI_ALLOC_NB_IoT_t dci_alloc[2][NUM_DCI_MAX_NB_IoT]; // dci_alloc from even/odd subframes
// PDSCH Varaibles // PDSCH Varaibles
PDSCH_CONFIG_DEDICATED pdsch_config_dedicated[NUMBER_OF_UE_MAX_NB_IoT]; PDSCH_CONFIG_DEDICATED_NB_IoT pdsch_config_dedicated[NUMBER_OF_UE_MAX_NB_IoT];
// PUSCH Varaibles // PUSCH Varaibles
PUSCH_CONFIG_DEDICATED pusch_config_dedicated[NUMBER_OF_UE_MAX_NB_IoT]; PUSCH_CONFIG_DEDICATED_NB_IoT pusch_config_dedicated[NUMBER_OF_UE_MAX_NB_IoT];
// PUCCH variables // PUCCH variables
PUCCH_CONFIG_DEDICATED pucch_config_dedicated[NUMBER_OF_UE_MAX_NB_IoT]; PUCCH_CONFIG_DEDICATED_NB_IoT pucch_config_dedicated[NUMBER_OF_UE_MAX_NB_IoT];
// UL-POWER-Control // UL-POWER-Control
UL_POWER_CONTROL_DEDICATED ul_power_control_dedicated[NUMBER_OF_UE_MAX_NB_IoT]; UL_POWER_CONTROL_DEDICATED_NB_IoT ul_power_control_dedicated[NUMBER_OF_UE_MAX_NB_IoT];
// TPC // TPC
TPC_PDCCH_CONFIG tpc_pdcch_config_pucch[NUMBER_OF_UE_MAX_NB_IoT]; TPC_PDCCH_CONFIG_NB_IoT tpc_pdcch_config_pucch[NUMBER_OF_UE_MAX_NB_IoT];
TPC_PDCCH_CONFIG tpc_pdcch_config_pusch[NUMBER_OF_UE_MAX_NB_IoT]; TPC_PDCCH_CONFIG_NB_IoT tpc_pdcch_config_pusch[NUMBER_OF_UE_MAX_NB_IoT];
// CQI reporting // CQI reporting
CQI_REPORT_CONFIG cqi_report_config[NUMBER_OF_UE_MAX_NB_IoT]; CQI_REPORT_CONFIG_NB_IoT cqi_report_config[NUMBER_OF_UE_MAX_NB_IoT];
// SRS Variables // SRS Variables
SOUNDINGRS_UL_CONFIG_DEDICATED soundingrs_ul_config_dedicated[NUMBER_OF_UE_MAX_NB_IoT]; SOUNDINGRS_UL_CONFIG_DEDICATED_NB_IoT soundingrs_ul_config_dedicated[NUMBER_OF_UE_MAX_NB_IoT];
uint8_t ncs_cell[20][7]; uint8_t ncs_cell[20][7];
// Scheduling Request Config // Scheduling Request Config
SCHEDULING_REQUEST_CONFIG scheduling_request_config[NUMBER_OF_UE_MAX_NB_IoT]; SCHEDULING_REQUEST_CONFIG_NB_IoT scheduling_request_config[NUMBER_OF_UE_MAX_NB_IoT];
// Transmission mode per UE // Transmission mode per UE
uint8_t transmission_mode[NUMBER_OF_UE_MAX_NB_IoT]; uint8_t transmission_mode[NUMBER_OF_UE_MAX_NB_IoT];
...@@ -635,7 +636,7 @@ typedef struct PHY_VARS_eNB_NB_IoT_s { ...@@ -635,7 +636,7 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
uint32_t rb_mask_ul[4]; uint32_t rb_mask_ul[4];
/// Information regarding TM5 /// Information regarding TM5
MU_MIMO_mode mu_mimo_mode[NUMBER_OF_UE_MAX_NB_IoT]; MU_MIMO_mode_NB_IoT mu_mimo_mode[NUMBER_OF_UE_MAX_NB_IoT];
/// target_ue_dl_mcs : only for debug purposes /// target_ue_dl_mcs : only for debug purposes
...@@ -666,41 +667,41 @@ typedef struct PHY_VARS_eNB_NB_IoT_s { ...@@ -666,41 +667,41 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
int hw_timing_advance; int hw_timing_advance;
time_stats_t phy_proc; time_stats_t_NB_IoT phy_proc;
time_stats_t phy_proc_tx; time_stats_t_NB_IoT phy_proc_tx;
time_stats_t phy_proc_rx; time_stats_t_NB_IoT phy_proc_rx;
time_stats_t rx_prach; time_stats_t_NB_IoT rx_prach;
time_stats_t ofdm_mod_stats; time_stats_t_NB_IoT ofdm_mod_stats;
time_stats_t dlsch_encoding_stats; time_stats_t_NB_IoT dlsch_encoding_stats;
time_stats_t dlsch_modulation_stats; time_stats_t_NB_IoT dlsch_modulation_stats;
time_stats_t dlsch_scrambling_stats; time_stats_t_NB_IoT dlsch_scrambling_stats;
time_stats_t dlsch_rate_matching_stats; time_stats_t_NB_IoT dlsch_rate_matching_stats;
time_stats_t dlsch_turbo_encoding_stats; time_stats_t_NB_IoT dlsch_turbo_encoding_stats;
time_stats_t dlsch_interleaving_stats; time_stats_t_NB_IoT dlsch_interleaving_stats;
time_stats_t ofdm_demod_stats; time_stats_t_NB_IoT ofdm_demod_stats;
time_stats_t rx_dft_stats; time_stats_t_NB_IoT rx_dft_stats;
time_stats_t ulsch_channel_estimation_stats; time_stats_t_NB_IoT ulsch_channel_estimation_stats;
time_stats_t ulsch_freq_offset_estimation_stats; time_stats_t_NB_IoT ulsch_freq_offset_estimation_stats;
time_stats_t ulsch_decoding_stats; time_stats_t_NB_IoT ulsch_decoding_stats;
time_stats_t ulsch_demodulation_stats; time_stats_t_NB_IoT ulsch_demodulation_stats;
time_stats_t ulsch_rate_unmatching_stats; time_stats_t_NB_IoT ulsch_rate_unmatching_stats;
time_stats_t ulsch_turbo_decoding_stats; time_stats_t_NB_IoT ulsch_turbo_decoding_stats;
time_stats_t ulsch_deinterleaving_stats; time_stats_t_NB_IoT ulsch_deinterleaving_stats;
time_stats_t ulsch_demultiplexing_stats; time_stats_t_NB_IoT ulsch_demultiplexing_stats;
time_stats_t ulsch_llr_stats; time_stats_t_NB_IoT ulsch_llr_stats;
time_stats_t ulsch_tc_init_stats; time_stats_t_NB_IoT ulsch_tc_init_stats;
time_stats_t ulsch_tc_alpha_stats; time_stats_t_NB_IoT ulsch_tc_alpha_stats;
time_stats_t ulsch_tc_beta_stats; time_stats_t_NB_IoT ulsch_tc_beta_stats;
time_stats_t ulsch_tc_gamma_stats; time_stats_t_NB_IoT ulsch_tc_gamma_stats;
time_stats_t ulsch_tc_ext_stats; time_stats_t_NB_IoT ulsch_tc_ext_stats;
time_stats_t ulsch_tc_intl1_stats; time_stats_t_NB_IoT ulsch_tc_intl1_stats;
time_stats_t ulsch_tc_intl2_stats; time_stats_t_NB_IoT ulsch_tc_intl2_stats;
#ifdef LOCALIZATION #ifdef LOCALIZATION
/// time state for localization /// time state for localization
time_stats_t localization_stats; time_stats_t_NB_IoT localization_stats;
#endif #endif
int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX_NB_IoT][10]; int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX_NB_IoT][10];
...@@ -767,8 +768,8 @@ typedef struct PHY_VARS_eNB_NB_IoT_s { ...@@ -767,8 +768,8 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
} PHY_VARS_eNB_NB_IoT; } PHY_VARS_eNB_NB_IoT;
/*
#define debug_msg if (((mac_xface->frame%100) == 0) || (mac_xface->frame < 50)) msg //#define debug_msg if (((mac_xface->frame%100) == 0) || (mac_xface->frame < 50)) msg
/// Top-level PHY Data Structure for UE /// Top-level PHY Data Structure for UE
typedef struct { typedef struct {
...@@ -780,7 +781,7 @@ typedef struct { ...@@ -780,7 +781,7 @@ typedef struct {
openair0_rf_map rf_map; openair0_rf_map rf_map;
//uint8_t local_flag; //uint8_t local_flag;
/// \brief Indicator of current run mode of UE (normal_txrx, rx_calib_ue, no_L2_connect, debug_prach) /// \brief Indicator of current run mode of UE (normal_txrx, rx_calib_ue, no_L2_connect, debug_prach)
runmode_t mode; runmode_NB_IoT_t mode;
/// \brief Indicator that UE should perform band scanning /// \brief Indicator that UE should perform band scanning
int UE_scan; int UE_scan;
/// \brief Indicator that UE should perform coarse scanning around carrier /// \brief Indicator that UE should perform coarse scanning around carrier
...@@ -788,7 +789,7 @@ typedef struct { ...@@ -788,7 +789,7 @@ typedef struct {
/// \brief Indicator that UE is synchronized to an eNB /// \brief Indicator that UE is synchronized to an eNB
int is_synchronized; int is_synchronized;
/// Data structure for UE process scheduling /// Data structure for UE process scheduling
UE_proc_t proc; UE_proc_NB_IoT_t proc;
/// Flag to indicate the UE shouldn't do timing correction at all /// Flag to indicate the UE shouldn't do timing correction at all
int no_timing_correction; int no_timing_correction;
/// \brief Total gain of the TX chain (16-bit baseband I/Q to antenna) /// \brief Total gain of the TX chain (16-bit baseband I/Q to antenna)
...@@ -814,12 +815,12 @@ typedef struct { ...@@ -814,12 +815,12 @@ typedef struct {
/// \brief indicator that Handover procedure has been triggered /// \brief indicator that Handover procedure has been triggered
uint8_t ho_triggered; uint8_t ho_triggered;
/// \brief Measurement variables. /// \brief Measurement variables.
PHY_MEASUREMENTS measurements; PHY_MEASUREMENTS_NB_IoT measurements;
LTE_DL_FRAME_PARMS frame_parms; NB_IoT_DL_FRAME_PARMS frame_parms;
/// \brief Frame parame before ho used to recover if ho fails. /// \brief Frame parame before ho used to recover if ho fails.
LTE_DL_FRAME_PARMS frame_parms_before_ho; NB_IoT_DL_FRAME_PARMS frame_parms_before_ho;
LTE_UE_COMMON common_vars; NB_IoT_UE_COMMON common_vars;
/*
LTE_UE_PDSCH *pdsch_vars[2][NUMBER_OF_CONNECTED_eNB_MAX+1]; // two RxTx Threads LTE_UE_PDSCH *pdsch_vars[2][NUMBER_OF_CONNECTED_eNB_MAX+1]; // two RxTx Threads
LTE_UE_PDSCH_FLP *pdsch_vars_flp[NUMBER_OF_CONNECTED_eNB_MAX+1]; LTE_UE_PDSCH_FLP *pdsch_vars_flp[NUMBER_OF_CONNECTED_eNB_MAX+1];
LTE_UE_PDSCH *pdsch_vars_SI[NUMBER_OF_CONNECTED_eNB_MAX+1]; LTE_UE_PDSCH *pdsch_vars_SI[NUMBER_OF_CONNECTED_eNB_MAX+1];
...@@ -837,7 +838,7 @@ typedef struct { ...@@ -837,7 +838,7 @@ typedef struct {
LTE_UE_DLSCH_t *dlsch_MCH[NUMBER_OF_CONNECTED_eNB_MAX]; LTE_UE_DLSCH_t *dlsch_MCH[NUMBER_OF_CONNECTED_eNB_MAX];
// This is for SIC in the UE, to store the reencoded data // This is for SIC in the UE, to store the reencoded data
LTE_eNB_DLSCH_t *dlsch_eNB[NUMBER_OF_CONNECTED_eNB_MAX]; LTE_eNB_DLSCH_t *dlsch_eNB[NUMBER_OF_CONNECTED_eNB_MAX];
*/
//Paging parameters //Paging parameters
uint32_t IMSImod1024; uint32_t IMSImod1024;
uint32_t PF; uint32_t PF;
...@@ -848,7 +849,7 @@ typedef struct { ...@@ -848,7 +849,7 @@ typedef struct {
uint8_t pucch_sel[10]; uint8_t pucch_sel[10];
uint8_t pucch_payload[22]; uint8_t pucch_payload[22];
UE_MODE_t UE_mode[NUMBER_OF_CONNECTED_eNB_MAX]; //UE_MODE_t UE_mode[NUMBER_OF_CONNECTED_eNB_MAX];
/// cell-specific reference symbols /// cell-specific reference symbols
uint32_t lte_gold_table[7][20][2][14]; uint32_t lte_gold_table[7][20][2][14];
...@@ -868,11 +869,11 @@ typedef struct { ...@@ -868,11 +869,11 @@ typedef struct {
int16_t ch_est_alpha; int16_t ch_est_alpha;
int generate_ul_signal[NUMBER_OF_CONNECTED_eNB_MAX]; int generate_ul_signal[NUMBER_OF_CONNECTED_eNB_MAX];
UE_SCAN_INFO_t scan_info[NB_BANDS_MAX]; UE_SCAN_INFO_NB_IoT_t scan_info[NB_BANDS_MAX_NB_IoT];
char ulsch_no_allocation_counter[NUMBER_OF_CONNECTED_eNB_MAX]; char ulsch_no_allocation_counter[NUMBER_OF_CONNECTED_eNB_MAX];
/*
unsigned char ulsch_Msg3_active[NUMBER_OF_CONNECTED_eNB_MAX]; unsigned char ulsch_Msg3_active[NUMBER_OF_CONNECTED_eNB_MAX];
uint32_t ulsch_Msg3_frame[NUMBER_OF_CONNECTED_eNB_MAX]; uint32_t ulsch_Msg3_frame[NUMBER_OF_CONNECTED_eNB_MAX];
...@@ -931,7 +932,7 @@ typedef struct { ...@@ -931,7 +932,7 @@ typedef struct {
int **ul_precoder_S_UE; int **ul_precoder_S_UE;
/// holds the maximum channel/precoder coefficient /// holds the maximum channel/precoder coefficient
char log2_maxp; char log2_maxp;
*/
/// if ==0 enables phy only test mode /// if ==0 enables phy only test mode
int mac_enabled; int mac_enabled;
...@@ -951,7 +952,7 @@ typedef struct { ...@@ -951,7 +952,7 @@ typedef struct {
/// N0 (used for abstraction) /// N0 (used for abstraction)
double N0; double N0;
/*
/// PDSCH Varaibles /// PDSCH Varaibles
PDSCH_CONFIG_DEDICATED pdsch_config_dedicated[NUMBER_OF_CONNECTED_eNB_MAX]; PDSCH_CONFIG_DEDICATED pdsch_config_dedicated[NUMBER_OF_CONNECTED_eNB_MAX];
...@@ -1042,9 +1043,9 @@ typedef struct { ...@@ -1042,9 +1043,9 @@ typedef struct {
SLIST_HEAD(ral_thresholds_gen_poll_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX]; SLIST_HEAD(ral_thresholds_gen_poll_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX];
SLIST_HEAD(ral_thresholds_lte_poll_s, ral_threshold_phy_t) ral_thresholds_lte_polled[RAL_LINK_PARAM_LTE_MAX]; SLIST_HEAD(ral_thresholds_lte_poll_s, ral_threshold_phy_t) ral_thresholds_lte_polled[RAL_LINK_PARAM_LTE_MAX];
#endif #endif
} PHY_VARS_UE;
*/ */
} PHY_VARS_UE_NB_IoT;
/* /*
void exit_fun(const char* s); void exit_fun(const char* s);
...@@ -1119,8 +1120,8 @@ static inline int release_thread(pthread_mutex_t *mutex,int *instance_cnt,char * ...@@ -1119,8 +1120,8 @@ static inline int release_thread(pthread_mutex_t *mutex,int *instance_cnt,char *
//#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_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"
#endif #endif
#endif // __PHY_DEFS__H__ #endif // __PHY_DEFS__H__
...@@ -43,14 +43,14 @@ extern int number_of_cards_NB_IoT; ...@@ -43,14 +43,14 @@ 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;
#ifndef OCP_FRAMEWORK #ifndef OCP_FRAMEWORK
extern PHY_VARS_UE ***PHY_vars_UE_g; extern PHY_VARS_UE_NB_IoT ***PHY_vars_UE_NB_IoT_g;
extern PHY_VARS_eNB_NB_IoT ***PHY_vars_eNB_NB_IoT_g; extern PHY_VARS_eNB_NB_IoT ***PHY_vars_eNB_NB_IoT_g;
extern PHY_VARS_RN **PHY_vars_RN_g; extern PHY_VARS_RN_NB_IoT **PHY_vars_RN_NB_IoT_g;
extern NB_IoT_DL_FRAME_PARMS *nb_iot_frame_parms_g; extern NB_IoT_DL_FRAME_PARMS *nb_iot_frame_parms_g;
#else #else
#define MAX_UE 10 #define MAX_UE 10
#define MAX_eNB_NB_IoT 20 #define MAX_eNB_NB_IoT 20
extern PHY_VARS_UE * PHY_vars_UE_g[MAX_UE][MAX_NUM_CCs]; extern PHY_VARS_UE_NB_IoT * PHY_vars_UE_NB_IoT_g[MAX_UE][MAX_NUM_CCs];
extern PHY_VARS_eNB_NB_IoT * PHY_vars_eNB_NB_IoT_g[MAX_eNB_NB_IoT][MAX_NUM_CCs]; extern PHY_VARS_eNB_NB_IoT * PHY_vars_eNB_NB_IoT_g[MAX_eNB_NB_IoT][MAX_NUM_CCs];
#endif #endif
......
...@@ -50,6 +50,234 @@ typedef enum {EXTENDED_NB_IoT=1,NORMAL_NB_IoT=0} NB_IoT_prefix_type_t; ...@@ -50,6 +50,234 @@ typedef enum {EXTENDED_NB_IoT=1,NORMAL_NB_IoT=0} NB_IoT_prefix_type_t;
} }
/////////////////////////
/// Union for \ref TPC_PDCCH_CONFIG::tpc_Index.
typedef union {
/// Index of N when DCI format 3 is used. See TS 36.212 (5.3.3.1.6). \vr{[1..15]}
uint8_t indexOfFormat3;
/// Index of M when DCI format 3A is used. See TS 36.212 (5.3.3.1.7). \vr{[1..31]}
uint8_t indexOfFormat3A;
} TPC_INDEX_NB_IoT_t;
/// TPC-PDCCH-Config Information Element from 36.331 RRC spec
typedef struct {
/// RNTI for power control using DCI format 3/3A, see TS 36.212. \vr{[0..65535]}
uint16_t rnti;
/// Index of N or M, see TS 36.212 (5.3.3.1.6 and 5.3.3.1.7), where N or M is dependent on the used DCI format (i.e. format 3 or 3a).
TPC_INDEX_NB_IoT_t tpc_Index;
} TPC_PDCCH_CONFIG_NB_IoT;
/// Enumeration for parameter \f$N_\text{ANRep}\f$ \ref PUCCH_CONFIG_DEDICATED::repetitionFactor.
typedef enum {
//n2=0,
n4_n,
n6_n
} ACKNAKREP_NB_IoT_t;
/// Enumeration for \ref PUCCH_CONFIG_DEDICATED::tdd_AckNackFeedbackMode.
typedef enum {
bundling_N=0,
multiplexing_N
} ANFBmode_NB_IoT_t;
/// PUCCH-ConfigDedicated from 36.331 RRC spec
typedef struct {
/// Flag to indicate ACK NAK repetition activation, see TS 36.213 (10.1). \vr{[0..1]}
uint8_t ackNackRepetition;
/// Parameter: \f$N_\text{ANRep}\f$, see TS 36.213 (10.1).
ACKNAKREP_NB_IoT_t repetitionFactor;
/// Parameter: \f$n^{(1)}_\text{PUCCH,ANRep}\f$, see TS 36.213 (10.1). \vr{[0..2047]}
uint16_t n1PUCCH_AN_Rep;
/// Feedback mode, see TS 36.213 (7.3). \details Applied to both PUCCH and PUSCH feedback. For TDD, should always be set to bundling.
ANFBmode_NB_IoT_t tdd_AckNackFeedbackMode;
} PUCCH_CONFIG_DEDICATED_NB_IoT;
// UE specific PUSCH configuration.
typedef struct {
/// Parameter: \f$I^\text{HARQ-ACK}_\text{offset}\f$, see TS 36.213 (Table 8.6.3-1). \vr{[0..15]}
uint16_t betaOffset_ACK_Index;
/// Parameter: \f$I^{RI}_\text{offset}\f$, see TS 36.213 (Table 8.6.3-2). \vr{[0..15]}
uint16_t betaOffset_RI_Index;
/// Parameter: \f$I^{CQI}_\text{offset}\f$, see TS 36.213 (Table 8.6.3-3). \vr{[0..15]}
uint16_t betaOffset_CQI_Index;
} PUSCH_CONFIG_DEDICATED_NB_IoT;
/// Enumeration for Parameter \f$P_A\f$ \ref PDSCH_CONFIG_DEDICATED::p_a.
typedef enum {
//dBm6=0, ///< (dB-6) corresponds to -6 dB
// dBm477, ///< (dB-4dot77) corresponds to -4.77 dB
// dBm3, ///< (dB-3) corresponds to -3 dB
//dBm177, ///< (dB-1dot77) corresponds to -1.77 dB
//dB0, ///< corresponds to 0 dB
// dB1, ///< corresponds to 1 dB
dB2_NB, ///< corresponds to 2 dB
dB3_NB ///< corresponds to 3 dB
} PA_NB_IoT_t;
/// PDSCH-ConfigDedicated from 36.331 RRC spec
typedef struct {
/// Parameter: \f$P_A\f$, see TS 36.213 (5.2).
PA_NB_IoT_t p_a;
} PDSCH_CONFIG_DEDICATED_NB_IoT;
/// UplinkPowerControlDedicated Information Element from 36.331 RRC spec
typedef struct {
/// Parameter: \f$P_\text{0\_UE\_PUSCH}(1)\f$, see TS 36.213 (5.1.1.1), unit dB. \vr{[-8..7]}\n This field is applicable for non-persistent scheduling, only.
int8_t p0_UE_PUSCH;
/// Parameter: Ks, see TS 36.213 (5.1.1.1). \vr{[0..1]}\n en0 corresponds to value 0 corresponding to state “disabled”. en1 corresponds to value 1.25 corresponding to “enabled”. \note the specification sais it is an enumerated value. \warning the enumeration values do not correspond to the given values in the specification (en1 should be 1.25).
uint8_t deltaMCS_Enabled;
/// Parameter: Accumulation-enabled, see TS 36.213 (5.1.1.1). \vr{[0..1]} 1 corresponds to "enabled" whereas 0 corresponds to "disabled".
uint8_t accumulationEnabled;
/// Parameter: \f$P_\text{0\_UE\_PUCCH}(1)\f$, see TS 36.213 (5.1.2.1), unit dB. \vr{[-8..7]}
int8_t p0_UE_PUCCH;
/// Parameter: \f$P_\text{SRS\_OFFSET}\f$, see TS 36.213 (5.1.3.1). \vr{[0..15]}\n For Ks=1.25 (\ref deltaMCS_Enabled), the actual parameter value is pSRS_Offset value - 3. For Ks=0, the actual parameter value is -10.5 + 1.5*pSRS_Offset value.
int8_t pSRS_Offset;
/// Specifies the filtering coefficient for RSRP measurements used to calculate path loss, as specified in TS 36.213 (5.1.1.1).\details The same filtering mechanism applies as for quantityConfig described in 5.5.3.2. \note the specification sais it is an enumerated value.
uint8_t filterCoefficient;
} UL_POWER_CONTROL_DEDICATED_NB_IoT;
/// Union for \ref TPC_PDCCH_CONFIG::tpc_Index.
//typedef union {
/// Index of N when DCI format 3 is used. See TS 36.212 (5.3.3.1.6). \vr{[1..15]}
// uint8_t indexOfFormat3;
/// Index of M when DCI format 3A is used. See TS 36.212 (5.3.3.1.7). \vr{[1..31]}
// uint8_t indexOfFormat3A;
//} TPC_INDEX_NB_IoT_t;
/// CQI-ReportPeriodic
typedef struct {
/// Parameter: \f$n^{(2)}_\text{PUCCH}\f$, see TS 36.213 (7.2). \vr{[0..1185]}, -1 indicates inactivity
int16_t cqi_PUCCH_ResourceIndex;
/// Parameter: CQI/PMI Periodicity and Offset Configuration Index \f$I_\text{CQI/PMI}\f$, see TS 36.213 (tables 7.2.2-1A and 7.2.2-1C). \vr{[0..1023]}
int16_t cqi_PMI_ConfigIndex;
/// Parameter: K, see 36.213 (4.2.2). \vr{[1..4]}
uint8_t K;
/// Parameter: RI Config Index \f$I_\text{RI}\f$, see TS 36.213 (7.2.2-1B). \vr{[0..1023]}, -1 indicates inactivity
int16_t ri_ConfigIndex;
/// Parameter: Simultaneous-AN-and-CQI, see TS 36.213 (10.1). \vr{[0..1]} 1 indicates that simultaneous transmission of ACK/NACK and CQI is allowed.
uint8_t simultaneousAckNackAndCQI;
/// parameter computed from Tables 7.2.2-1A and 7.2.2-1C
uint16_t Npd;
/// parameter computed from Tables 7.2.2-1A and 7.2.2-1C
uint16_t N_OFFSET_CQI;
} CQI_REPORTPERIODIC_NB_IoT;
/// Enumeration for parameter reporting mode \ref CQI_REPORT_CONFIG::cqi_ReportModeAperiodic.
typedef enum {
//rm12=0,
//rm20=1,
//rm22=2,
rm30_N=3,
rm31_N=4
} CQI_REPORTMODEAPERIODIC_NB_IoT;
/// CQI-ReportConfig Information Element from 36.331 RRC spec
typedef struct {
/// Parameter: reporting mode. Value rm12 corresponds to Mode 1-2, rm20 corresponds to Mode 2-0, rm22 corresponds to Mode 2-2 etc. PUSCH reporting modes are described in TS 36.213 [23, 7.2.1].
CQI_REPORTMODEAPERIODIC_NB_IoT cqi_ReportModeAperiodic;
/// Parameter: \f$\Delta_\text{offset}\f$, see TS 36.213 (7.2.3). \vr{[-1..6]}\n Actual value = IE value * 2 [dB].
int8_t nomPDSCH_RS_EPRE_Offset;
CQI_REPORTPERIODIC_NB_IoT CQI_ReportPeriodic;
} CQI_REPORT_CONFIG_NB_IoT;
/// SoundingRS-UL-ConfigDedicated Information Element from 36.331 RRC spec
typedef struct {
/// Parameter: \f$B_\text{SRS}\f$, see TS 36.211 (table 5.5.3.2-1, 5.5.3.2-2, 5.5.3.2-3 and 5.5.3.2-4). \vr{[0..3]} \note the specification sais it is an enumerated value.
uint8_t srs_Bandwidth;
/// Parameter: SRS hopping bandwidth \f$b_\text{hop}\in\{0,1,2,3\}\f$, see TS 36.211 (5.5.3.2) \vr{[0..3]} \note the specification sais it is an enumerated value.
uint8_t srs_HoppingBandwidth;
/// Parameter: \f$n_\text{RRC}\f$, see TS 36.211 (5.5.3.2). \vr{[0..23]}
uint8_t freqDomainPosition;
/// Parameter: Duration, see TS 36.213 (8.2). \vr{[0..1]} 0 corresponds to "single" and 1 to "indefinite".
uint8_t duration;
/// Parameter: \f$k_\text{TC}\in\{0,1\}\f$, see TS 36.211 (5.5.3.2). \vr{[0..1]}
uint8_t transmissionComb;
/// Parameter: \f$I_\text{SRS}\f$, see TS 36.213 (table 8.2-1). \vr{[0..1023]}
uint16_t srs_ConfigIndex;
/// Parameter: \f$n^\text{CS}_\text{SRS}\f$. See TS 36.211 (5.5.3.1). \vr{[0..7]} \note the specification sais it is an enumerated value.
uint8_t cyclicShift;
// Parameter: internal implementation: UE SRS configured
uint8_t srsConfigDedicatedSetup;
// Parameter: cell srs subframe for internal implementation
uint8_t srsCellSubframe;
// Parameter: ue srs subframe for internal implementation
uint8_t srsUeSubframe;
} SOUNDINGRS_UL_CONFIG_DEDICATED_NB_IoT;
/// Enumeration for parameter SR transmission \ref SCHEDULING_REQUEST_CONFIG::dsr_TransMax.
typedef enum {
//sr_n4=0,
// sr_n8=1,
// sr_n16=2,
sr_n32_N=3,
sr_n64_N=4
} DSR_TRANSMAX_NB_IoT_t;
/// SchedulingRequestConfig Information Element from 36.331 RRC spec
typedef struct {
/// Parameter: \f$n^{(1)}_\text{PUCCH,SRI}\f$, see TS 36.213 (10.1). \vr{[0..2047]}
uint16_t sr_PUCCH_ResourceIndex;
/// Parameter: \f$I_\text{SR}\f$, see TS 36.213 (10.1). \vr{[0..155]}
uint8_t sr_ConfigIndex;
/// Parameter for SR transmission in TS 36.321 (5.4.4). \details The value n4 corresponds to 4 transmissions, n8 corresponds to 8 transmissions and so on.
DSR_TRANSMAX_NB_IoT_t dsr_TransMax;
} SCHEDULING_REQUEST_CONFIG_NB_IoT;
typedef struct {
/// Downlink Power offset field
uint8_t dl_pow_off;
///Subband resource allocation field
uint8_t rballoc_sub[50];
///Total number of PRBs indicator
uint8_t pre_nb_available_rbs;
} MU_MIMO_mode_NB_IoT;
////////////////////////
typedef struct {
/// \brief Holds the received data in the frequency domain.
/// - first index: rx antenna [0..nb_antennas_rx[
/// - second index: symbol [0..28*ofdm_symbol_size[
int32_t **rxdataF;
/// \brief Hold the channel estimates in frequency domain.
/// - first index: eNB id [0..6] (hard coded)
/// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
/// - third index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[
int32_t **dl_ch_estimates[7];
/// \brief Hold the channel estimates in time domain (used for tracking).
/// - first index: eNB id [0..6] (hard coded)
/// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
/// - third index: samples? [0..2*ofdm_symbol_size[
int32_t **dl_ch_estimates_time[7];
}NB_IoT_UE_COMMON_PER_THREAD;
typedef struct {
/// \brief Holds the transmit data in time domain.
/// For IFFT_FPGA this points to the same memory as PHY_vars->tx_vars[a].TX_DMA_BUFFER.
/// - first index: tx antenna [0..nb_antennas_tx[
/// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES[
int32_t **txdata;
/// \brief Holds the transmit data in the frequency domain.
/// For IFFT_FPGA this points to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
/// - first index: tx antenna [0..nb_antennas_tx[
/// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX[
int32_t **txdataF;
/// \brief Holds the received data in time domain.
/// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
/// - first index: rx antenna [0..nb_antennas_rx[
/// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES+2048[
int32_t **rxdata;
NB_IoT_UE_COMMON_PER_THREAD common_vars_rx_data_per_thread[2];
/// holds output of the sync correlator
int32_t *sync_corr;
/// estimated frequency offset (in radians) for all subcarriers
int32_t freq_offset;
/// eNb_id user is synched to
int32_t eNb_id;
} NB_IoT_UE_COMMON;
/// NPRACH-ParametersList-NB-r13 from 36.331 RRC spec /// NPRACH-ParametersList-NB-r13 from 36.331 RRC spec
typedef struct NPRACH_Parameters_NB_IoT{ typedef struct NPRACH_Parameters_NB_IoT{
/// the period time for nprach /// the period time for nprach
......
...@@ -281,8 +281,9 @@ typedef enum { ...@@ -281,8 +281,9 @@ typedef enum {
} Extension_t; } Extension_t;
/// Measurement Variables /// Measurement Variables
*/
#define NUMBER_OF_SUBBANDS_MAX 13 #define NUMBER_OF_SUBBANDS_MAX_NB_IoT 13
/*
#define NUMBER_OF_HARQ_PID_MAX 8 #define NUMBER_OF_HARQ_PID_MAX 8
#define MAX_FRAME_NUMBER 0x400 #define MAX_FRAME_NUMBER 0x400
...@@ -384,6 +385,101 @@ typedef struct { ...@@ -384,6 +385,101 @@ typedef struct {
} PHY_MEASUREMENTS; } PHY_MEASUREMENTS;
*/ */
typedef enum {no_relay_NB_IoT=1,unicast_relay_type1_NB_IoT,unicast_relay_type2_NB_IoT, multicast_relay_NB_IoT} relaying_type_t_NB_IoT;
typedef struct {
//unsigned int rx_power[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //! estimated received signal power (linear)
//unsigned short rx_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //! estimated received signal power (dB)
//unsigned short rx_avg_power_dB[NUMBER_OF_CONNECTED_eNB_MAX]; //! estimated avg received signal power (dB)
// RRC measurements
uint32_t rssi;
int n_adj_cells;
unsigned int adj_cell_id[6];
uint32_t rsrq[7];
uint32_t rsrp[7];
float rsrp_filtered[7]; // after layer 3 filtering
float rsrq_filtered[7];
// common measurements
//! estimated noise power (linear)
unsigned int n0_power[NB_ANTENNAS_RX];
//! estimated noise power (dB)
unsigned short n0_power_dB[NB_ANTENNAS_RX];
//! total estimated noise power (linear)
unsigned int n0_power_tot;
//! total estimated noise power (dB)
unsigned short n0_power_tot_dB;
//! average estimated noise power (linear)
unsigned int n0_power_avg;
//! average estimated noise power (dB)
unsigned short n0_power_avg_dB;
//! total estimated noise power (dBm)
short n0_power_tot_dBm;
// UE measurements
//! estimated received spatial signal power (linear)
int rx_spatial_power[NUMBER_OF_CONNECTED_eNB_MAX][2][2];
//! estimated received spatial signal power (dB)
unsigned short rx_spatial_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][2][2];
/// estimated received signal power (sum over all TX antennas)
//int wideband_cqi[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
int rx_power[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
/// estimated received signal power (sum over all TX antennas)
//int wideband_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
unsigned short rx_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
/// estimated received signal power (sum over all TX/RX antennas)
int rx_power_tot[NUMBER_OF_CONNECTED_eNB_MAX]; //NEW
/// estimated received signal power (sum over all TX/RX antennas)
unsigned short rx_power_tot_dB[NUMBER_OF_CONNECTED_eNB_MAX]; //NEW
//! estimated received signal power (sum of all TX/RX antennas, time average)
int rx_power_avg[NUMBER_OF_CONNECTED_eNB_MAX];
//! estimated received signal power (sum of all TX/RX antennas, time average, in dB)
unsigned short rx_power_avg_dB[NUMBER_OF_CONNECTED_eNB_MAX];
/// SINR (sum of all TX/RX antennas, in dB)
int wideband_cqi_tot[NUMBER_OF_CONNECTED_eNB_MAX];
/// SINR (sum of all TX/RX antennas, time average, in dB)
int wideband_cqi_avg[NUMBER_OF_CONNECTED_eNB_MAX];
//! estimated rssi (dBm)
short rx_rssi_dBm[NUMBER_OF_CONNECTED_eNB_MAX];
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
int rx_correlation[NUMBER_OF_CONNECTED_eNB_MAX][2];
//! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation)
int rx_correlation_dB[NUMBER_OF_CONNECTED_eNB_MAX][2];
/// Wideband CQI (sum of all RX antennas, in dB, for precoded transmission modes (3,4,5,6), up to 4 spatial streams)
int precoded_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX+1][4];
/// Subband CQI per RX antenna (= SINR)
int subband_cqi[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX][NUMBER_OF_SUBBANDS_MAX_NB_IoT];
/// Total Subband CQI (= SINR)
int subband_cqi_tot[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX_NB_IoT];
/// Subband CQI in dB (= SINR dB)
int subband_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX][NUMBER_OF_SUBBANDS_MAX_NB_IoT];
/// Total Subband CQI
int subband_cqi_tot_dB[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX_NB_IoT];
/// Wideband PMI for each RX antenna
int wideband_pmi_re[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
/// Wideband PMI for each RX antenna
int wideband_pmi_im[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
///Subband PMI for each RX antenna
int subband_pmi_re[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX_NB_IoT][NB_ANTENNAS_RX];
///Subband PMI for each RX antenna
int subband_pmi_im[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX_NB_IoT][NB_ANTENNAS_RX];
/// chosen RX antennas (1=Rx antenna 1, 2=Rx antenna 2, 3=both Rx antennas)
unsigned char selected_rx_antennas[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX_NB_IoT];
/// Wideband Rank indication
unsigned char rank[NUMBER_OF_CONNECTED_eNB_MAX];
/// Number of RX Antennas
unsigned char nb_antennas_rx;
/// DLSCH error counter
// short dlsch_errors;
} PHY_MEASUREMENTS_NB_IoT;
typedef struct { typedef struct {
//unsigned int rx_power[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //! estimated received signal power (linear) //unsigned int rx_power[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //! estimated received signal power (linear)
//unsigned short rx_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //! estimated received signal power (dB) //unsigned short rx_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //! estimated received signal power (dB)
......
...@@ -48,12 +48,12 @@ int16_t *primary_synch2_time; ...@@ -48,12 +48,12 @@ int16_t *primary_synch2_time;
//PHY_VARS *PHY_vars; //PHY_VARS *PHY_vars;
#ifndef OCP_FRAMEWORK #ifndef OCP_FRAMEWORK
PHY_VARS_UE ***PHY_vars_UE_g; PHY_VARS_UE_NB_IoT ***PHY_vars_UE_NB_IoT_g;
PHY_VARS_eNB_NB_IoT ***PHY_vars_eNB_NB_IoT_g; PHY_VARS_eNB_NB_IoT ***PHY_vars_eNB_NB_IoT_g;
PHY_VARS_RN **PHY_vars_RN_g; PHY_VARS_RN_NB_IoT **PHY_vars_RN_NB_IoT_g;
LTE_DL_FRAME_PARMS *lte_frame_parms_g; LTE_DL_FRAME_PARMS *lte_frame_parms_g;
#else #else
PHY_VARS_UE * PHY_vars_UE_g[MAX_UE][MAX_NUM_CCs]={NULL}; PHY_VARS_UE_NB_IoT * PHY_vars_UE_NB_IoT_g[MAX_UE][MAX_NUM_CCs]={NULL};
PHY_vars_eNB_NB_IoT * PHY_vars_eNB_NB_IoT_g[MAX_eNB_NB_IoT][MAX_NUM_CCs]={NULL}; PHY_vars_eNB_NB_IoT * PHY_vars_eNB_NB_IoT_g[MAX_eNB_NB_IoT][MAX_NUM_CCs]={NULL};
#endif #endif
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "PHY/defs_nb_iot.h" #include "PHY/defs_nb_iot.h"
//#include "PHY/extern.h" //#include "PHY/extern.h"
#include "PHY/extern_NB_IoT.h" #include "PHY/extern_NB_IoT.h"
#include "PHY/vars.h" //#include "PHY/vars.h"
#include "PHY/vars_NB_IoT.h" #include "PHY/vars_NB_IoT.h"
#include "PHY/INIT/defs_nb_iot.h" #include "PHY/INIT/defs_nb_iot.h"
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
//#include "PHY/defs.h" //#include "PHY/defs.h"
#include "PHY/defs_nb_iot.h" #include "PHY/defs_nb_iot.h"
#include "PHY/extern_NB_IoT.h" //where we get the global Sched_Rsp_t structure filled #include "PHY/extern_NB_IoT.h" //where we get the global Sched_Rsp_t structure filled
#include "SCHED/defs.h" //#include "SCHED/defs.h"
#include "SCHED/extern.h" #include "SCHED/extern.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h" #include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h" #include "PHY/LTE_TRANSPORT/if5_tools.h"
...@@ -814,7 +814,7 @@ void npdsch_procedures(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -814,7 +814,7 @@ void npdsch_procedures(PHY_VARS_eNB_NB_IoT *eNB,
} }
start_meas(&eNB->dlsch_encoding_stats); //start_meas_NB_IoT(&eNB->dlsch_encoding_stats);
LOG_I(PHY, "NB-IoT Encoding step\n"); LOG_I(PHY, "NB-IoT Encoding step\n");
...@@ -828,12 +828,12 @@ void npdsch_procedures(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -828,12 +828,12 @@ void npdsch_procedures(PHY_VARS_eNB_NB_IoT *eNB,
// &eNB->dlsch_interleaving_stats); // &eNB->dlsch_interleaving_stats);
stop_meas(&eNB->dlsch_encoding_stats); // stop_meas_NB_IoT(&eNB->dlsch_encoding_stats);
// 36-211 // 36-211
//scrambling------------------------------------------- //scrambling-------------------------------------------
start_meas(&eNB->dlsch_scrambling_stats); // start_meas_NB_IoT(&eNB->dlsch_scrambling_stats);
LOG_I(PHY, "NB-IoT Scrambling step\n"); LOG_I(PHY, "NB-IoT Scrambling step\n");
/* /*
...@@ -856,11 +856,11 @@ void npdsch_procedures(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -856,11 +856,11 @@ void npdsch_procedures(PHY_VARS_eNB_NB_IoT *eNB,
// 0, // 0,
// subframe<<1); // subframe<<1);
stop_meas(&eNB->dlsch_scrambling_stats); //stop_meas_NB_IoT(&eNB->dlsch_scrambling_stats);
//modulation------------------------------------------- //modulation-------------------------------------------
start_meas(&eNB->dlsch_modulation_stats); //start_meas_NB_IoT(&eNB->dlsch_modulation_stats);
LOG_I(PHY, "NB-IoT Modulation step\n"); LOG_I(PHY, "NB-IoT Modulation step\n");
// dlsch_modulation(eNB, // dlsch_modulation(eNB,
...@@ -871,17 +871,17 @@ void npdsch_procedures(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -871,17 +871,17 @@ void npdsch_procedures(PHY_VARS_eNB_NB_IoT *eNB,
// dlsch, // dlsch,
// dlsch1); // dlsch1);
stop_meas(&eNB->dlsch_modulation_stats); //stop_meas_NB_IoT(&eNB->dlsch_modulation_stats);
} }
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
else { else {
start_meas(&eNB->dlsch_encoding_stats); //start_meas_NB_IoT(&eNB->dlsch_encoding_stats);
//dlsch_encoding_emul(eNB, //dlsch_encoding_emul(eNB,
//DLSCH_pdu, //DLSCH_pdu,
//dlsch); //dlsch);
stop_meas(&eNB->dlsch_encoding_stats); // stop_meas_NB_IoT(&eNB->dlsch_encoding_stats);
} }
#endif #endif
...@@ -952,7 +952,7 @@ void phy_procedures_eNB_TX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -952,7 +952,7 @@ void phy_procedures_eNB_TX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
if(do_meas == 1) if(do_meas == 1)
start_meas(&eNB->phy_proc_tx); //start_meas_NB_IoT(&eNB->phy_proc_tx);
/*the original scheduler "eNB_dlsch_ulsch_scheduler" now is no more done here but is triggered directly from UL_Indication (IF-Module Function)*/ /*the original scheduler "eNB_dlsch_ulsch_scheduler" now is no more done here but is triggered directly from UL_Indication (IF-Module Function)*/
......
...@@ -86,6 +86,7 @@ int16_t get_hundred_times_delta_IF_eNB_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,uint8_t U ...@@ -86,6 +86,7 @@ int16_t get_hundred_times_delta_IF_eNB_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,uint8_t U
} else { } else {
return(0); return(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