jarodz method is the most generic for sure and will get to the right result.
Alternatively, you can instantiate platform specific elements. For example, on my spartan3, I have LUT4, ROM256X1, and so on.
// LUT4: 4-input Look-Up Table with general output
// Spartan-3E
// Xilinx HDL Libraries Guide, version 12.1
LUT4 #(
.INIT(16’h0000) // Specify LUT Contents
) LUT4_inst (
.O(O), // LUT general output
.I0(I0), // LUT input
.I1(I1), // LUT input
.I2(I2), // LUT input
.I3(I3) // LUT input
);
// End of LUT4_inst instantiation
// ROM256X1: 256 x 1 Asynchronous Distributed (LUT) ROM
// Spartan-3E
// Xilinx HDL Libraries Guide, version 12.1
ROM256X1 #(
.INIT(256’h0000000000000000000000000000000000000000000000000000000000000000) // Contents of ROM
) ROM256X1_inst (
.O(O), // ROM output
.A0(A0), // ROM address[0]
.A1(A1), // ROM address[1]
.A2(A2), // ROM address[2]
.A3(A3), // ROM address[3]
.A4(A4), // ROM address[4]
.A5(A5), // ROM address[5]
.A6(A6), // ROM address[6]
.A7(A7) // ROM address[7]
);
// End of ROM256X1_inst instantiation
Regards
Richard