OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
ReservationTableFUResourceConflictDetector Class Reference

#include <ReservationTableFUResourceConflictDetector.hh>

Inheritance diagram for ReservationTableFUResourceConflictDetector:
Inheritance graph
Collaboration diagram for ReservationTableFUResourceConflictDetector:
Collaboration graph

Public Member Functions

 ReservationTableFUResourceConflictDetector (const TTAMachine::FunctionUnit &fu)
 
virtual ~ReservationTableFUResourceConflictDetector ()
 
virtual bool issueOperation (OperationID id)
 
virtual bool advanceCycle ()
 
virtual void reset ()
 
bool issueOperationInline (OperationID id)
 
bool advanceCycleInline ()
 
virtual OperationID operationID (const TCEString &operationName) const
 
- Public Member Functions inherited from FUResourceConflictDetector
 FUResourceConflictDetector ()
 
virtual ~FUResourceConflictDetector ()
 
virtual void endClock ()
 
virtual void advanceClock ()
 
virtual bool isIdle ()
 
- Public Member Functions inherited from ClockedState
 ClockedState ()
 
virtual ~ClockedState ()
 

Private Attributes

FUReservationTableIndex reservationTables_
 The reservation tables of operations. More...
 
ReservationTable globalReservationTable_
 The global reservation table. More...
 
const TTAMachine::FunctionUnitfu_
 The modeled FU. More...
 

Additional Inherited Members

- Public Types inherited from FUResourceConflictDetector
typedef int OperationID
 Type for identifying operations in the conflict detector interface. More...
 
- Protected Attributes inherited from FUResourceConflictDetector
OperationIDIndexoperationIndices_
 Map for finding indices for operations quickly. More...
 

Detailed Description

A Conventional Reservation Table implementation of a FU resource conflict detector.

Definition at line 55 of file ReservationTableFUResourceConflictDetector.hh.

Constructor & Destructor Documentation

◆ ReservationTableFUResourceConflictDetector()

ReservationTableFUResourceConflictDetector::ReservationTableFUResourceConflictDetector ( const TTAMachine::FunctionUnit fu)

Constructor.

Parameters
fuThe function unit to detect conflicts for.
Exceptions
InvalidDataIf the model could not be built from the given FU.

Definition at line 46 of file ReservationTableFUResourceConflictDetector.cc.

◆ ~ReservationTableFUResourceConflictDetector()

ReservationTableFUResourceConflictDetector::~ReservationTableFUResourceConflictDetector ( )
virtual

Destructor.

Definition at line 54 of file ReservationTableFUResourceConflictDetector.cc.

54  {
55 }

Member Function Documentation

◆ advanceCycle()

bool ReservationTableFUResourceConflictDetector::advanceCycle ( )
virtual

Simulates a cycle advance and reports a conflict if detected.

Returns
False in case a conflict is detected, otherwise true.

Reimplemented from FUResourceConflictDetector.

Definition at line 74 of file ReservationTableFUResourceConflictDetector.cc.

74  {
75  return advanceCycleInline();
76 }

References advanceCycleInline().

Here is the call graph for this function:

◆ advanceCycleInline()

bool ReservationTableFUResourceConflictDetector::advanceCycleInline ( )

Referenced by advanceCycle().

◆ issueOperation()

bool ReservationTableFUResourceConflictDetector::issueOperation ( OperationID  id)
virtual

Issues an operation and reports a conflict if detected.

Parameters
idThe id of the operation to issue.
Returns
False in case a conflict is detected, otherwise true.

Reimplemented from FUResourceConflictDetector.

Definition at line 64 of file ReservationTableFUResourceConflictDetector.cc.

64  {
65  return issueOperationInline(id);
66 }

References issueOperationInline().

Here is the call graph for this function:

◆ issueOperationInline()

bool ReservationTableFUResourceConflictDetector::issueOperationInline ( OperationID  id)

Referenced by issueOperation().

◆ operationID()

ReservationTableFUResourceConflictDetector::OperationID ReservationTableFUResourceConflictDetector::operationID ( const TCEString operationName) const
virtual

Returns an operation id for the given operation.

Operation IDs are used in the interface for optimizing the access. This method converts OSAL Operations to operation IDs.

Parameters
operationThe OSAL Operation to find ID for.
Returns
The operation ID.
Exceptions
KeyNotFoundif the operation of given name couldn't be found

Reimplemented from FUResourceConflictDetector.

Definition at line 89 of file ReservationTableFUResourceConflictDetector.cc.

90  {
91 
92  // find the index of the operation in the FU, it corresponds to the
93  // operation ID
94  for (int i = 0; i < fu_.operationCount(); ++i) {
95  if (StringTools::ciEqual(fu_.operation(i)->name(), operationName)) {
96  return i;
97  }
98  }
99  throw KeyNotFound(__FILE__, __LINE__, __func__, "Operation not found.");
100 }

References __func__, StringTools::ciEqual(), fu_, TTAMachine::HWOperation::name(), TTAMachine::FunctionUnit::operation(), and TTAMachine::FunctionUnit::operationCount().

Here is the call graph for this function:

◆ reset()

void ReservationTableFUResourceConflictDetector::reset ( )
virtual

Sets the state of the detector to its initial state.

This means that the FU state is assumed to be what it is in powerup.

Reimplemented from FUResourceConflictDetector.

Definition at line 108 of file ReservationTableFUResourceConflictDetector.cc.

108  {
110 }

References globalReservationTable_, and BitMatrix::setAllToZero().

Here is the call graph for this function:

Member Data Documentation

◆ fu_

const TTAMachine::FunctionUnit& ReservationTableFUResourceConflictDetector::fu_
private

The modeled FU.

Definition at line 77 of file ReservationTableFUResourceConflictDetector.hh.

Referenced by operationID().

◆ globalReservationTable_

ReservationTable ReservationTableFUResourceConflictDetector::globalReservationTable_
private

The global reservation table.

Definition at line 75 of file ReservationTableFUResourceConflictDetector.hh.

Referenced by reset().

◆ reservationTables_

FUReservationTableIndex ReservationTableFUResourceConflictDetector::reservationTables_
private

The reservation tables of operations.

Definition at line 73 of file ReservationTableFUResourceConflictDetector.hh.


The documentation for this class was generated from the following files:
ReservationTableFUResourceConflictDetector::issueOperationInline
bool issueOperationInline(OperationID id)
ReservationTableFUResourceConflictDetector::advanceCycleInline
bool advanceCycleInline()
ReservationTableFUResourceConflictDetector::globalReservationTable_
ReservationTable globalReservationTable_
The global reservation table.
Definition: ReservationTableFUResourceConflictDetector.hh:75
ReservationTableFUResourceConflictDetector::reservationTables_
FUReservationTableIndex reservationTables_
The reservation tables of operations.
Definition: ReservationTableFUResourceConflictDetector.hh:73
ReservationTableFUResourceConflictDetector::fu_
const TTAMachine::FunctionUnit & fu_
The modeled FU.
Definition: ReservationTableFUResourceConflictDetector.hh:77
BitMatrix::setAllToZero
void setAllToZero()
Definition: BitMatrix.cc:93
TTAMachine::HWOperation::name
const std::string & name() const
Definition: HWOperation.cc:141
__func__
#define __func__
Definition: Application.hh:67
TTAMachine::FunctionUnit::operationCount
virtual int operationCount() const
Definition: FunctionUnit.cc:419
StringTools::ciEqual
static bool ciEqual(const std::string &a, const std::string &b)
Definition: StringTools.cc:240
KeyNotFound
Definition: Exception.hh:285
TTAMachine::FunctionUnit::operation
virtual HWOperation * operation(const std::string &name) const
Definition: FunctionUnit.cc:363