Tuesday, 10 March 2020

Atlas - First designs

Introduction


The DE0-nano-SoC documentation on CD-ROM (contents available here) is the best way to get started using the Atlas SoC.  Three step by step guides are available to build an FPGA design (using Quartus), an HPS design (using C and EDS) and a combined FPGA-HPS deisgn.
After completing these projects I wanted to test the Golden Hardware Reference Design (GHRD) which combines all the hardware components and pins.  This should help with starting any future computer project.


My First FPGA


This is a good project to familiarise yourself with Quartus.  A simple counter is implemented in verilog and a schematic created integrating the counter with a clock and a multiplexor.  A button input is used to control the speed of LED output pattern flashing.
The tutorial clearly shows you how to use a number of Quartus features without introducing more complexity than necessary.

My First HPS


The purpose of this tutorial is to allow you to compile and run a C program on the linux system.
A cross-compiler is required and should be provided following a successful install as described in the getting started guide.
Initially my Altera toolchain didn't work so I installed arm-linux-gnueabihf-gcc under wsl and compiled / copied it across to atlas_sockit using winscp.
It wasn't particularly informative but good preparation for the combined FPGA-HPS test.
For further tutorials it was important that the compiler works as expected and I could use EDS (Embedded development software).  Generally I am using v18.1 software but licensing has changed so EDS isn't included.  I installed Quartus and EDS v16.1, the last release including EDS, and this worked exactly as expected.


My First HPS-FPGA


The third tutorial guides you to create a QSYS design based on the GHRD (Golden Hardware Reference Design) which includes a PIO module for the LEDs.  An interface between FPGA and HPS is configured so LEDs can be controlled from a linux program.  

An HPS C program is written to map the appropriate memory locations so that the C program can use them.  It is quite complex and I couldn't write it from scratch.

Once we have loaded the FPGA image and copied the compiled C program to Linux we can run the program and control LEDs.  This is a leap forward in using these devices.
I am not convinced I will go far along this route.  I don't want to spend too much time writing C programs.



Again software was a bit of an issue but once I standardised on Quartus / EDS 16.1 I could follow the tutorial easily.


Compiling Hardware Design


Having completed basic tutorials I wanted to compile the Golden Hardware Reference Design (GHRD) as this would provide me with a template for using all the FPGA components.  It also seemed to provide a way to build an SD card image.  Instructions were simple, an intricate Makefile script is provided to create a Quartus project, build it and add all the necessary files for an SD card image. Unfortunately they didn't work well.
Eventually I was able to compile the GHRD and download it to Atlas.  It required me to start the creation process on Quartus web edition 15.0 + EDS, then continue in Quartus 16.1 and finalise/download in Quartus 18.1.
I am pleased that I have a "working" reference design and I did learn quite a lot along the way but it wasn't enjoyable.






No comments:

Post a Comment