Не могу скомпилировать проект. В проект добавил только одну кнопку.
Написал тестовую программу. Та же ерунда. Итак:
В тестовой программе по нажатию кнопки делаю вкл/выкл светодиод.
ФАЙЛЫ:
UCF
Код
Net "Clock" Loc = "C9" | IOStandard = LVCMOS33;
Net "Led_2" Loc = "F8" | IOStandard = LVTTL | Slew = Slow | Drive = 8;
Net "Btn_Down" Loc = "K17" | IOStandard = LVTTL | PullDown;
VHDNet "Led_2" Loc = "F8" | IOStandard = LVTTL | Slew = Slow | Drive = 8;
Net "Btn_Down" Loc = "K17" | IOStandard = LVTTL | PullDown;
CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity MainBlinkingLed is
port (Clock: in std_logic;
Btn_Down: in std_logic;
Led_2: out std_logic);
end MainBlinkingLed;
architecture Behavioral of MainBlinkingLed is
shared variable Led2: bit := '0';
begin
prcBlnkLed2: process(Clock)
begin
if (Btn_Down = '1') then
Led2 := not(Led2);
end if;
end process prcBlnkLed2;
Led_2 <= '1' when Led2 = '0' else '0';
end Behavioral;
use IEEE.STD_LOGIC_1164.ALL;
entity MainBlinkingLed is
port (Clock: in std_logic;
Btn_Down: in std_logic;
Led_2: out std_logic);
end MainBlinkingLed;
architecture Behavioral of MainBlinkingLed is
shared variable Led2: bit := '0';
begin
prcBlnkLed2: process(Clock)
begin
if (Btn_Down = '1') then
Led2 := not(Led2);
end if;
end process prcBlnkLed2;
Led_2 <= '1' when Led2 = '0' else '0';
end Behavioral;
Проект не компилируется. Не проходит процесс Place&Route Пишет, что вывод Clock "не нагружен" и ещё вот это:
ERROR:Place:1018 - A clock IOB / clock component pair have been found that are not placed at an optimal clock IOB /
clock site pair. The clock component <Btn_Down_BUFGP/BUFG> is placed at site <BUFGMUX_X2Y1>. The IO component
<Btn_Down> is placed at site <IPAD93>. This will not allow the use of the fast path between the IO and the Clock
buffer. If this sub optimal condition is acceptable for this design, you may use the CLOCK_DEDICATED_ROUTE constraint
in the .ucf file to demote this message to a WARNING and allow your design to continue. However, the use of this
override is highly discouraged as it may lead to very poor timing results. It is recommended that this error
condition be corrected in the design. A list of all the COMP.PINs used in this clock placement rule is listed below.
These examples can be used directly in the .ucf file to override this clock rule.
< NET "Btn_Down" CLOCK_DEDICATED_ROUTE = FALSE; >
Схема подключения кнопки: подтянута к земле. При нажатии на на вход ПЛИС подается 3.3В (лог '1').
Если в код добавить функцию rising_edge(Clock) перед if-ом, то все компилируется и работает. Но хотелось изначально асинхронный процесс иметь, а тут получается синхронный. На просторах сети таких примеров с асинхронными схемами море: вот например асинхронный сброс триггера.
Ссылка
CODE
library IEEE;
use IEEE.std_logic_1164.all;
entity dff_async_rst is
port (data, clk, reset : in std_logic;
q :out std_logic);
end dff_async_rst;
architecture behav of dff_async_rst is
begin
process (clk, reset) begin
if (reset = '0') then
q <= '0';
elsif (clk'event and clk = '1') then
q <= data;
end if;
end process;
end behav;
use IEEE.std_logic_1164.all;
entity dff_async_rst is
port (data, clk, reset : in std_logic;
q :out std_logic);
end dff_async_rst;
architecture behav of dff_async_rst is
begin
process (clk, reset) begin
if (reset = '0') then
q <= '0';
elsif (clk'event and clk = '1') then
q <= data;
end if;
end process;
end behav;
Что делаю не так? Описание ucf для таких сигналов должно быть иное? Или еще какие глупости делаю?