VHDL コードについて質問があります。コードは、地雷を検出できるはずのロボット用です。このコードは、この特定の地雷探知機のコードです。teller_sensor プロセスが機能しません。FPGAチップでプログラムされるため、クロックは1つしか持てません。しかし、プロセスを機能させるために何をすべきかわかりません。皆さんが喜んで私を助けてくれることを願っています:)
ロベルト
コードは次のとおりです。
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
use IEEE.numeric_std.all;
library ieee; use ieee.numeric_std.all;
entity metaal_detector is
port (clk : in std_logic;
sensor : in std_logic;
reset : in std_logic;
metaal : out std_logic
);
end entity metaal_detector;
architecture behavioural of metaal_detector is
signal count, count_sensor, stand, clock1, sensor1, stand1 : unsigned (10 downto 0);
signal reset_teller, resets, metaals: std_logic;
begin
teller_clk: process (clk)
begin
if rising_edge(clk) then
if ((reset ='1') or (resets = '1')) then
count <= (others => '0');
else
count <= count + 1;
end if;
end if;
end process;
teller_sensor: process (sensor)
begin
if rising_edge(clk) then
if ((reset ='1') or (resets = '1')) then
count_sensor <= (others => '0');
else
if (sensor'event and sensor='1') then
count_sensor <= count_sensor + 1;
end if;
end if;
end if;
end process;
process(clk)
begin
if (unsigned(clock1) = 71) then
stand <= clock1;
reset_teller <= '1';
else
reset_teller <= '0';
stand <= stand;
end if;
end process;
process(clk)
begin
if (unsigned(stand1) < 70) then
metaals <= '1';
else
metaals <= '0';
end if;
end process;
clock1 <= count;
sensor1 <= count_sensor;
stand1 <= stand;
resets <= reset_teller;
metaal <= metaals;
end architecture behavioural;