Saar suggests using LUT6 to explicitly create a LUT. I prefer to control technology mapping with a LUT_MAP restriction. This requires less maintenance, and your HDL code remains compatible with your device and simulator.
Here is an example.
(* LUT_MAP="yes" *)
module mux4(sel, a, b, c, d, o);
input [1:0] sel;
input a;
input b;
input c;
input d;
output reg o;
always @* begin
case(sel)
2'b00: o <= a;
2'b01: o <= b;
2'b10: o <= c;
2'b11: o <= d;
endcase
end
endmodule
(XST), ( 6-, ) LUT. KEEP_HIERARCHY RLOC, RPM ( ).
(* KEEP_HIERARCHY="true" *)
module mux4x4p4(sel, a, b, c, d, o);
input [1:0] sel;
input [3:0] a;
input [3:0] b;
input [3:0] c;
input [3:0] d;
output [3:0] o;
(* RLOC="X0Y0" *)
mux4 m0(sel, a[0], b[0], c[0], d[0], o[0]);
(* RLOC="X0Y0" *)
mux4 m1(sel, a[1], b[1], c[1], d[1], o[1]);
(* RLOC="X0Y0" *)
mux4 m2(sel, a[2], b[2], c[2], d[2], o[2]);
(* RLOC="X0Y0" *)
mux4 m3(sel, a[3], b[3], c[3], d[3], o[3]);
endmodule
RPM datapaths - www.fpgacpu.org. , " FPGA": http://www.fpgacpu.org/log/aug02.html#art
!