Go to the documentation of this file.
33 #ifndef TCEASM_RESOURCE_MANAGER_HH
34 #define TCEASM_RESOURCE_MANAGER_HH
45 class ResourceElement;
50 class ResourceSection;
59 class BaseRegisterFile;
TPEF::Chunk * stringToChunk(const std::string aStr)
std::string requestTypeString(RequestType type) const
std::map< std::string, UValue > opOrPortIDs_
Bookkeeping of already added ports, operations and special registers.
TPEF::NullSection * nullSection_
The null section of TPEF.
TPEF::ASpaceElement * codeASpace_
The instruction address space element of TPEF.
UValue lastRegisterFileID_
For generating register file resource ids.
UValue functionUnitID(TTAMachine::FunctionUnit *unit)
TPEF::ResourceSection * resourceSection()
UValue findBusWidth(UValue slotNumber)
UValue registerFileID(TTAMachine::BaseRegisterFile *rf)
const TTAMachine::Machine & adf_
Machine where manager tries to find used resources.
TPEF::StringSection * stringSection()
UValue index
TPEF Resource operand id or register file index.
@ RQST_READ
Register of port for reading.
TPEF::Section * nullSection()
MachineResourceManager(TPEF::Binary &tpef, const TTAMachine::Machine &adf, AssemblyParserDiagnostic *parent_)
AssemblyParserDiagnostic * parent_
Assembler root class for adding warnings.
bool operator<(const ResourceKey &comp) const
std::string keyString
Key string for resource.
std::map< TTAMachine::FunctionUnit *, UValue > functionUnitIDs_
Bookkeeping of already added function units.
ResourceID indexResource(UValue currentLine, const RegisterTerm &term, UValue slotNumber, RequestType type, std::string &resourceKeyString)
TPEF::MoveElement::FieldType type
Resource type.
UValue width
Width of accessed port or other resource.
ResourceID rFPortOrFUIndexReference(TTAMachine::FunctionUnit *fu, TTAMachine::BaseRegisterFile *rf, UValue currentLine, const RegisterTerm &term, UValue slotNumber, RequestType type, std::string &resourceKeyString)
@ RQST_INVGUARD
Inverted register or port guard.
std::map< TTAMachine::BaseRegisterFile *, UValue > registerFileIDs_
Bookkeeping of already added register files.
ResourceID registerFileIndexReference(TTAMachine::BaseRegisterFile *rf, const RegisterTerm &term, UValue slotNumber, RequestType type, std::string &resourceKeyString)
TPEF::Binary & tpef_
Binary where all used resources are added.
RequestType type
Was resource read or written or was it guard.
TPEF::StringSection * strings_
The string section of TPEF.
UValue lastOpOrSpecRegisterID_
For generating shared ids for ports, operations or special registers.
UValue opOrPortID(std::string opOrPortString, const TTAMachine::Port *port)
void initResourceSection()
std::map< std::string, TPEF::ASpaceElement * > addressSpaces_
Bookkeeping for already requested address spaces.
TPEF::ASpaceElement * findDataAddressSpace(std::string name)
TPEF::ASpaceSection * aSpaceSection_
The address space section of TPEF.
UValue unit
TPEF Resource unit id.
@ RQST_GUARD
Register or port guard.
ResourceID & resourceID(UValue currentLine, const RegisterTerm &term, UValue slotNumber, RequestType type)
std::map< ResourceKey, ResourceID > resourceMap_
Bookkeeping for already requested resources.
TPEF::ResourceSection * resourceSection_
The resource section of TPEF.
ResourceID functionUnitPortResource(const RegisterTerm &term)
TPEF::ASpaceElement * undefinedAddressSpace()
TPEF::ASpaceElement * codeAddressSpace()
UValue lastFunctionUnitID_
For generating function unit resource ids.
TPEF::ASpaceElement * undefASpace_
The undefined address space element of TPEF.
UValue slotNumber
Bus that was used.
void addResourceElement(TPEF::ResourceElement *resource)
@ RQST_WRITE
Register or port for writing.