【发布时间】:2021-05-26 03:35:58
【问题描述】:
我正在创建一个 Alu,这是我的代码。
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity alu is port (
entrada: in std_logic_vector(11 downto 0);
S: in std_logic_vector(3 downto 0);
load : in std_logic;
O: out std_logic_vector(12 downto 0)
);
end alu;
architecture arc_alu12 of alu is
component sumador12bits
port (a, b: in std_logic_vector(11 downto 0); c: out std_logic_vector(12 downto 0));
end component;
signal sa, sb, A, aux: std_logic_vector(11 downto 0):="000000000000";
signal sr: std_logic_vector(12 downto 0);
begin
guarda_registro: process (load) begin
if load = '1' then
A <= entrada;
end if;
end process;
sss: sumador12bits port map(sa, sb, sr);
selector: process(S) begin
case S is
when "0000" =>
sa <= "0000"&A(7 downto 0);
sb <= "0000"&entrada(7 downto 0);
when "0001" =>
sa <= "0000"&A(7 downto 0);
aux <= "0000"&entrada(7 downto 0);
sb<= (not aux)+1;
when "0010" =>
sa <= A;
sb <= "000000000001";
when "0011" =>
sa <= A;
sb <= "111111111111";
when "0100" =>
sa <= entrada;
sb <= "000000000001";
when "0101" =>
sa <= entrada;
sb <= "111111111111";
when "0110" =>
sa <= A;
sb <= entrada;
when "0111" =>
sa<=A;
sb<= (not entrada)+1;
when "1000" =>
sr <= '0'&(A and entrada);
when "1001" =>
sr <= '0'&(A or entrada);
when "1010" =>
sr <= '0'&(A xor entrada);
when "1011" =>
sr <= '1'¬ A;
when "1100" =>
sa <= not A;
sb <= "000000000001";
when others => sr<= "0000000000000";
end case;
end process;
O <= sr;
end arc_alu12;
但我收到此消息错误:
@A: BN321 |在网络 O[0] 上找到多个驱动程序(在视图中: 工作.alu(arc_alu12));如果一个驱动程序是一个常数(真或假),使用 解决混合驱动器选项以将网络连接到 VCC 或 GND。
连接1:方向是(输出)pin:s inst:sss.FA1.ss1 of work.semisumador(syn_black_box)
连接2:方向为(输出)pin:Q[0] inst:selector.sr[0] of PrimLib.latr(prim)
错误 - BN314 :"e:\lscc\diamond\3.12\bin\nt64\alucode.vhd":6:7:6:9|Net O[0] (in view: work.alu(arc_alu12)) 有多个驱动
【问题讨论】:
-
Stackoverflow 上的搜索词将是 [vhdl] 多个驱动程序。你会惊讶于你会发现什么。此处提供minimal reproducible example 以显示所有驱动程序。在进程选择器中有 sr 的驱动程序,并且实例化的 sumador12 位标记为 sss 您未提供的源。在 VHDL 中,为已解析类型(std_logic、std_logic_vector)提供多个驱动程序是完全合法的。这在 FPGA 综合中通常是不合法的(可能有一些规则可以推断出你不知道的多路复用器)。
-
在进程中发生的每个信号分配都会创建一个驱动程序。分配信号的并发语句精心处理。解析类型的网络的值由解析决定。对于 FPGA 综合,仅允许特定设备的引脚和工具从内部网络推断多路复用器,这些内部网络只有一个驱动器提供逻辑值,而任何其他驱动器驱动“Z”(高阻抗)。其他所有用途都应该看到来自单个进程的信号、综合要求,而不是 VHDL 语言本身的一部分。
标签: signals vhdl lattice-diamond synplify