|
scc 2025.09
SystemC components library
|
a sparse array suitable for large sizes More...
#include <sparse_array.h>
Public Types | |
| using | page_type = std::vector<T> |
Public Member Functions | |
| sparse_array_b (uint64_t SIZE, unsigned PAGE_ADDR_BITS=24) | |
| ~sparse_array_b () | |
| T & | operator[] (uint32_t addr) |
| page_type & | operator() (uint32_t page_nr) |
| bool | is_allocated (uint32_t addr) |
| uint64_t | size () |
Public Attributes | |
| const uint64_t | mem_size |
| const uint64_t | page_addr_mask |
| const uint64_t | page_size |
| const unsigned | page_count |
| const uint64_t | page_addr_width |
Protected Attributes | |
| std::vector< page_type * > | arr |
a sparse array suitable for large sizes
a simple array which allocates memory in configurable chunks (size of 2^PAGE_ADDR_BITS), used for large sparse arrays. Memory is allocated on demand
Definition at line 37 of file sparse_array.h.
| using util::sparse_array_b< T >::page_type = std::vector<T> |
Definition at line 49 of file sparse_array.h.
|
inline |
the default constructor
Definition at line 53 of file sparse_array.h.
|
inline |
the destructor
Definition at line 66 of file sparse_array.h.
|
inline |
check if page for address is allocated
| addr | the address to check |
Definition at line 101 of file sparse_array.h.
|
inline |
page fetch operator
| page_nr | the page number ot fetch |
Definition at line 89 of file sparse_array.h.
|
inline |
element access operator
| addr | address to access |
Definition at line 76 of file sparse_array.h.
|
inline |
|
protected |
Definition at line 114 of file sparse_array.h.
| const uint64_t util::sparse_array_b< T >::mem_size |
Definition at line 39 of file sparse_array.h.
| const uint64_t util::sparse_array_b< T >::page_addr_mask |
Definition at line 41 of file sparse_array.h.
| const uint64_t util::sparse_array_b< T >::page_addr_width |
Definition at line 47 of file sparse_array.h.
| const unsigned util::sparse_array_b< T >::page_count |
Definition at line 45 of file sparse_array.h.
| const uint64_t util::sparse_array_b< T >::page_size |
Definition at line 43 of file sparse_array.h.