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

#include <TerminalImmediate.hh>

Inheritance diagram for TTAProgram::TerminalImmediate:
Inheritance graph
Collaboration diagram for TTAProgram::TerminalImmediate:
Collaboration graph

Public Member Functions

 TerminalImmediate (SimValue value)
 
virtual ~TerminalImmediate ()
 
virtual bool isImmediate () const
 
virtual SimValue value () const
 
virtual Terminalcopy () const
 
virtual bool equals (const Terminal &other) const
 
virtual TCEString toString () const
 
- Public Member Functions inherited from TTAProgram::Terminal
 Terminal ()
 
virtual ~Terminal ()
 
virtual bool isAddress () const
 
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 Address address () 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)
 

Protected Attributes

SimValue value_
 Value of the inline immediate. More...
 

Private Member Functions

TerminalImmediateoperator= (const TerminalImmediate &)
 Assignment not allowed. More...
 

Detailed Description

Represents an inline immediate.

Definition at line 44 of file TerminalImmediate.hh.

Constructor & Destructor Documentation

◆ TerminalImmediate()

TTAProgram::TerminalImmediate::TerminalImmediate ( SimValue  value)

The constructor.

Parameters
valueThe value of the inline immediate.

Definition at line 48 of file TerminalImmediate.cc.

48  :
49  value_(value) {
50 }

Referenced by copy().

◆ ~TerminalImmediate()

TTAProgram::TerminalImmediate::~TerminalImmediate ( )
virtual

The destructor.

Definition at line 55 of file TerminalImmediate.cc.

55  {
56 }

Member Function Documentation

◆ copy()

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

Creates an exact copy of the terminal and returns it.

Returns
A copy of the terminal.

Implements TTAProgram::Terminal.

Reimplemented in TTAProgram::TerminalInstructionAddress, TTAProgram::TerminalProgramOperation, TTAProgram::TerminalInstructionReference, TTAProgram::TerminalAddress, TTAProgram::TerminalLaneIDImmediate, TTAProgram::TerminalBasicBlockReference, and TTAProgram::TerminalSymbolReference.

Definition at line 85 of file TerminalImmediate.cc.

85  {
86  return new TerminalImmediate(value_);
87 }

References TerminalImmediate(), and value_.

Referenced by TTAProgram::Immediate::copy(), and IUResource::unassign().

Here is the call graph for this function:

◆ equals()

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

Checks if terminals are equal.

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

Implements TTAProgram::Terminal.

Reimplemented in TTAProgram::TerminalInstructionAddress, TTAProgram::TerminalProgramOperation, TTAProgram::TerminalInstructionReference, TTAProgram::TerminalAddress, TTAProgram::TerminalLaneIDImmediate, TTAProgram::TerminalBasicBlockReference, and TTAProgram::TerminalSymbolReference.

Definition at line 96 of file TerminalImmediate.cc.

96  {
97 
98  if (other.isImmediate() != true) {
99  return false;
100  }
101  if (typeid(*this) != typeid(other)) {
102  return false;
103  }
104  return value() == other.value();
105 }

References TTAProgram::Terminal::isImmediate(), value(), and TTAProgram::Terminal::value().

Here is the call graph for this function:

◆ isImmediate()

bool TTAProgram::TerminalImmediate::isImmediate ( ) const
virtual

Tells whether the terminal is an inline immediate value.

Returns
true always.

Reimplemented from TTAProgram::Terminal.

Definition at line 64 of file TerminalImmediate.cc.

64  {
65  return true;
66 }

◆ operator=()

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

Assignment not allowed.

◆ toString()

TCEString TTAProgram::TerminalImmediate::toString ( ) const
virtual

Implements TTAProgram::Terminal.

Reimplemented in TTAProgram::TerminalLaneIDImmediate, and TTAProgram::TerminalSymbolReference.

Definition at line 108 of file TerminalImmediate.cc.

108  {
109  DisassemblyImmediate* disasm =
111  TCEString dis = disasm->toString();
112  delete disasm;
113  return dis;
114 }

References POMDisassembler::createInlineImmediate(), and DisassemblyImmediate::toString().

Referenced by MachineConnectivityCheck::requiredImmediateWidth().

Here is the call graph for this function:

◆ value()

SimValue TTAProgram::TerminalImmediate::value ( ) const
virtual

Member Data Documentation

◆ value_

SimValue TTAProgram::TerminalImmediate::value_
protected

Value of the inline immediate.

Definition at line 62 of file TerminalImmediate.hh.

Referenced by TTAProgram::TerminalAddress::address(), copy(), and value().


The documentation for this class was generated from the following files:
DisassemblyImmediate::toString
virtual std::string toString() const
Definition: DisassemblyImmediate.cc:61
TTAProgram::TerminalImmediate::TerminalImmediate
TerminalImmediate(SimValue value)
Definition: TerminalImmediate.cc:48
POMDisassembler::createInlineImmediate
static DisassemblyImmediate * createInlineImmediate(const TTAProgram::Terminal &terminal, bool signExtend)
Definition: POMDisassembler.cc:296
TTAProgram::TerminalImmediate::value
virtual SimValue value() const
Definition: TerminalImmediate.cc:75
TTAProgram::TerminalImmediate::value_
SimValue value_
Value of the inline immediate.
Definition: TerminalImmediate.hh:62
DisassemblyImmediate
Definition: DisassemblyImmediate.hh:42
TCEString
Definition: TCEString.hh:53