mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Added "chparam -list"
This commit is contained in:
		
							parent
							
								
									590f74d8f0
								
							
						
					
					
						commit
						1f33b2a490
					
				
					 1 changed files with 21 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -192,11 +192,17 @@ struct ChparamPass : public Pass {
 | 
			
		|||
		log("Re-evaluate the selected modules with new parameters. String values must be\n");
 | 
			
		||||
		log("passed in double quotes (\").\n");
 | 
			
		||||
		log("\n");
 | 
			
		||||
		log("\n");
 | 
			
		||||
		log("    chparam -list [selection]\n");
 | 
			
		||||
		log("\n");
 | 
			
		||||
		log("List the available parameters of the selected modules.\n");
 | 
			
		||||
		log("\n");
 | 
			
		||||
	}
 | 
			
		||||
	virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
 | 
			
		||||
	{
 | 
			
		||||
		std::vector<setunset_t> setunset_list;
 | 
			
		||||
		dict<RTLIL::IdString, RTLIL::Const> new_parameters;
 | 
			
		||||
		bool list_mode = false;
 | 
			
		||||
 | 
			
		||||
		size_t argidx;
 | 
			
		||||
		for (argidx = 1; argidx < args.size(); argidx++)
 | 
			
		||||
| 
						 | 
				
			
			@ -209,10 +215,25 @@ struct ChparamPass : public Pass {
 | 
			
		|||
				argidx--;
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
			if (arg == "-list") {
 | 
			
		||||
				list_mode = true;
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
		extra_args(args, argidx, design);
 | 
			
		||||
 | 
			
		||||
		if (list_mode) {
 | 
			
		||||
			if (!new_parameters.empty())
 | 
			
		||||
				log_cmd_error("The options -set and -list cannot be used together.\n");
 | 
			
		||||
			for (auto module : design->selected_modules()) {
 | 
			
		||||
				log("%s:\n", log_id(module));
 | 
			
		||||
				for (auto param : module->avail_parameters)
 | 
			
		||||
					log("  %s\n", log_id(param));
 | 
			
		||||
			}
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		pool<IdString> modnames, old_modnames;
 | 
			
		||||
		for (auto module : design->selected_modules()) {
 | 
			
		||||
			if (design->selected_whole_module(module))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue