mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-30 19:22:31 +00:00 
			
		
		
		
	(IEEE1800-2017 section 20.11) This PR allows us to use $info/$warning/$error/$fatal **at elaboration time** within a generate block. This is very useful to stop a synthesis of a parametrized block when an illegal combination of parameters is chosen.
		
			
				
	
	
		
			30 lines
		
	
	
	
		
			548 B
		
	
	
	
		
			Systemverilog
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
	
		
			548 B
		
	
	
	
		
			Systemverilog
		
	
	
	
	
	
| module test;
 | |
| localparam X=1;
 | |
| genvar i;
 | |
| generate
 | |
| if (X == 1)
 | |
|   $info("X is 1");
 | |
| if (X == 1)
 | |
|   $warning("X is 1");
 | |
| else
 | |
|   $error("X is not 1");
 | |
| case (X)
 | |
|   1: $info("X is 1 in a case statement");
 | |
| endcase
 | |
| //case (X-1)
 | |
| //  1: $warn("X is 2");
 | |
| //  default: $warn("X might be anything in a case statement");
 | |
| //endcase
 | |
| for (i = 0; i < 3; i = i + 1)
 | |
| begin
 | |
|   case(i)
 | |
|     0: $info;
 | |
|     1: $warning;
 | |
|     default: $info("default case statemnent");
 | |
|   endcase
 | |
| end
 | |
| 
 | |
| $info("This is a standalone $info(). Next $info has no parameters");
 | |
| $info;
 | |
| endgenerate
 | |
| endmodule
 |