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

  

时间: 2024-07-31 14:30:25

Verilog之event的相关文章

C#学习日记24----事件(event)

事件为类和类的实例提供了向外界发送通知的能力,实现了对象与对象之间的通信,如果定义了一个事件成员,表示该类型具有 1.能够在事件中注册方法 (+=操作符实现). 2.能够在事件中注销方法(-=操作符实现). 3.当事件被触发时注册的方法会被通知(事件内部维护了一个注册方法列表).委托(Delegate)是事件(event)的载体,要定义事件就的要有委托.  有关委托的内容请点击 委托(De... www.mafengwo.cn/event/event.php?iid=4971258www.maf

Verilog HDL的不同抽象级别1

用门级结构描述D触发器,实例如下: 由已经设计好的模块构成更高一级的模块,用触发器组成代清零端的4位寄存器代码和实验结果如下: module flop(data,clock,clear,q,qb);input data,clock,clear;output q,qb; nand #10 nd1(a,data,clock,clear), nd2(b,ndata,clock), nd4(d,c,b,clear), nd5(e,c,nclock), nd6(f,d,nclock), nd8(qb,q,

关于verilog中语句可不可综合

1)所有综合工具都支持的结构: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.     (2

对Verilog 初学者比较有用的整理(转自它处)

对Verilog 初学者比较有用的整理(转自它处) ******************************************************************************************************************** *作者: Ian11122840    时间: 2010-9-27 09:04                                                                   

verilog断言(SVA:systemverlog assertion)语法 ---- 转载

转载自:http://blog.sina.com.cn/s/blog_4c270c730101f6mw.html 作者:白栎旸 断言assertion被放在verilog设计中,方便在仿真时查看异常情况.当异常出现时,断言会报警.一般在数字电路设计中都要加入断言,断言占整个设计的比例应不少于30%.以下是断言的语法: 1. SVA的插入位置:在一个.v文件中: module ABC (); rtl 代码 SVA断言 endmodule 注意:不要将SVA写在enmodule外面. 2. 断言编写

verilog behaviral modeling -- procedural timing contronls

1.delay control : an expression specifies the time duration between initially encountering the statement and when the statement actually executes. the delay expressiong can be dynamic function of the state of the circuit,but it can be a simple number

verilog状态机

如下是官网quartus的帮助文档中的说明. A state machine is a sequential circuit that advances through a number of states. By default, the Quartus II software automatically infers state machines in your Verilog HDL code by finding variables whose functionality can be

verilog 不可综合语句

最近在温习Verilog,让可综合不可综合搞得头大.在网上发现了这篇文章,整理的非常整齐. 转自http://bbs.ednchina.com/BLOG_ARTICLE_1770084.HTM 基础知识:verilog 不可综合语句  (1)所有综合工具都支持的结构:always,assign,begin,end,case,wire,tri,aupply0,supply1,reg,integer,default,for,function,and,nand,or,nor,xor,xnor,buf,

UART.V (verilog)

`timescale 1ns / 1ps // Documented Verilog UART // Copyright (C) 2010 Timothy Goddard ([email protected]) // Distributed under the MIT licence. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and