axcelenator
Newbie level 1
- Joined
- Feb 8, 2015
- Messages
- 1
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 15
declared a matrix and a signal in my TOP file like this:
type scanImage is array (0 to 7,0 to 7) of std_logic_vector(2 downto 0);
signal image_matrix : scanImage;
Now, I want to send the above signal to a function which calculates number of cells in the matrix which are not "000".
My package looks like this:
After compilizing I get this error:
Thanks for helping me.
type scanImage is array (0 to 7,0 to 7) of std_logic_vector(2 downto 0);
signal image_matrix : scanImage;
Now, I want to send the above signal to a function which calculates number of cells in the matrix which are not "000".
My package looks like this:
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; use IEEE.std_logic_arith.all; use IEEE.NUMERIC_STD.ALL; USE IEEE.NUMERIC_BIT.ALL; PACKAGE my_pack IS type double_array is array (0 to 7,0 to 7) of std_logic_vector(2 downto 0); --------------------square calculation declaration-------------------------- function square_calculation(matrix : double_array) return integer; --------------------------------------------------------------------- function square_calculation(matrix : double_array) return integer IS variable tmp: integer range 0 to 64; begin tmp:=0; for i in 0 to 7 loop for j in 0 to 7 loop if matrix(i,j)/="000" then tmp:=tmp+1; end if; end loop; end loop; return tmp; end function square_calculation; END my_pack;
After compilizing I get this error:
Error (10476): VHDL error at vision_ctrl.vhd(112): type of identifier "image_matrix" does not agree with its usage as "double_array" type
Thanks for helping me.
Last edited by a moderator: