Forum Discussion
Altera_Forum
Honored Contributor
11 years agoHello Tricky and thank you very much for your reply.
--- Quote Start --- First of all, I think you made an error: type GMat is array (0 to 1, 0 to 1) of GMat; shouldnt it be type GMat is array (0 to 1, 0 to 1) of GVal; --- Quote End --- It is a typewriting mistake, sorry about that. Thanks for the correction. --- Quote Start --- Have you tried a newer version? --- Quote End --- I only have this version right now. For the code, I made this separate example and got the same error: First, there is the types-package "IMG_Types.vhd".
library RealNum; -- Defined as a global library in the project settings, it refers to the location of the fixed_pkg
use RealNum.fixed_float_types.all;
use RealNum.fixed_pkg.all;
package IMG_Types is
subtype GVal is sfixed (1 downto -4); --sfixed is a fixed-point type defined in the VHDL fixed-point package.
type GMat is array (0 to 1, 0 to 1) of GVal;
end package;
Second, there is the routines, constants, .. package "G_pkg.vhd"
library ieee;
use ieee.std_logic_1164.all;
library RealNum; -- Defined as global library in the project settings, it refers to the location of the fixed_pkg
use RealNum.fixed_float_types.all;
use RealNum.fixed_pkg.all;
library PKG; -- defined as a global library to refere to the location of the IMg_Types (the same of this package. work will suffice of course)
use PKg.IMG_Types.all;
package G_pkg is
constant GMTest: GMat:= ((to_sfixed(-1.5,2,-3),to_sfixed(-1.4,2,-3)) , (to_sfixed(-0.2,2,-3),to_sfixed(-0.5,2,-3)));
end package G_pkg;
Finally there is the top-level entity
library ieee;
use ieee.std_logic_1164.all;
library PKG;
use PKG.IMG_Types.all;
use PKG.G_PKG.all;
entity FixedMat is
port(clk, reset : in std_logic;
fGab : out GVal
);
end FixedMat;
Architecture Exmp1Arc of FixedMat is
begin
fGab <= GMTest(0,0);
end;