Commit c4caf487 authored by mir's avatar mir

TASK_MANAGER_RU removed

parent 5fcaf29f
#ifndef TASK_MANAGER_WORKING_STEALING_H #ifndef TASK_MANAGER_WORKING_STEALING_H
#define TASK_MANAGER_WORKING_STEALING_H #define TASK_MANAGER_WORKING_STEALING_H
#define TASK_MANAGER_RU
#define TASK_MANAGER_UE_DECODING #define TASK_MANAGER_UE_DECODING
#define TASK_MANAGER_SIM #define TASK_MANAGER_SIM
......
...@@ -1903,17 +1903,15 @@ void init_NR_RU(configmodule_interface_t *cfg, char *rf_config_file) ...@@ -1903,17 +1903,15 @@ void init_NR_RU(configmodule_interface_t *cfg, char *rf_config_file)
int threadCnt = ru->num_tpcores; int threadCnt = ru->num_tpcores;
if (threadCnt < 2) LOG_E(PHY,"Number of threads for gNB should be more than 1. Allocated only %d\n",threadCnt); if (threadCnt < 2) LOG_E(PHY,"Number of threads for gNB should be more than 1. Allocated only %d\n",threadCnt);
else LOG_I(PHY,"RU Thread pool size %d\n",threadCnt); else LOG_I(PHY,"RU Thread pool size %d\n",threadCnt);
char pool[80]; char pool[512] = {0};
int s_offset = sprintf(pool,"%d",ru->tpcores[0]); int s_offset = sprintf(pool,"%d",ru->tpcores[0]);
for (int icpu=1; icpu<threadCnt; icpu++) { for (int icpu=1; icpu<threadCnt; icpu++) {
s_offset+=sprintf(pool+s_offset,",%d",ru->tpcores[icpu]); s_offset+=sprintf(pool+s_offset,",%d",ru->tpcores[icpu]);
} }
LOG_I(PHY,"RU thread-pool core string %s\n",pool); LOG_I(PHY,"RU thread-pool core string %s\n",pool);
#ifdef TASK_MANAGER_RU int const num_threads = parse_num_threads(pool);
init_task_manager(&ru->man, ru->num_tpcores); init_task_manager(&ru->man, num_threads);
#endif
ru->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
initTpool(pool, ru->threadPool, cpumeas(CPUMEAS_GETSTATE));
// FEP RX result FIFO // FEP RX result FIFO
ru->respfeprx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); ru->respfeprx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
initNotifiedFIFO(ru->respfeprx); initNotifiedFIFO(ru->respfeprx);
......
...@@ -178,9 +178,7 @@ typedef struct { ...@@ -178,9 +178,7 @@ typedef struct {
int startSymbol; int startSymbol;
int endSymbol; int endSymbol;
int slot; int slot;
#ifdef TASK_MANAGER_RU
task_ans_t* ans; task_ans_t* ans;
#endif
} feprx_cmd_t; } feprx_cmd_t;
typedef struct { typedef struct {
...@@ -189,9 +187,7 @@ typedef struct { ...@@ -189,9 +187,7 @@ typedef struct {
int slot; int slot;
int startSymbol; int startSymbol;
int numSymbols; int numSymbols;
#ifdef TASK_MANAGER_RU
task_ans_t* ans; task_ans_t* ans;
#endif
} feptx_cmd_t; } feptx_cmd_t;
typedef struct { typedef struct {
...@@ -434,11 +430,7 @@ typedef enum { ...@@ -434,11 +430,7 @@ typedef enum {
typedef struct RU_t_s { typedef struct RU_t_s {
#ifdef TASK_MANAGER_RU
task_manager_t man; task_manager_t man;
#endif
/// ThreadPool for RU
tpool_t *threadPool;
/// index of this ru /// index of this ru
uint32_t idx; uint32_t idx;
/// pointer to first RU /// pointer to first RU
......
...@@ -322,83 +322,55 @@ void nr_feptx(void *arg) { ...@@ -322,83 +322,55 @@ void nr_feptx(void *arg) {
////////////FEPTX//////////// ////////////FEPTX////////////
nr_feptx0(ru,slot,startSymbol,numSymbols,aa); nr_feptx0(ru,slot,startSymbol,numSymbols,aa);
#ifdef TASK_MANAGER_RU // Task completed in //
completed_task_ans(feptx->ans); completed_task_ans(feptx->ans);
#endif
} }
// RU FEP TX using thread-pool // RU FEP TX using thread-pool
void nr_feptx_tp(RU_t *ru, int frame_tx, int slot) { void nr_feptx_tp(RU_t *ru, int frame_tx, int slot) {
nfapi_nr_config_request_scf_t *cfg = &ru->gNB_list[0]->gNB_config; nfapi_nr_config_request_scf_t *cfg = &ru->gNB_list[0]->gNB_config;
int nbfeptx=0;
if (nr_slot_select(cfg,frame_tx,slot) == NR_UPLINK_SLOT) return; if (nr_slot_select(cfg,frame_tx,slot) == NR_UPLINK_SLOT) return;
// for (int aa=0; aa<ru->nb_tx; aa++) memset(ru->common.txdataF[aa],0,ru->nr_frame_parms->samples_per_slot_wCP*sizeof(int32_t));
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM, 1 ); if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM, 1 );
start_meas(&ru->ofdm_total_stats); start_meas(&ru->ofdm_total_stats);
#ifdef TASK_MANAGER_RU
size_t const sz = ru->nb_tx + (ru->half_slot_parallelization>0)*ru->nb_tx; size_t const sz = ru->nb_tx + (ru->half_slot_parallelization>0)*ru->nb_tx;
feptx_cmd_t arr[sz]; feptx_cmd_t arr[sz];
task_ans_t ans[sz]; task_ans_t ans[sz];
memset(ans, 0, sz*sizeof(task_ans_t)); memset(ans, 0, sz*sizeof(task_ans_t));
#endif
for (int aid=0;aid<ru->nb_tx;aid++) { int nbfeptx = 0;
#ifdef TASK_MANAGER_RU for (int aid = 0; aid < ru->nb_tx; aid++) {
feptx_cmd_t *feptx_cmd = &arr[nbfeptx]; feptx_cmd_t *feptx_cmd = &arr[nbfeptx];
feptx_cmd->ans = &ans[nbfeptx]; feptx_cmd->ans = &ans[nbfeptx];
#else
notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(feptx_cmd_t), 2000 + aid,ru->respfeptx,nr_feptx);
feptx_cmd_t *feptx_cmd=(feptx_cmd_t*)NotifiedFifoData(req);
#endif
feptx_cmd->aid = aid; feptx_cmd->aid = aid;
feptx_cmd->ru = ru; feptx_cmd->ru = ru;
feptx_cmd->slot = slot; feptx_cmd->slot = slot;
feptx_cmd->startSymbol = 0; feptx_cmd->startSymbol = 0;
feptx_cmd->numSymbols = (ru->half_slot_parallelization>0)?ru->nr_frame_parms->symbols_per_slot>>1:ru->nr_frame_parms->symbols_per_slot; feptx_cmd->numSymbols = (ru->half_slot_parallelization>0)?ru->nr_frame_parms->symbols_per_slot>>1:ru->nr_frame_parms->symbols_per_slot;
#ifdef TASK_MANAGER_RU
task_t t = {.func = nr_feptx, .args = feptx_cmd}; task_t t = {.func = nr_feptx, .args = feptx_cmd};
async_task_manager(&ru->man, t); async_task_manager(&ru->man, t);
#else
pushTpool(ru->threadPool,req);
#endif
nbfeptx++; nbfeptx++;
if (ru->half_slot_parallelization>0) { if (ru->half_slot_parallelization>0) {
#ifdef TASK_MANAGER_RU
feptx_cmd_t *feptx_cmd = &arr[nbfeptx]; feptx_cmd_t *feptx_cmd = &arr[nbfeptx];
feptx_cmd->ans = &ans[nbfeptx]; feptx_cmd->ans = &ans[nbfeptx];
#else
notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(feptx_cmd_t), 2000 + aid + ru->nb_tx,ru->respfeptx,nr_feptx);
feptx_cmd_t *feptx_cmd=(feptx_cmd_t*)NotifiedFifoData(req);
#endif
feptx_cmd->aid = aid; feptx_cmd->aid = aid;
feptx_cmd->ru = ru; feptx_cmd->ru = ru;
feptx_cmd->slot = slot; feptx_cmd->slot = slot;
feptx_cmd->startSymbol = ru->nr_frame_parms->symbols_per_slot>>1; feptx_cmd->startSymbol = ru->nr_frame_parms->symbols_per_slot>>1;
feptx_cmd->numSymbols = ru->nr_frame_parms->symbols_per_slot>>1; feptx_cmd->numSymbols = ru->nr_frame_parms->symbols_per_slot>>1;
#ifdef TASK_MANAGER_RU
task_t t = {.func = nr_feptx, .args = feptx_cmd}; task_t t = {.func = nr_feptx, .args = feptx_cmd};
async_task_manager(&ru->man, t); async_task_manager(&ru->man, t);
#else
pushTpool(ru->threadPool,req);
#endif
nbfeptx++; nbfeptx++;
} }
} }
#ifdef TASK_MANAGER_RU join_task_ans(ans, nbfeptx);
if(nbfeptx > 0)
join_task_ans(ans, nbfeptx);
#else
while (nbfeptx>0) {
notifiedFIFO_elt_t *req=pullTpool(ru->respfeptx, ru->threadPool);
delNotifiedFIFO_elt(req);
nbfeptx--;
}
#endif
stop_meas(&ru->ofdm_total_stats); stop_meas(&ru->ofdm_total_stats);
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM, 0 ); if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM, 0 );
...@@ -430,9 +402,8 @@ void nr_fep(void* arg) { ...@@ -430,9 +402,8 @@ void nr_fep(void* arg) {
ru->N_TA_offset); ru->N_TA_offset);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+aid, 0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+aid, 0);
#ifdef TASK_MANAGER_RU // Task completed in //
completed_task_ans(feprx_cmd->ans); completed_task_ans(feprx_cmd->ans);
#endif
} }
// RU RX FEP using thread-pool // RU RX FEP using thread-pool
...@@ -442,67 +413,42 @@ void nr_fep_tp(RU_t *ru, int slot) { ...@@ -442,67 +413,42 @@ void nr_fep_tp(RU_t *ru, int slot) {
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 ); if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
start_meas(&ru->ofdm_demod_stats); start_meas(&ru->ofdm_demod_stats);
#ifdef TASK_MANAGER_RU
size_t const sz = ru->nb_rx + (ru->half_slot_parallelization>0)*ru->nb_rx; size_t const sz = ru->nb_rx + (ru->half_slot_parallelization>0)*ru->nb_rx;
feprx_cmd_t arr[sz]; feprx_cmd_t arr[sz];
task_ans_t ans[sz]; task_ans_t ans[sz];
memset(&ans, 0, sz * sizeof(task_ans_t)); memset(&ans, 0, sz * sizeof(task_ans_t));
#endif
for (int aid=0;aid<ru->nb_rx;aid++) { for (int aid=0;aid<ru->nb_rx;aid++) {
#ifdef TASK_MANAGER_RU
feprx_cmd_t* feprx_cmd= &arr[nbfeprx]; feprx_cmd_t* feprx_cmd= &arr[nbfeprx];
feprx_cmd->ans = &ans[nbfeprx]; feprx_cmd->ans = &ans[nbfeprx];
#else
notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(feprx_cmd_t), 1000 + aid,ru->respfeprx,nr_fep);
feprx_cmd_t *feprx_cmd=(feprx_cmd_t*)NotifiedFifoData(req);
#endif
feprx_cmd->aid = aid; feprx_cmd->aid = aid;
feprx_cmd->ru = ru; feprx_cmd->ru = ru;
feprx_cmd->slot = ru->proc.tti_rx; feprx_cmd->slot = ru->proc.tti_rx;
feprx_cmd->startSymbol = 0; feprx_cmd->startSymbol = 0;
feprx_cmd->endSymbol = (ru->half_slot_parallelization > 0)?(ru->nr_frame_parms->symbols_per_slot>>1)-1:(ru->nr_frame_parms->symbols_per_slot-1); feprx_cmd->endSymbol = (ru->half_slot_parallelization > 0)?(ru->nr_frame_parms->symbols_per_slot>>1)-1:(ru->nr_frame_parms->symbols_per_slot-1);
#ifdef TASK_MANAGER_RU
task_t t = {.func = nr_fep, .args = feprx_cmd}; task_t t = {.func = nr_fep, .args = feprx_cmd};
async_task_manager(&ru->man, t); async_task_manager(&ru->man, t);
#else
pushTpool(ru->threadPool,req);
#endif
nbfeprx++; nbfeprx++;
if (ru->half_slot_parallelization>0) { if (ru->half_slot_parallelization>0) {
#ifdef TASK_MANAGER_RU
feprx_cmd_t* feprx_cmd= &arr[nbfeprx]; feprx_cmd_t* feprx_cmd= &arr[nbfeprx];
feprx_cmd->ans = &ans[nbfeprx]; feprx_cmd->ans = &ans[nbfeprx];
#else
notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(feprx_cmd_t), 1000 + aid + ru->nb_rx,ru->respfeprx,nr_fep); feprx_cmd->aid = aid;
feprx_cmd_t *feprx_cmd=(feprx_cmd_t*)NotifiedFifoData(req); feprx_cmd->ru = ru;
#endif feprx_cmd->slot = ru->proc.tti_rx;
feprx_cmd->aid = aid; feprx_cmd->startSymbol = ru->nr_frame_parms->symbols_per_slot>>1;
feprx_cmd->ru = ru; feprx_cmd->endSymbol = ru->nr_frame_parms->symbols_per_slot-1;
feprx_cmd->slot = ru->proc.tti_rx;
feprx_cmd->startSymbol = ru->nr_frame_parms->symbols_per_slot>>1;
feprx_cmd->endSymbol = ru->nr_frame_parms->symbols_per_slot-1;
#ifdef TASK_MANAGER_RU
task_t t = {.func = nr_fep, .args = feprx_cmd}; task_t t = {.func = nr_fep, .args = feprx_cmd};
async_task_manager(&ru->man, t); async_task_manager(&ru->man, t);
#else
pushTpool(ru->threadPool,req);
#endif
nbfeprx++; nbfeprx++;
} }
} }
#ifdef TASK_MANAGER_RU
if(nbfeprx > 0) join_task_ans(ans, nbfeprx);
join_task_ans(ans, nbfeprx);
#else
while (nbfeprx>0) {
notifiedFIFO_elt_t *req=pullTpool(ru->respfeprx, ru->threadPool);
delNotifiedFIFO_elt(req);
nbfeprx--;
}
#endif
stop_meas(&ru->ofdm_demod_stats); stop_meas(&ru->ofdm_demod_stats);
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 0 ); if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 0 );
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include <time.h> #include <time.h>
#include <stdint.h> #include <stdint.h>
/*
static static
int64_t time_now_ns(void) int64_t time_now_ns(void)
{ {
...@@ -56,7 +56,7 @@ int64_t time_now_ns(void) ...@@ -56,7 +56,7 @@ int64_t time_now_ns(void)
int64_t nanos = tms.tv_sec * 1000000000 + tms.tv_nsec; int64_t nanos = tms.tv_sec * 1000000000 + tms.tv_nsec;
return nanos; return nanos;
} }
*/
//#define DEBUG_RXDATA //#define DEBUG_RXDATA
//#define SRS_IND_DEBUG //#define SRS_IND_DEBUG
......
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