OpenASIP
2.0
|
#include <BitVector.hh>
Public Member Functions | |
BitVector () | |
BitVector (const BitVector &vector, unsigned int firstIndex, unsigned int lastIndex) | |
virtual | ~BitVector () |
void | pushBack (long long unsigned int integer, int size) |
void | pushBack (const BitVector &bits) |
void | pushBack (bool bit) |
std::string | toString () const |
BitVector is a specialization of STL's bit vector. It provides some handy helper methods.
Definition at line 44 of file BitVector.hh.
BitVector::BitVector | ( | ) |
BitVector::BitVector | ( | const BitVector & | vector, |
unsigned int | firstIndex, | ||
unsigned int | lastIndex | ||
) |
The constructor.
Creates a bit vector that is a sub vector of the given vector.
vector | The bit vector. |
firstIndex | The index of the given vector that is to be the first element in the created vector. |
lastIndex | The index of the given vector that is to be that last element in the created vector. |
OutOfRange | If the given indexes are too big or too small. |
Definition at line 60 of file BitVector.cc.
References assert.
|
virtual |
void BitVector::pushBack | ( | bool | bit | ) |
Pushes back the given bit.
bit | The bit to be added. |
Definition at line 120 of file BitVector.cc.
void BitVector::pushBack | ( | const BitVector & | bits | ) |
Pushes back the given bit vector.
bits | The bit vector. |
Definition at line 107 of file BitVector.cc.
void BitVector::pushBack | ( | long long unsigned int | integer, |
int | size | ||
) |
Pushes back the given number and increases the size of the vector by the given amount.
For example, if number 6 (110) is added with size 5, bits 00110 are concatenated to the vector. If size 2 is given, then bits 10 are concatenated to the vector.
integer | The number to be added. |
size | The number of bits to be added. |
Definition at line 94 of file BitVector.cc.
References MathTools::bit().
Referenced by CodeCompressorPlugin::addBitsForDstRegisterField(), CodeCompressorPlugin::addBitsForGuardField(), CodeCompressorPlugin::addBitsForICField(), CodeCompressorPlugin::addBitsForImmediateSlot(), MoveSlotDictionary::addInstructions(), CodeCompressorPlugin::encodeFUTerminal(), CodeCompressorPlugin::encodeIUTerminal(), CodeCompressorPlugin::encodeNOP(), CodeCompressorPlugin::encodeRFTerminal(), CodeCompressorPlugin::encodeSlotField(), ProGe::RV32MicroCodeGenerator::initializeOperations(), InstructionBitVector::pushBack(), CodeCompressorPlugin::socketCodeBits(), and ProgramImageGenerator::writeDataSection().
std::string BitVector::toString | ( | ) | const |
Converts BitVector to std::string format
Definition at line 130 of file BitVector.cc.
Referenced by ProGe::RV32MicroCodeGenerator::generateNOP(), and ProGe::RV32MicroCodeGenerator::initializeOperations().