Commit e40f2532 authored by Veronica.Quintuna's avatar Veronica.Quintuna

change algo to have the same measurements accross all cases

parent 300def54
...@@ -636,14 +636,9 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, ...@@ -636,14 +636,9 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
req->coreId=0; req->coreId=0;
req->processedBy[0]=0; req->processedBy[0]=0;
req->decodeIterations=0; req->decodeIterations=0;
// Ignore write error (if no trace listner) req->next=eNB->proc.threadPool.doneRequests;
if (write(eNB->proc.threadPool.traceFd, req, sizeof(request_t)- 2*sizeof(void*))) {}; start_meas(i_stats); eNB->proc.threadPool.doneRequests=req;
rdata->dlsch->harq_processes[rdata->harq_pid]->RTC[rdata->r] =
sub_block_interleaving_turbo(4+(rdata->Kr_bytes*8),
rdata->output+96, //&dlsch->harq_processes[harq_pid]->d[r][96],
rdata->dlsch->harq_processes[rdata->harq_pid]->w[rdata->r]);
stop_meas(i_stats); stop_meas(i_stats);
free(req);
} }
} }
return 0; return 0;
......
...@@ -704,25 +704,16 @@ request_t * ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr ...@@ -704,25 +704,16 @@ request_t * ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
req->decodeIterations=rdata->decodeIterations; req->decodeIterations=rdata->decodeIterations;
req->coreId=0; req->coreId=0;
req->processedBy[0]=0; req->processedBy[0]=0;
// Ignore write error (if no trace listner) req->next=eNB->proc.threadPool.doneRequests;
if (write(eNB->proc.threadPool.traceFd, req, sizeof(request_t)- 2*sizeof(void*))) {}; // Reassembly of Transport block here eNB->proc.threadPool.doneRequests=req;
if (rdata->decodeIterations <= eNB->ulsch[UE_id]->max_turbo_iterations ) {
// last block in a TDU is processed in caller if (rdata->decodeIterations > eNB->ulsch[UE_id]->max_turbo_iterations )
if ( rdata->segment_r < (rdata->nbSegments - 1) ) {
ulsch_harq->processedSegments++;
memcpy(ulsch_harq->b+rdata->offset,
rdata->decoded_bytes+Fbytes,
blockSize);
freeRequest(req);
}
}
else
// Entire TPU need retransmission // Entire TPU need retransmission
break; break;
} }
offset += blockSize; offset += blockSize;
} }
return(req); return NULL;
} }
static inline unsigned int lte_gold_unscram(unsigned int *x1, unsigned int *x2, unsigned char reset) __attribute__((always_inline)); static inline unsigned int lte_gold_unscram(unsigned int *x1, unsigned int *x2, unsigned char reset) __attribute__((always_inline));
......
...@@ -584,7 +584,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -584,7 +584,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
if ( eNB->proc.threadPool.activated ) { if ( eNB->proc.threadPool.activated ) {
// Wait all other threads finish to process // Wait all other threads finish to process
int nbRequest=0;
//printf("%s:%d:%d\n", __FILE__,__LINE__,eNB->proc.threadPool.notFinishedJobs); //printf("%s:%d:%d\n", __FILE__,__LINE__,eNB->proc.threadPool.notFinishedJobs);
int rr=0; int rr=0;
mutexlock(eNB->proc.threadPool.lockReportDone); mutexlock(eNB->proc.threadPool.lockReportDone);
...@@ -611,25 +610,21 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -611,25 +610,21 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
} }
} }
mutexunlock(eNB->proc.threadPool.lockReportDone); mutexunlock(eNB->proc.threadPool.lockReportDone);
}
request_t* tmp;
request_t* tmp; while ((tmp=eNB->proc.threadPool.doneRequests)!=NULL) {
while ((tmp=eNB->proc.threadPool.doneRequests)!=NULL) { tmp->returnTime=rdtsc();
tmp->returnTime=rdtsc(); // Ignore write error (if no trace listner)
// Ignore write error (if no trace listner) if (write(eNB->proc.threadPool.traceFd, tmp, sizeof(request_t)- 2*sizeof(void*))) {};
if (write(eNB->proc.threadPool.traceFd, tmp, sizeof(request_t)- 2*sizeof(void*))) {}; eNB->proc.threadPool.doneRequests=tmp->next;
eNB->proc.threadPool.doneRequests=tmp->next; start_meas(&eNB->dlsch_interleaving_stats);
start_meas(&eNB->dlsch_interleaving_stats); turboEncode_t * rdata=(turboEncode_t *) tmp->data;
turboEncode_t * rdata=(turboEncode_t *) tmp->data; rdata->dlsch->harq_processes[rdata->harq_pid]->RTC[rdata->r] =
rdata->dlsch->harq_processes[rdata->harq_pid]->RTC[rdata->r] = sub_block_interleaving_turbo(4+(rdata->Kr_bytes*8),
sub_block_interleaving_turbo(4+(rdata->Kr_bytes*8), rdata->output+96, //&dlsch->harq_processes[harq_pid]->d[r][96],
rdata->output+96, //&dlsch->harq_processes[harq_pid]->d[r][96], rdata->dlsch->harq_processes[rdata->harq_pid]->w[rdata->r]);
rdata->dlsch->harq_processes[rdata->harq_pid]->w[rdata->r]); freeRequest(tmp);
freeRequest(tmp); stop_meas(&eNB->dlsch_interleaving_stats);
stop_meas(&eNB->dlsch_interleaving_stats);
nbRequest++;
}
//if ( nbRequest ) printf("Done %d code blocks in %ld µsec\n", nbRequest, (rdtsc()-now)/eNB->proc.threadPool.cpuCyclesMicroSec);
} }
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
...@@ -1487,7 +1482,6 @@ void post_decode(request_t* decodeResult) { ...@@ -1487,7 +1482,6 @@ void post_decode(request_t* decodeResult) {
if (ulsch_harq->O_ACK>0) if (ulsch_harq->O_ACK>0)
fill_ulsch_harq_indication(eNB,ulsch_harq,ulsch->rnti,rdata->frame,rdata->subframe,ulsch->bundling); fill_ulsch_harq_indication(eNB,ulsch_harq,ulsch->rnti,rdata->frame,rdata->subframe,ulsch->bundling);
} }
freeRequest(decodeResult);
} }
void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
...@@ -1509,7 +1503,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1509,7 +1503,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
eNB->proc.threadPool.newestRequests != NULL || eNB->proc.threadPool.newestRequests != NULL ||
eNB->proc.threadPool.doneRequests != NULL eNB->proc.threadPool.doneRequests != NULL
) )
LOG_E(PHY,"no finished = %d\n",eNB->proc.threadPool.notFinishedJobs); LOG_E(PHY,"no finished = %d\n",eNB->proc.threadPool.notFinishedJobs);
for (int i=0; i<NUMBER_OF_UE_MAX; i++) { for (int i=0; i<NUMBER_OF_UE_MAX; i++) {
LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[i]; LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[i];
LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid];
...@@ -1548,8 +1542,6 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1548,8 +1542,6 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
frame, frame,
subframe); subframe);
stop_meas(&eNB->ulsch_decoding_stats); stop_meas(&eNB->ulsch_decoding_stats);
if ( ret != NULL )
post_decode(ret);
} else if (ulsch && ulsch->rnti>0 && } else if (ulsch && ulsch->rnti>0 &&
(ulsch_harq->status == ACTIVE) && (ulsch_harq->status == ACTIVE) &&
(ulsch_harq->frame == frame) && (ulsch_harq->frame == frame) &&
...@@ -1590,17 +1582,18 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1590,17 +1582,18 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
} }
} }
mutexunlock(eNB->proc.threadPool.lockReportDone); mutexunlock(eNB->proc.threadPool.lockReportDone);
}
request_t* tmp; request_t* tmp;
while ((tmp=eNB->proc.threadPool.doneRequests)!=NULL) { while ((tmp=eNB->proc.threadPool.doneRequests)!=NULL) {
tmp->returnTime=rdtsc(); turboDecode_t * rdata=(turboDecode_t *) tmp->data;
turboDecode_t * rdata=(turboDecode_t *) tmp->data; tmp->decodeIterations=rdata->decodeIterations;
tmp->decodeIterations=rdata->decodeIterations; post_decode(tmp);
// Ignore write error (if no trace listner) tmp->returnTime=rdtsc();
if (write(eNB->proc.threadPool.traceFd, tmp, sizeof(request_t)- 2*sizeof(void*))) {}; // Ignore write error (if no trace listner)
eNB->proc.threadPool.doneRequests=tmp->next; if (write(eNB->proc.threadPool.traceFd, tmp, sizeof(request_t)- 2*sizeof(void*))) {};
post_decode(tmp); eNB->proc.threadPool.doneRequests=tmp->next;
} freeRequest(tmp);
} }
} }
......
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