Skip to content

Commit

Permalink
fix(examples/vhdl/array_axis_vcs): add stubs.c
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor committed Apr 20, 2019
1 parent cf6804d commit 4443905
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/vhdl/array_axis_vcs/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@

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

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

for tb in lib.get_test_benches(pattern='*tb_py_*', allow_empty=False):
tb.set_objects([c_nobj])

for tb in lib.get_test_benches(pattern='*tb_c_*', allow_empty=False):
tb.set_objects([c_obj])

Expand Down
14 changes: 14 additions & 0 deletions examples/vhdl/array_axis_vcs/src/test/stubs.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

void write_byte ( uint8_t id, uint32_t i, uint8_t v ) {
printf("ERROR write_byte: THIS IS A STUB\n");
exit(1);
}

uint8_t read_byte ( uint8_t id, uint32_t i ) {
printf("ERROR read_byte: THIS IS A STUB\n");
exit(1);
return 0;
}

0 comments on commit 4443905

Please sign in to comment.