TAMS / Java / Hades / applets: contents | previous | next | ||||
Hades Applets contents visual index introduction std_logic_1164 gatelevel circuits delay models flipflops adders and arithm... counters LFSR and selftest memories programmable logic state-machine editor misc. demos I/O and displays DCF-77 clock relays (switch-le... CMOS circuits (sw... RTLIB logic RTLIB registers Prima processor D*CORE MicroJava Pic16 cosimulation Mips R3000 cosimu... Intel MCS4 (i4004) image processing ... [Sch04] Codeumsetzer [Sch04] Addierer [Sch04] Flipflops [Sch04] Schaltwerke [Sch04] RALU, Min... [Fer05] State-Mac... [Fer05] PIC16F84/... [Fer05] Miscellan... [Fer05] Femtojava adder factorial calculator Multicycle F... Bubblesort Insertion-sort Quicksort Pipelined Fe... quicksort (p... FreeTTS | Femtojava processor: factorial
Circuit Description
This applet demonstrates a simulation of a example using the component
FemtoJavaProcessor to calculate the factorial of the given input value.
The Femtojava processor is a Java Microcontroller
with 4 input ports, 4 output ports, 2 external interrupt inputs,
and 1 serial port.
It uses It uses a reduced-instruction-set Harvard architecture,
and runs a subset of JAVA bytecode.
FemtoJava instruction set: Instruction type Arithmetic and logic Control flow Stack Load/store Array Extended Others Mnemonics iadd, isub, imul, ineg, ishr, ishl, iushr, iand, ior, and ixor goto, ifeq, ifne, iflt, ifge, ifgt, ifle, if_icmpeq, if_icmpne, if_icmplt, if_icmpge, if_icmpgt, if_icmple, return, ireturn, and invokestatic iconst_m1, iconst_0, iconst_1, iconst_2, iconst_3, iconst_4, iconst_5, bipush, pop, pop2, dup, dup_x1, dup_x2, dup2, dup2_x1, and swap iload, iload_0, iload_1, iload_2, iload_3, istore, istore_0, istore_1, istore_2, and istore_3 iaload, baload, caload, saload, iastore, bastore, castore, sastore, and arraylength load_idx, store_idx, and sleep nop, iinc, getstatic, putstatic The user write a Java source at following format:
The designer can model, simulate, and build the system implementation directly in Java. We provide libraries that improve simulation accuracy and allow direct mapping of classes used by simulation to actual code in the final implementation. These predefined classes also cover all the details required to interface the microcontroller with the real world (interrupt mechanism programming, communication with LCD displays, and keyboards). A set of tools can help the designer predict the final system performance and costs. The design process is based on the Sashimi design environment. Sashimi uses freely available tools, like the Java compiler and the JVM included in the Java development kit (JDK). In addition, we also provided tools specifically designed for Sashimi. IT IS POSSIBLE to synthesize small Java microcontrollers in a single FPGA chip. The microcontroller executes Java bytecodes natively, with no new compiler or JVM implementation required. Because they are reconfigurable, the FPGA devices provide opportunities to update microcontroller capabilities. The design environment fully supports generating an optimized microcontroller and the adapted code. Please look at the following papers to learn more about Sashimi Project from Universidade Federal do Rio Grande do SUL (UFRGS), Brazil, Prof. Luigi Carro (supervisor); The FemtoJava as a HADES component was written by Aroldo Ferreira, André Bigonha, Alisson Garcia and Ricardo Ferreira from Universidade Federal of Vicosa, Viçosa, Brazil. BECK FILHO, Antonio Carlos ; MATTOS, Julio ; WAGNER, Flavio ; CARRO, L. . CACO PS - A General Purpose Cycle-accurate Configurable Power Simulator. In: 16th Symposium on Integrated Circuits and Systems Design, 2003, São Paulo. Proceedings. Los Alamitos : IEEE Computer Society Press, 2003. v. 1. p. 349-354. ITO, S., CARRO, L., JACOBI, R. Sashimi and FemtoJava: making Java work for microcontroller applications. IEEE Design & Test of Computers. Estados Unidos: , p.100 - 110, 2001. The authors investigate complete system development using a Java machine aimed at FPGA devices. A new design strategy targets a single FPGA chip, within which the dedicated Java microcontroller--FemtoJava--is synthesized. FemtoJavaProcessor Description: The component FemtoJavaProcessor is used to simulate FemtoJava programs codes on hades. To use this component the program code need to implement the Runnable interface, and have a copy of initSystem on method run. It's not necessary to implement the IOInterface, because this is already done by FemtoJavaProcessor.
Component full name: dpi.sashimi.FemtoJavaProcessor Code:
package dpi.sashimi; import saito.sashimi.*; public class FemtoJavaProgramTester implements IntrInterface, TimerInterface, Runnable { /** Creates a new instance of FemtoJavaProgramTester */ public FemtoJavaProgramTester() { FemtoJavaTimer.setTimerClass(this); FemtoJavaInterruptSystem.setInterruptClass(this); } /************************************************************************** * VARIABLES *************************************************************************/ static int value; static int result = 1; /************************************************************************** * MAIN FUNCTION *************************************************************************/ public static void initSystem() { FemtoJavaInterruptSystem.globalEnable(); FemtoJavaInterruptSystem.enable(0xff); while(true) { FemtoJava.sleep(); } } /************************************************************************** * INTERRUPTIONS *************************************************************************/ public void int0Method() { value = FemtoJavaIO.read(0); result = 1; if(value != 0) { for(;value > 0; value-- ) { result *= value; } } FemtoJavaIO.write( result, 0 ); } public void int1Method() { } public void spiMethod() { } public void tf0Method() { } public void tf1Method() { } /************************************************************************** * SIMULATION *************************************************************************/ public void run() { initSystem(); } } | |||
Print version | Run this demo in the Hades editor (via Java WebStart) | ||||
Usage | FAQ | About | License | Feedback | Tutorial (PDF) | Referenzkarte (PDF, in German) | ||||
Impressum | http://tams.informatik.uni-hamburg.de/applets/hades/webdemos/96-femtojava/factorial/factorial.html |