OpenASIP
2.0
|
#include <TPEFProgramFactory.hh>
Classes | |
class | CacheKey |
Cache key for resources that are accessed from MOM(s) More... | |
struct | SocketAllocation |
Public Member Functions | |
TPEFProgramFactory (const TPEF::Binary &aBinary, const TTAMachine::Machine &aMachine) | |
TPEFProgramFactory (const TPEF::Binary &aBinary, const TTAMachine::Machine &aMachine, UniversalMachine *aUniversalMachine) | |
TPEFProgramFactory (const TPEF::Binary &aBinary, UniversalMachine *aMachine) | |
virtual | ~TPEFProgramFactory () |
Program * | build () |
Protected Types | |
typedef std::map< HalfWord, SimValue * > | InlineValues |
typedef std::pair< Word, Word > | ImmediateKey |
typedef std::map< ImmediateKey, TPEF::ImmediateElement * > | ImmediateMap |
typedef std::vector< TPEF::MoveElement * > | MoveVector |
typedef std::vector< TPEF::ImmediateElement * > | ImmediateVector |
Private Member Functions | |
void | clearResourceAllocations () const |
bool | canSourceBeAssigned (SocketAllocation &alloc, std::map< TTAMachine::Socket *, std::vector< SocketAllocation * > > &fixedSockets) const |
bool | canDestinationBeAssigned (SocketAllocation &alloc, std::map< TTAMachine::Socket *, std::vector< SocketAllocation * > > &fixedSockets) const |
void | resolveSocketAllocations (std::vector< SocketAllocation > &allocs) const |
Terminal * | getFromCache (const CacheKey &key) const |
void | addToCache (const CacheKey &key, Terminal *cachedTerm) const |
void | clearCache () const |
Private Attributes | |
const TPEF::Binary * | binary_ |
Binary that is used for creating program. More... | |
const TTAMachine::Machine * | machine_ |
Target machine of program. More... | |
UniversalMachine * | universalMachine_ |
Universal machine of program. More... | |
TPEF::TPEFTools | tpefTools_ |
TPEFTools object for helper functions. More... | |
TTAMachine::AddressSpace * | adfInstrASpace_ |
Instruction address space of machine. More... | |
TPEF::ASpaceElement * | tpefInstrASpace_ |
Instruction address space element of TPEF. More... | |
std::map< const TPEF::InstructionElement *, class FunctionStart * > | functionStartPositions_ |
Stores information of start points of procedures that were found. More... | |
std::list< std::shared_ptr< Move > > | instructionImmediates_ |
Moves whose source terminals are addresses referring to instructions. More... | |
std::list< std::shared_ptr< Immediate > > | longInstructionImmediates_ |
Long immediates whose value terminals refers to instructions. More... | |
std::map< const CacheKey, Terminal * > | cache_ |
Cache map of terminals that are returned by different search parameters. More... | |
std::set< HalfWord > | allocatedBusses_ |
Busses that are already allocated by moves of current instruction. More... | |
std::map< TPEF::InstructionElement *, Instruction * > | instructionMap_ |
Program instruction by TPEF instruction element. More... | |
Creates a new TTA program out of a description of a binary representation of the program and a model of the target architecture.
This class builds only one program, even if the input binary contains many programs (the original TPEF file has multiple code sections with different address spaces).
Definition at line 87 of file TPEFProgramFactory.hh.
|
protected |
Definition at line 107 of file TPEFProgramFactory.hh.
|
protected |
Definition at line 108 of file TPEFProgramFactory.hh.
|
protected |
Definition at line 110 of file TPEFProgramFactory.hh.
|
protected |
Definition at line 106 of file TPEFProgramFactory.hh.
|
protected |
Definition at line 109 of file TPEFProgramFactory.hh.
TTAProgram::TPEFProgramFactory::TPEFProgramFactory | ( | const TPEF::Binary & | aBinary, |
const TTAMachine::Machine & | aMachine | ||
) |
Constructor for fully scheduled code.
aBinary | Binary that contains a program's instructions and data. |
aMachine | Machine to which code refers. |
relocs | Managed collection of relocation points in the program. |
Definition at line 137 of file TPEFProgramFactory.cc.
TTAProgram::TPEFProgramFactory::TPEFProgramFactory | ( | const TPEF::Binary & | aBinary, |
const TTAMachine::Machine & | aMachine, | ||
UniversalMachine * | aUniversalMachine | ||
) |
Constructor.
For mixed code which contains universal machine references and target machine references.
aBinary | Binary that contains a program's instructions and data. |
aMachine | Actual machine to which parallel code refers. |
aUniversalMachine | Universal machine for sequential code. |
relocs | Managed collection of relocation points in the program. |
Definition at line 119 of file TPEFProgramFactory.cc.
TTAProgram::TPEFProgramFactory::TPEFProgramFactory | ( | const TPEF::Binary & | aBinary, |
UniversalMachine * | aMachine | ||
) |
Constructor for fully unscheduled code.
aBinary | Binary that contains a program's instructions and data. |
uMachine | Universal Machine to which code refers. |
relocs | Managed collection of relocation points in the program. |
Definition at line 153 of file TPEFProgramFactory.cc.
|
virtual |
Destructor.
Definition at line 166 of file TPEFProgramFactory.cc.
References MapTools::deleteAllValues(), and functionStartPositions_.
|
protected |
Parses procedures from all TPEF CodeSections and adds them to Program.
program | Program where to add new procedures. |
programASpace | Address space of instruction memory. |
Definition at line 344 of file TPEFProgramFactory.cc.
References __func__, abortWithError, assert, TPEF::InstructionElement::begin(), binary_, createInstruction(), TPEF::ImmediateElement::destinationIndex(), TPEF::ImmediateElement::destinationUnit(), TPEF::CodeSection::element(), TPEF::Section::elementCount(), Exception::errorMessage(), functionName(), instructionMap_, isFunctionStart(), TPEF::InstructionElement::isImmediate(), TPEF::ImmediateElement::isInline(), TPEF::InstructionElement::isMove(), TPEF::Section::link(), program, TPEF::Binary::section(), TPEF::Binary::sectionCount(), Exception::setCause(), and TPEF::Section::startingAddress().
Referenced by build().
|
private |
Adds Terminal to cache.
key | Key of search variables for getting terminal from machine(s). |
cachedTerm | Terminal to be add to cache. |
Definition at line 1968 of file TPEFProgramFactory.cc.
References cache_.
Referenced by createTerminal().
Program * TTAProgram::TPEFProgramFactory::build | ( | ) |
Builds program model out of TPEF model.
NotAvailable | if there the binary contains no sections; if the instruction address space is missing or conflicting with architecture definition. |
Exception | if the TPEF or program in it is somehow broken. |
Definition at line 200 of file TPEFProgramFactory.cc.
References __func__, addProcedures(), TTAProgram::Terminal::address(), TTAMachine::Machine::addressSpaceNavigator(), adfInstrASpace_, TPEF::Section::aSpace(), assert, binary_, clearCache(), createDataMemories(), createLabels(), TTAProgram::InstructionReferenceManager::createReference(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), UniversalMachine::instructionAddressSpace(), instructionImmediates_, TTAProgram::Program::instructionReferenceManager(), TTAProgram::Program::instructionVector(), TTAMachine::Machine::Navigator< ComponentType >::item(), TPEF::Section::link(), TTAProgram::Address::location(), longInstructionImmediates_, machine_, TPEF::ASpaceElement::name(), TPEF::Binary::section(), TPEF::Binary::sectionCount(), seekFunctionStartPoints(), TTAProgram::Program::setUniversalMachine(), TTAProgram::Address::space(), TTAProgram::Program::startAddress(), stringOfChunk(), tpefInstrASpace_, TPEF::Binary::type(), universalMachine_, and TTAProgram::TerminalImmediate::value().
Referenced by InstructionDictionary::compress(), TTAProgram::Program::loadFromTPEF(), TTAProgram::Program::loadFromUnscheduledTPEF(), loadInputs(), SimulatorFrontend::loadProgram(), main(), InlineAsmParser::parse(), and CodeCompressorPlugin::startNewProgram().
|
private |
Checks if the destination of SocketAllocation can be assigned towards given map of already allocated sockets.
If tried socket is already used, it still can be used for another writing if the moves have opposite guards.
alloc | Socket allocation structure which is checked. |
fixedSockets | Map of already made socket allocations. |
Definition at line 1667 of file TPEFProgramFactory.cc.
References MapTools::containsKey(), TTAProgram::TPEFProgramFactory::SocketAllocation::dst, TTAProgram::TPEFProgramFactory::SocketAllocation::dstSocks, and TTAProgram::TPEFProgramFactory::SocketAllocation::move.
Referenced by resolveSocketAllocations().
|
private |
Checks if the source of SocketAllocation can be assigned towards given map of already allocated sockets.
If tried socket is already used, it still can be used for another reading if 1) the source register index is same for both of the allocations, or 2) the moves have opposite guards.
alloc | Socket allocation structure which is checked. |
fixedSockets | Map of already made socket allocations. |
Definition at line 1624 of file TPEFProgramFactory.cc.
References MapTools::containsKey(), TTAProgram::Terminal::index(), TTAProgram::TPEFProgramFactory::SocketAllocation::move, TTAProgram::TPEFProgramFactory::SocketAllocation::src, and TTAProgram::TPEFProgramFactory::SocketAllocation::srcSocks.
Referenced by resolveSocketAllocations().
|
private |
Clears cache.
Definition at line 1979 of file TPEFProgramFactory.cc.
References cache_.
Referenced by build().
|
private |
|
protected |
Creates data memories to program.
Definition at line 2176 of file TPEFProgramFactory.cc.
References TTAProgram::DataMemory::addDataDefinition(), TTAProgram::Program::addDataMemory(), adfInstrASpace_, TPEF::RelocElement::aSpace(), TPEF::Section::aSpace(), assert, TPEF::RawSection::belongsToSection(), binary_, TPEF::RawSection::chunkToMAUIndex(), TTAProgram::DataMemory::dataDefinition(), TTAProgram::DataMemory::dataDefinitionCount(), TPEF::RelocElement::destination(), TPEF::Section::element(), TPEF::Section::elementCount(), findAddressSpace(), instructionMap_, TTAProgram::Program::instructionReferenceManager(), TTAMachine::Machine::isLittleEndian(), TPEF::RawSection::lengthInMAUs(), TTAProgram::Address::location(), TPEF::RelocElement::location(), TPEF::DataSection::MAU(), TPEF::RelocSection::referencedSection(), TPEF::Binary::section(), TPEF::Binary::sectionCount(), TTAProgram::DataDefinition::size(), TPEF::RelocElement::size(), TTAProgram::DataDefinition::startAddress(), TPEF::Section::startingAddress(), TTAProgram::Program::targetProcessor(), TPEF::UDataSection::type(), TPEF::Section::type(), and TTAMachine::AddressSpace::width().
Referenced by build().
|
protected |
|
protected |
Creates an instruction out of given moves and immediate elements.
resources | TPEF resource section. |
moveElements | Move elements of instruction. |
longImemdiates | Long immediates of instruction. |
immElements | Immediate elements of instruction. |
Definition at line 512 of file TPEFProgramFactory.cc.
References TTAProgram::AnnotatedInstructionElement::addAnnotation(), TTAProgram::Instruction::addImmediate(), TTAProgram::Instruction::addMove(), TTAProgram::Terminal::address(), adfInstrASpace_, TPEF::InstructionElement::annotation(), TPEF::InstructionElement::annotationCount(), TPEF::RelocElement::aSpace(), assert, TPEF::MoveElement::bus(), TTAMachine::Machine::Navigator< ComponentType >::count(), createTerminal(), TPEF::ImmediateElement::destinationIndex(), TPEF::MoveElement::destinationIndex(), TPEF::MoveElement::destinationType(), TPEF::ImmediateElement::destinationUnit(), TPEF::MoveElement::destinationUnit(), TTAMachine::Socket::direction(), TTAProgram::TPEFProgramFactory::SocketAllocation::dstSocks, findAddressSpace(), findBus(), findGuard(), findImmediateUnit(), findInstrTemplate(), TPEF::MoveElement::guardIndex(), TPEF::MoveElement::guardType(), TPEF::MoveElement::guardUnit(), TPEF::TPEFTools::hasRelocation(), TPEF::InstructionAnnotation::id(), instructionImmediates_, TTAProgram::Terminal::isAddress(), TTAMachine::Socket::isConnectedTo(), TPEF::MoveElement::isEmpty(), TTAProgram::Terminal::isGPR(), TPEF::MoveElement::isGuarded(), TPEF::MoveElement::isGuardInverted(), TTAProgram::Terminal::isImmediateRegister(), TTAMachine::Machine::Navigator< ComponentType >::item(), longInstructionImmediates_, TPEF::ImmediateElement::longWord(), TTAMachine::Component::machine(), TTAMachine::Port::parentUnit(), TPEF::InstructionAnnotation::payload(), TTAMachine::Socket::port(), TTAProgram::Terminal::port(), TTAMachine::Socket::portCount(), TPEF::TPEFTools::relocation(), resolveSocketAllocations(), TTAProgram::Instruction::setInstructionTemplate(), TTAMachine::ImmediateUnit::signExtends(), TPEF::ImmediateElement::sLongWord(), TTAMachine::Machine::socketNavigator(), TTAProgram::Move::source(), TPEF::MoveElement::sourceIndex(), TPEF::MoveElement::sourceType(), TPEF::MoveElement::sourceUnit(), TTAProgram::Address::space(), TTAProgram::TPEFProgramFactory::SocketAllocation::srcSocks, TTAMachine::InstructionTemplate::supportedWidth(), tpefInstrASpace_, and tpefTools_.
Referenced by addProcedures().
|
protected |
Adds global labels of TPEF to Program.
prog | Program where to add labels. |
prevent addition of local symbol with same name multiple times
prevent addition of local symbol with same name multiple times
Definition at line 2036 of file TPEFProgramFactory.cc.
References __func__, TTAProgram::Scope::addCodeLabel(), TTAProgram::Scope::addDataLabel(), TPEF::Section::aSpace(), assert, binary_, TPEF::SymbolElement::binding(), TPEF::RawSection::bytesToMAUs(), TPEF::StringSection::chunk2String(), MapTools::containsKey(), TTAProgram::InstructionReferenceManager::createReference(), TPEF::Section::element(), TPEF::Section::elementCount(), findAddressSpace(), TTAProgram::Program::globalScope(), instructionMap_, TTAProgram::Program::instructionReferenceManager(), TPEF::Section::link(), TPEF::SymbolElement::name(), TPEF::Chunk::offset(), TPEF::DataSymElement::reference(), TPEF::CodeSymElement::reference(), TPEF::Binary::section(), TPEF::SymbolElement::section(), TPEF::Binary::sectionCount(), Exception::setCause(), TPEF::Section::startingAddress(), and TPEF::SymbolElement::type().
Referenced by build().
|
protected |
Creates a move terminal of the appropriate type for given input data.
This method cannot be used for creating terminal for immediate unit or register file registers.
resources | TPEF resource section. |
aBus | Bus to which terminal is connected. |
direction | Read or write terminal. |
type | TPEF type of terminal. |
unitId | TPEF identification code of the unit to which terminal belongs. |
index | Register or operation terminal index, or immediate identifier. |
immediateMap | All immediates of currently created instruction. |
Definition at line 759 of file TPEFProgramFactory.cc.
References __func__, Application::abortProgram(), abortWithError, TTAProgram::AnnotatedInstructionElement::addAnnotation(), addToCache(), adfInstrASpace_, TPEF::InstructionElement::annotation(), TPEF::InstructionElement::annotationCount(), TPEF::RelocElement::aSpace(), assert, MapTools::containsKey(), TTAProgram::Terminal::copy(), findAddressSpace(), findFunctionUnit(), findImmediateUnit(), findPort(), findRegisterFile(), TPEF::ResourceSection::findResource(), getFromCache(), TPEF::TPEFTools::hasRelocation(), TPEF::ResourceSection::hasResource(), TPEF::InstructionAnnotation::id(), TTAMachine::Bus::immediateWidth(), TPEF::ImmediateElement::isInline(), TPEF::Section::link(), Application::logStream(), TPEF::ImmediateElement::longWord(), TPEF::ResourceElement::name(), TTAMachine::FunctionUnit::operation(), TPEF::InstructionAnnotation::payload(), TTAMachine::BaseRegisterFile::port(), TPEF::TPEFTools::relocation(), Exception::setCause(), stringOfChunk(), Conversion::toInt(), Conversion::toString(), tpefInstrASpace_, tpefTools_, and TPEF::ImmediateElement::word().
Referenced by createInstruction().
|
protected |
Finds address space by name.
Name | of address space. |
NotAvailable | if requested address space does not belong to the target architecture. |
Definition at line 1333 of file TPEFProgramFactory.cc.
References __func__, TPEF::TPEFTools::addressSpaceName(), TTAMachine::Machine::addressSpaceNavigator(), UniversalMachine::dataAddressSpace(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), UniversalMachine::instructionAddressSpace(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine_, TPEF::ASpaceElement::MAU(), TTAMachine::Component::name(), Conversion::toString(), tpefTools_, and universalMachine_.
Referenced by createDataMemories(), createInstruction(), createLabels(), and createTerminal().
|
protected |
Returns the bus of real or universal machine with the given bus identification number, as found in TPEF.
resources | The resource section where the bus should be searched. |
busId | Id of requested bus. |
NotAvailable | if requested bus does not belong to the target architecture. |
Definition at line 972 of file TPEFProgramFactory.cc.
References __func__, assert, TTAMachine::Machine::busNavigator(), TPEF::ResourceSection::findResource(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TPEF::ResourceSection::hasResource(), TTAMachine::Machine::Navigator< ComponentType >::item(), TPEF::Section::link(), machine_, TPEF::ResourceElement::name(), stringOfChunk(), UniversalMachine::universalBus(), and universalMachine_.
Referenced by createInstruction(), and findInstrTemplate().
|
protected |
Returns FunctionUnit by TPEF identification number and operation name.
If function unit ID corresponds to the universal function unit, then operation name is checked to see if we should return universal gcu or universal fu.
If operation name is special register of function unit or if operation name is operation of gcu then universal gcu is returned.
resources | The resource section where the bus should be searched. |
unitId | Id of requested unit. |
tpefOpName | Name of operation or special register for universal machine resources. |
NotAvailable | if requested function unit does not belong to the target architecture. |
Definition at line 1143 of file TPEFProgramFactory.cc.
References __func__, abortWithError, assert, TTAMachine::Machine::controlUnit(), TPEF::ResourceSection::findResource(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::FunctionUnit::hasOperation(), TTAMachine::Machine::Navigator< ComponentType >::item(), TPEF::Section::link(), machine_, TPEF::ResourceElement::name(), TTAMachine::Component::name(), stringOfChunk(), UniversalMachine::universalFunctionUnit(), and universalMachine_.
Referenced by createTerminal(), and findGuard().
|
protected |
Finds guard of bus.
resources | TPEF resource section. |
bus | Bus of guard. |
type | Is fu or register guard. |
unitId | Id of the unit that contains guard register or port. |
index | Register or operand index of guard. |
isInverted | Is inverted guard. |
Definition at line 1373 of file TPEFProgramFactory.cc.
References __func__, abortWithError, assert, findFunctionUnit(), findRegisterFile(), TPEF::ResourceSection::findResource(), TTAMachine::Bus::guard(), TTAMachine::Bus::guardCount(), TTAMachine::Unit::hasPort(), TPEF::ResourceSection::hasResource(), TTAMachine::Guard::isInverted(), TPEF::Section::link(), TPEF::MoveElement::MF_RF, TPEF::MoveElement::MF_UNIT, TPEF::ResourceElement::name(), TTAMachine::Component::name(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::port(), TTAMachine::HWOperation::port(), TTAMachine::PortGuard::port(), TTAMachine::RegisterGuard::registerFile(), TTAMachine::RegisterGuard::registerIndex(), stringOfChunk(), Conversion::toInt(), and Conversion::toString().
Referenced by createInstruction().
|
protected |
Returns ImmediateUnit by TPEF id number.
resources | The resource section where the bus should be searched. |
immUnitId | Id of requested immediate unit. |
NotAvailable | if requested immediate unit does not belong to the target architecture. |
Definition at line 1099 of file TPEFProgramFactory.cc.
References __func__, TPEF::ResourceSection::findResource(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::Machine::immediateUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), TPEF::Section::link(), machine_, TPEF::ResourceElement::name(), and stringOfChunk().
Referenced by createInstruction(), createTerminal(), and findInstrTemplate().
|
protected |
Returns instruction template that can be used for current instruction.
resources | TPEF resource section. |
longImmediates | Long immediates of instruction. |
moves | Moves of instruction. |
Definition at line 1502 of file TPEFProgramFactory.cc.
References __func__, assert, TPEF::MoveElement::bus(), MapTools::containsKey(), TTAMachine::Machine::Navigator< ComponentType >::count(), TPEF::ImmediateElement::destinationUnit(), findBus(), findImmediateUnit(), TTAMachine::Machine::instructionTemplateNavigator(), TPEF::MoveElement::isEmpty(), TTAMachine::InstructionTemplate::isOneOfDestinations(), TTAMachine::Machine::Navigator< ComponentType >::item(), TPEF::ImmediateElement::longWord(), machine_, TTAMachine::Component::name(), TTAMachine::InstructionTemplate::numberOfDestinations(), MathTools::requiredBits(), MathTools::requiredBitsSigned(), TPEF::ImmediateElement::sLongWord(), TTAMachine::InstructionTemplate::supportedWidth(), THROW_EXCEPTION, Conversion::toString(), universalMachine_, TTAMachine::InstructionTemplate::usesSlot(), and TTAMachine::ImmediateUnit::zeroExtends().
Referenced by createInstruction().
|
protected |
Finds any function unit or special register port from target architecture (possiby the universal machine).
NOTE: this is currently used only for plain port references (sr or port without opcode) if TPEFProgramFactory. However method should be able finding also function unit ports.
bus | Bus where to socket is connected. |
portParent | Parent to which port in connected to. |
tpefOpName | Name of operation if opcode port to find. |
tpefOpIndex | Terminal index of operation if opcode port to find. |
NotAvailable | if requested port does not belong to the target architecture. |
Definition at line 1237 of file TPEFProgramFactory.cc.
References __func__, assert, TTAMachine::Machine::controlUnit(), TTAMachine::FunctionUnit::hasOperation(), TTAMachine::Unit::hasPort(), TTAMachine::ControlUnit::hasReturnAddressPort(), machine_, TTAMachine::Component::name(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::port(), TTAMachine::HWOperation::port(), TTAMachine::ControlUnit::returnAddressPort(), Conversion::toString(), UniversalMachine::universalBus(), and universalMachine_.
Referenced by createTerminal().
|
protected |
Returns RegisterFile by TPEF id number.
resources | The resource section where the bus should be searched. |
rfId | Id of requested register file. |
NotAvailable | if requested register file does not belong to the target architecture. |
Definition at line 1021 of file TPEFProgramFactory.cc.
References __func__, abortWithError, UniversalMachine::booleanRegisterFile(), UniversalMachine::doubleRegisterFile(), TPEF::ResourceSection::findResource(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), UniversalMachine::integerRegisterFile(), TTAMachine::Machine::Navigator< ComponentType >::item(), TPEF::Section::link(), machine_, TPEF::ResourceElement::name(), TTAMachine::Machine::registerFileNavigator(), stringOfChunk(), and universalMachine_.
Referenced by createTerminal(), and findGuard().
|
protected |
Returns name of function, that starts, from given instruction element.
instructionElement | Starting element, of procedure. |
Definition at line 2471 of file TPEFProgramFactory.cc.
References MapTools::containsKey(), and functionStartPositions_.
Referenced by addProcedures(), and seekFunctionStartPoints().
Returns cached terminal.
key | Cache key of terminal. |
Definition at line 1951 of file TPEFProgramFactory.cc.
References cache_, and MapTools::containsKey().
Referenced by createTerminal().
|
protected |
Checks if move is start point of function.
instructionElement | Intruction element which should be checked. |
Definition at line 2458 of file TPEFProgramFactory.cc.
References MapTools::containsKey(), and functionStartPositions_.
Referenced by addProcedures().
|
private |
Resolves sockets that are used for GPR and Immediate Unit reading and writing for instruction.
NOTE: TPEF specification currently supports storing port information of GPR references, so if this solution does not work or if this is too slow, then register port information should be implemented to TPEF object modell.
allocs | All GPR and IU reads and writes of instruction. One item in this vector represents one move in the instruction. |
Definition at line 1711 of file TPEFProgramFactory.cc.
References __func__, canDestinationBeAssigned(), canSourceBeAssigned(), TTAProgram::TPEFProgramFactory::SocketAllocation::dst, TTAProgram::TPEFProgramFactory::SocketAllocation::dstSocks, TTAProgram::TPEFProgramFactory::SocketAllocation::move, TTAMachine::Port::parentUnit(), TTAMachine::Socket::port(), TTAMachine::Socket::portCount(), TTAProgram::TPEFProgramFactory::SocketAllocation::src, and TTAProgram::TPEFProgramFactory::SocketAllocation::srcSocks.
Referenced by createInstruction().
|
protected |
Analyses all CodeSection from TPEF and tries to find function start points.
Definition at line 1991 of file TPEFProgramFactory.cc.
References assert, binary_, MapTools::deleteAllValues(), TPEF::Section::element(), TPEF::Section::elementCount(), functionName(), functionStartPositions_, TPEF::Section::link(), TPEF::SymbolElement::name(), TPEF::CodeSymElement::reference(), TPEF::Binary::section(), TPEF::Binary::sectionCount(), and stringOfChunk().
Referenced by build().
|
protected |
Returns value of chunk as string.
Helps getting names for various TPEF resources.
chunk | Chunk referring to section. |
chunkOwner | StringSection that contains requested string. |
Definition at line 180 of file TPEFProgramFactory.cc.
References assert, and TPEF::StringSection::chunk2String().
Referenced by build(), createTerminal(), findBus(), findFunctionUnit(), findGuard(), findImmediateUnit(), findRegisterFile(), and seekFunctionStartPoints().
|
private |
Instruction address space of machine.
Definition at line 281 of file TPEFProgramFactory.hh.
Referenced by build(), createDataMemories(), createInstruction(), and createTerminal().
|
mutableprivate |
Busses that are already allocated by moves of current instruction.
Definition at line 300 of file TPEFProgramFactory.hh.
|
private |
Binary that is used for creating program.
Definition at line 272 of file TPEFProgramFactory.hh.
Referenced by addProcedures(), build(), createDataMemories(), createLabels(), and seekFunctionStartPoints().
Cache map of terminals that are returned by different search parameters.
Definition at line 297 of file TPEFProgramFactory.hh.
Referenced by addToCache(), clearCache(), and getFromCache().
|
private |
Stores information of start points of procedures that were found.
Definition at line 287 of file TPEFProgramFactory.hh.
Referenced by functionName(), isFunctionStart(), seekFunctionStartPoints(), and ~TPEFProgramFactory().
|
mutableprivate |
Moves whose source terminals are addresses referring to instructions.
Definition at line 290 of file TPEFProgramFactory.hh.
Referenced by build(), and createInstruction().
|
mutableprivate |
Program instruction by TPEF instruction element.
Definition at line 303 of file TPEFProgramFactory.hh.
Referenced by addProcedures(), createDataMemories(), and createLabels().
|
mutableprivate |
Long immediates whose value terminals refers to instructions.
Definition at line 293 of file TPEFProgramFactory.hh.
Referenced by build(), and createInstruction().
|
private |
Target machine of program.
Definition at line 274 of file TPEFProgramFactory.hh.
Referenced by build(), findAddressSpace(), findBus(), findFunctionUnit(), findImmediateUnit(), findInstrTemplate(), findPort(), and findRegisterFile().
|
private |
Instruction address space element of TPEF.
Definition at line 283 of file TPEFProgramFactory.hh.
Referenced by build(), createInstruction(), and createTerminal().
|
private |
TPEFTools object for helper functions.
Definition at line 279 of file TPEFProgramFactory.hh.
Referenced by createInstruction(), createTerminal(), and findAddressSpace().
|
private |
Universal machine of program.
Definition at line 276 of file TPEFProgramFactory.hh.
Referenced by build(), findAddressSpace(), findBus(), findFunctionUnit(), findInstrTemplate(), findPort(), and findRegisterFile().