VHDL-Synthese - FF / Latch-Konstantenwert
Ich versuche, ein vhdl-Modul zu synthetisieren, das ich geschrieben habe.
Der Code ist unten:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
use IEEE.NUMERIC_STD.ALL;
entity ClockCounter is
port(
clk : in std_logic;
input : in std_logic;
enable : in std_logic;
output : out std_logic := '0';
bitReady : out std_logic := '0';
countError : out std_logic := '0'
);
end ClockCounter;
architecture Behavioral of ClockCounter is
signal totalBitWidth : integer := 4;
signal majorityValue : integer := 3;
begin
totalBitWidth <= 4;
majorityValue <= 3;
-- Process for recognizing a single input value from a clock cycle
-- wide input signal
majority_proc: process(clk, input, enable)
variable clkCount : integer := 0;
variable Sum : integer := 0;
begin
if rising_edge(clk) And enable = '1' then
-- Reset bitReady after one clock cycle
bitReady <= '0';
-- Check the input value and add it to the Sum variable
if input = '1' then
Sum := Sum + 1;
else
Sum := Sum + 0;
end if;
-- Increment the clock counter variable
clkCount := clkCount + 1;
-- Check if the clock count has reached the specified number of cycles
if clkCount >= totalBitWidth then
-- Determine if the Sum variable has met the threshold for
-- value of 1, set the output accordingly
if Sum >= majorityValue then
output <= '1';
else
output <= '0';
end if;
-- This checks if the value for all clock cycles was the same and
-- sets an error flag if not
if Sum = totalBitWidth Or Sum = 0 then
countError <= '0';
else
countError <= '1';
end if;
-- Reset the clock counter and sum value
clkCount := 0;
Sum := 0;
-- Set the bit counter high to alert other midules that a new bit
-- has been received
bitReady <= '1';
end if;
elsif enable = '0' then
clkCount := 0;
Sum := 0;
end if;
end process;
end Behavioral;
Das Problem, das ich bekomme, ist das folgende, wenn ich versuche zu synthetisieren:
WARNUNG: Xst: 1293 - FF / Latch hat im Block einen konstanten Wert von 0. Dieses FF / Latch wird während des Optimierungsprozesses gekürzt. WARNUNG: Xst: 1896 - Aufgrund eines anderen FF / Latch-Abgleichs hat FF / Latch im Block einen konstanten Wert von 0. Dieses FF / Latch wird während des Optimierungsprozesses gekürzt. WARNUNG: Xst: 1896 - Aufgrund eines anderen FF / Latch-Abgleichs hat FF / Latch im Block einen konstanten Wert von 0. Dieses FF / Latch wird während des Optimierungsprozesses gekürzt.
Das Trimmen geht bis zum Ende.
Was ich nicht verstehe, ist, dass die Variable clkCount eine Ganzzahl ist, die höchstens um 6 erhöht und dann auf 0 zurückgesetzt wird.
Kann ich diese Warnungen ignorieren?
Dieses Modul gehört zu einem größeren System, an dem ich gerade arbeite, und wenn ich das größere System zusammenstelle, bekomme ich eine Menge davon
1-Bit-Latch für Signal gefunden
Ich versuche also, so viele Warnungen wie möglich in Modulen der unteren Ebene zu beseitigen, bevor ich das Modul der oberen Ebene repariere.
Jede Hilfe wäre toll. Vielen Dank
PS - Ich verwende das Xilinx spartan 6 sp605 Evaluation Kit Board und den Project Navigator.