Hive-S internals
LiteX/VexRiscv RISC-V soft-SoC on Artix-7. Buildroot rootfs, UWM firmware, single SPI flash image.
Project layout
| Path | Content |
|---|---|
project.json | Config: repos, SoC args, flash mapping. |
container/ | Dockerfile (RISC-V toolchain, LiteX pinned to tag 2025.04, bun), entrypoint. |
hw/ | LiteX SoC generator: make.py, soc_linux.py, vhdl/, xci/ (AXI clock converter IP). |
buildroot/ | BR2_EXTERNAL tree: configs/ntl_defconfig, board/hive-s/ (kernel config, post-image), patches/ (LiteX/LiteEth/LiteSPI/VexRiscv kernel patches, vexriscv-aes ssl patches), rootfs_overlay/ (motd, S99uwm.sh, /opt/ntl env + CA + uwm-loader). |
images/ | Build outputs + bitstream.bin. Never touched by template updates. |
tools/ | Vivado/OpenOCD flash scripts (flash_device.tcl, FTDI/Arty configs, bscan-spi bitstream). |
ip/ | Generated IP cores (output of build hw). |
Docker volumes: ntl_buildhive_hw_<name>_<id> and ntl_buildhive_sw_<name>_<id>. Host mounts: images/, hw/ (ro, HW container), buildroot/ (ro, SW container).
build hw
- HW container: pulls LiteX + VexRiscv sources, runs
./make.py <hw.args>- generates gateware sources and the device tree (rv32.dtb). - Rewrites paths in the generated
aionyx_hive_s.tclfrom container to host paths. - Host:
vivado -mode batch -source aionyx_hive_s.tclbuilds the IP cores, copied toip/.
Bitstream generation itself is manual in Vivado; import the result with buildhive configure bitstream -f <file> (→ images/bitstream.bin).
build sw
SW container, two stages:
- UWM - clone
sw.uwmintosources/uwm,make out/hive-s_full_tls→images/uwm.xz+uwm-loader; loader also copied intobuildroot/rootfs_overlay/opt/ntl. - Buildroot - clone
sw.buildroot,make ntl_defconfig(BR2_EXTERNAL=/buildroot),make -j→images/:Image.lzma,rootfs.cpio.xz,u-boot.bin,u-boot.dtb,opensbi.bin,rv32.dtb.
Flash image
build flash runs on the host, no Docker:
- Each
flashmapping entry is wrapped as.fbi: 4-byte length + 4-byte CRC32 + data. mapping_table.binholds the sorted (src, dst) address pairs.images/flash.binlayout: bitstream at offset 0, each component atsrc − 0x01000000, mapping table at0x3F0000.
At boot the SoC firmware walks the mapping table and copies each blob from its flash src to its RAM dst. Entries without dst (e.g. uwm.xz) stay in flash. info flash prints the table and the assembled layout.
deploy flash
vivado -mode gui -source tools/flash_device.tcl - programs the SPI flash over JTAG. Prompts for device selection if several are connected.