|
gem5 [DEVELOP-FOR-25.0]
|
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. | |
| void | occupy (const GraphNode *new_node) |
| Occupy appropriate structures for an issued node. | |
| void | release (const GraphNode *done_node) |
| Release appropriate structures for a completed node. | |
| void | releaseStoreBuffer () |
| Release store buffer entry for a completed store. | |
| bool | isAvailable (const GraphNode *new_node) const |
| Check if structures required to issue a node are free. | |
| bool | awaitingResponse () const |
| Check if there are any outstanding requests, i.e. | |
| void | printOccupancy () |
| Print resource occupancy for debugging. | |
Private Attributes | |
| const uint16_t | sizeROB |
| The size of the ROB used to throttle the max. | |
| const uint16_t | sizeStoreBuffer |
| The size of store buffer. | |
| const uint16_t | sizeLoadBuffer |
| The size of load buffer. | |
| std::map< NodeSeqNum, NodeRobNum > | inFlightNodes |
| A map from the sequence number to the ROB number of the in- flight nodes. | |
| NodeRobNum | oldestInFlightRobNum |
| The ROB number of the oldest in-flight node. | |
| uint16_t | numInFlightLoads |
| Number of ready loads for which request may or may not be sent. | |
| uint16_t | numInFlightStores |
| Number of ready stores for which request may or may not be sent. | |
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 646 of file trace_cpu.hh.
| gem5::TraceCPU::ElasticDataGen::HardwareResource::HardwareResource | ( | uint16_t | max_rob, |
| uint16_t | max_stores, | ||
| uint16_t | max_loads ) |
Constructor that initializes the sizes of the structures.
| max_rob | size of the Reorder Buffer |
| max_stores | size of Store Buffer |
| max_loads | size of Load Buffer |
Definition at line 825 of file trace_cpu.cc.
References numInFlightLoads, numInFlightStores, oldestInFlightRobNum, sizeLoadBuffer, sizeROB, and sizeStoreBuffer.
| bool gem5::TraceCPU::ElasticDataGen::HardwareResource::awaitingResponse | ( | ) | const |
Check if there are any outstanding requests, i.e.
requests for which we are yet to receive a response.
Definition at line 949 of file trace_cpu.cc.
References numInFlightLoads, and numInFlightStores.
| bool gem5::TraceCPU::ElasticDataGen::HardwareResource::isAvailable | ( | const GraphNode * | new_node | ) | const |
Check if structures required to issue a node are free.
| node_ptr | pointer to the node ready to issue |
Definition at line 905 of file trace_cpu.cc.
References DPRINTFR, inFlightNodes, gem5::TraceCPU::ElasticDataGen::GraphNode::isLoad(), gem5::TraceCPU::ElasticDataGen::GraphNode::isStore(), numInFlightLoads, numInFlightStores, oldestInFlightRobNum, gem5::TraceCPU::ElasticDataGen::GraphNode::robNum, gem5::TraceCPU::ElasticDataGen::GraphNode::seqNum, sizeLoadBuffer, sizeROB, and sizeStoreBuffer.
| void gem5::TraceCPU::ElasticDataGen::HardwareResource::occupy | ( | const GraphNode * | new_node | ) |
Occupy appropriate structures for an issued node.
| node_ptr | pointer to the issued node |
Definition at line 836 of file trace_cpu.cc.
References inFlightNodes, gem5::TraceCPU::ElasticDataGen::GraphNode::isLoad(), gem5::TraceCPU::ElasticDataGen::GraphNode::isStore(), numInFlightLoads, numInFlightStores, oldestInFlightRobNum, printOccupancy(), gem5::TraceCPU::ElasticDataGen::GraphNode::robNum, and gem5::TraceCPU::ElasticDataGen::GraphNode::seqNum.
| void gem5::TraceCPU::ElasticDataGen::HardwareResource::printOccupancy | ( | ) |
Print resource occupancy for debugging.
Definition at line 956 of file trace_cpu.cc.
References DPRINTFR, numInFlightLoads, numInFlightStores, oldestInFlightRobNum, sizeLoadBuffer, and sizeStoreBuffer.
Referenced by occupy().
| void gem5::TraceCPU::ElasticDataGen::HardwareResource::release | ( | const GraphNode * | done_node | ) |
Release appropriate structures for a completed node.
| node_ptr | pointer to the completed node |
Definition at line 855 of file trace_cpu.cc.
References DPRINTFR, inFlightNodes, gem5::TraceCPU::ElasticDataGen::GraphNode::isLoad(), gem5::TraceCPU::ElasticDataGen::GraphNode::isStore(), gem5::TraceCPU::ElasticDataGen::GraphNode::isStrictlyOrdered(), numInFlightLoads, oldestInFlightRobNum, releaseStoreBuffer(), and gem5::TraceCPU::ElasticDataGen::GraphNode::seqNum.
| void gem5::TraceCPU::ElasticDataGen::HardwareResource::releaseStoreBuffer | ( | ) |
Release store buffer entry for a completed store.
Definition at line 898 of file trace_cpu.cc.
References numInFlightStores.
Referenced by release().
|
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 725 of file trace_cpu.hh.
Referenced by isAvailable(), occupy(), and release().
|
private |
Number of ready loads for which request may or may not be sent.
Definition at line 733 of file trace_cpu.hh.
Referenced by awaitingResponse(), HardwareResource(), isAvailable(), occupy(), printOccupancy(), and release().
|
private |
Number of ready stores for which request may or may not be sent.
Definition at line 738 of file trace_cpu.hh.
Referenced by awaitingResponse(), HardwareResource(), isAvailable(), occupy(), printOccupancy(), and releaseStoreBuffer().
|
private |
The ROB number of the oldest in-flight node.
Definition at line 728 of file trace_cpu.hh.
Referenced by HardwareResource(), isAvailable(), occupy(), printOccupancy(), and release().
|
private |
The size of load buffer.
This is used to throttle the max. number of in-flight loads.
Definition at line 713 of file trace_cpu.hh.
Referenced by HardwareResource(), isAvailable(), and printOccupancy().
|
private |
The size of the ROB used to throttle the max.
number of in-flight nodes.
Definition at line 701 of file trace_cpu.hh.
Referenced by HardwareResource(), and isAvailable().
|
private |
The size of store buffer.
This is used to throttle the max. number of in-flight stores.
Definition at line 707 of file trace_cpu.hh.
Referenced by HardwareResource(), isAvailable(), and printOccupancy().