Skip to content

Commit

Permalink
Release v4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaooooo committed Jun 7, 2021
1 parent 43c0b41 commit e6e64e6
Show file tree
Hide file tree
Showing 1,230 changed files with 299,595 additions and 24,629 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
On-going
- GVSOC
- Testbench: added new proxy commands for interacting with uart.
- Testbench: added multi-channel support with libsnd file input and output files.
- ISS: Improved div timing model to take parameter value into account.
- ISS: Added shared FPU model (not yet calibrated)

3.7.1

Highlights of this release:
Expand Down
48 changes: 40 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2017 GreenWaves Technologies SAS
# Copyright (c) 2021 GreenWaves Technologies SAS
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -42,14 +42,32 @@ TIMEOUT ?= 300

PULP_BRIDGE_PATH = $(GAP_SDK_HOME)/tools/pulp_tools/pulp-debug-bridge

SHELL=bash
ECHO_GREEN = $(shell tput setaf 2)
ECHO_BOLD = $(shell tput bold)
ECHO_CLEAR = $(shell tput sgr0)

# Keep this rule first
help:
@echo "=================== ${ECHO_BOLD}${ECHO_GREEN}GAP SDK${ECHO_CLEAR} ==================="
@echo ""
@echo "Main targets:"
@echo " - ${ECHO_BOLD}clean${ECHO_CLEAR} : clean the SDK"
@echo " - ${ECHO_BOLD}all${ECHO_CLEAR} : build the SDK without additional tools"
@echo " - ${ECHO_BOLD}minimal_sdk${ECHO_CLEAR} : build the bare minimum SDK"
@echo " - ${ECHO_BOLD}sdk${ECHO_CLEAR} : build the whole SDK"
@echo " - ${ECHO_BOLD}docs${ECHO_CLEAR} : build the SDK documentation"
@echo ""
@echo "Note: to speed up compilation, you can use the \"-j\" option with most rules"

checkout:
git submodule update --recursive --init

ifeq ($(TARGET_CHIP_FAMILY), GAP8)
sdk: all autotiler nntool openocd.build
all: pulp-os tools gvsoc flasher docs littlefs.build openocd_tools.build

clean: littlefs.clean
clean: littlefs.clean sfu.clean
$(RM) $(TARGET_INSTALL_DIR)
$(RM) $(INSTALL_DIR)
$(RM) $(BUILD_DIR)
Expand All @@ -64,17 +82,20 @@ else
sdk: all autotiler nntool
all: pulp-os gvsoc littlefs.build

clean: littlefs.clean
clean: littlefs.clean sfu.clean
$(RM) $(TARGET_INSTALL_DIR)
$(RM) $(BUILD_DIR)
endif
minimal_sdk: freertos pmsis-bsp.checkout pmsis-api.checkout gapy.all examples.checkout openocd_tools.build

mini_checkout: pmsis-bsp.checkout pmsis-api.checkout examples.checkout
minimal_sdk: freertos gapy.all openocd_tools.build
freertos: freertos.all openmp.all gap_lib.all

# Rules for installing docs
#------------------------------------------
docs:
$(MAKE) -C $(GAP_SDK_HOME)/docs all
$(MAKE) -C $(GAP_SDK_HOME)/doc html

# Rules for installing tools
#------------------------------------------
Expand All @@ -91,7 +112,17 @@ install_others: | $(INSTALL_BIN_DIR)
install_pulp_tools: install_others plptest.build
#$(MAKE) -C $(GAP_SDK_HOME)/tools/pulp_tools all

tools: install_others install_pulp_tools
tools: install_others install_pulp_tools sfu.build

sfu.clean:
ifneq ("$(wildcard tools/sfu_gen/Makefile)","")
cd tools/sfu_gen && make clean
endif

sfu.build:
ifneq ("$(wildcard tools/sfu_gen/Makefile)","")
cd tools/sfu_gen && make lib all install INSTALL_DIR=$(CURDIR)/tools/sfu_gen/install
endif

nntool:
$(MAKE) -C $(GAP_SDK_HOME)/tools/nntool all
Expand All @@ -110,6 +141,7 @@ flasher: pulp-os

gvsoc: pulp-os tools
./gvsoc/gvsoc-build
$(MAKE) gvsoc.build

autotiler:
if [ -e $(GAP_SDK_HOME)/tools/autotiler_v2/Makefile ]; then $(MAKE) -C $(GAP_SDK_HOME)/tools/autotiler_v2 all; fi
Expand Down Expand Up @@ -268,11 +300,11 @@ gvsoc.checkout:
git submodule update --init gvsoc/gvsoc gvsoc/gvsoc_gap gvsoc/gvsoc_gap_sfu

gvsoc.build:
make -C gvsoc/gvsoc build BUILD_DIR=$(BUILD_DIR)/gvsoc INSTALL_DIR=$(INSTALL_DIR) TARGET_INSTALL_DIR=$(GAP_SDK_HOME)/install
make -C gvsoc/gvsoc_gap build BUILD_DIR=$(BUILD_DIR)/gvsoc_gap INSTALL_DIR=$(INSTALL_DIR) TARGET_INSTALL_DIR=$(GAP_SDK_HOME)/install
$(MAKE) -C gvsoc/gvsoc build BUILD_DIR=$(BUILD_DIR)/gvsoc INSTALL_DIR=$(INSTALL_DIR) TARGET_INSTALL_DIR=$(GAP_SDK_HOME)/install
$(MAKE) -C gvsoc/gvsoc_gap build BUILD_DIR=$(BUILD_DIR)/gvsoc_gap INSTALL_DIR=$(INSTALL_DIR) TARGET_INSTALL_DIR=$(GAP_SDK_HOME)/install

gvsoc.clean:
make -C gvsoc/gvsoc clean BUILD_DIR=$(BUILD_DIR)/gvsoc INSTALL_DIR=$(INSTALL_DIR) TARGET_INSTALL_DIR=$(GAP_SDK_HOME)/install
$(MAKE) -C gvsoc/gvsoc clean BUILD_DIR=$(BUILD_DIR)/gvsoc INSTALL_DIR=$(INSTALL_DIR) TARGET_INSTALL_DIR=$(GAP_SDK_HOME)/install

gvsoc.all: gvsoc.checkout gvsoc.build

Expand Down
155 changes: 52 additions & 103 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,39 @@
[GWT-logo]: logo.png
[GWT-link]: https://greenwaves-technologies.com/

# Setting up the GAP8 SDK
# Setting up the GAP SDK

## About

The GAP8 SDK allows you to compile and execute applications on the GAP8 IoT
The GAP SDK allows you to compile and execute applications on the GAP IoT
Application Processor. This SDK is an extract of the necessary elements from
the [pulp-sdk](https://github.com/pulp-platform/pulp-sdk) produced by the PULP
project, to provide a development environment for the GAP8 series processors.
project, to provide a development environment for the GAP series processors.

We provide you with a set of tools and two different operating systems for GAP8:
We provide you with a set of tools and two different operating systems for GAP:

* [Tools](https://greenwaves-technologies.com/tools-and-software/)
* GAP8 RISCV GNU toolchain: a pre-compiled toolchain inherited from RISC V
* GAP RISCV GNU toolchain: a pre-compiled toolchain inherited from RISC V
project with support for our extensions to the RISC-V Instruction Set
Architecture.
* Program / control GAP8
* Program / control GAP
* Debug your application using GDB
* Program the GAPuino flash memory with applications
* [NNTOOL](https://github.com/GreenWaves-Technologies/gap_sdk/blob/master/tools/nntool/README.md):
a set of tools based on Python helps to port NN graphs from various NN
training packages to GAP8
training packages to GAP
* [GVSOC](https://gvsoc.readthedocs.io/en/latest/)
GVSOC is a lightweight and flexible instruction set simulator which can simulate GreenWaves' GAP series processors. GVSOC allows execution of programs on a virtual platform without any hardware limits. Thanks to device models, full application with real device drivers can be simulated. Currently, we provide simulations of devices such as cameras, microphones, LCDs, etc.
* [Profiler] Profiler is a part of GWT GAP SDK and used with GVSOC, GWT Full System SoC Simulator. Profiler gives a visual view of what is happening inside the chip and allows to control the simulator through a graphic interface. Profiler is an extremely useful tool for developing and debugging applications on GAP processors.
* [Autotiler](https://greenwaves-technologies.com/manuals/BUILD/AUTOTILER/html/index.html):
a code generator for GAP8, which can generate a user algorithm (CNN,
a code generator for GAP, which can generate a user algorithm (CNN,
MatrixAdd, MatrixMult, FFT, MFCC, etc) with optimized memory management.
* gapy: a Python utility for building the flashimage, creating
partitions and filesystems, executing OpenOCD, etc.
* Operating Systems
* PULP OS - The open source embedded RTOS produced by the PULP project
* FreeRTOS - FreeRTOS is an open source real-time operating system.
GreenWaves Technologies has ported it to GAP8.
GreenWaves Technologies has ported it to GAP.
* PMSIS - PMSIS is an open-source system layer which any operating system
can implement to provide a common API to applications. We currently provide
it for PULP OS and FreeRTOS, and it is used by our applications to be
Expand All @@ -49,27 +52,31 @@ These instructions were developed using a fresh Ubuntu 18.04 Bionic Beaver
The following packages need to be installed:

~~~~~shell
sudo apt-get install -y build-essential \
sudo apt-get install -y \
autoconf \
automake \
bison \
build-essential \
cmake \
curl \
doxygen \
flex \
git \
gtkwave \
libftdi-dev \
libftdi1 doxygen \
python3-pip \
libftdi1 \
libjpeg-dev \
libsdl2-dev \
curl \
wget \
cmake \
libusb-1.0-0-dev \
scons \
gtkwave \
libsdl2-ttf-dev \
libsndfile1-dev \
rsync \
autoconf \
automake \
texinfo \
libtool \
libusb-1.0-0-dev \
pkg-config \
libsdl2-ttf-dev \
libjpeg-dev
python3-pip \
rsync \
scons \
texinfo \
wget
~~~~~

For Ubuntu 20.04 only:
Expand Down Expand Up @@ -115,39 +122,14 @@ The following instructions assume that you install the GAP SDK into your home
directory. If you want to put it somewhere else then please modify them
accordingly.

### Ubuntu 16.04

You can follow the steps for Ubuntu 18.04 except for the following instructions.

After you have installed the system packages with apt-get, you need to also
create this symbolic link:

~~~~~shell
sudo ln -s /usr/bin/libftdi-config /usr/bin/libftdi1-config
~~~~~

Also, you may need to install git lfs

~~~~~shell
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
git lfs install
~~~~~

## Download and install the toolchain

Now clone the GAP8 SDK and the GAP8/RISC-V toolchain:
Now clone the GAP SDK and the GAP/RISC-V toolchain:

~~~~~shell
git clone https://github.com/GreenWaves-Technologies/gap_riscv_toolchain_ubuntu_18.git
~~~~~

In case you use an old git version, you may need to use these commands instead:

~~~~~shell
git lfs clone https://github.com/GreenWaves-Technologies/gap_riscv_toolchain_ubuntu_18.git
~~~~~

Install the toolchain (this may require to launch the script through sudo):

~~~~~shell
Expand All @@ -174,26 +156,16 @@ source sourceme.sh
or

~~~~~shell
# replace gapuino_v2.sh by the board you want
source config/gapuino_v2.sh
# replace gapuino_v3.sh by the board you want
source config/gapuino_v3.sh
~~~~~

If you directly source the board config, you need to source the appropriate
config file for the board that you have. The SDK supports 2 boards (gapuino
and gapoc) and each of them can use version 1 or version 2 of the GAP8 chip.
Boards bought before 10/2019 contains GAP8 version 1 and use a USB B plug for
JTAG while the ones bought after contains version 2 and use a USB micro B for
JTAG.

Hereafter you can find a summary of the available boards and their
configuration file.

| Board | Chip | Config file |
|:-------:|:-------:|:---------------------:|
| Gapuino | GAP8 v1 | configs/gapuino.sh |
| Gapuino | GAP8 v2 | configs/gapuino_v2.sh |
| Gapoc | GAP8 v1 | configs/gapoc_a.sh |
| Gapoc | GAP8 v2 | configs/gapoc_a_v2.sh |
config file for the board that you have. The SDK supports 3 boards (gapuino,
gapoc_a and gapoc_b) and each of them can use version 1/2/3 of the GAP8 chip.
Boards bought before 10/2019 contains GAP8 version 1 and use a USB B plug for
JTAG while the ones bought after contains version 2/3 and use a USB micro B
for JTAG.

Once the proper config file is sourced, you can proceed with the SDK build.

Expand All @@ -217,6 +189,7 @@ can install with this command from GAP SDK root folder:

~~~~~shell
pip3 install -r requirements.txt
pip3 install -r doc/requirements.txt
~~~~~

### SDK install
Expand Down Expand Up @@ -364,6 +337,14 @@ You can also run this example on the GAP virtual platform with this command:
make clean all run platform=gvsoc PMSIS_OS=freertos/pulpos
~~~~~

### Using the virtual platform with profiler

#### Using GAP Profiler
You can open the doc : gap_sdk/doc/_build/html/index.html and find Tools -> Profiler

In the doc, we will show you how to install and use the profiler step by step.

#### Using VCD traces with GTKWave
You can also generate VCD traces to see more details about the execution:

~~~~~shell
Expand Down Expand Up @@ -416,16 +397,12 @@ flash. Be careful that this is a permanent operation, even though it will still
be possible to boot from JTAG. This will just always boot from flash when you
power-up the board or reset it.

To program the efuses, execute the following command and follow the instructions:
To program the efuses, please read the [README](./tools/gap_fuser/README.md) and
use the fuser tool to program your efuse.

~~~~~shell
# if using hyperflash:
openocd-fuser-hyperflash
# if using spiflash:
openocd-fuser-spiflash
~~~~~
## Console IO via uart

If you choose to boot your application from Flash, and you want to view the
If you choose to boot your application from Flash, and/or you want to view the
output of printf's in your code then you can first compile your application
with the printf redirected on the UART with this command:

Expand All @@ -443,34 +420,6 @@ cutecom&
Then please configure your terminal program to use /dev/ttyUSB1 with a 115200
baud rate, 8 data bits and 1 stop bit.


## Documentation

Build the documentation:

~~~~~shell
cd gap_sdk
make docs
~~~~~

If you haven't download and install the autotiler, you will probably have some
warnings when you build the docs.
All the documentations are available on [our website](https://greenwaves-technologies.com/en/sdk/).

You can read the documentation by opening gap_doc.html in the docs folder in
your browser:

~~~~~shell
firefox docs/gap_doc.html
~~~~~

If you would like PDF versions of the reference manuals you can do:

~~~~~shell
cd docs
make pdf
~~~~~

## Upgrading/Downgrading the SDK

If you want to upgrade/downgrade your SDK to a new/old version:
Expand Down
2 changes: 1 addition & 1 deletion applications/FaceDetection/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ APP_CFLAGS += -DUSE_DISPLAY
endif

BOARD_NAME ?= gapoc_a
PMSIS_OS ?= freertos
#PMSIS_OS ?= freertos
USE_PMSIS_BSP=1

export GAP_USE_OPENOCD=1
Expand Down
Loading

0 comments on commit e6e64e6

Please sign in to comment.