mor1kx development platform =========================== This project is a fork of ORPSoCv2 and is intended to be used to help develop and verify the mor1kx processor. The reasons why this is forked from ORPSoCv2 are: * things are very mor1kx-specific * maintaing the cycle accurate build in such a way that it can easily support either the or1200 or mor1kx is rather hard and I'd rather focus on the mor1kx * We really do need Verilator support becuase it's used for linting and for verification, when we run the GCC regression suite on the generated model. Setup automatically =================== A script to install the mor1kx core automatically, and create some other required directories is available. Run it from the mor1kx-dev-env root dir: ./scripts/bash/setup.sh Adjust the permissions on it as required. Setup automatically =================== To set up the project, please symbolically link in the mor1kx git repo directory to rtl/verilog. Eg. cd rtl/verilog ln -s ~/path/to/git/mor1kx/rtl/verilog mor1kx This helps hacking on the mor1kx as well as the verification environment (we don't want to check the mor1kx code into this environment). Then, symlink the two required include files to the include/ directory of the generic mor1kx build, and wherever else you need it: cd boards/generic/mor1kx/rtl/verilog/include ln -s ../../../../../../rtl/verilog/mor1kx/mor1kx-defines.v ln -s ../../../../../../rtl/verilog/mor1kx/mor1kx-sprs.v To get the verilated model running, the path to a compiled libor1kktrace (available from git://github.com/juliusbaxter/or1ktrace.git) needs to be symlinked in: ln -s /path/to/libor1ktrace or1ktrace Words of Wisdom =============== git doesn't like empty directories and makes them disappear when committing. To get things to work in the generic/mor1kx build you'll need to add the out/ and modules/ directories as follows: mkdir boards/generic/mor1kx/modules mkdir boards/generic/mor1kx/sim/out Building the verilated model ============================ In boards/generic/mor1kx/sim/run do: make prepare-vlt Add V=1 if you wish to have all of the build output. This first lints the design and then generates the C++ model and compiles it up into a nice fast cycle-accurate simulator. Verilated model with or1ktrace ============================== A singular, unified and all-encompassing (?!) OR1K trace-generation library is available in or1ktrace. It must be downloaded and built and installed, though. You also need your binutils to have been built with --enable-shared. Downloading ----------- git clone https://github.com/juliusbaxter/or1ktrace.git Building -------- Assuming your binutils had --enabled-shared passed during configure and is installed under /opt/or1k-toolchain you'll want to configure or1ktrace and set the BINUTILS_BLD_DIR to point to the shared library directory under there. For me I did: ./configure BINUTILS_BLD_DIR=/opt/or1k-toolchain/i686-pc-linux-gnu/or1k-elf \ --prefix=/opt/or1ktrace and of course a 'make' and 'make install' later you'll have what you need under /opt/or1ktrace. Building using or1ktrace --------------------------- Set the OR1KTRACE_ROOT variable to point to the install directory, in this case we set it to /opt/or1ktrace: export OR1KTRACE_ROOT=/opt/or1ktrace Now when building the cycle-accurate model, pass USE_OR1KTRACE=1 too, eg. make prepare-vlt USE_OR1KTRACE=1 Once built, the --trace option will generate a trace to stdout. TODO - make it trace to a file (far more useful!)