reorganize

This commit is contained in:
Sebastien Bourdeauducq 2019-06-06 17:25:11 +08:00
parent 63664ab959
commit a203307108
6 changed files with 40 additions and 45 deletions

View File

@ -1,8 +1,28 @@
{ pkgs }:
let
hx = import ./derivations.nix { inherit pkgs; };
in
hx // {
symbiflow = import ./eda/symbiflow.nix { inherit pkgs; yosys = hx.yosys; };
rec {
drvs = rec {
yosys = pkgs.callPackage ./eda/yosys.nix {};
symbiyosys = pkgs.symbiyosys.override { inherit yosys; };
nmigen = pkgs.callPackage ./eda/nmigen.nix { inherit yosys; };
scala-spinalhdl = pkgs.callPackage ./eda/scala-spinalhdl.nix {};
jtagtap = pkgs.callPackage ./cores/jtagtap.nix { inherit nmigen; };
minerva = pkgs.callPackage ./cores/minerva.nix { inherit nmigen; inherit jtagtap; };
vexriscv-small = pkgs.callPackage ./cores/vexriscv.nix {
inherit scala-spinalhdl;
name = "vexriscv-small";
scalaToRun = "vexriscv.demo.GenSmallAndProductive";
};
heavycomps = pkgs.callPackage ./heavycomps.nix { inherit nmigen; };
binutils-riscv = pkgs.callPackage ./compilers/binutils.nix { platform = "riscv32"; };
rust-riscv32imc-crates = pkgs.callPackage ./compilers/rust-riscv32imc-crates.nix { };
helloworld = pkgs.callPackage ./firmware { inherit rust-riscv32imc-crates binutils-riscv; };
};
lib = {
symbiflow = import ./eda/symbiflow.nix { inherit pkgs; inherit (drvs) yosys; };
vivado = import ./eda/vivado.nix { inherit pkgs; };
}
};
}

View File

@ -1,22 +0,0 @@
{ pkgs }:
rec {
yosys = pkgs.callPackage ./eda/yosys.nix {};
symbiyosys = pkgs.symbiyosys.override { inherit yosys; };
nmigen = pkgs.callPackage ./eda/nmigen.nix { inherit yosys; };
scala-spinalhdl = pkgs.callPackage ./eda/scala-spinalhdl.nix {};
jtagtap = pkgs.callPackage ./cores/jtagtap.nix { inherit nmigen; };
minerva = pkgs.callPackage ./cores/minerva.nix { inherit nmigen; inherit jtagtap; };
vexriscv-small = pkgs.callPackage ./cores/vexriscv.nix {
inherit scala-spinalhdl;
name = "vexriscv-small";
scalaToRun = "vexriscv.demo.GenSmallAndProductive";
};
heavycomps = pkgs.callPackage ./heavycomps.nix { inherit nmigen; };
binutils-riscv = pkgs.callPackage ./compilers/binutils.nix { platform = "riscv32"; };
rust-riscv32imc-crates = pkgs.callPackage ./compilers/rust-riscv32imc-crates.nix { };
helloworld = pkgs.callPackage ./firmware { inherit rust-riscv32imc-crates binutils-riscv; };
}

View File

@ -1,9 +1,8 @@
{ pkgs ? import <nixpkgs> {}
, hx ? import ../default.nix { inherit pkgs; }}:
{ pkgs, hx }:
let
symbiflowInput = pkgs.runCommand "helloworld-symbiflow-input" {
buildInputs = [ (pkgs.python3.withPackages(ps: [hx.nmigen hx.heavycomps])) hx.yosys ];
buildInputs = [ (pkgs.python3.withPackages(ps: [hx.drvs.nmigen hx.drvs.heavycomps])) hx.drvs.yosys ];
}
''
mkdir $out
@ -20,7 +19,7 @@ let
echo -n "--um-45k --speed 8 --package CABGA381" > $out/device
'';
in
hx.symbiflow.buildBitstream {
hx.lib.symbiflow.buildBitstream {
name = "helloworld-bitstream";
src = symbiflowInput;
}

View File

@ -1,9 +1,8 @@
{ pkgs ? import <nixpkgs> {}
, hx ? import ../default.nix { inherit pkgs; }}:
{ pkgs, hx }:
let
vivadoInput = pkgs.runCommand "helloworld-vivado-input" {
buildInputs = [ (pkgs.python3.withPackages(ps: [hx.nmigen hx.heavycomps])) hx.yosys ];
buildInputs = [ (pkgs.python3.withPackages(ps: [hx.drvs.nmigen hx.drvs.heavycomps])) hx.drvs.yosys ];
}
''
mkdir $out
@ -42,7 +41,7 @@ let
EOF
'';
in
hx.vivado.buildBitstream {
hx.lib.vivado.buildBitstream {
name = "helloworld-bitstream";
src = vivadoInput;
}

View File

@ -1,9 +1,8 @@
{ pkgs ? import <nixpkgs> {}
, hx ? import ../default.nix { inherit pkgs; }}:
{ pkgs, hx }:
let
symbiflowInput = pkgs.runCommand "simplesoc-symbiflow-input" {
buildInputs = [ (pkgs.python3.withPackages(ps: [hx.nmigen hx.heavycomps hx.minerva])) hx.yosys ];
buildInputs = [ (pkgs.python3.withPackages(ps: [hx.drvs.nmigen hx.drvs.heavycomps hx.drvs.minerva])) hx.drvs.yosys ];
}
''
mkdir $out
@ -20,7 +19,7 @@ let
echo -n "--um-45k --speed 8 --package CABGA381" > $out/device
'';
in
hx.symbiflow.buildBitstream {
hx.lib.symbiflow.buildBitstream {
name = "simplesoc-bitstream";
src = symbiflowInput;
}

View File

@ -1,13 +1,13 @@
{ }:
let
pkgs = import <nixpkgs> { overlays = [ (import ./overlay.nix) ]; };
derivations = import ./derivations.nix { inherit pkgs; };
jobs = derivations // {
hx = import ./default.nix { inherit pkgs; };
jobs = hx.drvs // {
inherit (pkgs) llvm_7 rustc cargo cargo-vendor;
helloworld_ecp5 = import ./examples/helloworld_ecp5.nix { inherit pkgs; };
helloworld_kintex7 = import ./examples/helloworld_kintex7.nix { inherit pkgs; };
simplesoc_ecp5 = import ./examples/simplesoc_ecp5.nix { inherit pkgs; };
helloworld_ecp5 = import ./examples/helloworld_ecp5.nix { inherit pkgs hx; };
helloworld_kintex7 = import ./examples/helloworld_kintex7.nix { inherit pkgs hx; };
simplesoc_ecp5 = import ./examples/simplesoc_ecp5.nix { inherit pkgs hx; };
};
in
builtins.mapAttrs (name: value: pkgs.lib.hydraJob value) jobs