This page is meant to be a quick guide for new members of the LegUp team. Hopefully it will help you get started with LegUp.
LegUp: what it is, what it does, why it is important.
The quickest and easiest way to get a copy of LegUp is by downloading the latest VirtualBox image: http://legup.eecg.utoronto.ca/download.php
However, ideally you will want to work with LegUp directly on your computer. The following steps outline this process for Ubuntu 14.04 x64:
sudo apt-get install git tcl8.5-dev dejagnu expect texinfo build-essential \ liblpsolve55-dev libgmp3-dev automake libtool clang-3.5 libmysqlclient-dev \ qemu-system-arm qemu-system-mips gcc-4.8-plugin-dev libc6-dev-i386 meld \ libqt4-dev libgraphviz-dev libfreetype6-dev buildbot-slave libXi6:i386 \ libpng12-dev:i386 libfreetype6-dev:i386 libfontconfig1:i386 libxft2:i386 \ libncurses5:i386 libsm6:i386 libxtst6:i386 vim gitk kdiff3 gxemul clang-3.5 \ openssh-server mysql-server python3-mysql.connector python3-serial \ python3-pyqt5
There are several resources to help you set this up:
Run through the LegUp tutorials: http://legup.eecg.utoronto.ca/tutorials.php
Read the LegUp Documentation - User Guide: http://legup.eecg.utoronto.ca/docs/3.0/userguide.html#userguide
The LegUp Documentation - User Guide introduces several important make targets. These make targets are mostly defined in legup/examples/Makefile.common. You should be familiar with most of the following targets:
The legup/examples directory contains many different benchmarks. You may want to play around with compiling and simulating some of them using these make targets.
Read the LegUp Documentation - Programmer's Manual: http://legup.eecg.utoronto.ca/docs/3.0/programmermanual.html#progman
Familiarize yourself with the LegUp buildbot: http://www.legup.org:9100/waterfall
The following apply when doing a 'git push' to the LegUp master branch:
After doing a 'git pull' it is a good idea to run 'make' from the legup root directory. This ensures that any changes to the LegUp source (in legup/llvm/lib/Target/Verilog, legup/llvm/lib/Transforms/LegUp/ etc) will be incorporated into the LLVM binaries when you run tests, benchmarks etc.
Subscribe to the legup-builds mailing list: http://lists.legup.org/listinfo/. You may also want to subscribe to the legup-dev and legup-commits lists.
There are several important directories you should know about:
There are a few git commands you should be familiar with:
You may also want to install and familiarize yourself with a merge tool such as meld, opendiff, emerge, or vimdiff. This will help you handle git merge conflicts.
If you often work on multiple computers (home/work/school) you may want to set up your own branch for anything that is a work-in-progress. When it is 'finished' and passes all the test cases, then you can merge it into the master branch and push it to the remote. This way you can conveniently synchronize your working directory with git, while not breaking the master branch for other members of the team. In addition, you have a backup copy of your work in the remote repository in the case of local computer failure.
Try to write short unit tests to test parts of your code that may not be tested by the LegUp benchmarks.
You can run the legup/examples/benchmark.pl script to collect the cycles, fmax, LUTs, etc. for chstone and dhrystone. This takes a while, but is a good way to quantify the effect of your changes.
Avoid using buildbot for generating experimental data. If you need to run a lot of test cases, use SciNet. scinet.
I'm not sure if LegUp has any coding standards, or if we want to have any. Basically just try to write clean code and use comments… For reference the LLVM coding standards are here: http://llvm.org/docs/CodingStandards.html