Closed taneroksuz closed 2 years ago
However I don't understand why I am getting this error. I test all my design on WSL2 (Windows Subsystem for Linux 2). I get similar errors with other open source VHDL and Verilog similator but not commercial simulators. So I don't know what is the main reason of this error. I also disabled the upper limits of stack size in other open source simulator, but I encounter still the same error.
NVC uses a "secondary stack" to return large or dynamically sized objects like arrays from functions. I suspect GHDL does something similar as it's a standard technique for implementing Ada-like languages. That stack is fixed sized and is insufficient here as init_memory
allocates and returns an ~8MB array (each std_logic
element occupies one byte).
I've made the stack size configurable and also improved the error message so now it prints:
** Fatal: global secondary stack exhausted
Procedure HREAD [LINE, STD_ULOGIC_VECTOR]
File ../../lib/ieee.08/std_logic_1164-body.vhdl, Line 1509
Function INIT_MEMORY [STRING return MEMORY_TYPE]
File /home/nick/src/riscv-w7/vhdl/tb/bram.vhd, Line 43
** Note: the current limit is 8388608 bytes which you can increase with the
-G option, for example -G 16384k
nvc -G 16m ...
works ok for me. BTW I saw elaboration is very slow with your project: this is a known issue I hope to resolve at some point.
@taneroksuz are you still using nvc? The latest master branch has some performance improvements that should help with your project.
I get following error, when I test my design with very large arrays (e.g. 131072x64 bits):
However I don't understand why I am getting this error. I test all my design on WSL2 (Windows Subsystem for Linux 2). I get similar errors with other open source VHDL and Verilog similator but not commercial simulators. So I don't know what is the main reason of this error. I also disabled the upper limits of stack size in other open source simulator, but I encounter still the same error.