mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	Add "verilog_defines -list" and "verilog_defines -reset"
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
		
							parent
							
								
									4033ff8c2e
								
							
						
					
					
						commit
						5025aab8c9
					
				
					 1 changed files with 16 additions and 0 deletions
				
			
		|  | @ -553,6 +553,12 @@ struct VerilogDefines : public Pass { | ||||||
| 		log("    -Uname[=definition]\n"); | 		log("    -Uname[=definition]\n"); | ||||||
| 		log("        undefine the preprocessor symbol 'name'\n"); | 		log("        undefine the preprocessor symbol 'name'\n"); | ||||||
| 		log("\n"); | 		log("\n"); | ||||||
|  | 		log("    -reset\n"); | ||||||
|  | 		log("        clear list of defined preprocessor symbols\n"); | ||||||
|  | 		log("\n"); | ||||||
|  | 		log("    -list\n"); | ||||||
|  | 		log("        list currently defined preprocessor symbols\n"); | ||||||
|  | 		log("\n"); | ||||||
| 	} | 	} | ||||||
| 	void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE | 	void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE | ||||||
| 	{ | 	{ | ||||||
|  | @ -588,6 +594,16 @@ struct VerilogDefines : public Pass { | ||||||
| 				design->verilog_defines.erase(name); | 				design->verilog_defines.erase(name); | ||||||
| 				continue; | 				continue; | ||||||
| 			} | 			} | ||||||
|  | 			if (arg == "-reset") { | ||||||
|  | 				design->verilog_defines.clear(); | ||||||
|  | 				continue; | ||||||
|  | 			} | ||||||
|  | 			if (arg == "-list") { | ||||||
|  | 				for (auto &it : design->verilog_defines) { | ||||||
|  | 					log("`define %s%s %s\n", it.first.c_str(), it.second.second ? "()" : "", it.second.first.c_str()); | ||||||
|  | 				} | ||||||
|  | 				continue; | ||||||
|  | 			} | ||||||
| 			break; | 			break; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue