29#ifndef __BASE_CHUNK_GENERATOR_HH__
30#define __BASE_CHUNK_GENERATOR_HH__
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
This class takes an arbitrary memory region (address/length pair) and generates a series of appropria...
const Addr chunkSize
The maximum chunk size, e.g., the cache block size or page size.
Addr curSize
The size of the current chunk (in bytes).
Addr nextSize
The size of the next chunk (in bytes).
Addr sizeLeft
The number of bytes remaining in the region after the current chunk.
Addr curAddr
The starting address of the current chunk.
Addr nextAddr
The starting address of the next chunk (after the current one).
const Addr startAddr
The start address so we can calculate offset in writing block.
static constexpr bool isPowerOf2(const T &n)
static constexpr T roundUp(const T &val, const U &align)
This function is used to align addresses in memory.
bool last() const
Is this the last chunk?
Addr addr() const
Return starting address of current chunk.
Addr complete() const
Number of bytes we have already chunked up.
ChunkGenerator(Addr _startAddr, Addr totalSize, Addr _chunkSize)
Constructor.
void setNext(Addr next)
Grow this chunk to cover additional bytes which are already handled.
bool done() const
Are we done? That is, did the last call to next() advance past the end of the region?
Addr size() const
Return size in bytes of current chunk.
bool next()
Advance generator to next chunk.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.