This is an old revision of the document!
This example will demonstrate how to use the deep compiler to translate a simple Java program and run it on a MicroZed board. This is a simple “hello world” example. It does not allow to use the FPGA part of the zynq7000. See Application Development or System Developer for that purpose.
import java.io.PrintStream; import org.deepjava.runtime.zynq7000.driver.UART; public class HelloWorld { static { // Initialize UART (115200 8N1) UART uart = UART.getInstance(UART.pUART1); uart.start(115200, UART.NO_PARITY, (short)8); // Use the uart for stdout System.out = new PrintStream(uart.out); // Print a string to the stdout System.out.println("Hello world"); } }
#deep-1
meta {
version = "Mon Jan 15 09:08:35 CET 2020";
description = "deep project file for HelloWorld";
}
project HelloWorld {
libpath = "//ost.ch/dfs/bsc.sys/public-programme/deep/lib";
boardtype = MicroZed;
ostype = sts_arm;
programmertype = openOCD;
programmeropts = localhost_4444;
imgfile = "./";
# pl_file = "";
# enter names of rootclasses, e.g.
# rootclasses = "test.MyFirstTestClass","other.MySecondTestClass";
rootclasses = "test.HelloWorld";
}
putty or realterm to open the COM-port on J2 (baudrate = 115200). Alternatively open a terminal program as an eclipse view. Select the appropriate COM port number. Check your host operating settings for this number. If there is no associated serial port yet - make sure, that you have the proper driver installed (Downloading CP210x drivers).