Commit f4fd79c4 authored by Sakthivel Velumani's avatar Sakthivel Velumani

First commit

Created 3 threadpools for L1 rx, L1 tx and RU tx processing
parent 3b2d5037
......@@ -870,7 +870,7 @@ void init_gNB_proc(int inst) {
pthread_cond_init(&sync_phy_proc.cond_phy_proc_tx, NULL);
sync_phy_proc.phy_proc_CC_id = 0;
gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
gNB->threadPool_ulsch = (tpool_t*)malloc(sizeof(tpool_t));
gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
int numCPU = sysconf(_SC_NPROCESSORS_ONLN);
uint32_t num_threads_pusch;
......@@ -884,10 +884,50 @@ void init_gNB_proc(int inst) {
sprintf(ul_pool+2+s_offset,",-1");
s_offset += 3;
}
initTpool(ul_pool, gNB->threadPool, false);
initTpool(ul_pool, gNB->threadPool_ulsch, false);
initNotifiedFIFO(gNB->respDecode);
}
void init_gNB_Tpool(int inst) {
PHY_VARS_gNB *gNB;
gNB = RC.gNB[inst];
// ULSCH decoding threadpool
gNB->threadPool_ulsch = (tpool_t*)malloc(sizeof(tpool_t));
gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
int numCPU = sysconf(_SC_NPROCESSORS_ONLN);
uint32_t num_threads_pusch;
paramdef_t PUSCHThreads[] = NUM_THREADS_DESC;
config_get( PUSCHThreads,sizeof(PUSCHThreads)/sizeof(paramdef_t),NULL);
int threadCnt = min(numCPU, num_threads_pusch);
char ul_pool[80];
sprintf(ul_pool,"-1");
int s_offset = 0;
for (int icpu=1; icpu<threadCnt; icpu++) {
sprintf(ul_pool+2+s_offset,",-1");
s_offset += 3;
}
initTpool(ul_pool, gNB->threadPool_ulsch, false);
initNotifiedFIFO(gNB->respDecode);
// L1 RX threadpool
gNB->threadPool_L1 = (tpool_t*)malloc(sizeof(tpool_t));
gNB->resp_L1 = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
initTpool("-1", gNB->threadPool_L1, false);
initNotifiedFIFO(gNB->resp_L1);
// L1 TX threadpool
gNB->threadPool_L1_tx = (tpool_t*)malloc(sizeof(tpool_t));
gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
initTpool("-1",gNB->threadPool_L1_tx, false);
initNotifiedFIFO(gNB->resp_L1_tx);
// RU TX threadpool
gNB->threadPool_RU_tx = (tpool_t*)malloc(sizeof(tpool_t));
gNB->resp_RU_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
initTpool("-1",gNB->threadPool_RU_tx, false);
initNotifiedFIFO(gNB->resp_RU_tx);
}
/*!
......@@ -1010,15 +1050,10 @@ void init_eNB_afterRU(void) {
* (not tested in other modes).
*/
//init_precoding_weights(RC.gNB[inst]);
init_gNB_proc(inst);
//init_gNB_proc(inst);
init_gNB_Tpool(inst);
}
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
AssertFatal(RC.ru[ru_id]!=NULL,"ru_id %d is null\n",ru_id);
RC.ru[ru_id]->nr_wakeup_rxtx = wakeup_rxtx;
// RC.ru[ru_id]->wakeup_prach_eNB = wakeup_prach_gNB;
RC.ru[ru_id]->gNB_top = gNB_top;
}
}
void init_gNB(int single_thread_flag,int wait_for_sync) {
......
This diff is collapsed.
......@@ -640,7 +640,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
rdata->offset = offset;
rdata->ulsch = ulsch;
rdata->ulsch_id = UE_id;
pushTpool(phy_vars_gNB->threadPool,req);
pushTpool(phy_vars_gNB->threadPool_ulsch,req);
phy_vars_gNB->nbDecode++;
LOG_D(PHY,"Added a block to decode, in pipe: %d\n",phy_vars_gNB->nbDecode);
r_offset += E;
......
......@@ -832,7 +832,13 @@ typedef struct PHY_VARS_gNB_s {
time_stats_t ulsch_freq_offset_estimation_stats;
*/
notifiedFIFO_t *respDecode;
tpool_t *threadPool;
notifiedFIFO_t *resp_L1;
notifiedFIFO_t *resp_L1_tx;
notifiedFIFO_t *resp_RU_tx;
tpool_t *threadPool_ulsch;
tpool_t *threadPool_L1;
tpool_t *threadPool_L1_tx;
tpool_t *threadPool_RU_tx;
int nbDecode;
} PHY_VARS_gNB;
......
......@@ -243,7 +243,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
} else {
if ( rdata->nbSegments != ulsch_harq->processedSegments ) {
int nb=abortTpool(gNB->threadPool, req->key);
int nb=abortTpool(gNB->threadPool_ulsch, req->key);
nb+=abortNotifiedFIFO(gNB->respDecode, req->key);
gNB->nbDecode-=nb;
LOG_D(PHY,"uplink segment error %d/%d, aborted %d segments\n",rdata->segment_r,rdata->nbSegments, nb);
......@@ -353,7 +353,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
G);
while (gNB->nbDecode > 0) {
notifiedFIFO_elt_t *req=pullTpool(gNB->respDecode, gNB->threadPool);
notifiedFIFO_elt_t *req=pullTpool(gNB->respDecode, gNB->threadPool_ulsch);
nr_postDecode(gNB, req);
delNotifiedFIFO_elt(req);
}
......
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