To use Altera-provided megafunctions in a design, use the MegaWizard Plug-In Manager to generate a custom megafunction variation. Refer to Creating and Instantiating Altera-Provided Functions in Other EDA Tools for examples on how to use Altera-provided megafunctions and library of parameterized modules (LPM) functions in other EDA design entry/synthesis tools.
Once you create a megafunction variation, you can instantiate it as a black box entity in the design.
In addition, the DC FPGA software automatically recognizes certain types of HDL code and maps it to Altera megafunctions during synthesis. You can describe the design in Verilog HDL or VHDL and use the DC FPGA software to infer arithmetic and relational operators, counters, RAM, ROM, and DSP functions directly from HDL code.
If you are performing formal verification with the Formality software, you must instantiate RAM as a black box entity.