generated from saji/ecp5-template
add flake/nix formatter (nixfmt)
Some checks failed
Verilator Unit Tests / Test (push) Failing after 3m35s
Some checks failed
Verilator Unit Tests / Test (push) Failing after 3m35s
This commit is contained in:
parent
79927f0cbd
commit
ccdbc98cb0
135
flake.nix
135
flake.nix
|
@ -3,82 +3,75 @@
|
|||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-parts = {
|
||||
url = "github:hercules-ci/flake-parts";
|
||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||
};
|
||||
flake-parts = {
|
||||
url = "github:hercules-ci/flake-parts";
|
||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs@{flake-parts, ... }:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
# flake = let
|
||||
# in {
|
||||
# };
|
||||
# devShells."x86_64-linux".default = pkgs.mkShell {
|
||||
# packages = with pkgs; [
|
||||
# (python3.withPackages (pypkgs: with pypkgs; [
|
||||
# amaranth
|
||||
# amaranth-boards
|
||||
# ]))
|
||||
# yosys
|
||||
# nextpnr
|
||||
# # simulators
|
||||
# iverilog
|
||||
# verilator
|
||||
# # support package
|
||||
# trellis
|
||||
# # loader
|
||||
# openfpgaloader
|
||||
# ecpdap # easier to poke probes.
|
||||
# ];
|
||||
# };
|
||||
# };
|
||||
outputs =
|
||||
inputs@{ flake-parts, ... }:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
|
||||
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
"x86_64-darwin"
|
||||
];
|
||||
|
||||
perSystem = {config, self', inputs', pkgs, system, ...}: {
|
||||
packages.default = pkgs.python3.pkgs.buildPythonPackage {
|
||||
name = "groovylight";
|
||||
version = "0.0.1";
|
||||
src = ./.;
|
||||
format = "pyproject";
|
||||
perSystem =
|
||||
{
|
||||
config,
|
||||
self',
|
||||
inputs',
|
||||
pkgs,
|
||||
system,
|
||||
...
|
||||
}:
|
||||
{
|
||||
formatter = pkgs.nixfmt-rfc-style;
|
||||
packages.default = pkgs.python3.pkgs.buildPythonPackage {
|
||||
name = "groovylight";
|
||||
version = "0.0.1";
|
||||
src = ./.;
|
||||
format = "pyproject";
|
||||
|
||||
build-system = [pkgs.python3.pkgs.pdm-backend];
|
||||
build-system = [ pkgs.python3.pkgs.pdm-backend ];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
pkgs.python3.pkgs.amaranth
|
||||
pkgs.python3.pkgs.amaranth-boards
|
||||
];
|
||||
propagatedBuildInputs = [
|
||||
pkgs.python3.pkgs.amaranth
|
||||
pkgs.python3.pkgs.amaranth-boards
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
nativeCheckInputs = with pkgs; [
|
||||
python3.pkgs.pytestCheckHook
|
||||
yosys
|
||||
nextpnr
|
||||
trellis
|
||||
openfpgaloader
|
||||
];
|
||||
|
||||
};
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
(python3.withPackages (pypkgs: with pypkgs; [
|
||||
amaranth
|
||||
amaranth-boards
|
||||
]))
|
||||
self'.packages.default
|
||||
yosys
|
||||
nextpnr
|
||||
# simulators
|
||||
iverilog
|
||||
verilator
|
||||
# support package
|
||||
trellis
|
||||
# loader
|
||||
openfpgaloader
|
||||
ecpdap # easier to poke probes.
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
doCheck = true;
|
||||
nativeCheckInputs = with pkgs; [
|
||||
python3.pkgs.pytestCheckHook
|
||||
yosys
|
||||
nextpnr
|
||||
trellis
|
||||
openfpgaloader
|
||||
];
|
||||
|
||||
};
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
(python3.withPackages (
|
||||
pypkgs: with pypkgs; [
|
||||
amaranth
|
||||
amaranth-boards
|
||||
self'.packages.default
|
||||
]
|
||||
))
|
||||
yosys
|
||||
nextpnr
|
||||
# support package
|
||||
trellis
|
||||
# loader
|
||||
openfpgaloader
|
||||
ecpdap # easier to poke probes.
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,20 +1,24 @@
|
|||
# an overlay to
|
||||
let
|
||||
# an overlay to
|
||||
let
|
||||
tag = "2023.12";
|
||||
in final: prev: {
|
||||
wishbone-tool = prev.callPackage(import ./wishbone-tool.nix) { };
|
||||
in
|
||||
final: prev: {
|
||||
wishbone-tool = prev.callPackage (import ./wishbone-tool.nix) { };
|
||||
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
|
||||
(python-final: python-prev: {
|
||||
litex = python-final.callPackage(import ./litex.nix tag) { };
|
||||
litedram = python-final.callPackage(import ./litedram.nix tag) { };
|
||||
liteeth = python-final.callPackage(import ./liteeth.nix tag) { };
|
||||
litescope = python-final.callPackage(import ./litescope.nix tag) { };
|
||||
litespi = python-final.callPackage(import ./litespi.nix tag) { };
|
||||
liteiclink = python-final.callPackage(import ./liteiclink.nix tag) { };
|
||||
pythondata-cpu-vexriscv = python-final.callPackage(import ./pythondata-cpu-vexriscv.nix tag) { };
|
||||
pythondata-software-compiler_rt = python-final.callPackage(import ./pythondata-software-compiler_rt.nix tag) { };
|
||||
pythondata-software-picolibc = python-final.callPackage(import ./pythondata-software-picolibc.nix tag) { };
|
||||
litex = python-final.callPackage (import ./litex.nix tag) { };
|
||||
litedram = python-final.callPackage (import ./litedram.nix tag) { };
|
||||
liteeth = python-final.callPackage (import ./liteeth.nix tag) { };
|
||||
litescope = python-final.callPackage (import ./litescope.nix tag) { };
|
||||
litespi = python-final.callPackage (import ./litespi.nix tag) { };
|
||||
liteiclink = python-final.callPackage (import ./liteiclink.nix tag) { };
|
||||
pythondata-cpu-vexriscv = python-final.callPackage (import ./pythondata-cpu-vexriscv.nix tag) { };
|
||||
pythondata-software-compiler_rt =
|
||||
python-final.callPackage (import ./pythondata-software-compiler_rt.nix tag)
|
||||
{ };
|
||||
pythondata-software-picolibc =
|
||||
python-final.callPackage (import ./pythondata-software-picolibc.nix tag)
|
||||
{ };
|
||||
})
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
tag: {
|
||||
pkgs
|
||||
, lib
|
||||
, buildPythonPackage
|
||||
, migen
|
||||
, pyyaml
|
||||
}: buildPythonPackage {
|
||||
tag:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
migen,
|
||||
pyyaml,
|
||||
}:
|
||||
buildPythonPackage {
|
||||
pname = "litedram";
|
||||
version = "${tag}";
|
||||
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
tag: {
|
||||
pkgs
|
||||
, lib
|
||||
, buildPythonPackage
|
||||
, migen
|
||||
, setuptools
|
||||
, litex
|
||||
, pyyaml
|
||||
}: buildPythonPackage {
|
||||
tag:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
migen,
|
||||
setuptools,
|
||||
litex,
|
||||
pyyaml,
|
||||
}:
|
||||
buildPythonPackage {
|
||||
pname = "liteeth";
|
||||
version = "${tag}";
|
||||
|
||||
|
@ -17,17 +19,11 @@ tag: {
|
|||
hash = "sha256-DUNwDzcFLVmL5F/ZWmok7T7jO7ixC9IuDr1WUarnAqk=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
litex
|
||||
];
|
||||
buildInputs = [ litex ];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
migen
|
||||
];
|
||||
propagatedBuildInputs = [ migen ];
|
||||
|
||||
nativeCheckInputs = [
|
||||
pyyaml
|
||||
];
|
||||
nativeCheckInputs = [ pyyaml ];
|
||||
|
||||
checkPhase = ''
|
||||
python -m unittest test
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
tag: {
|
||||
pkgs
|
||||
, buildPythonPackage
|
||||
, litex
|
||||
}: buildPythonPackage {
|
||||
tag:
|
||||
{
|
||||
pkgs,
|
||||
buildPythonPackage,
|
||||
litex,
|
||||
}:
|
||||
buildPythonPackage {
|
||||
pname = "liteiclink";
|
||||
version = "${tag}";
|
||||
|
||||
|
@ -13,9 +15,7 @@ tag: {
|
|||
hash = "sha256-5Hp5vFqmfkXo1q60FvOkToTy952svirChIPIvkam04M=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
litex
|
||||
];
|
||||
buildInputs = [ litex ];
|
||||
|
||||
checkPhase = ''
|
||||
python -m unittest test
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
tag: {
|
||||
pkgs
|
||||
, lib
|
||||
, buildPythonPackage
|
||||
, migen
|
||||
, setuptools
|
||||
, litex
|
||||
}: buildPythonPackage {
|
||||
tag:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
migen,
|
||||
setuptools,
|
||||
litex,
|
||||
}:
|
||||
buildPythonPackage {
|
||||
pname = "litescope";
|
||||
version = "${tag}";
|
||||
|
||||
|
@ -16,9 +18,7 @@ tag: {
|
|||
hash = "sha256-OWC+XwB+BzlCQkPKJCbQ0W4T6JbsInldrn9jYYjWypM=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
litex
|
||||
];
|
||||
buildInputs = [ litex ];
|
||||
|
||||
checkPhase = ''
|
||||
python -m unittest test
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
tag: {
|
||||
pkgs
|
||||
, lib
|
||||
, buildPythonPackage
|
||||
, migen
|
||||
, setuptools
|
||||
, litex
|
||||
}: buildPythonPackage {
|
||||
tag:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
migen,
|
||||
setuptools,
|
||||
litex,
|
||||
}:
|
||||
buildPythonPackage {
|
||||
pname = "litespi";
|
||||
version = "${tag}";
|
||||
|
||||
|
@ -16,16 +18,11 @@ tag: {
|
|||
hash = "sha256-XYeWokF1IGtZWRK+6jhRSN91MOV5vyh5aO08sbtFBxw=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
litex
|
||||
];
|
||||
buildInputs = [ litex ];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
migen
|
||||
];
|
||||
propagatedBuildInputs = [ migen ];
|
||||
|
||||
nativeCheckInputs = [
|
||||
];
|
||||
nativeCheckInputs = [ ];
|
||||
|
||||
checkPhase = ''
|
||||
python -m unittest test
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
tag: {
|
||||
pkgs
|
||||
, lib
|
||||
, buildPythonPackage
|
||||
, pyserial
|
||||
, migen
|
||||
, requests
|
||||
, packaging
|
||||
, pexpect
|
||||
}: buildPythonPackage {
|
||||
tag:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
pyserial,
|
||||
migen,
|
||||
requests,
|
||||
packaging,
|
||||
pexpect,
|
||||
}:
|
||||
buildPythonPackage {
|
||||
pname = "litex";
|
||||
version = "${tag}";
|
||||
|
||||
|
@ -18,9 +20,7 @@ tag: {
|
|||
hash = "sha256-OcwqYLQ7ec2vTewdIJqP/aTCJ4yI43OIOkTMD/hIKO0=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
migen
|
||||
];
|
||||
buildInputs = [ migen ];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
requests
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
tag: {
|
||||
pkgs
|
||||
, buildPythonPackage
|
||||
}: buildPythonPackage rec {
|
||||
tag:
|
||||
{ pkgs, buildPythonPackage }:
|
||||
buildPythonPackage rec {
|
||||
pname = "pythondata-cpu-vexriscv";
|
||||
version = "${tag}";
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
tag: {
|
||||
pkgs
|
||||
, buildPythonPackage
|
||||
}: buildPythonPackage rec {
|
||||
tag:
|
||||
{ pkgs, buildPythonPackage }:
|
||||
buildPythonPackage rec {
|
||||
pname = "pythondata-software-compiler_rt";
|
||||
version = "${tag}";
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
tag: {
|
||||
pkgs
|
||||
, buildPythonPackage
|
||||
}: buildPythonPackage rec {
|
||||
tag:
|
||||
{ pkgs, buildPythonPackage }:
|
||||
buildPythonPackage rec {
|
||||
pname = "pythondata-software-picolibc";
|
||||
version = "${tag}";
|
||||
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
{ lib, fetchFromGitHub, rustPlatform }:
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
rustPlatform,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "wishbone-tool";
|
||||
|
@ -12,6 +16,5 @@ rustPlatform.buildRustPackage rec {
|
|||
};
|
||||
sourceRoot = "${src.name}/wishbone-tool";
|
||||
|
||||
|
||||
cargoHash = "sha256-kWvtZEXtb5bZ7/hd8jsr41UGSDOuDU4tyKWAL0kDoIg=";
|
||||
}
|
||||
|
|
54
python.nix
54
python.nix
|
@ -1,30 +1,30 @@
|
|||
# overlay python patched version with amaranth/boards updated.
|
||||
final: prev: {
|
||||
python3 = prev.python3.override {
|
||||
packageOverrides = pyfinal: pyprev: {
|
||||
amaranth = pyprev.amaranth.overridePythonAttrs {
|
||||
version = "0.6.0.dev53";
|
||||
src = prev.pkgs.fetchFromGitHub {
|
||||
owner = "amaranth-lang";
|
||||
repo = "amaranth";
|
||||
rev = "e30d822a7d93ee615e70e95a9958051dcc794802";
|
||||
# hash = "sha256-A46CMWGvqUFTp3geFFccUM9M7iECmNndzWm2GxA8XbE";
|
||||
hash = "sha256-sCUipI7HcuTg3sJscoSI0UdIutnxGWSwbgpwWyZuFxk=";
|
||||
};
|
||||
doCheck = false;
|
||||
# installCheckPhase = "${prev.python3.interpreter} -m unittest discover -t . -s tests -v";
|
||||
};
|
||||
amaranth-boards = pyprev.amaranth-boards.overridePythonAttrs {
|
||||
version = "0.1.dev250";
|
||||
src = prev.pkgs.fetchFromGitHub {
|
||||
owner = "amaranth-lang";
|
||||
repo = "amaranth-boards";
|
||||
rev = "19b97324ecf9111c5d16377af79f82aad761c476";
|
||||
hash = "sha256-0uvn91i/yuIY75lL5Oxvozdw7Q2Uw83JWo7srgEYEpI=";
|
||||
};
|
||||
build-system = [pyprev.pdm-backend];
|
||||
dontCheckRuntimeDeps = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
python3 = prev.python3.override {
|
||||
packageOverrides = pyfinal: pyprev: {
|
||||
amaranth = pyprev.amaranth.overridePythonAttrs {
|
||||
version = "0.6.0.dev53";
|
||||
src = prev.pkgs.fetchFromGitHub {
|
||||
owner = "amaranth-lang";
|
||||
repo = "amaranth";
|
||||
rev = "e30d822a7d93ee615e70e95a9958051dcc794802";
|
||||
# hash = "sha256-A46CMWGvqUFTp3geFFccUM9M7iECmNndzWm2GxA8XbE";
|
||||
hash = "sha256-sCUipI7HcuTg3sJscoSI0UdIutnxGWSwbgpwWyZuFxk=";
|
||||
};
|
||||
doCheck = false;
|
||||
# installCheckPhase = "${prev.python3.interpreter} -m unittest discover -t . -s tests -v";
|
||||
};
|
||||
amaranth-boards = pyprev.amaranth-boards.overridePythonAttrs {
|
||||
version = "0.1.dev250";
|
||||
src = prev.pkgs.fetchFromGitHub {
|
||||
owner = "amaranth-lang";
|
||||
repo = "amaranth-boards";
|
||||
rev = "19b97324ecf9111c5d16377af79f82aad761c476";
|
||||
hash = "sha256-0uvn91i/yuIY75lL5Oxvozdw7Q2Uw83JWo7srgEYEpI=";
|
||||
};
|
||||
build-system = [ pyprev.pdm-backend ];
|
||||
dontCheckRuntimeDeps = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue