我正在尝试编写一个代码,该代码将检测 din 信号的上升沿,并在此之后提高 5 个时钟周期的 dout。我在编译时不断收到不同的错误,我不确定它们的含义。我认为我对 VHDL 中的某些概念缺乏基本的了解,但遗憾的是在网上查找并没有对我有太大帮助。我仍然不知道软件可以接受哪些操作。
在我的代码中,我目前在第一个过程中有一个上升沿检测器,它将 dout 提升到逻辑高电平。第二个过程检查dout 是否为高,同时从5 倒数到0,在0 时将dout 设置为逻辑低。
这不会编译并返回以下错误:
错误 (10028):无法在rise_ext.vhd(31) 处解析网络“count[2]”的多个常量驱动程序
错误 (10029):rise_ext.vhd(17) 中的常量驱动程序
错误 (10028):无法在rise_ext.vhd(31) 解析网络“count[1]”的多个常量驱动程序
错误 (10028):无法在rise_ext.vhd(31) 处解析网络“count[0]”的多个常量驱动程序
错误 (10028):无法在rise_ext.vhd(31) 处解析网络“dout”的多个常量驱动程序
错误 (10029):rise_ext.vhd(19) 处的常量驱动程序
错误 (12153):无法详细说明顶级用户层次结构
错误:Quartus II 32-bit Analysis & Synthesis 不成功。 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 ;
最佳答案
你有 dout
和 count
在两个进程中分配。两者都不是已解析的信号。
来自 IEEE 标准 1076-1993:
12.6.1 驱动程序
Every signal assignment statement in a process statement defines a set of drivers for certain scalar signals. There is a single driver for a given scalar signal S in a process statement, provided that there is at least one signal assignment statement in that process statement and that the longest static prefix of the target signal of that signal assignment statement denotes S or denotes a composite signal of which S is a subelement. Each such signal assignment statement is said to be associated with that driver. Execution of a signal assignment statement affects only the associated driver(s).
这实质上意味着您正在复制两个
count
和 dout
.有很多方法可以对
dout
的行为进行建模和 count
你渴望。根据开始和结束事件在两个流程中 fork 它们的操作不是其中之一。这将需要三个进程,一个用于制造事件,一个用于破坏事件,一个用于时钟存储。您可能需要单独的事件来操作 count
.
关于vhdl - 错误 (10028) : Can't resolve multiple constant drivers for net. .. VHDL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21061596/