Hello everyone
I'm new to systemc and VS. I've made some codes, but when I debug the testbench of this code, I start getting "unhandled exception at memory location xxx" for ALL codes I used to run. How can I fix this? What causes this?
SC_MODULE(my_memory)
{
sc_in <bool> clk;
sc_in <sc_bv<12> > address;
sc_inout <sc_bv<16> > content;
sc_in <bool> write;
sc_signal <sc_bv<16> > mem[4096];
void my_memory::read () {content.write(mem[address.read().to_uint()]);}
void my_memory::writ()
{
if((write == (bool) '1') && clk.event() && (clk.read() == '1') )
mem[address.read().to_uint()]=content.read();
}
SC_CTOR(my_memory)
{
for(int i = 0; i <= 4095;i++)
mem.write(0);
SC_THREAD(writ);
sensitive<<clk<<write;
SC_THREAD(read);
sensitive<<address;
}
};
Regards