F
fl
Guest
Hi,
I want to program a CRC project originating from a past discussion:
function crc_shift
-- Mike Treseler
-- parallel data version
(constant X_load : in unsigned;
constant D_vec : in unsigned ;
constant Poly : in unsigned := x"3223") --Poly_16_12_5)
return unsigned is
variable X_out : unsigned(X_load'range);
begin
X_out := X_load;
for I in D_vec'range loop -- call serial version for each bit
X_out := crc_shift(X_out, D_vec(I), Poly);
end loop;
return X_out;
end function crc_shift;
end package body crc_package;
library IEEE;
use IEEE.std_logic_1164.all;
use WORK.crc_package.all;
entity tb is
end tb;
architecture structural of bit8_adder is
signal internal_carry : std_logic;
signal sum1: std_logic_vector(15 downto 0);
begin
sum1 <= crc_shift(x"3322", x"1111", x"3223");
end;
The code has an error when compiling:
** Error: C:\Users\Jeff\crc_ccitt.vhd(100): No feasible entries for subprogram "crc_shift".
I am new to VHDL, especially to function. Could you help me on what is wrong
with my code? Thanks.
I want to program a CRC project originating from a past discussion:
function crc_shift
-- Mike Treseler
-- parallel data version
(constant X_load : in unsigned;
constant D_vec : in unsigned ;
constant Poly : in unsigned := x"3223") --Poly_16_12_5)
return unsigned is
variable X_out : unsigned(X_load'range);
begin
X_out := X_load;
for I in D_vec'range loop -- call serial version for each bit
X_out := crc_shift(X_out, D_vec(I), Poly);
end loop;
return X_out;
end function crc_shift;
end package body crc_package;
library IEEE;
use IEEE.std_logic_1164.all;
use WORK.crc_package.all;
entity tb is
end tb;
architecture structural of bit8_adder is
signal internal_carry : std_logic;
signal sum1: std_logic_vector(15 downto 0);
begin
sum1 <= crc_shift(x"3322", x"1111", x"3223");
end;
The code has an error when compiling:
** Error: C:\Users\Jeff\crc_ccitt.vhd(100): No feasible entries for subprogram "crc_shift".
I am new to VHDL, especially to function. Could you help me on what is wrong
with my code? Thanks.