-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TMP: libresoc: import derivations from upstream
Signed-off-by: Jack Leightcap <[email protected]>
- Loading branch information
1 parent
bc0f45e
commit fb83045
Showing
6 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
lib, | ||
callPackage, | ||
runCommand, | ||
}: let | ||
baseDirectory = ./.; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
stdenv, | ||
fetchgit, | ||
python3, | ||
}: | ||
stdenv.mkDerivation { | ||
name = "libresoc-pinmux"; | ||
|
||
src = fetchgit { | ||
url = "https://git.libre-soc.org/git/pinmux.git"; | ||
hash = "sha256-Tux2RvcRmlpXMsHwve/+5rOyBRSThg9MVW2NGP3ZJxs="; | ||
}; | ||
|
||
nativeBuildInputs = [python3]; | ||
|
||
configurePhase = "true"; | ||
|
||
buildPhase = '' | ||
runHook preBuild | ||
python src/pinmux_generator.py -v -s ls180 -o ls180 | ||
runHook postBuild | ||
''; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mv ls180 $out | ||
runHook postInstall | ||
''; | ||
|
||
fixupPhase = "true"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
lib, | ||
buildPythonPackage, | ||
yosys, | ||
runCommand, | ||
c4m-jtag, | ||
nmigen-soc, | ||
libresoc-ieee754fpu, | ||
libresoc-openpower-isa, | ||
python, | ||
}: let | ||
# If we use ../. as source, then any change to | ||
# any unrelated Nix file would cause a rebuild, | ||
# since the build would have access to it. | ||
src = runCommand "libresoc-soc-source" {} '' | ||
mkdir $out | ||
cp -r ${../src} -T $out/src | ||
cp -r ${../setup.py} -T $out/setup.py | ||
cp -r ${../README.md} -T $out/README.md | ||
cp -r ${../NEWS.txt} -T $out/NEWS.txt | ||
''; | ||
in | ||
buildPythonPackage { | ||
pname = "libresoc-soc"; | ||
inherit src; | ||
|
||
propagatedBuildInputs = [ | ||
c4m-jtag | ||
nmigen-soc | ||
python | ||
libresoc-ieee754fpu | ||
libresoc-openpower-isa | ||
yosys | ||
]; | ||
|
||
doCheck = false; | ||
|
||
prePatch = '' | ||
rm -r src/soc/litex | ||
''; | ||
|
||
pythonImportsCheck = ["soc"]; | ||
|
||
meta = with lib; { | ||
homepage = "https://libre-soc.org/"; | ||
license = licenses.lgpl3Plus; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
runCommand, | ||
python3, | ||
python3Packages, | ||
pinmux, | ||
}: let | ||
script = '' | ||
mkdir pinmux | ||
ln -s ${pinmux} pinmux/ls180 | ||
export PINMUX="$(realpath ./pinmux)" | ||
python3 -m soc.simple.issuer_verilog \ | ||
--debug=jtag --enable-core --enable-pll \ | ||
--enable-xics --enable-sram4x4kblock --disable-svp64 \ | ||
$out | ||
''; | ||
in | ||
runCommand "libresoc.v" { | ||
nativeBuildInputs = | ||
(with python3Packages; [ | ||
libresoc-soc | ||
]) | ||
++ [pinmux]; | ||
} | ||
script |