Commit bf678f7f authored by Cedric Roux's avatar Cedric Roux

Merge remote-tracking branch...

Merge remote-tracking branch 'origin/RU-RAU-split-parallel-EMUFH-phy-test-merge' into develop_integration_2018_w15
parents 1272cabb 68fdd19c
......@@ -1365,6 +1365,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
......
......@@ -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",
......
......@@ -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),
......
This diff is collapsed.
......@@ -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$)
......
......@@ -201,8 +201,8 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr
dlsch0_harq->pdsch_start = eNB->pdcch_vars[subframe & 1].num_pdcch_symbols;
if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU
AssertFatal(sdu!=NULL,"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d subframe %d]: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d dlsch0_harq[round:%d SFN/SF:%d%d pdu:%p mcs:%d ndi:%d pdschstart:%d]\n",
frame,subframe,
AssertFatal(sdu!=NULL,"sdu==%d, NFAPI: SFN/SF:%04d%d proc:TX:[frame %d subframe %d]: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d dlsch0_harq[round:%d SFN/SF:%d%d pdu:%p mcs:%d ndi:%d pdschstart:%d]\n",
*sdu,frame,subframe,
proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid,
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index,dlsch0_harq->round,dlsch0_harq->frame,dlsch0_harq->subframe,dlsch0_harq->pdu,dlsch0_harq->mcs,dlsch0_harq->ndi,dlsch0_harq->pdsch_start);
if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d, subframe %d]: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d\n",
......
......@@ -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);
}
void kill_td_thread(PHY_VARS_eNB *eNB) {
eNB_proc_t *proc = &eNB->proc;
proc->instance_cnt_td = 0;
pthread_cond_signal(&proc->cond_td);
pthread_join(proc->pthread_td, NULL);
pthread_mutex_destroy( &proc->mutex_td );
pthread_cond_destroy( &proc->cond_td );
}
extern void *te_thread(void*);
void init_te_thread(PHY_VARS_eNB *eNB,pthread_attr_t *attr_te) {
void init_te_thread(PHY_VARS_eNB *eNB) {
eNB_proc_t *proc = &eNB->proc;
proc->tep.eNB = eNB;
proc->instance_cnt_te = -1;
for(int i=0; i<3 ;i++){
proc->tep[i].eNB = eNB;
proc->tep[i].instance_cnt_te = -1;
pthread_mutex_init( &proc->tep[i].mutex_te, NULL);
pthread_cond_init( &proc->tep[i].cond_te, NULL);
pthread_attr_init( &proc->tep[i].attr_te);
pthread_mutex_init( &proc->mutex_te, NULL);
pthread_cond_init( &proc->cond_te, NULL);
printf("Creating te_thread 0\n");
pthread_create(&proc->tep[i].pthread_te, &proc->tep[i].attr_te, te_thread, (void*)&proc->tep[i]);
}
}
void kill_te_thread(PHY_VARS_eNB *eNB) {
printf("Creating te_thread\n");
pthread_create(&proc->pthread_te, attr_te, te_thread, (void*)&proc->tep);
eNB_proc_t *proc = &eNB->proc;
for(int i=0; i<3 ;i++){
proc->tep[i].instance_cnt_te = 0;
pthread_cond_signal(&proc->tep[i].cond_te);
pthread_join(proc->tep[i].pthread_te, NULL);
pthread_mutex_destroy( &proc->tep[i].mutex_te);
pthread_cond_destroy( &proc->tep[i].cond_te);
}
}
void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe)
{
nfapi_rx_indication_pdu_t *pdu;
......@@ -1624,6 +1661,7 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,
// release DLSCH if needed
release_harq(eNB,UE_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
#if T_TRACER
/* TODO: get correct harq pid */
if (ulsch_harq->o_ACK[i] != 1)
......@@ -1722,6 +1760,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
// release DLSCH if needed
release_harq(eNB,UE_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
#if T_TRACER
if (harq_ack[0] != 1)
T(T_ENB_PHY_DLSCH_UE_NACK, T_INT(0), T_INT(frame), T_INT(subframe),
......
......@@ -138,12 +138,22 @@ static void *feptx_thread(void *param) {
RU_t *ru = (RU_t *)param;
RU_proc_t *proc = &ru->proc;
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
thread_top_init("feptx_thread",1,85000,120000,500000);
pthread_setname_np( pthread_self(),"feptx processing");
LOG_I(PHY,"thread feptx created id=%ld\n", syscall(__NR_gettid));
//CPU_SET(6, &cpuset);
//pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
//wait_sync("feptx_thread");
thread_top_init("feptx_thread",0,870000,1000000,1000000);
while (!oai_exit) {
if (wait_on_condition(&proc->mutex_feptx,&proc->cond_feptx,&proc->instance_cnt_feptx,"feptx thread")<0) break;
//stop_meas(&ru->ofdm_mod_wakeup_stats);
feptx0(ru,1);
if (release_thread(&proc->mutex_feptx,&proc->instance_cnt_feptx,"feptx thread")<0) break;
......@@ -152,6 +162,10 @@ static void *feptx_thread(void *param) {
exit_fun( "ERROR pthread_cond_signal" );
return NULL;
}
/*if(opp_enabled == 1 && ru->ofdm_mod_wakeup_stats.diff_now>30*3000){
print_meas_now(&ru->ofdm_mod_wakeup_stats,"fep wakeup",stderr);
printf("delay in fep wakeup in frame_tx: %d subframe_rx: %d \n",proc->frame_tx,proc->subframe_tx);
}*/
}
......@@ -168,7 +182,7 @@ void feptx_ofdm_2thread(RU_t *ru) {
wait.tv_sec=0;
wait.tv_nsec=5000000L;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
start_meas(&ru->ofdm_mod_stats);
if (subframe_select(fp,subframe) == SF_UL) return;
......@@ -198,17 +212,25 @@ void feptx_ofdm_2thread(RU_t *ru) {
exit_fun( "ERROR pthread_cond_signal" );
return;
}
//start_meas(&ru->ofdm_mod_wakeup_stats);
pthread_mutex_unlock( &proc->mutex_feptx );
}
// call first slot in this thread
feptx0(ru,0);
start_meas(&ru->ofdm_mod_wait_stats);
wait_on_busy_condition(&proc->mutex_feptx,&proc->cond_feptx,&proc->instance_cnt_feptx,"feptx thread");
stop_meas(&ru->ofdm_mod_wait_stats);
/*if(opp_enabled == 1 && ru->ofdm_mod_wait_stats.diff_now>30*3000){
print_meas_now(&ru->ofdm_mod_wait_stats,"fep wakeup",stderr);
printf("delay in feptx wait on codition in frame_rx: %d subframe_rx: %d \n",proc->frame_tx,proc->subframe_tx);
}*/
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 0 );
stop_meas(&ru->ofdm_mod_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 0 );
}
......@@ -426,12 +448,23 @@ static void *fep_thread(void *param) {
RU_t *ru = (RU_t *)param;
RU_proc_t *proc = &ru->proc;
thread_top_init("fep_thread",0,870000,1000000,1000000);
thread_top_init("fep_thread",1,100000,120000,5000000);
pthread_setname_np( pthread_self(),"fep processing");
LOG_I(PHY,"thread fep created id=%ld\n", syscall(__NR_gettid));
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
//CPU_SET(2, &cpuset);
//pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
//wait_sync("fep_thread");
while (!oai_exit) {
if (wait_on_condition(&proc->mutex_fep,&proc->cond_fep,&proc->instance_cnt_fep,"fep thread")<0) break;
if (wait_on_condition(&proc->mutex_fep,&proc->cond_fep,&proc->instance_cnt_fep,"fep thread")<0) break;
//stop_meas(&ru->ofdm_demod_wakeup_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1, 1 );
fep0(ru,0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1, 0 );
if (release_thread(&proc->mutex_fep,&proc->instance_cnt_fep,"fep thread")<0) break;
if (pthread_cond_signal(&proc->cond_fep) != 0) {
......@@ -439,6 +472,10 @@ static void *fep_thread(void *param) {
exit_fun( "ERROR pthread_cond_signal" );
return NULL;
}
/*if(opp_enabled == 1 && ru->ofdm_demod_wakeup_stats.diff_now>30*3000){
print_meas_now(&ru->ofdm_demod_wakeup_stats,"fep wakeup",stderr);
printf("delay in fep wakeup in frame_rx: %d subframe_rx: %d \n",proc->frame_rx,proc->subframe_rx);
}*/
}
......@@ -489,6 +526,7 @@ void ru_fep_full_2thread(RU_t *ru) {
wait.tv_sec=0;
wait.tv_nsec=5000000L;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
start_meas(&ru->ofdm_demod_stats);
if (pthread_mutex_timedlock(&proc->mutex_fep,&wait) != 0) {
......@@ -512,15 +550,23 @@ void ru_fep_full_2thread(RU_t *ru) {
exit_fun( "ERROR pthread_cond_signal" );
return;
}
//start_meas(&ru->ofdm_demod_wakeup_stats);
pthread_mutex_unlock( &proc->mutex_fep );
// call second slot in this symbol
fep0(ru,1);
start_meas(&ru->ofdm_demod_wait_stats);
wait_on_busy_condition(&proc->mutex_fep,&proc->cond_fep,&proc->instance_cnt_fep,"fep thread");
stop_meas(&ru->ofdm_demod_wait_stats);
if(opp_enabled == 1 && ru->ofdm_demod_wakeup_stats.diff_now>30*3000){
print_meas_now(&ru->ofdm_demod_wakeup_stats,"fep wakeup",stderr);
printf("delay in fep wait on codition in frame_rx: %d subframe_rx: %d \n",proc->frame_rx,proc->subframe_rx);
}
stop_meas(&ru->ofdm_demod_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 0 );
}
......
......@@ -297,6 +297,9 @@ void RCconfig_macrlc() {
mac_top_init_eNB();
for (j=0;j<RC.nb_macrlc_inst;j++) {
//RC.mac[j]->phy_test = *(MacRLC_ParamList.paramarray[j][MACRLC_PHY_TEST_IDX].iptr);
//printf("PHY_TEST = %d,%d\n", RC.mac[j]->phy_test, j);
if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_RRC") == 0) {
// check number of instances is same as RRC/PDCP
......
......@@ -687,4 +687,43 @@ typedef enum {
#define CONFIG_STRING_MACRLC_CONFIG "macrlc_config"
/* MACRLC configuration parameters names */
#define CONFIG_STRING_MACRLC_CC "num_cc"
#define CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE "tr_n_preference"
#define CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME "local_n_if_name"
#define CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS "local_n_address"
#define CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS "remote_n_address"
#define CONFIG_STRING_MACRLC_LOCAL_N_PORTC "local_n_portc"
#define CONFIG_STRING_MACRLC_REMOTE_N_PORTC "remote_n_portc"
#define CONFIG_STRING_MACRLC_LOCAL_N_PORTD "local_n_portd"
#define CONFIG_STRING_MACRLC_REMOTE_N_PORTD "remote_n_portd"
#define CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE "tr_s_preference"
#define CONFIG_STRING_MACRLC_LOCAL_S_IF_NAME "local_s_if_name"
#define CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS "local_s_address"
#define CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS "remote_s_address"
#define CONFIG_STRING_MACRLC_LOCAL_S_PORTC "local_s_portc"
#define CONFIG_STRING_MACRLC_REMOTE_S_PORTC "remote_s_portc"
#define CONFIG_STRING_MACRLC_LOCAL_S_PORTD "local_s_portd"
#define CONFIG_STRING_MACRLC_REMOTE_S_PORTD "remote_s_portd"
#define CONFIG_STRING_MACRLC_PHY_TEST_MODE "phy_test_mode"
#define MACRLC_CC_IDX 0
#define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1
#define MACRLC_LOCAL_N_IF_NAME_IDX 2
#define MACRLC_LOCAL_N_ADDRESS_IDX 3
#define MACRLC_REMOTE_N_ADDRESS_IDX 4
#define MACRLC_LOCAL_N_PORTC_IDX 5
#define MACRLC_REMOTE_N_PORTC_IDX 6
#define MACRLC_LOCAL_N_PORTD_IDX 7
#define MACRLC_REMOTE_N_PORTD_IDX 8
#define MACRLC_TRANSPORT_S_PREFERENCE_IDX 9
#define MACRLC_LOCAL_S_IF_NAME_IDX 10
#define MACRLC_LOCAL_S_ADDRESS_IDX 11
#define MACRLC_REMOTE_S_ADDRESS_IDX 12
#define MACRLC_LOCAL_S_PORTC_IDX 13
#define MACRLC_REMOTE_S_PORTC_IDX 14
#define MACRLC_LOCAL_S_PORTD_IDX 15
#define MACRLC_REMOTE_S_PORTD_IDX 16
#define MACRLC_PHY_TEST_IDX 17
/*---------------------------------------------------------------------------------------------------------------------------------------------------------*/
......@@ -1071,6 +1071,8 @@ typedef struct eNB_MAC_INST_s {
COMMON_channels_t common_channels[MAX_NUM_CCs];
/// current PDU index (BCH,MCH,DLSCH)
uint16_t pdu_index[MAX_NUM_CCs];
/// flag to enable phy-test (disables the scheduler)
uint16_t phy_test;
/// NFAPI Config Request Structure
nfapi_config_request_t config[MAX_NUM_CCs];
......
......@@ -64,6 +64,7 @@
#define DEBUG_eNB_SCHEDULER 1
extern RAN_CONTEXT_t RC;
extern int phy_test;
uint16_t pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 };
......@@ -640,26 +641,33 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
#endif
// This schedules MIB
if ((subframeP == 0) && (frameP & 3) == 0)
schedule_mib(module_idP, frameP, subframeP);
// This schedules SI for legacy LTE and eMTC starting in subframeP
schedule_SI(module_idP, frameP, subframeP);
// This schedules Paging in subframeP
schedule_PCH(module_idP,frameP,subframeP);
// This schedules Random-Access for legacy LTE and eMTC starting in subframeP
schedule_RA(module_idP, frameP, subframeP);
// copy previously scheduled UL resources (ULSCH + HARQ)
copy_ulreq(module_idP, frameP, subframeP);
// This schedules SRS in subframeP
schedule_SRS(module_idP, frameP, subframeP);
// This schedules ULSCH in subframeP (dci0)
schedule_ulsch(module_idP, frameP, subframeP);
// This schedules UCI_SR in subframeP
schedule_SR(module_idP, frameP, subframeP);
// This schedules UCI_CSI in subframeP
schedule_CSI(module_idP, frameP, subframeP);
// This schedules DLSCH in subframeP
schedule_dlsch(module_idP, frameP, subframeP, mbsfn_status);
if (phy_test == 0){
// This schedules SI for legacy LTE and eMTC starting in subframeP
schedule_SI(module_idP, frameP, subframeP);
// This schedules Paging in subframeP
schedule_PCH(module_idP,frameP,subframeP);
// This schedules Random-Access for legacy LTE and eMTC starting in subframeP
schedule_RA(module_idP, frameP, subframeP);
// copy previously scheduled UL resources (ULSCH + HARQ)
copy_ulreq(module_idP, frameP, subframeP);
// This schedules SRS in subframeP
schedule_SRS(module_idP, frameP, subframeP);
// This schedules ULSCH in subframeP (dci0)
schedule_ulsch(module_idP, frameP, subframeP);
// This schedules UCI_SR in subframeP
schedule_SR(module_idP, frameP, subframeP);
// This schedules UCI_CSI in subframeP
schedule_CSI(module_idP, frameP, subframeP);
// This schedules DLSCH in subframeP
schedule_dlsch(module_idP, frameP, subframeP, mbsfn_status);
}
else{
schedule_ulsch_phy_test(module_idP,frameP,subframeP);
schedule_ue_spec_phy_test(module_idP,frameP,subframeP,mbsfn_status);
}
if (RC.flexran[module_idP]->enabled)
flexran_agent_send_update_stats(module_idP);
......
......@@ -787,6 +787,7 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
eNB->eNB_stats[CC_id].bcch_buffer = bcch_sdu_length;
eNB->eNB_stats[CC_id].total_bcch_buffer += bcch_sdu_length;
eNB->eNB_stats[CC_id].bcch_mcs = mcs;
//printf("SI %d.%d\n", frameP, subframeP);/////////////////////////////////////////******************************
} else {
//LOG_D(MAC,"[eNB %d] Frame %d : BCCH not active \n",Mod_id,frame);
......
This diff is collapsed.
......@@ -150,6 +150,9 @@ void schedule_dlsch(module_id_t module_idP, frame_t frameP,
void schedule_ue_spec(module_id_t module_idP, slice_id_t slice_idP,
frame_t frameP,sub_frame_t subframe, int *mbsfn_flag);
void schedule_ue_spec_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,int *mbsfn_flag);
void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP);
/** \brief Function for UE/PHY to compute PUSCH transmit power in power-control procedure.
@param Mod_id Module id of UE
......
......@@ -191,6 +191,9 @@ const char* eurecomVariablesNames[] = {
"ue0_trx_write_ns",
"ue0_trx_read_ns_missing",
"ue0_trx_write_ns_missing",
"enb_thread_rxtx_CPUID",
"ru_thread_CPUID",
"ru_thread_tx_CPUID"
};
const char* eurecomFunctionsNames[] = {
......
......@@ -167,6 +167,9 @@ typedef enum {
VCD_SIGNAL_DUMPER_VARIABLES_UE0_TRX_WRITE_NS,
VCD_SIGNAL_DUMPER_VARIABLES_UE0_TRX_READ_NS_MISSING,
VCD_SIGNAL_DUMPER_VARIABLES_UE0_TRX_WRITE_NS_MISSING,
VCD_SIGNAL_DUMPER_VARIABLES_CPUID_ENB_THREAD_RXTX,
VCD_SIGNAL_DUMPER_VARIABLES_CPUID_RU_THREAD,
VCD_SIGNAL_DUMPER_VARIABLES_CPUID_RU_THREAD_TX,
VCD_SIGNAL_DUMPER_VARIABLES_END
} vcd_signal_dump_variables;
......
......@@ -117,7 +117,7 @@ int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cf
rc=load_lib(device, openair0_cfg, NULL,RAU_LOCAL_RADIO_HEAD );
if ( rc >= 0) {
if ( set_device(device) < 0) {
if ( set_device(device) < 0) {
fprintf(stderr, "%s %d:Unsupported radio head\n",__FILE__, __LINE__);
return -1;
}
......
......@@ -982,15 +982,20 @@ extern "C" {
// workaround for an api problem, master clock has to be set with the constructor not via set_master_clock_rate
args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock);
// args += ",num_send_frames=256,num_recv_frames=256, send_frame_size=4096, recv_frame_size=4096";
// args += ",num_send_frames=256,num_recv_frames=256, send_frame_size=4096, recv_frame_size=4096";
uhd::device_addrs_t device_adds = uhd::device::find(args);
if(device_adds.size() == 0) {
std::cerr<<"No USRP Device Found. " << std::endl;
free(s);
return -1;
args += ",addr=192.168.30.2";
uhd::device_addrs_t device_adds = uhd::device::find(args);
if(device_adds.size() == 0) {
std::cerr<<"No USRP Device Found. " << std::endl;
free(s);
return -1;
}
}
LOG_I(PHY,"Found USRP X300\n");
s->usrp = uhd::usrp::multi_usrp::make(args);
......@@ -1016,6 +1021,20 @@ extern "C" {
LOG_I(PHY,"%s() sample_rate:%u\n", __FUNCTION__, (int)openair0_cfg[0].sample_rate);
switch ((int)openair0_cfg[0].sample_rate) {
case 122880000:
// from usrp_time_offset
//openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 15; //to be checked
openair0_cfg[0].tx_bw = 80e6;
openair0_cfg[0].rx_bw = 80e6;
break;
case 61440000:
// from usrp_time_offset
//openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 15;
openair0_cfg[0].tx_bw = 40e6;
openair0_cfg[0].rx_bw = 40e6;
break;
case 30720000:
// from usrp_time_offset
//openair0_cfg[0].samples_per_packet = 2048;
......
......@@ -40,6 +40,8 @@
# endif
# include "enb_app.h"
extern int emulate_rf;
int create_tasks(uint32_t enb_nb)
{
LOG_D(ENB_APP, "%s(enb_nb:%d\n", __FUNCTION__, enb_nb);
......@@ -69,10 +71,11 @@ int create_tasks(uint32_t enb_nb)
LOG_E(S1AP, "Create task for S1AP failed\n");
return -1;
}
if (itti_create_task (TASK_UDP, udp_eNB_task, NULL) < 0) {
LOG_E(UDP_, "Create task for UDP failed\n");
return -1;
if(!emulate_rf){
if (itti_create_task (TASK_UDP, udp_eNB_task, NULL) < 0) {
LOG_E(UDP_, "Create task for UDP failed\n");
return -1;
}
}
if (itti_create_task (TASK_GTPV1_U, &gtpv1u_eNB_task, NULL) < 0) {
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
eNBs =
(
{
////////// Identification parameters:
eNB_ID = 0xe00;
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
mobile_country_code = "208";
mobile_network_code = "93";
tr_s_preference = "local_mac"
////////// Physical parameters:
component_carriers = (
{
node_function = "eNodeB_3GPP";
node_timing = "synch_to_ext_device";
node_synch_ref = 0;
frame_type = "FDD";
tdd_config = 3;
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 7;
downlink_frequency = 2685000000L;
uplink_frequency_offset = -120000000;
Nid_cell = 0;
N_RB_DL = 100;
Nid_cell_mbsfn = 0;
nb_antenna_ports = 1;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 90;
rx_gain = 125;
pbch_repetition = "FALSE";
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -27;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
pusch_hoppingMode = "interSubFrame";
pusch_hoppingOffset = 0;
pusch_groupHoppingEnabled = "ENABLE";
pusch_groupAssignment = 0;
pusch_sequenceHoppingEnabled = "DISABLE";
pusch_nDMRS1 = 1;
phich_duration = "NORMAL";
phich_resource = "ONESIXTH";
srs_enable = "DISABLE";
/* srs_BandwidthConfig =;
srs_SubframeConfig =;
srs_ackNackST =;
srs_MaxUpPts =;*/
pusch_p0_Nominal = -96;
pusch_alpha = "AL1";
pucch_p0_Nominal = -104;
msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0";
pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE";
/*
rach_sizeOfRA_PreamblesGroupA = ;
rach_messageSizeGroupA = ;
rach_messagePowerOffsetGroupB = ;
*/
rach_powerRampingStep = 4;
rach_preambleInitialReceivedTargetPower = -108;
rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10;
rach_macContentionResolutionTimer = 48;
rach_maxHARQ_Msg3Tx = 4;
pcch_default_PagingCycle = 128;
pcch_nB = "oneT";
bcch_modificationPeriodCoeff = 2;
ue_TimersAndConstants_t300 = 1000;
ue_TimersAndConstants_t301 = 1000;
ue_TimersAndConstants_t310 = 1000;
ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1;
ue_TransmissionMode = 1;
}
);
srb1_parameters :
{
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
timer_poll_retransmit = 80;
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
timer_reordering = 35;
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
timer_status_prohibit = 0;
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
poll_pdu = 4;
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
poll_byte = 99999;
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
max_retx_threshold = 4;
}
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2;
};
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.26";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth6";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth6";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
}
);
MACRLCs = (
{
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "local_RRC";
}
);
L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
}
);
RUs = (
{
local_rf = "yes"
nb_tx = 1
nb_rx = 1
att_tx = 0
att_rx = 0;
bands = [7];
max_pdschReferenceSignalPower = -27;
max_rxgain = 116;
eNB_instances = [0];
}
);
log_config :
{
global_log_level ="info";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="info";
mac_log_verbosity ="medium";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
};
......@@ -151,9 +151,9 @@ eNBs =
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.19/24";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.19/24";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
}
......@@ -164,6 +164,7 @@ MACRLCs = (
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "local_RRC";
phy_test_mode = 1;
}
);
......
[*]
[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI
[*] Tue Jul 25 20:26:12 2017
[*] Thu Feb 22 14:46:40 2018
[*]
[dumpfile] "/tmp/openair_dump_eNB.vcd"
[dumpfile_mtime] "Tue Jul 25 20:11:55 2017"
[dumpfile_size] 19201475
[savefile] "/home/papillon/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw"
[timestart] 29023604000
[size] 1236 578
[pos] 309 0
*-20.793451 29026062100 -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
[dumpfile_mtime] "Thu Feb 22 14:44:26 2018"
[dumpfile_size] 3482761
[savefile] "/homes/wangts/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw"
[timestart] 4525000000
[size] 1920 1018
[pos] 0 22
*-21.506693 4530514310 -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] 386
[signals_width] 262
[signals_width] 344
[sst_expanded] 1
[sst_vpaned_height] 146
[sst_vpaned_height] 303
@28
functions.trx_read
functions.trx_write
......@@ -25,12 +25,42 @@ functions.eNB_thread_rxtx0
@24
variables.frame_number_RX0_RU[63:0]
variables.subframe_number_RX0_RU[63:0]
@25
variables.frame_number_TX0_RU[63:0]
@24
variables.subframe_number_TX0_RU[63:0]
@28
functions.mac_schedule_dlsch
functions.macxface_eNB_dlsch_ulsch_scheduler
functions.macxface_ue_scheduler
functions.phy_eNB_ofdm_mod_l
@24
variables.frame_number_RX0_eNB[63:0]
@25
variables.subframe_number_RX0_eNB[63:0]
@24
variables.frame_number_TX0_eNB[63:0]
variables.subframe_number_TX0_eNB[63:0]
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]
@28
functions.phy_eNB_dlsch_modulation
functions.phy_eNB_dlsch_encoding
functions.phy_eNB_dlsch_scrambling
functions.phy_eNB_beam_precoding
functions.phy_enb_pdcch_tx
functions.phy_enb_prach_rx
functions.phy_procedures_ru_feprx0
functions.phy_procedures_eNb_rx_uespec0
functions.phy_procedures_eNb_rx_uespec1
functions.phy_enb_sfgen
functions.phy_procedures_eNb_tx0
functions.phy_procedures_eNb_tx1
functions.phy_procedures_ru_feprx1
functions.phy_procedures_ru_feptx_ofdm0
functions.phy_procedures_ru_feptx_ofdm1
functions.phy_procedures_ru_feptx_prec0
functions.phy_procedures_ru_feptx_prec1
functions.eNB_thread_rxtx1
functions.phy_enb_sfgen
functions.phy_enb_prach_rx
......
This diff is collapsed.
This diff is collapsed.
......@@ -217,6 +217,10 @@ extern PHY_VARS_UE* init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
extern void init_eNB_afterRU(void);
int transmission_mode=1;
int emulate_rf = 0;
int numerology = 0;
int codingw = 0;
int fepw = 0;
......@@ -632,6 +636,7 @@ void init_openair0(void) {
int card;
int i;
for (card=0; card<MAX_CARDS; card++) {
......@@ -639,6 +644,8 @@ void init_openair0(void) {
openair0_cfg[card].configFilename = NULL;
if(frame_parms[0]->N_RB_DL == 100) {
if(numerology == 0)
{
if (frame_parms[0]->threequarter_fs) {
openair0_cfg[card].sample_rate=23.04e6;
openair0_cfg[card].samples_per_frame = 230400;
......@@ -650,6 +657,22 @@ void init_openair0(void) {
openair0_cfg[card].tx_bw = 10e6;
openair0_cfg[card].rx_bw = 10e6;
}
}else if(numerology == 1)
{
openair0_cfg[card].sample_rate=61.44e6;
openair0_cfg[card].samples_per_frame = 307200;
openair0_cfg[card].tx_bw = 20e6;
openair0_cfg[card].rx_bw = 20e6;
}else if(numerology == 2)
{
openair0_cfg[card].sample_rate=122.88e6;
openair0_cfg[card].samples_per_frame = 307200;
openair0_cfg[card].tx_bw = 20e6;
openair0_cfg[card].rx_bw = 20e6;
}else
{
printf("Un supported numerology\n");
}
} else if(frame_parms[0]->N_RB_DL == 50) {
openair0_cfg[card].sample_rate=15.36e6;
openair0_cfg[card].samples_per_frame = 153600;
......
This diff is collapsed.
......@@ -43,6 +43,7 @@
#include <getopt.h>
#include <sys/sysinfo.h>
#include "rt_wrapper.h"
#include <errno.h>
#include "openair1/PHY/defs.h"
......@@ -283,6 +284,7 @@ void thread_top_init(char *thread_name,
if (sched_setattr(0, &attr, flags) < 0 ) {
perror("[SCHED] eNB tx thread: sched_setattr failed\n");
fprintf(stderr,"sched_setattr Error = %s",strerror(errno));
exit(1);
}
......
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