PIPS
|
#include <stdio.h>
#include <ctype.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "resources.h"
#include "misc.h"
#include "ri-util.h"
#include "effects-util.h"
#include "pipsdbm.h"
#include "text-util.h"
#include "dg.h"
#include "graph.h"
#include "ray_dte.h"
#include "sommet.h"
#include "sg.h"
#include "polyedre.h"
#include "control.h"
#include "callgraph.h"
#include "properties.h"
#include "phrase_tools.h"
#include "fsm_generation.h"
Go to the source code of this file.
Typedefs | |
typedef dg_arc_label | arc_label |
This phase is used for PHRASE project. More... | |
typedef dg_vertex_label | vertex_label |
Functions | |
bool | fsm_generation (const char *module_name) |
fsm_generation.c More... | |
typedef dg_arc_label arc_label |
This phase is used for PHRASE project.
NB: The PHRASE project is an attempt to automatically (or semi-automatically) transform high-level language for partial evaluation in reconfigurable logic (such as FPGAs or DataPaths).
This library provides phases allowing to build and modify "Finite State Machine"-like code portions which will be later synthetized in reconfigurable units.
This phase tries to generate finite state machine from arbitrary code by applying rules numeroting branches of the syntax tree and using it as state variable for the finite state machine.
This phase recursively transform each UNSTRUCTURED statement in a WHILE-LOOP statement controlled by a state variable, whose different values are associated to the different statements.
To add flexibility, the behavior of FSM_GENERATION is controlled by the property FSMIZE_WITH_GLOBAL_VARIABLE which control the fact that the same global variable (global to the current module) must be used for each FSMized statements.
alias fsm_generation 'FSM Generation'
fsm_generation > MODULE.code > PROGRAM.entities < PROGRAM.entities < MODULE.code
Definition at line 80 of file fsm_generation.c.
typedef dg_vertex_label vertex_label |
Definition at line 81 of file fsm_generation.c.
bool fsm_generation | ( | const char * | module_name | ) |
get the resources
dependence_graph = (graph) db_get_memory_resource(DBR_DG, module_name, true);
Now do the job
If property FSMIZE_WITH_GLOBAL_VARIABLE is set to true, we declare here the state variable which will be used in the whole module
Reorder the module, because new statements have been added
update/release resources
module_name | odule_name |
Definition at line 103 of file fsm_generation.c.
References compute_callees(), create_state_variable(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, fsmize_statement(), get_bool_property(), module_name(), module_name_to_entity(), module_reorder(), pips_assert, reset_current_module_entity(), reset_current_module_statement(), set_current_module_entity(), set_current_module_statement(), and statement_consistent_p().