I tried asking this in the Altera forum, but to no avail.
The crux of my question is why the template that Quatus itself suggests results in a warning and how to fix that?
For portability and readability I strongly prefer infering memory, but I seem to be having a very hard time getting Quartus II 7.2 to behave as expected. Quartus own template (pick edit -> insert template ->
single port ram. The code included below) when translated produces this warning:
"Warning: Inferred RAM node "ram~0" from synchronous design logic. Pass-through logic has been added to match the read-during-write behavior of the original design."
Indeed, the template is pass-through, but that is be directly supported by the M4K memory blocks in the context I'm using (no mixed port sizes or clocks).
The setting "Add Pass-Through Logic to Inferred RAMs" defaults to "On", but I don't understand that option. It seems to me that setting it to "Off" would instruct Quartus II to infer logic that doesn't implement exactly what the Verilog specifies and would certainly cause a discrepancy when simulated with Icarus Verilog.
To make matters even more entertaining, the online help disagrees with this template. Notably, the memory update is using a non-blocking assignment
if (we) ram[addr]