ramstyle Verilog HDL Synthesis Attribute

A Verilog HDL synthesis attribute that controls the way an inferred RAM is implemented.

Note: Analysis & Synthesis also recognizes the synonymous synthesis attribute syn_ramstyle. This synthesis attribute behaves identically to the ramstyle synthesis attribute.

To use the ramstyle attribute in a Verilog Design File (.v) Definition, specify the synthesis attribute delimited by (* and *) preceding the Variable Declaration of an inferred RAM whose implementation you want to control. Specify the synthesis attribute value as "logic", "no_rw_check", "M9K", "M20K", "M144K", "MLAB", or depending on the type of memory block you want the Intel® Quartus® Prime software to use when implementing the inferred RAM. If you use the synthesis attribute on anything but a variable that represents a RAM, or if you specify an illegal value, the Intel® Quartus® Primesoftware ignores that synthesis attribute.

By setting the value to "M4K", "M9K", "M20K", "M144K", or "MLAB", you can choose the type of memory block that the Intel® Quartus® Prime software uses when implementing the inferred RAM. If the attribute is set to "logic", then the RAM is implemented in logic cells.

In addition to specifying the type of memory block for the RAM implementation, by setting the value to "no_rw_check", you can use the ramstyle attribute to indicate that you do not care about the output of the inferred RAM when there are simultaneous reads and writes to the same address. By default, the Intel® Quartus® Prime software tries to create an inferred RAM with the same read-during-write behavior as your HDL source. In some cases, a RAM must be mapped into logic because it has a read-during-write behavior that is not supported by the memory blocks in your target device. In other cases, the Intel® Quartus® Prime software must insert extra logic to mimic your read-during-write behavior, which can increase the resource requirements or reduce the performance of your design. Setting the "no_rw_check" value directs the Intel® Quartus® Prime Compiler that the read-during-write behavior of the HDL source does not need to be preserved.

Note: You can specify both a block-type and "no_rw_check" in a single attribute by separating the values with a comma, for example "no_rw_check, M144K", or you can specify only a block-type or "no_rw_check".

For example, in the following code, the ramstyle synthesis attribute specifies that the inferred RAM my_ram should be implemented using an :

(* ramstyle = "M144K" *) reg [0:7] my_ram[0:63]; 
Note: You can also embed the ramstyle synthesis attribute in a comment following the Variable Declaration of an inferred RAM, as shown in the following code:
reg [0:7] my_ram[0:63] /* synthesis ramstyle = "M144K" */;