Commit d82a0d90 authored by Wang Tsu-Han's avatar Wang Tsu-Han

adding ulsch_decoding multiy threading

parent 7ac9d2ab
......@@ -207,20 +207,6 @@ uint8_t extract_cqi_crc(uint8_t *cqi,uint8_t CQI_LENGTH)
/*int ulsch_decoding_data_all(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
{
int value = 0;
if()
{
value = ulsch_decoding_data_2thread(eNB,UE_id,harq_pid,llr8_flag);
}
else
{
value = ulsch_decoding_data(eNB,UE_id,harq_pid,llr8_flag);
}
return value;
}*/
int ulsch_decoding_data_2thread0(td_params* tdp) {
......@@ -430,6 +416,9 @@ void *td_thread(void *param) {
PHY_VARS_eNB *eNB = ((td_params*)param)->eNB;
eNB_proc_t *proc = &eNB->proc;
pthread_setname_np( pthread_self(),"td processing");
LOG_I(PHY,"thread td created id=%ld\n", syscall(__NR_gettid));
while (!oai_exit) {
if (wait_on_condition(&proc->mutex_td,&proc->cond_td,&proc->instance_cnt_td,"td thread")<0) break;
......@@ -820,6 +809,22 @@ 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;
LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id];
LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid];
if(ulsch_harq->C>3)
{
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)
{
......
......@@ -71,7 +71,7 @@ schedule_ue_spec_phy_test(
uint16_t rnti = 0x1235;
uint32_t rb_alloc = 0x1FFFFFFF;
int32_t tpc = 1;
int32_t mcs = 22;
int32_t mcs = 28;
int32_t cqi = 15;
int32_t ndi = subframeP/5;
int32_t dai = 0;
......
......@@ -719,7 +719,7 @@ void init_eNB_proc(int inst) {
PHY_VARS_eNB *eNB;
eNB_proc_t *proc;
eNB_rxtx_proc_t *proc_rxtx;
pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_prach=NULL,*attr_te=NULL,*attr_te1=NULL;//*attr_td=NULL;
pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_prach=NULL,*attr_te=NULL,*attr_te1=NULL,*attr_td=NULL;
#ifdef Rel14
pthread_attr_t *attr_prach_br=NULL;
#endif
......@@ -783,7 +783,7 @@ void init_eNB_proc(int inst) {
// attr_td = &proc->attr_td;
// attr_te = &proc->attr_te;
#endif
//attr_td = &proc->attr_td;
attr_td = &proc->attr_td;
attr_te = &proc->attr_te[0];
attr_te1 = &proc->attr_te[1];
pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, proc );
......@@ -809,7 +809,7 @@ void init_eNB_proc(int inst) {
//////////////////////////////////////need to modified////////////////*****
init_te_thread(eNB,attr_te,attr_te1);
//init_td_thread(eNB,attr_td);
init_td_thread(eNB,attr_td);
if (opp_enabled == 1) pthread_create(&proc->process_stats_thread,NULL,process_stats_thread,(void*)eNB);
......@@ -1070,7 +1070,7 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
#endif
eNB->td = ulsch_decoding_data;//(get_nprocs()<=4) ? ulsch_decoding_data : ulsch_decoding_data_2thread;
eNB->td = ulsch_decoding_data_all;//(get_nprocs()<=4) ? ulsch_decoding_data : ulsch_decoding_data_2thread;
eNB->te = dlsch_encoding_all;//(get_nprocs()<=4) ? dlsch_encoding : dlsch_encoding_2threads;
......
......@@ -689,7 +689,7 @@ static void* emulatedRF_thread(void* param) {
int microsec = 500; // length of time to sleep, in miliseconds
struct timespec req = {0};
req.tv_sec = 0;
req.tv_nsec = microsec * 1000L;
req.tv_nsec = ((microsec * 1000L)/numerology);
cpu_set_t cpuset;
CPU_SET(1,&cpuset);
pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
......
......@@ -206,7 +206,7 @@ extern void reset_opp_meas(void);
extern void print_opp_meas(void);
int transmission_mode=1;
int numerology = 0;
int numerology = 2;
int fh_two_thread = 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