OpenASIP
2.0
|
#include <MachineInfo.hh>
Public Types | |
typedef TCETools::CIStringSet | OperationSet |
typedef std::vector< const TTAMachine::FUPort * > | ConstPortList |
Private Member Functions | |
MachineInfo () | |
Static Private Member Functions | |
template<typename PortType > | |
static PortType & | portFromOperand (const TTAMachine::HWOperation &hwOp, const TTAMachine::FUPort &port) |
Static Private Attributes | |
static const TCEString | LOCK_READ_ = "lock_read" |
static const TCEString | TRY_LOCK_ADDR_ = "try_lock_addr" |
static const TCEString | UNLOCK_ADDR_ = "unlock_addr" |
Definition at line 58 of file MachineInfo.hh.
typedef std::vector<const TTAMachine::FUPort*> MachineInfo::ConstPortList |
Definition at line 61 of file MachineInfo.hh.
Definition at line 60 of file MachineInfo.hh.
|
private |
|
static |
Definition at line 390 of file MachineInfo.cc.
References TTAMachine::Bus::immediateWidth(), MathTools::requiredBits(), MathTools::requiredBitsSigned(), TTAMachine::Bus::signExtends(), and TTAMachine::Bus::width().
|
static |
Definition at line 465 of file MachineInfo.cc.
References MachineConnectivityCheck::appendConnectedDestinationBuses(), TTAMachine::Machine::immediateUnitNavigator(), TTAMachine::Component::machine(), MathTools::requiredBits(), MathTools::requiredBitsSigned(), and TTAMachine::InstructionTemplate::supportedWidth().
|
static |
Checks if the given immediate can be transferred at all in the given machine.
Takes in account the move slots' or the immediate unit's extension mode when considering the encoding of the given constant's bits. In case this function returns true, the register copy adder or similar pass should be able to route the constant to the wanted destination(s), in case no direct bus with the immediate support is found. In case the destination (port) is known, its width should be set to destWidth to constraint the required immediate extension width (in case the move tries to write to a port narrower than the immediate actually requires bits, the bug is earlier in the compilation).
A complex example: a move where a negative constant with minimal encoding of 7b is transported through a 32b bus to a 8b destination with a 8b move slot that uses zero extension mode. The zero extension mode does not fill up the upper bits with 1, but it does not lead to information loss as the destination uses only the lower 8 bits which can be encoded directly to the immediate field, thus the extension is not needed.
Definition at line 444 of file MachineInfo.cc.
References TTAMachine::Machine::busNavigator(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::instructionTemplateNavigator(), and TTAMachine::Machine::Navigator< ComponentType >::item().
Referenced by llvm::LLVMTCEBuilder::emitSPInitialization(), and ConstantTransformer::runOnMachineFunction().
|
static |
Finds the default data address space for given machine.
mach | The machine whose default data address space is requested. |
Definition at line 176 of file MachineInfo.cc.
References __func__, TTAMachine::FunctionUnit::addressSpace(), TTAMachine::Machine::addressSpaceNavigator(), TTAMachine::Machine::controlUnit(), TTAMachine::Machine::Navigator< ComponentType >::count(), and TTAMachine::Machine::Navigator< ComponentType >::item().
Referenced by ITemplateBroker::findITemplates(), and MachineConnectivityCheck::requiredImmediateWidth().
|
static |
Searches for lock unit FUs and returns them.
Lock unit FU must have the correct operations and an address space
machine | Architecture to be searched |
Definition at line 759 of file MachineInfo.cc.
References __func__, TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::FunctionUnit::hasAddressSpace(), TTAMachine::FunctionUnit::hasOperation(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, and TTAMachine::Component::name().
Referenced by ProGe::TestBenchBlock::TestBenchBlock().
|
static |
Finds the widest operand available in the machine.
Helps finding the widest usable register in the machine.
Definition at line 566 of file MachineInfo.cc.
References TTAMachine::Machine::functionUnitNavigator(), getOpset(), machine, Operation::operand(), Operation::operandCount(), OperationPool::operation(), and Operand::width().
Referenced by llvm::TCEStubTTIImpl::getNumberOfRegisters(), and llvm::TCEStubTTIImpl::getRegisterBitWidth().
|
static |
Returns port that is bound to operand index of the operation in the FU.
Returns the port, if the FU has the operation and operation has the operand bound to some port. Otherwise, returns nullptr.
Definition at line 156 of file MachineInfo.cc.
References TTAMachine::FunctionUnit::hasOperation(), TTAMachine::HWOperation::isBound(), TTAMachine::FunctionUnit::operation(), and TTAMachine::HWOperation::port().
|
static |
Returns opset used by Global Control Unit.
gcu | The Global Control Unit whose opset is requested. |
Definition at line 93 of file MachineInfo.cc.
References TTAMachine::HWOperation::name(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationCount(), and StringTools::stringToLower().
|
static |
Checks that the operands used in the operations of the given FU are bound to some port.
mach | The machine whose opset is requested. |
Definition at line 65 of file MachineInfo.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::HWOperation::name(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationCount(), and StringTools::stringToLower().
Referenced by TTAProgram::CodeGenerator::CodeGenerator(), ProGe::CUOpcodeGenerator::encodings(), findWidestOperand(), TDGen::gatherAllMachineOperations(), DefaultICDecoderGenerator::generate(), ProGe::LoopBufferBlock::LoopBufferBlock(), supportsOperation(), DefaultDecoderGenerator::verifyCompatibility(), and TDGen::writeCondBranchDefs().
|
static |
Return first occurrence of FUPorts that are bound to operation given by name.
Returned list has FUPorts ordered in the order of operands. At index 1 is port bounded to operand 1, at index 2 port bounded to operand 2 and so on. List is empty if operation was not found from machine. Unbounded operands have NULL at the index of operand (0 is always NULL).
mach | The machine. |
operationStr | The operation. |
Definition at line 117 of file MachineInfo.cc.
References TTAMachine::Machine::controlUnit(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::FunctionUnit::hasOperation(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::HWOperation::operandCount(), TTAMachine::FunctionUnit::operation(), and TTAMachine::HWOperation::port().
|
static |
Definition at line 202 of file MachineInfo.cc.
References assert, TTAMachine::Machine::busNavigator(), TTAMachine::Machine::controlUnit(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::ControlUnit::globalGuardLatency(), TTAMachine::Bus::guard(), TTAMachine::Bus::guardCount(), TTAMachine::RegisterFile::guardLatency(), TTAMachine::Machine::Navigator< ComponentType >::item(), and TTAMachine::RegisterGuard::registerFile().
Referenced by CompiledSimCodeGenerator::CompiledSimCodeGenerator().
|
static |
Definition at line 806 of file MachineInfo.cc.
References TTAMachine::Machine::controlUnit(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::FunctionUnit::hasOperation(), and TTAMachine::FunctionUnit::operation().
Referenced by ScheduleEstimator::maximumSizeOfBB().
|
static |
Returns byte width of the widest load/store operation.
Definition at line 261 of file MachineInfo.cc.
References TTAMachine::FunctionUnit::addressSpace(), assert, TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::FunctionUnit::hasAddressSpace(), TTAMachine::AddressSpace::hasNumericalId(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::HWOperation::name(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationCount(), TCEString::startsWith(), StringTools::stringToLower(), and Conversion::toInt().
Referenced by TTAProgram::CodeGenerator::CodeGenerator(), LLVMBackend::compile(), llvm::LLVMTCEBuilder::dataEnd(), and llvm::TCETargetMachine::setTargetMachinePlugin().
|
static |
Counts registers of given width.
Definition at line 594 of file MachineInfo.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, TTAMachine::Machine::registerFileNavigator(), TTAMachine::BaseRegisterFile::size(), and TTAMachine::BaseRegisterFile::width().
Referenced by llvm::TCEStubTTIImpl::getNumberOfRegisters().
|
static |
Returns Operand object for the given hardware operation attached to the port.
InstanceNotFound exception is thrown, if the hardware operation doesn't have an operand in the given port.
hwOp | Hardware operation. |
port | The port containing the desired Operand. |
Definition at line 241 of file MachineInfo.cc.
References assert, NullOperation::instance(), TTAMachine::HWOperation::io(), TTAMachine::HWOperation::name(), Operation::operand(), and OperationPool::operation().
|
static |
Convenience function for getting OSAL operation from HWOperation description.
Throws InstanceNotFound if OSAL operation is not found.
Definition at line 794 of file MachineInfo.cc.
References Operation::isNull(), TTAMachine::HWOperation::name(), OperationPool::operation(), and THROW_EXCEPTION.
Referenced by TDGen::supportedStackAccessOperations().
|
staticprivate |
|
static |
Returns true if the machine has predicatable jump.
Definition at line 616 of file MachineInfo.cc.
References MachineConnectivityCheck::busConnectedToPort(), TTAMachine::Machine::busNavigator(), TTAMachine::Machine::controlUnit(), TTAMachine::FunctionUnit::hasOperation(), machine, TTAMachine::RegisterGuard::registerFile(), and TTAMachine::BaseRegisterFile::width().
Referenced by TDGen::createBranchAnalysis(), llvm::TCETargetLowering::TCETargetLowering(), and TDGen::writeCondBranchDefs().
|
static |
Definition at line 382 of file MachineInfo.cc.
References getOpset(), and TCEString::upper().
Referenced by Peel2BBLoops::negateOp(), and ConstantTransformer::runOnMachineFunction().
|
static |
Definition at line 703 of file MachineInfo.cc.
References MachineConnectivityCheck::busConnectedToPort(), TTAMachine::Machine::busNavigator(), TTAMachine::Machine::controlUnit(), TTAMachine::FunctionUnit::hasOperation(), TTAMachine::Guard::isInverted(), machine, TTAMachine::BaseFUPort::parentUnit(), and TTAMachine::PortGuard::port().
Referenced by TDGen::writeCondBranchDefs(), and TDGen::writePortGuardedJumpDefPair().
|
static |
Returns true if the machine has predicatable jump.
Definition at line 663 of file MachineInfo.cc.
References MachineConnectivityCheck::busConnectedToPort(), TTAMachine::Machine::busNavigator(), TTAMachine::Machine::controlUnit(), TTAMachine::FunctionUnit::hasOperation(), and machine.
Referenced by TDGen::createBranchAnalysis(), llvm::TCETargetLowering::TCETargetLowering(), and TDGen::writeCondBranchDefs().
|
static |
Checks if slot is used in any of the instruction templates defined in ADF.
mach | The Machine. |
slotName | The name of the slot. |
Definition at line 339 of file MachineInfo.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::instructionTemplateNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), and TTAMachine::InstructionTemplate::usesSlot().
|
static |
Returns set of pointers to instruction templates that uses the given slot.
mach | The Machine. |
slotName | The name of the slot. |
Definition at line 365 of file MachineInfo.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::instructionTemplateNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), and TTAMachine::InstructionTemplate::usesSlot().
Referenced by DefaultDecoderGenerator::writeSquashSignalGenerationProcess().
|
static |
Definition at line 507 of file MachineInfo.cc.
References TTAMachine::FunctionUnit::hasOperation(), TTAMachine::HWOperation::io(), TTAMachine::FUPort::isTriggering(), Operation::name(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationPort(), and TTAMachine::FunctionUnit::operationPortCount().
|
static |
Finds the operand index of trigger of given operation in the machine.
If the operation is not found from the machine, return 0. If the index is ambiguos return -1.
Definition at line 530 of file MachineInfo.cc.
References TTAMachine::Machine::controlUnit(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), UniversalMachine::instance(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, and Operation::numberOfInputs().
Referenced by DataDependenceGraphBuilder::isTriggering().
|
staticprivate |
Definition at line 123 of file MachineInfo.hh.
|
staticprivate |
Definition at line 124 of file MachineInfo.hh.
|
staticprivate |
Definition at line 125 of file MachineInfo.hh.