mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Fixed bug in "hierarchy -top" with array of instances
This commit is contained in:
		
							parent
							
								
									76c83283c4
								
							
						
					
					
						commit
						51cfcd8331
					
				
					 1 changed files with 10 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -259,9 +259,16 @@ void hierarchy_worker(RTLIL::Design *design, std::set<RTLIL::Module*> &used, RTL
 | 
			
		|||
		log("Used module: %*s%s\n", indent, "", mod->name.c_str());
 | 
			
		||||
	used.insert(mod);
 | 
			
		||||
 | 
			
		||||
	for (auto &it : mod->cells_) {
 | 
			
		||||
		if (design->modules_.count(it.second->type) > 0)
 | 
			
		||||
			hierarchy_worker(design, used, design->modules_[it.second->type], indent+4);
 | 
			
		||||
	for (auto cell : mod->cells()) {
 | 
			
		||||
		std::string celltype = cell->type.str();
 | 
			
		||||
		if (celltype.substr(0, 7) == "$array:") {
 | 
			
		||||
			int pos_idx = celltype.find_first_of(':');
 | 
			
		||||
			int pos_num = celltype.find_first_of(':', pos_idx + 1);
 | 
			
		||||
			int pos_type = celltype.find_first_of(':', pos_num + 1);
 | 
			
		||||
			celltype = celltype.substr(pos_type + 1);
 | 
			
		||||
		}
 | 
			
		||||
		if (design->module(celltype))
 | 
			
		||||
			hierarchy_worker(design, used, design->module(celltype), indent+4);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue