mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-30 19:22:31 +00:00 
			
		
		
		
	If a local variable is always assigned before it is used, then adding nosync prevents latches from being needlessly generated.
		
			
				
	
	
		
			21 lines
		
	
	
	
		
			255 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
	
		
			255 B
		
	
	
	
		
			Text
		
	
	
	
	
	
| read_verilog -sv <<EOF
 | |
| module top;
 | |
| logic x;
 | |
| logic z;
 | |
| assign z = 1'b1;
 | |
| always_comb begin
 | |
|     logic y;
 | |
|     case (x)
 | |
|     1'b0:
 | |
|         y = 1;
 | |
|     default:
 | |
|         y = 0;
 | |
|     endcase
 | |
|     if (z)
 | |
|         x = y;
 | |
|     else
 | |
|         x = 1'b0;
 | |
| end
 | |
| endmodule
 | |
| EOF
 | |
| proc
 |