当前位置:网站首页>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的函数,任务,则支持迭代,否则不支持.
边栏推荐
- Implement is by yourself_ class
- Leetcode 15: sum of three numbers
- In depth understanding of pre post + +, -- and negative modulus
- Thesis reading | which is the best multilingual pre training technology for machine translation? See the latest progress!
- Event cycle mechanism browser nodejs async await execution sequence promise execution sequence interview questions
- 搭建私有CA服务器
- Solve the problem that uni app applet obtains routes and route parameters
- four hundred and forty-four thousand one hundred and forty-one
- China trifluoroethanol industry research and investment forecast report (2022 Edition)
- What content does the software test plan include and how to write it. Share test plan template
猜你喜欢

The third day of rhcsa summer vacation

Redis cluster setup (Windows)
![[untitled]](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[untitled]

What about reinstalling win11 system?

Implementation principle of epoll

Now the operator wants to check the answer details of all user questions from Zhejiang University. Please take out the corresponding data

微服务 - Hystrix 熔断器

Browser cache HTTP cache CDN cache localstorage / sessionstorage / cookies

HMS core discovery Episode 16 live broadcast preview | play AI's new "sound" state with tiger pier

项目管理工具——项目开发者工具
随机推荐
[globally unique ID] how to handle the ID primary key after dividing the database and table?
Event cycle mechanism browser nodejs async await execution sequence promise execution sequence interview questions
Powering 5g notebook market, Wentai technology joined the "Honghu plan"
js 页面增加过渡层
龙蜥社区发布首个 Anolis OS 安全指南 为用户业务系统保驾护航
Render Optimization: repaint and reflow
1310_ Implementation analysis of a printf
05. Libavformat Library of ffmpeg
I have seven schemes to realize web real-time message push, seven!
Special analysis of data security construction in banking industry
Seven suggestions for Server Protection
STL notes (II): template and operator overloading
LeetCode 15:三数之和
一篇文章带你读懂Redis的哨兵模式
Pikachu vulnerability platform exercise
Deep error
LCP插件创建对等802.1ad接口
1310_一个printf的实现分析
接口幂等性
deep报错