about summary refs log tree commit diff
path: root/pkgs/applications/editors
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2023-12-30 20:07:21 +0100
committerBjørn Forsman <bjorn.forsman@gmail.com>2024-01-11 08:31:24 +0100
commit6f954b9b27a974c0746bcc1faa02559347a00e4d (patch)
tree2af90fea9dfbdd57130194064cf0e9f23a1281a0 /pkgs/applications/editors
parent61ad7230561a2f281eaf9e76a28f9fc195cac2b0 (diff)
quartus-prime-lite: add a test
Test that the wrapped quartus can build a SOF file.
Diffstat (limited to 'pkgs/applications/editors')
-rw-r--r--pkgs/applications/editors/quartus-prime/default.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/pkgs/applications/editors/quartus-prime/default.nix b/pkgs/applications/editors/quartus-prime/default.nix
index 538d3fb134cad..8275be235b431 100644
--- a/pkgs/applications/editors/quartus-prime/default.nix
+++ b/pkgs/applications/editors/quartus-prime/default.nix
@@ -117,6 +117,37 @@ in buildFHSEnv rec {
   passthru = {
     inherit unwrapped;
     tests = {
+      buildSof = runCommand "quartus-prime-lite-test-build-sof"
+        { nativeBuildInputs = [ quartus-prime-lite ];
+        }
+        ''
+          cat >mydesign.vhd <<EOF
+          library ieee;
+          use ieee.std_logic_1164.all;
+
+          entity mydesign is
+          port (
+              in_0: in std_logic;
+              in_1: in std_logic;
+              out_1: out std_logic
+          );
+          end mydesign;
+
+          architecture dataflow of mydesign is
+          begin
+              out_1 <= in_0 and in_1;
+          end dataflow;
+          EOF
+
+          quartus_sh --flow compile mydesign
+
+          if ! [ -f mydesign.sof ]; then
+              echo "error: failed to produce mydesign.sof" >&2
+              exit 1
+          fi
+
+          touch "$out"
+        '';
       questaEncryptedModel = runCommand "quartus-prime-lite-test-questa-encrypted-model" {} ''
         "${quartus-prime-lite}/bin/vlog" "${quartus-prime-lite.unwrapped}/questa_fse/intel/verilog/src/arriav_atoms_ncrypt.v"
         touch "$out"