首页 > 解决方案 > 有线或未合成

问题描述

我希望有两个组合过程以有线或方式驱动一个信号。每个进程都可以将“Z”或“1”值驱动到信号,并且有一个全局下拉到“L”。

Vivado 2017.1 综合“优化”我的代码以将常量 0 驱动到输出端口。为什么会这样?我该如何解决这个问题?

代码:

library ieee;
use ieee.std_logic_1164.all;

entity test is
    port(
        input_0 : in    std_logic;
        input_1 : in    std_logic;
        output  : out   std_logic
    );
end entity test;

architecture rtl of test is
    signal s_output : std_logic;
begin
    output  <=  to_X01(to_bit(s_output));

    process(input_0)
    begin
        s_output    <=  'Z';

        if input_0='1' then
            s_output    <=  '1';
        end if;
    end process;

    process(input_1)
    begin
        s_output    <=  'Z';

        if input_1='1' then
            s_output    <=  '1';
        end if;
    end process;

    s_output    <=  'L';
end architecture rtl;

合成结果:

WARNING: [Synth 8-3917] design test has port output driven by constant 0

在此处输入图像描述

标签: vhdlsynthesisvivado

解决方案


推荐阅读