Merge pull request #185308 from astro/silice

This commit is contained in:
Sandro 2022-08-30 18:06:32 +02:00 committed by GitHub
commit 79f570c2f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 164 additions and 0 deletions

View File

@ -0,0 +1,87 @@
{ stdenv, fetchFromGitHub, lib
, cmake, pkg-config, openjdk
, libuuid, python3
, silice, yosys, nextpnr, verilator
, dfu-util, icestorm, trellis
}:
stdenv.mkDerivation rec {
pname = "silice";
version = "unstable-2022-08-05";
src = fetchFromGitHub {
owner = "sylefeb";
repo = pname;
rev = "e26662ac757151e5dd8c60c45291b44906b1299f";
sha256 = "sha256-Q1JdgDlEErutZh0OfxYy5C4aVijFKlf6Hm5Iv+1jsj4=";
fetchSubmodules = true;
};
nativeBuildInputs = [
cmake
pkg-config
openjdk
];
buildInputs = [
libuuid
];
propagatedBuildInputs = [
(python3.withPackages (p: with p; [ edalize ]))
];
postPatch = ''
patchShebangs antlr/antlr.sh
# use nixpkgs version
rm -r python/pybind11
'';
installPhase = ''
make install
mkdir -p $out
cp -ar ../{bin,frameworks,lib} $out/
'';
passthru.tests =
let
testProject = project: stdenv.mkDerivation {
name = "${silice.name}-test-${project}";
nativeBuildInputs = [
silice
yosys
nextpnr
verilator
dfu-util
icestorm
trellis
];
src = "${src}/projects";
sourceRoot = "projects/${project}";
buildPhase = ''
targets=$(cut -d " " -f 2 configs | tr -d '\r')
for target in $targets ; do
make $target ARGS="--no_program"
done
'';
installPhase = ''
mkdir $out
for target in $targets ; do
cp -r BUILD_$target $out/
done
'';
};
in {
# a selection of test projects that build with the FPGA tools in
# nixpkgs
audio_sdcard_streamer = testProject "audio_sdcard_streamer";
bram_interface = testProject "bram_interface";
blinky = testProject "blinky";
pipeline_sort = testProject "pipeline_sort";
};
meta = with lib; {
description = "Open source language that simplifies prototyping and writing algorithms on FPGA architectures";
homepage = "https://github.com/sylefeb/Silice";
license = licenses.bsd2;
maintainers = [ maintainers.astro ];
};
}

View File

@ -0,0 +1,73 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, coreutils
, jinja2
, pandas
, pytestCheckHook
, which
, verilog
, yosys
}:
buildPythonPackage rec {
pname = "edalize";
version = "0.4.0";
src = fetchFromGitHub {
owner = "olofk";
repo = pname;
rev = "v${version}";
sha256 = "sha256-fpUNCxW7+uymodJ/yGME9VNcCEZdBROIdT1+blpgkzA=";
};
postPatch = ''
substituteInPlace tests/test_edam.py \
--replace /usr/bin/touch ${coreutils}/bin/touch
patchShebangs tests/mock_commands/vsim
'';
propagatedBuildInputs = [ jinja2 ];
checkInputs = [
pytestCheckHook
pandas
which
yosys
verilog
];
pythonImportsCheck = [ "edalize" ];
disabledTestPaths = [
"tests/test_apicula.py"
"tests/test_ascentlint.py"
"tests/test_diamond.py"
"tests/test_gatemate.py"
"tests/test_ghdl.py"
"tests/test_icarus.py"
"tests/test_icestorm.py"
"tests/test_ise.py"
"tests/test_mistral.py"
"tests/test_openlane.py"
"tests/test_oxide.py"
"tests/test_quartus.py"
"tests/test_radiant.py"
"tests/test_spyglass.py"
"tests/test_symbiyosys.py"
"tests/test_trellis.py"
"tests/test_vcs.py"
"tests/test_veribleformat.py"
"tests/test_veriblelint.py"
"tests/test_vivado.py"
"tests/test_xcelium.py"
"tests/test_xsim.py"
];
meta = with lib; {
description = "Abstraction library for interfacing EDA tools";
homepage = "https://github.com/olofk/edalize";
license = licenses.bsd2;
maintainers = [ maintainers.astro ];
};
}

View File

@ -10828,6 +10828,8 @@ with pkgs;
lua = lua5_3;
};
silice = callPackage ../development/compilers/silice { };
silver-searcher = callPackage ../tools/text/silver-searcher { };
simpleproxy = callPackage ../tools/networking/simpleproxy { };

View File

@ -2851,6 +2851,8 @@ in {
ed25519 = callPackage ../development/python-modules/ed25519 { };
edalize = callPackage ../development/python-modules/edalize { };
editables = callPackage ../development/python-modules/editables { };
editdistance = callPackage ../development/python-modules/editdistance { };