Platform Developer s Kit RC host library and FTU3 manual RC host library and FTU3 manual Celoxica the Celoxica logo and Handel C are trademarks of Celoxica Limited All other products or services mentioned herein may be trademarks of their respective owners Neither the whole nor any part of the information contained in or the product described in this document may be adapted or reproduced in any material form except with the prior written permission of the copyright holder The product described in this document is subject to continuous development and improvement All particulars of the product and its use contained in this document are given by Celoxica Limited in good faith However all warranties implied or express including but not limited to implied warranties of merchantability or fitness for purpose are excluded This document is intended only to assist the reader in the use of the product Celoxica Limited shall not be liable for any loss or damage arising from the use of any information in this document or any incorrect use of the product The information contained herein is subject to change without notice and is for general guidance only Copyright 2005 Celoxica Limited All rights reserved Authors RG Document number 1 Customer Support at http www celoxica com support Celoxica in Europe Celoxica in Japan Celoxica in the Americas T 44 0 1235 863 656 T 81 0 45 331 0218 T 1 800 570 7004 E sales emea celoxica com E sales japan celoxica com E sales america celoxica com www celoxica com RC host library and FTU3 manual Contents 1 RC OVERVIEW 5 2 RC LIB ERROR HANDLING 2 1 STATUS CODES 2 2 SETTING AUTOMATIC ERROR HANDLERS 2 3 CONVERTING STATUS CODES TO STRINGS 6 6 7 8 HOST LIBRARY AND 3 RC LIB FPGA FTU3 IMAGE HANDLING 10 4 RC LIB OPENING AND CLOSING BOARDS 11 5 RC LIB FETCHING BOARD INFORMATION 12 5 1 BOARD TYPES 12 6 RC LIB BOARD MONITORING 13 7 RC LIB SETTING TIMEOUTS 14 8 RC LIB CLOCKS 15 8 1 CLOCK TYPES 16 9 RC LIB CONFIGURABLE DEVICES 9 1 FETCHING DEVICE INFORMATION 9 2 CONFIGURABLE DEVICE TYPES 9 3 CONFIGURING THE DEVICES 17 17 18 18 10 RC LIB COMMUNICATING OVER USB 20 11 RC LIB REGISTER MAP 21 12 RC LIB ACCESSING RAM 22 12 1 QUERYING THE RAM 22 12 2 READING AND WRITING THE RAM 23 13 RC LIB FLASH ACCESS 13 1 IDENTIFYING THE FLASH TYPE 13 2 INDEX BASED FLASH DIRECTORY ACCESS 13 3 INDEX BASED FLASH FILE ACCESS 13 4 FILENAME BASED FLASH DIRECTORY ACCESS 13 5 FILENAME BASED FLASH FILE ACCESS 13 6 BLOCK BASED FLASH ACCESS www celoxica com Page 1 25 25 25 26 28 28 29 RC host library and FTU3 manual 14 RC LIB USAGE EXAMPLE 31 15 FILE TRANSFER UTILITY FTU3 15 1 FTU3 CONFIGURING THE FPGA 15 2 FTU3 SETTING THE CLOCKS 15 3 FTU3 ACCESSING THE FLASH RAM 15 4 FTU3 ACCESSING THE SRAM 32 33 34 36 37 16 38 RCX COMMAND LINE UTILITY 17 INDEX 41 www celoxica com Page 2 RC host library and FTU3 manual Conventions A number of conventions are used in this document These conventions are detailed below Warning Message These messages warn you that actions may damage your hardware Handy Note These messages draw your attention to crucial pieces of information Hexadecimal numbers will appear throughout this document The convention used is that of prefixing the number with 0x in common with standard C syntax Sections of code or commands that you must type are given in typewriter font like this void main Information about a type of object you must specify is given in italics like this copy SourceFileName DestinationFileName Optional elements are enclosed in square brackets like this struct type Name Curly brackets around an element show that it is optional but it may be repeated any number of times string character www celoxica com RC host library and FTU3 manual Assumptions Omissions This manual assumes that you have used Handel C or have the Handel C Language Reference Manual are familiar with common programming terms e g functions are familiar with MS Windows This manual does not include instruction in VHDL or Verilog instruction in the use of place and route tools tutorial example programs These are provided in the Handel C User Manual www celoxica com RC host library and FTU3 manual 1 RC host library and FTU3 overview RC Host Library The RC Host Library allows you to communicate with a Celoxica RC board from a host computer via the USB interface This includes configuring the FPGA and programmable clocks communicating directly with a program in the FPGA and accessing on board DRAM SRAM and Flash RAM The topics covered include Error Handling see page 6 FPGA image handling see page 10 Opening and closing boards see page 11 Fetching board information see page 12 Board monitoring see page 13 Setting timeouts see page 14 Clocks see page 15 Configurable devices see page 17 Communicating over USB see page 20 Register Map see page 21 Accessing RAM see page 22 Flash access see page 25 Usage Example see page 31 FTU3 The File Transfer Utility FTU3 provides a GUI for configuring the FPGA programming the variable clocks reading and writing the Flash and accessing the RAM when no application is running in the FPGA FTU3 can be started from Start Programs Celoxica Platform Developer s Kit FTU3 program Configuring the FPGA see page 33 Setting the clocks see page 34 Accessing the flash see page 36 Accessing the SRAM see page 37 rcx command line utility In addition to the FTU3 there is also a command line utility which can be used to access the RC boards rcx command line utility see page 38 www celoxica com Page 5 RC host library and FTU3 manual 2 RC Lib Error Handling All host API calls provide a status code return value which can be automatically caught by installing an error handler In addition these codes can be turned into strings for logging purposes 2 1 Status codes typedef enum RCStatus Description The type of error codes returned by RC API functions The error codes are as follows error code meaning RC OK The function completed successfully RC NULL POINTER A NULL pointer was passed as an argument where a valid pointer was required RC INVALID BOARD The Board argument was invalid RC INVALID VOLTAGE The Voltage argument was invalid RC INVALID TEMPERATURE The Temperature argument was invalid RC INVALID IMAGE The Image argument was invaild RC INVALID DEVICE The Device argument was invalid RC INVALID FLASH The Flash argument was invalid RC INVALID FLASH TYPE The flash is of the wrong type for the operation RC INVALID FLASH INDEX The Index argument was invalid RC INVALID FLASH FILENAME The Filename argument was invalid RC
View Full Document