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)所有综合工 ...
随机推荐
- jquery 联动 年月日
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>JQuery实例 - 生成年 ...
- Java算法-奇怪的分式
题目: 上小学的时候,小明常常自己发明新算法.一次,老师出的题目是: 1/4 乘以 8/5 小明竟然把分子拼接在一起,分母拼接在一起,答案是:18/45 老师刚想批评他.转念一想.这个答案凑巧也对啊, ...
- Hdu2111
<span style="color:#6600cc;">/* J - Saving HDU Time Limit:1000MS Memory Limit:32768K ...
- CF#315 C
#include <cstdio> #include <iostream> #include <algorithm> #include <queue> ...
- 并不对劲的spoj nsubstr
题意是求一个字符串每个长度的子串出现次数最多的那个出现了多少次,也就是求每个到根的最长路的right集合最大值 . 先建后缀自动机,然后将每个前缀所在的集合的初值设为1,因为所有前缀的right集合肯 ...
- [Codeforces 1037E] Trip
[题目链接] http://codeforces.com/problemset/problem/1037/E [算法] 首先离线 , 将问题倒过来考虑 , 转化为 : 每次删除一条边 , 此时最多有多 ...
- Java中wait和sleep方法的区别
1.两者的区别 这两个方法来自不同的类分别是Thread和Object 最主要是sleep方法没有释放锁,而wait方法释放了锁,使得其他线程可以使用同步控制块或者方法(锁代码块和方法锁). wait ...
- 全分布式的Hadoop虚拟机安装
在集群环境下装机.配置.运行的全过程,梳理总结到本文中. 第一部分:环境规划 •用户 hadoop 密码 hadoop •机器 机器名称 IP地址 Master.Hadoop 192.168.1.10 ...
- MyBatis高级查询 存储过程
1.第一个存储过程 根据用户id查询用户其他信息 #第一个存储过程 #根据用户id查询用户其他信息 DROP PROCEDURE IF EXISTS `select_user_by_id`; DEL ...
- POJ 2452 Sticks Problem (暴力或者rmq+二分)
题意:给你一组数a[n],求满足a[i] < a[k] < a[j] (i <= k <= j)的最大的 j - i . 析:在比赛时,我是暴力做的,虽然错了好多次,后来说理解 ...