chipsalliance / Cores-VeeR-EH1

VeeR EH1 core
Apache License 2.0
821 stars 221 forks source link

facing issues when C code size goes beyond 8KB #111

Open yash-agnisys opened 2 years ago

yash-agnisys commented 2 years ago

Hello,

I am using the swerv RTL and a mixed uvm + C environment to test out my firmware code. I generally write my test and cross-compile the c code to generate the object file and further generate the hex file which is loaded into the mem in "ahb_sif.sv" file. In the linker file i am placing the C code at loaction 0x80000000 onwards. The object file has components which contains different sections i.e., text, bss, data. I am facing issues whenever, the text section in object file goes above 8KB, the environment hangs up. The text section below 8KB runs fine. So my questions are :

  1. Is there some limitations to code size that can be loaded into memory?
  2. I can see in the ahb_sif.sv file that, the "mem" has been changed from the earlier commits. Earlier : bit [7:0] mem [0:MEM_SIZE_DW-1]; Now: bit [7:0] mem [bit[31:0]];

if that's the case, how can code be loaded into such small memory?

Regards, Yash

algrobman commented 2 years ago

bit[7:0] mem[bit[31:0]] is associative array, which can hold up to 4GB data .. it's byte array addressed by 32 bit address.