ebaz4205-hydra #330
30
flake.nix
30
flake.nix
|
@ -114,11 +114,12 @@
|
||||||
"nist_clock_satellite" "nist_qc2_satellite" "acpki_nist_clock_satellite" "acpki_nist_qc2_satellite"
|
"nist_clock_satellite" "nist_qc2_satellite" "acpki_nist_clock_satellite" "acpki_nist_qc2_satellite"
|
||||||
"nist_clock_satellite_100mhz" "nist_qc2_satellite_100mhz" "acpki_nist_clock_satellite_100mhz" "acpki_nist_qc2_satellite_100mhz"
|
"nist_clock_satellite_100mhz" "nist_qc2_satellite_100mhz" "acpki_nist_clock_satellite_100mhz" "acpki_nist_qc2_satellite_100mhz"
|
||||||
];
|
];
|
||||||
board-package-set = { target, variant, json ? null }: let
|
board-package-set = { target, variant ? null, json ? null }: let
|
||||||
szl = zynqpkgs."${target}-szl";
|
szl = zynqpkgs."${target}-szl";
|
||||||
fsbl = zynqpkgs."${target}-fsbl";
|
fsbl = zynqpkgs."${target}-fsbl";
|
||||||
fwtype = if builtins.elem variant sat_variants then "satman" else "runtime";
|
fwtype = if builtins.elem variant sat_variants then "satman" else "runtime";
|
||||||
|
|
||||||
|
targetVariantStr = if variant == null then "${target}" else "${target}-${variant}";
|
||||||
firmware = rustPlatform.buildRustPackage rec {
|
firmware = rustPlatform.buildRustPackage rec {
|
||||||
name = "firmware";
|
name = "firmware";
|
||||||
src = ./src;
|
src = ./src;
|
||||||
|
@ -142,7 +143,7 @@
|
||||||
export CLANG_EXTRA_INCLUDE_DIR="${llvmPackages_11.clang-unwrapped.lib}/lib/clang/11.1.0/include"
|
export CLANG_EXTRA_INCLUDE_DIR="${llvmPackages_11.clang-unwrapped.lib}/lib/clang/11.1.0/include"
|
||||||
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
|
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
|
||||||
export ZYNQ_RS=${zynq-rs}
|
export ZYNQ_RS=${zynq-rs}
|
||||||
make TARGET=${target} GWARGS="${if json == null then "-V ${variant}" else json}" ${fwtype}
|
make TARGET=${target} GWARGS="${if json == null then if target == "ebaz4205" then "" else "-V ${if variant == null then "" else variant}" else json};" ${fwtype}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
@ -157,7 +158,7 @@
|
||||||
dontFixup = true;
|
dontFixup = true;
|
||||||
auditable = false;
|
auditable = false;
|
||||||
};
|
};
|
||||||
gateware = pkgs.runCommand "${target}-${variant}-gateware"
|
gateware = pkgs.runCommand "${targetVariantStr}-gateware"
|
||||||
{
|
{
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
(pkgs.python3.withPackages(ps: [ ps.jsonschema artiqpkgs.migen migen-axi artiqpkgs.misoc artiqpkgs.artiq ]))
|
(pkgs.python3.withPackages(ps: [ ps.jsonschema artiqpkgs.migen migen-axi artiqpkgs.misoc artiqpkgs.artiq ]))
|
||||||
|
@ -165,27 +166,25 @@
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
python ${./src/gateware}/${target}.py -g build ${if json == null then "-V ${variant}" else json}
|
python ${./src/gateware}/${target}.py -g build ${if json == null then if target == "ebaz4205" then "" else "-V ${if variant == null then "" else variant}" else json}
|
||||||
mkdir -p $out $out/nix-support
|
mkdir -p $out $out/nix-support
|
||||||
cp build/top.bit $out
|
cp build/top.bit $out
|
||||||
echo file binary-dist $out/top.bit >> $out/nix-support/hydra-build-products
|
echo file binary-dist $out/top.bit >> $out/nix-support/hydra-build-products
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# SZL startup
|
# SZL startup
|
||||||
jtag = pkgs.runCommand "${target}-${variant}-jtag" {}
|
jtag = pkgs.runCommand "${targetVariantStr}-jtag" {}
|
||||||
''
|
''
|
||||||
mkdir $out
|
mkdir $out
|
||||||
ln -s ${szl}/szl.elf $out
|
ln -s ${szl}/szl.elf $out
|
||||||
ln -s ${firmware}/${fwtype}.bin $out
|
ln -s ${firmware}/${fwtype}.bin $out
|
||||||
ln -s ${gateware}/top.bit $out
|
ln -s ${gateware}/top.bit $out
|
||||||
'';
|
'';
|
||||||
sd = pkgs.runCommand "${target}-${variant}-sd"
|
sd = pkgs.runCommand "${targetVariantStr}-sd"
|
||||||
{
|
{
|
||||||
buildInputs = [ zynqpkgs.mkbootimage ];
|
buildInputs = [ zynqpkgs.mkbootimage ];
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
# Do not use "long" paths in boot.bif, because embedded developers
|
|
||||||
# can't write software (mkbootimage will segfault).
|
|
||||||
bifdir=`mktemp -d`
|
bifdir=`mktemp -d`
|
||||||
cd $bifdir
|
cd $bifdir
|
||||||
ln -s ${szl}/szl.elf szl.elf
|
ln -s ${szl}/szl.elf szl.elf
|
||||||
|
@ -205,7 +204,7 @@
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# FSBL startup
|
# FSBL startup
|
||||||
fsbl-sd = pkgs.runCommand "${target}-${variant}-fsbl-sd"
|
fsbl-sd = pkgs.runCommand "${targetVariantStr}-fsbl-sd"
|
||||||
{
|
{
|
||||||
buildInputs = [ zynqpkgs.mkbootimage ];
|
buildInputs = [ zynqpkgs.mkbootimage ];
|
||||||
}
|
}
|
||||||
|
@ -228,14 +227,14 @@
|
||||||
echo file binary-dist $out/boot.bin >> $out/nix-support/hydra-build-products
|
echo file binary-dist $out/boot.bin >> $out/nix-support/hydra-build-products
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
"${target}-${variant}-firmware" = firmware;
|
"${targetVariantStr}-firmware" = firmware;
|
||||||
"${target}-${variant}-gateware" = gateware;
|
"${targetVariantStr}-gateware" = gateware;
|
||||||
"${target}-${variant}-jtag" = jtag;
|
"${targetVariantStr}-jtag" = jtag;
|
||||||
"${target}-${variant}-sd" = sd;
|
"${targetVariantStr}-sd" = sd;
|
||||||
} // (
|
} // (
|
||||||
if builtins.elem target fsblTargets
|
if builtins.elem target fsblTargets
|
||||||
then {
|
then {
|
||||||
"${target}-${variant}-fsbl-sd" = fsbl-sd;
|
"${targetVariantStr}-fsbl-sd" = fsbl-sd;
|
||||||
}
|
}
|
||||||
else {}
|
else {}
|
||||||
);
|
);
|
||||||
|
@ -364,7 +363,8 @@
|
||||||
(board-package-set { target = "zc706"; variant = "acpki_nist_qc2_satellite_100mhz"; }) //
|
(board-package-set { target = "zc706"; variant = "acpki_nist_qc2_satellite_100mhz"; }) //
|
||||||
(board-package-set { target = "kasli_soc"; variant = "demo"; json = ./demo.json; }) //
|
(board-package-set { target = "kasli_soc"; variant = "demo"; json = ./demo.json; }) //
|
||||||
(board-package-set { target = "kasli_soc"; variant = "master"; json = ./kasli-soc-master.json; }) //
|
(board-package-set { target = "kasli_soc"; variant = "master"; json = ./kasli-soc-master.json; }) //
|
||||||
(board-package-set { target = "kasli_soc"; variant = "satellite"; json = ./kasli-soc-satellite.json; });
|
(board-package-set { target = "kasli_soc"; variant = "satellite"; json = ./kasli-soc-satellite.json; }) //
|
||||||
|
(board-package-set { target = "ebaz4205"; });
|
||||||
|
|
||||||
hydraJobs = packages.x86_64-linux // { inherit zc706-hitl-tests; inherit gateware-sim; inherit fmt-check; };
|
hydraJobs = packages.x86_64-linux // { inherit zc706-hitl-tests; inherit gateware-sim; inherit fmt-check; };
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue