Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Groups statements into a parallel block, so that they are executed concurrently.
Syntax
fork [ : Label
[Declarations...]]
Statements...
join
Declaration = {either} Register Parameter Event.
Rules
A fork-join block must contain at least one tatement.
Statements in a fork-join block are executed concurrently. The order of statements within a fork-join block does not matter. Timing controls are
relative to the time at which the block was entered. A fork-join block completes when all included statements have been completed. Begin-end and fork-join blocks may be nested within themselves and each other.
If a fork-join block is to contain local declarations, it must be named (i.e. it must have a label).
If a fork-join block is to be disabled, it must be named. Not synthesizable.
Tips
Fork-join statements are useful for describing stimulus in a concurrent
fashion.
Example
initial
fork : stimulus
#20 Data = 8'hae;
#40 Data = 8'hxx; // This is executed last
Reset = 0; // This is executed first
#10 Reset = 1;
join // Completes at time 40
What both of you said was right, but I am a little confused about how to correctly apply them in the verification environment effectively.
Currently I've used this block to architec one bus protocol sequence example, and found it was quite efficiently comprard with that was implemented by RTL FSM or other behavioral structure. The code size, you may say, was the least one, to realize such same functionality using Verilog!
If you have some examples on this topic, can you share with me?
Yes! In fact, i've always utilized the synchronization schemes using tasks instead of fork...join. Of course, the previous tasks have a poorer quality compared with the latter.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.