PIPS
freia.h
Go to the documentation of this file.
1 /*
2 
3  $Id: freia.h 23422 2017-10-16 15:51:07Z guillou $
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  * FREIA common stuff.
27  */
28 #ifndef HWAC_FREIA_H_
29 #define HWAC_FREIA_H_
30 
31 // additionnal hardware specific definitions
32 #include "freia_spoc.h"
33 #include "freia_terapix.h"
34 #include "freia_opencl.h"
35 #include "freia_sigmac.h"
36 #include "freia_mppa.h"
37 
38 #define HELPER "_helper_"
39 
40 // do not require NULL at the end of a vararg.
41 #define cat(args...) concatenate(args , NULL)
42 #define sb_cat(args...) string_buffer_cat(args , NULL)
43 #define sb_prf(args...) string_buffer_printf(args)
44 
45 // macros for freia stuff
46 #define FREIA_IMAGE_TYPE "freia_data2d"
47 #define FREIA_OUTPUT "freia_common_tx_image"
48 #define FREIA_ALLOC "freia_common_create_data"
49 #define FREIA_FREE "freia_common_destruct_data"
50 
51 #define AIPO "freia_aipo_"
52 #define FREIA_IMAGE FREIA_IMAGE_TYPE " * "
53 #define FREIA_DEFAULT_BPP get_int_property("FREIA_PIXEL_SIZE")
54 #define FREIA_DEFAULT_HEIGHT get_int_property("FREIA_IMAGE_HEIGHT")
55 #define FREIA_DEFAULT_WIDTH get_int_property("FREIA_IMAGE_WIDTH")
56 
57 // check the hardware target
58 #define freia_aipo_p(s) same_string_p((s), "aipo")
59 #define freia_spoc_p(s) same_string_p((s), "spoc")
60 #define freia_terapix_p(s) same_string_p((s), "terapix")
61 #define freia_opencl_p(s) same_string_p((s), "opencl")
62 #define freia_sigmac_p(s) same_string_p((s), "sigmac")
63 #define freia_mppa_p(s) same_string_p((s), "mppa")
64 
65 #define freia_valid_target_p(s) \
66  (freia_spoc_p(s) || freia_terapix_p(s) || freia_aipo_p(s) || \
67  freia_opencl_p(s) || freia_sigmac_p(s) || freia_mppa_p(s))
68 
69 /* FREIA API function name -> SPoC hardware description (and others?)
70  */
71 typedef struct {
72  // function name
73  string function_name;
74  // something very short for graph nodes
75  string compact_name;
76  // if the function is commutative/has a corresponding commuted version
77  string commutator;
78  // expected number of in/out arguments, that we should be able to use...
79  unsigned int arg_img_out; // 0 1
80  unsigned int arg_img_in; // 0 1 2
81  // cst, bool, kernel...
82  unsigned int arg_misc_out; // 0 1 2 3
83  unsigned int arg_misc_in; // 0 1 2 3
84  // mmmh... hardcoded to max 3 in or outs (threshold, global_*_coord...)
85  string arg_out_types[3];
86  string arg_in_types[3];
87  // ...
88  // corresponding hardware settings
94  // others? vhdl?:-)
95 } freia_api_t;
96 
97 #define dagvtx_freia_api(v) get_freia_api(vtxcontent_opid(dagvtx_content(v)))
98 
99 #endif /* !HWAC_FREIA_H_ */
FREIA API function name -> SPoC hardware description (and others?)
Definition: freia.h:71
string function_name
Definition: freia.h:73
mppa_hw_t mppa
Definition: freia.h:93
spoc_hw_t spoc
Definition: freia.h:89
unsigned int arg_misc_in
Definition: freia.h:83
string compact_name
Definition: freia.h:75
terapix_hw_t terapix
Definition: freia.h:90
sigmac_hw_t sigmac
Definition: freia.h:92
opencl_hw_t opencl
Definition: freia.h:91
unsigned int arg_img_out
Definition: freia.h:79
string commutator
Definition: freia.h:77
unsigned int arg_misc_out
Definition: freia.h:82
unsigned int arg_img_in
Definition: freia.h:80
FREIA-MPPA backend specific stuff.
Definition: freia_mppa.h:33
description of a SPoC hardware configuration should be precise enough to generate a full AIPO functio...
Definition: freia_spoc.h:160