×
嵌入式 > 嵌入式开发 > 详情

可编程逻辑器件设计技巧

发布时间:2020-07-06 发布时间:
|
1. 用Altera_Cpld作了一个186(主CPU)控制sdram的控制接口, 发现问题:要使得sdram读写正确, 必须把186(主CPU)的clk送给sdram, 而不能把clk经cpld的延时送给sdram. 两者相差仅仅4ns. 而时序通过逻辑分析仪测试没有问题. 此程序在xilinx器件上没有问题. 这是怎么回事?

答:建议将所有控制和时钟信号都从PLD输出, 因为SDRAM对时钟偏移(clock skew)很敏感, 而Altera的器件PLL允许对时钟频率和相位都进行完全控制. 因此, 对于所有使用SDRAM的设计, Altera的器件PLL必须生成SDRAM时钟信号.

要利用SDRAM作为数据或程序存储地址来完成设计, 是采用MegaWizard还是Plug-In Manager来将一个PLL在采用Quartus II软件的设计中的顶层示例?可以选择创建一个新的megafuntion变量, 然后在Plug-In manager中创建ALTCLKLOCK(I/P菜单)变量. 可以将PLL设置成多个, 或是将输入划分开来, 以适应设计需求. 一旦软件生成PLL, 将其在设计中示例, 并使用PLL的“Clock”输出以驱动CPU时钟输入和输出IP引脚.

2. 在max7000系列中, 只允许有两个输出使能信号, 可在设计中却存在三个, 每次编译时出现“device need too many [3/2] output enable signal”. 如果不更换器件(使用的是max7064lc68). 如何解决这个问题?

答:Each of these unique output enables may control a large number of tri-stated signals. For example, you may have 16 bidirectional I/O pins. Each of these pins require an output enable signal. If you group the signals into a 16-bit bus, you can use one output enable to control all of the signals instead of an individual output enable for each signal. (参考译文:这两个独特的输出使能中每个都可能控制大量三相信号. 例如, 可能有16个双向I/O引脚. 每个引脚需要一个输出使能信号. 如果将这些信号一起分组到一个16位总线, 就可以使用一个输出使能控制所有信号, 而不用每个信号一个输出使能. )

3. 关于vhdl的问题:process(a, b, c) begin… end process; 如果a、b、c同时改变, 该进程是否同时执行三次?

答:PROCESS STATEMENTS 中的执行跟逻辑有关系, 假如是同步逻辑, 则在每次时钟的触发沿根据A, B, C的条件来执行一次;假如是异步逻辑, 则根据判断A、B、C的条件来执行. 一般我们都推荐使用同步逻辑设计

4. 在设计最初, 由于没有将时钟信号定义在全局时钟引脚上, 导致MAXPLUS II 在时间分析时提示错误:(时钟偏斜加上信号延迟时间超过输入信号建立时间). 全局时钟引脚的时钟信号到各个触发器的延时最小, 有没有可能通过编译软件设置, 将普通I/O脚上的时钟信号也经过芯片内部的快速通道以最小的延迟送到每个触发器时钟引脚?

答:you can register that signal and assign it as the global signal, by the step flow: assign->logic option->Individual logic options->Global signal. But you'd better input the clock signal through the dedicated input pin. (参考译文:可以寄存这个信号, 并将它指定为全局信号, 步骤如下:指定—>逻辑选项—>个别逻辑选项—>全局信号. 但是, 最好通过专用输入引脚输入时钟信号. )

5. 用MaxplusII 软件设计完后, 用Delay Matrix查看延迟时间. 由于内部触发器的时钟信号用了一个输出引脚的信号, 譬如将一引脚ClkOut定义为Buffer, Clkout是一时钟信号, 然后反馈到内部逻辑, 内部逻辑用此信号作为时钟信号, 但用Delay Matrix, 却查看不到一些信号相应于ClkOut的延迟, 因为ClkOut是一Output引脚, 在Delay Matrix source 一栏中没有ClkOut信号, 如何解决这个问题?

答:这种做法在逻辑设计中称为GATE CLOCK, 所谓GATE CLOCK就是将设计中的组合逻辑结果拿来做时钟信号, 这是一种异步逻辑设计.

现在都推荐使用同步逻辑设计方法. 可以将该信号(CLKOUT)拿来作使能信号, 即ENABLE信号, 而时钟信号还是采用原来的统一时钟, 使设计用尽量少的同步时钟, 这样一来就还是用DELAY MATRIX来分析原有的时钟.

6. 我是一个epld的初学者, 目前看到xilinx的Virtex-II中嵌入大量的资源如:powerpc、ram等, 究竟如何在fpga中使用这些资源?

答:Xilinx Virtex-II中嵌入的资源非常丰富, 如BlockRAM、Digital Clock Manager、On-chip termination等等. ISE 4.2i软件完全支持这些资源. 可以举出单元库中相应基本数据的实例. Xilinx Core Generator中也还支持BlockRAM等特性. 至于PowerPC和MGT设计, 可以使用Virtex-II Pro开发者套件.

7. 在设计中, 往往需要对某个信号做一定(任意长)的延时, 有没有好的方法来实现?而不是采用类似移位寄存器的方法来延时.

答:使用移位寄存器在FPGA中对信号进行延时是一种好方法. Xilinx Virtex架构中每个对照表(LUT)都能够设置成为具有可编程深度(最多为16)的移位寄存器. 这就提供了一种高效的途径来在FPGA中实现移位寄存器. 无须使用触发器就可以实现一个16位寄存器. 作为一个好的设计习惯, 任何情况下都不要通过闸延迟来实现延迟逻辑.

8. ISE中的PAD TO PAD CONSTRAINT 是否是包括输入输出的pad时延之和再加上输入输出之间的组合逻辑的时延?还是只是输入输出之间的组合逻辑的时延?

答:Xilinx PAD-to-PAD contraint的确涉及到输入输出PAD时延. 这从布局后时序报告中可以看出.

9. 由于现在的设计基本上都是同步设计, 那么PAD TO PAD CONSTRAINT 在什么情况下使用?

答:虽然现今多数设计都是完全同步, 但仍有一些情况需要从一个输入引脚到另一个输出引脚的纯粹组合路径. 因此, 仍然需要PAD-to-PAD constraint控制这些路径的时延.

10. 如何在ISE 中看到PAD TO PAD 的布线情况?

答:通常不必在意信号在FPGA内的路线, 只要它涉及到时序问题. 这种工具将对以优化的方式对设计进行路由. 如果希望检查具体路由, 可以使用Xilinx FPGA Editor, 它包含在ISE4. 2i软件中.

11. 在Xilinx Foundation 3. 1i下用JTAG PROGRAMER下载程序到芯片中, 可是总是出现如下错误:If the security flag is turned on in the bitstream, programming status can not be confirmed;others, programming terminated due to error. 测量电路信号, 没有相应的波形, 显然下载没有成功. 所用的芯片是:Xilinx Spartan2 XC2S50TQ144. 怎么解决?

答:This is a security feature. By disabling readback, the configuration data cannot be read back from the FPGA. This prevents others from pirating your intellectual properties. You can enable or disable this feature during bitstream generation.

The proper way to determine if the configuration is finished without error is to check the status of the DONE pin on the FPGA. DONE pin should goes high if the bitstream is received correctly. Also, since you are using JTAG configuration, please make sure you have selected JTAG clock (not CClk) as your Startup clock during bitstream generation. (参考译文:这是保密功能. 通过禁用回读, 配置数据不能从FPGA回读. 这可以防止其他人盗用你的成果. 在生成位元流过程中, 可以启用或禁用这个功能.

确定配置是否准确无误地完成, 适合的方法就是检查FPGA上DONE引脚的状态. 如果正确地接收了位元流, 则DONE引脚将会升高. 而且, 既然使用JFAG配置, 就要确保在生成位元流过程中, 已经将JGAG时钟(而不是CClk)选作了Startup时钟. )

12. Xilinx Virtex架构中每个对照表(LUT)都能够设置成为具有可编程深度(最多为16)的移位寄存器. 可否理解为, 在写设计的时候如果设计了一个深度不大于16位的移位寄存器, ISE综合时就会用一个LUT来替代它?

答:Most synthesis tools (e. g. Synplify Pro, Xilinx XST) are able to infer LUT based shift register (SRL16E) from your source code. Even for depth greater than 16, the tool is smart enough to infer multiple SRL16E to realize the shift register. Another way to utilize this feature is to instantiate an SRL16E in the source code. You can refer to the Library Guide in the Xilinx ISE software package for more details. (参考译文:大多数综合工具, 例如Synplify Pro和Xilinx XST, 都能根据源代码中的移位寄存器SRL16E来推断 LUT. 即使是深度大于16的情况, 此类工具也能够推断出多SRL16E, 从而实现移位寄存器. 利用此功能的另一种途径是在原代码中例示一个SRL16E. 详细说明可以参考Xilinx ISE软件包中的库指南. )

(有关IP Capture工具的详细资料, 请访问相关网站. )

60. 制作了一块试验板, CPLD使用EPF10K20TI144-4. 用max+plus II 10. 1编程, 完成后, 下载至片子内, 经过几次下载尝试(一直提示configuration failure: SRAM load unsucessful), 直至提示“configuration complete”——这应该是表示下载成功吧, 可是片子却无法实现任何功能(连最基本的一个或门都无法实现)——不起任何作用, 我使用TQFP-144的适配座放置EPF10K20TI144. 现在有几个问题:

① 编译前选择的是EPF10K20TC144-3芯片(max+plus II的器件库中没有EPF10K20TI144-4), 有没有关系?也用EPF10K10TC144-4试过, 也是可以下载但无法实现功能.

② 为什么要下载很多次才能成功, 下载线是自己制作的?

③ 将MSEL0、MSEL1、nCE、专用输入脚、专用时钟脚接地, 其它非I/O引脚悬空, 是否还有些引脚需要接地或VCC?

④ 如果因为TQFP-144适配座一些触点与CPLD引脚接触不好导致一些VCCIO, VCCINT、GNDINT、GNDIO或其它一些非I/O引脚悬空, 会出现什么结果?

⑤ 如何才能使CPLD实现功能?

答:根据描述, 很有可能是加载电路有问题, 请参照Altera的AN116文件的加载电路图仔细核对, 特别注意和CPU相连的加载控制管脚:

① 编译芯片选择与速度等级无关;

② 请检测conf_done信号是否拉高;

③ 在常用的PS和JTAG加载模式时除了MSEL0, MSEL1, nCE, 没用的专用输入脚, 专用时钟脚应该接地 , data0, nconfig, dclk, nstatus, conf_done都应该上拉, 这些管脚不上拉很可能是导致你加载不成功的原因;

④ 如果因为TQFP-144适配座一些触点与CPLD引脚接触不好导致一些VCCIO, VCCINT, GNDINT, GNDIO或其它一些非I/O引脚悬空, 会出现会出现加载链路不通或加载不成功的现象;

⑤ 加载成功后CPLD就能实现功能.

61. 目前采用SRAM技术的LUT-based的FPGA仍然占绝对主流地位, 但是这种FPGA有其天生的缺陷, 请问下一代FPGA的构架发展趋势怎样?Altera在这方面有没有什么新的尝试?

答:下一代FPGA主要朝着SOPC的方向发展:

Altera的下一代产品Stratix, 基本单元LE仍然基于LUT结构, 但有些大的改变,

① 去掉了传统的级联链(Cascade Chain);

② 进位链(Carry Chain)由以前的单一1条变为LAB Carry-in、Carry-in1、Carry-in0三条;

③ LE的扇出也由2个变为了4个;

④ 触发器的控制信号也更多.

其它方面:

① RAM:一改以前单一2K BITs 或4K BITs的 Memory为小RAM:512BITs; 中RAM:4KBITs;大RAM:512 KBITs;

② 第一次在FPGA中嵌入DSP;

③ 时钟链路也由全局时钟变为全局时钟和区域全局时钟;

④ . . . . . .

所有的这些变化都是通过大量的用户反馈信息作出的慎重改进, 使的Stratix器件更加适合用户的设计需求

62. 能否提供7128的下载波形、DSP与PLD的典型下载电路?

答:7128的下载波形与PLD的典型下载电路在Altera应用文档AN95里有详细的说明.

63. Always use fully synchronous design. You never need to reply on gate delay if your design is fully synchronous. 如果设计是完全同步的, 意思是就可以不用依靠门延时. 但在设计时, 在对和数据一同进来的控制信号进行处理后所产生的输出控制信号会滞后数据数个时钟周期, 这时就不得不对数据进行门延时, 已达到同步. 现在看来, 这是不合适的. 但是, 要用什么办法来处理这个问题而不应用门延时呢?

答:In a fully synchronous design, you only have 3 kinds of paths(在完全同步设计中, 只有三种途径:)

① From I/O to synchronous element. (从I/O到同步元素)

② From synchronous element to synchronous element. (从同步元素到同步元素).

③ From synchronous element to I/O. (从同步元素到I/O)

A fully synchronous design will work as long as the delays of all these paths do not exceed the clock period. So you never need to introduce any delay. If you derive any control signal from the input signals, that control signal only goes to the 'D' or 'EN' pin of a FF, but not the 'CLK' pin. So there is no need to introduce any delay to your data. Simply speaking, you only need to design the data path but not the clock path in a fully synchrous design.

On the other hand, you can remove clock delay with the DLL in Xilinx SpartanII/Virtex devices or the DCM in VirtexII devices. (完全同步设计将工作到所有这些路径的延迟不超过时钟期间. 因此从不需要传入任何延迟. 如果从输入信号中得到任何控制信号, 则该控制信号只能传递至FF的D或EN引脚, 而不是CLK引脚. 因此, 不需要将任何延迟传入数据. 简单讲, 在完全同步设计中, 只需设计“数据”路径, 而不是“时钟”路径. )

64. ISE4. 2I可对某些特殊管脚设置内部上拉, 那么外部是不是就可以不必再加上拉电阻了?另外, 配置过程中, 所有的用户I/O是否均为三态? VIRTEX2的HSWAP_EN应接何电平?为什么?

答:Whether you need to add external pullup resistors depends on your board design. Usually external pullup resistors are required under the following conditions((参考译文:是否需要添加外部上拉电阻取决于电路板设计. 通常在以下条件下需要外部上拉电阻:)

- You need precise pullup values. The pullup built into the IOB is not specified to a precise resistive value since it values from batch to batch. (需要精确的上拉值. 因为it values from batch to batch, 所以然内置入IOB的上拉未指定精确电阻值. )

- You need strong pull-up strength. The IOB pullup is relatively weak - in the order of several tens of KOhms. (需要强大的上拉动力. IOB上拉相对较弱, 只有数十千欧)

If you only want to prevent the board signal from floating, external pullup is usually not required.

You need to refer to the datasheet of the corresponding FPGA series to determine the state of the I/O during configuration. As an example, I/O pins of Virtex-E and Spartan-IIE behave as tri-state beore configuration. The HSWAP_EN pin on Xilinx Virtex-II is for enabling/disabling pullups on the user I/O pins during configuration. By default, HSWAP_EN is tied high (internal pullup resistor) which turn off pullup resistors on user I/O during configuration. (如果只想阻止板信号浮动, 通常不需要外部上拉. 需要参考相应的FPGA系列的参数表, 以确定配置过程中I/O的状态. 例如, Virtex-E和Spartan-IIE的I/O引脚在配置以前是三态的. 配置过程中, Xilinx Virtex-II 上的HSWAP_EN引脚用于启用/禁用用户I/O引脚上的上拉. 缺省情况下, HSWAP_EN系有较高内部上拉电阻, 用于在配置期间关闭用户I/O上的上拉电阻).

65. 自顶向下的设计过程是什么样的一种过程?我的理解是在设计开始时, 利用vhdl或verilog中的延迟描述语言在功能和波形上进行仿真描述, 而后进行rtl设计. . . . 是否是这样的一个过程?

答:By top down design we usually mean you partition the top level design into a number of modules first, without going into details of each of those modules. Then you start to design each module, which may involves defining more underlying submodules. The process stops when you have designed all the underlying submodules. The basic idea is to build a hierarchy which starts with less details on the top and more details as you go down the hierarchy. (参考译文:我们所谓的自顶向下设计通常是指:先将顶级设计划分为多个模块, 而不涉及这些模块的细节. 然后开始设计每个模块, 可能包括定义更多底层子模块. 当设计完成所有底层子模块后, 这个过程即完成. 基本思路是建立一个层次结构, 从顶部粗略划分开始, 越向下层越详细. )

66. HSWAP_EN推荐接高还是低, 为什么?

答:There is no definite answer to this - it depends on whether you want the user I/Os to have pull up resistors during configurations. Therefore it is design dependent. (参考译文:没有定论. 高还是低取决于配置过程中是否要使用者I/O具有上拉电阻. 因此因设计而定. )

67. 用ISE做过很多的设计, 但是ISE中的help对设计说的比较详细, 但是对Navigator的功能的说明不是很好. ISE中有一个Library_view. 当你把work库中的设计move到VHDL或VERILOG中, 这时就会在library_view的窗口中看到. 但是什么用也没有呀. VHDL里用library ****; use *** 不行. veriloghdl里用`include也不行. 还不如直接在work中的一个package. 什么时候用到library_view中的功能?

答:The proper method to create and use library within ISE is (正确的方法是创建并使用ISE中的库, 过程如下:)

① Click Project->New Source and select VHDL library. (单击Project->New Source 然后选择 VHDL 库)

② Enter a name for the new library and click Next, then Finish. The new library is now visiable in the Library View tab. (为新的库输入名称, 然后单击Next-> Finish. 新的库即出现在Library View标签上. )

③ In the library view tab, right click on the new library and then click Add Sources. (在库查看标签中, 右键单击新库, 然后单击Add Sources)

④ Choose the sources you want to add to the library. (选择要添加到库的源)

⑤ You can then use this library in your source codes. For example (然后可以在源代码中使用这个库. 例如:)

library MyLib;

use MyLib. MyPkg. all;

. . . . .

Please refer to p. 5-14 to 5-17 of the ISE User Guide which is included in the ISE Documentation CD for more details. (详情请参阅ISE文档说明光盘中的ISE User Guide 5-14至5-17)

68. 利用器件的IBIS模型能否对器件的功能进行仿真?

答:IBIS models provide information about I/O driver and receiver characteristics without disclosing proprietary knowledge of the IC design (as unencrypted SPICE models do). You need to have an IBIS simulator in order to use the IBIS model. It is not for logic simulation like vhdl or verilog models do. (参考译文:IBIS模型提供有关I/O驱动器和接收器特征的信息, 而不会透露IC设计的所有权信息, 这和未加密的SPICE模型一样. 为了使用IBIS模型, 需要有一个IBIS模拟器. 像vhdl或verilog模型一样, 它不是适用于逻辑仿真. )


69. 用modelsim后仿真时需要用到XILINX的库, 下载了XILINX网址提供的TCL文件, 按照要求在AUTOEXEC. BAT中设置了SET MODELSIM=****, 重启了机器, 在MODELSIM下运行了TCL文件, 选项为VERILOG, simprim, 可是MODELSIM 还是报找不到库, 为什么?所用ISE版本为ISE4. 1I.

答:The tcl script is for compiling the Xilinx libraries with Modelsim. After you've compile the libraries, you need to vmap them when you simulate your design. For example, if the physical path to your compiled simprim library is d:/xilinx_sim_model/simprim, you need to map simprim to the full path by typing vmap simprim d:/xilinx_sim_model/simprim at the Modelsim command prompt. Then you can simulate your design by the following command vsim -L simprim (参考译文件:tcl脚本是为使用Modelsim编译Xilinx库的. 在编译完库之后, 仿真设计时需要vmap这些库. 例如, 如果指向已编译的simprim库的物理路径是d:/xilinx_sim_model/simprim, 则需要通过在Modelsim命令提示处输入vmap simprim d:/xilinx_sim_model/simprim来将simprim映射到完整路径. 然后可以使用命令vsim -L simprim 仿真设计. )

70. PINHSWAP_EN的作用是使能或关闭配置时I/O管脚上的上拉电阻, 这两种情况具体有什么不同呢?PCB设计时HSWAP_EN具体如何处理?

答:The Virtex-II HSWAP-EN pin has an internal pull-up by default to turn off the pull-up resistors at the I/O pins during configuration. You need to tie it low externally if you need to activate the pull-up at I/O pins during configuration. (参考译文:缺省情况下, Virtex-II HSWAP-EN管脚有一个内部上拉电阻, 以在配置期间关闭I/O管脚上的上拉电阻. 如果在配置过程中需要激活I/O管脚的上拉电阻, 需要将这个上拉电阻在表面上约束到较低. )

71. PWRDWN_B是power down pin, 可不可以不连接或上拉?

答:The PWRDWN_B pin was provided to set a Virtex-II device into a power-down mode: a low-power, inactive state. However, this feature is no longer supported in Virtex-II. To set it as inactive, the PWRDWN_B should be left at its default value, which is pulled up. (The PWRDWN_B does not require an external pull-up or pull-down. ). Please refer to Xilinx website for more details. (参考译文:PWRDWN_B管脚用于将Virtex-II器件设定为功率下降模式:低功率和不活动状态. 然而Virtex-II中已不再支持这种功能. 要在非活动状态下设定它, PWRDWN_B应该保留缺省值, 即已上拉. PWRDWN_B不要求外部上拉或下拉. 详情讲参阅Xilinx网站).

72. spartanII不能下载, 显示done不能拉高, done上上拉电阻已接, 是何原因?

答: Here are my suggestions(有几点建议:)

-Check if the mode pin is selected correctly. (检查是否正确选择了方式管脚).

- Check if you have selected the correct startup clock. If you are using serial mode, you need to use Cclk. If you are using jtag, you


『本文转载自网络,版权归原作者所有,如有侵权请联系删除』

热门文章 更多
一只老鸟的嵌入式ARM学习心得