add a bunch of litex things

This commit is contained in:
saji 2024-04-19 02:03:52 -05:00
parent 8bcb72013b
commit 32f38bd6dd
9 changed files with 152 additions and 8 deletions

View file

@ -27,7 +27,6 @@
]; # patches, version pins, new pkgs here. ]; # patches, version pins, new pkgs here.
} }
)); ));
in { in {
devShells = forAllSystems (pkgs: { devShells = forAllSystems (pkgs: {
default = pkgs.mkShell { default = pkgs.mkShell {
@ -36,6 +35,12 @@
cocotb cocotb
cocotb-bus cocotb-bus
litex litex
litedram
liteeth
litescope
pythondata-cpu-vexriscv
pythondata-software-compiler_rt
pythondata-software-picolibc
amaranth amaranth
])) ]))
yosys yosys
@ -50,7 +55,6 @@
ecpdap # easier to poke probes. ecpdap # easier to poke probes.
]; ];
}; };
}); });
}; };
} }

View file

@ -5,6 +5,12 @@ in final: prev: {
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
(python-final: python-prev: { (python-final: python-prev: {
litex = python-final.callPackage(import ./litex.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) { };
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) { };
}) })
]; ];
} }

27
litex/litedram.nix Normal file
View file

@ -0,0 +1,27 @@
tag: {
pkgs
, lib
, buildPythonPackage
, migen
, pyyaml
}: buildPythonPackage {
pname = "litedram";
version = "${tag}";
src = pkgs.fetchFromGitHub {
owner = "enjoy-digital";
repo = "litedram";
rev = "${tag}";
hash = "sha256-EaUszy0v6r5sKM5d5YmpRbR8Cf9xITObU71zUpg9cLU=";
};
buildInputs = [
pyyaml
migen
];
checkPhase = ''
python -m unittest test
'';
doCheck = true;
}

36
litex/liteeth.nix Normal file
View file

@ -0,0 +1,36 @@
tag: {
pkgs
, lib
, buildPythonPackage
, migen
, setuptools
, litex
, pyyaml
}: buildPythonPackage {
pname = "liteeth";
version = "${tag}";
src = pkgs.fetchFromGitHub {
owner = "enjoy-digital";
repo = "liteeth";
rev = "${tag}";
hash = "sha256-DUNwDzcFLVmL5F/ZWmok7T7jO7ixC9IuDr1WUarnAqk=";
};
buildInputs = [
litex
];
propagatedBuildInputs = [
migen
];
nativeCheckInputs = [
pyyaml
];
checkPhase = ''
python -m unittest test
'';
doCheck = true;
}

27
litex/litescope.nix Normal file
View file

@ -0,0 +1,27 @@
tag: {
pkgs
, lib
, buildPythonPackage
, migen
, setuptools
, litex
}: buildPythonPackage {
pname = "litescope";
version = "${tag}";
src = pkgs.fetchFromGitHub {
owner = "enjoy-digital";
repo = "litescope";
rev = "${tag}";
hash = "sha256-OWC+XwB+BzlCQkPKJCbQ0W4T6JbsInldrn9jYYjWypM=";
};
buildInputs = [
litex
];
checkPhase = ''
python -m unittest test
'';
doCheck = true;
}

View file

@ -5,13 +5,11 @@ tag: {
, pyserial , pyserial
, migen , migen
, requests , requests
, colorama
, packaging , packaging
, setuptools , pexpect
}: buildPythonPackage { }: buildPythonPackage {
pname = "litex"; pname = "litex";
version = "${tag}"; version = "${tag}";
pyproject = true;
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "enjoy-digital"; owner = "enjoy-digital";
@ -21,14 +19,12 @@ tag: {
}; };
buildInputs = [ buildInputs = [
setuptools migen
]; ];
propagatedBuildInputs = [ propagatedBuildInputs = [
migen
requests requests
pyserial pyserial
colorama
packaging packaging
]; ];

View file

@ -0,0 +1,16 @@
tag: {
pkgs
, buildPythonPackage
}: buildPythonPackage rec {
pname = "pythondata-cpu-vexriscv";
version = "${tag}";
src = pkgs.fetchFromGitHub {
owner = "litex-hub";
repo = "pythondata-cpu-vexriscv";
rev = "${tag}";
hash = "sha256-1RgwJCYxtiP5dfRHulfTNBgu6fum6RfoqkbFIlRTgKI=";
};
doCheck = false;
}

View file

@ -0,0 +1,16 @@
tag: {
pkgs
, buildPythonPackage
}: buildPythonPackage rec {
pname = "pythondata-software-compiler_rt";
version = "${tag}";
src = pkgs.fetchFromGitHub {
owner = "litex-hub";
repo = "pythondata-software-compiler_rt";
rev = "${tag}";
hash = "sha256-s/tfxhPwYAnu1z1LxEimeYWjX6IHbF2uD/1HjvQn/xo=";
};
doCheck = false;
}

View file

@ -0,0 +1,16 @@
tag: {
pkgs
, buildPythonPackage
}: buildPythonPackage rec {
pname = "pythondata-software-picolibc";
version = "${tag}";
src = pkgs.fetchFromGitHub {
owner = "litex-hub";
repo = "pythondata-software-picolibc";
rev = "${tag}";
hash = "sha256-5OY17BA37c6aHOvUwb0gJwXxGey4TdUiTTxJD5wuSGU=";
};
doCheck = false;
}