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);
......
...@@ -159,6 +159,13 @@ static inline void fh_if4p5_south_out(RU_t *ru) { ...@@ -159,6 +159,13 @@ static inline void fh_if4p5_south_out(RU_t *ru) {
send_IF4p5(ru,ru->proc.frame_tx, ru->proc.subframe_tx, IF4p5_PDLFFT); send_IF4p5(ru,ru->proc.frame_tx, ru->proc.subframe_tx, IF4p5_PDLFFT);
ru->south_out_cnt++; ru->south_out_cnt++;
} }
/*if (ru == RC.ru[0] || ru == RC.ru[1]) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU+ru->idx, ru->proc.frame_tx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU+ru->idx, ru->proc.subframe_tx );
}*/
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_OUT,ru->proc.frame_tx);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_OUT,ru->proc.subframe_tx);
} }
/*************************************************************/ /*************************************************************/
...@@ -211,7 +218,7 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) { ...@@ -211,7 +218,7 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
symbol_mask_full = (1<<fp->ul_symbols_in_S_subframe)-1; symbol_mask_full = (1<<fp->ul_symbols_in_S_subframe)-1;
else else
symbol_mask_full = (1<<fp->symbols_per_tti)-1; symbol_mask_full = (1<<fp->symbols_per_tti)-1;
LOG_D(PHY,"fh_if4p5_south_in: RU %d, frame %d, subframe %d\n",ru->idx,*frame,*subframe);
AssertFatal(proc->symbol_mask[*subframe]==0,"rx_fh_if4p5: proc->symbol_mask[%d] = %x\n",*subframe,proc->symbol_mask[*subframe]); AssertFatal(proc->symbol_mask[*subframe]==0,"rx_fh_if4p5: proc->symbol_mask[%d] = %x\n",*subframe,proc->symbol_mask[*subframe]);
do { do {
recv_IF4p5(ru, &f, &sf, &packet_type, &symbol_number); recv_IF4p5(ru, &f, &sf, &packet_type, &symbol_number);
...@@ -224,11 +231,11 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) { ...@@ -224,11 +231,11 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
} else if (packet_type == IF4p5_PRACH) { } else if (packet_type == IF4p5_PRACH) {
// nothing in RU for RAU // nothing in RU for RAU
} }ru->south_out_cnt= 0;
LOG_D(PHY,"rx_fh_if4p5: subframe %d symbol mask %x\n",*subframe,proc->symbol_mask[*subframe]); LOG_D(PHY,"rx_fh_if4p5: subframe %d symbol mask %x\n",*subframe,proc->symbol_mask[*subframe]);
} while(proc->symbol_mask[*subframe] != symbol_mask_full); } while(proc->symbol_mask[*subframe] != symbol_mask_full);
//caculate timestamp_rx, timestamp_tx based on frame and subframe //calculate timestamp_rx, timestamp_tx based on frame and subframe
proc->subframe_rx = sf; proc->subframe_rx = sf;
proc->frame_rx = f; proc->frame_rx = f;
proc->timestamp_rx = ((proc->frame_rx * 10) + proc->subframe_rx ) * fp->samples_per_tti ; proc->timestamp_rx = ((proc->frame_rx * 10) + proc->subframe_rx ) * fp->samples_per_tti ;
...@@ -238,7 +245,7 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) { ...@@ -238,7 +245,7 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
} }
if (proc->first_rx == 0) { if (proc->first_rx == 0) {
if (proc->subframe_rx != *subframe){ if (proc->subframe_rx != *subframe){
LOG_E(PHY,"Received Timestamp (IF4p5) doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)\n",proc->subframe_rx,*subframe); LOG_E(PHY,"Received Timestamp (IF4p5) doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)\n",proc->subframe_rx,*subframe);
exit_fun("Exiting"); exit_fun("Exiting");
} }
...@@ -256,12 +263,14 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) { ...@@ -256,12 +263,14 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
*subframe = proc->subframe_rx; *subframe = proc->subframe_rx;
} }
if (ru == RC.ru[0] || ru == RC.ru[1]) { /*if (ru == RC.ru[0] || ru == RC.ru[1]) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU+ru->idx, f ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU+ru->idx, f );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU+ru->idx, sf ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU+ru->idx, sf );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU+ru->idx, proc->frame_tx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU+ru->idx, proc->subframe_tx ); }*/
}
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_IN,f);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_IN,sf);
proc->symbol_mask[sf] = 0; proc->symbol_mask[sf] = 0;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff );
...@@ -352,11 +361,13 @@ void fh_if4p5_north_in(RU_t *ru,int *frame,int *subframe) { ...@@ -352,11 +361,13 @@ void fh_if4p5_north_in(RU_t *ru,int *frame,int *subframe) {
symbol_number = 0; symbol_number = 0;
symbol_mask = 0; symbol_mask = 0;
symbol_mask_full = (1<<ru->frame_parms.symbols_per_tti)-1; symbol_mask_full = (1<<ru->frame_parms.symbols_per_tti)-1;
LOG_I(PHY,"fh_if4p5_north_in: frame %d, subframe %d\n",*frame,*subframe); LOG_D(PHY,"fh_if4p5_north_in: frame %d, subframe %d\n",*frame,*subframe);
do { do {
recv_IF4p5(ru, frame, subframe, &packet_type, &symbol_number); recv_IF4p5(ru, frame, subframe, &packet_type, &symbol_number);
symbol_mask = symbol_mask | (1<<symbol_number); symbol_mask = symbol_mask | (1<<symbol_number);
} while (symbol_mask != symbol_mask_full); } while (symbol_mask != symbol_mask_full);
ru->north_in_cnt++; ru->north_in_cnt++;
// dump VCD output for first RU in list // dump VCD output for first RU in list
...@@ -408,7 +419,7 @@ void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) { ...@@ -408,7 +419,7 @@ void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) {
symbol_number = 0; symbol_number = 0;
symbol_mask = 0; symbol_mask = 0;
symbol_mask_full = ((subframe_select(fp,*subframe) == SF_S) ? (1<<fp->dl_symbols_in_S_subframe) : (1<<fp->symbols_per_tti))-1; symbol_mask_full = ((subframe_select(fp,*subframe) == SF_S) ? (1<<fp->dl_symbols_in_S_subframe) : (1<<fp->symbols_per_tti))-1;
LOG_I(PHY,"fh_if4p5_north_asynch_in: RU %d, frame %d, subframe %d\n",ru->idx,*frame,*subframe); LOG_D(PHY,"fh_if4p5_north_asynch_in: RU %d, frame %d, subframe %d\n",ru->idx,*frame,*subframe);
do { do {
recv_IF4p5(ru, &frame_tx, &subframe_tx, &packet_type, &symbol_number); recv_IF4p5(ru, &frame_tx, &subframe_tx, &packet_type, &symbol_number);
if (ru->cmd == STOP_RU){ if (ru->cmd == STOP_RU){
...@@ -454,8 +465,11 @@ void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) { ...@@ -454,8 +465,11 @@ void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) {
LOG_D(PHY,"RU %d/%d TST %llu, frame %d, subframe %d\n",ru->idx,0,(long long unsigned int)proc->timestamp_tx,frame_tx,subframe_tx); LOG_D(PHY,"RU %d/%d TST %llu, frame %d, subframe %d\n",ru->idx,0,(long long unsigned int)proc->timestamp_tx,frame_tx,subframe_tx);
// dump VCD output for first RU in list // dump VCD output for first RU in list
if (ru == RC.ru[0]) { if (ru == RC.ru[0]) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, frame_tx ); /*VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, frame_tx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU, subframe_tx ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU, subframe_tx );
*/
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_NORTH_ASYNCH_IN,frame_tx);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_NORTH_ASYNCH_IN,subframe_tx);
} }
...@@ -482,9 +496,11 @@ void fh_if4p5_north_out(RU_t *ru) { ...@@ -482,9 +496,11 @@ void fh_if4p5_north_out(RU_t *ru) {
RU_proc_t *proc=&ru->proc; RU_proc_t *proc=&ru->proc;
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms; LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
const int subframe = proc->subframe_rx; const int subframe = proc->subframe_rx;
if (ru->idx==0) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU, proc->subframe_rx ); if (ru->idx==0){
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_NORTH_OUT, proc->subframe_rx );
LOG_D(PHY,"Sending IF4p5_PULFFT SFN.SF %d.%d\n",proc->frame_rx,proc->subframe_rx); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_NORTH_OUT, proc->frame_rx );
}
LOG_D(PHY,"fh_if4p5_north_out: Sending IF4p5_PULFFT SFN.SF %d.%d\n",proc->frame_rx,proc->subframe_rx);
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) { if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) {
/// **** in TDD during DL send_IF4 of ULTICK to RCC **** /// /// **** in TDD during DL send_IF4 of ULTICK to RCC **** ///
send_IF4p5(ru, proc->frame_rx, proc->subframe_rx, IF4p5_PULTICK); send_IF4p5(ru, proc->frame_rx, proc->subframe_rx, IF4p5_PULTICK);
...@@ -629,7 +645,7 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) { ...@@ -629,7 +645,7 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
#endif #endif
} }
LOG_I(PHY,"RU %d/%d TS %llu (off %d), frame %d, subframe %d\n", LOG_D(PHY,"south_in/rx_rf: RU %d/%d TS %llu (off %d), frame %d, subframe %d\n",
ru->idx, ru->idx,
0, 0,
(unsigned long long int)proc->timestamp_rx, (unsigned long long int)proc->timestamp_rx,
...@@ -692,6 +708,8 @@ void tx_rf(RU_t *ru) { ...@@ -692,6 +708,8 @@ void tx_rf(RU_t *ru) {
lte_subframe_t prevSF_type = subframe_select(fp,(proc->subframe_tx+9)%10); lte_subframe_t prevSF_type = subframe_select(fp,(proc->subframe_tx+9)%10);
lte_subframe_t nextSF_type = subframe_select(fp,(proc->subframe_tx+1)%10); lte_subframe_t nextSF_type = subframe_select(fp,(proc->subframe_tx+1)%10);
int sf_extension = 0; int sf_extension = 0;
LOG_D(PHY,"south_out/tx_rf: frame %d, subframe %d\n",proc->frame_tx,proc->subframe_tx);
if ((SF_type == SF_DL) || if ((SF_type == SF_DL) ||
(SF_type == SF_S)) { (SF_type == SF_S)) {
...@@ -768,7 +786,8 @@ void tx_rf(RU_t *ru) { ...@@ -768,7 +786,8 @@ void tx_rf(RU_t *ru) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (proc->timestamp_tx-ru->openair0_cfg.tx_sample_advance)&0xffffffff ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (proc->timestamp_tx-ru->openair0_cfg.tx_sample_advance)&0xffffffff );
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_WRITE, 1 );
// prepare tx buffer pointers // prepare tx buffer pointers
txs = ru->rfdevice.trx_write_func(&ru->rfdevice, txs = ru->rfdevice.trx_write_func(&ru->rfdevice,
proc->timestamp_tx+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension, proc->timestamp_tx+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension,
txp, txp,
...@@ -1469,9 +1488,9 @@ static void* ru_thread_tx( void* param ) { ...@@ -1469,9 +1488,9 @@ static void* ru_thread_tx( void* param ) {
//CPU_SET(5, &cpuset); //CPU_SET(5, &cpuset);
//pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); //pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
//wait_sync("ru_thread_tx"); //wait_sync("ru_thread_tx");
//printf("Entering ru_thread_tx, ru_proc->cond_FH1, ru_proc->instance_cnt_FH1\n");
wait_on_condition(&proc->mutex_FH1,&proc->cond_FH1,&proc->instance_cnt_FH1,"ru_thread_tx"); wait_on_condition(&proc->mutex_FH1,&proc->cond_FH1,&proc->instance_cnt_FH1,"ru_thread_tx");
//printf("Passed ru_thread_tx ru_proc->cond_FH1\n");
printf( "ru_thread_tx ready\n"); printf( "ru_thread_tx ready\n");
while (!oai_exit) { while (!oai_exit) {
...@@ -1480,11 +1499,13 @@ static void* ru_thread_tx( void* param ) { ...@@ -1480,11 +1499,13 @@ static void* ru_thread_tx( void* param ) {
if (oai_exit) break; if (oai_exit) break;
LOG_D(PHY,"ru_thread_tx: Waiting for TX processing\n"); LOG_D(PHY,"ru_thread_tx (ru %d): Waiting for TX processing\n",ru->idx);
// wait until eNBs are finished subframe RX n and TX n+4 // wait until eNBs are finished subframe RX n and TX n+4
//printf("ru_thread_tx, ru_proc->cond_eNBs, ru_proc->instance_cnt_eNBs\n");
wait_on_condition(&proc->mutex_eNBs,&proc->cond_eNBs,&proc->instance_cnt_eNBs,"ru_thread_tx"); wait_on_condition(&proc->mutex_eNBs,&proc->cond_eNBs,&proc->instance_cnt_eNBs,"ru_thread_tx");
LOG_D(PHY,"ru_thread_tx: Woken from condition\n"); //printf("Passed ru_thread_tx ru_proc->cond_eNBs\n");
if (oai_exit) break; LOG_D(PHY,"ru_thread_tx (ru %d): Woken from condition\n",ru->idx);
if (oai_exit) break;
// do TX front-end processing if needed (precoding and/or IDFTs) // do TX front-end processing if needed (precoding and/or IDFTs)
if (ru->feptx_prec) ru->feptx_prec(ru); if (ru->feptx_prec) ru->feptx_prec(ru);
...@@ -1501,11 +1522,13 @@ static void* ru_thread_tx( void* param ) { ...@@ -1501,11 +1522,13 @@ static void* ru_thread_tx( void* param ) {
pthread_mutex_lock( &proc->mutex_eNBs ); pthread_mutex_lock( &proc->mutex_eNBs );
proc->ru_tx_ready++; proc->ru_tx_ready++;
//printf("~~~~~~~~~~~~~~~~~~proc->ru_tx_ready = %d\n", proc->ru_tx_ready);
// the thread can now be woken up // the thread can now be woken up
if (pthread_cond_signal(&proc->cond_eNBs) != 0) { if (pthread_cond_signal(&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" );
} }
//printf("Sent ru_thread_tx, ru_proc->cond_eNBs to tx_thread\n");
pthread_mutex_unlock( &proc->mutex_eNBs ); pthread_mutex_unlock( &proc->mutex_eNBs );
} }
release_thread(&proc->mutex_FH1,&proc->instance_cnt_FH1,"ru_thread_tx"); release_thread(&proc->mutex_FH1,&proc->instance_cnt_FH1,"ru_thread_tx");
...@@ -1701,7 +1724,7 @@ static void* ru_thread( void* param ) { ...@@ -1701,7 +1724,7 @@ static void* ru_thread( void* param ) {
ru->wait_cnt--; ru->wait_cnt--;
LOG_I(PHY,"RU thread %d, frame %d, subframe %d, wait_cnt %d \n",ru->idx, frame, subframe, ru->wait_cnt); LOG_D(PHY,"RU thread %d, frame %d, subframe %d, wait_cnt %d \n",ru->idx, frame, subframe, ru->wait_cnt);
if (ru->if_south!=LOCAL_RF && ru->wait_cnt <=20 && subframe == 5 && frame != RC.ru[0]->proc.frame_rx && resynch_done == 0) { if (ru->if_south!=LOCAL_RF && ru->wait_cnt <=20 && subframe == 5 && frame != RC.ru[0]->proc.frame_rx && resynch_done == 0) {
// Send RRU_frame adjust // Send RRU_frame adjust
...@@ -2595,7 +2618,7 @@ void init_RU(char *rf_config_file, clock_source_t clock_source,clock_source_t ti ...@@ -2595,7 +2618,7 @@ void init_RU(char *rf_config_file, clock_source_t clock_source,clock_source_t ti
// NOTE: multiple CC_id are not handled here yet! // NOTE: multiple CC_id are not handled here yet!
ru->openair0_cfg.clock_source = clock_source; ru->openair0_cfg.clock_source = clock_source;
ru->openair0_cfg.time_source = time_source; ru->openair0_cfg.time_source = time_source;
; ru->generate_dmrs_sync = (ru->is_slave == 0) ? 1 : 0;
eNB0 = ru->eNB_list[0]; eNB0 = ru->eNB_list[0];
LOG_D(PHY, "RU FUnction:%d ru->if_south:%d\n", ru->function, ru->if_south); LOG_D(PHY, "RU FUnction:%d ru->if_south:%d\n", ru->function, ru->if_south);
......
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