Go to the documentation of this file.
34 #ifndef TTA_TPEF_PROGRAM_FACTORY_HH
35 #define TTA_TPEF_PROGRAM_FACTORY_HH
58 class InstructionTemplate;
65 class ImmediateElement;
134 HalfWord busId)
const;
138 HalfWord rfId)
const;
142 Byte immUnitId)
const;
146 HalfWord unitId, std::string tpefOpName =
"")
const;
151 std::string tpefOpName =
"",
152 int tpefOpIndex = 0)
const;
163 bool isInverted)
const;
197 HalfWord anUnitId, HalfWord anIndex) :
207 else if (
type_ > keyToCompare.
type_)
return false;
215 if (&
bus_ < &(keyToCompare.
bus_))
return true;
257 std::vector<SocketAllocation*> >& fixedSockets)
const;
262 std::vector<SocketAllocation*> >& fixedSockets)
const;
265 std::vector<SocketAllocation>& allocs)
const;
297 mutable std::map<const CacheKey, Terminal *>
cache_;
TTAMachine::Port & findPort(const TTAMachine::Bus &bus, const TTAMachine::Unit &portParent, std::string tpefOpName="", int tpefOpIndex=0) const
std::pair< Word, Word > ImmediateKey
bool canDestinationBeAssigned(SocketAllocation &alloc, std::map< TTAMachine::Socket *, std::vector< SocketAllocation * > > &fixedSockets) const
Cache key for resources that are accessed from MOM(s)
TTAMachine::InstructionTemplate & findInstrTemplate(const TPEF::ResourceSection &resources, ImmediateVector &longImmediates, MoveVector &moves) const
TTAMachine::AddressSpace * adfInstrASpace_
Instruction address space of machine.
std::set< HalfWord > allocatedBusses_
Busses that are already allocated by moves of current instruction.
std::map< TPEF::InstructionElement *, Instruction * > instructionMap_
Program instruction by TPEF instruction element.
std::list< std::shared_ptr< Immediate > > longInstructionImmediates_
Long immediates whose value terminals refers to instructions.
virtual ~TPEFProgramFactory()
void createLabels(Program &prog)
TPEFProgramFactory(const TPEF::Binary &aBinary, const TTAMachine::Machine &aMachine)
HalfWord unitId_
unit id of the corresponding TPEF resource element.
bool operator<(const CacheKey &keyToCompare) const
void createDataRelocs(Program &prog)
void addToCache(const CacheKey &key, Terminal *cachedTerm) const
void createDataMemories(Program &prog)
Instruction * createInstruction(const TPEF::ResourceSection &resources, MoveVector &moveElements, ImmediateVector &longImmediates, ImmediateMap &immElements) const
Terminal * getFromCache(const CacheKey &key) const
void clearResourceAllocations() const
std::map< HalfWord, SimValue * > InlineValues
Terminal * createTerminal(const TPEF::ResourceSection &resources, const TTAMachine::Bus *aBus, TTAMachine::Socket::Direction direction, TPEF::MoveElement::FieldType type, HalfWord unitId, HalfWord index, const ImmediateMap *immediateMap=NULL) const
TPEF::TPEFTools tpefTools_
TPEFTools object for helper functions.
TTAMachine::Bus & findBus(const TPEF::ResourceSection &resources, HalfWord busId) const
SocketAllocation(std::shared_ptr< Move > m, unsigned int anIndex)
TTAMachine::FunctionUnit & findFunctionUnit(const TPEF::ResourceSection &resources, HalfWord unitId, std::string tpefOpName="") const
CacheKey(const TTAMachine::Bus &aBus, TTAMachine::Socket::Direction aDirection, TPEF::MoveElement::FieldType aType, HalfWord anUnitId, HalfWord anIndex)
TTAMachine::AddressSpace & findAddressSpace(const TPEF::ASpaceElement *aSpace) const
TPEF::ASpaceElement * tpefInstrASpace_
Instruction address space element of TPEF.
const TTAMachine::Bus & bus_
Bus that was used for transport.
std::vector< TPEF::ImmediateElement * > ImmediateVector
std::map< ImmediateKey, TPEF::ImmediateElement * > ImmediateMap
bool canSourceBeAssigned(SocketAllocation &alloc, std::map< TTAMachine::Socket *, std::vector< SocketAllocation * > > &fixedSockets) const
std::shared_ptr< Move > move
bool isFunctionStart(const TPEF::InstructionElement &instructionElement) const
std::map< const TPEF::InstructionElement *, class FunctionStart * > functionStartPositions_
Stores information of start points of procedures that were found.
TTAMachine::Guard & findGuard(const TPEF::ResourceSection &resources, TTAMachine::Bus &bus, TPEF::MoveElement::FieldType type, HalfWord unitId, HalfWord index, bool isInverted) const
const TTAMachine::Machine * machine_
Target machine of program.
void resolveSocketAllocations(std::vector< SocketAllocation > &allocs) const
std::vector< TTAMachine::Socket * > dstSocks
UniversalMachine * universalMachine_
Universal machine of program.
std::vector< TPEF::MoveElement * > MoveVector
TTAMachine::ImmediateUnit & findImmediateUnit(const TPEF::ResourceSection &resources, Byte immUnitId) const
void seekFunctionStartPoints()
TTAMachine::RegisterFile & findRegisterFile(const TPEF::ResourceSection &resources, HalfWord rfId) const
std::list< std::shared_ptr< Move > > instructionImmediates_
Moves whose source terminals are addresses referring to instructions.
find Finds info of the inner loops in the program
std::string functionName(const TPEF::InstructionElement &instructionElement) const
std::vector< TTAMachine::Socket * > srcSocks
const TPEF::Binary * binary_
Binary that is used for creating program.
TPEF::MoveElement::FieldType type_
Type of the accessed unit.
TTAMachine::Socket::Direction direction_
Direction if the port was read or written.
std::map< const CacheKey, Terminal * > cache_
Cache map of terminals that are returned by different search parameters.
std::string stringOfChunk(const TPEF::Chunk *chunk, const TPEF::Section *chunkOwner) const
HalfWord index_
Index of the corresponding TPEF resource element.
void addProcedures(Program &program, const TTAMachine::AddressSpace &programASpace) const