Commit edfef131 authored by laurent's avatar laurent

add counters for non turbo-codec part

parent fe5058ed
...@@ -148,7 +148,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_ ...@@ -148,7 +148,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
for (aa=0; aa<64; aa++) { for (aa=0; aa<64; aa++) {
dlsch->ue_spec_bf_weights[layer][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t)); dlsch->ue_spec_bf_weights[layer][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
for (re=0;re<OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; re++) { for (re=0; re<OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; re++) {
dlsch->ue_spec_bf_weights[layer][aa][re] = 0x00007fff; dlsch->ue_spec_bf_weights[layer][aa][re] = 0x00007fff;
} }
} }
...@@ -565,7 +565,6 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, ...@@ -565,7 +565,6 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
a[1+(A>>3)] = ((uint8_t*)&crc)[1]; a[1+(A>>3)] = ((uint8_t*)&crc)[1];
a[2+(A>>3)] = ((uint8_t*)&crc)[0]; a[2+(A>>3)] = ((uint8_t*)&crc)[0];
// printf("CRC %x (A %d)\n",crc,A); // printf("CRC %x (A %d)\n",crc,A);
dlsch->harq_processes[harq_pid]->B = A+24; dlsch->harq_processes[harq_pid]->B = A+24;
// dlsch->harq_processes[harq_pid]->b = a; // dlsch->harq_processes[harq_pid]->b = a;
memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+4); memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+4);
...@@ -606,9 +605,10 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, ...@@ -606,9 +605,10 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
return(-1); return(-1);
} }
request_t *req=createRequest(ENCODE,sizeof(turboEncode_t)); request_t *req=createRequest(ENCODE,sizeof(turboEncode_t));
union turboReqUnion id={.s={dlsch->rnti,frame,subframe,r,0}}; union turboReqUnion id= {.s={dlsch->rnti,frame,subframe,r,0}};
req->id= id.p; req->id= id.p;
req->decodeIterations=0; req->decodeIterations=0;
req->startUELoop=eNB->proc.threadPool.startProcessingUE;
turboEncode_t * rdata=(turboEncode_t *) req->data; turboEncode_t * rdata=(turboEncode_t *) req->data;
rdata->input=dlsch->harq_processes[harq_pid]->c[r]; rdata->input=dlsch->harq_processes[harq_pid]->c[r];
rdata->Kr_bytes=Kr>>3; rdata->Kr_bytes=Kr>>3;
...@@ -622,7 +622,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, ...@@ -622,7 +622,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
} else { } else {
memset(rdata->output,LTE_NULL, TURBO_SIMD_SOFTBITS); memset(rdata->output,LTE_NULL, TURBO_SIMD_SOFTBITS);
start_meas(te_stats); start_meas(te_stats);
req->creationTime=req->startProcessingTime=rdtsc(); req->startProcessingTime=rdtsc();
threegpplte_turbo_encoder(rdata->input, threegpplte_turbo_encoder(rdata->input,
rdata->Kr_bytes, rdata->Kr_bytes,
rdata->output+96,//&dlsch->harq_processes[harq_pid]->d[r][96], rdata->output+96,//&dlsch->harq_processes[harq_pid]->d[r][96],
...@@ -640,6 +640,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, ...@@ -640,6 +640,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
eNB->proc.threadPool.doneRequests=req; eNB->proc.threadPool.doneRequests=req;
stop_meas(i_stats); stop_meas(i_stats);
} }
eNB->proc.threadPool.startProcessingUE=rdtsc();
} }
return 0; return 0;
} }
......
...@@ -642,6 +642,7 @@ request_t * ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr ...@@ -642,6 +642,7 @@ request_t * ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
r_offset += E; r_offset += E;
start_meas(&eNB->ulsch_deinterleaving_stats); start_meas(&eNB->ulsch_deinterleaving_stats);
req=createRequest(DECODE,sizeof(turboDecode_t)); 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}}; union turboReqUnion id= {.s={eNB->ulsch[UE_id]->rnti,frame,subframe,r,0}};
req->id= id.p; req->id= id.p;
turboDecode_t * rdata=(turboDecode_t *) req->data; turboDecode_t * rdata=(turboDecode_t *) req->data;
...@@ -682,7 +683,7 @@ request_t * ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr ...@@ -682,7 +683,7 @@ request_t * ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
add_request(req, &eNB->proc.threadPool); add_request(req, &eNB->proc.threadPool);
req=NULL; req=NULL;
} else { } else {
req->creationTime=req->startProcessingTime=rdtsc(); req->startProcessingTime=rdtsc();
rdata->decodeIterations = td( rdata->soft_bits+96, rdata->decodeIterations = td( rdata->soft_bits+96,
rdata->decoded_bytes, rdata->decoded_bytes,
rdata->Kr, rdata->Kr,
...@@ -712,6 +713,7 @@ request_t * ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr ...@@ -712,6 +713,7 @@ request_t * ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
break; break;
} }
offset += blockSize; offset += blockSize;
eNB->proc.threadPool.startProcessingUE=rdtsc();
} }
return NULL; return NULL;
} }
...@@ -1342,18 +1344,18 @@ request_t* ulsch_decoding(PHY_VARS_eNB *eNB, ...@@ -1342,18 +1344,18 @@ request_t* ulsch_decoding(PHY_VARS_eNB *eNB,
j2+=Q_m; j2+=Q_m;
} }
/* To be improved according to alignment of j2 /* To be improved according to alignment of j2
#if defined(__x86_64__)||defined(__i386__) #if defined(__x86_64__)||defined(__i386__)
#ifndef __AVX2__ #ifndef __AVX2__
for (iprime=0; iprime<G;iprime+=8,j2+=8) for (iprime=0; iprime<G;iprime+=8,j2+=8)
*((__m128i *)&ulsch_harq->e[iprime]) = *((__m128i *)&y[j2]); *((__m128i *)&ulsch_harq->e[iprime]) = *((__m128i *)&y[j2]);
#else #else
for (iprime=0; iprime<G;iprime+=16,j2+=16) for (iprime=0; iprime<G;iprime+=16,j2+=16)
*((__m256i *)&ulsch_harq->e[iprime]) = *((__m256i *)&y[j2]); *((__m256i *)&ulsch_harq->e[iprime]) = *((__m256i *)&y[j2]);
#endif #endif
#elif defined(__arm__) #elif defined(__arm__)
for (iprime=0; iprime<G;iprime+=8,j2+=8) for (iprime=0; iprime<G;iprime+=8,j2+=8)
*((int16x8_t *)&ulsch_harq->e[iprime]) = *((int16x8_t *)&y[j2]); *((int16x8_t *)&ulsch_harq->e[iprime]) = *((int16x8_t *)&y[j2]);
#endif #endif
*/ */
int16_t *yp,*ep; int16_t *yp,*ep;
for (iprime=0,yp=&y[j2],ep=&ulsch_harq->e[0]; for (iprime=0,yp=&y[j2],ep=&ulsch_harq->e[0];
......
...@@ -555,6 +555,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -555,6 +555,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
uint64_t startTime=rdtsc(); uint64_t startTime=rdtsc();
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++)
{ {
eNB->proc.threadPool.startProcessingUE=rdtsc();
dlsch0 = eNB->dlsch[(uint8_t)UE_id][0]; dlsch0 = eNB->dlsch[(uint8_t)UE_id][0];
dlsch1 = eNB->dlsch[(uint8_t)UE_id][1]; dlsch1 = eNB->dlsch[(uint8_t)UE_id][1];
...@@ -567,11 +568,9 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -567,11 +568,9 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
AssertFatal(harq_pid>=0,"harq_pid is negative\n"); AssertFatal(harq_pid>=0,"harq_pid is negative\n");
if (harq_pid>=8) if (harq_pid>=8)
{ LOG_E(PHY,"harq_pid:%d corrupt must be 0-7 UE_id:%d frame:%d subframe:%d rnti:%x\n",
LOG_E(PHY,"harq_pid:%d corrupt must be 0-7 UE_id:%d frame:%d subframe:%d rnti:%x\n", harq_pid,UE_id,frame,subframe,dlsch0->rnti); harq_pid,UE_id,frame,subframe,dlsch0->rnti);
}
else else
{
// generate pdsch // generate pdsch
pdsch_procedures(eNB, pdsch_procedures(eNB,
proc, proc,
...@@ -582,7 +581,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -582,7 +581,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
0); 0);
} }
} }
}
if ( eNB->proc.threadPool.activated ) { if ( eNB->proc.threadPool.activated ) {
// Wait all other threads finish to process // Wait all other threads finish to process
...@@ -1509,6 +1507,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1509,6 +1507,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
LOG_E(PHY,"no finished = %d\n",eNB->proc.threadPool.notFinishedJobs); LOG_E(PHY,"no finished = %d\n",eNB->proc.threadPool.notFinishedJobs);
uint64_t startTime=rdtsc(); uint64_t startTime=rdtsc();
for (int i=0; i<NUMBER_OF_UE_MAX; i++) { for (int i=0; i<NUMBER_OF_UE_MAX; i++) {
eNB->proc.threadPool.startProcessingUE=rdtsc();
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];
......
...@@ -30,9 +30,9 @@ int main(int argc, char* argv[]) { ...@@ -30,9 +30,9 @@ int main(int argc, char* argv[]) {
usleep(100000); usleep(100000);
cpuCyclesMicroSec=(rdtsc()-deb)/100000; cpuCyclesMicroSec=(rdtsc()-deb)/100000;
printf("Cycles per µs: %lu\n",cpuCyclesMicroSec); printf("Cycles per µs: %lu\n",cpuCyclesMicroSec);
#define SEP "\t" #define SEP "\t"
printf("Frame" SEP "SubFrame" SEP "CodeBlock" SEP "RNTI" SEP "Iterations" SEP printf("Frame" SEP "SubFrame" SEP "CodeBlock" SEP "RNTI" SEP "Iterations" SEP
"StartTime" SEP "RunTime" SEP "ReturnTime" SEP "CumulSubFrame" "PreparationTime" SEP "StartTime" SEP "RunTime" SEP "ReturnTime" SEP "CumulSubFrame"
SEP "CPUcore" SEP "ThreadID" "\n"); SEP "CPUcore" SEP "ThreadID" "\n");
mkfifo("/tmp/test-tcri",0666); mkfifo("/tmp/test-tcri",0666);
...@@ -45,16 +45,17 @@ int main(int argc, char* argv[]) { ...@@ -45,16 +45,17 @@ int main(int argc, char* argv[]) {
int s=sizeof(request_t) -2*sizeof(void*); int s=sizeof(request_t) -2*sizeof(void*);
while ( 1 ) { while ( 1 ) {
if ( read(fd,&doneRequest, s) == s ) { if ( read(fd,&doneRequest, s) == s ) {
union turboReqUnion id={.p=doneRequest.id}; union turboReqUnion id= {.p=doneRequest.id};
doneRequest.processedBy[15]='\0'; doneRequest.processedBy[15]='\0';
printf("%u" SEP "%u" SEP "%u" SEP "%u" SEP "%lu" SEP printf("%u" SEP "%u" SEP "%u" SEP "%u" SEP "%lu" SEP
"%lu" SEP "%lu" SEP "%lu" SEP "%lu" SEP "%lu" SEP "%lu" SEP "%lu" SEP
"%lu" SEP "%u" SEP "%s" "\n", "%lu" SEP "%u" SEP "%s" "\n",
id.s.frame, id.s.frame,
id.s.subframe, id.s.subframe,
id.s.codeblock, id.s.codeblock,
id.s.rnti, id.s.rnti,
doneRequest.decodeIterations, doneRequest.decodeIterations,
(doneRequest.creationTime-doneRequest.startUELoop)/cpuCyclesMicroSec,
(doneRequest.startProcessingTime-doneRequest.creationTime)/cpuCyclesMicroSec, (doneRequest.startProcessingTime-doneRequest.creationTime)/cpuCyclesMicroSec,
(doneRequest.endProcessingTime-doneRequest.startProcessingTime)/cpuCyclesMicroSec, (doneRequest.endProcessingTime-doneRequest.startProcessingTime)/cpuCyclesMicroSec,
(doneRequest.returnTime-doneRequest.endProcessingTime)/cpuCyclesMicroSec, (doneRequest.returnTime-doneRequest.endProcessingTime)/cpuCyclesMicroSec,
...@@ -65,6 +66,6 @@ int main(int argc, char* argv[]) { ...@@ -65,6 +66,6 @@ int main(int argc, char* argv[]) {
} else { } else {
printf("no measurements\n"); printf("no measurements\n");
sleep(1); sleep(1);
} }
} }
} }
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
request_t * createRequest(enum request_t type,int size) { request_t * createRequest(enum request_t type,int size) {
request_t* request; request_t* request;
AssertFatal( (request = (request_t*)aligned_alloc(32,sizeof(request_t)+size)) != NULL,""); AssertFatal( (request = (request_t*)aligned_alloc(32,sizeof(request_t)+size)) != NULL,"");
memset(request,0,sizeof(request_t));
request->id = 0; request->id = 0;
request->type=type; request->type=type;
request->next = NULL; request->next = NULL;
...@@ -200,12 +201,7 @@ void handle_request(tpool_t * tp, request_t* request) { ...@@ -200,12 +201,7 @@ void handle_request(tpool_t * tp, request_t* request) {
tp->doneRequests=request; tp->doneRequests=request;
condsignal(tp->notifDone); condsignal(tp->notifDone);
mutexunlock(tp->lockReportDone); mutexunlock(tp->lockReportDone);
/*
printf("Thread '%ld' handled request '%d' delay in µs:%ld\n",
syscall( SYS_gettid ),
request->id,
(rdtsc() - request->creationTime)/tp->cpuCyclesMicroSec);
*/
} }
void* one_thread(void* data) { void* one_thread(void* data) {
......
...@@ -25,6 +25,7 @@ union turboReqUnion { ...@@ -25,6 +25,7 @@ union turboReqUnion {
typedef struct request { typedef struct request {
uint64_t id; uint64_t id;
enum request_t type; enum request_t type;
uint64_t startUELoop;
uint64_t creationTime; uint64_t creationTime;
uint64_t startProcessingTime; uint64_t startProcessingTime;
uint64_t endProcessingTime; uint64_t endProcessingTime;
...@@ -60,6 +61,7 @@ typedef struct thread_pool { ...@@ -60,6 +61,7 @@ typedef struct thread_pool {
int traceFd; int traceFd;
int dummyTraceFd; int dummyTraceFd;
uint64_t cpuCyclesMicroSec; uint64_t cpuCyclesMicroSec;
uint64_t startProcessingUE;
int nbThreads; int nbThreads;
bool restrictRNTI; bool restrictRNTI;
struct one_thread * allthreads; struct one_thread * allthreads;
......
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