From 5a8326e9d4b5462965ca03f97a447e0a7b186ea2 Mon Sep 17 00:00:00 2001 From: Quinn Unger Date: Tue, 14 Jul 2026 16:17:26 +0100 Subject: [PATCH] add build target to dump all fusesoc cores into a directory (#26) --- .gitignore | 1 + flake.nix | 2 ++ lib/fusesocLib.nix | 12 +++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b841e60..af78f8f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .direnv .envrc build +result diff --git a/flake.nix b/flake.nix index 3db2aa8..56a8339 100644 --- a/flake.nix +++ b/flake.nix @@ -44,6 +44,8 @@ legacyPackages.fusesocCores = fusesoc.lib.cores; packages = { + default = fusesoc.lib.dumpCores fusesoc.lib.cores; + inherit (moppkgs.packages.${system}) edalize; yosys-slang = pkgs.callPackage ./pkgs/yosys-slang.nix { }; diff --git a/lib/fusesocLib.nix b/lib/fusesocLib.nix index 7bfc6c2..deef46c 100644 --- a/lib/fusesocLib.nix +++ b/lib/fusesocLib.nix @@ -1,11 +1,12 @@ { - lib, fetchFromGitHub, fetchgit, fetchsvn, fetchurl, formats, fusesoc, + lib, + linkFarm, remarshal, runCommand, stdenv, @@ -276,6 +277,15 @@ rec { exec ${fusesoc}/bin/fusesoc $@ ''; + dumpCores = + coreSet: + linkFarm "fusesocCores" ( + map (x: { + inherit (x) name; + path = x; + }) (toCoreList coreSet) + ); + runCore = import ./runCore.nix { inherit lib -- 2.51.2