OPENRISC

This page gives information on the OpenRISC platform and specifically on how to build & use the related tools within our EDA- & system-environment.

Tools

To check out the original OpenRISC repository:

svn co http://opencores.org/ocsvn/openrisc/openrisc/trunk

All following instructions assume as the base directory the trunk/.

Note: The shell-syntax used is for bash. Also, the directory /opt is not directly writeable for users in our environment, so it might be replaced by any other directory, in ones home for example: /home/<user>/opt

GNU Tool-Chain

The GNU tool-chain is mainly necessary for the gcc compiler and gdb debugger that it provides, but also provides the assembler and linker, and is therefore necessary to run any program on the OR. Or1ksim (the architectural simulator) is necessary as a prerequisite for building the tool-chain, since it interacts with debugging mechanism. In the following, the toolchain will only be built with the so-called "newlib" and not the "uClibc".

Due to certain library dependencies, RHEL 6 or newer has to be used for building and running the OR GNU tools.

Building the tool-chain:

  1. install missing build dependencies as root:
    yum install make gcc flex bison patch texinfo ncurses-devel mpfr-devel gmp-devel libmpc-devel libzip-devel
  2. build and install or1ksim: http://opencores.org/or1k/Or1ksim
    cd or1ksim
    mkdir builddir_or1ksim
    cd builddir_or1ksim
    ../configure --target=or32-elf --prefix=/opt/or1ksim
    make -j 7 all
    make install
    export PATH=/opt/or1ksim/bin:$PATH
  3. build and install gnu-stable: http://opencores.org/or1k/OpenRISC_GNU_tool_chain
    cd gnu-stable
    ./bld-all.sh --make-load 7 --force --prefix /opt/openrisc --or1ksim-dir /opt/or1ksim --no-uclibc --no-or32-linux
    export PATH=/opt/openrisc/bin:$PATH

The export commands extend your path with the bin directories of the new tools, so it is best to generally add them to your environment, e.g. by adjusting your .bashrc (or equivalent).

ORPSoCv2 RTL Tests

The orpsocv2 platform provides a whole SoC environment with many peripherals for the OR1200 core, and is of main interest to us for the simulation environment and testbenches it provides. The simulation Makefiles are compatible with modelsim and a number of basic functionality tests exist that can be run automatically.

Note: The tests require the OR GNU tool-chain for building the test-program binaries (newlib only). Once the binaries (vmem files in orpsocv2/sw/tests/or1200/sim) are built, the tests (RTL simulations) can be run with normal modelsim also on RHEL5.

To build & run the automatic tests:
cd orpsocv2/sim/run
eda mgc make SIMULATOR=modelsim rtl-tests

The simulation setup is fine, if all tests = OK (no error during make).

The make environment can be cleaned by:
make distlcean

Single simulations (or custom ones for that matter) can be executed by specifying the TEST variable:
eda mgc make SIMULATOR=modelsim TEST=or1200-mytest rtl-test

This will look in the orpsocv2/sw/tests/or1200/sim directory for a or1200-mytest.c or .S and run it as a test, expecting a report(0x8000000d) as the result.

Useful Links

OpenRISC Main Page

Architecture

OR1000 Architectural Manual

OR1200 Specifications

OV Flag Bug

l.sub discussion

RTL / orpsoc

OR RTL Sim [Forum]

OR Modelsim [Forum]

orpsocv2 bootrom [Forum]

RTL simulation debugging

OpenRISC Generic [Forum] 

Wishbone

Wikipedia

B3 Spec

GNU GCC

OR GNU Toolchain

or32 gcc RHEL5 [Forum]

Assembly

OR inline asm [Forum]

GCC inline asm how-to

or32 asm examples

Or1ksim

architecural simulator main page

debugging using OpenRISC GDB via RSP and Or1ksim

OpenRisc Architectural Simulator Patches

Guides

Getting started with OpenRISC (should not be used for toolchain install)

OpenRISC 1200 soft processor

OpenRISC Case Study for Reliability (example toolchain)

IDE / Tools

OpenIDEA (Dynalith Systems)

 

Author: jeremy.constantin@epfl.ch       georgios.karakonstantis@epfl.ch