Commit 59caf353 authored by mir's avatar mir

Demodulation RF SIM working

parent 90b773a4
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// Comment for deactivating ws tpool // Comment for deactivating ws tpool
#define TASK_MANAGER_DECODING #define TASK_MANAGER_DECODING
//#define TASK_MANAGER_DEMODULATION #define TASK_MANAGER_DEMODULATION
//#define TASK_MANAGER_CODING //#define TASK_MANAGER_CODING
//#define TASK_MANAGER_RU //#define TASK_MANAGER_RU
......
...@@ -1440,6 +1440,10 @@ static void nr_pusch_symbol_processing(void *arg) ...@@ -1440,6 +1440,10 @@ static void nr_pusch_symbol_processing(void *arg)
for (int i = 0; i < (nb_re_pusch * rel15_ul->qam_mod_order * rel15_ul->nrOfLayers); i++) for (int i = 0; i < (nb_re_pusch * rel15_ul->qam_mod_order * rel15_ul->nrOfLayers); i++)
llr16[i] = llr_ptr[i] * rdata->s[i]; llr16[i] = llr_ptr[i] * rdata->s[i];
} }
#ifdef TASK_MANAGER_DEMODULATION
completed_task_ans(rdata->ans);
#endif
} }
...@@ -1650,6 +1654,15 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, ...@@ -1650,6 +1654,15 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
start_meas(&gNB->rx_pusch_symbol_processing_stats); start_meas(&gNB->rx_pusch_symbol_processing_stats);
int numSymbols = gNB->num_pusch_symbols_per_thread; int numSymbols = gNB->num_pusch_symbols_per_thread;
#ifdef TASK_MANAGER_DEMODULATION
int const loop_iter = rel15_ul->nr_of_symbols/numSymbols;
puschSymbolProc_t arr[loop_iter];
task_ans_t arr_ans[loop_iter];
memset(arr_ans, 0, loop_iter*sizeof(task_ans_t));
int sz_arr = 0;
#endif
for(uint8_t symbol = rel15_ul->start_symbol_index; for(uint8_t symbol = rel15_ul->start_symbol_index;
symbol < (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols); symbol < (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols);
symbol += numSymbols) symbol += numSymbols)
...@@ -1663,11 +1676,16 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, ...@@ -1663,11 +1676,16 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
total_res+=pusch_vars->ul_valid_re_per_slot[symbol+s]; total_res+=pusch_vars->ul_valid_re_per_slot[symbol+s];
} }
if (total_res > 0) { if (total_res > 0) {
#ifdef TASK_MANAGER_DEMODULATION
puschSymbolProc_t *rdata = &arr[sz_arr];
rdata->ans = &arr_ans[sz_arr];
++sz_arr;
#else
union puschSymbolReqUnion id = {.s={ulsch_id,frame,slot,0}}; union puschSymbolReqUnion id = {.s={ulsch_id,frame,slot,0}};
id.p=1+symbol; id.p=1+symbol;
notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(puschSymbolProc_t), id.p, &gNB->respPuschSymb, &nr_pusch_symbol_processing); // create a job for Tpool notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(puschSymbolProc_t), id.p, &gNB->respPuschSymb, &nr_pusch_symbol_processing); // create a job for Tpool
puschSymbolProc_t *rdata = (puschSymbolProc_t*)NotifiedFifoData(req); // data for the job puschSymbolProc_t *rdata = (puschSymbolProc_t*)NotifiedFifoData(req); // data for the job
#endif
rdata->gNB = gNB; rdata->gNB = gNB;
rdata->frame_parms = frame_parms; rdata->frame_parms = frame_parms;
rdata->rel15_ul = rel15_ul; rdata->rel15_ul = rel15_ul;
...@@ -1681,9 +1699,15 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, ...@@ -1681,9 +1699,15 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
rdata->nvar = nvar; rdata->nvar = nvar;
if (rel15_ul->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) { if (rel15_ul->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
// Obvious memory leak when TASK_MANAGER not defined
nr_pusch_symbol_processing(rdata); nr_pusch_symbol_processing(rdata);
} else { } else {
#ifdef TASK_MANAGER_DEMODULATION
task_t t = { .args = rdata, .func = &nr_pusch_symbol_processing };
async_task_manager(&gNB->man , t);
#else
pushTpool(&gNB->threadPool, req); pushTpool(&gNB->threadPool, req);
#endif
gNB->nbSymb++; gNB->nbSymb++;
} }
...@@ -1691,12 +1715,17 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, ...@@ -1691,12 +1715,17 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
} }
} // symbol loop } // symbol loop
#ifdef TASK_MANAGER_DEMODULATION
if(gNB->nbSymb > 0){
join_task_ans(arr_ans, sz_arr);
}
#else
while (gNB->nbSymb > 0) { while (gNB->nbSymb > 0) {
notifiedFIFO_elt_t *req = pullTpool(&gNB->respPuschSymb, &gNB->threadPool); notifiedFIFO_elt_t *req = pullTpool(&gNB->respPuschSymb, &gNB->threadPool);
gNB->nbSymb--; gNB->nbSymb--;
delNotifiedFIFO_elt(req); delNotifiedFIFO_elt(req);
} }
#endif
stop_meas(&gNB->rx_pusch_symbol_processing_stats); stop_meas(&gNB->rx_pusch_symbol_processing_stats);
return 0; return 0;
} }
...@@ -751,6 +751,9 @@ typedef struct puschSymbolProc_s { ...@@ -751,6 +751,9 @@ typedef struct puschSymbolProc_s {
int16_t **llr_layers; int16_t **llr_layers;
int16_t *s; int16_t *s;
uint32_t nvar; uint32_t nvar;
#ifdef TASK_MANAGER_DECODING
task_ans_t* ans;
#endif
} puschSymbolProc_t; } puschSymbolProc_t;
struct puschSymbolReqId { struct puschSymbolReqId {
......
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