Commit 184d51c6 authored by Cedric Roux's avatar Cedric Roux

Merge remote-tracking branch 'origin/develop_integration_2018_w15' into develop

Summary of changes:
- some work on better parallel processing of eNB
  try the eNB with options: --fepw --codingw
- small changes for multi-UE simulation and simulation accuracy
  (UE power levels)
- initial work for the UE to use TUN device instead of ue_ip.ko
  only done for oaisim, default bearer, compile with:
    ./build_oai --ue-nas-use-tun <rest of options>
parents 1272cabb 79eb6eb4
......@@ -242,6 +242,7 @@ add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace")
add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace")
add_boolean_option(DISABLE_LOG_X False "Deactivate all LOG_* macros")
add_boolean_option(USRP_REC_PLAY False "Enable USRP record playback mode")
add_boolean_option(UE_NAS_USE_TUN False "Enable UE NAS TUN device instead of ue_ip.ko")
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
......@@ -1365,6 +1366,7 @@ set (MAC_SRC
${MAC_DIR}/eNB_scheduler_bch.c
${MAC_DIR}/eNB_scheduler_primitives.c
${MAC_DIR}/eNB_scheduler_RA.c
${MAC_DIR}/eNB_scheduler_phytest.c
${MAC_DIR}/pre_processor.c
${MAC_DIR}/config.c
${MAC_DIR}/config_ue.c
......
......@@ -67,6 +67,7 @@ UE_TIMING_TRACE="False"
DISABLE_LOG_X="False"
USRP_REC_PLAY="False"
BUILD_ECLIPSE=0
UE_NAS_USE_TUN="False"
trap handle_ctrl_c INT
function print_help() {
......@@ -156,6 +157,8 @@ Options
Build eclipse project files. Paths are auto corrected by fixprj.sh
--usrp-recplay
Build for I/Q record-playback modes
--ue-nas-use-tun
Use TUN devices for the UEs instead of ue_ip.ko
Usage (first build):
oaisim (eNB + UE): ./build_oai -I --oaisim -x --install-system-files
Eurecom EXMIMO + COTS UE : ./build_oai -I --eNB -x --install-system-files
......@@ -347,6 +350,10 @@ function main() {
USRP_REC_PLAY="True"
echo_info "Enabling USRP record playback mode"
shift 1;;
--ue-nas-use-tun)
UE_NAS_USE_TUN="True"
echo_info "Enabling UE NAS TUN device usage instead of ue_ip.ko"
shift 1;;
-h | --help)
print_help
exit 1;;
......@@ -696,6 +703,7 @@ function main() {
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
echo "set ( UE_NAS_USE_TUN $UE_NAS_USE_TUN )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
[ "$CLEAN" = "1" ] && rm -rf $DIR/$oaisim_build_dir/build
mkdir -p $DIR/$oaisim_build_dir/build
......@@ -704,6 +712,12 @@ function main() {
compilations \
$oaisim_build_dir $oaisim_exec \
$oaisim_exec $dbin/$oaisim_exec.$REL
compilations \
$oaisim_build_dir $config_libconfig_shlib \
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
compilations \
$oaisim_build_dir coding \
libcoding.so $dbin/libcoding.so
if [ "$NOS1" != "1" ] ; then
......
......@@ -130,6 +130,7 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
{
case TYPE_STRING:
printf("call config_lookup_string for '%s' %p\n", cfgpath, &(libconfig_privdata.cfg)); fflush(stdout);
if ( config_lookup_string(&(libconfig_privdata.cfg),cfgpath, (const char **)&str)) {
if ( cfgoptions[i].numelt > 0 && str != NULL && strlen(str) >= cfgoptions[i].numelt ) {
fprintf(stderr,"[LIBCONFIG] %s: %s exceeds maximum length of %i bytes, value truncated\n",
......
......@@ -32,7 +32,7 @@ typedef struct {
#define VCD_NUM_FUNCTIONS 187
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_VARIABLES 128
#define VCD_NUM_VARIABLES 131
/* 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)
......
......@@ -1442,6 +1442,18 @@ ID = VCD_VARIABLE_UE0_TRX_WRITE_NS_MISSING
DESC = VCD variable UE0_TRX_WRITE_NS_MISSING
GROUP = ALL:VCD:UE:VCD_VARIABLE
FORMAT = ulong,value
ID = VCD_VARIABLE_CPUID_ENB_THREAD_RXTX
DESC = VCD variable CPUID_ENB_THREAD_RXTX
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
ID = VCD_VARIABLE_CPUID_RU_THREAD
DESC = VCD variable CPUID_RU_THREAD
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
ID = VCD_VARIABLE_CPUID_RU_THREAD_TX
DESC = VCD variable CPUID_RU_THREAD_TX
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
#functions
......
......@@ -72,6 +72,9 @@ const int itti_debug = (ITTI_DEBUG_ISSUES | ITTI_DEBUG_MP_STATISTICS);
/* Global message size */
#define MESSAGE_SIZE(mESSAGEiD) (sizeof(MessageHeader) + itti_desc.messages_info[mESSAGEiD].size)
extern int emulate_rf;
typedef enum task_state_s {
TASK_STATE_NOT_CONFIGURED, TASK_STATE_STARTING, TASK_STATE_READY, TASK_STATE_ENDED, TASK_STATE_MAX,
} task_state_t;
......@@ -342,14 +345,16 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me
destination_task_id,
itti_get_task_name(destination_task_id));
} else {
/* We cannot send a message if the task is not running */
AssertFatal (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_READY,
"Task %s Cannot send message %s (%d) to thread %d, it is not in ready state (%d)!\n",
itti_get_task_name(origin_task_id),
itti_desc.messages_info[message_id].name,
message_id,
destination_thread_id,
itti_desc.threads[destination_thread_id].task_state);
if(!emulate_rf){
/* We cannot send a message if the task is not running */
AssertFatal (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_READY,
"Task %s Cannot send message %s (%d) to thread %d, it is not in ready state (%d)!\n",
itti_get_task_name(origin_task_id),
itti_desc.messages_info[message_id].name,
message_id,
destination_thread_id,
itti_desc.threads[destination_thread_id].task_state);
}
/* Allocate new list element */
new = (message_list_t *) itti_malloc (origin_task_id, destination_task_id, sizeof(struct message_list_s));
......
......@@ -201,8 +201,8 @@ void oai_create_enb(void) {
eNB->CC_id = bodge_counter;
eNB->abstraction_flag = 0;
eNB->single_thread_flag = 0;//single_thread_flag;
eNB->td = ulsch_decoding_data;//(single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
eNB->te = dlsch_encoding;//(single_thread_flag==1) ? dlsch_encoding_2threads : dlsch_encoding;
eNB->td = ulsch_decoding_data_all;//(single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
eNB->te = dlsch_encoding_all;//(single_thread_flag==1) ? dlsch_encoding_2threads : dlsch_encoding;
RC.nb_CC[bodge_counter] = 1;
......
......@@ -738,6 +738,7 @@ void phy_config_cba_rnti (module_id_t Mod_id,int CC_id,eNB_flag_t eNB_flag, uin
}
}
int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
unsigned char is_secondary_eNB,
unsigned char abstraction_flag)
......
......@@ -2276,7 +2276,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
/* clear all bits, the above code may generate too much false detections
* (not sure about this, to be checked somehow)
*/
// memset(e, 0, DCI_BITS_MAX);
//memset(e, 0, DCI_BITS_MAX);
e_ptr = e;
......@@ -2298,6 +2298,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
#endif
if (dci_alloc[i].firstCCE>=0) {
//printf("generate DCI .%d rnti %d length %d\n", subframe, dci_alloc[i].rnti, dci_alloc[i].dci_length);
e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
e+(72*dci_alloc[i].firstCCE),
dci_alloc[i].dci_length,
......
......@@ -2183,6 +2183,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
#endif
//printf("DCI %d.%d rnti %d harq %d TBS %d\n", frame, subframe, rel8->rnti, rel8->harq_process, dlsch0_harq->TBS);
#if T_TRACER
if (dlsch0->active)
T(T_ENB_PHY_DLSCH_UE_DCI, T_INT(0), T_INT(frame), T_INT(subframe),
......@@ -5027,7 +5028,7 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms,
pdsch_vars->llr_offset[pdcch_vars->num_pdcch_symbols] = 0;
LOG_I(PHY,"compute_llr_offset: nb RB %d - Qm %d \n", nb_rb_alloc, dlsch0_harq->Qm);
// LOG_I(PHY,"compute_llr_offset: nb RB %d - Qm %d \n", nb_rb_alloc, dlsch0_harq->Qm);
//dlsch0_harq->rb_alloc_even;
//dlsch0_harq->rb_alloc_odd;
......@@ -5056,16 +5057,17 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms,
pdsch_vars->llr_length[symbol] = data_re;
if(symbol < (frame_parms->symbols_per_tti-1))
pdsch_vars->llr_offset[symbol+1] = pdsch_vars->llr_offset[symbol] + llr_offset;
/*
LOG_I(PHY,"Granted Re subframe %d / symbol %d => %d (%d RBs)\n", subframe, symbol_mod, granted_re,dlsch0_harq->nb_rb);
LOG_I(PHY,"Pbch/PSS/SSS Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, pbch_pss_sss_re);
LOG_I(PHY,"CRS Re Per PRB subframe %d / symbol %d => %d \n", subframe, symbol_mod, crs_re);
LOG_I(PHY,"Data Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, data_re);
LOG_I(PHY,"Data Re subframe %d-symbol %d => llr length %d, llr offset %d \n", subframe, symbol,
pdsch_vars->llr_length[symbol], pdsch_vars->llr_offset[symbol]);
*/
}
}
void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
......
This diff is collapsed.
......@@ -48,7 +48,7 @@ int16_t interf_unaw_shift = 13;
//#define DEBUG_HARQ
#define DEBUG_PHY 1
//#define DEBUG_PHY 1
//#define DEBUG_DLSCH_DEMOD 1
//#define DISABLE_LOG_X
......@@ -842,7 +842,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
pllr_symbol_cw1 = (int8_t*)pdsch_vars[eNB_id]->llr[1];
pllr_symbol_cw0 += llr_offset_symbol;
pllr_symbol_cw1 += llr_offset_symbol;
/*
LOG_I(PHY,"compute LLRs [AbsSubframe %d.%d-%d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %p @LLR Buff(symb) %p\n",
frame, subframe,symbol,
nb_rb,dlsch0_harq->Qm,
......@@ -850,7 +850,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
pdsch_vars[eNB_id]->llr_offset[symbol],
(int16_t*)pdsch_vars[eNB_id]->llr[0],
pllr_symbol_cw0);
*/
switch (dlsch0_harq->Qm) {
case 2 :
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
......
......@@ -30,7 +30,7 @@ extern short *ul_ref_sigs_rx[30][2][33];
extern unsigned short dftsizes[33];
extern unsigned short ref_primes[33];
extern int qam64_table[8],qam16_table[4];
extern int qam64_table[8],qam16_table[4],qpsk_table[2];
extern unsigned char cs_ri_normal[4];
extern unsigned char cs_ri_extended[4];
......
......@@ -127,6 +127,20 @@ int32_t dlsch_encoding(PHY_VARS_eNB *eNB,
time_stats_t *rm_stats,
time_stats_t *te_stats,
time_stats_t *i_stats);
int32_t dlsch_encoding_all(PHY_VARS_eNB *eNB,
uint8_t *a,
uint8_t num_pdcch_symbols,
LTE_eNB_DLSCH_t *dlsch,
int frame,
uint8_t subframe,
time_stats_t *rm_stats,
time_stats_t *te_stats,
time_stats_t *te_wait_stats,
time_stats_t *te_main_stats,
time_stats_t *te_wakeup_stats0,
time_stats_t *te_wakeup_stats1,
time_stats_t *i_stats);
int32_t dlsch_encoding_SIC(PHY_VARS_UE *ue,
uint8_t *a,
......@@ -171,7 +185,12 @@ int32_t dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
uint8_t subframe,
time_stats_t *rm_stats,
time_stats_t *te_stats,
time_stats_t *i_stats);
time_stats_t *te_wait_stats,
time_stats_t *te_main_stats,
time_stats_t *te_wakeup_stats0,
time_stats_t *te_wakeup_stats1,
time_stats_t *i_stats,
int worker_num);
void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t *DLSCH_pdu,
......@@ -1488,6 +1507,7 @@ uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB,
void generate_64qam_table(void);
void generate_16qam_table(void);
void generate_qpsk_table(void);
uint16_t extract_crc(uint8_t *dci,uint8_t DCI_LENGTH);
......@@ -1897,6 +1917,11 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
uint8_t Nbundled,
uint8_t llr8_flag);
int ulsch_decoding_data_all(PHY_VARS_eNB *eNB,
int UE_id,
int harq_pid,
int llr8_flag);
/*!
\brief Decoding of ULSCH data component from 36-212. This one spawns 1 worker thread in parallel,half of the segments in each thread.
@param phy_vars_eNB Pointer to eNB top-level descriptor
......
......@@ -31,7 +31,7 @@
*/
//#include "defs.h"
#include <syscall.h>
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/CODING/extern.h"
......@@ -46,6 +46,9 @@
#include "UTIL/LOG/vcd_signal_dumper.h"
//#define DEBUG_ULSCH_DECODING
#include "targets/RT/USER/rt_wrapper.h"
extern int codingw;
void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch)
{
......@@ -221,8 +224,6 @@ uint8_t extract_cqi_crc(uint8_t *cqi,uint8_t CQI_LENGTH)
int ulsch_decoding_data_2thread0(td_params* tdp) {
PHY_VARS_eNB *eNB = tdp->eNB;
......@@ -414,13 +415,20 @@ int ulsch_decoding_data_2thread0(td_params* tdp) {
extern int oai_exit;
void *td_thread(void *param) {
pthread_setname_np( pthread_self(), "td processing");
PHY_VARS_eNB *eNB = ((td_params*)param)->eNB;
eNB_proc_t *proc = &eNB->proc;
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
thread_top_init("td_thread",1,200000,250000,500000);
pthread_setname_np( pthread_self(),"td processing");
LOG_I(PHY,"thread td created id=%ld\n", syscall(__NR_gettid));
//wait_sync("td_thread");
while (!oai_exit) {
if (wait_on_condition(&proc->mutex_td,&proc->cond_td,&proc->instance_cnt_td,"td thread")<0) break;
if(oai_exit) break;
((td_params*)param)->ret = ulsch_decoding_data_2thread0((td_params*)param);
......@@ -623,6 +631,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
break;
}
stop_meas(&eNB->ulsch_turbo_decoding_stats);
//printf("/////////////////////////////////////////**************************loop for %d time in ulsch_decoding main\n",r);
}
// wait for worker to finish
......@@ -782,6 +791,20 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
return(ret);
}
int ulsch_decoding_data_all(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
{
int ret = 0;
/*if(codingw)
{
ret = ulsch_decoding_data_2thread(eNB,UE_id,harq_pid,llr8_flag);
}
else*/
{
ret = ulsch_decoding_data(eNB,UE_id,harq_pid,llr8_flag);
}
return ret;
}
static inline unsigned int lte_gold_unscram(unsigned int *x1, unsigned int *x2, unsigned char reset) __attribute__((always_inline));
static inline unsigned int lte_gold_unscram(unsigned int *x1, unsigned int *x2, unsigned char reset)
{
......
......@@ -62,7 +62,7 @@ unsigned char ue_power_offsets[25] = {14,11,9,8,7,6,6,5,4,4,4,3,3,3,2,2,2,1,1,1,
short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
int qam64_table[8],qam16_table[4];
int qam64_table[8],qam16_table[4],qpsk_table[2];
unsigned char cs_ri_normal[4] = {1,4,7,10};
unsigned char cs_ri_extended[4] = {0,3,5,8};
......
......@@ -53,7 +53,7 @@ void print_meas_now(time_stats_t *ts, const char* name, FILE* file_name){
if (ts->trials>0) {
//fprintf(file_name,"Name %25s: Processing %15.3f ms for SF %d, diff_now %15.3f \n", name,(ts->diff_now/(cpu_freq_GHz*1000000.0)),subframe,ts->diff_now);
fprintf(file_name,"%15.3f ms, diff_now %15.3f \n",(ts->diff_now/(cpu_freq_GHz*1000000.0)),(double)ts->diff_now);
fprintf(file_name,"%15.3f us, diff_now %15.3f \n",(ts->diff_now/(cpu_freq_GHz*1000.0)),(double)ts->diff_now);
}
}
......
......@@ -270,6 +270,8 @@ typedef struct {
pthread_mutex_t mutex_rxtx;
/// scheduling parameters for RXn-TXnp4 thread
struct sched_param sched_param_rxtx;
/// pipeline ready state
int pipe_ready;
} eNB_rxtx_proc_t;
typedef struct {
......@@ -285,6 +287,20 @@ typedef struct {
LTE_eNB_DLSCH_t *dlsch;
int G;
int harq_pid;
int total_worker;
int current_worker;
/// \internal This variable is protected by \ref mutex_te.
int instance_cnt_te;
/// pthread attributes for parallel turbo-encoder thread
pthread_attr_t attr_te;
/// scheduling parameters for parallel turbo-encoder thread
struct sched_param sched_param_te;
/// pthread structure for parallel turbo-encoder thread
pthread_t pthread_te;
/// condition variable for parallel turbo-encoder thread
pthread_cond_t cond_te;
/// mutex for parallel turbo-encoder thread
pthread_mutex_t mutex_te;
} te_params;
typedef struct RU_proc_t_s {
......@@ -321,6 +337,7 @@ typedef struct RU_proc_t_s {
/// \brief Instance count for FH processing thread.
/// \internal This variable is protected by \ref mutex_FH.
int instance_cnt_FH;
int instance_cnt_FH1;
/// \internal This variable is protected by \ref mutex_prach.
int instance_cnt_prach;
#ifdef Rel14
......@@ -336,10 +353,13 @@ typedef struct RU_proc_t_s {
int instance_cnt_asynch_rxtx;
/// \internal This variable is protected by \ref mutex_fep
int instance_cnt_fep;
/// \internal This variable is protected by \ref mutex_fep
/// \internal This variable is protected by \ref mutex_feptx
int instance_cnt_feptx;
/// This varible is protected by \ref mutex_emulatedRF
int instance_cnt_emulateRF;
/// pthread structure for RU FH processing thread
pthread_t pthread_FH;
pthread_t pthread_FH1;
/// pthread structure for RU prach processing thread
pthread_t pthread_prach;
#ifdef Rel14
......@@ -350,8 +370,10 @@ typedef struct RU_proc_t_s {
pthread_t pthread_synch;
/// pthread struct for RU RX FEP worker thread
pthread_t pthread_fep;
/// pthread struct for RU RX FEPTX worker thread
/// pthread struct for RU TX FEP worker thread
pthread_t pthread_feptx;
/// pthread struct for emulated RF
pthread_t pthread_emulateRF;
/// pthread structure for asychronous RX/TX processing thread
pthread_t pthread_asynch_rxtx;
/// flag to indicate first RX acquisition
......@@ -360,6 +382,7 @@ typedef struct RU_proc_t_s {
int first_tx;
/// pthread attributes for RU FH processing thread
pthread_attr_t attr_FH;
pthread_attr_t attr_FH1;
/// pthread attributes for RU prach
pthread_attr_t attr_prach;
#ifdef Rel14
......@@ -374,8 +397,11 @@ typedef struct RU_proc_t_s {
pthread_attr_t attr_fep;
/// pthread attributes for worker feptx thread
pthread_attr_t attr_feptx;
/// pthread attributes for emulated RF
pthread_attr_t attr_emulateRF;
/// scheduling parameters for RU FH thread
struct sched_param sched_param_FH;
struct sched_param sched_param_FH1;
/// scheduling parameters for RU prach thread
struct sched_param sched_param_prach;
#ifdef Rel14
......@@ -388,6 +414,7 @@ typedef struct RU_proc_t_s {
struct sched_param sched_param_asynch_rxtx;
/// condition variable for RU FH thread
pthread_cond_t cond_FH;
pthread_cond_t cond_FH1;
/// condition variable for RU prach thread
pthread_cond_t cond_prach;
#ifdef Rel14
......@@ -398,14 +425,17 @@ typedef struct RU_proc_t_s {
pthread_cond_t cond_synch;
/// condition variable for asynch RX/TX thread
pthread_cond_t cond_asynch_rxtx;
/// condition varaible for RU RX FEP thread
/// condition varible for RU RX FEP thread
pthread_cond_t cond_fep;
/// condition varaible for RU RX FEPTX thread
/// condition varible for RU TX FEP thread
pthread_cond_t cond_feptx;
/// condition varible for emulated RF
pthread_cond_t cond_emulateRF;
/// condition variable for eNB signal
pthread_cond_t cond_eNBs;
/// mutex for RU FH
pthread_mutex_t mutex_FH;
pthread_mutex_t mutex_FH1;
/// mutex for RU prach
pthread_mutex_t mutex_prach;
#ifdef Rel14
......@@ -422,12 +452,17 @@ typedef struct RU_proc_t_s {
pthread_mutex_t mutex_fep;
/// mutex for fep TX worker thread
pthread_mutex_t mutex_feptx;
/// mutex for emulated RF thread
pthread_mutex_t mutex_emulateRF;
/// symbol mask for IF4p5 reception per subframe
uint32_t symbol_mask[10];
/// number of slave threads
int num_slaves;
/// array of pointers to slaves
struct RU_proc_t_s **slave_proc;
/// pipeline ready state
int ru_rx_ready;
int ru_tx_ready;
} RU_proc_t;
/// Context data structure for eNB subframe processing
......@@ -461,7 +496,7 @@ typedef struct eNB_proc_t_s {
/// \internal This variable is protected by \ref mutex_td.
int instance_cnt_td;
/// \internal This variable is protected by \ref mutex_te.
int instance_cnt_te;
//int instance_cnt_te[3];
/// \internal This variable is protected by \ref mutex_prach.
int instance_cnt_prach;
#ifdef Rel14
......@@ -483,7 +518,7 @@ typedef struct eNB_proc_t_s {
/// pthread attributes for parallel turbo-decoder thread
pthread_attr_t attr_td;
/// pthread attributes for parallel turbo-encoder thread
pthread_attr_t attr_te;
//pthread_attr_t attr_te[3];
/// pthread attributes for single eNB processing thread
pthread_attr_t attr_single;
/// pthread attributes for prach processing thread
......@@ -497,7 +532,7 @@ typedef struct eNB_proc_t_s {
/// scheduling parameters for parallel turbo-decoder thread
struct sched_param sched_param_td;
/// scheduling parameters for parallel turbo-encoder thread
struct sched_param sched_param_te;
//struct sched_param sched_param_te[3];
/// scheduling parameters for single eNB thread
struct sched_param sched_param_single;
/// scheduling parameters for prach thread
......@@ -511,7 +546,7 @@ typedef struct eNB_proc_t_s {
/// pthread structure for parallel turbo-decoder thread
pthread_t pthread_td;
/// pthread structure for parallel turbo-encoder thread
pthread_t pthread_te;
//pthread_t pthread_te[3];
/// pthread structure for PRACH thread
pthread_t pthread_prach;
#ifdef Rel14
......@@ -521,7 +556,7 @@ typedef struct eNB_proc_t_s {
/// condition variable for parallel turbo-decoder thread
pthread_cond_t cond_td;
/// condition variable for parallel turbo-encoder thread
pthread_cond_t cond_te;
//pthread_cond_t cond_te[3];
/// condition variable for PRACH processing thread;
pthread_cond_t cond_prach;
#ifdef Rel14
......@@ -533,7 +568,7 @@ typedef struct eNB_proc_t_s {
/// mutex for parallel turbo-decoder thread
pthread_mutex_t mutex_td;
/// mutex for parallel turbo-encoder thread
pthread_mutex_t mutex_te;
//pthread_mutex_t mutex_te[3];
/// mutex for PRACH thread
pthread_mutex_t mutex_prach;
#ifdef Rel14
......@@ -559,9 +594,13 @@ typedef struct eNB_proc_t_s {
/// parameters for turbo-decoding worker thread
td_params tdp;
/// parameters for turbo-encoding worker thread
te_params tep;
te_params tep[3];
/// set of scheduling variables RXn-TXnp4 threads
eNB_rxtx_proc_t proc_rxtx[2];
/// stats thread pthread descriptor
pthread_t process_stats_thread;
/// for waking up tx procedure
RU_proc_t *ru_proc;
} eNB_proc_t;
......@@ -663,6 +702,7 @@ typedef enum {
REMOTE_IF4p5 =3,
REMOTE_IF1pp =4,
MAX_RU_IF_TYPES =5
//EMULATE_RF =6
} RU_if_south_t;
typedef struct RU_t_s{
......@@ -757,11 +797,19 @@ typedef struct RU_t_s{
void (*wakeup_prach_eNB_br)(struct PHY_VARS_eNB_s *eNB,struct RU_t_s *ru,int frame,int subframe);
#endif
/// function pointer to eNB entry routine
void (*eNB_top)(struct PHY_VARS_eNB_s *eNB, int frame_rx, int subframe_rx, char *string);
void (*eNB_top)(struct PHY_VARS_eNB_s *eNB, int frame_rx, int subframe_rx, char *string,struct RU_t_s *ru);
/// Timing statistics
time_stats_t ofdm_demod_stats;
/// Timing statistics (TX)
time_stats_t ofdm_mod_stats;
/// Timing wait statistics
time_stats_t ofdm_demod_wait_stats;
/// Timing wakeup statistics
time_stats_t ofdm_demod_wakeup_stats;
/// Timing wait statistics (TX)
time_stats_t ofdm_mod_wait_stats;
/// Timing wakeup statistics (TX)
time_stats_t ofdm_mod_wakeup_stats;
/// Timing statistics (RX Fronthaul + Compression)
time_stats_t rx_fhaul;
/// Timing statistics (TX Fronthaul + Compression)
......@@ -955,7 +1003,7 @@ typedef struct PHY_VARS_eNB_s {
eth_params_t eth_params;
int rx_total_gain_dB;
int (*td)(struct PHY_VARS_eNB_s *eNB,int UE_id,int harq_pid,int llr8_flag);
int (*te)(struct PHY_VARS_eNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *);
int (*te)(struct PHY_VARS_eNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *,time_stats_t *);
int (*start_if)(struct RU_t_s *ru,struct PHY_VARS_eNB_s *eNB);
uint8_t local_flag;
LTE_DL_FRAME_PARMS frame_parms;
......@@ -1134,7 +1182,14 @@ typedef struct PHY_VARS_eNB_s {
time_stats_t dlsch_modulation_stats;
time_stats_t dlsch_scrambling_stats;
time_stats_t dlsch_rate_matching_stats;
time_stats_t dlsch_turbo_encoding_preperation_stats;
time_stats_t dlsch_turbo_encoding_segmentation_stats;
time_stats_t dlsch_turbo_encoding_stats;
time_stats_t dlsch_turbo_encoding_waiting_stats;
time_stats_t dlsch_turbo_encoding_signal_stats;
time_stats_t dlsch_turbo_encoding_main_stats;
time_stats_t dlsch_turbo_encoding_wakeup_stats0;
time_stats_t dlsch_turbo_encoding_wakeup_stats1;
time_stats_t dlsch_interleaving_stats;
time_stats_t rx_dft_stats;
......
......@@ -203,6 +203,9 @@
// QAM amplitude definitions
/// Amplitude for QPSK (\f$ 2^15 \times 1/\sqrt{2}\f$)
#define QPSK 23170
/// First Amplitude for QAM16 (\f$ 2^{15} \times 2/\sqrt{10}\f$)
#define QAM16_n1 20724
/// Second Amplitude for QAM16 (\f$ 2^{15} \times 1/\sqrt{10}\f$)
......
......@@ -346,14 +346,24 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
start_meas(&eNB->dlsch_encoding_stats);
eNB->te(eNB,
dlsch_harq->pdu,
dlsch_harq->pdsch_start,
dlsch,
frame,subframe,
&eNB->dlsch_rate_matching_stats,
&eNB->dlsch_turbo_encoding_stats,
&eNB->dlsch_interleaving_stats);
dlsch_harq->pdu,
dlsch_harq->pdsch_start,
dlsch,
frame,
subframe,
&eNB->dlsch_rate_matching_stats,
&eNB->dlsch_turbo_encoding_stats,
&eNB->dlsch_turbo_encoding_waiting_stats,
&eNB->dlsch_turbo_encoding_main_stats,
&eNB->dlsch_turbo_encoding_wakeup_stats0,
&eNB->dlsch_turbo_encoding_wakeup_stats1,
&eNB->dlsch_interleaving_stats);
stop_meas(&eNB->dlsch_encoding_stats);
//////////////////////////////////////////////////*******************************************
if(eNB->dlsch_encoding_stats.diff_now>500*3000 && opp_enabled == 1)
{
print_meas_now(&eNB->dlsch_encoding_stats,"total coding",stderr);
}
// 36-211
start_meas(&eNB->dlsch_scrambling_stats);
dlsch_scrambling(fp,
......@@ -546,6 +556,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
else
{
// generate pdsch
pdsch_procedures(eNB,
proc,
harq_pid,
......@@ -1359,37 +1370,63 @@ extern int oai_exit;
extern void *td_thread(void*);
void init_td_thread(PHY_VARS_eNB *eNB,pthread_attr_t *attr_td) {
void init_td_thread(PHY_VARS_eNB *eNB) {
eNB_proc_t *proc = &eNB->proc;
proc->tdp.eNB = eNB;
proc->instance_cnt_td = -1;
pthread_attr_init( &proc->attr_td);
pthread_mutex_init( &proc->mutex_td, NULL);
pthread_cond_init( &proc->cond_td, NULL);
pthread_create(&proc->pthread_td, &proc->attr_td, td_thread, (void*)&proc->tdp);
pthread_create(&proc->pthread_td, attr_td, td_thread, (void*)&proc->tdp);
}