Merge pull request #185308 from astro/silice

authored by Sandro and committed by GitHub 79f570c2 8e48c164

+164
+87
pkgs/development/compilers/silice/default.nix
··· 1 + { stdenv, fetchFromGitHub, lib 2 + , cmake, pkg-config, openjdk 3 + , libuuid, python3 4 + , silice, yosys, nextpnr, verilator 5 + , dfu-util, icestorm, trellis 6 + }: 7 + 8 + stdenv.mkDerivation rec { 9 + pname = "silice"; 10 + version = "unstable-2022-08-05"; 11 + 12 + src = fetchFromGitHub { 13 + owner = "sylefeb"; 14 + repo = pname; 15 + rev = "e26662ac757151e5dd8c60c45291b44906b1299f"; 16 + sha256 = "sha256-Q1JdgDlEErutZh0OfxYy5C4aVijFKlf6Hm5Iv+1jsj4="; 17 + fetchSubmodules = true; 18 + }; 19 + 20 + nativeBuildInputs = [ 21 + cmake 22 + pkg-config 23 + openjdk 24 + ]; 25 + buildInputs = [ 26 + libuuid 27 + ]; 28 + propagatedBuildInputs = [ 29 + (python3.withPackages (p: with p; [ edalize ])) 30 + ]; 31 + 32 + postPatch = '' 33 + patchShebangs antlr/antlr.sh 34 + # use nixpkgs version 35 + rm -r python/pybind11 36 + ''; 37 + 38 + installPhase = '' 39 + make install 40 + mkdir -p $out 41 + cp -ar ../{bin,frameworks,lib} $out/ 42 + ''; 43 + 44 + passthru.tests = 45 + let 46 + testProject = project: stdenv.mkDerivation { 47 + name = "${silice.name}-test-${project}"; 48 + nativeBuildInputs = [ 49 + silice 50 + yosys 51 + nextpnr 52 + verilator 53 + dfu-util 54 + icestorm 55 + trellis 56 + ]; 57 + src = "${src}/projects"; 58 + sourceRoot = "projects/${project}"; 59 + buildPhase = '' 60 + targets=$(cut -d " " -f 2 configs | tr -d '\r') 61 + for target in $targets ; do 62 + make $target ARGS="--no_program" 63 + done 64 + ''; 65 + installPhase = '' 66 + mkdir $out 67 + for target in $targets ; do 68 + cp -r BUILD_$target $out/ 69 + done 70 + ''; 71 + }; 72 + in { 73 + # a selection of test projects that build with the FPGA tools in 74 + # nixpkgs 75 + audio_sdcard_streamer = testProject "audio_sdcard_streamer"; 76 + bram_interface = testProject "bram_interface"; 77 + blinky = testProject "blinky"; 78 + pipeline_sort = testProject "pipeline_sort"; 79 + }; 80 + 81 + meta = with lib; { 82 + description = "Open source language that simplifies prototyping and writing algorithms on FPGA architectures"; 83 + homepage = "https://github.com/sylefeb/Silice"; 84 + license = licenses.bsd2; 85 + maintainers = [ maintainers.astro ]; 86 + }; 87 + }
+73
pkgs/development/python-modules/edalize/default.nix
··· 1 + { lib 2 + , buildPythonPackage 3 + , fetchFromGitHub 4 + , coreutils 5 + , jinja2 6 + , pandas 7 + , pytestCheckHook 8 + , which 9 + , verilog 10 + , yosys 11 + }: 12 + 13 + buildPythonPackage rec { 14 + pname = "edalize"; 15 + version = "0.4.0"; 16 + 17 + src = fetchFromGitHub { 18 + owner = "olofk"; 19 + repo = pname; 20 + rev = "v${version}"; 21 + sha256 = "sha256-fpUNCxW7+uymodJ/yGME9VNcCEZdBROIdT1+blpgkzA="; 22 + }; 23 + 24 + postPatch = '' 25 + substituteInPlace tests/test_edam.py \ 26 + --replace /usr/bin/touch ${coreutils}/bin/touch 27 + patchShebangs tests/mock_commands/vsim 28 + ''; 29 + 30 + propagatedBuildInputs = [ jinja2 ]; 31 + 32 + checkInputs = [ 33 + pytestCheckHook 34 + pandas 35 + which 36 + yosys 37 + verilog 38 + ]; 39 + 40 + pythonImportsCheck = [ "edalize" ]; 41 + 42 + disabledTestPaths = [ 43 + "tests/test_apicula.py" 44 + "tests/test_ascentlint.py" 45 + "tests/test_diamond.py" 46 + "tests/test_gatemate.py" 47 + "tests/test_ghdl.py" 48 + "tests/test_icarus.py" 49 + "tests/test_icestorm.py" 50 + "tests/test_ise.py" 51 + "tests/test_mistral.py" 52 + "tests/test_openlane.py" 53 + "tests/test_oxide.py" 54 + "tests/test_quartus.py" 55 + "tests/test_radiant.py" 56 + "tests/test_spyglass.py" 57 + "tests/test_symbiyosys.py" 58 + "tests/test_trellis.py" 59 + "tests/test_vcs.py" 60 + "tests/test_veribleformat.py" 61 + "tests/test_veriblelint.py" 62 + "tests/test_vivado.py" 63 + "tests/test_xcelium.py" 64 + "tests/test_xsim.py" 65 + ]; 66 + 67 + meta = with lib; { 68 + description = "Abstraction library for interfacing EDA tools"; 69 + homepage = "https://github.com/olofk/edalize"; 70 + license = licenses.bsd2; 71 + maintainers = [ maintainers.astro ]; 72 + }; 73 + }
+2
pkgs/top-level/all-packages.nix
··· 10828 10828 lua = lua5_3; 10829 10829 }; 10830 10830 10831 + silice = callPackage ../development/compilers/silice { }; 10832 + 10831 10833 silver-searcher = callPackage ../tools/text/silver-searcher { }; 10832 10834 10833 10835 simpleproxy = callPackage ../tools/networking/simpleproxy { };
+2
pkgs/top-level/python-packages.nix
··· 2851 2851 2852 2852 ed25519 = callPackage ../development/python-modules/ed25519 { }; 2853 2853 2854 + edalize = callPackage ../development/python-modules/edalize { }; 2855 + 2854 2856 editables = callPackage ../development/python-modules/editables { }; 2855 2857 2856 2858 editdistance = callPackage ../development/python-modules/editdistance { };