Old Format:#include "maisie.h"
Compilation of the Parsec source file will generate an ".pi" file, containing Parsec information. An ".mo" file will no longer be generated. Also note that some programs will now require the inclusion of the "stdio.h" header file.
Note that in the example above, the value of "pkg" and "tmp_ltr" are only valid in the clause where they appear as read-only constants. In contrast, the "ltr" variable is local throughout the entity. Any attempt to change the value of "pkg" or "tmp_ltr" will result in a warning.
Old Format: entity mailbox {postoffice1, postoffice2, pkg_count, ltr_count} ename postoffice1, postoffice2; int pkg_count, ltr_count; { message letter {int class; int weight;} ltr; message package {int class; int weight;}; invoke postoffice1 with letter {1,4}; while (pkg_count > ltr_count) { wait until { mtype (package) {++pkg_count; ... } or ltr=mtype (letter) {++ltr_count; ... } } }New Format: message letter {int class; int weight;}; message package {int class; int weight;}; entity mailbox (ename postoffice1, ename postoffice2) { int pkg_count; int ltr_count; messsage letter ltr; send letter {1,4} to postoffice1; while (pkg_count > ltr_count) { receive (package pkg) { ++pkg_count; ... } or receive (letter tmp_ltr) { ++ltr_count; ltr = tmp_ltr; ... } } }
Before:
|
Now:
|
Before:
|
Now:receive (end signal) break; or timeout in (expon(mean)); |
The timeout must appear after all receive statements. If there are no receive statements, the 'timeout' should be replaced by the hold() command.
Also note that in entity definitions, parentheses are used instead of curly braces for parameter declaration. Parentheses must also be used with the "new" statement.
Before: entity job{ cpu, disk, dmean } ename disk, cpu; int dmean; { . . . .Recommended: entity job( ename cpu, ename disk, int dmean ) { . . . .
Before:q[j][i]=new queue{self,MEAN,i*NSRVR+j,NSWTCH} at i;New Syntax:q[j][i]=new queue(self,MEAN,i*NSRVR+j,NSWTCH) at i;
Old Syntax: entity job{ ename cpu, ename disk, int dmean } { message ack { } ack1; message req { ename location;}; int i, t, end, start, t_wait, tid; invoke cpu with req {self}; . . . .New Syntax: message ack { }; message req{ ename location;}; entity job( ename cpu, ename disk, int dmean ) { message ack ack1; int i, t, end, start, t_wait, tid; send req {self} to cpu; . . . .
All message type definitions must include the message type name, followed by the parameters in curly braces, identical to stucture definitions. However, when defining a message variable, the parameters and curly braces should not appear.
Legal Syntax: message ack{}; message finish {int x;}; entity job( ename cpu, ename disk, int dmean ) { message finish job_fin; int i, t, end, start, t_wait, tid; send req {self} to cpu; . . . .Illegal Syntax: message ack ack1; message finish; entity job( ename cpu, ename disk, int dmean ) { message finish {int x;} job_fin; int i, t, end, start, t_wait, tid; send req {self} to cpu; . . . .
Before:sclock(void) zzcla(sim_time) zzmaxla(max_time) maxclock(char *) |
Now:simclock(void) setlookahead(clocktype delta, clocktype ceiling) setmaxclock(clocktype) |
Example:
entity my_entity ( int a, char *c, float d ) [stacksize (unary_expression)]
{ . . . . };
Before:
|
Now:
|
Updated: December 10, 1997.