mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	Added log_id() helper function
This commit is contained in:
		
							parent
							
								
									ec3a798194
								
							
						
					
					
						commit
						a8cedb2257
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		|  | @ -52,6 +52,14 @@ void log_flush(); | ||||||
| 
 | 
 | ||||||
| const char *log_signal(const RTLIL::SigSpec &sig, bool autoint = true); | const char *log_signal(const RTLIL::SigSpec &sig, bool autoint = true); | ||||||
| 
 | 
 | ||||||
|  | static inline const char *log_id(std::string id) { | ||||||
|  | 	return RTLIL::id2cstr(id); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | template<typename T> static inline const char *log_id(T *obj) { | ||||||
|  | 	return RTLIL::id2cstr(obj->name); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| #define log_abort() log_error("Abort in %s:%d.\n", __FILE__, __LINE__) | #define log_abort() log_error("Abort in %s:%d.\n", __FILE__, __LINE__) | ||||||
| #define log_assert(_assert_expr_) do { if (_assert_expr_) break; log_error("Assert `%s' failed in %s:%d.\n", #_assert_expr_, __FILE__, __LINE__); } while (0) | #define log_assert(_assert_expr_) do { if (_assert_expr_) break; log_error("Assert `%s' failed in %s:%d.\n", #_assert_expr_, __FILE__, __LINE__); } while (0) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue