Commit edfef131 authored by laurent's avatar laurent

add counters for non turbo-codec part

parent fe5058ed
This diff is collapsed.
This diff is collapsed.
......@@ -555,6 +555,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
uint64_t startTime=rdtsc();
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];
dlsch1 = eNB->dlsch[(uint8_t)UE_id][1];
......@@ -567,11 +568,9 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
AssertFatal(harq_pid>=0,"harq_pid is negative\n");
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", harq_pid,UE_id,frame,subframe,dlsch0->rnti);
}
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);
else
{
// generate pdsch
pdsch_procedures(eNB,
proc,
......@@ -580,7 +579,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
dlsch1,
&eNB->UE_stats[(uint32_t)UE_id],
0);
}
}
}
......@@ -615,19 +613,19 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
}
request_t* tmp;
while ((tmp=eNB->proc.threadPool.doneRequests)!=NULL) {
tmp->returnTime=rdtsc();
tmp->cumulSubframe=tmp->returnTime-startTime;
// Ignore write error (if no trace listner)
if (write(eNB->proc.threadPool.traceFd, tmp, sizeof(request_t)- 2*sizeof(void*))) {};
eNB->proc.threadPool.doneRequests=tmp->next;
start_meas(&eNB->dlsch_interleaving_stats);
turboEncode_t * rdata=(turboEncode_t *) tmp->data;
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]);
freeRequest(tmp);
stop_meas(&eNB->dlsch_interleaving_stats);
tmp->returnTime=rdtsc();
tmp->cumulSubframe=tmp->returnTime-startTime;
// Ignore write error (if no trace listner)
if (write(eNB->proc.threadPool.traceFd, tmp, sizeof(request_t)- 2*sizeof(void*))) {};
eNB->proc.threadPool.doneRequests=tmp->next;
start_meas(&eNB->dlsch_interleaving_stats);
turboEncode_t * rdata=(turboEncode_t *) tmp->data;
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]);
freeRequest(tmp);
stop_meas(&eNB->dlsch_interleaving_stats);
}
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
......@@ -1506,9 +1504,10 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
eNB->proc.threadPool.newestRequests != 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);
uint64_t startTime=rdtsc();
for (int i=0; i<NUMBER_OF_UE_MAX; i++) {
eNB->proc.threadPool.startProcessingUE=rdtsc();
LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[i];
LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid];
......@@ -1590,15 +1589,15 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
request_t* tmp;
while ((tmp=eNB->proc.threadPool.doneRequests)!=NULL) {
turboDecode_t * rdata=(turboDecode_t *) tmp->data;
tmp->decodeIterations=rdata->decodeIterations;
post_decode(tmp);
tmp->returnTime=rdtsc();
tmp->cumulSubframe=tmp->returnTime-startTime;
// Ignore write error (if no trace listner)
if (write(eNB->proc.threadPool.traceFd, tmp, sizeof(request_t)- 2*sizeof(void*))) {};
eNB->proc.threadPool.doneRequests=tmp->next;
freeRequest(tmp);
turboDecode_t * rdata=(turboDecode_t *) tmp->data;
tmp->decodeIterations=rdata->decodeIterations;
post_decode(tmp);
tmp->returnTime=rdtsc();
tmp->cumulSubframe=tmp->returnTime-startTime;
// Ignore write error (if no trace listner)
if (write(eNB->proc.threadPool.traceFd, tmp, sizeof(request_t)- 2*sizeof(void*))) {};
eNB->proc.threadPool.doneRequests=tmp->next;
freeRequest(tmp);
}
}
......
......@@ -18,9 +18,9 @@
uint64_t cpuCyclesMicroSec;
static __inline__ uint64_t rdtsc(void) {
uint64_t a, d;
__asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
return (d<<32) | a;
uint64_t a, d;
__asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
return (d<<32) | a;
}
#include "thread-pool.h"
......@@ -30,10 +30,10 @@ int main(int argc, char* argv[]) {
usleep(100000);
cpuCyclesMicroSec=(rdtsc()-deb)/100000;
printf("Cycles per µs: %lu\n",cpuCyclesMicroSec);
#define SEP "\t"
#define SEP "\t"
printf("Frame" SEP "SubFrame" SEP "CodeBlock" SEP "RNTI" SEP "Iterations" SEP
"StartTime" SEP "RunTime" SEP "ReturnTime" SEP "CumulSubFrame"
SEP "CPUcore" SEP "ThreadID" "\n");
"PreparationTime" SEP "StartTime" SEP "RunTime" SEP "ReturnTime" SEP "CumulSubFrame"
SEP "CPUcore" SEP "ThreadID" "\n");
mkfifo("/tmp/test-tcri",0666);
int fd=open("/tmp/test-tcri", O_RDONLY);
......@@ -44,27 +44,28 @@ int main(int argc, char* argv[]) {
request_t doneRequest;
int s=sizeof(request_t) -2*sizeof(void*);
while ( 1 ) {
if ( read(fd,&doneRequest, s) == s ) {
union turboReqUnion id={.p=doneRequest.id};
doneRequest.processedBy[15]='\0';
printf("%u" SEP "%u" SEP "%u" SEP "%u" SEP "%lu" SEP
"%lu" SEP "%lu" SEP "%lu" SEP
"%lu" SEP "%u" SEP "%s" "\n",
id.s.frame,
id.s.subframe,
id.s.codeblock,
id.s.rnti,
doneRequest.decodeIterations,
(doneRequest.startProcessingTime-doneRequest.creationTime)/cpuCyclesMicroSec,
(doneRequest.endProcessingTime-doneRequest.startProcessingTime)/cpuCyclesMicroSec,
(doneRequest.returnTime-doneRequest.endProcessingTime)/cpuCyclesMicroSec,
doneRequest.cumulSubframe/cpuCyclesMicroSec,
doneRequest.coreId,
doneRequest.processedBy
);
} else {
printf("no measurements\n");
sleep(1);
}
if ( read(fd,&doneRequest, s) == s ) {
union turboReqUnion id= {.p=doneRequest.id};
doneRequest.processedBy[15]='\0';
printf("%u" SEP "%u" SEP "%u" SEP "%u" SEP "%lu" SEP
"%lu" SEP "%lu" SEP "%lu" SEP "%lu" SEP
"%lu" SEP "%u" SEP "%s" "\n",
id.s.frame,
id.s.subframe,
id.s.codeblock,
id.s.rnti,
doneRequest.decodeIterations,
(doneRequest.creationTime-doneRequest.startUELoop)/cpuCyclesMicroSec,
(doneRequest.startProcessingTime-doneRequest.creationTime)/cpuCyclesMicroSec,
(doneRequest.endProcessingTime-doneRequest.startProcessingTime)/cpuCyclesMicroSec,
(doneRequest.returnTime-doneRequest.endProcessingTime)/cpuCyclesMicroSec,
doneRequest.cumulSubframe/cpuCyclesMicroSec,
doneRequest.coreId,
doneRequest.processedBy
);
} else {
printf("no measurements\n");
sleep(1);
}
}
}
......@@ -29,6 +29,7 @@
request_t * createRequest(enum request_t type,int size) {
request_t* request;
AssertFatal( (request = (request_t*)aligned_alloc(32,sizeof(request_t)+size)) != NULL,"");
memset(request,0,sizeof(request_t));
request->id = 0;
request->type=type;
request->next = NULL;
......@@ -200,12 +201,7 @@ void handle_request(tpool_t * tp, request_t* request) {
tp->doneRequests=request;
condsignal(tp->notifDone);
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) {
......
......@@ -25,11 +25,12 @@ union turboReqUnion {
typedef struct request {
uint64_t id;
enum request_t type;
uint64_t startUELoop;
uint64_t creationTime;
uint64_t startProcessingTime;
uint64_t endProcessingTime;
uint64_t returnTime;
uint64_t cumulSubframe;
uint64_t returnTime;
uint64_t cumulSubframe;
uint64_t decodeIterations;
int coreId;
char processedBy[16];
......@@ -60,6 +61,7 @@ typedef struct thread_pool {
int traceFd;
int dummyTraceFd;
uint64_t cpuCyclesMicroSec;
uint64_t startProcessingUE;
int nbThreads;
bool restrictRNTI;
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