drake  1.0.0
include/drake/mapping.h
Go to the documentation of this file.
00001 /*
00002  Copyright 2015 Nicolas Melot
00003 
00004  This file is part of Drake.
00005 
00006  Drake is free software: you can redistribute it and/or modify
00007  it under the terms of the GNU General Public License as published by
00008  the Free Software Foundation, either version 3 of the License, or
00009  (at your option) any later version.
00010 
00011  Drake is distributed in the hope that it will be useful,
00012  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014  GNU General Public License for more details.
00015 
00016  You should have received a copy of the GNU General Public License
00017  along with Drake. If not, see <http://www.gnu.org/licenses/>.
00018 
00019 */
00020 
00021 
00022 #include <stddef.h>
00023 #include <drake/processor.h>
00024 #include <drake/schedule.h>
00025 
00026 #ifndef MAPPING_H
00027 #define MAPPING_H
00028 
00029 #define DRAKE_MAPPING_OUT_WARMUP "x [*,*]\n"
00030 #define DRAKE_MAPPING_OUT_NODE_COLUMN_WIDTH 6
00031 #define DRAKE_MAPPING_OUT_PROC_COLUMN_WIDTH 4
00032 #define DRAKE_MAPPING_OUT_AFFECT " :="
00033 #define DRAKE_MAPPING_OUT_ENDING ";"
00034 
00036 struct mapping
00037 {
00039         unsigned int processor_count;
00041         unsigned int max_processor_count;
00043         unsigned int task_count;
00045         struct processor ** proc;
00046         drake_schedule_t *schedule;
00047 };
00049 typedef struct mapping mapping_t;
00050 
00051 #define STRUCT_T mapping_t
00052 #include <pelib/structure.h>
00053 #define DONE_mapping_t 1
00054 
00056 int
00057 drake_mapping_insert_task(mapping_t*, processor_id, task_t*);
00059 int
00060 drake_mapping_remove_task(mapping_t*, task_id);
00062 int
00063 drake_mapping_find_processor_index(mapping_t*, processor_id);
00065 processor_id
00066 drake_mapping_find_processor(mapping_t*, task_id);
00068 int
00069 drake_mapping_insert_processor(mapping_t*, processor_t*);
00071 int
00072 drake_mapping_remove_processor(mapping_t*, int);
00073 
00075 int
00076 drake_mapping_violations(mapping_t*);
00077 
00081 char*
00082 drake_mapping_drawstr(mapping_t*, char*);
00084 int
00085 drake_mapping_draw(mapping_t*, FILE*);
00087 
00092 mapping_t*
00093 drake_mapping_loadfile(mapping_t* mapping, FILE* ilp_mapping_file);
00095 mapping_t*
00096 drake_mapping_loadstr(mapping_t*, char*);
00097 
00102 mapping_t*
00103 drake_mapping_loadfilterstr(mapping_t* mapping, char* str, int (filter)(task_t*));
00104 
00109 mapping_t*
00110 drake_mapping_loadfilterfile(mapping_t* mapping, FILE* ilp_mapping_file, int
00111 ( filter)(task_t*));
00112 
00116 task_t*
00117 drake_mapping_find_task(mapping_t* mapping, task_id id);
00118 
00119 #endif