Commit 59a07e21 authored by Massive's avatar Massive

testing with 2 RUS (changes in default precoder)

parent 03dfe63a
......@@ -2660,7 +2660,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
else if(ulsch->harq_processes[harq_pid]->n_DMRS == 7)
ulsch->harq_processes[harq_pid]->n_DMRS2 = 9;
LOG_I(PHY,"[eNB %d][PUSCH %d] Frame %d, Subframe %d Programming PUSCH with n_DMRS2 %d (cshift %d) ulsch:ndi:%d ulsch_pdu:ndi:%d new_ulsch:%d status:%d ulsch_pdu:rvidx:%d\n",
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d, Subframe %d Programming PUSCH with n_DMRS2 %d (cshift %d) ulsch:ndi:%d ulsch_pdu:ndi:%d new_ulsch:%d status:%d ulsch_pdu:rvidx:%d\n",
eNB->Mod_id,harq_pid,frame,subframe,
ulsch->harq_processes[harq_pid]->n_DMRS2,
ulsch->harq_processes[harq_pid]->n_DMRS,
......@@ -2692,7 +2692,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
else ulsch->harq_processes[harq_pid]->round++;
ulsch->rnti = ulsch_pdu->ulsch_pdu_rel8.rnti;
LOG_I(PHY,"Filling ULSCH %x (UE_id %d) (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, status %d, handled %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n",
LOG_D(PHY,"Filling ULSCH %x (UE_id %d) (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, status %d, handled %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n",
ulsch->rnti,
UE_id,
new_ulsch,
......
......@@ -64,7 +64,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
eth_state_t *eth = (eth_state_t*) (ru->ifdevice.priv);
int nsym = fp->symbols_per_tti;
if (ru->idx==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 );
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4+ru->idx, 1 );
if (packet_type == IF4p5_PDLFFT) {
//LOG_D(PHY,"send DL_IF4p5: RU %d frame %d, subframe %d\n",ru->idx,frame,subframe);
......@@ -262,7 +262,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
AssertFatal(1==0, "send_IF4p5 - Unknown packet_type %x", packet_type);
}
if (ru->idx==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4+ru->idx, 0 );
return;
}
......@@ -282,7 +282,7 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint
eth_state_t *eth = (eth_state_t*) (ru->ifdevice.priv);
int idx;
if (ru->idx==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 );
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4+ru->idx, 1 );
if (ru->function == NGFI_RRU_IF4p5) {
db_fulllength = (12*fp->N_RB_DL)*ru->nb_tx;
......@@ -415,7 +415,7 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint
AssertFatal(1==0, "recv_IF4p5 - Unknown packet_type %x", *packet_type);
}
if (ru->idx==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 0 );
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4+ru->idx, 0 );
return;
}
......
......@@ -1666,7 +1666,9 @@ static inline int wait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,
while (*instance_cnt < 0) {
// most of the time the thread is waiting here
// proc->instance_cnt_rxtx is -1
pthread_cond_wait(cond,mutex); // this unlocks mutex_rxtx while waiting and then locks it again
LOG_I(PHY,"Waiting (instance_cnt %d thread : %s)\n",*instance_cnt,name);
AssertFatal(0==pthread_cond_wait(cond,mutex),""); // this unlocks mutex_rxtx while waiting and then locks it again
LOG_I(PHY,"Waking up (instance_cnt %d thread: %s)\n",*instance_cnt,name);
}
if (pthread_mutex_unlock(mutex) != 0) {
......
......@@ -537,7 +537,7 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) {
AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0,
"No existing UE ULSCH for rnti %x\n",rel8->rnti);
LOG_I(PHY,"Applying UL config for UE %d, rnti %x in frame %d, subframe %d, modulation %d, rvidx %d\n", UE_id,rel8->rnti,frame,subframe,rel8->modulation_type,rel8->redundancy_version);
LOG_D(PHY,"Applying UL config for UE %d, rnti %x in frame %d, subframe %d, modulation %d, rvidx %d\n", UE_id,rel8->rnti,frame,subframe,rel8->modulation_type,rel8->redundancy_version);
fill_ulsch(eNB,&ul_config_pdu->ulsch_pdu,frame,subframe);
......@@ -831,7 +831,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
else {
for (i=0;i<number_ul_pdu;i++) {
ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i];
LOG_I(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type);
LOG_D(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type);
AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE ||
......
......@@ -1163,7 +1163,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
ulsch = eNB->ulsch[i];
ulsch_harq = ulsch->harq_processes[harq_pid];
if (ulsch->rnti>0) LOG_I(PHY,"eNB->ulsch[%d]->harq_processes[harq_pid:%d] SFN/SF:%04d%d: PUSCH procedures, UE %d/%x ulsch_harq[status:%d SFN/SF:%04d%d handled:%d]\n",
if (ulsch->rnti>0) LOG_D(PHY,"eNB->ulsch[%d]->harq_processes[harq_pid:%d] SFN/SF:%04d%d: PUSCH procedures, UE %d/%x ulsch_harq[status:%d SFN/SF:%04d%d handled:%d]\n",
i, harq_pid, frame,subframe,i,ulsch->rnti,
ulsch_harq->status, ulsch_harq->frame, ulsch_harq->subframe, ulsch_harq->handled);
......@@ -1182,7 +1182,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31));
}
LOG_I(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d \n", eNB->Mod_id, frame, subframe, i);
LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d \n", eNB->Mod_id, frame, subframe, i);
nPRS = fp->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1];
......@@ -1190,7 +1190,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
nPRS)%12;
LOG_I(PHY,
LOG_D(PHY,
"[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, Qm %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, ), O_ACK %d, beta_cqi %d \n",
eNB->Mod_id,harq_pid,frame,subframe,
ulsch_harq->dci_alloc,
......@@ -1223,7 +1223,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
stop_meas(&eNB->ulsch_decoding_stats);
LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d ulsch_harq->cqi_crc_status:%d ackBits:%d ulsch_decoding_stats[t:%lld max:%lld]\n",
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d ulsch_harq->cqi_crc_status:%d ackBits:%d ulsch_decoding_stats[t:%lld max:%lld]\n",
eNB->Mod_id,harq_pid,
frame,subframe,
ulsch->rnti,
......@@ -1259,7 +1259,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
fill_crc_indication(eNB,i,frame,subframe,1); // indicate NAK to MAC
fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC
LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n",
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n",
eNB->Mod_id,harq_pid,
frame,subframe, i,
ulsch_harq->round,
......
......@@ -217,7 +217,8 @@ void prach_procedures(PHY_VARS_eNB *eNB
}
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
/* write_output("prach.m","prachsig",eNB->prach_vars.rxsigF[0][0],839,1,1);
exit(-1);*/
} // max_preamble_energy > prach_I0 + 100
else {
eNB->measurements.prach_I0 = ((eNB->measurements.prach_I0*900)>>10) + ((max_preamble_energy[0]*124)>>10);
......
......@@ -359,15 +359,18 @@ void feptx_prec(RU_t *ru) {
int32_t ***bw;
int subframe = ru->proc.subframe_tx;
if (ru->idx != 0) return;
if (ru->num_eNB == 1) {
eNB = eNB_list[0];
fp = &eNB->frame_parms;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 1);
// simple antenna port mapping rule that works both for single antenna eNB and dual antenna eNB. It maps antenna ports evenly to RUs
for (aa=0;aa<ru->nb_tx;aa++)
memcpy((void*)ru->common.txdataF_BF[aa],
(void*)&eNB->common_vars.txdataF[aa][subframe*fp->symbols_per_tti*fp->ofdm_symbol_size],
(void*)&eNB->common_vars.txdataF[(aa+ru->idx)%eNB->frame_parms.nb_antenna_ports_eNB][subframe*fp->symbols_per_tti*fp->ofdm_symbol_size],
fp->symbols_per_tti*fp->ofdm_symbol_size*sizeof(int32_t));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 0);
......
......@@ -363,6 +363,7 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
// check uplink failure
if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer > 0) &&
(UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 0)) {
if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer&1023) == 0)
LOG_I(MAC, "UE %d rnti %x: UL Failure timer %d \n", UE_id, rnti,
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer);
if (UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent == 0) {
......@@ -396,6 +397,7 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
dl_config_pdu->dci_dl_pdu.
dci_dl_pdu_rel8.resource_block_coding);
} else { // ra_pdcch_sent==1
if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer&1023) == 0)
LOG_I(MAC,
"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",
UE_id, rnti,
......
......@@ -72,13 +72,21 @@ const char* eurecomVariablesNames[] = {
"subframe_number_RX0_eNB",
"subframe_number_RX1_eNB",
"frame_number_TX0_RU",
"frame_number_TX0_RU2",
"frame_number_TX1_RU",
"frame_number_TX1_RU2",
"frame_number_RX0_RU",
"frame_number_RX0_RU2",
"frame_number_RX1_RU",
"frame_number_RX1_RU2",
"subframe_number_TX0_RU",
"subframe_number_TX0_RU2",
"subframe_number_TX1_RU",
"subframe_number_TX1_RU2",
"subframe_number_RX0_RU",
"subframe_number_RX0_RU2",
"subframe_number_RX1_RU",
"subframe_number_RX1_RU2",
"runtime_TX_eNB",
"runtime_RX_eNB",
"frame_number_TX0_UE",
......@@ -388,8 +396,10 @@ const char* eurecomFunctionsNames[] = {
"test",
/* IF4/IF5 signals */
"send_if4",
"recv_if4",
"send_if4(RU0)",
"send_if4(RU1)",
"recv_if4(RU0)",
"recv_if4(RU1)",
"send_if5",
"recv_if5",
......
......@@ -48,13 +48,21 @@ typedef enum {
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_ENB,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX1_ENB,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU2,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_RU,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_RU2,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU2,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX1_RU,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX1_RU2,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU2,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX1_RU,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX1_RU2,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU2,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX1_RU,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX1_RU2,
VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_TX_ENB,
VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_RX_ENB,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_UE,
......@@ -369,7 +377,9 @@ typedef enum {
/* IF4/IF5 signals */
VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4,
VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4_RU2,
VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4,
VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4_RU2,
VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF5,
VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF5,
......
......@@ -180,12 +180,12 @@ L1s = (
RUs = (
{
local_if_name = "eth1";
remote_address = "10.10.10.19";
local_address = "10.10.10.18";
local_portc = 50000;
remote_portc = 50000;
local_portd = 50001;
remote_portd = 50001;
remote_address = "10.10.10.111";
local_address = "10.10.10.153";
local_portc = 50002;
remote_portc = 50002;
local_portd = 50003;
remote_portd = 50003;
local_rf = "no"
tr_preference = "udp_if4p5"
nb_tx = 1
......@@ -193,6 +193,7 @@ RUs = (
att_tx = 0
att_rx = 0;
eNB_instances = [0];
is_slave = "no"
}
);
......
......@@ -488,7 +488,7 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
pthread_mutex_lock(&proc->mutex_RU_PRACH);
for (i=0;i<eNB->num_RU;i++) {
if (ru == eNB->RU_list[i]) {
//LOG_D(PHY,"frame %d, subframe %d: RU %d for eNB %d signals PRACH (mask %x, num_RU %d)\n",frame,subframe,i,eNB->Mod_id,proc->RU_mask_prach,eNB->num_RU);
LOG_D(PHY,"frame %d, subframe %d: RU %d for eNB %d signals PRACH (mask %x, num_RU %d)\n",frame,subframe,i,eNB->Mod_id,proc->RU_mask_prach,eNB->num_RU);
//if ((proc->RU_mask_prach&(1<<i)) > 0)
// LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information (PRACH) from RU %d (num_RU %d, mask %x) has not been served yet!\n",
// eNB->Mod_id,frame,subframe,ru->idx,eNB->num_RU,proc->RU_mask_prach);
......@@ -1032,7 +1032,7 @@ void init_eNB_afterRU(void) {
}
}
eNB->frame_parms.nb_antennas_rx = 1;
/* TODO: review this code, there is something wrong.
* In monolithic mode, we come here with nb_antennas_rx == 0
......@@ -1043,10 +1043,6 @@ void init_eNB_afterRU(void) {
LOG_I(PHY, "%s() ************* DJP ***** eNB->frame_parms.nb_antennas_rx:%d - GOING TO HARD CODE TO 1", __FUNCTION__, eNB->frame_parms.nb_antennas_rx);
eNB->frame_parms.nb_antennas_rx = 1;
}
else
{
//LOG_I(PHY," Delete code\n");
}
if (eNB->frame_parms.nb_antennas_tx < 1)
{
......
......@@ -504,11 +504,11 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
*subframe = proc->subframe_rx;
}
if (ru == RC.ru[0]) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU, f );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU, sf );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, proc->frame_tx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU, proc->subframe_tx );
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_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 );
}
proc->symbol_mask[sf] = 0;
......@@ -1272,18 +1272,20 @@ void wakeup_eNBs(RU_t *ru) {
PHY_VARS_eNB **eNB_list = ru->eNB_list;
PHY_VARS_eNB *eNB=eNB_list[0];
eNB_proc_t *proc = &eNB->proc;
RU_proc_t *ruproc = &ru->proc;
struct timespec t;
LOG_D(PHY,"wakeup_eNBs (num %d) for RU %d (state %s)ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru_states[ru->state],ru->eNB_top);
if (ru->num_eNB==1 && ru->eNB_top!=0) {
if (ru->num_eNB==1) {
AssertFatal(ru->eNB_top!=0,"eNB_top function is not there\n");
// call eNB function directly
char string[20];
sprintf(string,"Incoming RU %d",ru->idx);
pthread_mutex_lock(&proc->mutex_RU);
LOG_I(PHY,"Frame %d, Subframe %d: RU %d done (wait_cnt %d),RU_mask[%d] %x\n",
AssertFatal(0==pthread_mutex_lock(&proc->mutex_RU),"");
LOG_D(PHY,"Frame %d, Subframe %d: RU %d done (wait_cnt %d),RU_mask[%d] %x\n",
ru->proc.frame_rx,ru->proc.subframe_rx,ru->idx,ru->wait_cnt,ru->proc.subframe_rx,proc->RU_mask[ru->proc.subframe_rx]);
if (proc->RU_mask[ru->proc.subframe_rx] == 0){
......@@ -1302,21 +1304,41 @@ void wakeup_eNBs(RU_t *ru) {
}
}
clock_gettime(CLOCK_MONOTONIC,&t);
LOG_I(PHY,"RU mask is now %x, time is %lu\n",proc->RU_mask[ru->proc.subframe_rx], t.tv_nsec - proc->t[ru->proc.subframe_rx].tv_nsec);
LOG_D(PHY,"RU mask is now %x, time is %lu\n",proc->RU_mask[ru->proc.subframe_rx], t.tv_nsec - proc->t[ru->proc.subframe_rx].tv_nsec);
if (proc->RU_mask[ru->proc.subframe_rx] == (1<<eNB->num_RU)-1) {
LOG_D(PHY,"Reseting mask frame %d, subframe %d, this is RU %d\n",ru->proc.frame_rx, ru->proc.subframe_rx, ru->idx);
LOG_I(PHY, "ru_mask is %d \n ", proc->RU_mask[ru->proc.subframe_rx]);
LOG_I(PHY, "the number of RU is %d, the current ru is RU %d \n ", (1<<eNB->num_RU)-1, ru->idx);
LOG_I(PHY, "ru->proc.subframe_rx is %d \n", ru->proc.subframe_rx);
LOG_I(PHY,"Reseting mask frame %d, subframe %d, this is RU %d\n",ru->proc.frame_rx, ru->proc.subframe_rx, ru->idx);
proc->RU_mask[ru->proc.subframe_rx] = 0;
clock_gettime(CLOCK_MONOTONIC,&t);
//stop_meas(&proc->ru_arrival_time);
AssertFatal(t.tv_nsec < proc->t[ru->proc.subframe_rx].tv_nsec+5000000,
"Time difference for subframe %d (Frame %d) => %lu > 5ms, this is RU %d\n",
ru->proc.subframe_rx, ru->proc.frame_rx,t.tv_nsec - proc->t[ru->proc.subframe_rx].tv_nsec, ru->idx);
AssertFatal(0==pthread_mutex_unlock(&proc->mutex_RU),"");
// unlock RUs that are waiting for eNB processing to be completed
LOG_I(PHY,"RU %d wakeup eNB top for for subframe %d\n", ru->idx,ru->proc.subframe_rx);
ru->eNB_top(eNB_list[0],proc->frame_rx,proc->subframe_rx,string);
AssertFatal(0==pthread_mutex_lock(&ruproc->mutex_eNBs),"");
LOG_I(PHY,"RU %d sending signal to unlock waiting ru_threads\n", ru->idx);
AssertFatal(0==pthread_cond_broadcast(&ruproc->cond_eNBs),"");
if (ruproc->instance_cnt_eNBs==-1) ruproc->instance_cnt_eNBs++;
AssertFatal(0==pthread_mutex_unlock(&ruproc->mutex_eNBs),"");
}
else
AssertFatal(0==pthread_mutex_unlock(&proc->mutex_RU),"");
// pthread_mutex_unlock(&proc->mutex_RU);
// LOG_D(PHY,"wakeup eNB top for for subframe %d\n", ru->proc.subframe_rx);
// ru->eNB_top(eNB_list[0],ru->proc.frame_rx,ru->proc.subframe_rx,string);
pthread_mutex_unlock(&proc->mutex_RU);
LOG_D(PHY,"wakeup eNB top for for subframe %d\n", ru->proc.subframe_rx);
ru->eNB_top(eNB_list[0],ru->proc.frame_rx,ru->proc.subframe_rx,string);
}
else { // multiple eNB case for later
......@@ -1823,7 +1845,7 @@ static void* ru_thread( void* param ) {
int subframe =9;
int frame =1023;
int resynch_done = 0;
char strname[30];
// set default return value
......@@ -1946,11 +1968,16 @@ static void* ru_thread( void* param ) {
if (ru->feprx) ru->feprx(ru);
// wakeup all eNB processes waiting for this RU
pthread_mutex_lock(&proc->mutex_eNBs);
if (proc->instance_cnt_eNBs==0) proc->instance_cnt_eNBs--;
pthread_mutex_unlock(&proc->mutex_eNBs);
if (ru->num_eNB>0) wakeup_eNBs(ru);
LOG_I(PHY,"RU %d: Waiting for eNB to complete\n",ru->idx);
// wait until eNBs are finished subframe RX n and TX n+4
wait_on_condition(&proc->mutex_eNBs,&proc->cond_eNBs,&proc->instance_cnt_eNBs,"ru_thread");
sprintf(strname,"ru_thread %d (condeNBs)",ru->idx);
wait_on_condition(&proc->mutex_eNBs,&proc->cond_eNBs,&proc->instance_cnt_eNBs,strname);
LOG_I(PHY,"RU %d: continuing\n",ru->idx);
// do TX front-end processing if needed (precoding and/or IDFTs)
if (ru->feptx_prec) ru->feptx_prec(ru);
......@@ -2135,6 +2162,7 @@ void init_RU_proc(RU_t *ru) {
proc->instance_cnt_FH = -1;
proc->instance_cnt_asynch_rxtx = -1;
proc->instance_cnt_ru = -1;
proc->instance_cnt_eNBs = -1;
proc->first_rx = 1;
proc->first_tx = 1;
proc->frame_offset = 0;
......
[*]
[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI
[*] Sat Aug 6 15:00:27 2016
[*] Fri May 4 13:17:37 2018
[*]
[dumpfile] "/tmp/openair_dump_eNB.vcd"
[dumpfile_mtime] "Sat Aug 6 14:59:21 2016"
[dumpfile_size] 991809002
[savefile] "/home/fourmi/openairinterface5g/targets/RT/USER/rcc_if4.gtkw"
[timestart] 0
[size] 1301 716
[pos] 309 0
[dumpfile_mtime] "Fri May 4 13:12:37 2018"
[dumpfile_size] 90116003
[savefile] "/home/massive/openairinterface5g/targets/RT/USER/rcc_if4.gtkw"
[timestart] 15824630000
[size] 1405 882
[pos] -5 -272
*-19.793451 7382528436 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[sst_width] 284
[signals_width] 262
[sst_expanded] 1
[sst_vpaned_height] 294
[sst_vpaned_height] 383
@24
variables.trx_ts[63:0]
variables.trx_tst[63:0]
@28
functions.recv_if4
functions.send_if4
functions.recv_if4(RU0)
functions.recv_if4(RU1)
functions.send_if4(RU0)
functions.send_if4(RU1)
functions.eNB_thread_rxtx0
@24
variables.subframe_number_RX0_RU[63:0]
@25
variables.frame_number_RX0_RU[63:0]
@24
variables.frame_number_RX0_eNB[63:0]
variables.subframe_number_RX0_eNB[63:0]
variables.frame_number_TX0_eNB[63:0]
variables.subframe_number_TX0_eNB[63:0]
@28
functions.phy_procedures_eNb_tx0
functions.phy_procedures_eNb_rx_common0
functions.phy_procedures_eNb_rx_uespec0
functions.eNB_thread_rxtx1
@24
......@@ -36,13 +41,10 @@ variables.frame_number_RX1_eNB[63:0]
variables.subframe_number_RX1_eNB[63:0]
variables.frame_number_TX1_eNB[63:0]
variables.subframe_number_TX1_eNB[63:0]
@29
functions.phy_procedures_eNb_tx1
@28
functions.phy_procedures_eNb_rx_common1
functions.phy_procedures_eNb_tx1
functions.phy_procedures_eNb_rx_uespec1
functions.phy_enb_sfgen
functions.phy_eNB_slot_fep
functions.phy_enb_prach_rx
@24
variables.dci_info[63:0]
......
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