首页 文章

如何在Xilinx中定义时钟输入

提问于
浏览
2

嘿,我几乎没有Xilinx的经验 . 我有一个数字逻辑课程的小组项目即将到期,我的合作伙伴,本来应该照顾Xilinx模拟决定保释我 . 所以我在这里试着在最后一分钟弄明白 .

我使用几个JK触发器设计了一个同步计数器,我需要为FJKC定义CLK输入 .

我已经制定了正确的原理图,但我无法弄清楚如何定义时钟输入 .

任何帮助表示赞赏,是的,这是作业 . 我在网上找不到任何基本的xilinx文档/教程,老实说,我没有时间学习整个IDE .

我正在使用VHDL

2 回答

  • 2

    看看这个例子 .

    library IEEE;
    use IEEE.std_logic_1164.all;
    use IEEE.numeric_std.all;    -- for the unsigned type
    
    entity counter_example is
    generic ( WIDTH : integer := 32);
    port (
      CLK, RESET, LOAD : in std_logic;
      DATA : in  unsigned(WIDTH-1 downto 0);  
      Q    : out unsigned(WIDTH-1 downto 0));
    end entity counter_example;
    
    architecture counter_example_a of counter_example is
    signal cnt : unsigned(WIDTH-1 downto 0);
    begin
      process(RESET, CLK) is
      begin
        if RESET = '1' then
          cnt <= (others => '0');
        elsif rising_edge(CLK) then
          if LOAD = '1' then
            cnt <= DATA;
          else
            cnt <= cnt + 1;
          end if;
        end if;
      end process;
    
      Q <= cnt;
    
    end architecture counter_example_a;
    

    Source

  • 2

    想象一下,您有一个样本设备如下:

    ENTITY SampleDevice IS 
        PORT 
        ( 
            CLK : IN std_logic
        );
    END SampleDevice;
    

    为了将CLK信号连接到FPGA中的实时时钟输入,您应将其设置为Top Module并创建带有条目的UCF文件:

    NET "CLK"  LOC = "P38";
    

    P38是Xilinx Spartan 3 XC3S200的时钟输入 .

相关问题