mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Fixed handling of parameters and localparams in functions
This commit is contained in:
		
							parent
							
								
									d98d99aec6
								
							
						
					
					
						commit
						34f2b84fb6
					
				
					 4 changed files with 39 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -520,6 +520,11 @@ struct AST_INTERNAL::ProcessGenerator
 | 
			
		|||
			log_error("Found wire declaration in block without label at at %s:%d!\n", ast->filename.c_str(), ast->linenum);
 | 
			
		||||
			break;
 | 
			
		||||
 | 
			
		||||
		case AST_PARAMETER:
 | 
			
		||||
		case AST_LOCALPARAM:
 | 
			
		||||
			log_error("Found parameter declaration in block without label at at %s:%d!\n", ast->filename.c_str(), ast->linenum);
 | 
			
		||||
			break;
 | 
			
		||||
 | 
			
		||||
		case AST_TCALL:
 | 
			
		||||
		case AST_FOR:
 | 
			
		||||
			break;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1013,7 +1013,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
 | 
			
		|||
 | 
			
		||||
		std::vector<AstNode*> new_children;
 | 
			
		||||
		for (size_t i = 0; i < children.size(); i++)
 | 
			
		||||
			if (children[i]->type == AST_WIRE) {
 | 
			
		||||
			if (children[i]->type == AST_WIRE || children[i]->type == AST_PARAMETER || children[i]->type == AST_LOCALPARAM) {
 | 
			
		||||
				children[i]->simplify(false, false, false, stage, -1, false, false);
 | 
			
		||||
				current_ast_mod->children.push_back(children[i]);
 | 
			
		||||
				current_scope[children[i]->str] = children[i];
 | 
			
		||||
| 
						 | 
				
			
			@ -1865,7 +1865,7 @@ skip_dynamic_range_lvalue_expansion:;
 | 
			
		|||
		}
 | 
			
		||||
 | 
			
		||||
		for (auto child : decl->children)
 | 
			
		||||
			if (child->type == AST_WIRE)
 | 
			
		||||
			if (child->type == AST_WIRE || child->type == AST_PARAMETER || child->type == AST_LOCALPARAM)
 | 
			
		||||
			{
 | 
			
		||||
				AstNode *wire = child->clone();
 | 
			
		||||
				wire->str = prefix + wire->str;
 | 
			
		||||
| 
						 | 
				
			
			@ -1896,7 +1896,7 @@ skip_dynamic_range_lvalue_expansion:;
 | 
			
		|||
			}
 | 
			
		||||
 | 
			
		||||
		for (auto child : decl->children)
 | 
			
		||||
			if (child->type != AST_WIRE)
 | 
			
		||||
			if (child->type != AST_WIRE && child->type != AST_PARAMETER && child->type != AST_LOCALPARAM)
 | 
			
		||||
			{
 | 
			
		||||
				AstNode *stmt = child->clone();
 | 
			
		||||
				stmt->replace_ids(prefix, replace_rules);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue