Estoy escribiendo un paquete para agregar funciones y tipos de soporte para crear un filtro FIR. En la función mult
, estoy tratando de multiplicar dos tipos firmados, que deberían ser compatibles en la biblioteca IEEE.numeric_std
. El error que estoy recibiendo (usando el IDE de Libero) es:
0 definitions of operator "*" match here
Aquí está el código:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.numeric_std.all;
package fir_pkg is
constant taps : integer := 8;
constant bit_width : integer := 8;
type fract is array(bit_width-1 downto 0) of std_logic;
type fract2 is array((2*bit_width)-1 downto 0) of std_logic;
type fract_sequence is array(taps-1 downto 0) of fract;
type fract2_sequence is array(taps-1 downto 0) of fract2;
function mult(a,b: fract_sequence) return fract2_sequence;
end package fir_pkg;
package body fir_pkg is
function mult(a,b: fract_sequence) return fract2_sequence is
variable a_s, b_s:signed(bit_width-1 downto 0);
variable seq: fract2_sequence;
begin
for i in a'range loop
a_s := signed(a(i));
b_s := signed(b(i));
seq(i) := a_s * b_s;
end loop;
return seq;
end mult;
end fir_pkg;