Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target Zynq and NPU #17

Closed
4 tasks done
sampsyo opened this issue Jun 26, 2014 · 2 comments
Closed
4 tasks done

Target Zynq and NPU #17

sampsyo opened this issue Jun 26, 2014 · 2 comments

Comments

@sampsyo
Copy link
Member

sampsyo commented Jun 26, 2014

We need to add the Zynq (ARM + FPGA) platform as a target for the ACCEPT toolchain.

This involves:

  • Extend app.mk to cross-compile binaries for the bare-metal ARM.
  • Also extend it to execute binaries using the Xilinx debugger (xmd), including sending the appropriate bitstream and possibly resetting the board with the Wemo switch.
  • Collect output and performance numbers through the serial log rather than the filesystem.
  • Make the experiments command aware of the platform it's running on so we can run x86 benchmarks on the cluster (in parallel) and Zynq experiments on pinga (in serial), and ne'er the twain shall meet.

Instructions from Thierry for running benchmarks on the Zynq:

  1. ssh into sampa-gw.cs.washington.edu
  2. ssh sampa-gw.cs.washington.edu
  3. from there, ssh into pinga
  4. ssh pinga
  5. source the xilinx settings script
  6. . /sampa/share/Xilinx/14.6/14.6/ISE_DS/settings64.sh
  7. go to the following directory
  8. cd /sampa/share/thierry/benchmarks/boot_files
  9. to run a benchmark, type the following (replace inversek2j with the benchmark of your choice)
  10.  make inversek2j
  11. this will compile the benchmark source code in BenchNN/, and will copy the elf file into the elf/ directory, program the NPU and run the binary on the NPU
  12. if you need to run your own elf file on the NPU, change the path of the elf file in the Makefile to your own (e.g. change elf/inversek2j.elf to /sampa/share/andreolb/inversek2j.elf).
  13. to read the output, go to the mini com_logs directory. 
  14. cd /sampa/share/thierry/minicom_logs
  15. each output is timestamped with the current time the benchmark was running
  16. vim minicom_14_06_09_13_42_44_inversek2j.txt

Andre's cross-compiler setup is in the npu branch's app.mk. Clang is invoked to target ARM and produce assembly files. Then gcc is used to produce the final binary:

arm-xilinx-eabi-gcc -Wl,-T -Wl,../lib/lscript.ld -L ../lib/bsp/lib inversek2j.s -o inversek2j.elf -Wl,--start-group,-lxil,-lgcc,-lc,-lm,--end-group

much like the msp430 workflow we have now.

sampsyo added a commit that referenced this issue Jun 26, 2014
The runtime library (previously enercrt, now acceptrt) was built with CMake
once, up front, with the rest of the toolchain. This was a bad idea because
it's platform-specific. Now it's built by app.mk, on demand for benchmarks
that need it.

The output file is tagged with the ARCH variable, so you get
`acceptrt.zynq.bc`. When ARCH is unset, it defaults to `default`, indicating
non-cross-compiling builds. I haven't tested this, but I think this should
also work for `acceptrt.msp430.bc` and such.
sampsyo added a commit that referenced this issue Jun 26, 2014
Wraps up the boilerplate used in Theirry's make targets as a RUNSHIM script.
The `zynqrun.sh` script takes both the bitstream file and the ELF binary to be
sent to the device.
@sampsyo sampsyo added this to the ASPLOS milestone Jun 27, 2014
sampsyo added a commit that referenced this issue Jun 27, 2014
This is the whole point of the separate runtime implementation for this
platform.
@sampsyo
Copy link
Member Author

sampsyo commented Jun 28, 2014

Next step: some sort of post-processor script that will split the main output from the performance numbers. For ease of wrangling, this could use the same filename for the performance data as for the default acceptrt. It could even do the conversion to seconds from FPGA clocks.

@sampsyo
Copy link
Member Author

sampsyo commented Jul 11, 2014

All ready. Need to merge in the NPU branch so we can actually run the experiments.

@sampsyo sampsyo closed this as completed Jul 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant