OpenASIP  2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TTAProgram::TerminalAddress Class Reference

#include <TerminalAddress.hh>

Inheritance diagram for TTAProgram::TerminalAddress:
Inheritance graph
Collaboration diagram for TTAProgram::TerminalAddress:
Collaboration graph

Public Member Functions

 TerminalAddress (SimValue value, const TTAMachine::AddressSpace &space)
 
virtual ~TerminalAddress ()
 
virtual bool isAddress () const
 
virtual Address address () const
 
virtual Terminalcopy () const
 
virtual bool equals (const Terminal &other) const
 
- Public Member Functions inherited from TTAProgram::TerminalImmediate
 TerminalImmediate (SimValue value)
 
virtual ~TerminalImmediate ()
 
virtual bool isImmediate () const
 
virtual SimValue value () const
 
virtual TCEString toString () const
 
- Public Member Functions inherited from TTAProgram::Terminal
 Terminal ()
 
virtual ~Terminal ()
 
virtual bool isInstructionAddress () const
 
virtual bool isImmediateRegister () const
 
virtual bool isGPR () const
 
virtual bool isFUPort () const
 
virtual bool isRA () const
 
virtual bool isBasicBlockReference () const
 
virtual bool isProgramOperationReference () const
 
virtual bool isCodeSymbolReference () const
 
virtual bool isUniversalMachineRegister () const
 
virtual const InstructionReferenceinstructionReference () const
 
virtual InstructionReferenceinstructionReference ()
 
virtual const TTAMachine::RegisterFileregisterFile () const
 
virtual const TTAMachine::ImmediateUnitimmediateUnit () const
 
virtual const TTAMachine::FunctionUnitfunctionUnit () const
 
virtual const BasicBlockbasicBlock () const
 
virtual int index () const
 
virtual bool isOpcodeSetting () const
 
virtual bool isTriggering () const
 
virtual Operationoperation () const
 
virtual OperationhintOperation () const
 
virtual int operationIndex () const
 
virtual const TTAMachine::Portport () const
 
virtual void setIndex (int index)
 
virtual void setInstructionReference (InstructionReference ref)
 
bool operator== (const Terminal &other) const
 
- Public Member Functions inherited from TTAProgram::AnnotatedInstructionElement
 AnnotatedInstructionElement ()
 
 ~AnnotatedInstructionElement ()
 
void addAnnotation (const ProgramAnnotation &annotation)
 
void setAnnotation (const ProgramAnnotation &annotation)
 
ProgramAnnotation annotation (int index, ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID) const
 
int annotationCount (ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID) const
 
void removeAnnotations (ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID)
 
bool hasAnnotations (ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID) const
 
bool hasAnnotation (ProgramAnnotation::Id id, const TCEString &data) const
 
void copyAnnotationsFrom (const AnnotatedInstructionElement &other)
 

Private Member Functions

TerminalAddressoperator= (const TerminalAddress &)
 Assignment not allowed. More...
 

Private Attributes

const TTAMachine::AddressSpacespace_
 Address space of the address. More...
 

Additional Inherited Members

- Protected Attributes inherited from TTAProgram::TerminalImmediate
SimValue value_
 Value of the inline immediate. More...
 

Detailed Description

Represents an inline immediate that refers to a data address.

Definition at line 48 of file TerminalAddress.hh.

Constructor & Destructor Documentation

◆ TerminalAddress()

TTAProgram::TerminalAddress::TerminalAddress ( SimValue  value,
const TTAMachine::AddressSpace space 
)

Constructor. Creates a terminal address from a given immediate value and a reference to an address space.

Parameters
valueValue of the address of the location.
spaceAddress space of the address.

Definition at line 47 of file TerminalAddress.cc.

50  : TerminalImmediate(value), space_(space) {
51 }

Referenced by copy().

◆ ~TerminalAddress()

TTAProgram::TerminalAddress::~TerminalAddress ( )
virtual

The destructor.

Definition at line 56 of file TerminalAddress.cc.

56  {
57 }

Member Function Documentation

◆ address()

Address TTAProgram::TerminalAddress::address ( ) const
virtual

Returns the address carried by this terminal.

Returns
An address.
Exceptions
WrongSubclassnever.

Reimplemented from TTAProgram::Terminal.

Definition at line 77 of file TerminalAddress.cc.

77  {
78  return Address(value_.unsignedValue(), space_);
79 }

References space_, SimValue::unsignedValue(), and TTAProgram::TerminalImmediate::value_.

Referenced by equals().

Here is the call graph for this function:

◆ copy()

Terminal * TTAProgram::TerminalAddress::copy ( ) const
virtual

Creates an exact copy of the terminal and returns it.

Returns
A copy of the terminal.

Reimplemented from TTAProgram::TerminalImmediate.

Definition at line 87 of file TerminalAddress.cc.

87  {
89 }

References space_, TerminalAddress(), and TTAProgram::TerminalImmediate::value().

Here is the call graph for this function:

◆ equals()

bool TTAProgram::TerminalAddress::equals ( const Terminal other) const
virtual

Checks if terminals are equal.

Parameters
otherTerminal to compare.
Returns
true if terminals are equal.

Reimplemented from TTAProgram::TerminalImmediate.

Definition at line 98 of file TerminalAddress.cc.

98  {
99 
100  if (other.isAddress() != true) {
101  return false;
102  }
103  return (address().location() == other.address().location() &&
104  address().space().name() == other.address().space().name());
105 }

References address(), TTAProgram::Terminal::address(), TTAProgram::Terminal::isAddress(), TTAProgram::Address::location(), TTAMachine::Component::name(), and TTAProgram::Address::space().

Here is the call graph for this function:

◆ isAddress()

bool TTAProgram::TerminalAddress::isAddress ( ) const
virtual

Tells whether the terminal is an inline immediate that refers to an address.

Returns
true always.

Reimplemented from TTAProgram::Terminal.

Definition at line 66 of file TerminalAddress.cc.

66  {
67  return true;
68 }

◆ operator=()

TerminalAddress& TTAProgram::TerminalAddress::operator= ( const TerminalAddress )
private

Assignment not allowed.

Member Data Documentation

◆ space_

const TTAMachine::AddressSpace& TTAProgram::TerminalAddress::space_
private

Address space of the address.

Definition at line 61 of file TerminalAddress.hh.

Referenced by address(), and copy().


The documentation for this class was generated from the following files:
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
TTAProgram::Address::space
const TTAMachine::AddressSpace & space() const
TTAProgram::TerminalImmediate::TerminalImmediate
TerminalImmediate(SimValue value)
Definition: TerminalImmediate.cc:48
TTAProgram::TerminalImmediate::value
virtual SimValue value() const
Definition: TerminalImmediate.cc:75
TTAProgram::TerminalAddress::space_
const TTAMachine::AddressSpace & space_
Address space of the address.
Definition: TerminalAddress.hh:61
TTAProgram::TerminalImmediate::value_
SimValue value_
Value of the inline immediate.
Definition: TerminalImmediate.hh:62
TTAProgram::Address::location
InstructionAddress location() const
SimValue::unsignedValue
unsigned int unsignedValue() const
Definition: SimValue.cc:919
TTAProgram::TerminalAddress::address
virtual Address address() const
Definition: TerminalAddress.cc:77
TTAProgram::TerminalAddress::TerminalAddress
TerminalAddress(SimValue value, const TTAMachine::AddressSpace &space)
Definition: TerminalAddress.cc:47