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.

systemverilog:task的更多相关文章

  1. systemverilog FAQ(zz)

    1. What is clocking block? Ans: Clocking block can be declared using the keywords clocking and endcl ...

  2. SystemVerilog 带输出的task

    1.task 的定义,输出定义为数组. /*- genRndPkt(): Generates random packet with the given length.*/ task genRndPkt ...

  3. systemverilog.vim

    " Vim syntax file " Language: SystemVerilog " Maintainer: Stephen Hobbs <stephenh@ ...

  4. systemverilog的高亮显示

    1. 在_vimrc文件末尾添加: syntax on "确定vim打开语法高亮 filetype on "打开文件类型检测 filetype plugin on "为特 ...

  5. vivado对task和function的可综合支持

    手册UG901,对vivado可综合的语句支持进行了描述,HDL包括:verilog-2001,system-verilog,VHDL: verilog-2001扩展了对task和function的支 ...

  6. systemverilog interface杂记

    随着IC设计复杂度的提高,模块间互联变得复杂,SV引入接口,代表一捆连线的结构. Systemverilog语法标准,新引入一个重要的数据类型:interface. interface主要作用有两个: ...

  7. systemverilog之OOP

    what is oop terminology an example class default methods for classes static attibute assigment and c ...

  8. 第三章:systemverilog文本值和数据类型

    1.增强的文本值 2.改进的`define文本替换 3.时间值 4.新的变量类型 5.有符号和无符号类型 6.静态和动态变量(***) 7.类型转换 8.常数 增强的文本值(文本赋值增强) 主要是:位 ...

  9. 第二章:systemverilog声明的位置

    1.package 定义及从package中导入定义(***) verilog中,对于变量.线网.task.function的声明必须在module和endmodule之间.如果task被多个modu ...

随机推荐

  1. IT兄弟连 JavaWeb教程 Servlet 状态管理 会话跟踪

    HTTP协议是无状态的,我们的客户端与服务器的每一次请求与响应,我们服务器都没有记忆能力将客户端与服务器的多次交互数据进行存储与管理共有两种技术实现: ●  基于客户端实现:Cookie,将状态保存在 ...

  2. IT兄弟连 JavaWeb教程 重定向

    HTTP协议规定了一种重定向机制,重定向的运作流程如下: ●  用户在浏览器端输入特定URL,请求访问服务器端的某个组件. ●  服务器端的组件返回一个状态码为302的响应结果,该响应结果的含义为: ...

  3. Angular 项目开发中父子组件传参

    在项目开发中经常会遇到 组件之间传参的问题.今天总结下在使用angular的项目中父子组件传参的问题: 1.父组件向子组件传参: 然后在父组件中 然后在父组件的html中 然后就可以在子组件中使用了 ...

  4. PTA天梯赛训练题L1-064:估值一亿的AI核心代码(字符串模拟)

    Update:smz说regex秒过Orz,yzd记在这里了. 听说今年天梯赛有个烦人的模拟,我便被队友逼着试做一下……一发15,二发20.记一记,要不然枉费我写这么久…… 自己还是代码能力太菜了,校 ...

  5. redirect与forward的区别

    文件名称:forward.jsp <html> <head><title> 跳转 </title> </head> <body> ...

  6. Cocos工作两周感受

    我是一个专注搞Unity开发的程序猿哈哈,但是最近的项目要采用Cocos引擎开发.在迷茫和学习成长中已经不知不觉过了两周.我就简单谈谈我这两周学习Cocos的一个感受. 具体说公司是采用js语言来开发 ...

  7. 学习Python的day1

    自己以前从来没有写博客的想法,但是学Python,里面的老师也说了,写博客可以加深自己的记忆,也能回顾内容.还能给别人参考.挺值的.2017-09-16 一. Python介绍 python的创始人为 ...

  8. JAVA设计模式--Strategy

    策略模式就是说当我进行比较大小的时候定义一个策略的比较器Comparator,然后由具体的比较策略来决定用什么量来比较大小.

  9. 做OJ项目时遇到的坑

    1.js代码写在Dom加载前,导致highcharts在ie8能够显示,而ie高版本和其他浏览器不能显示 我的理解:由于IE8和其他浏览器的js解析机制不同,ie8是在等dom全部加载完才开始执行js ...

  10. 秒杀Sublime Text的微软开源代码编辑工具Visual Studio Code

    1. 下载链接: https://code.visualstudio.com/ 2. 秒开一个ASP.NET网站源码 3.编辑CSS颜色支持 4.Git支持 5.常用快捷键 Ctrl+Shift+P ...