嵌入式逻辑分析仪—SigbalTap II,是Altera Quartus II 自带的嵌入式逻辑分析仪,它是在线式的仿真,更准确的观察数据的变化,方便调试。此工具其实就是在FPGA中添加了一部分额外的电路来监测内部的数据,然后通过JTAG上传到PC机进行显示。在FPGA的学习,本工具的使用会有很大帮助。本文将用一个简单的程序来演示如何使用它。
编写测试程序代码如下:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity test is
port(
clk: in std_logic;
data: out std_logic_vector(3 downto 0)
);
end entity;
architecture one of test is
signal count: std_logic_vector(3 downto 0);
signal half_clk: std_logic;
begin
data <= count;
process(clk)
begin
if(clk 'event and clk = '1') then
half_clk <= not half_clk;
end if;
end process;
process(half_clk)
begin
if(half_clk 'event and half_clk = '1') then
count <= count + 1;
end if;
end process;
end one;
编译,分配好管脚。点击Tools -> SignalTap II Logic Analyzer,得到如下界面