„Dead Code“ in Xilinx
Frage
Ich habe einige VHDL-Code ich für eine Klasse ich schreibe. Allerdings erkennt das Synthesewerkzeug cell3, cell2 und Zelle 1 als „tot“ Code und es wird nicht synthetisieren.
Ich habe wirklich keine Ahnung, was los ist 3,2,1 zu verursachen Zelle in der Synthese entfernt werden; Ich habe überprüft es einige 5+ mal und bat verschiedene Leute, und ich kann nicht finden, das „Warum“.
Nicht nach einer Lösung suchen, nur einen Zeiger auf, warum.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity multiply is
Port ( a : in STD_LOGIC_VECTOR (3 downto 0);
b : in STD_LOGIC;
clk : in STD_LOGIC;
rst : in STD_LOGIC;
p : out STD_LOGIC);
end multiply;
architecture Behavioral of multiply is
component cell_a port(
s: in std_logic;
c: in std_logic;
a: in std_logic;
b: in std_logic;
clk: in std_logic;
c_out: out std_logic;
s_out: out std_logic);
end component;
signal c_s_0: std_logic; --loopback wire for cell 0 from carry to sum
signal c_s_1: std_logic;
signal c_s_2: std_logic;
signal c_s_3: std_logic;
signal xfer1_0: std_logic; --wire between 1 and 0
signal xfer2_1: std_logic; --" 2 and 1
signal xfer3_2: std_logic; --" 3 and 2
begin
cell3: cell_a port map(
clk => clk,
s => c_s_3 , c => '0', a => a(3), b => b,
c_out => c_s_3, s_out => xfer3_2
);
cell2: cell_a port map(
clk => clk,
s => c_s_2 , c => xfer3_2, a => a(2), b => b,
c_out => c_s_2, s_out => xfer2_1
);
cell1: cell_a port map(
clk => clk,
s => c_s_1, c => xfer2_1, a => a(1), b => b,
c_out => c_s_1, s_out => xfer1_0
);
cell0: cell_a port map(
clk => clk,
s => c_s_0 , c => xfer1_0, a => a(0), b => b,
c_out => c_s_0, s_out => p
);
process(clk)
begin
if(clk'event and clk = '1') then
if(rst = '1') then
--reset logic here. Magic happens and the circuit goes to all 0
end if;
end if;
end process;
end Behavioral;
Lösung
Alles, was ich ohne zu sehen, den Rest des Codes vorschlagen kann, ist, dass Ihr ‚c‘ eingegeben cell_a nicht verwendet wird, die die Ausgänge alle von cell3 verursacht / 01.02 nicht benutzt werden (also toter Code, da es nicht produziert beobachtbare Ergebnisse).
ZELLE0 instanziiert weil Multiplikator 'p' Ausgang beobachtbar ist.
Andere Tipps
Es könnte, dass cell1-3 sein werden immer durch die Synthese optimiert heraus, da der Ausgang dieses Blocks „p“ ist nur 1 Bit.
Sie müssen nicht vollständig die Logik alle bewerten, um zu bestimmen, ob dieses Bit eine 0 oder eine 1 sein sollte.