Supporting Patmos - lf-lang/lingua-franca GitHub Wiki

Patmos is a RISC processor designed for real-time systems. Similar to FlexPRET, it is written in Chisel. Porting the LF to support Patmos is a work in progress.

patmos-clang is the LLVM-based C compiler for Patmos. Currently, the compiler is working on Linux only, the Mac port is broken. For Mac users this involves a dual step to compile LF programs.

  1. use lfc to generate the C code. Include the target in the LF application:
target C {
  threading: false,
  platform: "Patmos",
  build: "echo run make"
}
  1. Compile the C code for Patmos with make -f patmos.mk

  2. Execute the compiled program in one of the three platforms:

  • Use the Patmos instruction set simulator: pasim a.out
  • Use the hardware-based emulator: patemu a.out
  • Execute the program on an FPGA with the following steps:
make -C .../t-crest/patmos config
patserdown /dev/ttyUSB0 a.out

This assumes that Patmos has been synthesized. Synthesis for the default DE2-115 FPGA board is simply a

make

Further information on the build of Patmos is available at https://github.com/t-crest/patmos

Hint on mixed OS work: When running Linux in a virtual machine, one can mount a host folder and ssh into the VM. For example, when working with IntelliJ on a Mac, one can open a terminal into the VM for compilation and FPGA configuration.