OpenASIP  2.0
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
TTAMachine::TemplateSlot Class Reference

#include <TemplateSlot.hh>

Collaboration diagram for TTAMachine::TemplateSlot:
Collaboration graph

Public Member Functions

 TemplateSlot (const Bus &slot, int width, ImmediateUnit &destination)
 
 TemplateSlot (const ImmediateSlot &slot, int width, ImmediateUnit &destination)
 
 TemplateSlot (const Bus &slot)
 
virtual ~TemplateSlot ()
 
int width () const
 
std::string slot () const
 
ImmediateUnitdestination () const
 
ObjectStatesaveState () const
 
const Busbus () const
 

Static Public Attributes

static const std::string OSNAME_TEMPLATE_SLOT = "template_slot"
 ObjectState name for template slot. More...
 
static const std::string OSKEY_SLOT = "slot"
 ObjectState attribute key for slot name. More...
 
static const std::string OSKEY_WIDTH = "width"
 ObjectState attribute key for bit width. More...
 
static const std::string OSKEY_DESTINATION = "destination"
 ObjectState attribute key for destination. More...
 
static const std::string OSKEY_RF_READ = "rf_read"
 
static const std::string OSKEY_RF_WRITE = "rf_write"
 
static const std::string OSKEY_FU_READ = "fu_read"
 
static const std::string OSKEY_FU_WRITE = "fu_write"
 

Private Attributes

const Busbus_
 The bus which is programmed by the instruction bit field of this template slot. More...
 
const ImmediateSlotimmSlot_
 The immediate slot which is programmed by the instruction bit field of this template slot. More...
 
int width_
 The number of bits that can be encoded in this instruction field. More...
 
ImmediateUnitdestination_
 Destination unit. More...
 

Detailed Description

Repsesents a bit field of the TTA instruction that is used to encode a piece of a long immediate for a given instruction template or a NOP move.

Definition at line 55 of file TemplateSlot.hh.

Constructor & Destructor Documentation

◆ TemplateSlot() [1/3]

TTAMachine::TemplateSlot::TemplateSlot ( const Bus slot,
int  width,
ImmediateUnit destination 
)

Constructor.

Parameters
slotThe bus or which is programmed by the instruction bit field of this template slot.
widthThe number of significant bits that can be encoded in this instruction field.
destinationThe destination ImmediateUnit, that is, the ImmediateUnit that contains the registers that can be written with the bits in this template slot.

Definition at line 64 of file TemplateSlot.cc.

67  :
69 }

◆ TemplateSlot() [2/3]

TTAMachine::TemplateSlot::TemplateSlot ( const ImmediateSlot slot,
int  width,
ImmediateUnit destination 
)

Constructor.

Parameters
slotThe immediate slot which is programmed by the instruction bit field of this template slot.
widthThe number of significant bits that can be encoded in this instruction field.
destinationThe destination ImmediateUnit, that is, the ImmediateUnit that contains the registers that can be written with the bits in this template slot.

Definition at line 82 of file TemplateSlot.cc.

85  :
87 }

◆ TemplateSlot() [3/3]

TTAMachine::TemplateSlot::TemplateSlot ( const Bus slot)

Creates an implicit slot in a template that does not target an ImmediateUnit.

Parameters
slotThe bus or which is programmed by the instruction bit field of this template slot.

Definition at line 97 of file TemplateSlot.cc.

98  : bus_(&slot), width_(0), destination_(NULL) {}

◆ ~TemplateSlot()

TTAMachine::TemplateSlot::~TemplateSlot ( )
virtual

Destructor.

Definition at line 103 of file TemplateSlot.cc.

103  {
104 }

Member Function Documentation

◆ bus()

const Bus* TTAMachine::TemplateSlot::bus ( ) const

◆ destination()

ImmediateUnit* TTAMachine::TemplateSlot::destination ( ) const

◆ saveState()

ObjectState * TTAMachine::TemplateSlot::saveState ( ) const

Saves the state of the object into an ObjectState instance.

Returns
The newly created ObjectState instance.

Definition at line 113 of file TemplateSlot.cc.

113  {
114  ObjectState* slotState = new ObjectState(OSNAME_TEMPLATE_SLOT);
115  slotState->setAttribute(OSKEY_SLOT, slot());
116  slotState->setAttribute(OSKEY_WIDTH, width());
117  slotState->setAttribute(OSKEY_DESTINATION, destination()->name());
118  return slotState;
119 }

References destination(), OSKEY_DESTINATION, OSKEY_SLOT, OSKEY_WIDTH, OSNAME_TEMPLATE_SLOT, ObjectState::setAttribute(), slot(), and width().

Referenced by TTAMachine::InstructionTemplate::saveState().

Here is the call graph for this function:

◆ slot()

std::string TTAMachine::TemplateSlot::slot ( ) const

◆ width()

int TTAMachine::TemplateSlot::width ( ) const

Member Data Documentation

◆ bus_

const Bus* TTAMachine::TemplateSlot::bus_
private

The bus which is programmed by the instruction bit field of this template slot.

Definition at line 100 of file TemplateSlot.hh.

◆ destination_

ImmediateUnit* TTAMachine::TemplateSlot::destination_
private

Destination unit.

Definition at line 110 of file TemplateSlot.hh.

◆ immSlot_

const ImmediateSlot* TTAMachine::TemplateSlot::immSlot_
private

The immediate slot which is programmed by the instruction bit field of this template slot.

Definition at line 104 of file TemplateSlot.hh.

◆ OSKEY_DESTINATION

const string TTAMachine::TemplateSlot::OSKEY_DESTINATION = "destination"
static

ObjectState attribute key for destination.

Definition at line 85 of file TemplateSlot.hh.

Referenced by TTAMachine::InstructionTemplate::loadState(), and saveState().

◆ OSKEY_FU_READ

const string TTAMachine::TemplateSlot::OSKEY_FU_READ = "fu_read"
static

Definition at line 91 of file TemplateSlot.hh.

◆ OSKEY_FU_WRITE

const string TTAMachine::TemplateSlot::OSKEY_FU_WRITE = "fu_write"
static

Definition at line 93 of file TemplateSlot.hh.

◆ OSKEY_RF_READ

const string TTAMachine::TemplateSlot::OSKEY_RF_READ = "rf_read"
static

Definition at line 87 of file TemplateSlot.hh.

◆ OSKEY_RF_WRITE

const string TTAMachine::TemplateSlot::OSKEY_RF_WRITE = "rf_write"
static

Definition at line 89 of file TemplateSlot.hh.

◆ OSKEY_SLOT

const string TTAMachine::TemplateSlot::OSKEY_SLOT = "slot"
static

ObjectState attribute key for slot name.

Definition at line 81 of file TemplateSlot.hh.

Referenced by TTAMachine::InstructionTemplate::loadState(), and saveState().

◆ OSKEY_WIDTH

const string TTAMachine::TemplateSlot::OSKEY_WIDTH = "width"
static

ObjectState attribute key for bit width.

Definition at line 83 of file TemplateSlot.hh.

Referenced by TTAMachine::InstructionTemplate::loadState(), and saveState().

◆ OSNAME_TEMPLATE_SLOT

const string TTAMachine::TemplateSlot::OSNAME_TEMPLATE_SLOT = "template_slot"
static

ObjectState name for template slot.

Definition at line 79 of file TemplateSlot.hh.

Referenced by TTAMachine::InstructionTemplate::loadState(), and saveState().

◆ width_

int TTAMachine::TemplateSlot::width_
private

The number of bits that can be encoded in this instruction field.

Definition at line 107 of file TemplateSlot.hh.


The documentation for this class was generated from the following files:
TTAMachine::TemplateSlot::OSKEY_SLOT
static const std::string OSKEY_SLOT
ObjectState attribute key for slot name.
Definition: TemplateSlot.hh:81
TTAMachine::TemplateSlot::OSNAME_TEMPLATE_SLOT
static const std::string OSNAME_TEMPLATE_SLOT
ObjectState name for template slot.
Definition: TemplateSlot.hh:79
ObjectState
Definition: ObjectState.hh:59
TTAMachine::TemplateSlot::OSKEY_WIDTH
static const std::string OSKEY_WIDTH
ObjectState attribute key for bit width.
Definition: TemplateSlot.hh:83
TTAMachine::TemplateSlot::destination
ImmediateUnit * destination() const
TTAMachine::TemplateSlot::slot
std::string slot() const
TTAMachine::TemplateSlot::immSlot_
const ImmediateSlot * immSlot_
The immediate slot which is programmed by the instruction bit field of this template slot.
Definition: TemplateSlot.hh:104
TTAMachine::TemplateSlot::width_
int width_
The number of bits that can be encoded in this instruction field.
Definition: TemplateSlot.hh:107
TTAMachine::TemplateSlot::bus_
const Bus * bus_
The bus which is programmed by the instruction bit field of this template slot.
Definition: TemplateSlot.hh:100
TTAMachine::TemplateSlot::width
int width() const
TTAMachine::TemplateSlot::destination_
ImmediateUnit * destination_
Destination unit.
Definition: TemplateSlot.hh:110
ObjectState::setAttribute
void setAttribute(const std::string &name, const std::string &value)
Definition: ObjectState.cc:100
TTAMachine::TemplateSlot::OSKEY_DESTINATION
static const std::string OSKEY_DESTINATION
ObjectState attribute key for destination.
Definition: TemplateSlot.hh:85