|
Abstract
The E(mbedded ) Machine, is a virtual machine that interprets the
E code. Initialy the E Code consisted of 6 instructions:
- call executes a driver, a driver is a piece of code
written in a conventional language (in this case C);
- release releases a task, the task function is also written
in a conventional language ( C );
- future mark a piece of E code to be executed at some
future time;
- jump unconditioned jump to a specified address;
- if conditioned jump to a specified address;
- return stops the E Machine from executing E code until
an event occuers;
Recently we have extended the E Code in order to support hierarchical
execution, the new code is called Hierarchical E Code (HE Code).
HE Code consists of the following instructions:
- call executes a driver, a driver is a piece of code
written in a conventional language (in this case C);
- release releases a task, the task function is also written
in a conventional language ( C );
- wfuture mark a piece of E code to be executed at some
future time, the WriteQueue is used to store the trigger;
- sfuture mark a piece of E code to be executed at some
future time, the SwitchQueue is used to store the trigger;
- rfuture mark a piece of E code to be executed at some
future time, the ReadQueue is used to store the trigger;
- jumpConditional conditioned jump to a specified address;
- jumpAbsolute absolute jump to a specified address;
- jumpSubroutine subroutine jump to a specified address;
- copyRegister copy the contents of a register Rx into another
register Ry;
- pushRegister push the contents of a register Rx onto a stack;
- popRegister pop content from a stack to a register Rx;
- getParent get the parent trigger of the trigger stored in a register
Rx and store it into another register Ry;
- setParent set the parent trigger of the trigger stored in a register
Rx to the trigger stored in register Ry;
- copyChildren copy the children list of the trigger in a register Rx into
the children list of the trigger in register Ry;
- setParentOfChildren set the parent of all the children of the trigger
in a register Rx to the trigger stored in a register Ry;
- deleteChildren remove all child triggers of the trigger in Rx recursively;
- replaceChild in the children list of the trigger stored in register Rx,
replace trigger stored in Ry with trigger stored in Rz;
- cleanChildrenList empty the children list of trigger stored in a
register Rx;
- return returns from subroutine or stops the E Machine from
executing E code until an event occuers;
Downloads
E Machine source files (Linux, Mac OS): Flat_EMachine.tar.gz
Hierarchical E Machine source files (Linux, Mac OS): Hierarchical_EMachine.tar.gz
How To Run It?
First you have to download the E Machine or the Hierarchical E Machine.
sources.
To build the E Machine:
- edit the makefile to change the EXAMPLE definition to point to the
file you want to compile;
- type make all to compile the htl example program and build the E
Machine;
- type make all host=[host_name] to build the E Machine for specified
host.
To run the E Machine:
- type ./e-machine to run the E Machine for non-distributed programs;
- type ./e-machine [ID] to run the E Machine for the host with the
specified ID, the ID corresponds to the order in which the hosts appear in the HTL file,
starting from 0.
|