diff options
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/compilers/yosys/plugins/symbiflow-pmgen.patch | 15 | ||||
-rw-r--r-- | pkgs/development/compilers/yosys/plugins/symbiflow.nix | 47 |
2 files changed, 26 insertions, 36 deletions
diff --git a/pkgs/development/compilers/yosys/plugins/symbiflow-pmgen.patch b/pkgs/development/compilers/yosys/plugins/symbiflow-pmgen.patch deleted file mode 100644 index 8af0f86a89b40..0000000000000 --- a/pkgs/development/compilers/yosys/plugins/symbiflow-pmgen.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/yql-qlf-plugin/Makefile b/ql-qlf-plugin/Makefile -index 2819055c9fe..0e391581012 100644 ---- a/ql-qlf-plugin/Makefile -+++ b/ql-qlf-plugin/Makefile -@@ -55,10 +55,6 @@ VERILOG_MODULES = $(COMMON)/cells_sim.v \ - $(PP3_DIR)/mult_sim.v \ - $(PP3_DIR)/qlal3_sim.v \ - --retrieve-pmgen:=$(shell mkdir -p pmgen && wget -nc -O pmgen/pmgen.py https://raw.githubusercontent.com/SymbiFlow/yosys/master%2Bwip/passes/pmgen/pmgen.py) -- --pre-build:=$(shell python3 pmgen/pmgen.py -o pmgen/ql-dsp-pm.h -p ql_dsp ql_dsp.pmg) -- - install_modules: $(VERILOG_MODULES) - $(foreach f,$^,install -D $(f) $(DATA_DIR)/quicklogic/$(f);) - diff --git a/pkgs/development/compilers/yosys/plugins/symbiflow.nix b/pkgs/development/compilers/yosys/plugins/symbiflow.nix index 1ff817a82969e..f383efbd44e8b 100644 --- a/pkgs/development/compilers/yosys/plugins/symbiflow.nix +++ b/pkgs/development/compilers/yosys/plugins/symbiflow.nix @@ -8,19 +8,22 @@ , zlib , yosys-symbiflow , uhdm +, capnproto , surelog +, antlr4 , flatbuffers +, pkg-config }: let + version = "1.20230425"; + src = fetchFromGitHub { - owner = "chipsalliance"; - repo = "yosys-f4pga-plugins"; - rev = "08430ec4f53d1cf9d6a2091211d6c5ce501d5486"; - hash = "sha256-xCFi8OrNfsKt7bVSYJ/yuBify/pyCU1rI16gaCBgil8="; + owner = "chipsalliance"; + repo = "yosys-f4pga-plugins"; + rev = "v${version}"; + hash = "sha256-KNkmhvpKTby85P88+DqCOOGxIKpzbw5KF9ymqy40pfw="; }; - version = "2023.02.08"; - # Supported symbiflow plugins. # # The following are disabled: @@ -38,7 +41,7 @@ "systemverilog" ]; - static_gtest = gtest.dev.overrideAttrs (old: { + static_gtest = gtest.overrideAttrs (old: { dontDisableStatic = true; disableHardening = [ "pie" ]; cmakeFlags = old.cmakeFlags ++ ["-DBUILD_SHARED_LIBS=OFF"]; @@ -49,23 +52,26 @@ in lib.genAttrs plugins (plugin: stdenv.mkDerivation (rec { inherit src version plugin; enableParallelBuilding = true; - nativeBuildInputs = [ python3 ]; - buildInputs = [ yosys readline zlib uhdm surelog ]; + nativeBuildInputs = [ python3 pkg-config ]; + buildInputs = [ + yosys + readline + zlib + uhdm + surelog + capnproto + antlr4.runtime.cpp + ]; # xdc has an incorrect path to a test which has yet to be patched doCheck = plugin != "xdc"; nativeCheckInputs = [ static_gtest ]; - # ql-qlf tries to fetch a yosys script from github - # Run the script in preBuild instead. - patches = lib.optional ( plugin == "ql-qlf" ) ./symbiflow-pmgen.patch; - + # A Makefile rule tries to wget-fetch a yosys script from github. + # Link the script from our yosys sources in preBuild instead, so that + # the Makefile rule is a no-op. preBuild = '' - export LDFLAGS="-L${flatbuffers}/lib" - mkdir -p ql-qlf-plugin/pmgen - '' - + lib.optionalString ( plugin == "ql-qlf" ) '' - python3 ${yosys.src}/passes/pmgen/pmgen.py -o ql-qlf-plugin/pmgen/ql-dsp-pm.h -p ql_dsp ql-qlf-plugin/ql_dsp.pmg + ln -s ${yosys.src}/passes/pmgen/pmgen.py pmgen.py ''; # Providing a symlink avoids the need for patching the test makefile @@ -83,10 +89,9 @@ in lib.genAttrs plugins (plugin: stdenv.mkDerivation (rec { "YOSYS_DATA_DIR=\${out}/share/yosys/" ]; + checkTarget = "test"; checkFlags = [ - "YOSYS_PLUGINS_DIR=\${NIX_BUILD_TOP}/source/${plugin}-plugin" - "YOSYS_DATA_DIR=\${NIX_BUILD_TOP}/source/${plugin}-plugin" - ( "NIX_YOSYS_PLUGIN_DIRS=\${NIX_BUILD_TOP}/source/${plugin}-plugin" + ( "NIX_YOSYS_PLUGIN_DIRS=\${NIX_BUILD_TOP}/source/${plugin}-plugin/build" # sdc and xdc plugins use design introspection for their tests + (lib.optionalString ( plugin == "sdc" || plugin == "xdc" ) ":${yosys-symbiflow.design_introspection}/share/yosys/plugins/") |