From 65dcd0239a6a45d746bdfb7bd94fc9eaad80b161 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Fri, 22 Aug 2014 10:31:47 +0000 Subject: [PATCH] a few bugfixes, enb tx tested with 2 CCs git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5748 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- openair1/SCHED/phy_procedures_lte_eNb.c | 26 +++++++--- targets/RT/USER/lte-softmodem.c | 63 +++++++++++++------------ 2 files changed, 52 insertions(+), 37 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 74ad1b0286..24b06d047e 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -526,7 +526,10 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e switch (subframe) { case 5: DCI_pdu->Num_common_dci = 1; - DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_TDD_1_6_t; + if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) + DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_FDD_t; + else + DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_TDD_1_6_t; DCI_pdu->dci_alloc[0].L = 2; DCI_pdu->dci_alloc[0].rnti = SI_RNTI; DCI_pdu->dci_alloc[0].format = format1A; @@ -568,7 +571,11 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e if (transmission_mode<3) { //user 1 - DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_TDD_t; + if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) + DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_FDD_t; + else + DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_TDD_t; + DCI_pdu->dci_alloc[0].L = 2; DCI_pdu->dci_alloc[0].rnti = 0x1235; DCI_pdu->dci_alloc[0].format = format1; @@ -668,10 +675,13 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e break; */ case 9: - DCI_pdu->Num_ue_spec_dci = 2; + DCI_pdu->Num_ue_spec_dci = 1; //user 1 - DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ; + if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) + DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI0_5MHz_FDD_t ; + else + DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ; DCI_pdu->dci_alloc[0].L = 2; DCI_pdu->dci_alloc[0].rnti = 0x1235; DCI_pdu->dci_alloc[0].format = format0; @@ -688,6 +698,8 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e UL_alloc_pdu.cqi_req = 1; memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&UL_alloc_pdu,sizeof(DCI0_5MHz_TDD_1_6_t)); + // user 2 + /* DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ; DCI_pdu->dci_alloc[1].L = 2; DCI_pdu->dci_alloc[1].rnti = 0x1236; @@ -710,7 +722,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e UL_alloc_pdu.dai = 0; UL_alloc_pdu.cqi_req = 1; memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&UL_alloc_pdu,sizeof(DCI0_5MHz_TDD_1_6_t)); - + */ break; default: @@ -1374,9 +1386,9 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e */ #endif #ifdef EMOS_CHANNEL - fill_dci_emos(DCI_pdu,subframe,phy_vars_eNB); + fill_dci_emos(DCI_pdu,sched_subframe,phy_vars_eNB); #else - fill_dci(DCI_pdu,subframe,phy_vars_eNB); + fill_dci(DCI_pdu,sched_subframe,phy_vars_eNB); #endif #endif diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 40447ed4e3..21729cd529 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -234,11 +234,11 @@ static char *itti_dump_file = NULL; #endif #ifndef USRP -double tx_gain = 20; -double rx_gain = 10; +double tx_gain[4] = {20,10,0,0}; +double rx_gain[4] = {10,10,0,0}; #else -double tx_gain = 120; -double rx_gain = 50; +double tx_gain[4] = {120,0,0,0}; +double rx_gain[4] = {50,0,0,0}; #endif double sample_rate=30.72e6; @@ -803,7 +803,7 @@ static void * eNB_thread_tx(void *param) { #endif #ifdef RTAI - sprintf(task_name,"eNTX%d",proc->subframe); + sprintf(task_name,"TXC%dS%d",proc->CC_id,proc->subframe); task = rt_task_init_schmod(nam2num(task_name), 0, 0, 0, SCHED_FIFO, 0xF); if (task==NULL) { @@ -811,7 +811,8 @@ static void * eNB_thread_tx(void *param) { return 0; } else { - LOG_I(PHY,"[SCHED][eNB] eNB TX thread %d started with id %p\n", + LOG_I(PHY,"[SCHED][eNB] eNB TX thread CC %d SF %d started with id %p\n", + proc->CC_id, proc->subframe, task); } @@ -928,7 +929,7 @@ static void * eNB_thread_rx(void *param) { #endif #ifdef RTAI - sprintf(task_name,"eNRX%d",proc->subframe); + sprintf(task_name,"RXC%1dS%1d",proc->CC_id,proc->subframe); task = rt_task_init_schmod(nam2num(task_name), 0, 0, 0, SCHED_FIFO, 0xF); if (task==NULL) { @@ -936,7 +937,8 @@ static void * eNB_thread_rx(void *param) { return 0; } else { - LOG_I(PHY,"[SCHED][eNB] eNB RX thread %d started with id %p\n", /* on CPU %d*/ + LOG_I(PHY,"[SCHED][eNB] eNB RX thread CC_id %d SF %d started with id %p\n", /* on CPU %d*/ + proc->CC_id, proc->subframe, task); /*,rtai_cpuid()*/ } @@ -1101,11 +1103,11 @@ void kill_eNB_proc(void) { PHY_vars_eNB_g[0][CC_id]->proc[i].instance_cnt_tx=0; pthread_cond_signal(&PHY_vars_eNB_g[0][CC_id]->proc[i].cond_tx); #ifdef DEBUG_THREADS - printf("Joining eNB TX CC_id %d thread %d...",CC_id,i); + printf("Joining eNB TX CC_id %d thread %d...\n",CC_id,i); #endif pthread_join(PHY_vars_eNB_g[0][CC_id]->proc[i].pthread_tx,(void**)status_tx); #ifdef DEBUG_THREADS - if (status_tx) printf("status %d...",*status_tx); + if (status_tx) printf("status %d...\n",*status_tx); #endif #ifdef DEBUG_THREADS printf("Killing RX CC_id %d thread %d\n",CC_id,i); @@ -1113,11 +1115,11 @@ void kill_eNB_proc(void) { PHY_vars_eNB_g[0][CC_id]->proc[i].instance_cnt_rx=0; pthread_cond_signal(&PHY_vars_eNB_g[0][CC_id]->proc[i].cond_rx); #ifdef DEBUG_THREADS - printf("Joining eNB RX CC_id %d thread %d...",CC_id,i); + printf("Joining eNB RX CC_id %d thread %d...\n",CC_id,i); #endif pthread_join(PHY_vars_eNB_g[0][CC_id]->proc[i].pthread_rx,(void**)status_rx); #ifdef DEBUG_THREADS - if (status_rx) printf("status %d...",*status_rx); + if (status_rx) printf("status %d...\n",*status_rx); #endif pthread_mutex_destroy(&PHY_vars_eNB_g[0][CC_id]->proc[i].mutex_tx); pthread_mutex_destroy(&PHY_vars_eNB_g[0][CC_id]->proc[i].mutex_rx); @@ -1520,7 +1522,7 @@ static void *UE_thread(void *arg) { p_exmimo_config->rf.rf_freq_rx[i] = p_exmimo_config->rf.rf_freq_rx[i]+openair_daq_vars.freq_offset; p_exmimo_config->rf.rf_freq_tx[i] = p_exmimo_config->rf.rf_freq_rx[i]+openair_daq_vars.freq_offset; } - openair0_dump_config(card); + openair0_dump_config(0); } */ while (!oai_exit) { @@ -1611,7 +1613,7 @@ static void *UE_thread(void *arg) { hw_slot_offset = 0; slot = 0; - openair0_get_frame(card); + openair0_get_frame(0); // LOG_D(HW,"after get_frame\n"); // rt_sleep_ns(FRAME_PERIOD); // LOG_D(HW,"after sleep\n"); @@ -1637,7 +1639,7 @@ static void *UE_thread(void *arg) { is_synchronized = 1; //start the DMA transfers //LOG_D(HW,"Before openair0_start_rt_acquisition \n"); - openair0_start_rt_acquisition(card); + openair0_start_rt_acquisition(0); hw_slot_offset = (PHY_vars_UE_g[0][0]->rx_offset<<1) / PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti; LOG_D(HW,"Got synch: hw_slot_offset %d\n",hw_slot_offset); @@ -2113,11 +2115,10 @@ int main(int argc, char **argv) { frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 0; frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0; init_ul_hopping(frame_parms[CC_id]); - init_frame_parms(frame_parms[CC_id],1); + phy_init_top(frame_parms[CC_id]); } - phy_init_top(frame_parms[0]); phy_init_lte_top(frame_parms[0]); for (CC_id=0;CC_idCC_id = CC_id; #ifndef OPENAIR2 for (i=0;i