All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vertex_property_writer.h
Go to the documentation of this file.
1 #ifndef VERTEX_PROPERTY_WRITER_H_INCLUDED_
2 #define VERTEX_PROPERTY_WRITER_H_INCLUDED_
3 
4 #include "rose.h"
5 
6 #include "segment_graph.h"
7 #include "../internal_representation/design.h"
8 #include "../internal_representation/module_instance.h"
9 #include "../internal_representation/port.h"
10 #include "../internal_representation/object.h"
11 #include "../tools/variable_helper.h"
12 namespace risc {
13 
14 namespace sg {
15 
17 
22 
24 
25  template <class Vertex>
26  void operator() (std::ostream &out, Vertex v)
27  {
28  Segment &seg = graph_[v];
29  if(PSG_MODE) {
30  write_segment_PSG_mode(out, seg);
31  } else if(print_read_write_access) {
32  write_segment_RW_mode(out, seg);
33  } else {
34  write_segment(out, seg);
35  }
36  }
37 
43  void write_segment(std::ostream &out, Segment &seg);
44 
50  void write_segment_RW_mode(std::ostream &out, Segment &seg);
51 
57  void write_segment_PSG_mode(std::ostream &out, Segment &seg);
58 
63  static void replace_escape_characters(std::string &unparsed_stmt);
64 
69  static std::string write_pcp(const PortCallPath &pcp);
70 
75 
76  friend std::ostream& operator<< (std::ostream &out,
77  const VertexPropertyWriter &vpw)
78  {
79  return out;
80  }
81 };
82 
83 }; // end of namespace sg
84 
85 }; // end of namespace risc
86 
87 #endif /* VERTEX_PROPERTY_WRITER_H_INCLUDED_ */
88 
89 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */
void write_segment(std::ostream &out, Segment &seg)
This function generates DOT code for a segment (in normal mode)
Definition: vertex_property_writer.cpp:14
#define PSG_MODE
Definition: design.h:17
static bool print_read_write_access
A flag to turn on/off display of read/write accesses.
Definition: vertex_property_writer.h:21
void operator()(std::ostream &out, Vertex v)
Definition: vertex_property_writer.h:26
void write_segment_PSG_mode(std::ostream &out, Segment &seg)
This function generates DOT code for a segment in PSG mode.
Definition: vertex_property_writer.cpp:297
friend std::ostream & operator<<(std::ostream &out, const VertexPropertyWriter &vpw)
Definition: vertex_property_writer.h:76
Definition: port_call_path.h:10
static void replace_escape_characters(std::string &unparsed_stmt)
This function replaces characters with escape sequences.
Definition: vertex_property_writer.cpp:556
void write_segment_RW_mode(std::ostream &out, Segment &seg)
This function generates DOT code for a segment in read-write variables mode.
Definition: vertex_property_writer.cpp:134
VertexPropertyWriter(Graph &graph)
Definition: vertex_property_writer.cpp:9
Definition: vertex_property_writer.h:16
Graph & graph_
The segment graph.
Definition: vertex_property_writer.h:74
boost::adjacency_list< boost::listS, boost::listS, boost::bidirectionalS, Segment, Edge, boost::property< boost::vertex_index_t, int > > Graph
Definition: segment_graph.h:29
static std::string write_pcp(const PortCallPath &pcp)
This function replaces characters with escape sequences.
Definition: vertex_property_writer.cpp:571
Definition: segment.h:21