38#ifndef __MEM_RUBY_STRUCTURES_MN_TBESTORAGE_HH__
39#define __MEM_RUBY_STRUCTURES_MN_TBESTORAGE_HH__
42#include <unordered_map>
66template <
class RetryEntry>
71 std::initializer_list<TBEStorage *> _partitions)
82 total += part->size();
93 total += part->capacity();
104 total += part->reserved();
113 auto generic_slots =
partitions[0]->slotsAvailable();
115 return partitions[partition]->slotsAvailable() +
118 return generic_slots;
131 Tick current_time = 0)
const
169 int part_slot =
partitions[partition]->addEntryToNewSlot();
176 int generic_slot =
partitions[0]->addEntryToNewSlot();
181 return partitions[partition]->capacity() + generic_slot;
192 auto part_capacity =
partitions[partition]->capacity();
193 if (slot < part_capacity) {
194 partitions[partition]->removeEntryFromSlot(slot);
197 slot - part_capacity);
227 auto entry = *retry_iter;
238 : statistics::
Group(parent),
260 for (
auto it = begin_it; it != end_it; it++) {
void removeEntryFromSlot(int slot, int partition)
int addEntryToNewSlot(int partition)
bool areNSlotsAvailable(int n, int partition, Tick current_time=0) const
void emplaceRetryEntry(RetryEntry entry)
RetryEntry popNextRetryEntry()
float utilization() const
MN_TBEStorage(statistics::Group *parent, std::initializer_list< TBEStorage * > _partitions)
std::vector< TBEStorage * > partitions
std::list< RetryEntry > m_retryEntries
void decrementReserved(int partition)
std::list< RetryEntry >::iterator getNextRetryEntryIter()
gem5::ruby::CHI::MN_TBEStorage::MN_TBEStorageStats m_stats
void incrementReserved(int partition)
int slotsAvailable(int partition) const
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 Arm Limited All rights reserved.
uint64_t Tick
Tick count type.
Declaration of Statistics objects.
statistics::Average avg_reserved
statistics::Average avg_util
statistics::Average avg_size
MN_TBEStorageStats(statistics::Group *parent)