gem5  v20.1.0.0
Public Member Functions | Private Attributes | List of all members
TraceCPU::ElasticDataGen::HardwareResource Class Reference

The HardwareResource class models structures that hold the in-flight nodes. More...

Public Member Functions

 HardwareResource (uint16_t max_rob, uint16_t max_stores, uint16_t max_loads)
 Constructor that initializes the sizes of the structures. More...
 
void occupy (const GraphNode *new_node)
 Occupy appropriate structures for an issued node. More...
 
void release (const GraphNode *done_node)
 Release appropriate structures for a completed node. More...
 
void releaseStoreBuffer ()
 Release store buffer entry for a completed store. More...
 
bool isAvailable (const GraphNode *new_node) const
 Check if structures required to issue a node are free. More...
 
bool awaitingResponse () const
 Check if there are any outstanding requests, i.e. More...
 
void printOccupancy ()
 Print resource occupancy for debugging. More...
 

Private Attributes

const uint16_t sizeROB
 The size of the ROB used to throttle the max. More...
 
const uint16_t sizeStoreBuffer
 The size of store buffer. More...
 
const uint16_t sizeLoadBuffer
 The size of load buffer. More...
 
std::map< NodeSeqNum, NodeRobNuminFlightNodes
 A map from the sequence number to the ROB number of the in- flight nodes. More...
 
NodeRobNum oldestInFlightRobNum
 The ROB number of the oldest in-flight node. More...
 
uint16_t numInFlightLoads
 Number of ready loads for which request may or may not be sent. More...
 
uint16_t numInFlightStores
 Number of ready stores for which request may or may not be sent. More...
 

Detailed Description

The HardwareResource class models structures that hold the in-flight nodes.

When a node becomes dependency free, first check if resources are available to issue it.

Definition at line 697 of file trace_cpu.hh.

Constructor & Destructor Documentation

◆ HardwareResource()

TraceCPU::ElasticDataGen::HardwareResource::HardwareResource ( uint16_t  max_rob,
uint16_t  max_stores,
uint16_t  max_loads 
)

Constructor that initializes the sizes of the structures.

Parameters
max_robsize of the Reorder Buffer
max_storessize of Store Buffer
max_loadssize of Load Buffer

Definition at line 821 of file trace_cpu.cc.

Member Function Documentation

◆ awaitingResponse()

bool TraceCPU::ElasticDataGen::HardwareResource::awaitingResponse ( ) const

Check if there are any outstanding requests, i.e.

requests for which we are yet to receive a response.

Returns
true if there is at least one read or write request outstanding

Definition at line 943 of file trace_cpu.cc.

Referenced by TraceCPU::ElasticDataGen::execute().

◆ isAvailable()

bool TraceCPU::ElasticDataGen::HardwareResource::isAvailable ( const GraphNode new_node) const

Check if structures required to issue a node are free.

Parameters
node_ptrpointer to the node ready to issue
Returns
true if resources are available

Definition at line 899 of file trace_cpu.cc.

References DPRINTFR, TraceCPU::ElasticDataGen::GraphNode::isLoad(), TraceCPU::ElasticDataGen::GraphNode::isStore(), TraceCPU::ElasticDataGen::GraphNode::robNum, and TraceCPU::ElasticDataGen::GraphNode::seqNum.

Referenced by TraceCPU::ElasticDataGen::checkAndIssue(), and TraceCPU::ElasticDataGen::execute().

◆ occupy()

void TraceCPU::ElasticDataGen::HardwareResource::occupy ( const GraphNode new_node)

Occupy appropriate structures for an issued node.

Parameters
node_ptrpointer to the issued node

Definition at line 832 of file trace_cpu.cc.

References TraceCPU::ElasticDataGen::GraphNode::isLoad(), TraceCPU::ElasticDataGen::GraphNode::isStore(), TraceCPU::ElasticDataGen::GraphNode::robNum, and TraceCPU::ElasticDataGen::GraphNode::seqNum.

Referenced by TraceCPU::ElasticDataGen::checkAndIssue().

◆ printOccupancy()

void TraceCPU::ElasticDataGen::HardwareResource::printOccupancy ( )

Print resource occupancy for debugging.

Definition at line 949 of file trace_cpu.cc.

References DPRINTFR.

Referenced by TraceCPU::ElasticDataGen::execute().

◆ release()

void TraceCPU::ElasticDataGen::HardwareResource::release ( const GraphNode done_node)

◆ releaseStoreBuffer()

void TraceCPU::ElasticDataGen::HardwareResource::releaseStoreBuffer ( )

Release store buffer entry for a completed store.

Definition at line 892 of file trace_cpu.cc.

Referenced by TraceCPU::ElasticDataGen::completeMemAccess().

Member Data Documentation

◆ inFlightNodes

std::map<NodeSeqNum, NodeRobNum> TraceCPU::ElasticDataGen::HardwareResource::inFlightNodes
private

A map from the sequence number to the ROB number of the in- flight nodes.

This includes all nodes that are in the readyList plus the loads for which a request has been sent which are not present in the readyList. But such loads are not yet complete and thus occupy resources. We need to query the oldest in-flight node and since a map container keeps all its keys sorted using the less than criterion, the first element is the in-flight node with the least sequence number, i.e. the oldest in-flight node.

Definition at line 776 of file trace_cpu.hh.

◆ numInFlightLoads

uint16_t TraceCPU::ElasticDataGen::HardwareResource::numInFlightLoads
private

Number of ready loads for which request may or may not be sent.

Definition at line 782 of file trace_cpu.hh.

◆ numInFlightStores

uint16_t TraceCPU::ElasticDataGen::HardwareResource::numInFlightStores
private

Number of ready stores for which request may or may not be sent.

Definition at line 785 of file trace_cpu.hh.

◆ oldestInFlightRobNum

NodeRobNum TraceCPU::ElasticDataGen::HardwareResource::oldestInFlightRobNum
private

The ROB number of the oldest in-flight node.

Definition at line 779 of file trace_cpu.hh.

◆ sizeLoadBuffer

const uint16_t TraceCPU::ElasticDataGen::HardwareResource::sizeLoadBuffer
private

The size of load buffer.

This is used to throttle the max. number of in-flight loads.

Definition at line 764 of file trace_cpu.hh.

◆ sizeROB

const uint16_t TraceCPU::ElasticDataGen::HardwareResource::sizeROB
private

The size of the ROB used to throttle the max.

number of in-flight nodes.

Definition at line 752 of file trace_cpu.hh.

◆ sizeStoreBuffer

const uint16_t TraceCPU::ElasticDataGen::HardwareResource::sizeStoreBuffer
private

The size of store buffer.

This is used to throttle the max. number of in-flight stores.

Definition at line 758 of file trace_cpu.hh.


The documentation for this class was generated from the following files:

Generated on Wed Sep 30 2020 14:02:33 for gem5 by doxygen 1.8.17