mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Fixed propagation of width hints for $signed() and $unsigned()
This commit is contained in:
		
							parent
							
								
									8c523ef81d
								
							
						
					
					
						commit
						7fe13faefa
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -950,7 +950,10 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
 | 
			
		|||
	// just pass thru the signal. the parent will evaluated the is_signed property and inperpret the SigSpec accordingly
 | 
			
		||||
	case AST_TO_SIGNED:
 | 
			
		||||
	case AST_TO_UNSIGNED: {
 | 
			
		||||
			RTLIL::SigSpec sig = children[0]->genRTLIL();
 | 
			
		||||
			int sub_width_hint;
 | 
			
		||||
			bool sub_sign_hint;
 | 
			
		||||
			children[0]->detectSignWidth(sub_width_hint, sub_sign_hint);
 | 
			
		||||
			RTLIL::SigSpec sig = children[0]->genRTLIL(width_hint, sub_sign_hint);
 | 
			
		||||
			is_signed = sign_hint;
 | 
			
		||||
			return sig;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue