mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	This is a somewhat obscure edge case I encountered while working on test cases for earlier changes. Declarations in generate blocks should not be checked against the list of ports. This change also adds a check forbidding declarations within generate blocks being tagged as inputs or outputs.
		
			
				
	
	
		
			12 lines
		
	
	
	
		
			272 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
	
		
			272 B
		
	
	
	
		
			Text
		
	
	
	
	
	
logger -expect error "Cannot declare module port `\\x' within a generate block\." 1
 | 
						|
read_verilog <<EOT
 | 
						|
module top(x);
 | 
						|
    generate
 | 
						|
        if (1) begin : blk
 | 
						|
            output wire x;
 | 
						|
            assign x = 1;
 | 
						|
        end
 | 
						|
    endgenerate
 | 
						|
    output wire x;
 | 
						|
endmodule
 | 
						|
EOT
 |