gem5 v24.0.0.0
|
This class takes an arbitrary memory region (address/length pair) and generates a series of appropriately (e.g. More...
#include <chunk_generator.hh>
Public Member Functions | |
ChunkGenerator (Addr _startAddr, Addr totalSize, Addr _chunkSize) | |
Constructor. | |
Addr | addr () const |
Return starting address of current chunk. | |
Addr | size () const |
Return size in bytes of current chunk. | |
Addr | complete () const |
Number of bytes we have already chunked up. | |
bool | done () const |
Are we done? That is, did the last call to next() advance past the end of the region? | |
bool | last () const |
Is this the last chunk? | |
void | setNext (Addr next) |
Grow this chunk to cover additional bytes which are already handled. | |
bool | next () |
Advance generator to next chunk. | |
Private Attributes | |
Addr | curAddr |
The starting address of the current chunk. | |
Addr | nextAddr |
The starting address of the next chunk (after the current one). | |
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. | |
const Addr | startAddr |
The start address so we can calculate offset in writing block. | |
const Addr | chunkSize |
The maximum chunk size, e.g., the cache block size or page size. | |
This class takes an arbitrary memory region (address/length pair) and generates a series of appropriately (e.g.
block- or page-) aligned chunks covering the same region.
Example usage:
Definition at line 59 of file chunk_generator.hh.
|
private |
The maximum chunk size, e.g., the cache block size or page size.
Definition at line 75 of file chunk_generator.hh.
Referenced by ChunkGenerator(), next(), and setNext().
|
private |
The starting address of the current chunk.
Definition at line 63 of file chunk_generator.hh.
Referenced by addr(), ChunkGenerator(), complete(), and next().
|
private |
The size of the current chunk (in bytes).
Definition at line 67 of file chunk_generator.hh.
Referenced by ChunkGenerator(), done(), next(), setNext(), and size().
|
private |
The starting address of the next chunk (after the current one).
Definition at line 65 of file chunk_generator.hh.
Referenced by ChunkGenerator(), next(), and setNext().
|
private |
The size of the next chunk (in bytes).
Definition at line 69 of file chunk_generator.hh.
Referenced by ChunkGenerator(), next(), and setNext().
|
private |
The number of bytes remaining in the region after the current chunk.
Definition at line 71 of file chunk_generator.hh.
Referenced by ChunkGenerator(), last(), next(), and setNext().
|
private |
The start address so we can calculate offset in writing block.
Definition at line 73 of file chunk_generator.hh.
Referenced by ChunkGenerator(), and complete().