mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	Merge pull request #2352 from zachjs/const-func-localparam
Allow localparams in constant functions
This commit is contained in:
		
						commit
						a10893072b
					
				
					 2 changed files with 18 additions and 3 deletions
				
			
		|  | @ -4507,6 +4507,18 @@ AstNode *AstNode::eval_const_function(AstNode *fcall) | |||
| 
 | ||||
| 		log_assert(variables.count(str) != 0); | ||||
| 
 | ||||
| 		if (stmt->type == AST_LOCALPARAM) | ||||
| 		{ | ||||
| 			while (stmt->simplify(true, false, false, 1, -1, false, true)) { } | ||||
| 
 | ||||
| 			if (!backup_scope.count(stmt->str)) | ||||
| 				backup_scope[stmt->str] = current_scope[stmt->str]; | ||||
| 			current_scope[stmt->str] = stmt; | ||||
| 
 | ||||
| 			block->children.erase(block->children.begin()); | ||||
| 			continue; | ||||
| 		} | ||||
| 
 | ||||
| 		if (stmt->type == AST_ASSIGN_EQ) | ||||
| 		{ | ||||
| 			if (stmt->children.at(0)->type == AST_IDENTIFIER && stmt->children.at(0)->children.size() != 0 && | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue