当前位置:网站首页>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 时被赋值。
而非阻塞赋值,也能达到和并行块同等的赋值效果。
边栏推荐
- Ten minutes will take you in-depth understanding of multithreading - multithreaded teamwork: synchronous control
- How does proxy IP participate in the direct battle between web crawlers and anti crawlers
- Golang configure export goprivate to pull private library code
- [staff] pitch representation (bass clef | C1 36 note pitch representation | C2 48 note pitch representation | C3 60 note pitch representation)
- Find duplicates [Abstract binary / fast and slow pointer / binary enumeration]
- C shallow copy and deep copy
- What are the common proxy servers and what are the differences?
- How to develop digital collections? How to develop your own digital collections
- 【无标题】
- [learn C and fly] 3day Chapter 2 program in C language (exercise 2.3 calculate piecewise functions)
猜你喜欢
Query word weight, search word weight calculation
OSPF LSA message parsing (under update)
Baohong industry | what misunderstandings should we pay attention to when diversifying investment
C shallow copy and deep copy
2022-2028 global military computer industry research and trend analysis report
GB/T-2423.xx 环境试验文件,整理包括了最新的文件里面
What kind of good and cost-effective Bluetooth sports headset to buy
小米青年工程师,本来只是去打个酱油
Mongodb base de données non relationnelle
STM32__ 05 - PWM controlled DC motor
随机推荐
32, 64, 128 bit system
What are the common proxy servers and what are the differences?
What is the difference between an intermediate human resource manager and an intermediate economist (human resources direction)?
只需简单几步 - 开始玩耍微信小程序
AcWing 245. Can you answer these questions (line segment tree)
[untitled]
【做题打卡】集成每日5题分享(第二期)
GB/T-2423.xx 环境试验文件,整理包括了最新的文件里面
Face++ realizes face detection in the way of flow
STM32__ 05 - PWM controlled DC motor
使用 useDeferredValue 进行异步渲染
Which brand of sports headset is better? Bluetooth headset suitable for sports
Feature query of hypergraph iserver rest Service
Provincial election + noi Part IV graph theory
[punch in questions] integrated daily 5-question sharing (phase II)
CoordinatorLayout + TabLayout + ViewPager2(里面再嵌套一个RecyclerView),RecyclerView的滑动冲突解决
[reading notes] programmer training manual - practical learning is the most effective (project driven)
How to turn off the LED light of Rog motherboard
Analysis of FLV packaging format
QT uses sqllite