From c3ee27860bd076988d46affd2b6a7d073c2a0330 Mon Sep 17 00:00:00 2001 From: Tudor Timi Date: Sat, 1 Jun 2024 17:02:03 +0200 Subject: [PATCH] Add C source file to example using published dependency --- .../using-published/some-project/src/main/sv/some_project.sv | 1 + .../using-published/some-published-dependency/build.gradle | 1 + .../some-published-dependency/src/main/c/some_dpi_func.c | 5 +++++ .../src/main/sv/some_published_dependency.sv | 1 + 4 files changed, 8 insertions(+) create mode 100644 examples/using-published/some-published-dependency/src/main/c/some_dpi_func.c diff --git a/examples/using-published/some-project/src/main/sv/some_project.sv b/examples/using-published/some-project/src/main/sv/some_project.sv index a38db2d..6e52e37 100644 --- a/examples/using-published/some-project/src/main/sv/some_project.sv +++ b/examples/using-published/some-project/src/main/sv/some_project.sv @@ -8,5 +8,6 @@ module some_project; function automatic void do_stuff(); some_class o = new(); `some_published_dependency_macro + some_dpi_func(); endfunction endmodule diff --git a/examples/using-published/some-published-dependency/build.gradle b/examples/using-published/some-published-dependency/build.gradle index fe26e9b..f2591ea 100644 --- a/examples/using-published/some-published-dependency/build.gradle +++ b/examples/using-published/some-published-dependency/build.gradle @@ -1,5 +1,6 @@ plugins { id 'com.verificationgentleman.gradle.hdvl.systemverilog' + id 'com.verificationgentleman.gradle.hdvl.c' id 'maven-publish' } diff --git a/examples/using-published/some-published-dependency/src/main/c/some_dpi_func.c b/examples/using-published/some-published-dependency/src/main/c/some_dpi_func.c new file mode 100644 index 0000000..0c6597d --- /dev/null +++ b/examples/using-published/some-published-dependency/src/main/c/some_dpi_func.c @@ -0,0 +1,5 @@ +#include + +void some_dpi_func() { + printf("hello from C"); +} diff --git a/examples/using-published/some-published-dependency/src/main/sv/some_published_dependency.sv b/examples/using-published/some-published-dependency/src/main/sv/some_published_dependency.sv index c41e751..0672505 100644 --- a/examples/using-published/some-published-dependency/src/main/sv/some_published_dependency.sv +++ b/examples/using-published/some-published-dependency/src/main/sv/some_published_dependency.sv @@ -1,3 +1,4 @@ package some_published_dependency; `include "some_class.svh" + import "DPI-C" some_dpi_func(); endpackage