mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	Replace std::map with dict for simplemap_mappers.
				
					
				
			This commit is contained in:
		
							parent
							
								
									99b586b283
								
							
						
					
					
						commit
						437f3fb342
					
				
					 3 changed files with 5 additions and 5 deletions
				
			
		|  | @ -522,7 +522,7 @@ void simplemap_dlatch(RTLIL::Module *module, RTLIL::Cell *cell) | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void simplemap_get_mappers(std::map<RTLIL::IdString, void(*)(RTLIL::Module*, RTLIL::Cell*)> &mappers) | void simplemap_get_mappers(dict<IdString, void(*)(RTLIL::Module*, RTLIL::Cell*)> &mappers) | ||||||
| { | { | ||||||
| 	mappers[ID($not)]         = simplemap_not; | 	mappers[ID($not)]         = simplemap_not; | ||||||
| 	mappers[ID($pos)]         = simplemap_pos; | 	mappers[ID($pos)]         = simplemap_pos; | ||||||
|  | @ -559,7 +559,7 @@ void simplemap_get_mappers(std::map<RTLIL::IdString, void(*)(RTLIL::Module*, RTL | ||||||
| 
 | 
 | ||||||
| void simplemap(RTLIL::Module *module, RTLIL::Cell *cell) | void simplemap(RTLIL::Module *module, RTLIL::Cell *cell) | ||||||
| { | { | ||||||
| 	static std::map<RTLIL::IdString, void(*)(RTLIL::Module*, RTLIL::Cell*)> mappers; | 	static dict<IdString, void(*)(RTLIL::Module*, RTLIL::Cell*)> mappers; | ||||||
| 	static bool initialized_mappers = false; | 	static bool initialized_mappers = false; | ||||||
| 
 | 
 | ||||||
| 	if (!initialized_mappers) { | 	if (!initialized_mappers) { | ||||||
|  | @ -595,7 +595,7 @@ struct SimplemapPass : public Pass { | ||||||
| 		log_header(design, "Executing SIMPLEMAP pass (map simple cells to gate primitives).\n"); | 		log_header(design, "Executing SIMPLEMAP pass (map simple cells to gate primitives).\n"); | ||||||
| 		extra_args(args, 1, design); | 		extra_args(args, 1, design); | ||||||
| 
 | 
 | ||||||
| 		std::map<RTLIL::IdString, void(*)(RTLIL::Module*, RTLIL::Cell*)> mappers; | 		dict<IdString, void(*)(RTLIL::Module*, RTLIL::Cell*)> mappers; | ||||||
| 		simplemap_get_mappers(mappers); | 		simplemap_get_mappers(mappers); | ||||||
| 
 | 
 | ||||||
| 		for (auto mod : design->modules()) { | 		for (auto mod : design->modules()) { | ||||||
|  |  | ||||||
|  | @ -42,7 +42,7 @@ extern void simplemap_adff(RTLIL::Module *module, RTLIL::Cell *cell); | ||||||
| extern void simplemap_dlatch(RTLIL::Module *module, RTLIL::Cell *cell); | extern void simplemap_dlatch(RTLIL::Module *module, RTLIL::Cell *cell); | ||||||
| extern void simplemap(RTLIL::Module *module, RTLIL::Cell *cell); | extern void simplemap(RTLIL::Module *module, RTLIL::Cell *cell); | ||||||
| 
 | 
 | ||||||
| extern void simplemap_get_mappers(std::map<RTLIL::IdString, void(*)(RTLIL::Module*, RTLIL::Cell*)> &mappers); | extern void simplemap_get_mappers(dict<RTLIL::IdString, void(*)(RTLIL::Module*, RTLIL::Cell*)> &mappers); | ||||||
| 
 | 
 | ||||||
| YOSYS_NAMESPACE_END | YOSYS_NAMESPACE_END | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -62,7 +62,7 @@ void apply_prefix(IdString prefix, RTLIL::SigSpec &sig, RTLIL::Module *module) | ||||||
| 
 | 
 | ||||||
| struct TechmapWorker | struct TechmapWorker | ||||||
| { | { | ||||||
| 	std::map<IdString, void(*)(RTLIL::Module*, RTLIL::Cell*)> simplemap_mappers; | 	dict<IdString, void(*)(RTLIL::Module*, RTLIL::Cell*)> simplemap_mappers; | ||||||
| 	std::map<std::pair<IdString, std::map<IdString, RTLIL::Const>>, RTLIL::Module*> techmap_cache; | 	std::map<std::pair<IdString, std::map<IdString, RTLIL::Const>>, RTLIL::Module*> techmap_cache; | ||||||
| 	std::map<RTLIL::Module*, bool> techmap_do_cache; | 	std::map<RTLIL::Module*, bool> techmap_do_cache; | ||||||
| 	std::set<RTLIL::Module*, IdString::compare_ptr_by_name<RTLIL::Module>> module_queue; | 	std::set<RTLIL::Module*, IdString::compare_ptr_by_name<RTLIL::Module>> module_queue; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue