Home News People Research Study Search

Institute for Computing Systems Architecture

Computer Architecture Simulation & Visualisation

Rainbow separator

JavaHase Design documentation

Frédéric Mallet
2003-09-08
This document describes how the java source code for JavaHase/WebHase is organised. It also reports on the java code required to produce the C++ code for Hase v2.
JavaHase property file
security manager configuration
JavaHase short documentation
Hase++ design documentation

Location, compilation, execution

Most of the classes are directly written in JavaHase. However, the EDL parser is partially written using JFlex and the ELF parser is completely written using both JFlex and Java cup. That means, that for the two parsers, the Java files have to be generated by the JFlex 1.3.5 and the Java cup 0.10k systems prior to compilation. The library files for JFlex and Java Cup are available on the system as /usr/java/lib/java_cup/lib/java_cup.jar and /usr/java/lib/jflex/lib/JFlex.jar

Main Java source files

All source and class files are located in /group/project/hase/JavaHase/, which I will abbreviate into ${JavaHase} for future references.
Source files are separate from bytecode files. More specifically, all source files are in the ${JavaHase}/src directory, while class files are in the ${JavaHase}/classes directory. The batch file JhComp is supposed to simplify the compilation process for classes available in the eduni package. This command takes two arguments, the first one being the name of the package where the eduni. part has been removed, the second being the name of the class to be compiled. Wildcards will work if included into quotes.
For example, to compile the eduni.javahase.LinuxHase class, enter JhComp javahase LinuxHase from the ${JavaHase} directory. To compile all classes from the eduni.javahase.meta package, enter JhComp javahase/meta '*'. This later command will be expanded by the batch file to compile all eduni/javahase/meta/*.java files.

To launch the JavaHase gui, enter java -classpath ${JAVAHASEDIR}/classes:/usr/java/lib/java_cup/lib/java_cup.jar eduni.javahase.LinuxHase from the ${JavaHase} directory. This command will open the JavaHase gui after reading the appropriate property file.

The EDL Parser

For the EDL parsing there is only a Fflex lexer (EdlParserAuto.jlex) that decomposes the EDL file into sections (e.g. PREAMBLE, PARAMLIB, etc.) and uses the eduni.javahase.meta.Edl*Parser classes to build a Java object hierarchy according to the EDL meta-model.

To generate the EdlParserAuto.java file from EdlParserAuto.jlex, enter make from the ${JavaHase}/src/eduni/javahase/meta directory.

The ELF Parser

For the ELF parsing, there is both a lexer (elf.jlex) and syntax analyser (elf.cup) available. These two tools are combined to produce a Java object structure using classes available in the eduni.javahase.meta.elf package.

To generate the .java files for the ELF parser from elf.jlex, enter make elf from the ${JavaHase}/src/eduni/javahase/meta/elf directory.

package structure

javahase

The javahase package can be decomposed into 7 sub-packages described as follows.
JavaHase package description
Package nameDescription
eduni.javahase.metaIt contains all classes that implement the EDL/ELF meta-model. It maintains within the memory the same information than the EDL and ELF together. This information is used to generate the code in Java or C++.
It contains two subpackages:
eduni.javahase.meta.cpp:
to parse the Hase++ code and convert C++ constructs into Java ones.
eduni.javahase.meta.edl:
to represent the ELF information. This part is used by the view package and by the edit and preview mechanismes.
The main classes of this package are described by the figure below:
Hase meta-model
Hase meta-model
eduni.javahase.model Basic classes used for a specific model. Typically, the generated code is not dependent on the meta-model classes (though it is generated by them) and is dependent on the model classes.
This package contains only one subpackage :
eduni.javahase.model.event
To treat events as represented into the tracefile and animate them when required.
eduni.javahase.viewIt contains all classes to draw a JavaHase model on the screen. When generating the java code, some classes that use the view package are generated to draw a project according to the ELF information.
eduni.javahase.experiment It contains all classes required to run experiment with JavaHase models. This package is not complete yet, but the gui used by HASE to select experiment parameters comes from this package.
eduni.javahase.lib It contains the entity saved in libraries. The only library available is the sync library.
eduni.javahase.dialog It contains some classes to open dialog windows and select or display some information (e.g. Help dialog box, new project, etc.).
eduni.javahase.server It contains some code to protect JavaHase with a password access. This mechanism is not used anymore, a perl script is used instead to control the access to the HTML page that loads the applet.

distributions

I have re-implemented the eduni.distributions package, originally produced by Costas Simatos, so it is completely independent from SimJava.

simjava

Some modifications have been required on SimJava to follow improvements made to HASE. At the same time, Costas Simatos developed the SimJava 2 system to extend the trace ability of SimJava. In a effort to unify all existing versions of SimJava, the following structure was adopted.

The following figure represents the layers and the main classes in each layer.

The Simjava core and the different layers

fm

Some additionnal classes (e.g. Ordering traces, Hase++ viewer, etc.) have independently been developed and are available in the ${JavaHase}/src/eduni/fm directory.

hase

This package contains the code for the WebHase system that was used before moving to JavaHase. The code has not been modified for several months and should be JDK 1.1 compatible. Now, JavaHase integrates the WebHase functions and is able to produce an XML file from an EDL/ELF specification and a tracefile. The generated XML code can be read by the Original WebHase applet.

Since WebHase has not been modified for several months, recently introduced mechanisms (e.g. Clock entities) does not work using this procedure.

Alternatively, the JavaHase gui can also produce a JavaHase applet which behaviour is read from a tracefile instead of being the result of some Java code execution (translated from .hase code). This provides the same service than WebHase, but all improvements to JavaHase are immediately available with this mechanism called WebHase2.

RedHat 9

JavaHASE should work correctly on RedHat 9 as long as a JDK 1.4 is available. Currently slim.inf is installed with JDK 1.3.1. I am assuming a more recent JDK will be installed on the new system.
The C++ code generated by JavaHase for Hase v2 should be compatible with RedHat 9 as long as the right library files are used (i.e. libsim9.a, libarray9.a, libsync9.a) as explained by the Hase++ design documentation.

Return to Documents about HASE & SimJava


Rainbow separator

HASE Project
Institute for Computing Systems Architecture, School of Informatics, University of Edinburgh


Home : Research : Groups : Hase : Manuals : Design 

Please contact our webadmin with any comments or changes.
Unless explicitly stated otherwise, all material is copyright © The University of Edinburgh.