OpenASIP  2.0
Public Member Functions | Private Types | Private Attributes | List of all members
HDB::HWBlockImplementation Class Reference

#include <HWBlockImplementation.hh>

Inheritance diagram for HDB::HWBlockImplementation:
Inheritance graph
Collaboration diagram for HDB::HWBlockImplementation:
Collaboration graph

Public Member Functions

 HWBlockImplementation (const std::string &moduleName, const std::string &clkPort, const std::string &rstPort, const std::string &glockPort)
 
 HWBlockImplementation (const HWBlockImplementation &b)
 
virtual ~HWBlockImplementation ()
 
bool hasID () const
 
void setID (RowID id)
 
RowID id () const
 
void setModuleName (const std::string &name)
 
std::string moduleName () const
 
void setClkPort (const std::string &name)
 
std::string clkPort () const
 
void setRstPort (const std::string &name)
 
std::string rstPort () const
 
void setGlockPort (const std::string &name)
 
std::string glockPort () const
 
void addImplementationFile (BlockImplementationFile *file)
 
void removeImplementationFile (const BlockImplementationFile &file)
 
int implementationFileCount () const
 
BlockImplementationFilefile (int index) const
 

Private Types

typedef std::vector< BlockImplementationFile * > FileTable
 Vector type for BlockImplementationFile. More...
 

Private Attributes

std::string moduleName_
 Name of the module. More...
 
std::string clkPort_
 Name of the clock port. More...
 
std::string rstPort_
 Name of the reset port. More...
 
std::string glockPort_
 Name of the global lock port. More...
 
FileTable files_
 Contains the block implementation files. More...
 
bool hasID_
 Tells whether the implementation has an ID. More...
 
RowID id_
 ID of the implementation. More...
 

Detailed Description

Base class for FUImplementation and RFImplementation.

Definition at line 49 of file HWBlockImplementation.hh.

Member Typedef Documentation

◆ FileTable

Vector type for BlockImplementationFile.

Definition at line 82 of file HWBlockImplementation.hh.

Constructor & Destructor Documentation

◆ HWBlockImplementation() [1/2]

HDB::HWBlockImplementation::HWBlockImplementation ( const std::string &  moduleName,
const std::string &  clkPort,
const std::string &  rstPort,
const std::string &  glockPort 
)

The constructor.

Parameters
moduleNameName of the module.
clkPortName of the clock port.
rstPortName of the reset port.
glockPortName of the global lock port.

Definition at line 52 of file HWBlockImplementation.cc.

◆ HWBlockImplementation() [2/2]

HDB::HWBlockImplementation::HWBlockImplementation ( const HWBlockImplementation original)

Copy constructor.

Parameters
originalHWBlock to copy.

Definition at line 66 of file HWBlockImplementation.cc.

67  {
68 
69  moduleName_ = original.moduleName();
70  clkPort_ = original.clkPort();
71  rstPort_ = original.rstPort();
72  glockPort_ = original.glockPort();
73  hasID_ = original.hasID();
74 
75  if (original.hasID()) {
76  id_ = original.id();
77  } else {
78  id_ = -1;
79  }
80 
81  // Deep copy implementation file list.
82  for (int i = 0; i < original.implementationFileCount(); i++) {
83  BlockImplementationFile* newFile =
84  new BlockImplementationFile(original.file(i));
85 
86  addImplementationFile(newFile);
87  }
88 }

References addImplementationFile(), clkPort(), clkPort_, file(), glockPort(), glockPort_, hasID(), hasID_, id(), id_, implementationFileCount(), moduleName(), moduleName_, rstPort(), and rstPort_.

Here is the call graph for this function:

◆ ~HWBlockImplementation()

HDB::HWBlockImplementation::~HWBlockImplementation ( )
virtual

The destructor.

Definition at line 94 of file HWBlockImplementation.cc.

References SequenceTools::deleteAllItems(), and files_.

Here is the call graph for this function:

Member Function Documentation

◆ addImplementationFile()

void HDB::HWBlockImplementation::addImplementationFile ( BlockImplementationFile file)

Adds a new implementation file for the block implementation.

Parameters
fileThe file to add.

Definition at line 230 of file HWBlockImplementation.cc.

230  {
231  files_.push_back(file);
232 }

References file(), and files_.

Referenced by HWBlockImplementation().

Here is the call graph for this function:

◆ clkPort()

std::string HDB::HWBlockImplementation::clkPort ( ) const

◆ file()

BlockImplementationFile & HDB::HWBlockImplementation::file ( int  index) const

Returns a block implementation file by the given index.

Parameters
indexThe index.
Exceptions
OutOfRangeIf the index is negative or not smaller than the number of files.

Definition at line 267 of file HWBlockImplementation.cc.

267  {
268  if (index < 0 || index >= implementationFileCount()) {
269  const string procName = "HWBlockImplementation::file";
270  throw OutOfRange(__FILE__, __LINE__, procName);
271  }
272 
273  return *files_[index];
274 }

References files_, and implementationFileCount().

Referenced by HDB::HDBManager::addFUImplementation(), addImplementationFile(), ImplementationTester::createListOfSimulationFiles(), HDBToHtml::fuImplToHtml(), ProGeScriptGenerator::getBlockOrder(), HWBlockImplementation(), removeImplementationFile(), and HDBToHtml::rfImplToHtml().

Here is the call graph for this function:

◆ glockPort()

std::string HDB::HWBlockImplementation::glockPort ( ) const

◆ hasID()

bool HDB::HWBlockImplementation::hasID ( ) const

Tells whether the implementation has an ID.

Returns
True if the entry has an ID, otherwise false.

Definition at line 105 of file HWBlockImplementation.cc.

105  {
106  return hasID_;
107 }

References hasID_.

Referenced by HDBEditorModifyCmd::Do(), HWBlockImplementation(), and id().

◆ id()

RowID HDB::HWBlockImplementation::id ( ) const

Returns the ID of the implementation.

Returns
ID of the implementation.

Definition at line 128 of file HWBlockImplementation.cc.

128  {
129  if (!hasID()) {
130  throw NotAvailable(__FILE__, __LINE__, __func__);
131  } else {
132  return id_;
133  }
134 }

References __func__, hasID(), and id_.

Referenced by HDBEditorModifyCmd::Do(), HDBToHtml::fuEntryToHtml(), HWBlockImplementation(), HDBToHtml::rfEntryToHtml(), setID(), and HDBBrowserWindow::update().

Here is the call graph for this function:

◆ implementationFileCount()

int HDB::HWBlockImplementation::implementationFileCount ( ) const

Returns the number of files which constitutes the implementation of the block.

Returns
The number of files.

Definition at line 254 of file HWBlockImplementation.cc.

254  {
255  return files_.size();
256 }

References files_.

Referenced by HDB::HDBManager::addFUImplementation(), ImplementationTester::createListOfSimulationFiles(), file(), HDBToHtml::fuImplToHtml(), ProGeScriptGenerator::getBlockOrder(), HWBlockImplementation(), and HDBToHtml::rfImplToHtml().

◆ moduleName()

std::string HDB::HWBlockImplementation::moduleName ( ) const

◆ removeImplementationFile()

void HDB::HWBlockImplementation::removeImplementationFile ( const BlockImplementationFile file)

Removes the given block implementation file from the implementation.

Parameters
fileThe file to remove.

Definition at line 241 of file HWBlockImplementation.cc.

References file(), files_, and ContainerTools::removeValueIfExists().

Here is the call graph for this function:

◆ rstPort()

std::string HDB::HWBlockImplementation::rstPort ( ) const

◆ setClkPort()

void HDB::HWBlockImplementation::setClkPort ( const std::string &  name)

Sets the name of the clock port.

Parameters
nameName of the port.

Definition at line 164 of file HWBlockImplementation.cc.

164  {
165  clkPort_ = name;
166 }

References clkPort_.

◆ setGlockPort()

void HDB::HWBlockImplementation::setGlockPort ( const std::string &  name)

Sets the name of the global lock port.

Parameters
nameName of the port.

Definition at line 208 of file HWBlockImplementation.cc.

208  {
209  glockPort_ = name;
210 }

References glockPort_.

◆ setID()

void HDB::HWBlockImplementation::setID ( RowID  id)

Sets the ID for the implementation.

Parameters
idThe ID to set.

Definition at line 116 of file HWBlockImplementation.cc.

116  {
117  hasID_ = true;
118  id_ = id;
119 }

References hasID_, id(), and id_.

Here is the call graph for this function:

◆ setModuleName()

void HDB::HWBlockImplementation::setModuleName ( const std::string &  name)

Sets the module name.

Parameters
nameName of the module.

Definition at line 142 of file HWBlockImplementation.cc.

142  {
143  moduleName_ = name;
144 }

References moduleName_.

◆ setRstPort()

void HDB::HWBlockImplementation::setRstPort ( const std::string &  name)

Sets the name of the reset port.

Parameters
nameName of the port.

Definition at line 186 of file HWBlockImplementation.cc.

186  {
187  rstPort_ = name;
188 }

References rstPort_.

Member Data Documentation

◆ clkPort_

std::string HDB::HWBlockImplementation::clkPort_
private

Name of the clock port.

Definition at line 87 of file HWBlockImplementation.hh.

Referenced by clkPort(), HWBlockImplementation(), and setClkPort().

◆ files_

FileTable HDB::HWBlockImplementation::files_
private

Contains the block implementation files.

Definition at line 93 of file HWBlockImplementation.hh.

Referenced by addImplementationFile(), file(), implementationFileCount(), removeImplementationFile(), and ~HWBlockImplementation().

◆ glockPort_

std::string HDB::HWBlockImplementation::glockPort_
private

Name of the global lock port.

Definition at line 91 of file HWBlockImplementation.hh.

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

◆ hasID_

bool HDB::HWBlockImplementation::hasID_
private

Tells whether the implementation has an ID.

Definition at line 95 of file HWBlockImplementation.hh.

Referenced by hasID(), HWBlockImplementation(), and setID().

◆ id_

RowID HDB::HWBlockImplementation::id_
private

ID of the implementation.

Definition at line 98 of file HWBlockImplementation.hh.

Referenced by HWBlockImplementation(), id(), and setID().

◆ moduleName_

std::string HDB::HWBlockImplementation::moduleName_
private

Name of the module.

Definition at line 85 of file HWBlockImplementation.hh.

Referenced by HWBlockImplementation(), moduleName(), and setModuleName().

◆ rstPort_

std::string HDB::HWBlockImplementation::rstPort_
private

Name of the reset port.

Definition at line 89 of file HWBlockImplementation.hh.

Referenced by HWBlockImplementation(), rstPort(), and setRstPort().


The documentation for this class was generated from the following files:
HDB::HWBlockImplementation::rstPort_
std::string rstPort_
Name of the reset port.
Definition: HWBlockImplementation.hh:89
HDB::HWBlockImplementation::clkPort
std::string clkPort() const
Definition: HWBlockImplementation.cc:175
HDB::HWBlockImplementation::moduleName_
std::string moduleName_
Name of the module.
Definition: HWBlockImplementation.hh:85
HDB::HWBlockImplementation::file
BlockImplementationFile & file(int index) const
Definition: HWBlockImplementation.cc:267
OutOfRange
Definition: Exception.hh:320
HDB::HWBlockImplementation::implementationFileCount
int implementationFileCount() const
Definition: HWBlockImplementation.cc:254
HDB::HWBlockImplementation::files_
FileTable files_
Contains the block implementation files.
Definition: HWBlockImplementation.hh:93
NotAvailable
Definition: Exception.hh:728
HDB::HWBlockImplementation::hasID_
bool hasID_
Tells whether the implementation has an ID.
Definition: HWBlockImplementation.hh:95
HDB::HWBlockImplementation::rstPort
std::string rstPort() const
Definition: HWBlockImplementation.cc:197
SequenceTools::deleteAllItems
static void deleteAllItems(SequenceType &aSequence)
HDB::HWBlockImplementation::addImplementationFile
void addImplementationFile(BlockImplementationFile *file)
Definition: HWBlockImplementation.cc:230
ContainerTools::removeValueIfExists
static bool removeValueIfExists(ContainerType &aContainer, const ElementType &aKey)
HDB::HWBlockImplementation::id_
RowID id_
ID of the implementation.
Definition: HWBlockImplementation.hh:98
__func__
#define __func__
Definition: Application.hh:67
HDB::HWBlockImplementation::clkPort_
std::string clkPort_
Name of the clock port.
Definition: HWBlockImplementation.hh:87
HDB::HWBlockImplementation::glockPort_
std::string glockPort_
Name of the global lock port.
Definition: HWBlockImplementation.hh:91
HDB::HWBlockImplementation::id
RowID id() const
Definition: HWBlockImplementation.cc:128
HDB::HWBlockImplementation::moduleName
std::string moduleName() const
Definition: HWBlockImplementation.cc:153
HDB::HWBlockImplementation::glockPort
std::string glockPort() const
Definition: HWBlockImplementation.cc:219
HDB::HWBlockImplementation::hasID
bool hasID() const
Definition: HWBlockImplementation.cc:105