verilog 学习记(如何编写assert)
来源:互联网 发布:淘宝易轩数码靠谱吗 编辑:程序博客网 时间:2024/04/28 14:26
【 声明:版权所有,欢迎转载,请勿用于商业用途。 联系信箱:feixiaoxing @163.com】
我们在编写c代码的时候,一般测试的时候都要用assert进行判断。那么怎么在verilog中进行assert判断呢?大家知道,system verilog是包含有assert语句的,但是raw verilog没有。既然verilog 没有,那么我们可以自己定义一个module,一样可以实现assert的功能。今天在网上看到别人的描述,自己写了一段类似的代码,和大家一起分享一下。希望对大家有所帮助。
// author : feixiaoxing// date : 2017_01_19// history://module assert(clk, in);// input & outputinput clk;input in;// wire & reg;wire clk;wire in;// inner wire & reg/* none */// always clause defined herealways @(posedge clk)beginif(in !== 1)begin$display("assert happened in %m\n");$finish;endendendmodule
1 0
- verilog 学习记(如何编写assert)
- Verilog状态机的编写学习
- 如何学习verilog
- verilog学习记(时序电路)
- verilog学习记(加法器)
- Welcome To Verilog (verilog 学习)
- verilog学习记(开头篇)
- verilog学习记(快速入门)
- verilog学习记(测试和验证)
- verilog代码编写风格(他人整理)
- assert()函数如何使用?
- Verilog、FPGA学习(一)
- Verilog HDL 学习(一)
- Verilog HDL学习(二)
- verilog学习笔记(一)
- Verilog学习笔记(四)
- Verilog学习笔记(五)
- verilog 学习记(mac安装iverilog和gtkwave)
- 为什么我们需要uCos?带你透彻理解RTOS
- C++ AMP异构并行编程解析
- 学习笔记——用引用操纵对象
- 文章标题 HDU 3172 : Virtual Friends (并查集+map)
- Android官方MVP架构示例项目解析
- verilog 学习记(如何编写assert)
- ATOM编辑器快捷键大全
- CSS3之线条特效(鼠标悬停线条从中间变长)
- Mechanize模拟浏览器
- [玲珑杯#Round5]Grid Point 拉格朗日插值
- 华为机试在线训练-牛客网(4)质数因子
- 开发unity插件——一次搞定unity编辑器常用功能
- BZOJ 1036: [ZJOI2008]树的统计Count 树链剖分
- BZOJ 1455: 罗马游戏 左偏树 or pb_ds