mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-30 19:22:31 +00:00 
			
		
		
		
	Merge 913ac04764 into 1d2d777678
				
					
				
			This commit is contained in:
		
						commit
						d6eccca38a
					
				
					 2 changed files with 29 additions and 0 deletions
				
			
		|  | @ -1071,6 +1071,17 @@ struct HierarchyPass : public Pass { | |||
| 					mod->attributes[ID::initial_top] = RTLIL::Const(1); | ||||
| 				else | ||||
| 					mod->attributes.erase(ID::initial_top); | ||||
| 
 | ||||
| 			std::vector<IdString> abstract_ids; | ||||
| 			for (auto cell : top_mod->cells()) { | ||||
| 				IdString abstract_id = "$abstract" + cell->type.str(); | ||||
| 				if (design->module(cell->type) == nullptr && design->module(abstract_id)) | ||||
| 					abstract_ids.push_back(abstract_id); | ||||
| 			} | ||||
| 			for (auto abstract_id : abstract_ids) | ||||
| 				design->module(abstract_id)->derive(design, {}); | ||||
| 			for (auto abstract_id : abstract_ids) | ||||
| 				design->remove(design->module(abstract_id)); | ||||
| 		} | ||||
| 
 | ||||
| 		bool did_something = true; | ||||
|  |  | |||
							
								
								
									
										18
									
								
								tests/various/hierarchy_reassign_localparam.ys
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								tests/various/hierarchy_reassign_localparam.ys
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| read_verilog -defer <<EOT | ||||
| 
 | ||||
| module bb (...); | ||||
| localparam A = "abc"; | ||||
| input a; | ||||
| output b; | ||||
| endmodule | ||||
| 
 | ||||
| module top (...); | ||||
| input a; | ||||
| output b; | ||||
| bb #(.A("def")) my_bb (a, b); | ||||
| endmodule | ||||
| 
 | ||||
| EOT | ||||
| 
 | ||||
| logger -expect error "does not have a parameter named 'A'" 1 | ||||
| hierarchy -check -top top | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue