Maybe you should ask your synthesis tool supplier. In Xilinx,
the code I showed using $readmemh works for synthesis. If you
never assign the reg outside the initial block a reasonable
synthesis tool should understand this to be a ROM.
Other than that you could go back to your C program and output
code like:
wire [7:0] small_ROM [0:7];
assign small_ROM[0] = 8'h22;
assign small_ROM[1] = 8'h42;
assign small_ROM[2] = 8'h57;
assign small_ROM[3] = 8'h10;
assign small_ROM[4] = 8'h09;
assign small_ROM[5] = 8'h11;
assign small_ROM[6] = 8'h99;
assign small_ROM[7] = 8'hAF;
If you don't like to have clutter pasted into your
other code, you can `include the generated file.
That also prevents the C code from trashing your
code edits.
--
Gabor