Commit 5f30031d authored by Raymond Knopp's avatar Raymond Knopp

fixing merge conflict at slave RRU

parents 05ff7b9e cdb3f2af
...@@ -79,6 +79,14 @@ const char* eurecomVariablesNames[] = { ...@@ -79,6 +79,14 @@ const char* eurecomVariablesNames[] = {
"subframe_number_TX1_RU", "subframe_number_TX1_RU",
"subframe_number_RX0_RU", "subframe_number_RX0_RU",
"subframe_number_RX1_RU", "subframe_number_RX1_RU",
"subframe_number_if4p5_north_out",
"frame_number_if4p5_north_out",
"subframe_number_if4p5_north_asynch_in",
"frame_number_if4p5_north_asynch_in",
"subframe_number_if4p5_south_out",
"frame_number_if4p5_south_out",
"subframe_number_if4p5_south_in",
"frame_number_if4p5_south_in",
"runtime_TX_eNB", "runtime_TX_eNB",
"runtime_RX_eNB", "runtime_RX_eNB",
"frame_number_TX0_UE", "frame_number_TX0_UE",
......
...@@ -55,6 +55,14 @@ typedef enum { ...@@ -55,6 +55,14 @@ typedef enum {
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX1_RU, VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX1_RU,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU, VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX1_RU, VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX1_RU,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_NORTH_OUT,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_NORTH_OUT,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_NORTH_ASYNCH_IN,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_NORTH_ASYNCH_IN,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_OUT,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_OUT,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_IN,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_IN,
VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_TX_ENB, VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_TX_ENB,
VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_RX_ENB, VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_RX_ENB,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_UE, VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_UE,
......
...@@ -44,7 +44,7 @@ typedef struct { ...@@ -44,7 +44,7 @@ typedef struct {
#define VCD_NUM_FUNCTIONS (218) #define VCD_NUM_FUNCTIONS (218)
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */ /* number of VCD variables (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_VARIABLES (128) #define VCD_NUM_VARIABLES (136)/*(128)*/
/* first VCD function (to be kept up to date! see in T_messages.txt) */ /* first VCD function (to be kept up to date! see in T_messages.txt) */
#define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP) #define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP)
......
...@@ -1010,6 +1010,46 @@ ID = VCD_VARIABLE_SUBFRAME_NUMBER_RX1_RU ...@@ -1010,6 +1010,46 @@ ID = VCD_VARIABLE_SUBFRAME_NUMBER_RX1_RU
GROUP = ALL:VCD:ENB:VCD_VARIABLE GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value FORMAT = ulong,value
VCD_NAME = subframe_number_RX1_RU VCD_NAME = subframe_number_RX1_RU
ID = VCD_VARIABLE_SUBFRAME_NUMBER_IF4P5_NORTH_OUT
DESC = VCD variable SUBFRAME_NUMBER_IF4P5_NORTH_OUT
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_if4p5_north_out
ID = VCD_VARIABLE_FRAME_NUMBER_IF4P5_NORTH_OUT
DESC = VCD variable FRAME_NUMBER_IF4P5_NORTH_OUT
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_if4p5_north_out
ID = VCD_VARIABLE_SUBFRAME_NUMBER_IF4P5_NORTH_ASYNCH_IN
DESC = VCD variable SUBFRAME_NUMBER_IF4P5_NORTH_ASYNCH_IN
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_if4p5_north_asynch_in
ID = VCD_VARIABLE_FRAME_NUMBER_IF4P5_NORTH_ASYNCH_IN
DESC = VCD variable FRAME_NUMBER_IF4P5_NORTH_ASYNCH_IN
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_if4p5_north_asynch_in
ID = VCD_VARIABLE_SUBFRAME_NUMBER_IF4P5_SOUTH_OUT
DESC = VCD variable SUBFRAME_NUMBER_IF4P5_SOUTH_OUT
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_if4p5_south_out
ID = VCD_VARIABLE_FRAME_NUMBER_IF4P5_SOUTH_OUT
DESC = VCD variable FRAME_NUMBER_IF4P5_SOUTH_OUT
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_if4p5_south_out
ID = VCD_VARIABLE_SUBFRAME_NUMBER_IF4P5_SOUTH_IN
DESC = VCD variable SUBFRAME_NUMBER_IF4P5_SOUTH_IN
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_if4p5_south_in
ID = VCD_VARIABLE_FRAME_NUMBER_IF4P5_SOUTH_IN
DESC = VCD variable FRAME_NUMBER_IF4P5_SOUTH_IN
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_if4p5_south_in
ID = VCD_VARIABLE_RUNTIME_TX_ENB ID = VCD_VARIABLE_RUNTIME_TX_ENB
DESC = VCD variable RUNTIME_TX_ENB DESC = VCD variable RUNTIME_TX_ENB
GROUP = ALL:VCD:ENB:VCD_VARIABLE GROUP = ALL:VCD:ENB:VCD_VARIABLE
......
...@@ -477,13 +477,20 @@ LOG_M_END ...@@ -477,13 +477,20 @@ LOG_M_END
int ru_sync_time_init(RU_t *ru) // LTE_UE_COMMON *common_vars int ru_sync_time_init(RU_t *ru) // LTE_UE_COMMON *common_vars
{ {
/*
int16_t dmrs[2048]; int16_t dmrs[2048];
int16_t *dmrsp[2] = {dmrs,NULL}; int16_t *dmrsp[2] = {dmrs,NULL};
*/
int32_t dmrs[ru->frame_parms.ofdm_symbol_size*14] __attribute__((aligned(32)));
int32_t *dmrsp[2] = {&dmrs[(3-ru->frame_parms.Ncp)*ru->frame_parms.ofdm_symbol_size],NULL};
generate_ul_ref_sigs();
ru->dmrssync = (int16_t*)malloc16_clear(ru->frame_parms.N_RB_DL*2*sizeof(int16_t)); ru->dmrssync = (int16_t*)malloc16_clear(ru->frame_parms.N_RB_DL*2*sizeof(int16_t));
generate_drs_pusch(NULL,NULL, generate_drs_pusch(NULL,NULL,
&ru->frame_parms, &ru->frame_parms,
(int32_t**)dmrsp, dmrsp,/*(int32_t**)dmrsp,*/
0, 0,
AMP, AMP,
0, 0,
...@@ -503,7 +510,7 @@ int ru_sync_time_init(RU_t *ru) // LTE_UE_COMMON *common_vars ...@@ -503,7 +510,7 @@ int ru_sync_time_init(RU_t *ru) // LTE_UE_COMMON *common_vars
1); 1);
break; break;
case 50: case 50:
idft1024(dmrs, idft1024((int16_t*)dmrsp,/*dmrs,*/
ru->dmrssync, /// complex output ru->dmrssync, /// complex output
1); 1);
break; break;
......
...@@ -215,7 +215,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) { ...@@ -215,7 +215,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
} else if (packet_type >= IF4p5_PRACH && } else if (packet_type >= IF4p5_PRACH &&
packet_type <= IF4p5_PRACH+4) { packet_type <= IF4p5_PRACH+4) {
// FIX: hard coded prach samples length // FIX: hard coded prach samples length
LOG_D(PHY,"IF4p5_PRACH: frame %d, subframe %d,packet type %x\n",frame,subframe,packet_type); if (frame < 10) LOG_D(PHY,"IF4p5_PRACH: frame %d, subframe %d,packet type %x\n",frame,subframe,packet_type);
db_fulllength = PRACH_NUM_SAMPLES; db_fulllength = PRACH_NUM_SAMPLES;
if (eth->flags == ETH_RAW_IF4p5_MODE) { if (eth->flags == ETH_RAW_IF4p5_MODE) {
...@@ -249,6 +249,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) { ...@@ -249,6 +249,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
(void *)rxF, (void *)rxF,
PRACH_BLOCK_SIZE_BYTES); PRACH_BLOCK_SIZE_BYTES);
} }
if (frame == 0) LOG_I(PHY,"signal energy prach %d\n",dB_fixed(signal_energy(rxF,839)));
} }
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0+ru->idx, 1 ); if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0+ru->idx, 1 );
if ((ru->ifdevice.trx_write_func(&ru->ifdevice, if ((ru->ifdevice.trx_write_func(&ru->ifdevice,
......
...@@ -330,8 +330,14 @@ typedef struct RU_t_s{ ...@@ -330,8 +330,14 @@ typedef struct RU_t_s{
int in_synch; int in_synch;
/// timing offset /// timing offset
int rx_offset; int rx_offset;
/// south in counter
int south_in_cnt;
/// south out counter /// south out counter
int south_out_cnt; int south_out_cnt;
/// north in counter
int north_in_cnt;
/// north out counter
int north_out_cnt;
/// flag to indicate the RU is a slave to another source /// flag to indicate the RU is a slave to another source
int is_slave; int is_slave;
/// flag to indicate that the RU should generate the DMRS sequence in slot 2 (subframe 1) for OTA synchronization and calibration /// flag to indicate that the RU should generate the DMRS sequence in slot 2 (subframe 1) for OTA synchronization and calibration
......
...@@ -189,7 +189,7 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,int frame, int subframe) { ...@@ -189,7 +189,7 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,int frame, int subframe) {
int **txdataF = eNB->common_vars.txdataF; int **txdataF = eNB->common_vars.txdataF;
uint8_t *pbch_pdu=&eNB->pbch_pdu[0]; uint8_t *pbch_pdu=&eNB->pbch_pdu[0];
//LOG_D(PHY,"common_signal_procedures: frame %d, subframe %d fdd:%s dir:%s\n",frame,subframe,fp->frame_type == FDD?"FDD":"TDD", subframe_select(fp,subframe) == SF_DL?"DL":"UL?"); LOG_I(PHY,"common_signal_procedures: frame %d, subframe %d fdd:%s dir:%s\n",frame,subframe,fp->frame_type == FDD?"FDD":"TDD", subframe_select(fp,subframe) == SF_DL?"DL":"UL?");
// generate Cell-Specific Reference Signals for both slots // generate Cell-Specific Reference Signals for both slots
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_RS_TX,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_RS_TX,1);
......
...@@ -97,28 +97,44 @@ void feptx0(RU_t *ru,int slot) { ...@@ -97,28 +97,44 @@ void feptx0(RU_t *ru,int slot) {
fp->nb_prefix_samples, fp->nb_prefix_samples,
CYCLIC_PREFIX); CYCLIC_PREFIX);
else { else {
AssertFatal(ru->generate_dmrs_sync == 0 || /* AssertFatal(ru->generate_dmrs_sync==1 && (fp->frame_type != TDD || ru->is_slave == 1),
ru->generate_dmrs_sync==1 && (fp->frame_type != TDD || ru->is_slave == 1), "ru->generate_dmrs_sync should not be set, frame_type %d, is_slave %d\n",
"ru->generate_dmrs_sync should not be set (%d), frame_type %s, is_slave %d\n", fp->frame_type,ru->is_slave);
ru->generate_dmrs_sync,(fp->frame_type==1)?"TDD":"FDD",ru->is_slave); */
if (ru->generate_dmrs_sync == 1 && slot == 0 && subframe == 1 && aa==0) { if (ru->generate_dmrs_sync == 1 && slot == 0 && subframe == 1 && aa==0) {
int32_t dmrs[ru->frame_parms.ofdm_symbol_size*14] __attribute__((aligned(32)));
int32_t *dmrsp[2] = {&dmrs[(3-ru->frame_parms.Ncp)*ru->frame_parms.ofdm_symbol_size],NULL};
generate_ul_ref_sigs();
ru->dmrssync = (int16_t*)malloc16_clear(ru->frame_parms.ofdm_symbol_size*2*sizeof(int16_t));
generate_drs_pusch((PHY_VARS_UE *)NULL, generate_drs_pusch((PHY_VARS_UE *)NULL,
(UE_rxtx_proc_t*)NULL, (UE_rxtx_proc_t*)NULL,
fp, fp,
ru->common.txdataF_BF, dmrsp,//ru->common.txdataF_BF,
0, 0,
AMP, AMP,
1, 1,
0, 0,
fp->N_RB_DL, fp->N_RB_DL,
aa); aa);
}
idft1024((int16_t*)dmrsp[0],
(int16_t*)&ru->common.txdata[aa][slot_offset],
1);
/*normal_prefix_mod((int16_t*)dmrsp[0],
(int*)&ru->common.txdata[aa][slot_offset],
1,
fp);
*/
} else {
normal_prefix_mod(&ru->common.txdataF_BF[aa][slot*slot_sizeF], normal_prefix_mod(&ru->common.txdataF_BF[aa][slot*slot_sizeF],
(int*)&ru->common.txdata[aa][slot_offset], (int*)&ru->common.txdata[aa][slot_offset],
7, 7,
fp); fp);
} }
}
/* /*
len = fp->samples_per_tti>>1; len = fp->samples_per_tti>>1;
......
...@@ -245,7 +245,7 @@ int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestam ...@@ -245,7 +245,7 @@ int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestam
} }
eth->tx_nsamps = nblocks; eth->tx_nsamps = nblocks;
// printf("Sending %d bytes to %s:%d\n",packet_size,str,ntohs(eth->local_addrd.sin_port)); //printf("Sending %d bytes to %s:%d\n",packet_size,str,ntohs(eth->local_addrd.sin_port));
bytes_sent = sendto(eth->sockfdd, bytes_sent = sendto(eth->sockfdd,
buff[0], buff[0],
......
...@@ -177,7 +177,6 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset); ...@@ -177,7 +177,6 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) { static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) {
start_meas(&softmodem_stats_rxtx_sf); start_meas(&softmodem_stats_rxtx_sf);
// ******************************************************************* // *******************************************************************
if (nfapi_mode == 1) { if (nfapi_mode == 1) {
...@@ -238,10 +237,12 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam ...@@ -238,10 +237,12 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 1 );
if(!eNB->single_thread_flag && get_nprocs() >= 8){ if(!eNB->single_thread_flag && get_nprocs() >= 8){
//printf("Entering rxtx, proc1->cond_rxtx, proc1->pipe_ready, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
if(wait_on_condition(&proc[1].mutex_rxtx,&proc[1].cond_rxtx,&proc[1].pipe_ready,"wakeup_tx")<0) { if(wait_on_condition(&proc[1].mutex_rxtx,&proc[1].cond_rxtx,&proc[1].pipe_ready,"wakeup_tx")<0) {
LOG_E(PHY,"Frame %d, subframe %d: TX1 not ready\n",proc[1].frame_rx,proc[1].subframe_rx); LOG_E(PHY,"Frame %d, subframe %d: TX1 not ready\n",proc[1].frame_rx,proc[1].subframe_rx);
return(-1); return(-1);
} }
//printf("Passed rxtx, proc1->cond_rxtx, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
if (release_thread(&proc[1].mutex_rxtx,&proc[1].pipe_ready,"wakeup_tx")<0) return(-1); if (release_thread(&proc[1].mutex_rxtx,&proc[1].pipe_ready,"wakeup_tx")<0) return(-1);
} }
...@@ -319,7 +320,6 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam ...@@ -319,7 +320,6 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
static void* tx_thread(void* param) { static void* tx_thread(void* param) {
PHY_VARS_eNB *eNB = (PHY_VARS_eNB *)param; PHY_VARS_eNB *eNB = (PHY_VARS_eNB *)param;
eNB_proc_t *eNB_proc = &eNB->proc; eNB_proc_t *eNB_proc = &eNB->proc;
eNB_rxtx_proc_t *proc = &eNB_proc->proc_rxtx[1]; eNB_rxtx_proc_t *proc = &eNB_proc->proc_rxtx[1];
...@@ -332,10 +332,10 @@ static void* tx_thread(void* param) { ...@@ -332,10 +332,10 @@ static void* tx_thread(void* param) {
//wait_sync("tx_thread"); //wait_sync("tx_thread");
while (!oai_exit) { while (!oai_exit) {
//printf("Entering tx_thread, proc1->cond_rxtx, proc1->instance_cnt_rxtx, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break; if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break;
if (oai_exit) break; //printf("Passed tx_thread proc1->cond_rxtx, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
if (oai_exit) break;
// ***************************************** // *****************************************
// TX processing for subframe n+4 // TX processing for subframe n+4
// run PHY TX procedures the one after the other for all CCs to avoid race conditions // run PHY TX procedures the one after the other for all CCs to avoid race conditions
...@@ -356,6 +356,7 @@ static void* tx_thread(void* param) { ...@@ -356,6 +356,7 @@ static void* tx_thread(void* param) {
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
exit_fun( "ERROR pthread_cond_signal" ); exit_fun( "ERROR pthread_cond_signal" );
} }
//printf("Sent tx_thread, proc1->cond_rxtx to tx_thread, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
pthread_mutex_unlock( &proc->mutex_rxtx ); pthread_mutex_unlock( &proc->mutex_rxtx );
wakeup_txfh(proc,eNB); wakeup_txfh(proc,eNB);
} }
...@@ -410,9 +411,9 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -410,9 +411,9 @@ static void* eNB_thread_rxtx( void* param ) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx)); T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx));
//printf("Entering eNB_thread_rxtx, proc0->cond_rxtx, instance_cnt_rxtx, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break; if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break;
//printf("Passed eNB_thread_rxtx proc0->cond_rxtx , frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_CPUID_ENB_THREAD_RXTX,sched_getcpu()); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_CPUID_ENB_THREAD_RXTX,sched_getcpu());
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 );
...@@ -439,6 +440,7 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -439,6 +440,7 @@ static void* eNB_thread_rxtx( void* param ) {
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
exit_fun( "ERROR pthread_cond_signal" ); exit_fun( "ERROR pthread_cond_signal" );
} }
//printf("Sent eNB_thread_rxtx proc0-> cond_rxtx to tx_thread, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
pthread_mutex_unlock( &proc->mutex_rxtx ); pthread_mutex_unlock( &proc->mutex_rxtx );
if (nfapi_mode!=2){ if (nfapi_mode!=2){
if(get_nprocs() >= 8) wakeup_tx(eNB,eNB->proc.ru_proc); if(get_nprocs() >= 8) wakeup_tx(eNB,eNB->proc.ru_proc);
...@@ -451,7 +453,7 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -451,7 +453,7 @@ static void* eNB_thread_rxtx( void* param ) {
} // while !oai_exit } // while !oai_exit
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 ); // VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
LOG_D(PHY, " *** Exiting eNB thread RXn_TXnp4\n"); LOG_D(PHY, " *** Exiting eNB thread RXn_TXnp4\n");
...@@ -488,22 +490,28 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t ...@@ -488,22 +490,28 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t
} }
int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) { int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
RU_proc_t *ru_proc; RU_proc_t *ru_proc;
struct timespec wait; struct timespec wait;
wait.tv_sec=0; wait.tv_sec=0;
wait.tv_nsec=5000000L; wait.tv_nsec=5000000L;
LTE_DL_FRAME_PARMS *fp;
for(int ru_id=0; ru_id<eNB->num_RU; ru_id++){ for(int ru_id=0; ru_id<eNB->num_RU; ru_id++){
ru_proc = &eNB->RU_list[ru_id]->proc; ru_proc = &eNB->RU_list[ru_id]->proc;
fp = &eNB->RU_list[ru_id]->frame_parms;
if ((fp->frame_type == TDD) && (subframe_select(fp,proc->subframe_tx)==SF_UL)) continue;
// skip the RUs that are not synced
if (eNB->RU_list[ru_id]->state == RU_SYNC) { LOG_I(PHY,"wakeup_txfh: eNB %d : Skipping ru %d\n",eNB->Mod_id,ru_id); continue; }
if(ru_proc == NULL) if(ru_proc == NULL)
return(0); return(0);
//printf("Entering wakeup_txfh, ru_proc->cond_eNBs, ru_proc->ru_tx_ready, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,ru_proc->frame_tx,ru_proc->subframe_tx);
if(wait_on_condition(&ru_proc->mutex_eNBs,&ru_proc->cond_eNBs,&ru_proc->ru_tx_ready,"wakeup_txfh")<0) { if(wait_on_condition(&ru_proc->mutex_eNBs,&ru_proc->cond_eNBs,&ru_proc->ru_tx_ready,"wakeup_txfh")<0) {
LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", ru_proc->frame_tx, ru_proc->subframe_tx); LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", ru_proc->frame_tx, ru_proc->subframe_tx);
return(-1); return(-1);
} }
//printf("Passed wakeup_txfh ru_proc->cond_eNBs, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", ru_proc->frame_rx,ru_proc->subframe_rx,ru_proc->frame_tx,ru_proc->subframe_tx);
if (release_thread(&ru_proc->mutex_eNBs,&ru_proc->ru_tx_ready,"wakeup_txfh")<0) return(-1); if (release_thread(&ru_proc->mutex_eNBs,&ru_proc->ru_tx_ready,"wakeup_txfh")<0) return(-1);
if (ru_proc->instance_cnt_eNBs == 0) { if (ru_proc->instance_cnt_eNBs == 0) {
LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->subframe_tx, proc->frame_rx, proc->subframe_rx); LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->subframe_tx, proc->frame_rx, proc->subframe_rx);
return(-1); return(-1);
...@@ -518,27 +526,28 @@ int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) { ...@@ -518,27 +526,28 @@ int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
ru_proc->timestamp_tx = proc->timestamp_tx; ru_proc->timestamp_tx = proc->timestamp_tx;
ru_proc->subframe_tx = proc->subframe_tx; ru_proc->subframe_tx = proc->subframe_tx;
ru_proc->frame_tx = proc->frame_tx; ru_proc->frame_tx = proc->frame_tx;
// the thread can now be woken up // the thread can now be woken up
if (pthread_cond_signal(&ru_proc->cond_eNBs) != 0) { if (pthread_cond_signal(&ru_proc->cond_eNBs) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
exit_fun( "ERROR pthread_cond_signal" ); exit_fun( "ERROR pthread_cond_signal" );
return(-1); return(-1);
} }
//printf("Sent wakeup_txfh ru_proc->cond_eNBs to tx_thread\n, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,ru_proc->frame_tx,ru_proc->subframe_tx);
pthread_mutex_unlock( &ru_proc->mutex_eNBs ); pthread_mutex_unlock( &ru_proc->mutex_eNBs );
} }
return(0); return(0);
} }
int wakeup_tx(PHY_VARS_eNB *eNB,RU_proc_t *ru_proc) { int wakeup_tx(PHY_VARS_eNB *eNB,RU_proc_t *ru_proc) {
eNB_proc_t *proc=&eNB->proc; eNB_proc_t *proc=&eNB->proc;
eNB_rxtx_proc_t *proc_rxtx1=&proc->proc_rxtx[1];//*proc_rxtx=&proc->proc_rxtx[proc->frame_rx&1]; eNB_rxtx_proc_t *proc_rxtx1=&proc->proc_rxtx[1];/**proc_rxtx=&proc->proc_rxtx[proc->frame_rx&1];*/
eNB_rxtx_proc_t *proc_rxtx0=&proc->proc_rxtx[0]; eNB_rxtx_proc_t *proc_rxtx0=&proc->proc_rxtx[0];
/* LTE_DL_FRAME_PARMS *fp;
fp = &eNB->frame_parms;
if ((fp->frame_type == TDD) && (subframe_select(fp,proc_rxtx0->subframe_tx)==SF_UL)) return;
*/
struct timespec wait; struct timespec wait;
wait.tv_sec=0; wait.tv_sec=0;
wait.tv_nsec=5000000L; wait.tv_nsec=5000000L;
...@@ -571,14 +580,13 @@ int wakeup_tx(PHY_VARS_eNB *eNB,RU_proc_t *ru_proc) { ...@@ -571,14 +580,13 @@ int wakeup_tx(PHY_VARS_eNB *eNB,RU_proc_t *ru_proc) {
exit_fun( "ERROR pthread_cond_signal" ); exit_fun( "ERROR pthread_cond_signal" );
return(-1); return(-1);
} }
//printf("Sent wakeup_tx proc1->cond_rxtx to tx_thread, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc_rxtx1->frame_rx,proc_rxtx1->subframe_rx,proc_rxtx1->frame_tx,proc_rxtx1->subframe_tx);
pthread_mutex_unlock( &proc_rxtx1->mutex_rxtx ); pthread_mutex_unlock( &proc_rxtx1->mutex_rxtx );
return(0); return(0);
} }
int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
eNB_proc_t *proc=&eNB->proc; eNB_proc_t *proc=&eNB->proc;
RU_proc_t *ru_proc=&ru->proc; RU_proc_t *ru_proc=&ru->proc;
...@@ -618,11 +626,12 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { ...@@ -618,11 +626,12 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
wait.tv_sec=0; wait.tv_sec=0;
wait.tv_nsec=5000000L; wait.tv_nsec=5000000L;
//printf("Entering wakeup_rxtx, cond_rxtx, proc0->pipe_ready, frame %d, subframe %d\n", proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx,proc_rxtx0->frame_tx,proc_rxtx0->subframe_tx);
if(wait_on_condition(&proc_rxtx0->mutex_rxtx,&proc_rxtx0->cond_rxtx,&proc_rxtx0->pipe_ready,"wakeup_rxtx")<0) { if(wait_on_condition(&proc_rxtx0->mutex_rxtx,&proc_rxtx0->cond_rxtx,&proc_rxtx0->pipe_ready,"wakeup_rxtx")<0) {
LOG_E(PHY,"Frame %d, subframe %d: RXTX0 not ready\n",proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx); LOG_E(PHY,"Frame %d, subframe %d: RXTX0 not ready\n",proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx);
return(-1); return(-1);
} }
//printf("Passed wakeup_rxtx proc0->cond_rxtx, frame %d, subframe %d\n", proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx,proc_rxtx0->frame_tx,proc_rxtx0->subframe_tx);
if (release_thread(&proc_rxtx0->mutex_rxtx,&proc_rxtx0->pipe_ready,"wakeup_rxtx")<0) return(-1); if (release_thread(&proc_rxtx0->mutex_rxtx,&proc_rxtx0->pipe_ready,"wakeup_rxtx")<0) return(-1);
if (proc_rxtx0->instance_cnt_rxtx == 0) { if (proc_rxtx0->instance_cnt_rxtx == 0) {
...@@ -659,7 +668,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { ...@@ -659,7 +668,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
exit_fun( "ERROR pthread_cond_signal" ); exit_fun( "ERROR pthread_cond_signal" );
return(-1); return(-1);
} }
//printf("Sent wakeup_rxtx proc0->cond_rxtx to eNB_thread_rxtx, frame %d, subframe %d\n", proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx,proc_rxtx0->frame_tx,proc_rxtx0->subframe_tx);
pthread_mutex_unlock( &proc_rxtx0->mutex_rxtx ); pthread_mutex_unlock( &proc_rxtx0->mutex_rxtx );
return(0); return(0);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment