FPGA Essentials: Basys 3 Artix-7 FPGA - Review

Table of contents

RoadTest: FPGA Essentials: Basys 3 Artix-7 FPGA

Author: nixiefairy

Creation date:

Evaluation Type: Semiconductors

Did you receive all parts the manufacturer stated would be included in the package?: True

What other parts do you consider comparable to this product?: Spartan 3E

What were the biggest problems encountered?: No USB cable;

Detailed Review:

I was first introduced to a FPGA this year, in third year of college in the course 'Digital System and Design'. I was introduced to the nuances of Verilog in Xilinx ISE and my first FPGA board, the Spartan 3E. I started out from scratch, where I worked on small projects such as a mini-ALU, to implementing a Traffic Light system on the Spartan. I thoroughly enjoyed my experience with the FPGA course. It was during the end of course, where a roadtest on the XILINX Basys-3 popped up on the element14 community. Eager to get my hands dirty on the 7 series and using the Vivado Design Suite, 2018.1, I applied for it.

The Basys3 is powered by the Xilinx IP core: Artix-7:XC7A35T-1CPG236C . Unlike it's other Xilinx core counterparts, the Artix -7 aims for a budget friendly, high volume and low performance requirement. Digilent Inc. has a few boards running the Arix-7 series cores namely, the Nexys 4.Trainer board, ArtyEval board, Cmod A7-T series and the Basys3 board. A competitor to the Basys 3 in terms of size is the Cmod series. Costing half the price of a Basys 3 board, the Cmod series consists of a Pmod host connector, Quad SPI Flash and a USB-UART bridge, thus giving it a compact size and a cheap price, making it a strong contender in the field of small scale FPGA. A slightly upgraded version of this board series is the Basys 3. It consists of:

  • 16 user switches
  • 16 user LEDs
  • 5 user pushbuttons
  • 4-digit 7-segment display
  • Three Pmod ports
  • Pmod for XADC signals
  • 12-bit VGA output
  • USB-UART Bridge
  • Serial Flash
  • Digilent USB-JTAG port for FPGA programming and communication
  • USB HID Host for mice, keyboards and memory sticks

I plan to cover most of the above mentioned features of the Basys 3 through the form of FPGA designs which I have implemented on the board. I have used Vivado Suite Design 2017.4 (version currently running in our college labs) for the designs.

The Basys 3 arrived to be in excellent condition. Thanks the to the element14 packing department I'd say! Its always a pleasure to see the element14 box arrive at your doorstep. :-)

 

 

{gallery} Basys 3 unpacking

Box opening time!!!

The board!

Side View of the board

Perspective View: Nice view eh?

Top View

 

 

 

 

Board  powered up for the first time!

 

 

Now before I talk about the test cases I have used, I just want to mention one of the things that was an irritant about the board kit. The kit should include a micro-USB/JTAG cable with the board. I am well aware of the fact that Digilent does not offer connecting wires in most of the Xilinx Artix powered boards, but adding a wire will just make it more convenient for the user! In my case, I first bought a USB wire (unaware of the fact that it had no D+ D- wires), which just made my debugging even harder. After waisting a day or two, I bought a USB wire of farnell.ie, which took another two days to deliver. Digilent!

So without further ado I'll talk about the projects I did as my test cases for testing out each peripheral of the board.

 

A. Traffic Light

 

The main aim behind this experiment was to test out

a) PMOD connectors, and

b)Push buttons of the Basys 3 board

This was based on the Spartan 3E project, I had done as a project in my college course. However, there is a slight modification to the earlier version. I am running off 3 traffic lights for an intersection along with a pedestrian button, which resets all the traffic lights to red when the user presses them.

 

A brief look at the Mealy Finite State Machine I've used is shown in the diagram below:

With the basic FSM of a single traffic light clear in mind, I went ahead to program the FPGA for three traffic lights on the Basys3. The explanation of the modules, logic flow and codes are explained in the report I've attached: https://drive.google.com/open?id=1Bzqqh_NQPW2rufAVDzdPmDIXUqmBmWrW

A search on Google gave me the constraint file for the Basys 3. I didn't face any trouble (both in board and software) in synthesizing and uploading the .bit file  onto the board. Results of this little experiment of mine are attached below:

 

Both the PMOD connectors and push buttons worked perfect for the board.

 

B.VGA monitor

 

Like the name suggests the main purpose was to test out the VGA functionality. Basically, it consists of a top module and a VGA monitor setup module. The VGA monitor module, is tasked to give out a horizontal and vertical sync pulse (gives an x and y coordinate) and the filling up of these pixels is done in the top module itself, using the 16-bit colors available by the Basys 3 VGA port. The colors are selected on the basis of the positions of the switches in the Basys 3.

The experiment on testing on of the VGA port was successful.

 

C.Keyboard on a 7-segment

 

This one was a tricky one. I planned to display whatever I type on a keyboard onto the 7 segment display. Parts which I aimed to test were

          (a) 7 segment display

          (b) USB-HID

          (c) 16 switches

What I wanted to implement was that whatever I typed on the Keyboard, it's value( ASCII or PS2 code ) be displayed on the 7 segment display. I first worked on the 7 segment display. Whatever the state of the swithces are, the two's complement number is displayed on the 7 segment display. For example, if switch[1] is high, then the number 2 should be displayed on the 7 segment. This is shown in video below:

I then used the code given in the tutorial site, https://forum.digilentinc.com/topic/3991-usb-keyboard-on-baysy3/  of the Basys3 for working on the keyboard. Just to mention, I had quite a tough time to understand this but pulled through.  I used the Integrated Logic Analyzer (ILA) debugging of the Vivado Suite, which I must say made my work real easy. I believe, this was not there in the Xilinx ISE. The results of the debugging and the final result is attached below;

 

 

{gallery} ILA debugging

ILA:Number 16

ILA: Number 64

 

The ILA debugger of the Vivado Suite was a great help in fixing up the code of the keyboard and the 7 segment display.

 

D. USB Drive / Quad SPI

 

This was one of the features which really got me hooked to this board. It is the writing of the bitstream to the IP core from a USB flash drive. So after writing a bitstream file of a simple binary up counter, I uploaded it to a FAT32 formatted pen-drive and then plugged it into the USB - HID of the board. The final result is shown below:

I also had a chance to try the other mode of the Basys3, the QuadSPI non-volatile memory mode. It assigns a new memory configuration file to the Basys 3, that is to say, I flashed a new programming file to the old configuration file. Hence, this makes the board load a default program according to my choice when it boots up.

These modes of the programming file worked like a charm on the Basys3 board I tested.

 

Final Thoughts:

 

To be honest, most of the peripherals of Basys3 are similar (I would say lesser) to the Spartan 3E I have used in the college labs. However what makes this board a necessary add-on to hobbyist's collection is:

a) Small size. I feel, the Basys 3 comes equipped with all the necessary peripherals an FPGA needs when being integrated into a small scale project.

b) Reprogramming of the memory configuration device is the "coolest" features I believe this board has. The multiple PMOD connectors, and uploading a programing file through flash drive / Quad SPI makes the Basys 3 in my opinion a more versatile (to use) beast than the rest of the FPGAs out there.

 

Vivado is a pain to use on a slower pc , but aside that the board performed much better than the expectations that an ordinary FPGA can provide. It deserves a special place on a hobbyist's shelf. In fact, I am so excited about the capabilities of this board that I am planning to implement one-two (big) projects on this board, and will likely post a blog on it.

Until next time element14 community!

 

EDIT 1 :

 

So I finally built a small project using the FPGA board. It's the snake and fruit game. Basically consists of a snake running around the screen eating fruits and growing bigger (like the old game we used to play on the mobile). Now a few points to note before you see the reults:

I was unable to create a random generator for the fruit.

1) I first simply created a module which changes its output integer according to the input clock. Sadly I didn't have any luck with that. Cause at every clock cycle it was changing. Thus the postion (output integer) kept on changing on the screen, thus giving me a flashing fruit (FF for short) .

2 ) I then went ahead with the posedge'ing' a good collision. That is to say that when the snake and fruit met each other, a positive trigger was setup which was then used as an input clock for the module created in (1). Sadly this gave me no reults - probably because the trigger was too small impulse and could not detected by the module as a 'posedge'.

Other than, it works perfectly! Have a look at the results! Also I am eager to try out a new project on the board. Any suggestions?

https://drive.google.com/open?id=1kL_6T3A68XPW-byYFpz8kcb7DYN6Qrb6

Anonymous