Commit aa8810bf authored by mir's avatar mir

Cancellation added

parent 356da54c
...@@ -155,6 +155,12 @@ NR_gNB_ULSCH_t new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL) ...@@ -155,6 +155,12 @@ NR_gNB_ULSCH_t new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL)
void nr_processULSegment(void *arg) void nr_processULSegment(void *arg)
{ {
ldpcDecode_t *rdata = (ldpcDecode_t *)arg; ldpcDecode_t *rdata = (ldpcDecode_t *)arg;
#ifdef TASK_MANAGER
if(*rdata->cancel == true);
return;
#endif
PHY_VARS_gNB *phy_vars_gNB = rdata->gNB; PHY_VARS_gNB *phy_vars_gNB = rdata->gNB;
NR_UL_gNB_HARQ_t *ulsch_harq = rdata->ulsch_harq; NR_UL_gNB_HARQ_t *ulsch_harq = rdata->ulsch_harq;
t_nrLDPC_dec_params *p_decoderParms = &rdata->decoderParms; t_nrLDPC_dec_params *p_decoderParms = &rdata->decoderParms;
...@@ -610,6 +616,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -610,6 +616,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
#ifdef TASK_MANAGER #ifdef TASK_MANAGER
ldpcDecode_t* arr = calloc(harq_process->C, sizeof(ldpcDecode_t)); ldpcDecode_t* arr = calloc(harq_process->C, sizeof(ldpcDecode_t));
_Atomic bool cancel = false;
int idx_arr = 0; int idx_arr = 0;
#endif #endif
...@@ -617,6 +624,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -617,6 +624,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
int E = nr_get_E(G, harq_process->C, Qm, n_layers, r); int E = nr_get_E(G, harq_process->C, Qm, n_layers, r);
#ifdef TASK_MANAGER #ifdef TASK_MANAGER
ldpcDecode_t* rdata = &arr[idx_arr]; ldpcDecode_t* rdata = &arr[idx_arr];
rdata->cancel = &cancel;
++idx_arr; ++idx_arr;
#else #else
union ldpcReqUnion id = {.s = {ulsch->rnti, frame, nr_tti_rx, 0, 0}}; union ldpcReqUnion id = {.s = {ulsch->rnti, frame, nr_tti_rx, 0, 0}};
......
...@@ -810,6 +810,9 @@ typedef struct LDPCDecode_s { ...@@ -810,6 +810,9 @@ typedef struct LDPCDecode_s {
int offset; int offset;
int decodeIterations; int decodeIterations;
uint32_t tbslbrm; uint32_t tbslbrm;
#ifdef TASK_MANAGER
_Atomic bool* cancel;
#endif
} ldpcDecode_t; } ldpcDecode_t;
struct ldpcReqId { struct ldpcReqId {
......
...@@ -262,11 +262,11 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) ...@@ -262,11 +262,11 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req)
rdata->Kr_bytes - (ulsch_harq->F>>3) -((ulsch_harq->C>1)?3:0)); rdata->Kr_bytes - (ulsch_harq->F>>3) -((ulsch_harq->C>1)?3:0));
} else { } else {
if ( rdata->nbSegments != ulsch_harq->processedSegments ) { if (rdata->nbSegments != ulsch_harq->processedSegments){
// Let's forget about this optimization for now #ifdef TASK_MANAGER
printf("openair1/SCHED_NR/phy_procedures_nr_gNB.c:267 \n"); printf("openair1/SCHED_NR/phy_procedures_nr_gNB.c:267 \n");
assert(0 != 0); *rdata->cancel = true;
#ifndef TASK_MANAGER #else
int nb = abortTpoolJob(&gNB->threadPool, req->key); int nb = abortTpoolJob(&gNB->threadPool, req->key);
nb += abortNotifiedFIFOJob(&gNB->respDecode, req->key); nb += abortNotifiedFIFOJob(&gNB->respDecode, req->key);
gNB->nbDecode-=nb; gNB->nbDecode-=nb;
......
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