OpenASIP 2.2
Loading...
Searching...
No Matches
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.
 

Private Attributes

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

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.

56 :
59}
std::string clkPort_
Name of the clock port.
std::string glockPort_
Name of the global lock port.
std::string rstPort_
Name of the reset port.
std::string moduleName_
Name of the module.

◆ 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}
bool hasID_
Tells whether the implementation has an ID.
RowID id_
ID of the implementation.
void addImplementationFile(BlockImplementationFile *file)

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.

94 {
96}
FileTable files_
Contains the block implementation files.
static void deleteAllItems(SequenceType &aSequence)

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}
BlockImplementationFile & file(int index) const

References file(), and files_.

Referenced by HWBlockImplementation(), FUImplementationDialog::onAddSourceFile(), RFImplementationDialog::onAddSourceFile(), RFImplementationDialog::onMoveSourceFileDown(), FUImplementationDialog::onMoveSourceFileDown(), RFImplementationDialog::onMoveSourceFileUp(), and FUImplementationDialog::onMoveSourceFileUp().

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(), FUImplementationDialog::onDeleteSourceFile(), RFImplementationDialog::onDeleteSourceFile(), RFImplementationDialog::onMoveSourceFileDown(), FUImplementationDialog::onMoveSourceFileDown(), RFImplementationDialog::onMoveSourceFileUp(), FUImplementationDialog::onMoveSourceFileUp(), removeImplementationFile(), HDBToHtml::rfImplToHtml(), RFImplementationDialog::update(), and FUImplementationDialog::update().

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}
#define __func__

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

◆ 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.

242 {
244}
static bool removeValueIfExists(ContainerType &aContainer, const ElementType &aKey)

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

Referenced by FUImplementationDialog::onDeleteSourceFile(), RFImplementationDialog::onDeleteSourceFile(), RFImplementationDialog::onMoveSourceFileDown(), FUImplementationDialog::onMoveSourceFileDown(), RFImplementationDialog::onMoveSourceFileUp(), and FUImplementationDialog::onMoveSourceFileUp().

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_.

Referenced by FUImplementationDialog::onOK(), and RFImplementationDialog::onOK().

◆ 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_.

Referenced by FUImplementationDialog::onOK(), and RFImplementationDialog::onOK().

◆ 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_.

Referenced by FUImplementationDialog::onOK(), and RFImplementationDialog::onOK().

◆ 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_.

Referenced by FUImplementationDialog::onOK(), and RFImplementationDialog::onOK().

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: