FPGA 综合笔记

仿真时阻塞赋值和非阻塞赋值
Use of Non-Blocking Assignment in Testbench : Verilog

Use of Non-Blocking Assignment in Testbench : Verilog - Stack Overflow

non-blocking assignment does not work as expected in Verilog

non-blocking assignment does not work as expected in Verilog - Electrical Engineering Stack Exchange

This is actually quite similar to a question I answered previously, but I will try to build up a canonical answer for this somewhat common issue.

In a zero-delay simulation like this, the test flip-flop has a setup time and a hold time of zero:

```math

Tsetup=Thold=0

```

What this means is that the instant the sensitive clock edge occurs, the output is updated, regardless of what happened immediately before or after that instant. This is not like real hardware which would usually have a non-zero 𝑇𝑠𝑒𝑡𝑢𝑝 and 𝑇ℎ𝑜𝑙𝑑.

I ran your testbench, and the results are pretty clear. The valid signal changes at the same time the clock signal does. You have delayed them by precisely the same amount. So at the very edge when the clock is high, the valid signal has also changed:

Both the input (div_valid), and the clock (gclk) go high at the same time: 220 ns. Therefore, the DFF latches this new data, and the output changes instantly since there is also 0 propagation delay. This simulation would look less confusing if we just chose a different delay value for the input to the design:

In this case, we update the input on the falling edge of the clock (620 ns). It is much more clear now that the next clock edge (640 ns) will be when the DFF updates its output.

Curious state transitions in state machine RTL simulation

digital logic - Curious state transitions in state machine RTL simulation - Electrical Engineering Stack Exchange

Pitfall: If your testbench updates the TxSync input exactly at the rising clock edge, You will just have a glitch in nextState. Your simulator may remove this glitch, making it look like nextState never entered State_WRITETOLANE1, when in fact it did, just for a very brief moment. This would make it look like currentState latched a value that nextState never had.

Remedy: Don't update the inputs exactly at the rising clock edge. Add some small delay so that the simulation can be more clearly understood. In my case, I updated the input at the falling clock edge. But the update time is arbitrary if you are doing a 0 delay simulation.

陷阱:如果您的测试台在上升的时钟边缘精确更新了 TxSync 输入,那么 nextState 中将会出现一个毛刺。您的模拟器可能会消除这个毛刺,使其看起来 nextState 从未进入过 State_WRITETOLANE1 状态,但实际上它确实进入过,只是非常短暂。这会让它看起来 currentState 捕获了一个 nextState 从未拥有的值。

解决方法:不要在上升的时钟边缘精确更新输入。增加一些小延迟,以便模拟更清晰地理解。在我的情况下,我是在下降的时钟边缘更新输入的。但如果您正在进行零延迟模拟,更新时间是任意的。

Quartus 编译错误
Can't place multiple pins assigned to pin location

Error (176310): Can't place multiple pins assigned to pin location Pin_101 (IOPAD_X34_Y18_N21) Info (176311): Pin ch1_dac[3] is assigned to pin location Pin_101 (IOPAD_X34_Y18_N21) Info (176311): Pin ALTERA_nCEO is assigned to pin location Pin_101 (IOPAD_X34_Y18_N21)

解决办法:

菜单->Assignments->Device->Device and Pin Options:

将相关引脚改为普通 IO:

仿真通过,上板验证失败

解决办法:板子断电,上电,再烧录

一个可能的原因:FPGA 器件支持除法吗?

固化程序启动失败

故障描述

EP4CE6E22C8 通过 jic 文件固化成功,但是启动失败,FPGA 的 CONF_DONE 引脚输出总是低。实际该引脚在配置期间为低,配置成功后为高。

启动失败板子:带10k 上电阻,CONIFG_DONE 脚对地95M电阻,对VCC电阻:32k

启动 OK 的板子:CONFIG_DONE 脚对比:102M,, 对 VCC电阻:102M

故障原因

怀疑1:板子 FPGA 引脚有四根分线,怀疑是飞线过多,在操作时烧了板子。

怀疑2: CONF_DONE 引脚的 R27、D1 是手焊的,可能在焊接时烧了板子?

尝试

测量 FPGA 晶振频率: OK

尝试重新焊接 R19 ,失败

尝试更换 W25Q16: 失败

尝试重新编译: 失败

FPGA 坏了,只能更换FPGA

相关推荐
热爱学习地派大星16 小时前
Xilinx FPGA功耗评估
fpga开发·verilog·vivado·fpga功耗·xpe
进击的奶龙21 小时前
21verilog函数
verilog·基础语法
XINVRY-FPGA12 天前
XCVU47P-2FSVH2892E Xilinx Virtex UltraScale+ FPGA AMD
c语言·c++·人工智能·嵌入式硬件·阿里云·fpga开发·fpga
迎风打盹儿16 天前
FPGA点亮ILI9488驱动的SPI+RGB接口LCD显示屏(二)
fpga·verilog hdl·ili9488·rgb接口·lcd显示屏
tiantianuser20 天前
RDMA简介7之RoCE v2可靠传输
服务器·fpga开发·verilog·xilinx·rdma·可编程逻辑
9527华安25 天前
国产安路FPGA纯verilog图像缩放,工程项目解决方案,提供5套TD工程源码和技术支持
fpga开发·verilog·图像缩放·双线性插值·安路fpga
贝塔实验室25 天前
FPGA 的硬件结构
arm开发·fpga开发·职场和发展·硬件架构·硬件工程·fpga·安全架构
贝塔实验室1 个月前
FPGA 动态重构配置流程
驱动开发·fpga开发·硬件架构·硬件工程·射频工程·fpga·基带工程
tiantianuser1 个月前
RDMA简介5之RoCE v2队列
fpga开发·verilog·fpga·rdma·高速传输·rocev2
ALINX技术博客1 个月前
【新品解读】一板多能,AXRF49 定义新一代 RFSoC FPGA 开发平台
射频工程·fpga·amd·rfsoc·alinx