Skip to content

Commit bacca8f

Browse files
committed
fix(examples/vhdl/array_axis_vcs): add stubs.c
1 parent cf711ab commit bacca8f

2 files changed

Lines changed: 18 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,9 +22,14 @@
2222

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

25+
c_nobj = join(root, 'src', 'test', 'stubs.o')
2526
c_obj = join(root, 'src', 'test', 'main.o')
27+
print(os.popen('gcc -fPIC -rdynamic -c '+join(root, 'src/**/stubs.c')+' -o '+c_nobj).read())
2628
print(os.popen('gcc -fPIC -rdynamic -c '+join(root, 'src/**/main.c')+' -o '+c_obj).read())
2729

30+
for tb in lib.get_test_benches(pattern='*tb_py_*', allow_empty=False):
31+
tb.set_objects([c_nobj])
32+
2833
for tb in lib.get_test_benches(pattern='*tb_c_*', allow_empty=False):
2934
tb.set_objects([c_obj])
3035

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <stdio.h>
2+
3+
extern int ghdl_main (int argc, char **argv);
4+
5+
// main is the entrypoint to the application.
6+
int main(int argc, char **argv) {
7+
8+
printf("This is an example of how to wrap a GHDL + VUnit simulation in a C application.\n");
9+
10+
ghdl_main(argc, argv);
11+
12+
return 0;
13+
}

0 commit comments

Comments
 (0)