After tinkering with nix.flakes (probably not what is meant to be done) I added an extra line
(build { target = "kasli_soc"; variant = "custom_master"; json = /path/to/custom_master.json; }) //
I can now get the firmware to build using nix build #.kasli_soc-custom_master-firmware
but when I try and use the gateware
or jtag
options (needed to build the boot.bin
) I get the following error:
Urukul (EEM0) starting at RTIO channel 0x000000
DIO (EEM2) starting at RTIO channel 0x000006
DIO (EEM3) starting at RTIO channel 0x00000e
DIO (EEM4) starting at RTIO channel 0x000016
DIO (EEM5) starting at RTIO channel 0x00001e
DIO (EEM6) starting at RTIO channel 0x000026
DIO (EEM7) starting at RTIO channel 0x00002e
Fastino (EEM8) starting at RTIO channel 0x000036
USER LED at RTIO channel 0x000037
USER LED at RTIO channel 0x000038
/etc/profile: line 32: /opt/Xilinx/Vivado/2022.2/settings64.sh: No such file or directory
Traceback (most recent call last):
File "/nix/store/8v9930mhbzwkyfrzm1yhpq16zjr3ysf8-gateware/kasli_soc.py", line 530, in <module>
main()
File "/nix/store/8v9930mhbzwkyfrzm1yhpq16zjr3ysf8-gateware/kasli_soc.py", line 526, in main
soc.build(build_dir=args.g)
File "/nix/store/xa81fg7ifj5sam7iwvzq85pnz98nn19f-python3-3.10.12-env/lib/python3.10/site-packages/migen_axi/integration/soc_core.py", line 169, in build
self.platform.build(self, *args, **kwargs)
File "/nix/store/xa81fg7ifj5sam7iwvzq85pnz98nn19f-python3-3.10.12-env/lib/python3.10/site-packages/migen/build/xilinx/platform.py", line 59, in build
return self.toolchain.build(self, *args, **kwargs)
File "/nix/store/xa81fg7ifj5sam7iwvzq85pnz98nn19f-python3-3.10.12-env/lib/python3.10/site-packages/migen/build/xilinx/vivado.py", line 224, in build
_run_vivado(build_name)
File "/nix/store/xa81fg7ifj5sam7iwvzq85pnz98nn19f-python3-3.10.12-env/lib/python3.10/site-packages/migen/build/xilinx/vivado.py", line 69, in _run_vivado
raise OSError("Subprocess failed")
OSError: Subprocess failed
I have /opt/Xilinx/Vivado/2022.2/settings64.sh
as the location the file is installed and it all works compile when launching through nix develop
and then manually building gateware/firmware as described above.
This looks like the better solution than reverse engineering the nix commands, but can't quite work out why it is failing to find the file - any help appreciated.