Commit 595db57a authored by hbilel's avatar hbilel

Merge branch 'ue-tdd_fix_issueOai1B_44' into develop_integration_w50

Conflicts:
	targets/RT/USER/lte-ue.c
parents 1b07582c 35ae311a
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "SCHED/extern.h" #include "SCHED/extern.h"
#include "LAYER2/MAC/defs.h" #include "LAYER2/MAC/defs.h"
#include "SCHED/defs.h" #include "SCHED/defs.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "assertions.h" #include "assertions.h"
...@@ -171,6 +172,8 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue, ...@@ -171,6 +172,8 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue,
unsigned char eNB_id ) unsigned char eNB_id )
{ {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_RAR,VCD_FUNCTION_IN);
// RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *)rar_pdu; // RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *)rar_pdu;
uint8_t transmission_mode = ue->transmission_mode[eNB_id]; uint8_t transmission_mode = ue->transmission_mode[eNB_id];
unsigned char *rar_pdu = ue->dlsch_ra[eNB_id]->harq_processes[0]->b; unsigned char *rar_pdu = ue->dlsch_ra[eNB_id]->harq_processes[0]->b;
...@@ -315,6 +318,9 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue, ...@@ -315,6 +318,9 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue,
msg("ulsch ra (UE): TPC %d\n",ulsch->harq_processes[harq_pid]->TPC); msg("ulsch ra (UE): TPC %d\n",ulsch->harq_processes[harq_pid]->TPC);
msg("ulsch ra (UE): O %d\n",ulsch->O); msg("ulsch ra (UE): O %d\n",ulsch->O);
msg("ulsch ra (UE): ORI %d\n",ulsch->O_RI); msg("ulsch ra (UE): ORI %d\n",ulsch->O_RI);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_RAR,VCD_FUNCTION_OUT);
//#endif //#endif
return(0); return(0);
} }
......
...@@ -942,6 +942,8 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc) { ...@@ -942,6 +942,8 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc) {
int dummy_tx_buffer[3840*4] __attribute__((aligned(16))); int dummy_tx_buffer[3840*4] __attribute__((aligned(16)));
#endif #endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_COMMON,VCD_FUNCTION_IN);
start_meas(&ue->ofdm_mod_stats); start_meas(&ue->ofdm_mod_stats);
nsymb = (frame_parms->Ncp == 0) ? 14 : 12; nsymb = (frame_parms->Ncp == 0) ? 14 : 12;
...@@ -1043,7 +1045,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc) { ...@@ -1043,7 +1045,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc) {
stop_meas(&ue->ofdm_mod_stats); stop_meas(&ue->ofdm_mod_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_COMMON,VCD_FUNCTION_OUT);
} }
...@@ -1054,6 +1056,8 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1054,6 +1056,8 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
int prach_power; int prach_power;
PRACH_RESOURCES_t prach_resources_local; PRACH_RESOURCES_t prach_resources_local;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PRACH, VCD_FUNCTION_IN);
ue->generate_prach=0; ue->generate_prach=0;
if (ue->mac_enabled==0){ if (ue->mac_enabled==0){
...@@ -1171,6 +1175,8 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1171,6 +1175,8 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
if (ue->prach_cnt==3) if (ue->prach_cnt==3)
ue->generate_prach=0; ue->generate_prach=0;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PRACH, VCD_FUNCTION_OUT);
} }
void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag) { void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag) {
...@@ -1190,6 +1196,8 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB ...@@ -1190,6 +1196,8 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
uint8_t ulsch_input_buffer[5477] __attribute__ ((aligned(32))); uint8_t ulsch_input_buffer[5477] __attribute__ ((aligned(32)));
uint8_t access_mode; uint8_t access_mode;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_UESPEC,VCD_FUNCTION_IN);
// get harq_pid from subframe relationship // get harq_pid from subframe relationship
harq_pid = subframe2harq_pid(&ue->frame_parms, harq_pid = subframe2harq_pid(&ue->frame_parms,
frame_tx, frame_tx,
...@@ -1218,8 +1226,8 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB ...@@ -1218,8 +1226,8 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
} else { } else {
if (harq_pid==255) { if (harq_pid==255) {
LOG_E(PHY,"[UE%d] Frame %d ulsch_decoding.c: FATAL ERROR: illegal harq_pid, returning\n", LOG_E(PHY,"[UE%d] Frame %d subframe %d ulsch_decoding.c: FATAL ERROR: illegal harq_pid, returning\n",
Mod_id,frame_tx); Mod_id,frame_tx, subframe_tx);
mac_xface->macphy_exit("Error in ulsch_decoding"); mac_xface->macphy_exit("Error in ulsch_decoding");
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT);
stop_meas(&ue->phy_proc_tx); stop_meas(&ue->phy_proc_tx);
...@@ -1456,6 +1464,9 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB ...@@ -1456,6 +1464,9 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
ue->sr[subframe_tx]=0; ue->sr[subframe_tx]=0;
} }
} // subframe_scheduling_flag==1 } // subframe_scheduling_flag==1
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_UESPEC,VCD_FUNCTION_OUT);
} }
void ue_srs_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag) void ue_srs_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag)
...@@ -1553,6 +1564,8 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1553,6 +1564,8 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
int tx_amp; int tx_amp;
int8_t Po_PUCCH; int8_t Po_PUCCH;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PUCCH,VCD_FUNCTION_IN);
SOUNDINGRS_UL_CONFIG_DEDICATED *pSoundingrs_ul_config_dedicated=&ue->soundingrs_ul_config_dedicated[eNB_id]; SOUNDINGRS_UL_CONFIG_DEDICATED *pSoundingrs_ul_config_dedicated=&ue->soundingrs_ul_config_dedicated[eNB_id];
// 36.213 8.2 // 36.213 8.2
...@@ -1743,6 +1756,8 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1743,6 +1756,8 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
} }
} // SR_Payload==1 } // SR_Payload==1
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PUCCH,VCD_FUNCTION_OUT);
// PUCCH 2x // PUCCH 2x
if (ue->generate_ul_signal[eNB_id] == 0) { // we have not generated ACK/NAK/SR in this subframe if (ue->generate_ul_signal[eNB_id] == 0) { // we have not generated ACK/NAK/SR in this subframe
......
...@@ -174,6 +174,8 @@ const char* eurecomVariablesNames[] = { ...@@ -174,6 +174,8 @@ const char* eurecomVariablesNames[] = {
"ue0_SFN5", "ue0_SFN5",
"ue0_SFN6", "ue0_SFN6",
"ue0_SFN7", "ue0_SFN7",
"ue0_trx_read_ns",
"ue0_trx_write_ns",
}; };
const char* eurecomFunctionsNames[] = { const char* eurecomFunctionsNames[] = {
...@@ -188,6 +190,17 @@ const char* eurecomFunctionsNames[] = { ...@@ -188,6 +190,17 @@ const char* eurecomFunctionsNames[] = {
"ue_thread_synch", "ue_thread_synch",
"ue_thread_rxtx0", "ue_thread_rxtx0",
"ue_thread_rxtx1", "ue_thread_rxtx1",
"trx_read_sf9",
"trx_write_sf9",
"ue_signal_cond_rxtx",
"ue_wait_cond_rxtx0",
"ue_wait_cond_rxtx1",
"ue_lock_mutex_rxtx_for_cond_wait0",
"ue_lock_mutex_rxtx_for_cond_wait1",
"ue_lock_mutex_rxtx_for_cnt_decrement0",
"ue_lock_mutex_rxtx_for_cnt_decrement1",
"ue_lock_mutex_rxtx_for_cnt_increment0",
"ue_lock_mutex_rxtx_for_cnt_increment1",
/* RRH signals */ /* RRH signals */
"eNB_tx", "eNB_tx",
...@@ -218,6 +231,11 @@ const char* eurecomFunctionsNames[] = { ...@@ -218,6 +231,11 @@ const char* eurecomFunctionsNames[] = {
"phy_eNB_slot_fep", "phy_eNB_slot_fep",
"phy_procedures_ue_tx", "phy_procedures_ue_tx",
"phy_procedures_ue_rx", "phy_procedures_ue_rx",
"phy_procedures_ue_tx_ulsch_uespec",
"phy_procedures_ue_tx_pucch",
"phy_procedures_ue_tx_ulsch_common",
"phy_procedures_ue_tx_prach",
"phy_procedures_ue_tx_ulsch_rar",
"phy_procedures_eNB_lte", "phy_procedures_eNB_lte",
"phy_procedures_UE_lte", "phy_procedures_UE_lte",
"pdsch_thread", "pdsch_thread",
......
...@@ -146,6 +146,8 @@ typedef enum { ...@@ -146,6 +146,8 @@ typedef enum {
VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN5, VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN5,
VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN6, VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN6,
VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN7, VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN7,
VCD_SIGNAL_DUMPER_VARIABLES_UE0_TRX_READ_NS,
VCD_SIGNAL_DUMPER_VARIABLES_UE0_TRX_WRITE_NS,
VCD_SIGNAL_DUMPER_VARIABLES_LAST, VCD_SIGNAL_DUMPER_VARIABLES_LAST,
VCD_SIGNAL_DUMPER_VARIABLES_END = VCD_SIGNAL_DUMPER_VARIABLES_LAST, VCD_SIGNAL_DUMPER_VARIABLES_END = VCD_SIGNAL_DUMPER_VARIABLES_LAST,
} vcd_signal_dump_variables; } vcd_signal_dump_variables;
...@@ -162,6 +164,17 @@ typedef enum { ...@@ -162,6 +164,17 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_SYNCH, VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_SYNCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_RXTX0, VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_RXTX0,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_RXTX1, VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_RXTX1,
VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_SF9,
VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_SF9,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SIGNAL_COND_RXTX,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_WAIT_COND_RXTX0,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_WAIT_COND_RXTX1,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_COND_WAIT0,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_COND_WAIT1,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_DECREMENT0,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_DECREMENT1,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT0,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT1,
/* RRH signals */ /* RRH signals */
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX, VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX,
...@@ -192,6 +205,11 @@ typedef enum { ...@@ -192,6 +205,11 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP, VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_UESPEC,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PUCCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_COMMON,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PRACH,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_RAR,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_LTE, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_LTE,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,
VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_THREAD, VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_THREAD,
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "EsmMessageContainer.h" #include "EsmMessageContainer.h"
#include "nas_log.h" #include "nas_log.h"
#define NAS_DEBUG 1 //#define NAS_DEBUG 1
int decode_esm_message_container(EsmMessageContainer *esmmessagecontainer, uint8_t iei, uint8_t *buffer, uint32_t len) int decode_esm_message_container(EsmMessageContainer *esmmessagecontainer, uint8_t iei, uint8_t *buffer, uint32_t len)
{ {
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "nas_log.h" #include "nas_log.h"
#ifndef NAS_DEBUG #ifndef NAS_DEBUG
# define NAS_DEBUG 1 //# define NAS_DEBUG 1
#endif #endif
#define DECODE_U8(bUFFER, vALUE, sIZE) \ #define DECODE_U8(bUFFER, vALUE, sIZE) \
......
...@@ -732,6 +732,7 @@ static void *UE_thread_rxn_txnp4(void *arg) ...@@ -732,6 +732,7 @@ static void *UE_thread_rxn_txnp4(void *arg)
printf("Starting UE RXN_TXNP4 thread (%s)\n", threadname); printf("Starting UE RXN_TXNP4 thread (%s)\n", threadname);
while (!oai_exit) { while (!oai_exit) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_COND_WAIT0+(proc->subframe_rx&1), 1 );
if (pthread_mutex_lock(&proc->mutex_rxtx) != 0) { if (pthread_mutex_lock(&proc->mutex_rxtx) != 0) {
LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" ); LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" );
exit_fun("nothing to add"); exit_fun("nothing to add");
...@@ -739,15 +740,18 @@ static void *UE_thread_rxn_txnp4(void *arg) ...@@ -739,15 +740,18 @@ static void *UE_thread_rxn_txnp4(void *arg)
} }
while (proc->instance_cnt_rxtx < 0) { while (proc->instance_cnt_rxtx < 0) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_WAIT_COND_RXTX0+(proc->subframe_rx&1), 1 );
// most of the time, the thread is waiting here // most of the time, the thread is waiting here
pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx ); pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx );
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_WAIT_COND_RXTX0+(proc->subframe_rx&1), 0 );
if (pthread_mutex_unlock(&proc->mutex_rxtx) != 0) { if (pthread_mutex_unlock(&proc->mutex_rxtx) != 0) {
LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE RXn_TXnp4\n" ); LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE RXn_TXnp4\n" );
exit_fun("nothing to add"); exit_fun("nothing to add");
return &UE_thread_rxtx_retval; return &UE_thread_rxtx_retval;
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_COND_WAIT0+(proc->subframe_rx&1), 0 );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_RXTX0+(proc->subframe_rx&1), 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_RXTX0+(proc->subframe_rx&1), 1 );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_UE+(proc->subframe_rx&1), proc->subframe_rx ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_UE+(proc->subframe_rx&1), proc->subframe_rx );
...@@ -804,17 +808,25 @@ static void *UE_thread_rxn_txnp4(void *arg) ...@@ -804,17 +808,25 @@ static void *UE_thread_rxn_txnp4(void *arg)
} }
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) || if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) ||
(UE->frame_parms.frame_type == FDD) || (UE->frame_parms.frame_type == FDD) ) {
(subframe_select( &UE->frame_parms, proc->subframe_tx ) == SF_S)) {
if (UE->mode != loop_through_memory) { if (UE->mode != loop_through_memory) {
phy_procedures_UE_TX(UE,proc,0,0,UE->mode,no_relay); phy_procedures_UE_TX(UE,proc,0,0,UE->mode,no_relay);
} }
} }
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_S) &&
(UE->frame_parms.frame_type == TDD)) {
if (UE->mode != loop_through_memory) {
phy_procedures_UE_S_TX(UE,0,0,no_relay);
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_RXTX0+(proc->subframe_rx&1), 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_RXTX0+(proc->subframe_rx&1), 0 );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_DECREMENT0+(proc->subframe_rx&1), 1 );
if (pthread_mutex_lock(&proc->mutex_rxtx) != 0) { if (pthread_mutex_lock(&proc->mutex_rxtx) != 0) {
LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" ); LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" );
exit_fun("noting to add"); exit_fun("noting to add");
...@@ -829,6 +841,7 @@ static void *UE_thread_rxn_txnp4(void *arg) ...@@ -829,6 +841,7 @@ static void *UE_thread_rxn_txnp4(void *arg)
exit_fun("noting to add"); exit_fun("noting to add");
return &UE_thread_rxtx_retval; return &UE_thread_rxtx_retval;
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_DECREMENT0+(proc->subframe_rx&1), 0 );
} }
// thread finished // thread finished
...@@ -951,10 +964,11 @@ void *UE_thread(void *arg) { ...@@ -951,10 +964,11 @@ void *UE_thread(void *arg) {
rxp, rxp,
UE->frame_parms.samples_per_tti*10, UE->frame_parms.samples_per_tti*10,
UE->frame_parms.nb_antennas_rx); UE->frame_parms.nb_antennas_rx);
if (rxs!=UE->frame_parms.samples_per_tti*10) { if (rxs!=UE->frame_parms.samples_per_tti*10) {
exit_fun("problem in rx"); LOG_E(PHY, "problem in rx 1! want #samples=%d but got only %d!\n", UE->frame_parms.samples_per_tti*10, rxs);
exit_fun("problem in rx 1");
return &UE_thread_retval; return &UE_thread_retval;
} }
} }
...@@ -987,7 +1001,8 @@ void *UE_thread(void *arg) { ...@@ -987,7 +1001,8 @@ void *UE_thread(void *arg) {
UE->frame_parms.nb_antennas_rx); UE->frame_parms.nb_antennas_rx);
if (rxs!=UE->frame_parms.samples_per_tti){ if (rxs!=UE->frame_parms.samples_per_tti){
exit_fun("problem in rx"); LOG_E(PHY, "problem in rx 2! want #samples=%d but got only %d!\n", UE->frame_parms.samples_per_tti, rxs);
exit_fun("problem in rx 2");
return &UE_thread_retval; return &UE_thread_retval;
} }
...@@ -1009,7 +1024,8 @@ void *UE_thread(void *arg) { ...@@ -1009,7 +1024,8 @@ void *UE_thread(void *arg) {
UE->rx_offset, UE->rx_offset,
UE->frame_parms.nb_antennas_rx); UE->frame_parms.nb_antennas_rx);
if (rxs != UE->rx_offset) { if (rxs != UE->rx_offset) {
exit_fun("problem in rx"); LOG_E(PHY, "problem in rx 3! want #samples=%d but got only %d!\n", UE->rx_offset, rxs);
exit_fun("problem in rx 3!");
return &UE_thread_retval; return &UE_thread_retval;
} }
} }
...@@ -1023,6 +1039,11 @@ void *UE_thread(void *arg) { ...@@ -1023,6 +1039,11 @@ void *UE_thread(void *arg) {
(void**)rxdata, (void**)rxdata,
UE->frame_parms.ofdm_symbol_size+UE->frame_parms.nb_prefix_samples0, UE->frame_parms.ofdm_symbol_size+UE->frame_parms.nb_prefix_samples0,
UE->frame_parms.nb_antennas_rx); UE->frame_parms.nb_antennas_rx);
if (rxs != (UE->frame_parms.ofdm_symbol_size+UE->frame_parms.nb_prefix_samples0)) {
LOG_E(PHY, "problem in rx 4! want #samples=%d but got only %d!\n", UE->frame_parms.ofdm_symbol_size+UE->frame_parms.nb_prefix_samples0, rxs);
exit_fun("problem in rx 4!");
return &UE_thread_retval;
}
slot_fep(UE, slot_fep(UE,
0, 0,
0, 0,
...@@ -1046,20 +1067,27 @@ void *UE_thread(void *arg) { ...@@ -1046,20 +1067,27 @@ void *UE_thread(void *arg) {
for (i=0; i<UE->frame_parms.nb_antennas_rx; i++) for (i=0; i<UE->frame_parms.nb_antennas_rx; i++)
rxp[i] = (void*)&rxdata[i][UE->frame_parms.ofdm_symbol_size+UE->frame_parms.nb_prefix_samples0+(sf*UE->frame_parms.samples_per_tti)]; rxp[i] = (void*)&rxdata[i][UE->frame_parms.ofdm_symbol_size+UE->frame_parms.nb_prefix_samples0+(sf*UE->frame_parms.samples_per_tti)];
// grab signal for subframe // grab signal for subframe
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
if (UE->mode != loop_through_memory) { if (UE->mode != loop_through_memory) {
if (sf<9) { if (sf<9) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
rxs = UE->rfdevice.trx_read_func(&UE->rfdevice, rxs = UE->rfdevice.trx_read_func(&UE->rfdevice,
&timestamp, &timestamp,
rxp, rxp,
UE->frame_parms.samples_per_tti, UE->frame_parms.samples_per_tti,
UE->frame_parms.nb_antennas_rx); UE->frame_parms.nb_antennas_rx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
// prepare tx buffer pointers VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_UE0_TRX_READ_NS, rxs );
if (rxs != UE->frame_parms.samples_per_tti) {
LOG_E(PHY, "problem in rx 5! want #samples=%d but got only %d!\n", UE->frame_parms.samples_per_tti, rxs);
exit_fun("problem in rx 5!");
return &UE_thread_retval;
}
// prepare tx buffer pointers
for (i=0; i<UE->frame_parms.nb_antennas_tx; i++) for (i=0; i<UE->frame_parms.nb_antennas_tx; i++)
txp[i] = (void*)&UE->common_vars.txdata[i][((sf+2)%10)*UE->frame_parms.samples_per_tti]; txp[i] = (void*)&UE->common_vars.txdata[i][((sf+2)%10)*UE->frame_parms.samples_per_tti];
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
txs = UE->rfdevice.trx_write_func(&UE->rfdevice, txs = UE->rfdevice.trx_write_func(&UE->rfdevice,
timestamp+ timestamp+
(2*UE->frame_parms.samples_per_tti) - (2*UE->frame_parms.samples_per_tti) -
...@@ -1069,27 +1097,34 @@ void *UE_thread(void *arg) { ...@@ -1069,27 +1097,34 @@ void *UE_thread(void *arg) {
UE->frame_parms.samples_per_tti, UE->frame_parms.samples_per_tti,
UE->frame_parms.nb_antennas_tx, UE->frame_parms.nb_antennas_tx,
1); 1);
if (txs != UE->frame_parms.samples_per_tti) {
LOG_E(PHY,"TX : Timeout (sent %d/%d)\n",txs, UE->frame_parms.samples_per_tti);
exit_fun( "problem transmitting samples" );
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_UE0_TRX_WRITE_NS, rxs );
if (txs != UE->frame_parms.samples_per_tti) {
LOG_E(PHY,"TX : Timeout (sent %d/%d)\n",txs, UE->frame_parms.samples_per_tti);
exit_fun( "problem transmitting samples" );
}
} }
else { else {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_SF9, 1 );
rxs = UE->rfdevice.trx_read_func(&UE->rfdevice, rxs = UE->rfdevice.trx_read_func(&UE->rfdevice,
&timestamp, &timestamp,
rxp, rxp,
UE->frame_parms.samples_per_tti-UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0, UE->frame_parms.samples_per_tti-UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0,
UE->frame_parms.nb_antennas_rx); UE->frame_parms.nb_antennas_rx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_SF9, 0 );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_UE0_TRX_READ_NS, rxs );
if (rxs != (UE->frame_parms.samples_per_tti-UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0)) {
LOG_E(PHY, "problem in rx 6! want #samples=%d but got only %d!\n", UE->frame_parms.samples_per_tti-UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0, rxs);
exit_fun("problem in rx 6!");
return &UE_thread_retval;
}
// prepare tx buffer pointers // prepare tx buffer pointers
for (i=0; i<UE->frame_parms.nb_antennas_tx; i++) for (i=0; i<UE->frame_parms.nb_antennas_tx; i++)
txp[i] = (void*)&UE->common_vars.txdata[i][((sf+2)%10)*UE->frame_parms.samples_per_tti]; txp[i] = (void*)&UE->common_vars.txdata[i][((sf+2)%10)*UE->frame_parms.samples_per_tti];
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_SF9, 1 );
txs = UE->rfdevice.trx_write_func(&UE->rfdevice, txs = UE->rfdevice.trx_write_func(&UE->rfdevice,
timestamp+ timestamp+
(2*UE->frame_parms.samples_per_tti) - (2*UE->frame_parms.samples_per_tti) -
...@@ -1099,25 +1134,34 @@ void *UE_thread(void *arg) { ...@@ -1099,25 +1134,34 @@ void *UE_thread(void *arg) {
UE->frame_parms.samples_per_tti - rx_off_diff, UE->frame_parms.samples_per_tti - rx_off_diff,
UE->frame_parms.nb_antennas_tx, UE->frame_parms.nb_antennas_tx,
1); 1);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_SF9, 0 );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_UE0_TRX_WRITE_NS, rxs );
if (txs != UE->frame_parms.samples_per_tti - rx_off_diff) { if (txs != UE->frame_parms.samples_per_tti - rx_off_diff) {
LOG_E(PHY,"TX : Timeout (sent %d/%d)\n",txs, UE->frame_parms.samples_per_tti-rx_off_diff); LOG_E(PHY,"TX : Timeout (sent %d/%d)\n",txs, UE->frame_parms.samples_per_tti-rx_off_diff);
exit_fun( "problem transmitting samples" ); exit_fun( "problem transmitting samples" );
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_SF9, 1 );
// read in first symbol of next frame and adjust for timing drift // read in first symbol of next frame and adjust for timing drift
rxs = UE->rfdevice.trx_read_func(&UE->rfdevice, rxs = UE->rfdevice.trx_read_func(&UE->rfdevice,
&timestamp1, &timestamp1,
(void**)rxdata, (void**)rxdata,
UE->frame_parms.ofdm_symbol_size+UE->frame_parms.nb_prefix_samples0 - rx_off_diff, UE->frame_parms.ofdm_symbol_size + UE->frame_parms.nb_prefix_samples0 - rx_off_diff,
UE->frame_parms.nb_antennas_rx); UE->frame_parms.nb_antennas_rx);
rx_off_diff = 0; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_SF9, 0 );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_UE0_TRX_READ_NS, rxs );
if (rxs != (UE->frame_parms.ofdm_symbol_size + UE->frame_parms.nb_prefix_samples0 - rx_off_diff)) {
LOG_E(PHY, "problem in rx 7! want #samples=%d but got only %d! rx_off_diff=%d\n", UE->frame_parms.ofdm_symbol_size+UE->frame_parms.nb_prefix_samples0 - rx_off_diff, rxs, rx_off_diff);
exit_fun("problem in rx 7!");
return &UE_thread_retval;
}
rx_off_diff = 0;
} }
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
// operate on thread sf mod 2 // operate on thread sf mod 2
UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[sf&1]; UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[sf&1];
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT0+(proc->subframe_rx&1), 1 );
// lock mutex // lock mutex
if (pthread_mutex_lock(&proc->mutex_rxtx) != 0) { if (pthread_mutex_lock(&proc->mutex_rxtx) != 0) {
LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RX\n" ); LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RX\n" );
...@@ -1147,15 +1191,20 @@ void *UE_thread(void *arg) { ...@@ -1147,15 +1191,20 @@ void *UE_thread(void *arg) {
exit_fun("nothing to add"); exit_fun("nothing to add");
return &UE_thread_retval; return &UE_thread_retval;
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT0+(proc->subframe_rx&1), 0 );
if (instance_cnt_rxtx == 0) { if (instance_cnt_rxtx == 0) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SIGNAL_COND_RXTX, 1 );
if (pthread_cond_signal(&proc->cond_rxtx) != 0) { if (pthread_cond_signal(&proc->cond_rxtx) != 0) {
LOG_E( PHY, "[SCHED][UE] ERROR pthread_cond_signal for UE RX thread\n" ); LOG_E( PHY, "[SCHED][UE] ERROR pthread_cond_signal for UE RX thread\n" );
exit_fun("nothing to add"); exit_fun("nothing to add");
return &UE_thread_retval; return &UE_thread_retval;
} }
LOG_D(PHY, "firing up rxtx_thread[%d] at subframe %d\n", sf&1, sf); LOG_D(PHY, "firing up rxtx_thread[%d] at subframe %d\n", sf&1, sf);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SIGNAL_COND_RXTX, 0 );
} else { } else {
LOG_E( PHY, "[SCHED][UE] UE RX thread busy (IC %d)!!\n", instance_cnt_rxtx); LOG_E( PHY, "[SCHED][UE] UE RX thread busy (IC %d)!!\n", instance_cnt_rxtx);
if (instance_cnt_rxtx > 2) { if (instance_cnt_rxtx > 2) {
......
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