mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	Fixed handling of parameters with reversed range
This commit is contained in:
		
							parent
							
								
									08f9b38a9c
								
							
						
					
					
						commit
						13983e8318
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -678,7 +678,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, | ||||||
| 		if (children.size() > 1 && children[1]->type == AST_RANGE) { | 		if (children.size() > 1 && children[1]->type == AST_RANGE) { | ||||||
| 			if (!children[1]->range_valid) | 			if (!children[1]->range_valid) | ||||||
| 				log_error("Non-constant width range on parameter decl at %s:%d.\n", filename.c_str(), linenum); | 				log_error("Non-constant width range on parameter decl at %s:%d.\n", filename.c_str(), linenum); | ||||||
| 			int width = children[1]->range_left - children[1]->range_right + 1; | 			int width = std::abs(children[1]->range_left - children[1]->range_right) + 1; | ||||||
| 			if (children[0]->type == AST_REALVALUE) { | 			if (children[0]->type == AST_REALVALUE) { | ||||||
| 				RTLIL::Const constvalue = children[0]->realAsConst(width); | 				RTLIL::Const constvalue = children[0]->realAsConst(width); | ||||||
| 				log_warning("converting real value %e to binary %s at %s:%d.\n", | 				log_warning("converting real value %e to binary %s at %s:%d.\n", | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue