Add tests based on the test case from #1990
authorClaire Wolf <claire@symbioticeda.com>
Wed, 29 Apr 2020 12:28:54 +0000 (14:28 +0200)
committerClaire Wolf <claire@symbioticeda.com>
Sat, 2 May 2020 09:21:01 +0000 (11:21 +0200)
Signed-off-by: Claire Wolf <claire@symbioticeda.com>
tests/simple/partsel.v

index 83493fcb0ec7f4e8d79f322b2822a45de8ef30bf..dd66ded55f9e91225cd3d99167e2f6b47fc2f3d2 100644 (file)
@@ -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