B04 - Re-Entrant Tasks

From: Adam Krolnik (adamk@cyrix.com)
Date: Thu Jul 23 1998 - 23:52:57 PDT


- B04 - DRAFT -

B04: Re-Entrant Tasks - Cliff Cummings

<p>The task BNF in section A.2 does not match the task BNF in section 10.2.1
The BNF in section 10.2.1, Syntax 10-1 is correct and should be replicated
in the A.2 BNF.

Proposal: In section A.2, change task_argument_declaration to
task_item_declaration.

Proposal: In section A.2, add "| input_declaration" to the
task_item_declaration list. The complete list should be:

task_item_declaration :: =
          block_item_declaration
        | input_declaration
        | output_declaration
        | inout_declaration

<p>B04: Re-Entrant Tasks
Action Item - Cliff to do the BNF and send for examination
Action Item - Elliott to investigate events on automatic variables - events
on automatic variables shall be permitted (internal to the task - at the
same scope - no hierarchical reference)
Action Item - Cliff to contact Tektronix about synthesizable recursive
structures
Important restrictions:

Comments:

  1. There is no way to define the return value of a function to be automatic
     and not define all task item declarations to be automatic.
  2. Why would you declare a function as automatic and not use it recursively?

Proposal:

Section 10.2.1

Rewrite as:

"The task declaration shall begin with the keyword task, followed by the optional
keyword automatic, followed by a name for the task and a semicolon, and
ending with the keyword endtask. The keyword automatic declares an automatic
task that is reentrant with all the task declarations allocated dynamically
for each concurrent task entry. Task item declarations can specify the following:"

Add these lines to the next bullet list.

    automatic input arguments
    automatic output arguments
    automatic inout arguments
    automatic data types

<p>"These declarations have the same syntax as the corresponding declarations in a module definition (see Section 12.) You can optionally declare any declaration to
be automatic independent of the other declarations. Tasks without the optional
keyword are static tasks, with all non automatic declarations being statically allocated. These declarations will be shared across all uses of the task executing
concurrently. Specifying an automatic task and automatic declarations (including
the optional keyword automatic with the task definition and the task item declarations)
is considered redundant. Automatic task items and all items of an automatic
task are not referenceable by hierarchical references. Automatic tasks can be invoked through use of their hierarchical name."

Section 10.2.3

"A task may be enabled more than once concurrently. Registers declared automatic and
all registers of an automatic task shall be replicated on each concurrent task
invocation to store state specific to that invocation. Registers declared static
(not automatic) for a static task shall be static in that there shall be a single
register corresponding to each declared local register, regardless of the number
of concurrent activations of the task."

Delete last paragraph.

Section 10.3.1

"The function declaration shall begin with the keyword function, followed by
the optional keyword automatic, followed by the range of type of the
return value from the function, followed by the name of the function and
a semicolon, and shall end with the keyword endtask.
The keyword automatic declares a recursive function with all the function
declarations allocated dynamically for each recursive call.
Automatic function items and all items of a recursive function are not referenceable by hierarchical references. Recursive functions can be invoked through use of their hierarchical name."

<p>Rewrite the function 'factorial' in the example as:

function automatic integer factorial;
  input [31:0] operand;
  integer i;
  if (operand >= 2)
    factorial = factorial(operand - 1) * operand;
  else
    factorial = 1;
endfunction

<p>Section 11, Disabling of named blocks and tasks.
last paragraph before the examples, add

"Disabling an automatic task will terminate all concurrent executions of the task.
Disabling a block inside an automatic task will terminate all concurrent executions
of that block."

Section 12.4 Hierarchical names.
last paragraph before the examples, add to end of first sentence:

" with the exception of items of automatic tasks and automatic task item declarations.
These declarations are not referenceable by their hierarchical names."

<p><p>A.2 Declarations

<add>
list_of_ event_identifiers ::= event_identifier { , event_identifier } ;

<change>
event_declaration ::= event list_of_event_identifiers ;

[NOTE: B14 must be incorporated in these declarations! - not done here!]

<add>
task_input_declaration ::= input [ automatic ] list_of_port_identifiers ;
task_output_declaration ::= output [ automatic ] list_of_port_identifiers ;
task_inout_declaration ::= inout [ automatic ] list_of_port_identifiers ;
task_reg_declaration ::= reg [ automatic ] [range]
list_of_register_identifiers ;
task_integer_declaration ::= integer [ automatic ]
list_of_register_identifiers ;
task_time_declaration ::= time [ automatic ] list_of_register_identifiers ;
task_real_declaration ::= real [ automatic ] list_of_real_identifiers ;
task_realtime_declaration ::= realtime [ automatic ]
list_of_real_identifiers ;
task_event_declaration ::= event [ automatic ] list_of_event_identifiers ;

task_declaration ::=
        task [ automatic ] task_identifier ;
        { task_item_declaration }
        statement_or_null
        endtask
task_item_declaration :: =
  block_item_declaration
| input_declaration [ automatic ]
| output_declaration [ automatic ]
| inout_declaration [ automatic ]
block_item_declaration ::=
          parameter_declaration
        | reg_declaration [ automatic ]
        | integer_declaration [ automatic ]
        | real_declaration [ automatic ]
        | time_declaration [ automatic ]
        | realtime_declaration [ automatic ]
        | event_declaration [ automatic ]

<p>[Replicate these ideas for functions. Already in BNF98 work from Cliff.]



This archive was generated by hypermail 2.1.4 : Mon Jul 08 2002 - 12:52:58 PDT and
sponsored by Boyd Technology, Inc.