From 3ee8a5c3dbcbb4e53bee1b81026849bbb4ecb9eb Mon Sep 17 00:00:00 2001 From: randogoth Date: Sun, 25 Oct 2026 12:09:42 +0200 Subject: [PATCH] chore: add Quartus Prime Lite toolchain via nix flake in devbox --- .gitignore | 1 + devbox.json | 5 ++++- fpga/src/strix.qsf | 2 +- nix/flake.lock | 27 +++++++++++++++++++++++++++ nix/flake.nix | 21 +++++++++++++++++++++ 5 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 nix/flake.lock create mode 100644 nix/flake.nix diff --git a/.gitignore b/.gitignore index 055a0a8..674edf8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ fpga/**/output_files/ fpga/**/simulation/ *.qws *.qsf.bak +*_assignment_defaults.qdf *.qarlog *.rpt *.summary diff --git a/devbox.json b/devbox.json index 88cd77a..58bab44 100644 --- a/devbox.json +++ b/devbox.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.17.2/.schema/devbox.schema.json", - "packages": ["arduino-cli@latest"], + "packages": ["arduino-cli@latest", "path:./nix#quartus"], "shell": { "init_hook": [ "echo 'Welcome to devbox!' > /dev/null" @@ -13,6 +13,9 @@ ], "build": [ "arduino-cli compile --fqbn arduino:samd:mkrvidor4000 arduino/strix" + ], + "fpga": [ + "cd fpga/src && quartus_sh --flow compile strix" ] } } diff --git a/fpga/src/strix.qsf b/fpga/src/strix.qsf index 75ba465..e516554 100644 --- a/fpga/src/strix.qsf +++ b/fpga/src/strix.qsf @@ -42,7 +42,7 @@ set_global_assignment -name DEVICE 10CL016YU256C8G set_global_assignment -name TOP_LEVEL_ENTITY strix set_global_assignment -name ORIGINAL_QUARTUS_VERSION 23.1STD.1 set_global_assignment -name PROJECT_CREATION_TIME_DATE "18:01:00 JULY 21, 2024" -set_global_assignment -name LAST_QUARTUS_VERSION "23.1std.1 Lite Edition" +set_global_assignment -name LAST_QUARTUS_VERSION "25.1std.0 Lite Edition" set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0 set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85 diff --git a/nix/flake.lock b/nix/flake.lock new file mode 100644 index 0000000..3ddc189 --- /dev/null +++ b/nix/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1792773339, + "narHash": "sha256-rZLrzrC6i+jnTAlvPZHogKDulY7WWDEv9hJeHieO7Zw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3ec636362e1816bc2f0888fa0fa2c69f1bc9e504", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/nix/flake.nix b/nix/flake.nix new file mode 100644 index 0000000..4ede953 --- /dev/null +++ b/nix/flake.nix @@ -0,0 +1,21 @@ +{ + description = "STRIX FPGA toolchain"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + outputs = { nixpkgs, ... }: + let + # Quartus is unfree (free of charge, proprietary) and only built for x86_64-linux. + pkgs = import nixpkgs { + system = "x86_64-linux"; + config.allowUnfree = true; + }; + in + { + # Only the Vidor's FPGA family; Questa is dropped in favour of open-source simulators. + packages.x86_64-linux.quartus = pkgs.quartus-prime-lite.override { + supportedDevices = [ "Cyclone 10 LP" ]; + withQuesta = false; + }; + }; +}