/apio

:seedling: Experimental open source micro-ecosystem for open FPGAs

Primary LanguagePythonGNU General Public License v2.0GPL-2.0

Build Status Latest Version License Documentation Status Documentation Status

       

Experimental open source micro-ecosystem for open FPGAs. Based on platformio. Apio is a multiplatform toolbox, with static pre-built packages, project configuration tools and easy commands to verify, synthesize, simulate and upload your verilog designs.

Apio is used by Icestudio.

Table of contents

Installation

  1. Install Python 2.7 and pip

  2. Install the latest apio: pip install -U apio

Apio packages

Package Installation Description
icestorm apio install icestorm iCE40 FPGA synthesis, place & route and configuration tools. Icestorm project
iverilog apio install iverilog Verilog simulation and synthesis tool. Icarus Verilog project
scons apio install scons A software construction tool. Scons project
system apio install system Tools for listing the USB devices and retrieving information from the FTDI chips
examples apio install examples Verilog basic examples, pinouts, etc
pio-fpga apio install pio-fpga PlatformIO experimental configuration for supporting Lattice FPGA boards

Supported architectures: linux_x86_64, linux_i686, linux_armv7l, linux_aarch64, darwin, windows.

Supported boards

Board
Icezum Alhambra
Nandland Go board
iCEstick Evaluation Kit
iCE40-HX8K Breakout Board
icoBOARD 1.0
CAT Board

NOTE: all supported Icestorm FPGAs can be used with --fpga, --size, --type and --pack options.

Documentation

The project full documentation is located in Read the Docs: http://apiodoc.readthedocs.io

Development

git clone https://github.com/FPGAwars/apio.git
cd apio

Testing

pip install tox
tox
tox -e flake8
tox -e coverage

FAQ

What is Apio?

Apio is an experimental micro-ecosystem for open FPGAs. Based on platformio. Apio is a multiplatform toolbox, with static pre-built packages, project configuration tools and easy commands to verify, synthesize, simulate and upload your verilog designs.

Apio is a command line interface (CLI) made for open FPGA developers. It is also a flexible project, ready to be adapted to new experimental toolchains, boards and cores. It contains some extra utilities like cross-platform lsusb and lsftdi, examples, drivers' configuration, etc.

Apio evolves with the growing open FPGA movement. It must be flexible, adaptative and hackable

Why did Apio appear?

Apio appeared as a need to unify and simplify the use of the main open source tools for open FPGAs Icestorm and Icarus Verilog. This became very useful for the verilog developers as a CLI and for projects like Icestudio as a back-end.

We want to spread the open FPGA knowledge and tools to everyone (eg: verilog tutorial). Simplifying the setup time would help to focus on the content, improve workshops performances, etc. In short, reduce the entry barrier to new users.

There were some drawbacks that we wanted to solve:

  • Very long configuration time
  • Compile the toolchains for each OS
  • Multiple commands with low level parameters
  • Different behavior in Linux, Windows and Mac

Then, we started building lsusb, lsftdi and icestorm static pre-built packages for Linux (x86_64, i386, armv7l, aarch64), Windows and Mac OS, and learning about these amazing emerging tools.

The first integration step was to add FPGA tools in the PlatformIO project (Platforio-FPGA), which has been always used for classic microcontroller ecosystems. But the slow integration and the lack of flexibility encouraged us to create a custom fork of PlatformIO (pio) called Apio to speed up our investigation and experiments with open FPGAs.

Note: also a pio-fpga Apio package was created to configure FPGA tools in PlatformIO through Apio in the early times.

Very interesting ideas like a nice Python click interface, a SCons build system and a user-level package installation were included in the project.

What about PlatformIO Lattice FPGA support?

PlatformIO Lattice FPGA support was added in the 2.9.0 release. An issue was created with a very primitive and experimental support of iCEstick and Icezum boards (#480).

It was an initial attempt to try to fit the new open FPGA project concept into a classic microcontroller ecosystem.

In Platformio 3.0 a more flexible contribution method was implemented. Then, more contributions were made to support platform-lattice_iCE40 using the work and knowledge generated in the Apio project.

Differences between Apio and PlatformIO?

Apio is a micro-ecosystem focused only on open FPGAs while PlatformIO is an ecosystem focused on embedded platforms and microcontrollers. Apio has also a different API from PlatformIO.

Apio contains direct commands to verify, simulate, analyze, build, upload verilog code. It also contains system utilities, drivers configuration, generic examples, package management and board detection.

$ apio
Usage: apio [OPTIONS] COMMAND [ARGS]...

  Experimental micro-ecosystem for open FPGAs

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Code commands:
  build      Synthesize the bitstream.
  clean      Clean the previous generated files.
  sim        Launch the verilog simulation.
  time       Bitstream timing analysis.
  upload     Upload the bitstream to the FPGA.
  verify     Verify the verilog code.

Environment commands:
  boards     Manage FPGA boards.
  drivers    Manage FPGA drivers.
  examples   Manage verilog examples.
  init       Manage apio projects.
  install    Install packages.
  system     System tools.
  uninstall  Uninstall packages.
  upgrade    Check the latest Apio version.

PlatformIO is a bigger ecosystem than Apio. It integrates a lot of platforms, frameworks, boards and libraries for current IoT development. It also contains continuous integration, library examples, serial utilities and project testing.

$ pio
Usage: pio [OPTIONS] COMMAND [ARGS]...

Options:
  --version          Show the version and exit.
  -f, --force        Force to accept any confirmation prompts.
  -c, --caller TEXT  Caller ID (service).
  -h, --help         Show this message and exit.

Commands:
  boards    Pre-configured Embedded Boards
  ci        Continuous Integration
  device    Monitor device or list existing
  init      Initialize PlatformIO project or update existing
  lib       Library Manager
  platform  Platform Manager
  run       Process project environments
  settings  Manage PlatformIO settings
  test      Unit Testing
  update    Update installed Platforms, Packages and Libraries
  upgrade   Upgrade PlatformIO to the latest version

Future development

Apio will continue growing with new packages, commands, boards and more, improving from the community knowledge and contributions, and satisfying our FPGA needs.

PlatformIO may also increase its FPGA support using all the knowledge generated in the Apio project and the contribution of the community.

Has Apio graphic front-ends?

Yes.

  • Apio-IDE: is an experimental IDE that integrates Atom and Apio.

  • Icestudio: is an experimental visual hardware editor built with web technologies.

Videos

Apio in RPI2: iCEstick, Icezum and icoBOARD

Apio: an easy multi-platform toolbox for open FPGAs

Authors

Contributors

License

Licensed under a GPL v2 and Creative Commons Attribution-ShareAlike 4.0 International License