OpenASIP  2.0
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
MIDDGEdge Struct Reference

#include <MachineInstrDDG.hh>

Inheritance diagram for MIDDGEdge:
Inheritance graph
Collaboration diagram for MIDDGEdge:
Collaboration graph

Public Types

enum  DependenceType { DEP_UNKNOWN = 0, DEP_RAW = 1, DEP_WAR = 2, DEP_WAW = 3 }
 
enum  EdgeReason { EDGE_REGISTER, EDGE_MEMORY }
 

Public Member Functions

 MIDDGEdge (unsigned reg)
 
 MIDDGEdge (unsigned reg, DependenceType type)
 
virtual ~MIDDGEdge ()
 
TCEString dotString () const
 
TCEString toString () const
 
- Public Member Functions inherited from GraphEdge
 GraphEdge ()
 
 GraphEdge (const GraphEdge &edge)
 
virtual GraphEdgeclone () const
 
virtual ~GraphEdge ()
 
virtual int edgeID () const
 
virtual bool isBackEdge () const
 
int weight () const
 
void setWeight (int w)
 

Private Member Functions

std::string typeAsString () const
 

Private Attributes

unsigned reg_
 
unsigned char dependenceType_
 

Detailed Description

Definition at line 86 of file MachineInstrDDG.hh.

Member Enumeration Documentation

◆ DependenceType

Enumerator
DEP_UNKNOWN 
DEP_RAW 
DEP_WAR 
DEP_WAW 

Definition at line 87 of file MachineInstrDDG.hh.

87  {
88  DEP_UNKNOWN = 0,
89  DEP_RAW = 1,
90  DEP_WAR = 2,
91  DEP_WAW = 3};

◆ EdgeReason

Enumerator
EDGE_REGISTER 
EDGE_MEMORY 

Definition at line 93 of file MachineInstrDDG.hh.

93  {
95  EDGE_MEMORY};

Constructor & Destructor Documentation

◆ MIDDGEdge() [1/2]

MIDDGEdge::MIDDGEdge ( unsigned  reg)
inline

Definition at line 97 of file MachineInstrDDG.hh.

97  :

◆ MIDDGEdge() [2/2]

MIDDGEdge::MIDDGEdge ( unsigned  reg,
DependenceType  type 
)
inline

Definition at line 100 of file MachineInstrDDG.hh.

100  :
101  GraphEdge(), reg_(reg), dependenceType_(type) {}

◆ ~MIDDGEdge()

virtual MIDDGEdge::~MIDDGEdge ( )
inlinevirtual

Definition at line 104 of file MachineInstrDDG.hh.

104 {}

Member Function Documentation

◆ dotString()

TCEString MIDDGEdge::dotString ( ) const
inlinevirtual

Returns the string that should be placed in the edge's properties section in the GraphViz Dot string.

This can be overridden in the derived class to add different properties (e.g., colors, etc.) to different type of edges. The default implementation only sets the label property.

Returns
String describing the Dot properties of the edge.

Reimplemented from GraphEdge.

Definition at line 106 of file MachineInstrDDG.hh.

106  {
107  return (boost::format("label=\"%d %s\"") % reg_ % typeAsString()).
108  str();
109  }

References reg_, and typeAsString().

Referenced by MachineInstrDDG::dotString().

Here is the call graph for this function:

◆ toString()

TCEString MIDDGEdge::toString ( ) const
inlinevirtual

Return the label of the edge as a string.

Used for printing graph in GraphViz .dot file.

Returns
The edge ID as a string

Reimplemented from GraphEdge.

Definition at line 111 of file MachineInstrDDG.hh.

111  {
112  return (boost::format("%d %s") % reg_ % typeAsString()).str();
113  }

References reg_, and typeAsString().

Referenced by MachineInstrDDG::assignPhysReg().

Here is the call graph for this function:

◆ typeAsString()

std::string MIDDGEdge::typeAsString ( ) const
inlineprivate

Definition at line 117 of file MachineInstrDDG.hh.

117  {
118  std::string type = "unknown";
119  if (dependenceType_ == DEP_RAW)
120  type = "RaW";
121  else if (dependenceType_ == DEP_WAR)
122  type = "WaR";
123  else if (dependenceType_ == DEP_WAW)
124  type = "WaW";
125  return type;
126  }

References DEP_RAW, DEP_WAR, DEP_WAW, and dependenceType_.

Referenced by dotString(), and toString().

Member Data Documentation

◆ dependenceType_

unsigned char MIDDGEdge::dependenceType_
private

Definition at line 129 of file MachineInstrDDG.hh.

Referenced by typeAsString().

◆ reg_

unsigned MIDDGEdge::reg_
private

Definition at line 128 of file MachineInstrDDG.hh.

Referenced by dotString(), and toString().


The documentation for this struct was generated from the following file:
MIDDGEdge::reg_
unsigned reg_
Definition: MachineInstrDDG.hh:128
MIDDGEdge::DEP_RAW
@ DEP_RAW
Definition: MachineInstrDDG.hh:89
MIDDGEdge::typeAsString
std::string typeAsString() const
Definition: MachineInstrDDG.hh:117
MIDDGEdge::dependenceType_
unsigned char dependenceType_
Definition: MachineInstrDDG.hh:129
MIDDGEdge::DEP_WAR
@ DEP_WAR
Definition: MachineInstrDDG.hh:90
MIDDGEdge::DEP_UNKNOWN
@ DEP_UNKNOWN
Definition: MachineInstrDDG.hh:88
MIDDGEdge::EDGE_MEMORY
@ EDGE_MEMORY
Definition: MachineInstrDDG.hh:95
MIDDGEdge::EDGE_REGISTER
@ EDGE_REGISTER
Definition: MachineInstrDDG.hh:94
GraphEdge::GraphEdge
GraphEdge()
Definition: GraphEdge.cc:40
MIDDGEdge::DEP_WAW
@ DEP_WAW
Definition: MachineInstrDDG.hh:91