当前位置:网站首页>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 时被赋值。
而非阻塞赋值,也能达到和并行块同等的赋值效果。
边栏推荐
- Qualcomm platform wifi-- WPA_ supplicant issue
- 连通块模板及变式(共4题)
- Xiaomi, a young engineer, was just going to make soy sauce
- [punch in questions] integrated daily 5-question sharing (phase II)
- Provincial election + noi Part IV graph theory
- 2022-2028 global military computer industry research and trend analysis report
- LeetCode刷题(十)——顺序刷题46至50
- 小米青年工程师,本来只是去打个酱油
- Discussion on related configuration of thread pool
- QT uses sqllite
猜你喜欢

LFM signal denoising, time-frequency analysis, filtering
![[reading notes] programmer training manual - practical learning is the most effective (project driven)](/img/13/28116a74512895ad725dffed02f8bd.png)
[reading notes] programmer training manual - practical learning is the most effective (project driven)

Special symbols in SAP ui5 data binding syntax, and detailed explanation of absolute binding and relative binding concepts

【JVM】创建对象的流程详解
![[staff] pitch representation (bass clef | C1 36 note pitch representation | C2 48 note pitch representation | C3 60 note pitch representation)](/img/98/956d8abbccceb1aae47e25825bc63d.jpg)
[staff] pitch representation (bass clef | C1 36 note pitch representation | C2 48 note pitch representation | C3 60 note pitch representation)

New programmer magazine | Li Penghui talks about open source cloud native message flow system

How to run oddish successfully from 0?

Missing numbers from 0 to n-1 (simple difficulty)

使用 useDeferredValue 进行异步渲染

超图iServer rest服务之feature查询
随机推荐
连通块模板及变式(共4题)
[reading notes] programmer training manual - practical learning is the most effective (project driven)
Baohong industry | four basic knowledge necessary for personal finance
Kibana controls es
What kind of good and cost-effective Bluetooth sports headset to buy
Multi threaded query, double efficiency
批量检测url是否存在cdn—高准确率
Is bone conduction earphone better than traditional earphones? The sound production principle of bone conduction earphones is popular science
A list of job levels and salaries in common Internet companies. Those who have conditions must enter big factories. The salary is really high
Calculation of page table size of level 2, level 3 and level 4 in protection mode (4k=4*2^10)
使用 useDeferredValue 进行异步渲染
[staff] diacritical mark (ascending sign | descending sign B | double ascending sign x | double descending sign BB)
Connected block template and variants (4 questions in total)
图扑软件通过 CMMI5 级认证!| 国际软件领域高权威高等级认证
4. Find the median of two positive arrays
Use usedeferredvalue for asynchronous rendering
LeetCode刷题(十)——顺序刷题46至50
Force deduction daily question 540 A single element in an ordered array
Query word weight, search word weight calculation
2022 hoisting machinery command examination paper and summary of hoisting machinery command examination