I am trying to simulate an SRAM memory using SystemC and have to allocate several 2D arrays.
When I increase the number of bitcells to simulate I got std::dad_alloc error.
I am suspecting stack size issue and went through several already opened topics here but couldn't fine the solution
Beforre systemC compilation, I also set this
SC_DEFAULT_STACK_SIZE_ 0x16000000
variable it helps me increase the array size but not enough as required.
sc_vector<sc_vector<bitcell>> memory;
sc_vector<sc_vector<sc_signal<sc_logic, SC_MANY_WRITERS>>> bit_value_in;
sc_vector<sc_vector<sc_signal<sc_logic, SC_MANY_WRITERS>>> bit_value_out;
sc_vector<sc_signal<sc_logic>> periphOutput;
sc_vector<sc_signal<sc_logic, SC_MANY_WRITERS>> periphInput1;
sc_vector<sc_signal<sc_logic, SC_MANY_WRITERS>> periphInput2;
sc_vector<sc_signal<bool, SC_MANY_WRITERS>> periph_enable;
sc_vector<sc_vector<sc_signal<bool, SC_MANY_WRITERS>>> wr_enable;
sc_vector<sc_vector<sc_signal<bool, SC_MANY_WRITERS>>> rd_enable;
For each declared 1D/2D vector I have a creator function to instantiate the objects.
The SRAM has 1 bank of 4 arrays each with 128x256 bit-cell size
Please can you direct me the parameter to change in order to get rid of this bad_alloc message ?
Thanks