First perform the following steps:
This document describes how to install and use ALFred. As an example, we are assuming that you are running on UNIX, even though ALFred will run on any platform that supports Java and Esterel.
The installation process involves the following steps:
Choose a directory to unpack the distribution that we will refer to as <instdir>.
cat alfred_package.tar.gz | gzip -d | tar xomvf -
This will create a number of directories under the inria and sics directories:
As ALFred contains a set of Java classes, you need to specify to the Java interpreter the place where ALFred classes are stored. This is usually done by setting some CLASSPATH environment variable:
CLASSPATH=<instdir>/inria/alfred/classes/alfred.zipexport CLASSPATH
Don't forget to change <instdir> with the absolute path of the place you have unpacked the distribution.
To access to native code you have to set the LD_LIBRARY_PATH to <instdir>/inria/native/lib/<os_name>/.
To use the Esterel mode for ALFred/Esterel and be able to enter the QoS parameters values while developping the Esterel code for application, you have to include the following code in your ".emacs":
(setq user-elisp-library
(substitute-in-file-name "<instdir>/inria/alfred/emacs/esterel/"))
(setq load-path
(append load-path '("<instdir>/inria/alfred/emacs/esterel/")))
(setq auto-mode-alist
(append '(("\\.strl$" . esterel-mode))
auto-mode-alist))
(autoload 'esterel-mode "<instdir>/inria/alfred/emacs/esterel/esterel-mode.el"
"Major mode for editing Esterel programs" t)
;; Fontify an Esterel buffer
;; =========================
(defvar esterel-font-lock-keywords
(list
;;
;; Keywords
;;
"\\babort\\b" "\\band\\b" "\\bawait\\b" "\\bboolean\\b"
"\\bcall\\b" "\\bcase\\b" "\\bcombine\\b"
"\\bconstant\\b" "\\bcopymodule\\b" "\\bdo\\b" "\\beach\\b" "\\belse\\b"
"\\bemit\\b" "\\bend\\b" "\\bevery\\b" "\\bexec\\b" "\\bexit\\b"
"\\bfalse\\b" "\\bfunction\\b" "\\bhalt\\b" "\\bhandle\\b" "\\bif\\b"
"\\bimmediate\\b" "\\bin\\b" "\\binteger\\b" "\\binput\\b"
"\\binputoutput\\b" "\\bloop\\b" "\\bmod\\b" "\\bmodule\\b" "\\bnot\\b"
"\\bnothing\\b" "\\bor\\b"
"\\boutput\\b" "\\bpresent\\b"
"\\bprocedure\\b" "\\brelation\\b" "\\breturn\\b"
"\\brepeat\\b" "\\bresume\\b" "\\brun\\b"
"\\bsensor\\b" "\\bsignal\\b" "\\bstring\\b"
"\\bsuspend\\b" "\\bsustain\\b"
"\\btask\\b" "\\bthen\\b"
"\\btimeout\\b" "\\btimes\\b" "\\btrap\\b" "\\btrue\\b" "\\btype\\b"
"\\bupto\\b" "\\bvar\\b" "\\bwatching\\b" "\\bwith\\b" "\\bwhen\\b"
"\\bweak\\b" "\\elsif\\b"
;; module name
'("^[ \t]*module\\([ \t\n]\\|%.*$\\)+\\([a-zA-Z][a-zA-Z0-9_]*\\)"
2 font-lock-function-name-face)
))
(add-hook 'esterel-mode-hook 'turn-on-font-lock)
You also have to replace the variable "$HOME" by "<instdir>"
in "<instdir>/inria/alfred/emacs/esterel/esterel-mode.el".
A last thing to do is to edit the file "<instdir>/inria/alfred/parser/Tool.java" to correct the path where to find the gif files (two gif images are fetched and used in the ADU interface).
You first write the <file>.strl containing the Esterel module of your application and use the emacs menu to enter QoS parameters or write the <file>.qos without the help of the menu (see here how to do that).
Then you can call the ALFred parser. Let us see what are the options of this tool:
$ java inria.alfred.parser.Tool -h
usage: alfred.parser.Tool [options]
-f string : base name of the esterel file to be parsed (default to "AlfAppli")
-D string : directory absolute path (default to the current directory) where
to create some Esterel and Java files.
So if you want to work only in your current directory you just
enter the following command:
java inria.alfred.parser.Tool -f <file>This will create a bunch of esterel and java files. Note that all java files generated are previously saved in ".save" files.
Now you compile your Esterel files into java. First the application:
$ esterel -ssc AlfAppli.strl -B AlfAppli $ ocjava -ssc AlfAppli.ssc [-p <java package>]If you are defining some Esterel types that already exist in some Java package you just have to include this package at compile time. In that case, classes from packages are generated again by the parser and therefore must be destroyed.
$ esterel -ssc AlfAuto0.strl -main AlfAuto0 -B AlfAuto0
$ ocjava -ssc AlfAuto0.ssc -p inria.alfred.lib
$ esterel -ssc AlfAuto1.strl -main AlfAuto1 -B AlfAuto1
$ ocjava -ssc AlfAuto1.ssc -p inria.alfred.lib
: :
: :
Now to run your application you just have to call the
main java class inria.alfred.lib.Run. Let us
see what are the possible options:
$ java inria.alfred.lib.Run -h usage: java inria.alfred.lib.Run [options] -s <hostname> : source address -d <hostname> : destination address -p <adutype/port> : to set the port for adu transmission -m <adutype/group/port/ttl>: to set a multicast connection -version <version> : print the ALFred version -sched <period> : set the scheduling period in ms -nbadu <maxadu> : set the maximum number of ADU types -nbconn <total> : set the maximum number of connections -mtu <MTU> : set the Maximum Transmission Unit in bytes -manual_bw : to disable automatic probing of network bottleneck bandwith usage for application: No application level command line optionsIn real-time oriented multimedia applications, the underlying protocol mechanisms often need to dynamically adapt to network conditions. We suppose in that case that you are running the probe daemon from SICS to use the automatic probing of available data rate at the path bottleneck. To disable this automatic probing you can use the -manual_bw option and a menu will ask you to enter a maximum bandwith to remain TCP friendly.
Note that there is no real coherence between the "multicast" value of the "mode" QoS parameter and -m (command parameter).