OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Types | Private Attributes | List of all members
ProGe::ICDecoderGeneratorPlugin Class Referenceabstract

#include <ICDecoderGeneratorPlugin.hh>

Inheritance diagram for ProGe::ICDecoderGeneratorPlugin:
Inheritance graph
Collaboration diagram for ProGe::ICDecoderGeneratorPlugin:
Collaboration graph

Public Member Functions

 ICDecoderGeneratorPlugin (const TTAMachine::Machine &machine, const BinaryEncoding &bem, const std::string &description)
 
virtual ~ICDecoderGeneratorPlugin ()
 
virtual void completeNetlist (NetlistBlock &netlistBlock, const NetlistGenerator &generator)=0
 
virtual void generate (HDL language, const std::string &destinationDirectory, const NetlistGenerator &generator, const IDF::MachineImplementation &implementation, const std::string &entityString)=0
 
virtual std::set< int > requiredRFLatencies (const TTAMachine::ImmediateUnit &iu) const =0
 
virtual void verifyCompatibility () const =0
 
virtual void writeGlobalDefinitions (HDL language, std::ostream &pkgStream) const =0
 
std::string pluginDescription () const
 
int recognizedParameterCount () const
 
std::string recognizedParameter (int index) const
 
std::string parameterDescription (const std::string &paramName) const
 
void setParameter (const std::string &name, const std::string &value)
 
const TTAMachine::Machinemachine () const
 
const BinaryEncodingbem () const
 
virtual void readParameters ()=0
 

Protected Member Functions

void addParameter (const std::string &name, const std::string &description)
 
bool hasParameterSet (const std::string &name) const
 
std::string parameterValue (const std::string &name) const
 

Static Protected Member Functions

static TTAMachine::Socket::Direction convertDirection (HDB::Direction direction)
 

Private Types

typedef std::map< std::string, std::string > StringMap
 Map type for strings.
 

Private Attributes

const TTAMachine::Machinemachine_
 The machine to generate.
 
const BinaryEncodingbem_
 The binary encoding map.
 
StringMap parameterValues_
 Parameters set.
 
StringMap parameterDescriptions_
 Parameter descriptions.
 
std::string description_
 Description of the plugin.
 

Detailed Description

Base class for plugins that are able to generate and IC and decoder.

Todo:
Add rest of the methods.

Definition at line 68 of file ICDecoderGeneratorPlugin.hh.

Member Typedef Documentation

◆ StringMap

typedef std::map<std::string, std::string> ProGe::ICDecoderGeneratorPlugin::StringMap
private

Map type for strings.

Definition at line 151 of file ICDecoderGeneratorPlugin.hh.

Constructor & Destructor Documentation

◆ ICDecoderGeneratorPlugin()

ProGe::ICDecoderGeneratorPlugin::ICDecoderGeneratorPlugin ( const TTAMachine::Machine machine,
const BinaryEncoding bem,
const std::string &  description 
)

Constructor.

Parameters
machineThe machine to generate the IC&decoder for.

Definition at line 48 of file ICDecoderGeneratorPlugin.cc.

51 :
52 machine_(machine), bem_(bem), description_(description) {
53
54}
const BinaryEncoding & bem() const
const BinaryEncoding & bem_
The binary encoding map.
std::string description_
Description of the plugin.
const TTAMachine::Machine & machine() const
const TTAMachine::Machine & machine_
The machine to generate.

◆ ~ICDecoderGeneratorPlugin()

ProGe::ICDecoderGeneratorPlugin::~ICDecoderGeneratorPlugin ( )
virtual

Destructor.

Definition at line 60 of file ICDecoderGeneratorPlugin.cc.

60 {
61}

Member Function Documentation

◆ addParameter()

void ProGe::ICDecoderGeneratorPlugin::addParameter ( const std::string &  name,
const std::string &  description 
)
protected

Adds the given parameter to the set of recognized parameters.

Parameters
nameName of the parameter.
descriptionDescription of the parameter.

Definition at line 159 of file ICDecoderGeneratorPlugin.cc.

161 {
162
163 parameterDescriptions_.erase(name);
165 std::pair<string, string>(name, description));
166}
StringMap parameterDescriptions_
Parameter descriptions.

References parameterDescriptions_.

Referenced by DefaultICDecoderGenerator::DefaultICDecoderGenerator().

◆ bem()

const BinaryEncoding & ProGe::ICDecoderGeneratorPlugin::bem ( ) const

Returns the binary encoding map.

Returns
The binary encoding map.

Definition at line 214 of file ICDecoderGeneratorPlugin.cc.

214 {
215 return bem_;
216}

References bem_.

Referenced by DefaultICDecoderGenerator::DefaultICDecoderGenerator(), and DefaultICDecoderGenerator::writeGlobalDefinitions().

◆ completeNetlist()

virtual void ProGe::ICDecoderGeneratorPlugin::completeNetlist ( NetlistBlock netlistBlock,
const NetlistGenerator generator 
)
pure virtual

Completes the given netlist block by adding IC block and completing the decoder block by adding the ports connected to IC. Connects also IC to all the units in the machine.

Parameters
coreBlockThe netlist block to complete.
generatorThe netlist generator which generated the netlist.

Implemented in DefaultICDecoderGenerator.

Referenced by ProGe::NetlistGenerator::generate().

◆ convertDirection()

static TTAMachine::Socket::Direction ProGe::ICDecoderGeneratorPlugin::convertDirection ( HDB::Direction  direction)
staticprotected

◆ generate()

virtual void ProGe::ICDecoderGeneratorPlugin::generate ( HDL  language,
const std::string &  destinationDirectory,
const NetlistGenerator generator,
const IDF::MachineImplementation implementation,
const std::string &  entityString 
)
pure virtual

Generates the interconnection network and instruction decoder to the given destination directory.

Parameters
destinationDirectoryThe destination directory.
generatorThe netlist generator that generated the netlist block.

Implemented in DefaultICDecoderGenerator.

Referenced by ProGe::ProcessorGenerator::generateProcessor().

◆ hasParameterSet()

bool ProGe::ICDecoderGeneratorPlugin::hasParameterSet ( const std::string &  name) const
protected

Tells whether the plugin has the given parameter set.

Parameters
nameName of the parameter.
Returns
True if the given parameter is set, otherwise false.

Definition at line 176 of file ICDecoderGeneratorPlugin.cc.

176 {
178}
static bool containsKey(const MapType &aMap, const KeyType &aKey)

References MapTools::containsKey(), and parameterValues_.

Referenced by DefaultICDecoderGenerator::busTraceStartingCycle(), DefaultICDecoderGenerator::bypassInstructionRegister(), DefaultICDecoderGenerator::generateBusTrace(), DefaultICDecoderGenerator::generateDebugger(), DefaultICDecoderGenerator::generateLockTrace(), DefaultICDecoderGenerator::generateNoSelfLockingFUs(), DefaultICDecoderGenerator::hasSynchronousReset(), DefaultICDecoderGenerator::lockTraceStartingCycle(), and parameterValue().

Here is the call graph for this function:

◆ machine()

const TTAMachine::Machine & ProGe::ICDecoderGeneratorPlugin::machine ( ) const

Returns the machine.

Returns
The machine.

Definition at line 203 of file ICDecoderGeneratorPlugin.cc.

203 {
204 return machine_;
205}

References machine_.

Referenced by DefaultICDecoderGenerator::DefaultICDecoderGenerator().

◆ parameterDescription()

std::string ProGe::ICDecoderGeneratorPlugin::parameterDescription ( const std::string &  paramName) const

Returns the description of the given parameter.

Parameters
paramNameName of the parameter.
Returns
The description of the parameter.
Exceptions
IllegalParameterIf the given parameter is unrecognized.

Definition at line 121 of file ICDecoderGeneratorPlugin.cc.

122 {
123 try {
125 parameterDescriptions_, paramName);
126 } catch (const KeyNotFound& e) {
127 throw IllegalParameters(
128 __FILE__, __LINE__, __func__, e.errorMessage());
129 }
130}
#define __func__
std::string errorMessage() const
Definition Exception.cc:123
static KeyType keyForValue(const MapType &aMap, const ValueType &aValue)

References __func__, Exception::errorMessage(), MapTools::keyForValue(), and parameterDescriptions_.

Referenced by ProcessorImplementationWindow::TransferDataToWindow().

Here is the call graph for this function:

◆ parameterValue()

std::string ProGe::ICDecoderGeneratorPlugin::parameterValue ( const std::string &  name) const
protected

◆ pluginDescription()

std::string ProGe::ICDecoderGeneratorPlugin::pluginDescription ( ) const

Returns the description of the plugin.

Returns
The description.

Definition at line 70 of file ICDecoderGeneratorPlugin.cc.

70 {
71 return description_;
72}

References description_.

Referenced by ProcessorImplementationWindow::TransferDataToWindow().

◆ readParameters()

virtual void ProGe::ICDecoderGeneratorPlugin::readParameters ( )
pure virtual

◆ recognizedParameter()

std::string ProGe::ICDecoderGeneratorPlugin::recognizedParameter ( int  index) const

Returns the name of a recognized parameter by the given index.

Parameters
indexThe index.
Returns
The name of the parameter.
Exceptions
OutOfRangeIf the given index is negative or not smaller than the number of recognized parameters.

Definition at line 95 of file ICDecoderGeneratorPlugin.cc.

95 {
96 if (index < 0 || index >= recognizedParameterCount()) {
97 throw OutOfRange(__FILE__, __LINE__, __func__);
98 }
99
100 int i = 0;
101 for (StringMap::const_iterator iter = parameterDescriptions_.begin();
102 iter != parameterDescriptions_.end(); iter++) {
103 if (i == index) {
104 return iter->first;
105 }
106 i++;
107 }
108
109 assert(false);
110 return "";
111}
#define assert(condition)

References __func__, assert, parameterDescriptions_, and recognizedParameterCount().

Referenced by ProcessorImplementationWindow::onSetParameterValue(), and ProcessorImplementationWindow::TransferDataToWindow().

Here is the call graph for this function:

◆ recognizedParameterCount()

int ProGe::ICDecoderGeneratorPlugin::recognizedParameterCount ( ) const

Returns the number of recognized parameters.

Returns
The number of recognized parameters.

Definition at line 81 of file ICDecoderGeneratorPlugin.cc.

81 {
82 return parameterDescriptions_.size();
83}

References parameterDescriptions_.

Referenced by recognizedParameter(), and ProcessorImplementationWindow::TransferDataToWindow().

◆ requiredRFLatencies()

virtual std::set< int > ProGe::ICDecoderGeneratorPlugin::requiredRFLatencies ( const TTAMachine::ImmediateUnit iu) const
pure virtual

Returns the set of acceptable latencies of the hardware implementation of the given immediate unit.

Parameters
iuThe immediate unit.

Implemented in DefaultICDecoderGenerator.

Referenced by ProGe::ProcessorGenerator::checkIULatencies().

◆ setParameter()

void ProGe::ICDecoderGeneratorPlugin::setParameter ( const std::string &  name,
const std::string &  value 
)

Sets the given parameter for the plugin.

Parameters
nameName of the parameter.
valueValue of the parameter.
Exceptions
IllegalParameterIf the given parameter is unrecognized.

Definition at line 140 of file ICDecoderGeneratorPlugin.cc.

141 {
143 string errorMsg = "Unrecognized IC/decoder plugin parameter: " +
144 name;
145 throw IllegalParameters(__FILE__, __LINE__, __func__, errorMsg);
146 }
147
148 parameterValues_.erase(name);
149 parameterValues_.insert(std::pair<string, string>(name, value));
150}

References __func__, MapTools::containsKey(), parameterDescriptions_, and parameterValues_.

Referenced by ProGe::ProGeUI::generateProcessor().

Here is the call graph for this function:

◆ verifyCompatibility()

virtual void ProGe::ICDecoderGeneratorPlugin::verifyCompatibility ( ) const
pure virtual

Verifies that the plugin is compatible with the machine.

Exceptions
InvalidDataIf the plugin is not compatible with the machine.

Implemented in DefaultICDecoderGenerator.

Referenced by ProGe::ProcessorGenerator::generateProcessor().

◆ writeGlobalDefinitions()

virtual void ProGe::ICDecoderGeneratorPlugin::writeGlobalDefinitions ( HDL  language,
std::ostream &  pkgStream 
) const
pure virtual

Returns global package definitions in the form of a stream specifically for the variable length instruction architecture.

Parameters
languageThe HDL to use.
pkgStreamThe destination stream

Implemented in DefaultICDecoderGenerator.

Referenced by ProGe::ProcessorGenerator::generateGlobalsPackage().

Member Data Documentation

◆ bem_

const BinaryEncoding& ProGe::ICDecoderGeneratorPlugin::bem_
private

The binary encoding map.

Definition at line 156 of file ICDecoderGeneratorPlugin.hh.

Referenced by bem().

◆ description_

std::string ProGe::ICDecoderGeneratorPlugin::description_
private

Description of the plugin.

Definition at line 162 of file ICDecoderGeneratorPlugin.hh.

Referenced by pluginDescription().

◆ machine_

const TTAMachine::Machine& ProGe::ICDecoderGeneratorPlugin::machine_
private

The machine to generate.

Definition at line 154 of file ICDecoderGeneratorPlugin.hh.

Referenced by machine().

◆ parameterDescriptions_

StringMap ProGe::ICDecoderGeneratorPlugin::parameterDescriptions_
private

◆ parameterValues_

StringMap ProGe::ICDecoderGeneratorPlugin::parameterValues_
private

Parameters set.

Definition at line 158 of file ICDecoderGeneratorPlugin.hh.

Referenced by hasParameterSet(), parameterValue(), and setParameter().


The documentation for this class was generated from the following files: