从INOUT生成OUT

时间:2012-06-25 13:10:00

标签: vhdl xilinx

我想用chipcope探测一个三态信号。

根据this answer record,它无法完成,所以这就是我的开始(仅包含相关代码):

-- Tristate signals
FPGA_SMB0_SDA <= sysmon_iic_data;
FPGA_SMB0_SCL <= sysmon_iic_clk;

-- Output signals
DEBUG_LED0 <= '0';  
DEBUG_LED1 <= '0';   

哪个构建正常,没有错误。

尝试1:

这是我第一次尝试生成调试信号,用于探测只是一个输出:

-- Tristate signals
FPGA_SMB0_SDA <= sysmon_iic_data;
FPGA_SMB0_SCL <= sysmon_iic_clk;

-- Generating new output signals using tristate (tristate signals are either '0' or 'X' for IIC)
sysmon_iic_data_debug <= '0' when (sysmon_iic_data  = '0') else '1'; 
sysmon_iic_clk_debug <= '0' when (sysmon_iic_clk  = '0') else '1';   

-- connecting debug outs to debug leds (so that the debug signals aren't optimized out)
DEBUG_LED0 <= sysmon_iic_data_debug;  
DEBUG_LED1 <= sysmon_iic_clk_debug;   

上面的代码通过了综合,但NGDbuild给出了以下错误:

ERROR:ConstraintSystem:59 - Constraint <IOSTANDARD = LVCMOS25 ;>
   [frm121401u1r1.ucf(333)]: NET "FPGA_SMB0_SDA"
   not found.  Please verify that:
   1. The specified design element actually exists in the original design.
   2. The specified object is spelled correctly in the constraint source file.

以上重复8次,每次净重两次。

尝试2:

我尝试的第二件事是使用一个过程:

FPGA_SMB0_SDA <= sysmon_iic_data;
FPGA_SMB0_SCL <= sysmon_iic_clk;

gen_sysmon_debug : process(refclk_10m,refclk_10m_rst)
begin
    if (refclk_10m_rst = '1') then
        sysmon_iic_data_debug <= '0';
        sysmon_iic_clk_debug <= '0';
    elsif (rising_edge(refclk_10m)) then
        if (sysmon_iic_clk = '0') then
            sysmon_iic_clk_debug <= '0';
        else
            sysmon_iic_clk_debug <= '1';            
        end if;
        if (sysmon_iic_data = '0') then
            sysmon_iic_data_debug <= '0';
        else
            sysmon_iic_data_debug <= '1';       
        end if;

    end if;
end process;

DEBUG_LED0 <= sysmon_iic_data_debug;  
DEBUG_LED1 <= sysmon_iic_clk_debug;   

这给了我这个NGDbuild错误:

ERROR:NgdBuild:924 - bidirect pad net 'FPGA_SMB0_SDA' is driving non-buffer primitives:
     pin D on block sysmon_iic_data with type FDC,

其中两个,一个用于SDA,一个用于SCL

更多信息:

这就是我的UCF:

NET "DEBUG_LED0" LOC = "AK33" | IOSTANDARD = LVCMOS25 ;
NET "DEBUG_LED1" LOC = "AK34" | IOSTANDARD = LVCMOS25 ;
...
NET "FPGA_SMB0_SCL" LOC = "G13" | IOSTANDARD = LVCMOS25 ;
NET "FPGA_SMB0_SDA" LOC = "H13" | IOSTANDARD = LVCMOS25 ;

顶级vhdl网络定义:

DEBUG_LED0 : out std_logic;
DEBUG_LED1 : out std_logic;

FPGA_SMB0_SCL : inout std_logic;
FPGA_SMB0_SDA : inout std_logic;

和uBlaze .mhs:

PORT xps_iic_1_Sda_pin = xps_iic_1_Sda, DIR = IO, BUFFER_TYPE = NONE
PORT xps_iic_1_Scl_pin = xps_iic_1_Scl, DIR = IO, BUFFER_TYPE = NONE

我完全不知道为什么我会收到这些NGDbuild错误,有人有任何想法吗?

1 个答案:

答案 0 :(得分:0)

您的网络可能已经重命名,现在您已将其他信号连接到它:(

取出约束,让它构建。

将NCD文件加载到FPGA编辑器中,看看网络最终被调用了什么,并在你的UCF中使用它。

或者在顶级VHDL文件中自己实例化所有IOB,然后你知道IOB&#34; pin&#34;之间的网络的nae。并且真正的引脚不会改变,你可以约束那个网。