当前位置:网站首页>可综合RTL代码设计方法和注意事项
可综合RTL代码设计方法和注意事项
2022-06-11 20:51:00 【远古架构师alanwu】
很多芯片设计人员,在接触RTL Coding的一开始,很难区分哪种写法可综合,哪种写法不可综合,这里总结下可综合的RTL代码设计,需要注意的问题。
一、不使用仿真延时
避免使用#time对寄存器或wire进行延时,该方法可以将输出delay一段时间,在仿真的时候能够满足delay的需求,但在综合时,DC会将所有的#time忽略掉,带来的问题就是前仿结果和综合结果不一致,因此前仿时尽量避免这种使用#time。在网表和代码混合仿真时,可以在分界的地方适当加上#time,用于模拟RTL代码给入的延时信息。
二、避免出现信号赋初值
所有reg的初值因由复位逻辑实现,所有wire的初值,综合时会被综合工具默认忽略,因此避免使用wire赋初值导致的仿真结果和综合结果不一致的问题。对于reg的初值,不需要所有reg都有上电的初值,但是所有用于控制的reg,因在复位有效时赋初值。
所有未赋初值的reg,在上电后处于随机初值状态,也就是说流片回来后,其reg内部数据看起来像是乱码,但是对于同一个芯片,其流片后的乱码值是固定的,不同芯片的乱码值不同。因此,如果重要的控制信号未赋予初值,其带来的后果就是芯片的良率下降,芯片有几率能够正常工作,但大部分是不能正常工作的。
三、避免使用不可综合语句
在RTL Coding过程中,因避免出现time、defparam、$finish、fork、join、initial、delays、UDP、wait、$display等综合不识别语句。这些语句最好只出现在testbench中,在DUT中不能出现上述语句,否则要么综合报错,要么产生不可预知的后果。不同的EDA厂商,其综合工具对语句的支持也不尽相同,这里列举下所有综合工具都支持的语句和部分综合工具支持的语句。
所有综合工具都支持的语句有:always、assign、begin、end、case、wire、tri、aupply0、supply1、reg、integer、default、for、function、and、nand、or、nor、xor、xnor、buf、not、bufif0、bufif1、notif0、notif1、if、inout、input、instantitation、module、negedge、posedge、operators、output、parameter。
部分综合工具支持的语句有:casex、casez、wand、triand、wor、trior、real、disable、forever、arrays、memories、repeat、task、while。
四、其他注意事项
- 尽量使用同步方式设计电路;
- 不使用循环次数不确定的循环语句,如forever、while等,forever使用固定次数的循环在DC综合时是可以综合成网表的,但是如果无限循环,综合会不支持。
- 除非是关键路径的设计,一般不采用调用门级元件来描述设计的方法,建议采用行为语句来完成设计;
- 用always过程块描述组合逻辑,应在敏感信号列表中列出所有的输入信号;
- 所有的内部寄存器都应该能够被复位,在使用FPGA实现设计时,应尽量使用器件的全局复位端作为系统的总复位;
- 对时序逻辑描述,应尽量使用非阻塞赋值方式。对组合逻辑描述,既可以用阻塞赋值,也可以用非阻塞赋值,但在同一个过程块中,最好不要同时用阻塞赋值和非阻塞赋值。
- 不能在一个以上的always过程块中对同一个变量赋值。而对同一个赋值对象不能既使用阻塞式赋值,又使用非阻塞式赋值。
- 如果不打算把变量推导成锁存器,那么必须在if语句或case语句的所有条件分支中都对变量明确地赋值。避免语句中出现latch。
- 同一个变量的赋值不能受多个时钟控制,也不能受两种不同的时钟条件(或者不同的时钟沿)控制。
- 避免在case语句的分支项中使用x值或z值。casex在一些RTL code中存在,且DC综合工具可以识别,使用casex可以减少综合出来的代码面积,但必须清楚的知道哪些可以所用x代替。casez一般不建议使用。
关于RTL综合时的工具处理方法,和其他不清楚的地方,可以在下方留言讨论。
边栏推荐
- Toolbar替换ActionBar后Title不显示
- Chinese text classification based on CNN
- 29. location對象
- Solution to the problem of PHP strtotime obtaining natural monthly error
- What is the essence and process of SCM development? Chengdu Automation Development Undertaking
- 修改本地微信小程序的AppID
- 12 date and time in R
- moderlarts第二次作业
- Windows icon display exception resolution. The desktop icon is abnormal, the start menu icon is abnormal, and the taskbar icon is abnormal. Icon cache location.
- 机器视觉工控机PoE图像采集卡应用解析
猜你喜欢

Unity package manager starting server stuck

7905 and TL431 negative voltage regulator circuit - regulator and floating circuit relative to the positive pole of the power supply

MySQL installation free configuration tutorial under Windows mysql-5.6.51-winx64 Zip version

26. 定时器

Rtd2171u, substitute for trd2171u, substitute for trd2171u, cs5261 C to hdmi4k_ 30Hz

New product release: domestic single port Gigabit network card is officially mass produced!

银泰百货与淘宝天猫联合打造绿色潮玩展,助力“碳中和”

moderlarts第一次培訓

Power supply anti reverse connection and anti backflow - use MOS tube and op amp to realize ideal diode

29. location对象
随机推荐
Deploy website traffic statistics background based on Tencent cloud lightweight application server and umami
Power supply anti reverse connection and anti backflow - use MOS tube and op amp to realize ideal diode
Implement AOP and interface caching on WPF client
Log in with password and exit with error for three times.
桌面以及文件资源管理器无限重启的解决
Compilation process of program
2022-2028 global and Chinese thermopile detector Market Status and future development trend
Application analysis of Poe image acquisition card in machine vision industrial computer
unity package manager starting server stuck(Unity启动卡在starting server,然后报错)
moderlarts第一次培訓
Rtd2171u, substitute for trd2171u, substitute for trd2171u, cs5261 C to hdmi4k_ 30Hz
2022-2028 global and Chinese thermopile array module market status and future development trend
Release of version 5.6 of rainbow, add multiple installation methods, and optimize the topology operation experience
Interviewer: what is the event flow and event model in JS?
28. JS implementation mechanism
Usage methods and cases of PLSQL blocks, cursors, functions, stored procedures and triggers of Oracle Database
[index system] the latest modeling method of data warehouse index system
Object storage of CEPH distributed storage
[unity plug-in] shader keyword analysis tool shadercontrol
Première formation sur les largeurs modernes