GAP8 is programmed using C or C++ with a standard GCC, GDB, binutils based toolchain. We have extended the toolchain with code generation and optimization support for the extra instructions that we have added. Fine-grained access to the more difficult to optimize instructions can be gained using GCC built-ins. We also provide this toolchain integrated with a Visual IDE from PlatformIO.
Edge device security has been an increasingly important industry topic. Although the types of devices that GAP8 targets, small battery operated sensors with very limited backhaul bandwidth, are not top of mind for ambitious hackers, security is still a concern. GAP8 tries to take a reasonable approach to this.
GAP8 includes e-fuses that control the boot process and can force loading of encrypted software protecting the device from malicious firmware. The FC can run in a machine or user mode which combined with a memory protection unit firewalling the FC peripherals and L2 memory ensures that application software cannot corrupt GAP8s state.
GAP8 is not equipped with data caches due to their low efficiency (30 % hit rate on average which means that 70% of fetches are wasted energy) and the predictable nature of the streamed data processing that GAP8 is targeted at. We use 2 DMA units to carry out data movement from external memory and peripherals, L2 and L1 memory areas.
The micro DMA (uDMA) unit is an autonomous, multi-channel DMA controller capable of transferring data between external peripherals (Q-SPI, I2S, I2C, HuperBus, Camera Parallel Interface) and the L2 memory without intervention of the FC. The cluster DMA unit copies data from the L2 memory to the L1 memory. It is capable of 1D and 2D bulk memory transfer on the L2 side and 1D on the L1 side.
GAP8 has 3 different memory areas to consider when processing data, the small but high speed shared L1 area, the larger, slower L2 area and potentially off-chip streamed L3 memory via the HyperBus or Q-SPI interfaces. The best energy efficiency can be achieved If we can execute double or triple buffered data movement across these memory spaces using the DMA units concurrent with processing.
To aid in this we have developed a tool called the AutoTiler (Figure 4). The AutoTiler combines basic kernels that can operate on partial tiles of data in the L1 area with a »User Kernel« that describes how data should be passed to and circulate among Basic Kernels and in which memory area the data is located.
This tool then automatically generates readable C code that can be compiled for GAP8 that carries out all the DMA transfer management and synchronization of calls to the basic kernel running on each cluster core. Using this tool we have developed code generators for a wide range of different neural network and signal processing tasks.
As a demonstration of the use of the efficient delivery of computing power enabled by GAP8 a project at the University of Zurich and ETH Zurich has developed a ‘shield’ for a CrazyFlie nano-drone that enables it to have autonomous navigation capabilities (Figure 5).
Autonomous navigation has hitherto been restricted to larger micro or standard size drones where available power and weight carrying ability allowed the use of micro-PC or large embedded computing platforms or nano-drones using wireless communications to a remote processing device.
The project ported a neural network previously run on a PC to GAP8. The network, a derivative of RESnet, is trained on images correlated to a steering angle and collision probability (Figure 6). At 1 volt with the FC running at 50MHz and the Cluster at 100 MHz GAP8 can process 6.5 QVGA frames/sec at a power consumption of just 4 mW. Even at GAP8’s full processing speed the combined flight control and autonomous navigation functions are kept below 5 % of the overall power budget of the drone.
The Author
Martin Croome
obtained his BSc(Hons) in Computer Science from the University of Edinburgh in 1987. After working in several technical roles, he joined HP in 1989. During 11 years in HP he worked in many marketing roles for both PC, mobile and networking product ranges including Product Marketing Manager of HP’s handheld division in Singapore.
After leaving HP in 2000 he set up the European operations of a US startup Socket Mobile. In 2012 he joined Option Wireless where he held marketing and business management roles in the 3G and 4G data modem and IoT Gateway product lines. He was responsible for the conception and development of the Option CloudGate IoT Gateway and the Option LuvitRED IoT application generator.
In GreenWaves Technologies he is responsible for Business Development and marketing of the GAP8 IoT Application Processor.
martin.croome@greenwaves-technologies.com