Go to the documentation of this file.
33 #ifndef TTA_PROGRAM_WRITER_HH
34 #define TTA_PROGRAM_WRITER_HH
48 class ResourceSection;
49 class ResourceElement;
109 typedef std::pair<const TTAMachine::MachinePart*, int>
CacheKey;
165 const Address& aDstAddress,
int bitWidth) :
std::map< const TTAMachine::AddressSpace *, TPEF::ASpaceElement * > aSpaceMap_
Created TPEF binary.
TTAMachine::Machine & mach_
The model of the target processor architecture.
HalfWord lastRegisterFileId_
Last TPEF register file id that was generated.
TPEF::ResourceElement & functionUnit(const TTAMachine::FunctionUnit &fu)
void createDataSections(TPEF::Binary *bin, bool littleEndian) const
std::pair< const TTAMachine::MachinePart *, int > CacheKey
void createRelocSections(TPEF::Binary *bin) const
TPEF::Binary::FileType resolveFileType(TPEF::ResourceSection &resources) const
TPEF::ResourceElement & immediateUnit(const TTAMachine::ImmediateUnit &immUnit)
TPEF::ResourceElement & operand(const TTAMachine::HWOperation &oper, int operandIndex)
void createCodeSection(TPEF::CodeSection *code, TPEFResourceUpdater &updater) const
static const HalfWord IMMEDIATE_ADDRESS_WIDTH
Default widt that is used as address width of relocations of immediate elements. This should be fixed...
ResourceID terminalResource(const Terminal &term, TPEFResourceUpdater &updater) const
HalfWord index
Operand or register file index.
TPEFResourceUpdater(TTAMachine::Machine &mach, TPEF::ResourceSection &resources)
std::map< CacheKey, TPEF::ResourceElement * > ResourceCache
Mapping from parts of the target processor model to TPEF machine resource entries.
ResourceCache cache_
Aggregate of all mappings between machine resource entries and target processor parts (machine parts)...
TPEF::MoveElement::FieldType type
RF, UNIT or IMM.
HalfWord lastFunctionUnitId_
Last TPEF function unit id that was generated.
TPEF::ResourceSection & resources_
The TPEF input section that contains all machine resource entries.
TPEF::Section & findSection(TPEF::Binary &bin, Address address) const
HalfWord lastImmediateUnitId_
Last TPEF immediate unit id that was generated.
const Program & prog_
Program that is written to TPEF.
static const int MAX_SIMM_WIDTH
Maximum width for short immediates.
TPEF::ResourceElement & bus(const TTAMachine::Bus &bus)
TPEF::ASpaceElement & createASpaceElement(const TTAMachine::AddressSpace &addressSpace, TPEF::Binary &bin) const
int bits
Relocation width.
TPEF::SectionElement * srcElem
Location element.
TPEF::ResourceElement & registerFile(const TTAMachine::RegisterFile &rf)
TPEF::ResourceElement & functionUnitPort(const TTAMachine::Port &port)
std::vector< RelocInfo > relocInfos_
Address destination
Destination address.
TPEF::Section * srcSect
Location section.
HalfWord lastBusId_
Last TPEF bus id that was generated.
RelocInfo(TPEF::Section *aSrcSect, TPEF::SectionElement *aSrcElem, const Address &aDstAddress, int bitWidth)
HalfWord lastUnitPortId_
Last TPEF unit port id that was generated.
TPEF::Binary * createBinary() const
ProgramWriter(const Program &prog)