Commit f0759d6e authored by laurent's avatar laurent

dl in threadpool ok

parent 63c02302
...@@ -29,6 +29,7 @@ static int DEFENBS[] = {0}; ...@@ -29,6 +29,7 @@ static int DEFENBS[] = {0};
#include <openair1/PHY/LTE_REFSIG/lte_refsig.h> #include <openair1/PHY/LTE_REFSIG/lte_refsig.h>
#include <nfapi/oai_integration/nfapi_pnf.h> #include <nfapi/oai_integration/nfapi_pnf.h>
#include <executables/split_headers.h> #include <executables/split_headers.h>
#include <common/utils/threadPool/thread-pool.h>
extern uint16_t sf_ahead; extern uint16_t sf_ahead;
...@@ -691,6 +692,13 @@ static void *ru_thread( void *param ) { ...@@ -691,6 +692,13 @@ static void *ru_thread( void *param ) {
L1_rxtx_proc_t L1proc; L1_rxtx_proc_t L1proc;
L1_rxtx_proc_t *proc=&L1proc; L1_rxtx_proc_t *proc=&L1proc;
if ( strlen(get_softmodem_params()->threadPoolConfig) > 0 ) {
initTpool(get_softmodem_params()->threadPoolConfig, &L1proc.threadPool, true);
initNotifiedFIFO(&L1proc.respEncode);
initNotifiedFIFO(&L1proc.respDecode);
} else
initTpool("n", &L1proc.threadPool, true);
if (ru->if_south == LOCAL_RF) { // configure RF parameters only if (ru->if_south == LOCAL_RF) { // configure RF parameters only
fill_rf_config(ru,ru->rf_config_file); fill_rf_config(ru,ru->rf_config_file);
init_frame_parms(&ru->frame_parms,1); init_frame_parms(&ru->frame_parms,1);
......
...@@ -314,17 +314,17 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t ...@@ -314,17 +314,17 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t
proc->frame_tx,proc->subframe_tx, proc->frame_tx,proc->subframe_tx,
dlsch0->rnti,dlsch0->harq_mask, dlsch0->rnti,dlsch0->harq_mask,
rel8->rnti, rel8->rnti_type, rel8->harq_process, rel8->new_data_indicator_1, rel8->rnti, rel8->rnti_type, rel8->harq_process, rel8->new_data_indicator_1,
dlsch0_harq->round, dlsch0->harq_mask, dlsch0_harq->ndi); dlsch0_harq->DLround, dlsch0->harq_mask, dlsch0_harq->ndi);
if (dlsch0->rnti != rel8->rnti) { // if rnti of dlsch is not the same as in the config, this is a new entry if (dlsch0->rnti != rel8->rnti) { // if rnti of dlsch is not the same as in the config, this is a new entry
dlsch0_harq->round=0; dlsch0_harq->DLround=0;
dlsch0->harq_mask=0; dlsch0->harq_mask=0;
} }
if ((dlsch0->harq_mask & (1 << rel8->harq_process)) > 0) { if ((dlsch0->harq_mask & (1 << rel8->harq_process)) > 0) {
if (rel8->new_data_indicator_1 != dlsch0_harq->ndi) if (rel8->new_data_indicator_1 != dlsch0_harq->ndi)
dlsch0_harq->round = 0; dlsch0_harq->DLround = 0;
} else { // process is inactive, so activate and set round to 0 } else { // process is inactive, so activate and set round to 0
dlsch0_harq->round = 0; dlsch0_harq->DLround = 0;
} }
dlsch0_harq->ndi = rel8->new_data_indicator_1; dlsch0_harq->ndi = rel8->new_data_indicator_1;
...@@ -335,12 +335,12 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t ...@@ -335,12 +335,12 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t
dlsch0->active = 1; dlsch0->active = 1;
#endif #endif
if (rel8->rnti_type == 2) if (rel8->rnti_type == 2)
dlsch0_harq->round = 0; dlsch0_harq->DLround = 0;
LOG_D(PHY,"NFAPI: rel8[rnti %x dci_format %d harq_process %d ndi1 %d rnti type %d] dlsch0[rnti %x harq_mask %x] dlsch0_harq[round %d ndi %d]\n", LOG_D(PHY,"NFAPI: rel8[rnti %x dci_format %d harq_process %d ndi1 %d rnti type %d] dlsch0[rnti %x harq_mask %x] dlsch0_harq[round %d ndi %d]\n",
rel8->rnti,rel8->dci_format,rel8->harq_process, rel8->new_data_indicator_1, rel8->rnti_type, rel8->rnti,rel8->dci_format,rel8->harq_process, rel8->new_data_indicator_1, rel8->rnti_type,
dlsch0->rnti,dlsch0->harq_mask, dlsch0->rnti,dlsch0->harq_mask,
dlsch0_harq->round,dlsch0_harq->ndi dlsch0_harq->DLround,dlsch0_harq->ndi
); );
switch (rel8->dci_format) { switch (rel8->dci_format) {
...@@ -503,7 +503,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t ...@@ -503,7 +503,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t
NPRB = dlsch0_harq->nb_rb; NPRB = dlsch0_harq->nb_rb;
I_mcs = get_I_TBS(rel8->mcs_1); I_mcs = get_I_TBS(rel8->mcs_1);
} }
AssertFatal(NPRB>0,"DCI 1A: NPRB = 0 (rnti %x, rnti type %d, tpc %d, round %d, resource_block_coding %d, harq process %d)\n",rel8->rnti,rel8->rnti_type,rel8->tpc,dlsch0_harq->round,rel8->resource_block_coding,rel8->harq_process); AssertFatal(NPRB>0,"DCI 1A: NPRB = 0 (rnti %x, rnti type %d, tpc %d, round %d, resource_block_coding %d, harq process %d)\n",rel8->rnti,rel8->rnti_type,rel8->tpc,dlsch0_harq->DLround,rel8->resource_block_coding,rel8->harq_process);
dlsch0_harq->rvidx = rel8->redundancy_version_1; dlsch0_harq->rvidx = rel8->redundancy_version_1;
dlsch0_harq->Nl = 1; dlsch0_harq->Nl = 1;
dlsch0_harq->mimo_mode = (fp->nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI; dlsch0_harq->mimo_mode = (fp->nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI;
...@@ -523,12 +523,12 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t ...@@ -523,12 +523,12 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t
dlsch0->rnti = rel8->rnti; dlsch0->rnti = rel8->rnti;
//dlsch0->harq_ids[subframe] = rel8->harq_process; //dlsch0->harq_ids[subframe] = rel8->harq_process;
if (dlsch0_harq->round == 0) if (dlsch0_harq->DLround == 0)
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
dlsch0->harq_mask |= (1 << rel8->harq_process); dlsch0->harq_mask |= (1 << rel8->harq_process);
if (rel8->rnti_type == 1) LOG_D(PHY,"DCI 1A: round %d, mcs %d, TBS %d, rballoc %x, rv %d, rnti %x, harq process %d\n",dlsch0_harq->round,rel8->mcs_1,dlsch0_harq->TBS,rel8->resource_block_coding,rel8->redundancy_version_1,rel8->rnti,rel8->harq_process); if (rel8->rnti_type == 1) LOG_D(PHY,"DCI 1A: round %d, mcs %d, TBS %d, rballoc %x, rv %d, rnti %x, harq process %d\n",dlsch0_harq->DLround,rel8->mcs_1,dlsch0_harq->TBS,rel8->resource_block_coding,rel8->redundancy_version_1,rel8->rnti,rel8->harq_process);
break; break;
case NFAPI_DL_DCI_FORMAT_1: case NFAPI_DL_DCI_FORMAT_1:
...@@ -690,7 +690,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t ...@@ -690,7 +690,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t
if (dlsch0_harq->round == 0) { if (dlsch0_harq->DLround == 0) {
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
// printf("Setting DLSCH process %d to ACTIVE\n",rel8->harq_process); // printf("Setting DLSCH process %d to ACTIVE\n",rel8->harq_process);
...@@ -1042,16 +1042,16 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t ...@@ -1042,16 +1042,16 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t
// reset HARQ process if this is the first transmission // reset HARQ process if this is the first transmission
#ifdef PHY_TX_THREAD #ifdef PHY_TX_THREAD
if ((dlsch0->active[subframe]==1) && (dlsch0_harq->round == 0)) if ((dlsch0->active[subframe]==1) && (dlsch0_harq->DLround == 0))
#else #else
if ((dlsch0->active==1) && (dlsch0_harq->round == 0)) if ((dlsch0->active==1) && (dlsch0_harq->DLround == 0))
#endif #endif
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
#ifdef PHY_TX_THREAD #ifdef PHY_TX_THREAD
if ((dlsch1->active[subframe]==1) && (dlsch1_harq->round == 0)) if ((dlsch1->active[subframe]==1) && (dlsch1_harq->DLround == 0))
#else #else
if ((dlsch1->active==1) && (dlsch1_harq->round == 0)) if ((dlsch1->active==1) && (dlsch1_harq->DLround == 0))
#endif #endif
dlsch1_harq->status = ACTIVE; dlsch1_harq->status = ACTIVE;
...@@ -1479,7 +1479,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t ...@@ -1479,7 +1479,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t
printf ("dlsch0 eNB: NBRB %d\n", dlsch0_harq->nb_rb); printf ("dlsch0 eNB: NBRB %d\n", dlsch0_harq->nb_rb);
printf ("dlsch0 eNB: rballoc %x\n", dlsch0_harq->rb_alloc[0]); printf ("dlsch0 eNB: rballoc %x\n", dlsch0_harq->rb_alloc[0]);
printf ("dlsch0 eNB: harq_pid %d\n", harq_pid); printf ("dlsch0 eNB: harq_pid %d\n", harq_pid);
printf ("dlsch0 eNB: round %d\n", dlsch0_harq->round); printf ("dlsch0 eNB: round %d\n", dlsch0_harq->DLround);
printf ("dlsch0 eNB: rvidx %d\n", dlsch0_harq->rvidx); printf ("dlsch0 eNB: rvidx %d\n", dlsch0_harq->rvidx);
printf ("dlsch0 eNB: TBS %d (NPRB %d)\n", dlsch0_harq->TBS, NPRB); printf ("dlsch0 eNB: TBS %d (NPRB %d)\n", dlsch0_harq->TBS, NPRB);
printf ("dlsch0 eNB: mcs %d\n", dlsch0_harq->mcs); printf ("dlsch0 eNB: mcs %d\n", dlsch0_harq->mcs);
...@@ -1493,7 +1493,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t ...@@ -1493,7 +1493,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t
printf ("dlsch1 eNB: NBRB %d\n", dlsch1_harq->nb_rb); printf ("dlsch1 eNB: NBRB %d\n", dlsch1_harq->nb_rb);
printf ("dlsch1 eNB: rballoc %x\n", dlsch1_harq->rb_alloc[0]); printf ("dlsch1 eNB: rballoc %x\n", dlsch1_harq->rb_alloc[0]);
printf ("dlsch1 eNB: harq_pid %d\n", harq_pid); printf ("dlsch1 eNB: harq_pid %d\n", harq_pid);
printf ("dlsch1 eNB: round %d\n", dlsch1_harq->round); printf ("dlsch1 eNB: round %d\n", dlsch1_harq->DLround);
printf ("dlsch1 eNB: rvidx %d\n", dlsch1_harq->rvidx); printf ("dlsch1 eNB: rvidx %d\n", dlsch1_harq->rvidx);
printf ("dlsch1 eNB: TBS %d (NPRB %d)\n", dlsch1_harq->TBS, NPRB); printf ("dlsch1 eNB: TBS %d (NPRB %d)\n", dlsch1_harq->TBS, NPRB);
printf ("dlsch1 eNB: mcs %d\n", dlsch1_harq->mcs); printf ("dlsch1 eNB: mcs %d\n", dlsch1_harq->mcs);
...@@ -1748,19 +1748,19 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,mDCI_ALLOC_t *dc ...@@ -1748,19 +1748,19 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,mDCI_ALLOC_t *dc
dlsch0->subframe_tx[subframe] = 1; dlsch0->subframe_tx[subframe] = 1;
if (dlsch0->rnti != rel13->rnti) { // if rnti of dlsch is not the same as in the config, this is a new entry if (dlsch0->rnti != rel13->rnti) { // if rnti of dlsch is not the same as in the config, this is a new entry
dlsch0_harq->round = 0; dlsch0_harq->DLround = 0;
dlsch0->harq_mask =0; dlsch0->harq_mask =0;
printf("*********************** rnti %x => %x, pos %d\n",rel13->rnti,dlsch0->rnti,UE_id); printf("*********************** rnti %x => %x, pos %d\n",rel13->rnti,dlsch0->rnti,UE_id);
} }
if ((dlsch0->harq_mask & (1 << rel13->harq_process)) > 0) { if ((dlsch0->harq_mask & (1 << rel13->harq_process)) > 0) {
if ((rel13->new_data_indicator != dlsch0_harq->ndi)||(dci_alloc->ra_flag==1)) if ((rel13->new_data_indicator != dlsch0_harq->ndi)||(dci_alloc->ra_flag==1))
dlsch0_harq->round = 0; dlsch0_harq->DLround = 0;
} else { // process is inactive, so activate and set round to 0 } else { // process is inactive, so activate and set round to 0
dlsch0_harq->round = 0; dlsch0_harq->DLround = 0;
} }
dlsch0_harq->ndi = rel13->new_data_indicator; dlsch0_harq->ndi = rel13->new_data_indicator;
if (dlsch0_harq->round == 0) { if (dlsch0_harq->DLround == 0) {
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
dlsch0_harq->mcs = rel13->mcs; dlsch0_harq->mcs = rel13->mcs;
if (dci_alloc->ra_flag == 0) // get TBS from table using mcs and nb_rb if (dci_alloc->ra_flag == 0) // get TBS from table using mcs and nb_rb
...@@ -1782,7 +1782,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,mDCI_ALLOC_t *dc ...@@ -1782,7 +1782,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,mDCI_ALLOC_t *dc
dlsch0->harq_ids[dlsch0_harq->frame%2][dlsch0_harq->subframe] = rel13->harq_process; dlsch0->harq_ids[dlsch0_harq->frame%2][dlsch0_harq->subframe] = rel13->harq_process;
dlsch0_harq->pdsch_start = rel13->start_symbol; dlsch0_harq->pdsch_start = rel13->start_symbol;
LOG_D(PHY,"Setting DLSCH harq %d round %d to active for %d.%d\n",rel13->harq_process,dlsch0_harq->round,dlsch0_harq->frame,dlsch0_harq->subframe); LOG_D(PHY,"Setting DLSCH harq %d round %d to active for %d.%d\n",rel13->harq_process,dlsch0_harq->DLround,dlsch0_harq->frame,dlsch0_harq->subframe);
dlsch0->rnti = rel13->rnti; dlsch0->rnti = rel13->rnti;
......
This diff is collapsed.
...@@ -102,6 +102,7 @@ void generate_mch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,uint8_t *a) ...@@ -102,6 +102,7 @@ void generate_mch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,uint8_t *a)
AssertFatal(dlsch_encoding(eNB, AssertFatal(dlsch_encoding(eNB,
proc,
a, a,
1, 1,
eNB->dlsch_MCH, eNB->dlsch_MCH,
......
...@@ -71,7 +71,7 @@ typedef struct { ...@@ -71,7 +71,7 @@ typedef struct {
/// Subframe where current HARQ round was sent /// Subframe where current HARQ round was sent
uint32_t subframe; uint32_t subframe;
/// Index of current HARQ round for this DLSCH /// Index of current HARQ round for this DLSCH
uint8_t round; uint8_t DLround;
/// Modulation order /// Modulation order
uint8_t Qm; uint8_t Qm;
/// MCS /// MCS
...@@ -103,7 +103,7 @@ typedef struct { ...@@ -103,7 +103,7 @@ typedef struct {
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18) /// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e[MAX_NUM_CHANNEL_BITS] __attribute__((aligned(32))); uint8_t e[MAX_NUM_CHANNEL_BITS] __attribute__((aligned(32)));
/// Turbo-code outputs (36-212 V8.6 2009-03, p.12 /// Turbo-code outputs (36-212 V8.6 2009-03, p.12
uint8_t *d[MAX_NUM_DLSCH_SEGMENTS];//[(96+3+(3*6144))]; //uint8_t *d[MAX_NUM_DLSCH_SEGMENTS];//[(96+3+(3*6144))];
/// Sub-block interleaver outputs (36-212 V8.6 2009-03, p.16-17) /// Sub-block interleaver outputs (36-212 V8.6 2009-03, p.16-17)
uint8_t w[MAX_NUM_DLSCH_SEGMENTS][3*6144]; uint8_t w[MAX_NUM_DLSCH_SEGMENTS][3*6144];
/// Number of code segments (for definition see 36-212 V8.6 2009-03, p.9) /// Number of code segments (for definition see 36-212 V8.6 2009-03, p.9)
...@@ -272,6 +272,7 @@ typedef struct { ...@@ -272,6 +272,7 @@ typedef struct {
/// Pointer to the payload /// Pointer to the payload
uint8_t *b; uint8_t *b;
/// Pointers to transport block segments /// Pointers to transport block segments
//TBD
uint8_t *c[MAX_NUM_ULSCH_SEGMENTS]; uint8_t *c[MAX_NUM_ULSCH_SEGMENTS];
/// RTC values for each segment (for definition see 36-212 V8.6 2009-03, p.15) /// RTC values for each segment (for definition see 36-212 V8.6 2009-03, p.15)
uint32_t RTC[MAX_NUM_ULSCH_SEGMENTS]; uint32_t RTC[MAX_NUM_ULSCH_SEGMENTS];
...@@ -288,7 +289,10 @@ typedef struct { ...@@ -288,7 +289,10 @@ typedef struct {
/// soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15) /// soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
int16_t w[MAX_NUM_ULSCH_SEGMENTS][3*(6144+64)]; int16_t w[MAX_NUM_ULSCH_SEGMENTS][3*(6144+64)];
/// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15) /// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
//TBD
int16_t *d[MAX_NUM_ULSCH_SEGMENTS]; int16_t *d[MAX_NUM_ULSCH_SEGMENTS];
uint32_t processedSegments;
uint32_t processedBadSegment;
/// Number of code segments (for definition see 36-212 V8.6 2009-03, p.9) /// Number of code segments (for definition see 36-212 V8.6 2009-03, p.9)
uint32_t C; uint32_t C;
/// Number of "small" code segments (for definition see 36-212 V8.6 2009-03, p.10) /// Number of "small" code segments (for definition see 36-212 V8.6 2009-03, p.10)
......
...@@ -73,6 +73,7 @@ void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch); ...@@ -73,6 +73,7 @@ void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch);
LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag); LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag);
int dlsch_encoding_all(PHY_VARS_eNB *eNB, int dlsch_encoding_all(PHY_VARS_eNB *eNB,
L1_rxtx_proc_t *proc,
unsigned char *a, unsigned char *a,
uint8_t num_pdcch_symbols, uint8_t num_pdcch_symbols,
LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch,
...@@ -112,6 +113,7 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB, ...@@ -112,6 +113,7 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
@returns status @returns status
*/ */
int32_t dlsch_encoding(PHY_VARS_eNB *eNB, int32_t dlsch_encoding(PHY_VARS_eNB *eNB,
L1_rxtx_proc_t *proc,
uint8_t *a, uint8_t *a,
uint8_t num_pdcch_symbols, uint8_t num_pdcch_symbols,
LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch,
......
...@@ -313,6 +313,14 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) ...@@ -313,6 +313,14 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
r_offset += E; r_offset += E;
start_meas(&eNB->ulsch_deinterleaving_stats); start_meas(&eNB->ulsch_deinterleaving_stats);
#if 0
start_meas(&eNB->ulsch_deinterleaving_stats);
req=createRequest(DECODE,sizeof(turboDecode_t));
req->startUELoop=eNB->proc.threadPool.startProcessingUE;
union turboReqUnion id= {.s={eNB->ulsch[UE_id]->rnti,frame,subframe,r,0}};
req->id= id.p;
turboDecode_t * rdata=(turboDecode_t *) req->data;
#endif
sub_block_deinterleaving_turbo(4+Kr, sub_block_deinterleaving_turbo(4+Kr,
&ulsch_harq->d[r][96], &ulsch_harq->d[r][96],
ulsch_harq->w[r]); ulsch_harq->w[r]);
...@@ -322,6 +330,58 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) ...@@ -322,6 +330,58 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
crc_type = CRC24_A; crc_type = CRC24_A;
else else
crc_type = CRC24_B; crc_type = CRC24_B;
#if 0
rdata->frame=frame;
rdata->subframe=subframe;
rdata->UEid=UE_id;
rdata->harq_pid=harq_pid;
rdata->Kr=Kr;
rdata->maxIterations=eNB->ulsch[UE_id]->max_turbo_iterations;
rdata->ulsch_harq=ulsch_harq;
rdata->eNB=eNB;
rdata->nbSegments=ulsch_harq->C;
rdata->segment_r=r;
rdata->Fbits=(r==0) ? ulsch_harq->F : 0;
rdata->offset=offset;
rdata->function=td;
int Fbytes=rdata->Fbits>>3;
int blockSize=Kr_bytes - Fbytes - (rdata->nbSegments>1?3:0);
if ( eNB->proc.threadPool.activated) {
add_request(req, &eNB->proc.threadPool);
req=NULL;
} else {
req->startProcessingTime=rdtsc();
rdata->decodeIterations = td( rdata->soft_bits+96,
rdata->decoded_bytes,
rdata->Kr,
f1f2mat_old[rdata->iind*2],
f1f2mat_old[(rdata->iind*2)+1],
rdata->maxIterations,
rdata->nbSegments == 1 ? CRC24_A: CRC24_B,
rdata->Fbits,
&eNB->ulsch_tc_init_stats,
&eNB->ulsch_tc_alpha_stats,
&eNB->ulsch_tc_beta_stats,
&eNB->ulsch_tc_gamma_stats,
&eNB->ulsch_tc_ext_stats,
&eNB->ulsch_tc_intl1_stats,
&eNB->ulsch_tc_intl2_stats);
stop_meas(&eNB->ulsch_turbo_decoding_stats);
req->returnTime=req->endProcessingTime=rdtsc();
req->decodeIterations=rdata->decodeIterations;
req->coreId=0;
req->processedBy[0]=0;
req->next=eNB->proc.threadPool.doneRequests;
eNB->proc.threadPool.doneRequests=req;
if (rdata->decodeIterations > eNB->ulsch[UE_id]->max_turbo_iterations )
// Entire TPU need retransmission
break;
}
offset += blockSize;
eNB->proc.threadPool.startProcessingUE=rdtsc();
#endif
start_meas(&eNB->ulsch_turbo_decoding_stats); start_meas(&eNB->ulsch_turbo_decoding_stats);
ret = tc(&ulsch_harq->d[r][96], ret = tc(&ulsch_harq->d[r][96],
NULL, NULL,
......
...@@ -1332,8 +1332,6 @@ void rx_ulsch_emul(PHY_VARS_eNB *eNB, ...@@ -1332,8 +1332,6 @@ void rx_ulsch_emul(PHY_VARS_eNB *eNB,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch); eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch);
sprintf(fname,"/tmp/ulsch_r%d_d",round); sprintf(fname,"/tmp/ulsch_r%d_d",round);
sprintf(vname,"/tmp/ulsch_r%d_dseq",round); sprintf(vname,"/tmp/ulsch_r%d_dseq",round);
LOG_UM(fname,vname,&eNB->ulsch[UE_id]->harq_processes[harq_pid]->d[0][96],
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Kplus*3,1,0);
if (eNB->common_vars.rxdata) { if (eNB->common_vars.rxdata) {
sprintf(fname,"/tmp/rxsig0_r%d.m",round); sprintf(fname,"/tmp/rxsig0_r%d.m",round);
sprintf(vname,"rxs0_r%d",round); sprintf(vname,"rxs0_r%d",round);
......
...@@ -857,6 +857,54 @@ typedef struct PHY_VARS_eNB_s { ...@@ -857,6 +857,54 @@ typedef struct PHY_VARS_eNB_s {
uint8_t *FS6bufferZone; uint8_t *FS6bufferZone;
} PHY_VARS_eNB; } PHY_VARS_eNB;
struct turboReqId {
uint16_t rnti;
uint16_t frame;
uint8_t subframe;
uint8_t codeblock;
uint16_t spare;
} __attribute__((packed));
union turboReqUnion {
struct turboReqId s;
uint64_t p;
};
typedef struct TurboDecode_s {
decoder_if_t *function;
int16_t soft_bits[3*8*6144+12+96] __attribute__((aligned(32)));
uint8_t decoded_bytes[3+768] __attribute__((aligned(32)));
int UEid;
int harq_pid;
int frame;
int subframe;
int iind;
int Fbits;
int Kr;
LTE_UL_eNB_HARQ_t *ulsch_harq;
PHY_VARS_eNB *eNB;
int nbSegments;
int segment_r;
int offset;
int maxIterations;
int decodeIterations;
} turboDecode_t;
#define TURBO_SIMD_SOFTBITS 96+12+3+3*6144
typedef struct turboEncode_s {
uint8_t * input;
int Kr_bytes;
int filler;
unsigned int G;
int r;
int harq_pid;
int round;
int r_offset;
LTE_eNB_DLSCH_t *dlsch;
time_stats_t *rm_stats;
time_stats_t *te_stats;
time_stats_t *i_stats;
} turboEncode_t;
#endif /* __PHY_DEFS_ENB__H__ */ #endif /* __PHY_DEFS_ENB__H__ */
......
...@@ -220,13 +220,13 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro ...@@ -220,13 +220,13 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols; dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols;
if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU if (dlsch0_harq->DLround==0) { //get pointer to SDU if this a new SDU
if(sdu == NULL) { if(sdu == NULL) {
LOG_E(PHY, LOG_E(PHY,
"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d subframe %d]: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d dlsch0_harq[round:%d SFN/SF:%d%d pdu:%p mcs:%d ndi:%d pdschstart:%d]\n", "NFAPI: SFN/SF:%04d%d proc:TX:[frame %d subframe %d]: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d dlsch0_harq[round:%d SFN/SF:%d%d pdu:%p mcs:%d ndi:%d pdschstart:%d]\n",
frame,subframe, frame,subframe,
proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid, proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid,
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index,dlsch0_harq->round,dlsch0_harq->frame,dlsch0_harq->subframe,dlsch0_harq->pdu,dlsch0_harq->mcs,dlsch0_harq->ndi,dlsch0_harq->pdsch_start); dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index,dlsch0_harq->DLround,dlsch0_harq->frame,dlsch0_harq->subframe,dlsch0_harq->pdu,dlsch0_harq->mcs,dlsch0_harq->ndi,dlsch0_harq->pdsch_start);
return; return;
} }
...@@ -241,7 +241,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro ...@@ -241,7 +241,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
else dlsch1_harq->pdu = sdu; else dlsch1_harq->pdu = sdu;
} else { } else {
if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d, subframe %d]: programming dlsch for round %d, rnti %x, UE_id %d, harq_pid %d\n", if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d, subframe %d]: programming dlsch for round %d, rnti %x, UE_id %d, harq_pid %d\n",
frame,subframe,proc->frame_tx,proc->subframe_tx,dlsch0_harq->round, frame,subframe,proc->frame_tx,proc->subframe_tx,dlsch0_harq->DLround,
rel8->rnti,UE_id,harq_pid); rel8->rnti,UE_id,harq_pid);
} }
...@@ -321,7 +321,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro ...@@ -321,7 +321,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
dlsch0_harq->Nl = 1; dlsch0_harq->Nl = 1;
dlsch0_harq->mimo_mode = (eNB->frame_parms.nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI; dlsch0_harq->mimo_mode = (eNB->frame_parms.nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI;
dlsch0_harq->dl_power_off = 1; dlsch0_harq->dl_power_off = 1;
dlsch0_harq->round = 0; dlsch0_harq->DLround = 0;
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
dlsch0_harq->TBS = rel8->length<<3; dlsch0_harq->TBS = rel8->length<<3;
dlsch0_harq->Qm = rel8->modulation; dlsch0_harq->Qm = rel8->modulation;
...@@ -346,13 +346,13 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro ...@@ -346,13 +346,13 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
#else #else
dlsch0->i0, dlsch0->i0,
#endif #endif
dlsch0_harq->pdsch_start, dlsch0_harq->nb_rb, dlsch0_harq->vrb_type, dlsch0_harq->rvidx, dlsch0_harq->Nl, dlsch0_harq->mimo_mode, dlsch0_harq->dl_power_off, dlsch0_harq->round, dlsch0_harq->status, dlsch0_harq->pdsch_start, dlsch0_harq->nb_rb, dlsch0_harq->vrb_type, dlsch0_harq->rvidx, dlsch0_harq->Nl, dlsch0_harq->mimo_mode, dlsch0_harq->dl_power_off, dlsch0_harq->DLround, dlsch0_harq->status,
dlsch0_harq->TBS, dlsch0_harq->Qm, dlsch0_harq->codeword, dlsch0_harq->rb_alloc[0], dlsch0_harq->TBS, dlsch0_harq->Qm, dlsch0_harq->codeword, dlsch0_harq->rb_alloc[0],
rel8->length rel8->length
); );
#else #else
LOG_D(PHY,"dlsch0_harq[pdsch_start:%d nb_rb:%d vrb_type:%d rvidx:%d Nl:%d mimo_mode:%d dl_power_off:%d round:%d status:%d TBS:%d Qm:%d codeword:%d rb_alloc:%d] rel8[length:%d]\n", LOG_D(PHY,"dlsch0_harq[pdsch_start:%d nb_rb:%d vrb_type:%d rvidx:%d Nl:%d mimo_mode:%d dl_power_off:%d round:%d status:%d TBS:%d Qm:%d codeword:%d rb_alloc:%d] rel8[length:%d]\n",
dlsch0_harq->pdsch_start, dlsch0_harq->nb_rb, dlsch0_harq->vrb_type, dlsch0_harq->rvidx, dlsch0_harq->Nl, dlsch0_harq->mimo_mode, dlsch0_harq->dl_power_off, dlsch0_harq->round, dlsch0_harq->status, dlsch0_harq->pdsch_start, dlsch0_harq->nb_rb, dlsch0_harq->vrb_type, dlsch0_harq->rvidx, dlsch0_harq->Nl, dlsch0_harq->mimo_mode, dlsch0_harq->dl_power_off, dlsch0_harq->DLround, dlsch0_harq->status,
dlsch0_harq->TBS, dlsch0_harq->Qm, dlsch0_harq->codeword, dlsch0_harq->rb_alloc[0], dlsch0_harq->TBS, dlsch0_harq->Qm, dlsch0_harq->codeword, dlsch0_harq->rb_alloc[0],
rel8->length rel8->length
); );
...@@ -385,7 +385,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro ...@@ -385,7 +385,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
#endif #endif
dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols; dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols;
if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU if (dlsch0_harq->DLround==0) { //get pointer to SDU if this a new SDU
AssertFatal(sdu!=NULL,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d\n", AssertFatal(sdu!=NULL,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d\n",
proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid, proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid,
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index); dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index);
...@@ -397,7 +397,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro ...@@ -397,7 +397,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
else dlsch1_harq->pdu = sdu; else dlsch1_harq->pdu = sdu;
} else { } else {
if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round %d, rnti %x, UE_id %d, harq_pid %d\n", if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round %d, rnti %x, UE_id %d, harq_pid %d\n",
proc->frame_tx,proc->subframe_tx,dlsch0_harq->round, proc->frame_tx,proc->subframe_tx,dlsch0_harq->DLround,
rel8->rnti,UE_id,harq_pid); rel8->rnti,UE_id,harq_pid);
} }
} }
......
This diff is collapsed.
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "nfapi_interface.h" #include "nfapi_interface.h"
#include "platform_constants.h" #include "platform_constants.h"
#include "platform_types.h" #include "platform_types.h"
#include <common/utils/threadPool/thread-pool.h>
#define MAX_NUM_DL_PDU 100 #define MAX_NUM_DL_PDU 100
#define MAX_NUM_UL_PDU 100 #define MAX_NUM_UL_PDU 100
...@@ -179,6 +180,11 @@ typedef struct { ...@@ -179,6 +180,11 @@ typedef struct {
pthread_cond_t cond_RUs; pthread_cond_t cond_RUs;
/// mutex for RXn-TXnp4 processing thread /// mutex for RXn-TXnp4 processing thread
pthread_mutex_t mutex_RUs; pthread_mutex_t mutex_RUs;
tpool_t threadPool;
int nbEncode;
int nbDecode;
notifiedFIFO_t respEncode;
notifiedFIFO_t respDecode;
} L1_rxtx_proc_t; } L1_rxtx_proc_t;
typedef struct IF_Module_s{ typedef struct IF_Module_s{
......
...@@ -175,6 +175,7 @@ ...@@ -175,6 +175,7 @@
/* optname helpstr paramflags XXXptr defXXXval type numelt */ /* optname helpstr paramflags XXXptr defXXXval type numelt */
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define RF_CONFIG_FILE softmodem_params.rf_config_file #define RF_CONFIG_FILE softmodem_params.rf_config_file
#define TP_CONFIG softmodem_params.threadPoolConfig
#define PHY_TEST softmodem_params.phy_test #define PHY_TEST softmodem_params.phy_test
#define WAIT_FOR_SYNC softmodem_params.wait_for_sync #define WAIT_FOR_SYNC softmodem_params.wait_for_sync
#define SINGLE_THREAD_FLAG softmodem_params.single_thread_flag #define SINGLE_THREAD_FLAG softmodem_params.single_thread_flag
...@@ -187,6 +188,7 @@ ...@@ -187,6 +188,7 @@
#define USIM_TEST softmodem_params.usim_test #define USIM_TEST softmodem_params.usim_test
#define CMDLINE_PARAMS_DESC { \ #define CMDLINE_PARAMS_DESC { \
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&RF_CONFIG_FILE, defstrval:NULL, TYPE_STRING, sizeof(RF_CONFIG_FILE)}, \ {"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&RF_CONFIG_FILE, defstrval:NULL, TYPE_STRING, sizeof(RF_CONFIG_FILE)}, \
{"turbo-thread-pool", NULL, 0, strptr:(char **)&TP_CONFIG, defstrval:NULL, TYPE_STRING, sizeof(TP_CONFIG)}, \
{"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \ {"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&PHY_TEST, defintval:0, TYPE_INT, 0}, \ {"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&PHY_TEST, defintval:0, TYPE_INT, 0}, \
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&USIM_TEST, defintval:0, TYPE_UINT8, 0}, \ {"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&USIM_TEST, defintval:0, TYPE_UINT8, 0}, \
...@@ -253,6 +255,7 @@ typedef struct { ...@@ -253,6 +255,7 @@ typedef struct {
uint64_t optmask; uint64_t optmask;
THREAD_STRUCT thread_struct; THREAD_STRUCT thread_struct;
char rf_config_file[1024]; char rf_config_file[1024];
char threadPoolConfig[1024];
int phy_test; int phy_test;
uint8_t usim_test; uint8_t usim_test;
int emulate_rf; int emulate_rf;
......
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