OpenASIP  2.0
Public Member Functions | Protected Member Functions | Private Types | Private Attributes | List of all members
CentralizedControlICGenerator Class Referenceabstract

#include <CentralizedControlICGenerator.hh>

Inheritance diagram for CentralizedControlICGenerator:
Inheritance graph
Collaboration diagram for CentralizedControlICGenerator:
Collaboration graph

Public Member Functions

 CentralizedControlICGenerator ()
 
virtual ~CentralizedControlICGenerator ()
 
ProGe::NetlistPortsimmDataPort (const std::string &busName) const
 
ProGe::NetlistPortsimmCntrlPort (const std::string &busName) const
 
ProGe::NetlistPortbusCntrlPortOfSocket (const std::string &socketName) const
 
ProGe::NetlistPortdataCntrlPortOfSocket (const std::string &socketName) const
 
bool hasGlockPort () const
 
ProGe::NetlistPortglockPort () const
 
virtual int outputSocketCntrlPinForSegment (const TTAMachine::Socket &socket, const TTAMachine::Segment &segment) const =0
 
virtual int outputSocketDataControlValue (const TTAMachine::Socket &socket, const TTAMachine::Port &port) const =0
 
virtual int inputSocketControlValue (const TTAMachine::Socket &socket, const TTAMachine::Segment &segment) const =0
 

Protected Member Functions

void mapSImmDataPort (const std::string &busName, ProGe::NetlistPort &port)
 
void mapSImmCntrlPort (const std::string &busName, ProGe::NetlistPort &port)
 
void mapBusCntrlPortOfSocket (const std::string &socketName, ProGe::NetlistPort &port)
 
void mapDataCntrlPortOfSocket (const std::string &socketName, ProGe::NetlistPort &port)
 
void setGlockPort (ProGe::NetlistPort &glockPort)
 

Private Types

typedef std::map< std::string, ProGe::NetlistPort * > NetlistPortMap
 

Private Attributes

NetlistPortMap simmDataPortMap_
 Maps the short immediate data ports for buses. More...
 
NetlistPortMap simmCntrlPortMap_
 Maps the short immediate control ports for buses. More...
 
NetlistPortMap socketDataPortMap_
 Maps the data ports of sockets. More...
 
NetlistPortMap busCntrlPortMap_
 Maps the bus control ports of sockets. More...
 
NetlistPortMap dataCntrlPortMap_
 Maps the data control ports of sockets. More...
 
ProGe::NetlistPortglockPort_
 (optional) Glock port More...
 

Detailed Description

Definition at line 52 of file CentralizedControlICGenerator.hh.

Member Typedef Documentation

◆ NetlistPortMap

typedef std::map<std::string, ProGe::NetlistPort*> CentralizedControlICGenerator::NetlistPortMap
private

Definition at line 90 of file CentralizedControlICGenerator.hh.

Constructor & Destructor Documentation

◆ CentralizedControlICGenerator()

CentralizedControlICGenerator::CentralizedControlICGenerator ( )

The constructor.

Definition at line 44 of file CentralizedControlICGenerator.cc.

44  :
45  glockPort_(0) {
46 }

◆ ~CentralizedControlICGenerator()

CentralizedControlICGenerator::~CentralizedControlICGenerator ( )
virtual

The destructor.

Definition at line 52 of file CentralizedControlICGenerator.cc.

52  {
53 }

Member Function Documentation

◆ busCntrlPortOfSocket()

ProGe::NetlistPort & CentralizedControlICGenerator::busCntrlPortOfSocket ( const std::string &  socketName) const

Returns the bus control port of the given socket in the IC block.

Parameters
socketNameName of the socket.
Returns
The netlist port that was added by the IC generator.
Exceptions
InstanceNotFoundIf the port was not created.

Definition at line 98 of file CentralizedControlICGenerator.cc.

99  {
100  try {
101  return *MapTools::valueForKey<NetlistPort*>(busCntrlPortMap_, socketName);
102  } catch (const Exception&) {
103  throw InstanceNotFound(__FILE__, __LINE__, __func__);
104  }
105 }

References __func__, and busCntrlPortMap_.

Referenced by DefaultDecoderGenerator::completeDecoderBlock().

◆ dataCntrlPortOfSocket()

ProGe::NetlistPort & CentralizedControlICGenerator::dataCntrlPortOfSocket ( const std::string &  socketName) const

Returns the data control port of the given socket in the IC block.

Parameters
socketNameName of the socket.
Returns
The netlist port that was added by the IC generator.
Exceptions
InstanceNotFoundIf the port was not created.

Definition at line 115 of file CentralizedControlICGenerator.cc.

116  {
117  try {
118  return *MapTools::valueForKey<NetlistPort*>(dataCntrlPortMap_, socketName);
119  } catch (const Exception&) {
120  throw InstanceNotFound(__FILE__, __LINE__, __func__);
121  }
122 }

References __func__, and dataCntrlPortMap_.

Referenced by DefaultDecoderGenerator::completeDecoderBlock().

◆ glockPort()

ProGe::NetlistPort & CentralizedControlICGenerator::glockPort ( ) const

Returns reference to NetlistPort of glock.

Exceptions
InstanceNotFoundIf IC does not have glock port.

Definition at line 139 of file CentralizedControlICGenerator.cc.

139  {
140  if (!hasGlockPort()) {
141  throw InstanceNotFound(__FILE__, __LINE__, __func__,
142  "IC does not have glock port.");
143  } else {
144  return *glockPort_;
145  }
146 }

References __func__, glockPort_, and hasGlockPort().

Referenced by DefaultDecoderGenerator::addGlockPortToDecoder(), and setGlockPort().

Here is the call graph for this function:

◆ hasGlockPort()

bool CentralizedControlICGenerator::hasGlockPort ( ) const

Returns true if IC has glock port.

Definition at line 128 of file CentralizedControlICGenerator.cc.

128  {
129  return (glockPort_ != 0);
130 }

References glockPort_.

Referenced by DefaultDecoderGenerator::addGlockPortToDecoder(), glockPort(), and DefaultDecoderGenerator::glockPortWidth().

◆ inputSocketControlValue()

virtual int CentralizedControlICGenerator::inputSocketControlValue ( const TTAMachine::Socket socket,
const TTAMachine::Segment segment 
) const
pure virtual

◆ mapBusCntrlPortOfSocket()

void CentralizedControlICGenerator::mapBusCntrlPortOfSocket ( const std::string &  socketName,
ProGe::NetlistPort port 
)
protected

Maps the given bus control port for the given socket.

Parameters
socketNameName of the socket.
portThe netlist port.

Definition at line 191 of file CentralizedControlICGenerator.cc.

193  {
194 
196  busCntrlPortMap_.insert(
197  std::pair<std::string, NetlistPort*>(socketName, &port));
198 }

References assert, busCntrlPortMap_, and MapTools::containsKey().

Referenced by DefaultICGenerator::addICToNetlist().

Here is the call graph for this function:

◆ mapDataCntrlPortOfSocket()

void CentralizedControlICGenerator::mapDataCntrlPortOfSocket ( const std::string &  socketName,
ProGe::NetlistPort port 
)
protected

Maps the given data control port for the given socket.

Parameters
socketNameName of the socket.
portThe netlist port.

Definition at line 208 of file CentralizedControlICGenerator.cc.

210  {
211 
213  dataCntrlPortMap_.insert(
214  std::pair<std::string, NetlistPort*>(socketName, &port));
215 }

References assert, MapTools::containsKey(), and dataCntrlPortMap_.

Referenced by DefaultICGenerator::addICToNetlist().

Here is the call graph for this function:

◆ mapSImmCntrlPort()

void CentralizedControlICGenerator::mapSImmCntrlPort ( const std::string &  busName,
ProGe::NetlistPort port 
)
protected

Maps the given netlist port as the short immediate control port of the given bus.

Parameters
busNameThe bus.
portThe netlist port.

Definition at line 174 of file CentralizedControlICGenerator.cc.

176  {
177 
179  simmCntrlPortMap_.insert(
180  std::pair<std::string, NetlistPort*>(busName, &port));
181 }

References assert, MapTools::containsKey(), and simmCntrlPortMap_.

Referenced by DefaultICGenerator::addICToNetlist().

Here is the call graph for this function:

◆ mapSImmDataPort()

void CentralizedControlICGenerator::mapSImmDataPort ( const std::string &  busName,
ProGe::NetlistPort port 
)
protected

Maps the given netlist port as the short immediate data port of the given bus.

Parameters
busNameThe bus.
portThe netlist port.

Definition at line 156 of file CentralizedControlICGenerator.cc.

158  {
159 
161  simmDataPortMap_.insert(
162  std::pair<std::string, NetlistPort*>(busName, &port));
163 }

References assert, MapTools::containsKey(), and simmDataPortMap_.

Referenced by DefaultICGenerator::addICToNetlist().

Here is the call graph for this function:

◆ outputSocketCntrlPinForSegment()

virtual int CentralizedControlICGenerator::outputSocketCntrlPinForSegment ( const TTAMachine::Socket socket,
const TTAMachine::Segment segment 
) const
pure virtual

◆ outputSocketDataControlValue()

virtual int CentralizedControlICGenerator::outputSocketDataControlValue ( const TTAMachine::Socket socket,
const TTAMachine::Port port 
) const
pure virtual

◆ setGlockPort()

void CentralizedControlICGenerator::setGlockPort ( ProGe::NetlistPort glockPort)
protected

Sets optional glock port of IC.

Parameters
glockPortThe glock port.

Definition at line 224 of file CentralizedControlICGenerator.cc.

224  {
225  assert(glockPort_ == 0);
227 }

References assert, glockPort(), and glockPort_.

Referenced by DefaultICGenerator::addICToNetlist().

Here is the call graph for this function:

◆ simmCntrlPort()

ProGe::NetlistPort & CentralizedControlICGenerator::simmCntrlPort ( const std::string &  busName) const

Returns the short immediate control port for the given bus.

Parameters
busNameName of the bus.
Returns
The netlist port that was added by the IC generator.
Exceptions
InstanceNotFoundIf the port was not created.

Definition at line 81 of file CentralizedControlICGenerator.cc.

81  {
82  try {
83  return *MapTools::valueForKey<NetlistPort*>(
84  simmCntrlPortMap_, busName);
85  } catch (const Exception&) {
86  throw InstanceNotFound(__FILE__, __LINE__, __func__);
87  }
88 }

References __func__, and simmCntrlPortMap_.

◆ simmDataPort()

ProGe::NetlistPort & CentralizedControlICGenerator::simmDataPort ( const std::string &  busName) const

Returns the short immediate data port for the given bus.

Parameters
busNameName of the bus.
Returns
The netlist port that was added by the IC generator.
Exceptions
InstanceNotFoundIf the port was not created.

Definition at line 64 of file CentralizedControlICGenerator.cc.

64  {
65  try {
66  return *MapTools::valueForKey<NetlistPort*>(
67  simmDataPortMap_, busName);
68  } catch (const Exception&) {
69  throw InstanceNotFound(__FILE__, __LINE__, __func__);
70  }
71 }

References __func__, and simmDataPortMap_.

Referenced by DefaultDecoderGenerator::completeDecoderBlock().

Member Data Documentation

◆ busCntrlPortMap_

NetlistPortMap CentralizedControlICGenerator::busCntrlPortMap_
private

Maps the bus control ports of sockets.

Definition at line 99 of file CentralizedControlICGenerator.hh.

Referenced by busCntrlPortOfSocket(), and mapBusCntrlPortOfSocket().

◆ dataCntrlPortMap_

NetlistPortMap CentralizedControlICGenerator::dataCntrlPortMap_
private

Maps the data control ports of sockets.

Definition at line 101 of file CentralizedControlICGenerator.hh.

Referenced by dataCntrlPortOfSocket(), and mapDataCntrlPortOfSocket().

◆ glockPort_

ProGe::NetlistPort* CentralizedControlICGenerator::glockPort_
private

(optional) Glock port

Definition at line 103 of file CentralizedControlICGenerator.hh.

Referenced by glockPort(), hasGlockPort(), and setGlockPort().

◆ simmCntrlPortMap_

NetlistPortMap CentralizedControlICGenerator::simmCntrlPortMap_
private

Maps the short immediate control ports for buses.

Definition at line 95 of file CentralizedControlICGenerator.hh.

Referenced by mapSImmCntrlPort(), and simmCntrlPort().

◆ simmDataPortMap_

NetlistPortMap CentralizedControlICGenerator::simmDataPortMap_
private

Maps the short immediate data ports for buses.

Definition at line 93 of file CentralizedControlICGenerator.hh.

Referenced by mapSImmDataPort(), and simmDataPort().

◆ socketDataPortMap_

NetlistPortMap CentralizedControlICGenerator::socketDataPortMap_
private

Maps the data ports of sockets.

Definition at line 97 of file CentralizedControlICGenerator.hh.


The documentation for this class was generated from the following files:
CentralizedControlICGenerator::simmCntrlPortMap_
NetlistPortMap simmCntrlPortMap_
Maps the short immediate control ports for buses.
Definition: CentralizedControlICGenerator.hh:95
CentralizedControlICGenerator::simmDataPortMap_
NetlistPortMap simmDataPortMap_
Maps the short immediate data ports for buses.
Definition: CentralizedControlICGenerator.hh:93
CentralizedControlICGenerator::glockPort_
ProGe::NetlistPort * glockPort_
(optional) Glock port
Definition: CentralizedControlICGenerator.hh:103
assert
#define assert(condition)
Definition: Application.hh:86
CentralizedControlICGenerator::dataCntrlPortMap_
NetlistPortMap dataCntrlPortMap_
Maps the data control ports of sockets.
Definition: CentralizedControlICGenerator.hh:101
__func__
#define __func__
Definition: Application.hh:67
Exception
Definition: Exception.hh:54
CentralizedControlICGenerator::busCntrlPortMap_
NetlistPortMap busCntrlPortMap_
Maps the bus control ports of sockets.
Definition: CentralizedControlICGenerator.hh:99
MapTools::containsKey
static bool containsKey(const MapType &aMap, const KeyType &aKey)
CentralizedControlICGenerator::glockPort
ProGe::NetlistPort & glockPort() const
Definition: CentralizedControlICGenerator.cc:139
CentralizedControlICGenerator::hasGlockPort
bool hasGlockPort() const
Definition: CentralizedControlICGenerator.cc:128
InstanceNotFound
Definition: Exception.hh:304