mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-30 19:22:31 +00:00 
			
		
		
		
	remove buffers in opt_clean
This commit is contained in:
		
							parent
							
								
									7019bc00e4
								
							
						
					
					
						commit
						600c6cb013
					
				
					 1 changed files with 13 additions and 0 deletions
				
			
		|  | @ -293,6 +293,19 @@ void rmunused_module(RTLIL::Module *module, bool purge_mode, bool verbose) | |||
| 	if (verbose) | ||||
| 		log("Finding unused cells or wires in module %s..\n", module->name.c_str()); | ||||
| 
 | ||||
| 	std::vector<RTLIL::Cell*> delcells; | ||||
| 	for (auto cell : module->cells()) | ||||
| 		if (cell->type == "$pos") { | ||||
| 			bool is_signed = cell->getParam("\\A_SIGNED").as_bool(); | ||||
| 			RTLIL::SigSpec a = cell->getPort("\\A"); | ||||
| 			RTLIL::SigSpec y = cell->getPort("\\Y"); | ||||
| 			a.extend_u0(SIZE(y), is_signed); | ||||
| 			module->connect(y, a); | ||||
| 			delcells.push_back(cell); | ||||
| 		} | ||||
| 	for (auto cell : delcells) | ||||
| 		module->remove(cell); | ||||
| 
 | ||||
| 	rmunused_module_cells(module, verbose); | ||||
| 	rmunused_module_signals(module, purge_mode, verbose); | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue