OpenASIP  2.0
Public Types | Public Member Functions | List of all members
ReservationTable Class Reference

#include <ReservationTable.hh>

Inheritance diagram for ReservationTable:
Inheritance graph
Collaboration diagram for ReservationTable:
Collaboration graph

Public Types

typedef int ResourceID
 

Public Member Functions

 ReservationTable (const TTAMachine::FunctionUnit &fu)
 
 ReservationTable (const TTAMachine::HWOperation &operation)
 
virtual ~ReservationTable ()
 
void init (const TTAMachine::FunctionUnit &fu)
 
bool conflictsWith (const ReservationTable &anotherReservationTable, int cycle) const
 
void issueOperation (ReservationTable &anotherReservationTable)
 
void advanceCycle ()
 
bool isReserved (ResourceID resource, int cycle) const
 
bool conflictsWith (const BitMatrix &another) const
 
- Public Member Functions inherited from BitMatrix
 BitMatrix (int width, int height, bool initialValue)
 
 BitMatrix (const BitMatrix &another)
 
virtual ~BitMatrix ()
 
bool bitAt (int column, int row) const
 
void setBit (int column, int row, bool value)
 
void setAllToZero ()
 
void setAllToOne ()
 
void shiftLeft ()
 
void orWith (const BitMatrix &another)
 
bool conflictsWith (const BitMatrix &another) const
 
int rowCount () const
 
int columnCount () const
 
std::string toString () const
 
std::string toDotString () const
 
bool operator== (const BitMatrix &other) const
 
bool operator< (const BitMatrix &rightHand) const
 

Detailed Description

Models pipeline resources using a Conventional Reservation Table (CRT).

An efficient implementation to avoid all kinds of function overheads etc. All simulation operations can be done by calling inline methods.

Definition at line 49 of file ReservationTable.hh.

Member Typedef Documentation

◆ ResourceID

Definition at line 52 of file ReservationTable.hh.

Constructor & Destructor Documentation

◆ ReservationTable() [1/2]

ReservationTable::ReservationTable ( const TTAMachine::FunctionUnit fu)

Builds an empty reservation table of given width for the given function unit.

Parameters
fuThe function unit of which resources to build the reservation table of.
cycleCountThe count of cycle columns.

Definition at line 51 of file ReservationTable.cc.

51  :
52  BitMatrix(
53  fu.maxLatency(),
55  false) {
56 }

◆ ReservationTable() [2/2]

ReservationTable::ReservationTable ( const TTAMachine::HWOperation operation)

Builds a reservation table for the given operation.

Also includes empty resource rows so the reservation table is compatible with the global reservation table for the whole function unit.

Parameters
operationThe operation of which resources to use.

Definition at line 66 of file ReservationTable.cc.

66  :
67  BitMatrix(
68  operation.parentUnit()->maxLatency(),
69  operation.parentUnit()->operationPortCount() +
70  operation.parentUnit()->pipelineElementCount(), false) {
71 
72  const TTAMachine::FunctionUnit& fu = *operation.parentUnit();
73 
74  // First resource rows represent the input and output ports of the FU.
75  for (int p = 0; p < fu.operationPortCount(); ++p) {
76  for (int cycle = 0; cycle < columnCount(); ++cycle) {
77  setBit(
78  cycle, p, operation.pipeline()->isPortUsed(
79  *fu.operationPort(p), cycle));
80  }
81  }
82  // Rest of the rows are pipeline resources.
83  for (int r = 0; r < fu.pipelineElementCount(); ++r) {
84  for (int cycle = 0; cycle < columnCount(); ++cycle) {
85  setBit(
86  cycle, fu.operationPortCount() + r,
87  operation.pipeline()->isResourceUsed(
88  fu.pipelineElement(r)->name(), cycle));
89  }
90  }
91 }

References BitMatrix::columnCount(), TTAMachine::ExecutionPipeline::isPortUsed(), TTAMachine::ExecutionPipeline::isResourceUsed(), TTAMachine::PipelineElement::name(), TTAMachine::FunctionUnit::operationPort(), TTAMachine::FunctionUnit::operationPortCount(), TTAMachine::HWOperation::parentUnit(), TTAMachine::HWOperation::pipeline(), TTAMachine::FunctionUnit::pipelineElement(), TTAMachine::FunctionUnit::pipelineElementCount(), and BitMatrix::setBit().

Here is the call graph for this function:

◆ ~ReservationTable()

ReservationTable::~ReservationTable ( )
virtual

Destructor.

Definition at line 96 of file ReservationTable.cc.

96  {
97 }

Member Function Documentation

◆ advanceCycle()

void ReservationTable::advanceCycle ( )

◆ conflictsWith() [1/2]

bool BitMatrix::conflictsWith

◆ conflictsWith() [2/2]

bool ReservationTable::conflictsWith ( const ReservationTable anotherReservationTable,
int  cycle 
) const

◆ init()

void ReservationTable::init ( const TTAMachine::FunctionUnit fu)

◆ isReserved()

bool ReservationTable::isReserved ( ResourceID  resource,
int  cycle 
) const

◆ issueOperation()

void ReservationTable::issueOperation ( ReservationTable anotherReservationTable)

The documentation for this class was generated from the following files:
TTAMachine::ExecutionPipeline::isPortUsed
bool isPortUsed(const FUPort &port, int cycle) const
Definition: ExecutionPipeline.cc:349
TTAMachine::PipelineElement::name
const std::string & name() const
TTAMachine::FunctionUnit::maxLatency
virtual int maxLatency() const
Definition: FunctionUnit.cc:443
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
TTAMachine::FunctionUnit::pipelineElement
virtual PipelineElement * pipelineElement(int index) const
Definition: FunctionUnit.cc:523
BitMatrix::BitMatrix
BitMatrix(int width, int height, bool initialValue)
Definition: BitMatrix.cc:46
TTAMachine::FunctionUnit::operationPortCount
virtual int operationPortCount() const
Definition: FunctionUnit.cc:182
TTAMachine::FunctionUnit::pipelineElementCount
virtual int pipelineElementCount() const
Definition: FunctionUnit.cc:507
BitMatrix::columnCount
int columnCount() const
TTAMachine::HWOperation::parentUnit
FunctionUnit * parentUnit() const
Definition: HWOperation.cc:190
TTAMachine::HWOperation::pipeline
ExecutionPipeline * pipeline() const
Definition: HWOperation.cc:201
BitMatrix::setBit
void setBit(int column, int row, bool value)
TTAMachine::FunctionUnit::operationPort
virtual FUPort * operationPort(const std::string &name) const
Definition: FunctionUnit.cc:224
TTAMachine::ExecutionPipeline::isResourceUsed
bool isResourceUsed(const std::string &name, int cycle) const
Definition: ExecutionPipeline.cc:300