From afe5b3e464dac266d410215d7c4238737b9e19bf Mon Sep 17 00:00:00 2001 From: Rutherther Date: Wed, 21 Feb 2024 18:21:45 +0100 Subject: [PATCH] feat: add questa executable files --- flake.nix | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index fa8dc83..824df22 100644 --- a/flake.nix +++ b/flake.nix @@ -109,13 +109,40 @@ bzip2.out ]; + questaFhsEnv = pkgs.buildFHSEnv { + targetPkgs = quartusTargetPkgs; + name = "questasim-env"; + runScript = pkgs.writeScript "questasim-env" '' + ${runScriptPrefix "questa" true} + if [[ ! -z $INSTALL_DIR ]]; then + export PATH=$INSTALL_DIR/bin:$PATH + fi + export LD_LIBRARY_PATH=/lib:$LD_LIBRARY_PATH + exec bash -c "$@" + ''; + }; + + questaFiles = [ + "crd2bin" "dumplog64" "flps_util" "hdloffice" "hm_entity" "jobspy" "mc2com" + "mc2perfanalyze" "mc2_util" "qhcvt" "qhdel" "qhdir" "qhgencomp" "qhlib" "qhmake" "qhmap" + "qhsim" "qrun" "qverilog" "qvhcom" "qvlcom" "qwave2vcd" "qwaveman" "qwaveutils" + "sccom" "scgenmod" "sdfcom" "sm_entity" "triage" "vcd2qwave" "vcd2wlf" "vcom" "vcover" + "vdbg" "vdel" "vdir" "vencrypt" "verror" "vgencomp" "vhencrypt" "vis" "visualizer" + "vlib" "vlog" "vmake" "vmap" "vopt" "vovl" "vrun" + "vsim" "wlf2log" "wlf2vcd" "wlfman" "wlfrecover" "xml2ucdb" + ]; + + wrappedQuestaScripts = map (x: pkgs.writeScriptBin x '' + exec ${questaFhsEnv}/bin/questasim-env ${x} + '') questaFiles; + in { packages.${system} = { diamond-shell = pkgs.buildFHSEnv { multiPkgs = diamondTargetPkgs; name = "diamond-shell"; multiArch = true; - runScript = pkgs.writeScript "quartus-shell" '' + runScript = pkgs.writeScript "diamond-shell" '' export LD_LIBRARY_PATH=/lib:$LD_LIBRARY_PATH exec bash ''; @@ -143,6 +170,16 @@ ''; }; + questa = pkgs.buildEnv { + name = "questa"; + paths = wrappedQuestaScripts; + + meta = { + description = "Environment containing QuestaSim/ModelSim executable files."; + mainProgram = "vsim"; + }; + }; + quartus-udev-rules = pkgs.writeTextFile { name = "quartus-usbblaster"; destination = "/etc/udev/rules.d/51-usbblaster.rules"; -- 2.48.1