OpenASIP
2.0
|
#include <TPEFCodeSectionReader.hh>
Protected Member Functions | |
TPEFCodeSectionReader () | |
virtual | ~TPEFCodeSectionReader () |
virtual void | readData (BinaryStream &stream, Section *section) const |
virtual Section::SectionType | type () const |
virtual void | readInfo (BinaryStream &stream, Section *sect) const |
virtual HalfWord | readId (BinaryStream &stream) const |
Protected Member Functions inherited from TPEF::TPEFSectionReader | |
TPEFSectionReader () | |
virtual BinaryReader * | parent () const |
Protected Member Functions inherited from TPEF::SectionReader | |
SectionReader () | |
virtual void | finalize (Section *section) const |
Private Member Functions | |
TPEFCodeSectionReader (const TPEFCodeSectionReader &) | |
Copying not allowed. More... | |
TPEFCodeSectionReader & | operator= (TPEFCodeSectionReader &) |
Assignment not allowed. More... | |
void | readAnnotations (BinaryStream &stream, InstructionElement *elem) const |
Static Private Attributes | |
static TPEFCodeSectionReader | proto_ |
Prototype instance of TPEFCodeSectionReader to be registered to SectionReader. More... | |
Additional Inherited Members | |
Public Types inherited from TPEF::SectionReader | |
typedef BinaryReader::Length | Length |
Public Member Functions inherited from TPEF::TPEFSectionReader | |
virtual | ~TPEFSectionReader () |
Public Member Functions inherited from TPEF::SectionReader | |
virtual | ~SectionReader () |
Static Public Member Functions inherited from TPEF::SectionReader | |
static void | readSection (BinaryStream &stream, Section *section, BinaryReader *reader) |
static void | finalizeBinary (Binary *binaryToFinalize, BinaryReader *reader) |
Static Protected Member Functions inherited from TPEF::TPEFSectionReader | |
static const Header & | header () |
Static Protected Member Functions inherited from TPEF::SectionReader | |
static const SectionReader * | findSectionReader (const Section::SectionType type, const BinaryReader *bReader) |
static void | registerSectionReader (const SectionReader *sReader) |
Reads code section from TPEF binary file.
Definition at line 47 of file TPEFCodeSectionReader.hh.
|
protected |
Constructor.
Registers itself to SectionReader.
Definition at line 60 of file TPEFCodeSectionReader.cc.
References TPEF::SectionReader::registerSectionReader().
|
protectedvirtual |
|
private |
Copying not allowed.
|
private |
Assignment not allowed.
|
private |
Reads annotation fields and adds them to instruction.
TODO: move to inline file...
stream | Stream pointing to start of annotation. |
elem | Instruction where read annotations are added. |
Definition at line 285 of file TPEFCodeSectionReader.cc.
References TPEF::InstructionElement::addAnnotation(), TPEF::InstructionAnnotation::addByte(), BYTE_BITWIDTH, TPEF::TPEFHeaders::IANNOTE_CONTINUATION, TPEF::TPEFHeaders::IANNOTE_SIZE, and TPEF::BinaryStream::readByte().
Referenced by readData().
|
protectedvirtual |
Reads section data from TPEF binary file.
stream | Stream to be read from. |
section | Section where the information is to be stored. |
UnreachableStream | If reading of section fails. |
KeyAlreadyExists | Key was in use when trying to register object. |
EndOfFile | If end of file were reached while it shouldn't. |
OutOfRange | Some of read values were out of range. |
WrongSubclass | Some class couldn't do what it was asked for. |
UnexpectedValue | If there was unexpected value when reading. |
Reimplemented from TPEF::TPEFSectionReader.
Definition at line 93 of file TPEFCodeSectionReader.cc.
References TPEF::ImmediateElement::addByte(), TPEF::CodeSection::addElement(), TPEF::ReferenceManager::SafePointer::addObjectReference(), assert, TPEF::InstructionElement::begin(), BYTE_BITWIDTH, TPEF::TPEFSectionReader::header(), TPEF::TPEFHeaders::IA_ANNOTE, TPEF::TPEFHeaders::IA_EMPTY, TPEF::TPEFHeaders::IA_END, TPEF::TPEFHeaders::IA_MGUARD, TPEF::TPEFHeaders::IA_TYPE, TPEF::TPEFHeaders::IE_DST_TYPE_MASK, TPEF::TPEFHeaders::IE_GUARD_INV_MASK, TPEF::TPEFHeaders::IE_GUARD_TYPE_MASK, TPEF::TPEFHeaders::IE_SRC_TYPE_MASK, TPEF::MoveElement::MF_IMM, TPEF::MoveElement::MF_RF, TPEF::MoveElement::MF_UNIT, TPEF::TPEFHeaders::MVD_RF, TPEF::TPEFHeaders::MVD_UNIT, TPEF::TPEFHeaders::MVG_RF, TPEF::TPEFHeaders::MVG_UNIT, TPEF::TPEFHeaders::MVS_IMM, TPEF::TPEFHeaders::MVS_RF, TPEF::TPEFHeaders::MVS_UNIT, TPEF::Section::noBits(), TPEF::TPEFSectionReader::parent(), readAnnotations(), TPEF::BinaryStream::readByte(), TPEF::TPEFSectionReader::readData(), TPEF::BinaryStream::readHalfWord(), readId(), TPEF::BinaryStream::readPosition(), TPEF::InstructionElement::setBegin(), TPEF::MoveElement::setBus(), TPEF::ImmediateElement::setDestinationIndex(), TPEF::MoveElement::setDestinationIndex(), TPEF::MoveElement::setDestinationType(), TPEF::ImmediateElement::setDestinationUnit(), TPEF::MoveElement::setDestinationUnit(), TPEF::MoveElement::setEmpty(), TPEF::MoveElement::setGuarded(), TPEF::MoveElement::setGuardIndex(), TPEF::MoveElement::setGuardInverted(), TPEF::MoveElement::setGuardType(), TPEF::MoveElement::setGuardUnit(), TPEF::MoveElement::setSourceIndex(), TPEF::MoveElement::setSourceType(), and TPEF::MoveElement::setSourceUnit().
|
protectedvirtual |
Reads Bus, FU or RF id according to TPEF version.
Original TPEF version 1 supports only less than 256 buses, FUs and RFs. Version 2 fixes that issue and we need to check the stream version for proper amount of bytes to read.
stream | Stream to which the data is read. |
Definition at line 326 of file TPEFCodeSectionReader.cc.
References TPEF::BinaryStream::readByte(), TPEF::BinaryStream::readHalfWord(), TPEF::TPEFHeaders::TPEF_V1, and TPEF::BinaryStream::TPEFVersion().
Referenced by readData().
|
protectedvirtual |
Reads the info field of code section header.
The ‘info’ field of code sections normally contains the size of instruction word in memory image (in MAUs) and the instruction encoding type identifier. This information is ignored by the TUT_TTA architecture. The read position of the stream is moved 4 bytes forward.
stream | Stream from which the field is read. |
sect | Target section. Unused. |
Reimplemented from TPEF::TPEFSectionReader.
Definition at line 266 of file TPEFCodeSectionReader.cc.
References assert, TPEF::BinaryStream::readByte(), and TPEF::BinaryStream::readHalfWord().
|
protectedvirtual |
Returns the type of section it is meant to read.
Implements TPEF::SectionReader.
Definition at line 76 of file TPEFCodeSectionReader.cc.
References TPEF::Section::ST_CODE.
|
staticprivate |
Prototype instance of TPEFCodeSectionReader to be registered to SectionReader.
Definition at line 70 of file TPEFCodeSectionReader.hh.