当前位置:网站首页>The difference between function and task in SystemVerilog
The difference between function and task in SystemVerilog
2022-07-25 05:24:00 【Cored】
1. function
- The default data type is logic Input ;
- It can be passed as a formal parameter ;* function You can return or not return the result , You need keywords when returning return, Do not return. Use void function();
- Only data variables can be declared as... In the formal parameter list ref type , The network type cannot be declared ref;
- function Cannot call task(v Specified in the ),sv In particular fork…join_none Call in task;
- function If the parameter in the parameter list is not marked with direction , The default is input signal input;
2. task
- You can specify input output inout ref( reference parameter );
- You can return a value or not (void), But through output、inout or ref To specify the return value , Out of commission return return ;
- The default type is logic Input ;
- characteristic :
- task Unable to get return Return results , Output only (output inout) perhaps ref To return .
- task Time consuming statements can be placed in , and function no way . Common time-consuming statements @event 、wait event 、 #delay
explain :
To be called function, Then use function task All possible ;
To be called task, Only use task call .

边栏推荐
- 批量下载视频小技巧
- 基环树入门
- The third question of force deduction -- the longest substring without repeated characters
- Shenzhen on call test, subject 4 on call test, subject 3 theory, second theory on call test instructions
- ping命令
- Render Optimization: repaint and reflow
- Implement is by yourself_ base_ of
- Bypass XSS filters in Web Applications
- Project management tool - Introduction and practice of Alibaba cloud projex
- 接口幂等性
猜你喜欢

FinClip实现微信授权登录的三种方案

微信小程序相关操作示例

1310_一个printf的实现分析

Single sign on (one sign on, available everywhere)

微服务 - Hystrix 熔断器
![2022-07-24: what is the output of the following go language code? A:[]int{}; B:[]int(nil); C:panic; D: Compilation error. package main import ( “fmt“ ) f](/img/bf/e38a8fd813f88a83f61a1abfa3b95d.png)
2022-07-24: what is the output of the following go language code? A:[]int{}; B:[]int(nil); C:panic; D: Compilation error. package main import ( “fmt“ ) f

项目管理工具——项目开发者工具

Delivery practice of private PAAS platform based on cloud native

Performance Optimization: how to solve the slow loading speed of the first screen of spa single page application?

Go language function
随机推荐
TCL shows a number of folding screen mobile phones: the screen and hinge are independently developed!
Browser cache HTTP cache CDN cache localstorage / sessionstorage / cookies
DOM在Ahooks中的处理过程
Learning records [email protected] R & D effectiveness measurement indicators
How to judge whether it is attacked by DDoS
06. Libavdevice Library of ffmpeg
Interface idempotency
Seven suggestions for Server Protection
Odoo14 | about the abnormal display of statusbar keyword after use and Its Solutions
使用getifaddrs获取本机网口IP地址
Wechat applet related operation examples
Project management tool - Introduction and practice of Alibaba cloud projex
rhce第一天
自己实现is_convertible
LCP插件创建对等802.1ad接口
STL notes (VI): container vector
Introduction to base ring tree
Deep error
Application of hard coding and streaming integration scheme based on spice protocol in cloud games
剑指offer专项突击版第9天