当前位置:网站首页>systemVerilog中automatic用法
systemVerilog中automatic用法
2022-07-25 05:20:00 【向芯】
//有 "automatic"
module tryfact;
// define the function
function automatic integer factorial (input [31:0] operand);
if (operand >= 2)
factorial = factorial (operand - 1) * operand;
else
factorial = 1;
endfunction: factorial
// test the function
integer result;
initial begin
for (int n = 0; n <= 7; n++) begin
result = factorial(n);
$display("%0d factorial=%0d", n, result);
end
end
endmodule: tryfactThe simulation results are as follows:
0 factorial=1
1 factorial=1
2 factorial=2
3 factorial=6
4 factorial=24
5 factorial=120
6 factorial=720
7 factorial=5040
//没有automic
The simulation results are as follows:
0 factorial=1
1 factorial=1
2 factorial=1
3 factorial=1
4 factorial=1
5 factorial=1
6 factorial=1
7 factorial=1
简单的说:如果声明为automic的函数,任务,则支持迭代,否则不支持.
边栏推荐
- Add click event to unity 3D object
- VIM search and replacement and the use of regular expressions
- Redis集群搭建(Windows)
- Now the operator wants to check the answer details of all user questions from Zhejiang University. Please take out the corresponding data
- JWT(json web token)
- The second day of rhcsa summer vacation
- Browser cache HTTP cache CDN cache localstorage / sessionstorage / cookies
- Which website is suitable for physical server
- Harbor installation
- STL notes (I): knowledge system
猜你喜欢

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

Introduction to base ring tree

Special analysis of data security construction in banking industry
搭建私有CA服务器

微服务 - 远程调用(Feign组件)

1310_ Implementation analysis of a printf

Small case of data analysis: visualize recruitment data and view the most needed technologies in the field~
![[globally unique ID] how to handle the ID primary key after dividing the database and table?](/img/a1/800ee868b74ce5d98956d4a0e2c075.png)
[globally unique ID] how to handle the ID primary key after dividing the database and table?

教你三招从让性能从20s优化到500ms

Permanent magnet synchronous motor 36 question (1) -- what is the difference between salient pole motor and salient pole motor?
随机推荐
Preliminary understanding of Panda3D particle system
Powering 5g notebook market, Wentai technology joined the "Honghu plan"
龙蜥社区发布首个 Anolis OS 安全指南 为用户业务系统保驾护航
Unity LOD
05. Libavformat Library of ffmpeg
Pikachu vulnerability platform exercise
STM32 Development Notes 121: Kalman filter I understand
VPP不能加载UP状态接口
Docker builds MySQL master-slave replication
Performance Optimization: lazy loading of pictures
Performance Optimization: how to solve the slow loading speed of the first screen of spa single page application?
单点登录(一处登录,处处可用)
nacos中哪边有这个列的sql脚本啊?
Zhanrui's first 5g baseband chip was officially released and successfully ranked among the first tier of 5g!
Deep error
Matter's Unified Smart Home connection standard enables local automatic interaction between smart devices
RHCE first day
Shenzhen on call test, subject 4 on call test, subject 3 theory, second theory on call test instructions
微信小程序相关操作示例
1310_ Implementation analysis of a printf