Skip to content

Commit 1b9913a

Browse files
Add nix devShell with deps for the /syn yosys synthesis job
1 parent c9c6d47 commit 1b9913a

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

flake.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,18 @@
101101
'';
102102
};
103103

104+
syn_shell = shell.override (prev: {
105+
name = "ibex-devshell-synthesis";
106+
nativeBuildInputs = prev.nativeBuildInputs ++ ibex_syn.deps;
107+
shellHook = prev.shellHook + ibex_syn.profile;
108+
});
109+
104110
in {
105111
devShells.${system} = {
106112
default = inputs.self.devShells.${system}.shell;
107113

108114
inherit shell;
115+
inherit syn_shell;
109116
};
110117
};
111118
}

nix/syn.nix

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright lowRISC Contributors.
2+
# Licensed under the MIT License, see LICENSE for details.
3+
# SPDX-License-Identifier: MIT
4+
5+
# Deps for Ibex synthesis jobs
6+
7+
{
8+
inputs,
9+
pkgs,
10+
...
11+
}: let
12+
13+
sv2v_local = import ./sv2v.nix {inherit inputs pkgs;};
14+
15+
ibex_syn_deps = [
16+
sv2v_local.default
17+
] ++ (with pkgs; [
18+
# haskellPackages.sv2v # broken
19+
yosys
20+
openroad
21+
]);
22+
23+
# Create a dumb package of nangate45
24+
# > All we need is a path to the sources
25+
nangate45 = pkgs.stdenv.mkDerivation rec {
26+
pname = "openroad-nangate45";
27+
version = "PDKv1.3_v2010_12.Apache.CCL";
28+
src = pkgs.fetchFromGitHub {
29+
owner = "The-OpenROAD-Project";
30+
repo = "OpenROAD-flow-scripts";
31+
rev = "v3.0";
32+
hash = "sha256-fYAdhBsMcuCXmPMQVCRdm75Tk0rd9zLnLfJdjhnhC00=";
33+
};
34+
sourceRoot = "${src.name}/flow/platforms/nangate45";
35+
phases = [ "unpackPhase" "installPhase" ];
36+
installPhase = ''
37+
mkdir -p $out
38+
cp -r ./* $out
39+
'';
40+
};
41+
42+
ibex_syn_profile = ''
43+
export LR_SYNTH_CELL_LIBRARY_NAME=nangate
44+
export LR_SYNTH_CELL_LIBRARY_PATH=${nangate45}/lib/NangateOpenCellLibrary_typical.lib
45+
'';
46+
47+
in {
48+
49+
deps = ibex_syn_deps;
50+
profile = ibex_syn_profile;
51+
52+
}

0 commit comments

Comments
 (0)