显示标签为“FPGA”的博文。显示所有博文
显示标签为“FPGA”的博文。显示所有博文

2008年12月3日星期三

创建ON CHIP测试,我的标准步骤

设置的一般步骤:
  1. create Xilinx ChipScope Core chipscope_icon and chipscope_ila, then put them into ISE directory
  2. add component chipscope_icon and chipscope_ila_1 in Top entity, for example: fpga_right
  3. set the CONTROL, DATA and TRIG signals for the component chipscope_ila, the CONTROL comes from the component chipscope_icon, DATA is the signals, which is important and you want to see, for example, I take the signals from the NCORE_adr(the address from the Processors), for TRIG, I use a trigger_proc or use TRIG <= (not ncore_ta) & ncore_r_w;
  4. maybe set some LED signals for show the RESET signals, to see, if the program "Init_Raptor" works
  5. use lb_interface(for the communication with the Computer) in the Top entity
  6. use a "Init_Raptor", which made of MFC to set the Reset signal --> Init and Reset
  7. now you can use the ChipScope Analyze to do the on chip test
接下来,进行综合,并进行设置:
for Xilinx ISE setting here only for the Studienarbeit(GALS system testing):

Synthesis Properties:
by Synthesis Options: Cross Clock Analysis --> yes
by Xilinx Specific Options: Optimize Instantiated Primitives --> yes

Map Properties:
Trim Unconnected Signals --> yes, Replicate Logic to Allow Logic Level Reduction --> yes, Allow Logic Optimaization Across Hierarchy --> yes,
Use RLOC Constrains --> yes, Pack I/O Register/Latches into IOBs --> For Inputs and Outputs, Map Slice Logic into Unused Block RAMs --> yes
注意:将ISE Project中的所有的无关的.vhd删除,并且加入少的.vhd和.v的文档,让Project简单和其他文档无关,互不影响,只保留有用的文档。注意.ucf很重要,必须直接加入到Project中去,不能和Top entity外部相连。

使用ChipScope:
ChipScope_data <=ncore_addr_top (所需要引出的数据);
ChipScope_trigger <=(not ncore_ta) and (ncore_rw) (给定的trigger条件);

注意使用,如下的语句:
-- synopsys translate_off
在这里面的语句将不参与综合
-- synopsys translate_on

2008年11月22日星期六

使用 Xilinx ChipScope对FPGA进行调试

If the prblem with your design lies at the tp-level or is fundamentally hardware-related, using ChipScope modules is probably the best way to debug them.

Example:

如何使用 Xilinx ChipScope对FPGA进行调试,具体请看教程。
-- Xilinx Chipscope -- Instantiations
chipscope_controller : chipscope_icon
port map (control0 => chipscope_control);

chipscope_logicanalyzer : chipscope_ila_1
port map (clk => clk_lb, -- #
control => chipscope_control,
trig0 => chipscope_trig0);

-- Trigger
-- chipscope_trig0 <= (not ncore_ta) and (ncore_rw);
-- here:
-- chipscope_trig0 <= cluster_system_chipscope_trig_top;
-------------------------------------------------------

-- Xilinx Chipscope
signal chipscope_trig_top_int : std_logic_vector(0 downto 0);
-------------------------------------------------------
chipscope_trig_top_int(0) <= ((not ncore_ta) and (ncore_r_w)); -- #
chipscope_trig_top <= chipscope_trig_top_int;
逻辑分析仪Xilinx ChipScope的产生有两种方法:

Core Generator
(核产生器): 产生内核,将这些内核例化后添加到原设计文件,最后综合,实现,下载。
和Core Inserter(核插入器):不需要修改原文件,它是将生成的内核添加到综合后的网表文件中.

Core Inserter 的流程为:

1)的 RTL 综合成 Netlist;

2)调用 Core Inserter 插入逻辑分析仪;

3)布置和布局;

4)产生 bit 文件下载验证。


http://www.stanford.edu/class/ee108a/resources/documentation/chipscope_tutorial.pdf

这是一个很好的简单教程

基本步骤是:
  1. Generationg ChipScope Modules
  2. Incorporating and Instantiating the ChipScope Modules
  3. Connecting the ChipScope Modules
  4. Synthesizing, Implementing, and Running Your Design
  5. Using ChipScope Analyzer

2008年11月20日星期四

VHDL设计在FPGA模块测试 & VDHL极限编程结合FPGA实物仿真

例如 先进行5 Port original Switch-Box Testing在这个设计中只该变测试接口add Local Bus Interface, add N_core_Address测试接口,其他保持不变。
the Change for ISE Synthezise:
  1. add: library ethernet_lib;use ethernet_lib.all; in eth_controller.vhd.
  2. add: \hardware\assists : av_hw_acc, IP_header_check
  3. add: \hardware\building_blocks : cc_hw_acc, encoder
  4. in ISE: Sythesize properties: Veliog file path: --> ethenet Path
  5. use the new memory_interface.vhd and do some change to the ncore_wb.vhd: for example CPU_ID
  6. add all CoreGen file to the ISE-directory
  7. ISE libraries: change eth_port.vhd to ETHERNET.lib, change pe_cluster.vhd to URAT.lib
以上的内容对于读者并不重要,我只是记下来提醒自己:正确设置ISE是很重要,也是一点点学问和经验,以上例子表明,进行一个很简单的综合,在前期就要进行多达7步的搭配工作。测试常常需要很多不同的技巧,我这里是用XILINX CoreGenerator 生成储存文档,并和VHDL文件在ISE里进行综合,然后产生具有储存文档所描述功能的Bitstream。有时间的话,我将对XILINX CoreGenerator的使用进行说明。

这里所谓的"VDHL极限编程结合FPGA实物仿真":就是利用eXtreme Programming的一部分思想进行VHDL编程。极限编程:从最简单的解决方式入手再通过不断重构达到更好的结果。这种方法与传统系统开发方式的不同之处在于,它只关注于对当前的需求来进行设计、编码,而不去理会明天、下周或者下个月会出现的需求。
具体步骤:
  1. VHDL小系统的模拟(例:我的项目中:使用只有3个Ports的Switch Box系统在ModelSim进行模拟,这样可以提高模拟效率和速度)
  2. FPGA大系统实物仿真(例:我的项目中:使用有5个Ports的Switch Box的原始系统在ISE进行综合,这样可以保证综合的正确性)
  3. 在VHDL小系统的模拟验证正确的设计,直接放入大的系统,直接进行ISE综合,但是要仔细嵌入新的设计。
  4. 重复以上步骤。

2008年11月19日星期三

成功生成的 Bitstream 当下载到FPGA时,出错的原因及解决方法

成功生成的 Bitstream 当下载到FPGA时,出错
这很令人愤怒。如果一个大的系统通过 ISE 两个小时以上的综合。BITSTREAM 成功生成了,但下载到 FPGA 时却报错。以下是两个不同的报错。
Attemp to Download full Bitstream
Checking Local 1 Range/Remap Register............Success
FPGA-Erase complete
Startsequenz found, starting programming.......
Preparing for Interrupt..........................Success
ERROR ! Done timeout!
Init is LOW, but should be HIGH, this could indicate a CRC-error

Attemp to Download full Bitstream .
Checking Local 1 Range/Remap Register............Success
ERROR !
Init timeout

我们先讨论其产生原因。
会发生这种情况,常常是我生成2个Bitstream并且分别下载到相邻的FPGA上。这两个Bitstream可以单独放置在FPGA上毫无问题,但是就是不可以分别下载到相邻的 FPGA 上(已经通过多次实验证明),但是通常我需要这两个FPGA模块进行通信交流。

产生原因可能有2个:可能是在LINUX的机器上,不同的时间,综合ISE工具产生的结果是不同的。这个看是很荒谬的原因是我的导师告诉我的,他有多次经历。我在昨天也做了实验,同样一个VHDL设计在不同的时段(不同的LINUX机器)进行综合,新的Bitstream就可以用了。
另一个原因是:可能FPGA的模块的输出和输入没有正确的MAP & ROUTING。一直两个FPGA模块无法对应上。

解决方法:
目前只能进行多次综合,在不同的时段或使用不同的LINUX综合机器。
新的解决方法,如果发现我将在后续发布。
最新的解决方法:
1.请查看ise Project里的FPGA constrain文档是否有正确放置在top 文档下。
2.有时候要先删除旧的FPGA constrain文档,然后再加上一遍,这可能是ise的bug吧,我的导师告诉我的。
3.如果可以的话,请删除和你Project无关的vhd或verilog文档,它们可能会对你的综合产生影响。

2008年11月18日星期二

使用 local bus slave in FPGA 用于检测 VHDL Design

对FPGA进行测常常是一件很麻烦的工作。
这里有我最近的设计,例:
通过不同的从LOCAL BUS给定的地址可以从FPGA中很方便地读出所需要的测试数据。


status_multiplexer: process (I_ADR_test, DEBUG_PORT) is
begin
  case conv_integer(I_ADR_test)*4 is
  when 0 => I_DATA_IN_test_fpga2pc <= DEBUG_PORT(31 downto 0);
  when
4 => I_DATA_IN_test_fpga2pc <= DEBUG_PORT(63 downto 32);
  when
8 => I_DATA_IN_test_fpga2pc <= DEBUG_PORT(95 downto 64);
  when
12 => I_DATA_IN_test_fpga2pc<= DEBUG_PORT(127 downto 96); -- = 0xC
  when others
=> I_DATA_IN_test_fpga2pc <= "10101010101010101010101010101010";
end case;
end process
;


这里只用了一个很简单的multiplexer。
完成了对多个数据的测试。这个设计对于读取时地址资源稀少的 LOCAL BUS 设计很有帮助。可以只用一个 LOCAL BUS 但是可以读出不同的测试数据(在不同的时间)。我们只要给定 LOCAL BUS 的值 在本例中,给定 60004,就可以读出 DEBUG_PORT(63 downto 32)的数据。