24 #ifndef PHRASE_DISTRIBUTOR_DEFS
25 #define PHRASE_DISTRIBUTOR_DEFS
27 #define EXTERNALIZED_CODE_PRAGMA_BEGIN "BEGIN_FPGA_%s"
28 #define EXTERNALIZED_CODE_PRAGMA_END "END_FPGA_%s"
29 #define EXTERNALIZED_CODE_PRAGMA_ANALYZED "ANALYZED_FPGA_%s (%d statements)"
30 #define EXTERNALIZED_CODE_PRAGMA_CALL "CALL_FPGA_%s"
33 #define EXTERNALIZED_FUNCTION_PARAM_NAME "%s_PARAM_%d"
34 #define EXTERNALIZED_FUNCTION_PRIVATE_PARAM_NAME "%s_PRIV"
35 #define CONTROL_DATA_COMMON_NAME "CONTROL_DATA"
36 #define FUNCTION_COMMON_NAME "%s_COMMON"
37 #define COMMON_PARAM_NAME "%s_%s"
38 #define DYN_VAR_PARAM_NAME "%s_DV_PARAM"
39 #define REF_VAR_PARAM_NAME "%s_REF_PARAM"
40 #define UNITS_NB_NAME "UNITS_NB"
41 #define UNIT_ID_NAME "UNIT%d"
42 #define FUNCTIONS_NB_NAME "FUNCTIONS_NB"
43 #define FUNCTION_ID_NAME "%s_FUNCTION"
44 #define IN_PARAM_ID_NAME "%s_%s_IN_PARAM"
45 #define OUT_PARAM_ID_NAME "%s_%s_OUT_PARAM"
46 #define CONTROLIZED_STATEMENT_COMMENT "! CONTROLIZED CALL TO %s\n"
49 #define START_RU_MODULE_NAME "START_RU"
50 #define START_RU_PARAM1_NAME "FUNC_ID"
51 #define START_RU_PARAM2_NAME "UNIT_ID"
54 #define WAIT_RU_MODULE_NAME "WAIT_RU"
55 #define WAIT_RU_PARAM1_NAME "FUNC_ID"
56 #define WAIT_RU_PARAM2_NAME "UNIT_ID"
60 #define VARIABLE_NAME_FORMAT "_%"PRIdPTR"_%"PRIdPTR
61 #define SEND_PARAMETER_MODULE_NAME "SEND_%s_PARAMETER"
62 #define RECEIVE_PARAMETER_MODULE_NAME "RECEIVE_%s_PARAMETER"
63 #define SEND_ARRAY_PARAM_MODULE_NAME "SEND_%s_%s_PARAMETER"
64 #define RECEIVE_ARRAY_PARAM_MODULE_NAME "RECEIVE_%s_%s_PARAMETER"
65 #define COM_MODULE_PARAM1_NAME "FUNC_ID"
66 #define COM_MODULE_PARAM2_NAME "UNIT_ID"
67 #define COM_MODULE_PARAM3_NAME "PARAM_ID"
68 #define COM_MODULE_PARAM4_NAME "PARAM"
70 #define RU_SEND_FLOAT_PARAM_MODULE_NAME "RU_SEND_FLOAT_PARAM"
71 #define RU_RECEIVE_FLOAT_PARAM_MODULE_NAME "RU_RECEIVE_FLOAT_PARAM"
128 int number_of_deployment_units,
137 int number_of_deployment_units,
159 int number_of_deployment_units,
168 int number_of_deployment_units,
180 entity externalized_fonction_common,
181 int number_of_deployment_units);
190 entity externalized_fonction_common,
191 int number_of_deployment_units);
197 const char* new_name,
198 const char* new_module_name,
205 const char* parameter_name,
263 list* l_reg_variables);
static statement module_statement
#define region
simulation of the type region
const char * module_name(const char *s)
Return the module part of an entity name.
list make_receive_array_params_modules(entity function, list l_regions, entity global_common, entity externalized_fonction_common, int number_of_deployment_units)
Make all RECEIVE_PARAM communication modules for non-scalar regions for a given function.
list make_send_array_params_modules(entity function, list l_regions, entity global_common, entity externalized_fonction_common, int number_of_deployment_units)
Make all SEND_PARAM communication modules for non-scalar regions for a given function.
string get_externalizable_function_name(statement stat)
Return the identified function name of the externalized portion of code by searching comment matching...
list make_send_scalar_params_modules(hash_table ht_in_communications, int number_of_deployment_units, entity global_common, list l_commons)
Build and return list of modules used for INPUT communications (SEND_PARAMETERS......
string variable_to_string(variable var)
Return a unique (regarding variable_equal_p(var1,var2)) string representation of a variable var.
entity create_integer_parameter_for_new_module(const char *parameter_name, const char *module_name, entity module, int param_nb)
Create new integer variable parameter for a newly created module.
string get_common_param_name(entity variable, entity function)
bool compute_distribution_controlization_context(list l_calls, statement module_stat, entity module, hash_table *ht_calls, hash_table *ht_params, hash_table *ht_private, hash_table *ht_out_regions, hash_table *ht_in_regions)
This function is called during PHRASE distribution controlization.
entity create_private_variable_for_new_module(entity a_variable, const char *new_name, const char *new_module_name, entity module)
Creates a private variable in specified module.
void register_scalar_communications(hash_table *ht_communications, entity function, list l_regions)
Build an HASHTABLE where keys are VARIABLE and values are HASHTABLE where keys are modules or externa...
string get_externalized_and_analyzed_function_name(statement stat, int *stats_nb)
Return the identified function name of the externalized portion of code by searching comment matching...
string get_receive_param_module_name(entity function, region reg)
Return RECEIVE_PARAM module name for function and region.
string get_function_name_by_searching_tag(statement stat, const char *tag)
Return the identified function name of the externalized portion of code by searching comment matching...
void store_new_module(const char *module_name, entity module, statement module_statement)
Store (PIPDBM) newly created module module with module_statement as USER_FILE by saving pretty printi...
void declare_common_variables_in_module(entity common, entity module)
Creates all the things that need to be created in order to declare common in module (all the variable...
string get_out_param_id_name(entity variable, entity function)
entity make_wait_ru_module(statement *module_statement, int number_of_deployment_units, entity global_common, list l_commons)
Build and store new module WAIT_RU.
string get_send_parameter_module_name(variable var)
list make_receive_scalar_params_modules(hash_table ht_out_communications, int number_of_deployment_units, entity global_common, list l_commons)
Build and return list of modules used for OUTPUT communications (RECEIVE_PARAMETERS....
string get_send_param_module_name(entity function, region reg)
Return SEND_PARAM module name for function and region.
string get_externalized_function_name(statement stat)
Return the identified function name of the externalized portion of code by searching comment matching...
bool compute_distribution_context(list l_stats, statement module_stat, entity module, hash_table *ht_stats, hash_table *ht_params, hash_table *ht_private, hash_table *ht_out_regions, hash_table *ht_in_regions)
This function is called during PHRASE distribution.
entity create_parameter_for_new_module(variable var, const char *parameter_name, const char *module_name, entity module, int param_nb)
Create new variable parameter for a newly created module.
string get_function_id_name(entity function)
string get_in_param_id_name(entity variable, entity function)
void compute_region_variables(region reg, list *l_reg_params, list *l_reg_variables)
Build and return parameters (PHI1,PHI2) and dynamic variables for region reg.
entity make_start_ru_module(hash_table ht_params, statement *module_statement, int number_of_deployment_units, entity global_common, list l_commons)
Build and store new module START_RU.
string get_receive_parameter_module_name(variable var)
The structure used to build lists in NewGen.