21 #include <ac_assert.h>
33 static const size_t P = 1;
40 static const size_t P = SUB::P << 1;
44 static const char* make_permanent(
const char* nm) {
48 static std::list<std::string> nm_str;
49 nm_str.push_back(std::string(nm));
50 return nm_str.back().c_str();
57 template <
typename B,
size_t C>
58 class nv_array_bank_array_no_assert_base;
70 : a(make_permanent(sc_gen_unique_name(prefix)))
73 B &operator[](
size_t idx) {
return a; }
74 const B &operator[](
size_t idx)
const {
return a; }
78 template <
typename B,
size_t C>
89 : a0(make_permanent(sc_gen_unique_name(prefix)))
90 , a1(make_permanent(sc_gen_unique_name(prefix)))
93 B &operator[](
size_t idx) {
97 size_t aidx = idx & (W-1);
return idx&W ? a1[aidx] : a0[aidx];
100 const B &operator[](
size_t idx)
const {
101 #ifndef __SYNTHESIS__
104 size_t aidx = idx & (W-1);
return idx&W ? a1[aidx] : a0[aidx];
144 template <
typename Type,
unsigned int VectorLength>
152 nv_array(sc_module_name prefix,
const unsigned int&
id) :
base_t(prefix) {}
An implementation of array that declares VectorLength variables for array of size VectorLength.