当前位置:网站首页>Verilog parallel block implementation
Verilog parallel block implementation
2022-07-02 03:08:00 【Da Xi】
Parallel blocks
Parallel blocks have keywords fork and join To express .
Statements in parallel blocks are executed in parallel , Even blocking assignments .
The delay of each statement in a parallel block is related to the time when the block statement begins to execute .
The difference between sequential blocks and parallel blocks is obvious , Let's use simulation to illustrate .
The simulation code is as follows :
example
`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
The simulation results are as follows :

As shown in the figure , Sequential block sequential execution , The first 10ns when , The signal bi_sequen Only assigned as 8.
Parallel block ,ai_paral And bi_paral The assignment of is performed simultaneously , So they are 5ns Is assigned .
Instead of blocking assignment , It can also achieve the same assignment effect as parallel blocks .
边栏推荐
- MVVM and MVC
- New programmer magazine | Li Penghui talks about open source cloud native message flow system
- 寻找重复数[抽象二分/快慢指针/二进制枚举]
- Stack - es - official documents - filter search results
- Special symbols in SAP ui5 data binding syntax, and detailed explanation of absolute binding and relative binding concepts
- Mongodb base de données non relationnelle
- [JSON] gson use and step on the pit
- Discussion on related configuration of thread pool
- Apple added the first iPad with lightning interface to the list of retro products
- [staff] pitch representation (treble clef | C3 60 ~ B3 71 pitch representation | C4 72 pitch representation | C5 84 pitch representation)
猜你喜欢

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

Docker安装canal、mysql进行简单测试与实现redis和mysql缓存一致性

MongoDB非关系型数据库

Share the basic knowledge of a common Hongmeng application

Batch detect whether there is CDN in URL - high accuracy

About DNS

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

2022-2028 global soft capsule manufacturing machine industry research and trend analysis report

How to create an instance of the control defined in SAP ui5 XML view at runtime?

小米青年工程师,本来只是去打个酱油
随机推荐
MongoDB非关系型数据库
2022-2028 global military computer industry research and trend analysis report
/silicosis/geo/GSE184854_ scRNA-seq_ mouse_ lung_ ccr2/GSE184854_ RAW/GSM5598265_ matrix_ inflection_ demult
Qualcomm platform wifi-- WPA_ supplicant issue
结婚后
What kind of good and cost-effective Bluetooth sports headset to buy
SAML2.0 笔记(一)
Intersection of Venn graph
Websocket + spingboot realize code scanning login
QT uses sqllite
Rotating frame target detection mmrotate v0.3.1 learning model
Stdref and stdcref
Calculation of page table size of level 2, level 3 and level 4 in protection mode (4k=4*2^10)
QT environment generates dump to solve abnormal crash
GSE104154_ scRNA-seq_ fibrotic MC_ bleomycin/normalized AM3
Après le mariage
C reflection practice
JS <2>
The number one malware in January 2022: lokibot returned to the list, and emotet returned to the top
verilog REG 寄存器、向量、整数、实数、时间寄存器