我有VHDL合成的这个问题 . 我在多篇文章中读到,如果我只使用一个“等待”/进程,那么“wait”语句是可综合的,这就是我所做的 . 所以我试着制作一个柜台,显示我在哪个楼层(我的项目包括逻辑设计中的电梯),它应该在订购的楼层打开门5秒钟 . 问题出在wait语句中 . 我不知道要替换它以使其在ISE中工作 .
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity counter is
port(clk1: in std_logic;
enable2:in std_logic;
input_mux: in std_logic;
dir: in std_logic;
reset,s_g,s_u: in std_logic;
q_open: out std_logic;
q: out std_logic_vector(3 downto 0));
end counter;
architecture c1 of counter is
signal flag: std_logic:='0';
component test
port(clock: in std_logic;
a: in std_logic_vector(3 downto 0);
notify: out std_logic);
end component;
begin
delay: test port map(clk1,"0101",flag);
process
variable temp:std_logic_vector(3 downto 0):="0000";
variable q_open_var:std_logic:='0';
begin
if (enable2='1') then
if (s_g='1' and s_u='1') then
if (RESET='1') then
temp:="0000";
elsif (CLK1'EVENT and CLK1='1') then
if (DIR='1') then
temp:=temp+1;
elsif(DIR='0') then
temp:=temp-1;
end if;
end if;
end if;
end if;
if (input_mux='1') then
q_open_var:='1';
q_open<=q_open_var;
wait until (flag'event and flag='1');
q_open_var:='0';
end if;
q<=temp;
q_open<=q_open_var;
wait on clk1, reset;
end process;
end c1;
1 回答
虽然支持此结构,但您已超出支持的限制 . 综合工具必须根据您编码的内容生成寄存器 . 寄存器确实有时钟和复位输入,但综合工具不知道单词
clk1
和reset
. 即你在写吗?该工具不知道复位是什么,也不知道时钟是什么 . 实际上,两个信号都被认为是时钟触发器 .
但是你的设计更有问题,因为你在异步复位和时钟触发之前有if语句 . 虽然支持时钟门控,但您可能并不打算这样做 .
然后在你的声明中有一个/秒/时钟触发器:
wait until (flag'event and flag='1');
. 我不知道你在那里做什么,但你怎么能想象这是在硬件中实现的?您应该坚持标准/建议编码风格以实现可预测的行为 . 即
(我遗漏了
q_open
部分,因为目前还不清楚你想要什么 . 为此做一个单独的过程,因为它不依赖于reset
)附:我最喜欢_2584886的五行;)请在下次使用适当的缩进 . 并使用'elsif'而不是'else if' .