Computer Laboratory

ECAD and Architecture Practical Classes

Exercises

The ticking criteria for this lablet is to complete Exercise 2 to the ticker's satisfaction. Any suggested implementation may be ignored in favour of another, sensible approach. You should complete Exercise 1 first, but do not need to demonstrate it to a ticker. You may complete Exercise 2* if you wish to receive a starred tick.

We provide a brief Introduction to C, which should be sufficient for these labs.

Exercise 1 - Hello World

Behaviour

Test the Qsys SoC by printing "Hello world!" to a NIOS II terminal communicating with the system on the tPad.

Implementation Advice

The standard library, stdio.h, provides the printf function, which writes to stdout.

To compile the project (which automatically compiles the BSP), right-click on it and select Build Project.

To download the project to the tPad, first make sure that the FPGA is programmed with the Quartus project you compiled earlier. Then select Run | Run Configurations.... Right click on NIOS II Hardware and select New. Change Name and Project name to hello_world. On the Target Connection tab, there should be a single item under Processors; if not, scroll to the right and click Refresh Connections. Tick both boxes under System ID checks; these relate to debugging devices that have not been included in this SoC. Finally, click Run to upload the binary and open a NIOS II terminal.

If there is no output, you may need to check your Qsys project (particularly that there are no Qsys warnings), regenerate, recompile and reprogram. In Eclipse, you will then need to right click on the BSP project and select NIOS II | Generate BSP, updating the HAL to reflect the changes before rebuilding your C project and running it on the tPad again.

Previous  |  Contents  |  Next