Altera DE1 Installation guide

From Zet
Jump to: navigation, search

This document explains how to install the whole Zet sytem on the Altera DE1 board and have MS-DOS or FreeDOS running. These instructions are the same in principle for Microsoft Windows or Linux, because the only steps done in the computer are copying 3 files and editing another file.

Requisites

This guide is intended for the Altera DE1 board, which is one of the boards supported at the moment. This board is made by Terasic and sold under names Terasic DE1 or ALTERA Cyclone II FPGA Starter Board (DK-CYCII-2C20N). You will need a standard computer to use as a host that supports a recent version of Quartus II and has a free USB port to connect the DE1 FPGA Board. The Altera DE1 is intended in future to use a SD Card as it's Hard Drive, but this part is not complete at the moment, but is being actively worked on.

Quartus II is a proprietary FPGA Development IDE and comes in two versions. The Web Edition is a Free of Charge download Quartus II Web Edition. The same website hosts the paid for subscription edition of Quartus II. You can use either version to work with or modify Zet.

Your Altera DE1 may come with a DVD for the Web Edition in the box, which you can use. If not download and install it from the link above. You will need to register with Altera to get the software but this is not onerous and the Web Edition is free of charge.

Fig.1. DE1 board kit from the box
Fig.2. Board itself

Other requisites

Of course, you will need a computer monitor with a VGA input so you can see what is printed on screen and a PS/2 keyboard to operate Zet once it has booted (these are in addition to the screen and keyboard of your host computer). Any monitor with a standard VGA connector would work, which you need to connect to the VGA output of your DE1 board.

You may also need 64MB to 2GB SD/MMC card and SD-card reader for PC to use SD-card as disk drive for Zet system.

Getting Started

You should familiarise yourself with the DE1 before attempting to load the Zet project in to your DE1.

The Altera DE1 comes with an additional CD that contains demonstrations and sample project files. The projects that load in to the DE1 can be loaded from Windows or Linux, but some of the companion software that goes with the projects only works on Windows hosts at the time of writing this.

You should copy the contents of the CD to a suitable location on the drive of your host computer and use the guides and demo projects on the CD to get used to the basics of using the DE1 before proceeding further.

As a minimum you need to learn how to load a hardware image (.sof or .pof) file on to the DE1 as that will not be described here.

Zet Basics

To get Zet running on your board you will need three files

  • kotku.sof or kotku.pof from boards/altera-de1/syn folder which is the Zet Hardware Image which you send to the Altera DE1 using the Altera Quartus software.
  • bios.rom from src/bios folder which is the BIOS you program in to Flash Chip (at address 0x000000).
  • a-zet.img which is a Floppy Image you program in to the Flash Chip (at address 0x20000 FOUR ZEROS).
  • c.img.zip which is a zipped hard disk image. You copy it byte by byte to the SD card.

When you have completed these three steps you should have a working Zet!

Proceed as follows:-

Make sure the DE1 is plugged in to a USB port of the Host Computer and switched on.

The Flash chip is not directly connected to the built in programming hardware of the DE1 so the only way to program it is to load the FPGA with a hardware image that allows the programming hardware to tunnel through the FPGA and program the Flash chip. The Zet hardware image does not have this capability so a hardware image that is capable of doing this is required. The DE1 comes supplied with two ways of doing this but one way only works with Windows.

Hard disk image

To boot from the hard disk, you need an SD card (maximum 4 Gb). You can download the file C.img.zip from above and unzip it. You will get a 50 Mb file, which is the image of a hard disk. Now you need to copy it to the SD card. In Linux is very easy. You will do:

dd if=./c.img of=/dev/sdc

(supposed that the SD card is inserted, with device name /dev/sdc).

If you are using Windows, you can use the program Winimage to copy the hard disk image c.img on to the SD card.

Programming the Flash with the DE1 Control Panel (Windows Only)

Fig.3. Downloading images into flash
  • Load the DE1 with the DE1_USB_API.sof file (using Quartus II) from the DE1_control_panel directory of DE1 CD.
  • Start the DE1_Control_Panel.exe application and select Open from the menu and click on the menu entry "Open USB Port 0".
  • You can play with some of the options this application offers if you like. Change some LEDs ...
  • Click on the Flash TAB.
  • Click on the Flash Erase and wait for it to Erase the flash chip.
  • Click on the "File Length" box in the "Sequential Write" section so that feature is enabled.
  • Click the Write to Flash Button.
  • Select the bios.out file that you have previously stored on your PC and wait for it to program the BIOS.
  • Click in the address section of the "Sequential Write" and over type the number with 200000 (2MB).
  • Click the Write to Flash Button and select the required floppy image (say a-zet.img from the Forum or link above) and wait for it to program.

You have now completed the programming of the two files in to the Flash.

Programming the Flash using the NIOS II Command Line Environment (Linux and Windows)

  • To use the NIOS II method of programming you will need to install the NIOS EDS package.
  • Load DE1 with the \DE1_demonstrations\DE1_NIOS\DE1_NIOS.sof file from the DE1 CD (using the Altera Quartus software).
  • Follow the instructions here Zeus's forum instuctions

Zet processor boot

Fig.4. ALTERA Programming software under windows

The final stage is to load the Zet Hardware image (kotku.sof from the Forum at the time of writing).

You can compile kotku.sof using ALTERA Quartus II IDE by opening project /boards/altera-de1/syn/kotku.qpf and selecting Processing >> Start Compilation. Be patient, this can take few minutes to do. Then use Tools >> Programmer, and press Start for downloading bitstream into DE1 board.

If all is well the screen connected to the DE1 should show the boot screen and should then boot in to your chosen operaing system. Voila!

Fig.5. Working Zet system using ALTERA DE1 board