1048 - Lattice Diamond: Synthesis: Synplify Pro: How to change the type of memory resources Synplify Pro uses when using inferred memory in HDL code?<br>

1048 - Lattice Diamond: Synthesis: Synplify Pro: How to change the type of memory resources Synplify Pro uses when using inferred memory in HDL code?<br>

Lattice Diamond: Synthesis: Synplify Pro: In many cases HDL code that infers a memory is implemented as EBR-based memory. This can cause issues for a customer who needs to be able to reset this memory to zero during operation.

The Synplify compiler infers the RAM type based on any memory inferring code. There is an attribute in Synplify which automatically infers RAM as technology specific RAM resources if the attribute is not set. In order to change the way Synplify infers this memory you must set this attribute in the HDL code:

attribute syn_ramstyle : string;
attribute syn_ramstyle of mem0_s, mem1_s, mem2_s, mem3_s : signal is "registers" ;
This will infer your memory as registers and not EBR RAM, allowing you to reset the contents to zero.

There are three ways to infer memory through the following syn_ramstyle attribute settings:

  1. "registers" - causes an inferred RAM to be mapped to registers (flip-flops and logic) rather than the technology-specific RAM resources.
  2. "distributed" - causes the RAM to be implemented using the distributed RAM or PFU resources.
  3. "block_ram" - causes the RAM to be implemented using the dedicated RAM resources (EBR). If your RAM resources are limited you can map additional RAMs to registers instead of the dedicated or distributed RAM resources using this attribute.