OpenASIP
2.0
|
Public Member Functions | |
InstructionDictionary () | |
virtual InstructionBitVector * | compress (const std::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. More... | |
Private Member Functions | |
void | createDictionary () |
void | addToDictionary (const BitVector &instructionBits) |
void | updateDictionary (const Program &program) |
void | addInstructions () |
Private Attributes | |
Dictionary | dictionary_ |
The dictionary. More... | |
bool | compatibilityProgDone_ |
Indicates whether the compatibility program is in dictionary. More... | |
bool | dictionaryCreated_ |
Indicates whether the whole dictionary has been created. More... | |
Additional Inherited Members | |
Public Types inherited from CodeCompressorPlugin | |
typedef std::vector< Parameter > | ParameterTable |
Table for passing plugin parameters. More... | |
Protected Types inherited from CodeCompressorPlugin | |
typedef std::map< std::string, TPEF::Binary * > | TPEFMap |
Map type for handling programs. More... | |
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) |
Implements a simple instruction based dictionary compression scheme.
Definition at line 78 of file InstructionDictionary.cc.
|
private |
Map type for dictionary.
Definition at line 251 of file InstructionDictionary.cc.
|
inline |
The constructor.
Definition at line 84 of file InstructionDictionary.cc.
|
inlineprivate |
Adds the compressed instructions to the program.
Definition at line 315 of file InstructionDictionary.cc.
References MathTools::requiredBits().
|
inlineprivate |
Adds the given instruction bits to the dictionary.
instructionBits | The instruction bits to add. |
Definition at line 287 of file InstructionDictionary.cc.
References MapTools::containsKey().
|
inlinevirtual |
Creates the compressed code and returns the bit vector of it.
Implements CodeCompressorPlugin.
Definition at line 94 of file InstructionDictionary.cc.
References __func__, assert, TTAProgram::TPEFProgramFactory::build(), ENSURE_PROGRAMMABILITY, Exception::errorMessage(), machine, ProgrammabilityValidator::profile(), MathTools::requiredBits(), and YES.
|
inlineprivate |
Creates the whole dictionary
Definition at line 258 of file InstructionDictionary.cc.
References Application::logStream(), MathTools::requiredBits(), and Application::verboseLevel().
|
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 141 of file InstructionDictionary.cc.
References MathTools::requiredBits(), and AsciiImageWriter::writeImage().
|
inlinevirtual |
Prints the description of the plugin to the given stream.
stream | The stream. |
Implements CodeCompressorPlugin.
Definition at line 230 of file InstructionDictionary.cc.
|
inlineprivate |
Creates the dictionary.
Definition at line 300 of file InstructionDictionary.cc.
References program.
|
private |
Indicates whether the compatibility program is in dictionary.
Definition at line 337 of file InstructionDictionary.cc.
|
private |
The dictionary.
Definition at line 335 of file InstructionDictionary.cc.
|
private |
Indicates whether the whole dictionary has been created.
Definition at line 339 of file InstructionDictionary.cc.