Fayalite is a Rust library for designing digital hardware. Published at https://crates.io/crates/fayalite
Find a file
Jacob Lifshay 040cefea21
All checks were successful
/ test (pull_request) Successful in 4m43s
/ test (push) Successful in 5m21s
add tx_only_uart example to readme
2025-10-22 20:31:25 -07:00
.forgejo/workflows build tx_only_uart in CI 2025-10-22 20:12:08 -07:00
crates add transmit-only UART example 2025-10-22 20:11:02 -07:00
scripts tests/sim: split expected output text into separate files 2024-12-05 18:17:13 -08:00
.gitignore add missing copyright headers 2024-09-22 15:30:05 -07:00
Cargo.lock Add peripherals and Arty A7 platforms -- blinky works correctly now on arty-a7-100t! 2025-10-19 23:13:28 -07:00
Cargo.toml Add peripherals and Arty A7 platforms -- blinky works correctly now on arty-a7-100t! 2025-10-19 23:13:28 -07:00
LICENSE.md initial public commit 2024-06-10 23:09:13 -07:00
Notices.txt initial public commit 2024-06-10 23:09:13 -07:00
README.md add tx_only_uart example to readme 2025-10-22 20:31:25 -07:00

Fayalite

Fayalite is a library for designing digital hardware -- a hardware description language (HDL) embedded in the Rust programming language. Fayalite's semantics are based on FIRRTL as interpreted by LLVM CIRCT.

Building the Blinky example for the Arty A7 100T on Linux

This uses the container image containing all the external programs and files that Fayalite needs to build for FPGAs, the sources for the container image are in https://git.libre-chip.org/libre-chip/fayalite-deps

Steps:

Install podman (or docker).

Run:

podman run --rm --security-opt label=disable --volume="$(pwd):$(pwd)" -w="$(pwd)" -it git.libre-chip.org/libre-chip/fayalite-deps:latest cargo run --example blinky yosys-nextpnr-xray --nextpnr-xilinx-chipdb-dir /opt/fayalite-deps/nextpnr-xilinx/xilinx --prjxray-db-dir /opt/fayalite-deps/prjxray-db --platform arty-a7-100t -o target/blinky-out

To actually program the FPGA, you'll need to install openFPGALoader on your host OS:

On Debian 12:

sudo apt update && sudo apt install openfpgaloader

Then program the FPGA:

sudo openFPGALoader --board arty_a7_100t target/blinky-out/blinky.bit

This will program the FPGA but leave the Flash chip unmodified, so the FPGA will revert when the board is power-cycled.

To program the Flash also, so it stays programmed when power-cycling the board:

sudo openFPGALoader --board arty_a7_100t -f target/blinky-out/blinky.bit

Building the Transmit-only UART example for the Arty A7 100T on Linux

Follow the steps above of building the Blinky example, but replace blinky with tx_only_uart.

View the output using tio which you can install in Debian using apt.

Find the correct USB device:

sudo tio --list

You want the device with a name like (note the if01, if00 is presumably the JTAG port): /dev/serial/by-id/usb-Digilent_Digilent_USB_Device_210319B4A51E-if01-port0

Connect to the serial port:

sudo tio -b115200 /dev/serial/by-id/put-your-device-id-here

You'll see (repeating endlessly):

Hello World from Fayalite!!!
Hello World from Fayalite!!!
Hello World from Fayalite!!!

Press Ctrl+T then q to exit tio.

Funding

NLnet Grants

This project was funded through the NGI0 Commons Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement № 101135429. Additional funding is made available by the Swiss State Secretariat for Education, Research and Innovation (SERI).