OpenASIP
2.0
|
#include <MathTools.hh>
Static Public Member Functions | |
static unsigned int | bitLength (long unsigned int number) |
static bool | bitFieldsEquals (unsigned enc1, unsigned pos1, unsigned enc2, unsigned pos2, unsigned width) |
static long unsigned int | concatenateBits (long unsigned int msbBitField, unsigned msbWidth, long unsigned int lsbBitField, unsigned lsbWidth) |
static int | ceil_log2 (long unsigned int number) |
template<typename NumberType > | |
static int | ceil_div (NumberType dividee, NumberType diveder) |
static int | requiredBits (unsigned long int number) |
static int | requiredBits0Bit0 (long unsigned int number) |
static int | requiredBitsSigned (SLongWord number) |
static int | requiredBitsSigned (int number) |
static int | requiredBitsSigned (UInt32 number) |
static int | requiredBitsSigned (ULongWord number) |
static SLongWord | signExtendTo (SLongWord value, int width) |
static ULongWord | zeroExtendTo (ULongWord value, int width) |
static SLongWord | fastSignExtendTo (SLongWord value, int width) |
static ULongWord | fastZeroExtendTo (ULongWord value, int width) |
template<class IntegerType > | |
static void | setBit (IntegerType &bits, unsigned int index, bool bitState=true) |
static int | random (int, int) |
static unsigned int | roundUpToPowerTwo (unsigned int number) |
static int | roundUpToPowerTwo (int number) |
static SLongWord | roundDownToPowerTwo (SLongWord number) |
static bool | isInPowerOfTwo (unsigned int number) |
template<typename ResultNumberTypeS , typename ResultNumberTypeU = ResultNumberTypeS> | |
static std::pair< ResultNumberTypeS, ResultNumberTypeU > | bitsToIntegerRange (unsigned bitWidth, bool signExtending) |
static bool | bit (ULongWord integer, unsigned int index) |
static ULongWord | roundDownToPowerTwo (ULongWord number) |
Definition at line 42 of file MathTools.hh.
|
static |
|
static |
|
static |
Referenced by BEMGenerator::addLongImmDstRegisterFields(), DefaultICGenerator::busControlWidth(), DefaultDecoderGenerator::busControlWidth(), BEMGenerator::calculateEncodings(), BEMTester::canAddComponentEncoding(), BEMTester::canAddPortEncoding(), BEMValidator::checkLImmDstRegisterFields(), BEMTester::commonBitCount(), DefaultICGenerator::dataControlWidth(), DefaultDecoderGenerator::dataControlWidth(), BEMTools::encodingWidth(), BEMTools::extrabits(), BEMGenerator::requiredIndexWidth(), DefaultDecoderGenerator::rfOpcodeWidth(), SocketEncoding::socketIDWidth(), PortCode::width(), Encoding::width(), ImmediateControlField::width(), GuardField::width(), and DefaultICGenerator::writeInputSocketComponentDeclaration().
|
static |
|
static |
|
static |
Referenced by TTAProgram::CodeGenerator::createForLoopBufferInit().
|
static |
Concatenates two bit fields together.
Example:
* concatenateBits(12, 4, 13, 3) * -> (0b1100, 0b1101) * -> 0b1100 + 0b101 * -> 0b1100101 *
Definition at line 47 of file MathTools.cc.
Referenced by SimValue::intValue(), SimValue::signExtendTo(), SimValue::sIntWordValue(), and SimValue::sLongWordValue().
Referenced by SimValue::unsignedValue(), and SimValue::zeroExtendTo().
|
static |
|
static |
Referenced by FileSystem::createTempDirectory().
|
static |
Referenced by ProGe::NetlistGenerator::addBaseRFToNetlist(), TTAProgram::Instruction::addImmediate(), ProGe::ProcessorWrapperBlock::addInstructionMemory(), MoveSlotDictionary::addInstructions(), InstructionDictionary::addInstructions(), TPEF::DataSection::addMAU(), StaticProgramAnalyzer::addProgram(), MachineInfo::canEncodeImmediateInteger(), ImmInfo::canTakeImmediate(), MachineValidator::checkIMemAddrWidth(), POMValidator::checkLongImmediates(), InstructionDictionary::compress(), MoveSlotDictionary::compress(), TTAProgram::ProgramWriter::createCodeSection(), InstructionDictionary::createDictionary(), OpsetDialog::createOperation(), VectorLSGenerator::createVectorLSU(), TTAProgram::DataDefinition::DataDefinition(), MoveSlotDictionary::evaluateMoveSlotBoundaries(), TPEF::TPEFRelocSectionReader::finalize(), CodeSectionCreator::finalize(), TTAProgram::TPEFProgramFactory::findInstrTemplate(), ITemplateBroker::findITemplates(), InstructionBitVector::fixBits(), FUGen::FUGen(), ProGe::CUOpcodeGenerator::gcuOpcodeWidth(), InstructionDictionary::generateDecompressor(), ProGe::ProcessorGenerator::iMemAddressWidth(), ProGe::NetlistGenerator::instructionMemoryAddressWidth(), HDB::FUImplementation::maxOpcodeWidth(), AddressSpaceDialog::onMaxAddress(), RFTestbenchGenerator::opcodePortWidth(), ProGe::NetlistGenerator::opcodePortWidth(), MoveSlotDictionary::printDetails(), SimProgramBuilder::processMove(), ProGe::ProGeUI::readImemParameters(), PlatformIntegrator::readLsuParameters(), MachineConnectivityCheck::requiredImmediateWidth(), SegmentFigure::SegmentFigure(), TTAProgram::Instruction::setInstructionTemplate(), DataSectionCreator::sizeInWords(), UnitPortFigure::UnitPortFigure(), and AddressSpacesDialog::updateASList().
|
static |
|
static |
|
static |
Referenced by TPEF::DataSection::addMAU(), FUGen::buildOperations(), MachineInfo::canEncodeImmediateInteger(), ImmInfo::canTakeImmediate(), POMValidator::checkLongImmediates(), TTAProgram::Program::convertSymbolRef(), TTAProgram::ProgramWriter::createCodeSection(), TTAProgram::CodeGenerator::createForLoopBufferInit(), TTAProgram::CodeGenerator::createWhileLoopBufferInit(), FUGen::DAGNodeOperandWidth(), TTAProgram::DataDefinition::DataDefinition(), TTAProgram::CodeGenerator::decrementRegisterAddress(), TTAProgram::TPEFProgramFactory::findInstrTemplate(), ITemplateBroker::findITemplates(), TTAProgram::CodeGenerator::incrementRegisterAddress(), SimProgramBuilder::processMove(), MachineConnectivityCheck::requiredImmediateWidth(), and DataSectionCreator::sizeInWords().
|
static |
|
static |
|
static |
|
static |
|
static |