1 / 24

—— IP 复用

FPGA 系统设计与实践. —— IP 复用. 基于 ISE5.2 的设计输入方法. 3.1.4 IP 复用. IP( 知识产权)核将一些在数字电路中常用,但比较复杂的功能块,如 FIR 滤波器、 SDRAM 控制器、 PCI 接口等设计做成一个“黑盒”或者是可修改参数的模块,供设计者使用。 IP 核包括硬 IP 与软 IP。 调用 IP 核能避免重复劳动,大大减轻设计人员的工作量。. 3.1.4 IP 复用.

Download Presentation

—— IP 复用

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. FPGA系统设计与实践 ——IP复用 基于ISE5.2的设计输入方法

  2. 3.1.4IP复用 IP(知识产权)核将一些在数字电路中常用,但比较复杂的功能块,如FIR滤波器、SDRAM控制器、PCI接口等设计做成一个“黑盒”或者是可修改参数的模块,供设计者使用。IP核包括硬IP与软IP。调用IP核能避免重复劳动,大大减轻设计人员的工作量。

  3. 3.1.4IP复用 Xilinx Core Generator采用了Smart IP技术和友好的用户参数设置界面。使IP从生成到使用的过程简单,灵活,易用,高效,而且可以对IP使用的资源做一定估计。

  4. 3.1.4IP复用 下面以一个10进制计数器为例,讲解如何在ISE5.2中生成IP和使用IP,实现设计。

  5. 1.设计要求 设计一个10进制计数器: (1)计数频率为1Hz (2)外部晶振为30MHz (3)使用7段LED显示计 数器的值。 其原理框图如右图所示。

  6. 2.新建工程

  7. 3.新建VHDL(分频器)文件

  8. 4.编写分频器的VHDL源程序 library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity div30 is Port ( clkin : in std_logic; reset : in std_logic; clkout : out std_logic); end div30; architecture Behavioral of div30 is signal Reg_clk : std_logic :='0'; begin clkout <= Reg_clk ; process(clkin,reset) variable cnt : integer range 0 to 15000000 :=0; begin if reset = '0' then cnt :=0 ; Reg_clk <= '0'; elsif rising_edge(clkin) then cnt := cnt + 1; if cnt = 15000000 then cnt := 0; Reg_clk <= not Reg_clk ; end if; end if; end process; end Behavioral;

  9. 5.建立一个IP文件

  10. IP 初始化窗口

  11. IP核生成器操作界面

  12. IP核 在Xilinx Core Generator(IP核生成器)操作界面左边的窗口中包含了很多文件夹,文件夹下又有子文件夹,子文件夹中装的就是各种功能的IP。Core Generator中的IP相当丰富,而且已经分门别类装在不同的文件夹中。如:Basic Elements(基本元素)中包含有一些最基本的功能IP,比较器,计数器,编码器/译码器,格式转换,逻辑门/缓冲器,各种存储器,复选器,寄存器,移位寄存器等。

  13. IP核 还包含有: Communication & Networking(通讯和网络) IP Digital Signal Processing(数字信号处理) IP Math Functions(数学功能) IP Memories & Storage Elements(存储器) IP Prototype & Development Hardware Product(原形和开发硬 件产品) IP Standard Bus interfaces(标准总线接口) IP

  14. IP核生成器操作界面窗口中按钮的含义

  15. 6. IP参数设置 双击IP名 Binary Counter参数设置对话框

  16. 6. IP参数设置

  17. 7.生成IP

  18. 7.生成IP 报告显示,生成的计数器将占用5个LUT(查找表),5个寄存器;设计100%的是RPM(Relationally Placed Macro) ,这是一种相关元素的布局方式(采用这些布局方式有一定的好处,有兴趣的读者可以参考相关书籍)。设计有1个CLB(可配置逻辑块)宽,3个CLB高,一共使用了3个CLB或者3个slices(切片)。

  19. 7.生成IP 将生成好的IP文件加入工程后Sources in Project和Processes for Current Source中的变化如左图所示。

  20. 8.译码器设计 (1)定义端口

  21. 8.译码器设计 (2)编写VHDL源程序 library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity decoder is Port ( din : in std_logic_vector(3 downto 0); dout : out std_logic_vector(6 downto 0)); end decoder; architecture Behavioral of decoder is begin with din select dout<="1000000"when"0000",--0 "1111001"when"0001",--1 "0100100"when"0010",--2 "0110000"when"0011",--3 "0011001"when"0100",--4 "0010010"when"0101",--5 "0000010"when"0110",--6 "1111000"when"0111",--7 "0000000"when"1000",--8 "0010000"when"1001",--9 "1111111"when others; end Behavioral;

  22. 9.顶层映射 (1)定义端口

  23. 9.顶层映射 (2)编写VHDL源程序 CLK : IN std_logic); end component; component decoder Port ( din : in std_logic_vector(3 downto 0); dout : out std_logic_vector(6 downto 0)); end component; signal clk1hz : std_logic; signal q : std_logic_vector(3 downto 0); begin u1: div30 port map( clkin => clk , reset => reset , clkout => clk1hz); u2: my_cou port map( clk => clk1hz , q => q ); u3: decoder port map( din => q , dout => dout ); end Behavioral; library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity top is Port ( clk : in std_logic; reset : in std_logic; dout : out std_logic_vector(6 downto 0)); end top; architecture Behavioral of top is component div30 Port ( clkin : in std_logic; reset : in std_logic; clkout : out std_logic); end component; component my_cou port ( Q : OUT std_logic_VECTOR(3 downto 0);

  24. 到此已经使用IP完成了整个设计。

More Related