Continue to Site

Welcome to EDAboard.com

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.

Some advices or examples about fork...join!

Status
Not open for further replies.

Thomson

Full Member level 3
Joined
Oct 15, 2004
Messages
181
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,298
Activity points
2,400
Does anybody have some advices or examples about the usage of fork...join?

More specific, better it is!

Thanks in advance!

Thomson
 

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
 

fork - join statements are used to model concurrent processes in nonsynthesizable code.

in general, fork - join blocks are used in verification models.

Added after 22 seconds:


fork - join statements are used to model concurrent processes in nonsynthesizable code.

in general, fork - join blocks are used in verification models.
 

Hi, Mediative and Anjali

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?


Thanks in advance!


Thomson
 

junchaoguo51888 said:
whether fork ...join and task can perform the same function?

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.

Thomson
 

its all about achieving concurrency in statements, as initial statement is for sequential logic.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top