Architecture Control Logic Function Instantiation Example for VHDL
You can instantiate Altera-provided logic functions from the alt_mf library, which includes the a_8fadd, a_8mcomp, a_8count, and a_81mux functions, in VHDL designs. Altera provides behavioral descriptions of these functions that support pre-routing simulation of your top-level design with any supported simulation software.
When you instantiate one of these functions, you can either include a Component Declaration for the function, or use the Altera-provided shell script analyze_vss to create a design library called altera so that you can reference the functions through the VHDL Library and Use Clauses. The VHDL Library and Use Clauses direct the Design Compiler to incorporate the library files when it compiles your top-level design file.
The following example shows an 8-bit counter that is instantiated using the a_8count function.
Sample VHDL File with Logic Function Instantiation
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
LIBRARY altera;
USE altera.quartus.ALL;
ENTITY counter IS
PORT (clock,ena,load,dnup,set,clear : IN STD_LOGIC;
i : IN STD_LOGIC_VECTOR (7 DOWNTO 0);
q : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);