Commit 69d378da authored by mir's avatar mir

TASK_MANAGER_UE_DECODING flag removed

parent c4caf487
#ifndef TASK_MANAGER_WORKING_STEALING_H
#define TASK_MANAGER_WORKING_STEALING_H
#define TASK_MANAGER_UE_DECODING
#define TASK_MANAGER_SIM
#define TASK_MANAGER_LTE
......
......@@ -489,10 +489,8 @@ int main(int argc, char **argv)
T_Config_Init();
#endif
#if defined TASK_MANAGER_UE_DECODING
int const num_threads = parse_num_threads(get_softmodem_params()->threadPoolConfig);
init_task_manager(&nrUE_params.man, num_threads);
#endif
//randominit (0);
set_taus_seed (0);
......
......@@ -70,10 +70,7 @@ typedef struct {
uint64_t optmask; //mask to store boolean config options
uint32_t ofdm_offset_divisor; // Divisor for sample offset computation for each OFDM symbol
int max_ldpc_iterations; // number of maximum LDPC iterations
#ifdef TASK_MANAGER_UE_DECODING
task_manager_t man;
#endif
// tpool_t Tpool; // thread pool
int UE_scan_carrier;
int UE_fo_compensation;
int timing_advance;
......
......@@ -74,7 +74,6 @@ void nr_dlsch_unscrambling(int16_t *llr, uint32_t size, uint8_t q, uint32_t Nid,
#ifdef TASK_MANAGER_UE_DECODING
static bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue,
ldpcDecode_ue_t *rdata,
bool last,
......@@ -83,18 +82,6 @@ static bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue,
int *num_seg_ok,
UE_nr_rxtx_proc_t *proc)
{
#else
static bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue,
notifiedFIFO_elt_t *req,
notifiedFIFO_t *nf_p,
const bool last,
int b_size,
uint8_t b[b_size],
int *num_seg_ok,
const UE_nr_rxtx_proc_t *proc)
{
ldpcDecode_ue_t *rdata = (ldpcDecode_ue_t*) NotifiedFifoData(req);
#endif
NR_DL_UE_HARQ_t *harq_process = rdata->harq_process;
NR_UE_DLSCH_t *dlsch = (NR_UE_DLSCH_t *) rdata->dlsch;
int r = rdata->segment_r;
......@@ -236,9 +223,8 @@ static void nr_processDLSegment(void *arg)
stop_meas(&rdata->ts_rate_unmatch);
LOG_E(PHY,"dlsch_decoding.c: Problem in rate_matching\n");
#ifdef TASK_MANAGER_UE_DECODING
// Task completed in parallel
completed_task_ans(rdata->ans);
#endif
return;
}
stop_meas(&rdata->ts_rate_unmatch);
......@@ -280,9 +266,9 @@ static void nr_processDLSegment(void *arg)
memcpy(harq_process->c[r], LDPCoutput, Kr >> 3);
stop_meas(&rdata->ts_ldpc_decode);
}
#ifdef TASK_MANAGER_UE_DECODING
// Task completed in parallel
completed_task_ans(rdata->ans);
#endif
}
uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
......@@ -422,24 +408,17 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
initNotifiedFIFO(&nf);
set_abort(&harq_process->abort_decode, false);
#ifdef TASK_MANAGER_UE_DECODING
ldpcDecode_ue_t arr[harq_process->C];
task_ans_t ans[harq_process->C];
memset(ans, 0, harq_process->C*sizeof(task_ans_t));
#endif
for (r=0; r<harq_process->C; r++) {
//printf("start rx segment %d\n",r);
uint32_t E = nr_get_E(G, harq_process->C, dlsch->dlsch_config.qamModOrder, dlsch->Nl, r);
decParams.R = nr_get_R_ldpc_decoder(dlsch->dlsch_config.rv, E, decParams.BG, decParams.Z, &harq_process->llrLen, harq_process->DLround);
#ifdef TASK_MANAGER_UE_DECODING
ldpcDecode_ue_t* rdata = &arr[r];
rdata->ans = &ans[r];
#else
union ldpcReqUnion id = {.s={dlsch->rnti,frame,nr_slot_rx,0,0}};
notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(ldpcDecode_ue_t), id.p, &nf, &nr_processDLSegment);
ldpcDecode_ue_t * rdata=(ldpcDecode_ue_t *) NotifiedFifoData(req);
#endif
rdata->phy_vars_ue = phy_vars_ue;
rdata->harq_process = harq_process;
rdata->decoderParms = decParams;
......@@ -462,12 +441,9 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
reset_meas(&rdata->ts_deinterleave);
reset_meas(&rdata->ts_rate_unmatch);
reset_meas(&rdata->ts_ldpc_decode);
#ifdef TASK_MANAGER_UE_DECODING
task_t t = {.args = rdata, .func = nr_processDLSegment };
async_task_manager(&get_nrUE_params()->man, t);
#else
pushTpool(&get_nrUE_params()->Tpool,req);
#endif
LOG_D(PHY, "Added a block to decode, in pipe: %d\n", r);
r_offset += E;
offset += (Kr_bytes - (harq_process->F>>3) - ((harq_process->C>1)?3:0));
......@@ -475,23 +451,12 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
}
int num_seg_ok = 0;
int nbDecode = harq_process->C;
#ifdef TASK_MANAGER_UE_DECODING
if(nbDecode > 0){
join_task_ans(ans, nbDecode);
for(size_t i = 0; i < nbDecode ; ++i){
nr_ue_postDecode(phy_vars_ue, &arr[i], i == nbDecode - 1, b_size, b, &num_seg_ok, proc);
}
}
#else
while (nbDecode) {
notifiedFIFO_elt_t *req=pullTpool(&nf, &get_nrUE_params()->Tpool);
if (req == NULL)
break; // Tpool has been stopped
nr_ue_postDecode(phy_vars_ue, req, &nf, nbDecode == 1, b_size, b, &num_seg_ok, proc);
delNotifiedFIFO_elt(req);
nbDecode--;
}
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_COMBINE_SEG, VCD_FUNCTION_OUT);
ret = dlsch->last_iteration_cnt;
......
......@@ -729,10 +729,16 @@ typedef struct PHY_VARS_gNB_s {
void *scopeData;
/// structure for analyzing high-level RT measurements
rt_L1_profiling_t rt_L1_profiling;
#if defined(TASK_MANAGER_RU) || defined(TASK_MANAGER_SIM)
task_manager_t man;
// Second tp needed to avoid a cycle at rx_func tx_func
// T0 -> waiting L1_tx_free -> fills L1_tx_filled (rx_func)
// T1 -> waiting join_task_ans -> fills L1_tx_out (tx_func)
// The task that let's join_task_ans continue is in the T1's queue
// i.e., cycle/deadlock as waiting to a task that the same
// thread should work on
// T3 -> waiting L1_tx_out -> fills L1_tx_free
task_manager_t man_rx_tx_ru;
#endif
} PHY_VARS_gNB;
typedef struct puschSymbolProc_s {
......
......@@ -676,9 +676,7 @@ typedef struct LDPCDecode_ue_s {
time_stats_t ts_rate_unmatch;
time_stats_t ts_ldpc_decode;
UE_nr_rxtx_proc_t proc;
#ifdef TASK_MANAGER_UE_DECODING
task_ans_t* ans;
#endif
} ldpcDecode_ue_t;
#include "SIMULATION/ETH_TRANSPORT/defs.h"
......
......@@ -858,11 +858,8 @@ int main(int argc, char **argv)
unsigned char *test_input_bit;
unsigned int errors_bit = 0;
#ifdef TASK_MANAGER_UE_DECODING
init_task_manager(&nrUE_params.man, max(1, dlsch_threads));
#else
initFloatingCoresTpool(dlsch_threads, &nrUE_params.Tpool, false, "UE-tpool");
#endif
test_input_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
estimated_output_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
......@@ -890,12 +887,9 @@ int main(int argc, char **argv)
//NR_COMMON_channels_t *cc = RC.nrmac[0]->common_channels;
int n_errs = 0;
#ifdef TASK_MANAGER_UE_DECODING
int const num_threads = parse_num_threads(gNBthreads);
init_task_manager(&gNB->man, num_threads);
#else
initNamedTpool(gNBthreads, &gNB->threadPool, true, "gNB-tpool");
#endif
initNotifiedFIFO(&gNB->L1_tx_free);
initNotifiedFIFO(&gNB->L1_tx_filled);
initNotifiedFIFO(&gNB->L1_tx_out);
......
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