Compare commits
3 Commits
bf13e9f7c3
...
77f727e71e
Author | SHA1 | Date |
---|---|---|
Sebastien Bourdeauducq | 77f727e71e | |
Sebastien Bourdeauducq | 3855b61dfb | |
Sebastien Bourdeauducq | bd6fccf0ea |
19
README.md
19
README.md
|
@ -6,29 +6,17 @@ Minimalist bare metal Rust firmware for Red Pitaya.
|
||||||
Development instructions
|
Development instructions
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
Configure Nix channels:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
nix-channel --add https://nixbld.m-labs.hk/channel/custom/artiq/fast-beta/artiq-fast
|
|
||||||
nix-channel --update
|
|
||||||
```
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
|
|
||||||
- Rust Pitaya does not depend on ARTIQ but uses some packages available in the ARTIQ channel.
|
|
||||||
- If you are using Nix channels the first time, you need to be aware of this bug: https://github.com/NixOS/nix/issues/3831.
|
|
||||||
|
|
||||||
Pure build with Nix and execution on a remote JTAG server:
|
Pure build with Nix and execution on a remote JTAG server:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
nix-build -A rust-pitaya-jtag
|
nix build .#rust-pitaya-jtag
|
||||||
./remote_run.sh
|
./remote_run.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Impure incremental build and execution on a remote JTAG server:
|
Impure incremental build and execution on a remote JTAG server:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
nix-shell
|
nix develop
|
||||||
cd src
|
cd src
|
||||||
gateware/rust-pitaya.py -g ../build/gateware # build gateware
|
gateware/rust-pitaya.py -g ../build/gateware # build gateware
|
||||||
make # build firmware
|
make # build firmware
|
||||||
|
@ -38,14 +26,13 @@ cd ..
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
|
|
||||||
- This is developed with Nixpkgs 20.09, and the ``nixbld.m-labs.hk`` binary substituter can also be used here (see the ARTIQ manual for the public key and instructions).
|
|
||||||
- The impure build process is also compatible with non-Nix systems.
|
- The impure build process is also compatible with non-Nix systems.
|
||||||
- If the board is connected to the local machine, use the ``local_run.sh`` script.
|
- If the board is connected to the local machine, use the ``local_run.sh`` script.
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|
||||||
Copyright (C) 2019-2020 M-Labs Limited.
|
Copyright (C) 2019-2022 M-Labs Limited.
|
||||||
|
|
||||||
Rust Pitaya is free software: you can redistribute it and/or modify
|
Rust Pitaya is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
87
default.nix
87
default.nix
|
@ -1,87 +0,0 @@
|
||||||
let
|
|
||||||
zynq-rs = (import ./zynq-rs.nix);
|
|
||||||
pkgs = import <nixpkgs> { overlays = [ (import "${zynq-rs}/nix/mozilla-overlay.nix") ]; };
|
|
||||||
rustPlatform = (import "${zynq-rs}/nix/rust-platform.nix" { inherit pkgs; });
|
|
||||||
cargo-xbuild = (import zynq-rs).cargo-xbuild;
|
|
||||||
redpitaya-szl = (import zynq-rs).redpitaya-szl;
|
|
||||||
mkbootimage = import "${zynq-rs}/nix/mkbootimage.nix" { inherit pkgs; };
|
|
||||||
artiqpkgs = import <artiq-fast/default.nix> { inherit pkgs; };
|
|
||||||
vivado = import <artiq-fast/vivado.nix> { inherit pkgs; };
|
|
||||||
in rec {
|
|
||||||
rust-pitaya-firmware = rustPlatform.buildRustPackage {
|
|
||||||
name = "rust-pitaya-firmware";
|
|
||||||
|
|
||||||
src = ./src;
|
|
||||||
cargoSha256 = "173013gdlk8mljps6lar892zqgxrmxa7fkv8is3wgvgf7dnifjzs";
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
pkgs.gnumake
|
|
||||||
(pkgs.python3.withPackages(ps: (with artiqpkgs; [ migen migen-axi misoc ])))
|
|
||||||
cargo-xbuild
|
|
||||||
pkgs.llvmPackages_9.llvm
|
|
||||||
pkgs.llvmPackages_9.clang-unwrapped
|
|
||||||
];
|
|
||||||
buildPhase = ''
|
|
||||||
export XARGO_RUST_SRC="${rustPlatform.rust.rustc.src}/library"
|
|
||||||
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
|
|
||||||
make
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out $out/nix-support
|
|
||||||
cp ../build/firmware.bin $out/firmware.bin
|
|
||||||
cp ../build/firmware/armv7-none-eabihf/release/firmware $out/firmware.elf
|
|
||||||
echo file binary-dist $out/firmware.bin >> $out/nix-support/hydra-build-products
|
|
||||||
echo file binary-dist $out/firmware.elf >> $out/nix-support/hydra-build-products
|
|
||||||
'';
|
|
||||||
|
|
||||||
doCheck = false;
|
|
||||||
dontFixup = true;
|
|
||||||
};
|
|
||||||
rust-pitaya-gateware = pkgs.runCommand "rust-pitaya-gateware"
|
|
||||||
{
|
|
||||||
nativeBuildInputs = [
|
|
||||||
(pkgs.python3.withPackages(ps: (with artiqpkgs; [ migen migen-axi misoc ])))
|
|
||||||
vivado
|
|
||||||
];
|
|
||||||
}
|
|
||||||
''
|
|
||||||
python ${./src/gateware}/rust-pitaya.py -g build
|
|
||||||
mkdir -p $out $out/nix-support
|
|
||||||
cp build/top.bit $out
|
|
||||||
echo file binary-dist $out/top.bit >> $out/nix-support/hydra-build-products
|
|
||||||
'';
|
|
||||||
|
|
||||||
|
|
||||||
rust-pitaya-jtag = pkgs.runCommand "rust-pitaya-jtag" {}
|
|
||||||
''
|
|
||||||
mkdir $out
|
|
||||||
ln -s ${redpitaya-szl}/szl.elf $out
|
|
||||||
ln -s ${rust-pitaya-firmware}/firmware.bin $out
|
|
||||||
ln -s ${rust-pitaya-gateware}/top.bit $out
|
|
||||||
'';
|
|
||||||
rust-pitaya-sd = pkgs.runCommand "rust-pitaya-sd"
|
|
||||||
{
|
|
||||||
buildInputs = [ mkbootimage ];
|
|
||||||
}
|
|
||||||
''
|
|
||||||
# Do not use "long" paths in boot.bif, because embedded developers
|
|
||||||
# can't write software (mkbootimage will segfault).
|
|
||||||
bifdir=`mktemp -d`
|
|
||||||
cd $bifdir
|
|
||||||
ln -s ${redpitaya-szl}/szl.elf szl.elf
|
|
||||||
ln -s ${rust-pitaya-firmware}/firmware.elf firmware.elf
|
|
||||||
ln -s ${rust-pitaya-gateware}/top.bit top.bit
|
|
||||||
cat > boot.bif << EOF
|
|
||||||
the_ROM_image:
|
|
||||||
{
|
|
||||||
[bootloader]szl.elf
|
|
||||||
top.bit
|
|
||||||
firmware.elf
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
mkdir $out $out/nix-support
|
|
||||||
mkbootimage boot.bif $out/boot.bin
|
|
||||||
echo file binary-dist $out/boot.bin >> $out/nix-support/hydra-build-products
|
|
||||||
'';
|
|
||||||
}
|
|
|
@ -0,0 +1,241 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"artiq": {
|
||||||
|
"inputs": {
|
||||||
|
"artiq-comtools": "artiq-comtools",
|
||||||
|
"mozilla-overlay": "mozilla-overlay",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"sipyco": "sipyco",
|
||||||
|
"src-migen": "src-migen",
|
||||||
|
"src-misoc": "src-misoc",
|
||||||
|
"src-pythonparser": "src-pythonparser"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1661404661,
|
||||||
|
"narHash": "sha256-j3l/plOlK2Hcd4XIC32PDfKvqUY8Apr9sBeczyJ/L8A=",
|
||||||
|
"ref": "master",
|
||||||
|
"rev": "b705862ecd014b0c3b69051c1c822f13ce8aeea2",
|
||||||
|
"revCount": 8144,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/m-labs/artiq.git"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/m-labs/artiq.git"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"artiq-comtools": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"artiq-zynq",
|
||||||
|
"artiq",
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"sipyco": [
|
||||||
|
"artiq-zynq",
|
||||||
|
"artiq",
|
||||||
|
"sipyco"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1654007592,
|
||||||
|
"narHash": "sha256-vaDFhE1ItjqtIcinC/6RAJGbj44pxxMUEeQUa3FtgEE=",
|
||||||
|
"owner": "m-labs",
|
||||||
|
"repo": "artiq-comtools",
|
||||||
|
"rev": "cb73281154656ee8f74db1866859e31bf42755cd",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "m-labs",
|
||||||
|
"repo": "artiq-comtools",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"artiq-zynq": {
|
||||||
|
"inputs": {
|
||||||
|
"artiq": "artiq",
|
||||||
|
"mozilla-overlay": "mozilla-overlay_2",
|
||||||
|
"zynq-rs": "zynq-rs"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1661774127,
|
||||||
|
"narHash": "sha256-OTJKLZBoJtisDcpjckMsq2PgtgrkwSm5VV51kOPS8yI=",
|
||||||
|
"ref": "master",
|
||||||
|
"rev": "38f4d6cd2e7a0c2122bff674e04d4c251fc76b3b",
|
||||||
|
"revCount": 576,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.m-labs.hk/m-labs/artiq-zynq"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.m-labs.hk/m-labs/artiq-zynq"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mozilla-overlay": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1657214286,
|
||||||
|
"narHash": "sha256-rO/4oymKXU09wG2bcTt4uthPCp1XsBZjxuCJo3yVXNs=",
|
||||||
|
"owner": "mozilla",
|
||||||
|
"repo": "nixpkgs-mozilla",
|
||||||
|
"rev": "0508a66e28a5792fdfb126bbf4dec1029c2509e0",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "mozilla",
|
||||||
|
"repo": "nixpkgs-mozilla",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mozilla-overlay_2": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1657214286,
|
||||||
|
"narHash": "sha256-rO/4oymKXU09wG2bcTt4uthPCp1XsBZjxuCJo3yVXNs=",
|
||||||
|
"owner": "mozilla",
|
||||||
|
"repo": "nixpkgs-mozilla",
|
||||||
|
"rev": "0508a66e28a5792fdfb126bbf4dec1029c2509e0",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "mozilla",
|
||||||
|
"repo": "nixpkgs-mozilla",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mozilla-overlay_3": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1650459918,
|
||||||
|
"narHash": "sha256-sroCK+QJTmoXtcRkwZyKOP9iAYOPID2Bwdxn4GkG16w=",
|
||||||
|
"owner": "mozilla",
|
||||||
|
"repo": "nixpkgs-mozilla",
|
||||||
|
"rev": "e1f7540fc0a8b989fb8cf701dc4fd7fc76bcf168",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "mozilla",
|
||||||
|
"repo": "nixpkgs-mozilla",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1657123678,
|
||||||
|
"narHash": "sha256-cowVkScfUPlbBXUp08MeVk/wgm9E1zp1uC+9no2hZYw=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "316b762afdb9e142a803f29c49a88b4a47db80ee",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-22.05",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"artiq-zynq": "artiq-zynq"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sipyco": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"artiq-zynq",
|
||||||
|
"artiq",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1654830914,
|
||||||
|
"narHash": "sha256-tratXcWu6Dgzd0Qd9V6EMjuNlE9qDN1pKFhP+Gt0b64=",
|
||||||
|
"owner": "m-labs",
|
||||||
|
"repo": "sipyco",
|
||||||
|
"rev": "58b0935f7ae47659abee5b5792fa594153328d6f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "m-labs",
|
||||||
|
"repo": "sipyco",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"src-migen": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1656649178,
|
||||||
|
"narHash": "sha256-A91sZRrprEuPOtIUVxm6wX5djac9wnNZQ4+cU1nvJPc=",
|
||||||
|
"owner": "m-labs",
|
||||||
|
"repo": "migen",
|
||||||
|
"rev": "0fb91737090fe45fd764ea3f71257a4c53c7a4ae",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "m-labs",
|
||||||
|
"repo": "migen",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"src-misoc": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1649324486,
|
||||||
|
"narHash": "sha256-Mw/fQS3lHFvCm7L1k63joRkz5uyijQfywcOq+X2+o2s=",
|
||||||
|
"ref": "master",
|
||||||
|
"rev": "f1dc58d2b8c222ba41c25cee4301626625f46e43",
|
||||||
|
"revCount": 2420,
|
||||||
|
"submodules": true,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/m-labs/misoc.git"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"submodules": true,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/m-labs/misoc.git"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"src-pythonparser": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1628745371,
|
||||||
|
"narHash": "sha256-p6TgeeaK4NEmbhimEXp31W8hVRo4DgWmcCoqZ+UdN60=",
|
||||||
|
"owner": "m-labs",
|
||||||
|
"repo": "pythonparser",
|
||||||
|
"rev": "5413ee5c9f8760e95c6acd5d6e88dabb831ad201",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "m-labs",
|
||||||
|
"repo": "pythonparser",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zynq-rs": {
|
||||||
|
"inputs": {
|
||||||
|
"mozilla-overlay": "mozilla-overlay_3",
|
||||||
|
"nixpkgs": [
|
||||||
|
"artiq-zynq",
|
||||||
|
"artiq",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1661505762,
|
||||||
|
"narHash": "sha256-gXML1pez4LvYxuAG9AX3inKq0e7+D8SvNd/tW4OwXu4=",
|
||||||
|
"ref": "master",
|
||||||
|
"rev": "92b3f3e1dd14fb2e53868665d95bbea4270da33e",
|
||||||
|
"revCount": 621,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.m-labs.hk/m-labs/zynq-rs"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.m-labs.hk/m-labs/zynq-rs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
|
@ -0,0 +1,118 @@
|
||||||
|
{
|
||||||
|
description = "Minimalist bare metal Rust firmware for Red Pitaya";
|
||||||
|
|
||||||
|
inputs.artiq-zynq.url = git+https://git.m-labs.hk/m-labs/artiq-zynq;
|
||||||
|
|
||||||
|
outputs = { self, artiq-zynq }:
|
||||||
|
let
|
||||||
|
pkgs = import artiq-zynq.inputs.artiq.inputs.nixpkgs { system = "x86_64-linux"; overlays = [ (import artiq-zynq.inputs.mozilla-overlay) ]; };
|
||||||
|
zynqpkgs = artiq-zynq.inputs.zynq-rs.packages.x86_64-linux;
|
||||||
|
artiqpkgs = artiq-zynq.inputs.artiq.packages.x86_64-linux;
|
||||||
|
artiqzynqpkgs = artiq-zynq.packages.x86_64-linux;
|
||||||
|
rustPlatform = artiq-zynq.inputs.zynq-rs.rustPlatform;
|
||||||
|
in {
|
||||||
|
packages.x86_64-linux = rec {
|
||||||
|
rust-pitaya-firmware = rustPlatform.buildRustPackage {
|
||||||
|
name = "rust-pitaya-firmware";
|
||||||
|
|
||||||
|
src = ./src;
|
||||||
|
cargoLock = {
|
||||||
|
lockFile = src/Cargo.lock;
|
||||||
|
outputHashes = {
|
||||||
|
"libasync-0.0.0" = "sha256-gXML1pez4LvYxuAG9AX3inKq0e7+D8SvNd/tW4OwXu4=";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
pkgs.gnumake
|
||||||
|
(pkgs.python3.withPackages(ps: [ artiqpkgs.migen artiqzynqpkgs.migen-axi artiqpkgs.misoc ]))
|
||||||
|
pkgs.cargo-xbuild
|
||||||
|
pkgs.llvmPackages_9.llvm
|
||||||
|
pkgs.llvmPackages_9.clang-unwrapped
|
||||||
|
];
|
||||||
|
buildPhase = ''
|
||||||
|
XARGO_RUST_SRC="${rustPlatform.rust.rustc}/lib/rustlib/src/rust/library";
|
||||||
|
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
|
||||||
|
make
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out $out/nix-support
|
||||||
|
cp ../build/firmware.bin $out/firmware.bin
|
||||||
|
cp ../build/firmware/armv7-none-eabihf/release/firmware $out/firmware.elf
|
||||||
|
echo file binary-dist $out/firmware.bin >> $out/nix-support/hydra-build-products
|
||||||
|
echo file binary-dist $out/firmware.elf >> $out/nix-support/hydra-build-products
|
||||||
|
'';
|
||||||
|
|
||||||
|
doCheck = false;
|
||||||
|
dontFixup = true;
|
||||||
|
};
|
||||||
|
rust-pitaya-gateware = pkgs.runCommand "rust-pitaya-gateware"
|
||||||
|
{
|
||||||
|
nativeBuildInputs = [
|
||||||
|
(pkgs.python3.withPackages(ps: [ artiqpkgs.migen artiqzynqpkgs.migen-axi artiqpkgs.misoc ]))
|
||||||
|
artiqpkgs.vivado
|
||||||
|
];
|
||||||
|
}
|
||||||
|
''
|
||||||
|
python ${./src/gateware}/rust-pitaya.py -g build
|
||||||
|
mkdir -p $out $out/nix-support
|
||||||
|
cp build/top.bit $out
|
||||||
|
echo file binary-dist $out/top.bit >> $out/nix-support/hydra-build-products
|
||||||
|
'';
|
||||||
|
rust-pitaya-jtag = pkgs.runCommand "rust-pitaya-jtag" {}
|
||||||
|
''
|
||||||
|
mkdir $out
|
||||||
|
ln -s ${zynqpkgs.szl}/szl-redpitaya.elf $out
|
||||||
|
ln -s ${rust-pitaya-firmware}/firmware.bin $out
|
||||||
|
ln -s ${rust-pitaya-gateware}/top.bit $out
|
||||||
|
'';
|
||||||
|
rust-pitaya-sd = pkgs.runCommand "rust-pitaya-sd"
|
||||||
|
{
|
||||||
|
buildInputs = [ zynqpkgs.mkbootimage ];
|
||||||
|
}
|
||||||
|
''
|
||||||
|
# Do not use "long" paths in boot.bif, because embedded developers
|
||||||
|
# can't write software (mkbootimage will segfault).
|
||||||
|
bifdir=`mktemp -d`
|
||||||
|
cd $bifdir
|
||||||
|
ln -s ${zynqpkgs.szl}/szl-redpitaya.elf szl.elf
|
||||||
|
ln -s ${rust-pitaya-firmware}/firmware.elf firmware.elf
|
||||||
|
ln -s ${rust-pitaya-gateware}/top.bit top.bit
|
||||||
|
cat > boot.bif << EOF
|
||||||
|
the_ROM_image:
|
||||||
|
{
|
||||||
|
[bootloader]szl.elf
|
||||||
|
top.bit
|
||||||
|
firmware.elf
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
mkdir $out $out/nix-support
|
||||||
|
mkbootimage boot.bif $out/boot.bin
|
||||||
|
echo file binary-dist $out/boot.bin >> $out/nix-support/hydra-build-products
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
devShell.x86_64-linux = pkgs.mkShell {
|
||||||
|
name = "rust-pitaya-dev-shell";
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
pkgs.gnumake
|
||||||
|
rustPlatform.rust.rustc
|
||||||
|
rustPlatform.rust.cargo
|
||||||
|
pkgs.llvmPackages_9.llvm
|
||||||
|
pkgs.llvmPackages_9.clang-unwrapped
|
||||||
|
pkgs.cacert
|
||||||
|
cargo-xbuild
|
||||||
|
|
||||||
|
pkgs.openocd
|
||||||
|
pkgs.openssh pkgs.rsync
|
||||||
|
(pkgs.python3.withPackages(ps: [ artiqpkgs.migen artiqzynqpkgs.migen-axi artiqpkgs.misoc artiqzynqpkgs.artiq-netboot ]))
|
||||||
|
artiqpkgs.vivado
|
||||||
|
|
||||||
|
zynqpkgs.mkbootimage
|
||||||
|
];
|
||||||
|
XARGO_RUST_SRC = "${rustPlatform.rust.rustc}/lib/rustlib/src/rust/library";
|
||||||
|
OPENOCD_ZYNQ = "${artiq-zynq.inputs.zynq-rs}/openocd";
|
||||||
|
SZL = "${zynqpkgs.szl}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -33,7 +33,7 @@ load_bitstream_cmd=""
|
||||||
build_dir=`pwd`/build
|
build_dir=`pwd`/build
|
||||||
result_dir=`pwd`/result
|
result_dir=`pwd`/result
|
||||||
cd $OPENOCD_ZYNQ
|
cd $OPENOCD_ZYNQ
|
||||||
openocd -f redpitaya.cfg -c "load_image $SZL; resume 0; exit"
|
openocd -f redpitaya.cfg -c "load_image $SZL/szl-redpitaya.elf; resume 0; exit"
|
||||||
sleep 5
|
sleep 5
|
||||||
if [ $impure -eq 1 ]; then
|
if [ $impure -eq 1 ]; then
|
||||||
if [ $load_bitstream -eq 1 ]; then
|
if [ $load_bitstream -eq 1 ]; then
|
||||||
|
|
|
@ -46,7 +46,7 @@ echo "Creating $target_folder..."
|
||||||
ssh $sshopts $target_host "mkdir -p $target_folder"
|
ssh $sshopts $target_host "mkdir -p $target_folder"
|
||||||
echo "Copying files..."
|
echo "Copying files..."
|
||||||
rsync -e "ssh $sshopts" -Lc $OPENOCD_ZYNQ/* $target_host:$target_folder
|
rsync -e "ssh $sshopts" -Lc $OPENOCD_ZYNQ/* $target_host:$target_folder
|
||||||
rsync -e "ssh $sshopts" -Lc $SZL $target_host:$target_folder
|
rsync -e "ssh $sshopts" -Lc $SZL/szl-redpitaya.elf $target_host:$target_folder
|
||||||
if [ $impure -eq 1 ]; then
|
if [ $impure -eq 1 ]; then
|
||||||
if [ $load_bitstream -eq 1 ]; then
|
if [ $load_bitstream -eq 1 ]; then
|
||||||
load_bitstream_cmd="-g build/gateware/top.bit"
|
load_bitstream_cmd="-g build/gateware/top.bit"
|
||||||
|
@ -59,6 +59,6 @@ else
|
||||||
firmware="$pure_dir/firmware.bin"
|
firmware="$pure_dir/firmware.bin"
|
||||||
fi
|
fi
|
||||||
echo "Programming board..."
|
echo "Programming board..."
|
||||||
ssh $sshopts $target_host "cd $target_folder; openocd -f redpitaya.cfg -c'load_image szl.elf; resume 0; exit'"
|
ssh $sshopts $target_host "cd $target_folder; openocd -f redpitaya.cfg -c'load_image szl-redpitaya.elf; resume 0; exit'"
|
||||||
sleep 5
|
sleep 5
|
||||||
artiq_netboot $load_bitstream_cmd -f $firmware -b $board_host
|
artiq_netboot $load_bitstream_cmd -f $firmware -b $board_host
|
||||||
|
|
33
shell.nix
33
shell.nix
|
@ -1,33 +0,0 @@
|
||||||
let
|
|
||||||
zynq-rs = (import ./zynq-rs.nix);
|
|
||||||
pkgs = import <nixpkgs> { overlays = [ (import "${zynq-rs}/nix/mozilla-overlay.nix") ]; };
|
|
||||||
rustPlatform = (import "${zynq-rs}/nix/rust-platform.nix" { inherit pkgs; });
|
|
||||||
cargo-xbuild = (import zynq-rs).cargo-xbuild;
|
|
||||||
artiq-fast = <artiq-fast>;
|
|
||||||
artiqpkgs = import "${artiq-fast}/default.nix" { inherit pkgs; };
|
|
||||||
vivado = import "${artiq-fast}/vivado.nix" { inherit pkgs; };
|
|
||||||
redpitaya-szl = (import zynq-rs).redpitaya-szl;
|
|
||||||
in
|
|
||||||
pkgs.stdenv.mkDerivation {
|
|
||||||
name = "rust-pitaya-env";
|
|
||||||
buildInputs = [
|
|
||||||
pkgs.gnumake
|
|
||||||
rustPlatform.rust.rustc
|
|
||||||
rustPlatform.rust.cargo
|
|
||||||
pkgs.llvmPackages_9.llvm
|
|
||||||
pkgs.cacert
|
|
||||||
cargo-xbuild
|
|
||||||
|
|
||||||
pkgs.openocd
|
|
||||||
pkgs.openssh pkgs.rsync
|
|
||||||
|
|
||||||
(pkgs.python3.withPackages(ps: (with artiqpkgs; [ migen migen-axi misoc artiq-netboot ])))
|
|
||||||
vivado
|
|
||||||
|
|
||||||
(import "${zynq-rs}/nix/mkbootimage.nix" { inherit pkgs; })
|
|
||||||
];
|
|
||||||
|
|
||||||
XARGO_RUST_SRC = "${rustPlatform.rust.rustc.src}/library";
|
|
||||||
OPENOCD_ZYNQ = "${zynq-rs}/openocd";
|
|
||||||
SZL = "${redpitaya-szl}/szl.elf";
|
|
||||||
}
|
|
|
@ -8,41 +8,48 @@ checksum = "dcb6dd1c2376d2e096796e234a70e17e94cc2d5d54ff8ce42b28cef1d0d359a4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
version = "1.2.1"
|
version = "1.3.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "byteorder"
|
name = "byteorder"
|
||||||
version = "1.3.4"
|
version = "1.4.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
|
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cc"
|
||||||
|
version = "1.0.73"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cfg-if"
|
name = "cfg-if"
|
||||||
version = "0.1.10"
|
version = "1.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "compiler_builtins"
|
name = "compiler_builtins"
|
||||||
version = "0.1.35"
|
version = "0.1.39"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e3fcd8aba10d17504c87ef12d4f62ef404c6a4703d16682a9eb5543e6cf24455"
|
checksum = "3748f82c7d366a0b4950257d19db685d4958d2fa27c6d164a3f069fec42b748b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "core_io"
|
name = "core_io"
|
||||||
version = "0.1.20200410"
|
version = "0.1.20210325"
|
||||||
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#22833ef0c6ff705130c9c7e39c83103b5b6a1c12"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "97f8932064288cc79feb4d343a399d353a6f6f001e586ece47fe518a9e8507df"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"rustc_version",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "embedded-hal"
|
name = "embedded-hal"
|
||||||
version = "0.2.4"
|
version = "0.2.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fa998ce59ec9765d15216393af37a58961ddcefb14c753b4816ba2191d865fcb"
|
checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nb 0.1.3",
|
"nb 0.1.3",
|
||||||
"void",
|
"void",
|
||||||
|
@ -50,9 +57,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fatfs"
|
name = "fatfs"
|
||||||
version = "0.3.4"
|
version = "0.3.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "93079df23039e52059e1f03b4c29fb0c72da2c792aad91bb2236c9fb81d3592e"
|
checksum = "e18f80a87439240dac45d927fd8f8081b6f1e34c03e97271189fa8a8c2e96c8f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
|
@ -72,13 +79,26 @@ dependencies = [
|
||||||
"log",
|
"log",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libasync"
|
||||||
|
version = "0.0.0"
|
||||||
|
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#92b3f3e1dd14fb2e53868665d95bbea4270da33e"
|
||||||
|
dependencies = [
|
||||||
|
"embedded-hal",
|
||||||
|
"libcortex_a9",
|
||||||
|
"nb 1.0.0",
|
||||||
|
"pin-utils",
|
||||||
|
"smoltcp",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libboard_zynq"
|
name = "libboard_zynq"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#22833ef0c6ff705130c9c7e39c83103b5b6a1c12"
|
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#92b3f3e1dd14fb2e53868665d95bbea4270da33e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bit_field",
|
"bit_field",
|
||||||
"embedded-hal",
|
"embedded-hal",
|
||||||
|
"libasync",
|
||||||
"libcortex_a9",
|
"libcortex_a9",
|
||||||
"libregister",
|
"libregister",
|
||||||
"log",
|
"log",
|
||||||
|
@ -91,7 +111,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libconfig"
|
name = "libconfig"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#22833ef0c6ff705130c9c7e39c83103b5b6a1c12"
|
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#92b3f3e1dd14fb2e53868665d95bbea4270da33e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"core_io",
|
"core_io",
|
||||||
"fatfs",
|
"fatfs",
|
||||||
|
@ -102,7 +122,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libcortex_a9"
|
name = "libcortex_a9"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#22833ef0c6ff705130c9c7e39c83103b5b6a1c12"
|
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#92b3f3e1dd14fb2e53868665d95bbea4270da33e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bit_field",
|
"bit_field",
|
||||||
"libregister",
|
"libregister",
|
||||||
|
@ -112,7 +132,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libregister"
|
name = "libregister"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#22833ef0c6ff705130c9c7e39c83103b5b6a1c12"
|
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#92b3f3e1dd14fb2e53868665d95bbea4270da33e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bit_field",
|
"bit_field",
|
||||||
"vcell",
|
"vcell",
|
||||||
|
@ -122,8 +142,9 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libsupport_zynq"
|
name = "libsupport_zynq"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#22833ef0c6ff705130c9c7e39c83103b5b6a1c12"
|
source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#92b3f3e1dd14fb2e53868665d95bbea4270da33e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"cc",
|
||||||
"compiler_builtins",
|
"compiler_builtins",
|
||||||
"libboard_zynq",
|
"libboard_zynq",
|
||||||
"libcortex_a9",
|
"libcortex_a9",
|
||||||
|
@ -134,15 +155,15 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linked_list_allocator"
|
name = "linked_list_allocator"
|
||||||
version = "0.8.6"
|
version = "0.8.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "84565678e403453d1a27a0886882b3b271701e65146d972d9d7d9a4c4a0ff498"
|
checksum = "822add9edb1860698b79522510da17bef885171f75aa395cff099d770c609c24"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.11"
|
version = "0.4.17"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
|
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
]
|
]
|
||||||
|
@ -153,12 +174,6 @@ version = "0.7.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c75de51135344a4f8ed3cfe2720dc27736f7711989703a0b43aadf3753c55577"
|
checksum = "c75de51135344a4f8ed3cfe2720dc27736f7711989703a0b43aadf3753c55577"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "memchr"
|
|
||||||
version = "2.3.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nb"
|
name = "nb"
|
||||||
version = "0.1.3"
|
version = "0.1.3"
|
||||||
|
@ -174,6 +189,12 @@ version = "1.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "546c37ac5d9e56f55e73b677106873d9d9f5190605e41a856503623648488cae"
|
checksum = "546c37ac5d9e56f55e73b677106873d9d9f5190605e41a856503623648488cae"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pin-utils"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "r0"
|
name = "r0"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
|
@ -181,10 +202,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211"
|
checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "smoltcp"
|
name = "rustc_version"
|
||||||
version = "0.6.0"
|
version = "0.1.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0fe46639fd2ec79eadf8fe719f237a7a0bd4dac5d957f1ca5bbdbc1c3c39e53a"
|
checksum = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084"
|
||||||
|
dependencies = [
|
||||||
|
"semver",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "semver"
|
||||||
|
version = "0.1.20"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "smoltcp"
|
||||||
|
version = "0.7.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3e4a069bef843d170df47e7c0a8bf8d037f217d9f5b325865acc3e466ffe40d3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
|
@ -193,9 +229,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vcell"
|
name = "vcell"
|
||||||
version = "0.1.2"
|
version = "0.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "876e32dcadfe563a4289e994f7cb391197f362b6315dc45e8ba4aa6f564a4b3c"
|
checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "void"
|
name = "void"
|
||||||
|
@ -205,9 +241,9 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "volatile-register"
|
name = "volatile-register"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0d67cb4616d99b940db1d6bd28844ff97108b498a6ca850e5b6191a532063286"
|
checksum = "9ee8f19f9d74293faf70901bc20ad067dc1ad390d2cbf1e3f75f721ffee908b6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"vcell",
|
"vcell",
|
||||||
]
|
]
|
||||||
|
|
|
@ -9,6 +9,3 @@ debug = true
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
opt-level = 2
|
opt-level = 2
|
||||||
lto = true
|
lto = true
|
||||||
|
|
||||||
[patch.crates-io]
|
|
||||||
core_io = { git = "https://git.m-labs.hk/M-Labs/zynq-rs.git" }
|
|
||||||
|
|
|
@ -69,4 +69,18 @@ SECTIONS
|
||||||
. += 0x20000;
|
. += 0x20000;
|
||||||
__stack0_start = .;
|
__stack0_start = .;
|
||||||
} > SDRAM
|
} > SDRAM
|
||||||
|
|
||||||
|
.irq_stack1 (NOLOAD) : ALIGN(8)
|
||||||
|
{
|
||||||
|
__irq_stack1_end = .;
|
||||||
|
. += 0x100;
|
||||||
|
__irq_stack1_start = .;
|
||||||
|
} > SDRAM
|
||||||
|
|
||||||
|
.irq_stack0 (NOLOAD) : ALIGN(8)
|
||||||
|
{
|
||||||
|
__irq_stack0_end = .;
|
||||||
|
. += 0x100;
|
||||||
|
__irq_stack0_start = .;
|
||||||
|
} > SDRAM
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,10 +35,6 @@ class RustPitaya(SoCCore):
|
||||||
AsyncResetSynchronizer(self.cd_adc, ResetSignal()),
|
AsyncResetSynchronizer(self.cd_adc, ResetSignal()),
|
||||||
]
|
]
|
||||||
adc_pads = platform.request("adc")
|
adc_pads = platform.request("adc")
|
||||||
self.specials += [
|
|
||||||
Instance("ODDR", o_Q=adc_pads.clk[0], i_D1=1, i_D2=0, i_CE=1, i_C=self.cd_adc.clk),
|
|
||||||
Instance("ODDR", o_Q=adc_pads.clk[1], i_D1=0, i_D2=1, i_CE=1, i_C=self.cd_adc.clk),
|
|
||||||
]
|
|
||||||
self.comb += adc_pads.cdcs.eq(1)
|
self.comb += adc_pads.cdcs.eq(1)
|
||||||
for port in adc_pads.data_a, adc_pads.data_b:
|
for port in adc_pads.data_a, adc_pads.data_b:
|
||||||
platform.add_platform_command("set_input_delay -max 3.400 -clock clk_adc [get_ports {port}[*]]", port=port)
|
platform.add_platform_command("set_input_delay -max 3.400 -clock clk_adc [get_ports {port}[*]]", port=port)
|
||||||
|
|
Loading…
Reference in New Issue