diff --git a/examples/vhdl/array_axis_vcs/run.py b/examples/vhdl/array_axis_vcs/run.py index 238611dcd..dad836df2 100644 --- a/examples/vhdl/array_axis_vcs/run.py +++ b/examples/vhdl/array_axis_vcs/run.py @@ -22,6 +22,11 @@ # vu.set_sim_option('modelsim.init_files.after_load',['runall_addwave.do']) +c_nobj = join(root, 'src/test/stubs.o') +print(os.popen('gcc -fPIC -rdynamic -c '+join(root, 'src/**/stubs.c')+' -o '+c_nobj).read()) + +vu.set_sim_option("ghdl.elab_flags", ["-Wl,"+c_nobj]) + c_obj = join(root, 'src/test/main.o') # This can be executed externally, should C sources be more complex than a single file. print(os.popen('gcc -fPIC -rdynamic -c '+join(root, 'src/**/*.c')+' -o '+c_obj).read()) diff --git a/examples/vhdl/array_axis_vcs/src/test/stubs.c b/examples/vhdl/array_axis_vcs/src/test/stubs.c new file mode 100644 index 000000000..3eff8de5b --- /dev/null +++ b/examples/vhdl/array_axis_vcs/src/test/stubs.c @@ -0,0 +1,17 @@ +#include +#include +#include + +// get_param is used by GHDL to retrieve parameter values (integers). +uint32_t get_param(uint32_t w) { + printf("ERROR get_param: THIS IS A STUB\n"); + exit(1); + return 0; +} + +// get_param is used by GHDL to retrieve pointers to the base addresses of the buffers. +uintptr_t get_addr(uint32_t w) { + printf("ERROR get_addr: THIS IS A STUB\n"); + exit(1); + return (uintptr_t)NULL; +}