Construction d'un package
Bonjour,
je n'arrive pas à écrire un package. Voici mon code :
Code:
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
| library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
package pck is
type t is record f : std_logic_vector(7 downto 0);
end record;
function "-" (z : in t) return t;
end pck;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
package body pck is
function "-" (z : in t) return t is
variable tmp : t;
begin
tmp(f) := -z(f);
return tmp;
end "-";
end pck; |
A la compilation, Modelsim me dit :
** Error: */pck.vhd(23): (vcom-1136) Unknown identifier "f".
Quelqu'un voit le problème ?