This repository includes the elastic node middleware code as described in the paper The Elastic Node: An Experimental Platform for Hardware Accelerator Research in the Internet of Things. The included code is written in C and Python. The code is tested under the operating system Ubuntu 18.04.4.
The used hardware is listed in the Elastic Node Hardware repository. We use the elastic node version 4 (v4). For hardware details please refer to this repository.
The getting started guide explains which hardware components are needed and how to connect the hardware.
The middleware code includes the following functionalities:
- initialize the FPGA
- turn the FPGA on and off
- write and read to and from the FPGA
- enable and disable the external memory interface for the interconnection between the MCU and the FPGA
- reconfigure the FPGA and switch between different bitfiles
- upload a bitfile to the FPGA
For using the elastic node middleware code some tools are a perquisite. Therefore, please follow the instructions in the Installation Guide in the docs directory.
The docs directory contains a Getting Started Guide with further information's.
For writing an own application for the Elastic Node the Write Own Program Guide should be used.
For using the repository while changing the code of the libraries it can be cloned with the help of the Clone Guide.
How to use a docker container for building and running the elastic node middleware is explained in the file Docker.
The required hardware at the elastic node, which is used in our code, is the MCU and the FPGA. For interconnection of the MCU and the FPGA we use the MCU's external memory interface (Xmem).
The Xmem interface is an addressable data interface. To use it, a variable is defined at a specific memory location and the data value is written into it. The FPGA detects this and reacts accordingly. The interconnection between MCU and FPGA starts at the internal memory address 0x2000 of the MCU.
A FPGA is a type of integrated circuit which is able to instantiate circuits at runtime. A bitfile stores a specific circuit for the FPGA. So, a bitfile says how the programmable logic blocks of a FPGA need to be set. Therefore, when we using a bifile, the FPGA can be reconfigured to instantiate a different circuit. As we want to reconfigure the FPGA at the elastic node, we need bitfiles. Example bitfiles can be found in the bitfiles directory.
When following the Write Own Program Guide bitfiles can be uploaded to the elastic node.
The Elastic Node Middleware Library provides all necessary functions for using the Elastic Node by including the other libraries internally. All function can be found in the ElasticNodeMiddleware.h.
The Led library can be used for turning the MCU-LEDs at the elastic node on and off.
The xmem library initializes, enables and disables the external memory interface. The external memory is used to interconnect between the MCU and the FPGA.
In the header file of the xmem library we define the offset of the external memory. By using the elastic node, the offset is 0x2000.
The Reconfigure Multiboot Avr library handles the reconfiguration of the FPGA. For now the library is specialised for avr, because we use an avr-microcontroller up to the elastic node version 4. Multiboot is here the type of reconfiguration. Using multiboot means that we select one configuration and provide the address of the next configuration to the internal configuration access port (ICAP) interface of the FPGA.
The Interrupt manager library clears and sets interrupts.
The Pin definition library defines all pin and register definitions. Therefore, all pin and register definitions are at one point in the code.
The debug library provides different debug commands. Debugging is available via UART or LUFA. It is recommend to debug with LUFA as it needed for uploading a bitfile to the FPGA.
The UART library is one option for communication with the MCU when using the Debug library.
The Controlmanager library has different basic elastic node middleware functions, especially for starting the for uploading of bitfile to the FPGA.
- FlashFPGA: uploads bitfiles
- i: print the current User logic ID
The configuration library configures the FPGA for uploading a bitfile to it.
The Flash library is used for handling with the Flash memory of the FPGA. The Flash of the FPGA is needed for the communication between the FPGA and the MCU.
The Spi library implements the Serial Peripheral Interface for the FPGA.
The Bitmanipulation library is an library from the Embedded Utilities repository. It is used for setting and clearing bits.
The Lufa library is an library from the Peripheral Interface repositry. Lufa is a USB library for USB-enabled AVR microcontrollers and explained at fourwalledcubicle. It is one option for communication with the MCU when using the Debug library.
The Energy Monitoring Guide explains how to monitor the energy consumption via the monitoring MCU. It uses the Elastic Node Monitoring Repository.
As mentioned above the elastic node is described in detail in the paper The Elastic Node: An Experimental Platform for Hardware Accelerator Research in the Internet of Things. By comparing our implemented features with the features of the paper, we detect some features that are not integrated in our basic version yet. We list them in the following:
- Flash: We do not include the code for using the flash memory of the MCU (only of the FPGA). The flash memory is for additional data storage.
- Stub/Skeleton Generation: We do not have generation of the abstraction interface on the MCU (Stub) as well as on the FPGA (Skeleton) in this basic code.
- Arm elastic node: We will publish the elastic node middleware code for the elastic node ARM. This elastic node has an ARM MCU instead of an AVR MCU.