mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 13:29:12 +00:00 
			
		
		
		
	Fixes for early width and sign detection in ast simplifier
This commit is contained in:
		
							parent
							
								
									472117d532
								
							
						
					
					
						commit
						1325514d33
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -242,7 +242,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
 | 
				
			||||||
		width_hint = -1;
 | 
							width_hint = -1;
 | 
				
			||||||
		sign_hint = true;
 | 
							sign_hint = true;
 | 
				
			||||||
		for (auto child : children) {
 | 
							for (auto child : children) {
 | 
				
			||||||
			while (child->simplify(false, false, false, stage, -1, false) == true) { }
 | 
								while (child->simplify(false, false, in_lvalue, stage, -1, false) == true) { }
 | 
				
			||||||
			child->detectSignWidthWorker(width_hint, sign_hint);
 | 
								child->detectSignWidthWorker(width_hint, sign_hint);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		reset_width_after_children = true;
 | 
							reset_width_after_children = true;
 | 
				
			||||||
| 
						 | 
					@ -851,6 +851,7 @@ skip_dynamic_range_lvalue_expansion:;
 | 
				
			||||||
			wire->is_output = false;
 | 
								wire->is_output = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			current_ast_mod->children.push_back(wire);
 | 
								current_ast_mod->children.push_back(wire);
 | 
				
			||||||
 | 
								while (wire->simplify(true, false, false, 1, -1, false)) { }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			AstNode *lvalue = new AstNode(AST_IDENTIFIER);
 | 
								AstNode *lvalue = new AstNode(AST_IDENTIFIER);
 | 
				
			||||||
			lvalue->str = wire->str;
 | 
								lvalue->str = wire->str;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue