yosys*: cleanup, update (#397611)

This commit is contained in:
Gaétan Lepage
2025-07-10 11:43:38 +02:00
committed by GitHub
5 changed files with 51 additions and 39 deletions
@@ -1,18 +1,20 @@
diff --git a/tests/cxxrtl/run-test.sh b/tests/cxxrtl/run-test.sh
index ee299fc82..595cd3f88 100755
--- a/tests/cxxrtl/run-test.sh
+++ b/tests/cxxrtl/run-test.sh
@@ -5,7 +5,7 @@ set -ex
run_subtest () {
local subtest=$1; shift
- ${CC:-gcc} -std=c++11 -O2 -o cxxrtl-test-${subtest} -I../../backends/cxxrtl/runtime test_${subtest}.cc -lstdc++
+ ${CXX:-gcc} -std=c++11 -O2 -o cxxrtl-test-${subtest} -I../../backends/cxxrtl/runtime test_${subtest}.cc -lstdc++
./cxxrtl-test-${subtest}
}
@@ -14,4 +14,4 @@ run_subtest value_fuzz
# Compile-only test.
../../yosys -p "read_verilog test_unconnected_output.v; proc; clean; write_cxxrtl cxxrtl-test-unconnected_output.cc"
../../yosys -p "read_verilog test_unconnected_output.v; select =*; proc; clean; write_cxxrtl cxxrtl-test-unconnected_output.cc"
-${CC:-gcc} -std=c++11 -c -o cxxrtl-test-unconnected_output -I../../backends/cxxrtl/runtime cxxrtl-test-unconnected_output.cc
+${CXX:-gcc} -std=c++11 -c -o cxxrtl-test-unconnected_output -I../../backends/cxxrtl/runtime cxxrtl-test-unconnected_output.cc
diff --git a/tests/fmt/run-test.sh b/tests/fmt/run-test.sh
@@ -21,7 +23,7 @@ index 998047f83..2a4a59f01 100644
+++ b/tests/fmt/run-test.sh
@@ -51,7 +51,7 @@ test_cxxrtl () {
local subtest=$1; shift
../../yosys -p "read_verilog ${subtest}.v; proc; clean; write_cxxrtl -print-output std::cerr yosys-${subtest}.cc"
- ${CC:-gcc} -std=c++11 -o yosys-${subtest} -I../../backends/cxxrtl/runtime ${subtest}_tb.cc -lstdc++
+ ${CXX:-gcc} -std=c++11 -o yosys-${subtest} -I../../backends/cxxrtl/runtime ${subtest}_tb.cc -lstdc++
@@ -29,7 +31,7 @@ index 998047f83..2a4a59f01 100644
iverilog -o iverilog-${subtest} ${subtest}.v ${subtest}_tb.v
./iverilog-${subtest} |grep -v '\$finish called' >iverilog-${subtest}.log
@@ -69,7 +69,7 @@ diff iverilog-always_full.log iverilog-always_full-1.log
../../yosys -p "read_verilog display_lm.v" >yosys-display_lm.log
../../yosys -p "read_verilog display_lm.v; write_cxxrtl yosys-display_lm.cc"
-${CC:-gcc} -std=c++11 -o yosys-display_lm_cc -I../../backends/cxxrtl/runtime display_lm_tb.cc -lstdc++
@@ -1,24 +1,33 @@
{
stdenv,
lib,
bison,
boost,
stdenv,
fetchFromGitHub,
# nativeBuildInputs
bison,
flex,
gtkwave,
libffi,
makeWrapper,
pkg-config,
# propagatedBuildInputs
libffi,
python3,
readline,
symlinkJoin,
tcl,
iverilog,
zlib,
# tests
gtkwave,
iverilog,
# passthru
# plugins
symlinkJoin,
yosys,
makeWrapper,
yosys-bluespec,
yosys-ghdl,
yosys-symbiflow,
nix-update-script,
enablePython ? true, # enable python binding
}:
@@ -73,21 +82,16 @@ let
ghdl = yosys-ghdl;
} // (yosys-symbiflow);
boost_python = boost.override {
enablePython = true;
python = python3;
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "yosys";
version = "0.51";
version = "0.54";
src = fetchFromGitHub {
owner = "YosysHQ";
repo = "yosys";
tag = "v${finalAttrs.version}";
hash = "sha256-Y2Gf3CXd1em+4dlIo2+dwfZbqahM3kqG0rZUTjkIZak=";
hash = "sha256-yEAZvdBc+923a0OTtaCpTbrl33kcmvgwFlL5VEssHkQ=";
fetchSubmodules = true;
leaveDotGit = true;
postFetch = ''
@@ -106,27 +110,32 @@ stdenv.mkDerivation (finalAttrs: {
enableParallelBuilding = true;
nativeBuildInputs = [
pkg-config
bison
flex
pkg-config
];
propagatedBuildInputs = [
tcl
readline
libffi
zlib
(python3.withPackages (
pp: with pp; [
click
]
))
] ++ lib.optional enablePython boost_python;
propagatedBuildInputs =
[
libffi
readline
tcl
zlib
(python3.withPackages (
pp: with pp; [
click
]
))
]
++ lib.optionals enablePython [
python3.pkgs.boost
];
makeFlags = [ "PREFIX=${placeholder "out"}" ];
patches = [
./plugin-search-dirs.patch
./fix-clang-build.patch # see https://github.com/YosysHQ/yosys/issues/2011
./fix-clang-build.patch
];
postPatch = ''
@@ -170,14 +179,16 @@ stdenv.mkDerivation (finalAttrs: {
passthru = {
inherit withPlugins allPlugins;
updateScript = nix-update-script { };
};
meta = with lib; {
meta = {
description = "Open RTL synthesis framework and tools";
homepage = "https://yosyshq.net/yosys/";
license = licenses.isc;
platforms = platforms.all;
maintainers = with maintainers; [
changelog = "https://github.com/YosysHQ/yosys/releases/tag/v${finalAttrs.version}";
license = lib.licenses.isc;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [
shell
thoughtpolice
Luflosi
-1
View File
@@ -6135,7 +6135,6 @@ with pkgs;
);
# prolog
yosys = callPackage ../development/compilers/yosys { };
yosys-bluespec = callPackage ../development/compilers/yosys/plugins/bluespec.nix { };
yosys-ghdl = callPackage ../development/compilers/yosys/plugins/ghdl.nix { };
yosys-synlig = callPackage ../development/compilers/yosys/plugins/synlig.nix { };