diff --git a/justfile b/justfile index e61ca86..fe226d9 100644 --- a/justfile +++ b/justfile @@ -35,3 +35,11 @@ docs-zynq: bootgen: bootgen -arch zynq -image boot.bif -o boot.bin -w on echo "Generated boot.bin at zynq-boot-image/staging" + +[no-cd] +run binary: + # Run the initialization script. It needs to be run inside the justfile directory. + python3 {{justfile_directory()}}/scripts/zynq7000-init.py + + # Run the GDB debugger in GUI mode. + gdb-multiarch -q -x {{justfile_directory()}}/zynq/gdb.gdb {{binary}} -tui diff --git a/scripts/runner.sh b/scripts/runner.sh deleted file mode 100755 index 49e7049..0000000 --- a/scripts/runner.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# Exit if no arguments are provided -if [ "$#" -eq 0 ]; then - echo "Error: No arguments provided." - echo "Usage: run.sh " - exit 1 -fi - -# Get the absolute path to the `scripts/` directory -SCRIPT_DIR="$(cd -- "$(dirname -- "$0")" && pwd)" - -# Get the absolute path to the project root -ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" - -# Run the initialization script -"$SCRIPT_DIR/zynq7000-init.py" - -# Run the GDB debugger in GUI mode. -gdb-multiarch -q -x gdb.gdb "$@" -tui \ No newline at end of file diff --git a/scripts/unittest.sh b/scripts/unittest.sh deleted file mode 100755 index f3dab7d..0000000 --- a/scripts/unittest.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -cargo +stable test --target $(rustc -vV | grep host | cut -d ' ' -f2) -p zynq7000-hal -cargo +stable test --target $(rustc -vV | grep host | cut -d ' ' -f2) -p zynq7000 diff --git a/scripts/zynq7000-init.py b/scripts/zynq7000-init.py index 1de220d..fdcae84 100755 --- a/scripts/zynq7000-init.py +++ b/scripts/zynq7000-init.py @@ -121,7 +121,9 @@ def main(): bitstream = args.bit init_tcl = args.init_tcl - xsct_script = Path(TCL_SCRIPT_NAME) + # Get the script's directory + script_dir = Path(__file__).resolve().parent + xsct_script = script_dir / TCL_SCRIPT_NAME if not xsct_script.exists(): xsct_script = Path(os.path.join(SCRIPTS_DIR, TCL_SCRIPT_NAME)) diff --git a/zynq/.cargo/config.toml b/zynq/.cargo/config.toml index 15ce3b2..2a4d3aa 100644 --- a/zynq/.cargo/config.toml +++ b/zynq/.cargo/config.toml @@ -1,4 +1,6 @@ [target.armv7a-none-eabihf] +runner = "just run" + rustflags = [ "-Ctarget-cpu=cortex-a9", "-Ctarget-feature=+vfp3", diff --git a/zynq/zedboard-fsbl/src/main.rs b/zynq/zedboard-fsbl/src/main.rs index af514e2..fdc252a 100644 --- a/zynq/zedboard-fsbl/src/main.rs +++ b/zynq/zedboard-fsbl/src/main.rs @@ -25,10 +25,6 @@ use zynq7000_hal::{ }; use zynq7000_rt as _; -use crate::ddr_cfg::DDRIOB_CONFIG_SET_ZEDBOARD; - -pub mod ddr_cfg; - // PS clock input frequency. const PS_CLK: Hertz = Hertz::from_raw(33_333_333);