Title: Targeting Handel-C for the DE2 Board
1Targeting Handel-Cfor the DE2 Board
- Presented by
- Vincent Lai
- Supervised by
- Professor Cheung
2Aim
- Program the DE2 board in a C-based language
- A Library of drivers that support the hardware on
the DE2 board - A Manual and instructions for using the Library
3Achievements
- FPGA design framework
- Program in Handel-C
- Hardware synthesis in Quartus II
- A library targeting the DE2 system
- Drivers PS/2, RAM, VGA
- Interface with VHDL components
4Contents
- Hardware Software
- Development
- Demonstration
- Summary
Hardware Software Development
Demonstration Summary
5Hardware and Software
- Hardware
- Altera DE2 board
- Software
- Quartus II
- DK Design Suite
- Programming Language
- Handel-C
- VHDL
Hardware Software Development
Demonstration Summary
6Altera DE2 Board
- A Development board with a Cyclone II FPGA
- Memory
- Flash memory
- SRAM
- SDRAM
- VGA
- Switches
- PS/2 Mouse
- 16x2 LCD module
- 7-Segment Displays LEDs
Hardware Software Development
Demonstration Summary
7What is Handel-C?
- a C-based language
- not a hardware description language it supports
abstractions common for software programmers - Reasonably complex system can be design easily
- High level yet allow description of sequential
and parallel logic
Hardware Software Development
Demonstration Summary
8Contents
- Hardware Software
- Development
- Demonstration
- Summary
Hardware Software Development
Demonstration Summary
9Development Timeline
Hardware Software Development
Demonstration Summary
10Library Components
- Library file .hcl
- Header file .hch
- VHDL Functions Components
- PS/2 mouse
- Video Driver
- LCD module
Hardware Software Development
Demonstration Summary
11Library file .hcl
- Generated by using DK Library project
- Create a .hcc file containing macros
- Compile the project to obtain the .hcl file
- Example macro procedure
macro proc DE2SetLEDGs(mask) interface
bus_out() LEDG(mask) with
data"Y12","Y18","AA20","U17","U18","V18","W19",
"AF22","AE22"
Hardware Software Development
Demonstration Summary
12Header file .hch
- Describe the macros in the library
- Example
typedef signal unsigned 9 DE2_LEDG_MASK extern
macro proc DE2SetLEDGs(mask)
Hardware Software Development
Demonstration Summary
13Interfacing with VHDL
- Some functions are written in VHDL
- It is useful to interface with VHDL code
- Example
interface LCD_DISPLAY(unsigned 1 LCD_RS,
unsigned 1 LCD_E, unsigned 1 LCD_RW, unsigned
8 DATA_BUS) LCD(unsigned 1
re_setkey0.in, unsigned 1 clk_50Mhz
clk_in.in, unsigned 256 Hex_Display_Dataline)
with vhdl_type"std_logic_vector"
Hardware Software Development
Demonstration Summary
14Example Users Program
- in the sample code folder
set clock external "N2" include
"DE2.hch" void main(void) DE2_SW_MASK SW
do DE2SW(SW) //read inputs from
the toggle switches DE2SetLEDRs(SW) //sho
ws the status of the switches on LEDs
while(1)
Hardware Software Development
Demonstration Summary
15Designing with the Library?
Hardware Software Development
Demonstration Summary
16Difficulties
- Timing of the RAM
- Using the SRAM as a frame buffer
- 640x480 24-bit colour 921600 byte
- 640x480 16-bit colour 614400 byte
- 640x480 8-bit grayscale 307200 byte
- Storing a raw image in the 1M-byte Flash memory
Hardware Software Development
Demonstration Summary
17Results
- A library with the desired drivers
- A detailed Manual and instructions
- Sample codes
Hardware Software Development
Demonstration Summary
18Contents
- Hardware Software
- Development
- Demonstration
- Summary
Hardware Software Development
Demonstration Summary
19Contents
- Hardware Software
- Development
- Demonstration
- Summary
Hardware Software Development
Demonstration Summary
20Future Development
- Complete the development of drivers for the DE2
board - Portable between Devices
- Useful functions
- Image processing
- FIFO for the SDRAM
Hardware Software Development
Demonstration Summary
21Achievements
- FPGA design framework
- Program in Handel-C
- Hardware synthesis in Quartus II
- A library targeting the DE2 system
- Drivers PS/2, RAM, VGA
- Interface with VHDL components
Hardware Software Development
Demonstration Summary