zoukankan      html  css  js  c++  java
  • 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

      

  • 相关阅读:
    獲取XML文檔節點的值
    Asp.net之数组应用
    读写XML文档
    C#区分中英文统计字符串的长度
    vs2005常用快捷键
    基础知识
    中国的十二生肖原来还代表着对人品格的要求
    学习OO思想
    改变系统时间c#
    用C#创建各种类型的wave文件
  • 原文地址:https://www.cnblogs.com/mengdie/p/4684144.html
Copyright © 2011-2022 走看看