Altera_Forum
Honored Contributor
11 years agohow to define a function in quatus?
I created a file named user_defs.vhl, the contents as below:
LIBRARY ieee; USE ieee.std_logic_1164.all; PACKAGE user_defs IS Type Clock is (int, ext); Type Trig is (manual, auto); function spi_adc_wr_rd(input_dat: bit_vector(15 downto 0); input_clk: std_logic) return bit_vector(15 downto 0); END user_defs; PACKAGE BODY user_defs IS Function SPI_ADC_wr_RD(Input_dat: bit_vector(15 downto 0); Input_clk: std_LOGIC) return bit_vector(15 downto 0) is variable tmp: bit_vector(Input_dat'rang); begin tmp <= Input_dat; return tmp; end; END user_defs; I want to invole this function of SPI_ADC_wr_RD in another VHDL file, ... USE work.user_defs.all ... but when I compile this project, it always displays error as below, even I do not invole this function. 10479 VHDL error at user_defs(9): indexed name type is used but not declared. I am using 32-bit Quartus 13.1, please give me support. thanks! Br jjl3