User manual
DSM tutorials
static macro expr FlashAddrPins =
{
"A17", "D15", "C16", "D14", "E14", "A16", "C15",
"B15", "E13", "A15", "F12", "C14", "B14", "A14", "D13",
"C13", "B13", "E12", "A13", "B12", "D12", "C12", "D11"
};
/* … */
static Flash *FlashPtr;
The API implementation for the PSL is given in the following code:
macro proc PSLFlashRun (ClockRate)
{
FlashInit (&FlashPtr, FlashAddrPins, FlashDataPins,
FlashChipEnablePins, FlashOutputEnablePin,
FlashWriteEnablePin, FlashStatusPin,
FlashByteEnablePin, FlashEraseEnablePin);
FlashRun (FlashPtr, ClockRate);
}
macro proc PSLFlashReadWord (Address, DataPtr)
{
FlashReadWord (FlashPtr, Address, DataPtr);
}
macro proc PSLFlashWriteWord (Address, Data)
{
FlashWriteWord (FlashPtr, Address, Data);
}
macro proc PSLFlashEraseBlock (BlockNumber)
{
FlashEraseBlock (FlashPtr, BlockNumber);
}
4 Tutorial: Handel-C and PSL basics
The Handel-C and PSL basics tutorial demonstrates:
• Basic use of the common Handel-C operators which are not present in C or C++.
• How to create a device driver for a Platform Support Library.
• How to make the driver portable by using the Platform Abstraction Layer.
The examples can be used with any FPGA-based board, but are shown configured for the Celoxica
RC200.
New users are recommended to work through the following topics in order:
•
Handel-C language basics (see page 45)
•
Creating a device driver (see page 53)
www.celoxica.com
Page 44