aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenedikt Tutzer <e1225461@student.tuwien.ac.at>2018-08-20 16:04:43 +0200
committerBenedikt Tutzer <e1225461@student.tuwien.ac.at>2018-08-20 16:04:43 +0200
commit95d65971f3f114adb8b62a9d29bc0829467e3d81 (patch)
tree8dd1ff0da0379d74a816295dd32d2b4f58293df8
parentd87c7df27f8268ab849d3f9d84c4b000f83b44e2 (diff)
downloadyosys-95d65971f3f114adb8b62a9d29bc0829467e3d81.tar.gz
yosys-95d65971f3f114adb8b62a9d29bc0829467e3d81.tar.bz2
yosys-95d65971f3f114adb8b62a9d29bc0829467e3d81.zip
added some checks if python is enabled to make sure everything compiles if python is disabled in the makefile
-rw-r--r--kernel/python_wrappers.cc6
-rw-r--r--kernel/rtlil.cc6
-rw-r--r--kernel/rtlil.h1
-rw-r--r--kernel/yosys.h2
-rw-r--r--passes/cmds/plugin.cc4
5 files changed, 12 insertions, 7 deletions
diff --git a/kernel/python_wrappers.cc b/kernel/python_wrappers.cc
index af1f80929..2c27ea47f 100644
--- a/kernel/python_wrappers.cc
+++ b/kernel/python_wrappers.cc
@@ -2783,13 +2783,13 @@ namespace YOSYS_PYTHON {
struct Initializer
{
Initializer() {
- if(!Yosys::yosys_already_setup())
- {
+ if(!Yosys::yosys_already_setup())
+ {
Yosys::log_streams.push_back(&std::cout);
Yosys::log_error_stderr = true;
Yosys::yosys_setup();
Yosys::yosys_banner();
- }
+ }
}
Initializer(Initializer const &) {}
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index bcda931d2..93b138071 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -3925,14 +3925,12 @@ RTLIL::Process *RTLIL::Process::clone() const
return new_proc;
}
+
+#ifdef WITH_PYTHON
RTLIL::Memory::~Memory()
{
-#ifdef WITH_PYTHON
RTLIL::Memory::get_all_memorys()->erase(hashidx_);
-#endif
}
-
-#ifdef WITH_PYTHON
static std::map<unsigned int, RTLIL::Memory*> *all_memorys = new std::map<unsigned int, RTLIL::Memory*>();
std::map<unsigned int, RTLIL::Memory*> *RTLIL::Memory::get_all_memorys(void)
{
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index 89413a166..0e5159be2 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -1175,6 +1175,7 @@ struct RTLIL::Memory : public RTLIL::AttrObject
unsigned int hash() const { return hashidx_; }
Memory();
+ ~Memory();
RTLIL::IdString name;
int width, start_offset, size;
diff --git a/kernel/yosys.h b/kernel/yosys.h
index 6ed0f8b20..9f5f056a5 100644
--- a/kernel/yosys.h
+++ b/kernel/yosys.h
@@ -66,7 +66,9 @@
#include <stdio.h>
#include <limits.h>
+#ifdef WITH_PYTHON
#include <Python.h>
+#endif
#ifndef _YOSYS_
# error It looks like you are trying to build Yosys without the config defines set. \
diff --git a/passes/cmds/plugin.cc b/passes/cmds/plugin.cc
index 1a39140d4..a889397e2 100644
--- a/passes/cmds/plugin.cc
+++ b/passes/cmds/plugin.cc
@@ -44,7 +44,11 @@ void load_plugin(std::string filename, std::vector<std::string> aliases)
if (filename.find('/') == std::string::npos)
filename = "./" + filename;
+ #ifdef WITH_PYTHON
if (!loaded_plugins.count(filename) && !loaded_python_plugins.count(filename)) {
+ #else
+ if (!loaded_plugins.count(filename)) {
+ #endif
#ifdef WITH_PYTHON
if(boost::algorithm::ends_with(filename, ".py"))