RE: [sv-bc] RE: Can a function contain a fork/join/any/none?

From: Steven Sharp <sharp_at_.....>
Date: Tue Mar 21 2006 - 19:06:30 PST
I wrote earlier:

>An implementation could get itself into trouble if it went too far
>in suspending function execution.

I looked back at one of Phil Moorby's emails in this thread, and found
that he wrote something similar:

>Functions in Verilog were designed to be different from tasks for one
>very good reason: it was necessary for the evaluation of expressions to
>complete and have their value returned within a single evaluation step.
>In other words, the simulator must not context switch to other events
>until it finishes evaluating the expression and obtains the result.
>Functions and function calls must therefore be restricted and not allow
>their returning thread to block. With this restriction, blocking can
>only occur at a statement level, never at an expression operand level.
>This restriction reduces potential non-deterministic situations, and
>enables the simulator to optimize its runtime code.

So the original intent was that functions should not context switch
during evaluation, even though the LRM does not restrict it.

Steven Sharp
sharp@cadence.com
Received on Tue Mar 21 19:06:36 2006

This archive was generated by hypermail 2.1.8 : Tue Mar 21 2006 - 19:06:42 PST