OpenASIP  2.0
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
AvalonMMMasterInterface Class Reference

#include <AvalonMMMasterInterface.hh>

Inheritance diagram for AvalonMMMasterInterface:
Inheritance graph
Collaboration diagram for AvalonMMMasterInterface:
Collaboration graph

Public Member Functions

 AvalonMMMasterInterface (const TCEString &name, const TCEString &declaration, const TCEString &avalonPrefix, const SOPCInterface &clock)
 
virtual ~AvalonMMMasterInterface ()
 
bool isValidPort (const ProGe::NetlistPort &port) const
 
void addPort (const ProGe::NetlistPort &port)
 
virtual void writeInterface (std::ostream &stream) const
 
- Public Member Functions inherited from SOPCInterface
 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
 

Static Public Attributes

static const TCEString AVALON_MM_ADDRESS = "address"
 
static const TCEString AVALON_MM_WDATA = "writedata"
 
static const TCEString AVALON_MM_RDATA = "readdata"
 
static const TCEString AVALON_MM_READ = "read"
 
static const TCEString AVALON_MM_WRITE = "write"
 
static const TCEString AVALON_MM_BYTE_ENABLE
 
static const TCEString AVALON_MM_WAIT_REQ = "waitrequest"
 
static const TCEString AVALON_MM_IRQ_RECV = "irq"
 
- Static Public Attributes inherited from SOPCInterface
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"
 

Private Member Functions

const SOPCPortfindInterfacePort (TCEString hdlName, ProGe::Direction direction) const
 
void addIrqInterface (const ProGe::NetlistPort &port, const SOPCPort &avalonPort)
 

Private Attributes

TCEString avalonPrefix_
 
PortList masterPorts_
 
SOPCPort irqPort_
 
const SOPCInterfaceclock_
 
std::vector< SOPCInterface * > childInterfaces_
 

Static Private Attributes

static const int ADDRESS_DEF_WIDTH = 32
 
static const int WDATA_DEF_WIDTH = 32
 
static const int RDATA_DEF_WIDTH = 32
 
static const int READ_DEF_WIDTH = 1
 
static const int WRITE_DEF_WIDTH = 1
 
static const int BYTE_ENABLE_DEF_WIDTH = WDATA_DEF_WIDTH/8
 
static const int WAIT_REQ_DEF_WIDTH = 1
 
static const int IRQ_RECV_DEF_WIDTH = 32
 

Additional Inherited Members

- Protected Types inherited from SOPCInterface
typedef std::map< TCEString, TCEStringPropertyMap
 
typedef std::vector< SOPCPortPortList
 
- Protected Member Functions inherited from SOPCInterface
const PropertyMapproperties () const
 
const PortListports () const
 
void writeProperties (std::ostream &stream) const
 
void writePorts (std::ostream &stream) const
 

Detailed Description

Definition at line 39 of file AvalonMMMasterInterface.hh.

Constructor & Destructor Documentation

◆ AvalonMMMasterInterface()

AvalonMMMasterInterface::AvalonMMMasterInterface ( const TCEString name,
const TCEString declaration,
const TCEString avalonPrefix,
const SOPCInterface clock 
)

Definition at line 54 of file AvalonMMMasterInterface.cc.

58  :
59  SOPCInterface(name, declaration), avalonPrefix_(avalonPrefix),
60  clock_(&clock) {
61 
62  SOPCPort addr = {"", AVALON_MM_ADDRESS, ProGe::OUT, ADDRESS_DEF_WIDTH};
63  masterPorts_.push_back(addr);
64  SOPCPort wdata = {"", AVALON_MM_WDATA, ProGe::OUT, WDATA_DEF_WIDTH};
65  masterPorts_.push_back(wdata);
66  SOPCPort rdata = {"", AVALON_MM_RDATA, ProGe::IN, RDATA_DEF_WIDTH};
67  masterPorts_.push_back(rdata);
68  SOPCPort read = {"", AVALON_MM_READ, ProGe::OUT, READ_DEF_WIDTH};
69  masterPorts_.push_back(read);
70  SOPCPort write = {"", AVALON_MM_WRITE, ProGe::OUT, WRITE_DEF_WIDTH};
71  masterPorts_.push_back(write);
72  SOPCPort bEnable =
74  masterPorts_.push_back(bEnable);
75  SOPCPort waitReq =
77  masterPorts_.push_back(waitReq);
78  SOPCPort irqRecv = {"", AVALON_MM_IRQ_RECV, ProGe::IN, IRQ_RECV_DEF_WIDTH};
79  masterPorts_.push_back(irqRecv);
80 
81  // add default properties
82  setProperty("linewrapBursts", "false");
83  setProperty("adaptsTo", "\"\"");
84  setProperty("doStreamReads","false");
85  setProperty("doStreamWrites","false");
86  setProperty("burstOnBurstBoundariesOnly", "false");
88 }

References ADDRESS_DEF_WIDTH, AVALON_MM_ADDRESS, AVALON_MM_BYTE_ENABLE, AVALON_MM_IRQ_RECV, AVALON_MM_RDATA, AVALON_MM_READ, AVALON_MM_WAIT_REQ, AVALON_MM_WDATA, AVALON_MM_WRITE, BYTE_ENABLE_DEF_WIDTH, clock_, ProGe::IN, IRQ_RECV_DEF_WIDTH, masterPorts_, SOPCInterface::name(), ProGe::OUT, RDATA_DEF_WIDTH, READ_DEF_WIDTH, SOPCInterface::setProperty(), SOPCInterface::SOPC_ASSOCIATED_CLOCK, WAIT_REQ_DEF_WIDTH, WDATA_DEF_WIDTH, and WRITE_DEF_WIDTH.

Here is the call graph for this function:

◆ ~AvalonMMMasterInterface()

AvalonMMMasterInterface::~AvalonMMMasterInterface ( )
virtual

Definition at line 90 of file AvalonMMMasterInterface.cc.

90  {
91 
92  for (unsigned int i = 0; i < childInterfaces_.size(); i++) {
93  if (childInterfaces_.at(i) != NULL) {
94  delete childInterfaces_.at(i);
95  }
96  }
97 }

References childInterfaces_.

Member Function Documentation

◆ addIrqInterface()

void AvalonMMMasterInterface::addIrqInterface ( const ProGe::NetlistPort port,
const SOPCPort avalonPort 
)
private

Definition at line 151 of file AvalonMMMasterInterface.cc.

153  {
154 
155  TCEString irqName = name() + SOPC_IRQ_RECV_INT_NAME;
157  SOPCInterface* irq = new SOPCInterface(irqName, declr);
158  irq->setProperty("associatedAddressablePoint", name());
159  irq->setProperty("irqScheme", "INDIVIDUAL_REQUESTS");
161 
162  int width = avalonPort.width;
163  if (port.realWidthAvailable()) {
164  width = port.realWidth();
165  }
166  irq->setPort(port.name(), avalonPort.interfaceName,
167  avalonPort.direction, width);
168 
169  childInterfaces_.push_back(irq);
170 }

References childInterfaces_, clock_, SOPCInterface::SOPCPort::direction, SOPCInterface::SOPCPort::interfaceName, SOPCInterface::name(), ProGe::NetlistPort::name(), ProGe::NetlistPort::realWidth(), ProGe::NetlistPort::realWidthAvailable(), SOPCInterface::setPort(), SOPCInterface::setProperty(), SOPCInterface::SOPC_ASSOCIATED_CLOCK, SOPCInterface::SOPC_IRQ_RECV_INT_DECLR, SOPCInterface::SOPC_IRQ_RECV_INT_NAME, SOPCInterface::SOPCInterface(), and SOPCInterface::SOPCPort::width.

Referenced by addPort().

Here is the call graph for this function:

◆ addPort()

void AvalonMMMasterInterface::addPort ( const ProGe::NetlistPort port)

Definition at line 106 of file AvalonMMMasterInterface.cc.

106  {
107 
108  const SOPCPort* avalonPort =
109  findInterfacePort(port.name(), port.direction());
110  if (avalonPort->interfaceName == AVALON_MM_IRQ_RECV) {
111  addIrqInterface(port, *avalonPort);
112  } else {
113  int width = avalonPort->width;
114  if (port.realWidthAvailable()) {
115  width = port.realWidth();
116  }
117  setPort(port.name(), avalonPort->interfaceName,
118  avalonPort->direction, width);
119  }
120 }

References addIrqInterface(), AVALON_MM_IRQ_RECV, SOPCInterface::SOPCPort::direction, ProGe::NetlistPort::direction(), findInterfacePort(), SOPCInterface::SOPCPort::interfaceName, ProGe::NetlistPort::name(), ProGe::NetlistPort::realWidth(), ProGe::NetlistPort::realWidthAvailable(), SOPCInterface::setPort(), and SOPCInterface::SOPCPort::width.

Referenced by SOPCBuilderFileGenerator::handleAvalonSignal().

Here is the call graph for this function:

◆ findInterfacePort()

const SOPCInterface::SOPCPort * AvalonMMMasterInterface::findInterfacePort ( TCEString  hdlName,
ProGe::Direction  direction 
) const
private

Definition at line 133 of file AvalonMMMasterInterface.cc.

135  {
136 
137  const SOPCPort* found = NULL;
138  for (unsigned int i = 0; i < masterPorts_.size(); i++) {
139  TCEString search = avalonPrefix_ + masterPorts_.at(i).interfaceName;
140  if (hdlName.find(search) != TCEString::npos) {
141  if (direction == masterPorts_.at(i).direction) {
142  found = &masterPorts_.at(i);
143  break;
144  }
145  }
146  }
147  return found;
148 }

References avalonPrefix_, and masterPorts_.

Referenced by addPort(), and isValidPort().

◆ isValidPort()

bool AvalonMMMasterInterface::isValidPort ( const ProGe::NetlistPort port) const

Definition at line 100 of file AvalonMMMasterInterface.cc.

100  {
101 
102  return findInterfacePort(port.name(), port.direction()) != NULL;
103 }

References ProGe::NetlistPort::direction(), findInterfacePort(), and ProGe::NetlistPort::name().

Referenced by SOPCBuilderFileGenerator::handleAvalonSignal().

Here is the call graph for this function:

◆ writeInterface()

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

Reimplemented from SOPCInterface.

Definition at line 124 of file AvalonMMMasterInterface.cc.

124  {
125 
127  for (unsigned int i = 0; i < childInterfaces_.size(); i++) {
128  childInterfaces_.at(i)->writeInterface(stream);
129  }
130 }

References childInterfaces_, and SOPCInterface::writeInterface().

Referenced by SOPCBuilderFileGenerator::writeInterfaces().

Here is the call graph for this function:

Member Data Documentation

◆ ADDRESS_DEF_WIDTH

const int AvalonMMMasterInterface::ADDRESS_DEF_WIDTH = 32
staticprivate

Definition at line 83 of file AvalonMMMasterInterface.hh.

Referenced by AvalonMMMasterInterface().

◆ AVALON_MM_ADDRESS

const TCEString AvalonMMMasterInterface::AVALON_MM_ADDRESS = "address"
static

◆ AVALON_MM_BYTE_ENABLE

const TCEString AvalonMMMasterInterface::AVALON_MM_BYTE_ENABLE
static
Initial value:
=
"byteenable"

Definition at line 61 of file AvalonMMMasterInterface.hh.

Referenced by AvalonMMMasterInterface().

◆ AVALON_MM_IRQ_RECV

const TCEString AvalonMMMasterInterface::AVALON_MM_IRQ_RECV = "irq"
static

Definition at line 63 of file AvalonMMMasterInterface.hh.

Referenced by addPort(), and AvalonMMMasterInterface().

◆ AVALON_MM_RDATA

const TCEString AvalonMMMasterInterface::AVALON_MM_RDATA = "readdata"
static

Definition at line 58 of file AvalonMMMasterInterface.hh.

Referenced by AvalonMMMasterInterface().

◆ AVALON_MM_READ

const TCEString AvalonMMMasterInterface::AVALON_MM_READ = "read"
static

Definition at line 59 of file AvalonMMMasterInterface.hh.

Referenced by AvalonMMMasterInterface().

◆ AVALON_MM_WAIT_REQ

const TCEString AvalonMMMasterInterface::AVALON_MM_WAIT_REQ = "waitrequest"
static

Definition at line 62 of file AvalonMMMasterInterface.hh.

Referenced by AvalonMMMasterInterface().

◆ AVALON_MM_WDATA

const TCEString AvalonMMMasterInterface::AVALON_MM_WDATA = "writedata"
static

Definition at line 57 of file AvalonMMMasterInterface.hh.

Referenced by AvalonMMMasterInterface().

◆ AVALON_MM_WRITE

const TCEString AvalonMMMasterInterface::AVALON_MM_WRITE = "write"
static

Definition at line 60 of file AvalonMMMasterInterface.hh.

Referenced by AvalonMMMasterInterface().

◆ avalonPrefix_

TCEString AvalonMMMasterInterface::avalonPrefix_
private

Definition at line 75 of file AvalonMMMasterInterface.hh.

Referenced by findInterfacePort().

◆ BYTE_ENABLE_DEF_WIDTH

const int AvalonMMMasterInterface::BYTE_ENABLE_DEF_WIDTH = WDATA_DEF_WIDTH/8
staticprivate

Definition at line 88 of file AvalonMMMasterInterface.hh.

Referenced by AvalonMMMasterInterface().

◆ childInterfaces_

std::vector<SOPCInterface*> AvalonMMMasterInterface::childInterfaces_
private

◆ clock_

const SOPCInterface* AvalonMMMasterInterface::clock_
private

Definition at line 80 of file AvalonMMMasterInterface.hh.

Referenced by addIrqInterface(), and AvalonMMMasterInterface().

◆ IRQ_RECV_DEF_WIDTH

const int AvalonMMMasterInterface::IRQ_RECV_DEF_WIDTH = 32
staticprivate

Definition at line 90 of file AvalonMMMasterInterface.hh.

Referenced by AvalonMMMasterInterface().

◆ irqPort_

SOPCPort AvalonMMMasterInterface::irqPort_
private

Definition at line 78 of file AvalonMMMasterInterface.hh.

◆ masterPorts_

PortList AvalonMMMasterInterface::masterPorts_
private

Definition at line 77 of file AvalonMMMasterInterface.hh.

Referenced by AvalonMMMasterInterface(), and findInterfacePort().

◆ RDATA_DEF_WIDTH

const int AvalonMMMasterInterface::RDATA_DEF_WIDTH = 32
staticprivate

Definition at line 85 of file AvalonMMMasterInterface.hh.

Referenced by AvalonMMMasterInterface().

◆ READ_DEF_WIDTH

const int AvalonMMMasterInterface::READ_DEF_WIDTH = 1
staticprivate

Definition at line 86 of file AvalonMMMasterInterface.hh.

Referenced by AvalonMMMasterInterface().

◆ WAIT_REQ_DEF_WIDTH

const int AvalonMMMasterInterface::WAIT_REQ_DEF_WIDTH = 1
staticprivate

Definition at line 89 of file AvalonMMMasterInterface.hh.

Referenced by AvalonMMMasterInterface().

◆ WDATA_DEF_WIDTH

const int AvalonMMMasterInterface::WDATA_DEF_WIDTH = 32
staticprivate

Definition at line 84 of file AvalonMMMasterInterface.hh.

Referenced by AvalonMMMasterInterface().

◆ WRITE_DEF_WIDTH

const int AvalonMMMasterInterface::WRITE_DEF_WIDTH = 1
staticprivate

Definition at line 87 of file AvalonMMMasterInterface.hh.

Referenced by AvalonMMMasterInterface().


The documentation for this class was generated from the following files:
AvalonMMMasterInterface::AVALON_MM_WDATA
static const TCEString AVALON_MM_WDATA
Definition: AvalonMMMasterInterface.hh:57
AvalonMMMasterInterface::addIrqInterface
void addIrqInterface(const ProGe::NetlistPort &port, const SOPCPort &avalonPort)
Definition: AvalonMMMasterInterface.cc:151
SOPCInterface::setProperty
void setProperty(const TCEString &propertyName, const TCEString &propertyValue)
Definition: SOPCInterface.cc:73
AvalonMMMasterInterface::READ_DEF_WIDTH
static const int READ_DEF_WIDTH
Definition: AvalonMMMasterInterface.hh:86
AvalonMMMasterInterface::AVALON_MM_WRITE
static const TCEString AVALON_MM_WRITE
Definition: AvalonMMMasterInterface.hh:60
AvalonMMMasterInterface::BYTE_ENABLE_DEF_WIDTH
static const int BYTE_ENABLE_DEF_WIDTH
Definition: AvalonMMMasterInterface.hh:88
SOPCInterface::SOPC_ASSOCIATED_CLOCK
static const TCEString SOPC_ASSOCIATED_CLOCK
Definition: SOPCInterface.hh:70
AvalonMMMasterInterface::AVALON_MM_READ
static const TCEString AVALON_MM_READ
Definition: AvalonMMMasterInterface.hh:59
SOPCInterface
Definition: SOPCInterface.hh:41
ProGe::NetlistPort::direction
Direction direction() const
Definition: NetlistPort.cc:373
AvalonMMMasterInterface::AVALON_MM_ADDRESS
static const TCEString AVALON_MM_ADDRESS
Definition: AvalonMMMasterInterface.hh:56
AvalonMMMasterInterface::avalonPrefix_
TCEString avalonPrefix_
Definition: AvalonMMMasterInterface.hh:75
AvalonMMMasterInterface::RDATA_DEF_WIDTH
static const int RDATA_DEF_WIDTH
Definition: AvalonMMMasterInterface.hh:85
SOPCInterface::SOPC_IRQ_RECV_INT_NAME
static const TCEString SOPC_IRQ_RECV_INT_NAME
Definition: SOPCInterface.hh:82
AvalonMMMasterInterface::findInterfacePort
const SOPCPort * findInterfacePort(TCEString hdlName, ProGe::Direction direction) const
Definition: AvalonMMMasterInterface.cc:133
SOPCInterface::writeInterface
virtual void writeInterface(std::ostream &stream) const
Definition: SOPCInterface.cc:110
AvalonMMMasterInterface::AVALON_MM_BYTE_ENABLE
static const TCEString AVALON_MM_BYTE_ENABLE
Definition: AvalonMMMasterInterface.hh:61
ProGe::NetlistPort::realWidthAvailable
bool realWidthAvailable() const
Definition: NetlistPort.cc:334
AvalonMMMasterInterface::WDATA_DEF_WIDTH
static const int WDATA_DEF_WIDTH
Definition: AvalonMMMasterInterface.hh:84
SOPCInterface::setPort
void setPort(const TCEString &hdlName, const TCEString &interfaceName, ProGe::Direction direction, int width)
Definition: SOPCInterface.cc:90
AvalonMMMasterInterface::AVALON_MM_IRQ_RECV
static const TCEString AVALON_MM_IRQ_RECV
Definition: AvalonMMMasterInterface.hh:63
SOPCInterface::name
TCEString name() const
Definition: SOPCInterface.cc:98
AvalonMMMasterInterface::masterPorts_
PortList masterPorts_
Definition: AvalonMMMasterInterface.hh:77
SOPCInterface::SOPC_IRQ_RECV_INT_DECLR
static const TCEString SOPC_IRQ_RECV_INT_DECLR
Definition: SOPCInterface.hh:83
AvalonMMMasterInterface::childInterfaces_
std::vector< SOPCInterface * > childInterfaces_
Definition: AvalonMMMasterInterface.hh:81
AvalonMMMasterInterface::AVALON_MM_RDATA
static const TCEString AVALON_MM_RDATA
Definition: AvalonMMMasterInterface.hh:58
ProGe::NetlistPort::name
std::string name() const
Definition: NetlistPort.cc:283
SOPCInterface::SOPCInterface
SOPCInterface()
ProGe::OUT
@ OUT
Output port.
Definition: ProGeTypes.hh:54
AvalonMMMasterInterface::WRITE_DEF_WIDTH
static const int WRITE_DEF_WIDTH
Definition: AvalonMMMasterInterface.hh:87
ProGe::NetlistPort::realWidth
int realWidth() const
Definition: NetlistPort.cc:348
TCEString
Definition: TCEString.hh:53
AvalonMMMasterInterface::ADDRESS_DEF_WIDTH
static const int ADDRESS_DEF_WIDTH
Definition: AvalonMMMasterInterface.hh:83
AvalonMMMasterInterface::IRQ_RECV_DEF_WIDTH
static const int IRQ_RECV_DEF_WIDTH
Definition: AvalonMMMasterInterface.hh:90
AvalonMMMasterInterface::WAIT_REQ_DEF_WIDTH
static const int WAIT_REQ_DEF_WIDTH
Definition: AvalonMMMasterInterface.hh:89
AvalonMMMasterInterface::clock_
const SOPCInterface * clock_
Definition: AvalonMMMasterInterface.hh:80
ProGe::IN
@ IN
Input port.
Definition: ProGeTypes.hh:53
AvalonMMMasterInterface::AVALON_MM_WAIT_REQ
static const TCEString AVALON_MM_WAIT_REQ
Definition: AvalonMMMasterInterface.hh:62