I wrote code, but ModelSim said :
"unsigned2hexstring" is not an operator symbol.
What should I change and how use mine package like library? Is it will like : library ieee; use ieee.std_logic_1164.all; use work.prosoft_std.all ???
library ieee;
use ieee.std_logic_1164.all;
package prosoft_std is
constant CopyRigthNotice : string := "Copyright 2016 Prosoft. All rights reserved.";
type UNSIGNED is array (NATURAL range <>) of STD_LOGIC;
type SIGNED is array (NATURAL range <>) of STD_LOGIC;
function "unsigned2hexString" (ARG: UNSIGNED) return SIGNED;
end prosoft_std;
package body prosoft_std is
function "unsigned2hexString" (ARG : UNSIGNED) return UNSIGNED is
variable lengthVect : integer;
variable useThatVect : UNSIGNED:= ARG;
begin
lengthVect := ARG'length rem 4;
if (lengthVect != 0) then
for i in 0 to lengthVect loop
useThatVect := '0' & useThatVect;
end loop;
end if;
return useThatVect;
end "unsigned2hexString";
end prosoft_std;