Duke Scarring schrieb:
> Immerhin gibt der Synthesizer (xst) eine - wenn auch nicht direkt
> ziehlführende - Warnung aus.
Synplify (Lattice) sagt:
@W: CL159 :"...\stdlogicarith.vhd":8:8:8:12 | Input value is unused
|
Klar, denn value kann mit seinen 3 Bits niemals größer als 8
werden...
Und, falls einer fragt, das passiert auch hier, wenn man traditionsgemäß
einen std_logic_vector übergibt und die std_logic_unsigned.all hernimmt:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all; -- to avoid like the plague
use IEEE.std_logic_unsigned.all; -- to avoid like the plague
entity arith_test is
port(
value : in std_logic_vector(2 downto 0);
greater : out std_ulogic
);
end entity arith_test;
architecture rtl of arith_test is
begin
process(value)
begin
greater <= '0';
if value > 8 then
greater <= '1';
end if;
end process;
end architecture rtl;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all; -- to avoid like the plague
use IEEE.std_logic_unsigned.all; -- to avoid like the plague
entity arith_test_tb is
end entity arith_test_tb;
architecture testbench of arith_test_tb is
signal tb_value : std_logic_vector(2 downto 0);
signal tb_greater : std_ulogic;
begin
dut: entity work.arith_test
port map (
value => tb_value,
greater => tb_greater
);
process
begin
tb_value <= "000";
wait for 10 ns;
report "--------> new value: 0";
if tb_greater = '1' then
report "YES: it's greater then 8";
end if;
tb_value <= "110";
wait for 10 ns;
report "--------> new value: 6";
if tb_greater = '1' then
report "YES: it's greater then 8";
end if;
wait; -- forever
end process;
end architecture testbench;
|
Ja was passiert denn überhaupt, fragen jetzt die, die das nicht selber
simulieren können oder wollen?
Das hier (Aldec Active-HDL):
# EXECUTION:: NOTE : --------> new value: 0
# EXECUTION:: NOTE : YES: it's greater then 8
# EXECUTION:: NOTE : --------> new value: 6
# EXECUTION:: NOTE : YES: it's greater then 8
|