module permute ( a, x ); input [2:0] a; output [2:0] x; reg [2:0] x; always @(a) begin: _permute_logic reg [2-1:0] tmp; integer i; tmp = 0; for (i=0; i<3; i=i+1) begin // synthesis parallel_case full_case case (i) 0: tmp = 1; 1: tmp = 2; default: tmp = 0; endcase x[i] <= a[tmp]; end end endmodule