реклама на сайте
подробности

 
 
> Нажатие кнопки, Обработка события нажатия кнопки с помощью FPGA
aBoomest
сообщение Apr 7 2015, 07:37
Сообщение #1


Частый гость
**

Группа: Участник
Сообщений: 167
Регистрация: 24-12-08
Из: Россия
Пользователь №: 42 714



Добрый день. Прошу прощения за длинный пост. С ПЛИС работаю не впервые, однако возникла проблема. (причем совершенно неожиданно)
Не могу скомпилировать проект. В проект добавил только одну кнопку.
Написал тестовую программу. Та же ерунда. Итак:
В тестовой программе по нажатию кнопки делаю вкл/выкл светодиод.
ФАЙЛЫ:
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;
VHD
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;

Проект не компилируется. Не проходит процесс 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;

Что делаю не так? Описание ucf для таких сигналов должно быть иное? Или еще какие глупости делаю?


--------------------
C уважением!
Go to the top of the page
 
+Quote Post

Сообщений в этой теме
- aBoomest   Нажатие кнопки   Apr 7 2015, 07:37
- - Maverick   Цитата(aBoomest @ Apr 7 2015, 10:37) Добр...   Apr 7 2015, 07:43
- - Dmitriyspb   Цитата(aBoomest @ Apr 7 2015, 10:37) Добр...   Apr 7 2015, 07:57
|- - Dmitriyspb   Цитата(Dmitriyspb @ Apr 7 2015, 10:57) Пр...   Apr 7 2015, 09:35
- - aBoomest   Спасибо всем за ответы. Да, синхронный процесс лу...   Apr 7 2015, 09:48
|- - Maverick   Цитата(aBoomest @ Apr 7 2015, 12:48) А ес...   Apr 8 2015, 17:43
- - XVR   Давайте посмотрим на ваш процесс - КодprcBlnkLed2...   Apr 7 2015, 11:02
- - aBoomest   Цитата(XVR @ Apr 7 2015, 14:02) стоящая п...   Apr 8 2015, 10:51
|- - Dmitriyspb   Цитата(aBoomest @ Apr 8 2015, 13:51) Эх, ...   Apr 8 2015, 13:06
- - serjj   Цитатапро то к синтезу каких схем приводят те или ...   Apr 8 2015, 13:52
- - Golikov A.   ЦитатаДалее - строка Led2 := not(Led2);, стоящая п...   Apr 8 2015, 18:21
|- - XVR   Цитата(Golikov A. @ Apr 8 2015, 21:21) по...   Apr 9 2015, 11:29
|- - Dondob   Есть другое предложение - ловить фронт, отсчитыват...   Apr 22 2015, 20:24
|- - gridinp   Цитата(Dondob @ Apr 22 2015, 23:24) Есть ...   Apr 23 2015, 09:35
- - BSACPLD   Добавлю свои пять копеек как давить дребезг. Хоть ...   Apr 8 2015, 19:41
- - Golikov A.   Понятно. Просто сбило вывод что нужен клок, которы...   Apr 9 2015, 16:03


Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 21st July 2025 - 16:45
Рейтинг@Mail.ru


Страница сгенерированна за 0.01373 секунд с 7
ELECTRONIX ©2004-2016