38#ifndef __MEM_RUBY_STRUCTURES_MN_TBESTORAGE_HH__
39#define __MEM_RUBY_STRUCTURES_MN_TBESTORAGE_HH__
42#include <unordered_map>
63template <
class RetryEntry>
68 std::initializer_list<TBEStorage *> _partitions)
79 total += part->size();
90 total += part->capacity();
101 total += part->reserved();
110 auto generic_slots =
partitions[0]->slotsAvailable();
112 return partitions[partition]->slotsAvailable() +
115 return generic_slots;
128 Tick current_time = 0)
const
166 int part_slot =
partitions[partition]->addEntryToNewSlot();
173 int generic_slot =
partitions[0]->addEntryToNewSlot();
178 return partitions[partition]->capacity() + generic_slot;
189 auto part_capacity =
partitions[partition]->capacity();
190 if (slot < part_capacity) {
191 partitions[partition]->removeEntryFromSlot(slot);
194 slot - part_capacity);
224 auto entry = *retry_iter;
235 : statistics::
Group(parent),
257 for (
auto it = begin_it; it != end_it; it++) {
int addEntryToNewSlot(int partition)
float utilization() const
std::list< RetryEntry >::iterator getNextRetryEntryIter()
void decrementReserved(int partition)
void removeEntryFromSlot(int slot, int partition)
bool areNSlotsAvailable(int n, int partition, Tick current_time=0) const
RetryEntry popNextRetryEntry()
void emplaceRetryEntry(RetryEntry entry)
int slotsAvailable(int partition) const
void incrementReserved(int partition)
std::list< RetryEntry > m_retryEntries
std::vector< TBEStorage * > partitions
gem5::ruby::MN_TBEStorage::MN_TBEStorageStats m_stats
MN_TBEStorage(statistics::Group *parent, std::initializer_list< TBEStorage * > _partitions)
A stat that calculates the per tick average of a value.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
const FlagsType total
Print the total.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Tick
Tick count type.
Declaration of Statistics objects.
statistics::Average avg_reserved
MN_TBEStorageStats(statistics::Group *parent)
statistics::Average avg_util
statistics::Average avg_size