The COSMIC team are pleased to announce the initial release of the Mocha repository. It is a first minimal viable product with an initial set of blocks integrated for a first functional system. We expect a release (MVP-2) in late June 2026 that will integrate the rest of the blocks that will make this a more complete Secure Enclave and include instructions on how to boot a rich operating system. For now this release contains bare-metal examples.
The release contains a bitstream which you can flash on the Genesys 2 board lowrisc_mocha_chip_mocha_genesys2_0.bit, a utilisation report chip_mocha_genesys2_utilization_placed.rpt, a set of USB rules for FPGA programming 99-openfpgaloader.rules, a build of example software examples.tar.gz and a built Verilator simulator Vtop_chip_verilator.
Quick start
Firstly download all the artefacts, then follow the following steps to test on FPGA:
- Install dependencies:
- OpenFPGALoader, for example:
apt install openfpgaloader - Screen, for example:
apt install screen
- OpenFPGALoader, for example:
- Connect your Genesys 2 board with the POWER, UART and JTAG. Make sure to turn on the board using SW8.
- Configure udev rules:
cp 99-openfpgaloader.rules /etc/udev/rules.d/99-openfpgaloader.rules udevadm control --reload-rules udevadm trigger usermod -a $USER -G plugdev - Program the downloaded bitstream:
openFPGALoader -b genesys2 lowrisc_mocha_chip_mocha_genesys2_0.bit
- Look at UART output:
You should press the RESET button on the Genesys 2 board (BTN1) to see bootloader message "Boot ROM!". To exit screen press
screen $(ls /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_*-port0) 1000000ctrl-athenkand confirm withy.
In simulation you can do the following:
- Extract the example software:
tar -xzvf examples.tar.gz
- Make the simulator executable and run the hello world example by running the following command:
chmod +x Vtop_chip_verilator ./Vtop_chip_verilator -E release/hello_world_verilator
- Check the UART output:
Which should contain content including "Hello CHERI Mocha!"
cat uart0.log
Programming new software over SPI is also possible using the boot ROM. Here are the steps to run the hello world example:
- Open up a screen terminal in parallel:
screen $(ls /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_*-port0) 1000000 - In another terminal program the SPI. Note you must run this command twice, and it is expected that the second run reports "Fail":
In the terminal where you opened screen you should see the following output:
openFPGALoader --spi --offset 0x4000 --write-flash release/hello_world.bin openFPGALoader --spi --offset 0x4000 --write-flash release/hello_world.bin
Boot ROM! First reset Jumping to: 0x%0x Hello CHERI Mocha! timer 100us timer 100us timer 100us timer 100us
Please refer to the full developer guide for instructions on how to build the simulator, software and bitstream from source.