mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Add tests based on the test case from #1990
Signed-off-by: Claire Wolf <claire@symbioticeda.com>
This commit is contained in:
		
							parent
							
								
									589ed2d970
								
							
						
					
					
						commit
						749c2ff84a
					
				
					 1 changed files with 46 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -64,3 +64,49 @@ endmodule
 | 
			
		|||
module partsel_test003(input [2:0] a, b, input [31:0] din, output [3:0] dout);
 | 
			
		||||
assign dout = din[a*b +: 2];
 | 
			
		||||
endmodule
 | 
			
		||||
 | 
			
		||||
module partsel_test004 (
 | 
			
		||||
	input [31:0] din,
 | 
			
		||||
	input signed [4:0] n,
 | 
			
		||||
	output reg [31:0] dout
 | 
			
		||||
);
 | 
			
		||||
	always @(*) begin
 | 
			
		||||
		dout = 0;
 | 
			
		||||
		dout[n+1 +: 2] = din[n +: 2];
 | 
			
		||||
	end
 | 
			
		||||
endmodule
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module partsel_test005 (
 | 
			
		||||
	input [31:0] din,
 | 
			
		||||
	input signed [4:0] n,
 | 
			
		||||
	output reg [31:0] dout
 | 
			
		||||
);
 | 
			
		||||
	always @(*) begin
 | 
			
		||||
		dout = 0;
 | 
			
		||||
		dout[n+1] = din[n];
 | 
			
		||||
	end
 | 
			
		||||
endmodule
 | 
			
		||||
 | 
			
		||||
module partsel_test006 (
 | 
			
		||||
	input [31:0] din,
 | 
			
		||||
	input signed [4:0] n,
 | 
			
		||||
	output reg [31:-32] dout
 | 
			
		||||
);
 | 
			
		||||
	always @(*) begin
 | 
			
		||||
		dout = 0;
 | 
			
		||||
		dout[n+1 +: 2] = din[n +: 2];
 | 
			
		||||
	end
 | 
			
		||||
endmodule
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module partsel_test007 (
 | 
			
		||||
	input [31:0] din,
 | 
			
		||||
	input signed [4:0] n,
 | 
			
		||||
	output reg [31:-32] dout
 | 
			
		||||
);
 | 
			
		||||
	always @(*) begin
 | 
			
		||||
		dout = 0;
 | 
			
		||||
		dout[n+1] = din[n];
 | 
			
		||||
	end
 | 
			
		||||
endmodule
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue