gem5
|
#include <brig_object.hh>
Classes | |
struct | SectionInfo |
Public Types | |
enum | SectionIndex { DataSectionIndex, CodeSectionIndex, OperandsSectionIndex, NumSectionIndices } |
Public Member Functions | |
const uint8_t * | getSectionOffset (enum SectionIndex sec, int offs) const |
void | processDirectives (const Brig::BrigBase *dirPtr, const Brig::BrigBase *endPtr, StorageMap *storageMap) |
BrigObject (const std::string &fname, int len, uint8_t *fileData) | |
~BrigObject () | |
const char * | getString (int offs) const |
const Brig::BrigData * | getBrigBaseData (int offs) const |
const uint8_t * | getData (int offs) const |
const Brig::BrigBase * | getCodeSectionEntry (int offs) const |
const Brig::BrigOperand * | getOperand (int offs) const |
unsigned | getOperandPtr (int offs, int index) const |
const Brig::BrigInstBase * | getInst (int offs) const |
HsaCode * | getKernel (const std::string &name) const override |
HsaCode * | getFunction (const std::string &name) const override |
int | numKernels () const override |
HsaCode * | getKernel (int i) const override |
Public Member Functions inherited from HsaObject | |
HsaObject (const std::string &fileName) | |
const std::string & | name () const |
Static Public Member Functions | |
static HsaObject * | tryFile (const std::string &fname, int len, uint8_t *fileData) |
Static Public Member Functions inherited from HsaObject | |
static HsaObject * | createHsaObject (const std::string &fname) |
Public Attributes | |
SectionInfo | sectionInfo [NumSectionIndices] |
std::vector< HsailCode * > | kernels |
std::vector< HsailCode * > | functions |
std::string | kern_block_name |
StorageMap * | storageMap |
LabelMap * | labelMap |
HsailCode * | currentCode |
Public Attributes inherited from HsaObject | |
uint8_t * | readonlyData |
Static Public Attributes | |
static const char * | sectionNames [] |
Static Public Attributes inherited from HsaObject | |
static std::vector < std::function< HsaObject *(const std::string &, int, uint8_t *)> > | tryFileFuncs = { BrigObject::tryFile } |
Additional Inherited Members | |
Protected Attributes inherited from HsaObject | |
const std::string | filename |
Definition at line 60 of file brig_object.hh.
Enumerator | |
---|---|
DataSectionIndex | |
CodeSectionIndex | |
OperandsSectionIndex | |
NumSectionIndices |
Definition at line 63 of file brig_object.hh.
BrigObject::BrigObject | ( | const std::string & | fname, |
int | len, | ||
uint8_t * | fileData | ||
) |
Definition at line 415 of file brig_object.cc.
References Brig::BRIG_VERSION_BRIG_MAJOR, Brig::BRIG_VERSION_BRIG_MINOR, Brig::BrigModuleHeader::brigMajor, Brig::BrigModuleHeader::brigMinor, Brig::BrigSectionHeader::byteCount, CodeSectionIndex, DPRINTF, fatal, fatal_if(), getCodeSectionEntry(), Brig::BrigSectionHeader::headerByteCount, ArmISA::i, MODULE_IDENTIFICATION_LENGTH, Brig::BrigSectionHeader::name, Brig::BrigSectionHeader::nameLength, NumSectionIndices, processDirectives(), BrigObject::SectionInfo::ptr, Brig::BrigModuleHeader::sectionCount, Brig::BrigModuleHeader::sectionIndex, sectionInfo, BrigObject::SectionInfo::size, X86ISA::size(), and storageMap.
BrigObject::~BrigObject | ( | ) |
Definition at line 471 of file brig_object.cc.
References ArmISA::i, NumSectionIndices, BrigObject::SectionInfo::ptr, and sectionInfo.
const BrigData * BrigObject::getBrigBaseData | ( | int | offs | ) | const |
Definition at line 104 of file brig_object.cc.
Referenced by ListOperand::init().
const BrigBase * BrigObject::getCodeSectionEntry | ( | int | offs | ) | const |
Definition at line 98 of file brig_object.cc.
Referenced by BrigObject(), findRegDataType(), HsailCode::init(), LabelOperand::init(), FunctionRefOperand::init(), and AddrOperandBase::parseAddr().
const uint8_t * BrigObject::getData | ( | int | offs | ) | const |
Definition at line 110 of file brig_object.cc.
Referenced by findRegDataType(), ImmOperand< T >::init(), ListOperand::init(), BaseRegOperand::init_from_vect(), ImmOperand< T >::init_from_vect(), HsailISA::LdInst< MemDataType, DestDataType, AddrOperandType >::LdInst(), and HsailISA::StInst< MemDataType, SrcDataType, AddrOperandType >::StInst().
|
overridevirtual |
Implements HsaObject.
Definition at line 142 of file brig_object.cc.
const BrigInstBase * BrigObject::getInst | ( | int | offs | ) | const |
Definition at line 130 of file brig_object.cc.
|
overridevirtual |
Implements HsaObject.
Definition at line 136 of file brig_object.cc.
|
inlineoverridevirtual |
Implements HsaObject.
Definition at line 113 of file brig_object.hh.
const BrigOperand * BrigObject::getOperand | ( | int | offs | ) | const |
Definition at line 116 of file brig_object.cc.
Referenced by HsailISA::decodeBr(), HsailISA::decodeBrn(), HsailISA::decodeCbr(), findRegDataType(), BaseRegOperand::init(), ImmOperand< T >::init(), RegOrImmOperand< RegOperand, T >::init(), RegAddrOperand< RegOperandType >::init(), NoRegAddrOperand::init(), LabelOperand::init(), ListOperand::init(), FunctionRefOperand::init(), BaseRegOperand::init_from_vect(), ImmOperand< T >::init_from_vect(), RegOrImmOperand< RegOperand, T >::init_from_vect(), HsailISA::LdInst< MemDataType, DestDataType, AddrOperandType >::LdInst(), HsailISA::LdInstBase< MemDataType::CType, DestDataType::OperandType, AddrOperandType >::LdInstBase(), HsailISA::StInst< MemDataType, SrcDataType, AddrOperandType >::StInst(), and HsailISA::StInstBase< MemDataType, SrcDataType::OperandType, AddrOperandType >::StInstBase().
unsigned BrigObject::getOperandPtr | ( | int | offs, |
int | index | ||
) | const |
Definition at line 122 of file brig_object.cc.
Referenced by HsailISA::AtomicInstBase< MemDataType::OperandType, AddrOperandType, NumSrcOperands, HasDst >::AtomicInstBase(), HsailISA::BrInstBase< SRegOperand >::BrInstBase(), HsailISA::BrnInstBase< SRegOperand >::BrnInstBase(), HsailISA::Call::Call(), HsailISA::CbrInstBase< SRegOperand >::CbrInstBase(), HsailISA::CommonInstBase< DestDataType::OperandType, SrcDataType::OperandType, 1 >::CommonInstBase(), HsailISA::decodeAtomicHelper(), HsailISA::decodeBr(), HsailISA::decodeBrn(), HsailISA::decodeCbr(), HsailISA::decodeLd(), HsailISA::decodeLd2(), HsailISA::decodeLda(), HsailISA::decodeSt(), HsailISA::LdaInstBase< DestDataType::OperandType, AddrOperandType >::LdaInstBase(), HsailISA::LdInst< MemDataType, DestDataType, AddrOperandType >::LdInst(), HsailISA::LdInstBase< MemDataType::CType, DestDataType::OperandType, AddrOperandType >::LdInstBase(), HsailISA::SpecialInst1SrcBase< DestDataType::OperandType >::SpecialInst1SrcBase(), HsailISA::SpecialInstNoSrcBase< DestDataType::OperandType >::SpecialInstNoSrcBase(), HsailISA::StInst< MemDataType, SrcDataType, AddrOperandType >::StInst(), HsailISA::StInstBase< MemDataType, SrcDataType::OperandType, AddrOperandType >::StInstBase(), HsailISA::ThreeNonUniformSourceInstBase< DataType::OperandType, B1::OperandType, DataType::OperandType, DataType::OperandType >::ThreeNonUniformSourceInstBase(), and HsailISA::TwoNonUniformSourceInstBase< DestDataType::OperandType, Src0DataType::OperandType, Src1DataType::OperandType >::TwoNonUniformSourceInstBase().
const uint8_t * BrigObject::getSectionOffset | ( | enum SectionIndex | sec, |
int | offs | ||
) | const |
Definition at line 83 of file brig_object.cc.
References X86ISA::size().
const char * BrigObject::getString | ( | int | offs | ) | const |
Definition at line 92 of file brig_object.cc.
Referenced by LabelMap::addLabel(), StorageSpace::addSymbol(), HsailCode::init(), FunctionRefOperand::init(), BaseRegOperand::initWithStrOffset(), AddrOperandBase::parseAddr(), and LabelMap::refLabel().
|
inlineoverridevirtual |
void BrigObject::processDirectives | ( | const Brig::BrigBase * | dirPtr, |
const Brig::BrigBase * | endPtr, | ||
StorageMap * | storageMap | ||
) |
Definition at line 154 of file brig_object.cc.
References StorageMap::addSymbol(), Brig::BRIG_KIND_DIRECTIVE_ARG_BLOCK_END, Brig::BRIG_KIND_DIRECTIVE_ARG_BLOCK_START, Brig::BRIG_KIND_DIRECTIVE_COMMENT, Brig::BRIG_KIND_DIRECTIVE_CONTROL, Brig::BRIG_KIND_DIRECTIVE_EXTENSION, Brig::BRIG_KIND_DIRECTIVE_FUNCTION, Brig::BRIG_KIND_DIRECTIVE_KERNEL, Brig::BRIG_KIND_DIRECTIVE_LABEL, Brig::BRIG_KIND_DIRECTIVE_LOC, Brig::BRIG_KIND_DIRECTIVE_MODULE, Brig::BRIG_KIND_DIRECTIVE_PRAGMA, Brig::BRIG_KIND_DIRECTIVE_VARIABLE, Brig::BRIG_KIND_INST_BEGIN, Brig::BRIG_KIND_INST_END, Brig::BRIG_KIND_OPERAND_BEGIN, Brig::BRIG_KIND_OPERAND_CONSTANT_BYTES, Brig::BRIG_KIND_OPERAND_END, Brig::BRIG_SEGMENT_READONLY, Brig::BRIG_TYPE_ROIMG, Brig::BRIG_TYPE_SAMP, Brig::BRIG_TYPE_SIG32, Brig::BRIG_TYPE_SIG64, Brig::BRIG_TYPE_WOIMG, brigNext(), Brig::BrigBase::byteCount, DPRINTF, fatal, Brig::BrigDirectiveExecutable::firstCodeBlockEntry, StorageMap::getSize(), ArmISA::i, Brig::BrigDirectiveVariable::init, AlphaISA::Kernel::kernel, Brig::BrigBase::kind, ArmISA::len, M5_VAR_USED, name(), Brig::BrigDirectiveExecutable::name, Brig::BrigDirectiveVariable::name, Brig::BrigDirectiveExecutable::nextModuleEntry, StorageElement::offset, MipsISA::p, panic, Brig::BrigDirectiveVariable::segment, StorageElement::size, Brig::BrigDirectiveVariable::type, and warn.
Referenced by BrigObject().
|
static |
Definition at line 405 of file brig_object.cc.
References MODULE_IDENTIFICATION_LENGTH.
|
mutable |
Definition at line 118 of file brig_object.hh.
Referenced by HsailCode::init(), LabelOperand::init(), ListOperand::init(), and AddrOperandBase::parseAddr().
std::vector<HsailCode*> BrigObject::functions |
Definition at line 86 of file brig_object.hh.
std::string BrigObject::kern_block_name |
Definition at line 87 of file brig_object.hh.
std::vector<HsailCode*> BrigObject::kernels |
Definition at line 85 of file brig_object.hh.
Referenced by getKernel(), and numKernels().
LabelMap* BrigObject::labelMap |
Definition at line 98 of file brig_object.hh.
SectionInfo BrigObject::sectionInfo[NumSectionIndices] |
Definition at line 82 of file brig_object.hh.
Referenced by BrigObject(), and ~BrigObject().
|
static |
Definition at line 71 of file brig_object.hh.
StorageMap* BrigObject::storageMap |
Definition at line 97 of file brig_object.hh.
Referenced by BrigObject().