2024-04-19 15:13:39 +00:00
|
|
|
{
|
|
|
|
description = "ECP5 toolchain template project";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
};
|
|
|
|
|
2024-09-22 15:55:52 +00:00
|
|
|
outputs = inputs@{ nixpkgs, flake-utils, ... }:
|
2024-04-19 15:13:39 +00:00
|
|
|
let
|
2024-09-22 15:55:52 +00:00
|
|
|
python-overlay = import ./python.nix;
|
2024-04-19 15:13:39 +00:00
|
|
|
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
|
|
|
|
forAllSystems = function:
|
|
|
|
nixpkgs.lib.genAttrs systems (system: function (
|
|
|
|
import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
config.allowUnfree = true;
|
|
|
|
overlays = [
|
2024-09-22 15:55:52 +00:00
|
|
|
python-overlay
|
|
|
|
];
|
2024-04-19 15:13:39 +00:00
|
|
|
}
|
|
|
|
));
|
|
|
|
in {
|
2024-05-26 13:48:38 +00:00
|
|
|
packages = forAllSystems (pkgs: {
|
|
|
|
sim = import ./sim/package.nix pkgs;
|
2024-09-22 15:55:52 +00:00
|
|
|
|
2024-05-26 13:48:38 +00:00
|
|
|
});
|
2024-04-19 15:13:39 +00:00
|
|
|
devShells = forAllSystems (pkgs: {
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
packages = with pkgs; [
|
|
|
|
(python3.withPackages (ps: with ps; [
|
|
|
|
amaranth
|
|
|
|
]))
|
|
|
|
yosys
|
|
|
|
nextpnr
|
|
|
|
# simulators
|
2024-09-22 15:55:52 +00:00
|
|
|
iverilog
|
2024-04-19 15:13:39 +00:00
|
|
|
verilator
|
|
|
|
# support package
|
|
|
|
trellis
|
|
|
|
# loader
|
|
|
|
openfpgaloader
|
|
|
|
ecpdap # easier to poke probes.
|
|
|
|
];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|