Commit 1547de9a authored by Raymond Knopp's avatar Raymond Knopp

debugging for simulator target

parent 72cd1b1d
......@@ -287,15 +287,19 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint
LOG_D(PHY,"recv IF4p5: RU %d waiting (%d samples)\n",ru->idx,db_fulllength);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF, 1 );
if (ru->ifdevice.trx_read_func(&ru->ifdevice,
int read_cnt=0;
while (ru->ifdevice.trx_read_func(&ru->ifdevice,
(int64_t*) packet_type,
&rx_buffer,
db_fulllength,
0) < 0) {
perror("ETHERNET read");
read_cnt++;
if (read_cnt == 2) {
ru->cmd = STOP_RU;
return;
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF, 0 );
if (eth->flags == ETH_RAW_IF4p5_MODE) {
packet_header = (IF4p5_header_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES);
......
......@@ -686,7 +686,8 @@ typedef enum {
/// Some commamds to RRU. Not sure we should do it like this !
typedef enum {
STOP_RU = 0
EMPTY = 0,
STOP_RU = 1
} rru_cmd_t;
typedef struct RU_t_s{
......
......@@ -681,16 +681,17 @@ void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) {
uint32_t symbol_number,symbol_mask,symbol_mask_full;
int subframe_tx,frame_tx;
LOG_D(PHY, "%s(ru:%p frame, subframe)\n", __FUNCTION__, ru);
symbol_number = 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;
do {
recv_IF4p5(ru, &frame_tx, &subframe_tx, &packet_type, &symbol_number);
if (ru->cmd != STOP_RU){
if (ru->cmd == STOP_RU){
LOG_E(PHY,"Got STOP_RU\n");
pthread_mutex_lock(&proc->mutex_ru);
proc->instance_cnt_ru = -1;
pthread_mutex_unlock(&proc->mutex_ru);
ru->cmd=EMPTY;
return;
}
if ((subframe_select(fp,subframe_tx) == SF_DL) && (symbol_number == 0)) start_meas(&ru->rx_fhaul);
......@@ -711,7 +712,7 @@ void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) {
if (packet_type == IF4p5_PDLFFT) {
symbol_mask = symbol_mask | (1<<symbol_number);
}
else AssertFatal(1==0,"Illegal IF4p5 packet type (should only be IF4p5_PDLFFT%d\n",packet_type);
else AssertFatal(1==0,"Illegal IF4p5 packet type (should only be IF4p5_PDLFFT got %d\n",packet_type);
} while (symbol_mask != symbol_mask_full);
if (subframe_select(fp,subframe_tx) == SF_DL) stop_meas(&ru->rx_fhaul);
......@@ -754,6 +755,7 @@ void fh_if4p5_north_out(RU_t *ru) {
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 );
LOG_D(PHY,"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)) {
/// **** in TDD during DL send_IF4 of ULTICK to RCC **** ///
send_IF4p5(ru, proc->frame_rx, proc->subframe_rx, IF4p5_PULTICK);
......@@ -1305,7 +1307,7 @@ static inline int wakeup_prach_ru(RU_t *ru) {
ru->eNB_list[0]->proc.frame_prach = ru->proc.frame_rx;
ru->eNB_list[0]->proc.subframe_prach = ru->proc.subframe_rx;
}
LOG_I(PHY,"RU %d: waking up PRACH thread\n",ru->idx);
LOG_D(PHY,"RU %d: waking up PRACH thread\n",ru->idx);
// the thread can now be woken up
AssertFatal(pthread_cond_signal(&ru->proc.cond_prach) == 0, "ERROR pthread_cond_signal for RU prach thread\n");
}
......@@ -1826,6 +1828,13 @@ static void* ru_thread( void* param ) {
if (ru->stop_rf && ru->cmd == STOP_RU) {
ru->stop_rf(ru);
ru->state = RU_IDLE;
ru->cmd = EMPTY;
LOG_I(PHY,"RU %d rf device stopped\n",ru->idx);
break;
}
else if (ru->cmd == STOP_RU) {
ru->state = RU_IDLE;
ru->cmd = EMPTY;
LOG_I(PHY,"RU %d rf device stopped\n",ru->idx);
break;
}
......@@ -1835,7 +1844,7 @@ static void* ru_thread( void* param ) {
else AssertFatal(1==0, "No fronthaul interface at south port");
/*
LOG_D(PHY,"AFTER fh_south_in - SFN/SF:%d%d RU->proc[RX:%d%d TX:%d%d] RC.eNB[0][0]:[RX:%d%d TX(SFN):%d]\n",
LOG_I(PHY,"AFTER fh_south_in - SFN/SF:%d%d RU->proc[RX:%d%d TX:%d%d] RC.eNB[0][0]:[RX:%d%d TX(SFN):%d]\n",
frame,subframe,
proc->frame_rx,proc->subframe_rx,
proc->frame_tx,proc->subframe_tx,
......@@ -1846,7 +1855,7 @@ static void* ru_thread( void* param ) {
ru->do_prach,
is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx),
proc->frame_rx,proc->subframe_rx);
*/
*/
if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)==1)) {
wakeup_prach_ru(ru);
}
......@@ -2590,7 +2599,7 @@ void init_RU(char *rf_config_file, clock_source_t clock_source,clock_source_t ti
ru->idx = ru_id;
ru->ts_offset = 0;
ru->in_synch = (ru->is_slave == 1) ? 0 : 1;
ru->cmd = -1;
ru->cmd = EMPTY;
// use eNB_list[0] as a reference for RU frame parameters
// NOTE: multiple CC_id are not handled here yet!
ru->openair0_cfg.clock_source = clock_source;
......
......@@ -741,7 +741,7 @@ l2l1_task (void *args_p)
while (all_done==0) {
pthread_mutex_lock(&subframe_mutex);
int subframe_ru_mask_local = subframe_ru_mask;
int subframe_ru_mask_local = ((1<<NB_RU)-1);//subframe_ru_mask;
int subframe_UE_mask_local = subframe_UE_mask;
pthread_mutex_unlock(&subframe_mutex);
LOG_D(EMU,"Frame %d, Subframe %d, NB_RU %d, NB_UE %d: Checking masks %x,%x\n",frame,sf,NB_RU,NB_UE_INST,subframe_ru_mask_local,subframe_UE_mask_local);
......
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