software/demo: add litex_bare_metal_demo pre-installed script.

Build demo: litex_bare_metal_demo --build-path=build/arty/
This commit is contained in:
Florent Kermarrec 2020-12-21 19:27:21 +01:00
parent 4df56ed456
commit c79135c573
4 changed files with 36 additions and 2 deletions

View File

@ -6,8 +6,8 @@ This directory provides a minimal bare metal demo app that demonstrates how to e
[> Build
--------
Imagine you just build Arty example design from LiteX-Boards, to build the demo app, run in this directory:
`$ export BUILD_DIR=xxyy/litex/litex/boards/targets/build/arty && make`
Imagine you just build the Arty example design from LiteX-Boards, to build the demo app, run:
`$ litex_bare_metal_demo --build-path=build/arty/`
[> Load
-------

View File

View File

@ -0,0 +1,33 @@
#!/usr/bin/env python3
#
# This file is part of LiteX.
#
# Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr>
# SPDX-License-Identifier: BSD-2-Clause
import os
import argparse
from distutils.dir_util import copy_tree
def main():
parser = argparse.ArgumentParser(description="LiteX Bare Metal Demo App.")
parser.add_argument("--build-path", help="Target's build path.", required=True)
args = parser.parse_args()
# Create demo directory
os.makedirs("demo", exist_ok=True)
# Copy contents to demo directory
src = os.path.abspath(os.path.dirname(__file__))
copy_tree(src, "demo")
# Compile demo
os.system(f"export BUILD_DIR=../{args.build_path} && cd demo && make")
# Copy demo.bin
os.system("cp demo/demo.bin ./")
if __name__ == "__main__":
main()

View File

@ -43,6 +43,7 @@ setup(
"litex_read_verilog=litex.tools.litex_read_verilog:main",
"litex_simple=litex.boards.targets.simple:main",
"litex_json2dts=litex.tools.litex_json2dts:main",
"litex_bare_metal_demo=litex.soc.software.demo.demo:main",
# short names
"lxterm=litex.tools.litex_term:main",
"lxserver=litex.tools.litex_server:main",