MIPS
From JopWiki
Contents |
[edit] YARI
YARI as a MIPS compatible soft-core. A port for the Cyclone EP1C12 FPGA board (Cycore) is part of the distribution.
[edit] initial checkout
git clone git://repo.or.cz/yari.git cd yari git checkout -b cacao origin/cacao
[edit] Building CACAO for YARI
cd cacao-related wget http://ftp.gnu.org/gnu/binutils/binutils-2.17.tar.bz2 wget http://ftp.gnu.org/gnu/gcc/gcc-4.1.1/gcc-core-4.1.1.tar.bz2 tar xjf binutils-2.17.tar.bz2 tar xjf gcc-core-4.1.1.tar.bz2 bash ./build.sh
[edit] grabbing updates
git pull
[edit] preparing git patches
git commit -a -m "some message" git format-patch origin
Alternatively, get an account on repo.or.cz and tell Tommy to add you to the insider list. Then submitting changes amount to
git push
[edit] Plasma
A simple MIPS compatible processor Plasma is ported to the Cyclone EP1C12 FPGA board.
Download: http://www.jopdesign.com/files/mlite_ep1c12.zip
http://www.jopdesign.com/files/mlite.tar.bz2
Note: the Plasma port has issues with the memory interface. Only very small programs work.
[edit] Cacao
Cacao is a fast and portable Java VM implementation based on Just-In-Time (JIT) compilation. Cacao is available for various architectures, including MIPS, ARM, Alpha, SPARC, x86, PowerPC, ...
For more details visit: http://www.cacaojvm.org/
[edit] Running Cacao on Plasma
In order to get Cacao running on a (bare) Plasma core you will need:
- the cldc class library (phoneME)
http://www.complang.tuwien.ac.at/cd/brandner/jvmhw/plasma/phoneme_feature.tar.bz2 NOTE: THIS IS NOT AN OFFICIAL PHONEME PACKAGE!
- gcc (we've used gcc 4.1.1)
ftp://gd.tuwien.ac.at/gnu/gcc/releases/gcc-4.1.1/gcc-4.1.1.tar.bz2
- binutils (e.g., binutils 2.17)
http://ftp.gnu.org/gnu/binutils/binutils-2.17.tar.bz2
- newlib (e.g., 1.15.0)
ftp://sources.redhat.com/pub/newlib/newlib-1.15.0.tar.gz
- some Plasma specific extensions to newlib
http://www.complang.tuwien.ac.at/cd/brandner/jvmhw/plasma/plasma-newlib.tar.bz2
- a patched version of Cacao
http://www.complang.tuwien.ac.at/cd/brandner/jvmhw/plasma/cacao-mips.tar.bz2 NOTE: THIS IS NOT AN OFFICIAL CACAO PACKAGE!
- a woking Plasma core (see above)
[edit] Build and install binutils
- download and unpack the bintuils package
- run configure using the following arguments:
configure --prefix=<InstallDIR> --program-prefix=mips-elf- --target=mips-elf
- make [-j3]
- make install
[edit] Build and install gcc
- download and unpack the gcc package
- run configure:
configure --enable-debug=full --prefix=<InstallDIR> \
--enable-checking --disable-shared --disable-threads --without-headers \
--with-newlib --enable-languages=c --with-gnu-ld --with-gnu-as \
--program-prefix=mips-elf- --target=mips-elf
- make [-j3] all-gcc
- make install-gcc
[edit] Build and install newlib
- download and unpack the newlib package
- run configure:
configure --prefix=<InstallDIR> --target=mips-elf --disable-newlib-io-float
- make [-j3] CFLAGS="-g -O2 -Wall -DNO_UNALIGNED_LOADSTORE"
- make install
[edit] Build and install Plasma specific newlib
- download and unpack the Plasma newlib package
- make [-j3] INSTALL_DIR=<InstallDIR>/mips-elf
- make INSTALL_DIR=<InstallDIR>/mips-elf install
[edit] Unpack the phoneME package
- download and unpack the phoneME package
[edit] Build cacaoh for the host platform
- download and unpack the patched Cacao package
- run autogen.sh in the root directory
- mkdir build-host; cd build-host
- run configure:
../configure --with-classpath-includedir=/usr/include/classpath/ --enable-java=cldc1.1 --with-classpath=cldc1.1 --with-classpath-classes=<PathtoPhoneME>/cldc/src/javaapi/cldc1.1/classes --disable-libjvm --disable-threads --enable-gc=none --disable-boehm-threads
- make [-j3]
- There is no need to do a make install, we are only interrested in the cacaoh tool.
[edit] Build Cacao for Plamsa
- go to the root directory of Cacao
- mkdir build-mips; cd build-mips
- run configure:
../configure --with-classpath-includedir=/usr/include/classpath --enable-java=cldc1.1 --with-classpath=cldc1.1 --with-classpath-classes=<PathtoPhoneME>/cldc/src/javaapi/cldc1.1/classes --enable-statistics --disable-zlib --disable-libjvm --enable-staticvm --disable-threads --enable-embedded-classes --enable-gc=none --host=mips-elf --disable-boehm-threads --with-cacaoh=<PathToCacao>/build-host/src/cacaoh/cacaoh --enable-softfloat CFLAGS="-Os -mips1 -Tplasma.ld -msoft-float"
- make [-j3]
- in build/src/cacao/cacao you now have a MIPS binary for Plasma
[edit] Running Cacao with MIPS-SDE
- To get Cacao running with the MIPS-SDE tools you'll need essentially the same packages as above
- In addition you'll need the SDE package:
http://www.mips.com/products/software-tools/software-tools/mips-sde-lite/
- To build Cacao follow the steps described above, except for the last step.
[edit] Build Cacao for MIPS-SDE
- go to the root directory of Cacao
- mkdir build-mips; cd build-mips
- run configure:
../configure --with-classpath-includedir=/usr/include/classpath --enable-java=cldc1.1 --with-classpath=cldc1.1 --with-classpath-classes=<PathtoPhoneME>/cldc/src/javaapi/cldc1.1/classes --enable-statistics --disable-zlib --disable-libjvm --enable-staticvm --disable-threads --enable-embedded-classes --enable-gc=none --host=mips-elf --disable-boehm-threads --with-cacaoh=<PathToCacao>/build-host/src/cacaoh/cacaoh --enable-softfloat CFLAGS="-Os -mips1 -Tidt.ld -msoft-float"
- make [-j3]
- in build/src/cacao/cacao you now have a MIPS binary for SDE
[edit] Starting Cacao with MIPS-SDE
- use the sde-run command:
sde-run src/cacao/cacao
