@c "chapters/processes.tex"
@c $Id: processes.texi,v 1.1 2007/08/20 00:02:48 fang Exp $

@node Processes
@chapter Processes
@cindex process

Processes are the building blocks of concurrent programs.  
In @HAC{}, processes describe the execution of a single type of entity.  
The behavioral description can be very high-level, 
or it may be as detailed as transistor netlists.  

@menu
* Process Declarations::
* Process Definitions::
@end menu

@c ----------------------------------------------------------------------------
@node Process Declarations
@section Declarations

One may declare a new type of process without specifying its definition, 
like a prototype in C/C++.  
A process declaration contains only the name of the process type, 
and a port specification with an (optional) list of formal instances.  

@menu
* Process Ports::
* Process forward declarations::
@end menu

@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@node Process Ports
@subsection Ports
@cindex process ports
@cindex ports, process

A process declaration may be repeated any number of times as long
as the port formal instances are equivalent.  

Two port formal instance lists are equivalent
if and only if the following are true:
@enumerate
@item The list contains the same number of formal instances.  
@item Each formal instance (in order of each list) is type-equivalent
	(and size-equivalent).
@item Each formal instance has the same name.  
@end enumerate

Unlike C, where formal identifiers are optional in prototypes, 
port formal lists require names for each instance.  
This allows one to reference a process's ports individually 
before the process is defined.  

Unlike normal instantiations found in a namespace or definition body, 
formal instance arrays may not be extended with re-declarations.  
Since they may only be declared once, they must be densely packed.  

@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@node Process forward declarations
@subsection Forward declarations
@cindex process forward declaration
@cindex forward declaration, process

Only the name of the process type is declared.  

Also include template signature, covered later.  

Not yet supported.  

@c ----------------------------------------------------------------------------
@node Process Definitions
@section Definitions
@cindex process definitions

A process definition specifies a body in addition to a port specification.  

If a process definition is preceded by a declaration with the same name, 
then the definition's port specification must match those of the prototype, 
i.e. each port formal instance must be type-equivalent between the 
declaration and the definition.  
Likewise, declarations that follow a definition must also 
declare the same port formal instances.  

@menu
* Process definition body::
@end menu

@c ----------------------------------------------------------------------------
@node Process definition body
@subsection Process definition body
@cindex process definitions

The body of a process definition describes a sequence of actions
taken by the process.  

Refer to CHP chapter, appendix.  

Also HSE, PRS.  

@c ----------------------------------------------------------------------------

