diff options
Diffstat (limited to 'tests/various/dynamic_part_select/reversed.v')
-rw-r--r-- | tests/various/dynamic_part_select/reversed.v | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/various/dynamic_part_select/reversed.v b/tests/various/dynamic_part_select/reversed.v new file mode 100644 index 000000000..8b114ac77 --- /dev/null +++ b/tests/various/dynamic_part_select/reversed.v @@ -0,0 +1,13 @@ +module reversed #(parameter WIDTH=32, SELW=4, CTRLW=$clog2(WIDTH), DINW=2**SELW) + (input clk, + input [CTRLW-1:0] ctrl, + input [DINW-1:0] din, + input [SELW-1:0] sel, + output reg [WIDTH-1:0] dout); + + localparam SLICE = WIDTH/(SELW**2); + always @(posedge clk) begin + dout[(WIDTH-ctrl*sel)-:SLICE] <= din; + end +endmodule + |