*This is the tmp branch only for dev purpose. *
The following instructions are designed for a fresh installation of Ubuntu 22.04 (Jammy Jellyfish).
To install the required packages, run:
sudo apt-get install -y build-essential git doxygen python3-pip libsdl2-dev curl cmake gtkwave libsndfile1-dev rsync autoconf automake texinfo libtool pkg-config libsdl2-ttf-devGVSoC requires the following tools and versions:
- g++ and gcc versions >= 11.2.0
- cmake version >= 3.18.1
- Python version >= 3.11.3
Please ensure your toolchain meets these requirements.
Also please make sure you are using the bash shell for SoftHier Simulation:
bashFollow these steps to set up the SoftHier simulation environment:
-
Clone the repository and navigate into the project directory:
git clone https://github.com/gvsoc/gvsoc.git -b soft_hier_release soft_hier_release cd soft_hier_release -
Initialize the simulator environment by running:
source sourceme.sh
-
Build the SoftHier hardware model: 🛠️
make hw
The default configuration file is located at soft_hier/flex_cluster/flex_cluster_arch.py. To use a custom architecture configuration, specify the file path as follows:
cfg=<path/to/your/architecture/configuration/file> make hw-
Run the simulation with an example binary: 🎮
./install/bin/gvsoc --target=pulp.chips.flex_cluster.flex_cluster --binary examples/SoftHier/binary/example.elf run --trace=/chip/cluster_0/redmule
--binary: Specifies the executable binary to be loaded for the SoftHier simulation.--trace: Indicates which component's trace logs should be generated during the simulation.
To build the default binary from the source code in soft_hier/flex_cluster_sdk/app_example, run:
make swThe generated binary sw_build/softhier.elf and the dump file sw_build/softhier.dump will be located in the sw_build directory.
To build your own binary:
-
Prepare your source code in a folder with a
CMakeLists.txtthat defines the source files and include paths. For example:# CMakeLists.txt example set(SRC_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/main.c ) set(SOURCES ${SRC_SOURCES} PARENT_SCOPE) set(INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include PARENT_SCOPE)
-
Run the following command, replacing
<folder/of/your/code>with the path to your source code folder:app=<folder/of/your/code> make sw
This will compile the binary using the specified folder. The generated binary sw_build/softhier.elf and the dump file sw_build/softhier.dump will be located in the sw_build directory.
For convenient and flexible development, use the hs Makefile target to build both hardware and software together. This is particularly useful for custom architecture configurations and software development. Run:
cfg=<path/to/your/architecture/configuration/file> app=<folder/of/your/code> make hsWe provide example architecture configurations and software source code in the repository. Try the following:
cfg=examples/SoftHier/config/arch_test.py app=examples/SoftHier/software/test make hs; make run- Systolic GEMM on 512-bit NoC Bus
cfg=examples/SoftHier/config/arch_NoC512.py app=examples/SoftHier/software/gemm_systolic make hs; make runv - Systolic GEMM on 1024-bit NoC Bus
cfg=examples/SoftHier/config/arch_NoC1024.py app=examples/SoftHier/software/gemm_systolic make hs; make runv
The examples/SoftHier/assembled/HBM_preload_example/ directory contains:
config/– Architecture configuration files.preload/– Preloaded data files.software/– Multi-cluster GEMM software.
- Generating HBM Preload Data To generate an HBM preload binary from NumPy data, run:
python examples/SoftHier/assembled/HBM_preload_example/preload/hbm_data.pyThis will create the preload binary at:
examples/SoftHier/assembled/HBM_preload_example/preload/preload.elf
- Running SoftHier with HBM Preload To run SoftHier with the preloaded HBM data, use:
cfg=examples/SoftHier/assembled/HBM_preload_example/config/arch.py \
app=examples/SoftHier/assembled/HBM_preload_example/software \
pld=examples/SoftHier/assembled/HBM_preload_example/preload/preload.elf \
make hs runvTo visualize a SoftHier simulation, follow these steps:
- Run with the
runvMakefile target. - Generate a Perfetto-format trace file using the
pftotarget. An integrated example
<args> make hs runv pftoThe trace file will be saved at:
📂 sw_build/perfetto.json
To view the trace, open the following URL in your browser:
👉 Perfetto UI
Tutorials are prepared in tutorial folder
