PIPS
freia_terapix.h
Go to the documentation of this file.
1 /*
2 
3  $Id: freia_terapix.h 23065 2016-03-02 09:05:50Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of PIPS.
8 
9  PIPS is free software: you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 
25 /*
26  * data structures that describe FREIA Terapix target.
27  */
28 
29 #ifndef HWAC_FREIA_TERAPIX_H_
30 #define HWAC_FREIA_TERAPIX_H_
31 
32 // terapix specific property names
33 #define trpx_mem_prop "HWAC_TERAPIX_RAMPE"
34 #define trpx_npe_prop "HWAC_TERAPIX_NPE"
35 #define trpx_dmabw_prop "HWAC_TERAPIX_DMABW"
36 #define trpx_gram_width "HWAC_TERAPIX_GRAM_WIDTH"
37 #define trpx_gram_height "HWAC_TERAPIX_GRAM_HEIGHT"
38 #define trpx_dag_cut "HWAC_TERAPIX_DAG_CUT"
39 #define trpx_overlap_io "HWAC_TERAPIX_OVERLAP_IO"
40 #define trpx_max_size "HWAC_TERAPIX_IMAGELET_MAX_SIZE"
41 
42 // various dag cutting strategies for terapix
43 #define trpx_dag_cut_none_p(s) same_string_p(s, "none")
44 #define trpx_dag_cut_compute_p(s) same_string_p(s, "compute")
45 #define trpx_dag_cut_enumerate_p(s) same_string_p(s, "enumerate")
46 #define trpx_dag_cut_is_valid(s) \
47  trpx_dag_cut_none_p(s) || \
48  trpx_dag_cut_compute_p(s) || \
49  trpx_dag_cut_enumerate_p(s)
50 
51 #define trpx_overlap_io_p() get_bool_property(trpx_overlap_io)
52 
53 // includes for generated terapix helper
54 #define FREIA_TRPX_INCLUDES \
55  "// freia terapix includes\n" \
56  "#include <freiaCommon.h>\n" \
57  "#include <freiaMediumGrain.h>\n" \
58  "#include <freiaCoarseGrain.h>\n" \
59  "#include <terapix.h>\n" \
60  "#include <terapix_ucode.h>\n"
61 
62 // terapix freia function description
63 typedef struct {
64  // image erosion in each direction
65  int north, south, east, west;
66  // internal memory needed, in pixels (?)
67  int memory;
68  // approximate cost per pixel per row
69  // this information is available in the terapix simulator
70  int cost;
71  // whether it can be done in place
72  bool inplace;
73  // whether the input images order must be reversed when calling the hardware
74  bool reverse;
75  // microcode segment name
76  string ucode;
77 } terapix_hw_t;
78 
79 #endif /* !HWAC_FREIA_TERAPIX_H_ */