我正在尝试编写一个代码来检测 din 信号的上升沿,并在发生后将 doout 提高 5 个时钟周期。我在编译时不断收到不同的错误,但我不确定它们的含义。我认为我对 VHDL 中的一些概念缺乏基本的了解,但遗憾的是在网上查找并没有给我带来太大帮助。我仍然不知道该软件可以接受哪些操作。
在我的代码中,我目前在第一个进程中有一个上升沿检测器,它将 doout 提高到逻辑高电平。第二个进程检查 doout 是否为高电平,然后从 5 倒数到 0,如果为 0,则将 doout 设置为逻辑低电平。
这不会编译并返回以下错误:
错误 (10028):无法解析 raise_ext.vhd(31) 处网络“count[2]”的多个常量驱动程序
错误 (10029):rise_ext.vhd(17) 处的恒定驱动程序
错误 (10028):无法解析 raise_ext.vhd(31) 处网络“count[1]”的多个常量驱动程序
错误 (10028):无法解析 raise_ext.vhd(31) 处网络“count[0]”的多个常量驱动程序
错误 (10028):无法解析 raise_ext.vhd(31) 处网络“dout”的多个常量驱动程序
错误 (10029):rise_ext.vhd(19) 处的恒定驱动程序
错误(12153):无法详细说明顶级用户层次结构
错误:Quartus II 32 位分析和综合失败。 7 个错误,2 个警告
错误:峰值虚拟内存:326 MB
错误:处理结束:2014 年 1 月 11 日星期六 13:13:38
错误:已用时间:00:00:04
错误:总 CPU 时间(在所有处理器上):00:00:02
错误 (293001):Quartus II 完整编译失败。 9 个错误,2 个警告
entity rise_ext is
port ( clk: in bit ;
resetN: in bit ;
din: in bit ;
count: buffer integer range 0 to 6 ;
dout: buffer bit ) ;
end rise_ext ;
architecture arc_rise_ext of rise_ext is
signal s1 , s2 : bit ;
begin
process ( resetN, clk )
begin
if resetN = '0' then
dout <= '0' ;
count <= 5 ;
elsif clk'event and clk = '1' then
s1 <= din ;
s2 <= s1 ;
dout <= not s1 and s2 ;
end if ;
end process ;
process ( clk, dout )
begin
if clk'event and clk = '1' then
if dout = '1' then
if count > 0 then
count <= count - 1 ;
else
dout <= '0' ;
count <= 5 ;
end if;
end if ;
end if ;
end process ;
end arc_rise_ext ;
任何帮助将不胜感激!
我将所有数据类型更改为 std_logic 并完成了代码,但我仍然收到这些错误......
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity rise_ext is
port ( clk: in std_logic ;
resetN: in std_logic ;
din: in std_logic ;
count: buffer integer range 0 to 6 ;
dout: buffer std_logic ) ;
end rise_ext ;
architecture arc_rise_ext of rise_ext is
signal s1 , s2 : std_logic ;
begin
process ( resetN, clk )
begin
if resetN = '0' then
dout <= '0' ;
count <= 6 ;
elsif rising_edge(clk) then
s1 <= din ;
s2 <= s1 ;
dout <= not s1 and s2 ;
end if ;
end process ;
process ( clk )
begin
if rising_edge(clk) then
if dout = '1' then
count <= 5 ;
end if ;
end if ;
end process ;
process ( clk )
begin
if rising_edge(clk) then
if count = 0 then
count <= 6 ;
dout <= '0' ;
else
count <= count - 1 ;
end if ;
end if ;
end process ;
end arc_rise_ext ;