【问题标题】:VHDL 10 bit Shift RegisterVHDL 10 位移位寄存器
【发布时间】:2017-03-23 04:20:56
【问题描述】:

我正在尝试创建一个 10 位移位寄存器。但是我不断收到错误

[DRC 23-20] 违反规则 (NSTD-1) 未指定 I/O 标准 - 15 个逻辑端口中有 2 个使用 I/O 标准 (IOSTANDARD) 值“DEFAULT”,而不是用户分配的特定值。这可能会导致 I/O 争用或与电路板电源或连接不兼容,从而影响性能、信号完整性,或者在极端情况下会损坏设备或其连接的组件。要更正此违规,请指定所有 I/O 标准。除非所有逻辑端口都定义了用户指定的 I/O 标准值,否则此设计将无法生成比特流。要允许使用未指定的 I/O 标准值(不推荐)创建比特流,请使用以下命令:set_property SEVERITY {Warning} [get_drc_checks NSTD-1]。注意:使用 Vivado Runs 基础架构(例如,launch_runs Tcl 命令)时,将此命令添加到 .tcl 文件中,并将该文件添加为实现运行的 write_bitstream 步骤的预挂钩。问题端口:Clk、btnu。

每次我要写比特流。有人可以帮我指出正确的方向,并指出我所犯的任何其他错误,这些错误将导致我的移位寄存器无法正常工作。

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;

entity question2 is
Port (
  led: out std_logic_vector (9 downto 0);
  Clk: in std_logic;
  btnu: in std_logic;
  btnL: in std_logic;
  btnR: in std_logic ; 
  btnD: in std_logic;
  btnC: in std_logic 
 );

end question2;

architecture Behavioral of question2 is

  constant active: std_logic :='1';
  constant inactive: std_logic :='0';

  constant step_zero: std_logic_vector(9 downto 0)      :="0000000000";  
  constant step_one: std_logic_vector(9 downto 0)      :="0000000001";
  constant step_two: std_logic_vector(9 downto 0)      :="0000000010"; 
  constant step_three: std_logic_vector(9 downto 0)    :="0000000100";
  constant step_four: std_logic_vector(9 downto 0)     :="0000001000";
  constant step_five: std_logic_vector(9 downto 0)     :="0000010000";
  constant step_six: std_logic_vector(9 downto 0)      :="0000100000";    
  constant step_seven: std_logic_vector(9 downto 0)    :="0001000000";
  constant step_eight: std_logic_vector(9 downto 0)    :="0010000000";
  constant step_nine: std_logic_vector(9 downto 0)     :="0100000000";
  constant step_ten: std_logic_vector(9 downto 0)     :="0100000000";

  signal DataIn:  std_logic_vector (9 downto 0):= "0000000001";  
  signal Load:    std_logic := btnD;
  signal Reset:   std_logic; 
  signal Left:    std_logic:= btnL;
  signal Right:   std_logic:= btnR;
  signal DataOut: std_logic_vector (9 downto 0);
  signal Clear: std_logic:= btnU;
  signal speed_enable: std_logic; 

begin

SpeedControl: process (clk)
                variable counter: integer range 0 to 10000000;
           begin
                speed_enable<=not active;  
                if Reset = Active then
                    counter:= 0; 
                elsif (rising_edge (clk)) then 
                    counter := counter + 1; 
                    if (counter=10000000) then 
                        speed_enable<= Active; 
                        counter:=0; 
                    end if; 
                end if; 
            end process; 

shiftregister: process(speed_enable, clear, DataIn)

    begin
    if speed_enable=active then 
        if clear=active then 
            DataOut (9 downto 0) <= "0000000000"; --(others=>'0'); 
        elsif load = Active then 
            DataOut (9 downto 0) <= DataIn ; 
        elsif Left = Active then 
            DataOut (9 downto 0) <= DataOut(7 downto 0) & "11" ;   
        elsif Right = Active then 
            DataOut (9 downto 0) <= DataOut (9 downto 2) & "11" ;

        end if; 
   end if;  
end process;

LEDSTEP: process(DataOut)
  begin
      if DataOut = "0000000000" then 
            led <= step_zero; 
      elsif DataOut = "0000000001" then
            led <= step_one;
      elsif DataOut = "0000000010" then
            led <= step_two; 
      elsif DataOut = "0000000100" then
           led <= step_three;
      elsif DataOut = "000001000" then
           led <= step_four;
     elsif DataOut = "0000010000" then
           led <= step_five; 
     elsif DataOut = "0000100000" then
           led <= step_six; 
     elsif DataOut = "0001000000" then
           led <= step_seven; 
     elsif DataOut = "0010000000" then
           led <= step_eight;
     elsif DataOut = "0100000000" then
           led <= step_nine; 
     elsif DataOut = "1000000000" then
           led <= step_ten; 

      end if; 
      end process;   

end Behavioral;

【问题讨论】:

  • 该错误与您的移位寄存器无关,它与您的设计约束有关。见 Xilinx 回答here
  • 你能添加你的约束文件吗?

标签: vhdl xilinx vivado


【解决方案1】:

正如 cmets 中所述,这是您的设计约束的问题。 Xilinx 支持answers 中概述了该问题的详细描述(和典型解决方案)。

然而,在这个特定的例子中,您实际上已经为被投诉的端口(@98​​7654323@ 和btnU)指定了 PACKAGE_PIN 和 IOSTANDARD 约束。这个问题实际上是由于您的 vhd 文件和 xdc 文件之间的大小写不同(由于是 Tcl,它是区分大小写的)。在您的 vhd 文件中,导致错误的端口是 Clkbtnu - 这些在约束文件中不存在。

要解决此问题,请将您的端口声明修改为:

entity question2 is
Port (
  led: out std_logic_vector (9 downto 0);
  clk: in std_logic;
  btnU: in std_logic;
  btnL: in std_logic;
  btnR: in std_logic ; 
  btnD: in std_logic;
  btnC: in std_logic 
 );

end question2;

(相反,您可以修改约束文件,但会更改使用的命名约定)。

here 描述了在约束文件中讨论区分大小写的类似问题。

【讨论】:

  • 谢谢。这正是我的问题
猜你喜欢
  • 1970-01-01
  • 2013-06-03
  • 1970-01-01
  • 1970-01-01
  • 2016-09-02
  • 1970-01-01
  • 1970-01-01
  • 2020-11-21
相关资源
最近更新 更多