Skip to content

Commit

Permalink
Add nix devShell with deps for the /syn yosys synthesis job
Browse files Browse the repository at this point in the history
  • Loading branch information
hcallahan-lowrisc committed Mar 29, 2024
1 parent c9c6d47 commit 813f510
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
7 changes: 7 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,18 @@
'';
};

syn_shell = shell.override (prev: {
name = "ibex-devshell-synthesis";
nativeBuildInputs = prev.nativeBuildInputs ++ ibex_syn.deps;
shellHook = prev.shellHook + ibex_syn.profile;
});

in {
devShells.${system} = {
default = inputs.self.devShells.${system}.shell;

inherit shell;
inherit syn_shell;
};
};
}
52 changes: 52 additions & 0 deletions nix/syn.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright lowRISC Contributors.
# Licensed under the MIT License, see LICENSE for details.
# SPDX-License-Identifier: MIT

# Deps for Ibex synthesis jobs

{
inputs,
pkgs,
...
}: let

sv2v_local = import ./sv2v.nix {inherit inputs pkgs;};

ibex_syn_deps = [
sv2v_local.default
] ++ (with pkgs; [
# haskellPackages.sv2v # broken
yosys
openroad
]);

# Create a dumb package of nangate45
# > All we need is a path to the sources
nangate45 = pkgs.stdenv.mkDerivation rec {
pname = "openroad-nangate45";
version = "PDKv1.3_v2010_12.Apache.CCL";
src = pkgs.fetchFromGitHub {
owner = "The-OpenROAD-Project";
repo = "OpenROAD-flow-scripts";
rev = "181e9133776117ea1b9f74dbacbfdaadff8c331b"; # Tag: v3.0
hash = "sha256-fYAdhBsMcuCXmPMQVCRdm75Tk0rd9zLnLfJdjhnhC00=";
};
sourceRoot = "${src.name}/flow/platforms/nangate45";
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''
mkdir -p $out
cp -r ./* $out
'';
};

ibex_syn_profile = ''
export LR_SYNTH_CELL_LIBRARY_NAME=nangate
export LR_SYNTH_CELL_LIBRARY_PATH=${nangate45}/lib/NangateOpenCellLibrary_typical.lib
'';

in {

deps = ibex_syn_deps;
profile = ibex_syn_profile;

}

0 comments on commit 813f510

Please sign in to comment.