OpenASIP
2.0
|
#include <FUImplementation.hh>
Public Types | |
typedef HDB::Parameter | Parameter |
Parameter of FU implementation. More... | |
Public Member Functions | |
FUImplementation (const std::string &name, const std::string &opcodePort, const std::string &clkPort, const std::string &rstPort, const std::string &glockPort, const std::string &glockReqPort) | |
virtual | ~FUImplementation () |
FUImplementation (const FUImplementation &o) | |
void | setOpcodePort (const std::string &name) |
std::string | opcodePort () const |
void | setGlockReqPort (const std::string &name) |
std::string | glockReqPort () const |
void | setOpcode (const std::string &operation, int opcode) |
void | unsetOpcode (const std::string &operation) |
int | opcodeCount () const |
std::string | opcodeOperation (int index) const |
bool | hasOpcode (const std::string &operation) const |
int | opcode (const std::string &operation) const |
int | maxOpcodeWidth () const |
void | addArchitecturePort (FUPortImplementation *port) |
void | deleteArchitecturePort (FUPortImplementation *port) |
void | addExternalPort (FUExternalPort *port) |
void | deleteExternalPort (FUExternalPort *port) |
int | architecturePortCount () const |
int | externalPortCount () const |
FUPortImplementation & | architecturePort (int index) const |
FUPortImplementation & | portImplementationByArchitectureName (const std::string &architectureName) const |
FUExternalPort & | externalPort (int index) const |
void | addParameter (const std::string &name, const std::string &type, const std::string &value) |
void | removeParameter (const std::string &name) |
int | parameterCount () const |
Parameter | parameter (int index) const |
bool | hasParameter (const std::string &name) const |
Public Member Functions inherited from HDB::HWBlockImplementation | |
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 |
BlockImplementationFile & | file (int index) const |
Private Types | |
typedef std::vector< FUPortImplementation * > | PortTable |
Vector type for FUPortImplementation. More... | |
typedef std::vector< FUExternalPort * > | ExternalPortTable |
Vector type for FUExternalPort. More... | |
typedef std::map< std::string, int > | OpcodeMap |
Map type for operation codes. More... | |
typedef std::vector< Parameter > | ParameterTable |
Vector type for parameter names. More... | |
Private Attributes | |
std::string | opcodePort_ |
Name of the opcode port. More... | |
std::string | glockReqPort_ |
Name of the global lock request port. More... | |
PortTable | ports_ |
Contains the architectural ports. More... | |
ExternalPortTable | externalPorts_ |
Contains the external ports. More... | |
OpcodeMap | opcodes_ |
Contains the operation codes. More... | |
ParameterTable | parameters_ |
Contains the parameters. More... | |
Represents the implementation specific properties of an FU in HDB.
Definition at line 53 of file FUImplementation.hh.
|
private |
Vector type for FUExternalPort.
Definition at line 112 of file FUImplementation.hh.
|
private |
Map type for operation codes.
Definition at line 114 of file FUImplementation.hh.
Parameter of FU implementation.
Definition at line 61 of file FUImplementation.hh.
|
private |
Vector type for parameter names.
Definition at line 116 of file FUImplementation.hh.
|
private |
Vector type for FUPortImplementation.
Definition at line 110 of file FUImplementation.hh.
HDB::FUImplementation::FUImplementation | ( | const std::string & | name, |
const std::string & | opcodePort, | ||
const std::string & | clkPort, | ||
const std::string & | rstPort, | ||
const std::string & | glockPort, | ||
const std::string & | glockReqPort | ||
) |
The constructor.
name | Name of the module. |
opcodePort | Name of the opcode port. |
clkPort | Name of the clock port. |
rstPort | Name of the reset port. |
glockPort | Name of the global lock port. |
glockReqPort | Name of the global lock request port. |
Definition at line 62 of file FUImplementation.cc.
|
virtual |
The destructor.
Deletes all the ports.
Definition at line 113 of file FUImplementation.cc.
References SequenceTools::deleteAllItems(), externalPorts_, and ports_.
HDB::FUImplementation::FUImplementation | ( | const FUImplementation & | original | ) |
Copy constructor.
original | FUImplementation to copy. |
Definition at line 79 of file FUImplementation.cc.
References addArchitecturePort(), addExternalPort(), architecturePort(), architecturePortCount(), externalPort(), externalPortCount(), glockReqPort_, opcodePort_, opcodes_, and parameters_.
void HDB::FUImplementation::addArchitecturePort | ( | FUPortImplementation * | port | ) |
Adds the given architectural port.
port | The port to be added. |
Definition at line 274 of file FUImplementation.cc.
References ports_.
Referenced by FUImplementation(), and HDB::FUPortImplementation::FUPortImplementation().
void HDB::FUImplementation::addExternalPort | ( | FUExternalPort * | port | ) |
Adds the given external port.
port | The port to be added. |
Definition at line 300 of file FUImplementation.cc.
References externalPorts_.
Referenced by HDB::FUExternalPort::FUExternalPort(), and FUImplementation().
void HDB::FUImplementation::addParameter | ( | const std::string & | name, |
const std::string & | type, | ||
const std::string & | value | ||
) |
Adds the given parameter for the implementation.
name | Name of the parameter. |
type | Type of the parameter. |
value | Value of the parameter. |
IllegalParameters | If the FU implementation contains a parameter with the same name already. |
Definition at line 409 of file FUImplementation.cc.
References __func__, hasParameter(), and parameters_.
FUPortImplementation & HDB::FUImplementation::architecturePort | ( | int | index | ) | const |
Returns the architectural port implementation at the given position.
index | The position index. |
OutOfRange | If the given index is negative or not smaller the number of architectural ports. |
Definition at line 351 of file FUImplementation.cc.
References architecturePortCount(), and ports_.
Referenced by HDB::HDBManager::addFUImplementation(), ProGe::NetlistGenerator::addFUToNetlist(), FUTestbenchGenerator::createTbInstantiation(), FUImplementation(), HDBToHtml::fuImplToHtml(), ProGe::NetlistGenerator::isParameterizable(), and portImplementationByArchitectureName().
int HDB::FUImplementation::architecturePortCount | ( | ) | const |
Returns the number of architectural ports.
Definition at line 326 of file FUImplementation.cc.
References ports_.
Referenced by HDB::HDBManager::addFUImplementation(), ProGe::NetlistGenerator::addFUToNetlist(), architecturePort(), FUTestbenchGenerator::createTbInstantiation(), ImplementationTester::fuHasOnePort(), FUImplementation(), HDBToHtml::fuImplToHtml(), ProGe::NetlistGenerator::isParameterizable(), and portImplementationByArchitectureName().
void HDB::FUImplementation::deleteArchitecturePort | ( | FUPortImplementation * | port | ) |
Deletes the given architectural port.
port | The port to delete. |
InstanceNotFound | If the given port is not in this FU implementation. |
Definition at line 287 of file FUImplementation.cc.
References __func__, ContainerTools::deleteValueIfExists(), and ports_.
void HDB::FUImplementation::deleteExternalPort | ( | FUExternalPort * | port | ) |
Deletes the given external port.
port | The port to delete. |
InstanceNotFound | If the given port is not in this FU implementation. |
Definition at line 313 of file FUImplementation.cc.
References __func__, ContainerTools::deleteValueIfExists(), and externalPorts_.
FUExternalPort & HDB::FUImplementation::externalPort | ( | int | index | ) | const |
Returns the external port at the given position.
index | The position index. |
OutOfRange | If the given index is negative or not smaller the number of external ports. |
Definition at line 390 of file FUImplementation.cc.
References externalPortCount(), and externalPorts_.
Referenced by ProGe::NetlistGenerator::addFUExternalPortsToNetlist(), HDB::HDBManager::addFUImplementation(), FUImplementation(), HDBToHtml::fuImplToHtml(), and ProGeTestBenchGenerator::generate().
int HDB::FUImplementation::externalPortCount | ( | ) | const |
Returns the number of external ports.
Definition at line 337 of file FUImplementation.cc.
References externalPorts_.
Referenced by ProGe::NetlistGenerator::addFUExternalPortsToNetlist(), HDB::HDBManager::addFUImplementation(), externalPort(), ImplementationTester::fuHasExternalPorts(), FUImplementation(), HDBToHtml::fuImplToHtml(), and ProGeTestBenchGenerator::generate().
std::string HDB::FUImplementation::glockReqPort | ( | ) | const |
Returns the name of the global lock request port.
Definition at line 157 of file FUImplementation.cc.
References glockReqPort_.
Referenced by HDB::HDBManager::addFUImplementation(), ProGe::NetlistGenerator::addFUToNetlist(), and HDBToHtml::fuImplToHtml().
bool HDB::FUImplementation::hasOpcode | ( | const std::string & | operation | ) | const |
Tells whether there is an opcode defined for the given operation.
operation | Name of the operation. |
Definition at line 227 of file FUImplementation.cc.
References MapTools::containsKey(), opcodes_, and StringTools::stringToUpper().
Referenced by HDB::HDBManager::addFUImplementation().
bool HDB::FUImplementation::hasParameter | ( | const std::string & | name | ) | const |
Tells whether the implementation has the given parameter.
name | Name of the parameter. |
Definition at line 472 of file FUImplementation.cc.
References parameters_.
Referenced by addParameter().
int HDB::FUImplementation::maxOpcodeWidth | ( | ) | const |
Returns the maximum bitwidth of an opcode in this FU implementation.
The bitwidth is not stored explicitly in HDB, this method is provided only for convenience.
Definition at line 257 of file FUImplementation.cc.
References opcodes_, and MathTools::requiredBits().
Referenced by FUTestbenchGenerator::createStimulusArrays(), and FUTestbenchGenerator::createTbInstantiation().
int HDB::FUImplementation::opcode | ( | const std::string & | operation | ) | const |
Returns the opcode of the given operation.
operation | The operation. |
KeyNotFound | If there is no opcode defined for the given operation. |
Definition at line 242 of file FUImplementation.cc.
References opcodes_, and StringTools::stringToUpper().
Referenced by HDB::HDBManager::addFUImplementation(), FUTestbenchGenerator::createStimulusArrays(), HDBToHtml::fuImplToHtml(), and setOpcode().
int HDB::FUImplementation::opcodeCount | ( | ) | const |
Returns the number of opcodes in the FU.
Definition at line 194 of file FUImplementation.cc.
References opcodes_.
Referenced by HDBToHtml::fuImplToHtml(), and opcodeOperation().
std::string HDB::FUImplementation::opcodeOperation | ( | int | index | ) | const |
By the given index, returns an operation that has an opcode.
index | The index. |
OutOfRange | If the given index is negative or not smaller than the number of opcodes. |
Definition at line 207 of file FUImplementation.cc.
References __func__, opcodeCount(), and opcodes_.
Referenced by HDBToHtml::fuImplToHtml().
std::string HDB::FUImplementation::opcodePort | ( | ) | const |
Returns the name of the opcode port.
Definition at line 135 of file FUImplementation.cc.
References opcodePort_.
Referenced by HDB::HDBManager::addFUImplementation(), ProGe::NetlistGenerator::addFUToNetlist(), FUTestbenchGenerator::createStimulusArrays(), FUTestbenchGenerator::createTbCode(), FUTestbenchGenerator::createTbInstantiation(), and HDBToHtml::fuImplToHtml().
FUImplementation::Parameter HDB::FUImplementation::parameter | ( | int | index | ) | const |
Returns a parameter by the given index.
index | The index. |
OutOfRange | If the index is negative or not smaller than the number of parameters. |
Definition at line 457 of file FUImplementation.cc.
References __func__, parameterCount(), and parameters_.
Referenced by HDB::HDBManager::addFUImplementation(), ProGe::NetlistGenerator::addFUToNetlist(), HDBToHtml::fuImplToHtml(), and ProGeTestBenchGenerator::generate().
int HDB::FUImplementation::parameterCount | ( | ) | const |
Returns the number of parameters.
Definition at line 443 of file FUImplementation.cc.
References parameters_.
Referenced by HDB::HDBManager::addFUImplementation(), ProGe::NetlistGenerator::addFUToNetlist(), HDBToHtml::fuImplToHtml(), ProGeTestBenchGenerator::generate(), and parameter().
FUPortImplementation & HDB::FUImplementation::portImplementationByArchitectureName | ( | const std::string & | architectureName | ) | const |
Returns the implementation of a port for the given port architecture name.
architectureName | Name of the port in architecture table. |
InstanceNotFound | If no port with the given architecture name is found. |
Definition at line 370 of file FUImplementation.cc.
References __func__, architecturePort(), architecturePortCount(), and ports_.
Referenced by FUTestbenchGenerator::createStimulusArrays(), and FUTestbenchGenerator::createTbCode().
void HDB::FUImplementation::removeParameter | ( | const std::string & | name | ) |
Removes the parameter of the given name.
name | Name of the parameter. |
Definition at line 426 of file FUImplementation.cc.
References parameters_.
void HDB::FUImplementation::setGlockReqPort | ( | const std::string & | name | ) |
Sets the name of the global lock request port.
name | Name of the port. |
Definition at line 146 of file FUImplementation.cc.
References glockReqPort_.
void HDB::FUImplementation::setOpcode | ( | const std::string & | operation, |
int | opcode | ||
) |
Sets operation code for the given operation.
operation | Name of the operation. |
opcode | The operation code. |
Definition at line 169 of file FUImplementation.cc.
References opcode(), opcodes_, StringTools::stringToUpper(), and unsetOpcode().
void HDB::FUImplementation::setOpcodePort | ( | const std::string & | name | ) |
Sets the name of the opcode port.
name | Name of the port. |
Definition at line 124 of file FUImplementation.cc.
References opcodePort_.
void HDB::FUImplementation::unsetOpcode | ( | const std::string & | operation | ) |
Unsets the opcode of the given operation.
operation | Name of the operation. |
Definition at line 182 of file FUImplementation.cc.
References opcodes_, and StringTools::stringToUpper().
Referenced by setOpcode().
|
private |
Contains the external ports.
Definition at line 126 of file FUImplementation.hh.
Referenced by addExternalPort(), deleteExternalPort(), externalPort(), externalPortCount(), and ~FUImplementation().
|
private |
Name of the global lock request port.
Definition at line 121 of file FUImplementation.hh.
Referenced by FUImplementation(), glockReqPort(), and setGlockReqPort().
|
private |
Name of the opcode port.
Definition at line 119 of file FUImplementation.hh.
Referenced by FUImplementation(), opcodePort(), and setOpcodePort().
|
private |
Contains the operation codes.
Definition at line 128 of file FUImplementation.hh.
Referenced by FUImplementation(), hasOpcode(), maxOpcodeWidth(), opcode(), opcodeCount(), opcodeOperation(), setOpcode(), and unsetOpcode().
|
private |
Contains the parameters.
Definition at line 130 of file FUImplementation.hh.
Referenced by addParameter(), FUImplementation(), hasParameter(), parameter(), parameterCount(), and removeParameter().
|
private |
Contains the architectural ports.
Definition at line 124 of file FUImplementation.hh.
Referenced by addArchitecturePort(), architecturePort(), architecturePortCount(), deleteArchitecturePort(), portImplementationByArchitectureName(), and ~FUImplementation().