Terasic News Labs Our Company Products Turnkey Solutions Training FAQ
Cart
 
   
 
Stephen A. Edwards - Associate Professor of Computer Science, Columbia University
 





Stephen A. Edwards - Associate Professor of Computer Science, Columbia University

Stephen A. Edwards

  • BS EE, California Institute of Technology
  • MS & PhD EE, University of California Berkeley
  • Tenured associate professor of Computer Science, Columbia University in the City of New York (2001-present)
  • Over 90 peer-reviewed technical papers
  • Teaches an embedded systems class that employs Altera/Terasic FPGAs
  • Member of the Synopsys Advanced Technology Group (1998-2001)


I was really pleased to get my hands on one of the new DE10-Standard boards. In 2014, I switched from using DE2 boards to using SoCKit boards in the Embedded Systems class I teach at Columbia, in which I have students design and implement projects they devise. I've long required students to include both custom hardware and software in their projects; moving to the SoCKit boards (which, like the DE10-Standard , also sports a Cyclone V FPGA with a hard ARM processor) finally made it possible to develop systems that did serious things with USB, Ethernet, or Bluetooth. Once you go Linux, you never go back.

Physically, the DE10-Standard is similar to Terasic's other DE boards: blue, with a ring of connectors around the outside, spacers for feet, and mostly covered with a Plexiglass shield. Power (a 12VDC, 3.5A adapter is supplied) enters through a barrel jack next to the power switch. It's a little bigger than the SoCKit boards and a little smaller than the DE2s.
 
Before I even power it on, I see two things are a big improvement over the SoCKit board: six 7-segment LEDs and the absence of any Micro USB connectors. The non-multiplexed LED displays are perfect for beginning FPGA-only projects and for debugging more advanced projects. I think of LEDs as the "printf" of the FPGA world. Terasic also included ten individual LEDs, but it's much nicer to be able to display numbers. The SoCKit board has three Micro USB connectors: the USB Blaster, serial debug from the processors (termed HPS or Hard Processor System in Altera/Intel vernacular). Inevitably, students would break these delicate connectors, effectively destroying a $350 board. Thankfully, the serial debug port on the DE10-Standard is a much sturdier (through-hole-soldered) Mini USB connector, so I look forward to the boards better tolerating student abuse.
 
The DE10-Standard is built around the Altera Cyclone V SX 5CSXFC6D6F31C6N chip, the same as the SoCKit, and what a chip it is. I think of it as the guts of a low-end smartphone SoC (a 925 MHz dual-core ARM Cortex-A9 with 1 GB of DDR3 and the usual peripherals: USB, 1 Gb Ethernet, SD/MMC, UART, I2C, SPI, timers, and DMA) surrounded by a generous FPGA fabric (110K logic elements, about 700KB of block memory, and 112 DSP blocks with 27-bit multipliers). My experience with such chips is that their logic capacity far outstrips my students' ability to design and debug it.

THE PERIPHERALS
What makes or breaks a board like the DE10-Standard are the peripherals and connectors it includes, and I think Terasic has made many good decisions.  First of all, programming of the FPGA is via USB through an onboard USB Blaster II, meaning that you don't need an additional programming dongle; the included (standard) USB A-to-B cable suffices. And this is the only USB type B connector on the board, so there should be no confusion. This also functions as a JTAG port, allowing you to debug both the FPGA world and the ARM/HPS world. Terasic's DE-series boards have long had this feature and it's much appreciated.

The Cyclone V is fairly rigid about whether a peripheral is intended for use by the HPS/ARM world or for use by the FPGA. By and large, I think Terasic has made good choices on what connects where, but as a result, using certain peripherals from FPGA-land is difficult or impossible and others need custom FPGA logic to be used from software-land.

For example, the Gigabit Ethernet port is connected to the HPS/ARM/software world. This is a reasonable choice since most users will want their Linux networked, but this does mean doing really high-speed networking using the FPGA fabric is difficult or impossible.

The DE10-Standard includes a pair of USB-A host ports driven by an onboard USB 2.0 hub (a Microchip USB2512B) that allows things like keyboards and thumb drives to be connected. Like the Ethernet port, this makes USB essentially software-only, but this is inevitable given the complexity of the USB protocol. The DE2 also had a USB port, but using it required speaking to the very complex controller, a substantial project in itself.  It was at this point that students would begin begging to have Linux running on the board so you could use its well-supported USB stack.

The USB ports of the DE10-Standard are an improvement over the SoCKit in two respects. First, the USB-A sockets themselves are far sturdier than the flimsy micro USB port on the SoCKit. Second, nobody has just one USB peripheral, so a hub is nearly mandatory. Integrating the hub on the board is far nicer than using an external one that's easily lost and may require yet another external power supply. Of course, you will still need a hub if you have three or more peripherals, but two is definitely an improvement. One minor point: the USB controller on the Cyclone V supports USB OTG, meaning the port can be used either as a host (e.g., to connect devices like keyboards) or as a device (e.g., to behave like a keyboard). The DE10-Standard does not appear to support this feature.

The HPS serial console UART is passed through an industry-standard FTDI FT232R chip to a mini USB B connector. This means that under Linux, plugging in the serial console probably Just Works ("screen" is my favorite Linux serial terminal emulator); and that under Windows or MacOS, it is not difficult to find drivers for this common chip.

The other HPS peripherals include a micro SD card socket, typically used to hold a bootable Linux image; an ADXL345 accelerometer hanging off the HPS I2C bus; a 14-pin LTC header for Linear Technology boards, bringing out I2C and SPI buses; and a 128 X 64 SPI LCD module.

The FPGA side also has a wealth of peripherals.  I've already mentioned the 7-segment displays along with ten single LEDs. Each LED is driven directly (i.e., each gets its own pin), making them easy for beginners to use.  There are also four pushbuttons and ten switches; again each get their own pin.  The pushbuttons are debounced by a 74AUC17 Schmitt trigger, but I have mixed feelings about this. Rejecting keybounce is an important, challenging lesson for beginners.
 
The DE10-Standard sports a traditional (analog) VGA connector driven from the FPGA side through a 24-bit DAC, which Terasic says will go up to 1280x1024 (a 100 MHz dot clock, 60 Hz refresh). I have mixed feelings about Terasic's choice of VGA over HDMI/DVI. On the one hand, VGA is a much simpler standard to implement that is still widely supported. On the other hand, digital video interconnects have been the standard since 2000.  Regardless, I'm very happy Terasic included some sort of video output on the board. Furthermore, the "stock" Linux image from Terasic includes VGA framebuffer hardware for the FPGA fabric, allowing it to run a graphical interface.

Speaking of legacy interfaces from the late 1980s, Terasic included a PS/2 connector for a keyboard or mouse. While most users will wisely prefer to use USB devices when working with Linux projects, I was happy to see this stalwart serial interface available to students who want to build FPGA-only projects with a keyboard or mouse.


Perhaps the most unique connector on the DE10-Standard is the lone RCA jack that drives an Analog Devices ADV7180 TV decoder that digitizes standard resolution color composite video (NTSC, PAL, or SECAM) and passes it to the FPGA.  This makes it possible to connect video cameras, DVD players, or even a VHS videocassette player, to the board and process video.  Having personally designed and built something that manipulated video like this in the early 1990s, I have a soft spot for such projects.

More conventionally, the DE10-Standard also sports a 24-bit audio CODEC with line-in, line-out, and microphone-in jacks. These are connected to the FPGA side of things, so a hardware interface and software drivers are necessary to make audio input and output work with Linux.

The DE10-Standard sports two large connectors: a 40-pin GPIO header and an Altera HSMC (High-Speed Mezzanine Card) connector. Terasic has long supported this same GPIO header (dual rows of 0.1" pins) and sells a number of boards that plug in directly. It provides plenty of 3.3V I/O pins with diode clamps and current-limiting resistors so students are less likely to destroy the board when they unwittingly hook up 5V devices (yes, I'm speaking from experience). The GPIO connector is standard and easy to connect to.

The HSMC connector is designed to allow you to take advantage of the multi-gigabit-per-second differential transceivers on the Cyclone V SX part. Terasic and others sell HSMC boards for applications such as HDMI, DVI, SATA/SAS, XAUI/SFP+ for 10Gb Ethernet, but these tend to come with hefty pricetags that eclipse the modest price of the DE10 Standard.

The FPGA side has a single 64 MB SDRAM connected to it, which is distinct from the 1 GB of DDR3 available to the HPS. I also have mixed feelings about this choice. You almost always need additional memory for FPGA designs; on-chip memory never seems to be enough, so additional FPGA-only memory is a welcome addition. However, an SDRAM interface is complicated enough to force you to use someone else's (e.g., Altera's) controller, and getting it to work is non-trivial. My students would be far happier and successful using off-chip SRAM instead, even if they would have to settle for a smaller capacity. The choice of SDRAM seems like the worst of both worlds: difficult to use yet small by today's memory standards.  I miss the 512KB SRAM of the DE2.


DOCUMENTATION
As usual, Terasic supplies a "System CD" along with the DE10-Standard that contains documentation and sample projects. Terasic used to supply physical CDs with, e.g., the DE2, but Terasic has appropriately replaced this with a .zip file download from their website.

The System CD includes a wide variety of Terasic-produced user manuals, a nicely arranged directory of third-party datasheets for each of the peripherals (e.g., the audio CODEC, video DAC, SDRAM), a 33-page PDF schematic of the board, a Windows-only DE10-Standard "System Builder," and a collection of example projects with source. The System Builder program, which I was able to run under wine 1.6 with Ubuntu, generates a skeleton Quartus project for the DE10-Standard that includes pin assignments, a top-level Verilog module with the pins for each of the peripherals the user requests, and some clock constraints. While convenient, I would have preferred a more portable implementation (e.g., in Python). In any case, a user can simulate this tool by deleting parts of a reference design.

Terasic supplies seven of its own manuals for the DE10-Standard , more than I remember for other boards.  The "Learning Roadmap" suggests starting with the two-page Quick Start Guide, which lists steps for tasks such as creating an FPGA-only design and booting Linux.  The 50-page "My First FPGA" guide shows how to set up a Quartus project for the board, add a PLL using the schematic editor, connect it to a 32-bit counter coded in Verilog that drives the LEDs, and finally compile and program the FPGA.  The 14-page "My First HPS" guide shows how to cross-compile a C program with ARM-based GNU tools included as part of Quartus and copy the binary to a Linux system running on the board (using scp through an Ethernet connection). Glaringly absent from this guide is hints about what to do when things go wrong, e.g., when software hasn't been installed, when the network doesn't configure itself, when the compiler gives an error, etc.

My favorite is the 132-page User Manual, which includes block diagrams, descriptions of each of the peripherals and how they are connected to the FPGA, a user guide for the System Builder application, descriptions of the example projects, and the procedure for flashing the onboard serial configuration memory, i.e., that initially contains the FPGA factory demo configuration.

The Getting Started Guide shows how to download and install Quartus, set the microscopic "MSEL" switches that control whether the FPGA configures itself from the serial flash chip or when Linux boots (I do wish Terasic would have used something larger; these switches must be changed more often than you'd think and are so small a pencil tip is too large), connect various peripherals, boot into Linux, use the serial debug console, and flash a Micro SD card with a Linux image.


USING LINUX
I downloaded the "DE10-Standard_LXDE.zip" file from the Terasic website, uncompressed it, and used dd under Ubuntu Linux to flash the .img file onto an 8 GB Micro SD card. A 4 GB card would suffice, but an 8 GB card provides plenty of additional space.  I set the "MSEL" switches to "FPPx32" mode (on off on off on on) and connected a VGA monitor, a keyboard, mouse, and a mini USB cable to the console UART.

Under Linux, "screen" is my favorite simple terminal emulator; once I plugged in the USB cable, "screen /dev/ttyUSB0 115200" gave me access to boot messages and the console, conveniently even before the DE10's power was switched on.  The initial root password is "terasic".

This image booted into an Ubuntu 16.04.1 distribution with LDXE, a lightweight graphical desktop environment (although only 1024x768, less than the resolution of the monitor I was using).  I connected an Ethernet cable to our network and the board configured itself with an IP address. However, it wasn't resolving DNS names, something I've seen before with 16.04 and may be a problem with my network.  So I commented out the "dns=dnsmasq" line in /etc/NetworkManager/NetworkManager.conf, ran "service NetworkManager restart," disconnected and reconnected the Ethernet cable (to force DHCP) and "ping google.com" began to work as expected.

The LXDE image came with Firefox, so I started that up and verified I could search for and browse my website.  I opened Javascript-heavy Facebook and it worked, but was noticeably more sluggish than my ten-year-old desktop.  I opened YouTube and was pleasantly surprised to see it could handle full-screen 360p video, although the sound wasn't working (I doubt the FPGA configuration had the necessary custom peripheral for controlling the CODEC) and high-definition advertisements brought it to its knees.

I ran the "expand_rootfs.sh" script distributed with the image to expand the SD card image to fill the whole card. You run the script once, reboot, then run the "resize2fs_once" script it created.

I wrote, compiled, and ran "Hello World" in C using the vi editor and gcc compiler on the DE10 with the default image.  This went smoothly, but compiling the little "hps_gpio" demo example on the DE10 itself failed because the appropriate headers and libraries weren't installed on the default image, which was a little disappointing.

The image does include the binaries for the "hps_gpio" demo, which flashes the green "HPS" LED on the lower right corner of the board and then allows you to use the HPS user button (the tiny, rightmost button) to make it flash.  I also ran the included "gsensor" binary, which reads the built-in accelerometer through an I2C bus and reports which way the board is facing.  I find the inclusion of this peripheral a little odd since I'm not sure I want students tilting boards connected to six heavy cables.  Finally, I ran the "hps_lcd" demo, which switches on the 128 X 64 LCD and displays "Hello SoCFPGA Terasic."

Compiling for the DE10 involves installing the Intel SoC EDS, another 3 GB download above and beyond the 24 GB for the Quartus, the FPGA compilation tool suite.  Under Linux, I set up my environment by setting the SOCEDS_DEST_ROOT environment variable to the "embedded" directory the EDS installs and sourcing the supplied "env.sh" script. Now, I was able to use the Terasic-supplied Makefile to compile the hps_gpio demo executable on my Linux workstation and use scp to copy it to the DE-10 board and run it.

Compiling and running the hps_lcd demo under Linux was a little more difficult because the Terasic source code had misspelled the names of some local header files.  It probably compiled without a hitch under Windows since GCC et al. appears to treat filenames as case-insensitive.  I had to modify a handful of #include directories before it would compile, but once it did, I copied it to the board it and it worked.


THE DEMO PROJECTS
The DE10-Standard comes with an array of demonstration projects that illustrate the use of many of the board's features.  One group relies only on the FPGA portion of the board.  For example, the "standard factory configuration" demo displays a self-portrait on the VGA display, flashes various LEDs, and sends a beep out the audio CODEC. An audio recorder example instantiates a Nios II soft processor and interfaces with the audio CODEC and the off-chip SDRAM.  The "TV Box" demo uses the TV decoder to take in NTSC video and display it on the VGA monitor. Other demos illustrate the use of the PS/2 mouse interface, the IR receiver and transmitter, and the ADC.


SUMMARY
Overall, I'm quite pleased with the new DE-10 Standard.  It provides all the breakthrough Linux support that the SoCKit board did, but has additional, useful peripherals that make it even better suited for use in education.  It's also a physically robust board that should put up with the same high amount of student abuse that the DE2-series boards could handle.  I plan to adopt this board for my embedded systems class going forward.

Terasic News Labs | Our Company | Products | Turnkey Solutions | Training | FAQ | Contact Us | Forum | Facebook | YouTube