Commit fe999623 authored by navid's avatar navid

* update bladerf api (now it respect the timing)

* update the tx/rx bandwidth according to sampling rate 
* add openair2 stats


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7609 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 651a9252
...@@ -447,13 +447,20 @@ typedef struct { ...@@ -447,13 +447,20 @@ typedef struct {
// //
uint32_t total_dlsch_pdus_tx; uint32_t total_dlsch_pdus_tx;
// here for RX
// //
uint32_t ulsch_bitrate; uint32_t ulsch_bitrate;
// //
uint32_t ulsch_bytes_rx; uint32_t ulsch_bytes_rx;
// //
uint64_t ulsch_pdus_rx; uint64_t ulsch_pdus_rx;
// here for RX
uint32_t total_ulsch_bitrate;
//
uint32_t total_ulsch_bytes_rx;
//
uint32_t total_ulsch_pdus_rx;
} eNB_STATS; } eNB_STATS;
/*! \brief eNB statistics for the connected UEs*/ /*! \brief eNB statistics for the connected UEs*/
typedef struct { typedef struct {
...@@ -490,12 +497,6 @@ typedef struct { ...@@ -490,12 +497,6 @@ typedef struct {
// total rb used for retransmission // total rb used for retransmission
uint32_t total_rbs_used_retx; uint32_t total_rbs_used_retx;
/// preassigned mcs after rate adaptation
uint8_t ulsch_mcs1;
/// adjusted mcs
uint8_t ulsch_mcs2;
/// TX /// TX
/// Num pkt /// Num pkt
uint32_t num_pdu_tx[NB_RB_MAX]; uint32_t num_pdu_tx[NB_RB_MAX];
...@@ -528,6 +529,12 @@ typedef struct { ...@@ -528,6 +529,12 @@ typedef struct {
// uint32_t avg_pdu_size; // uint32_t avg_pdu_size;
/// RX /// RX
/// preassigned mcs after rate adaptation
uint8_t ulsch_mcs1;
/// adjusted mcs
uint8_t ulsch_mcs2;
/// estimated average pdu inter-departure time /// estimated average pdu inter-departure time
uint32_t avg_pdu_idt; uint32_t avg_pdu_idt;
/// estimated average pdu size /// estimated average pdu size
...@@ -536,6 +543,22 @@ typedef struct { ...@@ -536,6 +543,22 @@ typedef struct {
uint32_t aggregated_pdu_size; uint32_t aggregated_pdu_size;
uint32_t aggregated_pdu_arrival; uint32_t aggregated_pdu_arrival;
/// uplink transport block size
uint32_t ulsch_TBS;
/// total rb used for a new uplink transmission
uint32_t num_retransmission_rx;
/// total rb used for a new uplink transmission
uint32_t rbs_used_rx;
/// total rb used for a new uplink retransmission
uint32_t rbs_used_retx_rx;
/// total rb used for a new uplink transmission
uint32_t total_rbs_used_rx;
/// normalized rx power
int32_t normalized_rx_power;
/// target rx power
int32_t target_rx_power;
/// num rx pdu /// num rx pdu
uint32_t num_pdu_rx[NB_RB_MAX]; uint32_t num_pdu_rx[NB_RB_MAX];
/// num bytes rx /// num bytes rx
...@@ -544,8 +567,19 @@ typedef struct { ...@@ -544,8 +567,19 @@ typedef struct {
// uint32_t tti_goodput[NB_RB_MAX]; // uint32_t tti_goodput[NB_RB_MAX];
/// errors /// errors
uint32_t num_errors_rx; uint32_t num_errors_rx;
/// overall
uint64_t overhead_bytes_rx;
/// headers+ CE + padding bytes for a MAC PDU
uint64_t total_overhead_bytes_rx;
/// headers+ CE + padding bytes for a MAC PDU
uint64_t avg_overhead_bytes_rx;
//
uint32_t ulsch_bitrate;
//total
uint32_t total_ulsch_bitrate;
/// overall
/// MAC pdu bytes
uint64_t pdu_bytes_rx;
/// total MAC pdu bytes /// total MAC pdu bytes
uint64_t total_pdu_bytes_rx; uint64_t total_pdu_bytes_rx;
/// total num pdu /// total num pdu
......
...@@ -107,6 +107,9 @@ void rx_sdu( ...@@ -107,6 +107,9 @@ void rx_sdu(
payload_ptr = parse_ulsch_header(sduP,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,sdu_lenP); payload_ptr = parse_ulsch_header(sduP,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,sdu_lenP);
eNB->eNB_stats[CC_idP].ulsch_bytes_rx=sdu_lenP;
eNB->eNB_stats[CC_idP].total_ulsch_bytes_rx+=sdu_lenP;
eNB->eNB_stats[CC_idP].total_ulsch_pdus_rx+=1;
// control element // control element
for (i=0; i<num_ce; i++) { for (i=0; i<num_ce; i++) {
...@@ -343,7 +346,6 @@ void rx_sdu( ...@@ -343,7 +346,6 @@ void rx_sdu(
} }
payload_ptr+=rx_lengths[i]; payload_ptr+=rx_lengths[i];
} }
/* NN--> FK: we could either check the payload, or use a phy helper to detect a false msg3 */ /* NN--> FK: we could either check the payload, or use a phy helper to detect a false msg3 */
...@@ -357,6 +359,7 @@ void rx_sdu( ...@@ -357,6 +359,7 @@ void rx_sdu(
} }
} }
} else { } else {
UE_list->eNB_UE_stats[CC_idP][UE_id].pdu_bytes_rx=sdu_lenP;
UE_list->eNB_UE_stats[CC_idP][UE_id].total_pdu_bytes_rx+=sdu_lenP; UE_list->eNB_UE_stats[CC_idP][UE_id].total_pdu_bytes_rx+=sdu_lenP;
UE_list->eNB_UE_stats[CC_idP][UE_id].total_num_pdus_rx+=1; UE_list->eNB_UE_stats[CC_idP][UE_id].total_num_pdus_rx+=1;
} }
...@@ -769,7 +772,9 @@ void schedule_ulsch_rnti(module_id_t module_idP, ...@@ -769,7 +772,9 @@ void schedule_ulsch_rnti(module_id_t module_idP,
ndi = 1-UE_template->oldNDI_UL[harq_pid]; ndi = 1-UE_template->oldNDI_UL[harq_pid];
UE_template->oldNDI_UL[harq_pid]=ndi; UE_template->oldNDI_UL[harq_pid]=ndi;
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=UE_template->pre_assigned_mcs_ul; UE_list->eNB_UE_stats[CC_id][UE_id].normalized_rx_power=normalized_rx_power;
UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power=target_rx_power;
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1=UE_template->pre_assigned_mcs_ul;
mcs = cmin (UE_template->pre_assigned_mcs_ul, openair_daq_vars.target_ue_ul_mcs); // adjust, based on user-defined MCS mcs = cmin (UE_template->pre_assigned_mcs_ul, openair_daq_vars.target_ue_ul_mcs); // adjust, based on user-defined MCS
if (UE_template->pre_allocated_rb_table_index_ul >=0) { if (UE_template->pre_allocated_rb_table_index_ul >=0) {
...@@ -788,6 +793,8 @@ void schedule_ulsch_rnti(module_id_t module_idP, ...@@ -788,6 +793,8 @@ void schedule_ulsch_rnti(module_id_t module_idP,
} }
TBS = mac_xface->get_TBS_UL(mcs,rb_table[rb_table_index]); TBS = mac_xface->get_TBS_UL(mcs,rb_table[rb_table_index]);
UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx+=rb_table[rb_table_index];
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS=TBS;
buffer_occupancy -= TBS; buffer_occupancy -= TBS;
rballoc = mac_xface->computeRIV(frame_parms->N_RB_UL, rballoc = mac_xface->computeRIV(frame_parms->N_RB_UL,
first_rb[CC_id], first_rb[CC_id],
...@@ -817,16 +824,21 @@ void schedule_ulsch_rnti(module_id_t module_idP, ...@@ -817,16 +824,21 @@ void schedule_ulsch_rnti(module_id_t module_idP,
} }
LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE retransmission (mcs %d, first rb %d, nb_rb %d, TBS %d, harq_pid %d, round %d)\n", LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE retransmission (mcs %d, first rb %d, nb_rb %d, harq_pid %d, round %d)\n",
module_idP,UE_id,rnti,CC_id,frameP,subframeP,mcs, module_idP,UE_id,rnti,CC_id,frameP,subframeP,mcs,
first_rb[CC_id],UE_template->nb_rb_ul[harq_pid], first_rb[CC_id],UE_template->nb_rb_ul[harq_pid],
TBS,//mac_xface->get_TBS_UL(mcs,UE_template->nb_rb_ul[harq_pid]),
harq_pid, round); harq_pid, round);
rballoc = mac_xface->computeRIV(frame_parms->N_RB_UL, rballoc = mac_xface->computeRIV(frame_parms->N_RB_UL,
first_rb[CC_id], first_rb[CC_id],
UE_template->nb_rb_ul[harq_pid]); UE_template->nb_rb_ul[harq_pid]);
first_rb[CC_id]+=UE_template->nb_rb_ul[harq_pid]; // increment for next UE allocation first_rb[CC_id]+=UE_template->nb_rb_ul[harq_pid]; // increment for next UE allocation
UE_list->eNB_UE_stats[CC_id][UE_id].num_retransmission_rx+=1;
UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used_retx_rx=UE_template->nb_rb_ul[harq_pid];
UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx+=UE_template->nb_rb_ul[harq_pid];
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1=mcs;
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=mcs;
} }
// Cyclic shift for DM RS // Cyclic shift for DM RS
......
...@@ -102,23 +102,14 @@ int dump_eNB_l2_stats(char *buffer, int length) ...@@ -102,23 +102,14 @@ int dump_eNB_l2_stats(char *buffer, int length)
eNB->eNB_stats[CC_id].total_bcch_buffer, eNB->eNB_stats[CC_id].total_bcch_buffer,
eNB->eNB_stats[CC_id].bcch_mcs); eNB->eNB_stats[CC_id].bcch_mcs);
len += sprintf(&buffer[len],"CCCH , NB_TX_MAC = %d, transmitted bytes (TTI %d, total %d) MCS (TTI %d)\n",
eNB->eNB_stats[CC_id].total_num_bcch_pdu,
eNB->eNB_stats[CC_id].bcch_buffer,
eNB->eNB_stats[CC_id].total_bcch_buffer,
eNB->eNB_stats[CC_id].bcch_mcs);
len += sprintf(&buffer[len],"DCCH , NB_TX_MAC = %d, transmitted bytes (TTI %d, total %d) MCS (TTI %d)\n",
eNB->eNB_stats[CC_id].total_num_bcch_pdu,
eNB->eNB_stats[CC_id].bcch_buffer,
eNB->eNB_stats[CC_id].total_bcch_buffer,
eNB->eNB_stats[CC_id].bcch_mcs);
eNB->eNB_stats[CC_id].dlsch_bitrate=((eNB->eNB_stats[CC_id].dlsch_bytes_tx*8)/((eNB->frame + 1)*10)); eNB->eNB_stats[CC_id].dlsch_bitrate=((eNB->eNB_stats[CC_id].dlsch_bytes_tx*8)/((eNB->frame + 1)*10));
eNB->eNB_stats[CC_id].total_dlsch_pdus_tx+=eNB->eNB_stats[CC_id].dlsch_pdus_tx; eNB->eNB_stats[CC_id].total_dlsch_pdus_tx+=eNB->eNB_stats[CC_id].dlsch_pdus_tx;
eNB->eNB_stats[CC_id].total_dlsch_bytes_tx+=eNB->eNB_stats[CC_id].dlsch_bytes_tx; eNB->eNB_stats[CC_id].total_dlsch_bytes_tx+=eNB->eNB_stats[CC_id].dlsch_bytes_tx;
eNB->eNB_stats[CC_id].total_dlsch_bitrate=((eNB->eNB_stats[CC_id].total_dlsch_bytes_tx*8)/((eNB->frame + 1)*10)); eNB->eNB_stats[CC_id].total_dlsch_bitrate=((eNB->eNB_stats[CC_id].total_dlsch_bytes_tx*8)/((eNB->frame + 1)*10));
eNB->eNB_stats[CC_id].ulsch_bitrate=((eNB->eNB_stats[CC_id].ulsch_bytes_rx*8)/((eNB->frame + 1)*10));
eNB->eNB_stats[CC_id].total_ulsch_bitrate=((eNB->eNB_stats[CC_id].total_ulsch_bytes_rx*8)/((eNB->frame + 1)*10));
len += sprintf(&buffer[len],"DLSCH bitrate (TTI %u, avg %u) kbps, Transmitted bytes (TTI %u, total %u), Transmitted PDU (TTI %u, total %u) \n", len += sprintf(&buffer[len],"DLSCH bitrate (TTI %u, avg %u) kbps, Transmitted bytes (TTI %u, total %u), Transmitted PDU (TTI %u, total %u) \n",
eNB->eNB_stats[CC_id].dlsch_bitrate, eNB->eNB_stats[CC_id].dlsch_bitrate,
eNB->eNB_stats[CC_id].total_dlsch_bitrate, eNB->eNB_stats[CC_id].total_dlsch_bitrate,
...@@ -126,6 +117,14 @@ int dump_eNB_l2_stats(char *buffer, int length) ...@@ -126,6 +117,14 @@ int dump_eNB_l2_stats(char *buffer, int length)
eNB->eNB_stats[CC_id].total_dlsch_bytes_tx, eNB->eNB_stats[CC_id].total_dlsch_bytes_tx,
eNB->eNB_stats[CC_id].dlsch_pdus_tx, eNB->eNB_stats[CC_id].dlsch_pdus_tx,
eNB->eNB_stats[CC_id].total_dlsch_pdus_tx); eNB->eNB_stats[CC_id].total_dlsch_pdus_tx);
len += sprintf(&buffer[len],"ULSCH bitrate (TTI %u, avg %u) kbps, Received bytes (TTI %u, total %u), Received PDU (TTI %u, total %lu) \n",
eNB->eNB_stats[CC_id].ulsch_bitrate,
eNB->eNB_stats[CC_id].total_ulsch_bitrate,
eNB->eNB_stats[CC_id].ulsch_bytes_rx,
eNB->eNB_stats[CC_id].total_ulsch_bytes_rx,
eNB->eNB_stats[CC_id].ulsch_pdus_rx,
eNB->eNB_stats[CC_id].total_ulsch_pdus_rx);
} }
len += sprintf(&buffer[len],"\n"); len += sprintf(&buffer[len],"\n");
...@@ -133,12 +132,16 @@ int dump_eNB_l2_stats(char *buffer, int length) ...@@ -133,12 +132,16 @@ int dump_eNB_l2_stats(char *buffer, int length)
for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
for (i=0; i<UE_list->numactiveCCs[UE_id]; i++) { for (i=0; i<UE_list->numactiveCCs[UE_id]; i++) {
CC_id=UE_list->ordered_CCids[i][UE_id]; CC_id=UE_list->ordered_CCids[i][UE_id];
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_bitrate=((UE_list->eNB_UE_stats[CC_id][UE_id].TBS*8)/((eNB->frame + 1)*10)); UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_bitrate=((UE_list->eNB_UE_stats[CC_id][UE_id].TBS*8)/((eNB->frame + 1)*10));
UE_list->eNB_UE_stats[CC_id][UE_id].total_dlsch_bitrate= ((UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes*8)/((eNB->frame + 1)*10)); UE_list->eNB_UE_stats[CC_id][UE_id].total_dlsch_bitrate= ((UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes*8)/((eNB->frame + 1)*10));
UE_list->eNB_UE_stats[CC_id][UE_id].total_overhead_bytes+= UE_list->eNB_UE_stats[CC_id][UE_id].overhead_bytes; UE_list->eNB_UE_stats[CC_id][UE_id].total_overhead_bytes+= UE_list->eNB_UE_stats[CC_id][UE_id].overhead_bytes;
UE_list->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes=((UE_list->eNB_UE_stats[CC_id][UE_id].total_overhead_bytes*8)/((eNB->frame + 1)*10)); UE_list->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes=((UE_list->eNB_UE_stats[CC_id][UE_id].total_overhead_bytes*8)/((eNB->frame + 1)*10));
len += sprintf(&buffer[len],"UE %d %s, RNTI %x : CQI %d, MCS1 %d, MCS2 %d, RB (tx %d, retx %d, total %d), ncce (tx %d, retx %d) \n", UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_bitrate=((UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS*8)/((eNB->frame + 1)*10));
UE_list->eNB_UE_stats[CC_id][UE_id].total_ulsch_bitrate= ((UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes_rx*8)/((eNB->frame + 1)*10));
len += sprintf(&buffer[len],"UE %d %s (DLSCH), RNTI %x : CQI %d, MCS1 %d, MCS2 %d, RB (tx %d, retx %d, total %d), ncce (tx %d, retx %d) \n",
UE_id, UE_id,
map_int_to_str(rrc_status_names, UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status), map_int_to_str(rrc_status_names, UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status),
UE_list->eNB_UE_stats[CC_id][UE_id].crnti, UE_list->eNB_UE_stats[CC_id][UE_id].crnti,
...@@ -165,12 +168,30 @@ int dump_eNB_l2_stats(char *buffer, int length) ...@@ -165,12 +168,30 @@ int dump_eNB_l2_stats(char *buffer, int length)
UE_list->eNB_UE_stats[CC_id][UE_id].total_overhead_bytes, UE_list->eNB_UE_stats[CC_id][UE_id].total_overhead_bytes,
UE_list->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes UE_list->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes
); );
len += sprintf(&buffer[len],"UE %d %s (ULSCH), RNTI %x : rx power (normalized %d, target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n",
UE_id,
map_int_to_str(rrc_status_names, UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status),
UE_list->eNB_UE_stats[CC_id][UE_id].crnti,
UE_list->eNB_UE_stats[CC_id][UE_id].normalized_rx_power,
UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power,
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1,
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2,
UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used_rx,
UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used_retx_rx,
UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx,
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS
);
len += sprintf(&buffer[len], len += sprintf(&buffer[len],
"[MAC] ULSCH received bytes (total %"PRIu64")," "[MAC] ULSCH bitrate (TTI %d, avg %d), received bytes (total %"PRIu64"),"
"Total received PDU %d, Total errors %d\n", "Total received PDU %d, Total errors %d\n",
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_bitrate,
UE_list->eNB_UE_stats[CC_id][UE_id].total_ulsch_bitrate,
UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes_rx, UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes_rx,
UE_list->eNB_UE_stats[CC_id][UE_id].total_num_pdus_rx, UE_list->eNB_UE_stats[CC_id][UE_id].total_num_pdus_rx,
UE_list->eNB_UE_stats[CC_id][UE_id].num_errors_rx); UE_list->eNB_UE_stats[CC_id][UE_id].num_errors_rx);
len+= sprintf(&buffer[len],"Received PHR PH = %d (db)\n", UE_list->UE_template[CC_id][UE_id].phr_info); len+= sprintf(&buffer[len],"Received PHR PH = %d (db)\n", UE_list->UE_template[CC_id][UE_id].phr_info);
len+= sprintf(&buffer[len],"Received BSR LCGID[0][1][2][3] = %u %u %u %u\n", len+= sprintf(&buffer[len],"Received BSR LCGID[0][1][2][3] = %u %u %u %u\n",
UE_list->UE_template[CC_id][UE_id].bsr_info[LCGID0], UE_list->UE_template[CC_id][UE_id].bsr_info[LCGID0],
......
...@@ -710,7 +710,7 @@ rrc_ue_establish_drb( ...@@ -710,7 +710,7 @@ rrc_ue_establish_drb(
RADIO_ACCESS_BEARER,Rlc_info_um); RADIO_ACCESS_BEARER,Rlc_info_um);
*/ */
#ifdef PDCP_USE_NETLINK #ifdef PDCP_USE_NETLINK
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) && !defined(LINK_ENB_PDCP_TO_GTPV1U) # if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADERF) && !defined(LINK_ENB_PDCP_TO_GTPV1U)
# ifdef OAI_EMU # ifdef OAI_EMU
ip_addr_offset3 = oai_emulation.info.nb_enb_local; ip_addr_offset3 = oai_emulation.info.nb_enb_local;
ip_addr_offset4 = NB_eNB_INST; ip_addr_offset4 = NB_eNB_INST;
......
...@@ -3005,7 +3005,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( ...@@ -3005,7 +3005,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
ctxt_pP->module_id, ctxt_pP->frame, (int)DRB_configList->list.array[i]->drb_Identity); ctxt_pP->module_id, ctxt_pP->frame, (int)DRB_configList->list.array[i]->drb_Identity);
#if defined(PDCP_USE_NETLINK) && !defined(LINK_ENB_PDCP_TO_GTPV1U) #if defined(PDCP_USE_NETLINK) && !defined(LINK_ENB_PDCP_TO_GTPV1U)
// can mean also IPV6 since ether -> ipv6 autoconf // can mean also IPV6 since ether -> ipv6 autoconf
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) # if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADERF)
LOG_I(OIP, "[eNB %d] trying to bring up the OAI interface oai%d\n", LOG_I(OIP, "[eNB %d] trying to bring up the OAI interface oai%d\n",
ctxt_pP->module_id, ctxt_pP->module_id,
ctxt_pP->module_id); ctxt_pP->module_id);
......
...@@ -33,44 +33,47 @@ ...@@ -33,44 +33,47 @@
*/ */
#include <libbladeRF.h> #include <libbladeRF.h>
/*
enum brf_err_num{ #include "common_lib.h"
BLADERF_ERR_MIN=0, #include "log.h"
BLADERF_ERR_UNEXPECTED=-1,
BLADERF_ERR_RANGE=-2, typedef struct {
BLADERF_ERR_INVAL=-3,
BLADERF_ERR_MEM=-4, // opaque BRF data struct
BLADERF_ERR_IO=-5, struct bladerf *dev;
BLADERF_ERR_TIMEOUT=-6, // An empty ("") or NULL device identifier will result in the first encountered device being opened (using the first discovered backend)
BLADERF_ERR_NODEV=-7,
BLADERF_ERR_UNSUPPORTED=-8, unsigned int num_buffers;
BLADERF_ERR_MISALIGNED=-9, unsigned int buffer_size;
BLADERF_ERR_CHECKSUM=-10, unsigned int num_transfers;
BLADERF_ERR_NO_FILE=-11, unsigned int timeout_ms;
BLADERF_ERR_UPDATE_FPGA=-12,
BLADERF_ERR_UPDATE_FW=-13, struct bladerf_metadata meta_rx;
BLADERF_ERR_TIME_PAST=-14, struct bladerf_metadata meta_tx;
BLADERF_ERR_MAX=-15,
} unsigned int sample_rate;
mapping brf_err_names[] = { // time offset between transmiter timestamp and receiver timestamp;
{"BLADERF_OK", BLADERF_ERR_MIN}, double tdiff;
{"BLADERF_ERR_UNEXPECTED",BLADERF_ERR_UNEXPECTED}, // use brf_time_offset to get this value
{"BLADERF_ERR_RANGE",BLADERF_ERR_RANGE}, int tx_forward_nsamps; //166 for 20Mhz
{"BLADERF_ERR_INVAL",BLADERF_ERR_INVAL},
{"BLADERF_ERR_MEM",BLADERF_ERR_MEM},
{"BLADERF_ERR_IO",BLADERF_ERR_IO}, // --------------------------------
{"BLADERF_ERR_TIMEOUT",BLADERF_ERR_TIMEOUT}, // Debug and output control
{"BLADERF_ERR_NODEV",BLADERF_ERR_NODEV}, // --------------------------------
{"BLADERF_ERR_UNSUPPORTED",BLADERF_ERR_UNSUPPORTED}, int num_underflows;
{"BLADERF_ERR_MISALIGNED",BLADERF_ERR_MISALIGNED}, int num_overflows;
{"BLADERF_ERR_CHECKSUM",BLADERF_ERR_CHECKSUM}, int num_seq_errors;
{"BLADERF_ERR_NO_FILE",BLADERF_ERR_NO_FILE}, int num_rx_errors;
{"BLADERF_ERR_UPDATE_FPGA",BLADERF_ERR_UPDATE_FPGA}, int num_tx_errors;
{"BLADERF_ERR_UPDATE_FW",BLADERF_ERR_UPDATE_FW},
{"BLADERF_ERR_TIME_PAST",BLADERF_ERR_TIME_PAST}, uint64_t tx_actual_count;
{NULL, BLADERF_ERR_MAX} uint64_t rx_actual_count;
}; uint64_t tx_count;
*/ uint64_t rx_count;
openair0_timestamp rx_timestamp;
} brf_state_t;
/* /*
* func prototypes * func prototypes
*/ */
......
...@@ -292,7 +292,7 @@ char ref[128] = "internal"; ...@@ -292,7 +292,7 @@ char ref[128] = "internal";
char channels[128] = "0"; char channels[128] = "0";
unsigned int samples_per_frame = 307200; unsigned int samples_per_frame = 307200;
unsigned int tx_forward_nsamps; unsigned int tx_forward_nsamps=0;
int tx_delay; int tx_delay;
#endif #endif
...@@ -990,12 +990,16 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB) ...@@ -990,12 +990,16 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[0]= ((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[0]=
#ifdef EXMIMO #ifdef EXMIMO
((short*)dummy_tx_b)[2*i]<<4; ((short*)dummy_tx_b)[2*i]<<4;
#elif OAI_BLADRF
((short*)dummy_tx_b)[2*i];
#else #else
((short*)dummy_tx_b)[2*i]<<5; ((short*)dummy_tx_b)[2*i]<<5;
#endif #endif
((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[1]= ((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[1]=
#ifdef EXMIMO #ifdef EXMIMO
((short*)dummy_tx_b)[2*i+1]<<4; ((short*)dummy_tx_b)[2*i+1]<<4;
#elif OAI_BLADRF
((short*)dummy_tx_b)[2*i+1];
#else #else
((short*)dummy_tx_b)[2*i+1]<<5; ((short*)dummy_tx_b)[2*i+1]<<5;
#endif #endif
...@@ -1078,7 +1082,7 @@ static void* eNB_thread_tx( void* param ) ...@@ -1078,7 +1082,7 @@ static void* eNB_thread_tx( void* param )
return &eNB_thread_tx_status[proc->subframe]; return &eNB_thread_tx_status[proc->subframe];
} }
LOG_I( HW, "[SCHED] eNB TX deadline thread %d(tid %ld) started on CPU %d\n", proc->subframe, gettid(), sched_getcpu() ); LOG_I( HW, "[SCHED] eNB TX deadline thread %d(Tid %ld) started on CPU %d\n", proc->subframe, gettid(), sched_getcpu() );
#else #else
LOG_I( HW, "[SCHED][eNB] TX thread %d started on CPU %d TID %d\n", proc->subframe, sched_getcpu(),gettid() ); LOG_I( HW, "[SCHED][eNB] TX thread %d started on CPU %d TID %d\n", proc->subframe, sched_getcpu(),gettid() );
#endif #endif
...@@ -1256,8 +1260,8 @@ static void* eNB_thread_rx( void* param ) ...@@ -1256,8 +1260,8 @@ static void* eNB_thread_rx( void* param )
/* This creates a 2ms reservation every 10ms period*/ /* This creates a 2ms reservation every 10ms period*/
attr.sched_policy = SCHED_DEADLINE; attr.sched_policy = SCHED_DEADLINE;
attr.sched_runtime = 0.9 * 1000000; // each rx thread must finish its job in the worst case in 2ms attr.sched_runtime = 1 * 1000000; // each rx thread must finish its job in the worst case in 2ms
attr.sched_deadline = 2 * 1000000; // each rx thread will finish within 2ms attr.sched_deadline = 1 * 1000000; // each rx thread will finish within 2ms
attr.sched_period = 1 * 10000000; // each rx thread has a period of 10ms from the starting point attr.sched_period = 1 * 10000000; // each rx thread has a period of 10ms from the starting point
if (sched_setattr(0, &attr, flags) < 0 ) { if (sched_setattr(0, &attr, flags) < 0 ) {
...@@ -1265,7 +1269,7 @@ static void* eNB_thread_rx( void* param ) ...@@ -1265,7 +1269,7 @@ static void* eNB_thread_rx( void* param )
return &eNB_thread_rx_status[proc->subframe]; return &eNB_thread_rx_status[proc->subframe];
} }
LOG_I( HW, "[SCHED] eNB RX deadline thread %d(id %ld) started on CPU %d\n", proc->subframe, gettid(), sched_getcpu() ); LOG_I( HW, "[SCHED] eNB RX deadline thread %d(TID %ld) started on CPU %d\n", proc->subframe, gettid(), sched_getcpu() );
#else #else
LOG_I( HW, "[SCHED][eNB] RX thread %d started on CPU %d TID %d\n", proc->subframe, sched_getcpu(),gettid() ); LOG_I( HW, "[SCHED][eNB] RX thread %d started on CPU %d TID %d\n", proc->subframe, sched_getcpu(),gettid() );
#endif #endif
...@@ -1573,8 +1577,8 @@ static void* eNB_thread( void* arg ) ...@@ -1573,8 +1577,8 @@ static void* eNB_thread( void* arg )
/* This creates a .5 ms reservation */ /* This creates a .5 ms reservation */
attr.sched_policy = SCHED_DEADLINE; attr.sched_policy = SCHED_DEADLINE;
attr.sched_runtime = 0.1 * 1000000; attr.sched_runtime = 0.2 * 1000000;
attr.sched_deadline = 0.5 * 1000000; attr.sched_deadline = 0.9 * 1000000;
attr.sched_period = 1.0 * 1000000; attr.sched_period = 1.0 * 1000000;
...@@ -1769,9 +1773,10 @@ static void* eNB_thread( void* arg ) ...@@ -1769,9 +1773,10 @@ static void* eNB_thread( void* arg )
stop_meas( &softmodem_stats_hw ); stop_meas( &softmodem_stats_hw );
clock_gettime( CLOCK_MONOTONIC, &trx_time1 ); clock_gettime( CLOCK_MONOTONIC, &trx_time1 );
if (frame > 10){
if (rxs != spp) if (rxs != spp)
exit_fun( "problem receiving samples" ); exit_fun( "problem receiving samples" );
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
// Transmit TX buffer based on timestamp from RX // Transmit TX buffer based on timestamp from RX
...@@ -2798,7 +2803,6 @@ int main( int argc, char **argv ) ...@@ -2798,7 +2803,6 @@ int main( int argc, char **argv )
} }
dump_frame_parms(frame_parms[0]); dump_frame_parms(frame_parms[0]);
if(frame_parms[0]->N_RB_DL == 100) { if(frame_parms[0]->N_RB_DL == 100) {
...@@ -2807,6 +2811,8 @@ int main( int argc, char **argv ) ...@@ -2807,6 +2811,8 @@ int main( int argc, char **argv )
#ifndef EXMIMO #ifndef EXMIMO
openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].samples_per_packet = 2048;
samples_per_frame = 307200; samples_per_frame = 307200;
openair0_cfg[card].tx_bw = 10e6;
openair0_cfg[card].rx_bw = 10e6;
// from usrp_time_offset // from usrp_time_offset
tx_forward_nsamps = 175; tx_forward_nsamps = 175;
tx_delay = 8; tx_delay = 8;
...@@ -2817,6 +2823,8 @@ int main( int argc, char **argv ) ...@@ -2817,6 +2823,8 @@ int main( int argc, char **argv )
#ifndef EXMIMO #ifndef EXMIMO
openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].samples_per_packet = 2048;
samples_per_frame = 153600; samples_per_frame = 153600;
openair0_cfg[card].tx_bw = 5e6;
openair0_cfg[card].rx_bw = 5e6;
tx_forward_nsamps = 95; tx_forward_nsamps = 95;
tx_delay = 5; tx_delay = 5;
#endif #endif
...@@ -2824,10 +2832,17 @@ int main( int argc, char **argv ) ...@@ -2824,10 +2832,17 @@ int main( int argc, char **argv )
sample_rate = 7.68e6; sample_rate = 7.68e6;
bw = 2.5e6; bw = 2.5e6;
#ifndef EXMIMO #ifndef EXMIMO
openair0_cfg[0].samples_per_packet = 1024;
samples_per_frame = 76800; samples_per_frame = 76800;
openair0_cfg[card].tx_bw = 2.5e6;
openair0_cfg[card].rx_bw = 2.5e6;
openair0_cfg[0].samples_per_packet = 1024;
#ifdef OAI_USRP
tx_forward_nsamps = 70;
tx_delay = 6;
#elif OAI_BLADERF
tx_forward_nsamps = 70; tx_forward_nsamps = 70;
tx_delay = 6; tx_delay = 6;
#endif
#endif #endif
} else if (frame_parms[0]->N_RB_DL == 6) { } else if (frame_parms[0]->N_RB_DL == 6) {
sample_rate = 1.92e6; sample_rate = 1.92e6;
...@@ -2835,6 +2850,8 @@ int main( int argc, char **argv ) ...@@ -2835,6 +2850,8 @@ int main( int argc, char **argv )
#ifndef EXMIMO #ifndef EXMIMO
openair0_cfg[0].samples_per_packet = 256; openair0_cfg[0].samples_per_packet = 256;
samples_per_frame = 19200; samples_per_frame = 19200;
openair0_cfg[card].tx_bw = 1.5e6;
openair0_cfg[card].rx_bw = 1.5e6;
tx_forward_nsamps = 40; tx_forward_nsamps = 40;
tx_delay = 8; tx_delay = 8;
#endif #endif
......
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