zoukankan      html  css  js  c++  java
  • systemverilog:task

    1.task declaration 

      个人喜欢ANSI C格式的声明:

      task mytask(output int x,input logic y);

       ......

      endtask

    注意端口列表的方向和数据结构,容易犯错,最好每个逐一显示声明。

    2.static and automatic tasks(这个极易出错)

     2.1 所有定义在module  、 interface 、 program、 package中的task

      默认是静态task,其task中变量是静态变量,所有调用该task的程序都可以

      共享该变量。(由此可见默认大部分都是static task.不知道单独建立的task lib的 .v文件是不是static的)

    2.2automatic storage task in the following

       2.2.1 显示声明为automatic

            task automatic task_name(port list);

                ....

             endtask

       2.2.2 隐示声明,但定义task在module、program、package、interface中。 这个 systemverilog 上没看懂,貌似跟前面的2.1冲突了。

     2.3 automatic task  intems 不可以 hierarchical reference 但 automatic tasks 可以穿层调用。

    2.4

    A task may be enabled more than once concurrently. All variables of an automatic task shall be replicated on
    each concurrent task invocation to store state specific to that invocation. All variables of a static task shall be
    static in that there shall be a single variable corresponding to each declared local variable in a module
    instance, regardless of the number of concurrent activations of the task. However, static tasks in different
    instances of a module shall have separate storage from each other.
    Variables declared in static tasks, including input, output, and inout type arguments, shall retain their
    values between invocations. They shall be initialized to the default initialization value as described in 6.8.
    Variables declared in automatic tasks, including output type arguments, shall be initialized to the default
    initialization value whenever execution enters their scope. input and inout type arguments shall be
    initialized to the values passed from the expressions corresponding to these arguments listed in the task-
    enabling statements.
    Because variables declared in automatic tasks are deallocated at the end of the task invocation, they shall not
    be used in certain constructs that might refer to them after that point:
    —They shall not be assigned values using nonblocking assignments or procedural continuous
    assignments.
    —They shall not be referenced by procedural continuous assignments or procedural force statements.
    —They shall not be referenced in intra-assignment event controls of nonblocking assignments.
    —They shall not be traced with system tasks such as $monitor and $dumpvars.

  • 相关阅读:
    iOS- Swift:使用FMDB进行数据库操作(线程安全:增删改查)
    iOS- Swift:如何使用iOS8中的UIAlertController
    iOS- Swift和Object-C的混合编程
    iOS- 再谈ARC里内存问题,ARC里数组、对象内存得不到释放?
    iOS- 如何建立索引实现本地文本搜索引擎,允许容错搜索?
    iOS- 全方位解析.crash文件崩溃报告
    iOS- 关于AVAudioSession的使用——后台播放音乐
    iOS- Autolayout自动布局
    iOS- 详解如何使用ZBarSDK集成扫描二维码/条形码,点我!
    419. Roman to Integer【medium】
  • 原文地址:https://www.cnblogs.com/chip/p/4331384.html
Copyright © 2011-2022 走看看