当前位置:网站首页>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 .

边栏推荐
- RHCE first day
- In depth understanding of pre post + +, -- and negative modulus
- VIM search and replacement and the use of regular expressions
- Performance Optimization: lazy loading of pictures
- STL notes (IV): String
- Unity中使用UniRx入门总结
- 微服务 - 远程调用(Feign组件)
- "Niuke | daily question" inverse Polish expression
- STL notes (VII): container deque
- Three must know and know problems of redis
猜你喜欢
随机推荐
The second day of rhcsa summer vacation
ping命令
Implement is by yourself_ class
Shenzhen on call test, subject 4 on call test, subject 3 theory, second theory on call test instructions
Solve the problem that uni app applet obtains routes and route parameters
[cloud co creation] design Huawei cloud storage architecture with the youngest cloud service hcie (Part 1)
systemverilog中function和task区别
使用getifaddrs获取本机网口IP地址
Introduction to kubernetes
Introduction to base ring tree
Redis集群搭建(Windows)
SystemVerilog中interface(接口)介绍
odoo14 | 关于状态栏statusbar关键词使用后显示异常及解决方法
C编程 --“最大子数组的和” 的动态规划的解法
一篇文章带你读懂Redis的哨兵模式
Browser cache HTTP cache CDN cache localstorage / sessionstorage / cookies
Interface idempotency
1310_一个printf的实现分析
Typera+picgo+ Alibaba cloud OSS setup and error reporting solution [reprint]
How to carry out the function test with simple appearance and complex interior?







