PULP systems support integration of hardware accelerators (Hardware
Processing Engines) that share memory with the RISC-V core and are programmed
through memory-mapped load/store accesses.
The hw/ips/hwpe-stream
and hw/ips/hwpe-ctrl
folders contain the IPs
necessary to plug streaming accelerators into a PULP system on the data and
control plane.
For further information on how to design and integrate such accelerators,
see hw/ips/hwpe-stream/doc
, https://arxiv.org/abs/1612.05974,
https://arxiv.org/abs/1807.03010 .
This testbench provides an example "almost standalone" environment to test
an example HWPE, performing multiply-accumulate on a
vector of fixed-point values (in hw/ips/hwpe-mac-engine
after
updating the IPs: see below in the Getting Started section).
The testbench makes use of dummy memories and of a simple zero-riscy core
to execute tests written directly in C, essentially in the same way
one would write a test running on a real PULP system.
The C testbench is located in sw/tb_hwpe.c
, along with the boot script
(crt0.S
and vectors.S
), the linker script (link.ld
) and the headers
(archi_hwpe.h
and hal_hwpe.h
).
The top RTL testbench is located in hw/rtl/tb_hwpe.sv
.
This testbench has a loose dependency on the PULP sdk. To install it, follow the same instructions as reported in PULPissimo. Start by installing the system dependencies indicated here: https://github.com/pulp-platform/pulp-builder/blob/master/README.md
If you have access to it, you can install a recent version of the SDK
from pulp-sdk-release
:
https://github.com/pulp-platform/pulp-sdk-release
The testbench has been tested with version 2019.02.06 configured for PULPissimo RTL simulation, but it should work in most other configurations as well.
Otherwise, you can execute the following commands:
git clone https://github.com/pulp-platform/pulp-builder.git
cd pulp-builder
source configs/pulpissimo.sh
./scripts/clean
./scripts/build-runtime
source sdk-setup.sh
source configs/rtl.sh
cd ..
To build the RTL simulation platform, start by getting the latest version of the IPs composing the PULP system:
make update-ips
This will download all the required IPs, solve dependencies and generate the simulation scripts.
After having access to the SDK, you can build the simulation platform by doing the following:
make build-hw
Once built, the SW test can be built by using the command:
make clean all
Then, it is run in command-line mode by using:
make run
and in GUI mode by using
make run gui=1
All Makefile commands can be combined together as usual. Two flags can be set to alter the way that the test runs:
P_STALL
(default 0.0, max 1.0) is the probability of a fake contention in the dummy memory.TEST_SRCS
(default issw/tb_hwpe.c
) is the C file containing themain
function of the SW testbench. For example,
make build-hw clean all run P_STALL=0.1 gui=1
builds the HW platform, rebuilds the SW and runs the test in GUI mode, with 10% probability of a contention (i.e. a stall) being generated on each memory interface.
See documentation on https://hwpe-doc.readthedocs.io.