Commit 007b003d authored by Raymond Knopp's avatar Raymond Knopp

dlsim functional after develop->enhancement-ltem

parent d24f521a
...@@ -872,9 +872,6 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, ...@@ -872,9 +872,6 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
pusch_vars[UE_id]->llr = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); pusch_vars[UE_id]->llr = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
} //UE_id } //UE_id
pusch_vars[UE_id]->llr = (int16_t *) malloc16_clear ((8 * ((3 * 8 * 6144) + 12)) * sizeof (int16_t));
} //UE_id
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++)
eNB->UE_stats_ptr[UE_id] = &eNB->UE_stats[UE_id]; eNB->UE_stats_ptr[UE_id] = &eNB->UE_stats[UE_id];
......
...@@ -118,24 +118,6 @@ uint8_t *generate_dci0(uint8_t *dci, ...@@ -118,24 +118,6 @@ uint8_t *generate_dci0(uint8_t *dci,
uint8_t dci_flip[8]; uint8_t dci_flip[8];
AssertFatal((aggregation_level==1) ||
(aggregation_level==2) ||
(aggregation_level==4) ||
(aggregation_level==8)
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) // Added for EPDCCH/MPDCCH
||
(aggregation_level==16) ||
(aggregation_level==24) ||
(aggregation_level==32)
#endif
,
"generate_dci FATAL, illegal aggregation_level %d\n",aggregation_level);
coded_bits = 72 * aggregation_level;
#ifdef DEBUG_DCI_ENCODING #ifdef DEBUG_DCI_ENCODING
for (int i=0;i<1+((DCI_LENGTH+16)/8);i++) for (int i=0;i<1+((DCI_LENGTH+16)/8);i++)
printf("i %d : %x\n",i,dci[i]); printf("i %d : %x\n",i,dci[i]);
......
...@@ -42,31 +42,6 @@ ...@@ -42,31 +42,6 @@
//#define DEBUG_HARQ //#define DEBUG_HARQ
void conv_eMTC_rballoc (uint16_t resource_block_coding, uint32_t N_RB_DL, uint32_t * rb_alloc)
{
int RIV = resource_block_coding&31;
int narrowband = resource_block_coding>>5;
int N_NB_DL = N_RB_DL / 6;
int i0 = (N_RB_DL >> 1) - (3 * N_NB_DL);
int first_rb = (6 * narrowband) + i0;
int alloc = localRIV2alloc_LUT6[RIV];
int ind = first_rb >> 5;
int ind_mod = first_rb & 31;
AssertFatal(RIV<32,"RIV is %d > 31\n");
if (((N_RB_DL & 1) > 0) && (narrowband >= (N_NB_DL >> 1)))
first_rb++;
rb_alloc[0] = 0;
rb_alloc[1] = 0;
rb_alloc[2] = 0;
rb_alloc[3] = 0;
rb_alloc[ind] = alloc << ind_mod;
if (ind_mod > 26)
rb_alloc[ind + 1] = alloc >> (6 - (ind_mod - 26));
}
#include "LAYER2/MAC/mac.h" #include "LAYER2/MAC/mac.h"
...@@ -1572,11 +1547,9 @@ fill_mdci_and_dlsch (PHY_VARS_eNB * eNB, eNB_rxtx_proc_t * proc, mDCI_ALLOC_t * ...@@ -1572,11 +1547,9 @@ fill_mdci_and_dlsch (PHY_VARS_eNB * eNB, eNB_rxtx_proc_t * proc, mDCI_ALLOC_t *
dlsch0_harq = dlsch0->harq_processes[rel13->harq_process]; dlsch0_harq = dlsch0->harq_processes[rel13->harq_process];
dci_alloc->ra_flag = 0; dci_alloc->ra_flag = 0;
dlsch0->ra_flag = 0;
if (rel13->rnti_type == 2) { if (rel13->rnti_type == 2) {
dci_alloc->ra_flag = 1; dci_alloc->ra_flag = 1;
dlsch0->ra_flag = 1;
} }
AssertFatal (fp->frame_type == FDD, "TDD is not supported yet for eMTC\n"); AssertFatal (fp->frame_type == FDD, "TDD is not supported yet for eMTC\n");
...@@ -1804,8 +1777,8 @@ fill_mdci_and_dlsch (PHY_VARS_eNB * eNB, eNB_rxtx_proc_t * proc, mDCI_ALLOC_t * ...@@ -1804,8 +1777,8 @@ fill_mdci_and_dlsch (PHY_VARS_eNB * eNB, eNB_rxtx_proc_t * proc, mDCI_ALLOC_t *
dlsch0_harq->frame = (subframe >= 8) ? ((frame + 1) & 1023) : frame; dlsch0_harq->frame = (subframe >= 8) ? ((frame + 1) & 1023) : frame;
dlsch0_harq->subframe = (subframe + 2) % 10; dlsch0_harq->subframe = (subframe + 2) % 10;
LOG_I(PHY,"Setting DLSCH harq_ids[%d] to %d\n",dlsch0_harq->subframe,dlsch0->harq_ids[dlsch0_harq->subframe]); LOG_I(PHY,"Setting DLSCH harq_ids[%d] to %d\n",dlsch0_harq->subframe,dlsch0->harq_ids[frame%2][dlsch0_harq->subframe]);
dlsch0->harq_ids[dlsch0_harq->subframe] = rel13->harq_process; dlsch0->harq_ids[frame%2][dlsch0_harq->subframe] = rel13->harq_process;
dlsch0_harq->pdsch_start = rel13->start_symbol; dlsch0_harq->pdsch_start = rel13->start_symbol;
LOG_I(PHY,"Setting DLSCH harq %d round %d to active for %d.%d\n",rel13->harq_process,dlsch0_harq->round,dlsch0_harq->frame,dlsch0_harq->subframe); LOG_I(PHY,"Setting DLSCH harq %d round %d to active for %d.%d\n",rel13->harq_process,dlsch0_harq->round,dlsch0_harq->frame,dlsch0_harq->subframe);
...@@ -1994,7 +1967,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, ...@@ -1994,7 +1967,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,
} }
#ifdef Rel14 #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
int get_narrowband_index(int N_RB_UL,int rb) { int get_narrowband_index(int N_RB_UL,int rb) {
switch (N_RB_UL) { switch (N_RB_UL) {
...@@ -2028,8 +2001,16 @@ void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu ...@@ -2028,8 +2001,16 @@ void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu
//AssertFatal((UE_id=find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, //AssertFatal((UE_id=find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0,
// "No existing/free UE ULSCH for rnti %x\n",ulsch_pdu->ulsch_pdu_rel8.rnti); // "No existing/free UE ULSCH for rnti %x\n",ulsch_pdu->ulsch_pdu_rel8.rnti);
LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id];
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
int use_srs = 0;
harq_pid = ulsch_pdu->ulsch_pdu_rel8.harq_process_number;
ulsch->harq_mask |= 1 << harq_pid;
#ifdef Rel14 #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
ulsch->ue_type = ulsch_pdu->ulsch_pdu_rel13.ue_type; ulsch->ue_type = ulsch_pdu->ulsch_pdu_rel13.ue_type;
AssertFatal(harq_pid ==0, "Harq PID is not zero for BL/CE UE\n"); AssertFatal(harq_pid ==0, "Harq PID is not zero for BL/CE UE\n");
...@@ -2171,7 +2152,7 @@ fill_mpdcch_dci0 (PHY_VARS_eNB * eNB, eNB_rxtx_proc_t * proc, mDCI_ALLOC_t * dci ...@@ -2171,7 +2152,7 @@ fill_mpdcch_dci0 (PHY_VARS_eNB * eNB, eNB_rxtx_proc_t * proc, mDCI_ALLOC_t * dci
T_INT (mcs), T_INT (-1 /* TODO: remove round? */ ), T_INT (mcs), T_INT (-1 /* TODO: remove round? */ ),
T_INT (rel13->resource_block_start), T_INT (rel13->resource_block_start),
T_INT (rel13->number_of_resource_blocks), T_INT (rel13->number_of_resource_blocks),
T_INT (get_TBS_UL (mcs, rel13->number_of_resource_blocks) * 8), T_INT (rel13->aggregation_level), T_INT (rel13->cce_index)); T_INT (get_TBS_UL (mcs, rel13->number_of_resource_blocks) * 8), T_INT (rel13->aggreagation_level), T_INT (rel13->ecce_index));
#endif #endif
void *dci_pdu = (void *) dci_alloc->dci_pdu; void *dci_pdu = (void *) dci_alloc->dci_pdu;
......
...@@ -283,29 +283,33 @@ uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int sub ...@@ -283,29 +283,33 @@ uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int sub
} }
void conv_eMTC_rballoc(uint16_t resource_block_coding, void conv_eMTC_rballoc (uint16_t resource_block_coding, uint32_t N_RB_DL, uint32_t * rb_alloc)
uint32_t N_RB_DL, {
uint32_t *rb_alloc) {
int RIV = resource_block_coding&31;
int narrowband = resource_block_coding>>5; int narrowband = resource_block_coding>>5;
int RIV = resource_block_coding&31; int N_NB_DL = N_RB_DL / 6;
int N_NB_DL = N_RB_DL/6; int i0 = (N_RB_DL >> 1) - (3 * N_NB_DL);
int i0 = (N_RB_DL>>1) - (3*N_NB_DL); int first_rb = (6 * narrowband) + i0;
int first_rb = (6*narrowband)+i0; int alloc = localRIV2alloc_LUT6[RIV];
int alloc = localRIV2alloc_LUT6[RIV]; int ind = first_rb >> 5;
int ind = first_rb>>5; int ind_mod = first_rb & 31;
int ind_mod = first_rb&31;
AssertFatal(RIV<32,"RIV is %d > 31\n");
if (((N_RB_DL&1) > 0) && (narrowband>=(N_NB_DL>>1))) first_rb++;
rb_alloc[0] = 0; if (((N_RB_DL & 1) > 0) && (narrowband >= (N_NB_DL >> 1)))
rb_alloc[1] = 0; first_rb++;
rb_alloc[2] = 0; rb_alloc[0] = 0;
rb_alloc[3] = 0; rb_alloc[1] = 0;
rb_alloc[ind] = alloc<<ind_mod; rb_alloc[2] = 0;
if (ind_mod > 26) rb_alloc[ind+1] = alloc>>(6-(ind_mod-26)); rb_alloc[3] = 0;
rb_alloc[ind] = alloc << ind_mod;
if (ind_mod > 26)
rb_alloc[ind + 1] = alloc >> (6 - (ind_mod - 26));
} }
void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t *rb_alloc2) void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t *rb_alloc2)
{ {
......
...@@ -34,15 +34,15 @@ ...@@ -34,15 +34,15 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "PHY/defs.h" #include "PHY/defs_eNB.h"
#include "PHY/extern.h" #include "PHY/phy_extern.h"
#include "SCHED/defs.h" #include "SCHED/sched_eNB.h"
#include "SIMULATION/TOOLS/defs.h" // for taus #include "SIMULATION/TOOLS/sim.h" // for taus
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
#include "assertions.h" #include "assertions.h"
#include "T.h" #include "T.h"
#include "UTIL/LOG/log.h" #include "common/utils/LOG/log.h"
//#define DEBUG_DCI_ENCODING 1 //#define DEBUG_DCI_ENCODING 1
//#define DEBUG_DCI_DECODING 1 //#define DEBUG_DCI_DECODING 1
......
...@@ -127,7 +127,7 @@ typedef struct { ...@@ -127,7 +127,7 @@ typedef struct {
/// codeword this transport block is mapped to /// codeword this transport block is mapped to
uint8_t codeword; uint8_t codeword;
#ifdef PHY_TX_THREAD #ifdef PHY_TX_THREAD
#ifdef Rel14 #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
/// indicator that this DLSCH corresponds to SIB1-BR, needed for c_init for scrambling /// indicator that this DLSCH corresponds to SIB1-BR, needed for c_init for scrambling
uint8_t sib1_br_flag; uint8_t sib1_br_flag;
/// initial absolute subframe (see 36.211 Section 6.3.1), needed for c_init for scrambling /// initial absolute subframe (see 36.211 Section 6.3.1), needed for c_init for scrambling
...@@ -444,6 +444,10 @@ typedef struct { ...@@ -444,6 +444,10 @@ typedef struct {
} LTE_eNB_UE_stats; } LTE_eNB_UE_stats;
typedef struct { typedef struct {
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
/// UE type (normal, CEModeA, CEModeB)
uint8_t ue_type;
#endif
/// HARQ process mask, indicates which processes are currently active /// HARQ process mask, indicates which processes are currently active
uint16_t harq_mask; uint16_t harq_mask;
/// Pointers to 8 HARQ processes for the ULSCH /// Pointers to 8 HARQ processes for the ULSCH
......
...@@ -204,7 +204,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr ...@@ -204,7 +204,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr
// compute DL power control parameters // compute DL power control parameters
eNB->pdsch_config_dedicated[UE_id].p_a = rel8->pa; eNB->pdsch_config_dedicated[UE_id].p_a = rel8->pa;
#ifdef PHY_TX_THREAD #ifdef PHY_TX_THREAD
if (dlsch0->active[proc->subframe_tx]){ if (dlsch0->active[proc->subframe_tx]){
# else # else
if (dlsch0->active){ if (dlsch0->active){
...@@ -254,7 +254,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr ...@@ -254,7 +254,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr
#endif #endif
if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR
UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_FREE); UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE);
AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n"); AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n");
AssertFatal(UE_id<NUMBER_OF_UE_MAX,"returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX); AssertFatal(UE_id<NUMBER_OF_UE_MAX,"returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX);
...@@ -272,7 +272,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr ...@@ -272,7 +272,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr
dlsch0->i0 = rel13->initial_transmission_sf_io; dlsch0->i0 = rel13->initial_transmission_sf_io;
dlsch0_harq->pdsch_start = rel10->pdsch_start; dlsch0_harq->pdsch_start = rel10->pdsch_start;
dlsch0->harq_ids[proc->subframe_tx] = 0; dlsch0->harq_ids[frame%2][proc->subframe_tx] = 0;
dlsch0_harq->frame = proc->frame_tx; dlsch0_harq->frame = proc->frame_tx;
dlsch0_harq->subframe = proc->subframe_tx; dlsch0_harq->subframe = proc->subframe_tx;
...@@ -361,7 +361,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr ...@@ -361,7 +361,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr
#endif #endif
dlsch0->active = 1; dlsch0->active = 1;
harq_pid = dlsch0->harq_ids[proc->subframe_tx]; harq_pid = dlsch0->harq_ids[frame%2][proc->subframe_tx];
dlsch0->harq_mask |= (1<<harq_pid); dlsch0->harq_mask |= (1<<harq_pid);
AssertFatal((harq_pid>=0) && (harq_pid<8),"subframe %d: harq_pid %d not in 0...7\n",proc->subframe_tx,harq_pid); AssertFatal((harq_pid>=0) && (harq_pid<8),"subframe %d: harq_pid %d not in 0...7\n",proc->subframe_tx,harq_pid);
...@@ -370,15 +370,15 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr ...@@ -370,15 +370,15 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr
AssertFatal(dlsch0_harq!=NULL,"dlsch_harq is null\n"); AssertFatal(dlsch0_harq!=NULL,"dlsch_harq is null\n");
// compute DL power control parameters // compute DL power control parameters
eNB->pdsch_config_dedicated[UE_id].p_a = rel8->pa;
if (dlsch0->active){ if (dlsch0->active){
computeRhoA_eNB(&eNB->pdsch_config_dedicated[UE_id], dlsch0,dlsch0_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB); computeRhoA_eNB(rel8->pa,dlsch0,dlsch0_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB);
computeRhoB_eNB(&eNB->pdsch_config_dedicated[UE_id],&(eNB->frame_parms.pdsch_config_common),eNB->frame_parms.nb_antenna_ports_eNB,dlsch0,dlsch0_harq->dl_power_off); computeRhoB_eNB(rel8->pa,eNB->frame_parms.pdsch_config_common.p_b,eNB->frame_parms.nb_antenna_ports_eNB,dlsch0,dlsch0_harq->dl_power_off);
} }
if (dlsch1->active){ if (dlsch1->active){
computeRhoA_eNB(&eNB->pdsch_config_dedicated[UE_id], dlsch1,dlsch1_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB); computeRhoA_eNB(rel8->pa, dlsch1,dlsch1_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB);
computeRhoB_eNB(&eNB->pdsch_config_dedicated[UE_id],&(eNB->frame_parms.pdsch_config_common),eNB->frame_parms.nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off); computeRhoB_eNB(rel8->pa,eNB->frame_parms.pdsch_config_common.p_b,eNB->frame_parms.nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off);
} }
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
......
...@@ -417,7 +417,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -417,7 +417,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
int16_t UE_id=0; int16_t UE_id=0;
uint8_t num_pdcch_symbols=0; uint8_t num_pdcch_symbols=0;
uint8_t num_dci=0; uint8_t num_dci=0;
#ifdef Rel14 #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
uint8_t num_mdci = 0; uint8_t num_mdci = 0;
#endif #endif
uint8_t ul_subframe; uint8_t ul_subframe;
...@@ -468,8 +468,8 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -468,8 +468,8 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
// (subframe_select(fp,ul_subframe)==SF_UL)) { // This means that there is a potential UL subframe that will be scheduled here // (subframe_select(fp,ul_subframe)==SF_UL)) { // This means that there is a potential UL subframe that will be scheduled here
if (ul_subframe < 10) { // This means that there is a potential UL subframe that will be scheduled here if (ul_subframe < 10) { // This means that there is a potential UL subframe that will be scheduled here
for (i=0; i<NUMBER_OF_UE_MAX; i++) { for (i=0; i<NUMBER_OF_UE_MAX; i++) {
#ifdef Rel14 #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (eNB->ulsch[i]->ue_type >0) harq_pid = 0; if (eNB->ulsch[i] && eNB->ulsch[i]->ue_type >0) harq_pid = 0;
else else
#endif #endif
harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe); harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe);
...@@ -526,7 +526,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -526,7 +526,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
eNB->common_vars.txdataF, eNB->common_vars.txdataF,
subframe); subframe);
#ifdef Rel14 #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
num_mdci = eNB->mpdcch_vars[subframe &1].num_dci; num_mdci = eNB->mpdcch_vars[subframe &1].num_dci;
if (num_mdci > 0) { if (num_mdci > 0) {
LOG_I (PHY, "[eNB %" PRIu8 "] Frame %d, subframe %d: Calling generate_mdci_top (mpdcch) (num_dci %" PRIu8 ")\n", eNB->Mod_id, frame, subframe, num_mdci); LOG_I (PHY, "[eNB %" PRIu8 "] Frame %d, subframe %d: Calling generate_mdci_top (mpdcch) (num_dci %" PRIu8 ")\n", eNB->Mod_id, frame, subframe, num_mdci);
...@@ -653,8 +653,6 @@ void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,u ...@@ -653,8 +653,6 @@ void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,u
int SNRtimes10 = dB_fixed_times10(stat) - 300;//(10*eNB->measurements.n0_power_dB[0]); int SNRtimes10 = dB_fixed_times10(stat) - 300;//(10*eNB->measurements.n0_power_dB[0]);
int SNRtimes10 = dB_fixed_times10 (stat) - 10 * max (eNB->measurements.n0_subband_power_tot_dB[0],
eNB->measurements.n0_subband_power_tot_dB[eNB->frame_parms.N_RB_UL - 1]);
pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG; pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
...@@ -841,7 +839,7 @@ void uci_procedures (PHY_VARS_eNB * eNB, eNB_rxtx_proc_t * proc) { ...@@ -841,7 +839,7 @@ void uci_procedures (PHY_VARS_eNB * eNB, eNB_rxtx_proc_t * proc) {
metric[0] = rx_pucch (eNB, pucch_format1b, i, uci->n_pucch_1_0_sr[0], 0, //n2_pucch metric[0] = rx_pucch (eNB, pucch_format1b, i, uci->n_pucch_1_0_sr[0], 0, //n2_pucch
uci->srs_active, // shortened format uci->srs_active, // shortened format
pucch_b0b1[0], frame, subframe, PUCCH1a_THRES pucch_b0b1[0], frame, subframe, PUCCH1a_THRES
#ifdef Rel14 #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,uci->ue_type ,uci->ue_type
#endif #endif
); );
...@@ -855,7 +853,7 @@ void uci_procedures (PHY_VARS_eNB * eNB, eNB_rxtx_proc_t * proc) { ...@@ -855,7 +853,7 @@ void uci_procedures (PHY_VARS_eNB * eNB, eNB_rxtx_proc_t * proc) {
metric[res] = rx_pucch (eNB, uci->pucch_fmt, i, uci->n_pucch_1[res][0], 0, // n2_pucch metric[res] = rx_pucch (eNB, uci->pucch_fmt, i, uci->n_pucch_1[res][0], 0, // n2_pucch
uci->srs_active, // shortened format uci->srs_active, // shortened format
pucch_b0b1[res], frame, subframe, PUCCH1a_THRES pucch_b0b1[res], frame, subframe, PUCCH1a_THRES
#ifdef Rel14 #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,uci->ue_type ,uci->ue_type
#endif #endif
); );
...@@ -870,7 +868,7 @@ void uci_procedures (PHY_VARS_eNB * eNB, eNB_rxtx_proc_t * proc) { ...@@ -870,7 +868,7 @@ void uci_procedures (PHY_VARS_eNB * eNB, eNB_rxtx_proc_t * proc) {
frame, frame,
subframe, subframe,
PUCCH1a_THRES, PUCCH1a_THRES,
#ifdef Rel14 #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,uci->ue_type ,uci->ue_type
#endif #endif
); );
...@@ -1473,7 +1471,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) { ...@@ -1473,7 +1471,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) {
uint32_t harq_pid; uint32_t harq_pid;
#ifdef Rel14 #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (eNB->ulsch[UE_id]->ue_type > 0) harq_pid = 0; if (eNB->ulsch[UE_id]->ue_type > 0) harq_pid = 0;
else else
#endif #endif
...@@ -1669,8 +1667,7 @@ int getM(PHY_VARS_eNB *eNB,int frame,int subframe) { ...@@ -1669,8 +1667,7 @@ int getM(PHY_VARS_eNB *eNB,int frame,int subframe) {
AssertFatal(dlsch0_harq!=NULL,"dlsch0_harq is null\n"); AssertFatal(dlsch0_harq!=NULL,"dlsch0_harq is null\n");
if (dlsch0_harq->status == ACTIVE|| if (dlsch0_harq->status == ACTIVE||
(dlsch1_harq!=NULL && dlsch1_harq->status == ACTIVE)) Mtx ++; (dlsch1_harq!=NULL && dlsch1_harq->status == ACTIVE)) Mtx ++;
>>>>>>> origin/develop }
}
} }
return (Mtx); return (Mtx);
} }
...@@ -1681,7 +1678,7 @@ void fill_ulsch_cqi_indication (PHY_VARS_eNB * eNB, uint16_t frame, uint8_t subf ...@@ -1681,7 +1678,7 @@ void fill_ulsch_cqi_indication (PHY_VARS_eNB * eNB, uint16_t frame, uint8_t subf
pthread_mutex_lock (&eNB->UL_INFO_mutex); pthread_mutex_lock (&eNB->UL_INFO_mutex);
nfapi_cqi_indication_pdu_t *pdu = &eNB->UL_INFO.cqi_ind.cqi_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis]; nfapi_cqi_indication_pdu_t *pdu = &eNB->UL_INFO.cqi_ind.cqi_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis];
nfapi_cqi_indication_raw_pdu_t *raw_pdu = &eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis]; nfapi_cqi_indication_raw_pdu_t *raw_pdu = &eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis];
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG; pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
pdu->rx_ue_information.rnti = rnti; pdu->rx_ue_information.rnti = rnti;
if (ulsch_harq->cqi_crc_status != 1) if (ulsch_harq->cqi_crc_status != 1)
...@@ -1709,8 +1706,8 @@ void fill_ulsch_cqi_indication (PHY_VARS_eNB * eNB, uint16_t frame, uint8_t subf ...@@ -1709,8 +1706,8 @@ void fill_ulsch_cqi_indication (PHY_VARS_eNB * eNB, uint16_t frame, uint8_t subf
LOG_D(PHY,"eNB->UL_INFO.cqi_ind.number_of_cqis:%d\n", eNB->UL_INFO.cqi_ind.number_of_cqis); LOG_D(PHY,"eNB->UL_INFO.cqi_ind.number_of_cqis:%d\n", eNB->UL_INFO.cqi_ind.number_of_cqis);
pthread_mutex_unlock(&eNB->UL_INFO_mutex); pthread_mutex_unlock(&eNB->UL_INFO_mutex);
} } }
void fill_ulsch_harq_indication (PHY_VARS_eNB * eNB, LTE_UL_eNB_HARQ_t * ulsch_harq, uint16_t rnti, int frame, int subframe, int bundling) { void fill_ulsch_harq_indication (PHY_VARS_eNB * eNB, LTE_UL_eNB_HARQ_t * ulsch_harq, uint16_t rnti, int frame, int subframe, int bundling) {
...@@ -1735,53 +1732,52 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB * eNB, LTE_UL_eNB_HARQ_t * ulsch_h ...@@ -1735,53 +1732,52 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB * eNB, LTE_UL_eNB_HARQ_t * ulsch_h
// pdu->rx_ue_information.handle = handle; // pdu->rx_ue_information.handle = handle;
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG; pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
pdu->rx_ue_information.rnti = rnti; pdu->rx_ue_information.rnti = rnti;
>>>>>>> origin/develop
if (eNB->frame_parms.frame_type == FDD) {
if (eNB->frame_parms.frame_type == FDD) { pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG;
pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG; pdu->harq_indication_fdd_rel13.mode = 0;
pdu->harq_indication_fdd_rel13.mode = 0; pdu->harq_indication_fdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK;
pdu->harq_indication_fdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK;
for (i = 0; i < ulsch_harq->O_ACK; i++) {
for (i = 0; i < ulsch_harq->O_ACK; i++) { AssertFatal (ulsch_harq->o_ACK[i] == 0 || ulsch_harq->o_ACK[i] == 1, "harq_ack[%d] is %d, should be 1,2 or 4\n", i, ulsch_harq->o_ACK[i]);
AssertFatal (ulsch_harq->o_ACK[i] == 0 || ulsch_harq->o_ACK[i] == 1, "harq_ack[%d] is %d, should be 1,2 or 4\n", i, ulsch_harq->o_ACK[i]);
pdu->harq_indication_fdd_rel13.harq_tb_n[i] = 2 - ulsch_harq->o_ACK[i];
pdu->harq_indication_fdd_rel13.harq_tb_n[i] = 2 - ulsch_harq->o_ACK[i]; // release DLSCH if needed
// release DLSCH if needed
release_harq(eNB,UE_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
release_harq(eNB,UE_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
}
} } else { // TDD
} else { // TDD M = ul_ACK_subframe2_M (&eNB->frame_parms, subframe);
M = ul_ACK_subframe2_M (&eNB->frame_parms, subframe);
pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; pdu->harq_indication_tdd_rel13.mode = 1-bundling;
pdu->harq_indication_tdd_rel13.mode = 1-bundling; pdu->harq_indication_tdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK;
pdu->harq_indication_tdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK;
for (i = 0; i < ulsch_harq->O_ACK; i++) {
for (i = 0; i < ulsch_harq->O_ACK; i++) { AssertFatal (ulsch_harq->o_ACK[i] == 0 || ulsch_harq->o_ACK[i] == 1, "harq_ack[%d] is %d, should be 1,2 or 4\n", i, ulsch_harq->o_ACK[i]);
AssertFatal (ulsch_harq->o_ACK[i] == 0 || ulsch_harq->o_ACK[i] == 1, "harq_ack[%d] is %d, should be 1,2 or 4\n", i, ulsch_harq->o_ACK[i]);
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 2-ulsch_harq->o_ACK[i];
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 2-ulsch_harq->o_ACK[i]; // release DLSCH if needed
// release DLSCH if needed /* TODO: review this code, it's most certainly wrong.
/* TODO: review this code, it's most certainly wrong. * We have to release the proper HARQ in case of ACK or NACK if max retransmission reached.
* We have to release the proper HARQ in case of ACK or NACK if max retransmission reached. * Basically, call release_harq with 1 as last argument when ACK and 0 when NACK.
* Basically, call release_harq with 1 as last argument when ACK and 0 when NACK. */
*/ release_harq(eNB,UE_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
release_harq(eNB,UE_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1); if (M==1 && ulsch_harq->O_ACK==1 && ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,0,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
if (M==1 && ulsch_harq->O_ACK==1 && ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,0,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1); else if (M==1 && ulsch_harq->O_ACK==2 && ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
else if (M==1 && ulsch_harq->O_ACK==2 && ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1); else if (M>1 && ulsch_harq->o_ACK[i] == 1) {
else if (M>1 && ulsch_harq->o_ACK[i] == 1) { // spatial bundling
// spatial bundling release_harq(eNB,UE_id,0,frame,subframe,1<<i, ulsch_harq->o_ACK[i] == 1);
release_harq(eNB,UE_id,0,frame,subframe,1<<i, ulsch_harq->o_ACK[i] == 1); release_harq(eNB,UE_id,1,frame,subframe,1<<i, ulsch_harq->o_ACK[i] == 1);
release_harq(eNB,UE_id,1,frame,subframe,1<<i, ulsch_harq->o_ACK[i] == 1); }
} }
} //LOG_E(PHY,"eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs:%d\n", eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs);
//LOG_E(PHY,"eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs:%d\n", eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs); eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs++;
eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs++;
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
}
}
} }
void fill_uci_harq_indication (PHY_VARS_eNB * eNB, LTE_eNB_UCI * uci, int frame, int subframe, uint8_t * harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask) { void fill_uci_harq_indication (PHY_VARS_eNB * eNB, LTE_eNB_UCI * uci, int frame, int subframe, uint8_t * harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask) {
......
...@@ -127,7 +127,7 @@ void prach_procedures(PHY_VARS_eNB *eNB ...@@ -127,7 +127,7 @@ void prach_procedures(PHY_VARS_eNB *eNB
prach_mask = is_prach_subframe (&eNB->frame_parms, eNB->proc.frame_prach_br, eNB->proc.subframe_prach_br); prach_mask = is_prach_subframe (&eNB->frame_parms, eNB->proc.frame_prach_br, eNB->proc.subframe_prach_br);
eNB->UL_INFO.rach_ind_br.preamble_list = eNB->preamble_list_br; eNB->UL_INFO.rach_ind_br.rach_indication_body.preamble_list = eNB->preamble_list_br;
int ind = 0; int ind = 0;
int ce_level = 0; int ce_level = 0;
/* Save for later, it doesn't work /* Save for later, it doesn't work
...@@ -142,7 +142,7 @@ void prach_procedures(PHY_VARS_eNB *eNB ...@@ -142,7 +142,7 @@ void prach_procedures(PHY_VARS_eNB *eNB
if (eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] == 1) { if (eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] == 1) {
if ((eNB->prach_energy_counter == 100) && (max_preamble_energy[0] > eNB->measurements.prach_I0 + 200)) { if ((eNB->prach_energy_counter == 100) && (max_preamble_energy[0] > eNB->measurements.prach_I0 + 200)) {
eNB->UL_INFO.rach_ind_br.number_of_preambles++; eNB->UL_INFO.rach_ind_br.rach_indication_body.number_of_preambles++;
eNB->preamble_list_br[ind].preamble_rel8.timing_advance = max_preamble_delay[ind]; // eNB->preamble_list_br[ind].preamble_rel8.timing_advance = max_preamble_delay[ind]; //
eNB->preamble_list_br[ind].preamble_rel8.preamble = max_preamble[ind]; eNB->preamble_list_br[ind].preamble_rel8.preamble = max_preamble[ind];
...@@ -157,6 +157,7 @@ void prach_procedures(PHY_VARS_eNB *eNB ...@@ -157,6 +157,7 @@ void prach_procedures(PHY_VARS_eNB *eNB
eNB->preamble_list_br[ind].preamble_rel8.timing_advance, eNB->preamble_list_br[ind].preamble_rel8.timing_advance,
eNB->preamble_list_br[ind].preamble_rel8.preamble, eNB->preamble_list_br[ind].preamble_rel8.rnti, eNB->preamble_list_br[ind].preamble_rel13.rach_resource_type); eNB->preamble_list_br[ind].preamble_rel8.preamble, eNB->preamble_list_br[ind].preamble_rel8.rnti, eNB->preamble_list_br[ind].preamble_rel13.rach_resource_type);
} }
}
/* /*
ind++; ind++;
} }
......
...@@ -305,68 +305,6 @@ typedef struct RrcConfigurationReq_s { ...@@ -305,68 +305,6 @@ typedef struct RrcConfigurationReq_s {
#endif #endif
long prach_root[MAX_NUM_CCs];
long prach_config_index[MAX_NUM_CCs];
BOOLEAN_t prach_high_speed[MAX_NUM_CCs];
long prach_zero_correlation[MAX_NUM_CCs];
long prach_freq_offset[MAX_NUM_CCs];
long pucch_delta_shift[MAX_NUM_CCs];
long pucch_nRB_CQI[MAX_NUM_CCs];
long pucch_nCS_AN[MAX_NUM_CCs];
//#if (RRC_VERSION < MAKE_VERSION(10, 0, 0))
long pucch_n1_AN[MAX_NUM_CCs];
//#endif
long pdsch_referenceSignalPower[MAX_NUM_CCs];
long pdsch_p_b[MAX_NUM_CCs];
long pusch_n_SB[MAX_NUM_CCs];
long pusch_hoppingMode[MAX_NUM_CCs];
long pusch_hoppingOffset[MAX_NUM_CCs];
BOOLEAN_t pusch_enable64QAM[MAX_NUM_CCs];
BOOLEAN_t pusch_groupHoppingEnabled[MAX_NUM_CCs];
long pusch_groupAssignment[MAX_NUM_CCs];
BOOLEAN_t pusch_sequenceHoppingEnabled[MAX_NUM_CCs];
long pusch_nDMRS1[MAX_NUM_CCs];
long phich_duration[MAX_NUM_CCs];
long phich_resource[MAX_NUM_CCs];
BOOLEAN_t srs_enable[MAX_NUM_CCs];
long srs_BandwidthConfig[MAX_NUM_CCs];
long srs_SubframeConfig[MAX_NUM_CCs];
BOOLEAN_t srs_ackNackST[MAX_NUM_CCs];
BOOLEAN_t srs_MaxUpPts[MAX_NUM_CCs];
long pusch_p0_Nominal[MAX_NUM_CCs];
long pusch_alpha[MAX_NUM_CCs];
long pucch_p0_Nominal[MAX_NUM_CCs];
long msg3_delta_Preamble[MAX_NUM_CCs];
long ul_CyclicPrefixLength[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format1 pucch_deltaF_Format1[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format1b pucch_deltaF_Format1b[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format2 pucch_deltaF_Format2[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format2a pucch_deltaF_Format2a[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format2b pucch_deltaF_Format2b[MAX_NUM_CCs];
long rach_numberOfRA_Preambles[MAX_NUM_CCs];
BOOLEAN_t rach_preamblesGroupAConfig[MAX_NUM_CCs];
long rach_sizeOfRA_PreamblesGroupA[MAX_NUM_CCs];
long rach_messageSizeGroupA[MAX_NUM_CCs];
e_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB rach_messagePowerOffsetGroupB[MAX_NUM_CCs];
long rach_powerRampingStep[MAX_NUM_CCs];
long rach_preambleInitialReceivedTargetPower[MAX_NUM_CCs];
long rach_preambleTransMax[MAX_NUM_CCs];
long rach_raResponseWindowSize[MAX_NUM_CCs];
long rach_macContentionResolutionTimer[MAX_NUM_CCs];
long rach_maxHARQ_Msg3Tx[MAX_NUM_CCs];
long bcch_modificationPeriodCoeff[MAX_NUM_CCs];
long pcch_defaultPagingCycle[MAX_NUM_CCs];
long pcch_nB[MAX_NUM_CCs];
long ue_TimersAndConstants_t300[MAX_NUM_CCs];
long ue_TimersAndConstants_t301[MAX_NUM_CCs];
long ue_TimersAndConstants_t310[MAX_NUM_CCs];
long ue_TimersAndConstants_t311[MAX_NUM_CCs];
long ue_TimersAndConstants_n310[MAX_NUM_CCs];
long ue_TimersAndConstants_n311[MAX_NUM_CCs];
long ue_TransmissionMode[MAX_NUM_CCs];
long ue_multiple_max[MAX_NUM_CCs];
//TTN - for D2D
//SIB18 //SIB18
e_SL_CP_Len_r12 rxPool_sc_CP_Len[MAX_NUM_CCs]; e_SL_CP_Len_r12 rxPool_sc_CP_Len[MAX_NUM_CCs];
e_SL_PeriodComm_r12 rxPool_sc_Period[MAX_NUM_CCs]; e_SL_PeriodComm_r12 rxPool_sc_Period[MAX_NUM_CCs];
......
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