Commit 356da54c authored by mir's avatar mir

UE softmodem working

parent 97dc9997
......@@ -12,6 +12,7 @@
#include <string.h>
#include <poll.h>
#include <sys/types.h>
#include <sys/sysinfo.h>
#include <fcntl.h>
......@@ -413,7 +414,10 @@ void* worker_thread(void* arg)
task_thread_args_t* args = (task_thread_args_t*)arg;
int const idx = args->idx;
pin_thread_to_core(idx+4);
int const log_cores = get_nprocs_conf();
assert(log_cores > 0);
// Assuming: 2 x Physical cores = Logical cores
pin_thread_to_core(idx+log_cores/2);
task_manager_t* man = args->man;
......
......@@ -2,7 +2,7 @@
#define TASK_MANAGER_WORKING_STEALING_H
// Comment for deactivating ws tpool
//#define TASK_MANAGER
#define TASK_MANAGER
#include "task.h"
......
......@@ -52,6 +52,11 @@
#include "PHY/MODULATION/nr_modulation.h"
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
#include "openair2/NR_PHY_INTERFACE/nr_sched_response.h"
#include "common/utils/thread_pool/task_manager.h"
#include <stdlib.h>
#include <stdio.h>
#include <sys/sysinfo.h>
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
......@@ -88,6 +93,7 @@
#include <openair1/PHY/NR_TRANSPORT/nr_dlsch.h>
#include <PHY/NR_ESTIMATION/nr_ul_estimation.h>
//#define USRP_DEBUG 1
// Fix per CC openair rf/if device update
// extern openair0_device openair0;
......@@ -466,6 +472,13 @@ void init_gNB_Tpool(int inst) {
gNB = RC.gNB[inst];
gNB_L1_proc_t *proc = &gNB->proc;
#ifdef TASK_MANAGER
int log_cores = get_nprocs_conf();
assert(log_cores > 0);
// Assuming: 2 x Physical cores = Logical cores
init_task_manager(&gNB->man, log_cores/2);
#endif
// ULSCH decoding threadpool
initTpool(get_softmodem_params()->threadPoolConfig, &gNB->threadPool, cpumeas(CPUMEAS_GETSTATE));
// ULSCH decoder result FIFO
......
......@@ -297,7 +297,7 @@ void nr_processULSegment(void *arg)
}
#ifdef TASK_MANAGER
if( phy_vars_gNB->ldpc_offload_flag)
if(phy_vars_gNB->ldpc_offload_flag == 0)
nr_postDecode(rdata->gNB, rdata);
#endif
......@@ -331,7 +331,9 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
int Kr;
int Kr_bytes;
#ifndef TASK_MANAGER
phy_vars_gNB->nbDecode = 0;
#endif
harq_process->processedSegments = 0;
// ------------------------------------------------------------------
......@@ -645,9 +647,9 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
async_task_manager(&phy_vars_gNB->man, t);
#else
pushTpool(&phy_vars_gNB->threadPool, req);
#endif
phy_vars_gNB->nbDecode++;
LOG_D(PHY, "Added a block to decode, in pipe: %d\n", phy_vars_gNB->nbDecode);
#endif
r_offset += E;
offset += (Kr_bytes - (harq_process->F >> 3) - ((harq_process->C > 1) ? 3 : 0));
//////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -777,7 +777,9 @@ typedef struct PHY_VARS_gNB_s {
pthread_t L1_tx_thread;
int L1_tx_thread_core;
struct processingData_L1tx *msgDataTx;
#ifndef TASK_MANAGER
int nbDecode;
#endif
void *scopeData;
/// structure for analyzing high-level RT measurements
rt_L1_profiling_t rt_L1_profiling;
......
......@@ -251,8 +251,11 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req)
ulsch_harq->processedSegments++;
LOG_D(PHY, "processing result of segment: %d, processed %d/%d\n",
rdata->segment_r, ulsch_harq->processedSegments, rdata->nbSegments);
#ifndef TASK_MANAGER
gNB->nbDecode--;
LOG_D(PHY,"remain to decoded in subframe: %d\n", gNB->nbDecode);
#endif
if (decodeSuccess) {
memcpy(ulsch_harq->b+rdata->offset,
ulsch_harq->c[r],
......@@ -261,6 +264,8 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req)
} else {
if ( rdata->nbSegments != ulsch_harq->processedSegments ) {
// Let's forget about this optimization for now
printf("openair1/SCHED_NR/phy_procedures_nr_gNB.c:267 \n");
assert(0 != 0);
#ifndef TASK_MANAGER
int nb = abortTpoolJob(&gNB->threadPool, req->key);
nb += abortNotifiedFIFOJob(&gNB->respDecode, req->key);
......
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