OpenASIP  2.0
Classes | Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
SOPCInterface Class Reference

#include <SOPCInterface.hh>

Inheritance diagram for SOPCInterface:
Inheritance graph
Collaboration diagram for SOPCInterface:
Collaboration graph

Classes

struct  SOPCPort
 

Public Member Functions

 SOPCInterface (TCEString name, TCEString declaration)
 
virtual ~SOPCInterface ()
 
void setProperty (const TCEString &propertyName, const TCEString &propertyValue)
 
void setProperty (const TCEString &propertyName, int propertyValue)
 
void setPort (const TCEString &hdlName, const TCEString &interfaceName, ProGe::Direction direction, int width)
 
TCEString name () const
 
bool hasPorts () const
 
virtual void writeInterface (std::ostream &stream) const
 

Static Public Attributes

static const TCEString SOPC_ADD_INTERFACE
 
static const TCEString SOPC_SET_INT_PROPERTY
 
static const TCEString SOPC_ADD_INT_PORT
 
static const TCEString SOPC_ASSOCIATED_CLOCK
 
static const TCEString SOPC_MASTER_INT_NAME = "avalon_master"
 
static const TCEString SOPC_MASTER_INT_DECLR = "avalon start"
 
static const TCEString SOPC_CLOCK_INT_NAME = "clock_reset"
 
static const TCEString SOPC_CLOCK_INT_DECLR = "clock end"
 
static const TCEString SOPC_EXPORT_INT_NAME = "conduit_interface"
 
static const TCEString SOPC_EXPORT_INT_DECLR = "conduit end"
 
static const TCEString SOPC_EXPORT_NAME = "export"
 
static const TCEString SOPC_IRQ_RECV_INT_NAME = "interrupt_recv"
 
static const TCEString SOPC_IRQ_RECV_INT_DECLR = "interrupt start"
 
static const TCEString SOPC_INPUT = "Input"
 
static const TCEString SOPC_OUTPUT = "Output"
 
static const TCEString SOPC_BIDIR = "Bidir"
 

Protected Types

typedef std::map< TCEString, TCEStringPropertyMap
 
typedef std::vector< SOPCPortPortList
 

Protected Member Functions

const PropertyMapproperties () const
 
const PortListports () const
 
void writeProperties (std::ostream &stream) const
 
void writePorts (std::ostream &stream) const
 

Private Member Functions

 SOPCInterface ()
 
 SOPCInterface (const SOPCInterface &old)
 
SOPCInterfaceoperator= (SOPCInterface old)
 

Private Attributes

TCEString name_
 
TCEString declaration_
 
PropertyMap properties_
 
PortList ports_
 

Detailed Description

Definition at line 41 of file SOPCInterface.hh.

Member Typedef Documentation

◆ PortList

typedef std::vector<SOPCPort> SOPCInterface::PortList
protected

Definition at line 99 of file SOPCInterface.hh.

◆ PropertyMap

typedef std::map<TCEString, TCEString> SOPCInterface::PropertyMap
protected

Definition at line 98 of file SOPCInterface.hh.

Constructor & Destructor Documentation

◆ SOPCInterface() [1/3]

SOPCInterface::SOPCInterface ( TCEString  name,
TCEString  declaration 
)

Definition at line 66 of file SOPCInterface.cc.

66  :
67  name_(name), declaration_(declaration) {
68 }

◆ ~SOPCInterface()

SOPCInterface::~SOPCInterface ( )
virtual

Definition at line 70 of file SOPCInterface.cc.

70  {
71 }

◆ SOPCInterface() [2/3]

SOPCInterface::SOPCInterface ( )
private

◆ SOPCInterface() [3/3]

SOPCInterface::SOPCInterface ( const SOPCInterface old)
private

Member Function Documentation

◆ hasPorts()

bool SOPCInterface::hasPorts ( ) const

Definition at line 104 of file SOPCInterface.cc.

104  {
105 
106  return !ports_.empty();
107 }

References ports_.

Referenced by SOPCBuilderFileGenerator::writeInterfaces().

◆ name()

TCEString SOPCInterface::name ( ) const

◆ operator=()

SOPCInterface& SOPCInterface::operator= ( SOPCInterface  old)
private

◆ ports()

const SOPCInterface::PortList * SOPCInterface::ports ( ) const
protected

Definition at line 127 of file SOPCInterface.cc.

127  {
128 
129  return &ports_;
130 }

References ports_.

◆ properties()

const SOPCInterface::PropertyMap * SOPCInterface::properties ( ) const
protected

Definition at line 121 of file SOPCInterface.cc.

121  {
122 
123  return &properties_;
124 }

References properties_.

◆ setPort()

void SOPCInterface::setPort ( const TCEString hdlName,
const TCEString interfaceName,
ProGe::Direction  direction,
int  width 
)

Definition at line 90 of file SOPCInterface.cc.

92  {
93  SOPCPort port = {hdlName, interfaceName, direction, width};
94  ports_.push_back(port);
95 }

References ports_.

Referenced by AvalonMMMasterInterface::addIrqInterface(), AvalonMMMasterInterface::addPort(), SOPCBuilderFileGenerator::exportSignal(), and SOPCBuilderFileGenerator::SOPCBuilderFileGenerator().

◆ setProperty() [1/2]

void SOPCInterface::setProperty ( const TCEString propertyName,
const TCEString propertyValue 
)

◆ setProperty() [2/2]

void SOPCInterface::setProperty ( const TCEString propertyName,
int  propertyValue 
)

Definition at line 81 of file SOPCInterface.cc.

83  {
84 
85  TCEString convertedValue = Conversion::toString(propertyValue);
86  setProperty(propertyName, convertedValue);
87 }

References setProperty(), and Conversion::toString().

Here is the call graph for this function:

◆ writeInterface()

void SOPCInterface::writeInterface ( std::ostream &  stream) const
virtual

Reimplemented in AvalonMMMasterInterface.

Definition at line 110 of file SOPCInterface.cc.

110  {
111 
112  stream
113  << "# " << name_ << endl
114  << SOPC_ADD_INTERFACE << " " << name_ << " " << declaration_ << endl;
115  writeProperties(stream);
116  writePorts(stream);
117  stream << endl;
118 }

References declaration_, name_, SOPC_ADD_INTERFACE, writePorts(), and writeProperties().

Referenced by AvalonMMMasterInterface::writeInterface(), and SOPCBuilderFileGenerator::writeInterfaces().

Here is the call graph for this function:

◆ writePorts()

void SOPCInterface::writePorts ( std::ostream &  stream) const
protected

Definition at line 147 of file SOPCInterface.cc.

147  {
148 
149  for (unsigned int i = 0; i < ports_.size(); i++) {
150  stream
151  << SOPC_ADD_INT_PORT << " " << name_ << " "
152  << ports_.at(i).hdlName << " " << ports_.at(i).interfaceName
153  << " ";
154  if (ports_.at(i).direction == ProGe::IN) {
155  stream << SOPC_INPUT << " ";
156  } else if (ports_.at(i).direction == ProGe::OUT) {
157  stream << SOPC_OUTPUT << " ";
158  } else if (ports_.at(i).direction == ProGe::BIDIR) {
159  stream << SOPC_BIDIR << " ";
160  } else {
161  assert(false && "Invalid port direction");
162  }
163  stream << ports_.at(i).width << endl;
164  }
165 }

References assert, ProGe::BIDIR, ProGe::IN, name_, ProGe::OUT, ports_, SOPC_ADD_INT_PORT, SOPC_BIDIR, SOPC_INPUT, and SOPC_OUTPUT.

Referenced by writeInterface().

◆ writeProperties()

void SOPCInterface::writeProperties ( std::ostream &  stream) const
protected

Definition at line 134 of file SOPCInterface.cc.

134  {
135 
136  PropertyMap::const_iterator iter = properties_.begin();
137  while (iter != properties_.end()) {
138  stream
139  << SOPC_SET_INT_PROPERTY << " " << name_ << " " << iter->first
140  << " " << iter->second << endl;
141  iter++;
142  }
143 }

References name_, properties_, and SOPC_SET_INT_PROPERTY.

Referenced by writeInterface().

Member Data Documentation

◆ declaration_

TCEString SOPCInterface::declaration_
private

Definition at line 115 of file SOPCInterface.hh.

Referenced by writeInterface().

◆ name_

TCEString SOPCInterface::name_
private

Definition at line 114 of file SOPCInterface.hh.

Referenced by name(), writeInterface(), writePorts(), and writeProperties().

◆ ports_

PortList SOPCInterface::ports_
private

Definition at line 117 of file SOPCInterface.hh.

Referenced by hasPorts(), ports(), setPort(), and writePorts().

◆ properties_

PropertyMap SOPCInterface::properties_
private

Definition at line 116 of file SOPCInterface.hh.

Referenced by properties(), setProperty(), and writeProperties().

◆ SOPC_ADD_INT_PORT

const TCEString SOPCInterface::SOPC_ADD_INT_PORT
static
Initial value:
=
"add_interface_port"

Definition at line 69 of file SOPCInterface.hh.

Referenced by writePorts().

◆ SOPC_ADD_INTERFACE

const TCEString SOPCInterface::SOPC_ADD_INTERFACE
static
Initial value:
=
"add_interface"

Definition at line 67 of file SOPCInterface.hh.

Referenced by writeInterface().

◆ SOPC_ASSOCIATED_CLOCK

const TCEString SOPCInterface::SOPC_ASSOCIATED_CLOCK
static

◆ SOPC_BIDIR

const TCEString SOPCInterface::SOPC_BIDIR = "Bidir"
static

Definition at line 87 of file SOPCInterface.hh.

Referenced by writePorts().

◆ SOPC_CLOCK_INT_DECLR

const TCEString SOPCInterface::SOPC_CLOCK_INT_DECLR = "clock end"
static

Definition at line 76 of file SOPCInterface.hh.

◆ SOPC_CLOCK_INT_NAME

const TCEString SOPCInterface::SOPC_CLOCK_INT_NAME = "clock_reset"
static

Definition at line 75 of file SOPCInterface.hh.

◆ SOPC_EXPORT_INT_DECLR

const TCEString SOPCInterface::SOPC_EXPORT_INT_DECLR = "conduit end"
static

Definition at line 79 of file SOPCInterface.hh.

◆ SOPC_EXPORT_INT_NAME

const TCEString SOPCInterface::SOPC_EXPORT_INT_NAME = "conduit_interface"
static

Definition at line 78 of file SOPCInterface.hh.

◆ SOPC_EXPORT_NAME

const TCEString SOPCInterface::SOPC_EXPORT_NAME = "export"
static

Definition at line 80 of file SOPCInterface.hh.

Referenced by SOPCBuilderFileGenerator::exportSignal().

◆ SOPC_INPUT

const TCEString SOPCInterface::SOPC_INPUT = "Input"
static

Definition at line 85 of file SOPCInterface.hh.

Referenced by writePorts().

◆ SOPC_IRQ_RECV_INT_DECLR

const TCEString SOPCInterface::SOPC_IRQ_RECV_INT_DECLR = "interrupt start"
static

Definition at line 83 of file SOPCInterface.hh.

Referenced by AvalonMMMasterInterface::addIrqInterface().

◆ SOPC_IRQ_RECV_INT_NAME

const TCEString SOPCInterface::SOPC_IRQ_RECV_INT_NAME = "interrupt_recv"
static

Definition at line 82 of file SOPCInterface.hh.

Referenced by AvalonMMMasterInterface::addIrqInterface().

◆ SOPC_MASTER_INT_DECLR

const TCEString SOPCInterface::SOPC_MASTER_INT_DECLR = "avalon start"
static

Definition at line 73 of file SOPCInterface.hh.

Referenced by SOPCBuilderFileGenerator::handleAvalonSignal().

◆ SOPC_MASTER_INT_NAME

const TCEString SOPCInterface::SOPC_MASTER_INT_NAME = "avalon_master"
static

Definition at line 72 of file SOPCInterface.hh.

Referenced by SOPCBuilderFileGenerator::handleAvalonSignal().

◆ SOPC_OUTPUT

const TCEString SOPCInterface::SOPC_OUTPUT = "Output"
static

Definition at line 86 of file SOPCInterface.hh.

Referenced by writePorts().

◆ SOPC_SET_INT_PROPERTY

const TCEString SOPCInterface::SOPC_SET_INT_PROPERTY
static
Initial value:
=
"set_interface_property"

Definition at line 68 of file SOPCInterface.hh.

Referenced by writeProperties().


The documentation for this class was generated from the following files:
SOPCInterface::setProperty
void setProperty(const TCEString &propertyName, const TCEString &propertyValue)
Definition: SOPCInterface.cc:73
SOPCInterface::SOPC_ADD_INT_PORT
static const TCEString SOPC_ADD_INT_PORT
Definition: SOPCInterface.hh:69
ProGe::BIDIR
@ BIDIR
Bidirectional port.
Definition: ProGeTypes.hh:55
SOPCInterface::declaration_
TCEString declaration_
Definition: SOPCInterface.hh:115
Conversion::toString
static std::string toString(const T &source)
SOPCInterface::SOPC_ADD_INTERFACE
static const TCEString SOPC_ADD_INTERFACE
Definition: SOPCInterface.hh:67
assert
#define assert(condition)
Definition: Application.hh:86
SOPCInterface::writePorts
void writePorts(std::ostream &stream) const
Definition: SOPCInterface.cc:147
SOPCInterface::name
TCEString name() const
Definition: SOPCInterface.cc:98
SOPCInterface::SOPC_BIDIR
static const TCEString SOPC_BIDIR
Definition: SOPCInterface.hh:87
SOPCInterface::SOPC_SET_INT_PROPERTY
static const TCEString SOPC_SET_INT_PROPERTY
Definition: SOPCInterface.hh:68
ProGe::OUT
@ OUT
Output port.
Definition: ProGeTypes.hh:54
SOPCInterface::SOPC_OUTPUT
static const TCEString SOPC_OUTPUT
Definition: SOPCInterface.hh:86
SOPCInterface::ports_
PortList ports_
Definition: SOPCInterface.hh:117
TCEString
Definition: TCEString.hh:53
SOPCInterface::SOPC_INPUT
static const TCEString SOPC_INPUT
Definition: SOPCInterface.hh:85
SOPCInterface::properties_
PropertyMap properties_
Definition: SOPCInterface.hh:116
SOPCInterface::name_
TCEString name_
Definition: SOPCInterface.hh:114
SOPCInterface::writeProperties
void writeProperties(std::ostream &stream) const
Definition: SOPCInterface.cc:134
ProGe::IN
@ IN
Input port.
Definition: ProGeTypes.hh:53