Skip to content

Commit

Permalink
Merge pull request #14 from nbosb/dev-restructure
Browse files Browse the repository at this point in the history
Restructure
  • Loading branch information
aut0 authored Jul 30, 2024
2 parents cfe06ef + ca50a13 commit e2463c0
Show file tree
Hide file tree
Showing 89 changed files with 16,102 additions and 2,602 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*/BUILD/*
BUILD
images

20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Software for an ARMv8 Virtual Platform (AVP64)

This repository contains software for an ARMv8 multi-core virtual platform.
This repository contains software and configuration files for an ARMv8 multi-core virtual platform.
You can find the ARMv8 multi-core virtual platform [here](https://github.com/aut0/avp64).
It was built at the [Institute for Communication Technologies and Embedded Systems](https://www.ice.rwth-aachen.de/) at RWTH Aachen University.

Expand All @@ -10,36 +10,36 @@ It was built at the [Institute for Communication Technologies and Embedded Syste

1. To build `avp64_sw``, you need a working installation of [docker](https://docs.docker.com/engine/install/) or [podman](https://podman.io/).

2. Clone git repository:
1. Clone git repository:

```bash
git clone --recurse-submodules https://github.com/aut0/avp64_sw
git clone --recursive https://github.com/aut0/avp64_sw
```

3. The directory used in this project is:
1. The directory used in this project is:

```bash
<source-dir> location of your repo copy, e.g. /home/lukas/avp64_sw
```

4. You can find the build scripts in `<source-dir>/linux`:
1. You can find the build scripts in `<source-dir>/linux`:

```bash
build_linux_bootcode_el1el2.sh
build_linux_bootcode_el3.sh
build_linux_buildroot.sh
build_linux_nvdla_buildroot.sh
build_linux_buildroot_nvdla.sh
```

5. Execute the scripts:
1. Execute the scripts:

```bash
<source-dir>/linux/<script_name>.sh
```

Note: If the user is not a member of the group `docker`, the scripts have to be run as `root`. For more details see docker [documentation](https://docs.docker.com/).

6. The output can be found at `<source-dir>/linux/BUILD`.
1. The output can be found at `<source-dir>/images`.

1. You can untar the archives into the [avp64/sw](https://github.com/aut0/avp64/tree/master/sw) directory of your [avp64](https://github.com/aut0/avp64) project

----

Expand Down
81 changes: 81 additions & 0 deletions benchmark/config/benchmark.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
##############################################################################
# #
# Copyright 2024 MachineWare GmbH #
# #
# This software is licensed under the MIT license. #
# A copy of the license can be found in the LICENSE file at the root #
# of the source tree. #
# #
##############################################################################

### General configuration ####################################################
system.name = %BENCHMARK%
system.config = ${cfg}
system.cpu.ncores = 1

system.throttle.rtf = 0

# Specify simulation duration. Simulation will stop automatically once this
# time-stamp is reached. Use integer values with suffixes s, ms, us or ns. If
# you want to simulate infinitely, leave this commented out.
# system.duration = 2s

# TLM global quantum, a higher value improves performance but reduces timing
# accuracy. Use integer values with suffixes s, ms, us or ns.
system.quantum = 100us

# Clock frequency
system.clock_cpu.hz = 1000000000 # 1 GHz

### CPU configuration ########################################################
system.cpu.gdb_port = 5555
system.cpu.gdb_wait = false
system.cpu.gdb_echo = false
system.cpu.symbols = ${dir}/%BENCHMARK%/%BENCHMARK%.elf

for i : ${system.cpu.ncores} do
system.cpu.arm${i}.gdb_port = 5210${i}
system.cpu.arm${i}.gdb_wait = false
done

### Physical Address Map #####################################################

system.addr_ram = 0x00000000..0x0fffffff
system.addr_hwrng = 0x10007000..0x10007fff
system.addr_simdev = 0x10008000..0x10008fff
system.addr_uart0 = 0x10009000..0x10009fff
system.addr_uart1 = 0x1000a000..0x1000afff
system.addr_uart2 = 0x1000b000..0x1000bfff
system.addr_uart3 = 0x1000c000..0x1000cfff
system.addr_sdhci = 0x1000d000..0x1000dfff
system.addr_rtc = 0x1000e000..0x1000efff
system.addr_gpio = 0x1000f000..0x1000ffff
system.addr_lan0 = 0x10010000..0x1001ffff
system.addr_spi = 0x10020000..0x10020fff
system.cpu.addr_gic_distif = 0x10140000..0x10140fff
system.cpu.addr_gic_cpuif = 0x10141000..0x10142fff
system.cpu.addr_gic_vifctrl = 0x10143000..0x10144fff
system.cpu.addr_gic_vcpuif = 0x10145000..0x10146fff

### Interrupt Map ############################################################

system.irq_uart0 = 5
system.irq_uart1 = 6
system.irq_uart2 = 7
system.irq_uart3 = 8
system.irq_lan0 = 9
system.irq_sdhci = 10
system.irq_spi = 11
system.cpu.irq_gt_hyp = 10
system.cpu.irq_gt_virt = 11
system.cpu.irq_gt_ns = 14
system.cpu.irq_gt_s = 13

### Memory and IO peripherals configuration ##################################

# Memory configuration
system.ram.size = 0x10000000 # 256MB
system.ram.images = ${dir}/%BENCHMARK%/%BENCHMARK%.bin@0x00000000

# Terminal configuration
system.term0.backends = stdout # stdout|file|tap|null
1 change: 1 addition & 0 deletions benchmark/scripts/docker_entrypoint_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ "$1" == "build" ]; then
echo "Building $2"
mkdir -p /app/build/$2
make -C /app/benchmark/$2 O=/app/build/$2
/app/postprocess.bash $2
elif [ "$1" == "clean" ]; then
echo "Cleaning $2"
make -C /app/benchmark/$2 O=/app/build/$2 clean
Expand Down
7 changes: 7 additions & 0 deletions benchmark/scripts/docker_run_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"

BENCHMARK_SRC_DIR=$DIR/../src
IMAGES_DIR="$DIR/../../images"
BUILD_DIR=$DIR/../BUILD

DOCKER_FLAGS=""
Expand All @@ -46,10 +47,16 @@ else
DOCKER_FLAGS="--user $(id -u):$(id -g)"
fi

mkdir -p "${BUILD_DIR}"
mkdir -p "${IMAGES_DIR}"

docker run \
--rm \
$DOCKER_FLAGS \
-v "$BENCHMARK_SRC_DIR":/app/benchmark:ro,Z \
-v "$BUILD_DIR":/app/build:Z \
-v "$IMAGES_DIR":/app/images:Z \
-v "$DIR/postprocess.bash":/app/postprocess.bash:ro,Z \
-v "$DIR/../config":/app/config:ro,Z \
-v "$DIR/docker_entrypoint_benchmark.sh":/app/docker_entrypoint.sh:Z \
avp64_benchmark $1 $2
21 changes: 21 additions & 0 deletions benchmark/scripts/postprocess.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

BENCHMARK=$1

BUILD_DIR=/app/build/$BENCHMARK
TMP_DIR=$BUILD_DIR/tmp
BENCH_DIR=$TMP_DIR/$BENCHMARK

echo "Posprocessing benchmark '$1'"

rm -rf $TMP_DIR
mkdir -p $BENCH_DIR

# create/copy files
cp $BUILD_DIR/$BENCHMARK.{bin,elf} $BENCH_DIR/
sed -e "s/%BENCHMARK%/${BENCHMARK}/g" /app/config/benchmark.cfg > ${TMP_DIR}/${BENCHMARK}.cfg

# create tarball
pushd ${TMP_DIR} > /dev/null
tar -czf /app/images/${BENCHMARK}.tar.gz ./*
popd > /dev/null
37 changes: 0 additions & 37 deletions linux/build_linux_bootcode_el1el2.sh

This file was deleted.

37 changes: 0 additions & 37 deletions linux/build_linux_bootcode_el3.sh

This file was deleted.

9 changes: 4 additions & 5 deletions linux/build_linux_buildroot.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#!/bin/env bash
##############################################################################
# #
# Copyright 2020 Lukas Jünger #
# Copyright 2024 Lukas Jünger, Nils Bosbach #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
Expand All @@ -22,7 +22,7 @@ set -euo pipefail
# Get directory of script itself
SOURCE="${BASH_SOURCE[0]}"
# resolve $SOURCE until the file is no longer a symlink
while [ -h "$SOURCE" ]; do
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
SOURCE="$(readlink "$SOURCE")"
# if $SOURCE was a relative symlink, we need to resolve it relative to the
Expand All @@ -31,7 +31,6 @@ while [ -h "$SOURCE" ]; do
done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"

mkdir -p $DIR/BUILD
# Build Linux buildroot
docker build --tag avp64_linux_buildroot "$DIR/scripts/linux_buildroot"
"$DIR/scripts/linux_buildroot/docker_run_linux_buildroot.sh" build
"$DIR/scripts/linux_buildroot/docker_run_linux_buildroot.sh" build default
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#!/bin/env bash
##############################################################################
# #
# Copyright 2020 Lukas Jünger #
# Copyright 2024 Lukas Jünger, Nils Bosbach #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
Expand All @@ -22,7 +22,7 @@ set -euo pipefail
# Get directory of script itself
SOURCE="${BASH_SOURCE[0]}"
# resolve $SOURCE until the file is no longer a symlink
while [ -h "$SOURCE" ]; do
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
SOURCE="$(readlink "$SOURCE")"
# if $SOURCE was a relative symlink, we need to resolve it relative to the
Expand All @@ -31,4 +31,6 @@ while [ -h "$SOURCE" ]; do
done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"

"$DIR/scripts/linux_nvdla_buildroot/docker_run_linux_nvdla_buildroot.sh" clean
# Build Linux buildroot
docker build --tag avp64_linux_buildroot "$DIR/scripts/linux_buildroot"
"$DIR/scripts/linux_buildroot/docker_run_linux_buildroot.sh" build nvdla
37 changes: 0 additions & 37 deletions linux/build_linux_nvdla_buildroot.sh

This file was deleted.

2 changes: 1 addition & 1 deletion linux/buildroot
Submodule buildroot updated 12071 files
Loading

0 comments on commit e2463c0

Please sign in to comment.