risc::sg::SegmentGraph Class Reference

This class represents a segment graph for a process. More...

#include <segment_graph.h>

List of all members.

Public Types

typedef std::set
< SgFunctionDefinition * > 
FunctionCallBoundarySet
typedef std::set< VariantT > CCxxKeywordsBoundarySet
typedef std::set
< VertexDescriptor
SegmentSet

Public Member Functions

 SegmentGraph ()
 SegmentGraph (FunctionCallBoundarySet function_boundaries)
 SegmentGraph (CCxxKeywordsBoundarySet keyword_boundaries)
 SegmentGraph (FunctionCallBoundarySet function_boundaries, CCxxKeywordsBoundarySet keyword_boundaries)
void get_wait_and_notifying_events ()
 set the wait_events_ and notify_events_ for psg nodes under psg mode
void find_module_segments ()
 for loading PSG It adds simulation threads to module_definitions, and sets the corresponding starting_id_ of the thread.
void print_psg_file (std::string file_name)
void read_psg_from_file (std::string)
void replace_partial_function_call_nodes ()
 for each partial function call node, calls integrate_psg_into_sg to replace the node with corresponding sub psg
void integrate_psg_into_sg (VertexDescriptor, SgSymbol *)
void remove_dangling_segments ()
 after integration of all the psgs, the segments that does not belong to simulation processes are removed
void clean_graph ()
 This function deletes all duplicated nodes in each vertex of the graph.
void print_graph (std::string filename)
void print_graph_read_write_access (std::string filename)
void add_function (Thread *originating_thread, Function *function, bool duplicate_segments=false, bool is_simulation_process=true, std::string module_name="")
void read_write_analysis_of_segments ()
 The function determines which variables are read and written in the individual segments.
void set_all_segments_to_untouched ()
 This function sets the status of the flag helper_for_graph_algorithms for all nodes to 'Untouched'.
bool has_transition (int seg_id_from, int seg_id_to)
VertexDescriptor id_to_vertex_descriptor (int seg_id)

Public Attributes

std::vector< std::string > channel_seg_id_array_names_
 we need to instrument set_upcoming_segment_id(var_array) before port calls var_array is defined in the top level channel_seg_id_array_names_ stores the names of all var_array. the names are passed to instrumentor to instrument the arrays in the top file. each name was stored in psg files and loaded back
std::set< VertexDescriptorport_call_seg_vertexs_
 stores the partial function call nodes that hold port calls. are used in PSG mode.
std::vector< std::pair
< VertexDescriptor, SgSymbol * > > 
vertexID_symbol_pairs_of_partialFuncCallNodes_
 pairs of VertexDescriptor of partial function call node and the function's symbol. used for replacing partial function call nodes with its subpsg
std::map< SgSymbol
*, std::vector
< VertexDescriptor > > 
func_symbols_and_entrance_segVertex_
 mapping of function symbol and its entrance segment vertexes, reconstructed after loading
std::map< SgSymbol
*, std::vector
< VertexDescriptor > > 
func_symbols_and_exit_segVertex_
 mapping of function symbol and its exit segment vertexes reconstructed after loading
int total_segment_nodes_
 for redaction of psg, we need to store the total number of segment nodes. The value is set in the main function
Graph graph_
 Internal data structure of the segment graph.
std::set< VertexDescriptorprecached_function_segments_
 This set stores segments from precached functions. These segments will be deleted later.
std::set< SgFunctionCallExp * > port_calls_
 This set stores all function calls which belong to a port. These segments will be deleted later.
bool is_succesfully_created_
 Is true if the segment graph is successfully created.

Private Member Functions

void handle_recursive_calls ()
 This function integrates the recursive function calls.
void separate_variable_declaration_and_initializer_on_demand (SgBasicBlock *&bb, bool duplicate_segments, PortCallPath pcp)
void decompose_expression_with_boundary_calls (SgExpression *expr, SgBasicBlock *&bb, bool duplicate_segments, PortCallPath pcp)
void create_temp_variable_for_expression (SgExpression *expr, SgBasicBlock *&bb)
std::string generate_unique_name (SgNode *node)
std::string generate_unique_name (std::string)
bool is_boundary_stmt (SgStatement const *const current_stmt)
SgFunctionCallExp * has_function_call_with_boundary (SgExpression *expr, bool duplicate_segments, PortCallPath pcp)
bool should_decompose_function (SgExpression *expr, bool duplicate_segments, PortCallPath pcp)
SgFunctionDeclaration * contains_function_call_expression (SgExpression *expr)
SegmentSet build_graph (SgStatement *current_stmt, SegmentSet current_segments, SegmentSet &break_segments, SegmentSet &continue_segments, bool duplicate_segments, PortCallPath pcp)
void add_expression_to_segment (SegmentSet segments, SgNode *expr, PortCallPath pcp)
CachedFunctionAstAttributesbuild_segment_graph_for_function (SgFunctionDefinition *func_def, bool duplicate_segments, PortCallPath pcp)
void insert_loop_edges (VertexDescriptor &loop_vertex, SegmentSet &current_segments, SegmentSet &continue_segments, SegmentSet &leaf_segments_of_loop)
FunctionAnnotationAttributesget_function_call_annotation (SgFunctionCallExp *func_call_exp)
CachedFunctionAstAttributescreate_cached_function_attribute_for_annotated_function (SgNode *boundary_node, WAIT_CONSTRUCT wait_type, SegmentSet incoming_segments, bool is_conflict_free, PortCallPath pcp)
void add_mapped_symbol_to_reference (SgFunctionCallExp *func_call, SgFunctionDefinition *func_def)
void forward_reference_function_parameters (SgFunctionCallExp *func_call_exp)
void mark_not_conflict_free_func_calls_in_segment (SgNode *stmt, SegmentSet segments)
FunctionAnnotationanalyze_prepended_pragmas_for_annotation (SgFunctionDeclaration *func_decl)
SegmentSet duplicate_segments (SegmentSet segments)
SegmentSet duplicate_empty_segments (SegmentSet segments)
bool follow_function_call (SgFunctionDeclaration *func_decl)

Private Attributes

bool static_analysis_
FunctionCallBoundarySet function_boundaries_
CCxxKeywordsBoundarySet keyword_boundaries_
std::set< VertexDescriptorrecursive_function_calls_

Static Private Attributes

static int counter = 0
 This counter is used for generating variables names with unique names.

Detailed Description

This class represents a segment graph for a process.


Member Typedef Documentation

typedef std::set<SgFunctionDefinition*> risc::sg::SegmentGraph::FunctionCallBoundarySet

Constructor & Destructor Documentation

risc::sg::SegmentGraph::SegmentGraph (  ) 
risc::sg::SegmentGraph::SegmentGraph ( FunctionCallBoundarySet  function_boundaries  ) 
risc::sg::SegmentGraph::SegmentGraph ( CCxxKeywordsBoundarySet  keyword_boundaries  ) 
risc::sg::SegmentGraph::SegmentGraph ( FunctionCallBoundarySet  function_boundaries,
CCxxKeywordsBoundarySet  keyword_boundaries 
)

Member Function Documentation

void risc::sg::SegmentGraph::add_expression_to_segment ( SegmentSet  segments,
SgNode *  expr,
PortCallPath  pcp 
) [private]
void risc::sg::SegmentGraph::add_function ( Thread originating_thread,
Function function,
bool  duplicate_segments = false,
bool  is_simulation_process = true,
std::string  module_name = "" 
)
void risc::sg::SegmentGraph::add_mapped_symbol_to_reference ( SgFunctionCallExp *  func_call,
SgFunctionDefinition *  func_def 
) [private]
FunctionAnnotation * risc::sg::SegmentGraph::analyze_prepended_pragmas_for_annotation ( SgFunctionDeclaration *  func_decl  )  [private]
risc::sg::SegmentGraph::SegmentSet risc::sg::SegmentGraph::build_graph ( SgStatement *  current_stmt,
SegmentSet  current_segments,
SegmentSet break_segments,
SegmentSet continue_segments,
bool  duplicate_segments,
PortCallPath  pcp 
) [private]
risc::sg::CachedFunctionAstAttributes * risc::sg::SegmentGraph::build_segment_graph_for_function ( SgFunctionDefinition *  func_def,
bool  duplicate_segments,
PortCallPath  pcp 
) [private]
risc::sg::SegmentGraph::clean_graph (  ) 

This function deletes all duplicated nodes in each vertex of the graph.

SgFunctionDeclaration * risc::sg::SegmentGraph::contains_function_call_expression ( SgExpression *  expr  )  [private]
risc::sg::CachedFunctionAstAttributes * risc::sg::SegmentGraph::create_cached_function_attribute_for_annotated_function ( SgNode *  boundary_node,
WAIT_CONSTRUCT  wait_type,
SegmentSet  incoming_segments,
bool  is_conflict_free,
PortCallPath  pcp 
) [private]
void risc::sg::SegmentGraph::create_temp_variable_for_expression ( SgExpression *  expr,
SgBasicBlock *&  bb 
) [private]
void risc::sg::SegmentGraph::decompose_expression_with_boundary_calls ( SgExpression *  expr,
SgBasicBlock *&  bb,
bool  duplicate_segments,
PortCallPath  pcp 
) [private]
risc::sg::SegmentGraph::SegmentSet risc::sg::SegmentGraph::duplicate_empty_segments ( SegmentSet  segments  )  [private]
risc::sg::SegmentGraph::SegmentSet risc::sg::SegmentGraph::duplicate_segments ( SegmentSet  segments  )  [private]
risc::sg::SegmentGraph::find_module_segments (  ) 

for loading PSG It adds simulation threads to module_definitions, and sets the corresponding starting_id_ of the thread.

bool risc::sg::SegmentGraph::follow_function_call ( SgFunctionDeclaration *  func_decl  )  [private]
void risc::sg::SegmentGraph::forward_reference_function_parameters ( SgFunctionCallExp *  func_call_exp  )  [private]
std::string risc::sg::SegmentGraph::generate_unique_name ( std::string  s  )  [private]
std::string risc::sg::SegmentGraph::generate_unique_name ( SgNode *  node  )  [private]
risc::sg::FunctionAnnotationAttributes * risc::sg::SegmentGraph::get_function_call_annotation ( SgFunctionCallExp *  func_call_exp  )  [private]
risc::sg::SegmentGraph::get_wait_and_notifying_events (  ) 

set the wait_events_ and notify_events_ for psg nodes under psg mode

risc::sg::SegmentGraph::handle_recursive_calls (  )  [private]

This function integrates the recursive function calls.

SgFunctionCallExp * risc::sg::SegmentGraph::has_function_call_with_boundary ( SgExpression *  expr,
bool  duplicate_segments,
PortCallPath  pcp 
) [private]
bool risc::sg::SegmentGraph::has_transition ( int  seg_id_from,
int  seg_id_to 
)
risc::sg::VertexDescriptor risc::sg::SegmentGraph::id_to_vertex_descriptor ( int  seg_id  ) 
void risc::sg::SegmentGraph::insert_loop_edges ( VertexDescriptor loop_vertex,
SegmentSet current_segments,
SegmentSet continue_segments,
SegmentSet leaf_segments_of_loop 
) [private]
void risc::sg::SegmentGraph::integrate_psg_into_sg ( VertexDescriptor  func_call_vertex_id,
SgSymbol *  func_sym 
)
bool risc::sg::SegmentGraph::is_boundary_stmt ( SgStatement const *const   current_stmt  )  [private]
void risc::sg::SegmentGraph::mark_not_conflict_free_func_calls_in_segment ( SgNode *  stmt,
SegmentSet  segments 
) [private]
void risc::sg::SegmentGraph::print_graph ( std::string  filename  ) 
void risc::sg::SegmentGraph::print_graph_read_write_access ( std::string  filename  ) 
void risc::sg::SegmentGraph::print_psg_file ( std::string  file_name  ) 
void risc::sg::SegmentGraph::read_psg_from_file ( std::string  file_name  ) 
risc::sg::SegmentGraph::read_write_analysis_of_segments (  ) 

The function determines which variables are read and written in the individual segments.

risc::sg::SegmentGraph::remove_dangling_segments (  ) 

after integration of all the psgs, the segments that does not belong to simulation processes are removed

risc::sg::SegmentGraph::replace_partial_function_call_nodes (  ) 

for each partial function call node, calls integrate_psg_into_sg to replace the node with corresponding sub psg

Parameters:
filename The name of the file
void risc::sg::SegmentGraph::separate_variable_declaration_and_initializer_on_demand ( SgBasicBlock *&  bb,
bool  duplicate_segments,
PortCallPath  pcp 
) [private]
risc::sg::SegmentGraph::set_all_segments_to_untouched (  ) 

This function sets the status of the flag helper_for_graph_algorithms for all nodes to 'Untouched'.

bool risc::sg::SegmentGraph::should_decompose_function ( SgExpression *  expr,
bool  duplicate_segments,
PortCallPath  pcp 
) [private]

Member Data Documentation

we need to instrument set_upcoming_segment_id(var_array) before port calls var_array is defined in the top level channel_seg_id_array_names_ stores the names of all var_array. the names are passed to instrumentor to instrument the arrays in the top file. each name was stored in psg files and loaded back

int risc::sg::SegmentGraph::counter = 0 [static, private]

This counter is used for generating variables names with unique names.

mapping of function symbol and its entrance segment vertexes, reconstructed after loading

mapping of function symbol and its exit segment vertexes reconstructed after loading

Internal data structure of the segment graph.

Is true if the segment graph is successfully created.

stores the partial function call nodes that hold port calls. are used in PSG mode.

std::set<SgFunctionCallExp*> risc::sg::SegmentGraph::port_calls_

This set stores all function calls which belong to a port. These segments will be deleted later.

This set stores segments from precached functions. These segments will be deleted later.

for redaction of psg, we need to store the total number of segment nodes. The value is set in the main function

pairs of VertexDescriptor of partial function call node and the function's symbol. used for replacing partial function call nodes with its subpsg


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 30 Sep 2018 by  doxygen 1.6.1