|
OpenASIP 2.2
|


Public Member Functions | |
| MoveSlotDictionary () | |
| ~MoveSlotDictionary () | |
| virtual InstructionBitVector * | compress (const string &programName) |
| virtual void | generateDecompressor (std::ostream &stream, TCEString entityStr) |
| virtual void | printDescription (std::ostream &stream) |
Public Member Functions inherited from CodeCompressorPlugin | |
| virtual | ~CodeCompressorPlugin () |
| void | setParameters (ParameterTable parameters) |
| void | setPrograms (std::map< std::string, TPEF::Binary * > &programs) |
| void | setMachine (const TTAMachine::Machine &machine) |
| void | setBEM (const BinaryEncoding &bem) |
| const BinaryEncoding & | binaryEncoding () const |
| const TTAMachine::Machine & | machine () const |
| unsigned int | memoryAddress (const TTAProgram::Instruction &instruction) const |
| TTAProgram::Program & | currentProgram () const |
| int | imemMauWidth () const |
| InstructionBitVector * | bemInstructionBits (const TTAProgram::Instruction &) |
Private Types | |
| typedef std::map< BitVector, unsigned int > | Dictionary |
| Map type for dictionary. | |
Private Member Functions | |
| void | createDictionary () |
| void | updateDictionary (const Program &program) |
| void | addToDictionary (const BitVector &instructionBits, int slotIndex) |
| void | addInstructions () |
| void | generateDictionaryVhdl (std::ostream &stream, TCEString entityStr) |
| void | generateDecompressorEntity (std::ostream &stream, TCEString entityStr) |
| void | generateDecompressorArchitecture (std::ostream &stream, TCEString entityStr) |
| void | generateDecompressorSignals (std::ostream &stream, bool &haveLimm) |
| void | generateDecompressorBody (std::ostream &stream, bool &haveLimm) |
| void | evaluateMoveSlotBoundaries (vector< pair< int, int > > &boundaries) |
| void | generateDecompressorProcess (std::ostream &stream, bool &haveLimm) |
| void | printDetails () |
Private Attributes | |
| vector< Dictionary * > | dictionary_ |
| The dictionary. | |
| bool | dictionaryCreated_ |
| Indicates whether the dictionary has been created. | |
| unsigned int | compressedWidth_ |
| Total width of compressed instruction (limm fields + move slots) | |
Additional Inherited Members | |
Public Types inherited from CodeCompressorPlugin | |
| typedef std::vector< Parameter > | ParameterTable |
| Table for passing plugin parameters. | |
Protected Types inherited from CodeCompressorPlugin | |
| typedef std::map< std::string, TPEF::Binary * > | TPEFMap |
| Map type for handling programs. | |
Protected Member Functions inherited from CodeCompressorPlugin | |
| CodeCompressorPlugin () | |
| InstructionBitVector * | bemBits (const TTAProgram::Program &program) |
| int | moveSlotCount () const |
| int | moveSlotWidth (int index) const |
| int | firstMoveSlotIndex () const |
| void | startNewProgram (const std::string &programName) |
| void | addInstruction (const TTAProgram::Instruction &instruction, InstructionBitVector *bits) |
| void | setInstructionToStartAtBeginningOfMAU (const TTAProgram::Instruction &instruction) |
| void | setAllInstructionsToStartAtBeginningOfMAU () |
| InstructionBitVector * | programBits () const |
| bool | hasParameter (const std::string ¶mName) const |
| std::string | parameterValue (const std::string ¶mName) const |
| void | setImemWidth (int mau, int widthInMaus=1) |
| int | numberOfPrograms () const |
| TPEFMap::const_iterator | programElement (int index) const |
| std::string | indentation (int level) |
Definition at line 72 of file MoveSlotDictionary.cc.
|
private |
Map type for dictionary.
Definition at line 504 of file MoveSlotDictionary.cc.
|
inline |
The constructor
Definition at line 78 of file MoveSlotDictionary.cc.
|
inline |
The destructor
Definition at line 85 of file MoveSlotDictionary.cc.
References dictionary_.
|
inlineprivate |
Adds the compressed instructions to the program.
Definition at line 220 of file MoveSlotDictionary.cc.
References CodeCompressorPlugin::addInstruction(), CodeCompressorPlugin::bemBits(), CodeCompressorPlugin::bemInstructionBits(), CodeCompressorPlugin::currentProgram(), dictionary_, TTAProgram::Program::firstInstruction(), CodeCompressorPlugin::firstMoveSlotIndex(), MapTools::keyForValue(), CodeCompressorPlugin::moveSlotCount(), CodeCompressorPlugin::moveSlotWidth(), TTAProgram::Program::nextInstruction(), BitVector::pushBack(), and MathTools::requiredBits().
Referenced by compress().

|
inlineprivate |
Adds the given instruction bits to the move slot dictionary.
| instructionBits | The instruction bits to add. |
| slotIndex | Index of the move slot |
Definition at line 207 of file MoveSlotDictionary.cc.
References MapTools::containsKey(), and dictionary_.
Referenced by updateDictionary().

|
inlinevirtual |
Creates compressed code of the program and returns it in bit vector
Implements CodeCompressorPlugin.
Definition at line 97 of file MoveSlotDictionary.cc.
References addInstructions(), compressedWidth_, createDictionary(), dictionary_, dictionaryCreated_, CodeCompressorPlugin::firstMoveSlotIndex(), printDetails(), CodeCompressorPlugin::programBits(), MathTools::requiredBits(), CodeCompressorPlugin::setAllInstructionsToStartAtBeginningOfMAU(), CodeCompressorPlugin::setImemWidth(), CodeCompressorPlugin::startNewProgram(), and Application::verboseLevel().

|
inlineprivate |
Creates the whole dictionary
Definition at line 162 of file MoveSlotDictionary.cc.
References CodeCompressorPlugin::currentProgram(), dictionary_, dictionaryCreated_, CodeCompressorPlugin::moveSlotCount(), CodeCompressorPlugin::numberOfPrograms(), CodeCompressorPlugin::programElement(), CodeCompressorPlugin::setAllInstructionsToStartAtBeginningOfMAU(), CodeCompressorPlugin::startNewProgram(), and updateDictionary().
Referenced by compress().

|
inlineprivate |
Definition at line 424 of file MoveSlotDictionary.cc.
References dictionary_, CodeCompressorPlugin::firstMoveSlotIndex(), CodeCompressorPlugin::moveSlotCount(), and MathTools::requiredBits().
Referenced by generateDecompressorBody().

|
inlinevirtual |
Generates the decompressor in VHDL.
Note! The programs must be compressed by compress method before calling this method.
| stream | The stream to write. |
Implements CodeCompressorPlugin.
Definition at line 131 of file MoveSlotDictionary.cc.
References generateDecompressorArchitecture(), generateDecompressorEntity(), and generateDictionaryVhdl().

|
inlineprivate |
Definition at line 340 of file MoveSlotDictionary.cc.
References generateDecompressorBody(), and generateDecompressorSignals().
Referenced by generateDecompressor().

|
inlineprivate |
Definition at line 391 of file MoveSlotDictionary.cc.
References dictionary_, evaluateMoveSlotBoundaries(), CodeCompressorPlugin::firstMoveSlotIndex(), generateDecompressorProcess(), CodeCompressorPlugin::indentation(), and CodeCompressorPlugin::moveSlotCount().
Referenced by generateDecompressorArchitecture().

|
inlineprivate |
Definition at line 314 of file MoveSlotDictionary.cc.
References CodeCompressorPlugin::indentation().
Referenced by generateDecompressor().

|
inlineprivate |
Definition at line 439 of file MoveSlotDictionary.cc.
References dictionary_, CodeCompressorPlugin::indentation(), and CodeCompressorPlugin::moveSlotCount().
Referenced by generateDecompressorBody().

|
inlineprivate |
Definition at line 353 of file MoveSlotDictionary.cc.
References dictionary_, CodeCompressorPlugin::firstMoveSlotIndex(), CodeCompressorPlugin::indentation(), CodeCompressorPlugin::moveSlotCount(), and CodeCompressorPlugin::moveSlotWidth().
Referenced by generateDecompressorArchitecture().

|
inlineprivate |
Definition at line 257 of file MoveSlotDictionary.cc.
References dictionary_, CodeCompressorPlugin::indentation(), MapTools::keyForValue(), CodeCompressorPlugin::moveSlotCount(), CodeCompressorPlugin::moveSlotWidth(), and AsciiImageWriter::writeImage().
Referenced by generateDecompressor().

|
inlinevirtual |
Prints the description of the plugin to the given stream.
| stream | The stream. |
Implements CodeCompressorPlugin.
Definition at line 143 of file MoveSlotDictionary.cc.
|
inlineprivate |
Definition at line 473 of file MoveSlotDictionary.cc.
References CodeCompressorPlugin::binaryEncoding(), compressedWidth_, dictionary_, Application::logStream(), MathTools::requiredBits(), and BinaryEncoding::width().
Referenced by compress().

|
inlineprivate |
Creates dictionary for one program.
Definition at line 182 of file MoveSlotDictionary.cc.
References addToDictionary(), CodeCompressorPlugin::bemInstructionBits(), CodeCompressorPlugin::firstMoveSlotIndex(), CodeCompressorPlugin::moveSlotCount(), CodeCompressorPlugin::moveSlotWidth(), and program.
Referenced by createDictionary().

|
private |
Total width of compressed instruction (limm fields + move slots)
Definition at line 513 of file MoveSlotDictionary.cc.
Referenced by compress(), and printDetails().
|
private |
The dictionary.
Definition at line 507 of file MoveSlotDictionary.cc.
Referenced by addInstructions(), addToDictionary(), compress(), createDictionary(), evaluateMoveSlotBoundaries(), generateDecompressorBody(), generateDecompressorProcess(), generateDecompressorSignals(), generateDictionaryVhdl(), printDetails(), and ~MoveSlotDictionary().
|
private |
Indicates whether the dictionary has been created.
Definition at line 510 of file MoveSlotDictionary.cc.
Referenced by compress(), and createDictionary().