Skip to content

Commit 1d079c2

Browse files
committed
fix(array_axis_vcs): add stubs.c
1 parent 9192169 commit 1d079c2

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

examples/vhdl/array_axis_vcs/run.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222

2323
# vu.set_sim_option('modelsim.init_files.after_load',['runall_addwave.do'])
2424

25+
c_nobj = join(root, 'src/test/stubs.o')
26+
print(os.popen('gcc -fPIC -rdynamic -c '+join(root, 'src/**/stubs.c')+' -o '+c_nobj).read())
27+
28+
vu.set_sim_option("ghdl.elab_flags", ["-Wl,"+c_nobj])
29+
2530
c_obj = join(root, 'src/test/main.o')
2631
# This can be executed externally, should C sources be more complex than a single file.
2732
print(os.popen('gcc -fPIC -rdynamic -c '+join(root, 'src/**/*.c')+' -o '+c_obj).read())
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
#include <stdint.h>
4+
5+
// get_param is used by GHDL to retrieve parameter values (integers).
6+
uint32_t get_param(uint32_t w) {
7+
printf("ERROR get_param: THIS IS A STUB\n");
8+
exit(1);
9+
return 0;
10+
}
11+
12+
// get_param is used by GHDL to retrieve pointers to the base addresses of the buffers.
13+
uintptr_t get_addr(uint32_t w) {
14+
printf("ERROR get_addr: THIS IS A STUB\n");
15+
exit(1);
16+
return (uintptr_t)NULL;
17+
}

0 commit comments

Comments
 (0)