当前位置:网站首页>verilog 并行块实现
verilog 并行块实现
2022-07-02 03:02:00 【嗒曦】
并行块
并行块有关键字 fork 和 join 来表示。
并行块中的语句是并行执行的,即便是阻塞形式的赋值。
并行块中每条语句的时延都是与块语句开始执行的时间相关。
顺序块与并行块的区别显而易见,下面用仿真说明。
仿真代码如下:
实例
`timescale 1ns/1ns
module test ;
reg [3:0] ai_sequen, bi_sequen ;
reg [3:0] ai_paral, bi_paral ;
reg [3:0] ai_nonblk, bi_nonblk ;
//============================================================//
//(1)Sequence block
initial begin
#5 ai_sequen = 4'd5 ; //at 5ns
#5 bi_sequen = 4'd8 ; //at 10ns
end
//(2)fork block
initial fork
#5 ai_paral = 4'd5 ; //at 5ns
#5 bi_paral = 4'd8 ; //at 5ns
join
//(3)non-block block
initial fork
#5 ai_nonblk <= 4'd5 ; //at 5ns
#5 bi_nonblk <= 4'd8 ; //at 5ns
join
endmodule
仿真结果如下:
如图所示,顺序块顺序执行,第 10ns 时,信号 bi_sequen 才赋值为 8。
而并行块,ai_paral 与 bi_paral 的赋值是同时执行的,所以均在 5ns 时被赋值。
而非阻塞赋值,也能达到和并行块同等的赋值效果。
边栏推荐
- Force deduction daily question 540 A single element in an ordered array
- C shallow copy and deep copy
- CVPR 2022 | Dalian Institute of technology proposes a self calibration lighting framework for low light level image enhancement of real scenes
- Es interview questions
- QT implementation interface jump
- Unit · elementary C # learning notes
- 超图iServer rest服务之feature查询
- [JSON] gson use and step on the pit
- LeetCode刷题(十)——顺序刷题46至50
- What are the common proxy servers and what are the differences?
猜你喜欢
What kind of good and cost-effective Bluetooth sports headset to buy
图扑软件通过 CMMI5 级认证!| 国际软件领域高权威高等级认证
How to develop digital collections? How to develop your own digital collections
[learn C and fly] 1day Chapter 2 (exercise 2.2 find the temperature of Fahrenheit corresponding to 100 ° f)
连通块模板及变式(共4题)
Mongodb base de données non relationnelle
Build a modern data architecture on the cloud with Amazon AppFlow, Amazon lake formation and Amazon redshift
Just a few simple steps - start playing wechat applet
Après le mariage
Jointly developed by nailing, the exclusive functions of glory tablet V7 series were officially launched
随机推荐
CoordinatorLayout + TabLayout + ViewPager2(里面再嵌套一个RecyclerView),RecyclerView的滑动冲突解决
高并发场景下缓存处理方案
Qualcomm platform wifi-- WPA_ supplicant issue
Use the open source project [banner] to achieve the effect of rotating pictures (with dots)
How to create an instance of the control defined in SAP ui5 XML view at runtime?
MongoDB非关系型数据库
AcWing 245. Can you answer these questions (line segment tree)
Start a business
2022-2028 global deep sea generator controller industry research and trend analysis report
Websocket + spingboot realize code scanning login
结婚后
Use usedeferredvalue for asynchronous rendering
设置状态栏颜色
Build a modern data architecture on the cloud with Amazon AppFlow, Amazon lake formation and Amazon redshift
[reading notes] programmer training manual - practical learning is the most effective (project driven)
LeetCode刷题(十)——顺序刷题46至50
32, 64, 128 bit system
2022低压电工考试题模拟考试题库模拟考试平台操作
[Chongqing Guangdong education] Sichuan University concise university chemistry · material structure part introductory reference materials
小米青年工程师,本来只是去打个酱油