mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Fixed another bug found using vloghammer
This commit is contained in:
		
							parent
							
								
									eff68560a2
								
							
						
					
					
						commit
						e8da3ea7b6
					
				
					 2 changed files with 11 additions and 1 deletions
				
			
		| 
						 | 
					@ -798,7 +798,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint)
 | 
				
			||||||
	if (0) { case AST_SHIFT_SLEFT:  type_name = "$sshl"; is_signed = true; }
 | 
						if (0) { case AST_SHIFT_SLEFT:  type_name = "$sshl"; is_signed = true; }
 | 
				
			||||||
	if (0) { case AST_SHIFT_SRIGHT: type_name = "$sshr"; is_signed = true; }
 | 
						if (0) { case AST_SHIFT_SRIGHT: type_name = "$sshr"; is_signed = true; }
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			RTLIL::SigSpec left = children[0]->genRTLIL(width_hint);
 | 
								RTLIL::SigSpec left = children[0]->genRTLIL();
 | 
				
			||||||
			RTLIL::SigSpec right = children[1]->genRTLIL(width_hint);
 | 
								RTLIL::SigSpec right = children[1]->genRTLIL(width_hint);
 | 
				
			||||||
			int width = width_hint > 0 ? width_hint : left.width;
 | 
								int width = width_hint > 0 ? width_hint : left.width;
 | 
				
			||||||
			return binop2rtlil(this, type_name, width, left, right);
 | 
								return binop2rtlil(this, type_name, width, left, right);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										10
									
								
								tests/simple/vloghammer.v
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								tests/simple/vloghammer.v
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,10 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// test cases found using vloghammer
 | 
				
			||||||
 | 
					// https://github.com/cliffordwolf/VlogHammer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					module test01(a, y);
 | 
				
			||||||
 | 
						input [7:0] a;
 | 
				
			||||||
 | 
						output [3:0] y;
 | 
				
			||||||
 | 
						assign y = ~a >> 4;
 | 
				
			||||||
 | 
					endmodule
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue