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.
}
));
in {
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
@ -36,6 +35,12 @@
cocotb
cocotb-bus
litex
litedram
liteeth
litescope
pythondata-cpu-vexriscv
pythondata-software-compiler_rt
pythondata-software-picolibc
amaranth
]))
yosys
@ -50,7 +55,6 @@
ecpdap # easier to poke probes.
];
};
});
};
}

View file

@ -5,6 +5,12 @@ in final: prev: {
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) { };
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
, migen
, requests
, colorama
, packaging
, setuptools
, pexpect
}: buildPythonPackage {
pname = "litex";
version = "${tag}";
pyproject = true;
src = pkgs.fetchFromGitHub {
owner = "enjoy-digital";
@ -21,14 +19,12 @@ tag: {
};
buildInputs = [
setuptools
migen
];
propagatedBuildInputs = [
migen
requests
pyserial
colorama
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;
}