# HG changeset patch # User yutaka@localhost.localdomain # Date 1270629334 -32400 # Node ID 8b4d6bf8c43d47cba305f726ab1b3e8ff26c867e # Parent 1e1b0d280427f77edccd8ba300d4b3cfc7302da3 add entry_head function diff -r 1e1b0d280427 -r 8b4d6bf8c43d Makefile --- a/Makefile Wed Apr 07 05:18:52 2010 +0900 +++ b/Makefile Wed Apr 07 17:35:34 2010 +0900 @@ -10,16 +10,17 @@ INC = -I include -PPESRC = $(shell ls ppe/*.cc) -SPESRC = $(shell ls spe/*.cc) +PPESRC = $(shell ls ppe/*.cc) +SPESRC = $(shell ls spe/*.cc) +TASKSRC = $(shell ls task/*.cc) all: $(PPETARGET) $(SPETARGET) $(PPETARGET): $(PPEOBJ) - $(PPECC) $(PPELIB) $(INC) $(PPESRC) -o $@ + $(PPECC) $(PPELIB) $(INC) $(PPESRC) $(TASKSRC) -o $@ $(SPETARGET): $(SPEOBJ) - $(SPECC) $(SPELIB) $(INC) $(SPESRC) -o $@ + $(SPECC) $(SPELIB) $(INC) $(SPESRC) $(TASKSRC) -o $@ clean: rm -f $(PPETARGET) $(SPETARGET) diff -r 1e1b0d280427 -r 8b4d6bf8c43d include/Run.h --- a/include/Run.h Wed Apr 07 05:18:52 2010 +0900 +++ b/include/Run.h Wed Apr 07 17:35:34 2010 +0900 @@ -1,1 +1,6 @@ -void run(void *in, void *out, int data_length); +#ifndef INCLUDED_RUN +#define INCLUDED_RUN + +void run(void *in, void *out, int size_in, int size_out); + +#endif diff -r 1e1b0d280427 -r 8b4d6bf8c43d include/Sys.h --- a/include/Sys.h Wed Apr 07 05:18:52 2010 +0900 +++ b/include/Sys.h Wed Apr 07 17:35:34 2010 +0900 @@ -10,5 +10,6 @@ task_t* add_list(task_t *tail, task_t *task); void set_pin(task_t *task, int pin_in, int pin_out); +task_t* entry_head(task_head_t *head) #endif diff -r 1e1b0d280427 -r 8b4d6bf8c43d include/params.h --- a/include/params.h Wed Apr 07 05:18:52 2010 +0900 +++ b/include/params.h Wed Apr 07 17:35:34 2010 +0900 @@ -11,17 +11,19 @@ unsigned long long ea_out; //8 unsigned int next_task_size; //4 + unsigned int size_in; //4 unsigned int size_out; //4 unsigned int pin_in; //4 unsigned int pin_out; //4 -} task_head_t; //32 + int pat[3]; //12 + +} task_head_t; //48 typedef struct { task_head_t *head; //next data param void *input; - unsigned int task_size; } task_t; diff -r 1e1b0d280427 -r 8b4d6bf8c43d ppe/Manager.cc --- a/ppe/Manager.cc Wed Apr 07 05:18:52 2010 +0900 +++ b/ppe/Manager.cc Wed Apr 07 17:35:34 2010 +0900 @@ -33,12 +33,15 @@ int *out = (int*)tmp->head->ea_out; int *in = (int*)tmp->input; + int size_in = tmp->head->size_in; + int size_out = tmp->head->size_out; + //printf("in[%d] %f\n",i,in[i]); //printf("out[%d] %f\n",i,out[i]); //printf("size->out %d\n",tmp->head->size_out); - run(in, out, tmp->head->size_out); + run(in, out, size_in, size_out); //printf("out_spe[%d] %f\n",i,out_spe[i]); //printf("out[%d] %f\n",i,out[i]); @@ -67,10 +70,13 @@ int *out_spe = (int*)allocate(tmp->head->size_out); int *in = (int*)tmp->input; + int size_in = tmp->head->size_in; + int size_out = tmp->head->size_out; + //printf("in[%d] %f\n",i,in[i]); //printf("out[%d] %f\n",i,out[i]); - run(in, out_spe, tmp->head->size_out); + run(in, out_spe, size_in, size_out); //printf("out_spe[%d] %f\n",i,out_spe[i]); //printf("out[%d] %f\n",i,out[i]); diff -r 1e1b0d280427 -r 8b4d6bf8c43d ppe/Menu.cc --- a/ppe/Menu.cc Wed Apr 07 05:18:52 2010 +0900 +++ b/ppe/Menu.cc Wed Apr 07 17:35:34 2010 +0900 @@ -10,12 +10,8 @@ menu(int &list_num) { list_num = SPE_NUM; - int all_task_num = SPE_NUM*1000; - //int all_task_num = 1; - //int task_size = MAX_DMA_SIZE; + int all_task_num = SPE_NUM*10; int task_size = 16*1024; - //int in_size = (task_size - sizeof(task_head_t)) * all_task_num; - //int out_size = (task_size - sizeof(task_head_t)) * all_task_num; int in_size = (task_size - sizeof(task_head_t)); int out_size = (task_size - sizeof(task_head_t)); @@ -26,14 +22,7 @@ for (int i = 0; i < list_num; i++) { - list_head[i].ea_out = 0; - list_head[i].size_out = 0; - list_head[i].pin_in = 0; - list_head[i].pin_out = 0; - - task_t *tail = (task_t*)allocate(sizeof(task_t)); - tail->head = &list_head[i]; - tail->input = NULL; + task_t *tail = entry_head(&list_head[i]); for (int j = 0; j < list_length; j++) { diff -r 1e1b0d280427 -r 8b4d6bf8c43d ppe/Sys.cc --- a/ppe/Sys.cc Wed Apr 07 05:18:52 2010 +0900 +++ b/ppe/Sys.cc Wed Apr 07 17:35:34 2010 +0900 @@ -3,11 +3,29 @@ #include "Sys.h" task_t* +entry_head(task_head_t *head) +{ + + head->ea_out = 0; + head->size_in = 0; + head->size_out = 0; + head->pin_in = 0; + head->pin_out = 0; + + task_t *tail = (task_t*)allocate(sizeof(task_t)); + tail->head = head; + tail->input = NULL; + + return tail; + +} + +task_t* add_list(task_t *tail, task_t *task) { tail->head->next_task = (unsigned long long) (unsigned long) task->head; - tail->head->next_task_size = task->task_size; + tail->head->next_task_size = task->head->size_in + sizeof(task_head_t); task->head->next_task = 0; task->head->next_task_size = 0; @@ -82,16 +100,19 @@ int task_size = in_size + sizeof(task_head_t); + if (task_size > MAX_DMA_SIZE) { + printf("dma send size over %d\n",task_size); + } + posix_memalign(&buff, alignment, task_size); fix_type(task, buff); posix_memalign(&out, alignment, out_size); task->head->ea_out = (unsigned long long) (unsigned long) out; + + task->head->size_in = in_size; task->head->size_out = out_size; - task->task_size = task_size; - - return task; } diff -r 1e1b0d280427 -r 8b4d6bf8c43d spe/SpeSentry.cc --- a/spe/SpeSentry.cc Wed Apr 07 05:18:52 2010 +0900 +++ b/spe/SpeSentry.cc Wed Apr 07 17:35:34 2010 +0900 @@ -117,13 +117,14 @@ //printf("hoge"); output_buff[cur] = allocate(send_params->head->size_out); - int data_length = send_params->head->size_out; + int size_in = send_params->head->size_in; + int size_out = send_params->head->size_out; //task******************************************** - run(in,output_buff[cur],data_length); - + run(in, output_buff[cur], size_in, size_out); + //end********************************************* dma_put(output_buff[cur], send_params->head->ea_out, send_params->head->size_out, out_tag[cur]); @@ -151,12 +152,12 @@ //printf("hoge"); output_buff[cur] = allocate(send_params->head->size_out); - int data_length = send_params->head->size_out; - + int size_in = send_params->head->size_in; + int size_out = send_params->head->size_out; //task******************************************** - run(in,output_buff[cur],data_length); + run(in, output_buff[cur], size_in, size_out); //end*********************************************