User manual
PAL tutorial
1 PAL tutorial
The PAL tutorial shows an experienced Handel-C programmer how to implement platform-independent
hardware using the Handel-C language, DK and the PAL API.
The application implemented in the tutorial is a simple program that displays a square bouncing around
the screen.
The tutorial workspace can be accessed from the
Start menu, by default it is under Celoxica>Platform
Developer’s Kit
>PAL>PAL Tutorial Workspace.
The PAL tutorial is in three stages, with each contained in a separate project:
• Part1: Displays a simple white square.
• Part2: Introduces some user input control of the colour and square movement
• Part3: Adds a simple frame buffer.
All the interfacing to external logic is done using PAL. The source code contains comments describing
the program.
To compile the tutorial for yourself, you need DK.
If you want to run the tutorial designs in hardware you will need a Celoxica RC100, with Xilinx place and
route tools, or an Altera Nios development board (NDB) with Altera Quartus-II place and route tools.
1.1 Running the PAL tutorial in simulation
The 3 stages of the PAL tutorial can be run in simulation using the PALSim Virtual Platform.
1. Choose Part1, Part2 or Part3 of the tutorial projects by selecting Project>Set Active Project.
2. Choose to target the "Sim" platform (
Build>Set Active Configuration).
3. Build the project by pressing F7.
4. Execute the simulation by pressing F5.
If you run Part1, you will see a white square that moves slightly every time the screen refreshes. (If you
run the same program in hardware, the square will seem to bounce around the screen, because of the
faster refresh rate.)
If you run Part2 or Part3, you will see a coloured square. If you press Button 0 on the PALSim application
with your mouse, the colour of the square changes when the screen refreshes. In Part3, a trace is left as
the ball moves across the screen. If you press Button 1 with your mouse, the ball stops moving. You can
restart it by pressing Button 1 again.
1.2 Running the PAL tutorial in hardware
If you have an RC100 you can run the 3 stages of the PAL tutorial in hardware.
1. Open the tutorial workspace.
2. Choose Part1, Part2 or Part3 of the tutorial by selecting
Project>Set Active Project.
3. Choose the RC100 target (
Build>Set Active Configuration).
4. Build the project by pressing F7.
The build files will appear in the
RC100 directory for the relevant project (e.g.
InstallDir
\Tutorials\PAL\Part3\RC100).
An EDIF file and a constraints file will be produced.
www.celoxica.com
Page 7