Include Litex dependency
[soc.git] / nix / verilog.nix
1 { version }:
2
3 { stdenv, python3Packages, runCommand, python2, yosys }:
4
5 let
6 # If we use ../. as source, then any change to
7 # any unrelated Nix file would cause a rebuild,
8 # since the build would have access to it.
9 src = runCommand "libresoc-verilog-source" {} ''
10 mkdir $out
11 cp -r ${../src} -T $out/src
12 cp -r ${../mkpinmux.sh} -T $out/mkpinmux.sh
13 cp -r ${../pinmux} -T $out/pinmux
14 cp -r ${../Makefile} -T $out/Makefile
15 '';
16 in
17 stdenv.mkDerivation {
18 pname = "libresoc.v";
19 inherit version;
20
21 inherit src;
22
23 strictDeps = true;
24
25 nativeBuildInputs = (with python3Packages; [
26 c4m-jtag nmigen-soc python libresoc-ieee754fpu libresoc-openpower-isa
27 ]) ++ [ yosys ];
28
29 configurePhase = "true";
30
31 buildPhase = ''
32 runHook preBuild
33 env -C pinmux ${python2}/bin/python src/pinmux_generator.py -v -s ls180 -o ls180
34 cp pinmux/ls180/ls180_pins.py src/soc/debug
35 cp pinmux/ls180/ls180_pins.py src/soc/litex/florent/libresoc
36 cd src
37 export PYTHONPATH="$PWD:$PYTHONPATH"
38 python3 soc/simple/issuer_verilog.py \
39 --debug=jtag --enable-core --enable-pll \
40 --enable-xics --enable-sram4x4kblock --disable-svp64 \
41 libresoc.v
42 runHook postBuild
43 '';
44
45 installPhase = ''
46 runHook preInstall
47 mv libresoc.v $out
48 runHook postInstall
49 '';
50
51 fixupPhase = "true";
52 }