Verilog之event
1 Explicit event
The value changes on nets and variable can be used as events to trigger the execution of a statement.
The event can also be based on the direction of the change that is, towards the value 1 ( posedge) or towards the value 0 (negedge).
- A negedge shall be detected on the transition from 1 to x, z, or 0, and from x or z to 0
- A posedge shall be detected on the transition from 0 to x, z, or 1, and from x or z to 1
@(trig or enable) rega = regb; // event "or" is the same as ","
@(trig, enable) rega = regb; @(posedge clk_a or posedge ck_b or trig) rega = regb; always @(a, b, c, d, e)
always @(posedge clk, negedge rstn)
always @(a or b, c, d or e)
2 Implicit event
// Example 1
always @(*) // equivalent to @(a or b or c or d or f)
y = (a & b) | (c & d) | myfunction(f); // Example 2
always @* begin // equivalent to @(a or b or c or d or tmp1 or tmp2)
tmp1 = a & b;
tmp2 = c & d;
y = tmp1 | tmp2;
end // Example 3
always @* begin // equivalent to @(b)
@(i) kid = b; // i is not added to @*
end // Example 4
always @* begin // equivalent to @(a, b, c, d)
x = a ^ b;
@*
x = c ^ d;
end
Verilog之event的更多相关文章
- Verilog之event的用法
编写verilog的testbench时,可使用event变量触发事件. event变量声明为: event var; event触发为: ->var; 捕获触发为: @(var); 在mode ...
- verilog FAQ(zz)
1. What is the race condition in verilog? Ans :The situation when two expressions are allowed to exe ...
- verilog断言(SVA:systemverlog assertion)语法 ---- 转载
转载自:http://blog.sina.com.cn/s/blog_4c270c730101f6mw.html 作者:白栎旸 断言assertion被放在verilog设计中,方便在仿真时查 ...
- Verilog篇(二)系统函数
显示任务:$display,$write, 前者总会输出一个换行符,后者不会.固定输出格式版:$displayb/$displayo/$displayh/$writeb/$writeo/$writeh ...
- Verilog杂谈
1. Testbech总是用reg去驱动DUT的input端口,因为需要在仿真期间设置和保持输入端的值(例如在initial中设置初值,在always中设置激励值): 2. 避免对局部reg在定义时赋 ...
- Verilog Tips and Interview Questions
Verilog Interiew Quetions Collection : What is the difference between $display and $monitor and $wr ...
- 对Verilog 初学者比较有用的整理(转自它处)
*作者: Ian11122840 时间: 2010-9-27 09:04 ...
- (转帖) 有限狀態機FSM coding style整理 (SOC) (Verilog)
来源:http://www.codesoso.net/Record/101092_95120_21.html 来源:http://www.cnblogs.com/oomusou/archive/201 ...
- 不可综合的verilog语句分析
前半部分转自http://www.cnblogs.com/Mrseven/articles/2247657.html,后半部分为自己测试结果. 基础知识:verilog 不可综合语句 (1)所有综合工 ...
随机推荐
- linux 下使用genymotion
在官网下载genymotion http://www.genymotion.cn/ 然后进行下面操作 1.假设本机没有virtualbox 下载一个 能够通过指令 sudo apt-get inst ...
- RelativeLayout不能居中的解决的方法
在LinearLayout中有个让元素居中的办法就是.比方在LinearLayout里有个TextView.设置TextView的gravity能够让其居中. 而在Realative里设置这个不起作用 ...
- Redis集群主备模式部署
网上有非常多用Ruby安装Redis-cluster的文章.可是在实际环境下不想安装Ruby,所以本文主要介绍了用Redis命令部署Redis集群.而且为集群中每个master实例添加一个slave实 ...
- HDU4930-Fighting the Landlords
题意:斗地主,就是要自己出牌.使得对手在这一轮无法出牌,或者有出牌的可能.可是你的牌已经走完了.假设符合这些条件的话,输出Yes.否则输出No. 思路:先预处理能直接把牌走完的情况,假设不行的话就直接 ...
- Unix/Linux 软件安装
Unix/Linux 软件安装 首先我们明确.在Unix like的机器上,一套软件并不唯独一个程序,而是一堆程序代码文件. 比如main.c,haha.c,sin_value.c这三个源码文件. 1 ...
- cesm下载备注
新版使用svn下载. 软件要求: The following are the external system and software requirements for installing and ...
- mciSendString详解(转)
做个mp3播放器,用realplay和WMP做出来的程序内存占用太大.如果你仅仅是播放MP3,建议使用API函数mciSendString,我把该函数的详细资料罗列如下供你参考.Option Expl ...
- 【bzoj1787】&【bzoj1832】[Ahoi2008]Meet 紧急集合 & 聚会
bzoj1787就是bzoj1832 bzoj1832 空间和时间少了一些... 求三个结点到一个结点距离之和最小的结点以及距离和 求出两两lca,其中有两个相同,答案则为另一个 感觉就是一大暴力.. ...
- 【转】React 常用面试题目与分析
作者:王下邀月熊链接:https://zhuanlan.zhihu.com/p/24856035来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处. 本文有一定概率为水文,怕 ...
- T4 最小差异值 dvalue
T4 最小差异值 dvalue [问题描述] P 省刚经历一场不小的地震,所有城市之间的道路都损坏掉了,所以省长想请你将城市之间的道路重修一遍. 因为很多城市之间的地基都被地震破坏导致不能修公路了,所 ...