Add dynamic slicing Verilog testcase
authorEddie Hung <eddie@fpgeh.com>
Tue, 31 Mar 2020 18:51:31 +0000 (11:51 -0700)
committerEddie Hung <eddie@fpgeh.com>
Tue, 31 Mar 2020 18:51:31 +0000 (11:51 -0700)
tests/simple/dynslice.v [new file with mode: 0644]

diff --git a/tests/simple/dynslice.v b/tests/simple/dynslice.v
new file mode 100644 (file)
index 0000000..7236ac3
--- /dev/null
@@ -0,0 +1,12 @@
+module dynslice (
+    input clk ,
+    input [9:0] ctrl ,
+    input [15:0] din ,
+    input [3:0] sel ,
+    output reg [127:0] dout
+);
+always @(posedge clk)
+begin
+    dout[ctrl*sel+:16] <= din ;
+end
+endmodule