KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Compiling and Running

To compile and run the software, the following software should be available on your operating system:

  • A LM32 compiler / Posix build environment
    • For Windows or Linux, you can download the LM32 System Development Tools: http://http://www.latticesemi.com For the toolchain no license is required. It comes with cygwin, which contains Make and such.
    • You can also download a pre-made GCC toolchain from the white-rabbit website: http://www.ohwr.org/projects/general-cores/wiki/Demo Note that this is only compatible with Linux RedHat or deratives.
    • Or you can roll your own. I have not attempted this but there are several results for 'build GCC lm32 crosscompiler'.
  • iMPACT

Tool configuration

Note
Usually this is not required for Linux

Make sure the lm32 compiler is in the path. When you have installed the LM32 System Development Tools for Windows, there will be a 'LatticeMico System SDK Shell' link in the start menu which will set everthing right. Also data2mem and impact must be on the path. These are located (for windows) inside the ISE bin directory (bin/nt|nt64).

For windows there must be a version of rm available on the path, either through msys or cygwin.

Alternativly you may also provide the following variables:

  • GCC_LM32_BIN: LM32 GCC bin dir (e.g. C:/LatticeMicoSystem/2.0/micosystem/gtools/lm32/bin)
  • GCC_LM32_PREFIX: LM32 GCC binary prefix (default = lm32-elf-).
  • ISE_BIN: ISE bin directory (e.g. C:/LatticeMicoSystem/2.0/micosystem/gtools/lm32/bin)
Note
Variables can be set by either adding them to the envrionment variables, or by passing them to Make using the commandline, e.g. make ISE_BIN_DIR=c:/usr/bin/ise/bin GCC_LM32_PREFIX=lm32-.

Compilation

Once your environment has been set up, you can simply compile by running make from the build directory. If all goes well you should end up with a clbv2msw.elf and clb2msw.bit file in build/exe.

Running

Once compilation is succesful, you can run the newly created bit file using the 'upload' make target: $clbv2esw/build/>make upload, and in about 30 seconds your new image should be running on the FPGA.

Debugging

Unfortunatly I have not been able to get a debugger running on the FPGA yet. Hopefully in the future.

Development environment

I am using a standard Eclipse CDT install (not the contraption that comes with the micosystem), with the GCC cross compiler. If you configure it correctly it will allow for code-completion and building and running inside Eclipse.