mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 19:52:31 +00:00 
			
		
		
		
	verilog: disallow overriding global parameters
It was previously possible to override global parameters on a per-instance basis. This could be dangerous when using positional parameter bindings, hiding oversupplied parameters.
This commit is contained in:
		
							parent
							
								
									83fc5cc28b
								
							
						
					
					
						commit
						cb9f3b6abf
					
				
					 2 changed files with 18 additions and 0 deletions
				
			
		|  | @ -1286,6 +1286,8 @@ void AST::process(RTLIL::Design *design, AstNode *ast, bool dump_ast1, bool dump | |||
| 		} | ||||
| 		else { | ||||
| 			// must be global definition
 | ||||
| 			if ((*it)->type == AST_PARAMETER) | ||||
| 				(*it)->type = AST_LOCALPARAM; // cannot be overridden
 | ||||
| 			(*it)->simplify(false, false, false, 1, -1, false, false); //process enum/other declarations
 | ||||
| 			design->verilog_globals.push_back((*it)->clone()); | ||||
| 			current_scope.clear(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue