HiFive1 heralds new era of silicon freedomFollow article
Arduino-compatible combines ease of use with performance and is open to the core.
Open source digital design is by no means a new phenomenon, with projects such as the venerable OpenRISC processor having been flown aboard a NASA satellite and immortalised in silicon in Samsung digital televisions — to name but just two applications. However, HiFive1 with its RISC-V based microcontroller brings with it new levels of accessibility and performance.
The advent of the RISC-V open source instruction set architecture (ISA) generated a groundswell in interest in open source digital design, with the foundation that is responsible for stewarding its development boasting a membership that over the space of a few years has grown to include HP, IBM and Google, amongst numerous other tech giants and many smaller switched-on companies.
It should be noted at this point that RISC-V is an ISA and not a processor design per se, but reference implementation designs are provided by the foundation. In addition to which there is an incredibly vibrant global community of research institutions and industrial partners, working on their own designs for everything from ultra-low power devices for IoT, through to server class silicon and even designs with >1,000 cores and on-chip networks.
E310-G000 top-level block diagram, © 2017 SiFive Inc.
Freedom Everywhere is a family of customisable System-on-Chip (SoC) designs from SiFive, the start-up that was founded by the creators of the RISC-V architecture. The E300 platform is the first member of this family and combines a 32-bit E3 series Coreplex — microcontroller core plus interrupt controllers, and DMA and debug units etc. — with power management and an RTC, UART, I2C and SPI, amongst other peripherals.
The HiFive1 board is based around an FE310-G000 device, the first in the E300 SoC family, fabricated in 180nm silicon and supplied in a 48-pin QFN package. Features include:
- Support for RV32IMAC ISA options
- 16 KiB instruction cache
- 16 KiB data SRAM
- 8 KiB mask ROM with boot code and debug routines
- Core-local and platform interrupt controllers
- GPIO including QSPI (x3), UART (x2) and PWM (2x 16-bit + 1x 8-bit)
- Always-on domain with power management, RTC, watchdog and reset etc.
© 2017 SiFive Inc.
Along with the FE310-G000 the HiFive1 board integrates an FTDI USB to JTAG/serial bridge, SPI flash, plus level shifters and power and clock circuitry, to create an Arduino-compatible hardware platform with that familiar and verging on iconic form factor.
- 32-bit RISC-V core running at 320MHz (!)
- 128 Mbit flash
- 19x digital I/O
- 9x PWM pins
- SPI with 3 hardware CS pins
- 19x external interrupt pins
- 1x external wake-up pin
- Power via Micro USB or 7-12VDC jack
Building the SDK simply involves cloning the git repository and running make, with the various components it is comprised of being managed via git submodules. This means that you don’t have to go downloading/cloning component sources from different places and if the SDK is updated, you can get the latest version by running a couple of git commands followed by make once again.
The SDK is based around the RISC-V GNU toolchain, with GCC, binutils, dejagnu, glibc and newlib. OpenOCD is used for programming and also enables debugging via GDB.
The HiFive1 ships with an LED fade demo loaded into flash and if you connect to the USB serial device an ASCII logo is also output. The other examples provided are:
- hello world
- GPIO demo
These can be built with:
$ make software PROGRAM=program_name BOARD=freedom-e300-hifive1
And uploaded using:
$ make upload PROGRAM=program_name BOARD=freedom-e300-hifive1
Arduino IDE support
All that is required to enable support for HiFive1 in the Arduino IDE is to add a URL to the Boards Manager configuration.
Then search for and install the SiFive Freedom Boards package, following which you can compile and upload sketches. However, it should be noted that not every sketch is guaranteed to run unmodified — but this is in much the same way that if you took a sketch originally written for a classic ATmega-based Arduino and that used SoftwareSerial, or perhaps cli() and sei() to clear and enable interrupts, it wouldn’t run unmodified on an Intel Galileo, for example.
The HiFive1 could be used simply as another Arduino-compatible, albeit a very fast one. And of course it’s arrival has delighted open source digital designers, students and academics, open hardware advocates and makers the world over, with access to its microcontroller RTL.
The FE310-G000 device as provided with the HiFive1 should certainly be of interest to engineers with a need for a high performance microcontroller for use in general embedded applications, and notably of particular interest to those with IoT applications in mind. But that’s not where the story ends and is far from the ultimate goal of SiFive, who offer bespoke chips-as-a-service.
Custom Silicon for All
Top-Level Block Diagram of the E300 platform, © 2017 SiFive Inc.
Once you’ve evaluated the E300 platform via the HiFive1 board and confirmed that it delivers the performance and reliability you require when implemented in silicon, you are free to grab the RTL, prototype customisations and synthesize a bespoke design that targets an FPGA development board.
At the time of writing two development boards are supported: one with a Xilinx Artix-7 FPGA and that is targeted at makers and hobbyists; and a second featuring a formidable Xilinx Virtex-7 FPGA, along with support for 40Gb/s of connectivity, gigabit Ethernet, PCIe, FMC expansion and more.
So what exactly could you implement?
HiFive1 plus LoRaWAN shield
To give just one example, it would be possible to add support for wireless technologies such as LoRaWAN by adding IP blocks that implement the MAC layer. Or maybe just with two or more E3 series Coreplex, so that one can be dedicated to applications and another to network functions. Throwing in additional peripherals to support particular applications and maybe battery charging and/or energy scavenging circuitry — whatever you require in a highly integrated solution.
Not so long ago this might have seemed like a fantasy and the reserve of those with famously deep pockets, but this is no longer the case and SiFive are able to offer customised chips for less than $100,000. Which may still sound like a lot of money and is admittedly priced beyond the means of all but the wealthiest of enthusiasts, but this might be all that stands between an OK product that is moderately successful, and something game changing that blows away the competition.
Of course, custom silicon for use is own products is one thing, but it could also be that after years of consolidation in the semiconductor industry, we now start to see many more small chip start-ups as the barrier to entry is lowered and a collaborative ecosystem developing open source IP flourishes.
Is open source silicon the next logical step after the proprietary IP licensing model? To paraphrase Sir Robin Saxby, founding CEO of ARM, at the 2013 Global Semiconductor Alliance Entrepreneurship Conference in London: “Don't try and build the next ARM; build the company that will replace ARM.”