I have been stuck with this problem for a while. I would be really grateful if someone is able help. Have gone through most of the code repeatedly without any solution. There are sets of codes in use; this bcd counter is used further in the rest of my project. I have added the necessary codes below:
BCD counter for 1 digit:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL;
USE WORK.mypackage_p.ALL;
ENTITY bcd_e IS
PORT(
res_i, clk_i, enable_i, counter_res_i : IN STD_LOGIC;
bcd_o : OUT STD_LOGIC_VECTOR(bcd_width_c-1 DOWNTO 0);
carry_o : OUT STD_LOGIC
);
END bcd_e;
ARCHITECTURE bcd_a OF bcd_e IS
SIGNAL count_s : INTEGER RANGE bcd_cnt_c DOWNTO 0;
BEGIN
PROCESS(res_i, clk_i)
BEGIN
IF (res_i = '1') THEN
count_s <= 0;
ELSIF (clk_i = '1' AND clk_i'EVENT) THEN
IF (enable_i = '1') THEN
IF(count_s >= bcd_cnt_c) THEN
count_s <= 0;
ELSE
count_s <= count_s + 1;
END IF;
END IF;
IF (counter_res_i = '1') THEN
count_s <= 0;
END IF;
END IF;
END PROCESS;
bcd_o <= STD_LOGIC_VECTOR(to_unsigned(count_s, bcd_width_c));
carry_o <= '1' WHEN (count_s = bcd_cnt_c) ELSE '0';
END bcd_a;
8 digit BCD using the above bcd counter to create 8 digits
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL;
USE WORK.mypackage_p.ALL;
ENTITY bcd_8counter_e IS
PORT(
res_i, clk_i, enable_i, counter_res_i : IN STD_LOGIC;
bcd_array_o : OUT bcd_array_t
);
END bcd_8counter_e;
ARCHITECTURE bcd_8counter_a OF bcd_8counter_e IS
COMPONENT bcd
PORT(
res_i, clk_i, enable_i, counter_res_i : IN STD_LOGIC;
bcd_o : OUT STD_LOGIC_VECTOR(bcd_width_c-1 DOWNTO 0);
carry_o : OUT STD_LOGIC
);
END COMPONENT;
SIGNAL bcd_array_s : bcd_array_t;
SIGNAL enable_s : STD_LOGIC_VECTOR(no_of_digits_c-1 DOWNTO 0);
SIGNAL carry_s : STD_LOGIC_VECTOR(no_of_digits_c-1 DOWNTO 0);
FOR ALL : bcd USE ENTITY WORK.bcd_e (bcd_a);
BEGIN
carry_s(0) <= enable_i;
gen_carry : FOR i IN 1 TO (no_of_digits_c-1) GENERATE
carry_s(i) <= carry_s((i-1)) AND enable_s((i-1));
END GENERATE gen_carry;
gen_bcd : FOR i IN 0 TO (no_of_digits_c-1) GENERATE
digitx : bcd PORT MAP(res_i, clk_i, carry_s(i), counter_res_i, bcd_array_s(i), enable_s(i));
END GENERATE gen_bcd;
bcd_array_o <= bcd_array_s
END bcd_8counter_a;
My package file for the constants:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL;
PACKAGE mypackage_p IS
CONSTANT freq_20k_c : INTEGER := 2500;
CONSTANT bcd_cnt_c : INTEGER := 9;
CONSTANT bcd_width_c : INTEGER := 4;
CONSTANT no_of_digits_c : INTEGER := 8;
TYPE bcd_array_t IS ARRAY(7 DOWNTO 0) OF STD_LOGIC_VECTOR(3 DOWNTO 0);
END PACKAGE;
I keep getting the following warning:
Warning: /home/stud/mr-131416/Desktop/VHDL_Project_Latest/src/bcd_counter8_a.vhd(15): (vcom-1263) Configuration specification "all : bcd" applies to no component instantiation statements.
The code does not pass test/simulation of a test-bench because of this warning. Help would be really appreciated.