28 template <
class DataT, ArrayType ArrayT = ArrayType::AGED>
44 BaseArray(name, num_entries, clk, statset)
81 return writeFrontImpl_(dat);
93 return writeFrontImpl_(std::move(dat));
105 return writeBackImpl_(dat);
117 return writeBackImpl_(std::move(dat));
153 uint32_t writeFrontImpl_(U&& dat)
164 "Cannot write to the front of the Array. There are no free entries.");
170 uint32_t writeBackImpl_(U&& dat)
180 sparta_assert(i >= 0,
"Cannot write to the back of the array. There are no free entries.");
#define sparta_assert(...)
Simple variadic assertion that will throw a sparta_exception if the condition fails.
Array is essentially a fixed size vector, maintains a concept of validity of its indexes,...
size_type capacity() const
Return the maximum number of elements this Array can hold.
void write(const uint32_t idx, const DataT &dat)
Write data to the array.
bool isValid(const uint32_t idx) const
Determine whether an index is currently valid.
const DataT & read(const uint32_t idx) const
Read (only) the data at an index.
size_type numValid() const
The number of valid entries contained.
A representation of simulated time.
a type of Array with special allocation policies to support writing to the front most valid entry in ...
const DataT & readValid(const uint32_t nth=0) const
read the nth valid object from the front of the array.
uint32_t writeFront(const DataT &dat)
a public method that can be used to write data to the first invalidate entry in the array....
uint32_t writeBack(DataT &&dat)
a public method that can be used to write data to the last invalidate entry in the array....
uint32_t writeBack(const DataT &dat)
a public method that can be used to write data to the last invalidate entry in the array....
uint32_t push_back(DataT &&dat)
Push the first available index in the Array starting from the back.
uint32_t push_front(DataT &&dat)
Push the first available index in the Array.
FrontArray(const std::string &name, uint32_t num_entries, const Clock *clk, StatisticSet *statset=nullptr)
Construct the array.
uint32_t push_back(const DataT &dat)
Push the first available index in the Array starting from the back.
uint32_t push_front(const DataT &dat)
Push the first available index in the Array.
uint32_t writeFront(DataT &&dat)
a public method that can be used to write data to the first invalidate entry in the array....
Set of StatisticDef and CounterBase-derived objects for visiblility through a sparta Tree.
Macros for handling exponential backoff.