added some checks if python is enabled to make sure everything compiles if python...
authorBenedikt Tutzer <e1225461@student.tuwien.ac.at>
Mon, 20 Aug 2018 14:04:43 +0000 (16:04 +0200)
committerBenedikt Tutzer <e1225461@student.tuwien.ac.at>
Mon, 20 Aug 2018 14:04:43 +0000 (16:04 +0200)
kernel/python_wrappers.cc
kernel/rtlil.cc
kernel/rtlil.h
kernel/yosys.h
passes/cmds/plugin.cc

index af1f80929c9e18d0bde6650a5ba3a9d037eeef30..2c27ea47ff8a8037f0f5ee9fbba7c83e4e3a9f18 100644 (file)
@@ -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 &) {}
index bcda931d2245fbfe70c05f281468bc132a44efbb..93b138071a935eef4fa66dd79030e68dc86aba47 100644 (file)
@@ -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)
 {
index 89413a1660ea3922f2b4981950208ef12eec9323..0e5159be2e8581144092cd99e75e01d7a41c0667 100644 (file)
@@ -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;
index 6ed0f8b20b381305b68cec1e985101eee11cd442..9f5f056a50189ca2b665a03745794bb05bbefd0e 100644 (file)
@@ -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. \
index 1a39140d4dd1ac6275fbcd395a8e003477b5dea7..a889397e245c70eb4cd119e4be58c03a40d17c78 100644 (file)
@@ -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"))