48 #include <boost/graph/adjacency_list.hpp> 49 #include <boost/graph/filtered_graph.hpp> 50 #include <boost/iterator/iterator_facade.hpp> 56 : design_flow_step(_design_flow_step),
101 :
graph(design_flow_graphs_collection.get(), _selector)
107 :
graph(design_flow_graphs_collection.get(), _selector, _vertices)
120 const std::string output_directory =
122 if(!std::filesystem::exists(output_directory))
124 std::filesystem::create_directories(output_directory);
126 const std::string
full_name = output_directory + file_name +
".dot";
129 InternalWriteDot<const DesignFlowStepWriter, const DesignFlowEdgeWriter>(
full_name, design_flow_step_writer,
130 design_flow_edge_writer);
138 const size_t writing_step_counter)
const 140 const std::string output_directory =
142 if(!std::filesystem::exists(output_directory))
144 std::filesystem::create_directories(output_directory);
146 const std::string
full_name = output_directory + file_name +
".dot";
147 VertexWriterConstRef design_flow_step_writer(
148 new DesignFlowStepWriter(
this, vertex_history.find(writing_step_counter)->second, vertex_names));
150 this, vertex_history.find(writing_step_counter)->second, edge_history.find(writing_step_counter)->second));
151 InternalWriteDot<const DesignFlowStepWriter, const DesignFlowEdgeWriter>(
full_name, design_flow_step_writer,
152 design_flow_edge_writer);
159 :
VertexWriter(design_flow_graph, _detail_level), vertex_history(_vertex_history), actor_names(_actor_names)
174 out <<
"color=white,label=\"\"";
182 out <<
" style=filled, fillcolor=red, fontcolor=white,";
187 out <<
" style=filled, fillcolor=darkgreen, fontcolor=white, ";
197 out <<
" style=filled, fillcolor=black, fontcolor=white,";
202 out <<
" style=filled, fillcolor=darkgreen, fontcolor=white, ";
207 out <<
" style=filled, fillcolor=gold, fontcolor=white, ";
216 out <<
"style=dashed,";
224 out <<
"label=\"" <<
actor_names.find(v)->second <<
"\"";
229 if(design_flow_step_info->design_flow_step->IsComposed())
231 out <<
" shape=box3d,";
233 switch(design_flow_step_info->status)
237 out <<
" style=filled, fillcolor=red, fontcolor=white,";
242 out <<
" style=filled, fillcolor=darkgreen, fontcolor=white, ";
252 out <<
" style=filled, fillcolor=black, fontcolor=white,";
257 out <<
" style=filled, fillcolor=darkgreen, fontcolor=white, ";
262 out <<
" style=filled, fillcolor=gold, fontcolor=white, ";
271 out <<
"style=dashed,";
279 design_flow_step_info->design_flow_step->WriteDot(out);
287 const int _detail_level)
301 out <<
"color=white";
307 const bool source_executed =
310 const bool target_executed =
315 const int edge_selector =
edge_history.find(edge)->second;
318 out <<
"color=red3,";
320 else if(source_executed and target_executed)
322 out <<
"color=darkgreen, ";
327 out <<
"style=dashed";
349 out <<
"color=red3,";
351 else if(source_executed and target_executed)
353 out <<
"color=darkgreen, ";
358 out <<
"style=dashed";
void operator()(std::ostream &out, const EdgeDescriptor &edge) const override
Functor actually called by the boost library to perform the writing.
void WriteDot(const std::string &file_name, const int detail_level=0) const
Write this graph in dot format.
int GetSelector() const
Return the selector of this graph.
const ParameterConstRef parameters
Set of input parameters.
const graph * printing_graph
The graph to be printed.
Step successfully executed.
vertex AddDesignFlowStep(const DesignFlowStepRef design_flow_step, const bool unnecessary)
Add a design step.
Step successfully executed but without any IR change.
static const int DEPENDENCE_SELECTOR
The dependence selector.
CustomOrderedMap< T, U > CustomMap
exceptions managed by PandA
static const int DEPENDENCE_FEEDBACK_SELECTOR
The dependence feedback selector.
redefinition of map to manage ordered/unordered structures
DesignFlowStepInfo(const DesignFlowStepRef _design_flow_step, const bool unnecessary)
Constructor.
DesignFlowEdgeWriter(const DesignFlowGraph *design_flow_graph, const CustomMap< vertex, DesignFlowStep_Status > &vertex_history=CustomMap< vertex, DesignFlowStep_Status >(), const CustomUnorderedMapStable< EdgeDescriptor, int > &edge_history=CustomUnorderedMapStable< EdgeDescriptor, int >(), const int detail_level=0)
Constructor.
const CustomMap< vertex, DesignFlowStep_Status > & vertex_history
Actors which have to be printed (empty means all)
DesignFlowGraph(const DesignFlowGraphsCollectionRef design_flow_graphs_collection, const int _selector)
Constructor.
const graph * printing_graph
The graph to be printed.
const CustomMap< vertex, std::string > & actor_names
The name of the actors (when they cannot be taken from graph.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
Base class for step of design flow.
Functor used to write the content of a vertex to dotty file.
Classes to describe design flow graph.
DesignFlowGraphsCollection(const ParameterConstRef parameters)
Constructor.
~DesignFlowStepWriter() override
Destructor.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
const int selector
The selector of the graph to be printed.
static const int PRECEDENCE_SELECTOR
The condition selector.
General class used to describe a graph in PandA.
DesignFlowStep_Status
The status of a step.
void operator()(std::ostream &out, const vertex &v) const override
Functor actually called by the boost library to perform the writing.
~DesignFlowGraphsCollection() override
Destructor.
vertex GetDesignFlowStep(const std::string &signature) const
Return the vertex associated with a design step if exists, NULL_VERTEX otherwise. ...
DesignFlowDependenceInfo()
Constructor.
Functor used to write the content of the edges to a dotty file.
Functor used to write the content of the design flow edge to dotty file.
DesignFlowStepWriter(const DesignFlowGraph *design_flow_graph, const CustomMap< vertex, DesignFlowStep_Status > &vertex_history=CustomMap< vertex, DesignFlowStep_Status >(), const CustomMap< vertex, std::string > &actor_names=CustomMap< vertex, std::string >(), const int detail_level=0)
Constructor.
CustomUnorderedMap< std::string, vertex > signature_to_vertex
Map a signature of a step to the corresponding vertex.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
vertex GetDesignFlowStep(const std::string &signature) const
Return the vertex associated with a design step if exists, NULL_VERTEX otherwise. ...
this class is used to manage the command-line or XML options.
~DesignFlowGraph() override
Destructor.
Functor used to write the content of the design flow step to dotty file.
absl::node_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMapStable
const CustomUnorderedMapStable< EdgeDescriptor, int > & edge_history
Edges which have to be printed (empty means all)
~DesignFlowDependenceInfo() override
Destructor.
static const int AUX_SELECTOR
The auxiliary selector.
graphs_collection * collection
The graph collection.
Step is symbolic and it has already been marked.
virtual boost::graph_traits< boost_graphs_collection >::vertex_descriptor AddVertex(const NodeInfoRef info)
Add a vertex to this graph with a property.
#define NULL_VERTEX
null vertex definition
const CustomMap< vertex, DesignFlowStep_Status > & vertex_history
Actors which have to be printed (empty means all)
boost::graph_traits< graph >::edge_descriptor EdgeDescriptor
edge definition.