aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2020-04-09 14:23:47 -0700
committerGitHub <noreply@github.com>2020-04-09 14:23:47 -0700
commit371af7da381e9d17e4475cb0599865f7bea5a632 (patch)
treeb1d667484c8db5feda7bc345b8b7c10d154fd4cf
parent516857f3ba662f467d56df562eeca9ed214ac702 (diff)
parentf11dd6e20838bce1b1fa8e085570d2126484d10f (diff)
downloadyosys-371af7da381e9d17e4475cb0599865f7bea5a632.tar.gz
yosys-371af7da381e9d17e4475cb0599865f7bea5a632.tar.bz2
yosys-371af7da381e9d17e4475cb0599865f7bea5a632.zip
Merge pull request #1858 from YosysHQ/eddie/fix1856
kernel: include "kernel/constids.inc"
-rw-r--r--kernel/rtlil.cc2
-rw-r--r--kernel/rtlil.h2
-rw-r--r--kernel/yosys.cc2
-rw-r--r--tests/various/.gitignore1
-rw-r--r--tests/various/plugin.cc15
-rw-r--r--tests/various/plugin.sh6
6 files changed, 25 insertions, 3 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index 6a7eba2fa..d9003f28c 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -42,7 +42,7 @@ int RTLIL::IdString::last_created_idx_ptr_;
#endif
#define X(_id) IdString RTLIL::ID::_id;
-#include "constids.inc"
+#include "kernel/constids.inc"
#undef X
dict<std::string, std::string> RTLIL::constpad;
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index fb65f7a03..17f038e36 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -377,7 +377,7 @@ namespace RTLIL
namespace ID {
#define X(_id) extern IdString _id;
-#include "constids.inc"
+#include "kernel/constids.inc"
#undef X
};
diff --git a/kernel/yosys.cc b/kernel/yosys.cc
index 380f7030b..6009d6647 100644
--- a/kernel/yosys.cc
+++ b/kernel/yosys.cc
@@ -516,7 +516,7 @@ void yosys_setup()
already_setup = true;
#define X(_id) RTLIL::ID::_id = "\\" # _id;
-#include "constids.inc"
+#include "kernel/constids.inc"
#undef X
#ifdef WITH_PYTHON
diff --git a/tests/various/.gitignore b/tests/various/.gitignore
index 4b286fd61..12d4e5048 100644
--- a/tests/various/.gitignore
+++ b/tests/various/.gitignore
@@ -3,3 +3,4 @@
/write_gzip.v
/write_gzip.v.gz
/run-test.mk
+/plugin.so
diff --git a/tests/various/plugin.cc b/tests/various/plugin.cc
new file mode 100644
index 000000000..be305fbda
--- /dev/null
+++ b/tests/various/plugin.cc
@@ -0,0 +1,15 @@
+#include "kernel/rtlil.h"
+
+YOSYS_NAMESPACE_BEGIN
+
+struct TestPass : public Pass {
+ TestPass() : Pass("test", "test") { }
+ void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE
+ {
+ size_t argidx = 1;
+ extra_args(args, argidx, design);
+ log("Plugin test passed!\n");
+ }
+} TestPass;
+
+YOSYS_NAMESPACE_END
diff --git a/tests/various/plugin.sh b/tests/various/plugin.sh
new file mode 100644
index 000000000..d6d4aee59
--- /dev/null
+++ b/tests/various/plugin.sh
@@ -0,0 +1,6 @@
+set -e
+rm -f plugin.so
+CXXFLAGS=$(../../yosys-config --cxxflags)
+CXXFLAGS=${CXXFLAGS// -I\/usr\/local\/share\/yosys\/include/ -I..\/..\/share\/include}
+../../yosys-config --exec --cxx ${CXXFLAGS} --ldflags -shared -o plugin.so plugin.cc
+../../yosys -m ./plugin.so -p "test" | grep -q "Plugin test passed!"