Electronicdesign 18274 Sifive Hifive Promo

Hands-On HiFive RISC-V

Sept. 14, 2017
Technology Editor Bill Wong tries out SiFive’s HiFive1 RISC-V Arduino-compatible board.

I finally got my hands on SiFive’s HiFive1 RISC-V board. The demand has been so high that getting one was a challenge for a while. I reported on SiFive when it first announced its platform. The E310 is SiFive’s first 32-bit microcontroller and it is hosted on the HiFive, Arduino-compatible board.

SiFive’s HiFive1 RISC-V board is Arduino-compatible although it lacks built-in analog support.

RISC-V is an open-source instruction-set architecture (ISA) that is available on a number of platforms including Microsemi’s multiple FPGA families. I will be taking a look at RISC-V on that platform soon. Many of the comments here about the development tools will be applicable to Microsemi’s solution.

RISC-V is akin to ARM’s ARMv7 architecture definition whereas an ARM Cortex-M3 is a specific implementation architecture. Vendors that have Cortex-M3-compatible microcontrollers use the Cortex-M3 architecture and have a common instruction set. The E310 is SiFive’s Freedom Everyware platform and the E310 is a particular implementation. SiFive is really in the business of licensing its architecture but the E310 lets developers get their hands on the platform without resorting to the more complex Microsemi FPGA route. 

SiFive also has the Freedom Unleashed platform that targets higher-end solutions like ARM’s 64-bit Cortex-A suite. The Freedom U500 has a 64-bit RV64GC architecture that supports high-speed peripherals like PCI Express Gen 3.0, USB3.0, and Gigabit Ethernet, and it can use DDR3 and DDR4 memory. It has an RV64IMACN architecture that includes virtual memory support with a 512 Gigabyte memory space. It can be implemented using Taiwan Semiconductor Manufacturing Company Limited’s (TSMC) 28 nm technology.

The E310 has an RV32IMAC architecture. The RV32IMAC designation is an abbreviation for the standard RISC-V features including 32-bit support (RV32), integer support (I), hardware integer multiplication and division (M), atomic real-time instructions (A), and support for the 32-bit and compact (C) 16-bit instruction set. The chip has 16 32-bit registers and no hardware stack.

Getting Started

The E310 has a USB controller and debugger on the board. In fact, that chip is larger than the E310. It has on-chip RAM but not flash. Instead, its code and non-volatile data is stored on a 128 Mbit serial flash chip. 16 Mbytes is hefty for a microcontroller but SPI flash chips are inexpensive. It also means developers can select the amount of flash needed when implementing their own incarnation. Likewise, the type of SPI serial memory used can vary, including something like MRAM or FRAM with different storage characteristics and speeds from the conventional flash memory.

The HiFive1 board hooks to a PC using USB that can also supply power. An external power port takes a 7 to 12 V input and can operate in a standalone fashion. The FTDI USB chip provides the JTAG interface for programming and debugging.

There are two main options for development. I looked at both. The first is the Arduino IDE. The second is the Eclipse-based Freedom Studio. The Getting Started manual provides details on downloading and installing the Arduino support, although it assumes the IDE is already set up. This approach will work well for those already using the Arduino IDE and it is possible to have the IDE support more than one platform at a time.

Using the HiFive1 with the Arduino IDE was a relatively simple exercise. It was just a matter of using one of the sample applications after selecting the E310 board in the configuration section. Source-level debugging works well and the simplicity of the Arduino IDE will appeal to some.

I preferred the more robust Freedom Studio IDE but this brings along the complexity and advanced functionality of Eclipse. Getting the toolchain installed was a bit more complex than setting up the Arduino IDE, but not much. The benefits are significant, including a better (at least from my point of view) debugging environment that includes disassembly of the C code used with most examples. It was fun looking at the assembler code generated by the C compilers, and the Eclipse debugger allows stepping and breakpointing at this level in addition to the usual source level debugging.

Developers have a choice of development tools that can be used in command-line mode or with the Freedom Studio including a gcc and CLANG/LLVM compiler. Developers that would rather try out code on virtual platforms can utilize the Spike ISA simulator or the QEMU emulator.

Overall I found no great surprises using Freedom Studio or the HiFive1 board. The board and toolsuite are on par with other development kits I have looked at. The lack of analog support will obviously be a problem for some developers that had counted on that, but the digital support with nine PWM timers will be sufficient for most users.

The HiFive1’s higher performance compared to stock Arduinos is significant, although there are Arduino-compatible platforms that offer comparable performance. The HiFive1 does let you evaluate how the RISC-V platform will perform for particular applications. It is actually very power-efficient compared to the competition, while offering a lot of performance with a 300 Mhz clock. Check with SiFive for chip availability and costs. Of course, SiFive would love to sell you a design for a custom chip and that can include custom IP including analog support and on-chip memory.

Sponsored Recommendations


To join the conversation, and become an exclusive member of Electronic Design, create an account today!