mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	added some checks if python is enabled to make sure everything compiles if python is disabled in the makefile
This commit is contained in:
		
							parent
							
								
									d87c7df27f
								
							
						
					
					
						commit
						95d65971f3
					
				
					 5 changed files with 14 additions and 9 deletions
				
			
		|  | @ -2783,13 +2783,13 @@ namespace YOSYS_PYTHON { | ||||||
| 	struct Initializer | 	struct Initializer | ||||||
| 	{ | 	{ | ||||||
| 		Initializer() { | 		Initializer() { | ||||||
| 			if(!Yosys::yosys_already_setup()) |                        if(!Yosys::yosys_already_setup()) | ||||||
| 			{ |                        { | ||||||
| 				Yosys::log_streams.push_back(&std::cout); | 				Yosys::log_streams.push_back(&std::cout); | ||||||
| 				Yosys::log_error_stderr = true; | 				Yosys::log_error_stderr = true; | ||||||
| 				Yosys::yosys_setup(); | 				Yosys::yosys_setup(); | ||||||
| 				Yosys::yosys_banner(); | 				Yosys::yosys_banner(); | ||||||
| 			} |                        } | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		Initializer(Initializer const &) {} | 		Initializer(Initializer const &) {} | ||||||
|  |  | ||||||
|  | @ -3925,14 +3925,12 @@ RTLIL::Process *RTLIL::Process::clone() const | ||||||
| 
 | 
 | ||||||
| 	return new_proc; | 	return new_proc; | ||||||
| } | } | ||||||
| RTLIL::Memory::~Memory() |  | ||||||
| { |  | ||||||
| #ifdef WITH_PYTHON |  | ||||||
| 	RTLIL::Memory::get_all_memorys()->erase(hashidx_); |  | ||||||
| #endif |  | ||||||
| } |  | ||||||
| 
 | 
 | ||||||
| #ifdef WITH_PYTHON | #ifdef WITH_PYTHON | ||||||
|  | RTLIL::Memory::~Memory() | ||||||
|  | { | ||||||
|  | 	RTLIL::Memory::get_all_memorys()->erase(hashidx_); | ||||||
|  | } | ||||||
| static std::map<unsigned int, RTLIL::Memory*> *all_memorys = new std::map<unsigned int, RTLIL::Memory*>(); | 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) | std::map<unsigned int, RTLIL::Memory*> *RTLIL::Memory::get_all_memorys(void) | ||||||
| { | { | ||||||
|  |  | ||||||
|  | @ -1175,6 +1175,7 @@ struct RTLIL::Memory : public RTLIL::AttrObject | ||||||
| 	unsigned int hash() const { return hashidx_; } | 	unsigned int hash() const { return hashidx_; } | ||||||
| 
 | 
 | ||||||
| 	Memory(); | 	Memory(); | ||||||
|  | 	~Memory(); | ||||||
| 
 | 
 | ||||||
| 	RTLIL::IdString name; | 	RTLIL::IdString name; | ||||||
| 	int width, start_offset, size; | 	int width, start_offset, size; | ||||||
|  |  | ||||||
|  | @ -66,7 +66,9 @@ | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| #include <limits.h> | #include <limits.h> | ||||||
| 
 | 
 | ||||||
|  | #ifdef WITH_PYTHON | ||||||
| #include <Python.h> | #include <Python.h> | ||||||
|  | #endif | ||||||
| 
 | 
 | ||||||
| #ifndef _YOSYS_ | #ifndef _YOSYS_ | ||||||
| #  error It looks like you are trying to build Yosys without the config defines set. \ | #  error It looks like you are trying to build Yosys without the config defines set. \ | ||||||
|  |  | ||||||
|  | @ -44,7 +44,11 @@ void load_plugin(std::string filename, std::vector<std::string> aliases) | ||||||
| 	if (filename.find('/') == std::string::npos) | 	if (filename.find('/') == std::string::npos) | ||||||
| 		filename = "./" + filename; | 		filename = "./" + filename; | ||||||
| 
 | 
 | ||||||
|  | 	#ifdef WITH_PYTHON | ||||||
| 	if (!loaded_plugins.count(filename) && !loaded_python_plugins.count(filename)) { | 	if (!loaded_plugins.count(filename) && !loaded_python_plugins.count(filename)) { | ||||||
|  | 	#else | ||||||
|  | 	if (!loaded_plugins.count(filename)) { | ||||||
|  | 	#endif | ||||||
| 
 | 
 | ||||||
| 		#ifdef WITH_PYTHON | 		#ifdef WITH_PYTHON | ||||||
| 		if(boost::algorithm::ends_with(filename, ".py")) | 		if(boost::algorithm::ends_with(filename, ".py")) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue